- activated most of the support code for programmatically created menus again.

Blood's regular menu screens mostly work again
This commit is contained in:
Christoph Oelckers 2020-10-07 01:31:41 +02:00
parent 5726b693bd
commit 38ddbfe65f
8 changed files with 215 additions and 736 deletions

View File

@ -715,8 +715,10 @@ xx(MainmenuTextOnly)
xx(Episodemenu) xx(Episodemenu)
xx(Playerclassmenu) xx(Playerclassmenu)
xx(HexenDefaultPlayerclassmenu) xx(HexenDefaultPlayerclassmenu)
xx(ListMenuItemBloodDripDrawer)
xx(Skillmenu) xx(Skillmenu)
xx(Startgame) xx(Startgame)
xx(StartgameNoSkill)
xx(StartgameConfirm) xx(StartgameConfirm)
xx(StartgameConfirmed) xx(StartgameConfirmed)
xx(Loadgamemenu) xx(Loadgamemenu)
@ -1078,6 +1080,7 @@ xx(PlayerSkin)
xx(NewPlayerMenu) xx(NewPlayerMenu)
xx(AltHud) xx(AltHud)
xx(GameScreen) xx(GameScreen)
xx(ListM)
// summary // summary
xx(cwidth) xx(cwidth)

View File

@ -352,7 +352,7 @@ void DMenu::Close ()
assert(CurrentMenu == this); assert(CurrentMenu == this);
CurrentMenu = mParentMenu; CurrentMenu = mParentMenu;
if (mParentMenu && transition.StartTransition(this, mParentMenu, MA_Return)) if (false)// todo: && mParentMenu && transition.StartTransition(this, mParentMenu, MA_Return))
{ {
return; return;
} }
@ -474,7 +474,7 @@ void M_ActivateMenu(DMenu *menu)
CurrentMenu->mMouseCapture = false; CurrentMenu->mMouseCapture = false;
I_ReleaseMouseCapture(); I_ReleaseMouseCapture();
} }
transition.StartTransition(CurrentMenu, menu, MA_Advance); //transition.StartTransition(CurrentMenu, menu, MA_Advance);
} }
CurrentMenu = menu; CurrentMenu = menu;
GC::WriteBarrier(CurrentMenu); GC::WriteBarrier(CurrentMenu);
@ -1091,6 +1091,17 @@ DMenuItemBase * CreateListMenuItemText(double x, double y, int height, int hotke
return (DMenuItemBase*)p; return (DMenuItemBase*)p;
} }
DMenuItemBase* CreateListMenuItemStaticText(double x, double y, const char* text, FFont* font, PalEntry color, bool centered)
{
auto c = PClass::FindClass("ListMenuItemStaticText");
auto p = c->CreateNew();
FString textstr = text;
VMValue params[] = { p, x, y, &textstr, font, int(color.d), centered };
auto f = dyn_cast<PFunction>(c->FindSymbol("InitDirect", false));
VMCall(f->Variants[0].Implementation, params, countof(params), nullptr, 0);
return (DMenuItemBase*)p;
}
bool DMenuItemBase::Activate() bool DMenuItemBase::Activate()
{ {
IFVIRTUAL(DMenuItemBase, Activate) IFVIRTUAL(DMenuItemBase, Activate)

View File

@ -304,6 +304,7 @@ DMenuItemBase * CreateOptionMenuItemJoyConfigMenu(const char *label, IJoystickCo
DMenuItemBase * CreateListMenuItemPatch(double x, double y, int height, int hotkey, FTextureID tex, FName command, int param); DMenuItemBase * CreateListMenuItemPatch(double x, double y, int height, int hotkey, FTextureID tex, FName command, int param);
DMenuItemBase * CreateListMenuItemText(double x, double y, int height, int hotkey, const char *text, FFont *font, PalEntry color1, PalEntry color2, FName command, int param); DMenuItemBase * CreateListMenuItemText(double x, double y, int height, int hotkey, const char *text, FFont *font, PalEntry color1, PalEntry color2, FName command, int param);
DMenuItemBase * CreateOptionMenuItemCommand(const char *label, FName cmd, bool centered = false); DMenuItemBase * CreateOptionMenuItemCommand(const char *label, FName cmd, bool centered = false);
DMenuItemBase* CreateListMenuItemStaticText(double x, double y, const char* text, FFont* font, PalEntry color, bool centered = false);
void UpdateVRModes(bool considerQuadBuffered=true); void UpdateVRModes(bool considerQuadBuffered=true);

View File

@ -875,6 +875,7 @@ int RunGame()
gi->app_init(); gi->app_init();
SetDefaultMenuColors(); SetDefaultMenuColors();
M_Init(); M_Init();
BuildGameMenus();
if (!(paletteloaded & PALETTE_MAIN)) if (!(paletteloaded & PALETTE_MAIN))
I_FatalError("No palette found."); I_FatalError("No palette found.");

View File

@ -15,6 +15,11 @@ enum EMax
MAXMENUGAMEPLAYENTRIES = 7, MAXMENUGAMEPLAYENTRIES = 7,
}; };
enum EVolFlags
{
EF_HIDEFROMSP = 1,
};
// These get filled in by the map definition parsers of the front ends. // These get filled in by the map definition parsers of the front ends.
extern FString gSkillNames[MAXSKILLS]; extern FString gSkillNames[MAXSKILLS];
extern FString gVolumeNames[MAXVOLUMES]; extern FString gVolumeNames[MAXVOLUMES];

File diff suppressed because it is too large Load Diff

View File

@ -11,8 +11,8 @@ void M_StartControlPanel (bool makeSound, bool scaleoverride = false);
extern FNewGameStartup NewGameStartupInfo; extern FNewGameStartup NewGameStartupInfo;
void M_StartupEpisodeMenu(FNewGameStartup *gs); void M_StartupEpisodeMenu(FNewGameStartup *gs);
void M_StartupSkillMenu(FNewGameStartup *gs); void M_StartupSkillMenu(FNewGameStartup *gs);
void M_CreateGameMenus();
void SetDefaultMenuColors(); void SetDefaultMenuColors();
void BuildGameMenus();
// The savegame manager contains too much code that is game specific. Parts are shareable but need more work first. // The savegame manager contains too much code that is game specific. Parts are shareable but need more work first.

View File

@ -64,9 +64,9 @@ LISTMENU "MainMenu"
Position 160, 65 Position 160, 65
centermenu centermenu
linespacing 22 linespacing 22
NativeTextItem "3460", "n", "StartGame", 1 NativeTextItem "3460", "n", "StartGameNoSkill", 1
NativeTextItem "3461", "l", "LoadGameMenu" NativeTextItem "3461", "l", "LoadGameMenu"
NativeTextItem "3462", "m", "StartGame", 0 NativeTextItem "3462", "m", "StartGameNoSkill", 0
NativeTextItem "3463", "v", "OptionsMenu" NativeTextItem "3463", "v", "OptionsMenu"
NativeTextItem "3464", "q", "QuitMenu" NativeTextItem "3464", "q", "QuitMenu"
*/ */
@ -85,7 +85,7 @@ LISTMENU "IngameMenu"
class "$.MainMenu" class "$.MainMenu"
ifgame(Duke, Nam, WW2GI, Redneck, RedneckRides) ifgame(Duke, Nam, WW2GI, Redneck, RedneckRides)
{ {
position 160, 55, 115 position 160, 55
centermenu centermenu
animatedtransition animatedtransition
NativeTextItem "$MNU_NEWGAME", "n", "EpisodeMenu" NativeTextItem "$MNU_NEWGAME", "n", "EpisodeMenu"
@ -96,21 +96,24 @@ LISTMENU "IngameMenu"
NativeTextItem "$MNU_ENDGAME", "e", "EndgameMenu" NativeTextItem "$MNU_ENDGAME", "e", "EndgameMenu"
NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu" NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu"
} }
*/
ifgame(Blood) ifgame(Blood)
{ {
position 160, 45, 150 position 160, 45
caption "Blood" CaptionItem "Blood"
centermenu centermenu
Linespacing 17 Linespacing 17
NativeTextItem "$MNU_NEWGAME", "n", "EpisodeMenu" BloodTextItem "$MNU_NEWGAME", "n", "EpisodeMenu"
NativeTextItem "$MNU_OPTIONS", "o", "OptionsMenu" BloodTextItem "$MNU_OPTIONS", "o", "OptionsMenu"
NativeTextItem "$MNU_SAVEGAME", "s", "SaveGameMenu" BloodTextItem "$MNU_SAVEGAME", "s", "SaveGameMenu"
NativeTextItem "$MNU_LOADGAME", "l", "LoadGameMenu" BloodTextItem "$MNU_LOADGAME", "l", "LoadGameMenu"
NativeTextItem "$MNU_HELP", "h", "HelpMenu" BloodTextItem "$MNU_HELP", "h", "HelpMenu"
NativeTextItem "$MNU_CREDITS", "c", "CreditsMenu" BloodTextItem "$MNU_CREDITS", "c", "CreditsMenu"
NativeTextItem "$MNU_ENDGAME", "e", "EndgameMenu" BloodTextItem "$MNU_ENDGAME", "e", "EndgameMenu"
NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu" BloodTextItem "$MNU_QUITGAME", "q", "QuitMenu"
BloodDripDrawer
} }
/*
ifgame(ShadowWarrior) ifgame(ShadowWarrior)
{ {
Position 55, 32 Position 55, 32
@ -156,19 +159,20 @@ LISTMENU "EpisodeMenu"
{ {
class "$.ListMenu" class "$.ListMenu"
caption "$MNU_SELECTEPISODE" caption "$MNU_SELECTEPISODE"
position 160, 48, 142 position 160, 48
centermenu centermenu
fixedspacing 5 fixedspacing 5
animatedtransition animatedtransition
} }
*/
ifgame(blood) ifgame(blood)
{ {
class "$.ListMenu" position 160, 45
caption "$MNU_EPISODES"
position 160, 45, 150
centermenu
Linespacing 20 Linespacing 20
CaptionItem "$MNU_EPISODES"
BloodDripDrawer
} }
/*
ifgame(ShadowWarrior) ifgame(ShadowWarrior)
{ {
caption "$MNU_EPISODES" caption "$MNU_EPISODES"
@ -191,14 +195,15 @@ LISTMENU "SkillMenu"
fixedspacing 5 fixedspacing 5
animatedtransition animatedtransition
} }
*/
ifgame(blood) ifgame(blood)
{ {
class "$.ListMenu" position 160, 60
caption "$MNU_DIFFICULTY"
position 160, 60, 150
centermenu
Linespacing 20 Linespacing 20
CaptionItem "$MNU_DIFFICULTY"
BloodDripDrawer
} }
/*
ifgame(ShadowWarrior) ifgame(ShadowWarrior)
{ {
caption "$MNU_DIFFICULTY" caption "$MNU_DIFFICULTY"
@ -1084,7 +1089,6 @@ OptionMenu "AutomapOptions"
Option "$AUTOMAPMNU_ROTATE", "am_rotate", "OnOff" Option "$AUTOMAPMNU_ROTATE", "am_rotate", "OnOff"
Option "$AUTOMAPMNU_FOLLOW", "am_followplayer", "OnOff" Option "$AUTOMAPMNU_FOLLOW", "am_followplayer", "OnOff"
// move map controls here.
// todo: // todo:
//CVAR(Bool, am_textfont, false, CVAR_ARCHIVE) //CVAR(Bool, am_textfont, false, CVAR_ARCHIVE)
//CVAR(Bool, am_showlabel, false, CVAR_ARCHIVE) //CVAR(Bool, am_showlabel, false, CVAR_ARCHIVE)