Skip to content

Commit

Permalink
fix settings not loading correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyNinja1 committed Feb 19, 2025
1 parent dac3818 commit cb4d9a3
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 6 deletions.
Binary file modified Nations/TwinkieNations.dll
Binary file not shown.
5 changes: 5 additions & 0 deletions Twinkie/SettingMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,18 @@ class SettingMgr
{
if (!IniFile.read(IniStruct))
{
Status = -1;
GenerateIni();
if (!IniFile.generate(IniStruct))
{
Filesystem::create_directories("Twinkie");
IniFile.generate(IniStruct);
}
}
else
{
LoadIni();
}
}

Tab& operator[](std::string Name)
Expand Down
28 changes: 22 additions & 6 deletions Twinkie/Twink.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include "kiero/minhook/include/MinHook.h"

// #define BUILD_DEBUG
// #define BUILD_UNITED
#define BUILD_NATIONS
#define BUILD_UNITED
// #define BUILD_NATIONS
// #define BUILD_TMMC

struct ChallengeInfo
Expand Down Expand Up @@ -119,14 +119,28 @@ class Twink
Settings["Dashboard"]["Brake color (inactive)"].Set(ColorBrakeI);
Settings["Dashboard"]["Acceleration color (inactive)"].Set(ColorAccelI);

Settings["Dashboard"]["Enable"].Set(EnableDashboard);

Settings["Medals"]["Enable"].Set(EnableMedals);

Settings.Save();
}

Twink()
{
if (Settings.Status == -1)
if (Settings.Status == 0)
{
SaveSettings();
ColorSteer = Settings["Dashboard"]["Steer color"].GetAsVec4();
ColorBrake = Settings["Dashboard"]["Brake color"].GetAsVec4();
ColorAccel = Settings["Dashboard"]["Acceleration color"].GetAsVec4();

ColorSteerI = Settings["Dashboard"]["Steer color (inactive)"].GetAsVec4();
ColorBrakeI = Settings["Dashboard"]["Brake color (inactive)"].GetAsVec4();
ColorAccelI = Settings["Dashboard"]["Acceleration color (inactive)"].GetAsVec4();

EnableDashboard = Settings["Dashboard"]["Enable"].GetAsBool();

EnableMedals = Settings["Medals"]["Enable"].GetAsBool();
}
}

Expand All @@ -137,7 +151,8 @@ class Twink

void InitFonts(ImGuiIO& ImIo)
{
KanitFont16 = ImIo.Fonts->AddFontFromFileTTF("Twinkie\\Fonts\\Kanit.ttf", 16.f);
// TODO
/*KanitFont16 = ImIo.Fonts->AddFontFromFileTTF("Twinkie\\Fonts\\Kanit.ttf", 16.f);
if (KanitFont16)
{
PrintInternal("Font \"Kanit16\" initialized.");
Expand All @@ -155,7 +170,8 @@ class Twink
else
{
PrintError("Font \"Kanit48\" not initialized. SplitSpeeds extension is not available.");
}
}*/
return;
}

void Init()
Expand Down
Binary file modified United/TwinkieUnited.dll
Binary file not shown.

0 comments on commit cb4d9a3

Please sign in to comment.