Saves in Documents\My Games\Hookshot on Windows, as on Linux in XDG data #295

Closed
gab9281 wants to merge 2 commits from windows/my-games-saves into main
gab9281 commented 2026-11-07 19:29:57 +00:00 (Migrated from github.com)

One of the parts of #83, split into small PRs.

Linux already keeps saves in $XDG_DATA_HOME/hookshot, so a rebuilt or new game folder finds them. On Windows they stayed in user/ beside hookshot.exe, so a build into a new folder started with no saves.

  • Windows uses Documents\My Games\Hookshot (SHGetFolderPath, so Documents wherever it is, OneDrive's included), through the same saves_dir Linux already uses. The #ifndef _WIN32 around it is gone.
  • A user/ folder from before is moved there once, entry by entry. Nothing is written over an entry already there, and anything that can't be moved keeps the old place. saves-moved.txt beside the game says where they went.
  • --user still wins.
  • Readme: where Windows saves go.

Validated

  • saves_dir built alone for Windows (clang-cl, Windows SDK) and run under Proton (GE-Proton11-7):
    • the first start moved save0/ and options.ini to My Games and wrote the note;
    • the next start uses My Games;
    • an entry already in My Games keeps the saves in user/, untouched.
  • host/hos_main.c compiles for Windows and Linux. Linux's code is unchanged.

🤖 Generated with Claude Code

One of the parts of #83, split into small PRs. Linux already keeps saves in `$XDG_DATA_HOME/hookshot`, so a rebuilt or new game folder finds them. On Windows they stayed in `user/` beside `hookshot.exe`, so a build into a new folder started with no saves. - Windows uses `Documents\My Games\Hookshot` (`SHGetFolderPath`, so Documents wherever it is, OneDrive's included), through the same `saves_dir` Linux already uses. The `#ifndef _WIN32` around it is gone. - A `user/` folder from before is moved there once, entry by entry. Nothing is written over an entry already there, and anything that can't be moved keeps the old place. `saves-moved.txt` beside the game says where they went. - `--user` still wins. - Readme: where Windows saves go. **Validated** - `saves_dir` built alone for Windows (clang-cl, Windows SDK) and run under Proton (GE-Proton11-7): - the first start moved `save0/` and `options.ini` to My Games and wrote the note; - the next start uses My Games; - an entry already in My Games keeps the saves in `user/`, untouched. - `host/hos_main.c` compiles for Windows and Linux. Linux's code is unchanged. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
NotRexed commented 2026-11-07 19:45:29 +00:00 (Migrated from github.com)

Thanks. Moving where saves live on Windows is the owner's call (it touches every player's saves and the readme's update steps), so I'm leaving this for review rather than merging it.

Thanks. Moving where saves live on Windows is the owner's call (it touches every player's saves and the readme's update steps), so I'm leaving this for review rather than merging it.
gab9281 commented 2026-11-07 19:47:22 +00:00 (Migrated from github.com)

Added 74284f9: the update offer kept "skip this version" in user\ beside the game and ran before the saves' folder was chosen. With the saves moving to My Games, a skipped version would have been asked about again at every start. The check now runs once the saves' folder is known and keeps hookshot_update_skip.txt there. Tested under Proton with the dialog answered Cancel: the skip is written to the saves' folder, and the next start finds it and asks nothing.

Added 74284f9: the update offer kept "skip this version" in `user\` beside the game and ran before the saves' folder was chosen. With the saves moving to My Games, a skipped version would have been asked about again at every start. The check now runs once the saves' folder is known and keeps `hookshot_update_skip.txt` there. Tested under Proton with the dialog answered Cancel: the skip is written to the saves' folder, and the next start finds it and asks nothing.
NotRexed commented 2026-11-07 19:48:31 +00:00 (Migrated from github.com)

Thanks for the work! We're keeping saves in the game folder's user folder on Windows: it's where players look for them and back them up, and an update rebuilds the same folder without touching user. Closing.

Thanks for the work! We're keeping saves in the game folder's `user` folder on Windows: it's where players look for them and back them up, and an update rebuilds the same folder without touching `user`. Closing.
Commenting is not possible because the repository is archived.
No description provided.