CraftingPanelUI ​
Enhanced crafting panel that integrates with the existing UI system Handles multiple schools, recipe selection, material display, and crafting queue Uses Tween for smooth progress bar animation instead of polling Refactored to extend PanelUI instead of MarginContainer
Properties ​
PackedScene | craft_material_icon_scene | |
PackedScene | recipe_button_scene |
Variables ​
CraftingInteraction | current_interaction | null |
Player | current_player | null |
CraftSchoolDefinition | current_school | null |
CraftingRecipeDefinition | selected_recipe | null |
Array[Button] | recipe_buttons | [] |
Array[Node] | recipe_button_scenes | [] |
Array[CraftMaterialIconUI] | material_icons | [] |
CraftingJob | active_craft_job | null |
Tween | progress_tween | null |
bool | is_crafting | false |
CraftingManager | crafting_manager |
Methods ​
void | initialize_ui( p_system_hub: GameHost.SystemHub ) |
void | setup_crafting_panel( interaction: CraftingInteraction, player: Player, school: CraftSchoolDefinition ) |
void | close_panel() |
void | on_craft_completed( job: CraftingJob ) |
void | on_craft_cancelled( job: CraftingJob ) |
Signals ​
crafting_started( recipe: CraftingRecipeDefinition, quantity: int ) ​
========== SIGNALS ========== Note: window_closed signal is now inherited from PanelUI
crafting_cancelled() ​
Emitted when the crafting is cancelled.
Property descriptions ​
PackedScene craft_material_icon_scene ​
========== PRELOADED SCENES ==========
PackedScene recipe_button_scene ​
The scene of one recipe in the list.
Variable descriptions ​
CraftingInteraction current_interaction = null ​
========== DATA PROPERTIES ==========
Player current_player = null ​
The player who crafts.
CraftSchoolDefinition current_school = null ​
The craft school shown.
CraftingRecipeDefinition selected_recipe = null ​
The recipe picked.
Array[Button] recipe_buttons = [] ​
The buttons of the recipes in the list.
Array[Node] recipe_button_scenes = [] ​
The recipe scenes in the list.
Array[CraftMaterialIconUI] material_icons = [] ​
The icons of the materials of the recipe.
CraftingJob active_craft_job = null ​
The job that is crafting now.
Tween progress_tween = null ​
Progress tween for smooth animation
bool is_crafting = false ​
Button state tracking
CraftingManager crafting_manager ​
SystemRefs
Method descriptions ​
void initialize_ui( p_system_hub: GameHost.SystemHub ) ​
Sets the part up with the hub of the game systems: connects the signals it listens to and fills it.
void setup_crafting_panel( interaction: CraftingInteraction, player: Player, school: CraftSchoolDefinition ) ​
Setup the crafting panel with interaction data
void close_panel() ​
Close the crafting panel - overrides PanelUI's close_panel
void on_craft_completed( job: CraftingJob ) ​
Handle craft completion
void on_craft_cancelled( job: CraftingJob ) ​
Handle craft cancellation