Index: trunk/src/qcommon/q_shared.h =================================================================== --- trunk/src/qcommon/q_shared.h (revision 809) +++ trunk/src/qcommon/q_shared.h (working copy) @@ -1094,26 +1094,26 @@ // usercmd_t->button bits, many of which are generated by the client system, // so they aren't game/cgame only definitions // -#define BUTTON_ATTACK 1 -#define BUTTON_TALK 2 // displays talk balloon and disables actions -#define BUTTON_USE_HOLDABLE 4 -#define BUTTON_GESTURE 8 -#define BUTTON_WALKING 16 // walking can't just be infered from MOVE_RUN +#define BUTTON_ATTACK 0x001 +#define BUTTON_TALK 0x002 // displays talk balloon and disables actions +#define BUTTON_USE_HOLDABLE 0x004 +#define BUTTON_GESTURE 0x008 +#define BUTTON_WALKING 0x010 // walking can't just be infered from MOVE_RUN // because a key pressed late in the frame will // only generate a small move value for that frame // walking will use different animations and // won't generate footsteps -#define BUTTON_ATTACK2 32 -#define BUTTON_NEGATIVE 64 +#define BUTTON_ATTACK2 0x020 +#define BUTTON_NEGATIVE 0x040 // free button for use? -#define BUTTON_GETFLAG 128 -#define BUTTON_GUARDBASE 256 -#define BUTTON_PATROL 512 -#define BUTTON_FOLLOWME 1024 +#define BUTTON_EVO_USE 0x080 +#define BUTTON_GUARDBASE 0x100 // free button for use? +#define BUTTON_PATROL 0x200 // free button for use? +#define BUTTON_FOLLOWME 0x400 // free button for use? -#define BUTTON_ANY 2048 // any key whatsoever +#define BUTTON_ANY 0x800 // any key whatsoever -#define MOVE_RUN 120 // if forwardmove or rightmove are >= MOVE_RUN, +#define MOVE_RUN 120 // if forwardmove or rightmove are >= MOVE_RUN, // then BUTTON_WALKING should be set // usercmd_t is sent to the server each client frame Index: trunk/src/game/g_active.c =================================================================== --- trunk/src/game/g_active.c (revision 809) +++ trunk/src/game/g_active.c (working copy) @@ -1208,7 +1208,7 @@ client->buttons = ucmd->buttons; client->latched_buttons |= client->buttons & ~client->oldbuttons; - if( ( client->buttons & BUTTON_GETFLAG ) && !( client->oldbuttons & BUTTON_GETFLAG ) && + if( ( client->buttons & BUTTON_EVO_USE ) && !( client->oldbuttons & BUTTON_EVO_USE ) && client->ps.stats[ STAT_HEALTH ] > 0 ) { trace_t trace; Index: trunk/src/cgame/cg_tutorial.c =================================================================== --- trunk/src/cgame/cg_tutorial.c (revision 809) +++ trunk/src/cgame/cg_tutorial.c (working copy) @@ -33,17 +33,17 @@ static bind_t bindings[ ] = { - { "+button2", "Activate Upgrade", { -1, -1 } }, + { "+use_holdable", "Activate Upgrade", { -1, -1 } }, { "+speed", "Run/Walk", { -1, -1 } }, { "boost", "Sprint", { -1, -1 } }, { "+moveup", "Jump", { -1, -1 } }, { "+movedown", "Crouch", { -1, -1 } }, { "+attack", "Primary Attack", { -1, -1 } }, - { "+button5", "Secondary Attack", { -1, -1 } }, + { "+attack2", "Secondary Attack", { -1, -1 } }, { "reload", "Reload", { -1, -1 } }, { "buy ammo", "Buy Ammo", { -1, -1 } }, { "itemact medkit", "Use Medkit", { -1, -1 } }, - { "+button7", "Use Structure/Evolve", { -1, -1 } }, + { "+evo_use", "Use Structure/Evolve", { -1, -1 } }, { "deconstruct", "Deconstruct Structure", { -1, -1 } }, { "weapprev", "Previous Upgrade", { -1, -1 } }, { "weapnext", "Next Upgrade", { -1, -1 } } @@ -186,7 +186,7 @@ Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to cancel placing the %s\n", - CG_KeyNameForCommand( "+button5" ), + CG_KeyNameForCommand( "+attack2" ), BG_FindHumanNameForBuildable( buildable ) ) ); } else @@ -209,12 +209,12 @@ { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to swipe\n", - CG_KeyNameForCommand( "+button5" ) ) ); + CG_KeyNameForCommand( "+attack2" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to launch a projectile\n", - CG_KeyNameForCommand( "+button2" ) ) ); + CG_KeyNameForCommand( "+use_holdable" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to walk on walls\n", @@ -255,7 +255,7 @@ { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to spray poisonous gas\n", - CG_KeyNameForCommand( "+button5" ) ) ); + CG_KeyNameForCommand( "+attack2" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, @@ -278,7 +278,7 @@ { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to invoke an electrical attack\n", - CG_KeyNameForCommand( "+button5" ) ) ); + CG_KeyNameForCommand( "+attack2" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, @@ -301,12 +301,12 @@ { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to launch a projectile\n", - CG_KeyNameForCommand( "+button2" ) ) ); + CG_KeyNameForCommand( "+use_holdable" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Hold down and release %s to pounce\n", - CG_KeyNameForCommand( "+button5" ) ) ); + CG_KeyNameForCommand( "+attack2" ) ) ); } /* @@ -322,7 +322,7 @@ Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Hold down and release %s to charge\n", - CG_KeyNameForCommand( "+button5" ) ) ); + CG_KeyNameForCommand( "+attack2" ) ) ); } /* @@ -344,7 +344,7 @@ Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to cancel placing the %s\n", - CG_KeyNameForCommand( "+button5" ), + CG_KeyNameForCommand( "+attack2" ), BG_FindHumanNameForBuildable( buildable ) ) ); } else @@ -359,7 +359,7 @@ { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Hold %s to repair this structure\n", - CG_KeyNameForCommand( "+button5" ) ) ); + CG_KeyNameForCommand( "+attack2" ) ) ); } Q_strcat( text, MAX_TUTORIAL_TEXT, @@ -442,7 +442,7 @@ Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Hold %s to zoom\n", - CG_KeyNameForCommand( "+button5" ) ) ); + CG_KeyNameForCommand( "+attack2" ) ) ); break; case WP_PAIN_SAW: @@ -459,7 +459,7 @@ Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to fire the %s\n", - CG_KeyNameForCommand( "+button5" ), + CG_KeyNameForCommand( "+attack2" ), BG_FindHumanNameForWeapon( ps->weapon ) ) ); break; @@ -485,7 +485,7 @@ { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to use the %s\n", - CG_KeyNameForCommand( "+button2" ), + CG_KeyNameForCommand( "+use_holdable" ), name ) ); } @@ -500,7 +500,7 @@ Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to use a structure\n", - CG_KeyNameForCommand( "+button7" ) ) ); + CG_KeyNameForCommand( "+evo_use" ) ) ); Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to sprint\n", @@ -518,7 +518,7 @@ { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to return to free spectator mode\n", - CG_KeyNameForCommand( "+button2" ) ) ); + CG_KeyNameForCommand( "+use_holdable" ) ) ); if( CG_PlayerCount( ) > 1 ) { @@ -540,7 +540,7 @@ { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to enter spectator follow mode\n", - CG_KeyNameForCommand( "+button2" ) ) ); + CG_KeyNameForCommand( "+use_holdable" ) ) ); } } else @@ -620,7 +620,7 @@ { Q_strcat( text, MAX_TUTORIAL_TEXT, va( "Press %s to evolve\n", - CG_KeyNameForCommand( "+button7" ) ) ); + CG_KeyNameForCommand( "+evo_use" ) ) ); } } Index: trunk/src/ui/ui_shared.c =================================================================== --- trunk/src/ui/ui_shared.c (revision 809) +++ trunk/src/ui/ui_shared.c (working copy) @@ -3383,7 +3383,7 @@ static bind_t g_bindings[] = { { "+scores", K_TAB, -1, -1, -1 }, - { "+button2", K_ENTER, -1, -1, -1 }, + { "+use_holdable", K_ENTER, -1, -1, -1 }, { "+speed", K_SHIFT, -1, -1, -1 }, { "boost", 'x', -1, -1, -1 }, //TA: human sprinting { "+forward", K_UPARROW, -1, -1, -1 }, @@ -3414,15 +3414,15 @@ { "weapon 12", -1, -1, -1, -1 }, { "weapon 13", -1, -1, -1, -1 }, { "+attack", K_MOUSE1, -1, -1, -1 }, - { "+button5", K_MOUSE2, -1, -1, -1 }, //TA: secondary attack + { "+attack2", K_MOUSE2, -1, -1, -1 }, //TA: secondary attack { "reload", 'r', -1, -1, -1 }, //TA: reload { "buy ammo", 'b', -1, -1, -1 }, //TA: buy ammo { "itemact medkit", 'm', -1, -1, -1 }, //TA: use medkit - { "+button7", 'q', -1, -1, -1 }, //TA: buildable use + { "+evo_use", 'q', -1, -1, -1 }, //TA: buildable use { "deconstruct", 'e', -1, -1, -1 }, //TA: buildable destroy { "weapprev", '[', -1, -1, -1 }, { "weapnext", ']', -1, -1, -1 }, - { "+button3", K_MOUSE3, -1, -1, -1 }, + { "+gesture", K_MOUSE3, -1, -1, -1 }, { "+button4", K_MOUSE4, -1, -1, -1 }, { "prevTeamMember", 'w', -1, -1, -1 }, { "nextTeamMember", 'r', -1, -1, -1 }, Index: trunk/src/client/cl_input.c =================================================================== --- trunk/src/client/cl_input.c (revision 809) +++ trunk/src/client/cl_input.c (working copy) @@ -865,20 +865,36 @@ Cmd_AddCommand ("-speed", IN_SpeedUp); Cmd_AddCommand ("+attack", IN_Button0Down); Cmd_AddCommand ("-attack", IN_Button0Up); + + // look for BUTTON_NAME flags in ../game/* where NAME is TALK for + // +talk, GESTURE for +gesture etc. + Cmd_AddCommand ("+button0", IN_Button0Down); Cmd_AddCommand ("-button0", IN_Button0Up); + Cmd_AddCommand ("+talk", IN_Button1Down); + Cmd_AddCommand ("-talk", IN_Button1Up); Cmd_AddCommand ("+button1", IN_Button1Down); Cmd_AddCommand ("-button1", IN_Button1Up); + Cmd_AddCommand ("+use_holdable", IN_Button2Down); + Cmd_AddCommand ("-use_holdable", IN_Button2Up); Cmd_AddCommand ("+button2", IN_Button2Down); Cmd_AddCommand ("-button2", IN_Button2Up); + Cmd_AddCommand ("+gesture", IN_Button3Down); + Cmd_AddCommand ("-gesture", IN_Button3Up); Cmd_AddCommand ("+button3", IN_Button3Down); Cmd_AddCommand ("-button3", IN_Button3Up); + Cmd_AddCommand ("+walking", IN_Button4Down); + Cmd_AddCommand ("-walking", IN_Button4Up); Cmd_AddCommand ("+button4", IN_Button4Down); Cmd_AddCommand ("-button4", IN_Button4Up); + Cmd_AddCommand ("+attack2", IN_Button5Down); + Cmd_AddCommand ("-attack2", IN_Button5Up); Cmd_AddCommand ("+button5", IN_Button5Down); Cmd_AddCommand ("-button5", IN_Button5Up); Cmd_AddCommand ("+button6", IN_Button6Down); Cmd_AddCommand ("-button6", IN_Button6Up); + Cmd_AddCommand ("+evo_use", IN_Button7Down); + Cmd_AddCommand ("-evo_use", IN_Button7Up); Cmd_AddCommand ("+button7", IN_Button7Down); Cmd_AddCommand ("-button7", IN_Button7Up); Cmd_AddCommand ("+button8", IN_Button8Down);