Skip to content

Commit 030b30b

Browse files
committed
Disable Loadout and Pistolstart for Hexen
- It's incompatible
1 parent 4ed7f86 commit 030b30b

File tree

1 file changed

+63
-52
lines changed

1 file changed

+63
-52
lines changed

prboom2/src/m_menu.c

Lines changed: 63 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,6 +1826,58 @@ static int entry_index;
18261826
static char entry_string_index[ENTRY_STRING_BFR_SIZE]; // points to new strings while editing
18271827
static int choice_value;
18281828

1829+
/////////////////////////////
1830+
//
1831+
// Custom Skill Functions [based off Nugget]
1832+
1833+
enum
1834+
{
1835+
cskill_new_game,
1836+
cskill_pistol_start,
1837+
cskill_loadout_current
1838+
} cskill_mode_e;
1839+
1840+
static void M_StartCustomSkill(int mode)
1841+
{
1842+
// Use custom skill (-1 to match gameskill)
1843+
chosen_skill = num_skills - 1;
1844+
1845+
dsda_UpdateCustomSkill(chosen_skill);
1846+
1847+
if (mode == cskill_new_game || gamestate == GS_DEMOSCREEN)
1848+
M_FinishGameSelection();
1849+
else if (mode == cskill_pistol_start || !in_game)
1850+
G_DeferedInitNew(chosen_skill, gameepisode, gamemap);
1851+
else if (mode == cskill_loadout_current)
1852+
G_RestartWithLoadout();
1853+
1854+
M_ClearMenus();
1855+
}
1856+
1857+
static void StartCustomSkill(int mode)
1858+
{
1859+
M_StartCustomSkill(mode);
1860+
1861+
M_LeaveSetupMenu();
1862+
M_ClearMenus();
1863+
S_StartVoidSound(g_sfx_swtchx);
1864+
}
1865+
1866+
static void CSNewGame(void)
1867+
{
1868+
StartCustomSkill(cskill_new_game);
1869+
}
1870+
1871+
static void CSPistolStart(void)
1872+
{
1873+
StartCustomSkill(cskill_pistol_start);
1874+
}
1875+
1876+
static void CSCurrentLoadout(void)
1877+
{
1878+
StartCustomSkill(cskill_loadout_current);
1879+
}
1880+
18291881
/////////////////////////////
18301882
//
18311883
// M_ItemDisabled
@@ -1841,6 +1893,14 @@ static dboolean M_ItemDisabled(const setup_menu_t* s)
18411893
if (dsda_StrictMode() && dsda_IsStrictConfig(s->config_id))
18421894
return true;
18431895

1896+
// Hexen Stuff
1897+
if (hexen)
1898+
{
1899+
// Hexen doesn't allow pistolstart + loadout doesn't work due to key management
1900+
if (s->action == CSPistolStart || s->action == CSCurrentLoadout)
1901+
return true;
1902+
}
1903+
18441904
return false;
18451905
}
18461906

@@ -3616,58 +3676,6 @@ static void M_DrawCompatibility(void)
36163676
M_DrawScreenItems(current_setup_menu, DEFAULT_LIST_Y);
36173677
}
36183678

3619-
/////////////////////////////
3620-
//
3621-
// Custom Skill Functions [based off Nugget]
3622-
3623-
enum
3624-
{
3625-
cskill_new_game,
3626-
cskill_pistol_start,
3627-
cskill_loadout_current
3628-
} cskill_mode_e;
3629-
3630-
static void M_StartCustomSkill(int mode)
3631-
{
3632-
// Use custom skill (-1 to match gameskill)
3633-
chosen_skill = num_skills - 1;
3634-
3635-
dsda_UpdateCustomSkill(chosen_skill);
3636-
3637-
if (mode == cskill_new_game || gamestate == GS_DEMOSCREEN)
3638-
M_FinishGameSelection();
3639-
else if (mode == cskill_pistol_start || !in_game)
3640-
G_DeferedInitNew(chosen_skill, gameepisode, gamemap);
3641-
else if (mode == cskill_loadout_current)
3642-
G_RestartWithLoadout();
3643-
3644-
M_ClearMenus();
3645-
}
3646-
3647-
static void StartCustomSkill(int mode)
3648-
{
3649-
M_StartCustomSkill(mode);
3650-
3651-
M_LeaveSetupMenu();
3652-
M_ClearMenus();
3653-
S_StartVoidSound(g_sfx_swtchx);
3654-
}
3655-
3656-
static void CSNewGame(void)
3657-
{
3658-
StartCustomSkill(cskill_new_game);
3659-
}
3660-
3661-
static void CSPistolStart(void)
3662-
{
3663-
StartCustomSkill(cskill_pistol_start);
3664-
}
3665-
3666-
static void CSCurrentLoadout(void)
3667-
{
3668-
StartCustomSkill(cskill_loadout_current);
3669-
}
3670-
36713679

36723680
/////////////////////////////
36733681
//
@@ -5092,6 +5100,9 @@ static dboolean M_SetupCommonSelectResponder(int ch, int action, event_t* ev)
50925100
if (ptr1->m_flags & S_FUNC)
50935101
{
50945102
if (action == MENU_ENTER) {
5103+
if (M_ItemDisabled(ptr1))
5104+
return true;
5105+
50955106
if (ptr1->action)
50965107
ptr1->action();
50975108

0 commit comments

Comments
 (0)