[Fixed] ListMenu defaults to "OptClean" even with incompatible items

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

ListMenu defaults to "OptClean" even with incompatible items

Postby Player701 » Tue Oct 27, 2020 4:18 am

It appears that this commit has introduced a bug: DListMenuDescriptor's mVirtWidth is set to -2 by default (which means "Size OptClean"), while it should probably be -1 ("Size Clean"). Otherwise, it doesn't make sense to set it to -2 (OptClean) after checking that the menu doesn't have a custom size or incompatible items, because if these checks fail, it will remain at -2 by default (unless set explicitly during parsing). Which means that a list menu with incompatible items and no explicit size will still be "OptClean".

Solution: either set mVirtWith to -1 initially, or leave at -2 but invert the check (change to "!sizeset && !sizecompatible") and set to -1 if it passes. Preferably the latter, since I'm currently working on a PR that will allow extension of list menus, and the second scheme will play better with it.
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
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: ListMenu defaults to "OptClean" even with incompatible i

Postby Player701 » Wed Oct 28, 2020 10:41 am

Since my AddListMenu PR is now ready, I've decided to include a fix for this issue in it and submit the changes for review. See here for details. Unless I haven't fully understood the original intent, everything should work properly now. If the PR is rejected, this bug can still be fixed separately.
User avatar
Player701
 
 
 
Joined: 13 May 2009
Location: Russia
Discord: Player701#8214
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: ListMenu defaults to "OptClean" even with incompatible i

Postby Graf Zahl » Wed Oct 28, 2020 2:47 pm

Since I merged your PR this should be fixed.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: ListMenu defaults to "OptClean" even with incompatible i

Postby Nash » Wed Oct 28, 2020 3:01 pm

AddListMenu? Whoa nice! Thanks Player701. :D
User avatar
Nash
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Github ID: nashmuhandes


Return to Closed Bugs

Who is online

Users browsing this forum: No registered users and 3 guests