mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-16 15:59:59 -04:00
The launcher's home has a Saves screen: Export Save writes NX2navi-save-<date>_<time>.zip into Downloads (or a chosen folder) with a manifest, the save the game would load next and, for a bug report, the game's latest log and nx2navi.ini, never a key file; Import a Save checks a zip's manifest, game, paths and CRCs, backs the current save up into the saves folder and replaces it while the game is not running. The game's Game tab has the same exports and an import that waits in profile/save-import and becomes the save at the next start, since the running game would write its progress back over a save replaced under it. The zip code (runtime/save_zip.c) and the import at start are checked without game files by tests/save_zip_check.py and tests/save_share_check.py; the launcher side by its test suite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
25 lines
1.2 KiB
C
25 lines
1.2 KiB
C
// The host's own folder and file dialogs, for menu pages that point at a folder (the Amiibo tab) or a file (a shared
|
|
// save's zip, the Game tab), and the player's Downloads folder: folder_pick_win.cpp with Win32, folder_pick_sdl.c with
|
|
// SDL. The menu has no text entry, so a folder is chosen here or by walking the page's list.
|
|
#pragma once
|
|
#include <stddef.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
// done gets the chosen folder (UTF-8) or NULL when the player cancelled or the host has no dialog.
|
|
typedef void (*FolderPickDone)(const char *path, void *ctx);
|
|
|
|
// Opens the dialog at start (may be relative or missing) and returns at once; done runs later on another thread, once.
|
|
// The caller keeps one dialog open at a time.
|
|
void folder_pick(const char *start, FolderPickDone done, void *ctx);
|
|
// The same for one file: the dialog lists the files whose name ends in "." ext ("zip") and offers all files too.
|
|
void file_pick(const char *start, const char *ext, FolderPickDone done, void *ctx);
|
|
// The player's Downloads folder (where the system keeps it, also when moved) into out, UTF-8. 0 when there is none.
|
|
int folder_downloads(char *out, size_t cap);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|