Right button action made configurable

This commit is contained in:
johns 2000-04-23 21:57:05 +00:00
parent 7a83dd299c
commit 0bcbc3e9d9
4 changed files with 36 additions and 2 deletions

View file

@ -214,6 +214,8 @@ typedef struct _ui_ {
extern UI TheUI; /// The user interface
extern UI** UI_Table; /// All available user interfaces
extern char RightButtonAttacks; /// right button 0 move, 1 attack
/*----------------------------------------------------------------------------
-- Functions
----------------------------------------------------------------------------*/

View file

@ -315,8 +315,14 @@ global void DoRightButton(int x,int y)
SendCommandAttack(unit,x,y,NoUnitP,flush);
}
}
// Note: move is correct here, right default is move
SendCommandMove(unit,x,y,flush);
// empty space
if( RightButtonAttacks ) {
SendCommandAttack(unit,x,y,NoUnitP,flush);
} else {
// Note: move is correct here, right default is move
SendCommandMove(unit,x,y,flush);
}
continue;
}
@ -404,6 +410,8 @@ local void HandleMouseOn(int x,int y)
//
// Scrolling Region Handling
// FIXME: perhaps I should change the complete scroll handling.
// FIXME: show scrolling cursor only, if scrolling is possible
// FIXME: scrolling with edge resistance
//
if( x<SCROLL_LEFT ) {
CursorOn=CursorOnScrollLeft;

View file

@ -788,6 +788,26 @@ local SCM CclShowCommandKey(void)
return SCM_UNSPECIFIED;
}
/**
** Fighter right button attacks as default.
*/
local SCM CclRightButtonAttacks(void)
{
RightButtonAttacks=1;
return SCM_UNSPECIFIED;
}
/**
** Fighter right button moves as default.
*/
local SCM CclRightButtonMoves(void)
{
RightButtonAttacks=0;
return SCM_UNSPECIFIED;
}
/**
** Register CCL features for UI.
*/
@ -814,6 +834,8 @@ global void UserInterfaceCclRegister(void)
gh_new_procedure1_0("mouse-scroll-speed", CclMouseScrollSpeed);
gh_new_procedure0_0("show-command-key",CclShowCommandKey);
gh_new_procedure0_0("right-button-attacks",CclRightButtonAttacks);
gh_new_procedure0_0("right-button-moves",CclRightButtonMoves);
}

View file

@ -33,6 +33,8 @@
global int RaceAdd; // FIXME: debug solution
global char RightButtonAttacks; /// right button 0 move, 1 attack
/**
** The user interface configuration
*/