Add action buttons and related functionality; refactor production logic and update entity definitions

This commit is contained in:
Kirill
2026-06-03 23:26:44 +03:00
parent c21048add3
commit 934d890887
11 changed files with 253 additions and 25 deletions
+33
View File
@@ -0,0 +1,33 @@
extends HBoxContainer
class_name OwniverseAction
signal action_pressed(page_id, amount: float)
@onready var action_labels: Array = [
$ActionControl0/Label,
$ActionControl1/Label,
$ActionControl2/Label,
$ActionControl3/Label,
$ActionControl4/Label,
]
var page_id: int = -1
var action_values: Dictionary = {
0: 0,
1: 0,
2: 0,
3: 0,
4: 0,
}
func set_action_values(values: Array) -> void:
for ind in range(0, 5):
action_values[ind] = values[ind]
action_labels[ind].text = str(values[ind]) if values[ind] > 0 else ""
func _on_action_button_pressed(button_id: int) -> void:
action_pressed.emit(page_id, action_values[button_id])