From 2eda18951fde7ebd803aeb48595f203c0bb2f82a Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 28 Oct 2026 12:42:46 +0100 Subject: Item ESP: make 0 = unlimited explicit and persistent - config_load now accepts max_dist=0 instead of clamping it to 250, so the "unlimited" setting survives a restart. - The Max distance slider shows "All" at 0 and its tooltip documents 0 = unlimited; the categories log prints max=All. - Skip unclassified entities before projecting them / computing distance. - Keep the removed prop/crate debug logging and the user's rule that the distance slider applies to every tag. --- src/gui.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/gui.cpp') diff --git a/src/gui.cpp b/src/gui.cpp index e826ba9..b512ef3 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -193,6 +193,7 @@ struct Ctrl { int *ival; // CK_SLIDER int min, max; int action; // CK_BUTTON + bool zero_unlimited; // slider: value 0 displays as "All" }; struct Card { @@ -243,6 +244,7 @@ static void add_ctrl(int card, int kind, const char *label, const char *desc, c.min = min; c.max = max; c.action = action; + c.zero_unlimited = false; g_cards[card].n++; } static void add_toggle(int card, const char *label, const char *desc, @@ -364,8 +366,9 @@ static void build_cards() { add_toggle(items, "Show distance", "Append the distance in units.", &g_item_distance); add_slider(items, "Max distance", - "Items farther away than this are not tagged.", 250, 10000, - &g_item_max_dist); + "0 = unlimited; otherwise items farther away are hidden.", 0, + 10000, &g_item_max_dist); + g_ctrls[g_nctrl - 1].zero_unlimited = true; int spread = add_card(3, &g_spread, "Spread control", "Choose a server shot seed that tightens the cone.", @@ -1290,7 +1293,10 @@ static void draw_slider(const Rect &clip, const Rect &cr, int y, int rh, int kx = track.x + fw - S(4.0f); fill(Rect{kx, track.y - S(4.0f), S(8.0f), S(16.0f)}, C_ACCENT, &clip); char val[32]; - snprintf(val, sizeof(val), "%d", value); + if (ct.zero_unlimited && value == 0) + snprintf(val, sizeof(val), "All"); + else + snprintf(val, sizeof(val), "%d", value); text_in(clip, cr.x + cr.w - S(52.0f), y + (rh - g_body_h) / 2, val, g_font_body, g_body_h, 0, C_TEXT); } -- cgit v1.2.3