show passive name even if it is locked or disabled

This commit is contained in:
KimJeongSun 2024-09-02 18:25:41 +09:00
parent c20f37bcf9
commit 3dac0993f4

View File

@ -32,19 +32,19 @@ import {SettingKeyboard} from "#app/system/settings/settings-keyboard";
import {Passive as PassiveAttr} from "#enums/passive";
import * as Challenge from "../data/challenge";
import MoveInfoOverlay from "./move-info-overlay";
import { getEggTierForSpecies } from "#app/data/egg.js";
import { getEggTierForSpecies } from "#app/data/egg";
import { Device } from "#enums/devices";
import { Moves } from "#enums/moves";
import { Species } from "#enums/species";
import {Button} from "#enums/buttons";
import { EggSourceType } from "#app/enums/egg-source-types.js";
import { EggSourceType } from "#app/enums/egg-source-types";
import AwaitableUiHandler from "./awaitable-ui-handler";
import { DropDown, DropDownLabel, DropDownOption, DropDownState, DropDownType, SortCriteria } from "./dropdown";
import { StarterContainer } from "./starter-container";
import { DropDownColumn, FilterBar } from "./filter-bar";
import { ScrollBar } from "./scroll-bar";
import { SelectChallengePhase } from "#app/phases/select-challenge-phase.js";
import { TitlePhase } from "#app/phases/title-phase.js";
import { SelectChallengePhase } from "#app/phases/select-challenge-phase";
import { TitlePhase } from "#app/phases/title-phase";
import { Abilities } from "#app/enums/abilities";
export type StarterSelectCallback = (starters: Starter[]) => void;
@ -3066,9 +3066,31 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
this.pokemonAbilityText.setShadowColor(this.getTextColor(!isHidden ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GOLD, true));
const passiveAttr = this.scene.gameData.starterData[species.speciesId].passiveAttr;
this.pokemonPassiveText.setText(passiveAttr & PassiveAttr.UNLOCKED ? passiveAttr & PassiveAttr.ENABLED ? allAbilities[starterPassiveAbilities[this.lastSpecies.speciesId]].name : i18next.t("starterSelectUiHandler:disabled") : i18next.t("starterSelectUiHandler:locked"));
this.pokemonPassiveText.setColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY));
this.pokemonPassiveText.setShadowColor(this.getTextColor(passiveAttr === (PassiveAttr.UNLOCKED | PassiveAttr.ENABLED) ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY, true));
const passiveAbility = allAbilities[starterPassiveAbilities[this.lastSpecies.speciesId]];
if (passiveAbility) {
const isUnlocked = passiveAttr & PassiveAttr.UNLOCKED;
const isEnabled = passiveAttr & PassiveAttr.ENABLED;
const labelStyle = isUnlocked ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY;
const textStyle = isUnlocked && isEnabled ? TextStyle.SUMMARY_ALT : TextStyle.SUMMARY_GRAY;
const labelAlpha = isUnlocked ? 1 : 0.5;
const textAlpha = isUnlocked && isEnabled ? 1 : 0.5;
this.pokemonPassiveLabelText.setVisible(true);
this.pokemonPassiveLabelText.setColor(this.getTextColor(labelStyle));
this.pokemonPassiveLabelText.setAlpha(labelAlpha);
this.pokemonPassiveLabelText.setShadowColor(this.getTextColor(labelStyle, true));
this.pokemonPassiveText.setVisible(true);
this.pokemonPassiveText.setText(passiveAbility.name);
this.pokemonPassiveText.setColor(this.getTextColor(textStyle));
this.pokemonPassiveText.setAlpha(textAlpha);
this.pokemonPassiveText.setShadowColor(this.getTextColor(textStyle, true));
} else {
this.pokemonPassiveLabelText.setVisible(false);
this.pokemonPassiveText.setVisible(false);
}
this.pokemonNatureText.setText(getNatureName(natureIndex as unknown as Nature, true, true, false, this.scene.uiTheme));