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

1
2
3
4
apply_default_input_actions(
    action_names: GBActionNames,
    save_project: bool = false
) -> Array[StringName]

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

1
has_configured_action(action_name: StringName) -> bool

Flags: static

Returns true when an action already exists either in the live InputMap or in project settings.


get_configured_action_events

1
get_configured_action_events(action_name: StringName) -> Array[InputEvent]

Flags: static

Returns the configured events for an action from InputMap or persisted project settings.


apply_default_input_actions_with_report

1
2
3
4
apply_default_input_actions_with_report(
    action_names: GBActionNames,
    save_project: bool = false
) -> DefaultInputActionsHelper.ActionSetupReport

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

1
validate_action(p_action_name: StringName) -> Array[String]

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

1
get_editor_issues(action_names: GBActionNames) -> Array[String]

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

1
get_runtime_issues(action_names: GBActionNames) -> Array[String]

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

1
format_binding_description(events: Array[InputEvent]) -> String

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

1
get_mouse_button_name(button_index: MouseButton) -> String

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

1
get_project_setting_path(action_name: StringName) -> String

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

1
2
3
4
setup_and_report(
    action_names: GBActionNames,
    save_project: bool = false
) -> DefaultInputActionsHelper.ActionSetupReport

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

1
_sync_action_to_project_settings(action_name: StringName) -> void

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

1
_restore_action_from_project_settings(action_name: StringName) -> bool

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

1
_get_default_action_events(action_names: GBActionNames) -> Dictionary[StringName, Array]

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

1
_create_key_event(keycode: Key) -> InputEventKey

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

1
_create_mouse_button_event(button_index: MouseButton) -> InputEventMouseButton

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

1
2
3
4
5
_print_actions_by_category(
    actions: Array[StringName],
    action_names: GBActionNames,
    existing_action_events: Dictionary[StringName, Array] = {}
) -> void

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

1
2
3
4
_get_action_binding_description(
    action_name: StringName,
    existing_action_events: Dictionary[StringName, Array] = {}
) -> String

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