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