Sliders don't jump anymore

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
User avatar
Yomar
Posts: 394
Joined: October 27th, 2011, 5:14 am
Contact:

Sliders don't jump anymore

Post by Yomar »

This is not really an issue, but something that is bothering me, why the ability to click on the sliders (like the one to increase the time limit for examle) was removed from V 1.14 of BFW ?
Now you are forced to move the pointer exactly on that tiny rettangle, keep pressed the mouse button, and slide it, before you could just press on any point on the slider to make it jump there.
This makes tbe whole process of setting up a game more tedious, can the slider mechanics be restored like they were in V 1.12 of the game?
Beholded Wesnoth's Origins.
Max G on WIF
Rank 🌟🌟🌟🌟🌟
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Sliders don't jump anymore

Post by Iris »

Since you are asking “why”, this was definitely an accident rather than deliberate. For versions 1.6 through 1.14 there are basically two different UI frameworks. The lobby and game setup UI in older versions used the older one (GUI1), while Wesnoth 1.14.x uses the new one (GUI2). It’s 99% likely that this behaviour was just never implemented in it because of an oversight.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
gfgtdf
Developer
Posts: 1432
Joined: February 10th, 2013, 2:25 pm

Re: Sliders don't jump anymore

Post by gfgtdf »

I think the current gui2 slider behviour is mostly internal and also matches from what i observe in sliders in other applications: when you click on the slider area on the right from the grip the grip will jump a fixed amount to the right and when you click to the left side it will jump a fixed amount to the left, and not to exactly the position to where the mouse is. In the wesnoth this 'fixed amount' is currently just 1, which is not ideal for all cases though.
Scenario with Robots SP scenario (1.11/1.12), allows you to build your units with components, PYR No preperation turn 1.12 mp-mod that allows you to select your units immideately after the game begins.
User avatar
Yomar
Posts: 394
Joined: October 27th, 2011, 5:14 am
Contact:

Re: Sliders don't jump anymore

Post by Yomar »

Yes, it actually jymps by one, but I don't consider that even "jumping" but just moving a step forward, and its pratically almost useless.
But, thx for the clarifications.
Beholded Wesnoth's Origins.
Max G on WIF
Rank 🌟🌟🌟🌟🌟
User avatar
josteph
Inactive Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: Sliders don't jump anymore

Post by josteph »

This should be easy to fix.

The time slider is created here:

Code: Select all

data/gui/window/mp_create_game.cfg:455:                         {_GUI_MP_CREATE_OPTION_SLIDER ( _ "Reservoir")      "reservoir"       30 1500 ( _ "Longest time possible for any turn (seconds)") ()}
The macro _GUI_MP_CREATE_OPTION_SLIDER is defined in data/gui/window/mp_create_game.cfg and the definition contains:

Code: Select all

			[slider]
				id = {_SLIDER_ID}
				definition = "minimal"

				minimum_value = {_SLIDER_MIN}
				maximum_value = {_SLIDER_MAX}
				step_size = 1
				tooltip = {_TOOLTIP}

				{_EXTRA_WML}
			[/slider]
So this patch will fix it:

Code: Select all

diff --git a/data/gui/window/mp_create_game.cfg b/data/gui/window/mp_create_game.cfg
index c2363a54e8..092c60475f 100644
--- a/data/gui/window/mp_create_game.cfg
+++ b/data/gui/window/mp_create_game.cfg
@@ -448,11 +448,11 @@
 
 			[grid]
 
-				{_GUI_MP_CREATE_OPTION_SLIDER ( _ "Initial Limit")  "init_turn_limit" 30 1500 ( _ "Longest time allowed for first turn (seconds)") ()}
+				{_GUI_MP_CREATE_OPTION_SLIDER ( _ "Initial Limit")  "init_turn_limit" 30 1500 ( _ "Longest time allowed for first turn (seconds)") (step_size=15)}
 
-				{_GUI_MP_CREATE_OPTION_SLIDER ( _ "Turn Bonus")     "turn_bonus"      10 300  ( _ "Time for general tasks each turn (seconds)") ()}
+				{_GUI_MP_CREATE_OPTION_SLIDER ( _ "Turn Bonus")     "turn_bonus"      10 300  ( _ "Time for general tasks each turn (seconds)") (step_size=30)}
 
-				{_GUI_MP_CREATE_OPTION_SLIDER ( _ "Reservoir")      "reservoir"       30 1500 ( _ "Longest time possible for any turn (seconds)") ()}
+				{_GUI_MP_CREATE_OPTION_SLIDER ( _ "Reservoir")      "reservoir"       30 1500 ( _ "Longest time possible for any turn (seconds)") (step_size=15)}
 
 				{_GUI_MP_CREATE_OPTION_SLIDER ( _ "Action Bonus")   "action_bonus"    0  30   ( _ "Time for each attack, recruit, and capture") ()}
 
I set the step size to 15s which are 1% of the range - that's a nice round figure. I would PR this but maybe there's a way to use WFL or formulas or something to set step_size to min(1, (_SLIDER_MAX-_SLIDER_MIN)/100) for all [slider]s in the GUI, not just these three?
User avatar
Yomar
Posts: 394
Joined: October 27th, 2011, 5:14 am
Contact:

Re: Sliders don't jump anymore

Post by Yomar »

I think that the different gui also explains why Ican not select my faction and leader on the menu screen with right clicks, but only with left clicks.
Beholded Wesnoth's Origins.
Max G on WIF
Rank 🌟🌟🌟🌟🌟
Post Reply