added ogIcons
parent
66414e9bbc
commit
b5841471d2
|
@ -338,6 +338,7 @@ export class InputsController {
|
||||||
const gamepadID = gamepad.toLowerCase();
|
const gamepadID = gamepad.toLowerCase();
|
||||||
const config = deepCopy(this.getConfig(gamepadID));
|
const config = deepCopy(this.getConfig(gamepadID));
|
||||||
config.custom = this.configs[gamepad]?.custom || {...config.default};
|
config.custom = this.configs[gamepad]?.custom || {...config.default};
|
||||||
|
config.ogIcons = {...config.icons};
|
||||||
config.currentKeys = this.configs[gamepad]?.currentKeys;
|
config.currentKeys = this.configs[gamepad]?.currentKeys;
|
||||||
if (!this.configs[gamepad]?.currentKeys)
|
if (!this.configs[gamepad]?.currentKeys)
|
||||||
reloadCurrentKeys(config);
|
reloadCurrentKeys(config);
|
||||||
|
@ -354,6 +355,7 @@ export class InputsController {
|
||||||
const config = deepCopy(this.getConfigKeyboard(layout));
|
const config = deepCopy(this.getConfigKeyboard(layout));
|
||||||
config.custom = this.keyboardConfigs[layout]?.custom || {...config.default};
|
config.custom = this.keyboardConfigs[layout]?.custom || {...config.default};
|
||||||
config.currentKeys = this.keyboardConfigs[layout]?.currentKeys;
|
config.currentKeys = this.keyboardConfigs[layout]?.currentKeys;
|
||||||
|
config.ogIcons = {...config.icons};
|
||||||
if (!this.keyboardConfigs[layout]?.currentKeys)
|
if (!this.keyboardConfigs[layout]?.currentKeys)
|
||||||
reloadCurrentKeys(config);
|
reloadCurrentKeys(config);
|
||||||
else
|
else
|
||||||
|
|
|
@ -3,7 +3,7 @@ import AbstractBindingUiHandler from "../settings/abrast-binding-ui-handler";
|
||||||
import {Mode} from "../ui";
|
import {Mode} from "../ui";
|
||||||
import {
|
import {
|
||||||
getKeyAndActionFromCurrentKeysWithPressedButton,
|
getKeyAndActionFromCurrentKeysWithPressedButton,
|
||||||
getKeyAndActionFromCurrentKeysWithSettingName,
|
getKeyAndActionFromCurrentKeysWithSettingName, getKeyFromMapping,
|
||||||
} from "#app/configs/gamepad-utils";
|
} from "#app/configs/gamepad-utils";
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +22,8 @@ export default class GamepadBindingUiHandler extends AbstractBindingUiHandler {
|
||||||
this.buttonPressed = button.index;
|
this.buttonPressed = button.index;
|
||||||
const activeConfig = this.scene.inputController.getActiveConfig();
|
const activeConfig = this.scene.inputController.getActiveConfig();
|
||||||
const type = activeConfig.padType
|
const type = activeConfig.padType
|
||||||
const buttonIcon = getKeyAndActionFromCurrentKeysWithPressedButton(activeConfig, this.buttonPressed)?.icon
|
const key = getKeyFromMapping(activeConfig, this.buttonPressed);
|
||||||
|
const buttonIcon = activeConfig.ogIcons[key];
|
||||||
if (!buttonIcon) return;
|
if (!buttonIcon) return;
|
||||||
const assignedButtonIcon = getKeyAndActionFromCurrentKeysWithSettingName(activeConfig, this.target)?.icon;
|
const assignedButtonIcon = getKeyAndActionFromCurrentKeysWithSettingName(activeConfig, this.target)?.icon;
|
||||||
this.onInputDown(buttonIcon, assignedButtonIcon, type);
|
this.onInputDown(buttonIcon, assignedButtonIcon, type);
|
||||||
|
|
|
@ -3,7 +3,7 @@ import AbstractBindingUiHandler from "../settings/abrast-binding-ui-handler";
|
||||||
import {Mode} from "../ui";
|
import {Mode} from "../ui";
|
||||||
import {
|
import {
|
||||||
getKeyAndActionFromCurrentKeysWithPressedButton,
|
getKeyAndActionFromCurrentKeysWithPressedButton,
|
||||||
getKeyAndActionFromCurrentKeysWithSettingName,
|
getKeyAndActionFromCurrentKeysWithSettingName, getKeyFromMapping,
|
||||||
} from "#app/configs/gamepad-utils";
|
} from "#app/configs/gamepad-utils";
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,7 +21,8 @@ export default class KeyboardBindingUiHandler extends AbstractBindingUiHandler {
|
||||||
if (!this.listening || this.buttonPressed !== null) return;
|
if (!this.listening || this.buttonPressed !== null) return;
|
||||||
this.buttonPressed = key;
|
this.buttonPressed = key;
|
||||||
const activeConfig = this.scene.inputController.getActiveKeyboardConfig();
|
const activeConfig = this.scene.inputController.getActiveKeyboardConfig();
|
||||||
const buttonIcon = getKeyAndActionFromCurrentKeysWithPressedButton(activeConfig, key)?.icon
|
const _key = getKeyFromMapping(activeConfig, key);
|
||||||
|
const buttonIcon = activeConfig.ogIcons[_key];
|
||||||
if (!buttonIcon) return;
|
if (!buttonIcon) return;
|
||||||
const assignedButtonIcon = getKeyAndActionFromCurrentKeysWithSettingName(activeConfig, this.target)?.icon;
|
const assignedButtonIcon = getKeyAndActionFromCurrentKeysWithSettingName(activeConfig, this.target)?.icon;
|
||||||
this.onInputDown(buttonIcon, assignedButtonIcon, 'keyboard');
|
this.onInputDown(buttonIcon, assignedButtonIcon, 'keyboard');
|
||||||
|
|
Loading…
Reference in New Issue