fix(@projects/@magic-civilization): 🐛 fix empty culture tree rendering
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
7a9e89b5c8
commit
b5957a43f4
2 changed files with 11 additions and 0 deletions
|
|
@ -81,6 +81,11 @@ func _ready() -> void:
|
|||
await get_tree().create_timer(1.5).timeout
|
||||
elif _scene == "culture_tree_proof":
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
# DataLoader.load_theme must run before the proof scene constructs
|
||||
# its CultureWeb — without it `get_all_culture()` is empty and the
|
||||
# tree renders blank.
|
||||
if DataLoader.get_all_culture().is_empty():
|
||||
DataLoader.load_theme("age-of-dwarves")
|
||||
get_tree().change_scene_to_file(
|
||||
"res://engine/scenes/tests/culture_tree_proof.tscn"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,12 @@ func _ready() -> void:
|
|||
if not env_name.is_empty():
|
||||
_screenshot_name = env_name
|
||||
|
||||
# Ensure DataLoader is populated before TurnManager.get_culture_web()
|
||||
# tries to build from `get_all_culture()`. Idempotent — every other
|
||||
# proof scene calls this for the same reason.
|
||||
if DataLoader.get_all_culture().is_empty():
|
||||
DataLoader.load_theme("age-of-dwarves")
|
||||
|
||||
await get_tree().process_frame
|
||||
_setup_game_state()
|
||||
_show_culture_tree()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue