[Refactor] Cleanup filter bar (#5896)

* Cleanup filter bar

* Move DropDownColumn to its own file

---------

Co-authored-by: Amani H. <109637146+xsn34kzx@users.noreply.github.com>
This commit is contained in:
Sirz Benjie 2025-05-30 18:12:35 -05:00 committed by GitHub
parent ed0251ea90
commit 9a60cc9c71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 19 deletions

View File

@ -0,0 +1,9 @@
export enum DropDownColumn {
GEN,
TYPES,
BIOME,
CAUGHT,
UNLOCKS,
MISC,
SORT
}

View File

@ -5,16 +5,7 @@ import { addTextObject, getTextColor, TextStyle } from "./text";
import type { UiTheme } from "#enums/ui-theme"; import type { UiTheme } from "#enums/ui-theme";
import { addWindow, WindowVariant } from "./ui-theme"; import { addWindow, WindowVariant } from "./ui-theme";
import { globalScene } from "#app/global-scene"; import { globalScene } from "#app/global-scene";
import type { DropDownColumn } from "#enums/drop-down-column";
export enum DropDownColumn {
GEN,
TYPES,
BIOME,
CAUGHT,
UNLOCKS,
MISC,
SORT,
}
export class FilterBar extends Phaser.GameObjects.Container { export class FilterBar extends Phaser.GameObjects.Container {
private window: Phaser.GameObjects.NineSlice; private window: Phaser.GameObjects.NineSlice;
@ -49,13 +40,9 @@ export class FilterBar extends Phaser.GameObjects.Container {
this.cursorOffset = cursorOffset; this.cursorOffset = cursorOffset;
this.window = addWindow(0, 0, width, height, false, false, undefined, undefined, WindowVariant.THIN); this.window = addWindow(0, 0, width, height, false, false, undefined, undefined, WindowVariant.THIN);
this.add(this.window);
this.cursorObj = globalScene.add.image(1, 1, "cursor"); this.cursorObj = globalScene.add.image(1, 1, "cursor").setScale(0.5).setVisible(false).setOrigin(0);
this.cursorObj.setScale(0.5); this.add([this.window, this.cursorObj]);
this.cursorObj.setVisible(false);
this.cursorObj.setOrigin(0, 0);
this.add(this.cursorObj);
} }
/** /**

View File

@ -23,7 +23,8 @@ import type { Species } from "#enums/species";
import { Button } from "#enums/buttons"; import { Button } from "#enums/buttons";
import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType, SortCriteria } from "#app/ui/dropdown"; import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType, SortCriteria } from "#app/ui/dropdown";
import { PokedexMonContainer } from "#app/ui/pokedex-mon-container"; import { PokedexMonContainer } from "#app/ui/pokedex-mon-container";
import { DropDownColumn, FilterBar } from "#app/ui/filter-bar"; import { FilterBar } from "#app/ui/filter-bar";
import { DropDownColumn } from "#enums/drop-down-column";
import { ScrollBar } from "#app/ui/scroll-bar"; import { ScrollBar } from "#app/ui/scroll-bar";
import { Abilities } from "#enums/abilities"; import { Abilities } from "#enums/abilities";
import { import {

View File

@ -53,7 +53,8 @@ import { Button } from "#enums/buttons";
import { EggSourceType } from "#enums/egg-source-types"; import { EggSourceType } from "#enums/egg-source-types";
import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType, SortCriteria } from "#app/ui/dropdown"; import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType, SortCriteria } from "#app/ui/dropdown";
import { StarterContainer } from "#app/ui/starter-container"; import { StarterContainer } from "#app/ui/starter-container";
import { DropDownColumn, FilterBar } from "#app/ui/filter-bar"; import { FilterBar } from "#app/ui/filter-bar";
import { DropDownColumn } from "#enums/drop-down-column";
import { ScrollBar } from "#app/ui/scroll-bar"; import { ScrollBar } from "#app/ui/scroll-bar";
import { SelectChallengePhase } from "#app/phases/select-challenge-phase"; import { SelectChallengePhase } from "#app/phases/select-challenge-phase";
import { EncounterPhase } from "#app/phases/encounter-phase"; import { EncounterPhase } from "#app/phases/encounter-phase";

View File

@ -8,7 +8,7 @@ import { Abilities } from "#enums/abilities";
import { Species } from "#enums/species"; import { Species } from "#enums/species";
import { allSpecies, getPokemonSpecies, type PokemonForm } from "#app/data/pokemon-species"; import { allSpecies, getPokemonSpecies, type PokemonForm } from "#app/data/pokemon-species";
import { Button } from "#enums/buttons"; import { Button } from "#enums/buttons";
import { DropDownColumn } from "#app/ui/filter-bar"; import { DropDownColumn } from "#enums/drop-down-column";
import type PokemonSpecies from "#app/data/pokemon-species"; import type PokemonSpecies from "#app/data/pokemon-species";
import { PokemonType } from "#enums/pokemon-type"; import { PokemonType } from "#enums/pokemon-type";
import { UiMode } from "#enums/ui-mode"; import { UiMode } from "#enums/ui-mode";