fix(ui): adapt client to new ui-strings.yaml structure
The copy team rewrote ui-strings.yaml with multi-level nesting, renamed sections, and inline comments. Update the YAML parser to use a stack-based approach for arbitrary nesting depth, update HUD and interaction prompt to reference the new key names, and align tests with the new structure. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
+11
-3
@@ -13,12 +13,20 @@ func _ready() -> void:
|
||||
func update_from_hud_data(data: Dictionary) -> void:
|
||||
# Update perception mode display
|
||||
if data.has("perception_mode"):
|
||||
perception_label.text = UIStrings.get_text("hud.mode_label") + ": " + data.perception_mode.capitalize()
|
||||
var prefix := UIStrings.get_text("hud.perception_mode_prefix")
|
||||
if prefix.is_empty():
|
||||
perception_label.text = data.perception_mode.capitalize()
|
||||
else:
|
||||
perception_label.text = prefix + ": " + data.perception_mode.capitalize()
|
||||
|
||||
# Update time display (per D-031)
|
||||
if data.has("time"):
|
||||
time_label.text = UIStrings.get_text("hud.time_label") + ": " + data.time
|
||||
var prefix := UIStrings.get_text("hud.time_prefix")
|
||||
if prefix.is_empty():
|
||||
time_label.text = data.time
|
||||
else:
|
||||
time_label.text = prefix + ": " + data.time
|
||||
|
||||
# Update player health (from player data, not hud_data)
|
||||
func update_health(health: int) -> void:
|
||||
health_label.text = UIStrings.get_text("hud.health_label") + ": " + str(health)
|
||||
health_label.text = UIStrings.get_text("hud.health") + ": " + str(health)
|
||||
|
||||
@@ -40,7 +40,7 @@ func _show_prompt(interaction: Dictionary) -> void:
|
||||
|
||||
# v0.1: pick first verb (sorted by priority from server)
|
||||
var verb_label: String = verbs[0].get("label", "")
|
||||
var display_text: String = "%s - %s" % [UIStrings.get_text("interaction.prompt_prefix"), verb_label]
|
||||
var display_text: String = "E - %s" % verb_label
|
||||
|
||||
if _current_target_id != target_id or prompt_label.text != display_text:
|
||||
prompt_label.text = display_text
|
||||
|
||||
Reference in New Issue
Block a user