Files
UnleashedRecomp-hedge-dev/UnleashedRecomp/user/paths.h
Hyper df03a64305 Redirected Install button to custom implementation
This currently fades out and closes the game upon accepting the message, it does not yet reboot into the installer menu using --install-dlc.
2024-12-07 01:02:59 +00:00

31 lines
685 B
C++

#pragma once
#define USER_DIRECTORY "SWA"
static std::filesystem::path GetGamePath()
{
return std::filesystem::current_path();
}
static std::filesystem::path GetUserPath()
{
if (std::filesystem::exists("portable.txt"))
return std::filesystem::current_path();
std::filesystem::path userPath{};
// TODO: handle platform-specific paths.
PWSTR knownPath = NULL;
if (SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, NULL, &knownPath) == S_OK)
userPath = std::filesystem::path{ knownPath } / USER_DIRECTORY;
CoTaskMemFree(knownPath);
return userPath;
}
static std::filesystem::path GetSavePath()
{
return GetUserPath() / "save";
}