Skip to content

CraftingPanelUI ​

Inherits: PanelUI < Control

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 ​

PackedScenecraft_material_icon_scene
PackedScenerecipe_button_scene

Variables ​

CraftingInteractioncurrent_interactionnull
Playercurrent_playernull
CraftSchoolDefinitioncurrent_schoolnull
CraftingRecipeDefinitionselected_recipenull
Array[Button]recipe_buttons[]
Array[Node]recipe_button_scenes[]
Array[CraftMaterialIconUI]material_icons[]
CraftingJobactive_craft_jobnull
Tweenprogress_tweennull
boolis_craftingfalse
CraftingManagercrafting_manager

Methods ​

voidinitialize_ui( p_system_hub: GameHost.SystemHub )
voidsetup_crafting_panel( interaction: CraftingInteraction, player: Player, school: CraftSchoolDefinition )
voidclose_panel()
voidon_craft_completed( job: CraftingJob )
voidon_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