Overlay opacity: global setting + apply to all panels #16
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Feature
All UI overlays (build menu, villager panel, context menu, ESC menu, confirm dialog, Nisse info panel, debug panel) should use a consistent, slightly transparent background. The opacity should be controllable via a global setting.
Scope
1 — Settings screen (new)
The ESC menu already has a "Settings" button that shows a "coming soon" toast. Replace that with a real Settings overlay containing at least:
The setting must be persisted (localStorage) and read at scene startup.
2 — Central opacity constant
Introduce a
uiOpacityvalue (read from settings) that is passed to — or read by — all overlay constructors. All panel backgrounds currently use hardcoded alpha values (e.g.0.88,0.92,0.95); replace those withuiOpacity.3 — Apply to all overlays
Notes
UISettings/settingsobject in localStorage (separate from game save so a New Game does not wipe it).A few questions before starting implementation:
Slider vs. step buttons: Phaser has no native slider widget. I'd use
−/+step buttons (10 % steps) to match the existing UI style — is that fine, or do you want a draggable slider?Settings overlay layout: Should the Settings screen appear as a new panel on top of the ESC menu, or should it replace the ESC menu content while open?
Live update: The issue says "panels rebuild on next open". Should an already-open panel (e.g. build menu) immediately reflect the new opacity, or only on next open?
UISettings location: Should the settings object live in a new
src/utils/settings.tsmodule, or be integrated intoStateManager?