mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
- allow specifying a custom class for message box display.
This commit is contained in:
parent
ca1981c52f
commit
edebea4f8d
11 changed files with 19 additions and 6 deletions
|
@ -371,6 +371,7 @@ void FMapInfoParser::ParseGameInfo()
|
|||
GAMEINFOKEY_STRING_STAMPED(statusbarclass, "statusbarclass", statusbarclassfile)
|
||||
GAMEINFOKEY_MUSIC(intermissionMusic, intermissionOrder, "intermissionMusic")
|
||||
GAMEINFOKEY_STRING(CursorPic, "CursorPic")
|
||||
GAMEINFOKEY_STRING(MessageBoxClass, "MessageBoxClass")
|
||||
GAMEINFOKEY_BOOL(noloopfinalemusic, "noloopfinalemusic")
|
||||
GAMEINFOKEY_BOOL(drawreadthis, "drawreadthis")
|
||||
GAMEINFOKEY_BOOL(swapmenu, "swapmenu")
|
||||
|
|
1
src/gi.h
1
src/gi.h
|
@ -152,6 +152,7 @@ struct gameinfo_t
|
|||
int statusbarfile = -1;
|
||||
FName statusbarclass;
|
||||
int statusbarclassfile = -1;
|
||||
FName MessageBoxClass;
|
||||
FName backpacktype;
|
||||
FString intermissionMusic;
|
||||
int intermissionOrder;
|
||||
|
|
|
@ -66,14 +66,18 @@ DEFINE_ACTION_FUNCTION(DMessageBoxMenu, CallHandler)
|
|||
|
||||
DMenu *CreateMessageBoxMenu(DMenu *parent, const char *message, int messagemode, bool playsound, FName action = NAME_None, hfunc handler = nullptr)
|
||||
{
|
||||
auto c = PClass::FindClass("MessageBoxMenu");
|
||||
auto c = PClass::FindClass(gameinfo.MessageBoxClass);
|
||||
if (!c->IsDescendantOf(NAME_MessageBoxMenu)) c = PClass::FindClass(NAME_MessageBoxMenu);
|
||||
auto p = c->CreateNew();
|
||||
FString namestr = message;
|
||||
VMValue params[] = { p, parent, &namestr, messagemode, playsound, action.GetIndex(), reinterpret_cast<void*>(handler) };
|
||||
|
||||
auto f = dyn_cast<PFunction>(c->FindSymbol("Init", false));
|
||||
VMCall(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
|
||||
return (DMenu*)p;
|
||||
IFVIRTUALPTRNAME(p, NAME_MessageBoxMenu, Init)
|
||||
{
|
||||
VMValue params[] = { p, parent, &namestr, messagemode, playsound, action.GetIndex(), reinterpret_cast<void*>(handler) };
|
||||
VMCall(func, params, countof(params), nullptr, 0);
|
||||
return (DMenu*)p;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
|
|
@ -912,3 +912,4 @@ xx(StaticArray)
|
|||
xx(DynArray)
|
||||
xx(Struct)
|
||||
xx(ReflectType)
|
||||
xx(MessageBoxMenu)
|
||||
|
|
|
@ -68,6 +68,7 @@ gameinfo
|
|||
statscreen_coop = "CoopStatusScreen"
|
||||
statscreen_dm = "DeathmatchStatusScreen"
|
||||
statscreen_single = "DoomStatusScreen"
|
||||
messageboxclass = "MessageBoxMenu"
|
||||
}
|
||||
|
||||
DoomEdNums
|
||||
|
|
|
@ -69,6 +69,7 @@ gameinfo
|
|||
statscreen_coop = "CoopStatusScreen"
|
||||
statscreen_dm = "DeathmatchStatusScreen"
|
||||
statscreen_single = "DoomStatusScreen"
|
||||
messageboxclass = "MessageBoxMenu"
|
||||
}
|
||||
|
||||
spawnnums
|
||||
|
|
|
@ -67,6 +67,7 @@ gameinfo
|
|||
statscreen_coop = "CoopStatusScreen"
|
||||
statscreen_dm = "DeathmatchStatusScreen"
|
||||
statscreen_single = "RavenStatusScreen"
|
||||
messageboxclass = "MessageBoxMenu"
|
||||
}
|
||||
|
||||
DoomEdNums
|
||||
|
|
|
@ -65,6 +65,7 @@ gameinfo
|
|||
statscreen_coop = "CoopStatusScreen"
|
||||
statscreen_dm = "DeathmatchStatusScreen"
|
||||
statscreen_single = "RavenStatusScreen"
|
||||
messageboxclass = "MessageBoxMenu"
|
||||
}
|
||||
|
||||
DoomEdNums
|
||||
|
|
|
@ -53,6 +53,7 @@ gameinfo
|
|||
statscreen_mapnamefont = "BigFont"
|
||||
statscreen_finishedpatch = "WIF"
|
||||
statscreen_enteringpatch = "WIENTER"
|
||||
messageboxclass = "MessageBoxMenu"
|
||||
}
|
||||
|
||||
DoomEdNums
|
||||
|
|
|
@ -67,6 +67,7 @@ gameinfo
|
|||
statscreen_dm = "DeathmatchStatusScreen"
|
||||
statscreen_single = "RavenStatusScreen"
|
||||
statusbarclass = "StrifeStatusBar"
|
||||
messageboxclass = "MessageBoxMenu"
|
||||
}
|
||||
|
||||
DoomEdNums
|
||||
|
|
|
@ -50,7 +50,7 @@ class MessageBoxMenu : Menu
|
|||
//
|
||||
//=============================================================================
|
||||
|
||||
void Init(Menu parent, String message, int messagemode, bool playsound = false, Name cmd = 'None', voidptr native_handler = null)
|
||||
virtual void Init(Menu parent, String message, int messagemode, bool playsound = false, Name cmd = 'None', voidptr native_handler = null)
|
||||
{
|
||||
Super.Init(parent);
|
||||
mAction = cmd;
|
||||
|
|
Loading…
Reference in a new issue