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

@ -20,11 +20,13 @@ namespace cheat::feature
NF(f_DebugMode, "Debug Mode", "CustomTeleports", false), // Soon to be added
NF(f_Enabled, "Custom Teleport", "CustomTeleports", false),
NF(f_Next, "Teleport Next", "CustomTeleports", Hotkey(VK_OEM_6)),
NF(f_Previous, "Teleport Previous", "CustomTeleports", Hotkey(VK_OEM_4))
NF(f_Previous, "Teleport Previous", "CustomTeleports", Hotkey(VK_OEM_4)),
dir(util::GetCurrentPath() / "teleports")
{
f_Next.value().PressedEvent += MY_METHOD_HANDLER(CustomTeleports::OnNext);
f_Previous.value().PressedEvent += MY_METHOD_HANDLER(CustomTeleports::OnPrevious);
}
const FeatureGUIInfo& CustomTeleports::GetGUIInfo() const
{
static const FeatureGUIInfo info{ "Custom Teleports", "Teleport", true };

View File

@ -45,7 +45,7 @@ namespace cheat::feature
void DrawStatus() override;
std::vector<Teleport> Teleports;
std::filesystem::path dir = std::filesystem::current_path() / "teleports";
std::filesystem::path dir;
private:
std::set<unsigned int> checkedIndices;

View File

@ -14,17 +14,16 @@
void Run(HMODULE* phModule)
{
ResourceLoader::SetModuleHandle(*phModule);
auto cheatDir = std::filesystem::path(util::GetModulePath(*phModule));
util::SetCurrentPath(util::GetModulePath(*phModule));
// Init config
config::Initialize((cheatDir / "cfg.json").string());
config::Initialize((util::GetCurrentPath() / "cfg.json").string());
// Init logger
auto& settings = cheat::feature::Settings::GetInstance();
if (settings.f_FileLogging)
{
Logger::PrepareFileLogging((cheatDir / "logs").string());
Logger::PrepareFileLogging((util::GetCurrentPath() / "logs").string());
Logger::SetLevel(Logger::Level::Trace, Logger::LoggerType::FileLogger);
}
@ -56,5 +55,5 @@ void Run(HMODULE* phModule)
cheat::Init();
LOG_DEBUG("Config path is at %s", (cheatDir / "cfg.json").string().c_str());
LOG_DEBUG("Config path is at %s", (util::GetCurrentPath() / "cfg.json").string().c_str());
}