fix(ESP): Color picker fixed

This commit is contained in:
LiamD-Flop 2022-03-09 01:12:24 +01:00
parent 5a25456431
commit d07d851f4b
3 changed files with 23 additions and 7 deletions

View File

@ -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 },

View File

@ -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");

View File

@ -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();