mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-10-30 07:11:05 +00:00
* Implemented Windows registry read/write * Simplify registry API and handle path writes * Linux SetWorkingDirectory * Implement reading path and unicode string from windows registry * Use string_view value names for registry * Use RegGetValueW * Paths adjustments * / * Update working directory update failure message * Updated linux SetWorkingDirectory * Update flatpak define * Remove RootDirectoryPath and save registry at startup * dont save registry on exit * Slight formatting update --------- Co-authored-by: Sajid <sajidur78@gmail.com>
36 lines
899 B
C++
36 lines
899 B
C++
#pragma once
|
|
|
|
#include <mod/mod_loader.h>
|
|
|
|
#define USER_DIRECTORY "UnleashedRecomp"
|
|
|
|
#ifndef GAME_INSTALL_DIRECTORY
|
|
#define GAME_INSTALL_DIRECTORY "."
|
|
#endif
|
|
|
|
inline std::filesystem::path GetGamePath()
|
|
{
|
|
return GAME_INSTALL_DIRECTORY;
|
|
}
|
|
|
|
bool CheckPortable();
|
|
std::filesystem::path BuildUserPath();
|
|
const std::filesystem::path& GetUserPath();
|
|
|
|
inline std::filesystem::path GetSavePath(bool checkForMods)
|
|
{
|
|
if (checkForMods && !ModLoader::s_saveFilePath.empty())
|
|
return ModLoader::s_saveFilePath.parent_path();
|
|
else
|
|
return GetUserPath() / "save";
|
|
}
|
|
|
|
// Returned file name may not necessarily be
|
|
// equal to SYS-DATA as mods can assign anything.
|
|
inline std::filesystem::path GetSaveFilePath(bool checkForMods)
|
|
{
|
|
if (checkForMods && !ModLoader::s_saveFilePath.empty())
|
|
return ModLoader::s_saveFilePath;
|
|
else
|
|
return GetSavePath(false) / "SYS-DATA";
|
|
}
|