Implement asynchronous save manager with UI update optimizations and add tests for save functionality
This commit is contained in:
@@ -14,6 +14,8 @@ var _group_members: Dictionary = {}
|
||||
var _indexed_entity_count: int = -1
|
||||
|
||||
var items_to_update: Dictionary[String, float] = {}
|
||||
var defer_item_updates: bool = false
|
||||
var item_amounts_dirty: bool = true
|
||||
|
||||
var auto_production: Array = []
|
||||
var locked_entities: Array = []
|
||||
@@ -146,8 +148,12 @@ func get_item_amounts(total_produced: bool = false) -> Dictionary[String, float]
|
||||
return result
|
||||
|
||||
|
||||
func refresh_item_amounts() -> void:
|
||||
func refresh_item_amounts(force: bool = false) -> void:
|
||||
item_amounts_dirty = true
|
||||
if defer_item_updates and not force:
|
||||
return
|
||||
items_to_update = get_item_amounts()
|
||||
item_amounts_dirty = false
|
||||
|
||||
|
||||
func _add_time_delta(delta: float) -> Dictionary:
|
||||
|
||||
Reference in New Issue
Block a user