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

Commit

Permalink
Fixed the issue where champion's skin were restored after resurrection.
Browse files Browse the repository at this point in the history
  • Loading branch information
hydy100 authored Aug 14, 2024
1 parent e7982b6 commit 059983b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions R3nzSkin/GUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ void GUI::render() noexcept
const auto heroes{ cheatManager.memory->heroList };
static const auto my_team{ player ? player->get_team() : 100 };
static int gear{ player ? player->get_character_data_stack()->base_skin.gear : 0 };


auto& values{ cheatManager.database->champions_skins[fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str)] };
if (const auto stack{ player->get_character_data_stack() }; stack->base_skin.skin != values[cheatManager.config->current_combo_skin_index - 1].skin_id) {
stack->base_skin.skin = values[cheatManager.config->current_combo_skin_index - 1].skin_id;
stack->update(true);
}
static const auto vector_getter_skin = [](void* vec, const std::int32_t idx, const char** out_text) noexcept {
const auto& vector{ *static_cast<std::vector<SkinDatabase::skin_info>*>(vec) };
if (idx < 0 || idx > static_cast<std::int32_t>(vector.size())) return false;
Expand Down Expand Up @@ -90,13 +95,13 @@ void GUI::render() noexcept
if (ImGui::BeginTabBar("TabBar", ImGuiTabBarFlags_Reorderable | ImGuiTabBarFlags_FittingPolicyScroll | ImGuiTabBarFlags_NoTooltip)) {
if (player) {
if (ImGui::BeginTabItem("Local Player")) {
auto& values{ cheatManager.database->champions_skins[fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str)] };
ImGui::Text("Player Skins Settings:");

if (ImGui::Combo("Current Skin", &cheatManager.config->current_combo_skin_index, vector_getter_skin, static_cast<void*>(&values), values.size() + 1))
if (cheatManager.config->current_combo_skin_index > 0)
if (cheatManager.config->current_combo_skin_index > 0) {
player->change_skin(values[cheatManager.config->current_combo_skin_index - 1].model_name, values[cheatManager.config->current_combo_skin_index - 1].skin_id);

cheatManager.config->save();
}
const auto playerHash{ fnv::hash_runtime(player->get_character_data_stack()->base_skin.model.str) };
if (const auto it{ std::ranges::find_if(cheatManager.database->specialSkins,
[&skin = player->get_character_data_stack()->base_skin.skin, &ph = playerHash](const SkinDatabase::specialSkin& x) noexcept -> bool
Expand Down

0 comments on commit 059983b

Please sign in to comment.