removed Swap a/b
parent
5076625259
commit
d80c0e3d34
|
@ -118,7 +118,6 @@ export default class BattleScene extends SceneBase {
|
||||||
public fusionPaletteSwaps: boolean = true;
|
public fusionPaletteSwaps: boolean = true;
|
||||||
public enableTouchControls: boolean = false;
|
public enableTouchControls: boolean = false;
|
||||||
public enableVibration: boolean = false;
|
public enableVibration: boolean = false;
|
||||||
public abSwapped: boolean = false;
|
|
||||||
|
|
||||||
public disableMenu: boolean = false;
|
public disableMenu: boolean = false;
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import {Button} from "../enums/buttons";
|
||||||
export enum SettingGamepad {
|
export enum SettingGamepad {
|
||||||
Default_Controller = "DEFAULT_CONTROLLER",
|
Default_Controller = "DEFAULT_CONTROLLER",
|
||||||
Gamepad_Support = "GAMEPAD_SUPPORT",
|
Gamepad_Support = "GAMEPAD_SUPPORT",
|
||||||
Swap_A_and_B = "SWAP_A_B", // Swaps which gamepad button handles ACTION and CANCEL
|
|
||||||
Button_Action = "BUTTON_ACTION",
|
Button_Action = "BUTTON_ACTION",
|
||||||
Button_Cancel = "BUTTON_CANCEL",
|
Button_Cancel = "BUTTON_CANCEL",
|
||||||
Button_Menu = "BUTTON_MENU",
|
Button_Menu = "BUTTON_MENU",
|
||||||
|
@ -27,7 +26,6 @@ export enum SettingGamepad {
|
||||||
export const settingGamepadOptions: SettingOptions = {
|
export const settingGamepadOptions: SettingOptions = {
|
||||||
[SettingGamepad.Default_Controller]: ['Default', 'Change'],
|
[SettingGamepad.Default_Controller]: ['Default', 'Change'],
|
||||||
[SettingGamepad.Gamepad_Support]: ['Auto', 'Disabled'],
|
[SettingGamepad.Gamepad_Support]: ['Auto', 'Disabled'],
|
||||||
[SettingGamepad.Swap_A_and_B]: ['Enabled', 'Disabled'],
|
|
||||||
[SettingGamepad.Button_Action]: [`KEY ${Button.ACTION.toString()}`, 'Change'],
|
[SettingGamepad.Button_Action]: [`KEY ${Button.ACTION.toString()}`, 'Change'],
|
||||||
[SettingGamepad.Button_Cancel]: [`KEY ${Button.CANCEL.toString()}`, 'Change'],
|
[SettingGamepad.Button_Cancel]: [`KEY ${Button.CANCEL.toString()}`, 'Change'],
|
||||||
[SettingGamepad.Button_Menu]: [`KEY ${Button.MENU.toString()}`, 'Change'],
|
[SettingGamepad.Button_Menu]: [`KEY ${Button.MENU.toString()}`, 'Change'],
|
||||||
|
@ -46,7 +44,6 @@ export const settingGamepadOptions: SettingOptions = {
|
||||||
export const settingGamepadDefaults: SettingDefaults = {
|
export const settingGamepadDefaults: SettingDefaults = {
|
||||||
[SettingGamepad.Default_Controller]: 0,
|
[SettingGamepad.Default_Controller]: 0,
|
||||||
[SettingGamepad.Gamepad_Support]: 0,
|
[SettingGamepad.Gamepad_Support]: 0,
|
||||||
[SettingGamepad.Swap_A_and_B]: 1, // Set to 'Disabled' by default
|
|
||||||
[SettingGamepad.Button_Action]: 0,
|
[SettingGamepad.Button_Action]: 0,
|
||||||
[SettingGamepad.Button_Cancel]: 0,
|
[SettingGamepad.Button_Cancel]: 0,
|
||||||
[SettingGamepad.Button_Menu]: 0,
|
[SettingGamepad.Button_Menu]: 0,
|
||||||
|
@ -85,9 +82,6 @@ export function setSettingGamepad(scene: BattleScene, setting: SettingGamepad, v
|
||||||
// activate or deactivate the controller listener
|
// activate or deactivate the controller listener
|
||||||
scene.inputController.setGamepadSupport(settingGamepadOptions[setting][value] !== 'Disabled');
|
scene.inputController.setGamepadSupport(settingGamepadOptions[setting][value] !== 'Disabled');
|
||||||
break;
|
break;
|
||||||
case SettingGamepad.Swap_A_and_B:
|
|
||||||
scene.abSwapped = settingGamepadOptions[setting][value] !== 'Disabled';
|
|
||||||
break;
|
|
||||||
case SettingGamepad.Button_Action:
|
case SettingGamepad.Button_Action:
|
||||||
case SettingGamepad.Button_Cancel:
|
case SettingGamepad.Button_Cancel:
|
||||||
case SettingGamepad.Button_Menu:
|
case SettingGamepad.Button_Menu:
|
||||||
|
|
|
@ -148,14 +148,6 @@ export function setSetting(scene: BattleScene, setting: Setting, value: integer)
|
||||||
} else
|
} else
|
||||||
return false;
|
return false;
|
||||||
break;
|
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:
|
case Setting.Touch_Controls:
|
||||||
scene.enableTouchControls = settingOptions[setting][value] !== 'Disabled' && hasTouchscreen();
|
scene.enableTouchControls = settingOptions[setting][value] !== 'Disabled' && hasTouchscreen();
|
||||||
const touchControls = document.getElementById('touchControls');
|
const touchControls = document.getElementById('touchControls');
|
||||||
|
|
|
@ -90,7 +90,7 @@ export default class SettingsGamepadUiHandler extends UiHandler {
|
||||||
const optionValueLabels = [];
|
const optionValueLabels = [];
|
||||||
const inputsIcons = {};
|
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 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]));
|
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.cursorObj = null;
|
||||||
this.scrollCursor = null;
|
this.scrollCursor = null;
|
||||||
const layout = this.layout[configType];
|
const layout = this.layout[configType];
|
||||||
console.log('activeConfig', activeConfig);
|
|
||||||
console.log('layout', layout);
|
|
||||||
this.keys = layout.keys;
|
this.keys = layout.keys;
|
||||||
this.optionsContainer = layout.optionsContainer;
|
this.optionsContainer = layout.optionsContainer;
|
||||||
this.optionsContainer.setVisible(true);
|
this.optionsContainer.setVisible(true);
|
||||||
|
|
Loading…
Reference in New Issue