Phase 17/18 closure: stockpile filter UI + day summary + atmospheric audio

Three-agent fan-out (gdscript-refactor x3) closing deferred polish:

- Stockpile chip filter UI: new StockpilePanel (layer 18, right-anchored,
  mirrors WorkbenchPanel). 5-priority segmented control + 21-chip 4-col
  filter grid using Item.ALL_TYPES; wildcard (empty accepted_types) shows
  all chips checked with 'All' hint, first explicit pick switches to
  explicit-list mode. Selection chain extended to pawn → workbench →
  stockpile with mutual exclusion. 12 ui.stockpile.* + 13 item.* keys.

- DaySummaryCard: layer-19 modal auto-opens at dusk→night via day_ended,
  auto-pauses sim, shows day+season header, weather row, stats grid with
  green/yellow/red tension bar, Continue dismiss + backdrop tap.
  Settings 'Show end-of-day summary' toggle persists via GameState.

- Atmospheric audio: rain ambient loop (Cozy Melodies Pack 6) on
  weather_changed rain/storm with 0.5s fade-out on clear; thunder sting
  (Magic and Spells 6) on rain→storm transition; raid warning sting
  (Sword Pack 1, 'blades drawn') on EventBus.wolf_spawned. All on SFX
  bus — inherits existing slider + suspend mute.

Contracts pre-written before fan-out: EventBus.stockpile_selected /
stockpile_deselected / wolf_spawned signals; WolfSpawner._trigger_raid
+ _on_request_wolf_spawn now emit wolf_spawned with the spawned array.

MCP runtime verified: StockpilePanel opens with 21 chips, DaySummaryCard
renders weather row + tension bar + auto-pause, rain_player.playing=true
on weather_changed(rain), all three new SFX keys in Audio.SFX_FILES.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
megaproxy 2026-05-16 17:20:40 +01:00
parent 88e3fa9364
commit bba1ce4334
18 changed files with 935 additions and 18 deletions

View file

@ -20,6 +20,7 @@ const RESUME_TOAST_SCRIPT: Script = preload("res://scenes/ui/resume_toa
# Phase 17 — PawnDetailPanel (layer 18) and SettingsMenu (layer 26).
const PAWN_DETAIL_PANEL_SCRIPT: Script = preload("res://scenes/ui/pawn_detail_panel.gd")
const WORKBENCH_PANEL_SCRIPT: Script = preload("res://scenes/ui/workbench_panel.gd")
const STOCKPILE_PANEL_SCRIPT: Script = preload("res://scenes/ui/stockpile_panel.gd")
const MEDIEVAL_THEME_SCRIPT: Script = preload("res://scenes/ui/medieval_theme.gd")
# Built once in _ready and re-applied to any CanvasLayer-rooted Control because
@ -31,6 +32,8 @@ const BUILD_DRAWER_SCRIPT: Script = preload("res://scenes/ui/build_draw
# Phase 17 (Agent C) — WorkPriorityMatrix (layer 17) and AlertsLog (layer 19).
const WORK_PRIORITY_MATRIX_SCRIPT: Script = preload("res://scenes/ui/work_priority_matrix.gd")
const ALERTS_LOG_SCRIPT: Script = preload("res://scenes/ui/alerts_log.gd")
# Phase 17 — DaySummaryCard end-of-day recap modal (layer 19).
const DAY_SUMMARY_CARD_SCRIPT: Script = preload("res://scenes/ui/day_summary_card.gd")
func _ready() -> void:
@ -99,6 +102,13 @@ func _ready() -> void:
workbench_panel.name = "WorkbenchPanel"
add_child(workbench_panel)
# Stockpile filter + priority editor. Right-anchored 360 px, layer 18;
# mutually exclusive with PawnDetailPanel and WorkbenchPanel via Selection.
var stockpile_panel := CanvasLayer.new()
stockpile_panel.set_script(STOCKPILE_PANEL_SCRIPT)
stockpile_panel.name = "StockpilePanel"
add_child(stockpile_panel)
var settings_menu := CanvasLayer.new()
settings_menu.set_script(SETTINGS_MENU_SCRIPT)
settings_menu.name = "SettingsMenu"
@ -169,6 +179,14 @@ func _ready() -> void:
Audit.log("main", "Phase 17 (Agent C) — WorkPriorityMatrix + AlertsLog mounted.")
# Phase 17 — DaySummaryCard (layer 19) — auto-opens on day_ended signal.
var day_summary_card := CanvasLayer.new()
day_summary_card.set_script(DAY_SUMMARY_CARD_SCRIPT)
day_summary_card.name = "DaySummaryCard"
add_child(day_summary_card)
Audit.log("main", "Phase 17 — DaySummaryCard mounted.")
# Apply the medieval theme to every Control under each CanvasLayer.
# CanvasLayers interrupt the root-Window theme cascade so we have to seed
# each one explicitly. Defer one frame so panels that build their UI in