Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump phaser justatin555 #3087

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-to-hast": "^13.0.0",
"normalize.css": "^8.0.1",
"phaser": "^3.55.2",
"phaser": "^3.87.0",
"query-string": "^9.0.0",
"re-resizable": "^6.9.9",
"react": "^18.3.1",
Expand Down Expand Up @@ -100,6 +100,7 @@
"yareco": "^0.1.5"
},
"devDependencies": {
"//": "See: https://github.com/facebook/react/issues/28313#issuecomment-2076798972, https://github.com/t3-oss/create-t3-turbo/issues/984#issuecomment-2076413457",
"@babel/core": "^7.24.5",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@babel/preset-typescript": "^7.24.1",
Expand Down Expand Up @@ -138,15 +139,16 @@
"cross-env": "^7.0.3",
"eslint": "^9.9.0",
"eslint-plugin-react": "^7.35.0",
"//": "See: https://github.com/facebook/react/issues/28313#issuecomment-2076798972, https://github.com/t3-oss/create-t3-turbo/issues/984#issuecomment-2076413457",
"eslint-plugin-react-hooks": "5.1.0-canary-cb151849e1-20240424",
"eslint-plugin-react-refresh": "^0.4.9",
"eslint-plugin-simple-import-sort": "^12.1.1",
"https-browserify": "^1.0.0",
"husky": "^9.0.0",
"npm-run-all2": "^7.0.0",
"os-browserify": "^0.3.0",
"path": "^0.12.7",
"path-browserify": "^1.0.1",
"phaser3spectorjs": "^0.0.8",
"prettier": "^3.3.3",
"process": "^0.11.10",
"react-error-overlay": "^6.0.11",
Expand Down Expand Up @@ -177,5 +179,6 @@
"last 1 firefox version",
"last 1 safari version"
]
}
},
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
6 changes: 3 additions & 3 deletions src/features/game/input/GameInputManager.ts
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't do this, ! should only be used if you are absolutely sure it exists, so the comments are redundant.

Instead, either justify in the comments why you are absolutely sure it exists, or trust TS and use a guard (refer to what I had wrote last time in https://github.com/source-academy/frontend/pull/2940/files#diff-ab85a8652b937231da028317f53a4b2413b3833e76a7bb077c41c1011b9f47fe)

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class GameInputManager {
* @param active if true, mouse input is enabled. Else, mouse input is disabled.
*/
public enableMouseInput(active: boolean) {
this.scene.input.mouse.enabled = active;
this.scene.input.mouse!.enabled = active; // ! to convince typescript Mouse Manager exists
}

/**
Expand All @@ -41,7 +41,7 @@ class GameInputManager {
* @param active if true, keyboard input is enabled. Else, keyboard input is disabled.
*/
public enableKeyboardInput(active: boolean) {
this.scene.input.keyboard.enabled = active;
this.scene.input.keyboard!.enabled = active; // ! to convince typescript Keyboard Plugin exists
}

/**
Expand All @@ -57,7 +57,7 @@ class GameInputManager {
event: string | symbol,
callback: Function
) {
const keyObj = this.scene.input.keyboard.addKey(key);
const keyObj = this.scene.input.keyboard!.addKey(key); // ! to convince typescript Keyboard Plugin exists
const keyboardListener = keyObj.addListener(event, callback);
this.keyboardListeners.push(keyboardListener);
}
Expand Down
23 changes: 16 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6619,11 +6619,16 @@ event-emitter-es6@^1.1.5:
resolved "https://registry.yarnpkg.com/event-emitter-es6/-/event-emitter-es6-1.1.5.tgz#ef95311b2e17aa39be763b031ce4af7ee9cb7849"
integrity sha512-/n7qzkJBySdbe1W9/FBDdO7gzDIaewgj+Rj6Ayc2BdvVcaGP+p40DyViOFudCgV47UU8+cUFmcD3tJgjwY65qQ==

eventemitter3@^4.0.0, eventemitter3@^4.0.1, eventemitter3@^4.0.7:
eventemitter3@^4.0.0, eventemitter3@^4.0.1:
version "4.0.7"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-4.0.7.tgz#2de9b68f6528d5644ef5c59526a1b4a07306169f"
integrity sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==

eventemitter3@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-5.0.1.tgz#53f5ffd0a492ac800721bb42c66b841de96423c4"
integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==

events@^3.2.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400"
Expand Down Expand Up @@ -10406,13 +10411,17 @@ performance-now@^2.1.0:
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b"
integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==

phaser@^3.55.2:
version "3.55.2"
resolved "https://registry.yarnpkg.com/phaser/-/phaser-3.55.2.tgz#c1e2e9e70de7085502885e06f46b7eb4bd95e29a"
integrity sha512-amKXsbb2Ht29dGPKvt1edq3yGGYKtq8373GpJYGKPNPnneYY6MtVTOgjHDuZwtmUyK4v86FugkT3hzW/N4tjxQ==
phaser3spectorjs@^0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/phaser3spectorjs/-/phaser3spectorjs-0.0.8.tgz#a7996eebc9c498b6d9d19ecda35f16ad3918a8a8"
integrity sha512-0dSO7/aMjEUPrp5EcjRvRRsEf+jXDbmzalPeJ6VtTB2Pn1PeaKc+qlL/DmO3l1Dvc5lkzc+Sil1Ta+Hkyi5cbA==

phaser@^3.87.0:
version "3.87.0"
resolved "https://registry.yarnpkg.com/phaser/-/phaser-3.87.0.tgz#209f1673b311a3f76d59f14b785699709a8f9cf5"
integrity sha512-AyI1b3T5fp05gzf6WUmu2FNqaZL+Y7w88yBRLf7YZXF9bncUSHpnDrupnTGoPqy/RKHRLBcay7zWeqQ2wiMWcw==
dependencies:
eventemitter3 "^4.0.7"
path "^0.12.7"
eventemitter3 "^5.0.1"

picocolors@^0.2.1:
version "0.2.1"
Expand Down