mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-10 23:02:03 +00:00
- fixed most issues with Ion Fury's game startup menus.
This commit is contained in:
parent
8492e3c67a
commit
2c36e986b9
5 changed files with 103 additions and 25 deletions
|
@ -130,6 +130,7 @@ bool DListMenu::Responder (event_t *ev)
|
|||
if (mDesc->mItems[i]->CheckHotkey(ch))
|
||||
{
|
||||
mDesc->mSelectedItem = i;
|
||||
SelectionChanged();
|
||||
gi->MenuSound(GameInterface::SelectSound);
|
||||
return true;
|
||||
}
|
||||
|
@ -139,6 +140,7 @@ bool DListMenu::Responder (event_t *ev)
|
|||
if (mDesc->mItems[i]->CheckHotkey(ch))
|
||||
{
|
||||
mDesc->mSelectedItem = i;
|
||||
SelectionChanged();
|
||||
gi->MenuSound(GameInterface::SelectSound);
|
||||
return true;
|
||||
}
|
||||
|
@ -166,6 +168,7 @@ bool DListMenu::MenuEvent (int mkey, bool fromcontroller)
|
|||
if (--mDesc->mSelectedItem < 0) mDesc->mSelectedItem = mDesc->mItems.Size()-1;
|
||||
}
|
||||
while (!mDesc->mItems[mDesc->mSelectedItem]->Selectable() && mDesc->mSelectedItem != startedAt);
|
||||
SelectionChanged();
|
||||
gi->MenuSound(GameInterface::SelectSound);
|
||||
return true;
|
||||
|
||||
|
@ -175,6 +178,7 @@ bool DListMenu::MenuEvent (int mkey, bool fromcontroller)
|
|||
if (++mDesc->mSelectedItem >= (int)mDesc->mItems.Size()) mDesc->mSelectedItem = 0;
|
||||
}
|
||||
while (!mDesc->mItems[mDesc->mSelectedItem]->Selectable() && mDesc->mSelectedItem != startedAt);
|
||||
SelectionChanged();
|
||||
gi->MenuSound(GameInterface::SelectSound);
|
||||
return true;
|
||||
|
||||
|
@ -228,6 +232,7 @@ bool DListMenu::MouseEvent(int type, int xx, int yy)
|
|||
// no sound. This is too noisy.
|
||||
}
|
||||
mDesc->mSelectedItem = i;
|
||||
SelectionChanged();
|
||||
mDesc->mItems[i]->MouseEvent(type, x, y);
|
||||
return true;
|
||||
}
|
||||
|
@ -264,7 +269,7 @@ void DListMenu::Drawer ()
|
|||
PreDraw();
|
||||
for(unsigned i=0;i<mDesc->mItems.Size(); i++)
|
||||
{
|
||||
if (mDesc->mItems[i]->mEnabled) mDesc->mItems[i]->Drawer(this, origin, mDesc->mSelectedItem == (int)i);
|
||||
mDesc->mItems[i]->Drawer(this, origin, mDesc->mSelectedItem == (int)i);
|
||||
}
|
||||
if (mDesc->mSelectedItem >= 0 && mDesc->mSelectedItem < (int)mDesc->mItems.Size())
|
||||
mDesc->mItems[mDesc->mSelectedItem]->DrawSelector(mDesc->mSelectOfsX, mDesc->mSelectOfsY, mDesc->mSelector);
|
||||
|
|
|
@ -454,7 +454,6 @@ bool M_SetMenu(FName menu, int param, FName caller)
|
|||
case NAME_CustomSubMenu1:
|
||||
GameStartupInfo.CustomLevel2 = param;
|
||||
gi->CustomMenuSelection(GameStartupInfo.CustomLevel1, param);
|
||||
menu = FName(ENamedName(menu + param));
|
||||
break;
|
||||
|
||||
case NAME_SkillMenu:
|
||||
|
@ -469,6 +468,10 @@ bool M_SetMenu(FName menu, int param, FName caller)
|
|||
gi->StartGame(GameStartupInfo);
|
||||
return false;
|
||||
|
||||
case NAME_CustomSubMenu1:
|
||||
menu = ENamedName(menu + param);
|
||||
break;
|
||||
|
||||
#if 0
|
||||
case NAME_StartgameConfirm:
|
||||
{
|
||||
|
|
|
@ -499,6 +499,7 @@ public:
|
|||
bool MouseEvent(int type, int x, int y);
|
||||
void Ticker ();
|
||||
void Drawer ();
|
||||
virtual void SelectionChanged() {}
|
||||
void SetFocus(FListMenuItem *fc)
|
||||
{
|
||||
mFocusControl = fc;
|
||||
|
|
|
@ -1100,7 +1100,7 @@ static void BuildEpisodeMenu()
|
|||
FMenuDescriptor** desc = MenuDescriptors.CheckKey(NAME_CustomGameMenu);
|
||||
if (desc != NULL && (*desc)->mType == MDESC_ListMenu)
|
||||
{
|
||||
FListMenuDescriptor* ld = static_cast<FListMenuDescriptor*>(*desc);
|
||||
FListMenuDescriptor* ldo = static_cast<FListMenuDescriptor*>(*desc);
|
||||
|
||||
for (MenuGameplayStemEntry const& stem : g_MenuGameplayEntries)
|
||||
{
|
||||
|
@ -1112,7 +1112,8 @@ static void BuildEpisodeMenu()
|
|||
FMenuDescriptor** sdesc = MenuDescriptors.CheckKey(FName(ENamedName(NAME_CustomSubMenu1 + e)));
|
||||
if (sdesc != NULL && (*sdesc)->mType == MDESC_ListMenu)
|
||||
{
|
||||
FListMenuDescriptor* ld = static_cast<FListMenuDescriptor*>(*desc);
|
||||
FListMenuDescriptor* ld = static_cast<FListMenuDescriptor*>(*sdesc);
|
||||
ld->mCaption = entry.name;
|
||||
|
||||
for (MenuGameplayEntry const& subentry : stem.subentries)
|
||||
{
|
||||
|
@ -1123,15 +1124,16 @@ static void BuildEpisodeMenu()
|
|||
|
||||
if (subentry.flags & MGE_Locked) li->mEnabled = false;
|
||||
if (subentry.flags & MGE_Hidden) li->mHidden = true;
|
||||
|
||||
ld->mItems.Push(li);
|
||||
++s;
|
||||
}
|
||||
}
|
||||
FName link = entry.flags & MGE_UserContent ? NAME_UsermapMenu : s == 0 ? NAME_SkillMenu : NAME_CustomSubMenu1;
|
||||
|
||||
auto li = new FListMenuItemNativeText(ld->mXpos, 0, 0, 0, entry.name, NIT_BigFont, NIT_ActiveColor, 1.f, link, link == NAME_CustomSubMenu1 ? e : -1);
|
||||
auto li = new FListMenuItemNativeText(ldo->mXpos, 0, 0, 0, entry.name, NIT_BigFont, NIT_ActiveColor, 1.f, link, e);
|
||||
if (entry.flags & MGE_Locked) li->mEnabled = false;
|
||||
if (entry.flags & MGE_Hidden) li->mHidden = true;
|
||||
ldo->mItems.Push(li);
|
||||
e++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -147,9 +147,18 @@ LISTMENU "SkillMenu"
|
|||
{
|
||||
ifgame(Duke, Nam, WW2GI, Fury) // Ion Fury does not use this menu.
|
||||
{
|
||||
ifgame(fury)
|
||||
{
|
||||
position 160, 55, 115
|
||||
fixedspacing 2
|
||||
}
|
||||
else
|
||||
{
|
||||
position 160, 55, 115
|
||||
centermenu
|
||||
animatedtransition
|
||||
}
|
||||
caption "$MNU_SELECTSKILL"
|
||||
position 160, 55, 135
|
||||
centermenu
|
||||
fixedspacing 5
|
||||
class "Duke.ListMenu"
|
||||
animatedtransition
|
||||
|
@ -160,82 +169,140 @@ LISTMENU "SkillMenu"
|
|||
// The custom menus are only supported by the EDuke32 frontend.
|
||||
LISTMENU "CustomGameMenu"
|
||||
{
|
||||
caption "$MNU_NEWGAME"
|
||||
position 160, 48, 142
|
||||
centermenu
|
||||
fixedspacing 5
|
||||
ifgame(fury)
|
||||
{
|
||||
fixedspacing 2
|
||||
}
|
||||
else
|
||||
{
|
||||
fixedspacing 5
|
||||
animatedtransition
|
||||
}
|
||||
ScriptId 102
|
||||
class "Duke.ListMenu"
|
||||
animatedtransition
|
||||
centermenu
|
||||
}
|
||||
|
||||
LISTMENU "CustomSubMenu1"
|
||||
{
|
||||
position 160, 48, 142
|
||||
centermenu
|
||||
fixedspacing 5
|
||||
ifgame(fury)
|
||||
{
|
||||
fixedspacing 2
|
||||
}
|
||||
else
|
||||
{
|
||||
fixedspacing 5
|
||||
animatedtransition
|
||||
}
|
||||
centermenu
|
||||
ScriptId 103
|
||||
class "Duke.ListMenu"
|
||||
animatedtransition
|
||||
}
|
||||
|
||||
LISTMENU "CustomSubMenu2"
|
||||
{
|
||||
position 160, 48, 142
|
||||
ifgame(fury)
|
||||
{
|
||||
fixedspacing 2
|
||||
}
|
||||
else
|
||||
{
|
||||
fixedspacing 5
|
||||
animatedtransition
|
||||
}
|
||||
centermenu
|
||||
fixedspacing 5
|
||||
ScriptId 103
|
||||
class "Duke.ListMenu"
|
||||
animatedtransition
|
||||
}
|
||||
|
||||
LISTMENU "CustomSubMenu3"
|
||||
{
|
||||
position 160, 48, 142
|
||||
ifgame(fury)
|
||||
{
|
||||
fixedspacing 2
|
||||
}
|
||||
else
|
||||
{
|
||||
fixedspacing 5
|
||||
animatedtransition
|
||||
}
|
||||
centermenu
|
||||
fixedspacing 5
|
||||
ScriptId 103
|
||||
class "Duke.ListMenu"
|
||||
animatedtransition
|
||||
}
|
||||
|
||||
LISTMENU "CustomSubMenu4"
|
||||
{
|
||||
position 160, 48, 142
|
||||
ifgame(fury)
|
||||
{
|
||||
fixedspacing 2
|
||||
}
|
||||
else
|
||||
{
|
||||
fixedspacing 5
|
||||
animatedtransition
|
||||
}
|
||||
centermenu
|
||||
fixedspacing 5
|
||||
ScriptId 103
|
||||
class "Duke.ListMenu"
|
||||
animatedtransition
|
||||
}
|
||||
|
||||
LISTMENU "CustomSubMenu5"
|
||||
{
|
||||
position 160, 48, 142
|
||||
ifgame(fury)
|
||||
{
|
||||
fixedspacing 2
|
||||
}
|
||||
else
|
||||
{
|
||||
fixedspacing 5
|
||||
animatedtransition
|
||||
}
|
||||
centermenu
|
||||
fixedspacing 5
|
||||
ScriptId 103
|
||||
class "Duke.ListMenu"
|
||||
animatedtransition
|
||||
}
|
||||
|
||||
LISTMENU "CustomSubMenu6"
|
||||
{
|
||||
position 160, 48, 142
|
||||
ifgame(fury)
|
||||
{
|
||||
fixedspacing 2
|
||||
}
|
||||
else
|
||||
{
|
||||
fixedspacing 5
|
||||
animatedtransition
|
||||
}
|
||||
centermenu
|
||||
fixedspacing 5
|
||||
ScriptId 103
|
||||
class "Duke.ListMenu"
|
||||
animatedtransition
|
||||
}
|
||||
|
||||
LISTMENU "CustomSubMenu7"
|
||||
{
|
||||
position 160, 48, 142
|
||||
ifgame(fury)
|
||||
{
|
||||
fixedspacing 2
|
||||
}
|
||||
else
|
||||
{
|
||||
fixedspacing 5
|
||||
animatedtransition
|
||||
}
|
||||
centermenu
|
||||
fixedspacing 5
|
||||
ScriptId 103
|
||||
class "Duke.ListMenu"
|
||||
animatedtransition
|
||||
}
|
||||
|
||||
LISTMENU "MultiMenu"
|
||||
|
|
Loading…
Reference in a new issue