mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52: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.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.fHelicopterTownLoyaltyCheck = iniReader.ReadBoolean("Helicopter Other Settings","HELICOPTER_TOWN_LOYALTY_CHECK", TRUE );
|
||||
}
|
||||
|
||||
void FreeGameExternalOptions()
|
||||
|
||||
+2
-1
@@ -1437,12 +1437,13 @@ typedef struct
|
||||
UINT8 ubHelicopterTimeDelayForHoverWaitTooLong;
|
||||
BOOLEAN fAskBeforeKickingPassengersOut;
|
||||
|
||||
|
||||
UINT8 ubHelicopterSAMSiteAccuracy;
|
||||
UINT8 ubHelicopterPassengerHitChance;
|
||||
UINT8 ubHelicopterPassengerHitMinDamage;
|
||||
UINT8 ubHelicopterPassengerHitMaxDamage;
|
||||
|
||||
BOOLEAN fHelicopterTownLoyaltyCheck;
|
||||
|
||||
} HELICOPTER_SETTINGS;
|
||||
|
||||
typedef struct
|
||||
|
||||
@@ -40,9 +40,6 @@
|
||||
#include "ub_config.h"
|
||||
#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?
|
||||
UINT16 MAP_BORDER_TOWN_BTN_X;
|
||||
UINT16 MAP_BORDER_TOWN_BTN_Y;
|
||||
@@ -73,8 +70,6 @@ MOUSE_REGION LevelMouseRegions[ 4 ];
|
||||
|
||||
// graphics
|
||||
UINT32 guiMapBorder;
|
||||
//UINT32 guiMapBorderCorner;
|
||||
|
||||
|
||||
// scroll direction
|
||||
INT32 giScrollButtonState = -1;
|
||||
@@ -88,13 +83,8 @@ BOOLEAN fShowAircraftFlag = FALSE;
|
||||
BOOLEAN fShowItemsFlag = FALSE;
|
||||
BOOLEAN fShowMobileRestrictionsFlag = FALSE; // HEADROCK HAM 4
|
||||
|
||||
BOOLEAN fZoomFlag = 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.
|
||||
extern POPUP* gMapInventoryFilterPopup;
|
||||
extern BOOLEAN gfMapInventoryFilterPopupVisible;
|
||||
@@ -111,23 +101,9 @@ extern int CLOCK_Y_START;
|
||||
INT32 giMapBorderButtons[ 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 );
|
||||
BOOLEAN CreateButtonsForMapBorder( void );
|
||||
|
||||
|
||||
//void MapScrollButtonMvtCheck( void );
|
||||
//BOOLEAN ScrollButtonsDisplayingHelpMessage( void );
|
||||
//void UpdateScrollButtonStatesWhileScrolling( void );
|
||||
|
||||
// set button states to match map flags
|
||||
void InitializeMapBorderButtonStates( void );
|
||||
|
||||
@@ -147,21 +123,11 @@ void BtnTeamCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
void BtnMilitiaCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
// HEADROCK HAM 4: Mobile Restrictions Button callback
|
||||
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 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 )
|
||||
{
|
||||
@@ -186,16 +152,6 @@ BOOLEAN LoadMapBorderGraphics( void )
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
@@ -205,7 +161,6 @@ void DeleteMapBorderGraphics( void )
|
||||
// procedure will delete graphics loaded for map border
|
||||
|
||||
DeleteVideoObjectFromIndex( guiMapBorder );
|
||||
// DeleteVideoObjectFromIndex( guiMapBorderCorner );
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -217,13 +172,6 @@ void RenderMapBorder( void )
|
||||
// renders the actual border to the guiSAVEBUFFER
|
||||
HVOBJECT hHandle;
|
||||
|
||||
/*
|
||||
if( fDisabledMapBorder )
|
||||
{
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
// HEADROCK HAM 5: Do not redraw if the filter menu is open.
|
||||
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 )
|
||||
{
|
||||
// renders map border corner to the FRAME_BUFFER
|
||||
HVOBJECT hHandle;
|
||||
|
||||
/*
|
||||
if( fDisabledMapBorder )
|
||||
{
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
if( fShowMapInventoryPool )
|
||||
{
|
||||
return;
|
||||
@@ -341,37 +254,6 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
||||
|
||||
// HEADROCK HAM 4: Call to initiate coordinates for all buttons.
|
||||
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.
|
||||
|
||||
@@ -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
|
||||
SetButtonFastHelpText( giMapBorderButtons[ 0 ], pMapScreenBorderButtonHelpText[ 0 ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ 1 ], pMapScreenBorderButtonHelpText[ 1 ] );
|
||||
@@ -451,9 +316,6 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
||||
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
||||
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[ 1 ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ 2 ], MSYS_NO_CURSOR );
|
||||
@@ -464,9 +326,6 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
||||
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
||||
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
|
||||
//EnableButton
|
||||
@@ -548,13 +407,6 @@ void DeleteMapBorderButtons( void )
|
||||
{
|
||||
UINT8 ubCnt;
|
||||
|
||||
/*
|
||||
RemoveButton( guiMapBorderScrollButtons[ 0 ]);
|
||||
RemoveButton( guiMapBorderScrollButtons[ 1 ]);
|
||||
RemoveButton( guiMapBorderScrollButtons[ 2 ]);
|
||||
RemoveButton( guiMapBorderScrollButtons[ 3 ]);
|
||||
*/
|
||||
|
||||
RemoveButton( giMapBorderButtons[ 0 ]);
|
||||
RemoveButton( giMapBorderButtons[ 1 ]);
|
||||
RemoveButton( giMapBorderButtons[ 2 ]);
|
||||
@@ -566,18 +418,8 @@ void DeleteMapBorderButtons( void )
|
||||
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
||||
RemoveButton( giMapBorderButtons[ 6 ]); // HEADROCK HAM 4
|
||||
|
||||
//RemoveButton( guiMapBorderLandRaiseButtons[ 0 ]);
|
||||
//RemoveButton( guiMapBorderLandRaiseButtons[ 1 ]);
|
||||
|
||||
// images
|
||||
|
||||
/*
|
||||
UnloadButtonImage( guiMapBorderScrollButtonsImage[ 0 ] );
|
||||
UnloadButtonImage( guiMapBorderScrollButtonsImage[ 1 ] );
|
||||
UnloadButtonImage( guiMapBorderScrollButtonsImage[ 2 ] );
|
||||
UnloadButtonImage( guiMapBorderScrollButtonsImage[ 3 ] );
|
||||
*/
|
||||
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ 0 ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ 1 ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ 2 ] );
|
||||
@@ -590,10 +432,6 @@ void DeleteMapBorderButtons( void )
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ 6 ] ); // HEADROCK HAM 4
|
||||
|
||||
|
||||
//UnloadButtonImage( guiMapBorderLandRaiseButtonsImage[ 0 ] );
|
||||
//UnloadButtonImage( guiMapBorderLandRaiseButtonsImage[ 1 ] );
|
||||
|
||||
|
||||
// HEADROCK HAM 4: Increased number of buttons by one.
|
||||
for ( ubCnt = 0; ubCnt < NUM_MAP_BORDER_BTNS; ubCnt++ )
|
||||
{
|
||||
@@ -604,65 +442,6 @@ void DeleteMapBorderButtons( void )
|
||||
|
||||
|
||||
// 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)
|
||||
{
|
||||
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 )
|
||||
{
|
||||
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 )
|
||||
{
|
||||
// display the current level marker on the map border
|
||||
HVOBJECT hHandle;
|
||||
|
||||
/*
|
||||
if( fDisabledMapBorder )
|
||||
{
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
// it's actually a white rectangle, not a green arrow!
|
||||
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 )
|
||||
{
|
||||
// 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 )
|
||||
{
|
||||
|
||||
@@ -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
|
||||
//#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;
|
||||
@@ -57,24 +49,17 @@ extern BOOLEAN fShowTeamFlag;
|
||||
extern BOOLEAN fShowMilitia;
|
||||
extern BOOLEAN fShowAircraftFlag;
|
||||
extern BOOLEAN fShowItemsFlag;
|
||||
extern BOOLEAN fZoomFlag;
|
||||
extern BOOLEAN fShowMobileRestrictionsFlag; // HEADROCK HAM 4: Manual Mobile Militia mode
|
||||
//extern BOOLEAN fShowVehicleFlag;
|
||||
|
||||
//extern BOOLEAN fMapScrollDueToPanelButton;
|
||||
//extern BOOLEAN fCursorIsOnMapScrollButtons;
|
||||
//extern BOOLEAN fDisabledMapBorder;
|
||||
|
||||
// scroll animation
|
||||
extern INT32 giScrollButtonState;
|
||||
|
||||
BOOLEAN LoadMapBorderGraphics( void );
|
||||
void DeleteMapBorderGraphics( void );
|
||||
void RenderMapBorder( void );
|
||||
//void RenderMapBorderCorner( void );
|
||||
//void ShowDestinationOfPlottedPath( STR16 pLoc );
|
||||
//void ResetAircraftButton( void );
|
||||
//void HandleMapScrollButtonStates( void );
|
||||
|
||||
void ToggleShowTownsMode( void );
|
||||
void ToggleShowMinesMode( void );
|
||||
@@ -91,12 +76,6 @@ void TurnOnItemFilterMode( void );
|
||||
// HEADROCK HAM 4: Turn on Mobile Militia Restrictions Filter
|
||||
void TurnOnMobileFilterMode( void );
|
||||
|
||||
/*
|
||||
// enable disable map border
|
||||
void DisableMapBorderRegion( void );
|
||||
void EnableMapBorderRegion( void );
|
||||
*/
|
||||
|
||||
// create/destroy buttons for map border region
|
||||
void DeleteMapBorderButtons( void );
|
||||
BOOLEAN CreateButtonsForMapBorder( void );
|
||||
@@ -107,8 +86,6 @@ BOOLEAN DoesPlayerHaveAnyMilitia( void );
|
||||
// HEADROCK HAM 4: Same with Mobiles.
|
||||
UINT8 DoesPlayerHaveAnyMobileMilitia( void );
|
||||
|
||||
//void UpdateLevelButtonStates( void );
|
||||
|
||||
// create mouse regions for level markers
|
||||
void CreateMouseRegionsForLevelMarkers( 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 )
|
||||
fKnownSite = TRUE;
|
||||
|
||||
// known town check, exclude TownId 0 for non-town sectors
|
||||
else if( gfHiddenTown[ ubTownId ] && ubTownId != 0 )
|
||||
// known town check, to exclude non-town sectors
|
||||
else if( gfHiddenTown[ ubTownId ] && ubTownId != BLANK_SECTOR )
|
||||
fKnownSite = TRUE;
|
||||
|
||||
// known SAM Site check
|
||||
|
||||
@@ -61,8 +61,6 @@ extern BOOLEAN gfTransitionMapscreenToAutoResolve;
|
||||
extern BOOLEAN gfExitViewer;
|
||||
#endif
|
||||
|
||||
// zoom flag
|
||||
extern BOOLEAN fZoomFlag;
|
||||
extern BOOLEAN fMapScreenBottomDirty;
|
||||
|
||||
#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 ( ( ubProfileID == SKYRIDER ) &&
|
||||
( ( guiHelicopterSkyriderTalkState == 0 ) || ( ( GetWorldTotalMin() - guiTimeOfLastSkyriderMonologue ) < ( 24 * 60 ) ) ) )
|
||||
( ( guiHelicopterSkyriderTalkState == 0 ) || ( ( GetWorldTotalMin() - guiTimeOfLastSkyriderMonologue ) < ( 24 * 60 ) ) ||
|
||||
( gHelicopterSettings.fHelicopterTownLoyaltyCheck == FALSE ) ) )
|
||||
{
|
||||
gubFact[usFact] = FALSE;
|
||||
}
|
||||
|
||||
+65
-230
@@ -4524,8 +4524,6 @@ UINT32 MapScreenHandle(void)
|
||||
|
||||
guiTacticalInterfaceFlags |= INTERFACE_MAPSCREEN;
|
||||
|
||||
// fDisabledMapBorder = FALSE;
|
||||
|
||||
// handle the sort buttons
|
||||
AddTeamPanelSortButtonsForMapScreen( );
|
||||
|
||||
@@ -5295,9 +5293,6 @@ UINT32 MapScreenHandle(void)
|
||||
// check if we are going to create or destroy map border graphics?
|
||||
CreateDestroyMapInventoryPoolButtons( FALSE );
|
||||
|
||||
// set up buttons for mapscreen scroll
|
||||
// HandleMapScrollButtonStates( );
|
||||
|
||||
|
||||
// don't process any input until we've been through here once
|
||||
if( gfFirstMapscreenFrame == FALSE )
|
||||
@@ -5361,8 +5356,6 @@ UINT32 MapScreenHandle(void)
|
||||
|
||||
HandlePostAutoresolveMessages();
|
||||
|
||||
// UpdateLevelButtonStates( );
|
||||
|
||||
// NOTE: This must happen *before* UpdateTheStateOfTheNextPrevMapScreenCharacterButtons()
|
||||
CreateDestroyMapCharacterScrollButtons( );
|
||||
|
||||
@@ -5493,7 +5486,7 @@ UINT32 MapScreenHandle(void)
|
||||
}
|
||||
|
||||
|
||||
if( !fShowMapInventoryPool && !gfPauseDueToPlayerGamePause && !IsMapScreenHelpTextUp( ) /* && !fDisabledMapBorder */ )
|
||||
if( !fShowMapInventoryPool && !gfPauseDueToPlayerGamePause && !IsMapScreenHelpTextUp( ) )
|
||||
{
|
||||
RenderMapCursorsIndexesAnims( );
|
||||
}
|
||||
@@ -5615,11 +5608,6 @@ UINT32 MapScreenHandle(void)
|
||||
// handle dialog
|
||||
HandleDialogue( );
|
||||
|
||||
|
||||
// now the border corner piece
|
||||
// RenderMapBorderCorner( );
|
||||
|
||||
|
||||
// handle display of inventory pop up
|
||||
// HEADROCK HAM 3.5: Externalize!
|
||||
HandleDisplayOfItemPopUpForSector( gGameExternalOptions.ubDefaultArrivalSectorX, gGameExternalOptions.ubDefaultArrivalSectorY, startingZ );
|
||||
@@ -6358,12 +6346,7 @@ void RenderMapCursorsIndexesAnims( )
|
||||
if ( fHighlightChanged || gfMapPanelWasRedrawn )
|
||||
{
|
||||
// redraw sector index letters and numbers
|
||||
/*
|
||||
if( fZoomFlag )
|
||||
DrawMapIndexSmallMap( fSelectedCursorIsYellow );
|
||||
else
|
||||
*/
|
||||
DrawMapIndexBigMap( fSelectedCursorIsYellow );
|
||||
DrawMapIndexBigMap( fSelectedCursorIsYellow );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6396,82 +6379,70 @@ UINT32 HandleMapUI( )
|
||||
break;
|
||||
|
||||
case MAP_EVENT_PLOT_PATH:
|
||||
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;
|
||||
}
|
||||
*/
|
||||
// plotting for the chopper?
|
||||
if( fPlotForHelicopter == TRUE )
|
||||
{
|
||||
|
||||
if( IsSectorOutOfTheWay( sMapX, sMapY ) == TRUE )
|
||||
{
|
||||
if( gfAllowSkyriderTooFarQuote == TRUE )
|
||||
{
|
||||
SkyRiderTalk( DESTINATION_TOO_FAR );
|
||||
}
|
||||
|
||||
return( MAP_SCREEN );
|
||||
}
|
||||
|
||||
|
||||
// plotting for the chopper?
|
||||
if( fPlotForHelicopter == TRUE )
|
||||
{
|
||||
PlotPathForHelicopter( sMapX, sMapY );
|
||||
fTeamPanelDirty = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// plot for character
|
||||
|
||||
if( IsSectorOutOfTheWay( sMapX, sMapY ) == TRUE )
|
||||
{
|
||||
if( gfAllowSkyriderTooFarQuote == TRUE )
|
||||
{
|
||||
SkyRiderTalk( DESTINATION_TOO_FAR );
|
||||
}
|
||||
// check for valid character
|
||||
Assert ( bSelectedDestChar != -1 );
|
||||
if ( bSelectedDestChar == -1 )
|
||||
break;
|
||||
|
||||
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 );
|
||||
fTeamPanelDirty = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// plot for character
|
||||
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 );
|
||||
|
||||
// check for valid character
|
||||
Assert ( bSelectedDestChar != -1 );
|
||||
if ( bSelectedDestChar == -1 )
|
||||
break;
|
||||
// copy the path to every other selected character
|
||||
CopyPathToAllSelectedCharacters( GetSoldierMercPathPtr( MercPtrs[ gCharactersList[ bSelectedDestChar ].usSolID ] ) );
|
||||
|
||||
// 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 );
|
||||
|
||||
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 ] );
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
|
||||
|
||||
@@ -6507,21 +6478,10 @@ UINT32 HandleMapUI( )
|
||||
// Get Current mouse position
|
||||
if ( GetMouseMapXY( &sMapX, &sMapY) )
|
||||
{
|
||||
/*
|
||||
if( fZoomFlag == TRUE )
|
||||
// make sure this is a valid sector
|
||||
if( IsTheCursorAllowedToHighLightThisSector( sMapX, sMapY ) == FALSE )
|
||||
{
|
||||
// convert to zoom out coords from screen coords
|
||||
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
|
||||
// do nothing, return
|
||||
return( MAP_SCREEN );
|
||||
}
|
||||
|
||||
@@ -8010,15 +7970,6 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
if ( ( sMapX == pSoldier->sSectorX ) && ( sMapY == pSoldier->sSectorY ) )
|
||||
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
|
||||
AbortMovementPlottingMode( );
|
||||
|
||||
@@ -8686,20 +8637,6 @@ BOOLEAN GetMouseMapXY( INT16 *psMapWorldX, INT16 *psMapWorldY )
|
||||
GetCursorPos(&MousePos);
|
||||
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 ) );
|
||||
}
|
||||
|
||||
@@ -8714,13 +8651,11 @@ BOOLEAN GetMapXY( INT16 sX, INT16 sY, INT16 *psMapWorldX, INT16 *psMapWorldY )
|
||||
sMapX = sX - MAP_VIEW_START_X;//+2*MAP_GRID_X;
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
||||
if ( sMapX < 0 || sMapY < 0 )
|
||||
{
|
||||
return( FALSE );
|
||||
@@ -8753,38 +8688,13 @@ void RenderMapHighlight( INT16 sMapX, INT16 sMapY, UINT16 usLineColor, BOOLEAN f
|
||||
Assert( ( sMapX >= 1 ) && ( sMapX <= 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( ( IsTheCursorAllowedToHighLightThisSector( sMapX, sMapY ) == FALSE )&&( fZoomFlag == FALSE ) )
|
||||
if( ( IsTheCursorAllowedToHighLightThisSector( sMapX, sMapY ) == FALSE ) )
|
||||
{
|
||||
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 );
|
||||
}
|
||||
/*
|
||||
else
|
||||
{
|
||||
GetScreenXYFromMapXYStationary( sMapX, sMapY, &sScreenX, &sScreenY );
|
||||
}
|
||||
*/
|
||||
|
||||
// blit in the highlighted sector
|
||||
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
|
||||
@@ -8795,20 +8705,8 @@ void RenderMapHighlight( INT16 sMapX, INT16 sMapY, UINT16 usLineColor, BOOLEAN f
|
||||
if(gbPixelDepth==16)
|
||||
{
|
||||
// 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 );
|
||||
InvalidateRegion( sScreenX, sScreenY - 2, sScreenX + DMAP_GRID_X + 1, sScreenY + DMAP_GRID_Y - 1 );
|
||||
}
|
||||
}
|
||||
|
||||
RestoreClipRegionToFullScreenForRectangle( uiDestPitchBYTES );
|
||||
@@ -8816,7 +8714,6 @@ void RenderMapHighlight( INT16 sMapX, INT16 sMapY, UINT16 usLineColor, BOOLEAN f
|
||||
}
|
||||
|
||||
|
||||
|
||||
void PollLeftButtonInMapView( UINT32 *puiNewEvent )
|
||||
{
|
||||
static BOOLEAN fLBBeenPressedInMapView = FALSE;
|
||||
@@ -8902,17 +8799,6 @@ void PollLeftButtonInMapView( UINT32 *puiNewEvent )
|
||||
|
||||
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( CheckIfClickOnLastSectorInPath( sMapX, sMapY ) )
|
||||
{
|
||||
@@ -9022,16 +8908,6 @@ void PollRightButtonInMapView( UINT32 *puiNewEvent )
|
||||
{
|
||||
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
|
||||
// view is turned on. Each click advances the sector's classification by 1. If max is reached,
|
||||
// loops back to start.
|
||||
@@ -11476,16 +11352,6 @@ void PlotTemporaryPaths( void )
|
||||
if ( fPlotForHelicopter == 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
|
||||
PlotATemporaryPathForHelicopter( sMapX, sMapY);
|
||||
@@ -11507,21 +11373,11 @@ void PlotTemporaryPaths( void )
|
||||
// dest char has been selected,
|
||||
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 );
|
||||
|
||||
// check to see if we are drawing path
|
||||
DisplayThePotentialPathForCurrentDestinationCharacterForMapScreenInterface( sMapX, sMapY );
|
||||
DisplayThePotentialPathForCurrentDestinationCharacterForMapScreenInterface( sMapX, sMapY );
|
||||
|
||||
// if we need to draw path, do it
|
||||
if( fDrawTempPath == TRUE )
|
||||
@@ -12532,15 +12388,6 @@ void UpdateCursorIfInLastSector( void )
|
||||
{
|
||||
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( bSelectedDestChar != -1 )
|
||||
@@ -14546,17 +14393,6 @@ void CancelOrShortenPlottedPath( void )
|
||||
|
||||
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
|
||||
if( fShowAircraftFlag == TRUE )
|
||||
{
|
||||
@@ -16031,8 +15867,7 @@ void SelectAllCharactersInSquad( INT8 bSquadNumber )
|
||||
|
||||
BOOLEAN CanDrawSectorCursor( void )
|
||||
{
|
||||
if( /*( fCursorIsOnMapScrollButtons == FALSE ) && */
|
||||
( fShowTownInfo == FALSE ) && ( ghTownMineBox == -1 ) &&
|
||||
if( ( fShowTownInfo == FALSE ) && ( ghTownMineBox == -1 ) &&
|
||||
( fShowUpdateBox == FALSE ) && ( GetNumberOfMercsInUpdateList() == 0 ) &&
|
||||
( sSelectedMilitiaTown == 0 ) && ( gfMilitiaPopupCreated == FALSE ) &&
|
||||
( gfStartedFromMapScreen == FALSE ) &&
|
||||
|
||||
Reference in New Issue
Block a user