-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Refactor] Consolidate all try/catch
for animations in a single place
#378
base: beta
Are you sure you want to change the base?
Conversation
} catch (err: unknown) { | ||
console.error(`Failed to play animation for ${spriteKey}`, err); | ||
} | ||
sprite.play(spriteKey).stop(); |
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.
Based on some playtesting, the stop()
function can still crash here. This can be fixed by also overriding stop()
to use a try-catch.
The merge of #419 means that the globalScene.add functions overrides are no longer present on beta So not sure where to go from there for this PR. Maybe keep the current solution but put it elsewhere, or try to make things a bit cleaner with our own custom sprite object. |
What are the changes the user will see?
N/A
Why am I making these changes?
To simplify development.
What are the changes from a developer perspective?
All
try/catch
statements around sprite animations are removed, and centralized into the existing replacement function insrc/ui/ui-theme.ts
. Important changes are insrc/field/pokemon.ts
andsrc/ui/ui-theme.ts
.Try/catch removed in:
src/data/mystery-encounters/encounters/global-trade-system-encounter.ts
,src/data/mystery-encounters/utils/encounter-transformation-sequence.ts
,src/phases/abstract-form-change-base-phase.ts
,src/phases/egg-hatch-phase.ts
,src/phases/evolution-phase.ts
,src/phases/form-change-phase.ts
,src/phases/quiet-form-change-phase.ts
,src/ui/summary-ui-handler.ts
.Screenshots/Videos
missing.sprite.animation.test.mp4
Checklist
beta
as my base branchnpm run test:silent
)