renamed buttons to LB & RB + added whitelist for these buttons to specific handler
parent
bb28d3599e
commit
22c81f1a80
|
@ -8,8 +8,8 @@ export enum Button {
|
|||
CANCEL,
|
||||
MENU,
|
||||
STATS,
|
||||
CYCLE_SHINY,
|
||||
CYCLE_FORM,
|
||||
RB, // CYCLE_SHINY
|
||||
LB, // CYCLE_FORM
|
||||
CYCLE_GENDER,
|
||||
CYCLE_ABILITY,
|
||||
CYCLE_NATURE,
|
||||
|
|
|
@ -130,8 +130,8 @@ export class InputsController {
|
|||
gamepadMapping[this.player.mapping.RC_E] = this.scene.abSwapped ? Button.ACTION : Button.CANCEL;
|
||||
gamepadMapping[this.player.mapping.SELECT] = Button.STATS;
|
||||
gamepadMapping[this.player.mapping.START] = Button.MENU;
|
||||
gamepadMapping[this.player.mapping.RB] = Button.CYCLE_SHINY;
|
||||
gamepadMapping[this.player.mapping.LB] = Button.CYCLE_FORM;
|
||||
gamepadMapping[this.player.mapping.RB] = Button.RB;
|
||||
gamepadMapping[this.player.mapping.LB] = Button.LB;
|
||||
gamepadMapping[this.player.mapping.LT] = Button.CYCLE_GENDER;
|
||||
gamepadMapping[this.player.mapping.RT] = Button.CYCLE_ABILITY;
|
||||
gamepadMapping[this.player.mapping.RC_W] = Button.CYCLE_NATURE;
|
||||
|
@ -180,8 +180,8 @@ export class InputsController {
|
|||
[Button.CANCEL]: [keyCodes.BACKSPACE, keyCodes.X],
|
||||
[Button.MENU]: [keyCodes.ESC, keyCodes.M],
|
||||
[Button.STATS]: [keyCodes.SHIFT, keyCodes.C],
|
||||
[Button.CYCLE_SHINY]: [keyCodes.R],
|
||||
[Button.CYCLE_FORM]: [keyCodes.F],
|
||||
[Button.RB]: [keyCodes.R],
|
||||
[Button.LB]: [keyCodes.F],
|
||||
[Button.CYCLE_GENDER]: [keyCodes.G],
|
||||
[Button.CYCLE_ABILITY]: [keyCodes.E],
|
||||
[Button.CYCLE_NATURE]: [keyCodes.N],
|
||||
|
|
|
@ -57,8 +57,8 @@ export class UiInputs {
|
|||
actions[Button.CANCEL] = () => this.buttonAb(Button.CANCEL);
|
||||
actions[Button.MENU] = () => this.buttonMenu();
|
||||
actions[Button.STATS] = () => this.buttonStats(true);
|
||||
actions[Button.CYCLE_SHINY] = () => this.buttonCycleOption(Button.CYCLE_SHINY);
|
||||
actions[Button.CYCLE_FORM] = () => this.buttonCycleOption(Button.CYCLE_FORM);
|
||||
actions[Button.RB] = () => this.buttonCycleOption(Button.RB);
|
||||
actions[Button.LB] = () => this.buttonCycleOption(Button.LB);
|
||||
actions[Button.CYCLE_GENDER] = () => this.buttonCycleOption(Button.CYCLE_GENDER);
|
||||
actions[Button.CYCLE_ABILITY] = () => this.buttonCycleOption(Button.CYCLE_ABILITY);
|
||||
actions[Button.CYCLE_NATURE] = () => this.buttonCycleOption(Button.CYCLE_NATURE);
|
||||
|
@ -130,7 +130,9 @@ export class UiInputs {
|
|||
}
|
||||
|
||||
buttonCycleOption(button: Button): void {
|
||||
if (this.scene.ui?.getHandler() instanceof StarterSelectUiHandler) {
|
||||
const whitelist = [StarterSelectUiHandler, SettingsUiHandler];
|
||||
const uiHandler = this.scene.ui?.getHandler();
|
||||
if (whitelist.some(handler => uiHandler instanceof handler)) {
|
||||
this.scene.ui.processInput(button);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -155,6 +155,12 @@ export default class SettingsUiHandler extends UiHandler {
|
|||
if (this.optionCursors[cursor] < this.optionValueLabels[cursor].length - 1)
|
||||
success = this.setOptionCursor(cursor, this.optionCursors[cursor] + 1, true);
|
||||
break;
|
||||
case Button.LB:
|
||||
console.log('lb');
|
||||
break;
|
||||
case Button.RB:
|
||||
console.log('rb');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -969,7 +969,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
const row = Math.floor(this.cursor / 9);
|
||||
const props = this.scene.gameData.getSpeciesDexAttrProps(this.lastSpecies, this.dexAttrCursor);
|
||||
switch (button) {
|
||||
case Button.CYCLE_SHINY:
|
||||
case Button.RB:
|
||||
if (this.canCycleShiny) {
|
||||
this.setSpeciesDetails(this.lastSpecies, !props.shiny, undefined, undefined, props.shiny ? 0 : undefined, undefined, undefined);
|
||||
if (this.dexAttrCursor & DexAttr.SHINY)
|
||||
|
@ -978,7 +978,7 @@ export default class StarterSelectUiHandler extends MessageUiHandler {
|
|||
success = true;
|
||||
}
|
||||
break;
|
||||
case Button.CYCLE_FORM:
|
||||
case Button.LB:
|
||||
if (this.canCycleForm) {
|
||||
const formCount = this.lastSpecies.forms.length;
|
||||
let newFormIndex = props.formIndex;
|
||||
|
|
Loading…
Reference in New Issue