-
Автор темы
- #1
Крашит при заходе в players (lw)
попросил друг не бейте
Код:
void c_menu::draw_players(int child)
{
auto player = players_section;
if (!child)
{
child_title(crypt_str("ESP"));
tab_start();
ImGui::BeginChild(crypt_str("##ESP1_FIRST"), ImVec2(317 * dpi_scale, (child_height - 35) * dpi_scale));
{
ImGui::Checkbox(crypt_str("Enable"), &g_cfg.player.enable);
if (player == ENEMY)
{
ImGui::Checkbox(crypt_str("Out Of Fov Arrows"), &g_cfg.player.arrows);
ImGui::SameLine();
ImGui::ColorEdit(crypt_str("##arrowscolor"), &g_cfg.player.arrows_color, ALPHA);
if (g_cfg.player.arrows)
{
ImGui::SliderInt(crypt_str("Arrows distance"), &g_cfg.player.distance, 1, 100);
ImGui::SliderInt(crypt_str("Arrows size"), &g_cfg.player.size, 1, 100);
}
}
ImGui::Checkbox(crypt_str("Bounding box"), &g_cfg.player.type[player].box);
ImGui::SameLine();
ImGui::ColorEdit(crypt_str("##boxcolor"), &g_cfg.player.type[player].box_color, ALPHA);
ImGui::Checkbox(crypt_str("Name"), &g_cfg.player.type[player].name);
ImGui::SameLine();
ImGui::ColorEdit(crypt_str("##namecolor"), &g_cfg.player.type[player].name_color, ALPHA);
ImGui::Checkbox(crypt_str("Health bar"), &g_cfg.player.type[player].health);
ImGui::Checkbox(crypt_str("Health color"), &g_cfg.player.type[player].custom_health_color);
ImGui::SameLine();
ImGui::ColorEdit(crypt_str("##healthcolor"), &g_cfg.player.type[player].health_color, ALPHA);
for (auto i = 0, j = 0; i < ARRAYSIZE(flags); i++)
{
if (g_cfg.player.type[player].flags[i])
{
if (j)
preview += crypt_str(", ") + (std::string)flags[i];
else
preview = flags[i];
j++;
}
}
draw_multicombo(crypt_str("Flags"), g_cfg.player.type[player].flags, flags, ARRAYSIZE(flags), preview);
draw_multicombo(crypt_str("Weapon"), g_cfg.player.type[player].weapon, weaponplayer, ARRAYSIZE(weaponplayer), preview);
if (g_cfg.player.type[player].weapon[WEAPON_ICON] || g_cfg.player.type[player].weapon[WEAPON_TEXT])
{
ImGui::Text(crypt_str("Color "));
ImGui::SameLine();
ImGui::ColorEdit(crypt_str("##weapcolor"), &g_cfg.player.type[player].weapon_color, ALPHA);
}
ImGui::Checkbox(crypt_str("Skeleton"), &g_cfg.player.type[player].skeleton);
ImGui::SameLine();
ImGui::ColorEdit(crypt_str("##skeletoncolor"), &g_cfg.player.type[player].skeleton_color, ALPHA);
ImGui::Checkbox(crypt_str("Ammo bar"), &g_cfg.player.type[player].ammo);
ImGui::SameLine();
ImGui::ColorEdit(crypt_str("##ammocolor"), &g_cfg.player.type[player].ammobar_color, ALPHA);
ImGui::Checkbox(crypt_str("Footsteps"), &g_cfg.player.type[player].footsteps);
ImGui::SameLine();
ImGui::ColorEdit(crypt_str("##footstepscolor"), &g_cfg.player.type[player].footsteps_color, ALPHA);
if (g_cfg.player.type[player].footsteps)
{
ImGui::SliderInt(crypt_str("Thickness"), &g_cfg.player.type[player].thickness, 1, 10);
ImGui::SliderInt(crypt_str("Radius"), &g_cfg.player.type[player].radius, 50, 500);
}
if (player == ENEMY || player == TEAM)
{
ImGui::Checkbox(crypt_str("Snap lines"), &g_cfg.player.type[player].snap_lines);
ImGui::SameLine();
ImGui::ColorEdit(crypt_str("##snapcolor"), &g_cfg.player.type[player].snap_lines_color, ALPHA);
if (player == ENEMY)
{
if (g_cfg.ragebot.enable)
{
ImGui::Checkbox(crypt_str("Shot Capsules"), &g_cfg.player.lag_hitbox);
ImGui::SameLine();
ImGui::ColorEdit(crypt_str("##lagcompcolor"), &g_cfg.player.lag_hitbox_color, ALPHA);
}
}
}
else
{
}
}
static std::vector<esp_info_s> info;
static bool enabled = true;
ImGui::SetNextWindowSize(ImVec2(280, 430));
//ffs i dont find showborder here maybe u can find it on old imgui or i dont know where it is
ImGui::Begin("ESP Preview", &enabled, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse);
{
auto cur_window = ImGui::GetCurrentWindow();
ImVec2 w_pos = cur_window->Pos;
if (g_cfg.player.type->box)
{
//clear shit box
cur_window->DrawList->AddRect(ImVec2(w_pos.x + 40, w_pos.y + 60), ImVec2(w_pos.x + 200, w_pos.y + 360), ImColor(g_cfg.player.type->box_color[0] * 255, g_cfg.player.type->box_color[1] * 255, g_cfg.player.type->box_color[2] * 255));//getrawcolor???
}
if (g_cfg.player.type->health)
{
cur_window->DrawList->AddRectFilled(ImVec2(w_pos.x + 34, w_pos.y + 60), ImVec2(w_pos.x + 37, w_pos.y + 360), ImColor(255, 255, 255, 255));//change this to green value im lazy to look hex color
}
if (g_cfg.player.type->name)
info.emplace_back(esp_info_s("name", ImColor(255, 255, 255, 255), CENTER_UP));
for (auto render : info)
{
auto text_size = ImGui::CalcTextSize(render.f_name.c_str());
auto pos = ImVec2(w_pos.x + 205, w_pos.y + 60);
if (render.f_position == CENTER_DOWN)
{
pos = ImVec2(w_pos.x + (240 / 2) - text_size.x / 2, pos.y + 315 - text_size.y);
}
else if (render.f_position == CENTER_UP)
{
pos = ImVec2(w_pos.x + (240 / 2) - text_size.x / 2, pos.y - 5 - text_size.y);
}
cur_window->DrawList->AddText(pos, render.f_color, render.f_name.c_str());//still no u32 ;D
}
ImGui::EndGroup();
}
ImGui::EndChild();
tab_end();
}