-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove inventory button and created a gold label (#142)
* removed the button to access the inventory and added a label to show gold amount
- Loading branch information
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
extends Label | ||
## Gold counter display in the top right. Should handle updates when gold changes | ||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready() -> void: | ||
update_gold_text(InventoryManager.gold_component.get_gold_amount()) | ||
InventoryManager.gold_component.gold_changed.connect(update_gold_text) | ||
|
||
func update_gold_text(new_gold_amount : int) -> void: | ||
text = "Gold : " + str(new_gold_amount) |