Move delay in formChangePhase to first element

This commit is contained in:
Sirz Benjie 2025-04-30 14:47:36 -05:00
parent f49c4e7a42
commit ee7e2094e1
No known key found for this signature in database
GPG Key ID: 38AC42D68CF5E138
2 changed files with 9 additions and 9 deletions

View File

@ -131,11 +131,11 @@ export class FormChangePhase extends EvolutionPhase {
private beginTweens(preName: string, transformedPokemon: Pokemon): void {
globalScene.tweens.chain({
// Starts 250ms after sprites have been configured
delay: 250,
targets: null,
tweens: [
// Step 1: Fade in the background overlay
{
delay: 250,
targets: this.evolutionBgOverlay,
alpha: 1,
duration: 1500,

View File

@ -24,7 +24,7 @@ export function initGameSpeed() {
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Complexity is necessary here
const mutateProperties = (obj: any, allowArray = false) => {
// We do not mutate Tweens or TweenChains
// We do not mutate Tweens or TweenChain objects themselves.
if (obj instanceof Phaser.Tweens.Tween || obj instanceof Phaser.Tweens.TweenChain) {
return;
}
@ -42,9 +42,9 @@ export function initGameSpeed() {
obj[prop] = transformValue(objProp);
}
}
// If the object has a 'tweens' property, then it is a tween chain
// If the object has a 'tweens' property that is an array, then it is a tween chain
// and we need to mutate its properties as well
if (obj.tweens) {
if (obj.tweens && Array.isArray(obj.tweens)) {
for (const tween of obj.tweens) {
mutateProperties(tween);
}
@ -83,11 +83,11 @@ export function initGameSpeed() {
return originalAddCounter.apply(this, [config]);
} as typeof originalAddCounter;
// const originalCreate: TweenManager["create"] = this.tweens.create;
// this.tweens.create = function (config: Phaser.Types.Tweens.TweenBuilderConfig) {
// mutateProperties(config, true);
// return originalCreate.apply(this, [config]);
// } as typeof originalCreate;
const originalCreate: TweenManager["create"] = this.tweens.create;
this.tweens.create = function (config: Phaser.Types.Tweens.TweenBuilderConfig) {
mutateProperties(config, true);
return originalCreate.apply(this, [config]);
} as typeof originalCreate;
const originalAddMultiple: TweenManager["addMultiple"] = this.tweens.addMultiple;
this.tweens.addMultiple = function (config: Phaser.Types.Tweens.TweenBuilderConfig[]) {