Preferred monitor: chosen in Optionen > Allgemein, used at the next start

The Internet-Optionen frame becomes Bildschirm with a Monitor dropdown
(Hauptmonitor or a connected monitor, kept by device path in
[display] Monitor=). The borderless window and the render size use that
monitor, falling back to the main monitor when it is not connected.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-25 16:06:20 +01:00
1 parent c7d54a6cfd
commit 9bc557cd95
10 files changed
+407 -14

No files matched your search

+29
View File
@@ -132,3 +132,32 @@ the borders: screenshots 2026-10-20). One row *Autosave (Min.)*: Aus / 5 /
lighter one). A click selects, OK writes
`[characters] AutosaveMinutes` (`characters::SetAutosaveMinutes`, the timer
uses it at once), Cancel drops it.
## Allgemein: preferred monitor (2026-10-25)
Request: a setting for the monitor the game starts on; with none set, or the
preferred monitor not connected, the system's main monitor.
- `src/mods/monitor.cpp`: the monitors (`EnumDisplayMonitors`), named and
told apart through the display configuration (`QueryDisplayConfig`,
`DisplayConfigGetDeviceInfo`: the GDI name `\.\DISPLAYn` of each path's
source, the monitor's EDID name and device path of its target). The device
path is the id: it stays the same across restarts and when monitors are
rearranged, unlike `\.\DISPLAYn`. Kept in `sacredK.ini`
`[display] Monitor=` (empty: the main monitor).
- `GameMonitorRect` is asked where the screen is decided at startup: the
borderless window covers that monitor (`borderless.cpp`), and the render
size follows its aspect ratio (`widescreen.cpp` `ApplyRenderSize`). The
log line `monitor: <name> WxH at (x,y)` says which one was used and why.
A change applies at the next start.
- In the options (user's choice of place): the *Internet-Optionen* frame
(Datendurchsatz, multiplayer only) becomes *Bildschirm*. Its controls
(`UI_CFG_LANSPEED` label, DSL / ISDN radio buttons, everything inside
`UI_FRAME_INTERNET`) and the title label `UI_LABEL_WAN` are hidden; the
game keeps the saved Datendurchsatz. The title text (key `UI_CFG_WAN`) is
overridden with "Bildschirm" before the window is made.
- One row: *Monitor* and a box with the choice (Hauptmonitor, then each
monitor as "name (WxH)", "Nicht verbunden" for a preferred monitor that is
missing). A click opens the list upwards (the frame is the lowest one); a
click on an entry picks it, any click closes the list. A changed choice
shows "Ab dem nächsten Spielstart" below the box. OK saves, Cancel drops.