From 5785a60af1185c64724fba8662320ad7724df3fc Mon Sep 17 00:00:00 2001 From: OriShalhon Date: Fri, 3 Jan 2025 21:25:41 +0100 Subject: [PATCH] move random selection behavior to seperate label --- public/locales | 2 +- src/configs/inputs/cfg_keyboard_qwerty.ts | 4 +- src/enums/buttons.ts | 3 +- src/system/settings/settings-keyboard.ts | 8 - src/ui-inputs.ts | 2 - src/ui/starter-select-ui-handler.ts | 224 ++++++++++++---------- 6 files changed, 129 insertions(+), 114 deletions(-) diff --git a/public/locales b/public/locales index 6c6f0af398a..9e563308054 160000 --- a/public/locales +++ b/public/locales @@ -1 +1 @@ -Subproject commit 6c6f0af398ae11f8d96c6ac064f171d927812c85 +Subproject commit 9e563308054c6cd48d4a9e05b8529148db16ff99 diff --git a/src/configs/inputs/cfg_keyboard_qwerty.ts b/src/configs/inputs/cfg_keyboard_qwerty.ts index e14923c59f1..5ddc12e8784 100644 --- a/src/configs/inputs/cfg_keyboard_qwerty.ts +++ b/src/configs/inputs/cfg_keyboard_qwerty.ts @@ -183,7 +183,6 @@ const cfg_keyboard_qwerty = { [SettingKeyboard.Button_Cycle_Variant]: Button.V, [SettingKeyboard.Button_Speed_Up]: Button.SPEED_UP, [SettingKeyboard.Button_Slow_Down]: Button.SLOW_DOWN, - [SettingKeyboard.Button_Randomize]: Button.RANDOMIZE, [SettingKeyboard.Alt_Button_Up]: Button.UP, [SettingKeyboard.Alt_Button_Down]: Button.DOWN, [SettingKeyboard.Alt_Button_Left]: Button.LEFT, @@ -201,7 +200,6 @@ const cfg_keyboard_qwerty = { [SettingKeyboard.Alt_Button_Cycle_Variant]: Button.V, [SettingKeyboard.Alt_Button_Speed_Up]: Button.SPEED_UP, [SettingKeyboard.Alt_Button_Slow_Down]: Button.SLOW_DOWN, - [SettingKeyboard.Alt_Button_Randomize]: Button.RANDOMIZE }, default: { KEY_ARROW_UP: SettingKeyboard.Button_Up, @@ -232,7 +230,7 @@ const cfg_keyboard_qwerty = { KEY_M: SettingKeyboard.Alt_Button_Menu, KEY_O: -1, KEY_P: -1, - KEY_Q: SettingKeyboard.Button_Randomize, + KEY_Q: -1, KEY_S: SettingKeyboard.Alt_Button_Down, KEY_T: SettingKeyboard.Alt_Button_Cycle_Form, KEY_U: -1, diff --git a/src/enums/buttons.ts b/src/enums/buttons.ts index 28287ec156e..fe26023f8e7 100644 --- a/src/enums/buttons.ts +++ b/src/enums/buttons.ts @@ -15,6 +15,5 @@ export enum Button { CYCLE_NATURE, V, SPEED_UP, - SLOW_DOWN, - RANDOMIZE, + SLOW_DOWN } diff --git a/src/system/settings/settings-keyboard.ts b/src/system/settings/settings-keyboard.ts index 172132cf856..97990f61c86 100644 --- a/src/system/settings/settings-keyboard.ts +++ b/src/system/settings/settings-keyboard.ts @@ -34,8 +34,6 @@ export enum SettingKeyboard { Alt_Button_Cycle_Nature = "ALT_BUTTON_CYCLE_NATURE", Button_Cycle_Variant = "BUTTON_CYCLE_VARIANT", Alt_Button_Cycle_Variant = "ALT_BUTTON_CYCLE_VARIANT", - Button_Randomize = "BUTTON_RANDOMIZE", - Alt_Button_Randomize = "ALT_BUTTON_RANDOMIZE", Button_Speed_Up = "BUTTON_SPEED_UP", Alt_Button_Speed_Up = "ALT_BUTTON_SPEED_UP", Button_Slow_Down = "BUTTON_SLOW_DOWN", @@ -77,8 +75,6 @@ export const settingKeyboardOptions = { [SettingKeyboard.Alt_Button_Cycle_Nature]: [ `KEY ${Button.CYCLE_NATURE.toString()}`, pressAction ], [SettingKeyboard.Button_Cycle_Variant]: [ `KEY ${Button.V.toString()}`, pressAction ], [SettingKeyboard.Alt_Button_Cycle_Variant]: [ `KEY ${Button.V.toString()}`, pressAction ], - [SettingKeyboard.Button_Randomize]: [ `KEY ${Button.RANDOMIZE.toString()}`, pressAction ], - [SettingKeyboard.Alt_Button_Randomize]: [ `KEY ${Button.RANDOMIZE.toString()}`, pressAction ], [SettingKeyboard.Button_Speed_Up]: [ `KEY ${Button.SPEED_UP.toString()}`, pressAction ], [SettingKeyboard.Alt_Button_Speed_Up]: [ `KEY ${Button.SPEED_UP.toString()}`, pressAction ], [SettingKeyboard.Button_Slow_Down]: [ `KEY ${Button.SLOW_DOWN.toString()}`, pressAction ], @@ -118,8 +114,6 @@ export const settingKeyboardDefaults = { [SettingKeyboard.Alt_Button_Cycle_Nature]: 0, [SettingKeyboard.Button_Cycle_Variant]: 0, [SettingKeyboard.Alt_Button_Cycle_Variant]: 0, - [SettingKeyboard.Button_Randomize]: 0, - [SettingKeyboard.Alt_Button_Randomize]: 0, [SettingKeyboard.Button_Speed_Up]: 0, [SettingKeyboard.Alt_Button_Speed_Up]: 0, [SettingKeyboard.Button_Slow_Down]: 0, @@ -155,7 +149,6 @@ export function setSettingKeyboard(scene: BattleScene, setting: SettingKeyboard, case SettingKeyboard.Button_Cycle_Ability: case SettingKeyboard.Button_Cycle_Nature: case SettingKeyboard.Button_Cycle_Variant: - case SettingKeyboard.Button_Randomize: case SettingKeyboard.Button_Speed_Up: case SettingKeyboard.Button_Slow_Down: case SettingKeyboard.Alt_Button_Up: @@ -172,7 +165,6 @@ export function setSettingKeyboard(scene: BattleScene, setting: SettingKeyboard, case SettingKeyboard.Alt_Button_Cycle_Ability: case SettingKeyboard.Alt_Button_Cycle_Nature: case SettingKeyboard.Alt_Button_Cycle_Variant: - case SettingKeyboard.Alt_Button_Randomize: case SettingKeyboard.Alt_Button_Speed_Up: case SettingKeyboard.Alt_Button_Slow_Down: case SettingKeyboard.Alt_Button_Submit: diff --git a/src/ui-inputs.ts b/src/ui-inputs.ts index 3c6ca780715..92b1653df3d 100644 --- a/src/ui-inputs.ts +++ b/src/ui-inputs.ts @@ -79,7 +79,6 @@ export class UiInputs { [Button.SUBMIT]: () => this.buttonTouch(), [Button.ACTION]: () => this.buttonAb(Button.ACTION), [Button.CANCEL]: () => this.buttonAb(Button.CANCEL), - [Button.RANDOMIZE]: () => this.buttonAb(Button.RANDOMIZE), [Button.MENU]: () => this.buttonMenu(), [Button.STATS]: () => this.buttonGoToFilter(Button.STATS), [Button.CYCLE_SHINY]: () => this.buttonCycleOption(Button.CYCLE_SHINY), @@ -111,7 +110,6 @@ export class UiInputs { [Button.CYCLE_ABILITY]: () => undefined, [Button.CYCLE_NATURE]: () => undefined, [Button.V]: () => this.buttonInfo(false), - [Button.RANDOMIZE]: () => undefined, [Button.SPEED_UP]: () => undefined, [Button.SLOW_DOWN]: () => undefined, }; diff --git a/src/ui/starter-select-ui-handler.ts b/src/ui/starter-select-ui-handler.ts index 1da8c635e5e..9728f6c23e4 100644 --- a/src/ui/starter-select-ui-handler.ts +++ b/src/ui/starter-select-ui-handler.ts @@ -130,9 +130,10 @@ const valueReductionMax = 2; const filterBarHeight = 17; const speciesContainerX = 109; // if team on the RIGHT: 109 / if on the LEFT: 143 const teamWindowX = 285; // if team on the RIGHT: 285 / if on the LEFT: 109 -const teamWindowY = 18; +const teamWindowY = 38; const teamWindowWidth = 34; -const teamWindowHeight = 132; +const teamWindowHeight = 107; +const randomSelectionWindowHeight = 20; /** * Calculates the starter position for a Pokemon of a given UI index @@ -267,7 +268,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler { private natureIconElement: Phaser.GameObjects.Sprite; private variantIconElement: Phaser.GameObjects.Sprite; private goFilterIconElement: Phaser.GameObjects.Sprite; - private randomSelectIconElement: Phaser.GameObjects.Sprite; private shinyLabel: Phaser.GameObjects.Text; private formLabel: Phaser.GameObjects.Text; private genderLabel: Phaser.GameObjects.Text; @@ -275,7 +275,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler { private natureLabel: Phaser.GameObjects.Text; private variantLabel: Phaser.GameObjects.Text; private goFilterLabel: Phaser.GameObjects.Text; - private randomSelectLabel: Phaser.GameObjects.Text; private starterSelectMessageBox: Phaser.GameObjects.NineSlice; private starterSelectMessageBoxContainer: Phaser.GameObjects.Container; @@ -320,6 +319,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { private starterIconsCursorObj: Phaser.GameObjects.Image; private valueLimitLabel: Phaser.GameObjects.Text; private startCursorObj: Phaser.GameObjects.NineSlice; + private randomCursorObj: Phaser.GameObjects.NineSlice; private iconAnimHandler: PokemonIconAnimHandler; @@ -368,8 +368,9 @@ export default class StarterSelectUiHandler extends MessageUiHandler { starterContainerBg.setOrigin(0, 0); this.starterSelectContainer.add(starterContainerBg); - this.starterSelectContainer.add(addWindow(this.scene, teamWindowX, teamWindowY, teamWindowWidth, teamWindowHeight)); - this.starterSelectContainer.add(addWindow(this.scene, teamWindowX, teamWindowY + teamWindowHeight - 5, teamWindowWidth, teamWindowWidth, true)); + this.starterSelectContainer.add(addWindow(this.scene, teamWindowX, teamWindowY - randomSelectionWindowHeight, teamWindowWidth, randomSelectionWindowHeight, true)); + this.starterSelectContainer.add(addWindow(this.scene, teamWindowX, teamWindowY, teamWindowWidth, teamWindowHeight )); + this.starterSelectContainer.add(addWindow(this.scene, teamWindowX, teamWindowY + teamWindowHeight, teamWindowWidth, teamWindowWidth, true)); this.starterSelectContainer.add(starterContainerWindow); // Create and initialise filter bar @@ -607,6 +608,15 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.startCursorObj.setOrigin(0, 0); this.starterSelectContainer.add(this.startCursorObj); + const randomSelectLabel = addTextObject(this.scene, teamWindowX + 17, 23, i18next.t("starterSelectUiHandler:randomize"), TextStyle.TOOLTIP_CONTENT); + randomSelectLabel.setOrigin(0.5, 0); + this.starterSelectContainer.add(randomSelectLabel); + + this.randomCursorObj = this.scene.add.nineslice(teamWindowX + 4, 21, "select_cursor", undefined, 26, 15, 6, 6, 6, 6); + this.randomCursorObj.setVisible(false); + this.randomCursorObj.setOrigin(0, 0); + this.starterSelectContainer.add(this.randomCursorObj); + const starterSpecies: Species[] = []; const starterBoxContainer = this.scene.add.container(speciesContainerX + 6, 9); //115 @@ -865,13 +875,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.goFilterLabel = addTextObject(this.scene, this.filterInstructionRowX + this.instructionRowTextOffset, this.filterInstructionRowY, i18next.t("starterSelectUiHandler:goFilter"), TextStyle.PARTY, { fontSize: instructionTextSize }); this.goFilterLabel.setName("text-goFilter-label"); - this.randomSelectIconElement = new Phaser.GameObjects.Sprite(this.scene, this.instructionRowX, this.instructionRowY, "keyboard", "Q.png"); - this.randomSelectIconElement.setName("sprite-random-icon-element"); - this.randomSelectIconElement.setScale(0.675); - this.randomSelectIconElement.setOrigin(0.0, 0.0); - this.randomSelectLabel = addTextObject(this.scene, this.instructionRowX + this.instructionRowTextOffset, this.instructionRowY, i18next.t("starterSelectUiHandler:randomize"), TextStyle.PARTY, { fontSize: instructionTextSize }); - this.randomSelectLabel.setName("text-random-label"); - this.hideInstructions(); this.filterInstructionsContainer = this.scene.add.container(50, 5); @@ -1346,9 +1349,9 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.starterIconsCursorIndex = this.starterSpecies.length - 1; this.moveStarterIconsCursor(this.starterIconsCursorIndex); } else { + //TODO how can we get here if start button can't be selected? this is reduantant shoudld i renmove this? this.startCursorObj.setVisible(false); - this.filterBarCursor = Math.max(1, this.filterBar.numFilters - 1); - this.setFilterMode(true); + this.randomCursorObj.setVisible(true); } success = true; break; @@ -1395,14 +1398,20 @@ export default class StarterSelectUiHandler extends MessageUiHandler { case Button.UP: if (this.filterBar.openDropDown) { success = this.filterBar.decDropDownCursor(); - } else if (this.filterBarCursor === this.filterBar.numFilters - 1 && this.starterSpecies.length > 0) { + } else if (this.filterBarCursor === this.filterBar.numFilters - 1 ) { // UP from the last filter, move to start button - this.setFilterMode(false); - this.cursorObj.setVisible(false); - this.startCursorObj.setVisible(true); + if (this.starterSpecies.length > 0) { + this.setFilterMode(false); + this.cursorObj.setVisible(false); + this.startCursorObj.setVisible(true); + } else { + this.setFilterMode(false); + this.cursorObj.setVisible(false); + this.randomCursorObj.setVisible(true); + } success = true; } else if (numberOfStarters > 0) { - // UP from filter bar to bottom of Pokemon list + // UP from filter bar to bottom of Pokemon list this.setFilterMode(false); this.scrollCursor = Math.max(0, numOfRows - 9); this.updateScroll(); @@ -1419,12 +1428,11 @@ export default class StarterSelectUiHandler extends MessageUiHandler { case Button.DOWN: if (this.filterBar.openDropDown) { success = this.filterBar.incDropDownCursor(); - } else if (this.filterBarCursor === this.filterBar.numFilters - 1 && this.starterSpecies.length > 0) { - // DOWN from the last filter, move to Pokemon in party if any + } else if (this.filterBarCursor === this.filterBar.numFilters - 1) { + // DOWN from the last filter, move to random selection label this.setFilterMode(false); this.cursorObj.setVisible(false); - this.starterIconsCursorIndex = 0; - this.moveStarterIconsCursor(this.starterIconsCursorIndex); + this.randomCursorObj.setVisible(true); success = true; } else if (numberOfStarters > 0) { // DOWN from filter bar to top of Pokemon list @@ -1446,77 +1454,98 @@ export default class StarterSelectUiHandler extends MessageUiHandler { success = true; break; } - } else if (button === Button.RANDOMIZE) { - console.log("Attempting random selection from visible starters"); - if (this.starterSpecies.length < 6) { - // Get current party value - const currentPartyValue = this.starterSpecies - .map(s => s.generation) - .reduce((total: number, gen: number, i: number) => - total += this.scene.gameData.getSpeciesStarterValue(this.starterSpecies[i].speciesId), 0); - // Filter valid starters first - const validStarters = this.filteredStarterContainers.filter(starter => { - const species = starter.species; - const [ isDupe ] = this.isInParty(species); - const starterCost = this.scene.gameData.getSpeciesStarterValue(species.speciesId); - const isValidForChallenge = new BooleanHolder(true); - Challenge.applyChallenges( - this.scene.gameMode, - Challenge.ChallengeType.STARTER_CHOICE, - species, - isValidForChallenge, - this.scene.gameData.getSpeciesDexAttrProps( + } else if (this.randomCursorObj.visible) { + switch (button) { + case Button.ACTION: + if (this.starterSpecies.length >= 6) { + error = true; + break; + } + const currentPartyValue = this.starterSpecies.map(s => s.generation).reduce((total: number, _gen : number, i : number ) => total + this.scene.gameData.getSpeciesStarterValue(this.starterSpecies[i].speciesId), 0); + // Filter valid starters + const validStarters = this.filteredStarterContainers.filter(starter => { + const species = starter.species; + const [ isDupe ] = this.isInParty(species); + const starterCost = this.scene.gameData.getSpeciesStarterValue(species.speciesId); + const isValidForChallenge = new BooleanHolder(true); + Challenge.applyChallenges( + this.scene.gameMode, + Challenge.ChallengeType.STARTER_CHOICE, species, - this.getCurrentDexProps(species.speciesId) - ), - this.isPartyValid() - ); - const isCaught = this.scene.gameData.dexData[species.speciesId].caughtAttr; - return !isDupe && - isValidForChallenge.value && - (currentPartyValue + starterCost <= this.getValueLimit()) && - isCaught; - }); - - if (validStarters.length > 0) { - // Select random starter from valid options - const randomIndex = Math.floor(Math.random() * validStarters.length); - const randomStarter = validStarters[randomIndex]; + isValidForChallenge, + this.scene.gameData.getSpeciesDexAttrProps( + species, + this.getCurrentDexProps(species.speciesId) + ), + this.isPartyValid() + ); + const isCaught = this.scene.gameData.dexData[species.speciesId].caughtAttr; + return ( + !isDupe && + isValidForChallenge.value && + currentPartyValue + starterCost <= this.getValueLimit() && + isCaught + ); + }); + if (validStarters.length === 0) { + error = true; // No valid starters available + break; + } + // Select random starter + const randomStarter = validStarters[Math.floor(Math.random() * validStarters.length)]; const randomSpecies = randomStarter.species; - - // First set the species to load saved preferences and initialize default values - // This triggers the same flow as if the player had moved their cursor to this Pokemon + // Set species and prepare attributes this.setSpecies(randomSpecies); - - // Get the dex attributes after setSpecies has potentially loaded saved preferences const dexAttr = this.getCurrentDexProps(randomSpecies.speciesId); const props = this.scene.gameData.getSpeciesDexAttrProps(randomSpecies, dexAttr); - - // Use the current cursor values which now reflect any saved preferences - // these are the same values the player would see in the UI const abilityIndex = this.abilityCursor; const nature = this.natureCursor as unknown as Nature; const moveset = this.starterMoveset?.slice(0) as StarterMoveset; - const starterCost = this.scene.gameData.getSpeciesStarterValue(randomSpecies.speciesId); - const speciesForm = getPokemonSpeciesForm(randomSpecies.speciesId, props.formIndex); - speciesForm.loadAssets(this.scene, props.female, props.formIndex, props.shiny, props.variant, true) + // Load assets and add to party + speciesForm + .loadAssets(this.scene, props.female, props.formIndex, props.shiny, props.variant, true) .then(() => { if (this.tryUpdateValue(starterCost, true)) { - // Use addToParty with the same parameters that would be used in manual selection this.addToParty(randomSpecies, dexAttr, abilityIndex, nature, moveset, true); - console.log("Random starter added to party:", randomSpecies.name, "with cost:", starterCost); - success = true; + ui.playSelect(); } }); - } else { - // No valid starters available - error = true; - } - } else { - // Party is full - error = true; + break; + case Button.UP: + this.randomCursorObj.setVisible(false); + this.filterBarCursor = this.filterBar.numFilters - 1; + this.setFilterMode(true); + success = true; + break; + case Button.DOWN: + this.randomCursorObj.setVisible(false); + if (this.starterSpecies.length > 0) { + this.starterIconsCursorIndex = 0; + this.moveStarterIconsCursor(this.starterIconsCursorIndex); + } else { + this.filterBarCursor = this.filterBar.numFilters - 1; + this.setFilterMode(true); + } + success = true; + break; + case Button.LEFT: + if (numberOfStarters > 0) { + this.randomCursorObj.setVisible(false); + this.cursorObj.setVisible(true); + this.setCursor(onScreenFirstIndex + 8); // set last column + success = true; + } + break; + case Button.RIGHT: + if (numberOfStarters > 0) { + this.randomCursorObj.setVisible(false); + this.cursorObj.setVisible(true); + this.setCursor(onScreenFirstIndex); // set first column + success = true; + } + break; } } else { let starterContainer; @@ -1546,7 +1575,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { Challenge.applyChallenges(this.scene.gameMode, Challenge.ChallengeType.STARTER_CHOICE, this.lastSpecies, isValidForChallenge, this.scene.gameData.getSpeciesDexAttrProps(this.lastSpecies, this.getCurrentDexProps(this.lastSpecies.speciesId)), isPartyValid); - const currentPartyValue = this.starterSpecies.map(s => s.generation).reduce((total: number, gen: number, i: number) => total += this.scene.gameData.getSpeciesStarterValue(this.starterSpecies[i].speciesId), 0); + const currentPartyValue = this.starterSpecies.map(s => s.generation).reduce((total: number, _gen: number, i: number) => total += this.scene.gameData.getSpeciesStarterValue(this.starterSpecies[i].speciesId), 0); const newCost = this.scene.gameData.getSpeciesStarterValue(this.lastSpecies.speciesId); if (!isDupe && isValidForChallenge.value && currentPartyValue + newCost <= this.getValueLimit() && this.starterSpecies.length < PLAYER_PARTY_MAX_SIZE) { // this checks to make sure the pokemon doesn't exist in your party, it's valid for the challenge and that it won't go over the cost limit; if it meets all these criteria it will add it to your party options = [ @@ -1685,7 +1714,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { ui.showText(i18next.t("starterSelectUiHandler:selectNature"), null, () => { const natures = this.scene.gameData.getNaturesForAttr(this.speciesStarterDexEntry?.natureAttr); ui.setModeWithoutClear(Mode.OPTION_SELECT, { - options: natures.map((n: Nature, i: number) => { + options: natures.map((n: Nature, _i: number) => { const option: OptionSelectItem = { label: getNatureName(n, true, true, true, this.scene.uiTheme), handler: () => { @@ -2096,11 +2125,10 @@ export default class StarterSelectUiHandler extends MessageUiHandler { } } else { if (this.starterIconsCursorIndex === 0) { - // Up from first Pokemon in the team > go to filter + // Up from first Pokemon in the team > go to Random selection this.starterIconsCursorObj.setVisible(false); this.setSpecies(null); - this.filterBarCursor = Math.max(1, this.filterBar.numFilters - 1); - this.setFilterMode(true); + this.randomCursorObj.setVisible(true); } else { this.starterIconsCursorIndex--; this.moveStarterIconsCursor(this.starterIconsCursorIndex); @@ -2145,9 +2173,12 @@ export default class StarterSelectUiHandler extends MessageUiHandler { success = this.setCursor(this.cursor - 1); } else { // LEFT from filtered Pokemon, on the left edge - - if (this.starterSpecies.length === 0) { - // no starter in team > wrap around to the last column + if ( onScreenCurrentRow === 0 ) { + // from the first row of starters we go to the random selection + this.cursorObj.setVisible(false); + this.randomCursorObj.setVisible(true); + } else if (this.starterSpecies.length === 0) { + // no starter in team and not on first row > wrap around to the last column success = this.setCursor(this.cursor + Math.min(8, numberOfStarters - this.cursor)); } else if (onScreenCurrentRow < 7) { @@ -2183,7 +2214,11 @@ export default class StarterSelectUiHandler extends MessageUiHandler { success = this.setCursor(this.cursor + 1); } else { // RIGHT from filtered Pokemon, on the right edge - if (this.starterSpecies.length === 0) { + if ( onScreenCurrentRow === 0 ) { + // from the first row of starters we go to the random selection + this.cursorObj.setVisible(false); + this.randomCursorObj.setVisible(true); + } else if (this.starterSpecies.length === 0) { // no selected starter in team > wrap around to the first column success = this.setCursor(this.cursor - Math.min(8, this.cursor % 9)); @@ -2335,9 +2370,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler { case SettingKeyboard.Button_Stats: iconPath = "C.png"; break; - case SettingKeyboard.Button_Randomize: - iconPath = "Q.png"; - break; default: break; } @@ -2423,10 +2455,8 @@ export default class StarterSelectUiHandler extends MessageUiHandler { // if filter mode is inactivated and gamepadType is not undefined, update the button icons if (!this.filterMode) { this.updateFilterButtonIcon(SettingKeyboard.Button_Stats, gamepadType, this.goFilterIconElement, this.goFilterLabel); - this.updateButtonIcon(SettingKeyboard.Button_Randomize, gamepadType, this.randomSelectIconElement, this.randomSelectLabel); // random icon only appears not in filter mode } - } getValueLimit(): number { @@ -3086,7 +3116,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.dexAttrCursor = 0n; this.abilityCursor = -1; this.natureCursor = -1; - // We will only update the sprite if there is a change to form, shiny/variant // or gender for species with gender sprite differences const shouldUpdateSprite = (species?.genderDiffs && !isNullOrUndefined(female)) @@ -3516,7 +3545,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { } tryUpdateValue(add?: integer, addingToParty?: boolean): boolean { - const value = this.starterSpecies.map(s => s.generation).reduce((total: integer, gen: integer, i: integer) => total += this.scene.gameData.getSpeciesStarterValue(this.starterSpecies[i].speciesId), 0); + const value = this.starterSpecies.map(s => s.generation).reduce((total: integer, _gen: integer, i: integer) => total += this.scene.gameData.getSpeciesStarterValue(this.starterSpecies[i].speciesId), 0); const newValue = value + (add || 0); const valueLimit = this.getValueLimit(); const overLimit = newValue > valueLimit; @@ -3619,6 +3648,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler { if (!this.starterSpecies.length) { return false; } + console.log("reached tryStart"); const ui = this.getUi(); @@ -3779,8 +3809,6 @@ export default class StarterSelectUiHandler extends MessageUiHandler { this.variantLabel.setVisible(false); this.goFilterIconElement.setVisible(false); this.goFilterLabel.setVisible(false); - this.randomSelectIconElement.setVisible(false); - this.randomSelectLabel.setVisible(false); } clear(): void {