Phase 19 — onboarding: hint tour + Help modal + tooltip pass
Three-agent fan-out (gdscript-refactor x3) ships the chosen Phase 19 approach: contextual hints during first session + a Help reference, plus a sweep of hover tooltips for desktop discoverability. - HintSystem (autoload) + HintOverlay (layer 22 top-center banner): 7-step tour gated on player events — welcome (boot+2s), pawn select, build drawer open, stockpile painted, work matrix open, day_ended, tour_complete. Per-hint dismissals persist as Array[String] in GameState.settings['dismissed_hints']. Max-3 FIFO queue if hints chain. Reduce-motion path snaps in/out instead of tweening. Reset_tour() public API for the Help modal. - HelpModal (layer 20): 5-tab static reference (Controls / Verbs / Priorities / Storyteller / Tips). Opens via EventBus.help_requested, dimmed backdrop, X/Esc/backdrop-tap dismiss. SettingsMenu gains an 'Onboarding' section: Show-hints checkbox, Help button (emits help_requested), Reset hints button (calls HintSystem.reset_tour with has_method guard). Pre-existing 'W' keybind reference fixed to 'P'. - Tooltip pass: tooltip_text via Strings.t on every TopBar button (10 buttons incl. speed shortcuts), BuildDrawer FAB, and every tool button in BuildDrawer (21 tools). _add_tool_btn extended with optional tooltip param. ~34 new tooltip.* string keys. Contracts pre-written (Opus): EventBus.help_requested, hint_dismissed, ui_panel_opened signals; GameState show_hints + dismissed_hints defaults; BuildDrawer.open + WorkPriorityMatrix.open emit ui_panel_opened so HintSystem can subscribe via one signal. Also recorded [MED] known bug in memory.md: drag-paint with active paint tool is eaten by camera drag-pan. MCP runtime verified: welcome banner fires 2s after boot, dismiss queues build_drawer hint on next ui_panel_opened, dismissed_hints persisted as ['welcome'], HelpModal opens via help_requested with tab switching working (Controls → Tips verified visually). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
bba1ce4334
commit
59ca6ba9c5
16 changed files with 844 additions and 22 deletions
|
|
@ -63,6 +63,7 @@ func _ready() -> void:
|
|||
|
||||
func open() -> void:
|
||||
_set_panel_visible(true)
|
||||
EventBus.ui_panel_opened.emit(&"build_drawer")
|
||||
Audit.log("build_drawer", "opened (tab=%d)" % _active_tab)
|
||||
|
||||
|
||||
|
|
@ -94,6 +95,7 @@ func _build_ui() -> void:
|
|||
_fab.text = "+"
|
||||
_fab.custom_minimum_size = Vector2(FAB_SIZE, FAB_SIZE)
|
||||
_fab.focus_mode = Control.FOCUS_NONE
|
||||
_fab.tooltip_text = Strings.t(&"tooltip.fab_build")
|
||||
_fab.set_anchors_preset(Control.PRESET_BOTTOM_RIGHT)
|
||||
_fab.offset_left = -FAB_SIZE - 8
|
||||
_fab.offset_right = -8
|
||||
|
|
@ -177,11 +179,11 @@ func _build_designate_tab() -> Control:
|
|||
var flow := _make_flow_grid()
|
||||
box.add_child(flow)
|
||||
|
||||
_add_tool_btn(flow, Strings.t(&"tool.chop"), &"chop", func() -> void: _activate(&"chop", &"", Strings.t(&"tool.chop")))
|
||||
_add_tool_btn(flow, Strings.t(&"tool.mine"), &"mine", func() -> void: _activate(&"mine", &"", Strings.t(&"tool.mine")))
|
||||
_add_tool_btn(flow, Strings.t(&"tool.dig_grave"), &"dig_grave", func() -> void: _activate(&"dig_grave", &"", Strings.t(&"tool.dig_grave")))
|
||||
_add_tool_btn(flow, Strings.t(&"tool.no_roof"), &"no_roof", func() -> void: _activate(&"no_roof", &"", Strings.t(&"tool.no_roof")))
|
||||
_add_tool_btn(flow, Strings.t(&"tool.plant_tree"), &"plant_tree", func() -> void: _activate(&"plant_tree", &"", Strings.t(&"tool.plant_tree")))
|
||||
_add_tool_btn(flow, Strings.t(&"tool.chop"), &"chop", func() -> void: _activate(&"chop", &"", Strings.t(&"tool.chop")), Strings.t(&"tooltip.tool.chop"))
|
||||
_add_tool_btn(flow, Strings.t(&"tool.mine"), &"mine", func() -> void: _activate(&"mine", &"", Strings.t(&"tool.mine")), Strings.t(&"tooltip.tool.mine"))
|
||||
_add_tool_btn(flow, Strings.t(&"tool.dig_grave"), &"dig_grave", func() -> void: _activate(&"dig_grave", &"", Strings.t(&"tool.dig_grave")), Strings.t(&"tooltip.tool.dig_grave"))
|
||||
_add_tool_btn(flow, Strings.t(&"tool.no_roof"), &"no_roof", func() -> void: _activate(&"no_roof", &"", Strings.t(&"tool.no_roof")), Strings.t(&"tooltip.tool.no_roof"))
|
||||
_add_tool_btn(flow, Strings.t(&"tool.plant_tree"), &"plant_tree", func() -> void: _activate(&"plant_tree", &"", Strings.t(&"tool.plant_tree")), Strings.t(&"tooltip.tool.plant_tree"))
|
||||
|
||||
return box
|
||||
|
||||
|
|
@ -198,15 +200,15 @@ func _build_build_tab() -> Control:
|
|||
var st := _make_section_column(Strings.t(&"ui.build_drawer.section.structures"))
|
||||
var st_grid := st.get_child(1) as GridContainer
|
||||
_add_tool_btn(st_grid, Strings.t(&"tool.build_wall_stone"), &"build_wall_stone",
|
||||
func() -> void: _activate_wall(&"stone"))
|
||||
func() -> void: _activate_wall(&"stone"), Strings.t(&"tooltip.tool.build_wall_stone"))
|
||||
_add_tool_btn(st_grid, Strings.t(&"tool.build_wall_wood"), &"build_wall_wood",
|
||||
func() -> void: _activate_wall(&"wood"))
|
||||
func() -> void: _activate_wall(&"wood"), Strings.t(&"tooltip.tool.build_wall_wood"))
|
||||
_add_tool_btn(st_grid, Strings.t(&"tool.build_door"), &"build_door",
|
||||
func() -> void: _activate(&"build_door", &"", Strings.t(&"tool.build_door")))
|
||||
func() -> void: _activate(&"build_door", &"", Strings.t(&"tool.build_door")), Strings.t(&"tooltip.tool.build_door"))
|
||||
_add_tool_btn(st_grid, Strings.t(&"tool.build_floor_wood"), &"build_floor_wood",
|
||||
func() -> void: _activate_floor(&"wood"))
|
||||
func() -> void: _activate_floor(&"wood"), Strings.t(&"tooltip.tool.build_floor_wood"))
|
||||
_add_tool_btn(st_grid, Strings.t(&"tool.build_floor_stone"), &"build_floor_stone",
|
||||
func() -> void: _activate_floor(&"stone"))
|
||||
func() -> void: _activate_floor(&"stone"), Strings.t(&"tooltip.tool.build_floor_stone"))
|
||||
row.add_child(st)
|
||||
row.add_child(VSeparator.new())
|
||||
|
||||
|
|
@ -214,11 +216,11 @@ func _build_build_tab() -> Control:
|
|||
var fu := _make_section_column(Strings.t(&"ui.build_drawer.section.furniture"))
|
||||
var fu_grid := fu.get_child(1) as GridContainer
|
||||
_add_tool_btn(fu_grid, Strings.t(&"tool.build_crate"), &"build_crate",
|
||||
func() -> void: _activate(&"build_crate", &"", Strings.t(&"tool.build_crate")))
|
||||
func() -> void: _activate(&"build_crate", &"", Strings.t(&"tool.build_crate")), Strings.t(&"tooltip.tool.build_crate"))
|
||||
_add_tool_btn(fu_grid, Strings.t(&"tool.build_bed"), &"build_bed",
|
||||
func() -> void: _activate(&"build_bed", &"", Strings.t(&"tool.build_bed")))
|
||||
func() -> void: _activate(&"build_bed", &"", Strings.t(&"tool.build_bed")), Strings.t(&"tooltip.tool.build_bed"))
|
||||
_add_tool_btn(fu_grid, Strings.t(&"tool.build_torch"), &"build_torch",
|
||||
func() -> void: _activate(&"build_torch", &"", Strings.t(&"tool.build_torch")))
|
||||
func() -> void: _activate(&"build_torch", &"", Strings.t(&"tool.build_torch")), Strings.t(&"tooltip.tool.build_torch"))
|
||||
row.add_child(fu)
|
||||
row.add_child(VSeparator.new())
|
||||
|
||||
|
|
@ -227,24 +229,30 @@ func _build_build_tab() -> Control:
|
|||
var pr_grid := pr.get_child(1) as GridContainer
|
||||
_add_tool_btn(pr_grid, Strings.t(&"tool.workbench_carpenter"),
|
||||
&"build_workbench_carpenter",
|
||||
func() -> void: _activate(&"build_workbench_carpenter", &"", Strings.t(&"tool.workbench_carpenter")))
|
||||
func() -> void: _activate(&"build_workbench_carpenter", &"", Strings.t(&"tool.workbench_carpenter")),
|
||||
Strings.t(&"tooltip.tool.build_workbench_carpenter"))
|
||||
_add_tool_btn(pr_grid, Strings.t(&"tool.workbench_smelter"),
|
||||
&"build_workbench_smelter",
|
||||
func() -> void: _activate(&"build_workbench_smelter", &"", Strings.t(&"tool.workbench_smelter")))
|
||||
func() -> void: _activate(&"build_workbench_smelter", &"", Strings.t(&"tool.workbench_smelter")),
|
||||
Strings.t(&"tooltip.tool.build_workbench_smelter"))
|
||||
_add_tool_btn(pr_grid, Strings.t(&"tool.workbench_millstone"),
|
||||
&"build_workbench_millstone",
|
||||
func() -> void: _activate(&"build_workbench_millstone", &"", Strings.t(&"tool.workbench_millstone")))
|
||||
func() -> void: _activate(&"build_workbench_millstone", &"", Strings.t(&"tool.workbench_millstone")),
|
||||
Strings.t(&"tooltip.tool.build_workbench_millstone"))
|
||||
_add_tool_btn(pr_grid, Strings.t(&"tool.workbench_hearth"),
|
||||
&"build_workbench_hearth",
|
||||
func() -> void: _activate(&"build_workbench_hearth", &"", Strings.t(&"tool.workbench_hearth")))
|
||||
func() -> void: _activate(&"build_workbench_hearth", &"", Strings.t(&"tool.workbench_hearth")),
|
||||
Strings.t(&"tooltip.tool.build_workbench_hearth"))
|
||||
_add_tool_btn(pr_grid, Strings.t(&"tool.workbench_cremation_pyre"),
|
||||
&"build_workbench_cremation_pyre",
|
||||
func() -> void: _activate(&"build_workbench_cremation_pyre", &"", Strings.t(&"tool.workbench_cremation_pyre")))
|
||||
func() -> void: _activate(&"build_workbench_cremation_pyre", &"", Strings.t(&"tool.workbench_cremation_pyre")),
|
||||
Strings.t(&"tooltip.tool.build_workbench_cremation_pyre"))
|
||||
# Quarry — must be painted on a stone outcrop (BigRockNode); world.gd
|
||||
# rejects placements on plain ground.
|
||||
_add_tool_btn(pr_grid, Strings.t(&"tool.paint_quarry"),
|
||||
&"paint_quarry",
|
||||
func() -> void: _activate(&"paint_quarry", &"", Strings.t(&"tool.paint_quarry")))
|
||||
func() -> void: _activate(&"paint_quarry", &"", Strings.t(&"tool.paint_quarry")),
|
||||
Strings.t(&"tooltip.tool.paint_quarry"))
|
||||
row.add_child(pr)
|
||||
|
||||
return row
|
||||
|
|
@ -259,9 +267,11 @@ func _build_stockpile_tab() -> Control:
|
|||
box.add_child(flow)
|
||||
|
||||
_add_tool_btn(flow, Strings.t(&"tool.stockpile_general"), &"paint_stockpile",
|
||||
func() -> void: _activate(&"paint_stockpile", &"", Strings.t(&"tool.stockpile_general")))
|
||||
func() -> void: _activate(&"paint_stockpile", &"", Strings.t(&"tool.stockpile_general")),
|
||||
Strings.t(&"tooltip.tool.paint_stockpile"))
|
||||
_add_tool_btn(flow, Strings.t(&"tool.graveyard"), &"graveyard",
|
||||
func() -> void: _activate(&"graveyard", &"", Strings.t(&"tool.graveyard")))
|
||||
func() -> void: _activate(&"graveyard", &"", Strings.t(&"tool.graveyard")),
|
||||
Strings.t(&"tooltip.tool.graveyard"))
|
||||
|
||||
return box
|
||||
|
||||
|
|
@ -332,10 +342,13 @@ const _THUMB_SCRIPT: Script = preload("res://scenes/ui/build_drawer_thumb.gd")
|
|||
## Add a single tool button to `container`. The button is a VBoxContainer of
|
||||
## [thumb preview + Label] wrapped in a Button so the whole cell is one touch
|
||||
## target. `tool_id` drives the procedural preview shape (BuildDrawerThumb).
|
||||
func _add_tool_btn(container: Control, label_text: String, tool_id: StringName, callback: Callable) -> void:
|
||||
## `tooltip` is optional — set it for desktop discoverability; ignored on touch.
|
||||
func _add_tool_btn(container: Control, label_text: String, tool_id: StringName, callback: Callable, tooltip: String = "") -> void:
|
||||
var btn := Button.new()
|
||||
btn.custom_minimum_size = Vector2(BTN_SIZE, BTN_SIZE + LABEL_HEIGHT)
|
||||
btn.focus_mode = Control.FOCUS_NONE
|
||||
if tooltip != "":
|
||||
btn.tooltip_text = tooltip
|
||||
|
||||
var vb := VBoxContainer.new()
|
||||
vb.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue