Oops, fixed default bindings not being loaded from pwads.

# Conflicts:
#	src/console/c_bind.cpp
This commit is contained in:
drfrag 2020-02-28 19:03:21 +01:00
parent bf8a5621eb
commit 797037fcde
17 changed files with 63 additions and 366 deletions

View file

@ -746,6 +746,36 @@ CCMD (rebind)
//
//=============================================================================
void C_BindLump(int lump)
{
FScanner sc(lump);
while (sc.GetString())
{
FKeyBindings *dest = &Bindings;
int key;
// bind destination is optional and is the same as the console command
if (sc.Compare("bind"))
{
sc.MustGetString();
}
else if (sc.Compare("doublebind"))
{
dest = &DoubleBindings;
sc.MustGetString();
}
else if (sc.Compare("mapbind"))
{
dest = &AutomapBindings;
sc.MustGetString();
}
key = GetConfigKeyFromName(sc.String);
sc.MustGetString();
dest->SetBind(key, sc.String);
}
}
void C_BindDefaults ()
{
int lump, lastlump = 0;
@ -753,6 +783,9 @@ void C_BindDefaults ()
switch (k_modern)
{
case 0:
defbinds = "DEFBIND0";
break;
case 1:
defbinds = "DEFBIND1";
break;
@ -762,40 +795,14 @@ void C_BindDefaults ()
case 3:
defbinds = "DEFBIND3";
break;
default:
defbinds = "DEFBINDS";
break;
}
while ((lump = Wads.FindLump("DEFBINDS", &lastlump)) != -1)
C_BindLump(lump);
lump = 0;
lastlump = 0;
while ((lump = Wads.FindLump(defbinds, &lastlump)) != -1)
{
FScanner sc(lump);
while (sc.GetString())
{
FKeyBindings *dest = &Bindings;
int key;
// bind destination is optional and is the same as the console command
if (sc.Compare("bind"))
{
sc.MustGetString();
}
else if (sc.Compare("doublebind"))
{
dest = &DoubleBindings;
sc.MustGetString();
}
else if (sc.Compare("mapbind"))
{
dest = &AutomapBindings;
sc.MustGetString();
}
key = GetConfigKeyFromName(sc.String);
sc.MustGetString();
dest->SetBind(key, sc.String);
}
}
C_BindLump(lump);
}
CCMD(binddefaults)

View file

@ -0,0 +1,19 @@
/* Default keybindings for all games */
ctrl +attack
alt +strafe
rightarrow +right
leftarrow +left
uparrow +forward
downarrow +back
, +moveleft
. +moveright
mouse2 +strafe
mouse3 +forward
mouse4 +speed
// Generic joystick buttons
joy1 +attack
joy2 +strafe
joy3 +speed
joy4 +use

View file

@ -1,96 +1,10 @@
/* Default keybindings for all games */
` toggleconsole
1 "slot 1"
2 "slot 2"
3 "slot 3"
4 "slot 4"
5 "slot 5"
6 "slot 6"
7 "slot 7"
8 "slot 8"
9 "slot 9"
0 "slot 0"
[ invprev
] invnext
mwheelleft invprev
mwheelright invnext
enter invuse
- sizedown
= sizeup
shift +speed
space +use
w +forward
s +back
a +moveleft
d +moveright
e +jump
x crouch
mouse1 +attack
mouse2 +altattack
mouse3 +speed
capslock "toggle cl_run"
f1 menu_help
f2 menu_save
f3 menu_load
f4 menu_options
f5 menu_display
f6 quicksave
f7 menu_endgame
f8 togglemessages
f9 quickload
f11 bumpgamma
f10 menu_quit
tab togglemap
pause pause
sysrq screenshot
t messagemode
\ +showscores
f12 spynext
mwheeldown weapnext
mwheelup weapprev
// Originally just for Heretic, Hexen, and Strife.
// I can't see why they shouldn't be for Doom or Chex either.
pgup +moveup
ins +movedown
home land
pgdn +lookup
del +lookdown
end centerview
// Generic joystick buttons
// Xbox 360 / PS2 controllers
pad_a +use
pad_y +jump
rtrigger +attack
ltrigger +altattack
lshoulder weapprev
rshoulder weapnext
dpadleft invprev
dpadright invnext
dpaddown invuse
dpadup togglemap
pad_start pause
pad_back menu_main
lthumb crouch
/* Default automap bindings */
mapbind f am_togglefollow
mapbind g am_togglegrid
mapbind p am_toggletexture
mapbind m am_setmark
mapbind c am_clearmarks
mapbind 0 am_gobig
mapbind rightarrow +am_panright
mapbind leftarrow +am_panleft
mapbind uparrow +am_panup
mapbind downarrow +am_pandown
mapbind - +am_zoomout
mapbind = +am_zoomin
mapbind kp- +am_zoomout
mapbind kp+ +am_zoomin
mapbind mwheelup "am_zoom 1.2"
mapbind mwheeldown "am_zoom -1.2"

View file

@ -1,96 +1,10 @@
/* Default keybindings for all games */
` toggleconsole
1 "slot 1"
2 "slot 2"
3 "slot 3"
4 "slot 4"
5 "slot 5"
6 "slot 6"
7 "slot 7"
8 "slot 8"
9 "slot 9"
0 "slot 0"
[ invprev
] invnext
mwheelleft invprev
mwheelright invnext
enter invuse
- sizedown
= sizeup
shift +speed
space +use
e +forward
d +back
s +moveleft
f +moveright
w +jump
c crouch
mouse1 +attack
mouse2 +altattack
mouse3 +speed
capslock "toggle cl_run"
f1 menu_help
f2 menu_save
f3 menu_load
f4 menu_options
f5 menu_display
f6 quicksave
f7 menu_endgame
f8 togglemessages
f9 quickload
f11 bumpgamma
f10 menu_quit
tab togglemap
pause pause
sysrq screenshot
t messagemode
\ +showscores
f12 spynext
mwheeldown weapnext
mwheelup weapprev
// Originally just for Heretic, Hexen, and Strife.
// I can't see why they shouldn't be for Doom or Chex either.
pgup +moveup
ins +movedown
home land
pgdn +lookup
del +lookdown
end centerview
// Generic joystick buttons
// Xbox 360 / PS2 controllers
pad_a +use
pad_y +jump
rtrigger +attack
ltrigger +altattack
lshoulder weapprev
rshoulder weapnext
dpadleft invprev
dpadright invnext
dpaddown invuse
dpadup togglemap
pad_start pause
pad_back menu_main
lthumb crouch
/* Default automap bindings */
mapbind f am_togglefollow
mapbind g am_togglegrid
mapbind p am_toggletexture
mapbind m am_setmark
mapbind c am_clearmarks
mapbind 0 am_gobig
mapbind rightarrow +am_panright
mapbind leftarrow +am_panleft
mapbind uparrow +am_panup
mapbind downarrow +am_pandown
mapbind - +am_zoomout
mapbind = +am_zoomin
mapbind kp- +am_zoomout
mapbind kp+ +am_zoomin
mapbind mwheelup "am_zoom 1.2"
mapbind mwheeldown "am_zoom -1.2"

View file

@ -1,96 +1,10 @@
/* Default keybindings for all games */
` toggleconsole
1 "slot 1"
2 "slot 2"
3 "slot 3"
4 "slot 4"
5 "slot 5"
6 "slot 6"
7 "slot 7"
8 "slot 8"
9 "slot 9"
0 "slot 0"
[ invprev
] invnext
mwheelleft invprev
mwheelright invnext
enter invuse
- sizedown
= sizeup
shift +speed
space +use
i +forward
k +back
j +moveleft
l +moveright
o +jump
m crouch
mouse1 +attack
mouse2 +altattack
mouse3 +speed
capslock "toggle cl_run"
f1 menu_help
f2 menu_save
f3 menu_load
f4 menu_options
f5 menu_display
f6 quicksave
f7 menu_endgame
f8 togglemessages
f9 quickload
f11 bumpgamma
f10 menu_quit
tab togglemap
pause pause
sysrq screenshot
t messagemode
\ +showscores
f12 spynext
mwheeldown weapnext
mwheelup weapprev
// Originally just for Heretic, Hexen, and Strife.
// I can't see why they shouldn't be for Doom or Chex either.
pgup +moveup
ins +movedown
home land
pgdn +lookup
del +lookdown
end centerview
// Generic joystick buttons
// Xbox 360 / PS2 controllers
pad_a +use
pad_y +jump
rtrigger +attack
ltrigger +altattack
lshoulder weapprev
rshoulder weapnext
dpadleft invprev
dpadright invnext
dpaddown invuse
dpadup togglemap
pad_start pause
pad_back menu_main
lthumb crouch
/* Default automap bindings */
mapbind f am_togglefollow
mapbind g am_togglegrid
mapbind p am_toggletexture
mapbind m am_setmark
mapbind c am_clearmarks
mapbind 0 am_gobig
mapbind rightarrow +am_panright
mapbind leftarrow +am_panleft
mapbind uparrow +am_panup
mapbind downarrow +am_pandown
mapbind - +am_zoomout
mapbind = +am_zoomin
mapbind kp- +am_zoomout
mapbind kp+ +am_zoomin
mapbind mwheelup "am_zoom 1.2"
mapbind mwheeldown "am_zoom -1.2"

View file

@ -18,20 +18,9 @@ mwheelright invnext
enter invuse
- sizedown
= sizeup
ctrl +attack
alt +strafe
shift +speed
space +use
rightarrow +right
leftarrow +left
uparrow +forward
downarrow +back
, +moveleft
. +moveright
mouse1 +attack
mouse2 +strafe
mouse3 +forward
mouse4 +speed
capslock "toggle cl_run"
f1 menu_help
f2 menu_save
@ -62,12 +51,6 @@ pgdn +lookup
del +lookdown
end centerview
// Generic joystick buttons
joy1 +attack
joy2 +strafe
joy3 +speed
joy4 +use
// Xbox 360 / PS2 controllers
pad_a +use
pad_y +jump

View file

@ -1,3 +0,0 @@
/* Default keybindings for Heretic */
backspace "use ArtiTomeOfPower"

View file

@ -1,3 +0,0 @@
/* Default keybindings for Heretic */
backspace "use ArtiTomeOfPower"

View file

@ -1,3 +0,0 @@
/* Default keybindings for Heretic */
backspace "use ArtiTomeOfPower"

View file

@ -1,11 +0,0 @@
/* Default keybindings for Hexen */
backspace invuseall
\ "use ArtiHealth"
0 useflechette
9 "use ArtiBlastRadius"
8 "use ArtiTeleport"
7 "use ArtiTeleportOther"
6 "use ArtiPork"
5 "use ArtiInvulnerability2"
scroll +showscores

View file

@ -1,11 +0,0 @@
/* Default keybindings for Hexen */
backspace invuseall
\ "use ArtiHealth"
0 useflechette
9 "use ArtiBlastRadius"
8 "use ArtiTeleport"
7 "use ArtiTeleportOther"
6 "use ArtiPork"
5 "use ArtiInvulnerability2"
scroll +showscores

View file

@ -1,11 +0,0 @@
/* Default keybindings for Hexen */
backspace invuseall
\ "use ArtiHealth"
0 useflechette
9 "use ArtiBlastRadius"
8 "use ArtiTeleport"
7 "use ArtiTeleportOther"
6 "use ArtiPork"
5 "use ArtiInvulnerability2"
scroll +showscores

View file

@ -0,0 +1,6 @@
/* Default keybindings for Strife */
a +jump
w "showpop 1"
k "showpop 2"

View file

@ -1,10 +1,5 @@
/* Default keybindings for Strife */
c "showpop 1"
backspace invdrop
z "showpop 3"
k "showpop 2"
q invquery
; not done
; h - use health

View file

@ -1,10 +1,5 @@
/* Default keybindings for Strife */
x "showpop 1"
backspace invdrop
z "showpop 3"
k "showpop 2"
q invquery
; not done
; h - use health

View file

@ -1,10 +1,5 @@
/* Default keybindings for Strife */
w "showpop 1"
backspace invdrop
z "showpop 3"
u "showpop 2"
q invquery
; not done
; h - use health

View file

@ -1,10 +1,7 @@
/* Default keybindings for Strife */
a +jump
w "showpop 1"
backspace invdrop
z "showpop 3"
k "showpop 2"
q invquery
; not done