From 44e1bce7b6e72f8f308449b88a93f3a5f5a2c77e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Tue, 28 Nov 2023 14:35:28 +0100 Subject: [PATCH] return if gui_slider was changed --- engine/joint/v4k.h | 4 ++-- engine/split/v4k_gui.c | 4 ++-- engine/v4k.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/engine/joint/v4k.h b/engine/joint/v4k.h index 5ca9f9d..0db13d5 100644 --- a/engine/joint/v4k.h +++ b/engine/joint/v4k.h @@ -359060,7 +359060,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl entry->hover = false; } - + float old_value = *value; if (last_skin->drawrect) last_skin->drawrect(last_skin->userdata, skin, rect); vec2 slidersize={0}, cursorsize={0}; @@ -359080,7 +359080,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl cursorrect.w = cursorsize.y; if (last_skin->drawrect) last_skin->drawrect(last_skin->userdata, cursorskin, cursorrect); - return false; + return (old_value!=*value); } void gui_rect_id(int id, vec4 r, const char *skin) { diff --git a/engine/split/v4k_gui.c b/engine/split/v4k_gui.c index 1fbf33f..508fe43 100644 --- a/engine/split/v4k_gui.c +++ b/engine/split/v4k_gui.c @@ -215,7 +215,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl entry->hover = false; } - + float old_value = *value; if (last_skin->drawrect) last_skin->drawrect(last_skin->userdata, skin, rect); vec2 slidersize={0}, cursorsize={0}; @@ -235,7 +235,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl cursorrect.w = cursorsize.y; if (last_skin->drawrect) last_skin->drawrect(last_skin->userdata, cursorskin, cursorrect); - return false; + return (old_value!=*value); } void gui_rect_id(int id, vec4 r, const char *skin) { diff --git a/engine/v4k.c b/engine/v4k.c index 9d0ebc9..d6cc169 100644 --- a/engine/v4k.c +++ b/engine/v4k.c @@ -11225,7 +11225,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl entry->hover = false; } - + float old_value = *value; if (last_skin->drawrect) last_skin->drawrect(last_skin->userdata, skin, rect); vec2 slidersize={0}, cursorsize={0}; @@ -11245,7 +11245,7 @@ bool gui_slider_id(int id, vec4 rect, const char *skin, float min, float max, fl cursorrect.w = cursorsize.y; if (last_skin->drawrect) last_skin->drawrect(last_skin->userdata, cursorskin, cursorrect); - return false; + return (old_value!=*value); } void gui_rect_id(int id, vec4 r, const char *skin) {