InputRemapperUI
Inherits: Control
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
Description
This is an example implementation of an Input Remapper UI with the GatoInputRemapper API. It uses the model classes and the GatoInputRemapper autoload to get the loaded control scheme data and to set the input configuration defined there.
Properties
|
|
Methods
void |
grab_focus(hide_focus: |
void |
populate_ui(scheme: GatoControlScheme) |
void |
set_action(action_name: |
void |
set_action2d(action_name: |
void |
|
void |
close() |
Signals
detected_conflicting_inputs(input_action_list: Array[InputAction]) 🔗
Emitted when trying to save the current changes and the same InputEvent trigger was used with more than one action. For instance, it will be emitted if you try to save and you set jump and attack to the same key.
closed() 🔗
Emitted when the UI is closed (ie. set to invisible).
Property Descriptions
Node close_without_saving_dialog = <unknown> 🔗
Reference to the Control node with the dialog that shows up when trying to close the menu with unsaved changes.
Method Descriptions
void grab_focus(hide_focus: bool = false) 🔗
When the menu grabs focus, it tells the first interactable element on the UI to grab focus instead.
void populate_ui(scheme: GatoControlScheme) 🔗
Reacts to the GatoInputRemapper.control_scheme_changed signal to populate the UI with the loaded control scheme and propagates it down to its descendants so they can do the same.
void set_action(action_name: StringName, event: InputEvent) 🔗
Updates the control schemes in memory with a new InputEvent trigger for a single button action (ie. InputActionButton).
void set_action2d(action_name: StringName, new_input_action2d: InputAction) 🔗
Updates the control schemes in memory with a new configuration for a 2D action. The action could be based on buttons (ie. KeysInputAction2D) or a joystick (ie. JoystickInputAction2D).
void save_changes() 🔗
Saves the current changes to the input.data file.
void close() 🔗
Closes the menu and alerts anyone listening to closed events.