Initial commit: DayZ memory C++ port with DMA backend and overlay

This commit is contained in:
67
2026-06-16 15:18:44 +08:00
commit f04e38b8ae
163 changed files with 163380 additions and 0 deletions
File diff suppressed because it is too large Load Diff
+11
View File
@@ -0,0 +1,11 @@
Flaticon License
By means of these Terms, the Company grants the User a Flaticon License under which the User is authorized to download, use and modify the Flaticon Content on a device owned or controlled by the User on a non-transferable, limited, exclusive, revocable and worldwide basis for the entire duration of the rights and solely for the purposes and uses authorized under these Terms.
Without prejudice to the provisions set forth in paragraph 3 of this clause, the User of a Flaticon License may use the content in the Flaticon Content, provided that the Flaticon Content is not used in printed or electronic items (e.g. t-shirts, cups, postcards, birthday or greeting cards, invitations, calendars, web models or electronic devices, apps, NFTs, videogames, advertising spots, audiovisual animations) aimed to be resold, in which the Flaticon Content is the main element (because of size, relevance or any other cause, in case of doubt about whether the content is main element, it shall be deemed that the content is main element);
Furthermore, the authorization to use the content in the Flaticon Content shall be free of charge under the Flaticon License where any use thereof by the User is done by duly crediting said content to the Website/Company and, in any event, to the Collaborator, as stated by the Company from time to time. In order to benefit from the Service of using the Flaticon Content without the aforementioned crediting, the User must purchase a subscription (hereinafter the "Premium Subscription") from the Website and download the relevant Flaticon Content during the term of said Premium Subscription. The terms set forth in Section 9 shall apply to the purchase of the Premium Subscription.
Where any content of the Flaticon Content is marked or identified as being for editorial use, or where within the same there are distinctive signs, recognizable products, public buildings, public events or images taken in places where recognizable persons appear in the background, the User shall only be entitled to use it for such editorial use; in other words, for purposes related to exercising freedom of expression and the right to information or for academic or educational purposes. More specifically, this means that the User undertakes not to use said content in any way that could imply a link to any business activity, use in the course of trade or the advertising, promotion or marketing of any product or service. In addition, the User shall ensure that any use for educational purposes is allowed under any legislation which applies and shall fulfill any requirements set forth by such legislation, including, but not limited to, citation obligations or limitations on the extent or purpose of said use. The User shall be directly liable for, and the Company shall not assume any liability resulting from the use for commercial purposes by the User of any content in the Flaticon Content whose use must be limited to editorial use as set forth in this paragraph or as a consequence of any editorial use that is contrary to the legislation which applies.
More information about the Term and Conditions of use on https://www.freepikcompany.com/legal?#nav-flaticon
Binary file not shown.
+597
View File
@@ -0,0 +1,597 @@
#include "headers/includes.h"
#include <Windows.h>
#include <array>
#include <cstdlib>
#include <string>
#include "Overlay/MenuBridge.h" // project header (src/ is on the include path)
// -------------------------------------------------------------------------
// DayZ overlay integration
//
// This is the original Lumin demo `gui.cpp`, stripped of the login screen and
// the placeholder "visual" feature panels. The window/sidebar/feature
// scaffolding is preserved verbatim; only the tab list and per-tab content
// were swapped to drive this project's real ESP state via `g_menu`
// (see src/Overlay/MenuBridge.h). https://discord.gg/jxqVWub6Dk
// -------------------------------------------------------------------------
static void sync_layout_preferences()
{
elements->padding = var->gui.compact_layout ? c_vec2(8, 8) : c_vec2(10, 10);
elements->window.rounding = var->gui.window_rounding;
}
static constexpr float visual_window_width = 900.f;
static constexpr float visual_window_height = 527.f;
static constexpr float visual_sidebar_width = 162.5f;
static constexpr float visual_outer_padding = 10.f;
static constexpr float visual_column_gap = 14.f;
static constexpr float visual_panel_scale = 1.0f;
static constexpr float visual_section_width_scale = 0.98f;
static constexpr float visual_feature_padding_x = 0.f;
static constexpr float visual_feature_padding_y = 0.f;
struct visual_panel_density_state
{
float dpi;
float font_scale;
};
static float unscale_visual(float value)
{
return value / ImMax(var->gui.dpi, 0.01f);
}
static float visual_section_height(int section_count)
{
const float content_height = unscale_visual(gui->content_avail().y);
const float gaps = visual_column_gap * static_cast<float>(ImMax(section_count - 1, 0));
return ImMax(220.f, (content_height - gaps) / static_cast<float>(ImMax(section_count, 1)));
}
extern c_vec4 g_pill_selected_rect;
extern c_vec4 g_sidebar_selected_rect;
static int g_panel_number = 0;
// ---- search filtering -----------------------------------------------------
static char visual_search_lower(char value)
{
return value >= 'A' && value <= 'Z' ? static_cast<char>(value - 'A' + 'a') : value;
}
static std::string visual_search_query()
{
std::string query = var->gui.feature_search;
size_t first = 0;
while (first < query.size() && (query[first] == ' ' || query[first] == '\t'))
first++;
size_t last = query.size();
while (last > first && (query[last - 1] == ' ' || query[last - 1] == '\t'))
last--;
return query.substr(first, last - first);
}
static bool visual_contains_ci(std::string_view text, std::string_view query)
{
if (query.empty())
return true;
if (query.size() > text.size())
return false;
for (size_t i = 0; i <= text.size() - query.size(); i++)
{
size_t j = 0;
while (j < query.size() && visual_search_lower(text[i + j]) == visual_search_lower(query[j]))
j++;
if (j == query.size())
return true;
}
return false;
}
static bool visual_search_matches(std::string_view name, std::string_view description = {})
{
const std::string query = visual_search_query();
if (query.empty())
return true;
return visual_contains_ci(name, query) || visual_contains_ci(description, query);
}
struct visual_widget_filter
{
bool checkbox(std::string name, std::string description, bool* callback, title_status_icon status = title_status_none) const
{
if (!visual_search_matches(name, description))
return false;
return ::widgets->checkbox(name, description, callback, status);
}
bool slider(std::string name, std::string description, float* callback, float vmin, float vmax, std::string format = "%.1f") const
{
if (!visual_search_matches(name, description))
return false;
return ::widgets->slider(name, description, callback, vmin, vmax, format);
}
};
// ---- section helpers ------------------------------------------------------
static void begin_visual_section(std::string_view name, float height)
{
const int panel_number = g_panel_number + 1;
const float section_width = elements->child_width * visual_section_width_scale;
const float content_padding_x = ImMax(0.f, section_width * 0.05f);
gui->begin_content(name, c_vec2(section_width, s_(height)), c_vec2(content_padding_x, s_(5)), s_(0, 0), window_flags_no_move | window_flags_no_scrollbar, child_flags_none);
c_window* window = gui->get_window();
draw->rect_filled(window->DrawList, window->Rect().Min, window->Rect().Max, draw->get_clr(clr->child), s_(14));
g_panel_number = panel_number;
}
static void end_visual_section()
{
gui->end_content();
}
static visual_panel_density_state begin_visual_panel_density()
{
c_window* window = gui->get_window();
visual_panel_density_state state{ var->gui.dpi, window->FontWindowScale };
var->gui.dpi = ImMax(0.01f, state.dpi * visual_panel_scale);
ImGui::SetWindowFontScale(state.font_scale * visual_panel_scale);
return state;
}
static void end_visual_panel_density(visual_panel_density_state state)
{
ImGui::SetWindowFontScale(state.font_scale);
var->gui.dpi = state.dpi;
}
static void draw_visual_sidebar_glass(const c_rect& rect)
{
ImDrawList* draw_list = gui->get_window()->DrawList;
const float rounding = s_(14);
draw->rect_filled(draw_list, rect.Min, rect.Max, draw->get_clr(clr->child), rounding);
}
// Full-width single-column panel (used by Info / Radar / Settings).
static void begin_full_section(std::string_view name, float height, bool scroll = false)
{
const float section_width = gui->content_avail().x;
const float content_padding_x = ImMax(0.f, section_width * 0.035f);
const window_flags flags = window_flags_no_move | (scroll ? 0 : window_flags_no_scrollbar);
gui->begin_content(name, c_vec2(section_width, s_(height)), c_vec2(content_padding_x, s_(10)), s_(0, 6), flags, child_flags_none);
c_window* window = gui->get_window();
draw->rect_filled(window->DrawList, window->Rect().Min, window->Rect().Max, draw->get_clr(clr->child), s_(14));
}
// Accent section heading.
static void lumin_heading(const char* text)
{
c_window* w = gui->get_window();
const c_vec2 pos = w->DC.CursorPos;
const c_vec2 size = c_vec2(gui->content_avail().x, s_(22));
const c_rect rect(pos, pos + size);
gui->item_size(rect);
if (!gui->item_add(rect, w->GetID(text)))
return;
draw->text_clipped(w->DrawList, font->get(inter_semibold, 13), rect.Min, rect.Max, draw->get_clr(clr->accent), text, 0, 0, { 0.f, 0.5f });
}
// Muted single-line note.
static void lumin_note(const char* text)
{
c_window* w = gui->get_window();
const c_vec2 pos = w->DC.CursorPos;
const c_vec2 size = c_vec2(gui->content_avail().x, s_(16));
const c_rect rect(pos, pos + size);
gui->item_size(rect);
if (!gui->item_add(rect, w->GetID(text)))
return;
draw->text_clipped(w->DrawList, font->get(inter_medium, 11), rect.Min, rect.Max, draw->get_clr(clr->text), text, 0, 0, { 0.f, 0.5f });
}
// Read-only "label .... value" row on a rounded widget background.
static void lumin_kv(const char* label, const std::string& value, const c_vec4& value_clr)
{
c_window* w = gui->get_window();
const c_vec2 pos = w->DC.CursorPos;
const c_vec2 size = c_vec2(gui->content_avail().x, s_(34));
const c_rect rect(pos, pos + size);
gui->item_size(rect);
if (!gui->item_add(rect, w->GetID(label)))
return;
draw->rect_filled(w->DrawList, rect.Min, rect.Max, draw->get_clr(clr->widget), s_(8));
draw->text_clipped(w->DrawList, font->get(inter_semibold, 12), rect.Min + s_(12, 0), rect.Max, draw->get_clr(clr->white), label, 0, 0, { 0.f, 0.5f });
draw->text_clipped(w->DrawList, font->get(inter_medium, 11), rect.Min, rect.Max - s_(12, 0), draw->get_clr(value_clr), value.data(), 0, 0, { 1.f, 0.5f });
}
// ---- ESP / Items content --------------------------------------------------
static void render_esp_tab(const visual_widget_filter& w, float section_height)
{
if (!g_menu)
return;
gui->begin_group();
{
begin_visual_section("Entities", section_height);
w.checkbox("Players", "Show player ESP", g_menu->showPlayers, title_status_safe);
w.checkbox("Animals", "Show animal ESP", g_menu->showAnimals);
w.checkbox("Zombies", "Show infected ESP", g_menu->showZombies);
w.checkbox("Items", "Show loot ESP", g_menu->showItems);
w.checkbox("Corpses", "Show dead bodies", g_menu->showCorpses);
w.checkbox("Bounding Box", "Draw entity box", g_menu->showBox);
w.checkbox("Skeleton", "Draw bone skeleton", g_menu->showSkeleton);
w.checkbox("Head Circle", "Draw head highlight", g_menu->showHeadDot);
w.checkbox("Weapon In Hand", "Show held weapon name", g_menu->showWeapon);
w.checkbox("Health Bar", "Draw player health bar", g_menu->showHealthBar);
w.checkbox("Health Number", "Draw numeric health", g_menu->showHealthNumber);
w.checkbox("Skeleton Debug", "Label every named bone", g_menu->debugSkeleton, title_status_warning);
end_visual_section();
}
gui->end_group();
gui->sameline();
gui->begin_group();
{
begin_visual_section("Draw Distance", section_height);
w.slider("Players", "Max player draw distance", g_menu->playerMaxDist, 50.f, 1000.f, "%.0f m");
w.slider("Animals", "Max animal draw distance", g_menu->animalMaxDist, 50.f, 1000.f, "%.0f m");
w.slider("Zombies", "Max zombie draw distance", g_menu->zombieMaxDist, 50.f, 500.f, "%.0f m");
w.slider("Items", "Max loot draw distance", g_menu->itemMaxDist, 20.f, 200.f, "%.0f m");
end_visual_section();
}
gui->end_group();
}
static void render_items_tab(const visual_widget_filter& w, float section_height)
{
if (!g_menu || !g_menu->itemCategories)
return;
struct cat_t { const char* key; const char* label; };
static const std::array<cat_t, 17> kCats = { {
{ "isWeapon", "Weapons" },
{ "isAmmo", "Ammo" },
{ "isMelee", "Melee" },
{ "isExplosives", "Explosives" },
{ "isMedical", "Medical" },
{ "isFood", "Food" },
{ "isConsumables", "Consumables" },
{ "isClothing", "Clothing" },
{ "isBackpack", "Backpacks" },
{ "isOptics", "Optics" },
{ "isWeaponAttachments", "Weapon Attachments" },
{ "isTool", "Tools" },
{ "isCrafting", "Crafting" },
{ "isVehiclePart", "Vehicle Parts" },
{ "isForBuilding", "Building" },
{ "isHouse", "House / Terrain" },
{ "isOtherLoot", "Other" },
} };
auto& cats = *g_menu->itemCategories;
auto draw_category = [&](const cat_t& c)
{
// Missing key defaults to enabled; widget mutates the map slot directly.
auto it = cats.find(c.key);
if (it == cats.end())
it = cats.emplace(c.key, true).first;
w.checkbox(c.label, "Toggle loot category", &it->second);
};
const size_t split = (kCats.size() + 1) / 2;
gui->begin_group();
{
begin_visual_section("Loot Categories", section_height);
for (size_t i = 0; i < split; i++)
draw_category(kCats[i]);
end_visual_section();
}
gui->end_group();
gui->sameline();
gui->begin_group();
{
begin_visual_section("Loot Categories##2", section_height);
for (size_t i = split; i < kCats.size(); i++)
draw_category(kCats[i]);
end_visual_section();
}
gui->end_group();
}
static void render_info_tab(float section_height)
{
const c_vec4 green = c_col(75, 225, 145).Value;
const c_vec4 orange = c_col(255, 175, 75).Value;
begin_full_section("Info", section_height);
{
lumin_heading("Server");
if (g_menu && g_menu->connected)
{
lumin_kv("Status", "Connected", green);
if (!g_menu->serverName.empty()) lumin_kv("Server", g_menu->serverName, clr->white.Value);
if (!g_menu->mapName.empty()) lumin_kv("Map", g_menu->mapName, clr->white.Value);
if (g_menu->hasPos)
{
char pos[64];
ImFormatString(pos, IM_ARRAYSIZE(pos), "%.1f / %.1f / %.1f", g_menu->px, g_menu->py, g_menu->pz);
lumin_kv("Position", pos, clr->accent.Value);
}
gui->dummy(c_vec2(0, s_(6)));
lumin_heading("Entity Counts");
lumin_kv("Players", std::to_string(g_menu->nPlayers), clr->accent.Value);
lumin_kv("Animals", std::to_string(g_menu->nAnimals), clr->accent.Value);
lumin_kv("Zombies", std::to_string(g_menu->nZombies), clr->accent.Value);
lumin_kv("Vehicles", std::to_string(g_menu->nVehicles), clr->accent.Value);
lumin_kv("Items", std::to_string(g_menu->nItems), clr->accent.Value);
lumin_kv("Bullets", std::to_string(g_menu->nBullets), clr->accent.Value);
}
else
{
lumin_kv("Status", (g_menu && !g_menu->status.empty()) ? g_menu->status : "Offline", orange);
}
}
end_visual_section();
}
static constexpr const char* kRadarDomain = "radar.charliecharliekirky.christmas";
static void render_radar_tab(float section_height)
{
begin_full_section("Radar", section_height, true);
{
lumin_heading("Web Radar");
lumin_note("Open this address in a browser:");
gui->dummy(c_vec2(0, s_(4)));
if (widgets->action_button(kRadarDomain, "copy"))
ImGui::SetClipboardText(kRadarDomain);
if (g_menu)
{
gui->dummy(c_vec2(0, s_(6)));
lumin_heading("Connection");
lumin_kv("Port", std::to_string(g_menu->webPort), clr->accent.Value);
lumin_kv("Password", "Set in config.cfg", clr->text.Value);
}
}
end_visual_section();
}
static void render_exit_tab(float section_height)
{
begin_full_section("Exit", section_height);
{
lumin_heading("Exit Application");
lumin_note("This will close the overlay and exit the program.");
gui->dummy(c_vec2(0, s_(10)));
const c_col saved_accent = clr->accent;
clr->accent = c_col(225, 70, 70);
if (widgets->primary_button("Exit", "back") && g_menu && g_menu->onExit)
g_menu->onExit();
clr->accent = saved_accent;
}
end_visual_section();
}
static void render_settings_tab(float section_height)
{
if (!g_menu)
return;
// Persistent text buffers backing the four resolution fields. Seeded once
// from the live values, then treated as the source of truth (parsed back
// into the int pointers every frame).
static char ovr_w[8], ovr_h[8], rnd_w[8], rnd_h[8];
static bool buffers_ready = false;
if (!buffers_ready)
{
ImFormatString(ovr_w, IM_ARRAYSIZE(ovr_w), "%d", *g_menu->pendingW);
ImFormatString(ovr_h, IM_ARRAYSIZE(ovr_h), "%d", *g_menu->pendingH);
ImFormatString(rnd_w, IM_ARRAYSIZE(rnd_w), "%d", *g_menu->pendingRW);
ImFormatString(rnd_h, IM_ARRAYSIZE(rnd_h), "%d", *g_menu->pendingRH);
buffers_ready = true;
}
begin_full_section("Settings", section_height, true);
{
lumin_heading("Overlay (Monitor) Resolution");
lumin_note("Set to your MONITOR size. 0 x 0 = auto-detect.");
gui->push_id("ovr_res");
widgets->text_field("Width", ovr_w, IM_ARRAYSIZE(ovr_w));
widgets->text_field("Height", ovr_h, IM_ARRAYSIZE(ovr_h));
gui->pop_id();
*g_menu->pendingW = ImMax(0, atoi(ovr_w));
*g_menu->pendingH = ImMax(0, atoi(ovr_h));
if (widgets->primary_button("Apply Monitor Resolution") && g_menu->onApplyDisplayRes)
g_menu->onApplyDisplayRes();
gui->dummy(c_vec2(0, s_(8)));
lumin_heading("Game Render Resolution");
lumin_note("Set to the in-game resolution when it differs from the");
lumin_note("monitor. 0 x 0 = no stretched-res correction.");
gui->push_id("rnd_res");
widgets->text_field("Width", rnd_w, IM_ARRAYSIZE(rnd_w));
widgets->text_field("Height", rnd_h, IM_ARRAYSIZE(rnd_h));
gui->pop_id();
*g_menu->pendingRW = ImMax(0, atoi(rnd_w));
*g_menu->pendingRH = ImMax(0, atoi(rnd_h));
widgets->checkbox("Stretch to fill", "GPU stretches game to fill the monitor", g_menu->stretchToFill);
if (widgets->primary_button("Apply Render Resolution") && g_menu->onApplyRenderRes)
g_menu->onApplyRenderRes();
gui->dummy(c_vec2(0, s_(10)));
lumin_heading("General");
lumin_note("Press INSERT to toggle this menu.");
gui->dummy(c_vec2(0, s_(4)));
if (widgets->primary_button("Save Config", "active") && g_menu->onSaveConfig)
g_menu->onSaveConfig();
}
end_visual_section();
}
// ---------------------------------------------------------------------------
void c_gui::render()
{
gui->initialize();
sync_layout_preferences();
gui->easing(var->gui.tab_alpha, var->gui.tab != var->gui.tab_stored ? 0.f : 1.f, 7.f, static_easing);
if (var->gui.tab_alpha == 0)
var->gui.tab = var->gui.tab_stored;
const c_vec2 target(s_(visual_window_width), s_(visual_window_height));
gui->easing(elements->window.size.x, target.x, 24.f, dynamic_easing);
gui->easing(elements->window.size.y, target.y, 24.f, dynamic_easing);
const ImVec2 disp = ImGui::GetIO().DisplaySize;
gui->set_next_window_size(elements->window.size);
gui->set_next_window_pos(c_vec2(ImMax(0.f, (disp.x - elements->window.size.x) * 0.5f),
ImMax(0.f, (disp.y - elements->window.size.y) * 0.5f)));
gui->begin(elements->window.name, nullptr, window_flags_no_scrollbar | window_flags_no_scroll_with_mouse | window_flags_no_bring_to_front_on_focus | window_flags_no_focus_on_appearing | window_flags_no_background | window_flags_no_decoration | window_flags_no_move);
{
gui->set_style();
gui->draw_decorations();
const float top_row_y = visual_outer_padding;
const float top_row_height = 50.f;
const float top_row_gap = 2.f;
const float bottom_row_y = top_row_y + top_row_height + top_row_gap;
const float bottom_row_height = visual_window_height - bottom_row_y - visual_outer_padding;
const float sidebar_tabs_y = top_row_y + top_row_height;
const float sidebar_tabs_height = visual_window_height - sidebar_tabs_y - visual_outer_padding;
draw_visual_sidebar_glass(c_rect(c_vec2(s_(visual_outer_padding), s_(top_row_y)), c_vec2(s_(visual_outer_padding + visual_sidebar_width), s_(visual_window_height - visual_outer_padding))));
gui->set_pos(c_vec2(s_(visual_outer_padding), s_(top_row_y)), pos_all);
gui->begin_content("TopBrand", c_vec2(s_(visual_sidebar_width), s_(top_row_height)), s_(0, 0), s_(0, 0), window_flags_no_scrollbar | window_flags_no_background, child_flags_none);
{
widgets->brand_header("KarachiHook", var->gui.profile_name[0] != '\0' ? var->gui.profile_name : "DayZ Overlay");
}
gui->end_content();
gui->set_pos(c_vec2(s_(visual_outer_padding), s_(sidebar_tabs_y)), pos_all);
gui->begin_content("Tabs", c_vec2(s_(visual_sidebar_width), s_(sidebar_tabs_height)), s_(10, 10), s_(0, 4), window_flags_no_scrollbar | window_flags_no_background, child_flags_none);
{
var->gui.sidebar_glass = true;
{
c_window* tabs_inner_bg = gui->get_window();
static c_vec4 sidebar_overlay = c_vec4(0, 0, 0, 0);
gui->easing(sidebar_overlay, g_sidebar_selected_rect, 18.f, dynamic_easing);
if (sidebar_overlay.z > sidebar_overlay.x + 1.f)
{
draw->rect_filled(tabs_inner_bg->DrawList,
c_vec2(sidebar_overlay.x, sidebar_overlay.y), c_vec2(sidebar_overlay.z, sidebar_overlay.w),
draw->get_clr(clr->widget), s_(9.1f));
}
}
widgets->tab_button("ESP", "visuals", 1);
widgets->tab_button("Items", "loot", 2);
widgets->tab_button("Radar", "world", 3);
widgets->tab_button("Settings", "polish", 4);
widgets->tab_button("Exit", "back", 5);
widgets->tab_button("Info", "stats", 6);
{
static c_vec4 sidebar_indicator = c_vec4(0, 0, 0, 0);
gui->easing(sidebar_indicator, g_sidebar_selected_rect, 18.f, dynamic_easing);
if (sidebar_indicator.w > sidebar_indicator.y + 1.f)
{
c_window* tabs_inner = gui->get_window();
const float bar_w = s_(2);
const float bar_inset_y = s_(6);
const float bar_x = sidebar_indicator.x + s_(2);
const c_vec2 bar_min = c_vec2(bar_x, sidebar_indicator.y + bar_inset_y);
const c_vec2 bar_max = c_vec2(bar_x + bar_w, sidebar_indicator.w - bar_inset_y);
draw->rect_filled(tabs_inner->DrawList, bar_min, bar_max,
draw->get_clr(clr->accent), bar_w * 0.5f);
}
}
gui->easing(elements->tab_window_width, gui->get_window()->Size.x, 24.f, dynamic_easing);
var->gui.sidebar_glass = false;
}
gui->end_content();
gui->push_var(style_var_alpha, var->gui.tab_alpha);
const float feature_x = visual_outer_padding + visual_sidebar_width + visual_outer_padding;
const float feature_width = visual_window_width - feature_x - visual_outer_padding;
const float feature_header_height = top_row_height * 0.8f;
const float feature_header_y = top_row_y;
gui->set_pos(c_vec2(s_(feature_x), s_(feature_header_y) + s_(10) * (1.f - var->gui.tab_alpha)), pos_all);
{
const c_vec2 pill_pos = gui->get_window()->DC.CursorPos;
draw->rect_filled(gui->get_window()->DrawList, pill_pos, pill_pos + c_vec2(s_(feature_width), s_(feature_header_height)), draw->get_clr(clr->child), s_(14));
gui->begin_content("FeatureHeader", c_vec2(s_(feature_width), s_(feature_header_height)), s_(8, 4), s_(8, 0), window_flags_no_scrollbar | window_flags_no_background, child_flags_none);
{
const float search_width = s_(178.f);
widgets->search_field("Search", var->gui.feature_search, IM_ARRAYSIZE(var->gui.feature_search), c_vec2(search_width, s_(32.f)));
}
gui->end_content();
}
gui->set_pos(c_vec2(s_(feature_x), s_(bottom_row_y) + s_(10) * (1.f - var->gui.tab_alpha)), pos_all);
gui->begin_content("Features", c_vec2(s_(feature_width), s_(bottom_row_height)), s_(visual_feature_padding_x, visual_feature_padding_y), c_vec2(s_(visual_column_gap), 0.f), window_flags_no_scrollbar);
{
const visual_panel_density_state density_state = begin_visual_panel_density();
g_panel_number = 3;
gui->easing(elements->child_width, (gui->content_avail().x - s_(visual_column_gap)) / 2, 24.f, dynamic_easing);
const float section_height = visual_section_height(1);
const visual_widget_filter visual_widgets;
switch (var->gui.tab)
{
case 1: render_esp_tab(visual_widgets, section_height); break;
case 2: render_items_tab(visual_widgets, section_height); break;
case 3: render_radar_tab(section_height); break;
case 4: render_settings_tab(section_height); break;
case 5: render_exit_tab(section_height); break;
case 6: render_info_tab(section_height); break;
default: break;
}
end_visual_panel_density(density_state);
}
gui->end_content();
gui->pop_var();
}
gui->end();
}
// Shim called by GameOverlay (declared in src/Overlay/MenuBridge.h).
void RenderLuminMenu()
{
gui->render();
}
+66
View File
@@ -0,0 +1,66 @@
#pragma once
#include "includes.h"
enum fade_direction : int
{
vertically,
horizontally,
diagonally,
diagonally_reversed,
};
class c_draw
{
public:
ImU32 get_clr(const ImVec4& col, float alpha = 1.f);
ImU32 w_get_clr(style_col idx, float alpha = 1.f);
void text(ImDrawList* draw_list, const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.f, const ImVec4* cpu_fine_clip_rect = 0);
void text_clipped(ImDrawList* draw_list, ImFont* font, const ImVec2& pos_min, const ImVec2& pos_max, ImU32 color, const char* text, const char* text_display_end = NULL, const ImVec2* text_size_if_known = NULL, const ImVec2& align = ImVec2(0.f, 0.f), const ImRect* clip_rect = NULL);
void radial_gradient(ImDrawList* draw_list, const ImVec2& center, float radius, ImU32 col_in, ImU32 col_out);
void set_linear_color_alpha(ImDrawList* draw_list, int vert_start_idx, int vert_end_idx, ImVec2 gradient_p0, ImVec2 gradient_p1, ImU32 col0, ImU32 col1);
void line(ImDrawList* draw_list, const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness = 1.0f);
void rect(ImDrawList* draw_list, const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, draw_flags flags = 0, float thickness = 1.0f);
void rect_filled(ImDrawList* draw_list, const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, draw_flags flags = 0);
void rect_filled_multi_color(ImDrawList* draw, const ImVec2& p_min, const ImVec2& p_max, ImU32 col_upr_left, ImU32 col_upr_right, ImU32 col_bot_right, ImU32 col_bot_left, float rounding = 0.f, draw_flags flags = 0);
void fade_rect_filled(ImDrawList* draw, const ImVec2& pos_min, const ImVec2& pos_max, ImU32 col_one, ImU32 col_two, fade_direction direction, float rounding = 0.f, draw_flags flags = 0);
void shadow_rect(ImDrawList* draw_list, const ImVec2& obj_min, const ImVec2& obj_max, ImU32 shadow_col, float shadow_thickness, const ImVec2& shadow_offset, draw_flags flags = 0, float obj_rounding = 0.0f);
void circle(ImDrawList* draw_list, const ImVec2& center, float radius, ImU32 col, int num_segments = 0, float thickness = 1.0f);
void circle_filled(ImDrawList* draw_list, const ImVec2& center, float radius, ImU32 col, int num_segments = 0);
void shadow_circle(ImDrawList* draw_list, const ImVec2& obj_center, float obj_radius, ImU32 shadow_col, float shadow_thickness, const ImVec2& shadow_offset, draw_flags flags = 0, int obj_num_segments = 12);
void triangle(ImDrawList* draw_list, const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness = 1.f);
void triangle_filled(ImDrawList* draw_list, const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col);
void image(ImDrawList* draw_list, ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min = ImVec2(0, 0), const ImVec2& uv_max = ImVec2(1, 1), ImU32 col = IM_COL32_WHITE);
void image_rounded(ImDrawList* draw_list, ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min = ImVec2(0, 0), const ImVec2& uv_max = ImVec2(1, 1), ImU32 col = IM_COL32_WHITE, float rounding = 1.f, draw_flags flags = 0);
void shadow_convex_poly(ImDrawList* draw_list, const ImVec2* points, int points_count, ImU32 shadow_col, float shadow_thickness, const ImVec2& shadow_offset, draw_flags flags = 0);
void shadow_ngon(ImDrawList* draw_list, const ImVec2& obj_center, float obj_radius, ImU32 shadow_col, float shadow_thickness, const ImVec2& shadow_offset, draw_flags flags, int obj_num_segments);
void rotate_start(ImDrawList* draw_list);
void rotate_end(ImDrawList* draw_list, float rad, ImVec2 center = ImVec2(0, 0));
void push_clip_rect(ImDrawList* draw_list, const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect = false);
void pop_clip_rect(ImDrawList* draw_list);
};
inline std::unique_ptr<c_draw> draw = std::make_unique<c_draw>();
+477
View File
@@ -0,0 +1,477 @@
#pragma once
typedef int style_var;
typedef int style_col;
typedef int window_flags;
typedef int child_flags;
typedef int gui_cond;
typedef int draw_flags;
typedef int mouse_button;
using c_text = std::string;
using c_vec4 = ImVec4;
using c_col = ImColor;
using c_vec2 = ImVec2;
using c_multi_string = std::vector<std::string>;
using c_multi_bool = std::vector<bool>;
using c_window = ImGuiWindow;
using c_id = ImGuiID;
using c_rect = ImRect;
using c_draw_list = ImDrawList;
enum style_var_
{
style_var_alpha,
style_var_disabled_alpha,
style_var_window_padding,
style_var_window_rounding,
style_var_window_border_size,
style_var_window_min_size,
style_var_window_title_align,
style_var_child_rounding,
style_var_child_border_size,
style_var_popup_rounding,
style_var_popup_border_size,
style_var_frame_padding,
style_var_frame_rounding,
style_var_frame_border_size,
style_var_item_spacing,
style_var_item_inner_spacing,
style_var_indent_spacing,
style_var_cell_padding,
style_var_scrollbar_size,
style_var_scrollbar_rounding,
style_var_grab_min_size,
style_var_grab_rounding,
style_var_tab_rounding,
style_var_tab_border_size,
style_var_tab_bar_border_size,
style_var_tab_bar_overline_size,
style_var_table_angled_headers_angle,
style_var_table_angled_headers_text_align,
style_var_button_text_align,
style_var_selectable_text_align,
style_var_separator_text_border_size,
style_var_separator_text_align,
style_var_separator_text_padding,
style_var_window_shadow_size,
style_var_window_shadow_offset,
style_var_scrollbar_border_padding,
style_var_scrollbar_content_padding,
style_var_count
};
enum style_col_
{
style_col_text,
style_col_text_disabled,
style_col_window_bg,
style_col_child_bg,
style_col_popup_bg,
style_col_border,
style_col_border_shadow,
style_col_frame_bg,
style_col_frame_bg_hovered,
style_col_frame_bg_active,
style_col_title_bg,
style_col_title_bg_active,
style_col_title_bg_collapsed,
style_col_menu_bar_bg,
style_col_scrollbar_bg,
style_col_scrollbar_grab,
style_col_scrollbar_grab_hovered,
style_col_scrollbar_grab_active,
style_col_check_mark,
style_col_slider_grab,
style_col_slider_grab_active,
style_col_button,
style_col_button_hovered,
style_col_button_active,
style_col_header,
style_col_header_hovered,
style_col_header_active,
style_col_separator,
style_col_separator_hovered,
style_col_separator_active,
style_col_resize_grip,
style_col_resize_grip_hovered,
style_col_resize_grip_active,
style_col_tab_hovered,
style_col_tab,
style_col_tab_selected,
style_col_tab_selected_overline,
style_col_tab_dimmed,
style_col_tab_dimmed_selected,
style_col_tab_dimmed_selected_overline,
style_col_plot_lines,
style_col_plot_lines_hovered,
style_col_plot_histogram,
style_col_plot_histogram_hovered,
style_col_table_header_bg,
style_col_table_border_strong,
style_col_table_border_light,
style_col_table_row_bg,
style_col_table_row_bg_alt,
style_col_text_link,
style_col_text_selected_bg,
style_col_drag_drop_target,
style_col_nav_highlight,
style_col_nav_windowing_highlight,
style_col_nav_windowing_dim_bg,
style_col_modal_window_dim_bg,
style_col_window_shadow,
style_col_count,
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
style_col_tab_active = style_col_tab_selected,
style_col_tab_unfocused = style_col_tab_dimmed,
style_col_tab_unfocused_active = style_col_tab_dimmed_selected,
#endif
};
enum window_flags_
{
window_flags_none = 0,
window_flags_no_title_bar = 1 << 0,
window_flags_no_resize = 1 << 1,
window_flags_no_move = 1 << 2,
window_flags_no_scrollbar = 1 << 3,
window_flags_no_scroll_with_mouse = 1 << 4,
window_flags_no_collapse = 1 << 5,
window_flags_always_auto_resize = 1 << 6,
window_flags_no_background = 1 << 7,
window_flags_no_saved_settings = 1 << 8,
window_flags_no_mouse_inputs = 1 << 9,
window_flags_menu_bar = 1 << 10,
window_flags_horizontal_scrollbar = 1 << 11,
window_flags_no_focus_on_appearing = 1 << 12,
window_flags_no_bring_to_front_on_focus = 1 << 13,
window_flags_always_vertical_scrollbar = 1 << 14,
window_flags_always_horizontal_scrollbar = 1 << 15,
window_flags_no_nav_inputs = 1 << 16,
window_flags_no_nav_focus = 1 << 17,
window_flags_unsaved_document = 1 << 18,
window_flags_no_nav = window_flags_no_nav_inputs | window_flags_no_nav_focus,
window_flags_no_decoration = window_flags_no_title_bar | window_flags_no_resize | window_flags_no_scrollbar | window_flags_no_collapse,
window_flags_no_inputs = window_flags_no_mouse_inputs | window_flags_no_nav_inputs | window_flags_no_nav_focus,
window_flags_child_window = 1 << 24,
window_flags_tooltip = 1 << 25,
window_flags_popup = 1 << 26,
window_flags_modal = 1 << 27,
window_flags_child_menu = 1 << 28,
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
window_flags_always_use_window_padding = 1 << 30,
window_flags_nav_flattened = 1 << 31,
#endif
};
enum child_flags_
{
child_flags_none = 0,
child_flags_borders = 1 << 0,
child_flags_always_use_window_padding = 1 << 1,
child_flags_resize_x = 1 << 2,
child_flags_resize_y = 1 << 3,
child_flags_auto_resize_x = 1 << 4,
child_flags_auto_resize_y = 1 << 5,
child_flags_always_auto_resize = 1 << 6,
child_flags_frame_style = 1 << 7,
child_flags_nav_flattened = 1 << 8,
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
child_flags_border = child_flags_borders,
#endif
};
enum gui_cond_
{
gui_cond_none = 0,
gui_cond_always = 1 << 0,
gui_cond_once = 1 << 1,
gui_cond_first_use_ever = 1 << 2,
gui_cond_appearing = 1 << 3,
};
enum draw_flags_
{
draw_flags_none = 0,
draw_flags_closed = 1 << 0,
draw_flags_round_corners_top_left = 1 << 4,
draw_flags_round_corners_top_right = 1 << 5,
draw_flags_round_corners_bottom_left = 1 << 6,
draw_flags_round_corners_bottom_right = 1 << 7,
draw_flags_round_corners_none = 1 << 8,
draw_flags_round_corners_top = draw_flags_round_corners_top_left | draw_flags_round_corners_top_right,
draw_flags_round_corners_bottom = draw_flags_round_corners_bottom_left | draw_flags_round_corners_bottom_right,
draw_flags_round_corners_left = draw_flags_round_corners_bottom_left | draw_flags_round_corners_top_left,
draw_flags_round_corners_right = draw_flags_round_corners_bottom_right | draw_flags_round_corners_top_right,
draw_flags_round_corners_all = draw_flags_round_corners_top_left | draw_flags_round_corners_top_right | draw_flags_round_corners_bottom_left | draw_flags_round_corners_bottom_right,
draw_flags_round_corners_default = draw_flags_round_corners_all,
draw_flags_round_corners_mask = draw_flags_round_corners_all | draw_flags_round_corners_none,
draw_flags_shadow_cut_out_shape_background = 1 << 9
};
enum mouse_button_
{
mouse_button_left = 0,
mouse_button_right = 1,
mouse_button_middle = 2,
mouse_button_count = 5
};
struct data_var_info
{
ImU32 count;
ImU32 offset;
void* get_var_ptr(void* parent) const { return (void*)((unsigned char*)parent + offset); }
};
struct gui_style
{
float alpha;
float disabled_alpha;
ImVec2 window_padding;
float window_rounding;
float window_border_size;
ImVec2 window_min_size;
ImVec2 window_title_align;
ImGuiDir window_menu_button_position;
float child_rounding;
float child_border_size;
float popup_rounding;
float popup_border_size;
ImVec2 frame_padding;
float frame_rounding;
float frame_border_size;
ImVec2 item_spacing;
ImVec2 item_inner_spacing;
ImVec2 cell_padding;
ImVec2 touch_extra_padding;
float indent_spacing;
float columns_min_spacing;
float scrollbar_size;
float scrollbar_rounding;
float grab_min_size;
float grab_rounding;
float log_slider_deadzone;
float tab_rounding;
float tab_border_size;
float tab_min_width_for_close_button;
float tab_bar_border_size;
float tab_bar_overline_size;
float table_angled_headers_angle;
ImVec2 table_angled_headers_text_align;
ImGuiDir color_button_position;
ImVec2 button_text_align;
ImVec2 selectable_text_align;
float separator_text_border_size;
ImVec2 separator_text_align;
ImVec2 separator_text_padding;
float window_shadow_size;
ImVec2 window_shadow_offset;
ImVec2 scrollbar_border_padding;
float scrollbar_content_padding;
ImVec2 display_window_padding;
ImVec2 display_safe_area_padding;
float mouse_cursor_scale;
bool anti_aliased_lines;
bool anti_aliased_lines_use_tex;
bool anti_aliased_fill;
float curve_tessellation_tol;
float circle_tessellation_max_error;
ImVec4 colors[ImGuiCol_COUNT];
float hover_stationary_delay;
float hover_delay_short;
float hover_delay_normal;
ImGuiHoveredFlags hover_flags_for_tooltip_mouse;
ImGuiHoveredFlags hover_flags_for_tooltip_nav;
gui_style();
};
inline gui_style::gui_style()
{
alpha = 1.0f;
disabled_alpha = 0.60f;
window_padding = ImVec2(8, 8);
window_rounding = 0.0f;
window_border_size = 1.0f;
window_min_size = ImVec2(32, 32);
window_title_align = ImVec2(0.0f, 0.5f);
window_menu_button_position = ImGuiDir_Left;
child_rounding = 0.0f;
child_border_size = 1.0f;
popup_rounding = 0.0f;
popup_border_size = 1.0f;
frame_padding = ImVec2(4, 3);
frame_rounding = 0.0f;
frame_border_size = 0.0f;
item_spacing = ImVec2(8, 4);
item_inner_spacing = ImVec2(4, 4);
cell_padding = ImVec2(4, 2);
touch_extra_padding = ImVec2(0, 0);
indent_spacing = 21.0f;
columns_min_spacing = 6.0f;
scrollbar_size = 14.0f;
scrollbar_rounding = 9.0f;
grab_min_size = 12.0f;
grab_rounding = 0.0f;
log_slider_deadzone = 4.0f;
tab_rounding = 4.0f;
tab_border_size = 0.0f;
tab_min_width_for_close_button = 0.0f;
tab_bar_border_size = 1.0f;
tab_bar_overline_size = 2.0f;
table_angled_headers_angle = 35.0f * (IM_PI / 180.0f);
table_angled_headers_text_align = ImVec2(0.5f, 0.0f);
color_button_position = ImGuiDir_Right;
button_text_align = ImVec2(0.5f, 0.5f);
selectable_text_align = ImVec2(0.0f, 0.0f);
separator_text_border_size = 3.0f;
separator_text_align = ImVec2(0.0f, 0.5f);
separator_text_padding = ImVec2(20.0f, 3.0f);
window_shadow_size = 100.0f;
window_shadow_offset = ImVec2(0, 0);
scrollbar_border_padding = ImVec2(6, 6);
scrollbar_content_padding = 6;
display_window_padding = ImVec2(19, 19);
display_safe_area_padding = ImVec2(3, 3);
mouse_cursor_scale = 1.0f;
anti_aliased_lines = true;
anti_aliased_lines_use_tex = true;
anti_aliased_fill = true;
curve_tessellation_tol = 1.25f;
circle_tessellation_max_error = 0.30f;
hover_stationary_delay = 0.15f;
hover_delay_short = 0.15f;
hover_delay_normal = 0.40f;
hover_flags_for_tooltip_mouse = ImGuiHoveredFlags_Stationary | ImGuiHoveredFlags_DelayShort | ImGuiHoveredFlags_AllowWhenDisabled;
hover_flags_for_tooltip_nav = ImGuiHoveredFlags_NoSharedDelay | ImGuiHoveredFlags_DelayNormal | ImGuiHoveredFlags_AllowWhenDisabled;
colors[style_col_text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
colors[style_col_text_disabled] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
colors[style_col_window_bg] = ImVec4(0.06f, 0.06f, 0.06f, 0.94f);
colors[style_col_child_bg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[style_col_popup_bg] = ImVec4(0.08f, 0.08f, 0.08f, 0.94f);
colors[style_col_border] = ImVec4(0.43f, 0.43f, 0.50f, 0.50f);
colors[style_col_border_shadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[style_col_frame_bg] = ImVec4(0.16f, 0.29f, 0.48f, 0.54f);
colors[style_col_frame_bg_hovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f);
colors[style_col_frame_bg_active] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f);
colors[style_col_title_bg] = ImVec4(0.04f, 0.04f, 0.04f, 1.00f);
colors[style_col_title_bg_active] = ImVec4(0.16f, 0.29f, 0.48f, 1.00f);
colors[style_col_title_bg_collapsed] = ImVec4(0.00f, 0.00f, 0.00f, 0.51f);
colors[style_col_menu_bar_bg] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
colors[style_col_scrollbar_bg] = ImVec4(0.02f, 0.02f, 0.02f, 0.53f);
colors[style_col_scrollbar_grab] = ImVec4(0.31f, 0.31f, 0.31f, 1.00f);
colors[style_col_scrollbar_grab_hovered] = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
colors[style_col_scrollbar_grab_active] = ImVec4(0.51f, 0.51f, 0.51f, 1.00f);
colors[style_col_check_mark] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
colors[style_col_slider_grab] = ImVec4(0.24f, 0.52f, 0.88f, 1.00f);
colors[style_col_slider_grab_active] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
colors[style_col_button] = ImVec4(0.26f, 0.59f, 0.98f, 0.40f);
colors[style_col_button_hovered] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
colors[style_col_button_active] = ImVec4(0.06f, 0.53f, 0.98f, 1.00f);
colors[style_col_header] = ImVec4(0.26f, 0.59f, 0.98f, 0.31f);
colors[style_col_header_hovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.80f);
colors[style_col_header_active] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
colors[style_col_separator] = colors[style_col_border];
colors[style_col_separator_hovered] = ImVec4(0.10f, 0.40f, 0.75f, 0.78f);
colors[style_col_separator_active] = ImVec4(0.10f, 0.40f, 0.75f, 1.00f);
colors[style_col_resize_grip] = ImVec4(0.26f, 0.59f, 0.98f, 0.20f);
colors[style_col_resize_grip_hovered] = ImVec4(0.26f, 0.59f, 0.98f, 0.67f);
colors[style_col_resize_grip_active] = ImVec4(0.26f, 0.59f, 0.98f, 0.95f);
colors[style_col_tab_hovered] = colors[style_col_header_hovered];
colors[style_col_tab] = ImLerp(colors[style_col_header], colors[style_col_title_bg_active], 0.80f);
colors[style_col_tab_selected] = ImLerp(colors[style_col_header_active], colors[style_col_title_bg_active], 0.60f);
colors[style_col_tab_selected_overline] = colors[style_col_header_active];
colors[style_col_tab_dimmed] = ImLerp(colors[style_col_tab], colors[style_col_title_bg], 0.80f);
colors[style_col_tab_dimmed_selected] = ImLerp(colors[style_col_tab_selected], colors[style_col_title_bg], 0.40f);
colors[style_col_tab_dimmed_selected_overline] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
colors[style_col_plot_lines] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f);
colors[style_col_plot_lines_hovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f);
colors[style_col_plot_histogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
colors[style_col_plot_histogram_hovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
colors[style_col_table_header_bg] = ImVec4(0.19f, 0.19f, 0.20f, 1.00f);
colors[style_col_table_border_strong] = ImVec4(0.31f, 0.31f, 0.35f, 1.00f);
colors[style_col_table_border_light] = ImVec4(0.23f, 0.23f, 0.25f, 1.00f);
colors[style_col_table_row_bg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[style_col_table_row_bg_alt] = ImVec4(1.00f, 1.00f, 1.00f, 0.06f);
colors[style_col_text_link] = colors[style_col_header_active];
colors[style_col_text_selected_bg] = ImVec4(0.26f, 0.59f, 0.98f, 0.35f);
colors[style_col_drag_drop_target] = ImVec4(1.00f, 1.00f, 0.00f, 0.90f);
colors[style_col_nav_highlight] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
colors[style_col_nav_windowing_highlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f);
colors[style_col_nav_windowing_dim_bg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f);
colors[style_col_modal_window_dim_bg] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f);
colors[style_col_window_shadow] = ImVec4(0.08f, 0.08f, 0.08f, 0.35f);
}
static const data_var_info style_var_info[] =
{
{ 1, (ImU32)offsetof(gui_style, alpha) },
{ 1, (ImU32)offsetof(gui_style, disabled_alpha) },
{ 2, (ImU32)offsetof(gui_style, window_padding) },
{ 1, (ImU32)offsetof(gui_style, window_rounding) },
{ 1, (ImU32)offsetof(gui_style, window_border_size) },
{ 2, (ImU32)offsetof(gui_style, window_min_size) },
{ 2, (ImU32)offsetof(gui_style, window_title_align) },
{ 1, (ImU32)offsetof(gui_style, child_rounding) },
{ 1, (ImU32)offsetof(gui_style, child_border_size) },
{ 1, (ImU32)offsetof(gui_style, popup_rounding) },
{ 1, (ImU32)offsetof(gui_style, popup_border_size) },
{ 2, (ImU32)offsetof(gui_style, frame_padding) },
{ 1, (ImU32)offsetof(gui_style, frame_rounding) },
{ 1, (ImU32)offsetof(gui_style, frame_border_size) },
{ 2, (ImU32)offsetof(gui_style, item_spacing) },
{ 2, (ImU32)offsetof(gui_style, item_inner_spacing) },
{ 1, (ImU32)offsetof(gui_style, indent_spacing) },
{ 2, (ImU32)offsetof(gui_style, cell_padding) },
{ 1, (ImU32)offsetof(gui_style, scrollbar_size) },
{ 1, (ImU32)offsetof(gui_style, scrollbar_rounding) },
{ 1, (ImU32)offsetof(gui_style, grab_min_size) },
{ 1, (ImU32)offsetof(gui_style, grab_rounding) },
{ 1, (ImU32)offsetof(gui_style, tab_rounding) },
{ 1, (ImU32)offsetof(gui_style, tab_border_size) },
{ 1, (ImU32)offsetof(gui_style, tab_bar_border_size) },
{ 1, (ImU32)offsetof(gui_style, tab_bar_overline_size) },
{ 1, (ImU32)offsetof(gui_style, table_angled_headers_angle) },
{ 2, (ImU32)offsetof(gui_style, table_angled_headers_text_align) },
{ 2, (ImU32)offsetof(gui_style, button_text_align) },
{ 2, (ImU32)offsetof(gui_style, selectable_text_align) },
{ 1, (ImU32)offsetof(gui_style, separator_text_border_size) },
{ 2, (ImU32)offsetof(gui_style, separator_text_align) },
{ 2, (ImU32)offsetof(gui_style, separator_text_padding) },
{ 1, (ImU32)offsetof(gui_style, window_shadow_size) },
{ 2, (ImU32)offsetof(gui_style, window_shadow_offset) },
{ 2, (ImU32)offsetof(gui_style, scrollbar_border_padding) },
{ 1, (ImU32)offsetof(gui_style, scrollbar_content_padding) },
};
struct gui_style_mod
{
style_var var_idx;
union { int backup_int[2]; float backup_float[2]; };
gui_style_mod(style_var idx, int v) { var_idx = idx; backup_int[0] = v; }
gui_style_mod(style_var idx, float v) { var_idx = idx; backup_float[0] = v; }
gui_style_mod(style_var idx, ImVec2 v) { var_idx = idx; backup_float[0] = v.x; backup_float[1] = v.y; }
};
struct gui_color_mod
{
style_col col;
ImVec4 backup_value;
};
inline std::vector<gui_style_mod> style_var_stack;
inline std::vector<gui_color_mod> style_col_stack;
inline const data_var_info* get_style_var_info(style_var idx)
{
return &style_var_info[idx];
}
+34
View File
@@ -0,0 +1,34 @@
#pragma once
#include "includes.h"
// DayZ overlay integration: resolved relative to the executable's working
// directory. CMake copies framework/data/uicons next to the built binary.
inline constexpr const char* flaticon_uicons_regular_rounded_path = "data\\uicons\\uicons-regular-rounded.ttf";
class c_font
{
public:
void update();
ImFont* get(const std::vector<unsigned char>& font_data, float size);
ImFont* get_file(const std::string& file_path, float size, bool private_glyphs = false);
private:
struct font_data
{
std::vector<unsigned char> data;
std::string file_path;
const void* source;
float size;
ImFont* font;
bool file;
bool private_glyphs;
};
void add(const std::vector<unsigned char>& font_data, float size);
void add_file(const std::string& file_path, float size, bool private_glyphs);
std::vector<font_data> data;
};
inline std::unique_ptr<c_font> font = std::make_unique<c_font>();
+253
View File
@@ -0,0 +1,253 @@
#pragma once
#include "includes.h"
#include <unordered_map>
#include "widgets.h"
#include "../headers/functions.h"
using namespace ImGui;
#define s_(...) scale_impl(__VA_ARGS__, var->gui.dpi)
inline ImVec2 scale_impl(const ImVec2& vec, float dpi) {
return ImVec2(roundf(vec.x * dpi), roundf(vec.y * dpi));
}
inline ImVec2 scale_impl(float x, float y, float dpi) {
return ImVec2(roundf(x * dpi), roundf(y * dpi));
}
inline float scale_impl(float var, float dpi) {
return roundf(var * dpi);
}
enum positions
{
pos_all,
pos_x,
pos_y
};
enum easing_type
{
static_easing,
dynamic_easing
};
class c_gui
{
public:
std::unordered_map<ImGuiID, void*> m_anim_states;
template <typename T>
T* anim_container(ImGuiID id)
{
auto it = m_anim_states.find(id);
if (it != m_anim_states.end())
return static_cast<T*>(it->second);
T* new_state = new T();
m_anim_states[id] = new_state;
return new_state;
}
float fixed_speed(float speed) { return speed / ImGui::GetIO().Framerate; }
template<typename T>
T easing(T& value, T val, float speed, int type, bool dynamic_round = false)
{
if (type == static_easing)
{
if constexpr (std::is_same<T, ImVec4>::value)
{
return { 1.f, 1.f, 1.f, 1.f };
}
else
{
T step = fixed_speed(speed);
if (value < val)
{
value += step;
if (value > val) value = val;
}
else if (value > val)
{
value -= step;
if (value < val) value = val;
}
}
}
else if (type == dynamic_easing)
{
if constexpr (std::is_same<T, ImVec4>::value)
{
value = ImLerp(value, val, fixed_speed(speed));
}
else
value = ImLerp(value, val + (dynamic_round ? 0.5f : 0.f), fixed_speed(speed));
}
return value;
}
bool begin(std::string_view name, bool* p_open = nullptr, window_flags flags = window_flags_none);
void end();
void push_color(style_col idx, ImU32 col);
void pop_color(int count = 1);
void push_var(style_var idx, float val);
void push_var(style_var idx, const ImVec2& val);
void pop_var(int count = 1);
void push_font(ImFont* font);
void pop_font();
void set_pos(const ImVec2& pos, int type);
void set_pos(float pos, int type);
ImVec2 get_pos();
void set_screen_pos(const ImVec2& pos, int type);
void set_screen_pos(float pos, int type);
ImVec2 get_screen_pos();
void begin_group();
void end_group();
void begin_content(std::string_view id, const ImVec2& size, const ImVec2& padding = ImVec2(0, 0), const ImVec2& spacing = ImVec2(0, 0), window_flags window_flags__ = 0, child_flags child_flags__ = 0);
void end_content();
void sameline(float offset_from_start_x = 0.f, float spacing_w = -1.f);
void dummy(const ImVec2& size);
bool begin_def_child(std::string_view name, const ImVec2& size_arg = ImVec2(0, 0), child_flags child_flags = 0, window_flags window_flags = 0);
void end_def_child();
void set_next_window_pos(const ImVec2& pos, gui_cond cond = 0, const ImVec2& pivot = ImVec2(0, 0));
void set_next_window_size(const ImVec2& size, gui_cond cond = 0);
ImVec2 text_size(ImFont* font, const char* text, const char* text_end = nullptr, bool hide_text_after_double_hash = false, float wrap_width = -1.f);
ImVec2 window_size();
float window_width();
float window_height();
ImDrawList* window_drawlist();
ImDrawList* foreground_drawlist();
ImDrawList* background_drawlist();
ImVec2 window_pos();
ImGuiWindow* get_window();
void push_id(const char* str_id);
void push_id(const char* str_id_begin, const char* str_id_end);
void push_id(const void* ptr_id);
void push_id(int int_id);
void pop_id();
ImGuiID get_id(const char* str, const char* str_end);
ImGuiID get_id(const void* ptr);
ImGuiID get_id(int n);
ImVec2 content_avail();
ImVec2 content_max();
void item_size(const ImVec2& size, float text_baseline_y = -1.f);
void item_size(const ImRect& bb, float text_baseline_y = -1.f);
bool item_add(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg = NULL, ImGuiItemFlags extra_flags = 0);
bool is_window_hovered(ImGuiHoveredFlags flags);
bool is_window_focused(ImGuiFocusedFlags flags);
void set_window_focus();
void set_window_focus(const char* name);
bool is_rect_visible(const ImVec2& size);
bool is_rect_visible(const ImRect& rect);
ImVec2 adjust_window_pos(const ImVec2& rect, const ImVec2& window_size);
bool button_behavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool* out_held, ImGuiButtonFlags flags = 0);
bool invisible_button(const char* str_id, const ImVec2& size_arg, mouse_button flags = 0);
ImVec4 u32_to_float4(ImU32 in);
ImU32 float4_to_u32(const ImVec4& in);
void rgb_to_hsv(float r, float g, float b, float& out_h, float& out_s, float& out_v);
void hsv_to_rgb(float h, float s, float v, float& out_r, float& out_g, float& out_b);
bool item_hoverable(const ImRect& bb, ImGuiID id, ImGuiItemFlags item_flags = 0);
bool is_item_hovered(ImGuiHoveredFlags flags);
bool is_item_active();
bool is_item_clicked(mouse_button mouse_button);
bool mouse_down(mouse_button button);
bool mouse_clicked(mouse_button button, bool repeat = false);
bool mouse_released(mouse_button button);
bool mouse_double_clicked(mouse_button button);
const char* text_end(const char* text);
template<typename T>
const char* get_fmt(char* text, T* value, std::string_view fmt)
{
ImFormatString(text, IM_ARRAYSIZE(text), fmt.data(), *value);
return text + strlen(text);
}
bool is_window_cond(ImGuiWindow* window, const std::vector<std::string>& names);
ImVec2 mouse_pos();
void set_style();
void draw_decorations();
void initialize();
void render();
ImRect get_item_rect();
};
inline std::unique_ptr<c_gui> gui = std::make_unique<c_gui>();
+17
View File
@@ -0,0 +1,17 @@
#pragma once
#define IMGUI_DEFINE_MATH_OPERATORS
#include "imgui.h"
#include "imgui_internal.h"
#include <vector>
#include <sstream>
#include <string>
#include "flags.h"
#include "../settings/colors.h"
#include "../settings/elements.h"
#include "../settings/variables.h"
#include "fonts.h"
#include "draw.h"
#include "functions.h"
#include "../data/fonts.h"
+107
View File
@@ -0,0 +1,107 @@
#pragma once
#include "includes.h"
#define IMGUI_DEFINE_MATH_OPERATORS
struct custom_slider_t
{
bool held;
c_rect rect;
c_rect active;
c_vec2 circle_pos;
};
enum title_status_icon
{
title_status_none = 0,
title_status_danger,
title_status_warning,
title_status_safe
};
enum keybind_mode
{
keybind_mode_hold = 0,
keybind_mode_toggle,
keybind_mode_always
};
struct keybind_t
{
int key = ImGuiKey_None;
bool ctrl = false;
bool shift = false;
bool alt = false;
bool super = false;
int mode = keybind_mode_hold;
bool capturing = false;
};
class c_widgets
{
public:
bool tab_button(std::string name, std::string icon, int tab);
bool sub_tab_button(std::string name, std::string icon, int tab, float width = 0.f);
void brand_header(std::string name, std::string subtitle);
bool profile_dropdown(std::string name, std::string status);
bool primary_button(std::string name, std::string icon = "");
bool action_button(std::string name, std::string icon = "");
bool card_button(std::string name, std::string description, std::string button_text = "Run");
bool category_button(std::string name, std::string description, bool* callback);
bool child(std::string name);
void end_child();
bool checkbox(std::string name, std::string description, bool* callback, title_status_icon status = title_status_none);
bool keybind(std::string name, std::string description, keybind_t* bind);
bool dropdown(std::string name, std::string description, int* callback, std::vector<std::string> variants);
bool slider(std::string name, std::string description, float* callback, float vmin, float vmax, std::string format = "%.1f");
custom_slider_t custom_slider(std::string name, float* callback, float vmin, float vmax, float width);
bool color_picker(std::string name, c_vec4* color);
bool text_field(std::string name, char* buf, int buf_size, bool password = false, std::string icon = "");
bool search_field(std::string name, char* buf, int buf_size, const c_vec2& size);
};
inline std::unique_ptr<c_widgets> widgets = std::make_unique<c_widgets>();
enum notify_type
{
success = 0,
warning = 1,
error = 2
};
struct notify_state
{
int notify_id;
std::string title;
std::string text;
notify_type type{ success };
ImVec2 window_size{ 0, 0 };
float notify_alpha{ 0 };
bool active_notify{ true };
float notify_timer{ 0 };
float notify_pos{ 0 };
float notify_slide{ 28 };
};
class c_notify
{
public:
void setup_notify();
void add_notify(std::string title, std::string text, notify_type type);
private:
ImVec2 render_notify(float notify_alpha, float notify_percentage, float notify_pos, float notify_slide, const std::string& title, const std::string& text, notify_type type);
float notify_time{ 2.65f };
int notify_count{ 0 };
float notify_spacing{ 8 };
ImVec2 notify_padding{ 16, 16 };
std::vector<notify_state> notifications;
};
inline std::unique_ptr<c_notify> notify = std::make_unique<c_notify>();
File diff suppressed because it is too large Load Diff
+112
View File
@@ -0,0 +1,112 @@
#include "../headers/includes.h"
#include "../../thirdparty/imgui/imgui_freetype.h"
#include "imgui_impl_dx11.h"
static const ImWchar* get_private_icon_ranges()
{
static const ImWchar ranges[] =
{
0x26A0, 0x26A0, // warning sign
0x26D4, 0x26D4, // no entry
0x2714, 0x2714, // heavy check mark
0xE70D, 0xE70E, // Segoe MDL2 chevrons
0xF1E7, 0xF1E7, // fi-rr-backpack
0xF309, 0xF309, // fi-rr-bullseye
0xF3A2, 0xF3A2, // fi-rr-chart-histogram
0xF5F8, 0xF5F8, // fi-rr-eye
0xF71C, 0xF71C, // fi-rr-grid
0xF87D, 0xF87D, // fi-rr-layout-fluid
0xF8E1, 0xF8E1, // fi-rr-magic-wand
0xFB7C, 0xFB7C, // fi-rr-running
0xFD32, 0xFD32, // fi-rr-sword
0xFD5F, 0xFD5F, // fi-rr-target
0xFE19, 0xFE19, // fi-rr-treasure-chest
0xFEA0, 0xFEA0, // fi-rr-user
0xFEA6, 0xFEA6, // fi-rr-users
0xFF21, 0xFF21, // fi-rr-world
0
};
return ranges;
}
void c_font::update()
{
if (var->gui.dpi_changed)
{
var->gui.dpi = var->gui.stored_dpi / 100.f;
ImGuiIO& io = ImGui::GetIO();
ImGui_ImplDX11_InvalidateDeviceObjects();
io.Fonts->Clear();
for (auto& font_t : data)
{
ImFontConfig cfg;
if (font_t.file)
{
cfg.FontBuilderFlags = ImGuiFreeTypeBuilderFlags_ForceAutoHint;
const ImWchar* ranges = font_t.private_glyphs ? get_private_icon_ranges() : io.Fonts->GetGlyphRangesCyrillic();
font_t.font = io.Fonts->AddFontFromFileTTF(font_t.file_path.c_str(), s_(font_t.size), &cfg, ranges);
}
else
{
cfg.FontBuilderFlags = ImGuiFreeTypeBuilderFlags_ForceAutoHint | ImGuiFreeTypeBuilderFlags_Bitmap;
cfg.FontDataOwnedByAtlas = false;
font_t.font = io.Fonts->AddFontFromMemoryTTF(font_t.data.data(), font_t.data.size(), s_(font_t.size), &cfg, io.Fonts->GetGlyphRangesCyrillic());
}
}
io.Fonts->Build();
ImGui_ImplDX11_CreateDeviceObjects();
var->gui.dpi_changed = false;
}
}
ImFont* c_font::get(const std::vector<unsigned char>& font_data, float size)
{
const void* source = font_data.empty() ? nullptr : font_data.data();
for (auto& font_t : data)
{
if (!font_t.file && font_t.source == source && font_t.size == size)
{
return font_t.font;
}
}
add(font_data, size);
var->gui.dpi_changed = true;
return get(font_data, size);
}
ImFont* c_font::get_file(const std::string& file_path, float size, bool private_glyphs)
{
for (auto& font_t : data)
{
if (font_t.file && font_t.file_path == file_path && font_t.size == size && font_t.private_glyphs == private_glyphs)
{
return font_t.font;
}
}
add_file(file_path, size, private_glyphs);
var->gui.dpi_changed = true;
return nullptr;
}
void c_font::add(const std::vector<unsigned char>& font_data, float size)
{
const void* source = font_data.empty() ? nullptr : font_data.data();
data.push_back({ font_data, "", source, size, nullptr, false, false });
}
void c_font::add_file(const std::string& file_path, float size, bool private_glyphs)
{
data.push_back({ {}, file_path, nullptr, size, nullptr, true, private_glyphs });
}
+20
View File
@@ -0,0 +1,20 @@
#pragma once
#include "../headers/includes.h"
#include "../headers/flags.h"
#include <memory>
class c_colors
{
public:
c_col layout{ 25, 25, 28 };
c_col white{ 255, 255, 255 };
c_col black{ 0, 0, 0 };
c_col accent{ 176, 180, 255 };
c_col child{ 28, 28, 33 };
c_col widget{ 33, 33, 40 };
c_col text{ 110, 110, 129 };
c_col cirlce{ 50, 50, 63 };
c_col border{ 35, 35, 44 };
};
inline std::unique_ptr<c_colors> clr = std::make_unique<c_colors>();
+24
View File
@@ -0,0 +1,24 @@
#pragma once
#include <string>
#include "imgui.h"
class c_elements
{
public:
c_vec2 padding{ 10, 10 };
float child_width;
float tab_window_width;
struct
{
c_text name{ "Lumin" };
c_vec2 size{ 570, 354 };
float rounding{ 12 };
} window;
};
inline std::unique_ptr<c_elements> elements = std::make_unique<c_elements>();
+47
View File
@@ -0,0 +1,47 @@
#pragma once
#include <string>
#include <vector>
#include "imgui.h"
#include "../headers/flags.h"
class c_variables
{
public:
struct
{
float dpi = 1.f; // DayZ overlay: 1:1 scale so ESP fonts map to real px
int stored_dpi = 100;
bool dpi_changed = true;
int tab = 1; // DayZ overlay: start on the first feature tab (no login)
int tab_stored = 1;
float tab_alpha = 1.f;
int sub_tab = 1;
int sub_tab_stored = 1;
bool login_loading = false;
float login_loading_timer = 0.f;
float login_loading_alpha = 0.f;
std::string login_loading_description = "Please wait, account verification";
bool license_invalid = false;
float license_invalid_timer = 0.f;
std::string license_error_message = "";
bool compact_layout = false;
bool sidebar_glass = false;
float window_rounding = 12.f;
bool strict_license = true;
bool verification_animation = true;
char profile_name[64] = "Active user";
char feature_search[96] = "";
} gui;
gui_style style;
};
inline std::unique_ptr<c_variables> var = std::make_unique<c_variables>();
File diff suppressed because it is too large Load Diff
+164
View File
@@ -0,0 +1,164 @@
#include "../headers/functions.h"
#include "../headers/widgets.h"
static constexpr float notify_visual_scale = 0.81f;
static float notify_s(float value)
{
return s_(value * notify_visual_scale);
}
static c_vec2 notify_s(float x, float y)
{
return s_(x * notify_visual_scale, y * notify_visual_scale);
}
static c_vec4 notify_color(notify_type type)
{
if (type == error)
return c_col(245, 70, 86).Value;
return type == warning ? clr->text.Value : clr->accent.Value;
}
static const char* notify_badge_text(notify_type type)
{
if (type == warning)
return "DISABLED";
if (type == error)
return "ERROR";
return "ENABLED";
}
static void draw_notify_check_icon(ImDrawList* draw_list, const c_vec2& center, ImU32 color)
{
if ((color & IM_COL32_A_MASK) == 0)
return;
const c_vec2 points[] =
{
center + notify_s(-6.2f, -0.4f),
center + notify_s(-4.7f, -1.9f),
center + notify_s(-1.7f, 1.0f),
center + notify_s(5.5f, -6.3f),
center + notify_s(7.0f, -4.8f),
center + notify_s(-1.5f, 4.1f),
};
draw_list->AddConcavePolyFilled(points, IM_ARRAYSIZE(points), color);
}
static void draw_notify_minus_icon(ImDrawList* draw_list, const c_vec2& center, ImU32 color)
{
const float half_width = ImMax(2.0f, notify_s(5.8f));
const float half_height = ImMax(1.35f, notify_s(1.15f));
draw->rect_filled(draw_list, center - c_vec2(half_width, half_height), center + c_vec2(half_width, half_height), color, half_height);
}
void c_notify::add_notify(std::string title, std::string text, notify_type type)
{
if (!notifications.empty())
{
notify_state& last = notifications.back();
if (last.title == title && last.text == text && last.type == type && last.notify_timer < 0.22f)
return;
}
notifications.push_back({ notify_count++, std::move(title), std::move(text), type });
}
void c_notify::setup_notify()
{
float accumulated_height = notify_padding.y;
for (int i = 0; i < static_cast<int>(notifications.size()); )
{
notify_state& notification = notifications[i];
if (notification.active_notify)
notification.notify_timer += ImGui::GetIO().DeltaTime;
if (notification.notify_timer >= notify_time)
notification.active_notify = false;
gui->easing(notification.notify_alpha, notification.active_notify ? 1.f : 0.f, 14.f, dynamic_easing);
gui->easing(notification.notify_slide, notification.active_notify ? 0.f : 28.f, 18.f, dynamic_easing);
gui->easing(notification.notify_pos, accumulated_height, 14.f, dynamic_easing);
if (!notification.active_notify && notification.notify_alpha <= 0.015f)
{
notifications.erase(notifications.begin() + i);
continue;
}
if (notification.notify_alpha > 0.01f)
{
ImVec2 window_size = render_notify(notification.notify_alpha, notification.notify_timer / notify_time,
notification.notify_pos, notification.notify_slide, notification.title, notification.text, notification.type);
accumulated_height += window_size.y + notify_spacing;
}
i++;
}
}
ImVec2 c_notify::render_notify(float notify_alpha, float notify_percentage, float notify_pos, float notify_slide, const std::string& title, const std::string& text, notify_type type)
{
ImGuiIO& io = ImGui::GetIO();
ImDrawList* draw_list = gui->foreground_drawlist();
const c_vec4 status_color = notify_color(type);
const c_vec4 accent = clr->accent.Value;
const bool disabled = type == warning;
const c_vec2 size = notify_s(288, 76);
const c_vec2 pos = c_vec2(io.DisplaySize.x - notify_padding.x - size.x + notify_s(notify_slide), notify_pos);
const c_rect rect(pos, pos + size);
const float alpha = notify_alpha;
const float rounding = notify_s(12);
const float progress = ImSaturate(1.f - notify_percentage);
draw->shadow_rect(draw_list, rect.Min, rect.Max, draw->get_clr(clr->black, 0.30f * alpha), notify_s(20), notify_s(0, 8), 0, rounding);
draw->rect_filled(draw_list, rect.Min, rect.Max, draw->get_clr(clr->child, 0.98f * alpha), rounding);
draw->rect_filled_multi_color(draw_list, rect.Min, rect.Max,
draw->get_clr(clr->white, 0.040f * alpha), draw->get_clr(accent, 0.030f * alpha),
draw->get_clr(clr->black, 0.035f * alpha), draw->get_clr(clr->black, 0.035f * alpha), rounding);
draw->rect(draw_list, rect.Min, rect.Max, draw->get_clr(clr->border, 0.96f * alpha), rounding, 0, notify_s(1));
const c_rect badge(rect.Min + notify_s(13, 15), rect.Min + notify_s(49, 51));
draw->shadow_rect(draw_list, badge.Min + notify_s(1, 2), badge.Max - notify_s(1, 0), draw->get_clr(status_color, disabled ? 0.08f * alpha : 0.16f * alpha), notify_s(12), c_vec2(0, 0), 0, notify_s(9));
draw->rect_filled(draw_list, badge.Min, badge.Max, draw->get_clr(clr->widget, 0.94f * alpha), notify_s(9));
draw->rect_filled_multi_color(draw_list, badge.Min, badge.Max,
draw->get_clr(clr->white, 0.060f * alpha), draw->get_clr(status_color, disabled ? 0.020f * alpha : 0.070f * alpha),
draw->get_clr(clr->black, 0.025f * alpha), draw->get_clr(clr->black, 0.025f * alpha), notify_s(9));
draw->rect(draw_list, badge.Min, badge.Max, draw->get_clr(status_color, disabled ? 0.30f * alpha : 0.44f * alpha), notify_s(9), 0, notify_s(1));
const c_vec2 mark_center = badge.GetCenter() + notify_s(0, -0.5f);
if (disabled)
{
draw_notify_minus_icon(draw_list, mark_center, draw->get_clr(status_color, 0.95f * alpha));
}
else
{
draw_notify_check_icon(draw_list, mark_center, draw->get_clr(status_color, alpha));
}
const c_rect pill(rect.Max - notify_s(84, 60), rect.Max - notify_s(13, 42));
draw->rect_filled(draw_list, pill.Min, pill.Max, draw->get_clr(status_color, disabled ? 0.075f * alpha : 0.12f * alpha), notify_s(999));
draw->rect(draw_list, pill.Min, pill.Max, draw->get_clr(status_color, disabled ? 0.22f * alpha : 0.36f * alpha), notify_s(999), 0, notify_s(1));
draw->text_clipped(draw_list, font->get(inter_semibold, 8.f * notify_visual_scale), pill.Min, pill.Max, draw->get_clr(status_color, alpha),
notify_badge_text(type), 0, 0, { 0.5f, 0.5f });
draw->text_clipped(draw_list, font->get(inter_semibold, 12.f * notify_visual_scale), rect.Min + notify_s(60, 14), rect.Max - notify_s(91, 0),
draw->get_clr(clr->white, alpha), title.data(), 0, 0, { 0, 0 });
draw->text_clipped(draw_list, font->get(inter_medium, 10.f * notify_visual_scale), rect.Min + notify_s(60, 33), rect.Max - notify_s(15, 0),
draw->get_clr(clr->text, 0.96f * alpha), text.data(), 0, 0, { 0, 0 });
draw->line(draw_list, rect.Min + notify_s(60, 54), rect.Max - notify_s(15, 22), draw->get_clr(clr->border, 0.55f * alpha));
const c_rect track(rect.Min + notify_s(13, 64), rect.Max - notify_s(13, 8));
draw->rect_filled(draw_list, track.Min, track.Max, draw->get_clr(clr->widget, 0.78f * alpha), notify_s(999));
draw->rect_filled(draw_list, track.Min, c_vec2(track.Min.x + track.GetWidth() * progress, track.Max.y),
draw->get_clr(status_color, disabled ? 0.40f * alpha : 0.88f * alpha), notify_s(999));
return size;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff