[Added] Gray-able sliders

Moderator: GZDoom Developers

Gray-able sliders

Postby Nash » Wed Sep 30, 2020 8:27 am

Image

This simply lets a slider be "gray-able" depending on another CVar's value. The engine already supports this for most other widgets, I am simply exposing the existing behavior to sliders.

Usage is very simple. In your MENUDEF:

Code: Select allExpand view
// test_int is the value you want to check for. If this value is 0, the corresponding slider will be grayed out.
// test_float is the slider.
    Option "Test Option", "test_int", "OnOff"
    Slider "Test Slider", "test_float", 0.0, 1.0, 0.1, 1, "test_int"


Pull request
Demo file
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Gray-able sliders

Postby Rachael » Wed Sep 30, 2020 8:36 am

Potentially a very useful option, in my opinion.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Location: This post
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Gray-able sliders

Postby sinisterseed » Wed Sep 30, 2020 9:49 am

I agree, would like to see this too, keeps things consistent for settings that require another to be enabled first.

For on/off toggles this is already there, but sliders are missing.
User avatar
sinisterseed
GZDoom RO Translator & Raze Tester
 
Joined: 05 Nov 2019
Twitch ID: sixhundredsixteen
Github ID: sinisterseed
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Gray-able sliders

Postby Graf Zahl » Wed Sep 30, 2020 10:28 am

Very much appreciated. :)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Gray-able sliders

Postby Blue Shadow » Wed Sep 30, 2020 3:32 pm

Is this also implemented for the ScaleSlider?
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Gray-able sliders

Postby Nash » Wed Sep 30, 2020 5:20 pm

Blue Shadow wrote:Is this also implemented for the ScaleSlider?


No, I deliberately left that out because ScaleSlider's use case is very specific to that only one thing in GZDoom (the HUD scaling menu). Should I the gray-check to that too? What's the likeliness of modders using that widget?
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes

Re: Gray-able sliders

Postby Blue Shadow » Wed Sep 30, 2020 6:19 pm

I did some coding for someone last year, and that slider type came in handy. Apart from that, I don't know how widely it's used.

My question there was just an inquiry. I wasn't particularly asking for the feature to be added.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Gray-able sliders

Postby Graf Zahl » Wed Sep 30, 2020 11:15 pm

Nash wrote:
Blue Shadow wrote:Is this also implemented for the ScaleSlider?


No, I deliberately left that out because ScaleSlider's use case is very specific to that only one thing in GZDoom (the HUD scaling menu). Should I the gray-check to that too? What's the likeliness of modders using that widget?


TBH, if I could implement it without compatibility issues, I'd redo the UI scaling anyway to get rid of the clean scaling, use 1 for displaying at the requested size for the page at hand and use smaller values for downscaling. The current system is awful and only grew out a ZDoom-based design decision from 20+ years ago we did not want to change.

In Raze I completely steered clear of the clean scaling outside the places where the VGA font is used and I think it handles a thousand times better as a result.

Meaning: That slider type is more likely to be deprecated anyway. No need to add support to it.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Gray-able sliders

Postby Nash » Thu Oct 01, 2020 12:43 am

Yeah, that's what I thought. That's also the other reason I deliberately left ScaleSlider alone; I remember reading a post from you in another thread recently where you said you planned to redo the entire UI scaling stuff.
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes


Return to Closed Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests