mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-21 17:12:44 +02:00
Move delay in formChangePhase to first element
This commit is contained in:
parent
f49c4e7a42
commit
ee7e2094e1
@ -131,11 +131,11 @@ export class FormChangePhase extends EvolutionPhase {
|
|||||||
private beginTweens(preName: string, transformedPokemon: Pokemon): void {
|
private beginTweens(preName: string, transformedPokemon: Pokemon): void {
|
||||||
globalScene.tweens.chain({
|
globalScene.tweens.chain({
|
||||||
// Starts 250ms after sprites have been configured
|
// Starts 250ms after sprites have been configured
|
||||||
delay: 250,
|
|
||||||
targets: null,
|
targets: null,
|
||||||
tweens: [
|
tweens: [
|
||||||
// Step 1: Fade in the background overlay
|
// Step 1: Fade in the background overlay
|
||||||
{
|
{
|
||||||
|
delay: 250,
|
||||||
targets: this.evolutionBgOverlay,
|
targets: this.evolutionBgOverlay,
|
||||||
alpha: 1,
|
alpha: 1,
|
||||||
duration: 1500,
|
duration: 1500,
|
||||||
|
@ -24,7 +24,7 @@ export function initGameSpeed() {
|
|||||||
|
|
||||||
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Complexity is necessary here
|
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Complexity is necessary here
|
||||||
const mutateProperties = (obj: any, allowArray = false) => {
|
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) {
|
if (obj instanceof Phaser.Tweens.Tween || obj instanceof Phaser.Tweens.TweenChain) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -42,9 +42,9 @@ export function initGameSpeed() {
|
|||||||
obj[prop] = transformValue(objProp);
|
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
|
// 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) {
|
for (const tween of obj.tweens) {
|
||||||
mutateProperties(tween);
|
mutateProperties(tween);
|
||||||
}
|
}
|
||||||
@ -83,11 +83,11 @@ export function initGameSpeed() {
|
|||||||
return originalAddCounter.apply(this, [config]);
|
return originalAddCounter.apply(this, [config]);
|
||||||
} as typeof originalAddCounter;
|
} as typeof originalAddCounter;
|
||||||
|
|
||||||
// const originalCreate: TweenManager["create"] = this.tweens.create;
|
const originalCreate: TweenManager["create"] = this.tweens.create;
|
||||||
// this.tweens.create = function (config: Phaser.Types.Tweens.TweenBuilderConfig) {
|
this.tweens.create = function (config: Phaser.Types.Tweens.TweenBuilderConfig) {
|
||||||
// mutateProperties(config, true);
|
mutateProperties(config, true);
|
||||||
// return originalCreate.apply(this, [config]);
|
return originalCreate.apply(this, [config]);
|
||||||
// } as typeof originalCreate;
|
} as typeof originalCreate;
|
||||||
|
|
||||||
const originalAddMultiple: TweenManager["addMultiple"] = this.tweens.addMultiple;
|
const originalAddMultiple: TweenManager["addMultiple"] = this.tweens.addMultiple;
|
||||||
this.tweens.addMultiple = function (config: Phaser.Types.Tweens.TweenBuilderConfig[]) {
|
this.tweens.addMultiple = function (config: Phaser.Types.Tweens.TweenBuilderConfig[]) {
|
||||||
|
Loading…
Reference in New Issue
Block a user