PlaceableSelectionUI

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Unified UI component for selecting placeable objects and placeable sequences to build.

Source File: addons/grid_building/ui/placeable/single/placeable_selection_ui.gd

Extends: Control

Signals

  • Signal: valid_changed(is_valid : bool)

    Emitted when the UI validation state changes.

    is_valid True if the UI is properly configured and ready for use.

Exported Properties

  • Property: category_tags : Array[CategoricalTag] = []

    Category tags to include alongside folder-loaded ones.

    These tags are combined with tags loaded from category_tags_folder.

  • Property: placeables : Array[Placeable] = []

    Individual placeables to include alongside folder-loaded ones.

    These are displayed in grids alongside sequences. Combined with placeables from placeables_folder.

  • Property: sequences : Array[PlaceableSequence] = []

    Placeable sequences to include alongside folder-loaded ones.

    Sequences allow variant cycling within a single grid slot. Combined with sequences from sequences_folder.

  • Property: placeable_entry_template : PackedScene

    Template scene for individual placeable entries.

    Should be a [PlaceableView] that displays icon and name.

  • Property: sequence_entry_template : PackedScene

    Template scene for sequence entries with variant cycling.

    Should be a [PlaceableListEntry] that supports cycling through sequence variants.

  • Property: fixed_template_height : int = 48

    Fixed height for all templates to prevent resizing when cycling through sequence variants.

    When set to a positive value, enforces consistent height for all template entries.

    When set to 0, disables PlaceableSelectionUI-level height enforcement and allows templates to size naturally.

    Note: Individual PlaceableView instances may still enforce their own height via their fixed_view_height property.

    Default: 48 pixels for consistent template sizing.

  • Property: fixed_icon_size : int = 40

    Fixed icon size for all placeable view icons to ensure consistent icon dimensions.

    When set to a positive value, enforces both width and height for all icon TextureRects in PlaceableView instances.

    When set to 0, icon sizing is not enforced and will use template defaults.

    Default: 40 pixels for standard icon sizing.

  • Property: show_category_tab_names : bool = true

    Whether category tab titles should be visible for manual category selection.

    When false, tabs are hidden and only grid content is shown.

  • Property: hide_ui_on_selection : bool = false

    Whether to hide the selection UI when an item is selected.

    When true, the UI automatically hides after the user selects a placeable or sequence.

  • Property: ui_root : Control - Root control node for showing and hiding the entire UI.

  • Property: tab_container : TabContainer

    Tab container that handles category-based organization.

    Each tab represents a category tag and contains a grid of matching placeables/sequences.

Properties

  • Property: category_tags_folder : String = ""

    Path to folder containing category tag resources.

    Tags found here are automatically loaded and added to category_tags.

  • Property: placeables_folder : String = ""

    Path to folder containing placeable resources.

    Placeables found here are automatically loaded and added to placeables.

  • Property: sequences_folder : String = ""

    Path to folder containing placeable sequence resources.

    Sequences found here are automatically loaded and added to sequences.

  • Property: grid_columns : int = 1

    Number of columns for the grid layout.

    Default: 1 (single column list layout).

Private Properties

  • Property: _mode_state : [ModeState](./mode-state/) : (private)

    System mode state for tracking build mode changes.

    Automatically connects to mode changes to show/hide the UI appropriately.

  • Property: _systems_context : [GBSystemsContext](./gb-systems-context/) (private) - Context providing access to building system and other grid building systems.

  • Property: _logger : [GBLogger](./gb-logger/) (private) - Logger for diagnostic and error messages.

  • Property: _logic := PlaceableSelectionLogic.new() (private) - Shared logic for placeable selection behavior.

Public Methods

resolve_gb_dependencies

1
resolve_gb_dependencies(p_container : GBCompositionContainer) -> void

Called by GBChildInjector to resolve dependencies on the UI.

p_container: GBCompositionContainer - Container with system dependencies and configuration


rebuild

1
rebuild() -> void

Rebuild the UI after changing content type or assets at runtime


clear

1
clear() -> void

add_placeables

1
add_placeables(new_placeables : Array[Placeable]) -> void

Adds placeable options to the UI and updates the corresponding visuals.

new_placeables: Array[Placeable] - Array of new placeable resources to add to the UI


remove_placeables

1
remove_placeables(rem_placeables : Array[Placeable]) -> void

Removes placeable options from the UI and updates the corresponding visuals.

rem_placeables: Array[Placeable] - Array of placeable resources to remove from the UI


get_runtime_issues

1
get_runtime_issues() -> Array[String]

Run setup checks on the UI to ensure proper setup. Returns validation issues found during setup checks.

return: Array[String] - List of validation issues (empty if valid)


Private Methods

_ready

1
_ready() -> void

Flags: private


_load_assets

1
_load_assets() -> void

Flags: private

Load assets using GBAssetResolver for both placeables and sequences


_setup_tabs

1
_setup_tabs() -> void

Flags: private

Generate tabs for each category and populate each tab with content in unified grid layout


_get_placeables_with_tag

1
_get_placeables_with_tag(tag : Resource) -> Array[Placeable]

Flags: private


_get_sequences_with_tag

1
_get_sequences_with_tag(tag : Resource) -> Array[PlaceableSequence]

Flags: private


_create_mixed_content_grid

1
2
3
4
_create_mixed_content_grid(
    placeables_for_tag : Array[Placeable],
    sequences_for_tag : Array[PlaceableSequence]
) -> GridContainer

Flags: private

Creates a mixed content grid containing both placeables and sequences


_on_placeable_selected

1
_on_placeable_selected(p_placeable : Placeable) -> void

Flags: private


_on_sequence_entry_selected

1
_on_sequence_entry_selected(entry : PlaceableListEntry) -> void

Flags: private


_on_sequence_variant_changed

1
2
3
4
_on_sequence_variant_changed(
    entry : PlaceableListEntry,
    variant_index : int
) -> void

Flags: private


_on_mode_changed

1
_on_mode_changed(p_mode : GBEnums.Mode) -> void

Flags: private


_on_hidden

1
_on_hidden() -> void

Flags: private

When hidden, if in build mode, automatically switch to off mode


_validate_basic_components

1
_validate_basic_components() -> void

Flags: private

Get the current building system from systems context Validates basic required components are properly assigned


_validate_required_templates

1
_validate_required_templates() -> void

Flags: private

Validates only the templates that are needed based on loaded content


_get_building_system

1
_get_building_system() -> BuildingSystem

Flags: private


_enforce_template_height

1
_enforce_template_height(template_entry: Control) -> void

Flags: private

Enforces fixed height for consistent template sizing when fixed_template_height > 0.

When fixed_template_height is 0, height enforcement is disabled at the PlaceableSelectionUI level.


_constrain_template_icons

1
_constrain_template_icons(template_entry: Control) -> void

Flags: private

Constrains icon/image elements within templates to prevent height expansion


_find_nodes_by_type

1
2
3
4
_find_nodes_by_type(
    parent: Node,
    type_name: String
) -> Array[Node]

Flags: private

Recursively finds all nodes of a specific type within a parent node