Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
#270
Browse files Browse the repository at this point in the history
  • Loading branch information
R3nzTheCodeGOD committed Nov 22, 2022
1 parent e27e23d commit 7111a4f
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions R3nzSkin/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,7 @@ void GUI::render() noexcept
if (player)
ImGui::InputText("Change Nick", player->get_name());

if (ImGui::Button("No Skins")) {
if (player) {
cheatManager.config->current_combo_skin_index = 1;
player->change_skin(player->get_character_data_stack()->base_skin.model.str, 0);
}

if (ImGui::Button("No skins except local player")) {
for (auto& enemy : cheatManager.config->current_combo_enemy_skin_index)
enemy.second = 1;

Expand All @@ -213,21 +208,23 @@ void GUI::render() noexcept

for (auto i{ 0u }; i < heroes->length; ++i) {
const auto hero{ heroes->list[i] };
hero->change_skin(hero->get_character_data_stack()->base_skin.model.str, 0);
if (hero != player)
hero->change_skin(hero->get_character_data_stack()->base_skin.model.str, 0);
}
} ImGui::hoverInfo("Defaults the skin of all champions.");
} ImGui::hoverInfo("Sets the skins of all champions except the local player to the default skin.");

if (ImGui::Button("Random Skins")) {
for (auto i{ 0u }; i < heroes->length; ++i) {
const auto hero{ heroes->list[i] };
const auto championHash{ fnv::hash_runtime(hero->get_character_data_stack()->base_skin.model.str) };

if (championHash == FNV("PracticeTool_TargetDummy"))
continue;

const auto skinCount{ cheatManager.database->champions_skins[championHash].size() };
auto& skinDatabase{ cheatManager.database->champions_skins[championHash] };
auto& config{ (hero->get_team() != my_team) ? cheatManager.config->current_combo_enemy_skin_index : cheatManager.config->current_combo_ally_skin_index };

if (championHash == FNV("PracticeTool_TargetDummy"))
continue;

if (hero == player) {
cheatManager.config->current_combo_skin_index = random(1u, skinCount);
hero->change_skin(skinDatabase[cheatManager.config->current_combo_skin_index - 1].model_name, skinDatabase[cheatManager.config->current_combo_skin_index - 1].skin_id);
Expand Down

0 comments on commit 7111a4f

Please sign in to comment.