mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 19:20:38 +00:00
- fixed handling of the custom game mode menus in Ion Fury.
Sadly the scripting which necessitates this all is such a hack that it's probably necessary to fix again if the next project comes along that uses the same kind of "creativity" instead of providing a robust implementation.
This commit is contained in:
parent
2c36e986b9
commit
5f5fe271f7
4 changed files with 28 additions and 9 deletions
|
@ -445,13 +445,19 @@ bool M_SetMenu(FName menu, int param, FName caller)
|
||||||
case NAME_CustomGameMenu:
|
case NAME_CustomGameMenu:
|
||||||
GameStartupInfo.CustomLevel1 = param;
|
GameStartupInfo.CustomLevel1 = param;
|
||||||
GameStartupInfo.CustomLevel2 = -1;
|
GameStartupInfo.CustomLevel2 = -1;
|
||||||
GameStartupInfo.Episode = -1;
|
GameStartupInfo.Episode = 0; // Set start to E1L1 so that even if the script fails to set the starting level it is set to something valid.
|
||||||
GameStartupInfo.Level = -1;
|
GameStartupInfo.Level = 0;
|
||||||
GameStartupInfo.Skill = gDefaultSkill;
|
GameStartupInfo.Skill = gDefaultSkill;
|
||||||
gi->CustomMenuSelection(param, -1);
|
gi->CustomMenuSelection(param, -1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NAME_CustomSubMenu1:
|
case NAME_CustomSubMenu1:
|
||||||
|
case NAME_CustomSubMenu2:
|
||||||
|
case NAME_CustomSubMenu3:
|
||||||
|
case NAME_CustomSubMenu4:
|
||||||
|
case NAME_CustomSubMenu5:
|
||||||
|
case NAME_CustomSubMenu6:
|
||||||
|
case NAME_CustomSubMenu7:
|
||||||
GameStartupInfo.CustomLevel2 = param;
|
GameStartupInfo.CustomLevel2 = param;
|
||||||
gi->CustomMenuSelection(GameStartupInfo.CustomLevel1, param);
|
gi->CustomMenuSelection(GameStartupInfo.CustomLevel1, param);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1139,14 +1139,17 @@ static void BuildEpisodeMenu()
|
||||||
}
|
}
|
||||||
if (e > 0)
|
if (e > 0)
|
||||||
{
|
{
|
||||||
FMenuDescriptor** desc = MenuDescriptors.CheckKey(NAME_MainMenu);
|
for (auto name : { NAME_MainMenu, NAME_IngameMenu })
|
||||||
if (desc != NULL && (*desc)->mType == MDESC_ListMenu)
|
|
||||||
{
|
{
|
||||||
FListMenuDescriptor* ld = static_cast<FListMenuDescriptor*>(*desc);
|
FMenuDescriptor** desc = MenuDescriptors.CheckKey(name);
|
||||||
auto li = ld->mItems[0];
|
if (desc != NULL && (*desc)->mType == MDESC_ListMenu)
|
||||||
if (li->GetAction(nullptr) == NAME_EpisodeMenu)
|
|
||||||
{
|
{
|
||||||
li->SetAction(NAME_CustomGameMenu);
|
FListMenuDescriptor* ld = static_cast<FListMenuDescriptor*>(*desc);
|
||||||
|
auto li = ld->mItems[0];
|
||||||
|
if (li->GetAction(nullptr) == NAME_EpisodeMenu)
|
||||||
|
{
|
||||||
|
li->SetAction(NAME_CustomGameMenu);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -270,6 +270,16 @@ class DukeListMenu : public DListMenu
|
||||||
using Super = DListMenu;
|
using Super = DListMenu;
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
void SelectionChanged() override
|
||||||
|
{
|
||||||
|
if (mDesc->mScriptId == 110)
|
||||||
|
{
|
||||||
|
// Hack alert: Ion Fury depends on the skill getting set globally when the selection changes because the script cannot detect actual selection changes.
|
||||||
|
// Yuck!
|
||||||
|
ud.m_player_skill = mDesc->mSelectedItem+1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
virtual void CallScript(int event, bool getorigin = false)
|
virtual void CallScript(int event, bool getorigin = false)
|
||||||
{
|
{
|
||||||
ud.returnvar[0] = int(origin.X * 65536);
|
ud.returnvar[0] = int(origin.X * 65536);
|
||||||
|
|
|
@ -921,7 +921,7 @@ void __fastcall VM_SetPlayer(int const playerNum, int const labelNum, int const
|
||||||
else if ((ps.gm & MODE_MENU) && !(newValue & MODE_MENU))
|
else if ((ps.gm & MODE_MENU) && !(newValue & MODE_MENU))
|
||||||
Menu_Close(playerNum);
|
Menu_Close(playerNum);
|
||||||
*/
|
*/
|
||||||
ps.gm = newValue & ~MODE_MENU;
|
ps.gm = (newValue & ~MODE_MENU) | (ps.gm & MODE_MENU);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PLAYER_GOTWEAPON:
|
case PLAYER_GOTWEAPON:
|
||||||
|
|
Loading…
Reference in a new issue