@@ -481,57 +481,80 @@ class MiscTab
481481
482482 ImGui::Separator ();
483483
484- if (ImGui::Button (" Tournament of Souls - unlock all" ))
485- {
486- LCU::Request (" POST" , " /lol-marketing-preferences/v1/partition/sfm2023" , R"( {
487- "SmallConspiracyFan" : "True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True",
488- "SmallGwenPykeFan" : "True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True",
489- "SmallJhinFan" : "True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True",
490- "SmallSettFans" : "True,True,True,True,True,True,True,True,True,True,True,True,True,True,True",
491- "SmallShaco" : "True,True",
492- "hasNewAbility" : "False",
493- "hasNewFanLine" : "False",
494- "hasPlayedTutorial" : "True",
495- "hasSeenCelebration_Story" : "True",
496- "hasSeenLoadoutTutorial" : "True",
497- "hasSeenMapTutorial" : "True",
498- "loadout_active_e" : "2",
499- "loadout_active_q" : "1",
500- "loadout_active_r" : "2",
501- "loadout_active_w" : "2",
502- "numNodesUnlocked" : "20",
503- "progress" : "20"
504- })" );
484+ ImGui::Text (" Change your Riot ID:" );
485+ static char bufGameName[50 ];
486+ ImGui::SetNextItemWidth (static_cast <float >(S.Window .width / 4 ));
487+ ImGui::InputText (" ##inputGameName" , bufGameName, IM_ARRAYSIZE (bufGameName));
505488
506- Json::Value root;
507- Json::CharReaderBuilder builder;
508- const std::unique_ptr<Json::CharReader> reader (builder.newCharReader ());
509- JSONCPP_STRING err;
510- std::string getGrants = LCU::Request (" GET" , " /lol-rewards/v1/grants" );
489+ ImGui::SameLine ();
490+ ImGui::Text (" #" );
491+ ImGui::SameLine ();
492+ static char bufTagLine[50 ];
493+ ImGui::SetNextItemWidth (static_cast <float >(S.Window .width / 5 ));
494+ ImGui::InputText (" ##inputTagLine" , bufTagLine, IM_ARRAYSIZE (bufTagLine));
511495
512- if (reader->parse (getGrants.c_str (), getGrants.c_str () + static_cast <int >(getGrants.length ()), &root, &err))
496+ ImGui::SameLine ();
497+ if (ImGui::Button (" Change##buttonRiotID" ))
498+ {
499+ std::string newRiotId = std::string (bufGameName) + " #" + std::string (bufTagLine);
500+ if (MessageBoxA (nullptr , std::string (" Your new Riot ID will be: " + newRiotId).c_str (), " Are you sure?" , MB_OKCANCEL) == IDOK)
513501 {
514- if (root.isArray ())
515- {
516- for (auto grant : root)
517- {
518- for (Json::Value& reward : grant[" rewardGroup" ][" rewards" ])
519- {
520- Json::Value body;
521- body[" rewardGroupId" ] = grant[" info" ][" rewardGroupId" ].asString ();
522- body[" selections" ] = {};
523- body[" selections" ].append (reward[" id" ].asString ());
524-
525- result += LCU::Request (" POST" , std::format (" /lol-rewards/v1/grants/{}/select" , grant[" info" ][" id" ].asString ()),
526- body.toStyledString ());
527- }
528- }
529- }
502+ result = LCU::Request (" POST" , " https://127.0.0.1/lol-summoner/v1/save-alias" ,
503+ " {\" gameName\" : \" " + std::string (bufGameName) + " \" , \" tagLine\" : \" " + std::string (bufTagLine) + " \" }" );
530504 }
531505 }
532506
533- ImGui::SameLine ();
534- ImGui::HelpMarker (" You need reputation for this to work" );
507+ // if (ImGui::Button("Tournament of Souls - unlock all"))
508+ // {
509+ // LCU::Request("POST", "/lol-marketing-preferences/v1/partition/sfm2023", R"({
510+ // "SmallConspiracyFan" : "True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True",
511+ // "SmallGwenPykeFan" : "True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True",
512+ // "SmallJhinFan" : "True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,True",
513+ // "SmallSettFans" : "True,True,True,True,True,True,True,True,True,True,True,True,True,True,True",
514+ // "SmallShaco" : "True,True",
515+ // "hasNewAbility" : "False",
516+ // "hasNewFanLine" : "False",
517+ // "hasPlayedTutorial" : "True",
518+ // "hasSeenCelebration_Story" : "True",
519+ // "hasSeenLoadoutTutorial" : "True",
520+ // "hasSeenMapTutorial" : "True",
521+ // "loadout_active_e" : "2",
522+ // "loadout_active_q" : "1",
523+ // "loadout_active_r" : "2",
524+ // "loadout_active_w" : "2",
525+ // "numNodesUnlocked" : "20",
526+ // "progress" : "20"
527+ // })");
528+ //
529+ // Json::Value root;
530+ // Json::CharReaderBuilder builder;
531+ // const std::unique_ptr<Json::CharReader> reader(builder.newCharReader());
532+ // JSONCPP_STRING err;
533+ // std::string getGrants = LCU::Request("GET", "/lol-rewards/v1/grants");
534+ //
535+ // if (reader->parse(getGrants.c_str(), getGrants.c_str() + static_cast<int>(getGrants.length()), &root, &err))
536+ // {
537+ // if (root.isArray())
538+ // {
539+ // for (auto grant : root)
540+ // {
541+ // for (Json::Value& reward : grant["rewardGroup"]["rewards"])
542+ // {
543+ // Json::Value body;
544+ // body["rewardGroupId"] = grant["info"]["rewardGroupId"].asString();
545+ // body["selections"] = {};
546+ // body["selections"].append(reward["id"].asString());
547+ //
548+ // result += LCU::Request("POST", std::format("/lol-rewards/v1/grants/{}/select", grant["info"]["id"].asString()),
549+ // body.toStyledString());
550+ // }
551+ // }
552+ // }
553+ // }
554+ // }
555+ //
556+ // ImGui::SameLine();
557+ // ImGui::HelpMarker("You need reputation for this to work");
535558
536559 static Json::StreamWriterBuilder wBuilder;
537560 static std::string sResultJson ;
0 commit comments