launcher: notice when an interrupted apply was finished or rolled back (retries while another window applies), windows take over config changes made in another window, hints and settings wrap at the minimum window size, data paths with .. cleaned up, boot-to-level starts bound to their level (ignored for other levels)

This commit is contained in:
MineTec committed 2026-11-07 12:48:43 +01:00
1 parent 8b78958306
commit c4fa500198
30 files changed
+695 -102

No files matched your search

+15 -1
View File
@@ -73,6 +73,15 @@ instance last loaded/saved: fields it did not change keep what another window/CL
meanwhile (mod options merge per mod and key; unknown keys of newer versions are kept); a field
changed on both sides = last writer wins. The object then holds the merged values. A `new
Config()` that never touched a file overwrites everything (installer, tests).
`save` returns true when the merge pulled in values written elsewhere; `Config.refresh(file)` does
the same merge without writing (unsaved changes of this instance are kept). The launcher refreshes
when its window is activated and after a save that pulled something in, then rebuilds the Mods and
Settings tabs (status "Took over changes made in another LlamaMod window."), so a stale window's
next click cannot undo another window's selection.
Screenshots: `img/app/two-windows-before.jpg` / `-after.jpg` (right window ticked Test World, left
window after a click into it), `img/app/interrupted-apply-notice.jpg`, `img/app/saves-min-width.jpg`,
`img/app/settings-min-width.jpg` (hints are `ui/WrapLabel`s: they wrap at the panel width, the
Settings tab tracks the viewport width, the header subtitle is shortened in the middle before the buttons).
## First start
@@ -157,7 +166,12 @@ after the swap. If the app is killed between the two renames, `ModManager.recove
(GUI start, Play, CLI `--launch`) moves `cd-active.new` in when its marker matches config.json's
activeKey (exe and config are only written after the swap, so they still describe the previous
selection), otherwise moves `cd-active.old` back; without either nothing is touched (Play then
restores the original as before). Applying (and restoring)
restores the original as before). It returns a `Recovery`: NONE, FINISHED (new folder moved in),
RESTORED (old folder back), BUSY (another window/CLI holds `.apply.lock`: `BusyException`), FAILED.
The launcher shows FINISHED/RESTORED once (status line + small dialog: "The last apply was
interrupted; LlamaMod finished it." / "…restored the previous mod selection."); after BUSY it checks
again every 3 s and on window activation while idle, and Play reports the lock instead of starting
(`ui/RecoveryNotice`). CLI `--launch` prints the same texts. Applying (and restoring)
is refused while the game runs (`GameLauncher.isRunning()`) and holds an exclusive lock on
`<data>/.apply.lock` (a second window/CLI/editor gets "Another LlamaMod window or command is applying
mods"); every run is logged to `logs/apply.log`.