@@ -28,6 +28,16 @@ class LoginTab
2828 if (ImGui::BeginTabItem (" Login" ))
2929 {
3030 static std::string result;
31+ static bool once = true ;
32+ static char leagueArgs[1024 * 16 ];
33+ static std::string sArgs ;
34+
35+ if (once)
36+ {
37+ once = false ;
38+ std::copy (S.loginTab .leagueArgs .begin (), S.loginTab .leagueArgs .end (), leagueArgs);
39+ }
40+
3141 ImGui::Columns (2 , 0 , false );
3242
3343 static std::vector<std::pair<std::string, std::string>>langs = {
@@ -40,7 +50,7 @@ class LoginTab
4050 {" Vietnamese" ," vn_VN" },{" Indonesian" ," id_ID" },{" Chinese (Malaysia)" ," zh_MY" },{" Chinese (Taiwan)" ," zh_TW" }
4151 };
4252 // find saved lang from cfg file
43- auto findLang = std::find_if (langs.begin (), langs.end (), [](std::pair<std::string, std::string>k) { return k.second == S.language ; });
53+ auto findLang = std::find_if (langs.begin (), langs.end (), [](std::pair<std::string, std::string>k) { return k.second == S.loginTab . language ; });
4454
4555 static std::pair<std::string, std::string>selectedLang = { findLang[0 ].first ,findLang[0 ].second };
4656
@@ -52,8 +62,8 @@ class LoginTab
5262 }
5363 else
5464 {
55- ShellExecuteA (NULL , NULL , std::format (" {}LeagueClient.exe" , S.leaguePath ).c_str (), std::format ( " --locale={} " , selectedLang. second ) .c_str (), NULL , SW_SHOWNORMAL);
56- result = S.leaguePath + " LeagueClient.exe --locale= " + selectedLang. second ; // todo custom arguments
65+ ShellExecuteA (NULL , NULL , std::format (" {}LeagueClient.exe" , S.leaguePath ).c_str (), sArgs .c_str (), NULL , SW_SHOWNORMAL);
66+ result = S.leaguePath + " LeagueClient.exe " + sArgs ;
5767 }
5868 }
5969 ImGui::SameLine ();
@@ -65,8 +75,17 @@ class LoginTab
6575 if (ImGui::Selectable (lang.first .c_str (), lang.first == selectedLang.first ))
6676 {
6777 selectedLang = { lang.first ,lang.second };
68- S.language = lang.second ;
78+ S.loginTab . language = lang.second ;
6979 CSettings::Save ();
80+
81+ std::string localeArg = std::format (" --locale={} " , selectedLang.second );
82+ size_t localePos = sArgs .find (" --locale=" );
83+ if (localePos != std::string::npos)
84+ {
85+ sArgs .replace (localePos, localeArg.size (), localeArg);
86+ }
87+ else
88+ sArgs += localeArg;
7089 }
7190 }
7291 ImGui::EndCombo ();
@@ -87,6 +106,14 @@ class LoginTab
87106 }
88107 ImGui::Columns (1 );
89108
109+ std::copy (sArgs .begin (), sArgs .end (), leagueArgs);
110+ ImGui::Text (" Args: " );
111+ ImGui::SameLine ();
112+ ImGui::InputText (" ##inputLeagueArgs" , leagueArgs, IM_ARRAYSIZE (leagueArgs));
113+
114+ sArgs = leagueArgs;
115+ S.loginTab .leagueArgs = sArgs ;
116+
90117 ImGui::Separator ();
91118
92119 static char username[50 ];
@@ -139,7 +166,7 @@ class LoginTab
139166 }
140167
141168 ImGui::SameLine ();
142- Misc::HelpMarker (" This part is only, if you want to save your login and pass to .txt file and login with 1 click. You don't have to do that, you can just log in the usual way in client and launch the tool anytime you want" );
169+ Misc::HelpMarker (" This part is only, if you want to save your login and pass to config file and login with 1 click. You don't have to do that, you can just log in the usual way in client and launch the tool anytime you want" );
143170
144171 ImGui::Separator ();
145172
0 commit comments