Gray-able sliders

Moderator: GZDoom Developers

User avatar
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Gray-able sliders

Post by Nash »

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 all

// 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
Rachael
Posts: 13717
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Gray-able sliders

Post by Rachael »

Potentially a very useful option, in my opinion.
User avatar
sinisterseed
Posts: 1349
Joined: Tue Nov 05, 2019 6:48 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia with Vulkan support

Re: Gray-able sliders

Post by sinisterseed »

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Gray-able sliders

Post by Graf Zahl »

Very much appreciated. :)
Blue Shadow
Posts: 5016
Joined: Sun Nov 14, 2010 12:59 am

Re: Gray-able sliders

Post by Blue Shadow »

Is this also implemented for the ScaleSlider?
User avatar
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Gray-able sliders

Post by Nash »

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?
Blue Shadow
Posts: 5016
Joined: Sun Nov 14, 2010 12:59 am

Re: Gray-able sliders

Post by Blue Shadow »

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
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49130
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Gray-able sliders

Post by Graf Zahl »

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
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: Gray-able sliders

Post by Nash »

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.

Return to “Closed Feature Suggestions [GZDoom]”