]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Implement reset button in input dialog. Fixes #1170
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 6 Dec 2014 03:19:46 +0000 (14:19 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 6 Dec 2014 03:19:46 +0000 (14:19 +1100)
binds-default.cfg [new file with mode: 0644]
defaultXonotic.cfg
qcsrc/menu/xonotic/dialog_settings_input.c
qcsrc/menu/xonotic/keybinder.c

diff --git a/binds-default.cfg b/binds-default.cfg
new file mode 100644 (file)
index 0000000..f48842f
--- /dev/null
@@ -0,0 +1,155 @@
+// alias for switching the teamselect menu
+bind f5 menu_showteamselect
+
+bind f6 team_auto
+
+bind f7 menu_showsandboxtools
+
+// movement
+bind w +forward
+bind a +moveleft
+bind s +back
+bind d +moveright
+bind UPARROW +forward
+bind LEFTARROW +moveleft
+bind DOWNARROW +back
+bind RIGHTARROW +moveright
+bind SHIFT +crouch
+bind ENTER +jump
+bind SPACE +jump
+
+// weapons
+bind 0 weapon_group_0
+bind 1 weapon_group_1
+bind 2 weapon_group_2
+bind 3 weapon_group_3
+bind 4 weapon_group_4
+bind 5 weapon_group_5
+bind 6 weapon_group_6
+bind 7 weapon_group_7
+bind 8 weapon_group_8
+bind 9 weapon_group_9
+bind q weaplast
+bind MOUSE1 +fire
+bind MOUSE2 +fire2
+bind MOUSE3 togglezoom
+bind MOUSE4 weaplast
+bind MOUSE5 +hook
+bind MWHEELUP weapnext
+bind MWHEELDOWN weapprev
+bind r reload
+bind BACKSPACE dropweapon
+bind g dropweapon
+bind f +use
+bind v +button8 // drag object
+
+// misc
+bind e +hook
+bind ` toggleconsole
+bind ~ toggleconsole
+bind TAB +showscores
+bind ESCAPE togglemenu
+bind t messagemode
+bind y messagemode2
+bind z messagemode2
+bind u "+con_chat_maximize"
+bind m +hud_panel_radar_maximized
+bind i +show_info
+bind PAUSE pause
+bind F10 menu_showquitdialog
+bind F11 disconnect
+bind F12 screenshot
+bind F4 ready
+bind ALT +showaccuracy
+
+// Gamepad defaults. Tested with Logitech Rumblepad 2, I hope similar ones works as well.
+bind JOY1 "+crouch"
+bind JOY2 "+jump"
+bind JOY3 "weapprev"
+bind JOY4 "weapnext"
+bind JOY5 "+fire2"
+bind JOY6 "+fire"
+bind JOY7 "+zoom"
+bind JOY8 "dropweapon"
+bind JOY9 "menu_showteamselect"
+bind JOY10 "+show_info"
+bind JOY11 "+showscores"
+bind JOY12 "+con_chat_maximize"
+seta joyadvanced "1"
+seta joyadvaxisr "2"
+seta joyadvaxisx "3"
+seta joyadvaxisy "1"
+seta joyadvaxisz "4"
+seta joysidesensitivity "1.0"
+seta joypitchsensitivity "0.9"
+seta joyyawsensitivity "-1.8"
+// SDL only
+seta joy_deadzoneforward "0.05"
+seta joy_deadzonepitch "0.05"
+seta joy_deadzoneside "0.05"
+seta joy_deadzoneup "0.05"
+seta joy_deadzoneyaw "0.05"
+seta joy_sensitivitypitch "0.9"
+seta joy_sensitivityyaw "-1.8"
+
+// team say
+bind kp_ins messagemode
+bind kp_del messagemode2
+bind kp_end "+userbind 1"
+bind kp_downarrow "+userbind 2"
+bind kp_pgdn "+userbind 3"
+bind kp_leftarrow "+userbind 4"
+bind kp_5 "+userbind 6"
+bind kp_rightarrow "+userbind 7"
+bind kp_home "+userbind 9"
+bind kp_uparrow "+userbind 10"
+bind kp_pgup "+userbind 11"
+bind kp_multiply "+userbind 12"
+bind kp_slash "+userbind 13"
+bind kp_enter "+userbind 16"
+bind kp_plus "+userbind 17"
+bind kp_minus "+userbind 18"
+
+bind F1 vyes
+bind F2 vno
+
+//used for spectate/observer mode
+bind F3 spec
+
+// usercommands. These can be edited and bound by the menu.
+seta "userbind1_press" "say_team quad soon";  seta "userbind1_release" "";  seta "userbind1_description" "team: quad soon"
+seta "userbind2_press" "say_team free item %x^7 (l:%y^7); g_waypointsprite_team_here_p";  seta "userbind2_release" "";  seta "userbind2_description" "team: free item, icon"
+seta "userbind3_press" "say_team took item (l:%l^7); g_waypointsprite_team_here";  seta "userbind3_release" "";  seta "userbind3_description" "team: took item, icon"
+seta "userbind4_press" "say_team negative";  seta "userbind4_release" "";  seta "userbind4_description" "team: negative"
+seta "userbind5_press" "say_team positive";  seta "userbind5_release" "";  seta "userbind5_description" "team: positive"
+seta "userbind6_press" "say_team need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7); g_waypointsprite_team_helpme; cmd voice needhelp";  seta "userbind6_release" "";  seta "userbind6_description" "team: need help, icon"
+seta "userbind7_press" "say_team enemy seen (l:%y^7); g_waypointsprite_team_danger_p; cmd voice incoming";  seta "userbind7_release" "";  seta "userbind7_description" "team: enemy seen, icon"
+seta "userbind8_press" "say_team flag seen (l:%y^7); g_waypointsprite_team_here_p; cmd voice seenflag";  seta "userbind8_release" "";  seta "userbind8_description" "team: flag seen, icon"
+seta "userbind9_press" "say_team defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7); g_waypointsprite_team_here";  seta "userbind9_release" "";  seta "userbind9_description" "team: defending, icon"
+seta "userbind10_press" "say_team roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7); g_waypointsprite_team_here";  seta "userbind10_release" "";  seta "userbind10_description" "team: roaming, icon"
+seta "userbind11_press" "say_team attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7); g_waypointsprite_team_here";  seta "userbind11_release" "";  seta "userbind11_description" "team: attacking, icon"
+seta "userbind12_press" "say_team killed flagcarrier (l:%y^7); g_waypointsprite_team_here_p"; seta "userbind12_release" ""; seta "userbind12_description" "team: killed flag, icon"
+seta "userbind13_press" "say_team dropped flag (l:%d^7); g_waypointsprite_team_here_d"; seta "userbind13_release" ""; seta "userbind13_description" "team: dropped flag, icon"
+seta "userbind14_press" "say_team dropped gun %w^7 (l:%l^7); g_waypointsprite_team_here; wait; dropweapon"; seta "userbind14_release" ""; seta "userbind14_description" "team: drop gun, icon"
+// TODO change this to "use" once we can
+seta "userbind15_press" "say_team dropped flag/key %w^7 (l:%l^7); g_waypointsprite_team_here; wait; +use"; seta "userbind15_release" "-use"; seta "userbind15_description" "team: drop flag/key, icon"
+seta "userbind16_press" "say :-) / nice one"; seta "userbind16_release" ""; seta "userbind16_description" "chat: nice one"
+seta "userbind17_press" "say good game"; seta "userbind17_release" ""; seta "userbind17_description" "chat: good game"
+seta "userbind18_press" "say hi / good luck and have fun"; seta "userbind18_release" ""; seta "userbind18_description" "chat: hi / good luck"
+seta "userbind19_press" "+showscores; +con_chat_maximize"; seta "userbind19_release" "-showscores; -con_chat_maximize"; seta "userbind19_description" "scoreboard / chat history"
+seta "userbind20_press" "toggle cl_capturevideo"; seta "userbind20_release" ""; seta "userbind20_description" "toggle recording .avi"
+seta "userbind21_press" "toggle vid_fullscreen; vid_restart"; seta "userbind21_release" ""; seta "userbind21_description" "toggle fullscreen"
+seta "userbind22_press" ""; seta "userbind22_release" ""; seta "userbind22_description" ""
+seta "userbind23_press" ""; seta "userbind23_release" ""; seta "userbind23_description" ""
+seta "userbind24_press" ""; seta "userbind24_release" ""; seta "userbind24_description" ""
+seta "userbind25_press" ""; seta "userbind25_release" ""; seta "userbind25_description" ""
+seta "userbind26_press" ""; seta "userbind26_release" ""; seta "userbind26_description" ""
+seta "userbind27_press" ""; seta "userbind27_release" ""; seta "userbind27_description" ""
+seta "userbind28_press" ""; seta "userbind28_release" ""; seta "userbind28_description" ""
+seta "userbind29_press" ""; seta "userbind29_release" ""; seta "userbind29_description" ""
+seta "userbind30_press" ""; seta "userbind30_release" ""; seta "userbind30_description" ""
+seta "userbind31_press" ""; seta "userbind31_release" ""; seta "userbind31_description" ""
+seta "userbind32_press" ""; seta "userbind32_release" ""; seta "userbind32_description" ""
+alias _userbind_call "${$1}"
+alias +userbind "_userbind_call userbind${1}_press"
+alias -userbind "_userbind_call userbind${1}_release"
\ No newline at end of file
index 08847992870450fdc96adf37df3db21674ec100b..11f18bbe434f66742e67edce812770891351c558 100644 (file)
@@ -44,8 +44,6 @@ alias dropweapon "impulse 17"
 alias +show_info +button7
 alias -show_info -button7
 
-bind f6 team_auto
-
 // merge lightmaps up to 2048x2048 textures
 mod_q3bsp_lightmapmergepower 4
 
@@ -459,8 +457,6 @@ seta menu_sandbox_edit_physics 1
 seta menu_sandbox_edit_force 1
 seta menu_sandbox_edit_material ""
 
-bind f7 menu_showsandboxtools
-
 seta menu_monsters_edit_spawn ""
 seta menu_monsters_edit_skin 0
 seta menu_monsters_edit_movetarget 1
@@ -631,19 +627,6 @@ alias togglezoom "${_togglezoom}zoom"
 
 alias reload "impulse 20"
 
-// movement
-bind w +forward
-bind a +moveleft
-bind s +back
-bind d +moveright
-bind UPARROW +forward
-bind LEFTARROW +moveleft
-bind DOWNARROW +back
-bind RIGHTARROW +moveright
-bind SHIFT +crouch
-bind ENTER +jump
-bind SPACE +jump
-
 // weapons
 alias weapon_group_1 "impulse 1"
 alias weapon_group_2 "impulse 2"
@@ -656,102 +639,6 @@ alias weapon_group_8 "impulse 8"
 alias weapon_group_9 "impulse 9"
 alias weapon_group_0 "impulse 14" // cycles the superweapons
 exec weapons.cfg
-bind 0 weapon_group_0
-bind 1 weapon_group_1
-bind 2 weapon_group_2
-bind 3 weapon_group_3
-bind 4 weapon_group_4
-bind 5 weapon_group_5
-bind 6 weapon_group_6
-bind 7 weapon_group_7
-bind 8 weapon_group_8
-bind 9 weapon_group_9
-bind q weaplast
-bind MOUSE1 +fire
-bind MOUSE2 +fire2
-bind MOUSE3 togglezoom
-bind MOUSE4 weaplast
-bind MOUSE5 +hook
-bind MWHEELUP weapnext
-bind MWHEELDOWN weapprev
-bind r reload
-bind BACKSPACE dropweapon
-bind g dropweapon
-bind f +use
-bind v +button8 // drag object
-
-// misc
-bind e +hook
-bind ` toggleconsole
-bind ~ toggleconsole
-bind TAB +showscores
-bind ESCAPE togglemenu
-bind t messagemode
-bind y messagemode2
-bind z messagemode2
-bind u "+con_chat_maximize"
-bind m +hud_panel_radar_maximized
-bind i +show_info
-bind PAUSE pause
-bind F10 menu_showquitdialog
-bind F11 disconnect
-bind F12 screenshot
-bind F4 ready
-bind ALT +showaccuracy
-
-// Gamepad defaults. Tested with Logitech Rumblepad 2, I hope similar ones works as well.
-bind JOY1 "+crouch"
-bind JOY2 "+jump"
-bind JOY3 "weapprev"
-bind JOY4 "weapnext"
-bind JOY5 "+fire2"
-bind JOY6 "+fire"
-bind JOY7 "+zoom"
-bind JOY8 "dropweapon"
-bind JOY9 "menu_showteamselect"
-bind JOY10 "+show_info"
-bind JOY11 "+showscores"
-bind JOY12 "+con_chat_maximize"
-seta joyadvanced "1"
-seta joyadvaxisr "2"
-seta joyadvaxisx "3"
-seta joyadvaxisy "1"
-seta joyadvaxisz "4"
-seta joysidesensitivity "1.0"
-seta joypitchsensitivity "0.9"
-seta joyyawsensitivity "-1.8"
-// SDL only
-seta joy_deadzoneforward "0.05"
-seta joy_deadzonepitch "0.05"
-seta joy_deadzoneside "0.05"
-seta joy_deadzoneup "0.05"
-seta joy_deadzoneyaw "0.05"
-seta joy_sensitivitypitch "0.9"
-seta joy_sensitivityyaw "-1.8"
-
-// team say
-bind kp_ins messagemode
-bind kp_del messagemode2
-bind kp_end "+userbind 1"
-bind kp_downarrow "+userbind 2"
-bind kp_pgdn "+userbind 3"
-bind kp_leftarrow "+userbind 4"
-bind kp_5 "+userbind 6"
-bind kp_rightarrow "+userbind 7"
-bind kp_home "+userbind 9"
-bind kp_uparrow "+userbind 10"
-bind kp_pgup "+userbind 11"
-bind kp_multiply "+userbind 12"
-bind kp_slash "+userbind 13"
-bind kp_enter "+userbind 16"
-bind kp_plus "+userbind 17"
-bind kp_minus "+userbind 18"
-
-bind F1 vyes
-bind F2 vno
-
-//used for spectate/observer mode
-bind F3 spec
 
 // score log
 set sv_logscores_console 0     "print scores to server console"
@@ -897,43 +784,7 @@ set g_banned_list_idmode "1"       "when set, the IP banning system always uses the ID
 
 r_labelsprites_scale 0.40625 // labels sprites get displayed at 0.5x from 640x480 to 1280x1024, and at 1x from 1600x1200 onwards
 
-// usercommands. These can be edited and bound by the menu.
-seta "userbind1_press" "say_team quad soon";  seta "userbind1_release" "";  seta "userbind1_description" "team: quad soon"
-seta "userbind2_press" "say_team free item %x^7 (l:%y^7); g_waypointsprite_team_here_p";  seta "userbind2_release" "";  seta "userbind2_description" "team: free item, icon"
-seta "userbind3_press" "say_team took item (l:%l^7); g_waypointsprite_team_here";  seta "userbind3_release" "";  seta "userbind3_description" "team: took item, icon"
-seta "userbind4_press" "say_team negative";  seta "userbind4_release" "";  seta "userbind4_description" "team: negative"
-seta "userbind5_press" "say_team positive";  seta "userbind5_release" "";  seta "userbind5_description" "team: positive"
-seta "userbind6_press" "say_team need help (l:%l^7) (h:%h^7 a:%a^7 w:%w^7); g_waypointsprite_team_helpme; cmd voice needhelp";  seta "userbind6_release" "";  seta "userbind6_description" "team: need help, icon"
-seta "userbind7_press" "say_team enemy seen (l:%y^7); g_waypointsprite_team_danger_p; cmd voice incoming";  seta "userbind7_release" "";  seta "userbind7_description" "team: enemy seen, icon"
-seta "userbind8_press" "say_team flag seen (l:%y^7); g_waypointsprite_team_here_p; cmd voice seenflag";  seta "userbind8_release" "";  seta "userbind8_description" "team: flag seen, icon"
-seta "userbind9_press" "say_team defending (l:%l^7) (h:%h^7 a:%a^7 w:%w^7); g_waypointsprite_team_here";  seta "userbind9_release" "";  seta "userbind9_description" "team: defending, icon"
-seta "userbind10_press" "say_team roaming (l:%l^7) (h:%h^7 a:%a^7 w:%w^7); g_waypointsprite_team_here";  seta "userbind10_release" "";  seta "userbind10_description" "team: roaming, icon"
-seta "userbind11_press" "say_team attacking (l:%l^7) (h:%h^7 a:%a^7 w:%w^7); g_waypointsprite_team_here";  seta "userbind11_release" "";  seta "userbind11_description" "team: attacking, icon"
-seta "userbind12_press" "say_team killed flagcarrier (l:%y^7); g_waypointsprite_team_here_p"; seta "userbind12_release" ""; seta "userbind12_description" "team: killed flag, icon"
-seta "userbind13_press" "say_team dropped flag (l:%d^7); g_waypointsprite_team_here_d"; seta "userbind13_release" ""; seta "userbind13_description" "team: dropped flag, icon"
-seta "userbind14_press" "say_team dropped gun %w^7 (l:%l^7); g_waypointsprite_team_here; wait; dropweapon"; seta "userbind14_release" ""; seta "userbind14_description" "team: drop gun, icon"
-// TODO change this to "use" once we can
-seta "userbind15_press" "say_team dropped flag/key %w^7 (l:%l^7); g_waypointsprite_team_here; wait; +use"; seta "userbind15_release" "-use"; seta "userbind15_description" "team: drop flag/key, icon"
-seta "userbind16_press" "say :-) / nice one"; seta "userbind16_release" ""; seta "userbind16_description" "chat: nice one"
-seta "userbind17_press" "say good game"; seta "userbind17_release" ""; seta "userbind17_description" "chat: good game"
-seta "userbind18_press" "say hi / good luck and have fun"; seta "userbind18_release" ""; seta "userbind18_description" "chat: hi / good luck"
-seta "userbind19_press" "+showscores; +con_chat_maximize"; seta "userbind19_release" "-showscores; -con_chat_maximize"; seta "userbind19_description" "scoreboard / chat history"
-seta "userbind20_press" "toggle cl_capturevideo"; seta "userbind20_release" ""; seta "userbind20_description" "toggle recording .avi"
-seta "userbind21_press" "toggle vid_fullscreen; vid_restart"; seta "userbind21_release" ""; seta "userbind21_description" "toggle fullscreen"
-seta "userbind22_press" ""; seta "userbind22_release" ""; seta "userbind22_description" ""
-seta "userbind23_press" ""; seta "userbind23_release" ""; seta "userbind23_description" ""
-seta "userbind24_press" ""; seta "userbind24_release" ""; seta "userbind24_description" ""
-seta "userbind25_press" ""; seta "userbind25_release" ""; seta "userbind25_description" ""
-seta "userbind26_press" ""; seta "userbind26_release" ""; seta "userbind26_description" ""
-seta "userbind27_press" ""; seta "userbind27_release" ""; seta "userbind27_description" ""
-seta "userbind28_press" ""; seta "userbind28_release" ""; seta "userbind28_description" ""
-seta "userbind29_press" ""; seta "userbind29_release" ""; seta "userbind29_description" ""
-seta "userbind30_press" ""; seta "userbind30_release" ""; seta "userbind30_description" ""
-seta "userbind31_press" ""; seta "userbind31_release" ""; seta "userbind31_description" ""
-seta "userbind32_press" ""; seta "userbind32_release" ""; seta "userbind32_description" ""
-alias _userbind_call "${$1}"
-alias +userbind "_userbind_call userbind${1}_press"
-alias -userbind "_userbind_call userbind${1}_release"
+exec binds-default.cfg
 
 // we must change its default from 1.0 to 1 to be consistent with menuqc
 set slowmo 1
@@ -1179,8 +1030,6 @@ seta cl_clippedspectating 1 "movement collision for spectators so that you can't
 seta cl_autoscreenshot 1 "Take a screenshot upon the end of a match... 0 = Disable completely, 1 = Allow sv_autoscreenshot to take a screenshot when requested, 2 = Always take an autoscreenshot anyway."
 
 // must be at the bottom of this file:
-// alias for switching the teamselect menu
-bind f5 menu_showteamselect
 
 set g_bugrigs 0
 set g_bugrigs_planar_movement 1        "BROTRR bug emulation"
index d8554be4f7af38285bcb259d87ec22a894cd2284..c8ba7c4fd4483defb98d124de8ddbc88c736cf74 100644 (file)
@@ -20,12 +20,15 @@ entity makeXonoticInputSettingsTab()
 void XonoticInputSettingsTab_fill(entity me)
 {
        entity e;
-       entity kb;
+       entity kb = makeXonoticKeyBinder();
 
        me.TR(me);
-               me.TD(me, 1, 3, e = makeXonoticTextLabel(0, _("Key bindings:")));
+               me.TD(me, 1, 2, e = makeXonoticTextLabel(0, _("Key bindings:")));
+               me.TD(me, 1, 1, e = makeXonoticButton(_("Reset all"), '0 0 0'));
+                       e.onClick = KeyBinder_Bind_Reset_All;
+                       e.onClickEntity = kb;
        me.TR(me);
-               me.TD(me, me.rows - 4, 3, kb = makeXonoticKeyBinder());
+               me.TD(me, me.rows - 4, 3, kb);
        me.gotoRC(me, me.rows - 3, 0);
                me.TD(me, 1, 1, e = makeXonoticButton(_("Change key..."), '0 0 0'));
                        e.onClick = KeyBinder_Bind_Change;
index 66c3486a3a91c22747a646153d64d181f4f14302..d54ab6671f95e506950af0de8ce959dd6a9fd5f0 100644 (file)
@@ -238,6 +238,12 @@ void KeyBinder_Bind_Clear(entity btn, entity me)
        localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
        cvar_set("_hud_showbinds_reload", "1");
 }
+void KeyBinder_Bind_Reset_All(entity btn, entity me)
+{
+       localcmd("exec binds-default.cfg\n");
+       localcmd("-zoom\n"); // to make sure we aren't in togglezoom'd state
+       cvar_set("_hud_showbinds_reload", "1");
+}
 void XonoticKeyBinder_clickListBoxItem(entity me, float i, vector where)
 {
        if(i == me.lastClickedServer)