Compare commits

...

6 Commits

Author SHA1 Message Date
G Sai Nikhilesh
2089ebd8ea
Merge fd35a5ae1a into f6b99780fb 2025-08-15 19:31:10 +00:00
SmhMyHead
f6b99780fb
[UI/UIX] Dex unseen species filter (#5909)
* [UI/UIX] Dex unseen species filter

* Removed changes to icon visibility rules

* Update src/ui/pokedex-ui-handler.ts

---------

Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
2025-08-15 19:27:16 +00:00
G Sai Nikhilesh
fd35a5ae1a
Merge branch 'beta' into nikhilesh002/add_username_to_stats_screen 2025-08-15 21:16:05 +05:30
Wlowscha
6f369b244a
Merge branch 'beta' into nikhilesh002/add_username_to_stats_screen 2025-08-15 17:23:26 +02:00
Nikhilesh002
fd489a2ad1 [Feature] username fallback to "Guest" 2025-08-15 17:07:55 +05:30
Nikhilesh002
7f0860bcbc [Feature] Add Username to Stats Screen 2025-08-15 16:14:51 +05:30
3 changed files with 44 additions and 6 deletions

@ -1 +1 @@
Subproject commit ab2716d5440c25f73986664aa3f3131821c3c392
Subproject commit 1396c8af00894ec866eb940dd8f17e6044e34f3c

View File

@ -1,7 +1,9 @@
import { loggedInUser } from "#app/account";
import { globalScene } from "#app/global-scene";
import { speciesStarterCosts } from "#balance/starters";
import { Button } from "#enums/buttons";
import { DexAttr } from "#enums/dex-attr";
import { PlayerGender } from "#enums/player-gender";
import { TextStyle } from "#enums/text-style";
import { UiTheme } from "#enums/ui-theme";
import type { GameData } from "#system/game-data";
@ -316,7 +318,19 @@ export class GameStatsUiHandler extends UiHandler {
const headerBg = addWindow(0, 0, sWidth - 2, 24).setOrigin(0);
const headerText = addTextObject(0, 0, i18next.t("gameStatsUiHandler:stats"), TextStyle.HEADER_LABEL)
const usernameReplacement =
globalScene.gameData.gender === PlayerGender.FEMALE
? i18next.t("trainerNames:player_f")
: i18next.t("trainerNames:player_m");
const displayName = !globalScene.hideUsername ? (loggedInUser?.username ?? "Guest") : usernameReplacement;
const headerText = addTextObject(
0,
0,
`${i18next.t("gameStatsUiHandler:statsFor", { username: displayName })}`,
TextStyle.HEADER_LABEL,
)
.setOrigin(0)
.setPositionRelative(headerBg, 8, 4);

View File

@ -410,6 +410,11 @@ export class PokedexUiHandler extends MessageUiHandler {
new DropDownLabel(i18next.t("filterBar:hasHiddenAbility"), undefined, DropDownState.ON),
new DropDownLabel(i18next.t("filterBar:noHiddenAbility"), undefined, DropDownState.EXCLUDE),
];
const seenSpeciesLabels = [
new DropDownLabel(i18next.t("filterBar:seenSpecies"), undefined, DropDownState.OFF),
new DropDownLabel(i18next.t("filterBar:isSeen"), undefined, DropDownState.ON),
new DropDownLabel(i18next.t("filterBar:isUnseen"), undefined, DropDownState.EXCLUDE),
];
const eggLabels = [
new DropDownLabel(i18next.t("filterBar:egg"), undefined, DropDownState.OFF),
new DropDownLabel(i18next.t("filterBar:eggPurchasable"), undefined, DropDownState.ON),
@ -423,6 +428,7 @@ export class PokedexUiHandler extends MessageUiHandler {
new DropDownOption("FAVORITE", favoriteLabels),
new DropDownOption("WIN", winLabels),
new DropDownOption("HIDDEN_ABILITY", hiddenAbilityLabels),
new DropDownOption("SEEN_SPECIES", seenSpeciesLabels),
new DropDownOption("EGG", eggLabels),
new DropDownOption("POKERUS", pokerusLabels),
];
@ -792,13 +798,15 @@ export class PokedexUiHandler extends MessageUiHandler {
this.starterSelectMessageBoxContainer.setVisible(!!text?.length);
}
isSeen(species: PokemonSpecies, dexEntry: DexEntry): boolean {
isSeen(species: PokemonSpecies, dexEntry: DexEntry, seenFilter?: boolean): boolean {
if (dexEntry?.seenAttr) {
return true;
}
const starterDexEntry = globalScene.gameData.dexData[this.getStarterSpeciesId(species.speciesId)];
return !!starterDexEntry?.caughtAttr;
if (!seenFilter) {
const starterDexEntry = globalScene.gameData.dexData[this.getStarterSpeciesId(species.speciesId)];
return !!starterDexEntry?.caughtAttr;
}
return false;
}
/**
@ -1617,6 +1625,21 @@ export class PokedexUiHandler extends MessageUiHandler {
}
});
// Seen Filter
const dexEntry = globalScene.gameData.dexData[species.speciesId];
const isItSeen = this.isSeen(species, dexEntry, true);
const fitsSeen = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
if (misc.val === "SEEN_SPECIES" && misc.state === DropDownState.ON) {
return isItSeen;
}
if (misc.val === "SEEN_SPECIES" && misc.state === DropDownState.EXCLUDE) {
return !isItSeen;
}
if (misc.val === "SEEN_SPECIES" && misc.state === DropDownState.OFF) {
return true;
}
});
// Egg Purchasable Filter
const isEggPurchasable = this.isSameSpeciesEggAvailable(species.speciesId);
const fitsEgg = this.filterBar.getVals(DropDownColumn.MISC).some(misc => {
@ -1658,6 +1681,7 @@ export class PokedexUiHandler extends MessageUiHandler {
fitsFavorite &&
fitsWin &&
fitsHA &&
fitsSeen &&
fitsEgg &&
fitsPokerus
) {