Sliders don't jump anymore

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

Moderators: Forum Moderators, Developers

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

Sliders don't jump anymore

Post by Yomar » August 31st, 2018, 9:21 am

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?

User avatar
shadowm
Site Administrator
Posts: 6497
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Sliders don't jump anymore

Post by shadowm » September 1st, 2018, 6:45 pm

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.
Elsewhere: shadowmBlogFollow me on Twitter

gfgtdf
Developer
Posts: 1110
Joined: February 10th, 2013, 2:25 pm

Re: Sliders don't jump anymore

Post by gfgtdf » September 1st, 2018, 7:06 pm

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.

Yomar
Posts: 253
Joined: October 27th, 2011, 5:14 am
Contact:

Re: Sliders don't jump anymore

Post by Yomar » September 4th, 2018, 11:58 pm

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.

josteph
Developer
Posts: 145
Joined: August 19th, 2017, 6:58 pm

Re: Sliders don't jump anymore

Post by josteph » September 7th, 2018, 12:39 am

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?

Yomar
Posts: 253
Joined: October 27th, 2011, 5:14 am
Contact:

Re: Sliders don't jump anymore

Post by Yomar » September 8th, 2018, 6:15 pm

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.

Post Reply