-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInventoryPanel.gd
More file actions
25 lines (19 loc) · 929 Bytes
/
Copy pathInventoryPanel.gd
File metadata and controls
25 lines (19 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
extends Panel
onready var tab_sound = preload("res://Sounds/tab_click.wav")
func _process(_delta):
$ScoreLabel.text = "%s / %s" % [Helper.format_number(Inventory.inventory_count()), Helper.format_number(Targets.max_inventory_worth)]
$ProgressBar.max_value = Targets.max_inventory_worth
$ProgressBar.value = Inventory.inventory_count()
if Inventory.inventory_count() > Targets.max_inventory_worth * 0.95:
$ScoreLabel.set("custom_colors/font_color", Color(255,0,0,1))
else:
$ScoreLabel.set("custom_colors/font_color", Color(1,1,1,1))
func tick():
for item in $TabContainer/Goods/ScrollContainer/VBoxContainer.get_children():
item.tick()
for item in $TabContainer/Raw/ScrollContainer/VBoxContainer.get_children():
item.tick()
for item in $TabContainer/Tools/ScrollContainer/VBoxContainer.get_children():
item.tick()
func _on_TabContainer_tab_selected(_tab):
Targets.play_sound(tab_sound)