Alternate new shortcut "ALT + Right Mouse Button" for showing skill (traits) menu in Tactical (by Sevenfm)

- Old also working shortcut: "SHIFT + 4"
- moved menu to cursor position instead of soldier's position
- see (youtube): https://www.youtube.com/watch?v=RS7AKv0rWq0



git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6731 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2014-01-06 15:30:18 +00:00
parent 907a4b6b40
commit 27fb0562ee
3 changed files with 88 additions and 48 deletions
+64 -47
View File
@@ -59,6 +59,7 @@
#include "worlddat.h" //for gtileset #include "worlddat.h" //for gtileset
#include "Debug Control.h" //for livelog #include "Debug Control.h" //for livelog
#include "SkillMenu.h" // sevenfm: need this for TraitsMenu
#endif #endif
@@ -1226,58 +1227,74 @@ void QueryRTRightButton( UINT32 *puiNewEvent )
// ATE: // ATE:
if ( gusSelectedSoldier != NOBODY ) if ( gusSelectedSoldier != NOBODY )
{ {
// Switch on UI mode // sevenfm: ALT+RMB - TraitsMenu
switch( gCurrentUIMode ) if(_KeyDown(ALT))
{ {
case IDLE_MODE: switch( gCurrentUIMode )
{
break; case MOVE_MODE:
case TALKCURSOR_MODE:
case CONFIRM_MOVE_MODE: case ACTION_MODE:
case MOVE_MODE: case CONFIRM_ACTION_MODE:
case TALKCURSOR_MODE: case LOOKCURSOR_MODE:
TraitsMenu(usMapPos);
fClickIntercepted = TRUE;
break;
}
}
else
{
// Switch on UI mode
switch( gCurrentUIMode )
{ {
case IDLE_MODE:
break;
case CONFIRM_MOVE_MODE:
case MOVE_MODE:
case TALKCURSOR_MODE:
// We have here a change to action mode // We have here a change to action mode
*puiNewEvent = M_CHANGE_TO_ACTION; *puiNewEvent = M_CHANGE_TO_ACTION;
fClickIntercepted = TRUE;
break;
case ACTION_MODE:
// We have here a change to move mode
*puiNewEvent = A_END_ACTION;
fClickIntercepted = TRUE;
break;
case CONFIRM_ACTION_MODE:
if ( GetSoldier( &pSoldier, gusSelectedSoldier ) )
{
HandleRightClickAdjustCursor( pSoldier, usMapPos );
}
fClickIntercepted = TRUE;
break;
case MENU_MODE:
// If we get a hit here and we're in menu mode, quit the menu mode
EndMenuEvent( guiCurrentEvent );
fClickIntercepted = TRUE;
break;
case HANDCURSOR_MODE:
// If we cannot actually do anything, return to movement mode
*puiNewEvent = A_CHANGE_TO_MOVE;
break;
case LOOKCURSOR_MODE:
// If we cannot actually do anything, return to movement mode
*puiNewEvent = A_CHANGE_TO_MOVE;
break;
} }
fClickIntercepted = TRUE;
break;
case ACTION_MODE:
// We have here a change to move mode
*puiNewEvent = A_END_ACTION;
fClickIntercepted = TRUE;
break;
case CONFIRM_ACTION_MODE:
if ( GetSoldier( &pSoldier, gusSelectedSoldier ) )
{
HandleRightClickAdjustCursor( pSoldier, usMapPos );
}
fClickIntercepted = TRUE;
break;
case MENU_MODE:
// If we get a hit here and we're in menu mode, quit the menu mode
EndMenuEvent( guiCurrentEvent );
fClickIntercepted = TRUE;
break;
case HANDCURSOR_MODE:
// If we cannot actually do anything, return to movement mode
*puiNewEvent = A_CHANGE_TO_MOVE;
break;
case LOOKCURSOR_MODE:
// If we cannot actually do anything, return to movement mode
*puiNewEvent = A_CHANGE_TO_MOVE;
break;
} }
} }
} }
+6 -1
View File
@@ -11,6 +11,9 @@
#include "DisplayCover.h" #include "DisplayCover.h"
#include "worldman.h" #include "worldman.h"
// sevenfm: need this for correct calculation of traits menu position
extern INT16 gsInterfaceLevel;
UINT16 usTraitMenuPosX = 0; UINT16 usTraitMenuPosX = 0;
UINT16 usTraitMenuPosY = 0; UINT16 usTraitMenuPosY = 0;
@@ -143,7 +146,9 @@ TraitSelection::Setup( UINT32 aVal )
// grab soldier's x,y screen position // grab soldier's x,y screen position
INT16 sX, sY; INT16 sX, sY;
GetSoldierScreenPos( pSoldier, &sX, &sY ); // sevenfm: changed TraitsMenu position from soldier to mouse
//GetSoldierScreenPos( pSoldier, &sX, &sY );
GetGridNoScreenPos( sTraitsMenuTargetGridNo, gsInterfaceLevel, &sX, &sY );
if( sX < 0 ) sX = 0; if( sX < 0 ) sX = 0;
if( sY < 0 ) sY = 0; if( sY < 0 ) sY = 0;
+18
View File
@@ -970,6 +970,23 @@ void QueryTBRightButton( UINT32 *puiNewEvent )
{ {
// ATE: // ATE:
if ( gusSelectedSoldier != NOBODY ) if ( gusSelectedSoldier != NOBODY )
{
// sevenfm: ALT+RMB - TraitsMenu
if(_KeyDown(ALT))
{
switch( gCurrentUIMode )
{
case MOVE_MODE:
case TALKCURSOR_MODE:
case ACTION_MODE:
case CONFIRM_ACTION_MODE:
case LOOKCURSOR_MODE:
TraitsMenu(usMapPos);
fClickIntercepted = TRUE;
break;
}
}
else
{ {
// Switch on UI mode // Switch on UI mode
switch( gCurrentUIMode ) switch( gCurrentUIMode )
@@ -1028,6 +1045,7 @@ void QueryTBRightButton( UINT32 *puiNewEvent )
} }
} }
}
} }
else else
{ {