diff --git a/interface/purchasable_item.gd b/interface/purchasable_item.gd index c130b48..817e5fb 100644 --- a/interface/purchasable_item.gd +++ b/interface/purchasable_item.gd @@ -1,6 +1,14 @@ extends Panel class_name PurchasableItem +## Icon of the item that can be purchased. +@export var item_icon: Texture2D: + get: + return item_icon + set(value): + item_icon = value + $Contents/Header/IconRect.texture = item_icon + ## Name of the item that can be purchased. @export var item_name: String: get: @@ -39,7 +47,17 @@ class_name PurchasableItem return can_buy set(value): can_buy = value - $Contents/Action/BuyButton.disabled = not can_buy + $Contents/Action/BuyButton.disabled = not (can_buy && has_unlocked) + +## Whether the player has unlocked this item for purchase. +## +## Used to force the player to follow the tech tree. +@export var has_unlocked: bool = true: + get: + return has_unlocked + set(value): + has_unlocked = value + $Contents/Action/BuyButton.disabled = not (can_buy && has_unlocked) ## Whether the player is currently buying this item. ## @@ -72,7 +90,6 @@ func _on_buy_button_pressed(): is_buying = true purchase_begin.emit() - func complete_purchase(): is_buying = false - purchase_success.emit() \ No newline at end of file + purchase_success.emit() diff --git a/interface/purchasable_item.tscn b/interface/purchasable_item.tscn index af7ba38..b4ab008 100644 --- a/interface/purchasable_item.tscn +++ b/interface/purchasable_item.tscn @@ -45,7 +45,7 @@ layout_mode = 2 layout_mode = 2 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 20 -text = "Garasaut" +text = "ITEMNAME" uppercase = true [node name="NamePaddingRight" type="Control" parent="Contents/Header"] @@ -69,7 +69,7 @@ layout_mode = 2 layout_mode = 2 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 12 -text = "Garasa tutte le auto della zona per ottenere upgrade" +text = "What does this item do? Nobody knows." autowrap_mode = 2 [node name="DescriptionPaddingRight" type="Control" parent="Contents/Description"] @@ -101,7 +101,7 @@ layout_mode = 2 layout_mode = 2 size_flags_horizontal = 3 theme_override_font_sizes/font_size = 8 -text = "3 copper coins" +text = "3 fiorygi" vertical_alignment = 1 [node name="CostLabelPaddingRight" type="Control" parent="Contents/Action"]