- 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(Playerclassmenu)
xx(HexenDefaultPlayerclassmenu)
xx(ListMenuItemBloodDripDrawer)
xx(Skillmenu)
xx(Startgame)
xx(StartgameNoSkill)
xx(StartgameConfirm)
xx(StartgameConfirmed)
xx(Loadgamemenu)
@ -1078,6 +1080,7 @@ xx(PlayerSkin)
xx(NewPlayerMenu)
xx(AltHud)
xx(GameScreen)
xx(ListM)
// summary
xx(cwidth)

View file

@ -352,7 +352,7 @@ void DMenu::Close ()
assert(CurrentMenu == this);
CurrentMenu = mParentMenu;
if (mParentMenu && transition.StartTransition(this, mParentMenu, MA_Return))
if (false)// todo: && mParentMenu && transition.StartTransition(this, mParentMenu, MA_Return))
{
return;
}
@ -474,7 +474,7 @@ void M_ActivateMenu(DMenu *menu)
CurrentMenu->mMouseCapture = false;
I_ReleaseMouseCapture();
}
transition.StartTransition(CurrentMenu, menu, MA_Advance);
//transition.StartTransition(CurrentMenu, menu, MA_Advance);
}
CurrentMenu = menu;
GC::WriteBarrier(CurrentMenu);
@ -1091,6 +1091,17 @@ DMenuItemBase * CreateListMenuItemText(double x, double y, int height, int hotke
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()
{
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 * 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* CreateListMenuItemStaticText(double x, double y, const char* text, FFont* font, PalEntry color, bool centered = false);
void UpdateVRModes(bool considerQuadBuffered=true);

View file

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

View file

@ -15,6 +15,11 @@ enum EMax
MAXMENUGAMEPLAYENTRIES = 7,
};
enum EVolFlags
{
EF_HIDEFROMSP = 1,
};
// These get filled in by the map definition parsers of the front ends.
extern FString gSkillNames[MAXSKILLS];
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;
void M_StartupEpisodeMenu(FNewGameStartup *gs);
void M_StartupSkillMenu(FNewGameStartup *gs);
void M_CreateGameMenus();
void SetDefaultMenuColors();
void BuildGameMenus();
// 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
centermenu
linespacing 22
NativeTextItem "3460", "n", "StartGame", 1
NativeTextItem "3460", "n", "StartGameNoSkill", 1
NativeTextItem "3461", "l", "LoadGameMenu"
NativeTextItem "3462", "m", "StartGame", 0
NativeTextItem "3462", "m", "StartGameNoSkill", 0
NativeTextItem "3463", "v", "OptionsMenu"
NativeTextItem "3464", "q", "QuitMenu"
*/
@ -85,7 +85,7 @@ LISTMENU "IngameMenu"
class "$.MainMenu"
ifgame(Duke, Nam, WW2GI, Redneck, RedneckRides)
{
position 160, 55, 115
position 160, 55
centermenu
animatedtransition
NativeTextItem "$MNU_NEWGAME", "n", "EpisodeMenu"
@ -96,21 +96,24 @@ LISTMENU "IngameMenu"
NativeTextItem "$MNU_ENDGAME", "e", "EndgameMenu"
NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu"
}
*/
ifgame(Blood)
{
position 160, 45, 150
caption "Blood"
position 160, 45
CaptionItem "Blood"
centermenu
Linespacing 17
NativeTextItem "$MNU_NEWGAME", "n", "EpisodeMenu"
NativeTextItem "$MNU_OPTIONS", "o", "OptionsMenu"
NativeTextItem "$MNU_SAVEGAME", "s", "SaveGameMenu"
NativeTextItem "$MNU_LOADGAME", "l", "LoadGameMenu"
NativeTextItem "$MNU_HELP", "h", "HelpMenu"
NativeTextItem "$MNU_CREDITS", "c", "CreditsMenu"
NativeTextItem "$MNU_ENDGAME", "e", "EndgameMenu"
NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu"
BloodTextItem "$MNU_NEWGAME", "n", "EpisodeMenu"
BloodTextItem "$MNU_OPTIONS", "o", "OptionsMenu"
BloodTextItem "$MNU_SAVEGAME", "s", "SaveGameMenu"
BloodTextItem "$MNU_LOADGAME", "l", "LoadGameMenu"
BloodTextItem "$MNU_HELP", "h", "HelpMenu"
BloodTextItem "$MNU_CREDITS", "c", "CreditsMenu"
BloodTextItem "$MNU_ENDGAME", "e", "EndgameMenu"
BloodTextItem "$MNU_QUITGAME", "q", "QuitMenu"
BloodDripDrawer
}
/*
ifgame(ShadowWarrior)
{
Position 55, 32
@ -156,19 +159,20 @@ LISTMENU "EpisodeMenu"
{
class "$.ListMenu"
caption "$MNU_SELECTEPISODE"
position 160, 48, 142
position 160, 48
centermenu
fixedspacing 5
animatedtransition
}
*/
ifgame(blood)
{
class "$.ListMenu"
caption "$MNU_EPISODES"
position 160, 45, 150
centermenu
position 160, 45
Linespacing 20
CaptionItem "$MNU_EPISODES"
BloodDripDrawer
}
/*
ifgame(ShadowWarrior)
{
caption "$MNU_EPISODES"
@ -191,14 +195,15 @@ LISTMENU "SkillMenu"
fixedspacing 5
animatedtransition
}
*/
ifgame(blood)
{
class "$.ListMenu"
caption "$MNU_DIFFICULTY"
position 160, 60, 150
centermenu
position 160, 60
Linespacing 20
CaptionItem "$MNU_DIFFICULTY"
BloodDripDrawer
}
/*
ifgame(ShadowWarrior)
{
caption "$MNU_DIFFICULTY"
@ -1084,7 +1089,6 @@ OptionMenu "AutomapOptions"
Option "$AUTOMAPMNU_ROTATE", "am_rotate", "OnOff"
Option "$AUTOMAPMNU_FOLLOW", "am_followplayer", "OnOff"
// move map controls here.
// todo:
//CVAR(Bool, am_textfont, false, CVAR_ARCHIVE)
//CVAR(Bool, am_showlabel, false, CVAR_ARCHIVE)