From ba91dd01204c794b89d04bf45bce49c518fa1174 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 7 Aug 2019 19:12:11 +0000 Subject: [PATCH] Move cheat descriptions from menus.cpp to cheats.cpp git-svn-id: https://svn.eduke32.com/eduke32@7895 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/cheats.cpp | 40 ++++++++++++++++++++++++----- source/duke3d/src/cheats.h | 10 +++----- source/duke3d/src/menus.cpp | 49 ++++++++++++++++++------------------ 3 files changed, 63 insertions(+), 36 deletions(-) diff --git a/source/duke3d/src/cheats.cpp b/source/duke3d/src/cheats.cpp index fd78d8eea..873fc1e8e 100644 --- a/source/duke3d/src/cheats.cpp +++ b/source/duke3d/src/cheats.cpp @@ -24,7 +24,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "osdcmds.h" #include "cheats.h" -// KEEPINSYNC game.h: enum cheatindex_t char CheatStrings [NUMCHEATS][MAXCHEATLEN] = { #ifndef EDUKE32_STANDALONE @@ -58,6 +57,37 @@ char CheatStrings [NUMCHEATS][MAXCHEATLEN] = #endif }; +char CheatDescriptions[NUMCHEATS][MAXCHEATDESC] = +{ + "Toggle God Mode", + "Give Everything", + "Level Warp", + "Toggle Coordinate Display", + "Toggle 3rd-Person View", + "", // time + "Toggle All Locks", + "Toggle Cashman", + "Give All Items", + "Toggle Framerate Display", + "Change Skill", + "", // beta + "Toggle Hyper", + "Toggle Monsters", + "", // + "", // + "Matt Saettler. matts@saettler.com", // todd + "Toggle Show All Map", + "", // kroz + "", // allen + "Toggle Clipping", + "Give Weapons", + "Give Inventory", + "Give Keys", + "Toggle Debug Data Dump", + "", // + "", // cgs +}; + const uint32_t CheatFunctionFlags [NUMCHEATS] = { 1 << CHEATFUNC_GOD, @@ -89,8 +119,8 @@ const uint32_t CheatFunctionFlags [NUMCHEATS] = (1 << CHEATFUNC_GOD) | (1 << CHEATFUNC_GIVEEVERYTHING), }; -// KEEPINSYNC game.h: enum CheatCodeFunctions -// KEEPINSYNC menus.c: MenuEntry_t ME_CheatCodes[] +// KEEPINSYNC cheats.h: enum CheatCodeFunctions +// KEEPINSYNC menus.cpp: MenuEntry_t ME_CheatCodes[] const uint8_t CheatFunctionIDs[NUMCHEATS] = { CHEAT_CASHMAN, @@ -116,8 +146,6 @@ const uint8_t CheatFunctionIDs[NUMCHEATS] = CHEAT_DEBUG, }; -char const * const g_NAMMattCheatQuote = "Matt Saettler. matts@saettler.com"; - #ifndef EDUKE32_STANDALONE void G_SetupCheats(void) { @@ -626,7 +654,7 @@ void G_DoCheats(void) case CHEAT_TODD: if (NAM) { - Bstrcpy(apStrings[QUOTE_RESERVED4], g_NAMMattCheatQuote); + Bstrcpy(apStrings[QUOTE_RESERVED4], CheatDescriptions[CHEAT_TODD]); P_DoQuote(QUOTE_RESERVED4, pPlayer); } else diff --git a/source/duke3d/src/cheats.h b/source/duke3d/src/cheats.h index 1b37f494d..563f9c4b3 100644 --- a/source/duke3d/src/cheats.h +++ b/source/duke3d/src/cheats.h @@ -23,15 +23,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once #define MAXCHEATLEN 20 +#define MAXCHEATDESC 64 #define NUMCHEATCODES (int32_t) ARRAY_SIZE(CheatStrings) extern void G_DoCheats(void); extern void G_SetupCheats(void); -extern char const * const g_NAMMattCheatQuote; - -// Cheats -// KEEPINSYNC game.c: char CheatStrings[][] enum cheatindex_t { CHEAT_CORNHOLIO, // 0 @@ -65,9 +62,10 @@ enum cheatindex_t }; extern char CheatStrings[NUMCHEATS][MAXCHEATLEN]; +extern char CheatDescriptions[NUMCHEATS][MAXCHEATDESC]; -// KEEPINSYNC game.c: uint8_t CheatFunctionIDs[] -// KEEPINSYNC menus.c: MenuEntry_t ME_CheatCodes[] +// KEEPINSYNC cheats.cpp: uint8_t CheatFunctionIDs[] +// KEEPINSYNC menus.cpp: MenuEntry_t ME_CheatCodes[] enum CheatCodeFunctions { CHEATFUNC_CASHMAN, diff --git a/source/duke3d/src/menus.cpp b/source/duke3d/src/menus.cpp index 0bd11b89d..38eef4106 100644 --- a/source/duke3d/src/menus.cpp +++ b/source/duke3d/src/menus.cpp @@ -643,31 +643,31 @@ static MenuEntry_t ME_ENTERCHEAT = MAKE_MENUENTRY( "Enter Cheat Code", &MF_Redfo static MenuLink_t MEO_CHEAT_WARP = { MENU_CHEAT_WARP, MA_None, }; static MenuLink_t MEO_CHEAT_SKILL = { MENU_CHEAT_SKILL, MA_None, }; -// KEEPINSYNC game.h: enum CheatCodeFunctions -// KEEPINSYNC game.c: uint8_t CheatFunctionIDs[] +// KEEPINSYNC cheats.h: enum CheatCodeFunctions +// KEEPINSYNC cheats.cpp: uint8_t CheatFunctionIDs[] #define MAKE_MENUCHEAT( Name ) MAKE_MENUENTRY( Name, &MF_Bluefont, &MEF_Cheats, &MEO_NULL, Link ) static MenuEntry_t ME_CheatCodes[] = { - MAKE_MENUCHEAT( "Toggle Cashman" ), - MAKE_MENUCHEAT( "Toggle God Mode" ), - MAKE_MENUCHEAT( "Give Everything" ), - MAKE_MENUCHEAT( "Give Weapons" ), - MAKE_MENUCHEAT( "Give All Items" ), - MAKE_MENUCHEAT( "Give Inventory" ), - MAKE_MENUCHEAT( "Give Keys" ), - MAKE_MENUCHEAT( "Toggle Hyper" ), - MAKE_MENUCHEAT( "Toggle 3rd-Person View" ), - MAKE_MENUCHEAT( "Toggle Show All Map" ), - MAKE_MENUCHEAT( "Toggle All Locks" ), - MAKE_MENUCHEAT( "Toggle Clipping" ), - MAKE_MENUENTRY( "Level Warp", &MF_Bluefont, &MEF_Cheats, &MEO_CHEAT_WARP, Link ), - MAKE_MENUENTRY( "Change Skill", &MF_Bluefont, &MEF_Cheats, &MEO_CHEAT_SKILL, Link ), - MAKE_MENUCHEAT( "Toggle Monsters" ), - MAKE_MENUCHEAT( "Toggle Framerate Display" ), - MAKE_MENUCHEAT( NULL ), - MAKE_MENUCHEAT( NULL ), - MAKE_MENUCHEAT( NULL ), - MAKE_MENUCHEAT( "Toggle Coordinate Display" ), - MAKE_MENUCHEAT( "Toggle Debug Data Dump" ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_CASHMAN] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_CORNHOLIO] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_STUFF] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_WEAPONS] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_ITEMS] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_INVENTORY] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_KEYS] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_HYPER] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_VIEW] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_SHOWMAP] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_UNLOCK] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_CLIP] ), + MAKE_MENUENTRY( CheatDescriptions[CHEAT_SCOTTY], &MF_Bluefont, &MEF_Cheats, &MEO_CHEAT_WARP, Link ), + MAKE_MENUENTRY( CheatDescriptions[CHEAT_SKILL], &MF_Bluefont, &MEF_Cheats, &MEO_CHEAT_SKILL, Link ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_MONSTERS] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_RATE] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_BETA] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_TODD] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_ALLEN] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_COORDS] ), + MAKE_MENUCHEAT( CheatDescriptions[CHEAT_DEBUG] ), }; static MenuEntry_t *MEL_OPTIONS[] = { @@ -2013,7 +2013,8 @@ static void Menu_Pre(MenuID_t cm) if (!DUKEBETA) { ME_CheatCodes[CHEATFUNC_QUOTEBETA].name = apStrings[QUOTE_CHEAT_BETA]; - ME_CheatCodes[CHEATFUNC_QUOTETODD].name = NAM ? g_NAMMattCheatQuote : apStrings[QUOTE_CHEAT_TODD]; + if (!NAM) + ME_CheatCodes[CHEATFUNC_QUOTETODD].name = apStrings[QUOTE_CHEAT_TODD]; ME_CheatCodes[CHEATFUNC_QUOTEALLEN].name = apStrings[QUOTE_CHEAT_ALLEN]; }