mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-14 12:22:19 +02:00
[Performance] [Refactor] [UI/UX] Cleanup egg gacha UI, Speed Up Machines (#5889)
* Convert egg gacha type into an object literal * Refactor egg gacha ui handler * Apply kev's suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> * Condense Object.freeze inside of gacha-type.ts --------- Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
This commit is contained in:
parent
9958e4fe13
commit
bc45869912
@ -1,5 +1,7 @@
|
|||||||
export enum GachaType {
|
export const GachaType = Object.freeze({
|
||||||
MOVE,
|
MOVE: 0,
|
||||||
LEGENDARY,
|
LEGENDARY: 1,
|
||||||
SHINY
|
SHINY: 2
|
||||||
}
|
});
|
||||||
|
|
||||||
|
export type GachaType = typeof GachaType[keyof typeof GachaType];
|
||||||
|
@ -4,7 +4,7 @@ import CacheBustedLoaderPlugin from "#app/plugins/cache-busted-loader-plugin";
|
|||||||
import { SceneBase } from "#app/scene-base";
|
import { SceneBase } from "#app/scene-base";
|
||||||
import { WindowVariant, getWindowVariantSuffix } from "#app/ui/ui-theme";
|
import { WindowVariant, getWindowVariantSuffix } from "#app/ui/ui-theme";
|
||||||
import { isMobile } from "#app/touch-controls";
|
import { isMobile } from "#app/touch-controls";
|
||||||
import { localPing, getEnumValues, hasAllLocalizedSprites, getEnumKeys } from "#app/utils/common";
|
import { localPing, getEnumValues, hasAllLocalizedSprites } from "#app/utils/common";
|
||||||
import { initPokemonPrevolutions, initPokemonStarters } from "#app/data/balance/pokemon-evolutions";
|
import { initPokemonPrevolutions, initPokemonStarters } from "#app/data/balance/pokemon-evolutions";
|
||||||
import { initBiomes } from "#app/data/balance/biomes";
|
import { initBiomes } from "#app/data/balance/biomes";
|
||||||
import { initEggMoves } from "#app/data/balance/egg-moves";
|
import { initEggMoves } from "#app/data/balance/egg-moves";
|
||||||
@ -270,7 +270,7 @@ export class LoadingScene extends SceneBase {
|
|||||||
this.loadAtlas("egg_icons", "egg");
|
this.loadAtlas("egg_icons", "egg");
|
||||||
this.loadAtlas("egg_shard", "egg");
|
this.loadAtlas("egg_shard", "egg");
|
||||||
this.loadAtlas("egg_lightrays", "egg");
|
this.loadAtlas("egg_lightrays", "egg");
|
||||||
for (const gt of getEnumKeys(GachaType)) {
|
for (const gt of Object.keys(GachaType)) {
|
||||||
const key = gt.toLowerCase();
|
const key = gt.toLowerCase();
|
||||||
this.loadImage(`gacha_${key}`, "egg");
|
this.loadImage(`gacha_${key}`, "egg");
|
||||||
this.loadAtlas(`gacha_underlay_${key}`, "egg");
|
this.loadAtlas(`gacha_underlay_${key}`, "egg");
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user