From 593ea7b51f2ae9969694bbc55d1249a3329b3004 Mon Sep 17 00:00:00 2001 From: forkless Date: Mon, 1 Jun 2026 14:13:35 +0200 Subject: [PATCH] Add inline doc comments and cargo doc to CI --- src/discovery.rs | 5 +++++ src/gvas.rs | 5 +++++ src/ops.rs | 5 +++++ src/tui.rs | 7 +++++-- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/discovery.rs b/src/discovery.rs index f465df9..89af635 100644 --- a/src/discovery.rs +++ b/src/discovery.rs @@ -33,6 +33,11 @@ const KNOWN_PATTERNS: &[(&str, &str)] = &[ /// /// Returns a deduplicated, ranked list. The first result is cached as /// `save_path` in config.ini so subsequent launches skip the scan. +/// Auto-discover Subnautica 2 save folders across Steam, Xbox, Epic, and +/// custom installs. Checks both modern and legacy Steam paths. +/// +/// Returns a deduplicated, ranked list. The first result is cached as +/// `save_path` in config.ini so subsequent launches skip the scan. pub fn discover_save_folders() -> Vec { let mut found: Vec = Vec::new(); let mut seen: std::collections::HashSet = std::collections::HashSet::new(); diff --git a/src/gvas.rs b/src/gvas.rs index 11c3862..29333d0 100644 --- a/src/gvas.rs +++ b/src/gvas.rs @@ -293,6 +293,11 @@ pub fn extract_full_metadata(path: &Path) -> Result { /// Extracted metadata from a GVAS save file. #[derive(Debug, Clone, Default)] +/// Extracted metadata from a Subnautica 2 GVAS save file. +/// +/// Each field corresponds to a named UE5 property inside the save binary. +/// Playtime is derived from the `PlaytimeData` structure when available, +/// falling back to a byte-scan heuristic. pub struct SaveMetadata { /// Internal slot name, e.g. "savegame_0" pub slot_name: Option, diff --git a/src/ops.rs b/src/ops.rs index 17ee71f..c7a3692 100644 --- a/src/ops.rs +++ b/src/ops.rs @@ -92,6 +92,11 @@ pub fn recover_bak_to_sav( // ── full backup ──────────────────────────────────────────────────────────── /// Create a full backup of the save folder to `NotAlterra_Backups/notalterra_copy_`. +/// Create a full backup of all `savegame_*` files. +/// +/// Copies every `.sav` and `.bak` file from the save folder into a +/// timestamped subdirectory under `backup_root/NotAlterra_Backups/`. +/// Returns the number of files copied and the backup path. pub fn create_full_backup( save_folder: &Path, backup_root: &Path, diff --git a/src/tui.rs b/src/tui.rs index 74acb07..02d4395 100644 --- a/src/tui.rs +++ b/src/tui.rs @@ -3,8 +3,11 @@ //! Design principles: //! - Dashboard layout: header bar, main panel, status line //! - Keyboard-first: arrow keys + Enter/Esc, no mouse dependency -//! - Semantic color: cyan=info, green=success, yellow=warning, red=error -//! - Adapts to terminal size; minimum 60×15 +//! Terminal UI rendering for NotAlterra. +//! +//! Uses ratatui + crossterm to draw menu screens, picker lists, dialogs, +//! metadata inspectors, and the animated whale separator. All rendering +//! is stateless — callers pass in an [`AppState`] snapshot. use ratatui::{ layout::{Alignment, Constraint, Direction, Layout, Rect},