From eabb0fe27ad1f3f9055febc9e0ac9a25c84ad891 Mon Sep 17 00:00:00 2001 From: forkless Date: Sun, 31 May 2026 19:43:32 +0200 Subject: [PATCH] Show OK dialog for game-running guard instead of silent exit --- src/main.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index ce7ad92..1bd5eeb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -141,14 +141,17 @@ fn refresh_stats(tui_state: &mut tui::AppState, save_folder: Option<&Path>) { fn run_app(terminal: &mut Terminal) -> Result<()> { let mut app = App::new()?; - // Guard: exit if game is running + // Guard: warn if game is running, then exit if guard::game_running() { - println!("NotAlterra has detected that Subnautica 2 is currently running.\n"); -println!("The game holds file locks on your save files while active."); -println!("Backing up or restoring saves while the game is running can result in"); -println!("incomplete, corrupt, or overwritten save files.\n"); -println!("To protect your save files, NotAlterra will now exit.\n"); -println!(" → Close Subnautica 2, then relaunch NotAlterra."); + ok_dialog(terminal, &app, "Game Running", + "NotAlterra has detected that Subnautica 2 is currently running.\n\ + \n\ + The game holds file locks on your save files while active.\n\ + Backing up or restoring saves while the game is running can\n\ + result in incomplete, corrupt, or overwritten save files.\n\ + \n\ + Close Subnautica 2, then relaunch NotAlterra.", + )?; return Ok(()); }