DefaultInputActionsHelper
AUTO-GENERATED FILE – DO NOT EDIT MANUALLY
Helper class for managing default input actions for the Grid Building plugin. Provides utilities for applying default input mappings, validating actions, and formatting action bindings for display.
Source File: addons/grid_building/utils/default_input_actions_helper.gd
Extends: RefCounted
Public Methods
apply_default_input_actions
Flags: static
Applies default input actions to the project’s Input Map. Creates any missing default actions with their default key/mouse bindings. param action_names: GBActionNames struct containing all action names param save_project: If true, saves the project settings after creating actions (editor only). Returns an array of action names that were created.
has_configured_action
Flags: static
Returns true when an action already exists either in the live InputMap or in project settings.
get_configured_action_events
Flags: static
Returns the configured events for an action from InputMap or persisted project settings.
apply_default_input_actions_with_report
Flags: static
Returns information about which actions were created vs already existed. Returns an ActionSetupReport struct with created_actions, existing_actions, existing_action_events, and all_action_names. param action_names: GBActionNames struct containing all action names param save_project: If true, saves the project settings after creating actions (editor only).
validate_action
Flags: static
Validates that an action is defined in the project’s Input Map. Returns an array of issue descriptions. Empty array if action is valid.
get_editor_issues
Flags: static
Validates that all required actions are defined in the project’s Input Map. Checks all mode, building, and manipulation actions for editor configuration. param action_names: GBActionNames struct containing all action names Returns an array of issue descriptions for any missing or invalid actions.
get_runtime_issues
Flags: static
Validates that all required actions are defined in the project’s Input Map. Runtime validation wrapper that checks the same actions as editor validation. param action_names: GBActionNames struct containing all action names Returns an array of issue descriptions for any missing or invalid actions.
format_binding_description
Flags: static
Formats a human-readable description of input event bindings. param events: Array of InputEvent objects to format. Returns a string describing the bindings (e.g., “Key: Escape, Mouse: Left Click”).
get_mouse_button_name
Flags: static
Returns a human-readable name for a mouse button. param button_index: The mouse button index (e.g., MOUSE_BUTTON_LEFT). Returns a string describing the mouse button.
get_project_setting_path
Flags: static
Gets the project setting path for an action. param action_name: The name of the action. Returns the project setting path string.
setup_and_report
Flags: static
Applies default input actions and prints a detailed report to the console. This is the main entry point for the “Setup Default Input Actions” menu command. param action_names: GBActionNames struct containing all action names param save_project: If true, saves the project settings after creating actions (editor only). Returns an ActionSetupReport struct with created_actions, existing_actions, existing_action_events, and all_action_names.
Private Methods
_sync_action_to_project_settings
Flags: static, private
Syncs an action’s configuration to the project settings. Ensures the action is persisted to project.godot when running in the editor. param action_name: The name of the action to sync.
_restore_action_from_project_settings
Flags: static, private
Restores an action from persisted project settings into the live InputMap. Returns true when a persisted action existed and was restored.
_get_default_action_events
Flags: static, private
Returns the default input event mappings for all plugin actions. Maps action names to their default keyboard or mouse button events. param action_names: GBActionNames struct containing all action names Returns a dictionary of action names to arrays of InputEvent objects.
_create_key_event
Flags: static, private
Creates a keyboard input event for the specified keycode. param keycode: The key code to create an event for (e.g., KEY_ESCAPE). Returns an InputEventKey configured with the specified keycode.
_create_mouse_button_event
Flags: static, private
Creates a mouse button input event for the specified button. param button_index: The mouse button index (e.g., MOUSE_BUTTON_LEFT). Returns an InputEventMouseButton configured with the specified button.
_print_actions_by_category
Flags: static, private
Prints actions grouped by category. param actions: Array of action names to print param action_names: GBActionNames struct containing all action names param existing_action_events: Optional dictionary of existing action events (for existing actions)
_get_action_binding_description
Flags: static, private
Gets the binding description for an action. param action_name: The name of the action param existing_action_events: Optional dictionary of existing action events Returns a string describing the bindings