From c7edef4f436a988a295b037df85165f01a922e7a Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 29 Jan 2018 02:14:09 +0000 Subject: [PATCH] New LOGO_FLAGS bits LOGO_NOHELP and LOGO_NOCREDITS. LOGO_NOHELP: Remove the "Help" item in the main menu and the F1 key function. LOGO_NOCREDITS: Remove the "Credits" item in the main menu. Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6612 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/game.cpp | 2 +- source/duke3d/src/game.h | 2 ++ source/duke3d/src/menus.cpp | 7 +++++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index f472fd925..5be63ea21 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -4793,7 +4793,7 @@ void G_HandleLocalKeys(void) typebuf[0] = 0; } - if (KB_UnBoundKeyPressed(sc_F1)/* || (ud.show_help && I_AdvanceTrigger())*/) + if (KB_UnBoundKeyPressed(sc_F1) && !(G_GetLogoFlags() & LOGO_NOHELP)/* || (ud.show_help && I_AdvanceTrigger())*/) { KB_ClearKeyDown(sc_F1); diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index fa42a985a..7793e5752 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -97,6 +97,8 @@ enum LogoFlags_t { LOGO_NOGAMETITLE = 0x00400000, LOGO_NOTITLEBAR = 0x00800000, LOGO_HIDEEPISODE = 0x01000000, + LOGO_NOHELP = 0x02000000, + LOGO_NOCREDITS = 0x04000000, }; enum { diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index 63d28e2f5..98fe47493 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -1813,6 +1813,13 @@ void Menu_Init(void) // prepare credits M_CREDITS.title = M_CREDITS2.title = M_CREDITS3.title = s_Credits; } + + if (G_GetLogoFlags() & LOGO_NOHELP) + MEL_MAIN[3] = MEL_MAIN_INGAME[4] = nullptr; +#ifndef EDUKE32_SIMPLE_MENU + if (G_GetLogoFlags() & LOGO_NOCREDITS) + MEL_MAIN[4] = nullptr; +#endif } static void Menu_Run(Menu_t *cm, vec2_t origin);