Move sdk specific cfg files to different folder

Move all SDK internal CFG's to 'cfg/system'.
This commit is contained in:
Kawe Mazidjatari 2023-03-24 00:04:45 +01:00
parent 1758abb0aa
commit 193c5bdeba
4 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,5 @@
#pragma once
constexpr char IMGUI_BIND_PATH[] = "cfg/imgui/";
constexpr char IMGUI_BIND_FILE[] = "bind.json";
enum class ImGuiStyle_t

View File

@ -1172,7 +1172,7 @@ ImGuiIO::ImGuiIO()
DisplaySize = ImVec2(-1.0f, -1.0f);
DeltaTime = 1.0f / 60.0f;
IniSavingRate = 5.0f;
IniFilename = "platform\\cfg\\imgui\\layout.ini"; // Important: "imgui_layout.ini" is relative to current working dir, most apps will want to lock this to an absolute path (e.g. same path as executables).
IniFilename = "platform\\cfg\\system\\layout.ini"; // Important: "imgui_layout.ini" is relative to current working dir, most apps will want to lock this to an absolute path (e.g. same path as executables).
LogFilename = "platform\\logs\\imgui_log.txt";
MouseDoubleClickTime = 0.30f;
MouseDoubleClickMaxDist = 6.0f;

View File

@ -10,10 +10,10 @@
void ImGuiConfig::Load()
{
const string svPath = fmt::format("{:s}{:s}", IMGUI_BIND_PATH, IMGUI_BIND_FILE);
const string svPath = Format(SDK_SYSTEM_CFG_PATH"%s", IMGUI_BIND_FILE);
DevMsg(eDLL_T::MS, "Loading ImGui config file '%s'\n", svPath.c_str());
FileSystem()->CreateDirHierarchy(IMGUI_BIND_PATH, "PLATFORM"); // Create directory, so ImGui can load/save 'layout.ini'.
FileSystem()->CreateDirHierarchy(SDK_SYSTEM_CFG_PATH, "PLATFORM"); // Create directory, so ImGui can load/save 'layout.ini'.
FileHandle_t hFile = FileSystem()->Open(svPath.c_str(), "rt", "PLATFORM");
if (!hFile)
@ -54,10 +54,10 @@ void ImGuiConfig::Load()
void ImGuiConfig::Save()
{
const string svPath = fmt::format("{:s}{:s}", IMGUI_BIND_PATH, IMGUI_BIND_FILE);
const string svPath = Format(SDK_SYSTEM_CFG_PATH"%s", IMGUI_BIND_FILE);
DevMsg(eDLL_T::MS, "Saving ImGui config file '%s'\n", svPath.c_str());
FileSystem()->CreateDirHierarchy(IMGUI_BIND_PATH, "PLATFORM");
FileSystem()->CreateDirHierarchy(SDK_SYSTEM_CFG_PATH, "PLATFORM");
FileHandle_t hFile = FileSystem()->Open(svPath.c_str(), "wt", "PLATFORM");
if (!hFile)

View File

@ -149,10 +149,11 @@
#define SDK_ARRAYSIZE(arr) ((sizeof(arr) / sizeof(*arr))) // Name due to IMGUI implementation and NT implementation that we shouldn't share across everywhere.
#ifndef DEDICATED
#define SDK_DEFAULT_CFG "platform\\cfg\\startup_default.cfg"
#define SDK_DEFAULT_CFG "platform/cfg/startup_default.cfg"
#else
#define SDK_DEFAULT_CFG "platform\\cfg\\startup_dedi_default.cfg"
#define SDK_DEFAULT_CFG "platform/cfg/startup_dedi_default.cfg"
#endif
#define SDK_SYSTEM_CFG_PATH "cfg/system/"
// #define COMPILETIME_MAX and COMPILETIME_MIN for max/min in constant expressions
#define COMPILETIME_MIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )