mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-01-31 05:40:44 +00:00
- fixed stuck memory usage warning in options menu
https://forum.zdoom.org/viewtopic.php?t=62186
This commit is contained in:
parent
5e04678965
commit
9cffc29134
1 changed files with 18 additions and 2 deletions
|
@ -540,14 +540,19 @@ class CompatibilityMenu : OptionMenu
|
||||||
class GLTextureGLOptions : OptionMenu
|
class GLTextureGLOptions : OptionMenu
|
||||||
{
|
{
|
||||||
private int mWarningIndex;
|
private int mWarningIndex;
|
||||||
|
private string mWarningLabel;
|
||||||
|
|
||||||
override void Init(Menu parent, OptionMenuDescriptor desc)
|
override void Init(Menu parent, OptionMenuDescriptor desc)
|
||||||
{
|
{
|
||||||
super.Init(parent, desc);
|
super.Init(parent, desc);
|
||||||
|
|
||||||
|
// Find index of warning item placeholder
|
||||||
|
mWarningIndex = -1;
|
||||||
|
mWarningLabel = "!HQRESIZE_WARNING!";
|
||||||
|
|
||||||
for (int i=0; i < mDesc.mItems.Size(); ++i)
|
for (int i=0; i < mDesc.mItems.Size(); ++i)
|
||||||
{
|
{
|
||||||
if (mDesc.mItems[i].mLabel == "!HQRESIZE_WARNING!")
|
if (mDesc.mItems[i].mLabel == mWarningLabel)
|
||||||
{
|
{
|
||||||
mWarningIndex = i;
|
mWarningIndex = i;
|
||||||
break;
|
break;
|
||||||
|
@ -555,11 +560,22 @@ class GLTextureGLOptions : OptionMenu
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override void OnDestroy()
|
||||||
|
{
|
||||||
|
// Restore warning item placeholder
|
||||||
|
if (mWarningIndex >= 0)
|
||||||
|
{
|
||||||
|
mDesc.mItems[mWarningIndex].mLabel = mWarningLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
Super.OnDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
override void Ticker()
|
override void Ticker()
|
||||||
{
|
{
|
||||||
Super.Ticker();
|
Super.Ticker();
|
||||||
|
|
||||||
if (mWarningIndex > 0)
|
if (mWarningIndex >= 0)
|
||||||
{
|
{
|
||||||
string message;
|
string message;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue