From 57cb22f13589bd3c3c6d88b6e731648b92308de1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 12 Apr 2020 00:10:39 +0200 Subject: [PATCH] - console code matching with GZDoom Refactored the buttons to be definable locally per game for easier handling of differing input. --- .gitignore | 64 +------------ source/blood/src/blood.cpp | 66 ++++++++++++- source/blood/src/blood.h | 62 ++++++++++++ source/blood/src/controls.cpp | 8 +- source/blood/src/messages.cpp | 2 +- source/core/console/c_bind.cpp | 4 +- source/core/console/c_buttons.cpp | 145 +++++++++-------------------- source/core/console/c_buttons.h | 120 ++++-------------------- source/core/console/c_dispatch.cpp | 35 +------ source/core/gamecontrol.cpp | 1 + source/duke3d/src/duke3d.h | 68 +++++++++++++- source/duke3d/src/game.cpp | 62 ++++++++++++ source/duke3d/src/gamedef.cpp | 4 +- source/duke3d/src/gameexec.cpp | 4 +- source/exhumed/src/exhumed.cpp | 59 ++++++++++++ source/exhumed/src/exhumed.h | 61 ++++++++++++ source/rr/src/duke3d.h | 65 +++++++++++++ source/rr/src/game.cpp | 65 ++++++++++++- source/sw/src/demo.cpp | 2 +- source/sw/src/game.cpp | 71 +++++++++++++- source/sw/src/game.h | 63 +++++++++++++ 21 files changed, 715 insertions(+), 316 deletions(-) diff --git a/.gitignore b/.gitignore index dfa418d98..84a46663c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,67 +1,5 @@ - -obj/ - -eduke32 -apps/ -*.exe -/*.dll -*.dylib -*.so -*.elf -*.dol -*.x86 -*.x64 -*.ppc -*.app - -/movie -/blud*.png -/game*.sav -*.log -*.cache -*.cfg -texturecache -*.index - -*.manifest -/*.map -/*.mhk -/platform/Windows/*.map -*.pdb -.vs/ -*.VC.db -*.VC.opendb -*.sym -/*.grp -/*.rts -/*.art -/*.ar_ -/*.con -/*.SMK -/*.WAV -/platform/Windows/*.con -*.memmap -*.sdf -*.suo -*.opensdf -*.vcxproj.user -*.psess -*.vsp -perl.exe.stackdump - -xcuserdata/ -project.xcworkspace/ -*.dSYM/ - -.DS_Store -._* -/autoload -/movie -/blud*.png -/*.DEM -/game*.sav - build-vs2019/ +build-vs2019-32/ /source/gitinfo.h /build2 /build diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index c5f88be55..98ebd3ec1 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -708,9 +708,9 @@ void LocalKeys(void) bool alt = inputState.AltPressed(); bool ctrl = inputState.CtrlPressed(); bool shift = inputState.ShiftPressed(); - if (buttonMap.ButtonDown(gamefunc_See_Chase_View) && !alt && !shift) + if (buttonMap.ButtonDown(gamefunc_Third_Person_View) && !alt && !shift) { - buttonMap.ClearButton(gamefunc_See_Chase_View); + buttonMap.ClearButton(gamefunc_Third_Person_View); if (gViewPos > VIEWPOS_0) gViewPos = VIEWPOS_0; else @@ -755,7 +755,7 @@ void LocalKeys(void) gPlayerMsg.Set(*CombatMacros[fk]); gPlayerMsg.Send(); } - buttonMap.ClearButton(gamefunc_See_Chase_View); + buttonMap.ClearButton(gamefunc_Third_Person_View); return; } #if 0 @@ -1035,8 +1035,68 @@ void ClockStrobe() void ReadAllRFS(); +static const char* actions[] = { + "Move_Forward", + "Move_Backward", + "Turn_Left", + "Turn_Right", + "Strafe", + "Fire", + "Open", + "Run", + "Alt_Fire", // Duke3D", Blood + "Jump", + "Crouch", + "Look_Up", + "Look_Down", + "Look_Left", + "Look_Right", + "Strafe_Left", + "Strafe_Right", + "Aim_Up", + "Aim_Down", + "Weapon_1", + "Weapon_2", + "Weapon_3", + "Weapon_4", + "Weapon_5", + "Weapon_6", + "Weapon_7", + "Weapon_8", + "Weapon_9", + "Weapon_10", + "Inventory", + "Inventory_Left", + "Inventory_Right", + "Nightvision", + "MedKit", + "TurnAround", + "SendMessage", + "Map", + "Shrink_Screen", + "Enlarge_Screen", + "Center_View", + "Holster_Weapon", + "Show_Opponents_Weapon", + "Map_Follow_Mode", + "See_Coop_View", + "Mouse_Aiming", + "Toggle_Crosshair", + "Next_Weapon", + "Previous_Weapon", + "Dpad_Select", + "Dpad_Aiming", + "Third_Person_View", + "Toggle_Crouch", + "CrystalBall", + "ProximityBombs", + "RemoteBombs", + "Jetpack" +}; + int GameInterface::app_main() { + buttonMap.SetButtons(actions, NUM_ACTIONS); memcpy(&gGameOptions, &gSingleGameOptions, sizeof(GAMEOPTIONS)); gGameOptions.nMonsterSettings = !userConfig.nomonsters; bQuickStart = userConfig.nologo; diff --git a/source/blood/src/blood.h b/source/blood/src/blood.h index 25d71601a..e01449c1f 100644 --- a/source/blood/src/blood.h +++ b/source/blood/src/blood.h @@ -28,6 +28,68 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_BLD_NS +// Order is that of EDuke32 by necessity because it exposes the key binds to scripting by index instead of by name. +enum GameFunction_t +{ + gamefunc_Move_Forward, + gamefunc_Move_Backward, + gamefunc_Turn_Left, + gamefunc_Turn_Right, + gamefunc_Strafe, + gamefunc_Fire, + gamefunc_Open, + gamefunc_Run, + gamefunc_Alt_Fire, // Duke3D, Blood + gamefunc_Jump, + gamefunc_Crouch, + gamefunc_Look_Up, + gamefunc_Look_Down, + gamefunc_Look_Left, + gamefunc_Look_Right, + gamefunc_Strafe_Left, + gamefunc_Strafe_Right, + gamefunc_Aim_Up, + gamefunc_Aim_Down, + gamefunc_Weapon_1, + gamefunc_Weapon_2, + gamefunc_Weapon_3, + gamefunc_Weapon_4, + gamefunc_Weapon_5, + gamefunc_Weapon_6, + gamefunc_Weapon_7, + gamefunc_Weapon_8, + gamefunc_Weapon_9, + gamefunc_Weapon_10, + gamefunc_Inventory, + gamefunc_Inventory_Left, + gamefunc_Inventory_Right, + gamefunc_BeastVision, //Nightvision + gamefunc_MedKit, + gamefunc_TurnAround, + gamefunc_SendMessage, + gamefunc_Map, + gamefunc_Shrink_Screen, + gamefunc_Enlarge_Screen, + gamefunc_Center_View, + gamefunc_Holster_Weapon, + gamefunc_Show_Opponents_Weapon, + gamefunc_Map_Follow_Mode, + gamefunc_See_Coop_View, + gamefunc_Mouse_Aiming, + gamefunc_Toggle_Crosshair, + gamefunc_Next_Weapon, + gamefunc_Previous_Weapon, + gamefunc_Dpad_Select, + gamefunc_Dpad_Aiming, + gamefunc_Third_Person_View, + gamefunc_Toggle_Crouch, + gamefunc_CrystalBall, + gamefunc_ProximityBombs, + gamefunc_RemoteBombs, + gamefunc_JumpBoots, + NUM_ACTIONS +}; + struct INIDESCRIPTION { const char *pzName; const char *pzFilename; diff --git a/source/blood/src/controls.cpp b/source/blood/src/controls.cpp index c0bac7786..44c3f2b99 100644 --- a/source/blood/src/controls.cpp +++ b/source/blood/src/controls.cpp @@ -112,9 +112,9 @@ void ctrlGetInput(void) if (gQuitRequest) gInput.keyFlags.quit = 1; - if (buttonMap.ButtonDown(gamefunc_Map_Toggle)) + if (buttonMap.ButtonDown(gamefunc_Map)) { - buttonMap.ClearButton(gamefunc_Map_Toggle); + buttonMap.ClearButton(gamefunc_Map); viewToggle(gViewMode); } @@ -226,9 +226,9 @@ void ctrlGetInput(void) gInput.keyFlags.nextItem = 1; } - if (buttonMap.ButtonDown(gamefunc_Inventory_Use)) + if (buttonMap.ButtonDown(gamefunc_Inventory)) { - buttonMap.ClearButton(gamefunc_Inventory_Use); + buttonMap.ClearButton(gamefunc_Inventory); gInput.keyFlags.useItem = 1; } diff --git a/source/blood/src/messages.cpp b/source/blood/src/messages.cpp index 56e4331b9..b0c8a40a9 100644 --- a/source/blood/src/messages.cpp +++ b/source/blood/src/messages.cpp @@ -48,7 +48,7 @@ CCheatMgr gCheatMgr; void sub_5A928(void) { - for (int i = 0; i < NUMGAMEFUNCTIONS-1; i++) + for (int i = 0; i < buttonMap.NumButtons(); i++) buttonMap.ClearButton(i); } diff --git a/source/core/console/c_bind.cpp b/source/core/console/c_bind.cpp index 7fe54cc84..f4802b1e5 100644 --- a/source/core/console/c_bind.cpp +++ b/source/core/console/c_bind.cpp @@ -49,7 +49,7 @@ #include "d_event.h" - +extern int chatmodeon; const char *KeyNames[NUM_KEYS] = { @@ -823,7 +823,7 @@ bool C_DoKey (event_t *ev, FKeyBindings *binds, FKeyBindings *doublebinds) return false; } - if (!binding.IsEmpty())// && (chatmodeon == 0 || ev->data1 < 256)) + if (!binding.IsEmpty() && (chatmodeon == 0 || ev->data1 < 256)) { char *copy = binding.LockBuffer(); diff --git a/source/core/console/c_buttons.cpp b/source/core/console/c_buttons.cpp index 0e9939561..0ea14dd46 100644 --- a/source/core/console/c_buttons.cpp +++ b/source/core/console/c_buttons.cpp @@ -34,98 +34,14 @@ */ #include "c_buttons.h" +#include "templates.h" +#include "c_dispatch.h" #include "printf.h" #include "cmdlib.h" -#include "c_dispatch.h" -#include "gamecontrol.h" +#include "c_console.h" ButtonMap buttonMap; -struct ButtonDesc -{ - int index; - const char *name; -}; - -static const ButtonDesc gamefuncs[] = { - { gamefunc_Move_Forward, "Move_Forward"}, - { gamefunc_Move_Backward, "Move_Backward"}, - { gamefunc_Turn_Left, "Turn_Left"}, - { gamefunc_Turn_Right, "Turn_Right"}, - { gamefunc_Strafe, "Strafe"}, - { gamefunc_Fire, "Fire"}, - { gamefunc_Open, "Open"}, - { gamefunc_Run, "Run"}, - { gamefunc_Alt_Fire, "Alt_Fire"}, - { gamefunc_Jump, "Jump"}, - { gamefunc_Crouch, "Crouch"}, - { gamefunc_Look_Up, "Look_Up"}, - { gamefunc_Look_Down, "Look_Down"}, - { gamefunc_Look_Left, "Look_Left"}, - { gamefunc_Look_Right, "Look_Right"}, - { gamefunc_Strafe_Left, "Strafe_Left"}, - { gamefunc_Strafe_Right, "Strafe_Right"}, - { gamefunc_Aim_Up, "Aim_Up"}, - { gamefunc_Aim_Down, "Aim_Down"}, - { gamefunc_Weapon_1, "Weapon_1"}, - { gamefunc_Weapon_2, "Weapon_2"}, - { gamefunc_Weapon_3, "Weapon_3"}, - { gamefunc_Weapon_4, "Weapon_4"}, - { gamefunc_Weapon_5, "Weapon_5"}, - { gamefunc_Weapon_6, "Weapon_6"}, - { gamefunc_Weapon_7, "Weapon_7"}, - { gamefunc_Weapon_8, "Weapon_8"}, - { gamefunc_Weapon_9, "Weapon_9"}, - { gamefunc_Weapon_10, "Weapon_10"}, - { gamefunc_Inventory, "Inventory"}, - { gamefunc_Inventory_Left, "Inventory_Left"}, - { gamefunc_Inventory_Right, "Inventory_Right"}, - { gamefunc_Holo_Duke, "Holo_Duke"}, - { gamefunc_Jetpack, "Jetpack"}, - { gamefunc_NightVision, "NightVision"}, - { gamefunc_MedKit, "MedKit"}, - { gamefunc_TurnAround, "Turn_Around"}, - { gamefunc_SendMessage, "Send_Message"}, - { gamefunc_Map, "Map"}, - { gamefunc_Shrink_Screen, "Shrink_Screen"}, - { gamefunc_Enlarge_Screen, "Enlarge_Screen"}, - { gamefunc_Center_View, "Center_View"}, - { gamefunc_Holster_Weapon, "Holster_Weapon"}, - { gamefunc_Show_Opponents_Weapon, "Show_Opponents_Weapon"}, - { gamefunc_Map_Follow_Mode, "Map_Follow_Mode"}, - { gamefunc_See_Coop_View, "See_Coop_View"}, - { gamefunc_Mouse_Aiming, "Mouse_Aiming"}, - { gamefunc_Toggle_Crosshair, "Toggle_Crosshair"}, - { gamefunc_Steroids, "Steroids"}, - { gamefunc_Quick_Kick, "Quick_Kick"}, - { gamefunc_Next_Weapon, "Next_Weapon"}, - { gamefunc_Previous_Weapon, "Previous_Weapon"}, - { gamefunc_Show_DukeMatch_Scores, "Show_DukeMatch_Scores"}, - { gamefunc_Dpad_Select, "Dpad_Select"}, - { gamefunc_Dpad_Aiming, "Dpad_Aiming"}, - { gamefunc_Last_Weapon, "Last_Used_Weapon"}, - { gamefunc_Alt_Weapon, "Alt_Weapon"}, - { gamefunc_Third_Person_View, "Third_Person_View"}, - { gamefunc_Toggle_Crouch, "Toggle_Crouch"}, - { gamefunc_CrystalBall, "CrystalBall"}, // the following were added by Blood - { gamefunc_ProximityBombs, "ProximityBombs"}, - { gamefunc_RemoteBombs, "RemoteBombs"}, - { gamefunc_Smoke_Bomb, "Smoke_Bomb" }, - { gamefunc_Gas_Bomb, "Gas_Bomb" }, - { gamefunc_Flash_Bomb, "Flash_Bomb" }, - { gamefunc_Caltrops, "Caltrops" }, - -}; - -// This is for use by the tab command builder which can run before the optimized tables are initialized. -const char* StaticGetButtonName(int32_t func) -{ - for (auto& entry : gamefuncs) - if (entry.index == func) return entry.name; - return ""; -} - - //============================================================================= // @@ -133,12 +49,16 @@ const char* StaticGetButtonName(int32_t func) // //============================================================================= -ButtonMap::ButtonMap() +void ButtonMap::SetButtons(const char** names, int count) { - for(auto &gf : gamefuncs) + Buttons.Resize(count); + NumToName.Resize(count); + NameToNum.Clear(); + for(int i = 0; i < count; i++) { - NameToNum.Insert(gf.name, gf.index); - NumToName[gf.index] = gf.name; + Buttons[i] = {}; + NameToNum.Insert(names[i], i); + NumToName[i] = names[i]; } } @@ -153,18 +73,18 @@ int ButtonMap::ListActionCommands (const char *pattern) char matcher[32]; int count = 0; - for (int i = 0; i < NumButtons(); i++) + for (auto& btn : NumToName) { if (pattern == NULL || CheckWildcards (pattern, - (snprintf (matcher, countof(matcher), "+%s", NumToName[i].GetChars()), matcher))) + (mysnprintf (matcher, countof(matcher), "+%s", btn.GetChars()), matcher))) { - Printf ("+%s\n", NumToName[i].GetChars()); + Printf ("+%s\n", btn.GetChars()); count++; } if (pattern == NULL || CheckWildcards (pattern, - (snprintf (matcher, countof(matcher), "-%s", NumToName[i].GetChars()), matcher))) + (mysnprintf (matcher, countof(matcher), "-%s", btn.GetChars()), matcher))) { - Printf ("-%s\n", NumToName[i].GetChars()); + Printf ("-%s\n", btn.GetChars()); count++; } } @@ -178,11 +98,11 @@ int ButtonMap::ListActionCommands (const char *pattern) // //============================================================================= -int ButtonMap::FindButtonIndex (const char *key) const +int ButtonMap::FindButtonIndex (const char *key, int funclen) const { if (!key) return -1; - FName name(key, true); + FName name = funclen == -1? FName(key, true) : FName(key, funclen, true); if (name == NAME_None) return -1; auto res = NameToNum.CheckKey(name); @@ -214,10 +134,13 @@ void ButtonMap::ResetButtonTriggers () void ButtonMap::ResetButtonStates () { - for (auto &button : Buttons) + for (auto &btn : Buttons) { - button.ReleaseKey (0); - button.ResetTriggers (); + if (!btn.bReleaseLock) + { + btn.ReleaseKey (0); + } + btn.ResetTriggers (); } } @@ -316,3 +239,23 @@ bool FButtonStatus::ReleaseKey (int keynum) // Returns true if releasing this key caused the button to go up. return wasdown && !bDown; } + +//============================================================================= +// +// +// +//============================================================================= + +void ButtonMap::AddButtonTabCommands() +{ + // Add all the action commands for tab completion + for (auto& btn : NumToName) + { + char tname[16]; + strcpy (&tname[1], btn.GetChars()); + tname[0] = '+'; + C_AddTabCommand (tname); + tname[0] = '-'; + C_AddTabCommand (tname); + } +} diff --git a/source/core/console/c_buttons.h b/source/core/console/c_buttons.h index a80be688c..3567a8548 100644 --- a/source/core/console/c_buttons.h +++ b/source/core/console/c_buttons.h @@ -2,95 +2,8 @@ #include #include "tarray.h" -#include "zstring.h" #include "name.h" -// Order is that of EDuke32 by necessity because it exposes the key binds to scripting by index instead of by name. -enum GameFunction_t -{ - gamefunc_Move_Forward, - gamefunc_Move_Backward, - gamefunc_Turn_Left, - gamefunc_Turn_Right, - gamefunc_Strafe, - gamefunc_Fire, - gamefunc_Open, - gamefunc_Run, - gamefunc_Alt_Fire, // Duke3D, Blood - gamefunc_Jump, - gamefunc_Crouch, - gamefunc_Look_Up, - gamefunc_Look_Down, - gamefunc_Look_Left, - gamefunc_Look_Right, - gamefunc_Strafe_Left, - gamefunc_Strafe_Right, - gamefunc_Aim_Up, - gamefunc_Aim_Down, - gamefunc_Weapon_1, - gamefunc_Weapon_2, - gamefunc_Weapon_3, - gamefunc_Weapon_4, - gamefunc_Weapon_5, - gamefunc_Weapon_6, - gamefunc_Weapon_7, - gamefunc_Weapon_8, - gamefunc_Weapon_9, - gamefunc_Weapon_10, - gamefunc_Inventory, - gamefunc_Inventory_Use = gamefunc_Inventory, - gamefunc_Inventory_Left, - gamefunc_Inventory_Right, - gamefunc_Holo_Duke, // Duke3D, RR - gamefunc_Jetpack, - gamefunc_JumpBoots = gamefunc_Jetpack, - gamefunc_NightVision, - gamefunc_Night_Vision = gamefunc_NightVision, - gamefunc_BeastVision = gamefunc_NightVision, - gamefunc_MedKit, - gamefunc_Med_Kit = gamefunc_MedKit, - gamefunc_TurnAround, - gamefunc_SendMessage, - gamefunc_Map, - gamefunc_Map_Toggle = gamefunc_Map, - gamefunc_Shrink_Screen, - gamefunc_Enlarge_Screen, - gamefunc_Center_View, - gamefunc_Look_Straight = gamefunc_Center_View, - gamefunc_Holster_Weapon, - gamefunc_Show_Opponents_Weapon, - gamefunc_Map_Follow_Mode, - gamefunc_See_Coop_View, - gamefunc_See_Co_Op_View = gamefunc_See_Coop_View, - gamefunc_Mouse_Aiming, - gamefunc_Mouseview = gamefunc_Mouse_Aiming, - gamefunc_Toggle_Crosshair, - gamefunc_Steroids, - gamefunc_Quick_Kick, - gamefunc_Next_Weapon, - gamefunc_Previous_Weapon, - gamefunc_Show_DukeMatch_Scores, - gamefunc_Dpad_Select, - gamefunc_Dpad_Aiming, - gamefunc_Last_Weapon, - gamefunc_Alt_Weapon, - gamefunc_Third_Person_View, - gamefunc_See_Chase_View = gamefunc_Third_Person_View, - gamefunc_Toggle_Crouch, // This is the last one used by EDuke32. - gamefunc_CrystalBall, - gamefunc_ProximityBombs, - gamefunc_RemoteBombs, - gamefunc_Smoke_Bomb, // and these by ShadowWarrior (todo: There's quite a bit of potential for consolidation here - is it worth it?) - gamefunc_Gas_Bomb, - gamefunc_Flash_Bomb, - gamefunc_Caltrops, - - gamefunc_Zoom_In, // Map controls should not pollute the global button namespace. - gamefunc_Zoom_Out, - -}; - - // Actions struct FButtonStatus { @@ -100,6 +13,9 @@ struct FButtonStatus bool bDown; // Button is down right now bool bWentDown; // Button went down this tic bool bWentUp; // Button went up this tic + bool bReleaseLock; // Lock ReleaseKey call in ResetButtonStates + void (*PressHandler)(); // for optional game-side customization + void (*ReleaseHandler)(); bool PressKey (int keynum); // Returns true if this key caused the button to be pressed. bool ReleaseKey (int keynum); // Returns true if this key is no longer pressed. @@ -107,34 +23,38 @@ struct FButtonStatus void Reset () { bDown = bWentDown = bWentUp = false; } }; - class ButtonMap { - + TArray Buttons; TArray NumToName; // The internal name of the button TMap NameToNum; - + public: - ButtonMap(); void SetButtons(const char** names, int count); - - constexpr int NumButtons() const + + int NumButtons() const { return Buttons.Size(); } - int FindButtonIndex(const char* func) const; - - FButtonStatus *FindButton(const char *func) + int FindButtonIndex(const char* func, int funclen = -1) const; + + FButtonStatus* FindButton(const char* func, int funclen = -1) { - int index = FindButtonIndex(func); - return index > -1? &Buttons[index] : nullptr; + int index = FindButtonIndex(func, funclen); + return index > -1 ? &Buttons[index] : nullptr; } - void ResetButtonTriggers (); // Call ResetTriggers for all buttons - void ResetButtonStates (); // Same as above, but also clear bDown + FButtonStatus* GetButton(int index) + { + return &Buttons[index]; + } + + void ResetButtonTriggers(); // Call ResetTriggers for all buttons + void ResetButtonStates(); // Same as above, but also clear bDown int ListActionCommands(const char* pattern); + void AddButtonTabCommands(); bool ButtonDown(int x) const diff --git a/source/core/console/c_dispatch.cpp b/source/core/console/c_dispatch.cpp index 4ce262253..db1d6e25b 100644 --- a/source/core/console/c_dispatch.cpp +++ b/source/core/console/c_dispatch.cpp @@ -50,8 +50,6 @@ #include "c_cvars.h" #include "c_buttons.h" #include "findfile.h" -// Todo: Get rid of -#include "inputstate.h" // MACROS ------------------------------------------------------------------ @@ -173,7 +171,6 @@ FString StoredWarp; FConsoleCommand* Commands[FConsoleCommand::HASH_SIZE]; -CVAR (Bool, lookspring, true, CVAR_ARCHIVE); // Generate centerview when -mlook encountered? // PRIVATE DATA DEFINITIONS ------------------------------------------------ @@ -239,22 +236,18 @@ void C_DoCommand (const char *cmd, int keynum) // Check if this is an action if (*beg == '+' || *beg == '-') { - auto button = buttonMap.FindButton(beg + 1); - if (button) + auto button = buttonMap.FindButton(beg + 1, int(end - beg - 1)); + if (button != nullptr) { if (*beg == '+') { button->PressKey (keynum); + if (button->PressHandler) button->PressHandler(); } else { button->ReleaseKey (keynum); - /* - if (button == &Button_Mlook && lookspring) - { - Net_WriteByte (DEM_CENTERVIEW); - } - */ + if (button->ReleaseHandler) button->ReleaseHandler(); } return; } @@ -462,29 +455,9 @@ FConsoleCommand* FConsoleCommand::FindByName (const char* name) return FindNameInHashTable (Commands, name, strlen (name)); } -const char* StaticGetButtonName(int32_t func); - FConsoleCommand::FConsoleCommand (const char *name, CCmdRun runFunc) : m_RunFunc (runFunc) { - static bool firstTime = true; - - if (firstTime) - { - unsigned int i; - - firstTime = false; - - // Add all the action commands for tab completion - for (i = 0; i < buttonMap.NumButtons(); i++) - { - FString tname = "+"; tname << StaticGetButtonName(i); - C_AddTabCommand (tname); - tname.Substitute('+', '-'); - C_AddTabCommand (tname); - } - } - int ag = strcmp (name, "kill"); if (ag == 0) ag=0; diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index 26b2b04eb..a3af49e12 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -91,6 +91,7 @@ void I_SetWindowTitle(const char* caption); void InitENet(); void ShutdownENet(); bool AppActive; +int chatmodeon; // needed by the common console code. FString currentGame; FString LumpFilter; diff --git a/source/duke3d/src/duke3d.h b/source/duke3d/src/duke3d.h index 6ad871708..509568b7e 100644 --- a/source/duke3d/src/duke3d.h +++ b/source/duke3d/src/duke3d.h @@ -35,6 +35,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "menu/menu.h" #include "memarena.h" + + #ifdef EDUKE32_STANDALONE #define VOLUMEALL (1) #define PLUTOPAK (1) @@ -132,8 +134,72 @@ EDUKE32_STATIC_ASSERT(7 <= MAXTILES-MAXUSERTILES); BEGIN_DUKE_NS -static inline int32_t G_TileHasActor(int const tileNum) +// Order is that of EDuke32 by necessity because it exposes the key binds to scripting by index instead of by name. +enum GameFunction_t { + gamefunc_Move_Forward, + gamefunc_Move_Backward, + gamefunc_Turn_Left, + gamefunc_Turn_Right, + gamefunc_Strafe, + gamefunc_Fire, + gamefunc_Open, + gamefunc_Run, + gamefunc_Alt_Fire, // Duke3D, Blood + gamefunc_Jump, + gamefunc_Crouch, + gamefunc_Look_Up, + gamefunc_Look_Down, + gamefunc_Look_Left, + gamefunc_Look_Right, + gamefunc_Strafe_Left, + gamefunc_Strafe_Right, + gamefunc_Aim_Up, + gamefunc_Aim_Down, + gamefunc_Weapon_1, + gamefunc_Weapon_2, + gamefunc_Weapon_3, + gamefunc_Weapon_4, + gamefunc_Weapon_5, + gamefunc_Weapon_6, + gamefunc_Weapon_7, + gamefunc_Weapon_8, + gamefunc_Weapon_9, + gamefunc_Weapon_10, + gamefunc_Inventory, + gamefunc_Inventory_Left, + gamefunc_Inventory_Right, + gamefunc_Holo_Duke, // Duke3D, RR + gamefunc_Jetpack, + gamefunc_NightVision, + gamefunc_MedKit, + gamefunc_TurnAround, + gamefunc_SendMessage, + gamefunc_Map, + gamefunc_Shrink_Screen, + gamefunc_Enlarge_Screen, + gamefunc_Center_View, + gamefunc_Holster_Weapon, + gamefunc_Show_Opponents_Weapon, + gamefunc_Map_Follow_Mode, + gamefunc_See_Coop_View, + gamefunc_Mouse_Aiming, + gamefunc_Toggle_Crosshair, + gamefunc_Steroids, + gamefunc_Quick_Kick, + gamefunc_Next_Weapon, + gamefunc_Previous_Weapon, + gamefunc_Dpad_Select, + gamefunc_Dpad_Aiming, + gamefunc_Last_Weapon, + gamefunc_Alt_Weapon, + gamefunc_Third_Person_View, + gamefunc_Show_DukeMatch_Scores, + gamefunc_Toggle_Crouch, // This is the last one used by EDuke32. + NUM_ACTIONS +}; + +static inline int32_t G_TileHasActor(int const tileNum){ return g_tile[tileNum].execPtr!=NULL; } diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 44dbebec5..72c4ded98 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -5573,8 +5573,70 @@ EDUKE32_STATIC_ASSERT(sizeof(DukePlayer_t)%4 == 0); void app_loop(); +static const char* actions[] = { + "Move_Forward", + "Move_Backward", + "Turn_Left", + "Turn_Right", + "Strafe", + "Fire", + "Open", + "Run", + "Alt_Fire", // Duke3D", Blood + "Jump", + "Crouch", + "Look_Up", + "Look_Down", + "Look_Left", + "Look_Right", + "Strafe_Left", + "Strafe_Right", + "Aim_Up", + "Aim_Down", + "Weapon_1", + "Weapon_2", + "Weapon_3", + "Weapon_4", + "Weapon_5", + "Weapon_6", + "Weapon_7", + "Weapon_8", + "Weapon_9", + "Weapon_10", + "Inventory", + "Inventory_Left", + "Inventory_Right", + "Holo_Duke", // Duke3D", RR + "Jetpack", + "NightVision", + "MedKit", + "TurnAround", + "SendMessage", + "Map", + "Shrink_Screen", + "Enlarge_Screen", + "Center_View", + "Holster_Weapon", + "Show_Opponents_Weapon", + "Map_Follow_Mode", + "See_Coop_View", + "Mouse_Aiming", + "Toggle_Crosshair", + "Steroids", + "Quick_Kick", + "Next_Weapon", + "Previous_Weapon", + "Dpad_Select", + "Dpad_Aiming", + "Last_Weapon", + "Alt_Weapon", + "Third_Person_View", + "Show_DukeMatch_Scores", + "Toggle_Crouch", // This is the last one used by EDuke32. +}; int GameInterface::app_main() { + buttonMap.SetButtons(actions, NUM_ACTIONS); g_skillCnt = 4; ud.multimode = 1; ud.m_monsters_off = userConfig.nomonsters; diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 96d3628f1..a98a1b50e 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -4993,7 +4993,7 @@ repeatcase: scriptSkipSpaces(); - if (EDUKE32_PREDICT_FALSE((unsigned)j > NUMGAMEFUNCTIONS-1)) + if (EDUKE32_PREDICT_FALSE((unsigned)j > NUM_ACTIONS-1)) { Printf("%s:%d: error: function number exceeds number of game functions.\n", g_scriptFileName,g_lineNumber); @@ -5029,7 +5029,7 @@ repeatcase: g_scriptPtr--; j = *g_scriptPtr; - if (EDUKE32_PREDICT_FALSE((unsigned)j > NUMGAMEFUNCTIONS-1)) + if (EDUKE32_PREDICT_FALSE((unsigned)j > NUM_ACTIONS -1)) { Printf("%s:%d: error: function number exceeds number of game functions.\n", g_scriptFileName,g_lineNumber); diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 75cf810d2..ff941de1b 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -3722,7 +3722,7 @@ badindex: int const gameFunc = Gv_GetVar(*insptr++); int funcPos = Gv_GetVar(*insptr++); VM_ASSERT((unsigned)quoteIndex < MAXQUOTES, "invalid quote %d\n", quoteIndex); - VM_ASSERT((unsigned)gameFunc < NUMGAMEFUNCTIONS, "invalid function %d\n", gameFunc); + VM_ASSERT((unsigned)gameFunc < NUM_ACTIONS, "invalid function %d\n", gameFunc); auto bindings = Bindings.GetKeysForCommand(C_CON_GetButtonFunc(gameFunc)); if ((unsigned)funcPos >= bindings.Size()) funcPos = 0; @@ -3737,7 +3737,7 @@ badindex: int const gameFunc = Gv_GetVar(*insptr++); VM_ASSERT((unsigned)quoteIndex < MAXQUOTES, "invalid quote %d\n", quoteIndex); - VM_ASSERT((unsigned)gameFunc < NUMGAMEFUNCTIONS, "invalid function %d\n", gameFunc); + VM_ASSERT((unsigned)gameFunc < NUM_ACTIONS, "invalid function %d\n", gameFunc); auto binding = C_CON_GetBoundKeyForLastInput(gameFunc); if (binding.Len()) quoteMgr.FormatQuote(quoteIndex, "(%s)", binding.GetChars()); diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index 349d9f820..ac0967889 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -1796,6 +1796,63 @@ void CheckCommandLine(int argc, char const* const* argv, int &doTitle) } } +static const char* actions[] = +{ + "Move_Forward", + "Move_Backward", + "Turn_Left", + "Turn_Right", + "Strafe", + "Fire", + "Open", + "Run", + "Alt_Fire", // Duke3D", Blood + "Jump", + "Crouch", + "Look_Up", + "Look_Down", + "Look_Left", + "Look_Right", + "Strafe_Left", + "Strafe_Right", + "Aim_Up", + "Aim_Down", + "Weapon_1", + "Weapon_2", + "Weapon_3", + "Weapon_4", + "Weapon_5", + "Weapon_6", + "Weapon_7", + "Weapon_8", + "Weapon_9", + "Weapon_10", + "Inventory", + "Inventory_Left", + "Inventory_Right", + "TurnAround", + "SendMessage", + "Map", + "Shrink_Screen", + "Enlarge_Screen", + "Center_View", + "Holster_Weapon", + "Show_Opponents_Weapon", + "Map_Follow_Mode", + "See_Coop_View", + "Mouse_Aiming", + "Toggle_Crosshair", + "Next_Weapon", + "Previous_Weapon", + "Dpad_Select", + "Dpad_Aiming", + "Last_Weapon", + "Alt_Weapon", + "Third_Person_View", + "Toggle_Crouch", // This is the last one used by EDuke32. + "Zoom_In", // Map controls should not pollute the global button namespace. + "Zoom_Out", +}; int GameInterface::app_main() { @@ -1806,6 +1863,8 @@ int GameInterface::app_main() int stopTitle = kFalse; levelnew = 1; + buttonMap.SetButtons(actions, NUM_ACTIONS); + help_disabled = true; // Create the global level table. Parts of the engine need it, even though the game itself does not. for (int i = 0; i <= 32; i++) diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index 0319beb92..9ca41fc25 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -35,6 +35,67 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS +// Order is that of EDuke32 by necessity because it exposes the key binds to scripting by index instead of by name. +enum GameFunction_t +{ + gamefunc_Move_Forward, + gamefunc_Move_Backward, + gamefunc_Turn_Left, + gamefunc_Turn_Right, + gamefunc_Strafe, + gamefunc_Fire, + gamefunc_Open, + gamefunc_Run, + gamefunc_Alt_Fire, // Duke3D, Blood + gamefunc_Jump, + gamefunc_Crouch, + gamefunc_Look_Up, + gamefunc_Look_Down, + gamefunc_Look_Left, + gamefunc_Look_Right, + gamefunc_Strafe_Left, + gamefunc_Strafe_Right, + gamefunc_Aim_Up, + gamefunc_Aim_Down, + gamefunc_Weapon_1, + gamefunc_Weapon_2, + gamefunc_Weapon_3, + gamefunc_Weapon_4, + gamefunc_Weapon_5, + gamefunc_Weapon_6, + gamefunc_Weapon_7, + gamefunc_Weapon_8, + gamefunc_Weapon_9, + gamefunc_Weapon_10, + gamefunc_Inventory, + gamefunc_Inventory_Left, + gamefunc_Inventory_Right, + gamefunc_TurnAround, + gamefunc_SendMessage, + gamefunc_Map, + gamefunc_Shrink_Screen, + gamefunc_Enlarge_Screen, + gamefunc_Center_View, + gamefunc_Holster_Weapon, + gamefunc_Show_Opponents_Weapon, + gamefunc_Map_Follow_Mode, + gamefunc_See_Coop_View, + gamefunc_Mouse_Aiming, + gamefunc_Toggle_Crosshair, + gamefunc_Next_Weapon, + gamefunc_Previous_Weapon, + gamefunc_Dpad_Select, + gamefunc_Dpad_Aiming, + gamefunc_Last_Weapon, + gamefunc_Alt_Weapon, + gamefunc_Third_Person_View, + gamefunc_Toggle_Crouch, // This is the last one used by EDuke32. + gamefunc_Zoom_In, // Map controls should not pollute the global button namespace. + gamefunc_Zoom_Out, + NUM_ACTIONS, + +}; + #define kTimerTicks 120 #ifdef __WATCOMC__ diff --git a/source/rr/src/duke3d.h b/source/rr/src/duke3d.h index 6a33d2579..5297c50a7 100644 --- a/source/rr/src/duke3d.h +++ b/source/rr/src/duke3d.h @@ -132,6 +132,71 @@ END_RR_NS BEGIN_RR_NS +// Order is that of EDuke32 by necessity because it exposes the key binds to scripting by index instead of by name. +enum GameFunction_t +{ + gamefunc_Move_Forward, + gamefunc_Move_Backward, + gamefunc_Turn_Left, + gamefunc_Turn_Right, + gamefunc_Strafe, + gamefunc_Fire, + gamefunc_Open, + gamefunc_Run, + gamefunc_Alt_Fire, // Duke3D, Blood + gamefunc_Jump, + gamefunc_Crouch, + gamefunc_Look_Up, + gamefunc_Look_Down, + gamefunc_Look_Left, + gamefunc_Look_Right, + gamefunc_Strafe_Left, + gamefunc_Strafe_Right, + gamefunc_Aim_Up, + gamefunc_Aim_Down, + gamefunc_Weapon_1, + gamefunc_Weapon_2, + gamefunc_Weapon_3, + gamefunc_Weapon_4, + gamefunc_Weapon_5, + gamefunc_Weapon_6, + gamefunc_Weapon_7, + gamefunc_Weapon_8, + gamefunc_Weapon_9, + gamefunc_Weapon_10, + gamefunc_Inventory, + gamefunc_Inventory_Left, + gamefunc_Inventory_Right, + gamefunc_Holo_Duke, // Duke3D, RR + gamefunc_Jetpack, + gamefunc_NightVision, + gamefunc_MedKit, + gamefunc_TurnAround, + gamefunc_SendMessage, + gamefunc_Map, + gamefunc_Shrink_Screen, + gamefunc_Enlarge_Screen, + gamefunc_Center_View, + gamefunc_Holster_Weapon, + gamefunc_Show_Opponents_Weapon, + gamefunc_Map_Follow_Mode, + gamefunc_See_Coop_View, + gamefunc_Mouse_Aiming, + gamefunc_Toggle_Crosshair, + gamefunc_Steroids, + gamefunc_Quick_Kick, + gamefunc_Next_Weapon, + gamefunc_Previous_Weapon, + gamefunc_Dpad_Select, + gamefunc_Dpad_Aiming, + gamefunc_Last_Weapon, + gamefunc_Alt_Weapon, + gamefunc_Third_Person_View, + gamefunc_Show_DukeMatch_Scores, + gamefunc_Toggle_Crouch, // This is the last one used by EDuke32. + NUM_ACTIONS +}; + static inline int32_t G_HaveActor(int spriteNum) { return g_tile[spriteNum].execPtr!=NULL; diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index 8209162ea..921c4e0da 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -6957,9 +6957,72 @@ void app_loop(); EDUKE32_STATIC_ASSERT(sizeof(actor_t)%4 == 0); EDUKE32_STATIC_ASSERT(sizeof(DukePlayer_t)%4 == 0); +static const char* actions[] = { + "Move_Forward", + "Move_Backward", + "Turn_Left", + "Turn_Right", + "Strafe", + "Fire", + "Open", + "Run", + "Alt_Fire", // Duke3D", Blood + "Jump", + "Crouch", + "Look_Up", + "Look_Down", + "Look_Left", + "Look_Right", + "Strafe_Left", + "Strafe_Right", + "Aim_Up", + "Aim_Down", + "Weapon_1", + "Weapon_2", + "Weapon_3", + "Weapon_4", + "Weapon_5", + "Weapon_6", + "Weapon_7", + "Weapon_8", + "Weapon_9", + "Weapon_10", + "Inventory", + "Inventory_Left", + "Inventory_Right", + "Holo_Duke", // Duke3D", RR + "Jetpack", + "NightVision", + "MedKit", + "TurnAround", + "SendMessage", + "Map", + "Shrink_Screen", + "Enlarge_Screen", + "Center_View", + "Holster_Weapon", + "Show_Opponents_Weapon", + "Map_Follow_Mode", + "See_Coop_View", + "Mouse_Aiming", + "Toggle_Crosshair", + "Steroids", + "Quick_Kick", + "Next_Weapon", + "Previous_Weapon", + "Dpad_Select", + "Dpad_Aiming", + "Last_Weapon", + "Alt_Weapon", + "Third_Person_View", + "Show_DukeMatch_Scores", + "Toggle_Crouch", // This is the last one used by EDuke32. +}; + int GameInterface::app_main() { - playing_rr = 1; + buttonMap.SetButtons(actions, NUM_ACTIONS); + playing_rr = 1; g_skillCnt = 4; ud.multimode = 1; ud.m_monsters_off = userConfig.nomonsters; diff --git a/source/sw/src/demo.cpp b/source/sw/src/demo.cpp index ad04d15a4..d835b32f8 100644 --- a/source/sw/src/demo.cpp +++ b/source/sw/src/demo.cpp @@ -502,7 +502,7 @@ DemoPlayBack(void) } } - if (buttonMap.ButtonDown(gamefunc_See_Co_Op_View)) + if (buttonMap.ButtonDown(gamefunc_See_Coop_View)) { screenpeek += 1; if (screenpeek > numplayers-1) diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 59578033a..7a1819e7d 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -2672,6 +2672,68 @@ void CommandLineHelp(char const * const * argv) { } +static const char* actions[] = { + "Move_Forward", + "Move_Backward", + "Turn_Left", + "Turn_Right", + "Strafe", + "Fire", + "Open", + "Run", + "Alt_Fire", // Duke3D", Blood + "Jump", + "Crouch", + "Look_Up", + "Look_Down", + "Look_Left", + "Look_Right", + "Strafe_Left", + "Strafe_Right", + "Aim_Up", + "Aim_Down", + "Weapon_1", + "Weapon_2", + "Weapon_3", + "Weapon_4", + "Weapon_5", + "Weapon_6", + "Weapon_7", + "Weapon_8", + "Weapon_9", + "Weapon_10", + "Inventory", + "Inventory_Left", + "Inventory_Right", + "NightVision", + "MedKit", + "TurnAround", + "SendMessage", + "Map", + "Shrink_Screen", + "Enlarge_Screen", + "Center_View", + "Holster_Weapon", + "Show_Opponents_Weapon", + "Map_Follow_Mode", + "See_Coop_View", + "Mouse_Aiming", + "Toggle_Crosshair", + "Next_Weapon", + "Previous_Weapon", + "Dpad_Select", + "Dpad_Aiming", + "Last_Weapon", + "Alt_Weapon", + "Third_Person_View", + "Toggle_Crouch", // This is the last one used by EDuke32"", + "Smoke_Bomb", + "Gas_Bomb", + "Flash_Bomb", + "Caltrops", + +}; + int32_t GameInterface::app_main() { int i; @@ -2680,6 +2742,7 @@ int32_t GameInterface::app_main() void gameinput(void); int cnt = 0; + buttonMap.SetButtons(actions, NUM_ACTIONS); automapping = 1; BorderAdjust = true; SW_ExtInit(); @@ -3584,11 +3647,11 @@ void getinput(int const playerNum) inv_hotkey = 0; - if (buttonMap.ButtonDown(gamefunc_Med_Kit)) + if (buttonMap.ButtonDown(gamefunc_MedKit)) inv_hotkey = INVENTORY_MEDKIT+1; if (buttonMap.ButtonDown(gamefunc_Smoke_Bomb)) inv_hotkey = INVENTORY_CLOAK+1; - if (buttonMap.ButtonDown(gamefunc_Night_Vision)) + if (buttonMap.ButtonDown(gamefunc_NightVision)) inv_hotkey = INVENTORY_NIGHT_VISION+1; if (buttonMap.ButtonDown(gamefunc_Gas_Bomb)) inv_hotkey = INVENTORY_CHEMBOMB+1; @@ -3617,9 +3680,9 @@ void getinput(int const playerNum) if (gNet.MultiGameType == MULTI_GAME_COOPERATIVE) { - if (buttonMap.ButtonDown(gamefunc_See_Co_Op_View)) + if (buttonMap.ButtonDown(gamefunc_See_Coop_View)) { - buttonMap.ClearButton(gamefunc_See_Co_Op_View); + buttonMap.ClearButton(gamefunc_See_Coop_View); screenpeek = connectpoint2[screenpeek]; diff --git a/source/sw/src/game.h b/source/sw/src/game.h index 5c9cf5617..e7b53be7d 100644 --- a/source/sw/src/game.h +++ b/source/sw/src/game.h @@ -49,6 +49,69 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms BEGIN_SW_NS +enum GameFunction_t +{ + gamefunc_Move_Forward, + gamefunc_Move_Backward, + gamefunc_Turn_Left, + gamefunc_Turn_Right, + gamefunc_Strafe, + gamefunc_Fire, + gamefunc_Open, + gamefunc_Run, + gamefunc_Alt_Fire, // Duke3D, Blood + gamefunc_Jump, + gamefunc_Crouch, + gamefunc_Look_Up, + gamefunc_Look_Down, + gamefunc_Look_Left, + gamefunc_Look_Right, + gamefunc_Strafe_Left, + gamefunc_Strafe_Right, + gamefunc_Aim_Up, + gamefunc_Aim_Down, + gamefunc_Weapon_1, + gamefunc_Weapon_2, + gamefunc_Weapon_3, + gamefunc_Weapon_4, + gamefunc_Weapon_5, + gamefunc_Weapon_6, + gamefunc_Weapon_7, + gamefunc_Weapon_8, + gamefunc_Weapon_9, + gamefunc_Weapon_10, + gamefunc_Inventory, + gamefunc_Inventory_Left, + gamefunc_Inventory_Right, + gamefunc_NightVision, + gamefunc_MedKit, + gamefunc_TurnAround, + gamefunc_SendMessage, + gamefunc_Map, + gamefunc_Shrink_Screen, + gamefunc_Enlarge_Screen, + gamefunc_Center_View, + gamefunc_Holster_Weapon, + gamefunc_Show_Opponents_Weapon, + gamefunc_Map_Follow_Mode, + gamefunc_See_Coop_View, + gamefunc_Mouse_Aiming, + gamefunc_Toggle_Crosshair, + gamefunc_Next_Weapon, + gamefunc_Previous_Weapon, + gamefunc_Dpad_Select, + gamefunc_Dpad_Aiming, + gamefunc_Last_Weapon, + gamefunc_Alt_Weapon, + gamefunc_Third_Person_View, + gamefunc_Toggle_Crouch, // This is the last one used by EDuke32. + gamefunc_Smoke_Bomb, // and these by ShadowWarrior (todo: There's quite a bit of potential for consolidation here - is it worth it?) + gamefunc_Gas_Bomb, + gamefunc_Flash_Bomb, + gamefunc_Caltrops, + NUM_ACTIONS +}; + //#define SW_SHAREWARE 1 // This determines whether game is shareware compile or not! extern char isShareware; #define SW_SHAREWARE (isShareware)