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;