removed Swap a/b

pull/685/head
Greenlamp 2024-05-12 01:28:56 +02:00
parent 5076625259
commit d80c0e3d34
4 changed files with 1 additions and 18 deletions

View File

@ -118,7 +118,6 @@ export default class BattleScene extends SceneBase {
public fusionPaletteSwaps: boolean = true;
public enableTouchControls: boolean = false;
public enableVibration: boolean = false;
public abSwapped: boolean = false;
public disableMenu: boolean = false;

View File

@ -8,7 +8,6 @@ import {Button} from "../enums/buttons";
export enum SettingGamepad {
Default_Controller = "DEFAULT_CONTROLLER",
Gamepad_Support = "GAMEPAD_SUPPORT",
Swap_A_and_B = "SWAP_A_B", // Swaps which gamepad button handles ACTION and CANCEL
Button_Action = "BUTTON_ACTION",
Button_Cancel = "BUTTON_CANCEL",
Button_Menu = "BUTTON_MENU",
@ -27,7 +26,6 @@ export enum SettingGamepad {
export const settingGamepadOptions: SettingOptions = {
[SettingGamepad.Default_Controller]: ['Default', 'Change'],
[SettingGamepad.Gamepad_Support]: ['Auto', 'Disabled'],
[SettingGamepad.Swap_A_and_B]: ['Enabled', 'Disabled'],
[SettingGamepad.Button_Action]: [`KEY ${Button.ACTION.toString()}`, 'Change'],
[SettingGamepad.Button_Cancel]: [`KEY ${Button.CANCEL.toString()}`, 'Change'],
[SettingGamepad.Button_Menu]: [`KEY ${Button.MENU.toString()}`, 'Change'],
@ -46,7 +44,6 @@ export const settingGamepadOptions: SettingOptions = {
export const settingGamepadDefaults: SettingDefaults = {
[SettingGamepad.Default_Controller]: 0,
[SettingGamepad.Gamepad_Support]: 0,
[SettingGamepad.Swap_A_and_B]: 1, // Set to 'Disabled' by default
[SettingGamepad.Button_Action]: 0,
[SettingGamepad.Button_Cancel]: 0,
[SettingGamepad.Button_Menu]: 0,
@ -85,9 +82,6 @@ export function setSettingGamepad(scene: BattleScene, setting: SettingGamepad, v
// activate or deactivate the controller listener
scene.inputController.setGamepadSupport(settingGamepadOptions[setting][value] !== 'Disabled');
break;
case SettingGamepad.Swap_A_and_B:
scene.abSwapped = settingGamepadOptions[setting][value] !== 'Disabled';
break;
case SettingGamepad.Button_Action:
case SettingGamepad.Button_Cancel:
case SettingGamepad.Button_Menu:

View File

@ -148,14 +148,6 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
} else
return false;
break;
case Setting.Gamepad_Support:
// if we change the value of the gamepad support, we call a method in the inputController to
// activate or deactivate the controller listener
scene.inputController.setGamepadSupport(settingOptions[setting][value] !== 'Disabled');
break;
case Setting.Swap_A_and_B:
scene.abSwapped = settingOptions[setting][value] !== 'Disabled';
break;
case Setting.Touch_Controls:
scene.enableTouchControls = settingOptions[setting][value] !== 'Disabled' && hasTouchscreen();
const touchControls = document.getElementById('touchControls');

View File

@ -90,7 +90,7 @@ export default class SettingsGamepadUiHandler extends UiHandler {
const optionValueLabels = [];
const inputsIcons = {};
const commonSettingKeys = Object.keys(SettingGamepad).slice(0, 3).map(key => SettingGamepad[key]);
const commonSettingKeys = Object.keys(SettingGamepad).slice(0, 2).map(key => SettingGamepad[key]);
const specificBindingKeys = [...commonSettingKeys, ...Object.keys(config.setting).map(k => config.setting[k])];
const optionCursors = Object.values(Object.keys(settingGamepadDefaults).filter(s => specificBindingKeys.includes(s)).map(k => settingGamepadDefaults[k]));
@ -186,8 +186,6 @@ export default class SettingsGamepadUiHandler extends UiHandler {
this.cursorObj = null;
this.scrollCursor = null;
const layout = this.layout[configType];
console.log('activeConfig', activeConfig);
console.log('layout', layout);
this.keys = layout.keys;
this.optionsContainer = layout.optionsContainer;
this.optionsContainer.setVisible(true);