From 95661e5090264a5b837f3f5b6df84f8e0e58edbd Mon Sep 17 00:00:00 2001 From: clement Date: Sun, 4 Jan 2026 16:51:47 +0000 Subject: [PATCH] add option to enable/disable ui transitions --- share/config.c | 2 ++ share/config.h | 3 ++- share/gui.c | 6 ++++++ share/st_common.c | 17 +++++++++++++++-- share/transition.c | 2 +- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/share/config.c b/share/config.c index ea6507277..82aa53b64 100644 --- a/share/config.c +++ b/share/config.c @@ -46,6 +46,7 @@ int CONFIG_MOUSE_SENSE; int CONFIG_MOUSE_RESPONSE; int CONFIG_MOUSE_INVERT; int CONFIG_VSYNC; +int CONFIG_TRANSITIONS; int CONFIG_HMD; int CONFIG_HIGHDPI; int CONFIG_MOUSE_CAMERA_1; @@ -158,6 +159,7 @@ static struct { &CONFIG_MOUSE_RESPONSE, "mouse_response", 50 }, { &CONFIG_MOUSE_INVERT, "mouse_invert", 0 }, { &CONFIG_VSYNC, "vsync", 1 }, + { &CONFIG_TRANSITIONS, "uitransitions", 1}, { &CONFIG_HMD, "hmd", 0 }, { &CONFIG_HIGHDPI, "highdpi", 1 }, diff --git a/share/config.h b/share/config.h index 8f2e241a9..f5d9ca23c 100644 --- a/share/config.h +++ b/share/config.h @@ -38,6 +38,7 @@ extern int CONFIG_MOUSE_RESPONSE; extern int CONFIG_MOUSE_INVERT; extern int CONFIG_VSYNC; extern int CONFIG_HMD; +extern int CONFIG_TRANSITIONS; extern int CONFIG_HIGHDPI; extern int CONFIG_MOUSE_CAMERA_1; extern int CONFIG_MOUSE_CAMERA_2; @@ -153,4 +154,4 @@ int config_screenshot(void); /*---------------------------------------------------------------------------*/ -#endif \ No newline at end of file +#endif diff --git a/share/gui.c b/share/gui.c index 8f686e860..cfc261fcd 100644 --- a/share/gui.c +++ b/share/gui.c @@ -1733,6 +1733,12 @@ static void gui_widget_offset(int id, int pd) void gui_set_slide(int id, int flags, float delay, float t, float stagger) { + if(config_get_d(CONFIG_TRANSITIONS) == 0){ + if(t != 0 || delay != 0){ //fix for hack at hud.c:117 + t = 0.0000000001f; + delay = 0.00000001f; + } + } if (id) { int jd, c = 0; diff --git a/share/st_common.c b/share/st_common.c index 246577ece..d8328ed4c 100644 --- a/share/st_common.c +++ b/share/st_common.c @@ -252,7 +252,8 @@ enum VIDEO_SHADOW, VIDEO_VSYNC, VIDEO_HMD, - VIDEO_MULTISAMPLE + VIDEO_MULTISAMPLE, + VIDEO_TRANSITIONS }; static struct state *video_back; @@ -326,6 +327,12 @@ static int video_action(int tok, int val) r = video_mode(f, w, h); goto_state(&st_video); break; + case VIDEO_TRANSITIONS: + goto_state(&st_null); + config_set_d(CONFIG_TRANSITIONS, val); + r = video_mode(f, w, h); + goto_state(&st_video); + break; } return r; @@ -400,7 +407,13 @@ static int video_gui(void) conf_toggle(id, _("Shadow"), VIDEO_SHADOW, config_get_d(CONFIG_SHADOW), _("On"), 1, _("Off"), 0); - gui_layout(id, 0, 0); + gui_space(id); + + conf_toggle(id, _("UI Transitions"), VIDEO_TRANSITIONS, + config_get_d(CONFIG_TRANSITIONS), _("On"), 1, _("Off"), 0); + + gui_layout(id, 0, 0); + } return id; diff --git a/share/transition.c b/share/transition.c index 6857c0a4d..b197cd7a7 100644 --- a/share/transition.c +++ b/share/transition.c @@ -143,4 +143,4 @@ int transition_page(int id, int in, int intent) return id; } -/*---------------------------------------------------------------------------*/ \ No newline at end of file +/*---------------------------------------------------------------------------*/