From 9cffc291349a927f4d54ecf6aaaac7937d6f499b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 5 Oct 2018 15:22:21 +0300 Subject: [PATCH] - fixed stuck memory usage warning in options menu https://forum.zdoom.org/viewtopic.php?t=62186 --- wadsrc/static/zscript/menu/optionmenu.txt | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/wadsrc/static/zscript/menu/optionmenu.txt b/wadsrc/static/zscript/menu/optionmenu.txt index 3e1853735..f73035ab0 100644 --- a/wadsrc/static/zscript/menu/optionmenu.txt +++ b/wadsrc/static/zscript/menu/optionmenu.txt @@ -540,14 +540,19 @@ class CompatibilityMenu : OptionMenu class GLTextureGLOptions : OptionMenu { private int mWarningIndex; + private string mWarningLabel; override void Init(Menu parent, OptionMenuDescriptor 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) { - if (mDesc.mItems[i].mLabel == "!HQRESIZE_WARNING!") + if (mDesc.mItems[i].mLabel == mWarningLabel) { mWarningIndex = i; 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() { Super.Ticker(); - if (mWarningIndex > 0) + if (mWarningIndex >= 0) { string message;