Implement REQ-UI-MODAL-DIM: dim game behind modals

Add a window-wide semi-transparent black scrim drawn over the entire
game window (header bar, game world view, side panel column) while any
auto-pausing modal or end-game screen is open, behind that modal.

- New ModalDimOverlay widget: a full-window, mouse-transparent child of
  MainWindow that paints the dim color. Visibility is reference-counted
  (pushModal/popModal) so nested or back-to-back modals show a single
  dim, not stacked layers; a ModalDimScope RAII guard drives it.
- Wire a guard around every modal opened from MainWindow: schematic
  choice, escape menu, layout dialog, recipe/schematic selection
  (spanning the auto-opened layout dialog), game-over, and win. The
  nested Create Blueprint dialog is covered by the layout-dialog dim.
- Config-driven color via visuals.toml [overlays].modal_dim, following
  the existing OverlayVisuals/parseColor pattern; refreshed on the
  Restart config-reload paths (REQ-CFG-RELOAD).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZR44tA8sn4dPqDzAVXyps
This commit is contained in:
2026-07-13 22:07:14 +02:00
parent d56125f737
commit e04883a95f
8 changed files with 129 additions and 0 deletions

View File

@@ -12,6 +12,7 @@
#include "EventHandler.h"
#include "GameOverEvent.h"
#include "LayoutDialogRequestedEvent.h"
#include "ModalDimOverlay.h"
#include "WinEvent.h"
#include "RecipeSelectionRequestedEvent.h"
#include "SchematicChoicesAvailableEvent.h"
@@ -76,6 +77,7 @@ private:
BuildButtonGrid* m_buildButtonGrid;
BlueprintPanel* m_blueprintPanel;
QWidget* m_sidePanel;
ModalDimOverlay* m_dimOverlay = nullptr;
std::vector<ShipLayoutBlueprint> m_layoutBlueprints;
std::shared_ptr<ParsedReplay> m_replay; // non-null => view-only playback