Files
idle/core/currency/currency_panel.gd
Michele Rossi 81a4058b04 systems rework: buffs, prestige graph, research, modular architecture
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)
2026-05-07 20:36:21 +00:00

36 lines
1.0 KiB
GDScript

## Dynamically displays all currencies from the LevelGameState catalogue as CurrencyTile widgets.
class_name CurrencyPanel
extends PanelContainer
const CURRENCY_TILE_SCENE: PackedScene = preload("res://currency_tile.tscn")
@onready var _tiles_container: VBoxContainer = $CurrencyTiles
var _game_state: LevelGameState
func _ready() -> void:
_game_state = find_parent("LevelGameState")
if _game_state == null:
push_error("CurrencyPanel: No LevelGameState found in parent hierarchy")
return
_build_currency_tiles()
_game_state.ready.connect(_on_game_state_ready)
func _build_currency_tiles() -> void:
for child in _tiles_container.get_children():
child.queue_free()
if _game_state.currency_catalogue == null:
return
for currency in _game_state.currency_catalogue.currencies:
if currency == null:
continue
var tile: CurrencyTile = CURRENCY_TILE_SCENE.instantiate()
tile.currency = currency
tile.game_state = _game_state
_tiles_container.add_child(tile)
func _on_game_state_ready() -> void:
pass