VendorPanelUI ​
Refactored vendor panel that uses definition-based VendorSlotUI for shop display Left side: Vendor items (VendorSlotUI grid) Right side: Player inventory (InventoryUI for selling items back) Refactored to remove ui_manager references
Properties ​
bool | show_repair_button | true |
int | vendor_slots_per_row | 6 |
int | max_vendor_rows | 8 |
PackedScene | vendor_slot_scene | |
PackedScene | currency_display_scene |
Variables ​
VendorInventoryComponent | vendor_inventory | |
Entity | player_entity | |
bool | is_repair_mode | false |
Array[VendorSlotUI] | vendor_slots | [] |
Dictionary | currency_displays | {} # currency_id -> CurrencyDisplay |
Methods ​
void | initialize_ui( p_system_hub: GameHost.SystemHub ) |
void | setup_vendor_panel( vendor: VendorInventoryComponent, player: Entity ) |
void | clear_vendor_slots() |
void | close_panel() |
Signals ​
transaction_completed( success: bool, message: String ) ​
Emitted when a purchase or a sale ends: whether it worked and a message.
Property descriptions ​
bool show_repair_button = true ​
True shows the repair button.
int vendor_slots_per_row = 6 ​
How many vendor slots are in a row.
int max_vendor_rows = 8 ​
How many rows of vendor slots the panel shows.
PackedScene vendor_slot_scene ​
The scene of one vendor slot.
PackedScene currency_display_scene ​
The scene of one currency display.
Variable descriptions ​
VendorInventoryComponent vendor_inventory ​
The stock of the vendor.
Entity player_entity ​
The player who trades.
bool is_repair_mode = false ​
True while the player picks an item to repair.
Array[VendorSlotUI] vendor_slots = [] ​
Vendor slot management
Dictionary currency_displays = # currency_id -> CurrencyDisplay ​
Currency displays
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_vendor_panel( vendor: VendorInventoryComponent, player: Entity ) ​
Setup the vendor panel with vendor and player data
void clear_vendor_slots() ​
Clear all vendor slots
void close_panel() ​
Closes the window.