Route UI labels through the string table
Full build / Import + headless tests (push) Successful in 38s
Full build / Full desktop build + optional release (push) Skipped

Move start menu, settings, pause, Help, HUD, radio, shift review and campaign
labels/templates into content/strings.en.json, including placeholder-validated
dynamic status text. No player-facing hardcoded labels remain outside dynamic
data/debug output. Headless 250/250, docs check OK.
This commit is contained in:
zwitschi committed 2026-11-02 11:25:15 +01:00
1 parent 3a74cedee0
commit af923b1483
10 files changed
+179 -89

No files matched your search

+16 -16
View File
@@ -38,7 +38,7 @@ func _init() -> void:
root.add_child(center)
var title := Label.new()
title.text = "Shift Review"
title.text = Strings.lookup("review.title")
title.add_theme_font_size_override("font_size", 28)
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
center.add_child(title)
@@ -55,7 +55,7 @@ func _init() -> void:
center.add_child(_campaign_label)
_continue_button = Button.new()
_continue_button.text = "Continue campaign"
_continue_button.text = Strings.lookup("review.continue_campaign")
_continue_button.pressed.connect(func(): continue_requested.emit())
_continue_button.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
center.add_child(_continue_button)
@@ -126,28 +126,28 @@ func show_review(review: Dictionary, scenario: Resource, history: Array = [],
var g: String = rep.get("grade", "?")
if not past_grades.has(g):
past_grades.append(g)
history_line = "Shifts on record: %d · best score: %.0f · grades seen: %s" % [
history.size(), best, ", ".join(past_grades)]
history_line = Strings.fmt("review.history", [
history.size(), best, ", ".join(past_grades)])
var lines: Array[String] = [
"Venue: %s" % (scenario.display_name if scenario else review.get("scenario_id", "")),
"Policy: %s" % (scenario.policy_summary if scenario else "See venue policy."),
"Grade: %s Score: %.0f/100" % [reputation.get("grade", "?"), reputation.get("rating", 0.0)],
Strings.fmt("review.venue", [scenario.display_name if scenario else review.get("scenario_id", "")]),
Strings.fmt("review.policy", [scenario.policy_summary if scenario else "See venue policy."]),
Strings.fmt("review.grade", [reputation.get("grade", "?"), reputation.get("rating", 0.0)]),
history_line,
"Incidents handled: %d (peaceful %d)" % [incident_list.size(), peaceful],
"NPCs encountered: %d" % review.get("spawned_count", 0),
"Radio battery: %.0f%% emergency cooldown: %.0fs" % [radio.get("battery", 0.0), radio.get("emergency_cooldown_s", 0.0)],
"Crowd mood: %.0f%% (panic: %s)" % [crowd.get("mood", 0.0) * 100.0, str(crowd.get("panic", false))],
Strings.fmt("review.incidents", [incident_list.size(), peaceful]),
Strings.fmt("review.npcs", [review.get("spawned_count", 0)]),
Strings.fmt("review.radio", [radio.get("battery", 0.0), radio.get("emergency_cooldown_s", 0.0)]),
Strings.fmt("review.crowd", [crowd.get("mood", 0.0) * 100.0, str(crowd.get("panic", false))]),
Strings.fmt("review.responder", [", ".join(outcomes) if outcomes.size() > 0 else Strings.lookup("review.none")]),
Strings.fmt("review.investigations", [" | ".join(investigations) if investigations.size() > 0 else Strings.lookup("review.none")]),
"",
"Highlights:",
Strings.lookup("review.highlights"),
]
var mods: Array = reputation.get("modifiers", [])
var shown := 0
for mod in mods:
var delta: float = float(mod.get("delta", 0.0))
lines.append(" %s (%+.0f) %s" % [mod.get("category", ""), delta, mod.get("reason", "")])
lines.append(Strings.fmt("review.modifier", [str(mod.get("category", "")), "%+.0f" % delta, str(mod.get("reason", ""))]))
shown += 1
if shown >= 12:
break
@@ -156,11 +156,11 @@ func show_review(review: Dictionary, scenario: Resource, history: Array = [],
var campaign_complete := bool(campaign_summary.get("complete", false))
if _campaign_label:
if campaign_complete:
_campaign_label.text = "Campaign complete. Free-play venues remain available."
_campaign_label.text = Strings.lookup("review.campaign_complete")
elif next_venue != "":
_campaign_label.text = "Campaign shift %d complete · next: %s" % [
_campaign_label.text = Strings.fmt("review.campaign_next", [
int(campaign_summary.get("shift_number", 1)) - 1,
next_venue.replace("_", " ").capitalize()]
next_venue.replace("_", " ").capitalize()])
else:
_campaign_label.text = ""
if _continue_button: