- added an option to add elements to an existing options menu.

Note that for list menus this does not exist because they require complete setup to work as intended.
This commit is contained in:
Christoph Oelckers 2017-02-27 10:37:47 +01:00
parent 720e05d131
commit 0c660ff29c

View file

@ -871,6 +871,25 @@ static void ParseOptionMenu(FScanner &sc)
}
//=============================================================================
//
//
//
//=============================================================================
static void ParseAddOptionMenu(FScanner &sc)
{
sc.MustGetString();
DMenuDescriptor **pOld = MenuDescriptors.CheckKey(sc.String);
if (pOld == nullptr || *pOld == nullptr || !(*pOld)->IsKindOf(RUNTIME_CLASS(DOptionMenuDescriptor)))
{
sc.ScriptError("%s is not an option menu that can be extended", sc.String);
}
ParseOptionMenuBody(sc, (DOptionMenuDescriptor*)(*pOld));
}
//=============================================================================
//
//
@ -935,6 +954,10 @@ void M_ParseMenuDefs()
{
ParseOptionMenu(sc);
}
else if (sc.Compare("ADDOPTIONMENU"))
{
ParseAddOptionMenu(sc);
}
else if (sc.Compare("DEFAULTOPTIONMENU"))
{
ParseOptionMenuBody(sc, DefaultOptionMenuSettings);