fix: teleports and imgui.ini located in game folder

This commit is contained in:
Callow
2022-07-13 15:06:50 +03:00
parent 00f5e733b0
commit 9f339d3f57
6 changed files with 28 additions and 7 deletions

View File

@ -202,6 +202,9 @@ namespace renderer
ImGui_ImplDX12_CreateDeviceObjects();
ImGui::GetIO().ImeWindowHandle = window;
static const std::string imguiPath = (util::GetCurrentPath() / "imgui.ini").string();
ImGui::GetIO().IniFilename = imguiPath.c_str();
io.SetPlatformImeDataFn = nullptr; // F**king bug take 4 hours of my life
}
@ -213,6 +216,8 @@ namespace renderer
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
static const std::string imguiPath = (util::GetCurrentPath() / "imgui.ini").string();
io.IniFilename = imguiPath.c_str();
LoadCustomFont();
SetupImGuiStyle();

View File

@ -70,6 +70,17 @@ namespace util
return std::filesystem::path(pathOut).parent_path().string();
}
static std::filesystem::path _currentPath;
void SetCurrentPath(const std::filesystem::path& current_path)
{
_currentPath = current_path;
}
std::filesystem::path GetCurrentPath()
{
return _currentPath;
}
std::optional<std::string> SelectDirectory(const char* title)
{
auto currPath = std::filesystem::current_path();

View File

@ -6,6 +6,7 @@
#include <vector>
#include <cheat-base/Logger.h>
#include <filesystem>
#include <SimpleIni.h>
@ -38,6 +39,9 @@ namespace util
std::string GetModulePath(HMODULE hModule = nullptr);
void SetCurrentPath(const std::filesystem::path& curren_path);
std::filesystem::path GetCurrentPath();
std::vector<std::string> StringSplit(const std::string& delimiter, const std::string& content);
std::string SplitWords(const std::string& value);
std::string MakeCapital(std::string value);