mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +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:
+430
-907
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[];
|
||||
|
||||
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 fShownAssignmentMenu;
|
||||
extern BOOLEAN fShowRepairMenu;
|
||||
extern BOOLEAN fShowMoveItemMenu;
|
||||
extern BOOLEAN fShowDiseaseMenu;
|
||||
extern BOOLEAN fShowSpyMenu;
|
||||
|
||||
extern BOOLEAN fFirstClickInAssignmentScreenMask;
|
||||
|
||||
|
||||
@@ -1345,7 +1345,7 @@ BOOLEAN AllowedToTimeCompress( void )
|
||||
}
|
||||
|
||||
// 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 );
|
||||
}
|
||||
|
||||
@@ -306,17 +306,12 @@ INT32 giDblClickTimersForMoveBoxMouseRegions[ MAX_POPUP_BOX_STRING_COUNT ];
|
||||
INT32 giExitToTactBaseTime = 0;
|
||||
UINT32 guiSectorLocatorBaseTime = 0;
|
||||
|
||||
|
||||
// which menus are we showing
|
||||
BOOLEAN fShowAssignmentMenu = FALSE;
|
||||
BOOLEAN fShowTrainingMenu = FALSE;
|
||||
BOOLEAN fShowAttributeMenu = FALSE;
|
||||
BOOLEAN fShowSquadMenu = FALSE;
|
||||
BOOLEAN fShowContractMenu = FALSE;
|
||||
BOOLEAN fShowRemoveMenu = FALSE;
|
||||
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 fRebuildMoveBox = FALSE;
|
||||
@@ -922,17 +917,19 @@ void RestoreBackgroundForAssignmentGlowRegionList( void )
|
||||
ForceUpDateOfBox( ghAssignmentBox );
|
||||
ForceUpDateOfBox( ghEpcBox );
|
||||
ForceUpDateOfBox( ghRemoveMercAssignBox );
|
||||
if( fShowSquadMenu == TRUE )
|
||||
|
||||
if( gAssignMenuState == ASMENU_SQUAD )
|
||||
{
|
||||
ForceUpDateOfBox( ghSquadBox );
|
||||
}
|
||||
else if( fShowTrainingMenu == TRUE )
|
||||
else if( gAssignMenuState == ASMENU_TRAIN )
|
||||
{
|
||||
ForceUpDateOfBox( ghTrainingBox );
|
||||
}
|
||||
else if( fShowSnitchMenu == TRUE )
|
||||
else if ( gAssignMenuState == ASMENU_SNITCH )
|
||||
{
|
||||
ForceUpDateOfBox( ghSnitchBox );
|
||||
|
||||
if( fShowSnitchToggleMenu == TRUE )
|
||||
{
|
||||
ForceUpDateOfBox( ghSnitchToggleBox );
|
||||
@@ -2214,14 +2211,14 @@ void UpdateMapScreenAssignmentPositions( void )
|
||||
{
|
||||
// set the position of the pop up boxes
|
||||
SGPPoint pPoint;
|
||||
|
||||
|
||||
SGPPoint pNewPoint;
|
||||
SGPRect pDimensions;
|
||||
|
||||
if( guiCurrentScreen != MAP_SCREEN )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( bSelectedAssignChar == -1 )
|
||||
{
|
||||
if( gfPreBattleInterfaceActive == FALSE )
|
||||
@@ -2257,18 +2254,82 @@ void UpdateMapScreenAssignmentPositions( void )
|
||||
VehiclePosition.iY = AssignmentPosition.iY + ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_VEHICLE;
|
||||
SquadPosition.iY = AssignmentPosition.iY;
|
||||
|
||||
pNewPoint.iX = AssignmentPosition.iX;
|
||||
pNewPoint.iY = AssignmentPosition.iY;
|
||||
|
||||
if( fShowAssignmentMenu )
|
||||
{
|
||||
GetBoxPosition( ghAssignmentBox, &pPoint);
|
||||
GetBoxSize( ghAssignmentBox, &pDimensions );
|
||||
pPoint.iY = giBoxY;
|
||||
|
||||
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);
|
||||
pPoint.iY = giBoxY;
|
||||
|
||||
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 )
|
||||
{
|
||||
@@ -2278,48 +2339,7 @@ void UpdateMapScreenAssignmentPositions( void )
|
||||
|
||||
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
|
||||
if( fShowFacilityAssignmentMenu )
|
||||
{
|
||||
|
||||
@@ -307,17 +307,13 @@ public:
|
||||
};
|
||||
|
||||
extern BOOLEAN fShowAssignmentMenu;
|
||||
extern BOOLEAN fShowTrainingMenu ;
|
||||
extern BOOLEAN fShowAttributeMenu;
|
||||
extern BOOLEAN fShowSquadMenu ;
|
||||
extern BOOLEAN fShowContractMenu ;
|
||||
extern BOOLEAN fShowRemoveMenu ;
|
||||
extern BOOLEAN fShowMilitiaControlMenu ; //lal
|
||||
//extern BOOLEAN fShowTalkToAllMenu ;
|
||||
extern BOOLEAN fShowFacilityMenu; // HEADROCK HAM 3.6
|
||||
extern BOOLEAN fShowFacilityAssignmentMenu; // HEADROCK HAM 3.6
|
||||
// anv: snitch menus
|
||||
extern BOOLEAN fShowSnitchMenu;
|
||||
extern BOOLEAN fShowSnitchToggleMenu;
|
||||
extern BOOLEAN fShowSnitchSectorMenu;
|
||||
|
||||
|
||||
+1
-10
@@ -843,9 +843,6 @@ void CreateContractBox( SOLDIERTYPE *pCharacter );
|
||||
void CreateAssignmentsBox( void );
|
||||
void CreateTrainingBox( void );
|
||||
void CreateMercRemoveAssignBox( void );
|
||||
// HEADROCK HAM 3.6: Facility box, Sub-menu
|
||||
void CreateFacilityBox( void );
|
||||
void CreateFacilityAssignmentBox( void );
|
||||
|
||||
void DetermineWhichAssignmentMenusCanBeShown( void );
|
||||
void DetermineWhichMilitiaControlMenusCanBeShown( void ); //lal
|
||||
@@ -6978,13 +6975,7 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
|
||||
fShowAttributeMenu = FALSE;
|
||||
fShowFacilityAssignmentMenu = FALSE;
|
||||
fShowTrainingMenu = FALSE;
|
||||
fShowSquadMenu = FALSE;
|
||||
fShowRepairMenu = FALSE;
|
||||
fShowMoveItemMenu = FALSE;
|
||||
fShowDiseaseMenu = FALSE;
|
||||
fShowSpyMenu = FALSE;
|
||||
fShowFacilityMenu = FALSE;
|
||||
gAssignMenuState = ASMENU_NONE;
|
||||
fShowAssignmentMenu = FALSE;
|
||||
|
||||
giAssignHighLine = -1;
|
||||
|
||||
Reference in New Issue
Block a user