Page 1 of 1

Hints for OptionMenu

PostPosted: Sat May 11, 2019 12:04 am
by m8f
Hint is a static text that is visible only if the items above are selected.
The number of items above is configurable, and by default is 1.

I thought this kind of thing can be useful both in engine menus and in mod menus (I will definitely use it).
It helps to provide additional information for option menu entries without cluttering the interface.

PR

Hints demo

Re: Hints for OptionMenu

PostPosted: Sat May 11, 2019 1:38 am
by Nash
Care to post a video or animated GIF of how this looks like?

Re: Hints for OptionMenu

PostPosted: Sat May 11, 2019 10:25 am
by m8f


Found out that hints need a bit more work to reliably behave in some corner cases. Fixes are coming soon.

Edit: pushed the fixes.

Re: Hints for OptionMenu

PostPosted: Sat May 11, 2019 10:58 am
by Nash
So every line where a Hint widget is added, it adds a new blank line to make room for it? Hmm... not sure how I feel with all those gaps between each line of option... but I also don't have any better ideas currently. Maybe someone else can chime in.

Re: Hints for OptionMenu

PostPosted: Sat May 11, 2019 11:01 am
by m8f
Yes, Hint takes a line of the menu.

Re: Hints for OptionMenu

PostPosted: Sat May 11, 2019 2:20 pm
by Enjay
While I do think it's a neat idea, is it not just something that can be adopted as a mod-specific feature?

If this is adopted as an engine feature complete with hints in gzdoom.pk3, then I assume that the hints will need to be defined in the languages lump and, consequently, it also has implications for those making localisation translations.

I also have concerns about how neat it looks (the taking up of a line) but I don't really have an alternative suggestion.

Re: Hints for OptionMenu

PostPosted: Sat May 11, 2019 2:46 pm
by Gez
While I like the idea, I don't like this implementation. The hints should all show on a static position of the screen (typically at the bottom) instead of being inserted into the menu list. If you've gotta have separate labels taking up space in the list, then you could as well just make them visible all the time...

Re: Hints for OptionMenu

PostPosted: Sat May 11, 2019 7:33 pm
by m8f
Enjay wrote:is it not just something that can be adopted as a mod-specific feature?
Of course it can. It's in the development version of one of my mods already, and will gradually creep into others.

Enjay wrote:If this is adopted as an engine feature complete with hints in gzdoom.pk3, then I assume that the hints will need to be defined in the languages lump and, consequently, it also has implications for those making localisation translations.
If this class is added to the engine, it doesn't make us to add a description to every single option. It just allows to add such a description, if the developers desire.
Also, the existence of localisation translations shouldn't stop the addition of new strings to the engine in general.

Gez wrote:While I like the idea, I don't like this implementation. The hints should all show on a static position of the screen (typically at the bottom) instead of being inserted into the menu list.
This method of putting description has an issue if it's used with the current option menu implementation:
Image
As you can see, if the screen resolution is low or the menu is long enough, the items and the description overlap (the screenshot is from Nash's Gore Mod: Vengeance Edition v0.9 beta).
Another viable option is to put the description to the top (as was suggested in viewtopic.php?f=46&t=62641&start=90#p1083436). It doesn't have the overlap issue. Still a custom option menu is needed, and a class for each hinted selectable item.
By the way, The Hint item in the PR works for any selectable item out of the box, and can be used as a drop-in replacement of StaticText.

Gez wrote:If you've gotta have separate labels taking up space in the list, then you could as well just make them visible all the time...
Yes, this is a valid option, but the difference is the visual clutter. Compare:
ImageImage
Using the different color for descriptions helps, but not much:
Image

Re: Hints for OptionMenu

PostPosted: Sat May 11, 2019 8:00 pm
by Nash


Putting it at the top isn't a bad choice, IMO.

Re: Hints for OptionMenu

PostPosted: Sun May 12, 2019 2:19 am
by Graf Zahl
I have to agree with Nash here. As implemented the feature is not acceptable. This isn't how hints should be handled. It cannot just be done by adding new menu entries, you'll really have to make some alteration to the menu itself and look out for how it affects customized subclasses (e.g. the flag display for the gameplay and compatibility menus.)

Re: Hints for OptionMenu

PostPosted: Sun May 12, 2019 2:29 am
by m8f
Noted. Please move this to Closed Feature Suggestions.

Re: Hints for OptionMenu

PostPosted: Sun May 12, 2019 5:27 am
by Gez
m8f wrote:As you can see, if the screen resolution is low or the menu is long enough, the items and the description overlap (the screenshot is from Nash's Gore Mod: Vengeance Edition v0.9 beta).

The overlap can be addressed in multiple ways, from preventing the list to be drawn in the hint area to drawing a background box above the list and below the hint label.

Re: Hints for OptionMenu

PostPosted: Sun May 12, 2019 5:36 am
by Enjay
m8f wrote:Also, the existence of localisation translations shouldn't stop the addition of new strings to the engine in general.

Of course not.

I was merely pointing out that any standardised strings should be added to the language lump. Also, that a bunch of new strings for items already in the menus would create a sudden increased shortfall of translated strings for the currently supported languages. Obviously someone would have to work on those to keep language support up to date. That doesn't mean that strings should not be added. It was just an acknowledgement that adding them (particularly a lot of them) means additional work for other parties too.

Re: Hints for OptionMenu

PostPosted: Wed May 15, 2019 5:08 am
by Kinsie
Gez wrote:
m8f wrote:As you can see, if the screen resolution is low or the menu is long enough, the items and the description overlap (the screenshot is from Nash's Gore Mod: Vengeance Edition v0.9 beta).

The overlap can be addressed in multiple ways, from preventing the list to be drawn in the hint area to drawing a background box above the list and below the hint label.
The latter is what I did to my alteration of Nash's tooltip code.

Image

Re: Hints for OptionMenu

PostPosted: Wed May 15, 2019 6:22 am
by Nash
That could work, since by default, there is space for 1 more line anyway, even for long/scrolling menus (judging from the stock Gameplay Options layout at least)