Resolve pending gameplay tickets
This commit is contained in:
parent
ec20778215
commit
c2ebbfaa2d
28 changed files with 618 additions and 188 deletions
|
|
@ -8,6 +8,8 @@ signal research_requested(id: String)
|
|||
@onready var status: Label = $StatusLabel
|
||||
@onready var resource_bar: Control = $Bar
|
||||
|
||||
var building_id: int = 0
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
super._ready()
|
||||
|
|
@ -15,13 +17,22 @@ func _ready() -> void:
|
|||
tree.node_confirmed.connect(func(id: String): research_requested.emit(id))
|
||||
|
||||
|
||||
func open_for(building_id: int) -> void:
|
||||
func open_for(next_building_id: int) -> void:
|
||||
building_id = next_building_id
|
||||
resource_bar.building_id = building_id
|
||||
var building: Dictionary = GameState.find_building(building_id)
|
||||
cost.set_payment_position(building.get("position", null))
|
||||
open_menu()
|
||||
tree.reset_scroll()
|
||||
refresh()
|
||||
|
||||
|
||||
func close_menu() -> void:
|
||||
super.close_menu()
|
||||
building_id = 0
|
||||
cost.set_payment_position(null)
|
||||
|
||||
|
||||
func selected_id() -> String:
|
||||
return String(tree.selected_id)
|
||||
|
||||
|
|
@ -31,6 +42,10 @@ func research_completed(id: String) -> void:
|
|||
refresh(id)
|
||||
|
||||
|
||||
func set_status(message: String) -> void:
|
||||
status.text = message
|
||||
|
||||
|
||||
func refresh(id: String = "") -> void:
|
||||
if id == "":
|
||||
id = String(tree.selected_id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue