- close active skill sub-menu
- stop moving merc
- stop moving group of mercs
- stop dragging
- unready weapon

Changed hotkeys:
- [A]: activate skills menu.
- [Alt]+[A]: start autobandage
- [Q]: change scope mode
- [Ctrl]+[Q]: change grenade launcher angle

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9260 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Sevenfm
2022-01-16 13:59:59 +00:00
parent 94b7d5611d
commit c972655886
3 changed files with 136 additions and 44 deletions
+9
View File
@@ -42,6 +42,15 @@ public:
} }
} }
BOOLEAN Active()
{
if (gPopup != NULL && fInitialized && gPopup->Visible())
{
return TRUE;
}
return FALSE;
}
UINT16 GetMaxPosX() UINT16 GetMaxPosX()
{ {
if ( gPopup ) if ( gPopup )
+126 -44
View File
@@ -164,6 +164,15 @@ UINT32 guiUITargetSoldierId = NOBODY;
// sevenfm: for cover dialog // sevenfm: for cover dialog
extern COVER_DRAW_MODE gubDrawMode; extern COVER_DRAW_MODE gubDrawMode;
extern TraitSelection gTraitSelection;
extern SkillSelection gSkillSelection;
extern ArtillerySector gArtillerySector;
extern ArtilleryTeam gArtilleryTeam;
extern ReinforcementSector gReinforcementSector;
extern ReinforcementNumber gReinforcementNumber;
extern SoldierSelection gSoldierSelection;
extern DragSelection gDragSelection;
extern MOUSE_REGION gMPanelRegion; extern MOUSE_REGION gMPanelRegion;
extern UINT32 guiNewUICursor; extern UINT32 guiNewUICursor;
@@ -341,6 +350,7 @@ void HandleTBLevelUp(void);
void HandleTBDropBackpacks( void ); void HandleTBDropBackpacks( void );
void HandleTBPickUpBackpacks( void ); void HandleTBPickUpBackpacks( void );
void HandleTBSoldierRun( void ); void HandleTBSoldierRun( void );
void HandleTBSkillsMenu(void);
void HandleTacticalReload(void); void HandleTacticalReload(void);
void HandleTacticalTakeItem( void ); void HandleTacticalTakeItem( void );
@@ -2060,60 +2070,119 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
MercPtrs[ gusSelectedSoldier ]->flags.fDoSpread = FALSE; MercPtrs[ gusSelectedSoldier ]->flags.fDoSpread = FALSE;
} }
// Before anything, delete popup box!
// Befone anything, delete popup box!
EndUIMessage( ); EndUIMessage( );
// CANCEL FROM PLANNING MODE! // CANCEL FROM PLANNING MODE!
if ( InUIPlanMode( ) ) if ( InUIPlanMode( ) )
{ {
EndUIPlan( ); EndUIPlan( );
continue;
} }
if ( InItemDescriptionBox( ) ) if ( InItemDescriptionBox( ) )
{ {
DeleteItemDescriptionBox( ); DeleteItemDescriptionBox( );
continue;
} }
else if( InKeyRingPopup( ) ) else if( InKeyRingPopup( ) )
{ {
DeleteKeyRingPopup( ); DeleteKeyRingPopup( );
continue;
}
if (gDragSelection.Active())
{
gDragSelection.Cancel();
continue;
}
else if (gReinforcementNumber.Active())
{
gReinforcementNumber.Cancel();
continue;
}
else if (gSoldierSelection.Active())
{
gSoldierSelection.Cancel();
continue;
}
else if (gArtilleryTeam.Active())
{
gArtilleryTeam.Cancel();
continue;
}
else if (gArtillerySector.Active())
{
gArtillerySector.Cancel();
continue;
}
else if (gReinforcementSector.Active())
{
gReinforcementSector.Cancel();
continue;
}
else if (gSkillSelection.Active())
{
gSkillSelection.Cancel();
continue;
}
else if (gTraitSelection.Active())
{
gTraitSelection.Cancel();
continue;
} }
if ( gCurrentUIMode == MENU_MODE ) if ( gCurrentUIMode == MENU_MODE )
{ {
// If we get a hit here and we're in menu mode, quit the menu mode // If we get a hit here and we're in menu mode, quit the menu mode
EndMenuEvent( guiCurrentEvent ); EndMenuEvent( guiCurrentEvent );
continue;
} }
if ( gCurrentUIMode == HANDCURSOR_MODE ) if (gCurrentUIMode == HANDCURSOR_MODE || gCurrentUIMode == RADIOCURSOR_MODE)
{ {
*puiNewEvent = A_CHANGE_TO_MOVE; *puiNewEvent = A_CHANGE_TO_MOVE;
continue;
} }
if (gCurrentUIMode == RADIOCURSOR_MODE) if (!(gTacticalStatus.uiFlags & ENGAGED_IN_CONV))
{ {
*puiNewEvent = A_CHANGE_TO_MOVE; if (gTacticalStatus.fAtLeastOneGuyOnMultiSelect)
} {
// ATE: OK, stop any mercs who are moving by selection method....
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) ) StopRubberBandedMercFromMoving();
{ continue;
if ( gusSelectedSoldier != NOBODY ) }
else if (gusSelectedSoldier != NOBODY &&
MercPtrs[gusSelectedSoldier] &&
!(gAnimControl[MercPtrs[gusSelectedSoldier]->usAnimState].uiFlags & ANIM_STATIONARY))
{ {
// If soldier is not stationary, stop // If soldier is not stationary, stop
MercPtrs[ gusSelectedSoldier ]->StopSoldier( ); MercPtrs[gusSelectedSoldier]->StopSoldier();
*puiNewEvent = A_CHANGE_TO_MOVE; *puiNewEvent = A_CHANGE_TO_MOVE;
continue;
// sevenfm: also stop dragging
if (MercPtrs[gusSelectedSoldier]->IsDraggingSomeone(false))
{
MercPtrs[gusSelectedSoldier]->CancelDrag();
DirtyMercPanelInterface(MercPtrs[gusSelectedSoldier], DIRTYLEVEL2);
}
} }
// ATE: OK, stop any mercs who are moving by selection method....
StopRubberBandedMercFromMoving( );
} }
// sevenfm: also stop dragging
if (gusSelectedSoldier != NOBODY &&
MercPtrs[gusSelectedSoldier] &&
MercPtrs[gusSelectedSoldier]->IsDraggingSomeone(false))
{
MercPtrs[gusSelectedSoldier]->CancelDrag();
DirtyMercPanelInterface(MercPtrs[gusSelectedSoldier], DIRTYLEVEL2);
continue;
}
// sevenfm: unready weapon
if (gusSelectedSoldier != NOBODY &&
MercPtrs[gusSelectedSoldier] &&
WeaponReady(MercPtrs[gusSelectedSoldier]))
{
MercPtrs[gusSelectedSoldier]->InternalSoldierReadyWeapon(MercPtrs[gusSelectedSoldier]->ubDirection, TRUE, FALSE);
HandleSight(MercPtrs[gusSelectedSoldier], SIGHT_LOOK);
continue;
}
} }
// CHECK ESC KEYS HERE.... // CHECK ESC KEYS HERE....
@@ -2122,7 +2191,6 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
StopAnyCurrentlyTalkingSpeech( ); StopAnyCurrentlyTalkingSpeech( );
} }
// IF UI HAS LOCKED, ONLY ALLOW EXIT! // IF UI HAS LOCKED, ONLY ALLOW EXIT!
if ( gfDisableRegionActive || gfUserTurnRegionActive ) if ( gfDisableRegionActive || gfUserTurnRegionActive )
{ {
@@ -3020,12 +3088,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
DisplaySectorItemsInfo(); DisplaySectorItemsInfo();
else else
{ {
// Flugente: trait skill selection menu. Yes, screw squad 13 HandleTBSkillsMenu();
INT32 usMapPos;
if ( GetMouseMapPos( &usMapPos ) )
{
TraitsMenu(usMapPos);
}
} }
break; break;
@@ -3163,14 +3226,18 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
SetSteadyStateAmbience( ubAmbientSound ); SetSteadyStateAmbience( ubAmbientSound );
#else
//shadooow: trying to use autobandage during conversation will mess up game
// sevenfm: don't try to activate autobandage in hostile sector
if (!(gTacticalStatus.uiFlags & INCOMBAT) && NumEnemyInSector() == 0 && DialogueQueueIsEmpty())
{
BeginAutoBandage();
}
#endif #endif
} }
else else
{ {
if (DialogueQueueIsEmpty())//shadooow: trying to use autobandage during conversation will mess up game HandleTBSkillsMenu();
{
BeginAutoBandage();
}
} }
break; break;
@@ -4155,26 +4222,26 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
case 'q': case 'q':
if( fCtrl ) if( fCtrl )
{ {
// used for cheat mode functions if (gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE])
HandleTBSwapHands( );
}
else if ( fAlt )
{
// used for cheat mode functions
HandleTBSwapGunsling( );
}
else
{
if ( gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] )
{ {
gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] = FALSE; gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] = FALSE;
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_GL_LOW_ANGLE ] ); ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_GL_LOW_ANGLE]);
} }
else else
{ {
gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] = TRUE; gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] = TRUE;
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_GL_HIGH_ANGLE ] ); ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_GL_HIGH_ANGLE]);
} }
//HandleTBSwapHands( );
}
else if ( fAlt )
{
HandleTBSwapGunsling( );
}
else
{
SetScopeMode(usMapPos);
} }
break; break;
@@ -9340,3 +9407,18 @@ BOOLEAN FindScopeTransformation(UINT16 usItem, TransformInfoStruct **pTransforma
return FALSE; return FALSE;
} }
void HandleTBSkillsMenu(void)
{
// Flugente: trait skill selection menu.
INT32 usMapPos;
if (GetMouseMapPos(&usMapPos))
{
TraitsMenu(usMapPos);
}
else if (gusSelectedSoldier != NOBODY && MercPtrs[gusSelectedSoldier] && !TileIsOutOfBounds(MercPtrs[gusSelectedSoldier]->sGridNo))
{
LocateGridNo(MercPtrs[gusSelectedSoldier]->sGridNo);
TraitsMenu(MercPtrs[gusSelectedSoldier]->sGridNo);
}
}
+1
View File
@@ -162,6 +162,7 @@
BOOLEAN refresh(void); BOOLEAN refresh(void);
BOOLEAN forceDraw(void); BOOLEAN forceDraw(void);
BOOLEAN callOption(int optIndex); BOOLEAN callOption(int optIndex);
BOOLEAN Visible(void) { return this->PopupVisible; };
INT32 getBoxId() const { INT32 getBoxId() const {
return this->boxId; return this->boxId;