Added descriptions to upgrades and fixed timer not stopping bug

This commit is contained in:
2024-05-11 12:26:07 +01:00
parent b180483437
commit 9fc8367dd3
12 changed files with 162 additions and 48 deletions
+10
View File
@@ -5,6 +5,10 @@ class_name PermUpgrade
@export var Name : String = ""
@export var GlobalVariable : String = ""
@export var BaseCost : int = 10
@export var Description : String = ""
signal mouse_enter(description : String)
signal mouse_leave()
@onready var Level1 = $Container/Level1
@onready var Level2 = $Container/Level2
@@ -72,3 +76,9 @@ func _on_cost_pressed() -> void:
func _on_upgrade_tokens_updated(qty : int) -> void:
update()
func _on_mouse_entered() -> void:
mouse_enter.emit(Description)
func _on_mouse_exited() -> void:
mouse_leave.emit()
+4
View File
@@ -8,6 +8,8 @@
[node name="PermUpgrade" type="PanelContainer"]
offset_right = 128.0
offset_bottom = 26.0
theme = ExtResource("2_ie5gk")
theme_type_variation = &"UpgradeContainer"
script = ExtResource("1_g7x2d")
[node name="Container" type="VBoxContainer" parent="."]
@@ -80,4 +82,6 @@ layout_mode = 2
theme = ExtResource("2_ie5gk")
text = "10"
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
[connection signal="pressed" from="Container/Cost" to="." method="_on_cost_pressed"]