mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Cleaned up assignment menu code (WIP)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8533 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+398
-875
File diff suppressed because it is too large
Load Diff
+16
-4
@@ -349,12 +349,24 @@ extern MOUSE_REGION gVehicleMenuRegion[];
|
|||||||
extern MOUSE_REGION gFacilityMenuRegion[];
|
extern MOUSE_REGION gFacilityMenuRegion[];
|
||||||
extern MOUSE_REGION gFacilityMenuRegion[];
|
extern MOUSE_REGION gFacilityMenuRegion[];
|
||||||
|
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
ASMENU_NONE = 0,
|
||||||
|
ASMENU_REPAIR,
|
||||||
|
ASMENU_VEHICLE,
|
||||||
|
ASMENU_DISEASE,
|
||||||
|
ASMENU_SPY,
|
||||||
|
ASMENU_MOVEITEM,
|
||||||
|
ASMENU_FACILITY,
|
||||||
|
ASMENU_TRAIN,
|
||||||
|
ASMENU_SQUAD,
|
||||||
|
ASMENU_SNITCH,
|
||||||
|
};
|
||||||
|
|
||||||
|
extern int gAssignMenuState;
|
||||||
|
|
||||||
extern BOOLEAN fShownContractMenu;
|
extern BOOLEAN fShownContractMenu;
|
||||||
extern BOOLEAN fShownAssignmentMenu;
|
extern BOOLEAN fShownAssignmentMenu;
|
||||||
extern BOOLEAN fShowRepairMenu;
|
|
||||||
extern BOOLEAN fShowMoveItemMenu;
|
|
||||||
extern BOOLEAN fShowDiseaseMenu;
|
|
||||||
extern BOOLEAN fShowSpyMenu;
|
|
||||||
|
|
||||||
extern BOOLEAN fFirstClickInAssignmentScreenMask;
|
extern BOOLEAN fFirstClickInAssignmentScreenMask;
|
||||||
|
|
||||||
|
|||||||
@@ -1345,7 +1345,7 @@ BOOLEAN AllowedToTimeCompress( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// HEADROCK HAM 3.6: Added Facility Menus
|
// HEADROCK HAM 3.6: Added Facility Menus
|
||||||
if( fShowAssignmentMenu || fShowTrainingMenu || fShowAttributeMenu || fShowSquadMenu || fShowContractMenu || fShowRemoveMenu || fShowFacilityAssignmentMenu || fShowFacilityMenu )
|
if( fShowAssignmentMenu || gAssignMenuState > ASMENU_NONE || fShowAttributeMenu || fShowContractMenu || fShowRemoveMenu || fShowFacilityAssignmentMenu )
|
||||||
{
|
{
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -306,17 +306,12 @@ INT32 giDblClickTimersForMoveBoxMouseRegions[ MAX_POPUP_BOX_STRING_COUNT ];
|
|||||||
INT32 giExitToTactBaseTime = 0;
|
INT32 giExitToTactBaseTime = 0;
|
||||||
UINT32 guiSectorLocatorBaseTime = 0;
|
UINT32 guiSectorLocatorBaseTime = 0;
|
||||||
|
|
||||||
|
|
||||||
// which menus are we showing
|
// which menus are we showing
|
||||||
BOOLEAN fShowAssignmentMenu = FALSE;
|
BOOLEAN fShowAssignmentMenu = FALSE;
|
||||||
BOOLEAN fShowTrainingMenu = FALSE;
|
|
||||||
BOOLEAN fShowAttributeMenu = FALSE;
|
BOOLEAN fShowAttributeMenu = FALSE;
|
||||||
BOOLEAN fShowSquadMenu = FALSE;
|
|
||||||
BOOLEAN fShowContractMenu = FALSE;
|
BOOLEAN fShowContractMenu = FALSE;
|
||||||
BOOLEAN fShowRemoveMenu = FALSE;
|
BOOLEAN fShowRemoveMenu = FALSE;
|
||||||
BOOLEAN fShowMilitiaControlMenu = FALSE; //lal
|
BOOLEAN fShowMilitiaControlMenu = FALSE; //lal
|
||||||
//BOOLEAN fShowTalkToAllMenu = FALSE;//lal
|
|
||||||
BOOLEAN fShowFacilityMenu = FALSE; // HEADROCK HAM 3.6: Facility Menu
|
|
||||||
BOOLEAN fShowFacilityAssignmentMenu = FALSE; // HEADROCK HAM 3.6: Facility Sub-menu
|
BOOLEAN fShowFacilityAssignmentMenu = FALSE; // HEADROCK HAM 3.6: Facility Sub-menu
|
||||||
|
|
||||||
BOOLEAN fRebuildMoveBox = FALSE;
|
BOOLEAN fRebuildMoveBox = FALSE;
|
||||||
@@ -922,17 +917,19 @@ void RestoreBackgroundForAssignmentGlowRegionList( void )
|
|||||||
ForceUpDateOfBox( ghAssignmentBox );
|
ForceUpDateOfBox( ghAssignmentBox );
|
||||||
ForceUpDateOfBox( ghEpcBox );
|
ForceUpDateOfBox( ghEpcBox );
|
||||||
ForceUpDateOfBox( ghRemoveMercAssignBox );
|
ForceUpDateOfBox( ghRemoveMercAssignBox );
|
||||||
if( fShowSquadMenu == TRUE )
|
|
||||||
|
if( gAssignMenuState == ASMENU_SQUAD )
|
||||||
{
|
{
|
||||||
ForceUpDateOfBox( ghSquadBox );
|
ForceUpDateOfBox( ghSquadBox );
|
||||||
}
|
}
|
||||||
else if( fShowTrainingMenu == TRUE )
|
else if( gAssignMenuState == ASMENU_TRAIN )
|
||||||
{
|
{
|
||||||
ForceUpDateOfBox( ghTrainingBox );
|
ForceUpDateOfBox( ghTrainingBox );
|
||||||
}
|
}
|
||||||
else if( fShowSnitchMenu == TRUE )
|
else if ( gAssignMenuState == ASMENU_SNITCH )
|
||||||
{
|
{
|
||||||
ForceUpDateOfBox( ghSnitchBox );
|
ForceUpDateOfBox( ghSnitchBox );
|
||||||
|
|
||||||
if( fShowSnitchToggleMenu == TRUE )
|
if( fShowSnitchToggleMenu == TRUE )
|
||||||
{
|
{
|
||||||
ForceUpDateOfBox( ghSnitchToggleBox );
|
ForceUpDateOfBox( ghSnitchToggleBox );
|
||||||
@@ -2214,14 +2211,14 @@ void UpdateMapScreenAssignmentPositions( void )
|
|||||||
{
|
{
|
||||||
// set the position of the pop up boxes
|
// set the position of the pop up boxes
|
||||||
SGPPoint pPoint;
|
SGPPoint pPoint;
|
||||||
|
SGPPoint pNewPoint;
|
||||||
|
SGPRect pDimensions;
|
||||||
|
|
||||||
if( guiCurrentScreen != MAP_SCREEN )
|
if( guiCurrentScreen != MAP_SCREEN )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( bSelectedAssignChar == -1 )
|
if( bSelectedAssignChar == -1 )
|
||||||
{
|
{
|
||||||
if( gfPreBattleInterfaceActive == FALSE )
|
if( gfPreBattleInterfaceActive == FALSE )
|
||||||
@@ -2257,19 +2254,83 @@ void UpdateMapScreenAssignmentPositions( void )
|
|||||||
VehiclePosition.iY = AssignmentPosition.iY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_VEHICLE;
|
VehiclePosition.iY = AssignmentPosition.iY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_VEHICLE;
|
||||||
SquadPosition.iY = AssignmentPosition.iY;
|
SquadPosition.iY = AssignmentPosition.iY;
|
||||||
|
|
||||||
|
pNewPoint.iX = AssignmentPosition.iX;
|
||||||
|
pNewPoint.iY = AssignmentPosition.iY;
|
||||||
|
|
||||||
if( fShowAssignmentMenu )
|
if( fShowAssignmentMenu )
|
||||||
{
|
{
|
||||||
GetBoxPosition( ghAssignmentBox, &pPoint);
|
GetBoxPosition( ghAssignmentBox, &pPoint);
|
||||||
|
GetBoxSize( ghAssignmentBox, &pDimensions );
|
||||||
pPoint.iY = giBoxY;
|
pPoint.iY = giBoxY;
|
||||||
|
|
||||||
SetBoxPosition( ghAssignmentBox, pPoint );
|
SetBoxPosition( ghAssignmentBox, pPoint );
|
||||||
|
|
||||||
|
// hang it right beside the assignment/EPC box menu
|
||||||
|
pNewPoint.iX = pPoint.iX + pDimensions.iRight;
|
||||||
|
pNewPoint.iY = pPoint.iY;
|
||||||
|
|
||||||
GetBoxPosition( ghEpcBox, &pPoint);
|
GetBoxPosition( ghEpcBox, &pPoint);
|
||||||
pPoint.iY = giBoxY;
|
pPoint.iY = giBoxY;
|
||||||
|
|
||||||
SetBoxPosition( ghEpcBox, pPoint );
|
SetBoxPosition( ghEpcBox, pPoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch ( gAssignMenuState )
|
||||||
|
{
|
||||||
|
case ASMENU_REPAIR:
|
||||||
|
{
|
||||||
|
GetBoxPosition( ghRepairBox, &pPoint );
|
||||||
|
pPoint.iY = giBoxY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_REPAIR;
|
||||||
|
|
||||||
|
SetBoxPosition( ghRepairBox, pPoint );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ASMENU_VEHICLE:
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ASMENU_DISEASE:
|
||||||
|
{
|
||||||
|
GetBoxPosition( ghDiseaseBox, &pPoint );
|
||||||
|
pPoint.iY = giBoxY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_DOCTOR_DIAGNOSIS;
|
||||||
|
|
||||||
|
SetBoxPosition( ghDiseaseBox, pPoint );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ASMENU_SPY:
|
||||||
|
{
|
||||||
|
GetBoxPosition( ghSpyBox, &pPoint );
|
||||||
|
pPoint.iY = giBoxY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_SPY;
|
||||||
|
|
||||||
|
SetBoxPosition( ghSpyBox, pPoint );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ASMENU_MOVEITEM:
|
||||||
|
{
|
||||||
|
GetBoxPosition( ghMoveItemBox, &pPoint );
|
||||||
|
pPoint.iY = giBoxY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_MOVE_ITEMS;
|
||||||
|
|
||||||
|
SetBoxPosition( ghMoveItemBox, pPoint );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case ASMENU_FACILITY:
|
||||||
|
{
|
||||||
|
//GetBoxPosition( ghFacilityBox, &pPoint );
|
||||||
|
|
||||||
|
pPoint.iX = pNewPoint.iX;
|
||||||
|
pPoint.iY = pNewPoint.iY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_FACILITY;
|
||||||
|
|
||||||
|
SetBoxPosition( ghFacilityBox, pPoint );
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if( fShowAttributeMenu )
|
if( fShowAttributeMenu )
|
||||||
{
|
{
|
||||||
GetBoxPosition( ghAttributeBox, &pPoint);
|
GetBoxPosition( ghAttributeBox, &pPoint);
|
||||||
@@ -2279,47 +2340,6 @@ void UpdateMapScreenAssignmentPositions( void )
|
|||||||
SetBoxPosition( ghAttributeBox, pPoint );
|
SetBoxPosition( ghAttributeBox, pPoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( fShowRepairMenu )
|
|
||||||
{
|
|
||||||
GetBoxPosition( ghRepairBox, &pPoint);
|
|
||||||
pPoint.iY = giBoxY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_REPAIR;
|
|
||||||
|
|
||||||
SetBoxPosition( ghRepairBox, pPoint );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( fShowMoveItemMenu )
|
|
||||||
{
|
|
||||||
GetBoxPosition( ghMoveItemBox, &pPoint);
|
|
||||||
pPoint.iY = giBoxY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_MOVE_ITEMS;
|
|
||||||
|
|
||||||
SetBoxPosition( ghMoveItemBox, pPoint );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( fShowDiseaseMenu )
|
|
||||||
{
|
|
||||||
GetBoxPosition( ghDiseaseBox, &pPoint );
|
|
||||||
pPoint.iY = giBoxY + (GetFontHeight( MAP_SCREEN_FONT ) + 2) * ASSIGN_MENU_DOCTOR_DIAGNOSIS;
|
|
||||||
|
|
||||||
SetBoxPosition( ghDiseaseBox, pPoint );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( fShowSpyMenu )
|
|
||||||
{
|
|
||||||
GetBoxPosition( ghSpyBox, &pPoint );
|
|
||||||
pPoint.iY = giBoxY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_SPY;
|
|
||||||
|
|
||||||
SetBoxPosition( ghSpyBox, pPoint );
|
|
||||||
}
|
|
||||||
|
|
||||||
// HEADROCK HAM 3.6: Facility Menu
|
|
||||||
if( fShowFacilityMenu )
|
|
||||||
{
|
|
||||||
GetBoxPosition( ghFacilityBox, &pPoint);
|
|
||||||
pPoint.iY = giBoxY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_FACILITY;
|
|
||||||
|
|
||||||
SetBoxPosition( ghFacilityBox, pPoint );
|
|
||||||
}
|
|
||||||
|
|
||||||
// HEADROCK HAM 3.6: Facility Sub-menu
|
// HEADROCK HAM 3.6: Facility Sub-menu
|
||||||
if( fShowFacilityAssignmentMenu )
|
if( fShowFacilityAssignmentMenu )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -307,17 +307,13 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern BOOLEAN fShowAssignmentMenu;
|
extern BOOLEAN fShowAssignmentMenu;
|
||||||
extern BOOLEAN fShowTrainingMenu ;
|
|
||||||
extern BOOLEAN fShowAttributeMenu;
|
extern BOOLEAN fShowAttributeMenu;
|
||||||
extern BOOLEAN fShowSquadMenu ;
|
|
||||||
extern BOOLEAN fShowContractMenu ;
|
extern BOOLEAN fShowContractMenu ;
|
||||||
extern BOOLEAN fShowRemoveMenu ;
|
extern BOOLEAN fShowRemoveMenu ;
|
||||||
extern BOOLEAN fShowMilitiaControlMenu ; //lal
|
extern BOOLEAN fShowMilitiaControlMenu ; //lal
|
||||||
//extern BOOLEAN fShowTalkToAllMenu ;
|
//extern BOOLEAN fShowTalkToAllMenu ;
|
||||||
extern BOOLEAN fShowFacilityMenu; // HEADROCK HAM 3.6
|
|
||||||
extern BOOLEAN fShowFacilityAssignmentMenu; // HEADROCK HAM 3.6
|
extern BOOLEAN fShowFacilityAssignmentMenu; // HEADROCK HAM 3.6
|
||||||
// anv: snitch menus
|
// anv: snitch menus
|
||||||
extern BOOLEAN fShowSnitchMenu;
|
|
||||||
extern BOOLEAN fShowSnitchToggleMenu;
|
extern BOOLEAN fShowSnitchToggleMenu;
|
||||||
extern BOOLEAN fShowSnitchSectorMenu;
|
extern BOOLEAN fShowSnitchSectorMenu;
|
||||||
|
|
||||||
|
|||||||
+1
-10
@@ -843,9 +843,6 @@ void CreateContractBox( SOLDIERTYPE *pCharacter );
|
|||||||
void CreateAssignmentsBox( void );
|
void CreateAssignmentsBox( void );
|
||||||
void CreateTrainingBox( void );
|
void CreateTrainingBox( void );
|
||||||
void CreateMercRemoveAssignBox( void );
|
void CreateMercRemoveAssignBox( void );
|
||||||
// HEADROCK HAM 3.6: Facility box, Sub-menu
|
|
||||||
void CreateFacilityBox( void );
|
|
||||||
void CreateFacilityAssignmentBox( void );
|
|
||||||
|
|
||||||
void DetermineWhichAssignmentMenusCanBeShown( void );
|
void DetermineWhichAssignmentMenusCanBeShown( void );
|
||||||
void DetermineWhichMilitiaControlMenusCanBeShown( void ); //lal
|
void DetermineWhichMilitiaControlMenusCanBeShown( void ); //lal
|
||||||
@@ -6978,13 +6975,7 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
|||||||
|
|
||||||
fShowAttributeMenu = FALSE;
|
fShowAttributeMenu = FALSE;
|
||||||
fShowFacilityAssignmentMenu = FALSE;
|
fShowFacilityAssignmentMenu = FALSE;
|
||||||
fShowTrainingMenu = FALSE;
|
gAssignMenuState = ASMENU_NONE;
|
||||||
fShowSquadMenu = FALSE;
|
|
||||||
fShowRepairMenu = FALSE;
|
|
||||||
fShowMoveItemMenu = FALSE;
|
|
||||||
fShowDiseaseMenu = FALSE;
|
|
||||||
fShowSpyMenu = FALSE;
|
|
||||||
fShowFacilityMenu = FALSE;
|
|
||||||
fShowAssignmentMenu = FALSE;
|
fShowAssignmentMenu = FALSE;
|
||||||
|
|
||||||
giAssignHighLine = -1;
|
giAssignHighLine = -1;
|
||||||
|
|||||||
Reference in New Issue
Block a user