-
Автор темы
- #1
2. вставляем вот этот код, примерно в 3500 строчку
Код:
bool ImGui::BeginGroupBox(const char* name, const ImVec2& size_arg)
{
ImGuiWindow* window = GetCurrentWindow();
ImGuiWindowFlags flags = ImGuiWindowFlags_GroupBox | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_ChildWindow;
window->DC.CursorPos.y += GImGui->FontSize / 2;
const ImVec2 content_avail = ImGui::GetContentRegionAvail();
ImVec2 size = ImFloor(size_arg);
if (size.x <= 0.0f) {
if (size.x == 0.0f)
flags |= ImGuiWindowFlags_ChildWindowAutoFitX;
size.x = ImMax(content_avail.x, 4.0f) - fabsf(size.x); // Arbitrary minimum zero-ish child size of 4.0f (0.0f causing too much issues)
}
if (size.y <= 0.0f) {
if (size.y == 0.0f)
flags |= ImGuiWindowFlags_ChildWindowAutoFitY;
size.y = ImMax(content_avail.y, 4.0f) - fabsf(size.y);
}
bool ret = ImGui::Begin(name, NULL, size, -1.0f, flags);
window = ImGui::GetCurrentWindow();
auto padding = ImGui::GetStyle().WindowPadding;
auto text_size = CalcTextSize(name, NULL, true);
if (text_size.x > 1.0f) {
window->DrawList->PushClipRectFullScreen();
window->DrawList->PopClipRect();
}
return ret;
}
void ImGui::EndGroupBox()
{
EndChild();
ImGuiWindow* window = GetCurrentWindow();
window->DC.CursorPosPrevLine.y -= GImGui->FontSize / 2;
}
bool ImGui::ToggleButton(const char* label, bool* v, const ImVec2& size_arg)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
int flags = 0;
ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style;
const ImGuiID id = window->GetID(label);
const ImVec2 label_size = CalcTextSize(label, NULL, true);
ImVec2 pos = window->DC.CursorPos;
ImVec2 size = CalcItemSize(size_arg, label_size.x + style.FramePadding.x * 2.0f, label_size.y + style.FramePadding.y * 2.0f);
const ImRect bb(pos, pos + size);
ItemSize(bb, style.FramePadding.y);
if (!ItemAdd(bb, &id))
return false;
if (window->DC.ButtonRepeat) flags |= ImGuiButtonFlags_Repeat;
bool hovered, held;
bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags);
// Render
const ImU32 col = GetColorU32(((held && hovered) || *v) ? ImGuiCol_ButtonActive : (hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button));
RenderFrame(bb.Min, bb.Max, col, true, style.FrameRounding);
RenderTextClipped(bb.Min + style.FramePadding, bb.Max - style.FramePadding, label, NULL, &label_size);
if (pressed)
*v = !*v;
return pressed;
}
4.Спускаемся до 133 строчки //window.
5.Вставляем, этот код.
Код:
IMGUI_API bool BeginGroupBox(const char* name, const ImVec2& size = ImVec2(0, 0));
IMGUI_API void EndGroupBox();
IMGUI_API bool ToggleButton(const char* label, bool* v, const ImVec2& size = ImVec2(0, 0));
7. Заменяем, всё что-там есть, на этот код.
Код:
ImGuiWindowFlags_ChildWindow = 1 << 20, // Don't use! For internal use by BeginChild()
ImGuiWindowFlags_ChildWindowAutoFitX = 1 << 21, // Don't use! For internal use by BeginChild()
ImGuiWindowFlags_ChildWindowAutoFitY = 1 << 22, // Don't use! For internal use by BeginChild()
ImGuiWindowFlags_ComboBox = 1 << 23, // Don't use! For internal use by ComboBox()
ImGuiWindowFlags_Tooltip = 1 << 24, // Don't use! For internal use by BeginTooltip()
ImGuiWindowFlags_Popup = 1 << 25, // Don't use! For internal use by BeginPopup()
ImGuiWindowFlags_Modal = 1 << 26, // Don't use! For internal use by BeginPopupModal()
ImGuiWindowFlags_ChildMenu = 1 << 27, // Don't use! For internal use by BeginMenu()
ImGuiWindowFlags_GroupBox = 1 << 28
9. Заходим в client.cpp, спускаемся до 55 строчки, и вставляем туда вот этот код.
Код:
template<size_t N>
void render_tabs(char* (&names)[N], int& activetab, float w, float h, bool sameline)
{
bool values[N] = { false };
values[activetab] = true;
for (auto i = 0; i < N; ++i) {
if (ImGui::ToggleButton(names[i], &values[i], ImVec2{ w, h })) {
activetab = i;
}
if (sameline && i < N - 1)
ImGui::SameLine();
}
}
Код:
ImGui::BeginGroupBox("");
static char* misc_tab_names[] = { "Misc", "Radar", "Knifebot" };
static int active_misc_tab = 0;
bool placeholder_true = false;
auto& style = ImGui::GetStyle();
bool group_w = -style.WindowPadding.x * 2;
ImGui::GetWindowSize(); style.WindowPadding.x * 2;
render_tabs(misc_tab_names, active_misc_tab, group_w / _countof(misc_tab_names), 20.0f, true);
if (active_misc_tab == 0)
{
ImGui::Checkbox("Bhop", &Settings::Misc::misc_Bhop);
ImGui::Checkbox("Recoil crosshair", &Settings::Misc::misc_Punch);
ImGui::Checkbox("Sniper crosshair", &Settings::Misc::misc_AwpAim);
ImGui::Checkbox("NoFlash", &Settings::Misc::misc_NoFlash);
ImGui::Checkbox("Auto Strafe", &Settings::Misc::misc_AutoStrafe);
ImGui::Checkbox("Auto Accept", &Settings::Misc::misc_AutoAccept);
ImGui::Checkbox("Spectators", &Settings::Misc::misc_Spectators);
ImGui::Checkbox("Fov Changer", &Settings::Misc::misc_FovChanger);
ImGui::PushItemWidth(362.f);
ImGui::SliderInt("Fov View", &Settings::Misc::misc_FovView, 1, 190);
ImGui::SliderInt("Fov Model View", &Settings::Misc::misc_FovModelView, 1, 190);
ImGui::Separator();
ImGui::ColorEdit3("Awp Aim Color", Settings::Misc::misc_AwpAimColor);
}
if (active_misc_tab == 1)
{
ImGui::Checkbox("Active", &Settings::Radar::rad_Active);
ImGui::SameLine();
ImGui::Checkbox("Team", &Settings::Radar::rad_Team);
ImGui::SameLine();
ImGui::Checkbox("Enemy", &Settings::Radar::rad_Enemy);
ImGui::SameLine();
ImGui::Checkbox("Sound", &Settings::Radar::rad_Sound);
ImGui::SameLine();
ImGui::Checkbox("InGame", &Settings::Radar::rad_InGame);
ImGui::Spacing();
ImGui::Separator();
ImGui::Spacing();
ImGui::PushItemWidth(339.f);
ImGui::SliderInt("Range", &Settings::Radar::rad_Range, 1, 5000);
ImGui::SliderInt("Alpha", &Settings::Radar::rad_Alpha, 1, 255);
ImGui::Spacing();
ImGui::Separator();
ImGui::Spacing();
ImGui::ColorEdit3("Color CT", Settings::Radar::rad_Color_CT);
ImGui::ColorEdit3("Color TT", Settings::Radar::rad_Color_TT);
ImGui::ColorEdit3("Color Visible CT", Settings::Radar::rad_Color_VCT);
ImGui::ColorEdit3("Color Visible TT", Settings::Radar::rad_Color_VTT);
}
if (active_misc_tab == 2)
{
ImGui::Checkbox("Active", &Settings::Knifebot::knf_Active);
ImGui::Checkbox("Attack Team", &Settings::Knifebot::knf_Team);
ImGui::Separator();
string attack_1 = "Attack 1";
string attack_2 = "Attack 2";
string attack_3 = "Attack 1 + Attack 2";
const char* items[] = { attack_1.c_str() , attack_2.c_str() , attack_3.c_str() };
ImGui::Combo("Attack type", &Settings::Knifebot::knf_Attack, items, IM_ARRAYSIZE(items));
ImGui::Separator();
ImGui::SliderInt("Dist to attack 1", &Settings::Knifebot::knf_DistAttack, 1, 100);
ImGui::SliderInt("Dist to attack 2", &Settings::Knifebot::knf_DistAttack2, 1, 100);
}
ImGui::EndGroupBox();
}
}
}
Я например так-же сделал, только для скинченжера.
ТАБЫ С РАДАРОМ, И КНАЙФБОТОМ МОЖНО УДАЛИТЬ !
Код:
imgui_internal.h 603 строчка
bool ButtonRepeat; // == ButtonRepeatStack.back() [empty == false]
Последнее редактирование: