diff --git a/include/ui.h b/include/ui.h index e0138c575..722573d3c 100644 --- a/include/ui.h +++ b/include/ui.h @@ -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 ----------------------------------------------------------------------------*/ diff --git a/ui/mouse.cpp b/ui/mouse.cpp index a13af1247..6784d40cf 100644 --- a/ui/mouse.cpp +++ b/ui/mouse.cpp @@ -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; diff --git a/ui/script_ui.cpp b/ui/script_ui.cpp index 18a903c35..bb3dab294 100644 --- a/ui/script_ui.cpp +++ b/ui/script_ui.cpp @@ -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); } diff --git a/ui/ui.cpp b/ui/ui.cpp index aca62472e..b8fb2f071 100644 --- a/ui/ui.cpp +++ b/ui/ui.cpp @@ -33,6 +33,8 @@ global int RaceAdd; // FIXME: debug solution +global char RightButtonAttacks; /// right button 0 move, 1 attack + /** ** The user interface configuration */