mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- fixed the item check in OptionMenuItemCommand.
This was calling the wrong GetItem function.
This commit is contained in:
parent
443ac50887
commit
7b1645d239
3 changed files with 9 additions and 3 deletions
|
@ -448,6 +448,12 @@ DEFINE_ACTION_FUNCTION(DMenu, GetItem)
|
|||
ACTION_RETURN_OBJECT(self->GetItem(name));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DOptionMenuDescriptor, GetItem)
|
||||
{
|
||||
PARAM_SELF_PROLOGUE(DOptionMenuDescriptor);
|
||||
PARAM_NAME(name);
|
||||
ACTION_RETURN_OBJECT(self->GetItem(name));
|
||||
}
|
||||
|
||||
|
||||
bool DMenu::DimAllowed()
|
||||
|
|
|
@ -57,7 +57,7 @@ class OptionMenuDescriptor : MenuDescriptor native
|
|||
native bool mDontDim;
|
||||
|
||||
native void CalcIndent();
|
||||
//native OptionMenuItem GetItem(Name iname);
|
||||
native OptionMenuItem GetItem(Name iname);
|
||||
void Reset()
|
||||
{
|
||||
// Reset the default settings (ignore all other values in the struct)
|
||||
|
|
|
@ -132,11 +132,11 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu
|
|||
override bool Activate()
|
||||
{
|
||||
// This needs to perform a few checks to prevent abuse by malicious modders.
|
||||
let m = Menu.GetCurrentMenu();
|
||||
let m = OptionMenu(Menu.GetCurrentMenu());
|
||||
// don't execute if no menu is active
|
||||
if (m == null) return false;
|
||||
// don't execute if this item cannot be found in the current menu.
|
||||
if (m.GetItem(mAction) != self) return false;
|
||||
if (m.mDesc.GetItem(mAction) != self) return false;
|
||||
Menu.MenuSound("menu/choose");
|
||||
DoCommand(mAction);
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue