Decouples core systems from centralized globals in favor of catalogue-based architecture and data-driven content. Key changes: - Prestige: node-based buff tech tree, graph panel, progress bar - Research: multi-worker system, per-generator research, xp generation - Ascension: meta-currency layer via multi-currency prestige resets - Buffs: refactored as generator-independent via catalogues - UI: currency panel, edge-scrolling camera + zoom, current-goal panel - Alchemy Tower: crafting building with recipe/cost system - Testing: 7 test suites (ascension, prestige, research, goals) - Content: migrated from hardcoded idles/ to gym format (tiny_sword)
28 lines
966 B
GDScript
28 lines
966 B
GDScript
class_name WorkerSummaryLabel
|
|
extends Label
|
|
|
|
@onready var _game_state: LevelGameState = find_parent("LevelGameState")
|
|
|
|
signal research_workers_changed(new_count: int)
|
|
|
|
func _ready() -> void:
|
|
if _game_state == null:
|
|
push_error("WorkerSummaryLabel: Could not find LevelGameState parent")
|
|
return
|
|
|
|
_game_state.currency_changed.connect(_on_currency_changed)
|
|
_game_state.research_workers_changed.connect(_on_research_workers_changed)
|
|
_update_worker_display()
|
|
|
|
func _on_currency_changed(currency_id: StringName, _new_amount: BigNumber) -> void:
|
|
if currency_id == "worker":
|
|
_update_worker_display()
|
|
|
|
func _on_research_workers_changed(new_count: int) -> void:
|
|
_update_worker_display()
|
|
|
|
func _update_worker_display() -> void:
|
|
var worker_currency: int = int(_game_state.get_currency_amount_by_id("worker").mantissa)
|
|
var research_workers: int = _game_state.get_research_workers()
|
|
text = "Workers: %d available, %d assigned" % [worker_currency, research_workers]
|