diff --git a/src/main.rs b/src/main.rs index a56d958..0dde85b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -286,6 +286,11 @@ fn run_disclaimer(terminal: &mut Terminal, app: &mut App) -> Resu } } + +/// Scan the local filesystem for Subnautica 2 save folders. +/// +/// Spawns a background thread for the scan and shows a live elapsed timer. +/// Caches the first match as `save_path` in config.ini. // ── menu actions ─────────────────────────────────────────────────────────── fn action_locate_saves(terminal: &mut Terminal, app: &mut App) -> Result<()> { @@ -387,6 +392,7 @@ fn action_locate_saves(terminal: &mut Terminal, app: &mut App) -> Ok(()) } +/// Recover a .sav from its .bak backup with a rollback safety net. fn action_recover_bak(terminal: &mut Terminal, app: &mut App) -> Result<()> { let save_folder = ensure_save_folder(terminal, app)?; @@ -588,6 +594,7 @@ fn action_recover_bak(terminal: &mut Terminal, app: &mut App) -> Ok(()) } +/// Create a full backup of all savegame files into a timestamped folder. fn action_create_backup(terminal: &mut Terminal, app: &mut App) -> Result<()> { let save_folder = ensure_save_folder(terminal, app)?; @@ -629,6 +636,7 @@ fn action_create_backup(terminal: &mut Terminal, app: &mut App) - Ok(()) } +/// Restore a previously created full backup, overwriting the save folder. fn action_restore_backup(terminal: &mut Terminal, app: &mut App) -> Result<()> { let save_folder = ensure_save_folder(terminal, app)?; let backup_root = app.backup_root(); @@ -890,6 +898,7 @@ fn ini_delete_action( // ── inspect saves ────────────────────────────────────────────────────────── +/// Inspect GVAS metadata for any .sav or .bak file from a file picker. fn action_inspect_saves(terminal: &mut Terminal, app: &mut App) -> Result<()> { let save_folder = ensure_save_folder(terminal, app)?; let mut files: Vec<_> = std::fs::read_dir(&save_folder) diff --git a/src/tui.rs b/src/tui.rs index 7a6eb3f..96f6c69 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -274,6 +274,7 @@ pub fn draw_ok_dialog_styled(f: &mut Frame, app: &AppState, title: &str, lines: draw_whale_separator(f, bar, app); } +/// Return a rectangle centered in `r` by the given width and height percentages. fn centered_rect_size(w: u16, h: u16, r: Rect) -> Rect { let popup = Layout::default().direction(Direction::Vertical) .constraints([Constraint::Length((r.height.saturating_sub(h))/2), Constraint::Length(h), Constraint::Length((r.height.saturating_sub(h))/2)]) @@ -643,6 +644,7 @@ fn truncate_path_tail(path: &str, max_width: usize) -> String { } /// Create a centered rectangle for modal overlays. +/// Return a rectangle centered in `r` by the given width and height percentages. fn centered_rect(percent_x: u16, percent_y: u16, r: Rect) -> Rect { let popup_layout = Layout::default() .direction(Direction::Vertical)