mirror of https://github.com/ZDoom/gzdoom-gles.git
- fixed the item check in OptionMenuItemCommand.
This was calling the wrong GetItem function.
This commit is contained in:
parent
443ac50887
commit
7b1645d239
|
@ -448,6 +448,12 @@ DEFINE_ACTION_FUNCTION(DMenu, GetItem)
|
||||||
ACTION_RETURN_OBJECT(self->GetItem(name));
|
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()
|
bool DMenu::DimAllowed()
|
||||||
|
|
|
@ -57,7 +57,7 @@ class OptionMenuDescriptor : MenuDescriptor native
|
||||||
native bool mDontDim;
|
native bool mDontDim;
|
||||||
|
|
||||||
native void CalcIndent();
|
native void CalcIndent();
|
||||||
//native OptionMenuItem GetItem(Name iname);
|
native OptionMenuItem GetItem(Name iname);
|
||||||
void Reset()
|
void Reset()
|
||||||
{
|
{
|
||||||
// Reset the default settings (ignore all other values in the struct)
|
// Reset the default settings (ignore all other values in the struct)
|
||||||
|
|
|
@ -132,11 +132,11 @@ class OptionMenuItemCommand : OptionMenuItemSubmenu
|
||||||
override bool Activate()
|
override bool Activate()
|
||||||
{
|
{
|
||||||
// This needs to perform a few checks to prevent abuse by malicious modders.
|
// 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
|
// don't execute if no menu is active
|
||||||
if (m == null) return false;
|
if (m == null) return false;
|
||||||
// don't execute if this item cannot be found in the current menu.
|
// 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");
|
Menu.MenuSound("menu/choose");
|
||||||
DoCommand(mAction);
|
DoCommand(mAction);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue