diff --git a/public/images/inputs/snes.json b/public/images/inputs/snes.json new file mode 100644 index 000000000..2ffe08764 --- /dev/null +++ b/public/images/inputs/snes.json @@ -0,0 +1,108 @@ +{"frames": [ + +{ + "filename": "select.png", + "frame": {"x":0,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}, +{ + "filename": "start.png", + "frame": {"x":128,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}, +{ + "filename": "T_X_A_White_Alt.png", + "frame": {"x":256,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}, +{ + "filename": "T_X_B_White_Alt.png", + "frame": {"x":384,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}, +{ + "filename": "T_X_Dpad_Down_Alt.png", + "frame": {"x":512,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}, +{ + "filename": "T_X_Dpad_Left_Alt.png", + "frame": {"x":640,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}, +{ + "filename": "T_X_Dpad_Right_Alt.png", + "frame": {"x":768,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}, +{ + "filename": "T_X_Dpad_Up_Alt.png", + "frame": {"x":896,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}, +{ + "filename": "T_X_LB_Alt.png", + "frame": {"x":1024,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}, +{ + "filename": "T_X_RB_Alt.png", + "frame": {"x":1152,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}, +{ + "filename": "T_X_X_White_Alt.png", + "frame": {"x":1280,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}, +{ + "filename": "T_X_Y_White_Alt.png", + "frame": {"x":1408,"y":0,"w":128,"h":128}, + "rotated": false, + "trimmed": false, + "spriteSourceSize": {"x":0,"y":0,"w":128,"h":128}, + "sourceSize": {"w":128,"h":128} +}], +"meta": { + "app": "https://www.codeandweb.com/texturepacker", + "version": "1.0", + "image": "snes.png", + "format": "RGBA8888", + "size": {"w":1536,"h":128}, + "scale": "1", + "smartupdate": "$TexturePacker:SmartUpdate:86d994650b80a3f876cc92e4d0928a65:60b6f706b30e87e11c3d01cec0eccf9c:7e443c950e063b6a235f0fd6295e2000$" +} +} diff --git a/public/images/inputs/snes.png b/public/images/inputs/snes.png new file mode 100644 index 000000000..94b1d1ce7 Binary files /dev/null and b/public/images/inputs/snes.png differ diff --git a/src/configs/pad_unlicensedSNES.ts b/src/configs/pad_unlicensedSNES.ts index 7da7553ff..30ed331c3 100644 --- a/src/configs/pad_unlicensedSNES.ts +++ b/src/configs/pad_unlicensedSNES.ts @@ -22,12 +22,12 @@ const pad_unlicensedSNES = { LC_E: 15 }, icons: { - RC_S: "T_X_B_Color_Alt.png", - RC_E: "T_X_A_Color_Alt.png", - RC_W: "T_X_Y_Color_Alt.png", - RC_N: "T_X_X_Color_Alt.png", - START: "T_X_X_Alt.png", - SELECT: "T_X_Share_Alt.png", + RC_S: "T_X_B_White_Alt.png", + RC_E: "T_X_A_White_Alt.png", + RC_W: "T_X_Y_White_Alt.png", + RC_N: "T_X_X_White_Alt.png", + START: "start.png", + SELECT: "select.png", LB: "T_X_LB_Alt.png", RB: "T_X_RB_Alt.png", LC_N: "T_X_Dpad_Up_Alt.png", diff --git a/src/inputs-controller.ts b/src/inputs-controller.ts index 3e43d60ec..744a03447 100644 --- a/src/inputs-controller.ts +++ b/src/inputs-controller.ts @@ -662,8 +662,7 @@ export class InputsController { * @returns Array Tuple containing the pad type and the currently assigned icon for the button index. */ getPressedButtonLabel(button: Phaser.Input.Gamepad.Button): [string, string] { - const type = this.configs[this.chosenGamepad].padType; - return [type === 'snes' ? 'xbox' : type, getCurrenlyAssignedIconFromInputIndex(this.configs[this.chosenGamepad], button.index)]; + return [this.configs[this.chosenGamepad].padType, getCurrenlyAssignedIconFromInputIndex(this.configs[this.chosenGamepad], button.index)]; } /** diff --git a/src/loading-scene.ts b/src/loading-scene.ts index 8e69ad63b..34f4291ed 100644 --- a/src/loading-scene.ts +++ b/src/loading-scene.ts @@ -216,6 +216,7 @@ export class LoadingScene extends SceneBase { this.loadAtlas('dualshock', 'inputs'); this.loadAtlas('nswitch', 'inputs'); this.loadAtlas('xbox', 'inputs'); + this.loadAtlas('snes', 'inputs'); this.loadSe('select'); this.loadSe('menu_open'); diff --git a/src/ui/settings-gamepad-ui-handler.ts b/src/ui/settings-gamepad-ui-handler.ts index d0df227b3..0e12d9250 100644 --- a/src/ui/settings-gamepad-ui-handler.ts +++ b/src/ui/settings-gamepad-ui-handler.ts @@ -144,7 +144,7 @@ export default class SettingsGamepadUiHandler extends UiHandler { } // For null options, add an icon for the key. const key = getKeyForSettingName(config as GamepadConfig, SettingGamepad[setting]); - const icon = this.scene.add.sprite(0, 0, config.padType === 'snes' ? 'xbox' : config.padType); + const icon = this.scene.add.sprite(0, 0, config.padType); icon.setScale(0.1); icon.setOrigin(0, -0.1); inputsIcons[key] = icon;