Style the rest of the interface: panels, sliders, scrollbars, cards
ci / verify (push) Successful in 48s
ci / verify (push) Successful in 48s
Buttons were the easy half. This is everything else. Dialogs sit on panels now rather than being text over a dimmed world -- the pause menu, character select, upgrades, settings and credits all root through UiTheme.dialog_panel(). The panel stylebox is the pack's frame MODULATED DARK. The set is cream throughout, which is right for buttons and wrong for a dialog over a dark dungeon; tinting keeps the pixel border and the corner shape and lets every label the game already draws in light colours stay readable, instead of recolouring every label in five screens to suit the art. Sliders and scrollbars are the pack's too, section headings sit on its banner ribbon, and an upgrade card's rarity is now its frame rather than a word on it -- three choices are compared at a glance and a colour reads faster than a label. Two bugs of the same shape, and neither was findable without looking at the screen. A Slider and a ScrollBar take their THICKNESS from the stylebox's minimum size, which for a StyleBoxTexture is its content margins. Mine were zero, so both resolved the correct stylebox, reported the correct texture, and drew a groove zero pixels tall. A probe confirmed the theme was resolving perfectly while the track was invisible. Tests now assert every slider and scrollbar stylebox has a non-zero minimum, and it is gotcha 7 in CLAUDE.md. The first attempt at the slider groove also used the pack's HOLLOW bar sprite, whose middle is transparent -- tinting it dark left an outline and nothing else. It uses the solid one. tools/screenshot.tscn gained the upgrade screen, which it has to stage: the game scene owns that screen's visibility and re-asserts it every frame, so setting `visible` lasted exactly one frame, and standing the player at the NPC client-side lasted until reconciliation pulled them back. It now moves the player on both sides and holds it until the shot. That tool has caught four bugs the automated gates all passed. check.sh clean, 468 tests, SMOKE PASS, all four diagnostics green. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+10
-1
@@ -266,9 +266,18 @@ find. The same run then showed **Fire bound to the right mouse button**, which
|
||||
was the test suite writing the player's real `user://settings.cfg`, because
|
||||
rebinding calls `save()` and nothing had redirected the path.
|
||||
|
||||
Two lessons, and the second is the general one:
|
||||
Styling the rest of the interface then produced two more of exactly the same
|
||||
shape: an invisible slider track and an invisible scrollbar. Both resolved the
|
||||
right stylebox, reported the right texture, and drew nothing, because a
|
||||
`Slider` and a `ScrollBar` take their thickness from the stylebox's *minimum
|
||||
size* — its content margins — and mine were zero. Neither was findable without
|
||||
looking.
|
||||
|
||||
Three lessons, and the last is the general one:
|
||||
|
||||
- After touching `src/ui/`, look at it. There is no substitute.
|
||||
- When a control resolves the right theme item and still looks wrong, check
|
||||
what Godot derives from that item's *size* rather than its picture.
|
||||
- A test that exercises a code path which writes to user state **will write to
|
||||
user state**. Redirect the path in the fixture, and assert the default is
|
||||
still the real one so the redirect cannot escape.
|
||||
|
||||
Reference in New Issue
Block a user