Refactor production request handling: implement queuing mechanism and improve production application logic
This commit is contained in:
+6
-1
@@ -315,7 +315,11 @@ func _page_action_pressed(page_id: int, action_amount) -> void:
|
||||
var item_id: String = g_active_items[page_id].item_id
|
||||
|
||||
if E.gt(action_amount, 0):
|
||||
owniverse.request_production(item_id, action_amount)
|
||||
if owniverse.request_production(item_id, action_amount):
|
||||
page_actions[page_id].mark_pending(action_amount)
|
||||
|
||||
func _on_owniverse_production_applied(_item_id: String) -> void:
|
||||
active_actions_dirty = true
|
||||
|
||||
|
||||
#endregion
|
||||
@@ -345,6 +349,7 @@ func _enable_interface_sounds() -> void:
|
||||
func create_new_universe() -> void:
|
||||
var previous: Owniverse = owniverse
|
||||
owniverse = Owniverse.new()
|
||||
owniverse.production_applied.connect(_on_owniverse_production_applied)
|
||||
var inited_result: Dictionary = init_enitities()
|
||||
locked_items = inited_result.locked_items
|
||||
|
||||
|
||||
Reference in New Issue
Block a user