From d07d851f4b897e85af255aca18f7aadc4099243f Mon Sep 17 00:00:00 2001 From: LiamD-Flop Date: Wed, 9 Mar 2022 01:12:24 +0100 Subject: [PATCH] fix(ESP): Color picker fixed --- BigBaseV2/src/core/globals.hpp | 3 +++ BigBaseV2/src/views/esp/view_esp.cpp | 13 +++++++++---- BigBaseV2/src/views/view_session.cpp | 14 +++++++++++--- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/BigBaseV2/src/core/globals.hpp b/BigBaseV2/src/core/globals.hpp index 89b15ac8..271cf1ba 100644 --- a/BigBaseV2/src/core/globals.hpp +++ b/BigBaseV2/src/core/globals.hpp @@ -162,6 +162,7 @@ namespace big bool distance = true; bool name = true; ImU32 color = 3359983061; + ImU32 friend_color = 3359983061; }; public: @@ -268,6 +269,7 @@ namespace big this->esp.enabled = j["esp"]["enabled"]; this->esp.color = j["esp"]["color"]; + this->esp.friend_color = j["esp"]["friend_color"]; this->esp.box = j["esp"]["box"]; this->esp.distance = j["esp"]["distance"]; this->esp.god = j["esp"]["god"]; @@ -420,6 +422,7 @@ namespace big this->esp.box_render_distance[1] }) }, { "color", this->esp.color }, + { "friend_color", this->esp.friend_color }, { "distance", this->esp.distance }, { "box", this->esp.box }, { "god", this->esp.god }, diff --git a/BigBaseV2/src/views/esp/view_esp.cpp b/BigBaseV2/src/views/esp/view_esp.cpp index beb51b12..c6830a72 100644 --- a/BigBaseV2/src/views/esp/view_esp.cpp +++ b/BigBaseV2/src/views/esp/view_esp.cpp @@ -57,6 +57,11 @@ namespace big ImVec2 name_pos = { esp_side_x, esp_y - (175.f * multplr) }; + ImU32 esp_color = g->esp.color; + + if (plyr->is_friend()) + esp_color = g->esp.friend_color; + if (g->esp.distance) name_pos = { esp_x - (62.5f * multplr), esp_y - (175.f * multplr) - 25.f }; @@ -64,16 +69,16 @@ namespace big health_perc = health_perc < 0.f ? 0.f : health_perc; if (distance < g->esp.tracer_render_distance[1] && distance > g->esp.tracer_render_distance[0] && g->esp.tracer) - draw_list->AddLine({ (float)g->window.x * 0.5f, (float)g->window.y }, { esp_x, esp_y }, g->esp.color); + draw_list->AddLine({ (float)g->window.x * 0.5f, (float)g->window.y }, { esp_x, esp_y }, esp_color); if (distance < g->esp.box_render_distance[1] && distance > g->esp.box_render_distance[0] && g->esp.box) - draw_list->AddRect({ esp_x - (62.5f * multplr), esp_y - (175.f * multplr) }, { esp_x - (62.5f * multplr) + (125.f * multplr), esp_y - (175.f * multplr) + (350.f * multplr) }, g->esp.color); + draw_list->AddRect({ esp_x - (62.5f * multplr), esp_y - (175.f * multplr) }, { esp_x - (62.5f * multplr) + (125.f * multplr), esp_y - (175.f * multplr) + (350.f * multplr) }, esp_color); if (g->esp.name) - draw_list->AddText(name_pos, g->esp.color, plyr->get_name()); + draw_list->AddText(name_pos, esp_color, plyr->get_name()); if (g->esp.distance) - draw_list->AddText({ esp_side_x, esp_y - (175.f * multplr) }, g->esp.color, fmt::format("{}m", (int)distance).c_str()); + draw_list->AddText({ esp_side_x, esp_y - (175.f * multplr) }, esp_color, fmt::format("{}m", (int)distance).c_str()); if (god && g->esp.god) draw_list->AddText({ esp_side_x, esp_y - (175.f * multplr) + 20.f }, health_red, "GOD"); diff --git a/BigBaseV2/src/views/view_session.cpp b/BigBaseV2/src/views/view_session.cpp index 61586fd2..2a9bcfb2 100644 --- a/BigBaseV2/src/views/view_session.cpp +++ b/BigBaseV2/src/views/view_session.cpp @@ -38,11 +38,19 @@ namespace big ImGui::Checkbox("Show Player Godmode", &g->esp.god); ImGui::Checkbox("Show Player Health", &g->esp.health); ImGui::Checkbox("Show Player Name", &g->esp.name); - static ImVec4 col = ImVec4(114.0f / 255.0f, 144.0f / 255.0f, 154.0f / 255.0f, 200.0f / 255.0f); - if (ImGui::ColorPicker4("##picker", (float*)&col, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoSmallPreview)) + + static ImVec4 col_esp = ImGui::ColorConvertU32ToFloat4(g->esp.color); + static ImVec4 col_friend = ImGui::ColorConvertU32ToFloat4(g->esp.friend_color); + if (ImGui::ColorEdit4("ESP Color##esp_picker", (float*)&col_esp, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview)) { - g->esp.color = ImGui::ColorConvertFloat4ToU32(col); + g->esp.color = ImGui::ColorConvertFloat4ToU32(col_esp); } + if (ImGui::ColorEdit4("Friend ESP Color##friend_picker", (float*)&col_friend, ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_NoSidePreview)) + { + g->esp.friend_color = ImGui::ColorConvertFloat4ToU32(col_friend); + } + + } ImGui::TreePop();