@@ -42,79 +42,52 @@ class SettingsTab
4242
4343 static void Render ()
4444 {
45+ static bool once = true ;
4546 if (ImGui::BeginTabItem (" Settings" ))
4647 {
48+ if (once)
49+ {
50+ once = false ;
51+ HKEY hkResult;
52+ if (RegOpenKeyExA (HKEY_LOCAL_MACHINE, " Software\\ Microsoft\\ Windows NT\\ CurrentVersion\\ Image File Execution Options\\ LeagueClientUx.exe" , 0 , KEY_SET_VALUE | KEY_QUERY_VALUE, &hkResult) == ERROR_SUCCESS)
53+ {
54+ char buffer[MAX_PATH];
55+ DWORD dwLen;
56+ LSTATUS regQuery = RegGetValueA (hkResult, 0 , " debugger" , RRF_RT_REG_SZ, 0 , (PVOID)&buffer, &dwLen);
57+ if (regQuery == ERROR_SUCCESS)
58+ {
59+ S.currentDebugger = buffer;
60+ }
61+ else if (regQuery == ERROR_FILE_NOT_FOUND)
62+ {
63+ S.currentDebugger = " Nothing" ;
64+ }
65+ else
66+ {
67+ S.currentDebugger = " Failed" ;
68+ }
69+ }
70+ }
4771 static std::string result;
4872
4973 ImGui::Checkbox (" Auto-rename" , &S.autoRename );
74+ ImGui::SameLine ();
75+ Misc::HelpMarker (" Automatically renames the program on launch" );
5076
5177 ImGui::Checkbox (" Stream Proof" , &S.streamProof );
78+ ImGui::SameLine ();
79+ Misc::HelpMarker (" Hides the program in recordings and screenshots" );
5280
5381 ImGui::Checkbox (" Register debugger IFEO" , &S.debugger );
82+ ImGui::SameLine ();
83+ ImGui::Text (" | Hooked to: %s" , S.currentDebugger .c_str ());
5484
5585 // Terminate all league related processes,
5686 // remove read only and hidden property from files
5787 // and delete them
58- if (ImGui::Button (" Clear logs" ))
88+ if (ImGui::Button (" Clean logs" ))
5989 {
60- result = " " ;
61- Misc::TerminateProcessByName (" RiotClientServices.exe" );
62- Misc::TerminateProcessByName (" RiotClientCrashHandler.exe" );
63- Misc::TerminateProcessByName (" RiotClientUx.exe" );
64- Misc::TerminateProcessByName (" RiotClientUxRender.exe" );
65-
66- Misc::TerminateProcessByName (" LeagueClient.exe" );
67- Misc::TerminateProcessByName (" LeagueCrashHandler.exe" );
68- Misc::TerminateProcessByName (" LeagueClientUx.exe" );
69- Misc::TerminateProcessByName (" LeagueClientUxRender.exe" );
70-
71- std::this_thread::sleep_for (std::chrono::seconds (2 ));
72-
73- std::error_code errorCode;
74-
75- std::string logsFolder = S.leaguePath + " Logs" ;
76- if (std::filesystem::exists (logsFolder))
77- {
78- SetFileAttributesA (logsFolder.c_str (), GetFileAttributesA (logsFolder.c_str ()) & ~FILE_ATTRIBUTE_READONLY & ~FILE_ATTRIBUTE_HIDDEN);
79- std::filesystem::remove_all (logsFolder, errorCode);
80- result += logsFolder + " - " + errorCode.message () + " \n " ;
81- }
82-
83- std::string configFolder = S.leaguePath + " Config" ;
84- if (std::filesystem::exists (configFolder))
85- {
86- SetFileAttributesA (configFolder.c_str (), GetFileAttributesA (configFolder.c_str ()) & ~FILE_ATTRIBUTE_READONLY & ~FILE_ATTRIBUTE_HIDDEN);
87- std::filesystem::remove_all (configFolder, errorCode);
88- result += configFolder + " - " + errorCode.message () + " \n " ;
89- }
90-
91- std::string programData = " C:/ProgramData/Riot Games" ;
92- if (std::filesystem::exists (programData))
93- {
94- SetFileAttributesA (programData.c_str (), GetFileAttributesA (programData.c_str ()) & ~FILE_ATTRIBUTE_READONLY & ~FILE_ATTRIBUTE_HIDDEN);
95- std::filesystem::remove_all (programData, errorCode);
96- result += programData + " - " + errorCode.message () + " \n " ;
97- }
98-
99- char * pLocal;
100- size_t localLen;
101- _dupenv_s (&pLocal, &localLen, " LOCALAPPDATA" );
102- std::string local = pLocal;
103- local += " \\ Riot Games" ;
104- if (std::filesystem::exists (local))
105- {
106- SetFileAttributesA (local.c_str (), GetFileAttributesA (local.c_str ()) & ~FILE_ATTRIBUTE_READONLY & ~FILE_ATTRIBUTE_HIDDEN);
107- std::filesystem::remove_all (local, errorCode);
108- result += local + " - " + errorCode.message () + " \n " ;
109- }
110-
111- int k = 0 ;
112- for (const auto & file : std::filesystem::directory_iterator (std::filesystem::temp_directory_path ()))
113- {
114- std::filesystem::remove_all (file, errorCode);
115- k++;
116- }
117- result += " Deleted " + std::to_string (k) + " files in temp directory\n " ;
90+ result = Misc::ClearLogs ();
11891 }
11992
12093 static char bufLeaguePath[MAX_PATH];
@@ -174,5 +147,7 @@ class SettingsTab
174147
175148 ImGui::EndTabItem ();
176149 }
150+ else
151+ once = true ;
177152 }
178153};
0 commit comments