- everything compiles again (not tested yet.)

This commit is contained in:
Christoph Oelckers 2019-10-26 00:32:49 +02:00
parent c3dc4f35be
commit cfaafcede7
81 changed files with 1626 additions and 2252 deletions

View file

@ -786,6 +786,7 @@ set (PCH_SOURCES
common/rts.cpp
common/gameconfigfile.cpp
common/gamecvars.cpp
common/gamecontrol.cpp
common/2d/v_2ddrawer.cpp
common/2d/v_draw.cpp

View file

@ -9,7 +9,7 @@ NBlood is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
This program is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@ -35,194 +35,17 @@ BEGIN_BLD_NS
#ifndef function_private_h_
#define function_private_h_
// KEEPINSYNC lunatic/con_lang.lua
char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] =
{
"Move_Forward",
"Move_Backward",
"Turn_Left",
"Turn_Right",
"Turn_Around",
"Strafe",
"Strafe_Left",
"Strafe_Right",
"Jump",
"Crouch",
"Run",
"AutoRun",
"Open",
"Weapon_Fire",
"Weapon_Special_Fire",
"Aim_Up",
"Aim_Down",
"Aim_Center",
"Look_Up",
"Look_Down",
"Tilt_Left",
"Tilt_Right",
"Weapon_1",
"Weapon_2",
"Weapon_3",
"Weapon_4",
"Weapon_5",
"Weapon_6",
"Weapon_7",
"Weapon_8",
"Weapon_9",
"Weapon_10",
"Inventory_Use",
"Inventory_Left",
"Inventory_Right",
"Map_Toggle",
"Map_Follow_Mode",
"Shrink_Screen",
"Enlarge_Screen",
"Send_Message",
"See_Coop_View",
"See_Chase_View",
"Mouse_Aiming",
"Toggle_Crosshair",
"Next_Weapon",
"Previous_Weapon",
"Holster_Weapon",
"Show_Opponents_Weapon",
"BeastVision",
"CrystalBall",
"JumpBoots",
"MedKit",
"ProximityBombs",
"RemoteBombs",
"Show_Console",
};
#ifdef __SETUP__
const char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] =
{
"W", "Kpad8",
"S", "Kpad2",
"Left", "Kpad4",
"Right", "KPad6",
"BakSpc", "",
"LAlt", "RAlt",
"A", "",
"D", "",
"Space", "/",
"LCtrl", "",
"LShift", "RShift",
"CapLck", "",
"E", "",
"RCtrl", "",
"X", "",
"Home", "KPad7",
"End", "Kpad1",
"KPad5", "",
"PgUp", "Kpad9",
"PgDn", "Kpad3",
"Insert", "Kpad0",
"Delete", "Kpad.",
"1", "",
"2", "",
"3", "",
"4", "",
"5", "",
"6", "",
"7", "",
"8", "",
"9", "",
"0", "",
"Enter", "KpdEnt",
"[", "",
"]", "",
"Tab", "",
"F", "",
"-", "Kpad-",
"=", "Kpad+",
"T", "",
"K", "",
"F7", "",
"U", "",
"I", "",
"'", "",
";", "",
"ScrLck", "",
"Y", "",
"B", "",
"C", "",
"J", "",
"M", "",
"P", "",
"R", "",
"`", "",
};
const char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] =
{
"Up", "Kpad8",
"Down", "Kpad2",
"Left", "Kpad4",
"Right", "KPad6",
"BakSpc", "",
"LAlt", "RAlt",
",", "",
".", "",
"A", "/",
"Z", "",
"LShift", "RShift",
"CapLck", "",
"Space", "",
"LCtrl", "RCtrl",
"X", "",
"Home", "KPad7",
"End", "Kpad1",
"KPad5", "",
"PgUp", "Kpad9",
"PgDn", "Kpad3",
"Insert", "Kpad0",
"Delete", "Kpad.",
"1", "",
"2", "",
"3", "",
"4", "",
"5", "",
"6", "",
"7", "",
"8", "",
"9", "",
"0", "",
"Enter", "KpdEnt",
"[", "",
"]", "",
"Tab", "",
"F", "",
"-", "Kpad-",
"=", "Kpad+",
"T", "",
"K", "",
"F7", "",
"U", "",
"I", "",
"'", "",
";", "",
"ScrLck", "",
"W", "",
"B", "",
"C", "",
"J", "",
"M", "",
"P", "",
"R", "",
"`", "",
};
static const char * mousedefaults[MAXMOUSEBUTTONS] =
{
"Weapon_Fire",
"Weapon_Special_Fire",
"",
"",
"Previous_Weapon",
"Next_Weapon",
"Weapon_Fire"
"Weapon_Special_Fire"
""
""
"Previous_Weapon"
"Next_Weapon"
};
@ -233,8 +56,8 @@ static const char * mouseclickeddefaults[MAXMOUSEBUTTONS] =
static const char * mouseanalogdefaults[MAXMOUSEAXES] =
{
"analog_turning",
"analog_moving",
"analog_turning"
"analog_moving"
};
@ -242,131 +65,74 @@ static const char * mousedigitaldefaults[MAXMOUSEDIGITAL] =
{
};
#if defined(GEKKO)
static const char * joystickdefaults[MAXJOYBUTTONSANDHATS] =
{
"Open", // A
"Fire", // B
"Run", // 1
"Map", // 2
"Previous_Weapon", // -
"Next_Weapon", // +
"", // Home
"Jump", // Z
"Crouch", // C
"Map", // X
"Run", // Y
"Jump", // L
"Quick_Kick", // R
"Crouch", // ZL
"Fire", // ZR
"Quick_Kick", // D-Pad Up
"Inventory_Right", // D-Pad Right
"Inventory", // D-Pad Down
"Inventory_Left", // D-Pad Left
"Fire"
"Strafe"
"Run"
"Open"
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
"Aim_Down"
"Look_Right"
"Aim_Up"
"Look_Left"
};
static const char * joystickclickeddefaults[MAXJOYBUTTONSANDHATS] =
{
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"Inventory",
""
"Inventory"
"Jump"
"Crouch"
};
static const char * joystickanalogdefaults[MAXJOYAXES] =
{
"analog_strafing",
"analog_moving",
"analog_turning",
"analog_lookingupanddown",
"analog_turning"
"analog_moving"
"analog_strafing"
};
static const char * joystickdigitaldefaults[MAXJOYDIGITAL] =
{
""
""
""
""
""
""
"Run"
};
#else
static const char * joystickdefaults[MAXJOYBUTTONSANDHATS] =
{
"Fire",
"Strafe",
"Run",
"Open",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"",
"Aim_Down",
"Look_Right",
"Aim_Up",
"Look_Left",
};
static const char * joystickclickeddefaults[MAXJOYBUTTONSANDHATS] =
{
"",
"Inventory",
"Jump",
"Crouch",
};
static const char * joystickanalogdefaults[MAXJOYAXES] =
{
"analog_turning",
"analog_moving",
"analog_strafing",
};
static const char * joystickdigitaldefaults[MAXJOYDIGITAL] =
{
"",
"",
"",
"",
"",
"",
"Run",
};
#endif
#endif
#endif

View file

@ -1524,18 +1524,6 @@ int app_main(int argc, char const * const * argv)
G_AddSearchPaths();
// used with binds for fast function lookup
hash_init(&h_gamefuncs);
for (bssize_t i=NUMGAMEFUNCTIONS-1; i>=0; i--)
{
if (gamefunctions[i][0] == '\0')
continue;
char *str = Bstrtolower(Xstrdup(gamefunctions[i]));
hash_add(&h_gamefuncs,gamefunctions[i],i,0);
hash_add(&h_gamefuncs,str,i,0);
Bfree(str);
}
#ifdef STARTUP_SETUP_WINDOW
int const readSetup =
@ -1574,7 +1562,7 @@ int app_main(int argc, char const * const * argv)
//Bsprintf(tempbuf, HEAD2 " %s", s_buildRev);
OSD_SetVersion("Blood", 10, 0);
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, gamefunctions[gamefunc_Show_Console][0] == '\0' ? OSD_PROTECTED : 0);
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
registerosdcommands();
char *const setupFileName = Xstrdup(SetupFilename);

View file

@ -32,7 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "hash.h"
#include "scriplib.h"
#include "renderlayer.h"
#include "function.h"
#include "gamecontrol.h"
#include "blood.h"
#include "config.h"
#include "gamedefs.h"
@ -55,8 +55,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
hashtable_t h_gamefuncs = { NUMGAMEFUNCTIONS<<1, NULL };
int32_t MouseFunctions[MAXMOUSEBUTTONS][2];
int32_t MouseDigitalFunctions[MAXMOUSEAXES][2];
int32_t MouseAnalogueAxes[MAXMOUSEAXES];
@ -67,7 +65,6 @@ int32_t JoystickAnalogueAxes[MAXJOYAXES];
int32_t JoystickAnalogueScale[MAXJOYAXES];
int32_t JoystickAnalogueDead[MAXJOYAXES];
int32_t JoystickAnalogueSaturate[MAXJOYAXES];
uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
int32_t scripthandle;
int32_t setupread;
int32_t mus_restartonload;
@ -99,34 +96,6 @@ int32_t gDeliriumBlur;
int gWeaponsV10x;
/////////
int32_t CONFIG_FunctionNameToNum(const char *func)
{
int32_t i;
if (!func)
return -1;
i = hash_find(&h_gamefuncs,func);
if (i < 0)
{
char *str = Bstrtolower(Xstrdup(func));
i = hash_find(&h_gamefuncs,str);
Bfree(str);
return i;
}
return i;
}
char *CONFIG_FunctionNumToName(int32_t func)
{
if ((unsigned)func >= (unsigned)NUMGAMEFUNCTIONS)
return NULL;
return gamefunctions[func];
}
int32_t CONFIG_AnalogNameToNum(const char *func)
@ -173,54 +142,6 @@ const char *CONFIG_AnalogNumToName(int32_t func)
}
void CONFIG_SetDefaultKeys(const char (*keyptr)[MAXGAMEFUNCLEN], bool lazy/*=false*/)
{
static char const s_gamefunc_[] = "gamefunc_";
int constexpr strlen_gamefunc_ = ARRAY_SIZE(s_gamefunc_) - 1;
if (!lazy)
{
Bmemset(KeyboardKeys, 0xff, sizeof(KeyboardKeys));
CONTROL_ClearAllBinds();
}
for (int i=0; i < ARRAY_SSIZE(gamefunctions); ++i)
{
if (gamefunctions[i][0] == '\0')
continue;
auto &key = KeyboardKeys[i];
int const default0 = KB_StringToScanCode(keyptr[i<<1]);
int const default1 = KB_StringToScanCode(keyptr[(i<<1)+1]);
// skip the function if the default key is already used
// or the function is assigned to another key
if (lazy && (key[0] != 0xff || (CONTROL_KeyIsBound(default0) && Bstrlen(CONTROL_KeyBinds[default0].cmdstr) > strlen_gamefunc_
&& CONFIG_FunctionNameToNum(CONTROL_KeyBinds[default0].cmdstr + strlen_gamefunc_) >= 0)))
{
#if 0 // defined(DEBUGGINGAIDS)
if (key[0] != 0xff)
initprintf("Skipping %s bound to %s\n", keyptr[i<<1], CONTROL_KeyBinds[default0].cmdstr);
#endif
continue;
}
key[0] = default0;
key[1] = default1;
if (key[0])
CONTROL_FreeKeyBind(key[0]);
if (key[1])
CONTROL_FreeKeyBind(key[1]);
if (i == gamefunc_Show_Console)
OSD_CaptureKey(key[0]);
else
CONFIG_MapKey(i, key[0], 0, key[1], 0);
}
}
void CONFIG_SetDefaults(void)
@ -333,7 +254,7 @@ void CONFIG_SetDefaults(void)
Bstrcpy(CommbatMacro[8], "Amateurs!");
Bstrcpy(CommbatMacro[9], "Fool! You are already dead.");
CONFIG_SetDefaultKeys(keydefaults);
CONFIG_SetDefaultKeys("demolition/defbinds.txt");
memset(MouseFunctions, -1, sizeof(MouseFunctions));
memset(MouseDigitalFunctions, -1, sizeof(MouseDigitalFunctions));
@ -388,54 +309,6 @@ void CONFIG_SetDefaults(void)
}
// wrapper for CONTROL_MapKey(), generates key bindings to reflect changes to keyboard setup
void CONFIG_MapKey(int which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2)
{
int const keys[] = { key1, key2, oldkey1, oldkey2 };
char buf[2*MAXGAMEFUNCLEN];
char tempbuf[128];
if (which == gamefunc_Show_Console)
OSD_CaptureKey(key1);
for (int k = 0; (unsigned)k < ARRAY_SIZE(keys); k++)
{
if (keys[k] == 0xff || !keys[k])
continue;
int match = 0;
for (; sctokeylut[match].key; match++)
{
if (keys[k] == sctokeylut[match].sc)
break;
}
tempbuf[0] = 0;
for (int i=NUMGAMEFUNCTIONS-1; i>=0; i--)
{
if (KeyboardKeys[i][0] == keys[k] || KeyboardKeys[i][1] == keys[k])
{
Bsprintf(buf, "gamefunc_%s; ", CONFIG_FunctionNumToName(i));
Bstrcat(tempbuf,buf);
}
}
int const len = Bstrlen(tempbuf);
if (len >= 2)
{
tempbuf[len-2] = 0; // cut off the trailing "; "
CONTROL_BindKey(keys[k], tempbuf, 1, sctokeylut[match].key ? sctokeylut[match].key : "<?>");
}
else
{
CONTROL_FreeKeyBind(keys[k]);
}
}
}
void CONFIG_SetupMouse(void)
{

View file

@ -25,12 +25,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#define config_public_h_
#include "keyboard.h"
#include "function.h"
#include "gamecontrol.h"
#include "control.h"
#include "_control.h"
#include "gamedefs.h"
#include "hash.h"
#include "gamecvars.h"
#include "gamecontrol.h"
BEGIN_BLD_NS
@ -49,7 +50,6 @@ extern int32_t JoystickAnalogueAxes[MAXJOYAXES];
extern int32_t JoystickAnalogueScale[MAXJOYAXES];
extern int32_t JoystickAnalogueDead[MAXJOYAXES];
extern int32_t JoystickAnalogueSaturate[MAXJOYAXES];
extern uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
extern int32_t scripthandle;
extern int32_t setupread;
extern int32_t configversion;
@ -72,7 +72,6 @@ extern int32_t gMouseSensitivity;
extern bool gNoClip;
extern bool gInfiniteAmmo;
extern bool gFullMap;
extern hashtable_t h_gamefuncs;
extern int32_t gUpscaleFactor;
extern int32_t gDeliriumBlur;
@ -85,19 +84,14 @@ void CONFIG_WriteSetup(uint32_t flags);
void CONFIG_SetDefaults(void);
void CONFIG_SetupMouse(void);
void CONFIG_SetupJoystick(void);
void CONFIG_SetDefaultKeys(const char (*keyptr)[MAXGAMEFUNCLEN], bool lazy=false);
int32_t CONFIG_GetMapBestTime(char const *mapname, uint8_t const *mapmd4);
int CONFIG_SetMapBestTime(uint8_t const *mapmd4, int32_t tm);
int32_t CONFIG_FunctionNameToNum(const char *func);
char * CONFIG_FunctionNumToName(int32_t func);
int32_t CONFIG_AnalogNameToNum(const char *func);
const char *CONFIG_AnalogNumToName(int32_t func);
void CONFIG_MapKey(int which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2);
END_BLD_NS
#endif

View file

@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "mouse.h"
#include "joystick.h"
#include "control.h"
#include "function.h"
#include "gamecontrol.h"
#include "common_game.h"
#include "blood.h"
#include "config.h"
@ -88,7 +88,6 @@ void ctrlInit(void)
CONTROL_DefineFlag(gamefunc_Move_Backward, false);
CONTROL_DefineFlag(gamefunc_Turn_Left, false);
CONTROL_DefineFlag(gamefunc_Turn_Right, false);
CONTROL_DefineFlag(gamefunc_Turn_Around, false);
CONTROL_DefineFlag(gamefunc_Strafe, false);
CONTROL_DefineFlag(gamefunc_Strafe_Left, false);
CONTROL_DefineFlag(gamefunc_Strafe_Right, false);
@ -97,16 +96,11 @@ void ctrlInit(void)
CONTROL_DefineFlag(gamefunc_Run, false);
CONTROL_DefineFlag(gamefunc_AutoRun, false);
CONTROL_DefineFlag(gamefunc_Open, false);
CONTROL_DefineFlag(gamefunc_Weapon_Fire, false);
CONTROL_DefineFlag(gamefunc_Weapon_Special_Fire, false);
CONTROL_DefineFlag(gamefunc_Aim_Up, false);
CONTROL_DefineFlag(gamefunc_Aim_Up, false);
CONTROL_DefineFlag(gamefunc_Aim_Down, false);
CONTROL_DefineFlag(gamefunc_Aim_Center, false);
CONTROL_DefineFlag(gamefunc_Look_Up, false);
CONTROL_DefineFlag(gamefunc_Look_Up, false);
CONTROL_DefineFlag(gamefunc_Look_Down, false);
CONTROL_DefineFlag(gamefunc_Tilt_Left, false);
CONTROL_DefineFlag(gamefunc_Tilt_Right, false);
CONTROL_DefineFlag(gamefunc_Weapon_1, false);
CONTROL_DefineFlag(gamefunc_Weapon_1, false);
CONTROL_DefineFlag(gamefunc_Weapon_2, false);
CONTROL_DefineFlag(gamefunc_Weapon_3, false);
CONTROL_DefineFlag(gamefunc_Weapon_4, false);
@ -116,15 +110,12 @@ void ctrlInit(void)
CONTROL_DefineFlag(gamefunc_Weapon_8, false);
CONTROL_DefineFlag(gamefunc_Weapon_9, false);
CONTROL_DefineFlag(gamefunc_Weapon_10, false);
CONTROL_DefineFlag(gamefunc_Inventory_Use, false);
CONTROL_DefineFlag(gamefunc_Inventory_Left, false);
CONTROL_DefineFlag(gamefunc_Inventory_Left, false);
CONTROL_DefineFlag(gamefunc_Inventory_Right, false);
CONTROL_DefineFlag(gamefunc_Map_Toggle, false);
CONTROL_DefineFlag(gamefunc_Map_Follow_Mode, false);
CONTROL_DefineFlag(gamefunc_Map_Follow_Mode, false);
CONTROL_DefineFlag(gamefunc_Shrink_Screen, false);
CONTROL_DefineFlag(gamefunc_Enlarge_Screen, false);
CONTROL_DefineFlag(gamefunc_Send_Message, false);
CONTROL_DefineFlag(gamefunc_See_Coop_View, false);
CONTROL_DefineFlag(gamefunc_See_Coop_View, false);
CONTROL_DefineFlag(gamefunc_See_Chase_View, false);
CONTROL_DefineFlag(gamefunc_Mouse_Aiming, false);
CONTROL_DefineFlag(gamefunc_Toggle_Crosshair, false);
@ -132,11 +123,20 @@ void ctrlInit(void)
CONTROL_DefineFlag(gamefunc_Previous_Weapon, false);
CONTROL_DefineFlag(gamefunc_Holster_Weapon, false);
CONTROL_DefineFlag(gamefunc_Show_Opponents_Weapon, false);
CONTROL_DefineFlag(gamefunc_BeastVision, false);
CONTROL_DefineFlag(gamefunc_CrystalBall, false);
CONTROL_DefineFlag(gamefunc_JumpBoots, false);
CONTROL_DefineFlag(gamefunc_MedKit, false);
CONTROL_DefineFlag(gamefunc_ProximityBombs, false);
CONTROL_DefineFlag(gamefunc_MedKit, false);
CONTROL_DefineFlag(gamefunc_Turn_Around, false);
CONTROL_DefineFlag(gamefunc_Weapon_Fire, false);
CONTROL_DefineFlag(gamefunc_Weapon_Special_Fire, false);
CONTROL_DefineFlag(gamefunc_Aim_Center, false);
CONTROL_DefineFlag(gamefunc_Tilt_Left, false);
CONTROL_DefineFlag(gamefunc_Tilt_Right, false);
CONTROL_DefineFlag(gamefunc_Inventory_Use, false);
CONTROL_DefineFlag(gamefunc_Map_Toggle, false);
CONTROL_DefineFlag(gamefunc_Send_Message, false);
CONTROL_DefineFlag(gamefunc_BeastVision, false);
CONTROL_DefineFlag(gamefunc_CrystalBall, false);
CONTROL_DefineFlag(gamefunc_JumpBoots, false);
CONTROL_DefineFlag(gamefunc_ProximityBombs, false);
CONTROL_DefineFlag(gamefunc_RemoteBombs, false);
}

View file

@ -1,106 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 2010-2019 EDuke32 developers and contributors
Copyright (C) 2019 Nuke.YKT
This file is part of NBlood.
NBlood is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
// function.h
// file created by makehead.exe
// these headers contain default key assignments, as well as
// default button assignments and game function names
// axis defaults are also included
#ifndef function_public_h_
#define function_public_h_
BEGIN_BLD_NS
#define NUMGAMEFUNCTIONS 55
#define MAXGAMEFUNCLEN 32
extern char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
extern const char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN];
extern const char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN];
enum GameFunction_t
{
gamefunc_Move_Forward,
gamefunc_Move_Backward,
gamefunc_Turn_Left,
gamefunc_Turn_Right,
gamefunc_Turn_Around,
gamefunc_Strafe,
gamefunc_Strafe_Left,
gamefunc_Strafe_Right,
gamefunc_Jump,
gamefunc_Crouch,
gamefunc_Run,
gamefunc_AutoRun,
gamefunc_Open,
gamefunc_Weapon_Fire,
gamefunc_Weapon_Special_Fire,
gamefunc_Aim_Up,
gamefunc_Aim_Down,
gamefunc_Aim_Center,
gamefunc_Look_Up,
gamefunc_Look_Down,
gamefunc_Tilt_Left,
gamefunc_Tilt_Right,
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_Use,
gamefunc_Inventory_Left,
gamefunc_Inventory_Right,
gamefunc_Map_Toggle,
gamefunc_Map_Follow_Mode,
gamefunc_Shrink_Screen,
gamefunc_Enlarge_Screen,
gamefunc_Send_Message,
gamefunc_See_Coop_View,
gamefunc_See_Chase_View,
gamefunc_Mouse_Aiming,
gamefunc_Toggle_Crosshair,
gamefunc_Next_Weapon,
gamefunc_Previous_Weapon,
gamefunc_Holster_Weapon,
gamefunc_Show_Opponents_Weapon,
gamefunc_BeastVision,
gamefunc_CrystalBall,
gamefunc_JumpBoots,
gamefunc_MedKit,
gamefunc_ProximityBombs,
gamefunc_RemoteBombs,
gamefunc_Show_Console,
};
END_BLD_NS
#endif

View file

@ -1127,7 +1127,6 @@ void CGameMenuItemKeyList::Scan(void)
bScan = true;
}
extern uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
void CGameMenuItemKeyList::Draw(void)
{
char buffer[40], buffer2[40];

View file

@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "ns.h" // Must come before everything else!
//#include "global.h"
//#include "game.h"
#include "function.h"
#include "gamecontrol.h"
#include "keyboard.h"
#include "mouse.h"
#include "joystick.h"

View file

@ -150,7 +150,7 @@ char zUserMapName[16];
const char *zEpisodeNames[6];
const char *zLevelNames[6][16];
static char MenuGameFuncs[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
static FString MenuGameFuncs[NUMGAMEFUNCTIONS];
static char const *MenuGameFuncNone = " -None-";
static char const *pzGamefuncsStrings[NUMGAMEFUNCTIONS + 1];
static int nGamefuncsValues[NUMGAMEFUNCTIONS + 1];
@ -1304,13 +1304,10 @@ void SetupMenus(void)
int k = 1;
for (int i = 0; i < NUMGAMEFUNCTIONS; ++i)
{
Bstrcpy(MenuGameFuncs[i], gamefunctions[i]);
MenuGameFuncs[i] = CONFIG_FunctionNumToName(i);
MenuGameFuncs[i].Substitute('_', ' ');
for (int j = 0; j < MAXGAMEFUNCLEN; ++j)
if (MenuGameFuncs[i][j] == '_')
MenuGameFuncs[i][j] = ' ';
if (gamefunctions[i][0] != '\0')
if (MenuGameFuncs[i][0] != '\0')
{
pzGamefuncsStrings[k] = MenuGameFuncs[i];
nGamefuncsValues[k] = i;
@ -1386,12 +1383,12 @@ void SetCenterHoriz(CGameMenuItemZBool *pItem)
void ResetKeys(CGameMenuItemChain *)
{
CONFIG_SetDefaultKeys(keydefaults);
CONFIG_SetDefaultKeys("demolition/defbinds.txt");
}
void ResetKeysClassic(CGameMenuItemChain *)
{
CONFIG_SetDefaultKeys(oldkeydefaults);
CONFIG_SetDefaultKeys("demolition/origbinds.txt");
}
////

View file

@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "keyboard.h"
#include "control.h"
#include "function.h"
#include "gamecontrol.h"
#include "common_game.h"
#include "blood.h"
#include "config.h"
@ -53,7 +53,6 @@ void sub_5A928(void)
CONTROL_ClearButton(i);
}
extern uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
void sub_5A944(char key)
{
for (int i = 0; i < NUMGAMEFUNCTIONS-1; i++)

View file

@ -476,20 +476,6 @@ void onvideomodechange(int32_t newmode)
UpdateDacs(gLastPal, false);
}
static int osdcmd_button(osdcmdptr_t parm)
{
static char const s_gamefunc_[] = "gamefunc_";
int constexpr strlen_gamefunc_ = ARRAY_SIZE(s_gamefunc_) - 1;
char const *p = parm->name + strlen_gamefunc_;
// if (g_player[myconnectindex].ps->gm == MODE_GAME) // only trigger these if in game
if (gInputMode == kInputGame)
CONTROL_ButtonFlags[CONFIG_FunctionNameToNum(p)] = 1; // FIXME
return OSDCMD_OK;
}
const char *const ConsoleButtons[] =
{
"mouse1", "mouse2", "mouse3", "mouse4", "mwheelup",
@ -631,7 +617,7 @@ static int osdcmd_bind(osdcmdptr_t parm)
{
KeyboardKeys[j][1] = KeyboardKeys[j][0];
KeyboardKeys[j][0] = sctokeylut[i].sc;
// CONTROL_MapKey(j, sctokeylut[i].sc, ud.config.KeyboardKeys[j][0]);
// CONTROL_MapKey(j, sctokeylut[i].sc, KeyboardKeys[j][0]);
if (j == gamefunc_Show_Console)
OSD_CaptureKey(sctokeylut[i].sc);
@ -769,8 +755,6 @@ static int osdcmd_inittimer(osdcmdptr_t parm)
int32_t registerosdcommands(void)
{
char buffer[256];
OSD_RegisterFunction("changelevel","changelevel <volume> <level>: warps to the given level", osdcmd_changelevel);
OSD_RegisterFunction("map","map <mapfile>: loads the given user map", osdcmd_map);
OSD_RegisterFunction("demo","demo <demofile or demonum>: starts the given demo", osdcmd_demo);
@ -781,22 +765,6 @@ int32_t registerosdcommands(void)
OSD_RegisterFunction("crosshaircolor","crosshaircolor: changes the crosshair color", osdcmd_crosshaircolor);
OSD_RegisterFunction("crosshairreset", "crosshairreset: restores the original crosshair", osdcmd_resetcrosshair);
for (auto & func : gamefunctions)
{
if (func[0] == '\0')
continue;
// if (!Bstrcmp(gamefunctions[i],"Show_Console")) continue;
Bsprintf(buffer, "gamefunc_%s", func);
char *const t = Bstrtolower(Xstrdup(buffer));
Bstrcat(buffer, ": game button");
OSD_RegisterFunction(t, Xstrdup(buffer), osdcmd_button);
}
OSD_RegisterFunction("give","give <all|health|weapons|ammo|armor|keys|inventory>: gives requested item", osdcmd_give);
OSD_RegisterFunction("god","god: toggles god mode", osdcmd_god);
// OSD_RegisterFunction("activatecheat","activatecheat <id>: activates a cheat code", osdcmd_activatecheat);

View file

@ -43,7 +43,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "compat.h"
#include "control.h"
#include "config.h"
//#include "function.h"
//#include "gamecontrol.h"
//#include "game.h"
//#include "grpscan.h"
//#include "inv.h"

View file

@ -38,6 +38,7 @@
#include <wctype.h>
#include "v_text.h"
#include "v_font.h"
#include "utf8.h"

View file

@ -0,0 +1,291 @@
#include "gamecontrol.h"
#include "tarray.h"
#include "zstring.h"
#include "name.h"
#include "control.h"
#include "keyboard.h"
#include "sc_man.h"
struct GameFuncNameDesc
{
int index;
const char *name;
};
static const GameFuncNameDesc 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, "TurnAround"},
{ gamefunc_SendMessage, "SendMessage"},
{ 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_Console, "Show_Console"},
{ gamefunc_Show_DukeMatch_Scores, "Show_DukeMatch_Scores"},
{ gamefunc_Dpad_Select, "Dpad_Select"},
{ gamefunc_Dpad_Aiming, "Dpad_Aiming"},
{ gamefunc_AutoRun, "AutoRun"},
{ gamefunc_Last_Weapon, "Last_Used_Weapon"},
{ gamefunc_Quick_Save, "Quick_Save"},
{ gamefunc_Quick_Load, "Quick_Load"},
{ gamefunc_Alt_Weapon, "Alternate_Weapon"}, // Name in RedNukem
{ gamefunc_Alt_Weapon, "Alt_Weapon"}, // Name in EDuke32
{ gamefunc_Third_Person_View, "Third_Person_View"},
{ gamefunc_Toggle_Crouch, "Toggle_Crouch"},
{ gamefunc_See_Chase_View, "See_Chase_View"}, // the following were added by Blood
{ gamefunc_Turn_Around, "Turn_Around"},
{ gamefunc_Weapon_Fire, "Weapon_Fire"},
{ gamefunc_Weapon_Special_Fire, "Weapon_Special_Fire"},
{ gamefunc_Aim_Center, "Aim_Center"},
{ gamefunc_Tilt_Left, "Tilt_Left"},
{ gamefunc_Tilt_Right, "Tilt_Right"},
{ gamefunc_Inventory_Use, "Inventory_Use"},
{ gamefunc_Map_Toggle, "Map_Toggle"},
{ gamefunc_Send_Message, "Send_Message"},
{ gamefunc_BeastVision, "BeastVision"},
{ gamefunc_CrystalBall, "CrystalBall"},
{ gamefunc_JumpBoots, "JumpBoots"},
{ gamefunc_ProximityBombs, "ProximityBombs"},
{ gamefunc_RemoteBombs, "RemoteBombs"},
};
static TMap<FName, int> GF_NameToNum;
static TArray<FString> GF_NumToName; // This one will preserve the original name for writing to the config (which must be loaded before CON scripts can hack around with the alias array.)
static TArray<FString> GF_NumToAlias; // This is for CON scripts to hack apart.
uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
static void InitNameToNum()
{
GF_NumToName.Resize(NUMGAMEFUNCTIONS);
GF_NumToAlias.Resize(NUMGAMEFUNCTIONS);
for(auto &gf : gamefuncs)
{
GF_NameToNum.Insert(gf.name, gf.index);
GF_NumToAlias[gf.index] = GF_NumToName[gf.index] = gf.name;
}
}
int32_t CONFIG_FunctionNameToNum(const char *func)
{
if (!func) return -1;
FName name(func, true);
if (name == NAME_None) return -1;
auto res = GF_NameToNum.CheckKey(name);
if (!res) return -1;
return *res;
}
const char *CONFIG_FunctionNumToName(int32_t func)
{
if ((unsigned)func >= (unsigned)NUMGAMEFUNCTIONS)
return NULL;
return GF_NumToAlias[func];
}
const char *CONFIG_FunctionNumToRealName(int32_t func)
{
if ((unsigned)func >= (unsigned)NUMGAMEFUNCTIONS)
return NULL;
return GF_NumToName[func];
}
void CONFIG_ReplaceButtonName(int num, const char *text)
{
if ((unsigned)num >= (unsigned)NUMGAMEFUNCTIONS)
return;
GF_NumToAlias[num] = text;
GF_NameToNum.Insert(text, num);
}
void CONFIG_DeleteButtonName(int num)
{
if ((unsigned)num >= (unsigned)NUMGAMEFUNCTIONS)
return;
GF_NumToAlias[num] = "";
}
// wrapper for CONTROL_MapKey(), generates key bindings to reflect changes to keyboard setup
void CONFIG_MapKey(int which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2)
{
int const keys[] = { key1, key2, oldkey1, oldkey2 };
if (which == gamefunc_Show_Console)
OSD_CaptureKey(key1);
for (int k = 0; (unsigned)k < ARRAY_SIZE(keys); k++)
{
if (keys[k] == 0xff || !keys[k])
continue;
int match = 0;
for (; sctokeylut[match].key; match++)
{
if (keys[k] == sctokeylut[match].sc)
break;
}
FString tempbuf;
for (int i = NUMGAMEFUNCTIONS - 1; i >= 0; i--)
{
if (KeyboardKeys[i][0] == keys[k] || KeyboardKeys[i][1] == keys[k])
{
tempbuf.AppendFormat("gamefunc_%s; ", CONFIG_FunctionNumToName(i));
}
}
auto len = tempbuf.Len();
if (len >= 2)
{
tempbuf.Truncate(len - 2); // cut off the trailing "; "
CONTROL_BindKey(keys[k], tempbuf, 1, sctokeylut[match].key ? sctokeylut[match].key : "<?>");
}
else
{
CONTROL_FreeKeyBind(keys[k]);
}
}
}
void CONFIG_SetDefaultKeys(const char *defbinds, bool lazy/*=false*/)
{
FScanner sc;
sc.Open(defbinds);
if (!lazy)
{
memset(KeyboardKeys, 0xff, sizeof(KeyboardKeys));
CONTROL_ClearAllBinds();
}
while (sc.GetToken())
{
sc.TokenMustBe(TK_StringConst);
int num = CONFIG_FunctionNameToNum(sc.String);
int default0 = -1;
int default1 = -1;
if (sc.CheckToken(','))
{
sc.MustGetToken(TK_StringConst);
default0 = KB_StringToScanCode(sc.String);
if (sc.CheckToken(','))
{
sc.MustGetToken(TK_StringConst);
default1 = KB_StringToScanCode(sc.String);
if (num >= 0 && num < NUMGAMEFUNCTIONS)
{
auto& key = KeyboardKeys[num];
#if 0
// skip the function if the default key is already used
// or the function is assigned to another key
if (lazy && (key[0] != 0xff || (CONTROL_KeyIsBound(default0) && Bstrlen(CONTROL_KeyBinds[default0].cmdstr) > strlen_gamefunc_
&& CONFIG_FunctionNameToNum(CONTROL_KeyBinds[default0].cmdstr + strlen_gamefunc_) >= 0)))
{
continue;
}
#endif
key[0] = default0;
key[1] = default1;
if (key[0]) CONTROL_FreeKeyBind(key[0]);
if (key[1]) CONTROL_FreeKeyBind(key[1]);
if (num == gamefunc_Show_Console)
OSD_CaptureKey(key[0]);
else
CONFIG_MapKey(num, key[0], 0, key[1], 0);
CONTROL_DefineFlag(num, false);
}
}
}
}
}
static int osdcmd_button(osdcmdptr_t parm)
{
static char const s_gamefunc_[] = "gamefunc_";
int constexpr strlen_gamefunc_ = ARRAY_SIZE(s_gamefunc_) - 1;
char const *p = parm->name + strlen_gamefunc_;
//if (gInputMode == kInputGame) // only trigger these if in game (fixme: Ensure it works for all games!)
CONTROL_ButtonFlags[CONFIG_FunctionNameToNum(p)] = 1; // FIXME
return OSDCMD_OK;
}
static FString stringStore[2*NUMGAMEFUNCTIONS]; // toss all persistent strings in here so that they stick around until shutdown.
void SetupButtonFunctions()
{
unsigned index = 0;
// Note: This must run after the CON scripts had a chance to mess around with the game function name array.
for (auto & func : GF_NumToAlias)
{
if (func[0] == '\0')
continue;
stringStore[index].Format("gamefunc_%s", func);
stringStore[index].ToLower();
stringStore[index+1] = stringStore[index];
stringStore[index+1] += ": game button";
OSD_RegisterFunction(stringStore[index], stringStore[index+1], osdcmd_button);
index += 2;
}
}

105
source/common/gamecontrol.h Normal file
View file

@ -0,0 +1,105 @@
#pragma once
#include "keyboard.h"
// Order is that of EDuke32 by necessity because it exposes this array to scripting.
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,
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,
gamefunc_Jetpack,
gamefunc_NightVision,
gamefunc_Night_Vision = gamefunc_NightVision,
gamefunc_MedKit,
gamefunc_Med_Kit = 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_See_Co_Op_View = gamefunc_See_Coop_View,
gamefunc_Mouse_Aiming,
gamefunc_Toggle_Crosshair,
gamefunc_Steroids,
gamefunc_Quick_Kick,
gamefunc_Next_Weapon,
gamefunc_Previous_Weapon,
gamefunc_Show_Console,
gamefunc_Show_DukeMatch_Scores,
gamefunc_Dpad_Select,
gamefunc_Dpad_Aiming,
gamefunc_AutoRun,
gamefunc_Last_Weapon,
gamefunc_Quick_Save,
gamefunc_Quick_Load,
gamefunc_Alt_Weapon,
gamefunc_Third_Person_View,
gamefunc_Toggle_Crouch,
gamefunc_See_Chase_View, // this was added by Blood
gamefunc_Turn_Around,
gamefunc_Weapon_Fire,
gamefunc_Weapon_Special_Fire,
gamefunc_Aim_Center,
gamefunc_Tilt_Left,
gamefunc_Tilt_Right,
gamefunc_Inventory_Use,
gamefunc_Map_Toggle,
gamefunc_Send_Message,
gamefunc_BeastVision,
gamefunc_CrystalBall,
gamefunc_JumpBoots,
gamefunc_ProximityBombs,
gamefunc_RemoteBombs,
gamefunc_Smoke_Bomb,
gamefunc_Gas_Bomb,
gamefunc_Flash_Bomb,
gamefunc_Caltrops,
NUMGAMEFUNCTIONS
};
extern uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
void CONFIG_SetDefaultKeys(const char *defbinds, bool lazy=false);
int32_t CONFIG_FunctionNameToNum(const char* func);
const char* CONFIG_FunctionNumToName(int32_t func);
const char* CONFIG_FunctionNumToRealName(int32_t func);
void CONFIG_ReplaceButtonName(int num, const char* text);
void CONFIG_DeleteButtonName(int num);
void CONFIG_MapKey(int which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2);

View file

@ -1395,9 +1395,15 @@ public:
{
}
BitArray(const BitArray & arr)
BitArray(unsigned elem)
: bytes((elem + 7) / 8, true)
{
}
BitArray(const BitArray & arr)
: bytes(arr.bytes)
{
bytes = arr.bytes;
size = arr.size;
}
@ -1409,8 +1415,8 @@ public:
}
BitArray(BitArray && arr)
: bytes(std::move(arr.bytes))
{
bytes = std::move(arr.bytes);
size = arr.size;
arr.size = 0;
}
@ -1428,9 +1434,10 @@ public:
return !!(bytes[index >> 3] & (1 << (index & 7)));
}
void Set(size_t index)
void Set(size_t index, bool set = true)
{
bytes[index >> 3] |= (1 << (index & 7));
if (!set) Clear(index);
else bytes[index >> 3] |= (1 << (index & 7));
}
void Clear(size_t index)

View file

@ -35,226 +35,8 @@ BEGIN_DUKE_NS
#ifndef function_private_h_
#define function_private_h_
// KEEPINSYNC lunatic/con_lang.lua
char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] =
{
"Move_Forward",
"Move_Backward",
"Turn_Left",
"Turn_Right",
"Strafe",
"Fire",
"Open",
"Run",
"Alt_Fire",
"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",
#ifndef EDUKE32_STANDALONE
"Holo_Duke",
"Jetpack",
"NightVision",
"MedKit",
#else
"",
"",
"",
"",
#endif
"TurnAround",
"SendMessage",
"Map",
"Shrink_Screen",
"Enlarge_Screen",
"Center_View",
"Holster_Weapon",
"Show_Opponents_Weapon",
"Map_Follow_Mode",
"See_Coop_View",
"Mouse_Aiming",
"Toggle_Crosshair",
#ifndef EDUKE32_STANDALONE
"Steroids",
"Quick_Kick",
#else
"",
"",
#endif
"Next_Weapon",
"Previous_Weapon",
"Show_Console",
#ifndef EDUKE32_STANDALONE
"Show_DukeMatch_Scores",
#else
"Show_Multiplayer_Scores",
#endif
"Dpad_Select",
"Dpad_Aiming",
"AutoRun",
"Last_Used_Weapon",
"Quick_Save",
"Quick_Load",
"Alt_Weapon",
"Third_Person_View",
"Toggle_Crouch",
};
#ifdef __SETUP__
const char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] =
{
"W", "Kpad8",
"S", "Kpad2",
"Left", "Kpad4",
"Right", "KPad6",
"LAlt", "RAlt",
"RCtrl", "",
"E", "",
"LShift", "RShift",
"", "",
"Space", "/",
"LCtrl", "",
"PgUp", "Kpad9",
"PgDn", "Kpad3",
"Insert", "Kpad0",
"Delete", "Kpad.",
"A", "",
"D", "",
"Home", "KPad7",
"End", "Kpad1",
"1", "",
"2", "",
"3", "",
"4", "",
"5", "",
"6", "",
"7", "",
"8", "",
"9", "",
"0", "",
"Enter", "KpdEnt",
"[", "",
"]", "",
"H", "",
"J", "",
"N", "",
"M", "",
"BakSpc", "",
"T", "",
"Tab", "",
"-", "Kpad-",
"=", "Kpad+",
"KPad5", "",
"ScrLck", "",
"Y", "",
"F", "",
"K", "",
"", "",
"", "",
"R", "",
"Q", "",
"'", "",
";", "",
"`", "",
"", "",
"", "",
"", "",
"CapLck", "",
"X", "",
"F6", "",
"F9", "",
"", "",
"F7", "",
"C", "",
};
const char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] =
{
"Up", "Kpad8",
"Down", "Kpad2",
"Left", "Kpad4",
"Right", "KPad6",
"LAlt", "RAlt",
"LCtrl", "RCtrl",
"Space", "",
"LShift", "RShift",
"", "",
"A", "/",
"Z", "",
"PgUp", "Kpad9",
"PgDn", "Kpad3",
"Insert", "Kpad0",
"Delete", "Kpad.",
",", "",
".", "",
"Home", "KPad7",
"End", "Kpad1",
"1", "",
"2", "",
"3", "",
"4", "",
"5", "",
"6", "",
"7", "",
"8", "",
"9", "",
"0", "",
"Enter", "KpdEnt",
"[", "",
"]", "",
"H", "",
"J", "",
"N", "",
"M", "",
"BakSpc", "",
"T", "",
"Tab", "",
"-", "Kpad-",
"=", "Kpad+",
"KPad5", "",
"ScrLck", "",
"W", "",
"F", "",
"K", "",
"U", "",
"I", "",
"R", "",
"`", "",
"'", "",
";", "",
"C", "",
"", "",
"", "",
"", "",
"CapLck", "",
"", "",
"F6", "",
"F9", "",
"", "",
"F7", "",
"", "",
};
static const char * mousedefaults[MAXMOUSEBUTTONS] =
{
"Fire",

View file

@ -42,26 +42,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_DUKE_NS
hashtable_t h_gamefuncs = { NUMGAMEFUNCTIONS<<1, NULL };
int32_t CONFIG_FunctionNameToNum(const char *func)
{
if (!func)
return -1;
return hash_findcase(&h_gamefuncs, func);
}
static char const * CONFIG_FunctionNumToName(int32_t func)
{
if ((unsigned)func >= (unsigned)NUMGAMEFUNCTIONS)
return "";
return gamefunctions[func];
}
int32_t CONFIG_AnalogNameToNum(const char *func)
{
if (!func)
@ -130,56 +110,6 @@ static void CONFIG_SetJoystickAnalogAxisFunction(int i, int function)
}
void CONFIG_SetDefaultKeys(const char (*keyptr)[MAXGAMEFUNCLEN], bool lazy/*=false*/)
{
static char const s_gamefunc_[] = "gamefunc_";
int constexpr strlen_gamefunc_ = ARRAY_SIZE(s_gamefunc_) - 1;
if (!lazy)
{
Bmemset(ud.config.KeyboardKeys, 0xff, sizeof(ud.config.KeyboardKeys));
CONTROL_ClearAllBinds();
}
for (int i=0; i < ARRAY_SSIZE(gamefunctions); ++i)
{
if (gamefunctions[i][0] == '\0')
continue;
auto &key = ud.config.KeyboardKeys[i];
int const default0 = KB_StringToScanCode(keyptr[i<<1]);
int const default1 = KB_StringToScanCode(keyptr[(i<<1)+1]);
// skip the function if the default key is already used
// or the function is assigned to another key
if (lazy && (key[0] != 0xff || (CONTROL_KeyIsBound(default0) && Bstrlen(CONTROL_KeyBinds[default0].cmdstr) > strlen_gamefunc_
&& CONFIG_FunctionNameToNum(CONTROL_KeyBinds[default0].cmdstr + strlen_gamefunc_) >= 0)))
{
#if 0 // defined(DEBUGGINGAIDS)
if (key[0] != 0xff)
initprintf("Skipping %s bound to %s\n", keyptr[i<<1], CONTROL_KeyBinds[default0].cmdstr);
#endif
continue;
}
key[0] = default0;
key[1] = default1;
if (key[0])
CONTROL_FreeKeyBind(key[0]);
if (key[1])
CONTROL_FreeKeyBind(key[1]);
if (i == gamefunc_Show_Console)
OSD_CaptureKey(key[0]);
else
CONFIG_MapKey(i, key[0], 0, key[1], 0);
}
}
void CONFIG_SetDefaults(void)
{
ud.config.scripthandle = -1;
@ -285,7 +215,7 @@ void CONFIG_SetDefaults(void)
Bstrcpy(ud.ridecule[9], "AARRRGHHHHH!!!");
#endif
CONFIG_SetDefaultKeys(keydefaults);
CONFIG_SetDefaultKeys("demolition/defbinds.txt");
memset(ud.config.MouseFunctions, -1, sizeof(ud.config.MouseFunctions));
memset(ud.config.MouseDigitalFunctions, -1, sizeof(ud.config.MouseDigitalFunctions));
@ -349,52 +279,6 @@ void CONFIG_SetDefaults(void)
}
// wrapper for CONTROL_MapKey(), generates key bindings to reflect changes to keyboard setup
void CONFIG_MapKey(int which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2)
{
int const keys[] = { key1, key2, oldkey1, oldkey2 };
char buf[2*MAXGAMEFUNCLEN];
if (which == gamefunc_Show_Console)
OSD_CaptureKey(key1);
for (int k = 0; (unsigned)k < ARRAY_SIZE(keys); k++)
{
if (keys[k] == 0xff || !keys[k])
continue;
int match = 0;
for (; match < ARRAY_SSIZE(sctokeylut); ++match)
{
if (keys[k] == sctokeylut[match].sc)
break;
}
tempbuf[0] = 0;
for (int i=NUMGAMEFUNCTIONS-1; i>=0; i--)
{
if (ud.config.KeyboardKeys[i][0] == keys[k] || ud.config.KeyboardKeys[i][1] == keys[k])
{
Bsprintf(buf, "gamefunc_%s; ", CONFIG_FunctionNumToName(i));
Bstrcat(tempbuf,buf);
}
}
int const len = Bstrlen(tempbuf);
if (len >= 2)
{
tempbuf[len-2] = 0; // cut off the trailing "; "
CONTROL_BindKey(keys[k], tempbuf, 1, sctokeylut[match].key ? sctokeylut[match].key : "<?>");
}
else
{
CONTROL_FreeKeyBind(keys[k]);
}
}
}
void CONFIG_SetupMouse(void)
@ -866,7 +750,7 @@ void CONFIG_WriteSettings(void) // save binds and aliases to <cfgname>_settings.
for (int i=0; i<NUMGAMEFUNCTIONS; ++i)
{
char const * name = CONFIG_FunctionNumToName(i);
if (name && name[0] != '\0' && (ud.config.KeyboardKeys[i][0] == 0xff || !ud.config.KeyboardKeys[i][0]))
if (name && name[0] != '\0' && (KeyboardKeys[i][0] == 0xff || !KeyboardKeys[i][0]))
{
buildvfs_fputstr(fp, "unbound ");
buildvfs_fputstrptr(fp, name);
@ -1069,8 +953,8 @@ void CONFIG_WriteSetup(uint32_t flags)
char const * CONFIG_GetGameFuncOnKeyboard(int gameFunc)
{
const char * string0 = KB_ScanCodeToString(ud.config.KeyboardKeys[gameFunc][0]);
return string0[0] == '\0' ? KB_ScanCodeToString(ud.config.KeyboardKeys[gameFunc][1]) : string0;
const char * string0 = KB_ScanCodeToString(KeyboardKeys[gameFunc][0]);
return string0[0] == '\0' ? KB_ScanCodeToString(KeyboardKeys[gameFunc][1]) : string0;
}
char const * CONFIG_GetGameFuncOnMouse(int gameFunc)

View file

@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef config_public_h_
#define config_public_h_
#include "function.h"
#include "gamecontrol.h"
BEGIN_DUKE_NS
@ -33,7 +33,6 @@ void CONFIG_WriteSetup(uint32_t flags);
void CONFIG_SetDefaults(void);
void CONFIG_SetupMouse(void);
void CONFIG_SetupJoystick(void);
void CONFIG_SetDefaultKeys(const char (*keyptr)[MAXGAMEFUNCLEN], bool lazy=false);
void CONFIG_SetGameControllerDefaultsStandard(void);
void CONFIG_SetGameControllerDefaultsPro(void);
@ -42,12 +41,8 @@ void CONFIG_SetGameControllerDefaultsClear(void);
int32_t CONFIG_GetMapBestTime(char const *mapname, uint8_t const *mapmd4);
int CONFIG_SetMapBestTime(uint8_t const *mapmd4, int32_t tm);
int32_t CONFIG_FunctionNameToNum(const char *func);
int32_t CONFIG_AnalogNameToNum(const char *func);
void CONFIG_MapKey(int which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2);
const char * CONFIG_GetGameFuncOnKeyboard(int gameFunc);
const char * CONFIG_GetGameFuncOnJoystick(int gameFunc);

View file

@ -113,7 +113,7 @@ EDUKE32_STATIC_ASSERT(7 <= MAXTILES-MAXUSERTILES);
#include "common_game.h"
#include "config.h"
#include "control.h"
#include "function.h"
#include "gamecontrol.h"
#include "game.h"
#include "gamedef.h"
#include "gamedefs.h"

View file

@ -1,112 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 2010 EDuke32 developers and contributors
This file is part of EDuke32.
EDuke32 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
// function.h
// file created by makehead.exe
// these headers contain default key assignments, as well as
// default button assignments and game function names
// axis defaults are also included
#ifndef function_public_h_
#define function_public_h_
BEGIN_DUKE_NS
#define NUMGAMEFUNCTIONS 63
#define MAXGAMEFUNCLEN 32
extern char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
extern const char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN];
extern const char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN];
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,
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,
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_Show_Console,
gamefunc_Show_DukeMatch_Scores,
gamefunc_Dpad_Select,
gamefunc_Dpad_Aiming,
gamefunc_AutoRun,
gamefunc_Last_Weapon,
gamefunc_Quick_Save,
gamefunc_Quick_Load,
gamefunc_Alt_Weapon,
gamefunc_Third_Person_View,
gamefunc_Toggle_Crouch,
};
END_DUKE_NS
#endif

View file

@ -5778,7 +5778,6 @@ static void G_Cleanup(void)
hash_free(&h_gamevars);
hash_free(&h_arrays);
hash_free(&h_labels);
hash_free(&h_gamefuncs);
#endif
hash_loop(&h_dukeanim, G_FreeHashAnim);
@ -6341,16 +6340,6 @@ int app_main(int argc, const char * const*argv)
if (forcegl) initprintf("GL driver blacklist disabled.\n");
#endif
// used with binds for fast function lookup
hash_init(&h_gamefuncs);
for (bssize_t i=NUMGAMEFUNCTIONS-1; i>=0; i--)
{
if (gamefunctions[i][0] == '\0')
continue;
hash_add(&h_gamefuncs,gamefunctions[i],i,0);
}
#ifdef STARTUP_SETUP_WINDOW
int const readSetup =
#endif
@ -6516,7 +6505,7 @@ int app_main(int argc, const char * const*argv)
Bsprintf(tempbuf, HEAD2 " %s", s_buildRev);
OSD_SetVersion(tempbuf, 10,0);
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, /*gamefunctions[gamefunc_Show_Console][0] == '\0' ? OSD_PROTECTED :*/ 0);
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
registerosdcommands();
if (g_networkMode != NET_DEDICATED_SERVER)
@ -6563,7 +6552,7 @@ int app_main(int argc, const char * const*argv)
OSD_Exec(tempbuf);
OSD_Exec("autoexec.cfg");
CONFIG_SetDefaultKeys(keydefaults, true);
//CONFIG_SetDefaultKeys("demolition/defbinds.txt", true);
system_getcvars();

View file

@ -232,7 +232,6 @@ typedef struct {
int32_t JoystickAnalogueInvert[MAXJOYAXES];
int32_t JoystickAnalogueDead[MAXJOYAXES];
int32_t JoystickAnalogueSaturate[MAXJOYAXES];
uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
int32_t scripthandle;
int32_t setupread;

View file

@ -2039,92 +2039,6 @@ void C_DefineMusic(int volumeNum, int levelNum, const char *fileName)
check_filename_case(pMapInfo->musicfn);
}
#ifdef LUNATIC
void C_DefineSound(int32_t sndidx, const char *fn, int32_t args[5])
{
Bassert((unsigned)sndidx < MAXSOUNDS);
{
sound_t *const snd = &g_sounds[sndidx];
Xfree(snd->filename);
snd->filename = dup_filename(fn);
check_filename_case(snd->filename);
snd->ps = args[0];
snd->pe = args[1];
snd->pr = args[2];
snd->m = args[3] & ~SF_ONEINST_INTERNAL;
if (args[3] & SF_LOOP)
snd->m |= SF_ONEINST_INTERNAL;
snd->vo = args[4];
if (sndidx > g_highestSoundIdx)
g_highestSoundIdx = sndidx;
}
}
void C_DefineQuote(int32_t qnum, const char *qstr)
{
C_AllocQuote(qnum);
Bstrncpyz(apStrings[qnum], qstr, MAXQUOTELEN);
}
void C_DefineVolumeName(int32_t vol, const char *name)
{
Bassert((unsigned)vol < MAXVOLUMES);
Bstrncpyz(g_volumeNames[vol], name, sizeof(g_volumeNames[vol]));
g_volumeCnt = vol+1;
}
void C_DefineSkillName(int32_t skill, const char *name)
{
Bassert((unsigned)skill < MAXSKILLS);
Bstrncpyz(g_skillNames[skill], name, sizeof(g_skillNames[skill]));
g_skillCnt = max(g_skillCnt, skill+1); // TODO: bring in line with C-CON?
}
void C_DefineLevelName(int32_t vol, int32_t lev, const char *fn,
int32_t partime, int32_t designertime,
const char *levelname)
{
Bassert((unsigned)vol < MAXVOLUMES);
Bassert((unsigned)lev < MAXLEVELS);
{
map_t *const map = &g_mapInfo[(MAXLEVELS*vol)+lev];
Xfree(map->filename);
map->filename = dup_filename(fn);
// TODO: truncate to 32 chars?
Xfree(map->name);
map->name = Xstrdup(levelname);
map->partime = REALGAMETICSPERSEC * partime;
map->designertime = REALGAMETICSPERSEC * designertime;
}
}
void C_DefineGameFuncName(int32_t idx, const char *name)
{
assert((unsigned)idx < NUMGAMEFUNCTIONS);
Bstrncpyz(gamefunctions[idx], name, MAXGAMEFUNCLEN);
hash_add(&h_gamefuncs, gamefunctions[idx], idx, 0);
}
void C_DefineGameType(int32_t idx, int32_t flags, const char *name)
{
Bassert((unsigned)idx < MAXGAMETYPES);
g_gametypeFlags[idx] = flags;
Bstrncpyz(g_gametypeNames[idx], name, sizeof(g_gametypeNames[idx]));
g_gametypeCnt = idx+1;
}
#endif
void C_DefineVolumeFlags(int32_t vol, int32_t flags)
{
Bassert((unsigned)vol < MAXVOLUMES);
@ -2296,7 +2210,8 @@ void C_InitQuotes(void)
#ifdef EDUKE32_TOUCH_DEVICES
apStrings[QUOTE_DEAD] = 0;
#else
char const * const OpenGameFunc = gamefunctions[gamefunc_Open];
// WTF ?!?
char const * const OpenGameFunc = CONFIG_FunctionNumToName(gamefunc_Open);
C_ReplaceQuoteSubstring(QUOTE_DEAD, "SPACE", OpenGameFunc);
C_ReplaceQuoteSubstring(QUOTE_DEAD, "OPEN", OpenGameFunc);
C_ReplaceQuoteSubstring(QUOTE_DEAD, "USE", OpenGameFunc);
@ -5218,33 +5133,24 @@ repeatcase:
}
i = 0;
hash_delete(&h_gamefuncs, gamefunctions[j]);
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0)
{
gamefunctions[j][i] = *textptr;
textptr++,i++;
if (EDUKE32_PREDICT_FALSE(*textptr != 0x0a && *textptr != 0x0d && ispecial(*textptr)))
{
initprintf("%s:%d: warning: invalid character in function name.\n",
g_scriptFileName,g_lineNumber);
g_warningCnt++;
scriptSkipLine();
break;
}
if (EDUKE32_PREDICT_FALSE(i >= MAXGAMEFUNCLEN-1))
{
initprintf("%s:%d: warning: truncating function name to %d characters.\n",
g_scriptFileName,g_lineNumber,MAXGAMEFUNCLEN);
g_warningCnt++;
scriptSkipLine();
break;
}
}
gamefunctions[j][i] = '\0';
hash_add(&h_gamefuncs,gamefunctions[j],j,0);
{
TArray<char> build;
while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0)
{
build.Push(*textptr);
textptr++, i++;
if (EDUKE32_PREDICT_FALSE(*textptr != 0x0a && *textptr != 0x0d && ispecial(*textptr)))
{
initprintf("%s:%d: warning: invalid character in function name.\n",
g_scriptFileName, g_lineNumber);
g_warningCnt++;
scriptSkipLine();
break;
}
}
build.Push(0);
CONFIG_ReplaceButtonName(j, build.Data());
}
continue;
case CON_UNDEFINEGAMEFUNC:
@ -5262,10 +5168,7 @@ repeatcase:
continue;
}
hash_delete(&h_gamefuncs, gamefunctions[j]);
gamefunctions[j][0] = '\0';
CONFIG_DeleteButtonName(j);
continue;
case CON_DEFINESKILLNAME:
@ -5996,25 +5899,6 @@ static void C_AddDefaultDefinitions(void)
for (int i=0; i<MAXEVENTS; i++)
C_AddDefinition(EventNames[i], i, LABEL_DEFINE|LABEL_EVENT);
#if 0
for (int i=0; i<NUMGAMEFUNCTIONS; i++)
{
int32_t j;
if (gamefunctions[i][0] == '\0')
continue;
// if (!Bstrcmp(gamefunctions[i],"Show_Console")) continue;
j = Bsprintf(tempbuf,"GAMEFUNC_%s", gamefunctions[i]);
for (; j>=0; j--)
tempbuf[j] = Btoupper(tempbuf[j]);
C_AddDefinition(tempbuf, i, LABEL_DEFINE);
}
#endif
static tokenmap_t predefined[] =
{
{ "CLIPMASK0", CLIPMASK0 },

View file

@ -83,8 +83,6 @@ extern intptr_t const * insptr;
void VM_ScriptInfo(intptr_t const * const ptr, int const range);
#endif
extern hashtable_t h_gamefuncs;
extern hashtable_t h_gamevars;
extern hashtable_t h_arrays;
extern hashtable_t h_labels;
@ -552,7 +550,7 @@ enum UserdefsLabel_t
USERDEFS_M_ORIGIN_Y,
USERDEFS_PLAYERBEST,
USERDEFS_MUSICTOGGLE,
USERDEF_USEVOXELS,
USERDEFS_USEVOXELS,
USERDEFS_USEHIGHTILE,
USERDEFS_USEMODELS,
USERDEFS_GAMETYPEFLAGS,

View file

@ -3655,13 +3655,13 @@ badindex:
VM_ASSERT((unsigned)gameFunc < NUMGAMEFUNCTIONS, "invalid function %d\n", gameFunc);
if (funcPos < 2)
Bstrcpy(tempbuf, KB_ScanCodeToString(ud.config.KeyboardKeys[gameFunc][funcPos]));
Bstrcpy(tempbuf, KB_ScanCodeToString(KeyboardKeys[gameFunc][funcPos]));
else
{
Bstrcpy(tempbuf, KB_ScanCodeToString(ud.config.KeyboardKeys[gameFunc][0]));
Bstrcpy(tempbuf, KB_ScanCodeToString(KeyboardKeys[gameFunc][0]));
if (!*tempbuf)
Bstrcpy(tempbuf, KB_ScanCodeToString(ud.config.KeyboardKeys[gameFunc][1]));
Bstrcpy(tempbuf, KB_ScanCodeToString(KeyboardKeys[gameFunc][1]));
}
if (*tempbuf)

View file

@ -1476,7 +1476,7 @@ int32_t __fastcall VM_GetUserdef(int32_t labelNum, int const lParm2)
case USERDEFS_M_ORIGIN_Y: labelNum = ud.returnvar[1]; break;
case USERDEFS_PLAYERBEST: labelNum = ud.playerbest; break;
case USERDEFS_MUSICTOGGLE: labelNum = mus_enabled; break;
case USERDEF_USEVOXELS: labelNum = r_voxels; break;
case USERDEFS_USEVOXELS: labelNum = r_voxels; break;
case USERDEFS_USEHIGHTILE: labelNum = hw_hightile; break;
case USERDEFS_USEMODELS: labelNum = hw_models; break;
case USERDEFS_GAMETYPEFLAGS: labelNum = g_gametypeFlags[ud.coop]; break;

View file

@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "global.h"
#include "game.h"
#include "function.h"
#include "gamecontrol.h"
#include "keyboard.h"
#include "mouse.h"
#include "joystick.h"

View file

@ -32,6 +32,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "savegame.h"
#include "xxhash.h"
#include "gamecvars.h"
#include "gamecontrol.h"
#include "../../glbackend/glbackend.h"
BEGIN_DUKE_NS
@ -260,7 +261,7 @@ static char const *MEOSN_YesNo[] = { "Yes", "No", };
static MenuOptionSet_t MEOS_YesNo = MAKE_MENUOPTIONSET( MEOSN_YesNo, NULL, 0x3 );
static char MenuGameFuncs[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
static FString MenuGameFuncs[NUMGAMEFUNCTIONS];
static char const *MenuGameFuncNone = " -None-";
static char const *MEOSN_Gamefuncs[NUMGAMEFUNCTIONS+1];
static int32_t MEOSV_Gamefuncs[NUMGAMEFUNCTIONS+1];
@ -1672,15 +1673,12 @@ void Menu_Init(void)
k = 1;
for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
{
Bstrcpy(MenuGameFuncs[i], gamefunctions[i]);
MenuGameFuncs[i] = CONFIG_FunctionNumToName(i);
MenuGameFuncs[i].Substitute('_', ' ');
for (j = 0; j < MAXGAMEFUNCLEN; ++j)
if (MenuGameFuncs[i][j] == '_')
MenuGameFuncs[i][j] = ' ';
if (gamefunctions[i][0] != '\0')
{
MEOSN_Gamefuncs[k] = MenuGameFuncs[i];
if (MenuGameFuncs[i][0] != '\0')
{
MEOSN_Gamefuncs[k] = MenuGameFuncs[i];
MEOSV_Gamefuncs[k] = i;
++k;
}
@ -1859,8 +1857,8 @@ void Menu_Init(void)
ME_KEYBOARDSETUPFUNCS[i].name = MenuGameFuncs[i];
ME_KEYBOARDSETUPFUNCS[i].entry = &MEO_KEYBOARDSETUPFUNCS[i];
MEO_KEYBOARDSETUPFUNCS[i] = MEO_KEYBOARDSETUPFUNCS_TEMPLATE;
MEO_KEYBOARDSETUPFUNCS[i].column[0] = &ud.config.KeyboardKeys[i][0];
MEO_KEYBOARDSETUPFUNCS[i].column[1] = &ud.config.KeyboardKeys[i][1];
MEO_KEYBOARDSETUPFUNCS[i].column[0] = &KeyboardKeys[i][0];
MEO_KEYBOARDSETUPFUNCS[i].column[1] = &KeyboardKeys[i][1];
}
M_KEYBOARDKEYS.numEntries = NUMGAMEFUNCTIONS;
for (i = 0; i < MENUMOUSEFUNCTIONS; ++i)
@ -2899,10 +2897,10 @@ static void Menu_PreInput(MenuEntry_t *entry)
{
auto column = (MenuCustom2Col_t*)entry->entry;
char key[2];
key[0] = ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0];
key[1] = ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1];
key[0] = KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0];
key[1] = KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1];
*column->column[M_KEYBOARDKEYS.currentColumn] = 0xff;
CONFIG_MapKey(M_KEYBOARDKEYS.currentEntry, ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0], key[0], ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1], key[1]);
CONFIG_MapKey(M_KEYBOARDKEYS.currentEntry, KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0], key[0], KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1], key[1]);
S_PlaySound(KICK_HIT);
KB_ClearKeyDown(sc_Delete);
}
@ -2959,14 +2957,14 @@ static int32_t Menu_PreCustom2ColScreen(MenuEntry_t *entry)
if (sc != sc_None)
{
char key[2];
key[0] = ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0];
key[1] = ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1];
key[0] = KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0];
key[1] = KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1];
S_PlaySound(PISTOL_BODYHIT);
*column->column[M_KEYBOARDKEYS.currentColumn] = KB_GetLastScanCode();
CONFIG_MapKey(M_KEYBOARDKEYS.currentEntry, ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0], key[0], ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1], key[1]);
CONFIG_MapKey(M_KEYBOARDKEYS.currentEntry, KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0], key[0], KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1], key[1]);
KB_ClearKeyDown(sc);
@ -3728,11 +3726,11 @@ static void Menu_Verify(int32_t input)
case MENU_KEYSRESETVERIFY:
if (input)
CONFIG_SetDefaultKeys(keydefaults);
CONFIG_SetDefaultKeys("demolition/defbinds.txt");
break;
case MENU_KEYSCLASSICVERIFY:
if (input)
CONFIG_SetDefaultKeys(oldkeydefaults);
CONFIG_SetDefaultKeys("demolition/origbinds.txt");
break;
case MENU_JOYSTANDARDVERIFY:
if (input)

View file

@ -857,19 +857,6 @@ void onvideomodechange(int32_t newmode)
g_crosshairSum = -1;
}
static int osdcmd_button(osdcmdptr_t parm)
{
static char const s_gamefunc_[] = "gamefunc_";
int constexpr strlen_gamefunc_ = ARRAY_SIZE(s_gamefunc_) - 1;
char const *p = parm->name + strlen_gamefunc_;
// if (g_player[myconnectindex].ps->gm == MODE_GAME) // only trigger these if in game
CONTROL_ButtonFlags[CONFIG_FunctionNameToNum(p)] = 1; // FIXME
return OSDCMD_OK;
}
const char *const ConsoleButtons[] =
{
"mouse1", "mouse2", "mouse3", "mouse4", "mwheelup",
@ -1008,9 +995,9 @@ static int osdcmd_bind(osdcmdptr_t parm)
if (j != -1)
{
ud.config.KeyboardKeys[j][1] = ud.config.KeyboardKeys[j][0];
ud.config.KeyboardKeys[j][0] = sctokeylut[i].sc;
// CONTROL_MapKey(j, sctokeylut[i].sc, ud.config.KeyboardKeys[j][0]);
KeyboardKeys[j][1] = KeyboardKeys[j][0];
KeyboardKeys[j][0] = sctokeylut[i].sc;
// CONTROL_MapKey(j, sctokeylut[i].sc, KeyboardKeys[j][0]);
if (j == gamefunc_Show_Console)
OSD_CaptureKey(sctokeylut[i].sc);
@ -1033,7 +1020,7 @@ static int osdcmd_unbindall(osdcmdptr_t UNUSED(parm))
for (int i = 0; i < MAXMOUSEBUTTONS; ++i)
CONTROL_FreeMouseBind(i);
for (auto &KeyboardKey : ud.config.KeyboardKeys)
for (auto &KeyboardKey : KeyboardKeys)
KeyboardKey[0] = KeyboardKey[1] = 0xff;
if (!OSD_ParsingScript())
@ -1078,7 +1065,7 @@ static int osdcmd_unbound(osdcmdptr_t parm)
int const gameFunc = CONFIG_FunctionNameToNum(parm->parms[0]);
if (gameFunc != -1)
ud.config.KeyboardKeys[gameFunc][0] = 0;
KeyboardKeys[gameFunc][0] = 0;
return OSDCMD_OK;
}
@ -1452,22 +1439,6 @@ int32_t registerosdcommands(void)
OSD_RegisterFunction("cmenu","cmenu <#>: jumps to menu", osdcmd_cmenu);
OSD_RegisterFunction("crosshaircolor","crosshaircolor: changes the crosshair color", osdcmd_crosshaircolor);
for (auto & func : gamefunctions)
{
if (func[0] == '\0')
continue;
// if (!Bstrcmp(gamefunctions[i],"Show_Console")) continue;
Bsprintf(tempbuf, "gamefunc_%s", func);
char *const t = Bstrtolower(Xstrdup(tempbuf));
Bstrcat(tempbuf, ": game button");
OSD_RegisterFunction(t, Xstrdup(tempbuf), osdcmd_button);
}
OSD_RegisterFunction("give","give <all|health|weapons|ammo|armor|keys|inventory>: gives requested item", osdcmd_give);
OSD_RegisterFunction("god","god: toggles god mode", osdcmd_god);
OSD_RegisterFunction("activatecheat","activatecheat <id>: activates a cheat code", osdcmd_activatecheat);

View file

@ -41,7 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "common_game.h"
#include "compat.h"
#include "control.h"
#include "function.h"
#include "gamecontrol.h"
#include "game.h"
#include "grpscan.h"
#include "inv.h"

View file

@ -78,9 +78,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms
// NORMAL axis scale
#define NORMALAXISSCALE 65536
#define BUTTONSET(x, value) (CONTROL_ButtonState |= ((uint64_t)value << ((uint64_t)(x))))
#define BUTTONCLEAR(x) (CONTROL_ButtonState &= ~((uint64_t)1 << ((uint64_t)(x))))
#define BUTTONHELDSET(x, value) (CONTROL_ButtonHeldState |= (uint64_t)(value << ((uint64_t)(x))))
#define LIMITCONTROL(x) (*x = clamp(*x, -MAXCONTROLVALUE, MAXCONTROLVALUE))
//****************************************************************************

View file

@ -36,6 +36,7 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
#ifndef control_public_h_
#define control_public_h_
#include "tarray.h"
//***************************************************************************
//
@ -43,14 +44,35 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au)
//
//***************************************************************************
#define MAXGAMEBUTTONS 64
#define MAXGAMEBUTTONS 80
#define BUTTON(x) ((CONTROL_ButtonState >> ((uint64_t)(x))) & 1)
#define BUTTONHELD(x) ((CONTROL_ButtonHeldState >> ((uint64_t)(x))) & 1)
extern BitArray CONTROL_ButtonState, CONTROL_ButtonHeldState;
inline bool BUTTON(int x)
{
return CONTROL_ButtonState[x];
}
inline bool BUTTONHELD(int x)
{
return CONTROL_ButtonHeldState[x];
}
inline bool BUTTONJUSTPRESSED(int x)
{
return (BUTTON(x) && !BUTTONHELD(x));
}
inline bool BUTTONRELEASED(int x)
{
return (!BUTTON(x) && BUTTONHELD(x));
}
inline bool BUTTONSTATECHANGED(int x)
{
return (BUTTON(x) != BUTTONHELD(x));
}
#define BUTTONJUSTPRESSED(x) (BUTTON(x) && !BUTTONHELD(x))
#define BUTTONRELEASED(x) (!BUTTON(x) && BUTTONHELD(x))
#define BUTTONSTATECHANGED(x) (BUTTON(x) != BUTTONHELD(x))
//***************************************************************************
@ -174,9 +196,6 @@ extern bool CONTROL_JoyPresent;
extern bool CONTROL_MouseEnabled;
extern bool CONTROL_JoystickEnabled;
extern uint64_t CONTROL_ButtonState;
extern uint64_t CONTROL_ButtonHeldState;
extern LastSeenInput CONTROL_LastSeenInput;
@ -253,7 +272,7 @@ void CONTROL_ProcessBinds(void);
////////////////////
#define CONTROL_NUM_FLAGS 64
#define CONTROL_NUM_FLAGS 80
extern int32_t CONTROL_ButtonFlags[CONTROL_NUM_FLAGS];
extern bool CONTROL_SmoothMouse;

View file

@ -22,8 +22,8 @@ bool CONTROL_MousePresent = false;
bool CONTROL_JoyPresent = false;
bool CONTROL_JoystickEnabled = false;
uint64_t CONTROL_ButtonState = 0;
uint64_t CONTROL_ButtonHeldState = 0;
BitArray CONTROL_ButtonState(MAXGAMEBUTTONS);
BitArray CONTROL_ButtonHeldState(MAXGAMEBUTTONS);
LastSeenInput CONTROL_LastSeenInput;
@ -743,14 +743,14 @@ void CONTROL_ClearButton(int whichbutton)
CONTROL_Android_ClearButton(whichbutton);
#endif
BUTTONCLEAR(whichbutton);
CONTROL_ButtonState.Clear(whichbutton);
CONTROL_Flags[whichbutton].cleared = TRUE;
}
void CONTROL_ClearAllButtons(void)
{
CONTROL_ButtonHeldState = 0;
CONTROL_ButtonState = 0;
CONTROL_ButtonHeldState.Zero();
CONTROL_ButtonState.Zero();
for (auto & c : CONTROL_Flags)
c.cleared = TRUE;
@ -816,8 +816,8 @@ static void CONTROL_GetFunctionInput(void)
CONTROL_ButtonFunctionState(CONTROL_ButtonFlags);
CONTROL_AxisFunctionState(CONTROL_ButtonFlags);
CONTROL_ButtonHeldState = CONTROL_ButtonState;
CONTROL_ButtonState = 0;
std::swap(CONTROL_ButtonHeldState, CONTROL_ButtonState);
CONTROL_ButtonState.Zero();
int i = CONTROL_NUM_FLAGS-1;
@ -825,7 +825,7 @@ static void CONTROL_GetFunctionInput(void)
{
CONTROL_SetFlag(i, /*CONTROL_KeyboardFunctionPressed(i) | */CONTROL_ButtonFlags[i]);
if (CONTROL_Flags[i].cleared == FALSE) BUTTONSET(i, CONTROL_Flags[i].active);
if (CONTROL_Flags[i].cleared == FALSE) CONTROL_ButtonState.Set(i, CONTROL_Flags[i].active);
else if (CONTROL_Flags[i].active == FALSE) CONTROL_Flags[i].cleared = 0;
}
while (i--);
@ -889,8 +889,8 @@ bool CONTROL_Startup(controltype which, int32_t(*TimeFunction)(void), int32_t ti
initprintf("CONTROL_Startup: Joystick Present\n");
#endif
CONTROL_ButtonState = 0;
CONTROL_ButtonHeldState = 0;
CONTROL_ButtonState.Zero();
CONTROL_ButtonHeldState.Zero();
for (auto & CONTROL_Flag : CONTROL_Flags)
CONTROL_Flag.used = FALSE;

View file

@ -34,207 +34,8 @@ BEGIN_RR_NS
#ifndef function_private_h_
#define function_private_h_
// KEEPINSYNC lunatic/con_lang.lua
char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] =
{
"Move_Forward",
"Move_Backward",
"Turn_Left",
"Turn_Right",
"Strafe",
"Fire",
"Open",
"Run",
"AutoRun",
"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",
"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",
"Show_Console",
"Show_DukeMatch_Scores",
"Dpad_Select",
"Dpad_Aiming",
"Alternate_Weapon",
"Last_Used_Weapon",
"Quick_Save",
"Quick_Load",
"Third_Person_View",
"Toggle_Crouch",
};
#ifdef __SETUP__
char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] =
{
"W", "Kpad8",
"S", "Kpad2",
"Left", "Kpad4",
"Right", "KPad6",
"LAlt", "RAlt",
"RCtrl", "",
"E", "",
"LShift", "RShift",
"CapLck", "",
"Space", "/",
"LCtrl", "",
"PgUp", "Kpad9",
"PgDn", "Kpad3",
"Insert", "Kpad0",
"Delete", "Kpad.",
"A", "",
"D", "",
"Home", "KPad7",
"End", "Kpad1",
"1", "",
"2", "",
"3", "",
"4", "",
"5", "",
"6", "",
"7", "",
"8", "",
"9", "",
"0", "",
"Enter", "KpdEnt",
"[", "",
"]", "",
"H", "",
"J", "",
"N", "",
"M", "",
"BakSpc", "",
"T", "",
"Tab", "",
"-", "Kpad-",
"=", "Kpad+",
"KPad5", "",
"ScrLck", "",
"Y", "",
"F", "",
"K", "",
"", "",
"", "",
"R", "",
"Q", "",
"'", "",
";", "",
"`", "",
"", "",
"", "",
"", "",
"", "",
"X", "",
"F6", "",
"F9", "",
"F7", "",
"", "",
};
char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] =
{
"Up", "Kpad8",
"Down", "Kpad2",
"Left", "Kpad4",
"Right", "KPad6",
"LAlt", "RAlt",
"LCtrl", "RCtrl",
"Space", "",
"LShift", "RShift",
"CapLck", "",
"A", "/",
"Z", "",
"PgUp", "Kpad9",
"PgDn", "Kpad3",
"Insert", "Kpad0",
"Delete", "Kpad.",
",", "",
".", "",
"Home", "KPad7",
"End", "Kpad1",
"1", "",
"2", "",
"3", "",
"4", "",
"5", "",
"6", "",
"7", "",
"8", "",
"9", "",
"0", "",
"Enter", "KpdEnt",
"[", "",
"]", "",
"H", "",
"J", "",
"N", "",
"M", "",
"BakSpc", "",
"T", "",
"Tab", "",
"-", "Kpad-",
"=", "Kpad+",
"KPad5", "",
"ScrLck", "",
"W", "",
"F", "",
"K", "",
"U", "",
"I", "",
"R", "",
"`", "",
"'", "",
";", "",
"C", "",
"", "",
"", "",
"", "",
"", "",
"", "",
"F6", "",
"F9", "",
"F7", "",
"", "",
};
static const char * mousedefaults[MAXMOUSEBUTTONS] =
{
"Fire",
@ -262,8 +63,6 @@ static const char * mousedigitaldefaults[MAXMOUSEDIGITAL] =
{
};
#if defined(GEKKO)
#else
static const char * joystickdefaults[MAXJOYBUTTONSANDHATS] =
{
"Fire",
@ -332,7 +131,6 @@ static const char * joystickdigitaldefaults[MAXJOYDIGITAL] =
"",
"Run",
};
#endif
#endif
#endif

View file

@ -40,36 +40,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_RR_NS
hashtable_t h_gamefuncs = { NUMGAMEFUNCTIONS<<1, NULL };
int32_t CONFIG_FunctionNameToNum(const char *func)
{
int32_t i;
if (!func)
return -1;
i = hash_find(&h_gamefuncs,func);
if (i < 0)
{
char *str = Bstrtolower(Xstrdup(func));
i = hash_find(&h_gamefuncs,str);
Bfree(str);
return i;
}
return i;
}
char *CONFIG_FunctionNumToName(int32_t func)
{
if ((unsigned)func >= (unsigned)NUMGAMEFUNCTIONS)
return NULL;
return gamefunctions[func];
}
int32_t CONFIG_AnalogNameToNum(const char *func)
@ -116,55 +86,6 @@ const char *CONFIG_AnalogNumToName(int32_t func)
}
void CONFIG_SetDefaultKeys(const char (*keyptr)[MAXGAMEFUNCLEN], bool lazy/*=false*/)
{
static char const s_gamefunc_[] = "gamefunc_";
int constexpr strlen_gamefunc_ = ARRAY_SIZE(s_gamefunc_) - 1;
if (!lazy)
{
Bmemset(ud.config.KeyboardKeys, 0xff, sizeof(ud.config.KeyboardKeys));
CONTROL_ClearAllBinds();
}
for (int i=0; i < ARRAY_SSIZE(gamefunctions); ++i)
{
if (gamefunctions[i][0] == '\0')
continue;
auto &key = ud.config.KeyboardKeys[i];
int const default0 = KB_StringToScanCode(keyptr[i<<1]);
int const default1 = KB_StringToScanCode(keyptr[(i<<1)+1]);
// skip the function if the default key is already used
// or the function is assigned to another key
if (lazy && (key[0] != 0xff || (CONTROL_KeyIsBound(default0) && Bstrlen(CONTROL_KeyBinds[default0].cmdstr) > strlen_gamefunc_
&& CONFIG_FunctionNameToNum(CONTROL_KeyBinds[default0].cmdstr + strlen_gamefunc_) >= 0)))
{
#if 0 // defined(DEBUGGINGAIDS)
if (key[0] != 0xff)
initprintf("Skipping %s bound to %s\n", keyptr[i<<1], CONTROL_KeyBinds[default0].cmdstr);
#endif
continue;
}
key[0] = default0;
key[1] = default1;
if (key[0])
CONTROL_FreeKeyBind(key[0]);
if (key[1])
CONTROL_FreeKeyBind(key[1]);
if (i == gamefunc_Show_Console)
OSD_CaptureKey(key[0]);
else
CONFIG_MapKey(i, key[0], 0, key[1], 0);
}
}
void CONFIG_SetDefaults(void)
{
@ -289,25 +210,8 @@ void CONFIG_SetDefaults(void)
// JBF 20031211
if (RR)
{
Bstrcpy((char*)keydefaults[gamefunc_Holo_Duke<<1], "B");
Bstrcpy((char*)keydefaults[gamefunc_Jetpack<<1], "C");
Bstrcpy((char*)keydefaults[gamefunc_NightVision<<1], "Y");
Bstrcpy((char*)keydefaults[gamefunc_MedKit<<1], "R");
Bstrcpy((char*)keydefaults[gamefunc_Steroids<<1], "M");
Bstrcpy((char*)keydefaults[gamefunc_Show_Opponents_Weapon<<1], "V");
Bstrcpy((char*)oldkeydefaults[gamefunc_Holo_Duke<<1], "B");
Bstrcpy((char*)oldkeydefaults[gamefunc_Jetpack<<1], "C");
Bstrcpy((char*)oldkeydefaults[gamefunc_NightVision<<1], "Y");
Bstrcpy((char*)oldkeydefaults[gamefunc_MedKit<<1], "W");
Bstrcpy((char*)oldkeydefaults[gamefunc_Steroids<<1], "M");
Bstrcpy((char*)oldkeydefaults[gamefunc_Show_Opponents_Weapon<<1], "E");
Bstrcpy((char*)oldkeydefaults[gamefunc_Show_Console<<1], "V");
}
CONFIG_SetDefaultKeys(keydefaults);
CONFIG_SetDefaultKeys("demolition/defbinds.txt");
memset(ud.config.MouseFunctions, -1, sizeof(ud.config.MouseFunctions));
for (i=0; i<MAXMOUSEBUTTONS; i++)
@ -360,55 +264,6 @@ void CONFIG_SetDefaults(void)
}
}
// wrapper for CONTROL_MapKey(), generates key bindings to reflect changes to keyboard setup
void CONFIG_MapKey(int which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2)
{
int const keys[] = { key1, key2, oldkey1, oldkey2 };
char buf[2*MAXGAMEFUNCLEN];
if (which == gamefunc_Show_Console)
OSD_CaptureKey(key1);
for (int k = 0; (unsigned)k < ARRAY_SIZE(keys); k++)
{
if (keys[k] == 0xff || !keys[k])
continue;
int match = 0;
for (; sctokeylut[match].key; match++)
{
if (keys[k] == sctokeylut[match].sc)
break;
}
tempbuf[0] = 0;
for (int i=NUMGAMEFUNCTIONS-1; i>=0; i--)
{
if (ud.config.KeyboardKeys[i][0] == keys[k] || ud.config.KeyboardKeys[i][1] == keys[k])
{
Bsprintf(buf, "gamefunc_%s; ", CONFIG_FunctionNumToName(i));
Bstrcat(tempbuf,buf);
}
}
int const len = Bstrlen(tempbuf);
if (len >= 2)
{
tempbuf[len-2] = 0; // cut off the trailing "; "
CONTROL_BindKey(keys[k], tempbuf, 1, sctokeylut[match].key ? sctokeylut[match].key : "<?>");
}
else
{
CONTROL_FreeKeyBind(keys[k]);
}
}
}
void CONFIG_SetupMouse(void)
{
int32_t i;

View file

@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef config_public_h_
#define config_public_h_
#include "function.h"
#include "gamecontrol.h"
BEGIN_RR_NS
@ -34,15 +34,10 @@ void CONFIG_GetSetupFilename( void );
void CONFIG_WriteSetup(uint32_t flags);
void CONFIG_SetupMouse( void );
void CONFIG_SetupJoystick( void );
void CONFIG_SetDefaultKeys(const char (*keyptr)[MAXGAMEFUNCLEN], bool lazy=false);
int32_t CONFIG_GetMapBestTime(char const * mapname, uint8_t const * mapmd4);
int32_t CONFIG_SetMapBestTime(uint8_t const * mapmd4, int32_t tm);
void CONFIG_MapKey(int32_t which, kb_scancode key1, kb_scancode oldkey1, kb_scancode key2, kb_scancode oldkey2);
int32_t CONFIG_FunctionNameToNum(const char *func);
char *CONFIG_FunctionNumToName(int32_t func);
int32_t CONFIG_AnalogNameToNum(const char *func);
const char *CONFIG_AnalogNumToName(int32_t func);
void CONFIG_SetDefaults(void);

View file

@ -116,7 +116,7 @@ END_RR_NS
#include "common_game.h"
#include "config.h"
#include "control.h"
#include "function.h"
#include "gamecontrol.h"
#include "game.h"
#include "gamedef.h"
#include "gamedefs.h"

View file

@ -1,111 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 2010 EDuke32 developers and contributors
This file is part of EDuke32.
EDuke32 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
//-------------------------------------------------------------------------
// function.h
// file created by makehead.exe
// these headers contain default key assignments, as well as
// default button assignments and game function names
// axis defaults are also included
#ifndef function_public_h_
#define function_public_h_
BEGIN_RR_NS
#define NUMGAMEFUNCTIONS 62
#define MAXGAMEFUNCLEN 32
extern char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
extern char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN];
extern char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN];
enum GameFunction_t
{
gamefunc_Move_Forward,
gamefunc_Move_Backward,
gamefunc_Turn_Left,
gamefunc_Turn_Right,
gamefunc_Strafe,
gamefunc_Fire,
gamefunc_Open,
gamefunc_Run,
gamefunc_AutoRun,
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,
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_Show_Console,
gamefunc_Show_DukeMatch_Scores,
gamefunc_Dpad_Select,
gamefunc_Dpad_Aiming,
gamefunc_Alt_Weapon,
gamefunc_Last_Weapon,
gamefunc_Quick_Save,
gamefunc_Quick_Load,
gamefunc_Third_Person_View,
gamefunc_Toggle_Crouch, // TODO: Implement properly for mp
};
END_RR_NS
#endif

View file

@ -7130,7 +7130,6 @@ static void G_Cleanup(void)
// Bfree(MusicPtr);
hash_free(&h_labels);
hash_free(&h_gamefuncs);
hash_loop(&h_dukeanim, G_FreeHashAnim);
hash_free(&h_dukeanim);
@ -7714,19 +7713,6 @@ int app_main(int argc, char const * const * argv)
if (forcegl) initprintf("GL driver blacklist disabled.\n");
#endif
// used with binds for fast function lookup
hash_init(&h_gamefuncs);
for (bssize_t i=NUMGAMEFUNCTIONS-1; i>=0; i--)
{
if (gamefunctions[i][0] == '\0')
continue;
char *str = Bstrtolower(Xstrdup(gamefunctions[i]));
hash_add(&h_gamefuncs,gamefunctions[i],i,0);
hash_add(&h_gamefuncs,str,i,0);
Bfree(str);
}
#ifdef STARTUP_SETUP_WINDOW
int const readSetup =
#endif
@ -7900,7 +7886,7 @@ int app_main(int argc, char const * const * argv)
Bsprintf(tempbuf, HEAD2 " %s", s_buildRev);
OSD_SetVersion(tempbuf, 10,0);
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, gamefunctions[gamefunc_Show_Console][0] == '\0' ? OSD_PROTECTED : 0);
OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0);
registerosdcommands();
//if (g_networkMode != NET_DEDICATED_SERVER)
@ -7947,7 +7933,7 @@ int app_main(int argc, char const * const * argv)
OSD_Exec(tempbuf);
OSD_Exec("autoexec.cfg");
CONFIG_SetDefaultKeys(keydefaults, true);
//CONFIG_SetDefaultKeys(keydefaults, true);
system_getcvars();

View file

@ -206,8 +206,7 @@ typedef struct {
int32_t JoystickAnalogueScale[MAXJOYAXES];
int32_t JoystickAnalogueDead[MAXJOYAXES];
int32_t JoystickAnalogueSaturate[MAXJOYAXES];
uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
int32_t scripthandle;
int32_t setupread;

View file

@ -944,7 +944,7 @@ void C_InitQuotes(void)
#ifdef EDUKE32_TOUCH_DEVICES
apStrings[QUOTE_DEAD] = 0;
#else
char const * const OpenGameFunc = gamefunctions[gamefunc_Open];
char const * OpenGameFunc = CONFIG_FunctionNumToName(gamefunc_Open);
C_ReplaceQuoteSubstring(QUOTE_DEAD, "SPACE", OpenGameFunc);
C_ReplaceQuoteSubstring(QUOTE_DEAD, "OPEN", OpenGameFunc);
C_ReplaceQuoteSubstring(QUOTE_DEAD, "USE", OpenGameFunc);

View file

@ -66,8 +66,6 @@ enum
extern intptr_t const * insptr;
extern void VM_ScriptInfo(intptr_t const *ptr, int range);
extern hashtable_t h_gamefuncs;
extern hashtable_t h_labels;
extern char g_scriptFileName[BMAX_PATH];

View file

@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "global.h"
#include "game.h"
#include "function.h"
#include "gamecontrol.h"
#include "keyboard.h"
#include "mouse.h"
#include "joystick.h"

View file

@ -262,7 +262,7 @@ static char const *MEOSN_YesNo[] = { "Yes", "No", };
static MenuOptionSet_t MEOS_YesNo = MAKE_MENUOPTIONSET( MEOSN_YesNo, NULL, 0x3 );
static char MenuGameFuncs[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN];
static FString MenuGameFuncs[NUMGAMEFUNCTIONS];
static char const *MenuGameFuncNone = " -None-";
static char const *MEOSN_Gamefuncs[NUMGAMEFUNCTIONS+1];
static int32_t MEOSV_Gamefuncs[NUMGAMEFUNCTIONS+1];
@ -1614,28 +1614,28 @@ void Menu_Init(void)
k = 1;
for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
{
Bstrcpy(MenuGameFuncs[i], gamefunctions[i]);
for (j = 0; j < MAXGAMEFUNCLEN; ++j)
if (MenuGameFuncs[i][j] == '_')
MenuGameFuncs[i][j] = ' ';
if (gamefunctions[i][0] != '\0')
{
MEOSN_Gamefuncs[k] = MenuGameFuncs[i];
MEOSV_Gamefuncs[k] = i;
++k;
}
MenuGameFuncs[i] = CONFIG_FunctionNumToName(i);
MenuGameFuncs[i].Substitute('_', ' ');
}
if (RR)
{
Bstrcpy(MenuGameFuncs[gamefunc_Holo_Duke], "Beer");
Bstrcpy(MenuGameFuncs[gamefunc_Jetpack], "CowPie");
Bstrcpy(MenuGameFuncs[gamefunc_NightVision], "Yeehaa");
Bstrcpy(MenuGameFuncs[gamefunc_MedKit], "Whiskey");
Bstrcpy(MenuGameFuncs[gamefunc_Steroids], "Moonshine");
Bstrcpy(MenuGameFuncs[gamefunc_Quick_Kick], "Pee");
MenuGameFuncs[gamefunc_Holo_Duke] = "Beer";
MenuGameFuncs[gamefunc_Jetpack] = "CowPie";
MenuGameFuncs[gamefunc_NightVision] = "Yeehaa";
MenuGameFuncs[gamefunc_MedKit] = "Whiskey";
MenuGameFuncs[gamefunc_Steroids] = "Moonshine";
MenuGameFuncs[gamefunc_Quick_Kick] = "Pee";
}
for (i = 0; i < NUMGAMEFUNCTIONS; ++i)
{
if (MenuGameFuncs[i][0] != '\0')
{
MEOSN_Gamefuncs[k] = MenuGameFuncs[i];
MEOSV_Gamefuncs[k] = i;
++k;
}
}
MEOS_Gamefuncs.numOptions = k;
for (i = 0; i < NUMKEYS; ++i)
@ -1752,8 +1752,8 @@ void Menu_Init(void)
ME_KEYBOARDSETUPFUNCS[i].name = MenuGameFuncs[i];
ME_KEYBOARDSETUPFUNCS[i].entry = &MEO_KEYBOARDSETUPFUNCS[i];
MEO_KEYBOARDSETUPFUNCS[i] = MEO_KEYBOARDSETUPFUNCS_TEMPLATE;
MEO_KEYBOARDSETUPFUNCS[i].column[0] = &ud.config.KeyboardKeys[i][0];
MEO_KEYBOARDSETUPFUNCS[i].column[1] = &ud.config.KeyboardKeys[i][1];
MEO_KEYBOARDSETUPFUNCS[i].column[0] = &KeyboardKeys[i][0];
MEO_KEYBOARDSETUPFUNCS[i].column[1] = &KeyboardKeys[i][1];
}
M_KEYBOARDKEYS.numEntries = NUMGAMEFUNCTIONS;
for (i = 0; i < MENUMOUSEFUNCTIONS; ++i)
@ -3275,10 +3275,10 @@ static void Menu_PreInput(MenuEntry_t *entry)
{
auto *column = (MenuCustom2Col_t*)entry->entry;
char key[2];
key[0] = ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0];
key[1] = ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1];
key[0] = KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0];
key[1] = KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1];
*column->column[M_KEYBOARDKEYS.currentColumn] = 0xff;
CONFIG_MapKey(M_KEYBOARDKEYS.currentEntry, ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0], key[0], ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1], key[1]);
CONFIG_MapKey(M_KEYBOARDKEYS.currentEntry, KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0], key[0], KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1], key[1]);
S_PlaySound(RR ? 335 : KICK_HIT);
KB_ClearKeyDown(sc_Delete);
}
@ -3335,14 +3335,14 @@ static int32_t Menu_PreCustom2ColScreen(MenuEntry_t *entry)
if (sc != sc_None)
{
char key[2];
key[0] = ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0];
key[1] = ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1];
key[0] = KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0];
key[1] = KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1];
S_PlaySound(RR ? 341 : PISTOL_BODYHIT);
*column->column[M_KEYBOARDKEYS.currentColumn] = KB_GetLastScanCode();
CONFIG_MapKey(M_KEYBOARDKEYS.currentEntry, ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0], key[0], ud.config.KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1], key[1]);
CONFIG_MapKey(M_KEYBOARDKEYS.currentEntry, KeyboardKeys[M_KEYBOARDKEYS.currentEntry][0], key[0], KeyboardKeys[M_KEYBOARDKEYS.currentEntry][1], key[1]);
KB_ClearKeyDown(sc);
@ -3640,9 +3640,9 @@ static void Menu_EntryLinkActivate(MenuEntry_t *entry)
videoSetPalette(ud.brightness>>2,g_player[myconnectindex].ps->palette,0);
}
else if (entry == &ME_KEYBOARDSETUP_RESET)
CONFIG_SetDefaultKeys(keydefaults);
CONFIG_SetDefaultKeys("demolition/defbinds.txt");
else if (entry == &ME_KEYBOARDSETUP_RESETCLASSIC)
CONFIG_SetDefaultKeys(oldkeydefaults);
CONFIG_SetDefaultKeys("demolition/origbinds.txt");
else if (entry == &ME_NETHOST_LAUNCH)
{
// master does whatever it wants

View file

@ -739,19 +739,6 @@ static int osdcmd_name(osdcmdptr_t parm)
}
#endif
static int osdcmd_button(osdcmdptr_t parm)
{
static char const s_gamefunc_[] = "gamefunc_";
int constexpr strlen_gamefunc_ = ARRAY_SIZE(s_gamefunc_) - 1;
char const *p = parm->name + strlen_gamefunc_;
// if (g_player[myconnectindex].ps->gm == MODE_GAME) // only trigger these if in game
CONTROL_ButtonFlags[CONFIG_FunctionNameToNum(p)] = 1; // FIXME
return OSDCMD_OK;
}
const char *const ConsoleButtons[] =
{
"mouse1", "mouse2", "mouse3", "mouse4", "mwheelup",
@ -890,9 +877,9 @@ static int osdcmd_bind(osdcmdptr_t parm)
if (j != -1)
{
ud.config.KeyboardKeys[j][1] = ud.config.KeyboardKeys[j][0];
ud.config.KeyboardKeys[j][0] = sctokeylut[i].sc;
// CONTROL_MapKey(j, sctokeylut[i].sc, ud.config.KeyboardKeys[j][0]);
KeyboardKeys[j][1] = KeyboardKeys[j][0];
KeyboardKeys[j][0] = sctokeylut[i].sc;
// CONTROL_MapKey(j, sctokeylut[i].sc, KeyboardKeys[j][0]);
if (j == gamefunc_Show_Console)
OSD_CaptureKey(sctokeylut[i].sc);
@ -915,7 +902,7 @@ static int osdcmd_unbindall(osdcmdptr_t UNUSED(parm))
for (int i = 0; i < MAXMOUSEBUTTONS; ++i)
CONTROL_FreeMouseBind(i);
for (auto &KeyboardKey : ud.config.KeyboardKeys)
for (auto &KeyboardKey : KeyboardKeys)
KeyboardKey[0] = KeyboardKey[1] = 0xff;
if (!OSD_ParsingScript())
@ -1231,22 +1218,6 @@ int32_t registerosdcommands(void)
OSD_RegisterFunction("disconnect","disconnect: disconnects from the local multiplayer game", osdcmd_disconnect);
#endif
for (auto & func : gamefunctions)
{
if (func[0] == '\0')
continue;
// if (!Bstrcmp(gamefunctions[i],"Show_Console")) continue;
Bsprintf(tempbuf, "gamefunc_%s", func);
char *const t = Bstrtolower(Xstrdup(tempbuf));
Bstrcat(tempbuf, ": game button");
OSD_RegisterFunction(t, Xstrdup(tempbuf), osdcmd_button);
}
OSD_RegisterFunction("give","give <all|health|weapons|ammo|armor|keys|inventory>: gives requested item", osdcmd_give);
OSD_RegisterFunction("god","god: toggles god mode", osdcmd_god);
OSD_RegisterFunction("activatecheat","activatecheat <id>: activates a cheat code", osdcmd_activatecheat);

View file

@ -40,7 +40,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "common_game.h"
#include "compat.h"
#include "control.h"
#include "function.h"
#include "gamecontrol.h"
#include "game.h"
#include "grpscan.h"
#include "inv.h"

View file

@ -37,171 +37,6 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
const char *gamefunctions[] =
{
"Move_Forward",
"Move_Backward",
"Turn_Left",
"Turn_Right",
"Strafe",
"Fire",
"Open",
"Run",
"AutoRun",
"Jump",
"Crouch",
"Look_Up",
"Look_Down",
"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",
"Med_Kit",
"Smoke_Bomb",
"Night_Vision",
"Gas_Bomb",
"Flash_Bomb",
"Caltrops",
"TurnAround",
"SendMessage",
"Map",
"Shrink_Screen",
"Enlarge_Screen",
"Center_View",
"Holster_Weapon",
"Map_Follow_Mode",
"See_Co_Op_View",
"Mouse_Aiming",
"Toggle_Crosshair",
"Next_Weapon",
"Previous_Weapon",
"Show_Menu",
"Show_Console",
};
#define NUMKEYENTRIES 50
static const char *keydefaults[] =
{
"Move_Forward", "Up", "Kpad8",
"Move_Backward", "Down", "Kpad2",
"Turn_Left", "Left", "Kpad4",
"Turn_Right", "Right", "KPad6",
"Strafe", "LAlt", "RAlt",
"Fire", "LCtrl", "RCtrl",
"Open", "Space", "",
"Run", "LShift", "RShift",
"AutoRun", "CapLck", "",
"Jump", "A", "/",
"Crouch", "Z", "",
"Look_Up", "PgUp", "Kpad9",
"Look_Down", "PgDn", "Kpad3",
"Strafe_Left", ",", "",
"Strafe_Right", ".", "",
"Aim_Up", "Home", "KPad7",
"Aim_Down", "End", "Kpad1",
"Weapon_1", "1", "",
"Weapon_2", "2", "",
"Weapon_3", "3", "",
"Weapon_4", "4", "",
"Weapon_5", "5", "",
"Weapon_6", "6", "",
"Weapon_7", "7", "",
"Weapon_8", "8", "",
"Weapon_9", "9", "",
"Weapon_10", "0", "",
"Inventory", "Enter", "KpdEnt",
"Inventory_Left", "[", "",
"Inventory_Right", "]", "",
"Med_Kit", "M", "",
"Smoke_Bomb", "S", "",
"Night_Vision", "N", "",
"Gas_Bomb", "G", "",
"Flash_Bomb", "F", "",
"Caltrops", "C", "",
"TurnAround", "BakSpc", "",
"SendMessage", "T", "",
"Map", "Tab", "",
"Shrink_Screen", "-", "Kpad-",
"Enlarge_Screen", "=", "Kpad+",
"Center_View", "KPad5", "",
"Holster_Weapon", "ScrLck", "",
"Map_Follow_Mode", "F", "",
"See_Co_Op_View", "K", "",
"Mouse_Aiming", "U", "",
"Toggle_Crosshair", "I", "",
"Next_Weapon", "'", "",
"Previous_Weapon", ";", "",
"Show_Console", "NumLck", "",
};
static const char *keydefaults_modern[] =
{
"Move_Forward", "W", "",
"Move_Backward", "S", "",
"Turn_Left", "", "",
"Turn_Right", "", "",
"Strafe", "", "",
"Fire", "", "",
"Open", "E", "",
"Run", "LShift", "",
"AutoRun", "CapLck", "",
"Jump", "Space", "",
"Crouch", "LAlt", "",
"Look_Up", "", "",
"Look_Down", "", "",
"Strafe_Left", "A", "",
"Strafe_Right", "D", "",
"Aim_Up", "", "",
"Aim_Down", "", "",
"Weapon_1", "1", "",
"Weapon_2", "2", "",
"Weapon_3", "3", "",
"Weapon_4", "4", "",
"Weapon_5", "5", "",
"Weapon_6", "6", "",
"Weapon_7", "7", "",
"Weapon_8", "8", "",
"Weapon_9", "9", "",
"Weapon_10", "0", "",
"Inventory", "Enter", "",
"Inventory_Left", "[", "",
"Inventory_Right", "]", "",
"Med_Kit", "M", "",
"Smoke_Bomb", "B", "",
"Night_Vision", "N", "",
"Gas_Bomb", "G", "",
"Flash_Bomb", "F", "",
"Caltrops", "C", "",
"TurnAround", "BakSpc", "",
"SendMessage", "T", "",
"Map", "Tab", "",
"Shrink_Screen", "-", "",
"Enlarge_Screen", "=", "",
"Center_View", "", "",
"Holster_Weapon", "H", "",
"Map_Follow_Mode", "F", "",
"See_Co_Op_View", "K", "",
"Mouse_Aiming", "U", "",
"Toggle_Crosshair", "I", "",
"Next_Weapon", "", "",
"Previous_Weapon", "", "",
"Show_Console", "NumLck", "",
};
static const char *mousedefaults[] =
{

View file

@ -39,7 +39,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "control.h"
#include "config.h"
#include "sounds.h"
#include "function.h"
#include "gamecontrol.h"
#include "game.h"
#include "colormap.h"

View file

@ -35,7 +35,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "text.h"
#include "control.h"
#include "function.h"
#include "gamecontrol.h"
//#include "inv.h"
BEGIN_SW_NS

View file

@ -35,7 +35,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "scriplib.h"
#include "gamedefs.h"
#include "keyboard.h"
#include "function.h"
#include "gamecontrol.h"
#include "control.h"
#include "fx_man.h"
#include "sounds.h"
@ -71,7 +71,6 @@ int32_t NumberPlayers,CommPort,PortSpeed,IrqNumber,UartAddress;
int32_t UseMouse = 1, UseJoystick = 0;
uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
int32_t MouseButtons[MAXMOUSEBUTTONS];
int32_t MouseButtonsClicked[MAXMOUSEBUTTONS];
int32_t MouseDigitalAxes[MAXMOUSEAXES][2];
@ -101,49 +100,6 @@ static int32_t scripthandle = -1;
/*
===================
=
= CONFIG_FunctionNameToNum
=
===================
*/
int32_t CONFIG_FunctionNameToNum(const char *func)
{
int32_t i;
if (!func) return -1;
for (i=0; i<NUMGAMEFUNCTIONS; i++)
{
if (!Bstrcasecmp(func,gamefunctions[i]))
{
return i;
}
}
return -1;
}
/*
===================
=
= CONFIG_FunctionNumToName
=
===================
*/
const char *CONFIG_FunctionNumToName(int32_t func)
{
if ((unsigned)func >= (unsigned)NUMGAMEFUNCTIONS)
{
return NULL;
}
else
{
return gamefunctions[func];
}
}
/*
===================
=
@ -283,36 +239,7 @@ void CONFIG_SetDefaults(void)
void SetDefaultKeyDefinitions(int style)
{
int numkeydefaults;
const char **keydefaultset;
int i, f, k1, k2;
if (style)
{
numkeydefaults = sizeof(keydefaults_modern) / sizeof(char *) / 3;
keydefaultset = keydefaults_modern;
}
else
{
numkeydefaults = sizeof(keydefaults) / sizeof(char *) / 3;
keydefaultset = keydefaults;
}
memset(KeyboardKeys, 0xff, sizeof(KeyboardKeys));
for (i=0; i < numkeydefaults; i++)
{
f = CONFIG_FunctionNameToNum(keydefaultset[3*i+0]);
if (f == -1) continue;
k1 = KB_StringToScanCode(keydefaultset[3*i+1]);
k2 = KB_StringToScanCode(keydefaultset[3*i+2]);
// [JM] Needs to be rewritten, I think. !CHECKME!
#if 0
CONTROL_MapKey(i, k1, k2);
#endif
KeyboardKeys[f][0] = k1;
KeyboardKeys[f][1] = k2;
}
CONFIG_SetDefaultKeys(style ? "demolition/defbinds.txt" : "demolition/origbinds.txt");
}
void SetMouseDefaults(int style)

View file

@ -29,7 +29,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "compat.h"
#include "function.h"
#include "gamecontrol.h"
#include "keyboard.h"
#include "control.h"
@ -78,8 +78,6 @@ extern int32_t MouseSensitivity;
extern int32_t MouseAiming;
extern int32_t MouseAimingFlipped;
extern uint8_t KeyboardKeys[NUMGAMEFUNCTIONS][2];
extern int32_t MouseButtons[MAXMOUSEBUTTONS];
extern int32_t MouseButtonsClicked[MAXMOUSEBUTTONS];
@ -114,8 +112,6 @@ void CONFIG_WriteSetup(void);
void WriteCommitFile(int32_t gametype);
void CONFIG_GetSetupFilename(void);
const char *CONFIG_FunctionNumToName(int32_t func);
int32_t CONFIG_FunctionNameToNum(const char *func);
const char *CONFIG_AnalogNumToName(int32_t func);
int32_t CONFIG_AnalogNameToNum(const char *func);

View file

@ -44,7 +44,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "quake.h"
#include "common_game.h"
#include "function.h"
#include "gamecontrol.h"
#include "control.h"
#include "trigger.h"

View file

@ -38,7 +38,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "mytypes.h"
#include "control.h"
#include "function.h"
#include "gamecontrol.h"
#include "demo.h"
#include "player.h"
@ -478,9 +478,9 @@ DemoPlayBack(void)
}
#endif
if (BUTTON(gamefunc_See_Co_Op_View))
if (BUTTON(gamefunc_See_Coop_View))
{
CONTROL_ClearButton(gamefunc_See_Co_Op_View);
CONTROL_ClearButton(gamefunc_See_Coop_View);
screenpeek = connectpoint2[screenpeek];

View file

@ -41,7 +41,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "mytypes.h"
#include "control.h"
#include "function.h"
#include "gamecontrol.h"
#include "network.h"
#include "pal.h"
#include "player.h"

View file

@ -1,99 +0,0 @@
//-------------------------------------------------------------------------
/*
Copyright (C) 1997, 2005 - 3D Realms Entertainment
This file is part of Shadow Warrior version 1.2
Shadow Warrior is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Original Source: 1997 - Frank Maddin and Jim Norwood
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
*/
//-------------------------------------------------------------------------
// function.h
// file created by makehead.exe
// these headers contain default key assignments, as well as
// default button assignments and game function names
// axis defaults are also included
#ifndef function_public_
#define function_public_
BEGIN_SW_NS
#define NUMGAMEFUNCTIONS 51
extern const char *gamefunctions[];
enum
{
gamefunc_Move_Forward,
gamefunc_Move_Backward,
gamefunc_Turn_Left,
gamefunc_Turn_Right,
gamefunc_Strafe,
gamefunc_Fire,
gamefunc_Open,
gamefunc_Run,
gamefunc_AutoRun,
gamefunc_Jump,
gamefunc_Crouch,
gamefunc_Look_Up,
gamefunc_Look_Down,
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_Med_Kit,
gamefunc_Smoke_Bomb,
gamefunc_Night_Vision,
gamefunc_Gas_Bomb,
gamefunc_Flash_Bomb,
gamefunc_Caltrops,
gamefunc_TurnAround,
gamefunc_SendMessage,
gamefunc_Map,
gamefunc_Shrink_Screen,
gamefunc_Enlarge_Screen,
gamefunc_Center_View,
gamefunc_Holster_Weapon,
gamefunc_Map_Follow_Mode,
gamefunc_See_Co_Op_View,
gamefunc_Mouse_Aiming,
gamefunc_Toggle_Crosshair,
gamefunc_Next_Weapon,
gamefunc_Previous_Weapon,
gamefunc_Show_Menu,
gamefunc_Show_Console,
};
END_SW_NS
#endif

View file

@ -70,7 +70,7 @@ Things required to make savegames work:
#include "menus.h"
#include "control.h"
#include "function.h"
#include "gamecontrol.h"
#include "gamedefs.h"
#include "config.h"

View file

@ -42,7 +42,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "quake.h"
#include "common_game.h"
#include "function.h"
#include "gamecontrol.h"
#include "control.h"
#include "trigger.h"

View file

@ -44,7 +44,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "pal.h"
#include "demo.h"
#include "function.h"
#include "gamecontrol.h"
#include "gamedefs.h"
#include "config.h"
#include "network.h"
@ -829,7 +829,8 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item)
for (i=0; i<(int)SIZ(strs); i++)
{
w = 0;
sprintf(ds,strs[i],gamefunctions[currentkey],col[currentcol]);
auto c = CONFIG_FunctionNumToName(currentkey);
sprintf(ds,strs[i],c,col[currentcol]);
for (j=0; ds[j]; j++) if (ds[j] == '_') ds[j] = ' ';
MNU_MeasureString(ds, &w, &h);
MNU_DrawString((XDIM - w)/2, y, ds, 0, 16);
@ -925,10 +926,11 @@ SWBOOL MNU_KeySetupCustom(UserCall call, MenuItem *item)
for (i = topitem; i <= botitem; i++)
{
for (j = 0; gamefunctions[i][j]; j++)
auto c = CONFIG_FunctionNumToName(i);
for (j = 0; c[j]; j++)
{
if (gamefunctions[i][j] == '_') ds[j] = ' ';
else ds[j] = gamefunctions[i][j];
if (c[j] == '_') ds[j] = ' ';
else ds[j] = c[j];
}
ds[j] = 0;
@ -1047,10 +1049,11 @@ static int MNU_SelectButtonFunction(const char *buttonname, int *currentfunc)
}
else
{
for (j = 0; gamefunctions[i-1][j]; j++)
auto c = CONFIG_FunctionNumToName(i-1);
for (j = 0; c[j]; j++)
{
if (gamefunctions[i-1][j] == '_') ds[j] = ' ';
else ds[j] = gamefunctions[i-1][j];
if (c[j] == '_') ds[j] = ' ';
else ds[j] = c[j];
}
ds[j] = 0;
}
@ -4657,10 +4660,9 @@ void MNU_DoMenu(CTLType type, PLAYERp pp)
MNU_DoSlider(1, &currentmenu->items[currentmenu->cursor], FALSE);
resetitem = TRUE;
}
else if (mnu_input.button1 || BUTTON(gamefunc_Show_Menu))
else if (mnu_input.button1)
{
static int handle3=0;
CONTROL_ClearButton(gamefunc_Show_Menu);
if (!FX_SoundActive(handle3))
handle3 = PlaySound(DIGI_SWORDSWOOSH,&zero,&zero,&zero,v3df_dontpan);
MNU_UpLevel();
@ -4704,10 +4706,9 @@ MNU_CheckForMenus(void)
}
else
{
if ((KEY_PRESSED(KEYSC_ESC) || BUTTON(gamefunc_Show_Menu)) && dimensionmode == 3 && !ConPanel)
if ((KEY_PRESSED(KEYSC_ESC)) && dimensionmode == 3 && !ConPanel)
{
KEY_PRESSED(KEYSC_ESC) = 0;
CONTROL_ClearButton(gamefunc_Show_Menu);
KB_ClearKeysDown();
// setup sliders/buttons
MNU_InitMenus();

View file

@ -74,13 +74,6 @@ void ResetPalette(PLAYERp pp);
void ExitMenus(void);
void ResetMenuInput(void);
#define BUTTONSET(x,value) \
( \
((x)>31) ? \
(CONTROL_ButtonState2 |= (value<<((x)-32))) : \
(CONTROL_ButtonState1 |= (value<<(x))) \
)
extern SWBOOL BorderAdjust;
extern SWBOOL MultiPlayQuitFlag;

View file

@ -41,7 +41,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "text.h"
#include "common_game.h"
#include "function.h"
#include "gamecontrol.h"
#include "control.h"
#include "trigger.h"

View file

@ -38,7 +38,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
//#include "mytypes.h"
//#include "control.h"
//#include "function.h"
//#include "gamecontrol.h"
#include "network.h"
//#include "symutil.h"

View file

@ -39,7 +39,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "control.h"
#include "config.h"
#include "sounds.h"
#include "function.h"
#include "gamecontrol.h"
#include "rts.h"
@ -56,8 +56,6 @@ BEGIN_SW_NS
void SetupGameButtons(void)
{
// processes array from function.h - char * gamefunctions[];
short gamefunc;
for (gamefunc = 0; gamefunc < NUMGAMEFUNCTIONS; gamefunc++)
@ -163,7 +161,7 @@ void TermSetup(void)
#include "control.h"
#include "config.h"
#include "sounds.h"
#include "function.h"
#include "gamecontrol.h"
#include "rts.h"
#include "timer.h"
@ -370,13 +368,6 @@ void main()
printf("x=%6ld y=%6ld z=%6ld yaw=%6ld pitch=%6ld roll=%6ld\n",
info.dx,info.dy,info.dz,info.dyaw,info.dpitch,info.droll);
// Get Keyboard input and set appropiate game function states
for (i=0; i<NUMGAMEFUNCTIONS; i++)
{
if (BUTTON(i) && !BUTTONHELD(i))
{
printf("%s\n",gamefunctions[i]);
}
}
for (i=0; i<10; i++)
{
if (KB_KeyPressed(sc_F1+i))

View file

@ -38,7 +38,7 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
#include "gamedefs.h"
#include "common_game.h"
#include "config.h"
#include "function.h"
#include "gamecontrol.h"
#include "rts.h"

View file

@ -0,0 +1,55 @@
"Move_Forward", "W", "Kpad8"
"Move_Backward", "S", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Turn_Around", "BakSpc"
"Strafe", "LAlt", "RAlt"
"Strafe_Left", "A"
"Strafe_Right", "D"
"Jump", "Space", "/"
"Crouch", "LCtrl"
"Run", "LShift", "RShift"
"AutoRun", "CapLck"
"Open", "E"
"Weapon_Fire", "RCtrl"
"Weapon_Special_Fire", "X"
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Aim_Center", "KPad5"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Tilt_Left", "Insert", "Kpad0"
"Tilt_Right", "Delete", "Kpad."
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory_Use", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Map_Toggle", "Tab"
"Map_Follow_Mode", "F"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Send_Message", "T"
"See_Coop_View", "K"
"See_Chase_View", "F7"
"Mouse_Aiming", "U"
"Toggle_Crosshair", "I"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "Y"
"BeastVision", "B"
"CrystalBall", "C"
"JumpBoots", "J"
"MedKit", "M"
"ProximityBombs", "P"
"RemoteBombs", "R"
"Show_Console", "`"

View file

@ -0,0 +1,55 @@
"Move_Forward", "Up", "Kpad8"
"Move_Backward", "Down", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Turn_Around", "BakSpc"
"Strafe", "LAlt", "RAlt"
"Strafe_Left", ","
"Strafe_Right", "."
"Jump", "A", "/"
"Crouch", "Z"
"Run", "LShift", "RShift"
"AutoRun", "CapLck"
"Open", "Space"
"Weapon_Fire", "LCtrl", "RCtrl"
"Weapon_Special_Fire", "X"
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Aim_Center", "KPad5"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Tilt_Left", "Insert", "Kpad0"
"Tilt_Right", "Delete", "Kpad."
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory_Use", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Map_Toggle", "Tab"
"Map_Follow_Mode", "F"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Send_Message", "T"
"See_Coop_View", "K"
"See_Chase_View", "F7"
"Mouse_Aiming", "U"
"Toggle_Crosshair", "I"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "W"
"BeastVision", "B"
"CrystalBall", "C"
"JumpBoots", "J"
"MedKit", "M"
"ProximityBombs", "P"
"RemoteBombs", "R"
"Show_Console", "`"

View file

@ -0,0 +1,63 @@
"Move_Forward", "W", "Kpad8"
"Move_Backward", "S", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "RCtrl"
"Open", "E"
"Run", "LShift", "RShift"
"Alt_Fire"
"Jump", "Space", "/"
"Crouch", "LCtrl"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", "A"
"Strafe_Right", "D"
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Holo_Duke", "H"
"Jetpack", "J"
"NightVision", "N"
"MedKit", "M"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "Y"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming"
"Toggle_Crosshair"
"Steroids", "R"
"Quick_Kick", "Q"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "`"
"Show_DukeMatch_Scores"
"Dpad_Select"
"Dpad_Aiming"
"AutoRun", "CapLck"
"Last_Used_Weapon", "X"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Alt_Weapon"
"Third_Person_View", "F7"
"Toggle_Crouch", "C"

View file

@ -0,0 +1,63 @@
"Move_Forward", "Up", "Kpad8"
"Move_Backward", "Down", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "LCtrl", "RCtrl"
"Open", "Space"
"Run", "LShift", "RShift"
"Alt_Fire"
"Jump", "A", "/"
"Crouch", "Z"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", ","
"Strafe_Right", "."
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Holo_Duke", "H"
"Jetpack", "J"
"NightVision", "N"
"MedKit", "M"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "W"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming", "U"
"Toggle_Crosshair", "I"
"Steroids", "R"
"Quick_Kick", "`"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "C"
"Show_DukeMatch_Scores"
"Dpad_Select"
"Dpad_Aiming"
"AutoRun", "CapLck"
"Last_Used_Weapon"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Alt_Weapon"
"Third_Person_View", "F7"
"Toggle_Crouch"

View file

@ -0,0 +1,57 @@
"Move_Forward", "W", "Kpad8"
"Move_Backward", "S", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "RCtrl"
"Open", "E"
"Run", "LShift", "RShift"
"Alt_Fire"
"Jump", "Space", "/"
"Crouch", "LCtrl"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", "A"
"Strafe_Right", "D"
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "Y"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming"
"Toggle_Crosshair"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "`"
"Show_DukeMatch_Scores"
"Dpad_Select"
"Dpad_Aiming"
"AutoRun", "CapLck"
"Last_Used_Weapon", "X"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Alt_Weapon"
"Third_Person_View", "F7"
"Toggle_Crouch", "C"

View file

@ -0,0 +1,57 @@
"Move_Forward", "Up", "Kpad8"
"Move_Backward", "Down", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "LCtrl", "RCtrl"
"Open", "Space"
"Run", "LShift", "RShift"
"Alt_Fire"
"Jump", "A", "/"
"Crouch", "Z"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", ","
"Strafe_Right", "."
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "W"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming", "U"
"Toggle_Crosshair", "I"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "C"
"Show_DukeMatch_Scores"
"Dpad_Select"
"Dpad_Aiming"
"AutoRun", "CapLck"
"Last_Used_Weapon"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Alt_Weapon"
"Third_Person_View", "F7"
"Toggle_Crouch"

View file

@ -0,0 +1,63 @@
"Move_Forward", "W", "Kpad8"
"Move_Backward", "S", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "RCtrl"
"Open", "E"
"Run", "LShift", "RShift"
"Alt_Fire"
"Jump", "Space", "/"
"Crouch", "LCtrl"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", "A"
"Strafe_Right", "D"
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Holo_Duke", "H"
"Jetpack", "J"
"NightVision", "N"
"MedKit", "M"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "Y"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming"
"Toggle_Crosshair"
"Steroids", "R"
"Quick_Kick", "Q"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "`"
"Show_DukeMatch_Scores"
"Dpad_Select"
"Dpad_Aiming"
"AutoRun", "CapLck"
"Last_Used_Weapon", "X"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Alt_Weapon"
"Third_Person_View", "F7"
"Toggle_Crouch", "C"

View file

@ -0,0 +1,63 @@
"Move_Forward", "Up", "Kpad8"
"Move_Backward", "Down", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "LCtrl", "RCtrl"
"Open", "Space"
"Run", "LShift", "RShift"
"Alt_Fire"
"Jump", "A", "/"
"Crouch", "Z"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", ","
"Strafe_Right", "."
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Holo_Duke", "H"
"Jetpack", "J"
"NightVision", "N"
"MedKit", "M"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "W"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming", "U"
"Toggle_Crosshair", "I"
"Steroids", "R"
"Quick_Kick", "`"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "C"
"Show_DukeMatch_Scores"
"Dpad_Select"
"Dpad_Aiming"
"AutoRun", "CapLck"
"Last_Used_Weapon"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Alt_Weapon"
"Third_Person_View", "F7"
"Toggle_Crouch"

View file

@ -0,0 +1,62 @@
"Move_Forward", "W", "Kpad8"
"Move_Backward", "S", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "RCtrl"
"Open", "E"
"Run", "LShift", "RShift"
"AutoRun", "CapLck"
"Jump", "Space", "/"
"Crouch", "LCtrl"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", "A"
"Strafe_Right", "D"
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Holo_Duke", "B"
"Jetpack", "C"
"NightVision", "Y"
"MedKit", "R"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "E"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming"
"Toggle_Crosshair"
"Steroids", "M"
"Quick_Kick", "Q"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "`"
"Show_DukeMatch_Scores"
"Dpad_Select",+
"Dpad_Aiming"
"Alternate_Weapon"
"Last_Used_Weapon", "X"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Third_Person_View", "F7"
"Toggle_Crouch"

View file

@ -0,0 +1,63 @@
"Move_Forward", "Up", "Kpad8"
"Move_Backward", "Down", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "LCtrl", "RCtrl"
"Open", "Space"
"Run", "LShift", "RShift"
"AutoRun", "CapLck"
"Jump", "A", "/"
"Crouch", "Z"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", ","
"Strafe_Right", "."
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Holo_Duke", "B"
"Jetpack", "C"
"NightVision", "Y"
"MedKit", "W"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "E"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming", "U"
"Toggle_Crosshair", "I"
"Steroids", "M"
"Quick_Kick", "`"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "V"
"Show_DukeMatch_Scores"
"Dpad_Select"
"Dpad_Aiming"
"Alternate_Weapon"
"Last_Used_Weapon"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Third_Person_View", "F7"
"Toggle_Crouch"

View file

@ -0,0 +1,62 @@
"Move_Forward", "W", "Kpad8"
"Move_Backward", "S", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "RCtrl"
"Open", "E"
"Run", "LShift", "RShift"
"AutoRun", "CapLck"
"Jump", "Space", "/"
"Crouch", "LCtrl"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", "A"
"Strafe_Right", "D"
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Holo_Duke", "B"
"Jetpack", "C"
"NightVision", "Y"
"MedKit", "R"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "E"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming"
"Toggle_Crosshair"
"Steroids", "M"
"Quick_Kick", "Q"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "`"
"Show_DukeMatch_Scores"
"Dpad_Select",+
"Dpad_Aiming"
"Alternate_Weapon"
"Last_Used_Weapon", "X"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Third_Person_View", "F7"
"Toggle_Crouch"

View file

@ -0,0 +1,63 @@
"Move_Forward", "Up", "Kpad8"
"Move_Backward", "Down", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "LCtrl", "RCtrl"
"Open", "Space"
"Run", "LShift", "RShift"
"AutoRun", "CapLck"
"Jump", "A", "/"
"Crouch", "Z"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", ","
"Strafe_Right", "."
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Holo_Duke", "B"
"Jetpack", "C"
"NightVision", "Y"
"MedKit", "W"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "E"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming", "U"
"Toggle_Crosshair", "I"
"Steroids", "M"
"Quick_Kick", "`"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "V"
"Show_DukeMatch_Scores"
"Dpad_Select"
"Dpad_Aiming"
"Alternate_Weapon"
"Last_Used_Weapon"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Third_Person_View", "F7"
"Toggle_Crouch"

View file

@ -0,0 +1,50 @@
"Move_Forward", "W"
"Move_Backward", "S"
"Turn_Left"
"Turn_Right"
"Strafe"
"Fire"
"Open", "E"
"Run", "LShift"
"AutoRun", "CapLck"
"Jump", "Space"
"Crouch", "LAlt"
"Look_Up"
"Look_Down"
"Strafe_Left", "A"
"Strafe_Right", "D"
"Aim_Up"
"Aim_Down"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter"
"Inventory_Left", "["
"Inventory_Right", "]"
"MedKit", "M"
"Smoke_Bomb", "B"
"Nightvision", "N"
"Gas_Bomb", "G"
"Flash_Bomb", "F"
"Caltrops", "C"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-"
"Enlarge_Screen", "="
"Center_View"
"Holster_Weapon", "H"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming", "U"
"Toggle_Crosshair", "I"
"Next_Weapon"
"Previous_Weapon"
"Show_Console", "NumLck"

View file

@ -0,0 +1,50 @@
"Move_Forward", "Up", "Kpad8"
"Move_Backward", "Down", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "LCtrl", "RCtrl"
"Open", "Space"
"Run", "LShift", "RShift"
"AutoRun", "CapLck"
"Jump", "A", "/"
"Crouch", "Z"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Strafe_Left", ","
"Strafe_Right", "."
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"MedKit", "M"
"Smoke_Bomb", "S"
"Nightvision", "N"
"Gas_Bomb", "G"
"Flash_Bomb", "F"
"Caltrops", "C"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming", "U"
"Toggle_Crosshair", "I"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "NumLck"

View file

@ -0,0 +1,63 @@
"Move_Forward", "W", "Kpad8"
"Move_Backward", "S", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "RCtrl"
"Open", "E"
"Run", "LShift", "RShift"
"Alt_Fire"
"Jump", "Space", "/"
"Crouch", "LCtrl"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", "A"
"Strafe_Right", "D"
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Holo_Duke", "H"
"Jetpack", "J"
"NightVision", "N"
"MedKit", "M"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "Y"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming"
"Toggle_Crosshair"
"Steroids", "R"
"Quick_Kick", "Q"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "`"
"Show_DukeMatch_Scores"
"Dpad_Select"
"Dpad_Aiming"
"AutoRun", "CapLck"
"Last_Used_Weapon", "X"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Alt_Weapon"
"Third_Person_View", "F7"
"Toggle_Crouch", "C"

View file

@ -0,0 +1,63 @@
"Move_Forward", "Up", "Kpad8"
"Move_Backward", "Down", "Kpad2"
"Turn_Left", "Left", "Kpad4"
"Turn_Right", "Right", "KPad6"
"Strafe", "LAlt", "RAlt"
"Fire", "LCtrl", "RCtrl"
"Open", "Space"
"Run", "LShift", "RShift"
"Alt_Fire"
"Jump", "A", "/"
"Crouch", "Z"
"Look_Up", "PgUp", "Kpad9"
"Look_Down", "PgDn", "Kpad3"
"Look_Left", "Insert", "Kpad0"
"Look_Right", "Delete", "Kpad."
"Strafe_Left", ","
"Strafe_Right", "."
"Aim_Up", "Home", "KPad7"
"Aim_Down", "End", "Kpad1"
"Weapon_1", "1"
"Weapon_2", "2"
"Weapon_3", "3"
"Weapon_4", "4"
"Weapon_5", "5"
"Weapon_6", "6"
"Weapon_7", "7"
"Weapon_8", "8"
"Weapon_9", "9"
"Weapon_10", "0"
"Inventory", "Enter", "KpdEnt"
"Inventory_Left", "["
"Inventory_Right", "]"
"Holo_Duke", "H"
"Jetpack", "J"
"NightVision", "N"
"MedKit", "M"
"TurnAround", "BakSpc"
"SendMessage", "T"
"Map", "Tab"
"Shrink_Screen", "-", "Kpad-"
"Enlarge_Screen", "=", "Kpad+"
"Center_View", "KPad5"
"Holster_Weapon", "ScrLck"
"Show_Opponents_Weapon", "W"
"Map_Follow_Mode", "F"
"See_Coop_View", "K"
"Mouse_Aiming", "U"
"Toggle_Crosshair", "I"
"Steroids", "R"
"Quick_Kick", "`"
"Next_Weapon", "'"
"Previous_Weapon", ";"
"Show_Console", "C"
"Show_DukeMatch_Scores"
"Dpad_Select"
"Dpad_Aiming"
"AutoRun", "CapLck"
"Last_Used_Weapon"
"Quick_Save", "F6"
"Quick_Load", "F9"
"Alt_Weapon"
"Third_Person_View", "F7"
"Toggle_Crouch"