adding essential data into config file

pull/685/head
Greenlamp 2024-05-11 02:36:47 +02:00
parent 022c4351d3
commit 043216aa75
4 changed files with 81 additions and 2 deletions

View File

@ -1,3 +1,6 @@
import {SettingGamepad} from "../system/settings-gamepad";
import {Button} from "../enums/buttons";
/**
* Dualshock mapping
*/
@ -21,7 +24,6 @@ const pad_dualshock = {
LC_S: 13,
LC_W: 14,
LC_E: 15,
MENU: 16,
TOUCH: 17
},
icons: {
@ -41,8 +43,28 @@ const pad_dualshock = {
LC_S: "T_P4_Dpad_Down_Default.png",
LC_W: "T_P4_Dpad_Left_Default.png",
LC_E: "T_P4_Dpad_Right_Default.png",
MENU: "",
TOUCH: "T_P4_Touch_Pad_Default.png"
},
setting: {
RC_S: SettingGamepad.Button_Action,
RC_E: SettingGamepad.Button_Cancel,
},
default: {
RC_S: Button.ACTION,
RC_E: Button.CANCEL,
RC_W: Button.CYCLE_NATURE,
RC_N: Button.CYCLE_VARIANT,
START: Button.MENU,
SELECT: Button.STATS,
LB: Button.CYCLE_FORM,
RB: Button.CYCLE_SHINY,
LT: Button.CYCLE_GENDER,
RT: Button.CYCLE_ABILITY,
LC_N: Button.UP,
LC_S: Button.DOWN,
LC_W: Button.LEFT,
LC_E: Button.RIGHT,
TOUCH: Button.SUBMIT,
}
};

View File

@ -1,3 +1,6 @@
import {SettingGamepad} from "../system/settings-gamepad";
import {Button} from "../enums/buttons";
/**
* Generic pad mapping
*/
@ -40,6 +43,27 @@ const pad_generic = {
LC_W: "T_X_Dpad_Left_Alt.png",
LC_E: "T_X_Dpad_Right_Alt.png",
MENU: ""
},
setting: {
RC_S: SettingGamepad.Button_Action,
RC_E: SettingGamepad.Button_Cancel,
},
default: {
RC_S: Button.ACTION,
RC_E: Button.CANCEL,
RC_W: Button.CYCLE_NATURE,
RC_N: Button.CYCLE_VARIANT,
START: Button.MENU,
SELECT: Button.STATS,
LB: Button.CYCLE_FORM,
RB: Button.CYCLE_SHINY,
LT: Button.CYCLE_GENDER,
RT: Button.CYCLE_ABILITY,
LC_N: Button.UP,
LC_S: Button.DOWN,
LC_W: Button.LEFT,
LC_E: Button.RIGHT,
TOUCH: Button.SUBMIT,
}
};

View File

@ -1,3 +1,6 @@
import {SettingGamepad} from "../system/settings-gamepad";
import {Button} from "../enums/buttons";
/**
* 081f-e401 - UnlicensedSNES
*/
@ -31,6 +34,25 @@ const pad_unlicensedSNES = {
LC_S: "T_X_Dpad_Down_Alt.png",
LC_W: "T_X_Dpad_Left_Alt.png",
LC_E: "T_X_Dpad_Right_Alt.png",
},
setting: {
RC_S: SettingGamepad.Button_Action,
RC_E: SettingGamepad.Button_Cancel,
},
default: {
RC_S: Button.ACTION,
RC_E: Button.CANCEL,
RC_W: Button.CYCLE_NATURE,
RC_N: Button.CYCLE_VARIANT,
START: Button.MENU,
SELECT: Button.STATS,
LB: Button.CYCLE_FORM,
RB: Button.CYCLE_SHINY,
LC_N: Button.UP,
LC_S: Button.DOWN,
LC_W: Button.LEFT,
LC_E: Button.RIGHT,
TOUCH: Button.SUBMIT,
}
};

View File

@ -18,11 +18,21 @@ export interface IconsMapping {
[key: string]: string;
}
export interface SettingMapping {
[key: string]: string;
}
export interface DefaultMapping {
[key: string]: Button;
}
export interface GamepadConfig {
padID: string;
padType: string;
gamepadMapping: GamepadMapping;
icons: IconsMapping;
setting: SettingMapping;
default: DefaultMapping;
}
export interface ActionGamepadMapping {
@ -289,6 +299,7 @@ export class InputsController {
this.player[gamepad]['custom'] = mappedPad.gamepadMapping;
this.player[gamepad]['icons'] = mappedPad.icons;
this.player[gamepad]['type'] = mappedPad.padType;
this.player[gamepad]['default'] = mappedPad.default;
}
if (this.chosenGamepad === thisGamepad.id) this.initChosenGamepad(this.chosenGamepad)
}