mirror of
https://github.com/1dot13/source.git
synced 2026-09-16 14:47:17 +02:00
Code Cleanup (by Buggler)
- Unused vanilla code cleanup on zoomed strategic map & raising/lowering level git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6700 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -3344,6 +3344,8 @@ void LoadHelicopterRepairRefuelSettings()
|
|||||||
gHelicopterSettings.ubHelicopterPassengerHitChance = iniReader.ReadInteger("Helicopter SAM Settings","HELICOPTER_PASSENGER_HIT_CHANCE", 25, 0, 100);
|
gHelicopterSettings.ubHelicopterPassengerHitChance = iniReader.ReadInteger("Helicopter SAM Settings","HELICOPTER_PASSENGER_HIT_CHANCE", 25, 0, 100);
|
||||||
gHelicopterSettings.ubHelicopterPassengerHitMaxDamage = iniReader.ReadInteger("Helicopter SAM Settings","HELICOPTER_PASSENGER_HIT_MAX_DAMAGE", 10, 0, 100);
|
gHelicopterSettings.ubHelicopterPassengerHitMaxDamage = iniReader.ReadInteger("Helicopter SAM Settings","HELICOPTER_PASSENGER_HIT_MAX_DAMAGE", 10, 0, 100);
|
||||||
gHelicopterSettings.ubHelicopterPassengerHitMinDamage = iniReader.ReadInteger("Helicopter SAM Settings","HELICOPTER_PASSENGER_HIT_MIN_DAMAGE", 1, 0, 100);
|
gHelicopterSettings.ubHelicopterPassengerHitMinDamage = iniReader.ReadInteger("Helicopter SAM Settings","HELICOPTER_PASSENGER_HIT_MIN_DAMAGE", 1, 0, 100);
|
||||||
|
|
||||||
|
gHelicopterSettings.fHelicopterTownLoyaltyCheck = iniReader.ReadBoolean("Helicopter Other Settings","HELICOPTER_TOWN_LOYALTY_CHECK", TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
void FreeGameExternalOptions()
|
void FreeGameExternalOptions()
|
||||||
|
|||||||
+2
-1
@@ -1437,12 +1437,13 @@ typedef struct
|
|||||||
UINT8 ubHelicopterTimeDelayForHoverWaitTooLong;
|
UINT8 ubHelicopterTimeDelayForHoverWaitTooLong;
|
||||||
BOOLEAN fAskBeforeKickingPassengersOut;
|
BOOLEAN fAskBeforeKickingPassengersOut;
|
||||||
|
|
||||||
|
|
||||||
UINT8 ubHelicopterSAMSiteAccuracy;
|
UINT8 ubHelicopterSAMSiteAccuracy;
|
||||||
UINT8 ubHelicopterPassengerHitChance;
|
UINT8 ubHelicopterPassengerHitChance;
|
||||||
UINT8 ubHelicopterPassengerHitMinDamage;
|
UINT8 ubHelicopterPassengerHitMinDamage;
|
||||||
UINT8 ubHelicopterPassengerHitMaxDamage;
|
UINT8 ubHelicopterPassengerHitMaxDamage;
|
||||||
|
|
||||||
|
BOOLEAN fHelicopterTownLoyaltyCheck;
|
||||||
|
|
||||||
} HELICOPTER_SETTINGS;
|
} HELICOPTER_SETTINGS;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
|||||||
@@ -40,9 +40,6 @@
|
|||||||
#include "ub_config.h"
|
#include "ub_config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#define MAP_BORDER_CORNER_X 584
|
|
||||||
//#define MAP_BORDER_CORNER_Y 279
|
|
||||||
|
|
||||||
// HEADROCK HAM 4: Now defining X/Y coordinates for Map Bottom buttons. Some day perhaps variable coordinates?
|
// HEADROCK HAM 4: Now defining X/Y coordinates for Map Bottom buttons. Some day perhaps variable coordinates?
|
||||||
UINT16 MAP_BORDER_TOWN_BTN_X;
|
UINT16 MAP_BORDER_TOWN_BTN_X;
|
||||||
UINT16 MAP_BORDER_TOWN_BTN_Y;
|
UINT16 MAP_BORDER_TOWN_BTN_Y;
|
||||||
@@ -73,8 +70,6 @@ MOUSE_REGION LevelMouseRegions[ 4 ];
|
|||||||
|
|
||||||
// graphics
|
// graphics
|
||||||
UINT32 guiMapBorder;
|
UINT32 guiMapBorder;
|
||||||
//UINT32 guiMapBorderCorner;
|
|
||||||
|
|
||||||
|
|
||||||
// scroll direction
|
// scroll direction
|
||||||
INT32 giScrollButtonState = -1;
|
INT32 giScrollButtonState = -1;
|
||||||
@@ -88,13 +83,8 @@ BOOLEAN fShowAircraftFlag = FALSE;
|
|||||||
BOOLEAN fShowItemsFlag = FALSE;
|
BOOLEAN fShowItemsFlag = FALSE;
|
||||||
BOOLEAN fShowMobileRestrictionsFlag = FALSE; // HEADROCK HAM 4
|
BOOLEAN fShowMobileRestrictionsFlag = FALSE; // HEADROCK HAM 4
|
||||||
|
|
||||||
BOOLEAN fZoomFlag = FALSE;
|
|
||||||
//BOOLEAN fShowVehicleFlag = FALSE;
|
//BOOLEAN fShowVehicleFlag = FALSE;
|
||||||
|
|
||||||
//BOOLEAN fMapScrollDueToPanelButton = FALSE;
|
|
||||||
//BOOLEAN fCursorIsOnMapScrollButtons = FALSE;
|
|
||||||
//BOOLEAN fDisabledMapBorder = FALSE;
|
|
||||||
|
|
||||||
// HEADROCK HAM 5: Externed here to be able to forgo redrawing the map inventory.
|
// HEADROCK HAM 5: Externed here to be able to forgo redrawing the map inventory.
|
||||||
extern POPUP* gMapInventoryFilterPopup;
|
extern POPUP* gMapInventoryFilterPopup;
|
||||||
extern BOOLEAN gfMapInventoryFilterPopupVisible;
|
extern BOOLEAN gfMapInventoryFilterPopupVisible;
|
||||||
@@ -111,23 +101,9 @@ extern int CLOCK_Y_START;
|
|||||||
INT32 giMapBorderButtons[ 7 ] = { -1, -1, -1, -1, -1, -1, -1 };
|
INT32 giMapBorderButtons[ 7 ] = { -1, -1, -1, -1, -1, -1, -1 };
|
||||||
INT32 giMapBorderButtonsImage[ 7 ] = { -1, -1, -1, -1, -1, -1, -1 };
|
INT32 giMapBorderButtonsImage[ 7 ] = { -1, -1, -1, -1, -1, -1, -1 };
|
||||||
|
|
||||||
//UINT32 guiMapBorderScrollButtons[ 4 ] = { -1, -1, -1, -1 };
|
|
||||||
//UINT32 guiMapBorderScrollButtonsImage[ 4 ];
|
|
||||||
|
|
||||||
// raise/lower land buttons
|
|
||||||
//UINT32 guiMapBorderLandRaiseButtons[ 2 ] = { -1, -1 };
|
|
||||||
//UINT32 guiMapBorderLandRaiseButtonsImage[ 2 ];
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void DeleteMapBorderButtons( void );
|
void DeleteMapBorderButtons( void );
|
||||||
BOOLEAN CreateButtonsForMapBorder( void );
|
BOOLEAN CreateButtonsForMapBorder( void );
|
||||||
|
|
||||||
|
|
||||||
//void MapScrollButtonMvtCheck( void );
|
|
||||||
//BOOLEAN ScrollButtonsDisplayingHelpMessage( void );
|
|
||||||
//void UpdateScrollButtonStatesWhileScrolling( void );
|
|
||||||
|
|
||||||
// set button states to match map flags
|
// set button states to match map flags
|
||||||
void InitializeMapBorderButtonStates( void );
|
void InitializeMapBorderButtonStates( void );
|
||||||
|
|
||||||
@@ -147,21 +123,11 @@ void BtnTeamCallback(GUI_BUTTON *btn,INT32 reason);
|
|||||||
void BtnMilitiaCallback(GUI_BUTTON *btn,INT32 reason);
|
void BtnMilitiaCallback(GUI_BUTTON *btn,INT32 reason);
|
||||||
// HEADROCK HAM 4: Mobile Restrictions Button callback
|
// HEADROCK HAM 4: Mobile Restrictions Button callback
|
||||||
void BtnMobileCallback(GUI_BUTTON *btn,INT32 reason);
|
void BtnMobileCallback(GUI_BUTTON *btn,INT32 reason);
|
||||||
//void BtnZoomCallback(GUI_BUTTON *btn,INT32 reason);
|
|
||||||
|
|
||||||
void BtnGenericMouseMoveButtonCallbackForMapBorder(GUI_BUTTON *btn,INT32 reason);
|
|
||||||
void LevelMarkerBtnCallback(MOUSE_REGION * pRegion, INT32 iReason );
|
void LevelMarkerBtnCallback(MOUSE_REGION * pRegion, INT32 iReason );
|
||||||
|
|
||||||
void CommonBtnCallbackBtnDownChecks( void );
|
void CommonBtnCallbackBtnDownChecks( void );
|
||||||
|
|
||||||
/*
|
|
||||||
void BtnScrollNorthMapScreenCallback( GUI_BUTTON *btn,INT32 reason );
|
|
||||||
void BtnScrollSouthMapScreenCallback( GUI_BUTTON *btn,INT32 reason );
|
|
||||||
void BtnScrollWestMapScreenCallback( GUI_BUTTON *btn,INT32 reason );
|
|
||||||
void BtnScrollEastMapScreenCallback( GUI_BUTTON *btn,INT32 reason );
|
|
||||||
void BtnLowerLevelBtnCallback(GUI_BUTTON *btn,INT32 reason);
|
|
||||||
void BtnRaiseLevelBtnCallback(GUI_BUTTON *btn,INT32 reason);
|
|
||||||
*/
|
|
||||||
|
|
||||||
BOOLEAN LoadMapBorderGraphics( void )
|
BOOLEAN LoadMapBorderGraphics( void )
|
||||||
{
|
{
|
||||||
@@ -186,16 +152,6 @@ BOOLEAN LoadMapBorderGraphics( void )
|
|||||||
|
|
||||||
CHECKF( AddVideoObject( &VObjectDesc, &guiMapBorder ) );
|
CHECKF( AddVideoObject( &VObjectDesc, &guiMapBorder ) );
|
||||||
|
|
||||||
/* corner was removed along with the Zoom feature
|
|
||||||
// will load map border corner
|
|
||||||
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
|
|
||||||
FilenameForBPP( "INTERFACE\\map_screen_cutout.sti", VObjectDesc.ImageFile );
|
|
||||||
CHECKF( AddVideoObject( &VObjectDesc, &guiMapBorderCorner ) );
|
|
||||||
|
|
||||||
fCursorIsOnMapScrollButtons = FALSE;
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
return ( TRUE );
|
return ( TRUE );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -205,7 +161,6 @@ void DeleteMapBorderGraphics( void )
|
|||||||
// procedure will delete graphics loaded for map border
|
// procedure will delete graphics loaded for map border
|
||||||
|
|
||||||
DeleteVideoObjectFromIndex( guiMapBorder );
|
DeleteVideoObjectFromIndex( guiMapBorder );
|
||||||
// DeleteVideoObjectFromIndex( guiMapBorderCorner );
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -217,13 +172,6 @@ void RenderMapBorder( void )
|
|||||||
// renders the actual border to the guiSAVEBUFFER
|
// renders the actual border to the guiSAVEBUFFER
|
||||||
HVOBJECT hHandle;
|
HVOBJECT hHandle;
|
||||||
|
|
||||||
/*
|
|
||||||
if( fDisabledMapBorder )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// HEADROCK HAM 5: Do not redraw if the filter menu is open.
|
// HEADROCK HAM 5: Do not redraw if the filter menu is open.
|
||||||
if( fShowMapInventoryPool )
|
if( fShowMapInventoryPool )
|
||||||
{
|
{
|
||||||
@@ -265,46 +213,11 @@ void RenderMapBorder( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
void RenderMapBorderCorner( void )
|
|
||||||
{
|
|
||||||
// renders map border corner to the FRAME_BUFFER
|
|
||||||
HVOBJECT hHandle;
|
|
||||||
|
|
||||||
if( fDisabledMapBorder )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( fShowMapInventoryPool )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// get and blt corner
|
|
||||||
GetVideoObject(&hHandle, guiMapBorderCorner );
|
|
||||||
BltVideoObject( FRAME_BUFFER , hHandle, 0,MAP_BORDER_CORNER_X, MAP_BORDER_CORNER_Y, VO_BLT_SRCTRANSPARENCY,NULL );
|
|
||||||
|
|
||||||
InvalidateRegion( MAP_BORDER_CORNER_X, MAP_BORDER_CORNER_Y, 635, 315);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
void RenderMapBorderEtaPopUp( void )
|
void RenderMapBorderEtaPopUp( void )
|
||||||
{
|
{
|
||||||
// renders map border corner to the FRAME_BUFFER
|
// renders map border corner to the FRAME_BUFFER
|
||||||
HVOBJECT hHandle;
|
HVOBJECT hHandle;
|
||||||
|
|
||||||
/*
|
|
||||||
if( fDisabledMapBorder )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if( fShowMapInventoryPool )
|
if( fShowMapInventoryPool )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@@ -341,37 +254,6 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
|||||||
|
|
||||||
// HEADROCK HAM 4: Call to initiate coordinates for all buttons.
|
// HEADROCK HAM 4: Call to initiate coordinates for all buttons.
|
||||||
InitMapBorderButtonCoordinates();
|
InitMapBorderButtonCoordinates();
|
||||||
/*
|
|
||||||
// up button
|
|
||||||
guiMapBorderScrollButtonsImage[ ZOOM_MAP_SCROLL_UP ] = LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,11,4,-1,6,-1 );
|
|
||||||
guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_UP ] = QuickCreateButton( guiMapBorderScrollButtonsImage[ ZOOM_MAP_SCROLL_UP ], 602, 303,
|
|
||||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
|
||||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnScrollNorthMapScreenCallback);
|
|
||||||
|
|
||||||
// dwn button
|
|
||||||
guiMapBorderScrollButtonsImage[ ZOOM_MAP_SCROLL_DWN ] = LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,12,5,-1,7,-1 );
|
|
||||||
guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_DWN ] = QuickCreateButton( guiMapBorderScrollButtonsImage[ ZOOM_MAP_SCROLL_DWN ], 602, 338,
|
|
||||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
|
||||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnScrollSouthMapScreenCallback);
|
|
||||||
|
|
||||||
// left button
|
|
||||||
guiMapBorderScrollButtonsImage[ ZOOM_MAP_SCROLL_LEFT ] = LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,9,0,-1,2,-1 );
|
|
||||||
guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_LEFT ] = QuickCreateButton( guiMapBorderScrollButtonsImage[ ZOOM_MAP_SCROLL_LEFT ], 584, 322,
|
|
||||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
|
||||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnScrollWestMapScreenCallback);
|
|
||||||
|
|
||||||
// right button
|
|
||||||
guiMapBorderScrollButtonsImage[ ZOOM_MAP_SCROLL_RIGHT ] = LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,10,1,-1,3,-1 );
|
|
||||||
guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_RIGHT ] = QuickCreateButton( guiMapBorderScrollButtonsImage[ ZOOM_MAP_SCROLL_RIGHT ], 619, 322,
|
|
||||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
|
||||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnScrollEastMapScreenCallback);
|
|
||||||
|
|
||||||
// set up fast help text
|
|
||||||
SetButtonFastHelpText( guiMapBorderScrollButtons[ 0 ], pMapScreenBorderButtonHelpText[ 6 ] );
|
|
||||||
SetButtonFastHelpText( guiMapBorderScrollButtons[ 1 ], pMapScreenBorderButtonHelpText[ 7 ] );
|
|
||||||
SetButtonFastHelpText( guiMapBorderScrollButtons[ 2 ], pMapScreenBorderButtonHelpText[ 8 ] );
|
|
||||||
SetButtonFastHelpText( guiMapBorderScrollButtons[ 3 ], pMapScreenBorderButtonHelpText[ 9 ] );
|
|
||||||
*/
|
|
||||||
|
|
||||||
// HEADROCK HAM 4: Button X/Y coordinates are now INIT'ed separately.
|
// HEADROCK HAM 4: Button X/Y coordinates are now INIT'ed separately.
|
||||||
|
|
||||||
@@ -423,23 +305,6 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// raise and lower view level
|
|
||||||
|
|
||||||
// raise
|
|
||||||
/*
|
|
||||||
guiMapBorderLandRaiseButtonsImage[ MAP_BORDER_RAISE_LEVEL ] = LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,11,4,-1,6,-1 );
|
|
||||||
guiMapBorderLandRaiseButtons[ MAP_BORDER_RAISE_LEVEL ] = QuickCreateButton( guiMapBorderLandRaiseButtonsImage[ MAP_BORDER_RAISE_LEVEL ], MAP_BORDER_X + 264, 322,
|
|
||||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
|
||||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnRaiseLevelBtnCallback);
|
|
||||||
|
|
||||||
// lower
|
|
||||||
guiMapBorderLandRaiseButtonsImage[ MAP_BORDER_LOWER_LEVEL ] = LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,12,5,-1,7,-1 );
|
|
||||||
guiMapBorderLandRaiseButtons[ MAP_BORDER_LOWER_LEVEL ] = QuickCreateButton( guiMapBorderLandRaiseButtonsImage[ MAP_BORDER_LOWER_LEVEL ], MAP_BORDER_X + 264, 340,
|
|
||||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
|
|
||||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnLowerLevelBtnCallback);
|
|
||||||
|
|
||||||
*/
|
|
||||||
// set up fast help text
|
// set up fast help text
|
||||||
SetButtonFastHelpText( giMapBorderButtons[ 0 ], pMapScreenBorderButtonHelpText[ 0 ] );
|
SetButtonFastHelpText( giMapBorderButtons[ 0 ], pMapScreenBorderButtonHelpText[ 0 ] );
|
||||||
SetButtonFastHelpText( giMapBorderButtons[ 1 ], pMapScreenBorderButtonHelpText[ 1 ] );
|
SetButtonFastHelpText( giMapBorderButtons[ 1 ], pMapScreenBorderButtonHelpText[ 1 ] );
|
||||||
@@ -451,9 +316,6 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
|||||||
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
||||||
SetButtonFastHelpText( giMapBorderButtons[ 6 ], pMapScreenBorderButtonHelpText[ 6 ] ); // HEADROCK HAM 4: Mobile Militia button
|
SetButtonFastHelpText( giMapBorderButtons[ 6 ], pMapScreenBorderButtonHelpText[ 6 ] ); // HEADROCK HAM 4: Mobile Militia button
|
||||||
|
|
||||||
//SetButtonFastHelpText( guiMapBorderLandRaiseButtons[ 0 ], pMapScreenBorderButtonHelpText[ 10 ] );
|
|
||||||
//SetButtonFastHelpText( guiMapBorderLandRaiseButtons[ 1 ], pMapScreenBorderButtonHelpText[ 11 ] );
|
|
||||||
|
|
||||||
SetButtonCursor(giMapBorderButtons[ 0 ], MSYS_NO_CURSOR );
|
SetButtonCursor(giMapBorderButtons[ 0 ], MSYS_NO_CURSOR );
|
||||||
SetButtonCursor(giMapBorderButtons[ 1 ], MSYS_NO_CURSOR );
|
SetButtonCursor(giMapBorderButtons[ 1 ], MSYS_NO_CURSOR );
|
||||||
SetButtonCursor(giMapBorderButtons[ 2 ], MSYS_NO_CURSOR );
|
SetButtonCursor(giMapBorderButtons[ 2 ], MSYS_NO_CURSOR );
|
||||||
@@ -464,9 +326,6 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
|||||||
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
||||||
SetButtonCursor(giMapBorderButtons[ 6 ], MSYS_NO_CURSOR ); // HEADROCK HAM 4: Mobile Militia button
|
SetButtonCursor(giMapBorderButtons[ 6 ], MSYS_NO_CURSOR ); // HEADROCK HAM 4: Mobile Militia button
|
||||||
|
|
||||||
// SetButtonCursor(guiMapBorderLandRaiseButtons[ 0 ], MSYS_NO_CURSOR );
|
|
||||||
// SetButtonCursor(guiMapBorderLandRaiseButtons[ 1 ], MSYS_NO_CURSOR );
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef JA2UB
|
#ifdef JA2UB
|
||||||
//EnableButton
|
//EnableButton
|
||||||
@@ -548,13 +407,6 @@ void DeleteMapBorderButtons( void )
|
|||||||
{
|
{
|
||||||
UINT8 ubCnt;
|
UINT8 ubCnt;
|
||||||
|
|
||||||
/*
|
|
||||||
RemoveButton( guiMapBorderScrollButtons[ 0 ]);
|
|
||||||
RemoveButton( guiMapBorderScrollButtons[ 1 ]);
|
|
||||||
RemoveButton( guiMapBorderScrollButtons[ 2 ]);
|
|
||||||
RemoveButton( guiMapBorderScrollButtons[ 3 ]);
|
|
||||||
*/
|
|
||||||
|
|
||||||
RemoveButton( giMapBorderButtons[ 0 ]);
|
RemoveButton( giMapBorderButtons[ 0 ]);
|
||||||
RemoveButton( giMapBorderButtons[ 1 ]);
|
RemoveButton( giMapBorderButtons[ 1 ]);
|
||||||
RemoveButton( giMapBorderButtons[ 2 ]);
|
RemoveButton( giMapBorderButtons[ 2 ]);
|
||||||
@@ -566,18 +418,8 @@ void DeleteMapBorderButtons( void )
|
|||||||
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
||||||
RemoveButton( giMapBorderButtons[ 6 ]); // HEADROCK HAM 4
|
RemoveButton( giMapBorderButtons[ 6 ]); // HEADROCK HAM 4
|
||||||
|
|
||||||
//RemoveButton( guiMapBorderLandRaiseButtons[ 0 ]);
|
|
||||||
//RemoveButton( guiMapBorderLandRaiseButtons[ 1 ]);
|
|
||||||
|
|
||||||
// images
|
// images
|
||||||
|
|
||||||
/*
|
|
||||||
UnloadButtonImage( guiMapBorderScrollButtonsImage[ 0 ] );
|
|
||||||
UnloadButtonImage( guiMapBorderScrollButtonsImage[ 1 ] );
|
|
||||||
UnloadButtonImage( guiMapBorderScrollButtonsImage[ 2 ] );
|
|
||||||
UnloadButtonImage( guiMapBorderScrollButtonsImage[ 3 ] );
|
|
||||||
*/
|
|
||||||
|
|
||||||
UnloadButtonImage( giMapBorderButtonsImage[ 0 ] );
|
UnloadButtonImage( giMapBorderButtonsImage[ 0 ] );
|
||||||
UnloadButtonImage( giMapBorderButtonsImage[ 1 ] );
|
UnloadButtonImage( giMapBorderButtonsImage[ 1 ] );
|
||||||
UnloadButtonImage( giMapBorderButtonsImage[ 2 ] );
|
UnloadButtonImage( giMapBorderButtonsImage[ 2 ] );
|
||||||
@@ -590,10 +432,6 @@ void DeleteMapBorderButtons( void )
|
|||||||
UnloadButtonImage( giMapBorderButtonsImage[ 6 ] ); // HEADROCK HAM 4
|
UnloadButtonImage( giMapBorderButtonsImage[ 6 ] ); // HEADROCK HAM 4
|
||||||
|
|
||||||
|
|
||||||
//UnloadButtonImage( guiMapBorderLandRaiseButtonsImage[ 0 ] );
|
|
||||||
//UnloadButtonImage( guiMapBorderLandRaiseButtonsImage[ 1 ] );
|
|
||||||
|
|
||||||
|
|
||||||
// HEADROCK HAM 4: Increased number of buttons by one.
|
// HEADROCK HAM 4: Increased number of buttons by one.
|
||||||
for ( ubCnt = 0; ubCnt < NUM_MAP_BORDER_BTNS; ubCnt++ )
|
for ( ubCnt = 0; ubCnt < NUM_MAP_BORDER_BTNS; ubCnt++ )
|
||||||
{
|
{
|
||||||
@@ -604,65 +442,6 @@ void DeleteMapBorderButtons( void )
|
|||||||
|
|
||||||
|
|
||||||
// callbacks
|
// callbacks
|
||||||
|
|
||||||
/*
|
|
||||||
void BtnLowerLevelBtnCallback(GUI_BUTTON *btn,INT32 reason)
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
|
||||||
{
|
|
||||||
// are help messages being displayed?..redraw
|
|
||||||
if( ScrollButtonsDisplayingHelpMessage( ) )
|
|
||||||
{
|
|
||||||
fMapPanelDirty = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
MarkButtonsDirty( );
|
|
||||||
|
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
|
||||||
}
|
|
||||||
else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
|
||||||
{
|
|
||||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
|
||||||
{
|
|
||||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
|
||||||
|
|
||||||
// go down one level
|
|
||||||
GoDownOneLevelInMap( );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void BtnRaiseLevelBtnCallback(GUI_BUTTON *btn,INT32 reason)
|
|
||||||
{
|
|
||||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
|
||||||
{
|
|
||||||
// are help messages being displayed?..redraw
|
|
||||||
if( ScrollButtonsDisplayingHelpMessage( ) )
|
|
||||||
{
|
|
||||||
fMapPanelDirty = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
MarkButtonsDirty( );
|
|
||||||
|
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
|
||||||
}
|
|
||||||
else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
|
||||||
{
|
|
||||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
|
||||||
{
|
|
||||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
|
||||||
// go up one level
|
|
||||||
GoUpOneLevelInMap( );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
void BtnMilitiaCallback(GUI_BUTTON *btn,INT32 reason)
|
void BtnMilitiaCallback(GUI_BUTTON *btn,INT32 reason)
|
||||||
{
|
{
|
||||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
||||||
@@ -764,56 +543,6 @@ void BtnMobileCallback(GUI_BUTTON *btn,INT32 reason)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
void BtnZoomCallback(GUI_BUTTON *btn,INT32 reason)
|
|
||||||
{
|
|
||||||
UINT16 sTempXOff=0;
|
|
||||||
UINT16 sTempYOff=0;
|
|
||||||
|
|
||||||
|
|
||||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
|
||||||
{
|
|
||||||
CommonBtnCallbackBtnDownChecks();
|
|
||||||
|
|
||||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
|
||||||
{
|
|
||||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
|
||||||
fZoomFlag=FALSE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
|
||||||
fZoomFlag=TRUE;
|
|
||||||
if( sSelMapX > 14 )
|
|
||||||
{
|
|
||||||
iZoomX = ( ( sSelMapX + 2 ) / 2 ) * ( MAP_GRID_X * 2 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
iZoomX=sSelMapX/2*MAP_GRID_X*2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( sOldSelMapY > 14 )
|
|
||||||
{
|
|
||||||
iZoomY = ( ( sSelMapY + 2 ) / 2 ) * ( MAP_GRID_Y * 2 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
iZoomY=sSelMapY/2*MAP_GRID_Y*2;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
fMapPanelDirty=TRUE;
|
|
||||||
}
|
|
||||||
else if(reason & MSYS_CALLBACK_REASON_RBUTTON_DWN )
|
|
||||||
{
|
|
||||||
CommonBtnCallbackBtnDownChecks();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
void ToggleShowTownsMode( void )
|
void ToggleShowTownsMode( void )
|
||||||
{
|
{
|
||||||
if( fShowTownFlag == TRUE )
|
if( fShowTownFlag == TRUE )
|
||||||
@@ -1064,298 +793,12 @@ void ShowDestinationOfPlottedPath( STR16 pLoc )
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
|
||||||
void BtnScrollNorthMapScreenCallback( GUI_BUTTON *btn,INT32 reason )
|
|
||||||
{
|
|
||||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
|
||||||
{
|
|
||||||
|
|
||||||
// not zoomed in?...don't push down
|
|
||||||
if( fZoomFlag == FALSE )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// are help messages being displayed?..redraw
|
|
||||||
if( ScrollButtonsDisplayingHelpMessage( ) )
|
|
||||||
{
|
|
||||||
fMapPanelDirty = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
|
||||||
}
|
|
||||||
else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
|
||||||
{
|
|
||||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
|
||||||
{
|
|
||||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
|
||||||
giScrollButtonState = NORTH_DIR;
|
|
||||||
fMapScrollDueToPanelButton = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
|
|
||||||
{
|
|
||||||
giScrollButtonState = NORTH_DIR;
|
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void BtnScrollSouthMapScreenCallback( GUI_BUTTON *btn,INT32 reason )
|
|
||||||
{
|
|
||||||
|
|
||||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
|
||||||
{
|
|
||||||
|
|
||||||
// not zoomed in?...don't push down
|
|
||||||
if( fZoomFlag == FALSE )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// are help messages being displayed?..redraw
|
|
||||||
if( ScrollButtonsDisplayingHelpMessage( ) )
|
|
||||||
{
|
|
||||||
fMapPanelDirty = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
|
||||||
}
|
|
||||||
else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
|
||||||
{
|
|
||||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
|
||||||
{
|
|
||||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
|
||||||
giScrollButtonState = SOUTH_DIR;
|
|
||||||
fMapScrollDueToPanelButton = TRUE;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
|
|
||||||
{
|
|
||||||
giScrollButtonState = SOUTH_DIR;
|
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void BtnScrollEastMapScreenCallback( GUI_BUTTON *btn,INT32 reason )
|
|
||||||
{
|
|
||||||
|
|
||||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
|
||||||
{
|
|
||||||
// not zoomed in?...don't push down
|
|
||||||
if( fZoomFlag == FALSE )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// are help messages being displayed?..redraw
|
|
||||||
if( ScrollButtonsDisplayingHelpMessage( ) )
|
|
||||||
{
|
|
||||||
fMapPanelDirty = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
|
||||||
}
|
|
||||||
else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
|
||||||
{
|
|
||||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
|
||||||
{
|
|
||||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
|
||||||
giScrollButtonState = EAST_DIR;
|
|
||||||
fMapScrollDueToPanelButton = TRUE;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
|
|
||||||
{
|
|
||||||
giScrollButtonState = EAST_DIR;
|
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void BtnScrollWestMapScreenCallback( GUI_BUTTON *btn,INT32 reason )
|
|
||||||
{
|
|
||||||
|
|
||||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
|
||||||
{
|
|
||||||
|
|
||||||
// not zoomed in?...don't push down
|
|
||||||
if( fZoomFlag == FALSE )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// are help messages being displayed?..redraw
|
|
||||||
if( ScrollButtonsDisplayingHelpMessage( ) )
|
|
||||||
{
|
|
||||||
fMapPanelDirty = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
|
||||||
}
|
|
||||||
else if(reason & MSYS_CALLBACK_REASON_LBUTTON_UP )
|
|
||||||
{
|
|
||||||
if (btn->uiFlags & BUTTON_CLICKED_ON)
|
|
||||||
{
|
|
||||||
btn->uiFlags&=~(BUTTON_CLICKED_ON);
|
|
||||||
giScrollButtonState = WEST_DIR;
|
|
||||||
fMapScrollDueToPanelButton = TRUE;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
|
|
||||||
{
|
|
||||||
giScrollButtonState = WEST_DIR;
|
|
||||||
btn->uiFlags|=(BUTTON_CLICKED_ON);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MapScrollButtonMvtCheck( void )
|
|
||||||
{
|
|
||||||
// run through each button's mouse region, if mouse cursor there...don't show map white sector highlight
|
|
||||||
fCursorIsOnMapScrollButtons = FALSE;
|
|
||||||
|
|
||||||
if( ButtonList[ guiMapBorderScrollButtons[ 0 ] ]->Area.uiFlags & MSYS_MOUSE_IN_AREA )
|
|
||||||
{
|
|
||||||
fCursorIsOnMapScrollButtons = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ButtonList[ guiMapBorderScrollButtons[ 1 ] ]->Area.uiFlags & MSYS_MOUSE_IN_AREA )
|
|
||||||
{
|
|
||||||
fCursorIsOnMapScrollButtons = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ButtonList[ guiMapBorderScrollButtons[ 2 ] ]->Area.uiFlags & MSYS_MOUSE_IN_AREA )
|
|
||||||
{
|
|
||||||
fCursorIsOnMapScrollButtons = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( ButtonList[ guiMapBorderScrollButtons[ 3 ] ]->Area.uiFlags & MSYS_MOUSE_IN_AREA )
|
|
||||||
{
|
|
||||||
fCursorIsOnMapScrollButtons = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
void HandleMapScrollButtonStates( void )
|
|
||||||
{
|
|
||||||
// will enable/disable map scroll buttons based on zoom mode
|
|
||||||
|
|
||||||
if( fDisabledMapBorder || fShowMapInventoryPool )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if underground, don't want zoom in
|
|
||||||
if( iCurrentMapSectorZ )
|
|
||||||
{
|
|
||||||
if( fZoomFlag == TRUE )
|
|
||||||
{
|
|
||||||
fZoomFlag = FALSE;
|
|
||||||
fMapPanelDirty = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
MapBorderButtonOff( MAP_BORDER_ZOOM_BTN );
|
|
||||||
DisableButton( giMapBorderButtons[ MAP_BORDER_ZOOM_BTN ]);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EnableButton( giMapBorderButtons[ MAP_BORDER_ZOOM_BTN ]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if( fZoomFlag )
|
|
||||||
{
|
|
||||||
EnableButton( guiMapBorderScrollButtons[ 0 ]);
|
|
||||||
EnableButton( guiMapBorderScrollButtons[ 1 ]);
|
|
||||||
EnableButton( guiMapBorderScrollButtons[ 2 ]);
|
|
||||||
EnableButton( guiMapBorderScrollButtons[ 3 ]);
|
|
||||||
|
|
||||||
UpdateScrollButtonStatesWhileScrolling( );
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
DisableButton( guiMapBorderScrollButtons[ 0 ]);
|
|
||||||
DisableButton( guiMapBorderScrollButtons[ 1 ]);
|
|
||||||
DisableButton( guiMapBorderScrollButtons[ 2 ]);
|
|
||||||
DisableButton( guiMapBorderScrollButtons[ 3 ]);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// check mvt too
|
|
||||||
MapScrollButtonMvtCheck( );
|
|
||||||
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// generic button mvt callback for mapscreen map border
|
|
||||||
void BtnGenericMouseMoveButtonCallbackForMapBorder(GUI_BUTTON *btn,INT32 reason)
|
|
||||||
{
|
|
||||||
//If the button isn't the anchored button, then we don't want to modify the button state.
|
|
||||||
|
|
||||||
if( btn != gpAnchoredButton )
|
|
||||||
{
|
|
||||||
if( reason & MSYS_CALLBACK_REASON_LOST_MOUSE )
|
|
||||||
{
|
|
||||||
if( btn->Area.uiFlags & MSYS_FASTHELP )
|
|
||||||
{
|
|
||||||
// redraw area
|
|
||||||
fMapPanelDirty = TRUE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( reason & MSYS_CALLBACK_REASON_LOST_MOUSE )
|
|
||||||
{
|
|
||||||
if( !gfAnchoredState )
|
|
||||||
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
|
||||||
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
|
||||||
}
|
|
||||||
else if( reason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
|
|
||||||
{
|
|
||||||
btn->uiFlags |= BUTTON_CLICKED_ON ;
|
|
||||||
InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
BOOLEAN ScrollButtonsDisplayingHelpMessage( void )
|
|
||||||
{
|
|
||||||
// return if any help messages are being displayed for the scroll buttons
|
|
||||||
|
|
||||||
if( ( ButtonList[ guiMapBorderScrollButtons[ 0 ] ]->Area.uiFlags & MSYS_HAS_BACKRECT )||
|
|
||||||
( ButtonList[ guiMapBorderScrollButtons[ 1 ] ]->Area.uiFlags & MSYS_HAS_BACKRECT )||
|
|
||||||
( ButtonList[ guiMapBorderScrollButtons[ 2 ] ]->Area.uiFlags & MSYS_HAS_BACKRECT )||
|
|
||||||
( ButtonList[ guiMapBorderScrollButtons[ 3 ] ]->Area.uiFlags & MSYS_HAS_BACKRECT ) )
|
|
||||||
{
|
|
||||||
return( TRUE );
|
|
||||||
}
|
|
||||||
|
|
||||||
return( FALSE );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
void DisplayCurrentLevelMarker( void )
|
void DisplayCurrentLevelMarker( void )
|
||||||
{
|
{
|
||||||
// display the current level marker on the map border
|
// display the current level marker on the map border
|
||||||
HVOBJECT hHandle;
|
HVOBJECT hHandle;
|
||||||
|
|
||||||
/*
|
|
||||||
if( fDisabledMapBorder )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// it's actually a white rectangle, not a green arrow!
|
// it's actually a white rectangle, not a green arrow!
|
||||||
GetVideoObject(&hHandle, guiLEVELMARKER );
|
GetVideoObject(&hHandle, guiLEVELMARKER );
|
||||||
@@ -1413,43 +856,6 @@ void LevelMarkerBtnCallback(MOUSE_REGION * pRegion, INT32 iReason )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
void DisableMapBorderRegion( void )
|
|
||||||
{
|
|
||||||
// will shutdown map border region
|
|
||||||
|
|
||||||
if( fDisabledMapBorder )
|
|
||||||
{
|
|
||||||
// checked, failed
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// get rid of graphics and mouse regions
|
|
||||||
DeleteMapBorderGraphics( );
|
|
||||||
|
|
||||||
|
|
||||||
fDisabledMapBorder = TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void EnableMapBorderRegion( void )
|
|
||||||
{
|
|
||||||
// will re-enable mapborder region
|
|
||||||
|
|
||||||
if( fDisabledMapBorder == FALSE )
|
|
||||||
{
|
|
||||||
// checked, failed
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// re load graphics and buttons
|
|
||||||
LoadMapBorderGraphics( );
|
|
||||||
|
|
||||||
fDisabledMapBorder = FALSE;
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
void TurnOnShowTeamsMode( void )
|
void TurnOnShowTeamsMode( void )
|
||||||
{
|
{
|
||||||
// if mode already on, leave, else set and redraw
|
// if mode already on, leave, else set and redraw
|
||||||
@@ -1713,63 +1119,6 @@ void TurnOnMobileFilterMode( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
void UpdateLevelButtonStates( void )
|
|
||||||
{
|
|
||||||
|
|
||||||
if( iCurrentMapSectorZ == 0 )
|
|
||||||
{
|
|
||||||
DisableButton( guiMapBorderLandRaiseButtons[ MAP_BORDER_RAISE_LEVEL ] );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EnableButton( guiMapBorderLandRaiseButtons[ MAP_BORDER_RAISE_LEVEL ] );
|
|
||||||
}
|
|
||||||
|
|
||||||
if( iCurrentMapSectorZ == 3 )
|
|
||||||
{
|
|
||||||
DisableButton( guiMapBorderLandRaiseButtons[ MAP_BORDER_LOWER_LEVEL ] );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
EnableButton( guiMapBorderLandRaiseButtons[ MAP_BORDER_LOWER_LEVEL ] );
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
void UpdateScrollButtonStatesWhileScrolling( void )
|
|
||||||
{
|
|
||||||
// too far west, disable
|
|
||||||
if ( iZoomY == NORTH_ZOOM_BOUND )
|
|
||||||
{
|
|
||||||
ButtonList[ guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_UP ] ]->uiFlags&=~(BUTTON_CLICKED_ON);
|
|
||||||
DisableButton( guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_UP ] );
|
|
||||||
}
|
|
||||||
else if(iZoomY == SOUTH_ZOOM_BOUND )
|
|
||||||
{
|
|
||||||
ButtonList[ guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_DWN ] ]->uiFlags&=~(BUTTON_CLICKED_ON);
|
|
||||||
DisableButton( guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_DWN ] );
|
|
||||||
}
|
|
||||||
|
|
||||||
// too far west, disable
|
|
||||||
if ( iZoomX == WEST_ZOOM_BOUND )
|
|
||||||
{
|
|
||||||
ButtonList[ guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_LEFT ] ]->uiFlags&=~(BUTTON_CLICKED_ON);
|
|
||||||
DisableButton( guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_LEFT ] );
|
|
||||||
}
|
|
||||||
else if(iZoomX == EAST_ZOOM_BOUND )
|
|
||||||
{
|
|
||||||
ButtonList[ guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_RIGHT ] ]->uiFlags&=~(BUTTON_CLICKED_ON);
|
|
||||||
DisableButton( guiMapBorderScrollButtons[ ZOOM_MAP_SCROLL_RIGHT ] );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
void InitializeMapBorderButtonStates( void )
|
void InitializeMapBorderButtonStates( void )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,14 +35,6 @@ enum{
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
enum{
|
|
||||||
MAP_BORDER_RAISE_LEVEL=0,
|
|
||||||
MAP_BORDER_LOWER_LEVEL,
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// HEADROCK HAM 4: Turned these into EXTERNS to allow dynamic modification
|
// HEADROCK HAM 4: Turned these into EXTERNS to allow dynamic modification
|
||||||
//#define MAP_LEVEL_MARKER_X (MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 + 114)) //MAP_BORDER_X + MAP_BORDER_X_OFFSET + 384 //(SCREEN_WIDTH - 75) //565
|
//#define MAP_LEVEL_MARKER_X (MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 + 114)) //MAP_BORDER_X + MAP_BORDER_X_OFFSET + 384 //(SCREEN_WIDTH - 75) //565
|
||||||
extern UINT16 MAP_LEVEL_MARKER_X;
|
extern UINT16 MAP_LEVEL_MARKER_X;
|
||||||
@@ -57,24 +49,17 @@ extern BOOLEAN fShowTeamFlag;
|
|||||||
extern BOOLEAN fShowMilitia;
|
extern BOOLEAN fShowMilitia;
|
||||||
extern BOOLEAN fShowAircraftFlag;
|
extern BOOLEAN fShowAircraftFlag;
|
||||||
extern BOOLEAN fShowItemsFlag;
|
extern BOOLEAN fShowItemsFlag;
|
||||||
extern BOOLEAN fZoomFlag;
|
|
||||||
extern BOOLEAN fShowMobileRestrictionsFlag; // HEADROCK HAM 4: Manual Mobile Militia mode
|
extern BOOLEAN fShowMobileRestrictionsFlag; // HEADROCK HAM 4: Manual Mobile Militia mode
|
||||||
//extern BOOLEAN fShowVehicleFlag;
|
//extern BOOLEAN fShowVehicleFlag;
|
||||||
|
|
||||||
//extern BOOLEAN fMapScrollDueToPanelButton;
|
|
||||||
//extern BOOLEAN fCursorIsOnMapScrollButtons;
|
|
||||||
//extern BOOLEAN fDisabledMapBorder;
|
|
||||||
|
|
||||||
// scroll animation
|
// scroll animation
|
||||||
extern INT32 giScrollButtonState;
|
extern INT32 giScrollButtonState;
|
||||||
|
|
||||||
BOOLEAN LoadMapBorderGraphics( void );
|
BOOLEAN LoadMapBorderGraphics( void );
|
||||||
void DeleteMapBorderGraphics( void );
|
void DeleteMapBorderGraphics( void );
|
||||||
void RenderMapBorder( void );
|
void RenderMapBorder( void );
|
||||||
//void RenderMapBorderCorner( void );
|
|
||||||
//void ShowDestinationOfPlottedPath( STR16 pLoc );
|
//void ShowDestinationOfPlottedPath( STR16 pLoc );
|
||||||
//void ResetAircraftButton( void );
|
//void ResetAircraftButton( void );
|
||||||
//void HandleMapScrollButtonStates( void );
|
|
||||||
|
|
||||||
void ToggleShowTownsMode( void );
|
void ToggleShowTownsMode( void );
|
||||||
void ToggleShowMinesMode( void );
|
void ToggleShowMinesMode( void );
|
||||||
@@ -91,12 +76,6 @@ void TurnOnItemFilterMode( void );
|
|||||||
// HEADROCK HAM 4: Turn on Mobile Militia Restrictions Filter
|
// HEADROCK HAM 4: Turn on Mobile Militia Restrictions Filter
|
||||||
void TurnOnMobileFilterMode( void );
|
void TurnOnMobileFilterMode( void );
|
||||||
|
|
||||||
/*
|
|
||||||
// enable disable map border
|
|
||||||
void DisableMapBorderRegion( void );
|
|
||||||
void EnableMapBorderRegion( void );
|
|
||||||
*/
|
|
||||||
|
|
||||||
// create/destroy buttons for map border region
|
// create/destroy buttons for map border region
|
||||||
void DeleteMapBorderButtons( void );
|
void DeleteMapBorderButtons( void );
|
||||||
BOOLEAN CreateButtonsForMapBorder( void );
|
BOOLEAN CreateButtonsForMapBorder( void );
|
||||||
@@ -107,8 +86,6 @@ BOOLEAN DoesPlayerHaveAnyMilitia( void );
|
|||||||
// HEADROCK HAM 4: Same with Mobiles.
|
// HEADROCK HAM 4: Same with Mobiles.
|
||||||
UINT8 DoesPlayerHaveAnyMobileMilitia( void );
|
UINT8 DoesPlayerHaveAnyMobileMilitia( void );
|
||||||
|
|
||||||
//void UpdateLevelButtonStates( void );
|
|
||||||
|
|
||||||
// create mouse regions for level markers
|
// create mouse regions for level markers
|
||||||
void CreateMouseRegionsForLevelMarkers( void );
|
void CreateMouseRegionsForLevelMarkers( void );
|
||||||
void DeleteMouseRegionsForLevelMarkers( void );
|
void DeleteMouseRegionsForLevelMarkers( void );
|
||||||
|
|||||||
+529
-1527
File diff suppressed because it is too large
Load Diff
@@ -716,8 +716,8 @@ void AddCommonInfoToBox(void)
|
|||||||
if ( fVisited )
|
if ( fVisited )
|
||||||
fKnownSite = TRUE;
|
fKnownSite = TRUE;
|
||||||
|
|
||||||
// known town check, exclude TownId 0 for non-town sectors
|
// known town check, to exclude non-town sectors
|
||||||
else if( gfHiddenTown[ ubTownId ] && ubTownId != 0 )
|
else if( gfHiddenTown[ ubTownId ] && ubTownId != BLANK_SECTOR )
|
||||||
fKnownSite = TRUE;
|
fKnownSite = TRUE;
|
||||||
|
|
||||||
// known SAM Site check
|
// known SAM Site check
|
||||||
|
|||||||
@@ -61,8 +61,6 @@ extern BOOLEAN gfTransitionMapscreenToAutoResolve;
|
|||||||
extern BOOLEAN gfExitViewer;
|
extern BOOLEAN gfExitViewer;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// zoom flag
|
|
||||||
extern BOOLEAN fZoomFlag;
|
|
||||||
extern BOOLEAN fMapScreenBottomDirty;
|
extern BOOLEAN fMapScreenBottomDirty;
|
||||||
|
|
||||||
#include "connect.h"
|
#include "connect.h"
|
||||||
|
|||||||
@@ -1008,7 +1008,8 @@ BOOLEAN CheckFact( UINT16 usFact, UINT8 ubProfileID )
|
|||||||
{
|
{
|
||||||
// if Skyrider, ignore low loyalty until he has monologues, and wait at least a day since the latest monologue to avoid a hot/cold attitude
|
// if Skyrider, ignore low loyalty until he has monologues, and wait at least a day since the latest monologue to avoid a hot/cold attitude
|
||||||
if ( ( ubProfileID == SKYRIDER ) &&
|
if ( ( ubProfileID == SKYRIDER ) &&
|
||||||
( ( guiHelicopterSkyriderTalkState == 0 ) || ( ( GetWorldTotalMin() - guiTimeOfLastSkyriderMonologue ) < ( 24 * 60 ) ) ) )
|
( ( guiHelicopterSkyriderTalkState == 0 ) || ( ( GetWorldTotalMin() - guiTimeOfLastSkyriderMonologue ) < ( 24 * 60 ) ) ||
|
||||||
|
( gHelicopterSettings.fHelicopterTownLoyaltyCheck == FALSE ) ) )
|
||||||
{
|
{
|
||||||
gubFact[usFact] = FALSE;
|
gubFact[usFact] = FALSE;
|
||||||
}
|
}
|
||||||
|
|||||||
+65
-230
@@ -4524,8 +4524,6 @@ UINT32 MapScreenHandle(void)
|
|||||||
|
|
||||||
guiTacticalInterfaceFlags |= INTERFACE_MAPSCREEN;
|
guiTacticalInterfaceFlags |= INTERFACE_MAPSCREEN;
|
||||||
|
|
||||||
// fDisabledMapBorder = FALSE;
|
|
||||||
|
|
||||||
// handle the sort buttons
|
// handle the sort buttons
|
||||||
AddTeamPanelSortButtonsForMapScreen( );
|
AddTeamPanelSortButtonsForMapScreen( );
|
||||||
|
|
||||||
@@ -5295,9 +5293,6 @@ UINT32 MapScreenHandle(void)
|
|||||||
// check if we are going to create or destroy map border graphics?
|
// check if we are going to create or destroy map border graphics?
|
||||||
CreateDestroyMapInventoryPoolButtons( FALSE );
|
CreateDestroyMapInventoryPoolButtons( FALSE );
|
||||||
|
|
||||||
// set up buttons for mapscreen scroll
|
|
||||||
// HandleMapScrollButtonStates( );
|
|
||||||
|
|
||||||
|
|
||||||
// don't process any input until we've been through here once
|
// don't process any input until we've been through here once
|
||||||
if( gfFirstMapscreenFrame == FALSE )
|
if( gfFirstMapscreenFrame == FALSE )
|
||||||
@@ -5361,8 +5356,6 @@ UINT32 MapScreenHandle(void)
|
|||||||
|
|
||||||
HandlePostAutoresolveMessages();
|
HandlePostAutoresolveMessages();
|
||||||
|
|
||||||
// UpdateLevelButtonStates( );
|
|
||||||
|
|
||||||
// NOTE: This must happen *before* UpdateTheStateOfTheNextPrevMapScreenCharacterButtons()
|
// NOTE: This must happen *before* UpdateTheStateOfTheNextPrevMapScreenCharacterButtons()
|
||||||
CreateDestroyMapCharacterScrollButtons( );
|
CreateDestroyMapCharacterScrollButtons( );
|
||||||
|
|
||||||
@@ -5493,7 +5486,7 @@ UINT32 MapScreenHandle(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( !fShowMapInventoryPool && !gfPauseDueToPlayerGamePause && !IsMapScreenHelpTextUp( ) /* && !fDisabledMapBorder */ )
|
if( !fShowMapInventoryPool && !gfPauseDueToPlayerGamePause && !IsMapScreenHelpTextUp( ) )
|
||||||
{
|
{
|
||||||
RenderMapCursorsIndexesAnims( );
|
RenderMapCursorsIndexesAnims( );
|
||||||
}
|
}
|
||||||
@@ -5615,11 +5608,6 @@ UINT32 MapScreenHandle(void)
|
|||||||
// handle dialog
|
// handle dialog
|
||||||
HandleDialogue( );
|
HandleDialogue( );
|
||||||
|
|
||||||
|
|
||||||
// now the border corner piece
|
|
||||||
// RenderMapBorderCorner( );
|
|
||||||
|
|
||||||
|
|
||||||
// handle display of inventory pop up
|
// handle display of inventory pop up
|
||||||
// HEADROCK HAM 3.5: Externalize!
|
// HEADROCK HAM 3.5: Externalize!
|
||||||
HandleDisplayOfItemPopUpForSector( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ );
|
HandleDisplayOfItemPopUpForSector( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ );
|
||||||
@@ -6358,12 +6346,7 @@ void RenderMapCursorsIndexesAnims( )
|
|||||||
if ( fHighlightChanged || gfMapPanelWasRedrawn )
|
if ( fHighlightChanged || gfMapPanelWasRedrawn )
|
||||||
{
|
{
|
||||||
// redraw sector index letters and numbers
|
// redraw sector index letters and numbers
|
||||||
/*
|
DrawMapIndexBigMap( fSelectedCursorIsYellow );
|
||||||
if( fZoomFlag )
|
|
||||||
DrawMapIndexSmallMap( fSelectedCursorIsYellow );
|
|
||||||
else
|
|
||||||
*/
|
|
||||||
DrawMapIndexBigMap( fSelectedCursorIsYellow );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6396,82 +6379,70 @@ UINT32 HandleMapUI( )
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MAP_EVENT_PLOT_PATH:
|
case MAP_EVENT_PLOT_PATH:
|
||||||
GetMouseMapXY(&sMapX, &sMapY);
|
GetMouseMapXY(&sMapX, &sMapY);
|
||||||
|
|
||||||
/*
|
// plotting for the chopper?
|
||||||
// translate screen values to map grid values for zoomed in
|
if( fPlotForHelicopter == TRUE )
|
||||||
if(fZoomFlag)
|
{
|
||||||
{
|
|
||||||
sMapX=(UINT16)iZoomX/MAP_GRID_X+sMapX;
|
if( IsSectorOutOfTheWay( sMapX, sMapY ) == TRUE )
|
||||||
sMapX=sMapX/2;
|
{
|
||||||
sMapY=(UINT16)iZoomY/MAP_GRID_Y+sMapY;
|
if( gfAllowSkyriderTooFarQuote == TRUE )
|
||||||
sMapY=sMapY/2;
|
{
|
||||||
}
|
SkyRiderTalk( DESTINATION_TOO_FAR );
|
||||||
*/
|
}
|
||||||
|
|
||||||
|
return( MAP_SCREEN );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// plotting for the chopper?
|
PlotPathForHelicopter( sMapX, sMapY );
|
||||||
if( fPlotForHelicopter == TRUE )
|
fTeamPanelDirty = TRUE;
|
||||||
{
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// plot for character
|
||||||
|
|
||||||
if( IsSectorOutOfTheWay( sMapX, sMapY ) == TRUE )
|
// check for valid character
|
||||||
{
|
Assert ( bSelectedDestChar != -1 );
|
||||||
if( gfAllowSkyriderTooFarQuote == TRUE )
|
if ( bSelectedDestChar == -1 )
|
||||||
{
|
break;
|
||||||
SkyRiderTalk( DESTINATION_TOO_FAR );
|
|
||||||
}
|
|
||||||
|
|
||||||
return( MAP_SCREEN );
|
// check if last sector in character's path is same as where mouse is
|
||||||
}
|
if( GetLastSectorIdInCharactersPath( &Menptr[gCharactersList[bSelectedDestChar].usSolID] ) != ( sMapX + ( sMapY * MAP_WORLD_X ) ) )
|
||||||
|
{
|
||||||
|
sX = ( GetLastSectorIdInCharactersPath( &Menptr[gCharactersList[bSelectedDestChar].usSolID] ) % MAP_WORLD_X );
|
||||||
|
sY = ( GetLastSectorIdInCharactersPath( &Menptr[gCharactersList[bSelectedDestChar].usSolID] ) / MAP_WORLD_X );
|
||||||
|
GetCursorPos(&MousePos);
|
||||||
|
ScreenToClient(ghWindow, &MousePos); // In window coords!
|
||||||
|
RestoreBackgroundForMapGrid( sX, sY );
|
||||||
|
// fMapPanelDirty = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
//SetFontDestBuffer( FRAME_BUFFER, 0, 0, 640, 480, FALSE );
|
||||||
|
|
||||||
PlotPathForHelicopter( sMapX, sMapY );
|
if( ( IsTheCursorAllowedToHighLightThisSector( sMapX, sMapY ) == TRUE ) &&
|
||||||
fTeamPanelDirty = TRUE;
|
( SectorInfo[ ( SECTOR( sMapX, sMapY ) ) ].ubTraversability[ THROUGH_STRATEGIC_MOVE ] != GROUNDBARRIER ) )
|
||||||
}
|
{
|
||||||
else
|
// Can we get go there? (NULL temp character path)
|
||||||
{
|
if ( GetLengthOfPath( pTempCharacterPath ) > 0 )
|
||||||
// plot for character
|
{
|
||||||
|
PlotPathForCharacter( &Menptr[gCharactersList[bSelectedDestChar].usSolID], sMapX, sMapY, FALSE );
|
||||||
|
|
||||||
// check for valid character
|
// copy the path to every other selected character
|
||||||
Assert ( bSelectedDestChar != -1 );
|
CopyPathToAllSelectedCharacters( GetSoldierMercPathPtr( MercPtrs[ gCharactersList[ bSelectedDestChar ].usSolID ] ) );
|
||||||
if ( bSelectedDestChar == -1 )
|
|
||||||
break;
|
|
||||||
|
|
||||||
// check if last sector in character's path is same as where mouse is
|
StartConfirmMapMoveMode( sMapY );
|
||||||
if( GetLastSectorIdInCharactersPath( &Menptr[gCharactersList[bSelectedDestChar].usSolID] ) != ( sMapX + ( sMapY * MAP_WORLD_X ) ) )
|
fMapPanelDirty = TRUE;
|
||||||
{
|
fTeamPanelDirty = TRUE; // update team panel desinations
|
||||||
sX = ( GetLastSectorIdInCharactersPath( &Menptr[gCharactersList[bSelectedDestChar].usSolID] ) % MAP_WORLD_X );
|
}
|
||||||
sY = ( GetLastSectorIdInCharactersPath( &Menptr[gCharactersList[bSelectedDestChar].usSolID] ) / MAP_WORLD_X );
|
else
|
||||||
GetCursorPos(&MousePos);
|
{
|
||||||
ScreenToClient(ghWindow, &MousePos); // In window coords!
|
// means it's a vehicle and we've clicked an off-road sector
|
||||||
RestoreBackgroundForMapGrid( sX, sY );
|
MapScreenMessage( FONT_MCOLOR_LTYELLOW, MSG_MAP_UI_POSITION_MIDDLE, pMapErrorString[ 40 ] );
|
||||||
// fMapPanelDirty = TRUE;
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//SetFontDestBuffer( FRAME_BUFFER, 0, 0, 640, 480, FALSE );
|
|
||||||
|
|
||||||
if( ( IsTheCursorAllowedToHighLightThisSector( sMapX, sMapY ) == TRUE ) &&
|
|
||||||
( SectorInfo[ ( SECTOR( sMapX, sMapY ) ) ].ubTraversability[ THROUGH_STRATEGIC_MOVE ] != GROUNDBARRIER ) )
|
|
||||||
{
|
|
||||||
// Can we get go there? (NULL temp character path)
|
|
||||||
if ( GetLengthOfPath( pTempCharacterPath ) > 0 )
|
|
||||||
{
|
|
||||||
PlotPathForCharacter( &Menptr[gCharactersList[bSelectedDestChar].usSolID], sMapX, sMapY, FALSE );
|
|
||||||
|
|
||||||
// copy the path to every other selected character
|
|
||||||
CopyPathToAllSelectedCharacters( GetSoldierMercPathPtr( MercPtrs[ gCharactersList[ bSelectedDestChar ].usSolID ] ) );
|
|
||||||
|
|
||||||
StartConfirmMapMoveMode( sMapY );
|
|
||||||
fMapPanelDirty = TRUE;
|
|
||||||
fTeamPanelDirty = TRUE; // update team panel desinations
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// means it's a vehicle and we've clicked an off-road sector
|
|
||||||
MapScreenMessage( FONT_MCOLOR_LTYELLOW, MSG_MAP_UI_POSITION_MIDDLE, pMapErrorString[ 40 ] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
@@ -6507,21 +6478,10 @@ UINT32 HandleMapUI( )
|
|||||||
// Get Current mouse position
|
// Get Current mouse position
|
||||||
if ( GetMouseMapXY( &sMapX, &sMapY) )
|
if ( GetMouseMapXY( &sMapX, &sMapY) )
|
||||||
{
|
{
|
||||||
/*
|
// make sure this is a valid sector
|
||||||
if( fZoomFlag == TRUE )
|
if( IsTheCursorAllowedToHighLightThisSector( sMapX, sMapY ) == FALSE )
|
||||||
{
|
{
|
||||||
// convert to zoom out coords from screen coords
|
// do nothing, return
|
||||||
sMapX = ( INT16 )( iZoomX / MAP_GRID_X + sMapX ) / 2;
|
|
||||||
sMapY = ( INT16 )( iZoomY / MAP_GRID_Y + sMapY ) / 2;
|
|
||||||
//sMapX = ( INT16 ) ( ( ( iZoomX ) / ( MAP_GRID_X * 2) ) + sMapX / 2 );
|
|
||||||
//sMapX = ( INT16 ) ( ( ( iZoomY ) / ( MAP_GRID_Y * 2) ) + sMapY / 2 );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// not zoomed out, make sure this is a valid sector
|
|
||||||
if( IsTheCursorAllowedToHighLightThisSector( sMapX, sMapY ) == FALSE )
|
|
||||||
{
|
|
||||||
// do nothing, return
|
|
||||||
return( MAP_SCREEN );
|
return( MAP_SCREEN );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8010,15 +7970,6 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
|||||||
if ( ( sMapX == pSoldier->sSectorX ) && ( sMapY == pSoldier->sSectorY ) )
|
if ( ( sMapX == pSoldier->sSectorX ) && ( sMapY == pSoldier->sSectorY ) )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/*
|
|
||||||
if( fZoomFlag == TRUE )
|
|
||||||
{
|
|
||||||
// convert to zoom out coords from screen coords
|
|
||||||
sMapX = ( INT16 )( iZoomX / MAP_GRID_X + sMapX ) / 2;
|
|
||||||
sMapY = ( INT16 )( iZoomY / MAP_GRID_Y + sMapY ) / 2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// cancel movement plotting
|
// cancel movement plotting
|
||||||
AbortMovementPlottingMode( );
|
AbortMovementPlottingMode( );
|
||||||
|
|
||||||
@@ -8686,20 +8637,6 @@ BOOLEAN GetMouseMapXY( INT16 *psMapWorldX, INT16 *psMapWorldY )
|
|||||||
GetCursorPos(&MousePos);
|
GetCursorPos(&MousePos);
|
||||||
ScreenToClient(ghWindow, &MousePos); // In window coords!
|
ScreenToClient(ghWindow, &MousePos); // In window coords!
|
||||||
|
|
||||||
if(fZoomFlag)
|
|
||||||
{
|
|
||||||
if(MousePos.x >MAP_GRID_X+MAP_VIEW_START_X)
|
|
||||||
MousePos.x-=MAP_GRID_X;
|
|
||||||
if(MousePos.x >MAP_VIEW_START_X+MAP_VIEW_WIDTH)
|
|
||||||
MousePos.x=-1;
|
|
||||||
if(MousePos.y > MAP_GRID_Y+MAP_VIEW_START_Y)
|
|
||||||
MousePos.y-=MAP_GRID_Y;
|
|
||||||
if(MousePos.y >MAP_VIEW_START_Y+MAP_VIEW_HEIGHT-11)
|
|
||||||
MousePos.y=-11;
|
|
||||||
if(MousePos.y < MAP_VIEW_START_Y)
|
|
||||||
MousePos.y=-1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return( GetMapXY( (INT16)MousePos.x, (INT16)MousePos.y, psMapWorldX, psMapWorldY ) );
|
return( GetMapXY( (INT16)MousePos.x, (INT16)MousePos.y, psMapWorldX, psMapWorldY ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8714,13 +8651,11 @@ BOOLEAN GetMapXY( INT16 sX, INT16 sY, INT16 *psMapWorldX, INT16 *psMapWorldY )
|
|||||||
sMapX = sX - MAP_VIEW_START_X;//+2*MAP_GRID_X;
|
sMapX = sX - MAP_VIEW_START_X;//+2*MAP_GRID_X;
|
||||||
sMapY = sY - MAP_VIEW_START_Y;
|
sMapY = sY - MAP_VIEW_START_Y;
|
||||||
|
|
||||||
if(!fZoomFlag)
|
if ( sMapX < MAP_GRID_X || sMapY < MAP_GRID_Y )
|
||||||
{
|
|
||||||
if ( sMapX < MAP_GRID_X || sMapY < MAP_GRID_Y )
|
|
||||||
{
|
{
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ( sMapX < 0 || sMapY < 0 )
|
if ( sMapX < 0 || sMapY < 0 )
|
||||||
{
|
{
|
||||||
return( FALSE );
|
return( FALSE );
|
||||||
@@ -8753,38 +8688,13 @@ void RenderMapHighlight( INT16 sMapX, INT16 sMapY, UINT16 usLineColor, BOOLEAN f
|
|||||||
Assert( ( sMapX >= 1 ) && ( sMapX <= 16 ) );
|
Assert( ( sMapX >= 1 ) && ( sMapX <= 16 ) );
|
||||||
Assert( ( sMapY >= 1 ) && ( sMapY <= 16 ) );
|
Assert( ( sMapY >= 1 ) && ( sMapY <= 16 ) );
|
||||||
|
|
||||||
/*
|
|
||||||
if((fZoomFlag)&&((sMapX > MAP_WORLD_X-1)||(sMapY> MAP_WORLD_Y-1)))
|
|
||||||
return;
|
|
||||||
*/
|
|
||||||
|
|
||||||
// if we are not allowed to highlight, leave
|
// if we are not allowed to highlight, leave
|
||||||
if( ( IsTheCursorAllowedToHighLightThisSector( sMapX, sMapY ) == FALSE )&&( fZoomFlag == FALSE ) )
|
if( ( IsTheCursorAllowedToHighLightThisSector( sMapX, sMapY ) == FALSE ) )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
else if( ( IsTheCursorAllowedToHighLightThisSector( sMapX , sMapY ) == FALSE )&&( fZoomFlag == TRUE ) && ( fStationary == TRUE ) )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if( ( IsTheCursorAllowedToHighLightThisSector( ( INT16 ) ( ( ( iZoomX ) / ( MAP_GRID_X * 2 ) ) + sMapX / 2 ) ,( INT16 ) ( ( ( iZoomY ) / ( MAP_GRID_Y * 2 ) ) + sMapY / 2 ) ) == FALSE ) && ( fZoomFlag == TRUE ) &&( fStationary == FALSE ) )
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
// if((!fStationary)||(!fZoomFlag))
|
|
||||||
{
|
|
||||||
GetScreenXYFromMapXY( sMapX, sMapY, &sScreenX, &sScreenY );
|
GetScreenXYFromMapXY( sMapX, sMapY, &sScreenX, &sScreenY );
|
||||||
}
|
|
||||||
/*
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GetScreenXYFromMapXYStationary( sMapX, sMapY, &sScreenX, &sScreenY );
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// blit in the highlighted sector
|
// blit in the highlighted sector
|
||||||
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
|
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
|
||||||
@@ -8795,20 +8705,8 @@ void RenderMapHighlight( INT16 sMapX, INT16 sMapY, UINT16 usLineColor, BOOLEAN f
|
|||||||
if(gbPixelDepth==16)
|
if(gbPixelDepth==16)
|
||||||
{
|
{
|
||||||
// DB Need to add a radar color for 8-bit
|
// DB Need to add a radar color for 8-bit
|
||||||
/*
|
|
||||||
if (fZoomFlag)
|
|
||||||
{
|
|
||||||
// draw rectangle for zoom in
|
|
||||||
RectangleDraw( TRUE, sScreenX-MAP_GRID_X, sScreenY-MAP_GRID_Y - 1, sScreenX + MAP_GRID_ZOOM_X - MAP_GRID_X, sScreenY + MAP_GRID_ZOOM_Y - MAP_GRID_Y - 1, usLineColor, pDestBuf );
|
|
||||||
InvalidateRegion( sScreenX-MAP_GRID_X - 3, sScreenY-MAP_GRID_Y - 4, sScreenX + DMAP_GRID_ZOOM_X - MAP_GRID_X, sScreenY + DMAP_GRID_ZOOM_Y - MAP_GRID_Y - 1 );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
// draw rectangle for zoom out
|
|
||||||
RectangleDraw( TRUE, sScreenX, sScreenY - 1, sScreenX + MAP_GRID_X, sScreenY + MAP_GRID_Y - 1, usLineColor, pDestBuf );
|
RectangleDraw( TRUE, sScreenX, sScreenY - 1, sScreenX + MAP_GRID_X, sScreenY + MAP_GRID_Y - 1, usLineColor, pDestBuf );
|
||||||
InvalidateRegion( sScreenX, sScreenY - 2, sScreenX + DMAP_GRID_X + 1, sScreenY + DMAP_GRID_Y - 1 );
|
InvalidateRegion( sScreenX, sScreenY - 2, sScreenX + DMAP_GRID_X + 1, sScreenY + DMAP_GRID_Y - 1 );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RestoreClipRegionToFullScreenForRectangle( uiDestPitchBYTES );
|
RestoreClipRegionToFullScreenForRectangle( uiDestPitchBYTES );
|
||||||
@@ -8816,7 +8714,6 @@ void RenderMapHighlight( INT16 sMapX, INT16 sMapY, UINT16 usLineColor, BOOLEAN f
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void PollLeftButtonInMapView( UINT32 *puiNewEvent )
|
void PollLeftButtonInMapView( UINT32 *puiNewEvent )
|
||||||
{
|
{
|
||||||
static BOOLEAN fLBBeenPressedInMapView = FALSE;
|
static BOOLEAN fLBBeenPressedInMapView = FALSE;
|
||||||
@@ -8902,17 +8799,6 @@ void PollLeftButtonInMapView( UINT32 *puiNewEvent )
|
|||||||
|
|
||||||
GetMouseMapXY(&sMapX, &sMapY);
|
GetMouseMapXY(&sMapX, &sMapY);
|
||||||
|
|
||||||
/*
|
|
||||||
// translate screen values to map grid values for zoomed in
|
|
||||||
if(fZoomFlag)
|
|
||||||
{
|
|
||||||
sMapX=(UINT16)iZoomX/MAP_GRID_X+sMapX;
|
|
||||||
sMapX=sMapX/2;
|
|
||||||
sMapY=(UINT16)iZoomY/MAP_GRID_Y+sMapY;
|
|
||||||
sMapY=sMapY/2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// if he clicked on the last sector in his current path
|
// if he clicked on the last sector in his current path
|
||||||
if( CheckIfClickOnLastSectorInPath( sMapX, sMapY ) )
|
if( CheckIfClickOnLastSectorInPath( sMapX, sMapY ) )
|
||||||
{
|
{
|
||||||
@@ -9022,16 +8908,6 @@ void PollRightButtonInMapView( UINT32 *puiNewEvent )
|
|||||||
{
|
{
|
||||||
if ( GetMouseMapXY( &sMapX, &sMapY ) )
|
if ( GetMouseMapXY( &sMapX, &sMapY ) )
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if(fZoomFlag)
|
|
||||||
{
|
|
||||||
sMapX=(UINT16)iZoomX/MAP_GRID_X+sMapX;
|
|
||||||
sMapX=sMapX/2;
|
|
||||||
sMapY=(UINT16)iZoomY/MAP_GRID_Y+sMapY;
|
|
||||||
sMapY=sMapY/2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// HEADROCK HAM 4: Toggle Militia Restrictions manually. This occurs when the Mobile Restrictions
|
// HEADROCK HAM 4: Toggle Militia Restrictions manually. This occurs when the Mobile Restrictions
|
||||||
// view is turned on. Each click advances the sector's classification by 1. If max is reached,
|
// view is turned on. Each click advances the sector's classification by 1. If max is reached,
|
||||||
// loops back to start.
|
// loops back to start.
|
||||||
@@ -11476,16 +11352,6 @@ void PlotTemporaryPaths( void )
|
|||||||
if ( fPlotForHelicopter == TRUE )
|
if ( fPlotForHelicopter == TRUE )
|
||||||
{
|
{
|
||||||
Assert( fShowAircraftFlag == TRUE );
|
Assert( fShowAircraftFlag == TRUE );
|
||||||
/*
|
|
||||||
if( fZoomFlag )
|
|
||||||
{
|
|
||||||
sMapX = ( INT16 )( ( ( iZoomX ) / ( WORLD_MAP_X ) ) + sMapX );
|
|
||||||
sMapX /= 2;
|
|
||||||
|
|
||||||
sMapY = ( INT16 )( ( ( iZoomY ) / ( WORLD_MAP_X ) ) + sMapY );
|
|
||||||
sMapY /= 2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// plot temp path
|
// plot temp path
|
||||||
PlotATemporaryPathForHelicopter( sMapX, sMapY);
|
PlotATemporaryPathForHelicopter( sMapX, sMapY);
|
||||||
@@ -11507,21 +11373,11 @@ void PlotTemporaryPaths( void )
|
|||||||
// dest char has been selected,
|
// dest char has been selected,
|
||||||
if( bSelectedDestChar != -1 )
|
if( bSelectedDestChar != -1 )
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if( fZoomFlag )
|
|
||||||
{
|
|
||||||
sMapX = ( INT16 )( ( ( iZoomX ) / ( MAP_GRID_X ) ) + sMapX );
|
|
||||||
sMapX /= 2;
|
|
||||||
|
|
||||||
sMapY = ( INT16 )( ( ( iZoomY ) / ( MAP_GRID_Y ) ) + sMapY );
|
|
||||||
sMapY /= 2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
PlotATemporaryPathForCharacter( &Menptr[ gCharactersList[ bSelectedDestChar ].usSolID ], sMapX, sMapY );
|
PlotATemporaryPathForCharacter( &Menptr[ gCharactersList[ bSelectedDestChar ].usSolID ], sMapX, sMapY );
|
||||||
|
|
||||||
// check to see if we are drawing path
|
// check to see if we are drawing path
|
||||||
DisplayThePotentialPathForCurrentDestinationCharacterForMapScreenInterface( sMapX, sMapY );
|
DisplayThePotentialPathForCurrentDestinationCharacterForMapScreenInterface( sMapX, sMapY );
|
||||||
|
|
||||||
// if we need to draw path, do it
|
// if we need to draw path, do it
|
||||||
if( fDrawTempPath == TRUE )
|
if( fDrawTempPath == TRUE )
|
||||||
@@ -12532,15 +12388,6 @@ void UpdateCursorIfInLastSector( void )
|
|||||||
{
|
{
|
||||||
GetMouseMapXY(&sMapX, &sMapY);
|
GetMouseMapXY(&sMapX, &sMapY);
|
||||||
|
|
||||||
// translate screen values to map grid values for zoomed in
|
|
||||||
if(fZoomFlag)
|
|
||||||
{
|
|
||||||
sMapX=(UINT16)iZoomX/MAP_GRID_X+sMapX;
|
|
||||||
sMapX=sMapX/2;
|
|
||||||
sMapY=(UINT16)iZoomY/MAP_GRID_Y+sMapY;
|
|
||||||
sMapY=sMapY/2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( fShowAircraftFlag == FALSE )
|
if( fShowAircraftFlag == FALSE )
|
||||||
{
|
{
|
||||||
if( bSelectedDestChar != -1 )
|
if( bSelectedDestChar != -1 )
|
||||||
@@ -14546,17 +14393,6 @@ void CancelOrShortenPlottedPath( void )
|
|||||||
|
|
||||||
GetMouseMapXY(&sMapX, &sMapY);
|
GetMouseMapXY(&sMapX, &sMapY);
|
||||||
|
|
||||||
/*
|
|
||||||
// translate zoom in to zoom out coords
|
|
||||||
if(fZoomFlag)
|
|
||||||
{
|
|
||||||
sMapX=(UINT16)iZoomX/MAP_GRID_X+sMapX;
|
|
||||||
sMapX=sMapX/2;
|
|
||||||
sMapY=(UINT16)iZoomY/MAP_GRID_Y+sMapY;
|
|
||||||
sMapY=sMapY/2;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
// check if we are in aircraft mode
|
// check if we are in aircraft mode
|
||||||
if( fShowAircraftFlag == TRUE )
|
if( fShowAircraftFlag == TRUE )
|
||||||
{
|
{
|
||||||
@@ -16031,8 +15867,7 @@ void SelectAllCharactersInSquad( INT8 bSquadNumber )
|
|||||||
|
|
||||||
BOOLEAN CanDrawSectorCursor( void )
|
BOOLEAN CanDrawSectorCursor( void )
|
||||||
{
|
{
|
||||||
if( /*( fCursorIsOnMapScrollButtons == FALSE ) && */
|
if( ( fShowTownInfo == FALSE ) && ( ghTownMineBox == -1 ) &&
|
||||||
( fShowTownInfo == FALSE ) && ( ghTownMineBox == -1 ) &&
|
|
||||||
( fShowUpdateBox == FALSE ) && ( GetNumberOfMercsInUpdateList() == 0 ) &&
|
( fShowUpdateBox == FALSE ) && ( GetNumberOfMercsInUpdateList() == 0 ) &&
|
||||||
( sSelectedMilitiaTown == 0 ) && ( gfMilitiaPopupCreated == FALSE ) &&
|
( sSelectedMilitiaTown == 0 ) && ( gfMilitiaPopupCreated == FALSE ) &&
|
||||||
( gfStartedFromMapScreen == FALSE ) &&
|
( gfStartedFromMapScreen == FALSE ) &&
|
||||||
|
|||||||
Reference in New Issue
Block a user