mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-14 11:50:49 +00:00
- added a caption drawer control for ListMenus.
This commit is contained in:
parent
1ea6084478
commit
3ddc544a85
2 changed files with 38 additions and 4 deletions
|
@ -6,10 +6,10 @@
|
||||||
|
|
||||||
LISTMENU "MainMenu"
|
LISTMENU "MainMenu"
|
||||||
{
|
{
|
||||||
/*
|
//class "$.MainMenu"
|
||||||
class "$.MainMenu"
|
|
||||||
ifgame(Duke, Nam, WW2GI, Redneck, RedneckRides)
|
ifgame(Duke, Nam, WW2GI, Redneck, RedneckRides)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
position 160, 55, 115
|
position 160, 55, 115
|
||||||
centermenu
|
centermenu
|
||||||
animatedtransition
|
animatedtransition
|
||||||
|
@ -20,11 +20,13 @@ LISTMENU "MainMenu"
|
||||||
NativeTextItem "$MNU_HELP", "h", "HelpMenu"
|
NativeTextItem "$MNU_HELP", "h", "HelpMenu"
|
||||||
NativeTextItem "$MNU_CREDITS", "c", "CreditsMenu"
|
NativeTextItem "$MNU_CREDITS", "c", "CreditsMenu"
|
||||||
NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu"
|
NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu"
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
ifgame(Blood)
|
ifgame(Blood)
|
||||||
{
|
{
|
||||||
|
CaptionItem "Blood"
|
||||||
|
/*
|
||||||
position 160, 45, 150
|
position 160, 45, 150
|
||||||
caption "Blood"
|
|
||||||
centermenu
|
centermenu
|
||||||
Linespacing 20
|
Linespacing 20
|
||||||
NativeTextItem "$MNU_NEWGAME", "n", "EpisodeMenu"
|
NativeTextItem "$MNU_NEWGAME", "n", "EpisodeMenu"
|
||||||
|
@ -34,9 +36,11 @@ LISTMENU "MainMenu"
|
||||||
NativeTextItem "$MNU_HELP", "h", "HelpMenu"
|
NativeTextItem "$MNU_HELP", "h", "HelpMenu"
|
||||||
NativeTextItem "$MNU_CREDITS", "c", "CreditsMenu"
|
NativeTextItem "$MNU_CREDITS", "c", "CreditsMenu"
|
||||||
NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu"
|
NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu"
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
ifgame(ShadowWarrior)
|
ifgame(ShadowWarrior)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
Position 55, 32
|
Position 55, 32
|
||||||
Linespacing 17
|
Linespacing 17
|
||||||
NativeTextItem "$MNU_NEWGAME", "n", "EpisodeMenu"
|
NativeTextItem "$MNU_NEWGAME", "n", "EpisodeMenu"
|
||||||
|
@ -53,9 +57,11 @@ LISTMENU "MainMenu"
|
||||||
NativeTextItem "$MNU_HOWTOORDER", "h", "CreditsMenu"
|
NativeTextItem "$MNU_HOWTOORDER", "h", "CreditsMenu"
|
||||||
}
|
}
|
||||||
NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu"
|
NativeTextItem "$MNU_QUITGAME", "q", "QuitMenu"
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
ifgame(Exhumed)
|
ifgame(Exhumed)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
Position 160, 65
|
Position 160, 65
|
||||||
centermenu
|
centermenu
|
||||||
linespacing 22
|
linespacing 22
|
||||||
|
@ -64,8 +70,8 @@ LISTMENU "MainMenu"
|
||||||
NativeTextItem "3462", "m", "StartGame", 0
|
NativeTextItem "3462", "m", "StartGame", 0
|
||||||
NativeTextItem "3463", "v", "OptionsMenu"
|
NativeTextItem "3463", "v", "OptionsMenu"
|
||||||
NativeTextItem "3464", "q", "QuitMenu"
|
NativeTextItem "3464", "q", "QuitMenu"
|
||||||
}
|
|
||||||
*/
|
*/
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -340,3 +340,31 @@ class ListMenuItemPatchItem : ListMenuItemSelectable
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
// caption - draws a text using the customizer's caption hook
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
class ListMenuItemCaptionItem : ListMenuItem
|
||||||
|
{
|
||||||
|
String mText;
|
||||||
|
Font mFont;
|
||||||
|
|
||||||
|
void Init(ListMenuDescriptor desc, String text, String fnt = "BigFont")
|
||||||
|
{
|
||||||
|
Super.Init(0, 0);
|
||||||
|
mText = text;
|
||||||
|
mFont = Font.FindFont(fnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
override void Draw(bool selected, ListMenuDescriptor desc)
|
||||||
|
{
|
||||||
|
let font = generic_ui || !desc.mFont ? NewSmallFont : desc.mFont;
|
||||||
|
if (font && mText.Length() > 0)
|
||||||
|
{
|
||||||
|
menuCustomizer.DrawCaption(mText, font, 0, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue