mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-19 06:42:20 +02:00
Changing display of seen Pokémon in the dex
This commit is contained in:
parent
9fe41c8ea5
commit
68173ce969
@ -704,23 +704,23 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getMenuText(): string {
|
getMenuText(): string {
|
||||||
const isFormCaught = this.isFormCaught();
|
const isSeen = this.isSeen();
|
||||||
const isSeen = this.speciesStarterDexEntry?.seenAttr;
|
const isStarterCaught = !!this.isCaught(this.getStarterSpecies(this.species));
|
||||||
if (this.species.speciesId === Species.ODDISH) {
|
|
||||||
console.log(isFormCaught, isSeen);
|
|
||||||
}
|
|
||||||
|
|
||||||
return this.menuOptions
|
return this.menuOptions
|
||||||
.map(o => {
|
.map(o => {
|
||||||
const label = `${i18next.t(`pokedexUiHandler:${MenuOptions[o]}`)}`;
|
const label = `${i18next.t(`pokedexUiHandler:${MenuOptions[o]}`)}`;
|
||||||
const isWhite = isFormCaught || (isSeen && o === MenuOptions.BIOMES);
|
const isDark =
|
||||||
|
!isSeen ||
|
||||||
|
(!isStarterCaught && (o === MenuOptions.TOGGLE_IVS || o === MenuOptions.NATURES)) ||
|
||||||
|
(this.tmMoves.length < 1 && o === MenuOptions.TM_MOVES);
|
||||||
const color = getTextColor(
|
const color = getTextColor(
|
||||||
isWhite ? TextStyle.SETTINGS_VALUE : TextStyle.SHADOW_TEXT,
|
isDark ? TextStyle.SHADOW_TEXT : TextStyle.SETTINGS_VALUE,
|
||||||
false,
|
false,
|
||||||
globalScene.uiTheme,
|
globalScene.uiTheme,
|
||||||
);
|
);
|
||||||
const shadow = getTextColor(
|
const shadow = getTextColor(
|
||||||
isWhite ? TextStyle.SETTINGS_VALUE : TextStyle.SHADOW_TEXT,
|
isDark ? TextStyle.SHADOW_TEXT : TextStyle.SETTINGS_VALUE,
|
||||||
true,
|
true,
|
||||||
globalScene.uiTheme,
|
globalScene.uiTheme,
|
||||||
);
|
);
|
||||||
@ -924,6 +924,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
return (dexEntry?.caughtAttr ?? 0n) & (starterDexEntry?.caughtAttr ?? 0n) & species.getFullUnlocksData();
|
return (dexEntry?.caughtAttr ?? 0n) & (starterDexEntry?.caughtAttr ?? 0n) & species.getFullUnlocksData();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check whether a given form is caught for a given species.
|
* Check whether a given form is caught for a given species.
|
||||||
* All forms that can be reached through a form change during battle are considered caught and show up in the dex as such.
|
* All forms that can be reached through a form change during battle are considered caught and show up in the dex as such.
|
||||||
@ -948,6 +949,14 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
return isFormCaught;
|
return isFormCaught;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isSeen(): boolean {
|
||||||
|
if (this.speciesStarterDexEntry?.seenAttr) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
const starterCaughtAttr = this.isCaught(this.getStarterSpecies(this.species));
|
||||||
|
return !!starterCaughtAttr;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the starter attributes for the given PokemonSpecies, after sanitizing them.
|
* Get the starter attributes for the given PokemonSpecies, after sanitizing them.
|
||||||
* If somehow a preference is set for a form, variant, gender, ability or nature
|
* If somehow a preference is set for a form, variant, gender, ability or nature
|
||||||
@ -1096,6 +1105,8 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
|
|
||||||
const isCaught = this.isCaught();
|
const isCaught = this.isCaught();
|
||||||
const isFormCaught = this.isFormCaught();
|
const isFormCaught = this.isFormCaught();
|
||||||
|
const isSeen = this.isSeen();
|
||||||
|
const isStarterCaught = !!this.isCaught(this.getStarterSpecies(this.species));
|
||||||
|
|
||||||
if (this.blockInputOverlay) {
|
if (this.blockInputOverlay) {
|
||||||
if (button === Button.CANCEL || button === Button.ACTION) {
|
if (button === Button.CANCEL || button === Button.ACTION) {
|
||||||
@ -1131,7 +1142,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
if (button === Button.ACTION) {
|
if (button === Button.ACTION) {
|
||||||
switch (this.cursor) {
|
switch (this.cursor) {
|
||||||
case MenuOptions.BASE_STATS:
|
case MenuOptions.BASE_STATS:
|
||||||
if (!isCaught || !isFormCaught) {
|
if (!isSeen) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
this.blockInput = true;
|
this.blockInput = true;
|
||||||
@ -1151,7 +1162,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MenuOptions.LEVEL_MOVES:
|
case MenuOptions.LEVEL_MOVES:
|
||||||
if (!isCaught || !isFormCaught) {
|
if (!isSeen) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
this.blockInput = true;
|
this.blockInput = true;
|
||||||
@ -1209,7 +1220,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MenuOptions.EGG_MOVES:
|
case MenuOptions.EGG_MOVES:
|
||||||
if (!isCaught || !isFormCaught) {
|
if (!isSeen) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
this.blockInput = true;
|
this.blockInput = true;
|
||||||
@ -1276,7 +1287,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MenuOptions.TM_MOVES:
|
case MenuOptions.TM_MOVES:
|
||||||
if (!isCaught || !isFormCaught) {
|
if (!isSeen) {
|
||||||
error = true;
|
error = true;
|
||||||
} else if (this.tmMoves.length < 1) {
|
} else if (this.tmMoves.length < 1) {
|
||||||
ui.showText(i18next.t("pokedexUiHandler:noTmMoves"));
|
ui.showText(i18next.t("pokedexUiHandler:noTmMoves"));
|
||||||
@ -1327,7 +1338,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MenuOptions.ABILITIES:
|
case MenuOptions.ABILITIES:
|
||||||
if (!isCaught || !isFormCaught) {
|
if (!isSeen) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
this.blockInput = true;
|
this.blockInput = true;
|
||||||
@ -1415,7 +1426,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MenuOptions.BIOMES:
|
case MenuOptions.BIOMES:
|
||||||
if (!(isCaught || this.speciesStarterDexEntry?.seenAttr)) {
|
if (!isSeen) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
this.blockInput = true;
|
this.blockInput = true;
|
||||||
@ -1494,7 +1505,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MenuOptions.EVOLUTIONS:
|
case MenuOptions.EVOLUTIONS:
|
||||||
if (!isCaught || !isFormCaught) {
|
if (!isSeen) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
this.blockInput = true;
|
this.blockInput = true;
|
||||||
@ -1673,7 +1684,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MenuOptions.TOGGLE_IVS:
|
case MenuOptions.TOGGLE_IVS:
|
||||||
if (!isCaught || !isFormCaught) {
|
if (!isStarterCaught) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
this.toggleStatsMode();
|
this.toggleStatsMode();
|
||||||
@ -1683,7 +1694,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MenuOptions.NATURES:
|
case MenuOptions.NATURES:
|
||||||
if (!isCaught || !isFormCaught) {
|
if (!isStarterCaught) {
|
||||||
error = true;
|
error = true;
|
||||||
} else {
|
} else {
|
||||||
this.blockInput = true;
|
this.blockInput = true;
|
||||||
@ -2396,8 +2407,6 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (species) {
|
if (species) {
|
||||||
const dexEntry = globalScene.gameData.dexData[species.speciesId];
|
|
||||||
|
|
||||||
const caughtAttr = this.isCaught(species);
|
const caughtAttr = this.isCaught(species);
|
||||||
|
|
||||||
if (!caughtAttr) {
|
if (!caughtAttr) {
|
||||||
@ -2418,7 +2427,7 @@ export default class PokedexPageUiHandler extends MessageUiHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isFormCaught = this.isFormCaught();
|
const isFormCaught = this.isFormCaught();
|
||||||
const isFormSeen = dexEntry ? (dexEntry.seenAttr & globalScene.gameData.getFormAttr(formIndex ?? 0)) > 0n : false;
|
const isFormSeen = this.isSeen();
|
||||||
|
|
||||||
this.shinyOverlay.setVisible(shiny ?? false); // TODO: is false the correct default?
|
this.shinyOverlay.setVisible(shiny ?? false); // TODO: is false the correct default?
|
||||||
this.pokemonNumberText.setColor(this.getTextColor(shiny ? TextStyle.SUMMARY_GOLD : TextStyle.SUMMARY, false));
|
this.pokemonNumberText.setColor(this.getTextColor(shiny ? TextStyle.SUMMARY_GOLD : TextStyle.SUMMARY, false));
|
||||||
|
Loading…
Reference in New Issue
Block a user