mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Tier0: separate launcher and imgui configs to user directory
Keep it separate from the system configurations.
This commit is contained in:
parent
3d2b15cde2
commit
3974ba70bb
src
public/tier0
resource/batch
sdklauncher
thirdparty/imgui/misc
@ -139,6 +139,7 @@
|
||||
#define SDK_ARRAYSIZE(arr) ((sizeof(arr) / sizeof(*arr))) // Name due to IMGUI implementation and NT implementation that we shouldn't share across everywhere.
|
||||
|
||||
#define SDK_SYSTEM_CFG_PATH "cfg/system/"
|
||||
#define SDK_USER_CFG_PATH "cfg/user/"
|
||||
|
||||
#define VALID_CHARSTAR(star) (star && star[0]) // Check if char* is valid and not empty.
|
||||
|
||||
|
@ -22,6 +22,8 @@ del /Q "%~dp0..\platform\cfg\englishclient_build_vpk.cfg"
|
||||
del /Q "%~dp0..\platform\cfg\englishclient_extract_vpk.cfg"
|
||||
del /Q "%~dp0..\platform\cfg\englishserver_build_vpk.cfg"
|
||||
del /Q "%~dp0..\platform\cfg\englishserver_extract_vpk.cfg"
|
||||
del /Q "%~dp0..\platform\cfg\system\launcher.vdf"
|
||||
del /Q "%~dp0..\platform\cfg\system\keymap.vdf"
|
||||
REM Remove deprecated pak files (these are no longer used).
|
||||
del /Q "%~dp0..\paks\Win32\common_empty.rpak"
|
||||
del /Q "%~dp0..\paks\Win32\common_sdk2.rpak"
|
||||
|
@ -563,7 +563,7 @@ void CSurface::Setup()
|
||||
void CSurface::LoadSettings()
|
||||
{
|
||||
CUtlString settingsPath;
|
||||
settingsPath.Format("platform/" SDK_SYSTEM_CFG_PATH "%s", LAUNCHER_SETTING_FILE);
|
||||
settingsPath.Format("platform/" SDK_USER_CFG_PATH "%s", LAUNCHER_SETTING_FILE);
|
||||
|
||||
const char* pSettingsPath = settingsPath.String();
|
||||
|
||||
@ -624,7 +624,7 @@ void CSurface::LoadSettings()
|
||||
void CSurface::SaveSettings()
|
||||
{
|
||||
CUtlString settingsPath;
|
||||
settingsPath.Format("platform/" SDK_SYSTEM_CFG_PATH "%s", LAUNCHER_SETTING_FILE);
|
||||
settingsPath.Format("platform/" SDK_USER_CFG_PATH "%s", LAUNCHER_SETTING_FILE);
|
||||
|
||||
CUtlString settingsDir = settingsPath.DirName();
|
||||
|
||||
|
8
src/thirdparty/imgui/misc/imgui_utility.cpp
vendored
8
src/thirdparty/imgui/misc/imgui_utility.cpp
vendored
@ -14,10 +14,10 @@
|
||||
|
||||
void ImGuiConfig::Load()
|
||||
{
|
||||
const string svPath = Format(SDK_SYSTEM_CFG_PATH"%s", IMGUI_BIND_FILE);
|
||||
const string svPath = Format(SDK_USER_CFG_PATH"%s", IMGUI_BIND_FILE);
|
||||
Msg(eDLL_T::MS, "Loading ImGui config file '%s'\n", svPath.c_str());
|
||||
|
||||
FileSystem()->CreateDirHierarchy(SDK_SYSTEM_CFG_PATH, "PLATFORM"); // Create directory, so ImGui can load/save 'layout.ini'.
|
||||
FileSystem()->CreateDirHierarchy(SDK_USER_CFG_PATH, "PLATFORM"); // Create directory, so ImGui can load/save 'layout.ini'.
|
||||
KeyValues* pKeyMapKV = FileSystem()->LoadKeyValues(IFileSystem::TYPE_COMMON, svPath.c_str(), "PLATFORM");
|
||||
if (!pKeyMapKV)
|
||||
{
|
||||
@ -44,10 +44,10 @@ void ImGuiConfig::Load()
|
||||
|
||||
void ImGuiConfig::Save()
|
||||
{
|
||||
const string svPath = Format(SDK_SYSTEM_CFG_PATH"%s", IMGUI_BIND_FILE);
|
||||
const string svPath = Format(SDK_USER_CFG_PATH"%s", IMGUI_BIND_FILE);
|
||||
Msg(eDLL_T::MS, "Saving ImGui config file '%s'\n", svPath.c_str());
|
||||
|
||||
FileSystem()->CreateDirHierarchy(SDK_SYSTEM_CFG_PATH, "PLATFORM"); // Create directory, so ImGui can load/save 'layout.ini'.
|
||||
FileSystem()->CreateDirHierarchy(SDK_USER_CFG_PATH, "PLATFORM"); // Create directory, so ImGui can load/save 'layout.ini'.
|
||||
|
||||
KeyValues kv("KeyMap");
|
||||
KeyValues* pKeyMapKV = kv.FindKey("KeyMap", true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user