-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Refactor] Create global scene variable #4766
base: beta
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found the sound issue I think (see comment in evolution phase)
Haven't checked anything else yet. Did the ME tests pass because you skipped the ones that were failing for now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please update the "Why" section on the ff:
- why can you say its easier development?
- what does this solve?
- why is this the approach we made (ie global variable vs using something from phaser's
SceneManager
(I'm not too knowledgeable on phaser but I've seen some scene getters on docs)?
I agree that it's🍝 to slap the BattleScene
on everything but I just wanna understand this change doesn't turn out to be the same.
I sure love how impossible it is to batch apply suggestions to a large PR, thanks GitHub. |
Co-authored-by: Moka <[email protected]>
Yeah, I just wanted to get the PR up before sleeping so I could get some feedback (esp on the sound issue).
Currently to access the scene you need to awkwardly pass it around thorough various functions/etc, and if it's not already being passed to the context you're working in you have to refactor the function/etc to add a
I'm not too familiar with Phaser's tool(s) that we have access to for this, and their documentation permalinks are broken when using Google as I've just realized when trying to look it up. If you know of a better way that'd be great. I went with what seemed like the simplest method. |
Yeah I disabled them (for now) and marked them with General ME tests issue: 55d1b14#diff-b25c954eb59b69c9bdf7245abdfcb9428f37a4d2b7c68bcf2177aab1810889d8R129 SMP issue: 55d1b14#diff-6dcfc99d6f0b54ca275b4778e9f553ec1ae6cbee7698442de4731ef524409df2R16 "bug superfan" ME issue: 55d1b14#diff-dfe138746b004afe72d3f75d913fc5a5c84a9d52879f12a11afb1200c4efd3d9R386 I tested the ME issues in-game and everything worked fine, so it's a test-specific issue, I'm just not sure what's going on. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stopping for now, but this should fix the bug superfan encounter issue at least (explanation in second comment bc I keep forgetting github doesn't organize them by line)
src/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts
Outdated
Show resolved
Hide resolved
src/test/mystery-encounter/encounters/bug-type-superfan-encounter.test.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Moka <[email protected]>
Co-authored-by: Moka <[email protected]>
Take this with several grains of salt, but:
|
Huh, I tried the opposite (making sure |
Okay I think I found the issue with the |
Well whatever, the two SMPhase tests I couldn't fix weren't actually testing the thing they were supposed to be testing anyway. That just leaves the ME tests that were breaking upon reaching |
Everything is fixed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approving to bite the merge conflict bullet
If only GitHub wasn't dumb and could fix these fake merge conflicts automatically instead of needing me to do it locally. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is needed for cleaning up RNG too.
Remove missed instances of `.scene`
What are the changes the user will see?
N/A
Why am I making these changes?
Currently to access the active scene you need to awkwardly pass it around thorough various functions/etc, and if it's not already being passed to the context you're working in you have to refactor the function/etc to add a scene passaround parameter/whatever and then potentially update every instance of it throughout the code.
What are the changes from a developer perspective?
All the random
scene
function params, class fields, etc areobliteratedremoved and replaced with a single global scene variable.How to test the changes?
Play the game, run the tests.
Checklist
beta
as my base branch[ ] Have I considered writing automated tests for the issue?[ ] If I have text, did I make it translatable and add a key in the English locale file(s)?npm run test
)[ ] Are the changes visual?[ ] Have I provided screenshots/videos of the changes?