mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Widescreen UI patch (by Asdow).
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9216 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -2628,6 +2628,8 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve
|
||||
else
|
||||
{
|
||||
// WANNE - MP: We have to re-initialize the correct interface
|
||||
// Have to initialize map UI Coordinates, because inventory panel layout location depends on them.
|
||||
initMapViewAndBorderCoordinates();
|
||||
if((UsingNewInventorySystem() == true))
|
||||
{
|
||||
InitNewInventorySystem();
|
||||
@@ -2824,6 +2826,8 @@ void reapplySETTINGS()
|
||||
gGameOptions.ubSquadSize = 6;
|
||||
|
||||
// WANNE - MP: We have to re-initialize the correct interface
|
||||
// Have to initialize map UI Coordinates, because inventory panel layout location depends on them.
|
||||
initMapViewAndBorderCoordinates();
|
||||
if((UsingNewInventorySystem() == true) && IsNIVModeValid(true))
|
||||
{
|
||||
InitNewInventorySystem();
|
||||
|
||||
@@ -182,6 +182,7 @@ extern void BeginLoadScreen( void );
|
||||
extern void EndLoadScreen();
|
||||
|
||||
extern CPostalService gPostalService;
|
||||
extern void initMapViewAndBorderCoordinates(void);
|
||||
|
||||
//Global variable used
|
||||
#ifdef JA2BETAVERSION
|
||||
@@ -4803,6 +4804,8 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
|
||||
gGameOptions.ubAttachmentSystem = SaveGameHeader.sInitialGameOptions.ubAttachmentSystem;
|
||||
}
|
||||
|
||||
// Have to initialize map UI Coordinates, because inventory panel layout location depends on them.
|
||||
initMapViewAndBorderCoordinates();
|
||||
if((UsingNewInventorySystem() == true))
|
||||
{
|
||||
if(IsNIVModeValid(true) == FALSE){
|
||||
|
||||
@@ -95,6 +95,15 @@ typedef CHAR8 SGPFILENAME[SGPFILENAME_LEN];
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
INT32 x;
|
||||
INT32 y;
|
||||
INT32 width;
|
||||
INT32 height;
|
||||
|
||||
} SGPRectangle;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
INT32 iLeft;
|
||||
|
||||
@@ -507,6 +507,10 @@ BOOLEAN BltVideoObject( UINT32 uiDestVSurface,
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
BOOLEAN BltVideoObject(UINT32 uiDestVSurface, HVOBJECT hSrcVObject, UINT16 usRegionIndex, SGPRectangle Region, UINT32 fBltFlags, blt_fx* pBltFx)
|
||||
{
|
||||
return BltVideoObject(uiDestVSurface, hSrcVObject, usRegionIndex, Region.x, Region.y, fBltFlags, pBltFx);
|
||||
}
|
||||
// *******************************************************************************
|
||||
// Video Object Manipulation Functions
|
||||
// *******************************************************************************
|
||||
|
||||
@@ -175,6 +175,7 @@ BOOLEAN BltVideoObject( UINT32 uiDestVSurface,
|
||||
INT32 iDestY,
|
||||
UINT32 fBltFlags,
|
||||
blt_fx *pBltFx );
|
||||
BOOLEAN BltVideoObject(UINT32 uiDestVSurface, HVOBJECT hSrcVObject, UINT16 usRegionIndex, SGPRectangle Region, UINT32 fBltFlags, blt_fx* pBltFx);
|
||||
|
||||
BOOLEAN BltVideoObjectFromIndex( UINT32 uiDestVSurface,
|
||||
UINT32 uiSrcVObject,
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
extern int POP_UP_BOX_X;
|
||||
|
||||
#include "MilitiaSquads.h"
|
||||
// HEADROCK HAM 3.5: Include Facility data
|
||||
@@ -15410,7 +15411,7 @@ void CreateAssignmentsBox( void )
|
||||
|
||||
// will create attribute pop up menu for mapscreen assignments
|
||||
|
||||
AssignmentPosition.iX = (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + OrigAssignmentPosition.iX;
|
||||
AssignmentPosition.iX = POP_UP_BOX_X;
|
||||
|
||||
if( giBoxY != 0 )
|
||||
{
|
||||
|
||||
@@ -279,6 +279,7 @@ enum
|
||||
};
|
||||
|
||||
extern void CreateDestroyMapInvButton();
|
||||
extern void DestroyMapCharInvIOregions();
|
||||
|
||||
//Autoresolve sets this variable which defaults to -1 when not needed.
|
||||
INT16 gsEnemyGainedControlOfSectorID = -1;
|
||||
@@ -593,7 +594,14 @@ void EnterAutoResolveMode( UINT8 ubSectorX, UINT8 ubSectorY )
|
||||
|
||||
//Set up mapscreen for removal
|
||||
SetPendingNewScreen( AUTORESOLVE_SCREEN );
|
||||
CreateDestroyMapInvButton();
|
||||
if (isWidescreenUI())
|
||||
{
|
||||
DestroyMapCharInvIOregions();
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateDestroyMapInvButton();
|
||||
}
|
||||
RenderButtons();
|
||||
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve1");
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
|
||||
#include "PostalService.h"
|
||||
extern CPostalService gPostalService;
|
||||
extern void initMapViewAndBorderCoordinates(void);
|
||||
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -583,6 +584,8 @@ fFirstTimeInMapScreen = TRUE;
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"InitNewGame: set initial inventory coords");
|
||||
if( gubScreenCount == 0 )
|
||||
{
|
||||
// Have to initialize map UI Coordinates, because inventory panel layout location depends on them.
|
||||
initMapViewAndBorderCoordinates();
|
||||
if((UsingNewInventorySystem() == true))
|
||||
{
|
||||
InitNewInventorySystem();
|
||||
|
||||
@@ -39,31 +39,9 @@
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
// 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;
|
||||
UINT16 MAP_BORDER_MINE_BTN_X;
|
||||
UINT16 MAP_BORDER_MINE_BTN_Y;
|
||||
UINT16 MAP_BORDER_TEAMS_BTN_X;
|
||||
UINT16 MAP_BORDER_TEAMS_BTN_Y;
|
||||
UINT16 MAP_BORDER_AIRSPACE_BTN_X;
|
||||
UINT16 MAP_BORDER_AIRSPACE_BTN_Y;
|
||||
UINT16 MAP_BORDER_ITEM_BTN_X;
|
||||
UINT16 MAP_BORDER_ITEM_BTN_Y;
|
||||
UINT16 MAP_BORDER_MILITIA_BTN_X;
|
||||
UINT16 MAP_BORDER_MILITIA_BTN_Y;
|
||||
UINT16 MAP_BORDER_DISEASE_BTN_X; // Flugente: disease
|
||||
UINT16 MAP_BORDER_DISEASE_BTN_Y;
|
||||
|
||||
//UINT16 MAP_BORDER_WEATHER_BTN_X; // Flugente: weather // WANNE: Dynamic X position
|
||||
UINT16 MAP_BORDER_WEATHER_BTN_Y;
|
||||
//UINT16 MAP_BORDER_INTEL_BTN_X; // Flugente: intel // WANNE: Dynamic X position
|
||||
UINT16 MAP_BORDER_INTEL_BTN_Y;
|
||||
|
||||
UINT16 MAP_LEVEL_MARKER_X;
|
||||
UINT16 MAP_LEVEL_MARKER_Y;
|
||||
UINT16 MAP_LEVEL_MARKER_DELTA;
|
||||
UINT16 MAP_LEVEL_MARKER_WIDTH;
|
||||
extern UINT16 UI_BOTTOM_X;
|
||||
extern UINT16 UI_BOTTOM_Y;
|
||||
extern UILayout_Map UI_MAP;
|
||||
|
||||
// extern to anchored button in winbart97
|
||||
extern GUI_BUTTON *gpAnchoredButton;
|
||||
@@ -150,6 +128,10 @@ BOOLEAN LoadMapBorderGraphics( void )
|
||||
{
|
||||
FilenameForBPP( "INTERFACE\\MBS.sti", VObjectDesc.ImageFile );
|
||||
}
|
||||
else if (iResolution == _1280x720)
|
||||
{
|
||||
FilenameForBPP("INTERFACE\\MBS_1280x720.sti", VObjectDesc.ImageFile);
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
{
|
||||
FilenameForBPP( "INTERFACE\\MBS_800x600.sti", VObjectDesc.ImageFile );
|
||||
@@ -201,9 +183,9 @@ void RenderMapBorder( void )
|
||||
// get and blt border
|
||||
GetVideoObject(&hHandle, guiMapBorder );
|
||||
|
||||
BltVideoObject( guiSAVEBUFFER, hHandle, 0, xResOffset + MAP_BORDER_X, yResOffset + MAP_BORDER_Y, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
BltVideoObject( guiSAVEBUFFER, hHandle, 0, UI_MAP.BorderRegion.x, UI_MAP.BorderRegion.y, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
RestoreExternBackgroundRect( xResOffset + MAP_BORDER_X, yResOffset + MAP_BORDER_Y, SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset, SCREEN_HEIGHT - 121 - 2 * yResOffset);
|
||||
RestoreExternBackgroundRect(UI_MAP.BorderRegion.x, UI_MAP.BorderRegion.y, SCREEN_WIDTH, SCREEN_HEIGHT - 121);
|
||||
|
||||
// show the level marker
|
||||
DisplayCurrentLevelMarker( );
|
||||
@@ -229,8 +211,8 @@ void RenderMapBorderEtaPopUp( void )
|
||||
GetVideoObject(&hHandle, guiMapBorderEtaPopUp );
|
||||
|
||||
// coordinates should depend on the actual ETA display
|
||||
UINT16 xVal = (CLOCK_ETA_X - 10) ;
|
||||
UINT16 yVal = (CLOCK_Y_START - 7);
|
||||
UINT16 xVal = (UI_MAP.ETA.Clock_X - 10) ;
|
||||
UINT16 yVal = (UI_MAP.ETA.Start_Y - 7);
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
BltVideoObject( FRAME_BUFFER , hHandle, 0, xVal, yVal, VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
@@ -253,37 +235,37 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
||||
|
||||
// towns
|
||||
giMapBorderButtonsImage[ MAP_BORDER_TOWN_BTN ] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti" ,-1,5,-1,14,-1 );
|
||||
giMapBorderButtons[ MAP_BORDER_TOWN_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_TOWN_BTN ], MAP_BORDER_TOWN_BTN_X, MAP_BORDER_TOWN_BTN_Y,
|
||||
giMapBorderButtons[ MAP_BORDER_TOWN_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_TOWN_BTN ], UI_MAP.Button.Town.iX, UI_MAP.Button.Town.iY,
|
||||
BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnTownCallback);
|
||||
|
||||
// mines
|
||||
giMapBorderButtonsImage[ MAP_BORDER_MINE_BTN ] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti" ,-1,4,-1,13,-1 );
|
||||
giMapBorderButtons[ MAP_BORDER_MINE_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_MINE_BTN ], MAP_BORDER_MINE_BTN_X, MAP_BORDER_MINE_BTN_Y,
|
||||
giMapBorderButtons[ MAP_BORDER_MINE_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_MINE_BTN ], UI_MAP.Button.Mine.iX, UI_MAP.Button.Mine.iY,
|
||||
BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnMineCallback);
|
||||
|
||||
// people
|
||||
giMapBorderButtonsImage[ MAP_BORDER_TEAMS_BTN ] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti" ,-1,3,-1,12,-1 );
|
||||
giMapBorderButtons[ MAP_BORDER_TEAMS_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_TEAMS_BTN ], MAP_BORDER_TEAMS_BTN_X, MAP_BORDER_TEAMS_BTN_Y,
|
||||
giMapBorderButtons[ MAP_BORDER_TEAMS_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_TEAMS_BTN ], UI_MAP.Button.Teams.iX, UI_MAP.Button.Teams.iY,
|
||||
BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnTeamCallback);
|
||||
|
||||
// militia
|
||||
giMapBorderButtonsImage[ MAP_BORDER_MILITIA_BTN ] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti" ,-1,8,-1,17,-1 );
|
||||
giMapBorderButtons[ MAP_BORDER_MILITIA_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_MILITIA_BTN ], MAP_BORDER_MILITIA_BTN_X, MAP_BORDER_MILITIA_BTN_Y,
|
||||
giMapBorderButtons[ MAP_BORDER_MILITIA_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_MILITIA_BTN ], UI_MAP.Button.Militia.iX, UI_MAP.Button.Militia.iY,
|
||||
BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnMilitiaCallback);
|
||||
|
||||
// airspace
|
||||
giMapBorderButtonsImage[ MAP_BORDER_AIRSPACE_BTN ] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti" ,-1,2,-1,11,-1 );
|
||||
giMapBorderButtons[ MAP_BORDER_AIRSPACE_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_AIRSPACE_BTN ], MAP_BORDER_AIRSPACE_BTN_X, MAP_BORDER_AIRSPACE_BTN_Y,
|
||||
giMapBorderButtons[ MAP_BORDER_AIRSPACE_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_AIRSPACE_BTN ], UI_MAP.Button.Airspace.iX, UI_MAP.Button.Airspace.iY,
|
||||
BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnAircraftCallback);
|
||||
|
||||
// items
|
||||
giMapBorderButtonsImage[ MAP_BORDER_ITEM_BTN ] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti" ,-1,1,-1,10,-1 );
|
||||
giMapBorderButtons[ MAP_BORDER_ITEM_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_ITEM_BTN ], MAP_BORDER_ITEM_BTN_X, MAP_BORDER_ITEM_BTN_Y,
|
||||
giMapBorderButtons[ MAP_BORDER_ITEM_BTN ] = QuickCreateButton( giMapBorderButtonsImage[ MAP_BORDER_ITEM_BTN ], UI_MAP.Button.Inventory.iX, UI_MAP.Button.Inventory.iY,
|
||||
BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnItemCallback);
|
||||
|
||||
@@ -302,7 +284,7 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
||||
SetButtonCursor(giMapBorderButtons[ MAP_BORDER_ITEM_BTN ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ MAP_BORDER_MILITIA_BTN ], MSYS_NO_CURSOR );
|
||||
|
||||
UINT16 nextButtonX = MAP_BORDER_DISEASE_BTN_X - 43;
|
||||
UINT16 nextButtonX = UI_MAP.Button.Disease.iX - 43;
|
||||
|
||||
// Flugente: disease
|
||||
if ( gGameExternalOptions.fDisease && gGameExternalOptions.fDiseaseStrategic )
|
||||
@@ -315,7 +297,7 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
||||
if ( giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN] < 0 )
|
||||
giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti", -1, 2, -1, 11, -1 );
|
||||
|
||||
giMapBorderButtons[MAP_BORDER_DISEASE_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN], nextButtonX, MAP_BORDER_DISEASE_BTN_Y,
|
||||
giMapBorderButtons[MAP_BORDER_DISEASE_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN], nextButtonX, UI_MAP.Button.Disease.iY,
|
||||
BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnDiseaseCallback );
|
||||
|
||||
@@ -341,7 +323,7 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
||||
x = MAP_BORDER_DISEASE_BTN_X;
|
||||
*/
|
||||
|
||||
giMapBorderButtons[MAP_BORDER_WEATHER_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_WEATHER_BTN], nextButtonX, MAP_BORDER_WEATHER_BTN_Y,
|
||||
giMapBorderButtons[MAP_BORDER_WEATHER_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_WEATHER_BTN], nextButtonX, UI_MAP.Button.Weather_Y,
|
||||
BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnWeatherCallback );
|
||||
|
||||
@@ -367,7 +349,7 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
||||
x = MAP_BORDER_WEATHER_BTN_X;
|
||||
*/
|
||||
|
||||
giMapBorderButtons[MAP_BORDER_INTEL_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_INTEL_BTN], nextButtonX, MAP_BORDER_INTEL_BTN_Y,
|
||||
giMapBorderButtons[MAP_BORDER_INTEL_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_INTEL_BTN], nextButtonX, UI_MAP.Button.Intel_Y,
|
||||
BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnIntelCallback );
|
||||
|
||||
@@ -469,6 +451,24 @@ void DeleteMapBorderButtons( void )
|
||||
}
|
||||
}
|
||||
|
||||
void DisableMapBorderButtons(void)
|
||||
{
|
||||
for (int i = 0; i < NUM_MAP_BORDER_BTNS; ++i)
|
||||
{
|
||||
if (giMapBorderButtons[i] != -1)
|
||||
DisableButton( giMapBorderButtons[i] );
|
||||
}
|
||||
}
|
||||
|
||||
void EnableMapBorderButtons(void)
|
||||
{
|
||||
for (int i = 0; i < NUM_MAP_BORDER_BTNS; ++i)
|
||||
{
|
||||
if (giMapBorderButtons[i] != -1)
|
||||
EnableButton(giMapBorderButtons[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// callbacks
|
||||
void BtnMilitiaCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
@@ -860,9 +860,9 @@ void DisplayCurrentLevelMarker( void )
|
||||
|
||||
// it's actually a white rectangle, not a green arrow!
|
||||
GetVideoObject(&hHandle, guiLEVELMARKER );
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0, MAP_LEVEL_MARKER_X + 1, MAP_LEVEL_MARKER_Y + ( MAP_LEVEL_MARKER_DELTA * ( INT16 )iCurrentMapSectorZ ), VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0, UI_MAP.LevelMarkerArea.x + 1, UI_MAP.LevelMarkerArea.y + (UI_MAP.LevelMarkerArea.height * ( INT16 )iCurrentMapSectorZ ), VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
|
||||
RestoreExternBackgroundRect(MAP_LEVEL_MARKER_X + 1, MAP_LEVEL_MARKER_Y + ( MAP_LEVEL_MARKER_DELTA * ( INT16 )iCurrentMapSectorZ ), 55, 9);
|
||||
RestoreExternBackgroundRect(UI_MAP.LevelMarkerArea.x + 1, UI_MAP.LevelMarkerArea.y + (UI_MAP.LevelMarkerArea.height * ( INT16 )iCurrentMapSectorZ ), 55, 9);
|
||||
}
|
||||
|
||||
void CreateMouseRegionsForLevelMarkers( void )
|
||||
@@ -872,8 +872,11 @@ void CreateMouseRegionsForLevelMarkers( void )
|
||||
|
||||
for( sCounter = 0; sCounter < 4 ; ++sCounter )
|
||||
{
|
||||
MSYS_DefineRegion(&LevelMouseRegions[ sCounter ], MAP_LEVEL_MARKER_X, ( INT16 )( MAP_LEVEL_MARKER_Y + ( MAP_LEVEL_MARKER_DELTA * sCounter ) ), MAP_LEVEL_MARKER_X + MAP_LEVEL_MARKER_WIDTH, ( INT16 )( MAP_LEVEL_MARKER_Y + ( MAP_LEVEL_MARKER_DELTA * ( sCounter + 1 ) ) ), MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR,
|
||||
MSYS_NO_CALLBACK, LevelMarkerBtnCallback );
|
||||
const auto tlx = UI_MAP.LevelMarkerArea.x;
|
||||
const auto tly = UI_MAP.LevelMarkerArea.y + UI_MAP.LevelMarkerArea.height * sCounter;
|
||||
const auto brx = tlx + UI_MAP.LevelMarkerArea.width;
|
||||
const auto bry = tly + UI_MAP.LevelMarkerArea.height;
|
||||
MSYS_DefineRegion(&LevelMouseRegions[ sCounter ], tlx, tly, brx, bry, MSYS_PRIORITY_HIGH, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, LevelMarkerBtnCallback );
|
||||
|
||||
MSYS_SetRegionUserData(&LevelMouseRegions[sCounter],0,sCounter);
|
||||
|
||||
@@ -1439,32 +1442,78 @@ void MapBorderButtonOn( UINT8 ubBorderButtonIndex )
|
||||
ButtonList[ giMapBorderButtons[ ubBorderButtonIndex ] ]->uiFlags |= BUTTON_CLICKED_ON;
|
||||
}
|
||||
|
||||
|
||||
// HEADROCK HAM 4: Init the coordinates for all Map Border buttons
|
||||
void InitMapBorderButtonCoordinates()
|
||||
{
|
||||
UINT32 buttonOffset = 155; // 160
|
||||
if (isWidescreenUI())
|
||||
{
|
||||
// Map border buttons are located in the map bottom ui bar for widescreen UI
|
||||
const UINT16 firstColumn = UI_BOTTOM_X + 746;
|
||||
const UINT16 secondColumn = UI_BOTTOM_X + 788;
|
||||
const UINT16 thirdColumn = UI_BOTTOM_X + 831;
|
||||
const UINT16 fourthColumn = UI_BOTTOM_X + 874;
|
||||
const UINT16 fifthColumn = UI_BOTTOM_X + 917;
|
||||
const UINT16 sixthColumn = UI_BOTTOM_X + 960;
|
||||
const UINT16 firstRow = UI_BOTTOM_Y + 1; //SCREEN_HEIGHT - 115;
|
||||
const UINT16 SecondRow = UI_BOTTOM_Y + 38; //SCREEN_HEIGHT - 78;
|
||||
|
||||
|
||||
UI_MAP.Button.Town = { firstColumn, firstRow };
|
||||
UI_MAP.Button.Mine = { secondColumn, firstRow };
|
||||
UI_MAP.Button.Teams = { fifthColumn, firstRow };
|
||||
UI_MAP.Button.Militia = { sixthColumn, firstRow };
|
||||
UI_MAP.Button.Airspace = { firstColumn, SecondRow};
|
||||
UI_MAP.Button.Inventory = { secondColumn, SecondRow };
|
||||
UI_MAP.Button.Disease = { thirdColumn, SecondRow };
|
||||
UI_MAP.Button.Weather_Y = SecondRow;
|
||||
UI_MAP.Button.Intel_Y = SecondRow;
|
||||
UI_MAP.LevelMarkerArea = { UI_BOTTOM_X + 840, UI_BOTTOM_Y, 55, 8 };
|
||||
}
|
||||
else if (iResolution < _800x600)
|
||||
{
|
||||
const UINT16 xOffset = 43;
|
||||
UI_MAP.Button.Town = { UI_MAP.BorderRegion.x + 35, UI_MAP.BorderRegion.y + 325 };
|
||||
UI_MAP.Button.Mine = { UI_MAP.Button.Town.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Teams = { UI_MAP.Button.Mine.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Militia = { UI_MAP.Button.Teams.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Airspace = { UI_MAP.Button.Militia.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Inventory = { UI_MAP.Button.Airspace.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
|
||||
MAP_BORDER_TOWN_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) - 152;
|
||||
MAP_BORDER_TOWN_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
MAP_BORDER_MINE_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) - 109;
|
||||
MAP_BORDER_MINE_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
MAP_BORDER_TEAMS_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) - 66;
|
||||
MAP_BORDER_TEAMS_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
MAP_BORDER_AIRSPACE_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 20;
|
||||
MAP_BORDER_AIRSPACE_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
MAP_BORDER_ITEM_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 63;
|
||||
MAP_BORDER_ITEM_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
MAP_BORDER_MILITIA_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) - 23;
|
||||
MAP_BORDER_MILITIA_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
MAP_BORDER_DISEASE_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 190;
|
||||
MAP_BORDER_DISEASE_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
//MAP_BORDER_WEATHER_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 233; // WANNE: Dynamic X position
|
||||
MAP_BORDER_WEATHER_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
//MAP_BORDER_INTEL_BTN_X = xResOffset + MAP_BORDER_X + ( ( SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset ) / 2 ) + 276; // WANNE: Dynamic X position
|
||||
MAP_BORDER_INTEL_BTN_Y = ( SCREEN_HEIGHT - yResOffset - buttonOffset );
|
||||
UI_MAP.Button.Disease = { UI_MAP.BorderRegion.x + 361, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Weather_Y = UI_MAP.Button.Town.iY;
|
||||
UI_MAP.Button.Intel_Y = UI_MAP.Button.Town.iY;
|
||||
UI_MAP.LevelMarkerArea = { UI_MAP.BorderRegion.x + 303, UI_MAP.Button.Town.iY, 55, 8 };
|
||||
|
||||
MAP_LEVEL_MARKER_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 114;
|
||||
MAP_LEVEL_MARKER_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
MAP_LEVEL_MARKER_DELTA = 8;
|
||||
MAP_LEVEL_MARKER_WIDTH = 55;
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
{
|
||||
const UINT16 xOffset = 43;
|
||||
UI_MAP.Button.Town = { UI_MAP.BorderRegion.x + 115, UI_MAP.BorderRegion.y + 444 };
|
||||
UI_MAP.Button.Mine = { UI_MAP.Button.Town.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Teams = { UI_MAP.Button.Mine.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Militia = { UI_MAP.Button.Teams.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Airspace = { UI_MAP.Button.Militia.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Inventory = { UI_MAP.Button.Airspace.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
|
||||
UI_MAP.Button.Disease = { UI_MAP.BorderRegion.x + 450, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Weather_Y = UI_MAP.Button.Town.iY;
|
||||
UI_MAP.Button.Intel_Y = UI_MAP.Button.Town.iY;
|
||||
UI_MAP.LevelMarkerArea = { UI_MAP.BorderRegion.x + 383, UI_MAP.Button.Town.iY, 55, 8 };
|
||||
}
|
||||
else
|
||||
{
|
||||
const UINT16 xOffset = 43;
|
||||
UI_MAP.Button.Town = { UI_MAP.BorderRegion.x + 228, UI_MAP.BorderRegion.y + 612 };
|
||||
UI_MAP.Button.Mine = { UI_MAP.Button.Town.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Teams = { UI_MAP.Button.Mine.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Militia = { UI_MAP.Button.Teams.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Airspace = { UI_MAP.Button.Militia.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Inventory = { UI_MAP.Button.Airspace.iX + xOffset, UI_MAP.Button.Town.iY };
|
||||
|
||||
UI_MAP.Button.Disease = { UI_MAP.BorderRegion.x + 560, UI_MAP.Button.Town.iY };
|
||||
UI_MAP.Button.Weather_Y = UI_MAP.Button.Town.iY;
|
||||
UI_MAP.Button.Intel_Y = UI_MAP.Button.Town.iY;
|
||||
UI_MAP.LevelMarkerArea = { UI_MAP.BorderRegion.x + 495, UI_MAP.Button.Town.iY, 55, 8 };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,10 +35,6 @@ enum{
|
||||
|
||||
// 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;
|
||||
extern UINT16 MAP_LEVEL_MARKER_Y;
|
||||
extern UINT16 MAP_LEVEL_MARKER_DELTA;
|
||||
extern UINT16 MAP_LEVEL_MARKER_WIDTH;
|
||||
|
||||
extern BOOLEAN fShowTownFlag;
|
||||
extern BOOLEAN fShowMineFlag;
|
||||
@@ -108,4 +104,7 @@ void MapBorderButtonOn( UINT8 ubBorderButtonIndex );
|
||||
// HEADROCK HAM 4: Initialize coordinates for Map Border buttons
|
||||
void InitMapBorderButtonCoordinates();
|
||||
|
||||
void DisableMapBorderButtons(void);
|
||||
void EnableMapBorderButtons(void);
|
||||
|
||||
#endif
|
||||
@@ -59,10 +59,40 @@
|
||||
|
||||
#include "connect.h"
|
||||
|
||||
/* CHRISL: Adjusted settings to allow new Map_Screen_Bottom_800x600.sti to work. This is needed if we
|
||||
want to have the new inventory panel not overlap the message text area. */
|
||||
#define MAP_BOTTOM_X 0
|
||||
#define MAP_BOTTOM_Y (SCREEN_HEIGHT - 121) //359
|
||||
|
||||
struct UILayout_BottomButtons
|
||||
{
|
||||
SGPPoint CompressTime;
|
||||
SGPPoint CompressLess;
|
||||
SGPPoint Laptop;
|
||||
SGPPoint Options;
|
||||
SGPPoint Tactical;
|
||||
SGPPoint ScrollUp;
|
||||
SGPPoint ScrollDown;
|
||||
};
|
||||
struct UILayout_BottomTexts
|
||||
{
|
||||
SGPRectangle BalanceTitle;
|
||||
SGPRectangle IncomeTitle;
|
||||
SGPRectangle ExpensesTitle;
|
||||
SGPRectangle CurrentBalance;
|
||||
SGPRectangle CurrentIncome;
|
||||
SGPRectangle CurrentExpenses;
|
||||
SGPRectangle CompressTime;
|
||||
SGPRectangle LoadedSector;
|
||||
};
|
||||
struct BottomUILayout
|
||||
{
|
||||
SGPRectangle Region;
|
||||
UILayout_BottomButtons Button;
|
||||
UILayout_BottomTexts Text;
|
||||
};
|
||||
|
||||
BottomUILayout UI_BOTTOM;
|
||||
UINT16 UI_BOTTOM_X;
|
||||
UINT16 UI_BOTTOM_Y;
|
||||
UINT16 MAP_BOTTOM_LAPTOP_X;
|
||||
UINT16 MAP_BOTTOM_LAPTOP_Y;
|
||||
|
||||
//#define MESSAGE_SCROLL_AREA_START_X (SCREEN_WIDTH - 534) //330
|
||||
//#define MESSAGE_SCROLL_AREA_END_X (SCREEN_WIDTH - 522) //344
|
||||
@@ -240,6 +270,10 @@ void HandleLoadOfMapBottomGraphics( void )
|
||||
{
|
||||
FilenameForBPP( "INTERFACE\\map_screen_bottom.sti", VObjectDesc.ImageFile );
|
||||
}
|
||||
else if (iResolution == _1280x720)
|
||||
{
|
||||
FilenameForBPP("INTERFACE\\map_screen_bottom_1280x720.sti", VObjectDesc.ImageFile);
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
{
|
||||
FilenameForBPP( "INTERFACE\\map_screen_bottom_800x600.sti", VObjectDesc.ImageFile );
|
||||
@@ -315,7 +349,7 @@ void RenderMapScreenInterfaceBottom( BOOLEAN fForceMapscreenFullRender )
|
||||
// get and blt panel
|
||||
GetVideoObject(&hHandle, guiMAPBOTTOMPANEL );
|
||||
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0, xResOffset + MAP_BOTTOM_X, MAP_BOTTOM_Y, VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0, UI_BOTTOM.Region.x, UI_BOTTOM.Region.y, VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
|
||||
// WANNE - MP: Radarmap image should be displayed on every sector in multiplayer game
|
||||
if( GetSectorFlagStatus( sSelMapX, sSelMapY, ( UINT8 )iCurrentMapSectorZ, SF_ALREADY_VISITED ) == TRUE
|
||||
@@ -337,8 +371,7 @@ void RenderMapScreenInterfaceBottom( BOOLEAN fForceMapscreenFullRender )
|
||||
// dirty buttons
|
||||
MarkButtonsDirty( );
|
||||
|
||||
// TODO.RW.ARSP: Check: Is the height 121 OK?
|
||||
RestoreExternBackgroundRect( xResOffset + MAP_BOTTOM_X, MAP_BOTTOM_Y, SCREEN_WIDTH - MAP_BOTTOM_X - 2 * xResOffset, 121 );
|
||||
RestoreExternBackgroundRect(UI_BOTTOM.Region);
|
||||
|
||||
// re render radar map
|
||||
RenderRadarScreen( );
|
||||
@@ -392,20 +425,20 @@ BOOLEAN CreateButtonsForMapScreenInterfaceBottom( void )
|
||||
{
|
||||
// laptop
|
||||
guiMapBottomExitButtonsImage[ MAP_EXIT_TO_LAPTOP ]= LoadButtonImage( "INTERFACE\\map_border_buttons.sti" ,-1,6,-1,15,-1 );
|
||||
guiMapBottomExitButtons[ MAP_EXIT_TO_LAPTOP ] = QuickCreateButton( guiMapBottomExitButtonsImage[ MAP_EXIT_TO_LAPTOP ], xResOffset + (xResSize - 184), (SCREEN_HEIGHT - 70),
|
||||
guiMapBottomExitButtons[ MAP_EXIT_TO_LAPTOP ] = QuickCreateButton( guiMapBottomExitButtonsImage[ MAP_EXIT_TO_LAPTOP ], UI_BOTTOM.Button.Laptop.iX, UI_BOTTOM.Button.Laptop.iY,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnLaptopCallback);
|
||||
|
||||
// tactical
|
||||
guiMapBottomExitButtonsImage[ MAP_EXIT_TO_TACTICAL ]= LoadButtonImage( "INTERFACE\\map_border_buttons.sti" ,-1,7,-1,16,-1 );
|
||||
|
||||
guiMapBottomExitButtons[ MAP_EXIT_TO_TACTICAL ] = QuickCreateButton( guiMapBottomExitButtonsImage[ MAP_EXIT_TO_TACTICAL ], xResOffset + (xResSize - 144), (SCREEN_HEIGHT - 70),
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnTacticalCallback);
|
||||
guiMapBottomExitButtons[ MAP_EXIT_TO_TACTICAL ] = QuickCreateButton( guiMapBottomExitButtonsImage[ MAP_EXIT_TO_TACTICAL ], UI_BOTTOM.Button.Tactical.iX, UI_BOTTOM.Button.Tactical.iY,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnTacticalCallback);
|
||||
|
||||
// options
|
||||
guiMapBottomExitButtonsImage[ MAP_EXIT_TO_OPTIONS ]= LoadButtonImage( "INTERFACE\\map_border_buttons.sti" ,-1,18,-1,19,-1 );
|
||||
guiMapBottomExitButtons[ MAP_EXIT_TO_OPTIONS ] = QuickCreateButton( guiMapBottomExitButtonsImage[ MAP_EXIT_TO_OPTIONS ], xResOffset + (xResSize - 182), (SCREEN_HEIGHT - 108),
|
||||
guiMapBottomExitButtons[ MAP_EXIT_TO_OPTIONS ] = QuickCreateButton( guiMapBottomExitButtonsImage[ MAP_EXIT_TO_OPTIONS ], UI_BOTTOM.Button.Options.iX, UI_BOTTOM.Button.Options.iY,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnOptionsFromMapScreenCallback);
|
||||
|
||||
@@ -421,12 +454,12 @@ BOOLEAN CreateButtonsForMapScreenInterfaceBottom( void )
|
||||
|
||||
// time compression buttons
|
||||
guiMapBottomTimeButtonsImage[ MAP_TIME_COMPRESS_MORE ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,10,1,-1,3,-1 );
|
||||
guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_MORE ] = QuickCreateButton( guiMapBottomTimeButtonsImage[ MAP_TIME_COMPRESS_MORE ], xResOffset + (xResSize - 112), (SCREEN_HEIGHT - 24),
|
||||
guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_MORE ] = QuickCreateButton( guiMapBottomTimeButtonsImage[ MAP_TIME_COMPRESS_MORE ], UI_BOTTOM.Button.CompressTime.iX, UI_BOTTOM.Button.CompressTime.iY,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 2 ,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnTimeCompressMoreMapScreenCallback);
|
||||
|
||||
guiMapBottomTimeButtonsImage[ MAP_TIME_COMPRESS_LESS ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,9,0,-1,2,-1 );
|
||||
guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_LESS ] = QuickCreateButton( guiMapBottomTimeButtonsImage[ MAP_TIME_COMPRESS_LESS ], xResOffset + (xResSize - 174), (SCREEN_HEIGHT - 24),
|
||||
guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_LESS ] = QuickCreateButton( guiMapBottomTimeButtonsImage[ MAP_TIME_COMPRESS_LESS ], UI_BOTTOM.Button.CompressLess.iX, UI_BOTTOM.Button.CompressLess.iY,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 2,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnTimeCompressLessMapScreenCallback);
|
||||
|
||||
@@ -443,10 +476,10 @@ BOOLEAN CreateButtonsForMapScreenInterfaceBottom( void )
|
||||
guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_UP ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,11,4,-1,6,-1 );
|
||||
guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_DOWN ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,12,5,-1,7,-1 );
|
||||
|
||||
guiMapMessageScrollButtons[ MAP_SCROLL_MESSAGE_UP ] = QuickCreateButton( guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_UP ], xResOffset + (xResSize - 306), (SCREEN_HEIGHT - 109),
|
||||
guiMapMessageScrollButtons[ MAP_SCROLL_MESSAGE_UP ] = QuickCreateButton( guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_UP ], UI_BOTTOM.Button.ScrollUp.iX, UI_BOTTOM.Button.ScrollUp.iY,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnMessageUpMapScreenCallback);
|
||||
guiMapMessageScrollButtons[ MAP_SCROLL_MESSAGE_DOWN ] = QuickCreateButton( guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_DOWN ], xResOffset + (xResSize - 306), (SCREEN_HEIGHT - 28),
|
||||
guiMapMessageScrollButtons[ MAP_SCROLL_MESSAGE_DOWN ] = QuickCreateButton( guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_DOWN ], UI_BOTTOM.Button.ScrollDown.iX, UI_BOTTOM.Button.ScrollDown.iY,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnMessageDownMapScreenCallback);
|
||||
|
||||
@@ -630,7 +663,13 @@ void DrawNameOfLoadedSector( void )
|
||||
GetSectorIDString( sSelMapX, sSelMapY, ( INT8 )( iCurrentMapSectorZ ),sString, TRUE );
|
||||
ReduceStringLength( sString, 80, COMPFONT );
|
||||
|
||||
VarFindFontCenterCoordinates( xResOffset + (xResSize - 92), (SCREEN_HEIGHT - 55), 80, 16, COMPFONT, &sFontX, &sFontY, sString );
|
||||
VarFindFontCenterCoordinates(
|
||||
UI_BOTTOM.Text.LoadedSector.x,
|
||||
UI_BOTTOM.Text.LoadedSector.y,
|
||||
UI_BOTTOM.Text.LoadedSector.width,
|
||||
UI_BOTTOM.Text.LoadedSector.height,
|
||||
COMPFONT, &sFontX, &sFontY, sString
|
||||
);
|
||||
|
||||
mprintf( sFontX, sFontY, L"%s", sString );
|
||||
}
|
||||
@@ -975,7 +1014,7 @@ void DisplayCompressMode( void )
|
||||
}
|
||||
|
||||
// ABCDEFG
|
||||
RestoreExternBackgroundRect( xResOffset + (xResSize - 151), (SCREEN_HEIGHT - 24), 63, 13 );
|
||||
RestoreExternBackgroundRect(UI_BOTTOM.Text.CompressTime);
|
||||
SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
|
||||
SetFont( COMPFONT );
|
||||
|
||||
@@ -1001,7 +1040,7 @@ void DisplayCompressMode( void )
|
||||
SetFontForeground( usColor );
|
||||
SetFontBackground( FONT_BLACK );
|
||||
|
||||
FindFontCenterCoordinates( xResOffset + (xResSize - 151), (SCREEN_HEIGHT - 24), 33, 13, sString, COMPFONT, &sX, &sY );
|
||||
FindFontCenterCoordinates(UI_BOTTOM.Text.CompressTime.x, UI_BOTTOM.Text.CompressTime.y, 33, 13, sString, COMPFONT, &sX, &sY );
|
||||
|
||||
mprintf( sX, sY, sString );
|
||||
|
||||
@@ -1011,7 +1050,11 @@ void DisplayCompressMode( void )
|
||||
|
||||
void CreateCompressModePause( void )
|
||||
{
|
||||
MSYS_DefineRegion( &gMapPauseRegion, xResOffset + (xResSize - 153), (SCREEN_HEIGHT - 24), xResOffset + (xResSize - 118), (SCREEN_HEIGHT - 13), MSYS_PRIORITY_HIGH,
|
||||
const auto tlx = UI_BOTTOM.Text.CompressTime.x;
|
||||
const auto tly = UI_BOTTOM.Text.CompressTime.y;
|
||||
const auto brx = tlx + UI_BOTTOM.Text.CompressTime.width;
|
||||
const auto bry = tly + UI_BOTTOM.Text.CompressTime.height;
|
||||
MSYS_DefineRegion( &gMapPauseRegion, tlx, tly, brx, bry, MSYS_PRIORITY_HIGH,
|
||||
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressModeClickCallback );
|
||||
|
||||
SetRegionFastHelpText( &gMapPauseRegion, pMapScreenBottomFastHelp[ 7 ] );
|
||||
@@ -1043,12 +1086,21 @@ void DeleteMessageSliderBar( void )
|
||||
|
||||
void CreateMapScreenBottomMessageScrollBarRegion( void )
|
||||
{
|
||||
MSYS_DefineRegion( &gMapMessageScrollBarRegion, MESSAGE_SCROLL_AREA_START_X, MESSAGE_SCROLL_AREA_START_Y,
|
||||
MESSAGE_SCROLL_AREA_END_X, MESSAGE_SCROLL_AREA_END_Y,
|
||||
MSYS_PRIORITY_NORMAL, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MapScreenMessageScrollBarCallBack );
|
||||
MSYS_DefineRegion( &gMapMessageScrollBarRegion,
|
||||
MESSAGE_SCROLL_AREA_START_X,
|
||||
MESSAGE_SCROLL_AREA_START_Y,
|
||||
MESSAGE_SCROLL_AREA_END_X,
|
||||
MESSAGE_SCROLL_AREA_END_Y,
|
||||
MSYS_PRIORITY_NORMAL, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MapScreenMessageScrollBarCallBack
|
||||
);
|
||||
|
||||
MSYS_DefineRegion(&gMapMessageRegion, (INT16)(xResOffset + 16), MESSAGE_SCROLL_AREA_START_Y-16, MESSAGE_SCROLL_AREA_END_X-22, MESSAGE_SCROLL_AREA_END_Y+12,
|
||||
MSYS_PRIORITY_NORMAL, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK);
|
||||
MSYS_DefineRegion( &gMapMessageRegion,
|
||||
UI_BOTTOM.Region.x + 16,
|
||||
MESSAGE_SCROLL_AREA_START_Y-16,
|
||||
MESSAGE_SCROLL_AREA_END_X-22,
|
||||
MESSAGE_SCROLL_AREA_END_Y+12,
|
||||
MSYS_PRIORITY_NORMAL, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1462,12 +1514,7 @@ void DisplayCurrentBalanceTitleForMapBottom( void )
|
||||
swprintf( sString, L"%s", pMapScreenBottomText[ 0 ] );
|
||||
|
||||
// center it
|
||||
// CHRISL: Replaced X coordinate with dynamic coordinate set from right edge of screen
|
||||
//VarFindFontCenterCoordinates( (1024 - 637), (SCREEN_HEIGHT - 107), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
|
||||
// CHRISL: Use this if we want to display from the left edge
|
||||
//VarFindFontCenterCoordinates( 359, (SCREEN_HEIGHT - 107), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
|
||||
// HEADROCK HAM 3.6: The balance/income box has been moved to the right side, near the laptop button.
|
||||
VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 111), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
|
||||
VarFindFontCenterCoordinates(UI_BOTTOM.Text.BalanceTitle.x, UI_BOTTOM.Text.BalanceTitle.y, UI_BOTTOM.Text.BalanceTitle.width, UI_BOTTOM.Text.BalanceTitle.height, COMPFONT, &sFontX, &sFontY, sString );
|
||||
|
||||
// print it
|
||||
mprintf( sFontX, sFontY, L"%s", sString );
|
||||
@@ -1475,12 +1522,7 @@ void DisplayCurrentBalanceTitleForMapBottom( void )
|
||||
swprintf( sString, L"%s", zMarksMapScreenText[ 2 ] );
|
||||
|
||||
// center it
|
||||
// CHRISL: Replaced X coordinate with dynamic coordinate set from right edge of screen
|
||||
//VarFindFontCenterCoordinates( (1024 - 637), (SCREEN_HEIGHT - 61), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
|
||||
// CHRISL: Use this if we want to display from the left edge
|
||||
//VarFindFontCenterCoordinates( 359, (SCREEN_HEIGHT - 61), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
|
||||
// HEADROCK HAM 3.6: The balance/income box has been moved to the right side, near the laptop button.
|
||||
VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 74), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
|
||||
VarFindFontCenterCoordinates(UI_BOTTOM.Text.IncomeTitle.x, UI_BOTTOM.Text.IncomeTitle.y, UI_BOTTOM.Text.IncomeTitle.width, UI_BOTTOM.Text.IncomeTitle.height, COMPFONT, &sFontX, &sFontY, sString );
|
||||
|
||||
// print it
|
||||
mprintf( sFontX, sFontY, L"%s", sString );
|
||||
@@ -1489,7 +1531,7 @@ void DisplayCurrentBalanceTitleForMapBottom( void )
|
||||
|
||||
// HEADROCK HAM 3.6: Projected expenses for today, with facilities (and in the future, merc contracts) taken into
|
||||
// account.
|
||||
VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 37), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
|
||||
VarFindFontCenterCoordinates(UI_BOTTOM.Text.ExpensesTitle.x, UI_BOTTOM.Text.ExpensesTitle.y, UI_BOTTOM.Text.ExpensesTitle.width, UI_BOTTOM.Text.ExpensesTitle.height, COMPFONT, &sFontX, &sFontY, sString );
|
||||
|
||||
// print it
|
||||
mprintf( sFontX, sFontY, L"%s", sString );
|
||||
@@ -1520,7 +1562,13 @@ void DisplayCurrentBalanceForMapBottom( void )
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
|
||||
VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 95), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
|
||||
VarFindFontCenterCoordinates(
|
||||
UI_BOTTOM.Text.CurrentBalance.x,
|
||||
UI_BOTTOM.Text.CurrentBalance.y,
|
||||
UI_BOTTOM.Text.CurrentBalance.width,
|
||||
UI_BOTTOM.Text.CurrentBalance.height,
|
||||
COMPFONT, &sFontX, &sFontY, sString
|
||||
);
|
||||
|
||||
// print it
|
||||
mprintf( sFontX, sFontY, L"%s", sString );
|
||||
@@ -1549,16 +1597,31 @@ void CreateDestroyMouseRegionMasksForTimeCompressionButtons( void )
|
||||
if( ( fDisabled ) && ( fCreated == FALSE ) )
|
||||
{
|
||||
// mask over compress more button
|
||||
MSYS_DefineRegion( &gTimeCompressionMask[ 0 ], xResOffset + (xResSize - 112), (SCREEN_HEIGHT - 24), xResOffset + (xResSize - 112) + 13, (SCREEN_HEIGHT - 24) + 16, MSYS_PRIORITY_HIGHEST - 1,
|
||||
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback );
|
||||
MSYS_DefineRegion( &gTimeCompressionMask[ 0 ],
|
||||
UI_BOTTOM.Button.CompressTime.iX,
|
||||
UI_BOTTOM.Button.CompressTime.iY,
|
||||
UI_BOTTOM.Button.CompressTime.iX + 13,
|
||||
UI_BOTTOM.Button.CompressTime.iY + 16,
|
||||
MSYS_PRIORITY_HIGHEST - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback
|
||||
);
|
||||
|
||||
// mask over compress less button
|
||||
MSYS_DefineRegion( &gTimeCompressionMask[ 1 ], xResOffset + (xResSize - 174), (SCREEN_HEIGHT - 24), xResOffset + (xResSize - 174) + 13, (SCREEN_HEIGHT - 24) + 16, MSYS_PRIORITY_HIGHEST - 1,
|
||||
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback );
|
||||
MSYS_DefineRegion( &gTimeCompressionMask[ 1 ],
|
||||
UI_BOTTOM.Button.CompressLess.iX,
|
||||
UI_BOTTOM.Button.CompressLess.iY,
|
||||
UI_BOTTOM.Button.CompressLess.iX + 13,
|
||||
UI_BOTTOM.Button.CompressLess.iY + 16,
|
||||
MSYS_PRIORITY_HIGHEST - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback
|
||||
);
|
||||
|
||||
// mask over pause game button
|
||||
MSYS_DefineRegion( &gTimeCompressionMask[ 2 ], xResOffset + (xResSize - 153), (SCREEN_HEIGHT - 24), xResOffset + (xResSize - 153) + 118, (SCREEN_HEIGHT - 13), MSYS_PRIORITY_HIGHEST - 1,
|
||||
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback );
|
||||
MSYS_DefineRegion( &gTimeCompressionMask[ 2 ],
|
||||
UI_BOTTOM.Text.CompressTime.x,
|
||||
UI_BOTTOM.Text.CompressTime.y,
|
||||
UI_BOTTOM.Text.CompressTime.width,
|
||||
UI_BOTTOM.Text.CompressTime.height,
|
||||
MSYS_PRIORITY_HIGHEST - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback
|
||||
);
|
||||
RemoveMouseRegionForPauseOfClock();
|
||||
fCreated = TRUE;
|
||||
}
|
||||
@@ -1618,7 +1681,13 @@ void DisplayProjectedDailyMineIncome( void )
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
|
||||
VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 58), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
|
||||
VarFindFontCenterCoordinates(
|
||||
UI_BOTTOM.Text.CurrentIncome.x,
|
||||
UI_BOTTOM.Text.CurrentIncome.y,
|
||||
UI_BOTTOM.Text.CurrentIncome.width,
|
||||
UI_BOTTOM.Text.CurrentIncome.height,
|
||||
COMPFONT, &sFontX, &sFontY, sString
|
||||
);
|
||||
|
||||
// print it
|
||||
mprintf( sFontX, sFontY, L"%s", sString );
|
||||
@@ -1669,7 +1738,13 @@ void DisplayProjectedDailyExpenses( void )
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
|
||||
VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 21), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
|
||||
VarFindFontCenterCoordinates(
|
||||
UI_BOTTOM.Text.CurrentExpenses.x,
|
||||
UI_BOTTOM.Text.CurrentExpenses.y,
|
||||
UI_BOTTOM.Text.CurrentExpenses.width,
|
||||
UI_BOTTOM.Text.CurrentExpenses.height,
|
||||
COMPFONT, &sFontX, &sFontY, sString
|
||||
);
|
||||
|
||||
// print it
|
||||
mprintf( sFontX, sFontY, L"%s", sString );
|
||||
@@ -2066,10 +2141,74 @@ void ChangeCurrentMapscreenMessageIndex( UINT8 ubNewMessageIndex )
|
||||
fMapScreenBottomDirty = TRUE;
|
||||
}
|
||||
|
||||
|
||||
void InitMapScreenInterfaceBottomCoords( void )
|
||||
{
|
||||
// HEADROCK HAM 3.6: Message window is now as wide as possible.
|
||||
MESSAGE_SCROLL_AREA_START_X = xResOffset + xResSize - 307;
|
||||
MESSAGE_SCROLL_AREA_END_X = xResOffset + xResSize - 293;
|
||||
}
|
||||
if (isWidescreenUI())
|
||||
{
|
||||
UI_BOTTOM.Region = { 0, (SCREEN_HEIGHT - 116), 1280, 116 };
|
||||
const auto x = UI_BOTTOM.Region.x;
|
||||
const auto y = UI_BOTTOM.Region.y;
|
||||
const auto width = UI_BOTTOM.Region.width;
|
||||
const auto height = UI_BOTTOM.Region.height;
|
||||
UI_BOTTOM.Text.CompressTime = { x + 1129, y + 94, 34, 13 };
|
||||
UI_BOTTOM.Text.BalanceTitle = { x + 1002, y + 5, 78, 10 };
|
||||
UI_BOTTOM.Text.IncomeTitle = { x + 1002, y + 42, 78, 10 };
|
||||
UI_BOTTOM.Text.ExpensesTitle = { x + 1002, y + 79, 78, 10 };
|
||||
UI_BOTTOM.Text.CurrentBalance= { x + 1002, y + 22, 78, 10 };
|
||||
UI_BOTTOM.Text.CurrentIncome= { x + 1002, y + 59, 78, 10 };
|
||||
UI_BOTTOM.Text.CurrentExpenses= { x + 1002, y + 96, 78, 10 };
|
||||
UI_BOTTOM.Text.LoadedSector = { x + (width - 92), y + (height - 55), 80, 16, };
|
||||
|
||||
UI_BOTTOM.Button.CompressTime = { x + 1168, y + 94 };
|
||||
UI_BOTTOM.Button.CompressLess = { x + 1106, y + 94 };
|
||||
UI_BOTTOM.Button.Laptop = { x + 1096, y + 48 };
|
||||
UI_BOTTOM.Button.Options = { x + 1098, y + 10 };
|
||||
UI_BOTTOM.Button.Tactical = { x + 1136, y + 48 };
|
||||
UI_BOTTOM.Button.ScrollUp = { x + 718, y + 9 };
|
||||
UI_BOTTOM.Button.ScrollDown = { x + 718, y + 90 };
|
||||
|
||||
// For external use
|
||||
UI_BOTTOM_X = x;
|
||||
UI_BOTTOM_Y = y;
|
||||
MAP_BOTTOM_LAPTOP_X = UI_BOTTOM.Button.Laptop.iX;
|
||||
MAP_BOTTOM_LAPTOP_Y = UI_BOTTOM.Button.Laptop.iY;
|
||||
|
||||
// HEADROCK HAM 3.6: Message window is now as wide as possible.
|
||||
MESSAGE_SCROLL_AREA_START_X = x + 718;
|
||||
MESSAGE_SCROLL_AREA_END_X = x + 732;
|
||||
}
|
||||
else
|
||||
{
|
||||
UI_BOTTOM.Region = { xResOffset, (SCREEN_HEIGHT - 121), xResSize, 121 };
|
||||
const auto x = UI_BOTTOM.Region.x;
|
||||
const auto y = UI_BOTTOM.Region.y;
|
||||
const auto width = UI_BOTTOM.Region.width;
|
||||
const auto height = UI_BOTTOM.Region.height;
|
||||
UI_BOTTOM.Text.CompressTime = { x + width - 153, y + 96, 34, 13 };
|
||||
UI_BOTTOM.Text.BalanceTitle = { x + width - 278, y + 10, 78, 10 };
|
||||
UI_BOTTOM.Text.IncomeTitle = { x + width - 278, y + 47, 78, 10 };
|
||||
UI_BOTTOM.Text.ExpensesTitle = { x + width - 278, y + 84, 78, 10 };
|
||||
UI_BOTTOM.Text.CurrentBalance = { x + width - 278, y + height - 94, 78, 10 };
|
||||
UI_BOTTOM.Text.CurrentIncome = { x + width - 278, y + height - 57, 78, 10 };
|
||||
UI_BOTTOM.Text.CurrentExpenses = { x + width - 278, y + height - 20, 78, 10 };
|
||||
UI_BOTTOM.Text.LoadedSector = { x + (width - 92), y + (height - 55), 80, 16, };
|
||||
|
||||
UI_BOTTOM.Button.CompressTime = { x + (width - 112), y + 97 };
|
||||
UI_BOTTOM.Button.CompressLess = { x + (width - 174), y + 97 };
|
||||
UI_BOTTOM.Button.Laptop = { x + (width - 184), y + 51 };
|
||||
UI_BOTTOM.Button.Options = { x + (width - 182), y + 13 };
|
||||
UI_BOTTOM.Button.Tactical = { x + (width - 144), y + 51 };
|
||||
UI_BOTTOM.Button.ScrollUp = { x + (width - 306), y + 12 };
|
||||
UI_BOTTOM.Button.ScrollDown = { x + (width - 306), y + 93 };
|
||||
|
||||
UI_BOTTOM_X = x;
|
||||
UI_BOTTOM_Y = y;
|
||||
MAP_BOTTOM_LAPTOP_X = UI_BOTTOM.Button.Laptop.iX;
|
||||
MAP_BOTTOM_LAPTOP_Y = UI_BOTTOM.Button.Laptop.iY;
|
||||
|
||||
// HEADROCK HAM 3.6: Message window is now as wide as possible.
|
||||
MESSAGE_SCROLL_AREA_START_X = xResOffset + xResSize - 307;
|
||||
MESSAGE_SCROLL_AREA_END_X = xResOffset + xResSize - 293;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,12 +49,63 @@
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
extern UILayout_Map UI_MAP;
|
||||
|
||||
// Flugente: external sector data
|
||||
extern SECTOR_EXT_DATA SectorExternalData[256][4];
|
||||
|
||||
extern void SetLastTimePlayerWasInSector(INT16 sMapX, INT16 sMapY, INT8 sMapZ); // Flugente: set last time sector was visited
|
||||
|
||||
UINT16 MAPINV_NEXT_X;
|
||||
UINT16 MAPINV_PREV_X;
|
||||
UINT16 MAPINV_ARROW_Y;
|
||||
UINT16 MAPINV_ZOOM_X;
|
||||
UINT16 MAPINV_ZOOM_Y;
|
||||
UINT16 MAPINV_STACK_X;
|
||||
UINT16 MAPINV_STACK_Y;
|
||||
UINT16 MAPINV_SORT_AMMO_X;
|
||||
UINT16 MAPINV_SORT_AMMO_Y;
|
||||
UINT16 MAPINV_SORT_ATT_X;
|
||||
UINT16 MAPINV_SORT_ATT_Y;
|
||||
UINT16 MAPINV_EJECT_AMMO_X;
|
||||
UINT16 MAPINV_EJECT_AMMO_Y;
|
||||
UINT16 MAPINV_FILTER_X;
|
||||
UINT16 MAPINV_FILTER_Y;
|
||||
UINT16 MAPINV_FILTER_AMMO_X;
|
||||
UINT16 MAPINV_FILTER_AMMO_Y;
|
||||
UINT16 MAPINV_FILTER_GUN_X;
|
||||
UINT16 MAPINV_FILTER_GUN_Y;
|
||||
UINT16 MAPINV_FILTER_EXPLOSIVE_X;
|
||||
UINT16 MAPINV_FILTER_EXPLOSIVE_Y;
|
||||
UINT16 MAPINV_FILTER_MELEE_X;
|
||||
UINT16 MAPINV_FILTER_MELEE_Y;
|
||||
UINT16 MAPINV_FILTER_ARMOR_X;
|
||||
UINT16 MAPINV_FILTER_ARMOR_Y;
|
||||
UINT16 MAPINV_FILTER_LBE_X;
|
||||
UINT16 MAPINV_FILTER_LBE_Y;
|
||||
UINT16 MAPINV_FILTER_KIT_X;
|
||||
UINT16 MAPINV_FILTER_KIT_Y;
|
||||
UINT16 MAPINV_FILTER_MISC1_X;
|
||||
UINT16 MAPINV_FILTER_MISC1_Y;
|
||||
UINT16 MAPINV_FILTER_MISC2_X;
|
||||
UINT16 MAPINV_FILTER_MISC2_Y;
|
||||
UINT16 MAPINV_FILTER_SAVE_TEMPLATE_X;
|
||||
UINT16 MAPINV_FILTER_SAVE_TEMPLATE_Y;
|
||||
UINT16 MAPINV_FILTER_LOAD_TEMPLATE_X;
|
||||
UINT16 MAPINV_FILTER_LOAD_TEMPLATE_Y;
|
||||
UINT16 MAPINV_DONE_X;
|
||||
UINT16 MAPINV_DONE_y;
|
||||
UINT16 MAPINV_ITEMPOOL_X;
|
||||
UINT16 MAPINV_ITEMPOOL_Y;
|
||||
UINT16 MAPINV_PAGE_X;
|
||||
UINT16 MAPINV_PAGE_Y;
|
||||
UINT16 MAPINV_SECTOR_X;
|
||||
UINT16 MAPINV_SECTOR_Y;
|
||||
UINT16 MAPINV_LOC_STR_X;
|
||||
UINT16 MAPINV_LOC_STR_Y;
|
||||
UINT16 MAPINV_ITEMPOOL_STR_X;
|
||||
UINT16 MAPINV_ITEMPOOL_STR_Y;
|
||||
|
||||
//dnl ch51 081009
|
||||
UINT8 gInventoryPoolIndex = '0';
|
||||
std::vector<WORLDITEM> pInventoryPoolListQ[INVPOOLLISTNUM];
|
||||
@@ -355,6 +406,7 @@ BOOLEAN MapInventoryFilterMenuPopup_OptionOff( void );
|
||||
void MapInventoryFilterToggle( UINT32 uiFlags );
|
||||
void MapInventoryFilterSet( UINT32 uiFlags );
|
||||
void HandleSetFilterButtons();
|
||||
void InitMapInventoryCoordinates(void);
|
||||
|
||||
//dnl ch75 271013 ClearAllItemPools and RefreshItemPools are relocated from "Handle Items.cpp"
|
||||
void ClearAllItemPools()
|
||||
@@ -394,29 +446,22 @@ BOOLEAN LoadInventoryPoolGraphic( void )
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
{
|
||||
MAP_INV_SLOT_COLS = 8;
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 40;
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = 269 + xResOffset;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = 51 + yResOffset;
|
||||
sprintf( VObjectDesc.ImageFile, "INTERFACE\\sector_inventory.sti" );
|
||||
}
|
||||
else if (iResolution == _1280x720)
|
||||
{
|
||||
sprintf(VObjectDesc.ImageFile, "INTERFACE\\sector_inventory_1280x720.sti");
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
{
|
||||
MAP_INV_SLOT_COLS = 11;
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 77;
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + 278 + xResOffset;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = 62 + yResOffset;
|
||||
sprintf( VObjectDesc.ImageFile, "INTERFACE\\sector_inventory_800x600.sti" );
|
||||
}
|
||||
else
|
||||
{
|
||||
MAP_INV_SLOT_COLS = 17;
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = MAP_INVENTORY_POOL_MAX_SLOTS;
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + 282 + xResOffset;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = 50 + yResOffset;
|
||||
sprintf( VObjectDesc.ImageFile, "INTERFACE\\sector_inventory_1024x768.sti" );
|
||||
}
|
||||
|
||||
|
||||
// add to V-object index
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiMapInventoryPoolBackground));
|
||||
|
||||
@@ -428,6 +473,8 @@ BOOLEAN LoadInventoryPoolGraphic( void )
|
||||
sprintf( VObjectDesc.ImageFile, "INTERFACE\\Attachment_Asterisks.sti" );
|
||||
CHECKF(AddVideoObject(&VObjectDesc, &guiAttachmentAsterisks));
|
||||
|
||||
|
||||
ResetMapInventoryOffsets();
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -467,7 +514,7 @@ void BlitInventoryPoolGraphic( void )
|
||||
|
||||
// blit inventory pool graphic to the screen
|
||||
GetVideoObject(&hHandle, guiMapInventoryPoolBackground);
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0,(SCREEN_WIDTH - INTERFACE_WIDTH)/2 + INVEN_POOL_X, yResOffset + INVEN_POOL_Y , VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0, UI_MAP.BorderRegion.x, UI_MAP.BorderRegion.y, VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
|
||||
// HEADROCK HAM 5: Draw inventory slots
|
||||
BlitInventoryPoolSlotGraphics();
|
||||
@@ -500,7 +547,7 @@ void BlitInventoryPoolGraphic( void )
|
||||
HandleButtonStatesWhileMapInventoryActive( );
|
||||
|
||||
// Invalidate
|
||||
RestoreExternBackgroundRect(xResOffset + MAP_BORDER_X, yResOffset + MAP_BORDER_Y, SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset, SCREEN_HEIGHT - 121 - 2 * yResOffset);
|
||||
RestoreExternBackgroundRect(UI_MAP.BorderRegion.x, UI_MAP.BorderRegion.y, SCREEN_WIDTH, SCREEN_HEIGHT - 121);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -853,7 +900,14 @@ void CreateDestroyMapInventoryPoolButtons( BOOLEAN fExitFromMapScreen )
|
||||
}
|
||||
|
||||
// destroy buttons for map border
|
||||
DeleteMapBorderButtons( );
|
||||
if (isWidescreenUI())
|
||||
{
|
||||
DisableMapBorderButtons();
|
||||
}
|
||||
else
|
||||
{
|
||||
DeleteMapBorderButtons( );
|
||||
}
|
||||
|
||||
// delete map level markers regions
|
||||
DeleteMouseRegionsForLevelMarkers( );
|
||||
@@ -893,12 +947,18 @@ void CreateDestroyMapInventoryPoolButtons( BOOLEAN fExitFromMapScreen )
|
||||
if(gGameExternalOptions.fEnableInventoryPoolQ)//dnl ch51 081009
|
||||
SwitchToInventoryPoolQ(0);
|
||||
|
||||
// check fi we are in fact leaving mapscreen
|
||||
// check if we are in fact leaving mapscreen
|
||||
if( fExitFromMapScreen == FALSE )
|
||||
{
|
||||
// recreate mapborder buttons
|
||||
CreateButtonsForMapBorder( );
|
||||
|
||||
if (isWidescreenUI())
|
||||
{
|
||||
EnableMapBorderButtons();
|
||||
}
|
||||
else
|
||||
{
|
||||
CreateButtonsForMapBorder();
|
||||
}
|
||||
// recreate map level markers regions
|
||||
CreateMouseRegionsForLevelMarkers( );
|
||||
}
|
||||
@@ -965,7 +1025,6 @@ void CreateDestroyMapInventoryPoolButtons( BOOLEAN fExitFromMapScreen )
|
||||
|
||||
// do our handling here
|
||||
HandleMapSectorInventory( );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1420,7 +1479,10 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// access description box directly if CTRL is pressed for stack items
|
||||
else if((twItem->object.ubNumberOfObjects == 1 || _KeyDown( CTRL )) && fValidPointer)
|
||||
{
|
||||
fShowInventoryFlag = TRUE;
|
||||
if (!isWidescreenUI())
|
||||
{
|
||||
fShowInventoryFlag = TRUE;
|
||||
}
|
||||
|
||||
if (InItemDescriptionBox( ))
|
||||
{
|
||||
@@ -1762,14 +1824,16 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
|
||||
void CreateMapInventoryButtons( void )
|
||||
{
|
||||
InitMapInventoryCoordinates();
|
||||
|
||||
guiMapInvenArrowButtonImage[ 0 ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" , 10, 1, -1, 3, -1 );
|
||||
guiMapInvenArrowButton[ 0 ] = QuickCreateButton( guiMapInvenArrowButtonImage[ 0 ], (MAP_INV_X_OFFSET + 559), (SCREEN_HEIGHT - 144 - yResOffset),
|
||||
guiMapInvenArrowButton[ 0 ] = QuickCreateButton( guiMapInvenArrowButtonImage[ 0 ], MAPINV_NEXT_X, MAPINV_ARROW_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)MapInventoryPoolNextBtn );
|
||||
|
||||
|
||||
guiMapInvenArrowButtonImage[ 1 ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,9, 0, -1, 2, -1 );
|
||||
guiMapInvenArrowButton[ 1 ] = QuickCreateButton( guiMapInvenArrowButtonImage[ 1 ], (MAP_INV_X_OFFSET + 487), (SCREEN_HEIGHT - 144 - yResOffset),
|
||||
guiMapInvenArrowButton[ 1 ] = QuickCreateButton( guiMapInvenArrowButtonImage[ 1 ], MAPINV_PREV_X, MAPINV_ARROW_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)MapInventoryPoolPrevBtn );
|
||||
|
||||
@@ -1783,7 +1847,7 @@ void CreateMapInventoryButtons( void )
|
||||
if (iResolution >= _800x600 )
|
||||
{
|
||||
guiMapInvenZoomButtonImage = LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 0, 0, -1, 1, -1 );
|
||||
guiMapInvenZoomButton = QuickCreateButton( guiMapInvenZoomButtonImage, INVEN_POOL_X+10 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenZoomButton = QuickCreateButton( guiMapInvenZoomButtonImage, MAPINV_ZOOM_X, MAPINV_ZOOM_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolZoomBtn );
|
||||
|
||||
@@ -1797,7 +1861,7 @@ void CreateMapInventoryButtons( void )
|
||||
|
||||
// HEADROCK HAM 5: Stack and Merge button
|
||||
guiMapInvenSortButtonImage[ 0 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 16, 14, -1, 15, -1 );
|
||||
guiMapInvenSortButton[ 0 ] = QuickCreateButton( guiMapInvenSortButtonImage[ 0 ], INVEN_POOL_X+50 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenSortButton[ 0 ] = QuickCreateButton( guiMapInvenSortButtonImage[ 0 ], MAPINV_STACK_X, MAPINV_STACK_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolStackAndMergeBtn );
|
||||
|
||||
@@ -1805,7 +1869,7 @@ void CreateMapInventoryButtons( void )
|
||||
|
||||
// HEADROCK HAM 5: Sort Ammo Button
|
||||
guiMapInvenSortButtonImage[ 1 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 4, 2, -1, 3, -1 );
|
||||
guiMapInvenSortButton[ 1 ] = QuickCreateButton( guiMapInvenSortButtonImage[ 1 ], INVEN_POOL_X+80 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenSortButton[ 1 ] = QuickCreateButton( guiMapInvenSortButtonImage[ 1 ], MAPINV_SORT_AMMO_X, MAPINV_SORT_AMMO_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolSortAmmoBtn );
|
||||
|
||||
@@ -1813,15 +1877,15 @@ void CreateMapInventoryButtons( void )
|
||||
|
||||
// HEADROCK HAM 5: Sort Attachments Button
|
||||
guiMapInvenSortButtonImage[ 2 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 10, 8, -1, 9, -1 );
|
||||
guiMapInvenSortButton[ 2 ] = QuickCreateButton( guiMapInvenSortButtonImage[ 2 ], INVEN_POOL_X+110 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenSortButton[ 2 ] = QuickCreateButton( guiMapInvenSortButtonImage[ 2 ], MAPINV_SORT_ATT_X, MAPINV_SORT_ATT_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolSortAttachmentsBtn );
|
||||
|
||||
SetButtonFastHelpText( guiMapInvenSortButton[ 2 ], pMapScreenInvenButtonHelpText[ 6 ] );
|
||||
|
||||
// HEADROCK HAM 5: Sort Attachments Button
|
||||
// HEADROCK HAM 5: Eject Ammo Button
|
||||
guiMapInvenSortButtonImage[ 3 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 13, 11, -1, 12, -1 );
|
||||
guiMapInvenSortButton[ 3 ] = QuickCreateButton( guiMapInvenSortButtonImage[ 3 ], INVEN_POOL_X+140 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenSortButton[ 3 ] = QuickCreateButton( guiMapInvenSortButtonImage[ 3 ], MAPINV_EJECT_AMMO_X, MAPINV_EJECT_AMMO_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolEjectAmmoBtn );
|
||||
|
||||
@@ -1829,7 +1893,7 @@ void CreateMapInventoryButtons( void )
|
||||
|
||||
// HEADROCK HAM 5: Filter Toggle Button
|
||||
guiMapInvenFilterButtonImage[ 0 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 7, 5, -1, 6, -1 );
|
||||
guiMapInvenFilterButton[ 0 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 0 ], INVEN_POOL_X+185 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenFilterButton[ 0 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 0 ], MAPINV_FILTER_X, MAPINV_FILTER_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolFilterBtn );
|
||||
|
||||
@@ -1841,7 +1905,7 @@ void CreateMapInventoryButtons( void )
|
||||
guiMapInvenFilterButtonDefined[0] = TRUE;
|
||||
|
||||
guiMapInvenFilterButtonImage[ 1 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 20, 20, -1, 21, -1 );
|
||||
guiMapInvenFilterButton[ 1 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 1 ], INVEN_POOL_X+214 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenFilterButton[ 1 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 1 ], MAPINV_FILTER_GUN_X, MAPINV_FILTER_GUN_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolFilterBtn );
|
||||
|
||||
@@ -1853,7 +1917,7 @@ void CreateMapInventoryButtons( void )
|
||||
guiMapInvenFilterButtonDefined[1] = TRUE;
|
||||
|
||||
guiMapInvenFilterButtonImage[ 2 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 22, 22, -1, 23, -1 );
|
||||
guiMapInvenFilterButton[ 2 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 2 ], INVEN_POOL_X+214 + xResOffset, INVEN_POOL_Y + 24 + yResOffset,
|
||||
guiMapInvenFilterButton[ 2 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 2 ], MAPINV_FILTER_AMMO_X, MAPINV_FILTER_AMMO_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolFilterBtn );
|
||||
|
||||
@@ -1865,7 +1929,7 @@ void CreateMapInventoryButtons( void )
|
||||
guiMapInvenFilterButtonDefined[2] = TRUE;
|
||||
|
||||
guiMapInvenFilterButtonImage[ 3 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 24, 24, -1, 25, -1 );
|
||||
guiMapInvenFilterButton[ 3 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 3 ], INVEN_POOL_X+243 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenFilterButton[ 3 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 3 ], MAPINV_FILTER_EXPLOSIVE_X, MAPINV_FILTER_EXPLOSIVE_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolFilterBtn );
|
||||
|
||||
@@ -1877,7 +1941,7 @@ void CreateMapInventoryButtons( void )
|
||||
guiMapInvenFilterButtonDefined[3] = TRUE;
|
||||
|
||||
guiMapInvenFilterButtonImage[ 4 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 26, 26, -1, 27, -1 );
|
||||
guiMapInvenFilterButton[ 4 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 4 ], INVEN_POOL_X+243 + xResOffset, INVEN_POOL_Y + 24 + yResOffset,
|
||||
guiMapInvenFilterButton[ 4 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 4 ], MAPINV_FILTER_MELEE_X, MAPINV_FILTER_MELEE_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolFilterBtn );
|
||||
|
||||
@@ -1889,7 +1953,7 @@ void CreateMapInventoryButtons( void )
|
||||
guiMapInvenFilterButtonDefined[4] = TRUE;
|
||||
|
||||
guiMapInvenFilterButtonImage[ 5 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 28, 28, -1, 29, -1 );
|
||||
guiMapInvenFilterButton[ 5 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 5 ], INVEN_POOL_X+272 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenFilterButton[ 5 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 5 ], MAPINV_FILTER_ARMOR_X, MAPINV_FILTER_ARMOR_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolFilterBtn );
|
||||
|
||||
@@ -1901,7 +1965,7 @@ void CreateMapInventoryButtons( void )
|
||||
guiMapInvenFilterButtonDefined[5] = TRUE;
|
||||
|
||||
guiMapInvenFilterButtonImage[ 6 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 30, 30, -1, 31, -1 );
|
||||
guiMapInvenFilterButton[ 6 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 6 ], INVEN_POOL_X+272 + xResOffset, INVEN_POOL_Y + 24 + yResOffset,
|
||||
guiMapInvenFilterButton[ 6 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 6 ], MAPINV_FILTER_LBE_X, MAPINV_FILTER_LBE_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolFilterBtn );
|
||||
|
||||
@@ -1913,7 +1977,7 @@ void CreateMapInventoryButtons( void )
|
||||
guiMapInvenFilterButtonDefined[6] = TRUE;
|
||||
|
||||
guiMapInvenFilterButtonImage[ 7 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 32, 32, -1, 33, -1 );
|
||||
guiMapInvenFilterButton[ 7 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 7 ], INVEN_POOL_X+301 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenFilterButton[ 7 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 7 ], MAPINV_FILTER_KIT_X, MAPINV_FILTER_KIT_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolFilterBtn );
|
||||
|
||||
@@ -1925,7 +1989,7 @@ void CreateMapInventoryButtons( void )
|
||||
guiMapInvenFilterButtonDefined[7] = TRUE;
|
||||
|
||||
guiMapInvenFilterButtonImage[ 8 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 34, 34, -1, 35, -1 );
|
||||
guiMapInvenFilterButton[ 8 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 8 ], INVEN_POOL_X+301 + xResOffset, INVEN_POOL_Y + 24 + yResOffset,
|
||||
guiMapInvenFilterButton[ 8 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 8 ], MAPINV_FILTER_MISC1_X, MAPINV_FILTER_MISC1_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolFilterBtn );
|
||||
|
||||
@@ -1938,7 +2002,7 @@ void CreateMapInventoryButtons( void )
|
||||
|
||||
// Flugente: toggle button for move item display
|
||||
guiMapInvenFilterButtonImage[ 9 ]= LoadButtonImage( "INTERFACE\\sector_inventory_buttons.sti" , 36, 36, -1, 37, -1 );
|
||||
guiMapInvenFilterButton[ 9 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 9 ], INVEN_POOL_X+336 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenFilterButton[ 9 ] = QuickCreateButton( guiMapInvenFilterButtonImage[ 9 ], MAPINV_FILTER_MISC2_X, MAPINV_FILTER_MISC2_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryPoolFilterBtnMoveItemDisplay );
|
||||
|
||||
@@ -1956,7 +2020,7 @@ void CreateMapInventoryButtons( void )
|
||||
{
|
||||
// Flugente: gear templates
|
||||
guiMapInvenFilterButtonImage[10] = LoadButtonImage("INTERFACE\\sector_inventory_buttons.sti", 40, 40, -1, 40, -1);
|
||||
guiMapInvenFilterButton[10] = QuickCreateButton(guiMapInvenFilterButtonImage[10], INVEN_POOL_X + 371 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenFilterButton[10] = QuickCreateButton(guiMapInvenFilterButtonImage[10], MAPINV_FILTER_SAVE_TEMPLATE_X, MAPINV_FILTER_SAVE_TEMPLATE_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryWriteEquipmentTemplate);
|
||||
|
||||
@@ -1964,7 +2028,7 @@ void CreateMapInventoryButtons( void )
|
||||
guiMapInvenFilterButtonDefined[10] = TRUE;
|
||||
|
||||
guiMapInvenFilterButtonImage[11] = LoadButtonImage("INTERFACE\\sector_inventory_buttons.sti", 42, 42, -1, 42, -1);
|
||||
guiMapInvenFilterButton[11] = QuickCreateButton(guiMapInvenFilterButtonImage[11], INVEN_POOL_X + 406 + xResOffset, INVEN_POOL_Y + 10 + yResOffset,
|
||||
guiMapInvenFilterButton[11] = QuickCreateButton(guiMapInvenFilterButtonImage[11], MAPINV_FILTER_LOAD_TEMPLATE_X, MAPINV_FILTER_LOAD_TEMPLATE_Y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
NULL, (GUI_CALLBACK)MapInventoryReadEquipmentTemplate);
|
||||
|
||||
@@ -3145,7 +3209,7 @@ void DisplayPagesForMapInventoryPool( void )
|
||||
swprintf( sString, L"%d / %d", iCurrentInventoryPoolPage + 1, iLastInventoryPoolPage + 1 );
|
||||
|
||||
// grab centered coords
|
||||
FindFontCenterCoordinates(MAP_INVENTORY_POOL_PAGE_X, MAP_INVENTORY_POOL_PAGE_Y - yResOffset, MAP_INVENTORY_POOL_PAGE_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
|
||||
FindFontCenterCoordinates(MAPINV_PAGE_X, MAPINV_PAGE_Y, MAP_INVENTORY_POOL_PAGE_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
|
||||
|
||||
mprintf( sX, sY, sString );
|
||||
|
||||
@@ -3207,7 +3271,7 @@ void DrawNumberOfIventoryPoolItems( void )
|
||||
SetFontDestBuffer( guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
|
||||
|
||||
// grab centered coords
|
||||
FindFontCenterCoordinates(MAP_INVENTORY_POOL_NUMBER_X, MAP_INVENTORY_POOL_PAGE_Y - yResOffset, MAP_INVENTORY_POOL_NUMBER_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
|
||||
FindFontCenterCoordinates(MAPINV_ITEMPOOL_X, MAPINV_ITEMPOOL_Y, MAP_INVENTORY_POOL_NUMBER_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
|
||||
|
||||
mprintf( sX, sY, sString );
|
||||
|
||||
@@ -3221,7 +3285,7 @@ void CreateMapInventoryPoolDoneButton( void )
|
||||
{
|
||||
// create done button
|
||||
guiMapInvenDoneButtonImage= LoadButtonImage( "INTERFACE\\done_button.sti" , -1, 0, -1, 1, -1 );
|
||||
guiMapInvenDoneButton = QuickCreateButton( guiMapInvenDoneButtonImage, MAP_INV_X_OFFSET + 587 , (yResSize - 147 + yResOffset),
|
||||
guiMapInvenDoneButton = QuickCreateButton( guiMapInvenDoneButtonImage, MAPINV_DONE_X , MAPINV_DONE_y,
|
||||
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
|
||||
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)MapInventoryPoolDoneBtn );
|
||||
|
||||
@@ -3260,7 +3324,7 @@ void DisplayCurrentSector( void )
|
||||
SetFontDestBuffer( guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
|
||||
|
||||
// grab centered coords
|
||||
FindFontCenterCoordinates(MAP_INVENTORY_POOL_LOC_X, MAP_INVENTORY_POOL_PAGE_Y - yResOffset, MAP_INVENTORY_POOL_LOC_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
|
||||
FindFontCenterCoordinates(MAPINV_SECTOR_X, MAPINV_SECTOR_Y, MAP_INVENTORY_POOL_LOC_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
|
||||
|
||||
mprintf( sX, sY, sString );
|
||||
|
||||
@@ -3420,12 +3484,12 @@ void DrawTextOnMapInventoryBackground( void )
|
||||
SetFontDestBuffer( guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
|
||||
|
||||
//Calculate the height of the string, as it needs to be vertically centered.
|
||||
usStringHeight = DisplayWrappedString(MAP_INV_X_OFFSET + 268, (SCREEN_HEIGHT - 138 - yResOffset), 53, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 0 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED | DONT_DISPLAY_TEXT );
|
||||
DisplayWrappedString(MAP_INV_X_OFFSET + 268, (UINT16)((SCREEN_HEIGHT - 138 - yResOffset) - (usStringHeight / 2) ), 53, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 0 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||
usStringHeight = DisplayWrappedString(MAPINV_LOC_STR_X, MAPINV_LOC_STR_Y, 53, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 0 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED | DONT_DISPLAY_TEXT );
|
||||
DisplayWrappedString(MAPINV_LOC_STR_X, MAPINV_LOC_STR_Y - (usStringHeight / 2) , 53, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 0 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||
|
||||
//Calculate the height of the string, as it needs to be vertically centered.
|
||||
usStringHeight = DisplayWrappedString( MAP_INV_X_OFFSET + 369, (SCREEN_HEIGHT - 138 - yResOffset), 65, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 1 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED | DONT_DISPLAY_TEXT );
|
||||
DisplayWrappedString(MAP_INV_X_OFFSET + 369, (UINT16)((SCREEN_HEIGHT - 138 - yResOffset) - (usStringHeight / 2) ), 65, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 1 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||
usStringHeight = DisplayWrappedString(MAPINV_ITEMPOOL_STR_X, MAPINV_ITEMPOOL_STR_Y, 65, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 1 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED | DONT_DISPLAY_TEXT );
|
||||
DisplayWrappedString(MAPINV_ITEMPOOL_STR_X, MAPINV_ITEMPOOL_STR_Y - (usStringHeight / 2), 65, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 1 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED );
|
||||
|
||||
// item filter buttons included in 640x480
|
||||
/*if (iResolution < _800x600)
|
||||
@@ -3973,16 +4037,21 @@ BOOLEAN LoadInventoryPoolQ (UINT8 ubSaveGameID)
|
||||
UINT32 uiNumBytesRead;
|
||||
HWFILE hFile = 0;
|
||||
|
||||
if(MAP_INVENTORY_POOL_SLOT_COUNT <= 0)
|
||||
{
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 40;
|
||||
else if (iResolution < _1024x768)
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 77;
|
||||
else
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 170;
|
||||
}
|
||||
|
||||
//if(MAP_INVENTORY_POOL_SLOT_COUNT <= 0)
|
||||
//{
|
||||
// if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
// MAP_INVENTORY_POOL_SLOT_COUNT = 40;
|
||||
// else if (iResolution == _1280x720)
|
||||
// {
|
||||
// MAP_INVENTORY_POOL_SLOT_COUNT = MAP_INVENTORY_POOL_MAX_SLOTS;
|
||||
// }
|
||||
// else if (iResolution < _1024x768)
|
||||
// MAP_INVENTORY_POOL_SLOT_COUNT = 77;
|
||||
// else
|
||||
// MAP_INVENTORY_POOL_SLOT_COUNT = 170;
|
||||
//}
|
||||
ResetMapInventoryOffsets();
|
||||
|
||||
ret = FALSE;
|
||||
CreateSavedGameFileNameFromNumber(ubSaveGameID, tmpbuf);
|
||||
strcat(tmpbuf, ".IPQ");
|
||||
@@ -4049,16 +4118,21 @@ BOOLEAN SaveInventoryPoolQ(UINT8 ubSaveGameID)
|
||||
UINT32 uiNumBytesWritten;
|
||||
HWFILE hFile;
|
||||
|
||||
if(MAP_INVENTORY_POOL_SLOT_COUNT <= 0)
|
||||
{
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 40;
|
||||
else if (iResolution < _1024x768)
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 77;
|
||||
else
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 170;
|
||||
}
|
||||
|
||||
//if(MAP_INVENTORY_POOL_SLOT_COUNT <= 0)
|
||||
//{
|
||||
// if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
// MAP_INVENTORY_POOL_SLOT_COUNT = 40;
|
||||
// else if (iResolution == _1280x720)
|
||||
// {
|
||||
// MAP_INVENTORY_POOL_SLOT_COUNT = MAP_INVENTORY_POOL_MAX_SLOTS;
|
||||
// }
|
||||
// else if (iResolution < _1024x768)
|
||||
// MAP_INVENTORY_POOL_SLOT_COUNT = 77;
|
||||
// else
|
||||
// MAP_INVENTORY_POOL_SLOT_COUNT = 170;
|
||||
//}
|
||||
ResetMapInventoryOffsets();
|
||||
|
||||
ret = FALSE;
|
||||
CreateSavedGameFileNameFromNumber(ubSaveGameID, tmpbuf);
|
||||
strcat(tmpbuf, ".IPQ");
|
||||
@@ -4452,12 +4526,11 @@ void ResetMapInventoryOffsets( void )
|
||||
{
|
||||
//////////////////////////////////////////////
|
||||
// ZOOM OFF
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
if (isWidescreenUI() ||iResolution >= _1024x768)
|
||||
{
|
||||
MAP_INV_SLOT_COLS = 8;
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = 269 + xResOffset;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = 51 + yResOffset;
|
||||
MAP_INV_SLOT_COLS = 17;
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = UI_MAP.BorderRegion.x + 25;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = UI_MAP.BorderRegion.y + 51;
|
||||
}
|
||||
else if (iResolution >= _800x600 && iResolution < _1024x768)
|
||||
{
|
||||
@@ -4465,12 +4538,18 @@ void ResetMapInventoryOffsets( void )
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = 278 + xResOffset;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = 62 + yResOffset;
|
||||
}
|
||||
else if (iResolution >= _1024x768)
|
||||
else
|
||||
{
|
||||
MAP_INV_SLOT_COLS = 17;
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = 282 + xResOffset;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = 50 + yResOffset;
|
||||
MAP_INV_SLOT_COLS = 8;
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = 269 + xResOffset;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = 51 + yResOffset;
|
||||
}
|
||||
//else if (iResolution >= _1024x768)
|
||||
//{
|
||||
// MAP_INV_SLOT_COLS = 17;
|
||||
// MAP_INVENTORY_POOL_SLOT_START_X = 282 + xResOffset;
|
||||
// MAP_INVENTORY_POOL_SLOT_START_Y = 50 + yResOffset;
|
||||
//}
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = GetInventorySlotCount( FALSE );
|
||||
|
||||
ITEMDESC_ITEM_STATUS_HEIGHT_INV_POOL = 20;
|
||||
@@ -4493,11 +4572,11 @@ void ResetMapInventoryOffsets( void )
|
||||
////////////////////////////////////
|
||||
// ZOOM ON
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
if (isWidescreenUI() || iResolution >= _1024x768)
|
||||
{
|
||||
MAP_INV_SLOT_COLS = 3;
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = 269 + xResOffset;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = 51 + yResOffset;
|
||||
MAP_INV_SLOT_COLS = 8;
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = UI_MAP.BorderRegion.x + 25;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = UI_MAP.BorderRegion.y + 51;
|
||||
}
|
||||
else if (iResolution >= _800x600 && iResolution < _1024x768)
|
||||
{
|
||||
@@ -4505,12 +4584,18 @@ void ResetMapInventoryOffsets( void )
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = 278 + xResOffset;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = 62 + yResOffset;
|
||||
}
|
||||
else if (iResolution >= _1024x768)
|
||||
else
|
||||
{
|
||||
MAP_INV_SLOT_COLS = 8;
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = 282 + xResOffset;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = 50 + yResOffset;
|
||||
MAP_INV_SLOT_COLS = 3;
|
||||
MAP_INVENTORY_POOL_SLOT_START_X = 269 + xResOffset;
|
||||
MAP_INVENTORY_POOL_SLOT_START_Y = 51 + yResOffset;
|
||||
}
|
||||
//else if (iResolution >= _1024x768)
|
||||
//{
|
||||
// MAP_INV_SLOT_COLS = 8;
|
||||
// MAP_INVENTORY_POOL_SLOT_START_X = 282 + xResOffset;
|
||||
// MAP_INVENTORY_POOL_SLOT_START_Y = 50 + yResOffset;
|
||||
//}
|
||||
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = GetInventorySlotCount( TRUE );
|
||||
ITEMDESC_ITEM_STATUS_HEIGHT_INV_POOL = 40;
|
||||
@@ -4672,32 +4757,32 @@ UINT16 GetInventorySlotCount( BOOLEAN fZoomed )
|
||||
{
|
||||
if (!fZoomed)
|
||||
{
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
if (isWidescreenUI() || iResolution >= _1024x768)
|
||||
{
|
||||
return 40;
|
||||
return MAP_INVENTORY_POOL_MAX_SLOTS;
|
||||
}
|
||||
if (iResolution >= _800x600 && iResolution < _1024x768)
|
||||
else if (iResolution >= _800x600 && iResolution < _1024x768)
|
||||
{
|
||||
return 77;
|
||||
}
|
||||
if (iResolution >= _1024x768)
|
||||
else
|
||||
{
|
||||
return MAP_INVENTORY_POOL_MAX_SLOTS;
|
||||
return 40;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
if (isWidescreenUI() || iResolution >= _1024x768)
|
||||
{
|
||||
return 6;
|
||||
return 40;
|
||||
}
|
||||
if (iResolution >= _800x600 && iResolution < _1024x768)
|
||||
else if (iResolution >= _800x600 && iResolution < _1024x768)
|
||||
{
|
||||
return 15;
|
||||
}
|
||||
if (iResolution >= _1024x768)
|
||||
else
|
||||
{
|
||||
return 40;
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6239,3 +6324,158 @@ void HandleSectorCooldownFunctions( INT16 sMapX, INT16 sMapY, INT8 sMapZ, std::v
|
||||
HandleItemCooldownFunctions( &(pWorldItem[ uiCount ].object), tickspassed * ( fUndo ? -NUM_SEC_PER_TACTICAL_TURN : NUM_SEC_PER_TACTICAL_TURN ), (sMapZ > 0) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void InitMapInventoryCoordinates(void)
|
||||
{
|
||||
if (isWidescreenUI())
|
||||
{
|
||||
MAPINV_NEXT_X = UI_MAP.BorderRegion.x + 679;
|
||||
MAPINV_PREV_X = UI_MAP.BorderRegion.x + 607;
|
||||
MAPINV_ARROW_Y = UI_MAP.BorderRegion.y + 19;
|
||||
|
||||
MAPINV_ZOOM_X = UI_MAP.BorderRegion.x + 10;
|
||||
MAPINV_ZOOM_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_STACK_X = UI_MAP.BorderRegion.x + 50;
|
||||
MAPINV_STACK_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_SORT_AMMO_X = UI_MAP.BorderRegion.x + 80;
|
||||
MAPINV_SORT_AMMO_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_SORT_ATT_X = UI_MAP.BorderRegion.x + 110;
|
||||
MAPINV_SORT_ATT_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_EJECT_AMMO_X = UI_MAP.BorderRegion.x + 140;
|
||||
MAPINV_EJECT_AMMO_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_FILTER_X = UI_MAP.BorderRegion.x + 185;
|
||||
MAPINV_FILTER_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_FILTER_GUN_X = UI_MAP.BorderRegion.x + 214;
|
||||
MAPINV_FILTER_GUN_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_FILTER_AMMO_X = UI_MAP.BorderRegion.x + 214;
|
||||
MAPINV_FILTER_AMMO_Y = UI_MAP.BorderRegion.y + 24;
|
||||
|
||||
MAPINV_FILTER_EXPLOSIVE_X = UI_MAP.BorderRegion.x + 243;
|
||||
MAPINV_FILTER_EXPLOSIVE_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_FILTER_MELEE_X = UI_MAP.BorderRegion.x + 243;
|
||||
MAPINV_FILTER_MELEE_Y = UI_MAP.BorderRegion.y + 24;
|
||||
|
||||
MAPINV_FILTER_ARMOR_X = UI_MAP.BorderRegion.x + 272;
|
||||
MAPINV_FILTER_ARMOR_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_FILTER_LBE_X = UI_MAP.BorderRegion.x + 272;
|
||||
MAPINV_FILTER_LBE_Y = UI_MAP.BorderRegion.y + 24;
|
||||
|
||||
MAPINV_FILTER_KIT_X = UI_MAP.BorderRegion.x + 301;
|
||||
MAPINV_FILTER_KIT_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_FILTER_MISC1_X = UI_MAP.BorderRegion.x + 301;
|
||||
MAPINV_FILTER_MISC1_Y = UI_MAP.BorderRegion.y + 24;
|
||||
|
||||
MAPINV_FILTER_MISC2_X = UI_MAP.BorderRegion.x + 336;
|
||||
MAPINV_FILTER_MISC2_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_FILTER_SAVE_TEMPLATE_X = UI_MAP.BorderRegion.x + 371;
|
||||
MAPINV_FILTER_SAVE_TEMPLATE_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_FILTER_LOAD_TEMPLATE_X = UI_MAP.BorderRegion.x + 406;
|
||||
MAPINV_FILTER_LOAD_TEMPLATE_Y = UI_MAP.BorderRegion.y + 10;
|
||||
|
||||
MAPINV_DONE_X = UI_MAP.BorderRegion.x + 706;
|
||||
MAPINV_DONE_y = UI_MAP.BorderRegion.y + 15;
|
||||
|
||||
MAPINV_ITEMPOOL_X = UI_MAP.BorderRegion.x + 558;
|
||||
MAPINV_ITEMPOOL_Y = UI_MAP.BorderRegion.y + 19;
|
||||
|
||||
MAPINV_PAGE_X = UI_MAP.BorderRegion.x + 626;
|
||||
MAPINV_PAGE_Y = UI_MAP.BorderRegion.y + 19;
|
||||
|
||||
MAPINV_SECTOR_X = UI_MAP.BorderRegion.x + 447;
|
||||
MAPINV_SECTOR_Y = UI_MAP.BorderRegion.y + 19;
|
||||
|
||||
MAPINV_LOC_STR_X = MAPINV_SECTOR_X - 19;
|
||||
MAPINV_LOC_STR_Y = UI_MAP.BorderRegion.y + 15;
|
||||
|
||||
MAPINV_ITEMPOOL_STR_X = MAPINV_ITEMPOOL_X - 19;
|
||||
MAPINV_ITEMPOOL_STR_Y = UI_MAP.BorderRegion.y + 15;
|
||||
}
|
||||
else
|
||||
{
|
||||
MAPINV_NEXT_X = MAP_INV_X_OFFSET + 559;
|
||||
MAPINV_PREV_X = MAP_INV_X_OFFSET + 487;
|
||||
MAPINV_ARROW_Y = SCREEN_HEIGHT - 144 - yResOffset;
|
||||
|
||||
MAPINV_ZOOM_X = INVEN_POOL_X + 10 + xResOffset;
|
||||
MAPINV_ZOOM_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_STACK_X = INVEN_POOL_X + 50 + xResOffset;
|
||||
MAPINV_STACK_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_SORT_AMMO_X = INVEN_POOL_X + 80 + xResOffset;
|
||||
MAPINV_SORT_AMMO_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_SORT_ATT_X = INVEN_POOL_X + 110 + xResOffset;
|
||||
MAPINV_SORT_ATT_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_EJECT_AMMO_X = INVEN_POOL_X + 140 + xResOffset;
|
||||
MAPINV_EJECT_AMMO_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_X = INVEN_POOL_X + 185 + xResOffset;
|
||||
MAPINV_FILTER_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_GUN_X = INVEN_POOL_X + 214 + xResOffset;
|
||||
MAPINV_FILTER_GUN_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_AMMO_X = INVEN_POOL_X + 214 + xResOffset;
|
||||
MAPINV_FILTER_AMMO_Y = INVEN_POOL_Y + 24 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_EXPLOSIVE_X = INVEN_POOL_X + 243 + xResOffset;
|
||||
MAPINV_FILTER_EXPLOSIVE_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_MELEE_X = INVEN_POOL_X + 243 + xResOffset;
|
||||
MAPINV_FILTER_MELEE_Y = INVEN_POOL_Y + 24 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_ARMOR_X = INVEN_POOL_X + 272 + xResOffset;
|
||||
MAPINV_FILTER_ARMOR_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_LBE_X = INVEN_POOL_X + 272 + xResOffset;
|
||||
MAPINV_FILTER_LBE_Y = INVEN_POOL_Y + 24 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_KIT_X = INVEN_POOL_X + 301 + xResOffset;
|
||||
MAPINV_FILTER_KIT_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_MISC1_X = INVEN_POOL_X + 301 + xResOffset;
|
||||
MAPINV_FILTER_MISC1_Y = INVEN_POOL_Y + 24 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_MISC2_X = INVEN_POOL_X + 336 + xResOffset;
|
||||
MAPINV_FILTER_MISC2_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_SAVE_TEMPLATE_X = INVEN_POOL_X + 371 + xResOffset;
|
||||
MAPINV_FILTER_SAVE_TEMPLATE_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_FILTER_LOAD_TEMPLATE_X = INVEN_POOL_X + 406 + xResOffset;
|
||||
MAPINV_FILTER_LOAD_TEMPLATE_Y = INVEN_POOL_Y + 10 + yResOffset;
|
||||
|
||||
MAPINV_DONE_X = MAP_INV_X_OFFSET + 587;
|
||||
MAPINV_DONE_y = yResSize - 147 + yResOffset;
|
||||
|
||||
MAPINV_ITEMPOOL_X = MAP_INVENTORY_POOL_NUMBER_X;
|
||||
MAPINV_ITEMPOOL_Y = MAP_INVENTORY_POOL_PAGE_Y - yResOffset;
|
||||
|
||||
MAPINV_PAGE_X = MAP_INVENTORY_POOL_PAGE_X;
|
||||
MAPINV_PAGE_Y = MAP_INVENTORY_POOL_PAGE_Y - yResOffset;
|
||||
|
||||
MAPINV_SECTOR_X = MAP_INVENTORY_POOL_LOC_X;
|
||||
MAPINV_SECTOR_Y = MAP_INVENTORY_POOL_PAGE_Y - yResOffset;
|
||||
|
||||
MAPINV_LOC_STR_X = MAP_INV_X_OFFSET + 268;
|
||||
MAPINV_LOC_STR_Y = (SCREEN_HEIGHT - 138 - yResOffset);
|
||||
|
||||
MAPINV_ITEMPOOL_STR_X = MAP_INV_X_OFFSET + 369;
|
||||
MAPINV_ITEMPOOL_STR_Y = (SCREEN_HEIGHT - 138 - yResOffset);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ extern CHAR16 gzSectorNames[256][4][MAX_SECTOR_NAME_LENGTH];
|
||||
extern UINT8 gMilitiaGroupId;
|
||||
extern UINT8 gNewMilitiaGroupId;
|
||||
extern PathStPtr gpMilitiaPreviousMercPath;
|
||||
extern UILayout_Map UI_MAP;
|
||||
|
||||
UINT16 MAP_GRID_X;
|
||||
UINT16 MAP_GRID_Y;
|
||||
@@ -274,8 +275,6 @@ UINT16 MAP_LEVEL_STRING_Y;
|
||||
#define WEST_OFFSET_Y 0
|
||||
#define WEST_TO_SOUTH_OFFSET_Y 0
|
||||
#define EAST_TO_NORTH_OFFSET_Y 0
|
||||
#define RED_WEST_OFF_X -MAP_GRID_X
|
||||
#define RED_EAST_OFF_X MAP_GRID_X
|
||||
#define RED_NORTH_OFF_Y -21
|
||||
#define RED_SOUTH_OFF_Y 21
|
||||
|
||||
@@ -621,8 +620,8 @@ void DrawIconL(INT32 MAP_GRID_X2, INT32 MAP_GRID_Y2, INT32 i )
|
||||
{
|
||||
HVOBJECT hHandle;
|
||||
|
||||
INT16 sX = (UINT16)(MAP_VIEW_START_X + MAP_GRID_X + (MAP_GRID_X2 * MAP_GRID_X) / 10);
|
||||
INT16 sY = (UINT16)(MAP_VIEW_START_Y + MAP_GRID_Y + ((MAP_GRID_Y2 * MAP_GRID_Y) / 10) + 1);
|
||||
const UINT16 sX = UI_MAP.ViewRegion.x + UI_MAP.GridSize.iX + (MAP_GRID_X2 * UI_MAP.GridSize.iX) / 10;
|
||||
const UINT16 sY = UI_MAP.ViewRegion.y + UI_MAP.GridSize.iY + ((MAP_GRID_Y2 * UI_MAP.GridSize.iY) / 10) + 1;
|
||||
|
||||
INT8 ubVidObjIndex = 1;
|
||||
|
||||
@@ -658,7 +657,11 @@ void DrawMapIndexBigMap( BOOLEAN fSelectedCursorIsYellow )
|
||||
else
|
||||
SetFontForeground(MAP_INDEX_COLOR);
|
||||
|
||||
FindFontCenterCoordinates(((INT16)(MAP_HORT_INDEX_X+( iCount - 1) *MAP_GRID_X)), MAP_HORT_INDEX_Y, MAP_GRID_X, MAP_HORT_HEIGHT, pMapHortIndex[iCount], MAP_FONT, &usX, &usY);
|
||||
const auto left = UI_MAP.Numbers.x + UI_MAP.Numbers.width * (iCount - 1);
|
||||
const auto top = UI_MAP.Numbers.y;
|
||||
const auto width = UI_MAP.Numbers.width;
|
||||
const auto height = UI_MAP.Numbers.height;
|
||||
FindFontCenterCoordinates(left, top, width, height, pMapHortIndex[iCount], MAP_FONT, &usX, &usY);
|
||||
mprintf(usX,usY,pMapHortIndex[iCount]);
|
||||
|
||||
if ( fDrawCursors && (iCount == sSelMapY) && ( GetSelectedDestChar() == -1) && !fPlotForHelicopter && !fPlotForMilitia )
|
||||
@@ -668,12 +671,16 @@ void DrawMapIndexBigMap( BOOLEAN fSelectedCursorIsYellow )
|
||||
else
|
||||
SetFontForeground(MAP_INDEX_COLOR);
|
||||
|
||||
FindFontCenterCoordinates(MAP_VERT_INDEX_X, ((INT16)(MAP_VERT_INDEX_Y+ ( iCount - 1) *MAP_GRID_Y)), MAP_HORT_HEIGHT, MAP_GRID_Y, pMapVertIndex[iCount], MAP_FONT, &usX, &usY);
|
||||
const auto vertLeft = UI_MAP.Alphabet.x;
|
||||
const auto vertTop = UI_MAP.Alphabet.y + UI_MAP.Alphabet.height * (iCount - 1);
|
||||
const auto vertWidth = UI_MAP.Alphabet.width;
|
||||
const auto vertHeight = UI_MAP.Alphabet.height;
|
||||
FindFontCenterCoordinates(vertLeft, vertTop, vertWidth, vertHeight, pMapVertIndex[iCount], MAP_FONT, &usX, &usY);
|
||||
mprintf(usX,usY,pMapVertIndex[iCount]);
|
||||
}
|
||||
|
||||
InvalidateRegion(MAP_VERT_INDEX_X, MAP_VERT_INDEX_Y,MAP_VERT_INDEX_X+MAP_HORT_HEIGHT, MAP_VERT_INDEX_Y+( iCount - 1 ) * MAP_GRID_Y );
|
||||
InvalidateRegion(MAP_HORT_INDEX_X, MAP_HORT_INDEX_Y,MAP_HORT_INDEX_X + ( iCount - 1) * MAP_GRID_X, MAP_HORT_INDEX_Y+ MAP_HORT_HEIGHT);
|
||||
InvalidateRegion(UI_MAP.Alphabet.x, UI_MAP.Alphabet.y, UI_MAP.Alphabet.x+ UI_MAP.Alphabet.width, UI_MAP.Alphabet.y + UI_MAP.Alphabet.height * ( iCount - 1 ) );
|
||||
InvalidateRegion(UI_MAP.Numbers.x, UI_MAP.Numbers.y, UI_MAP.Numbers.x + ( iCount - 1) * UI_MAP.Numbers.width, UI_MAP.Numbers.y + UI_MAP.Numbers.height);
|
||||
|
||||
SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
|
||||
}
|
||||
@@ -944,10 +951,10 @@ void fillMapColoursForSamSiteAirSpace( INT32( &colorMap )[ MAXIMUM_VALID_Y_COORD
|
||||
|
||||
UINT32 DrawMap(void)
|
||||
{
|
||||
MapScreenRect.iLeft = MAP_VIEW_START_X + MAP_GRID_X - 2;
|
||||
MapScreenRect.iTop = MAP_VIEW_START_Y + MAP_GRID_Y - 1;
|
||||
MapScreenRect.iRight = MAP_VIEW_START_X + MAP_VIEW_WIDTH - 1 + MAP_GRID_X;
|
||||
MapScreenRect.iBottom = MAP_VIEW_START_Y + MAP_VIEW_HEIGHT - 10 + MAP_GRID_Y;
|
||||
MapScreenRect.iLeft = UI_MAP.ViewRegion.x + UI_MAP.GridSize.iX - 2;
|
||||
MapScreenRect.iTop = UI_MAP.ViewRegion.y + UI_MAP.GridSize.iY - 1;
|
||||
MapScreenRect.iRight = UI_MAP.ViewRegion.x + UI_MAP.ViewRegion.width - 1 + UI_MAP.GridSize.iX;
|
||||
MapScreenRect.iBottom = UI_MAP.ViewRegion.y + UI_MAP.ViewRegion.height - 10 + UI_MAP.GridSize.iY;
|
||||
|
||||
if (!iCurrentMapSectorZ)
|
||||
{ // Aboveground sectors
|
||||
@@ -961,7 +968,7 @@ UINT32 DrawMap(void)
|
||||
UINT32 uiSrcPitchBYTES;
|
||||
UINT8 *pSrcBuf = LockVideoSurface(guiBIGMAP, &uiSrcPitchBYTES);
|
||||
|
||||
Blt8BPPDataTo16BPPBufferHalf(pDestBuf, uiDestPitchBYTES, hSrcVSurface, pSrcBuf, uiSrcPitchBYTES, MAP_VIEW_START_X + 1, MAP_VIEW_START_Y);
|
||||
Blt8BPPDataTo16BPPBufferHalf(pDestBuf, uiDestPitchBYTES, hSrcVSurface, pSrcBuf, uiSrcPitchBYTES, UI_MAP.ViewRegion.x + 1, UI_MAP.ViewRegion.y);
|
||||
|
||||
UnLockVideoSurface(guiBIGMAP);
|
||||
UnLockVideoSurface(guiSAVEBUFFER);
|
||||
@@ -1123,8 +1130,8 @@ UINT32 DrawMap(void)
|
||||
|
||||
void GetScreenXYFromMapXY( INT16 sMapX, INT16 sMapY, INT16 *psX, INT16 *psY )
|
||||
{
|
||||
*psX = ( sMapX * MAP_GRID_X ) + MAP_VIEW_START_X;
|
||||
*psY = ( sMapY * MAP_GRID_Y ) + MAP_VIEW_START_Y;
|
||||
*psX = ( sMapX * UI_MAP.GridSize.iX ) + UI_MAP.ViewRegion.x;
|
||||
*psY = ( sMapY * UI_MAP.GridSize.iY ) + UI_MAP.ViewRegion.y;
|
||||
}
|
||||
|
||||
|
||||
@@ -1174,8 +1181,8 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen1");
|
||||
wcscpy( sStringA, L"");
|
||||
}
|
||||
|
||||
usX = (UINT16) (MAP_VIEW_START_X + MAP_GRID_X + (pTownPoints[ bTown ].x * MAP_GRID_X) / 10);
|
||||
usY = (UINT16) (MAP_VIEW_START_Y + MAP_GRID_Y + ((pTownPoints[ bTown ].y * MAP_GRID_Y) / 10) + 1);
|
||||
usX = (UINT16) (UI_MAP.ViewRegion.x + UI_MAP.GridSize.iX + (pTownPoints[ bTown ].x * UI_MAP.GridSize.iX) / 10);
|
||||
usY = (UINT16) (UI_MAP.ViewRegion.y + UI_MAP.GridSize.iY + ((pTownPoints[ bTown ].y * UI_MAP.GridSize.iY) / 10) + 1);
|
||||
|
||||
// red for low loyalty, green otherwise
|
||||
SetFontForeground( ( UINT8 ) ( fLoyaltyTooLowToTrainMilitia ? FONT_MCOLOR_RED : FONT_MCOLOR_LTGREEN ) );
|
||||
@@ -1205,7 +1212,7 @@ void DrawTownLabels(STR16 pString, STR16 pStringA, UINT16 usFirstX, UINT16 usFir
|
||||
SetFont( MapTownLabelsFont );
|
||||
|
||||
// if within view region...render, else don't
|
||||
if( ( usFirstX > MAP_VIEW_START_X + MAP_VIEW_WIDTH )||( usFirstX < MAP_VIEW_START_X )|| (usFirstY < MAP_VIEW_START_Y ) || ( usFirstY > MAP_VIEW_START_Y + MAP_VIEW_HEIGHT ) )
|
||||
if( ( usFirstX > UI_MAP.ViewRegion.x + UI_MAP.ViewRegion.width)||( usFirstX < UI_MAP.ViewRegion.x)|| (usFirstY < UI_MAP.ViewRegion.y) || ( usFirstY > UI_MAP.ViewRegion.y + UI_MAP.ViewRegion.height) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1226,7 +1233,7 @@ void DrawTownLabels(STR16 pString, STR16 pStringA, UINT16 usFirstX, UINT16 usFir
|
||||
VarFindFontCenterCoordinates(( INT16 )( usFirstX ), ( INT16 )usFirstY, StringPixLength( pString, MapTownLabelsFont), 0, MapTownLabelsFont, &sSecondX, &sSecondY, pStringA);
|
||||
|
||||
// make sure we don't go past left edge (Grumm)
|
||||
sPastEdge = (MAP_VIEW_START_X + 23) - sSecondX;
|
||||
sPastEdge = (UI_MAP.ViewRegion.x + 23) - sSecondX;
|
||||
|
||||
if (sPastEdge > 0)
|
||||
sSecondX += sPastEdge;
|
||||
@@ -1481,20 +1488,20 @@ void ShowUncertainNumberEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
UINT8 iconOffsetX = 0;
|
||||
UINT8 iconOffsetY = 0;
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
if (isWidescreenUI() || iResolution >= _1024x768)
|
||||
{
|
||||
iconOffsetX = 2;
|
||||
iconOffsetY = 9;
|
||||
iconOffsetX = 12;
|
||||
iconOffsetY = 13;
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
else if (iResolution >= _800x600 && iResolution < _1024x768)
|
||||
{
|
||||
iconOffsetX = 8;
|
||||
iconOffsetY = 12;
|
||||
}
|
||||
else
|
||||
{
|
||||
iconOffsetX = 12;
|
||||
iconOffsetY = 13;
|
||||
iconOffsetX = 2;
|
||||
iconOffsetY = 9;
|
||||
}
|
||||
|
||||
// grab the x and y postions
|
||||
@@ -1505,13 +1512,13 @@ void ShowUncertainNumberEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
GetVideoObject(&hIconHandle, guiCHARICONS);
|
||||
|
||||
// check if we are zoomed in...need to offset in case for scrolling purposes
|
||||
sXPosition = ( INT16 )( iconOffsetX + ( MAP_VIEW_START_X + ( sSectorX * MAP_GRID_X + 1 ) ) - 1 );
|
||||
sYPosition = ( INT16 )( ( ( iconOffsetY + ( yResOffset + sSectorY * MAP_GRID_Y ) + 1 ) ) );
|
||||
sXPosition = ( INT16 )( iconOffsetX + (UI_MAP.ViewRegion.x + ( sSectorX * UI_MAP.GridSize.iX + 1 ) ) - 1 );
|
||||
sYPosition = ( INT16 )( ( ( iconOffsetY + (UI_MAP.ViewRegion.y + sSectorY * UI_MAP.GridSize.iY ) + 1 ) ) );
|
||||
sYPosition -= 2;
|
||||
|
||||
// small question mark
|
||||
BltVideoObject(guiSAVEBUFFER, hIconHandle, SMALL_QUESTION_MARK, sXPosition, sYPosition, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
InvalidateRegion( sXPosition ,sYPosition, sXPosition + DMAP_GRID_X, sYPosition + DMAP_GRID_Y );
|
||||
InvalidateRegion( sXPosition ,sYPosition, sXPosition + UI_MAP.GridSize.iX + 1, sYPosition + UI_MAP.GridSize.iY + 1);
|
||||
}
|
||||
|
||||
void ShowTeamAndVehicles(INT32 fShowFlags)
|
||||
@@ -1576,10 +1583,10 @@ BOOLEAN ShadeMapElem( INT16 sMapX, INT16 sMapY, INT32 iColor )
|
||||
sScreenX += 1;
|
||||
|
||||
// compensate for original BIG_MAP blit being done at MAP_VIEW_START_X + 1
|
||||
clip.iLeft = 2 * ( sScreenX - ( MAP_VIEW_START_X + 1 ) );
|
||||
clip.iTop = 2 * ( sScreenY - MAP_VIEW_START_Y );
|
||||
clip.iRight = clip.iLeft + ( 2 * MAP_GRID_X );
|
||||
clip.iBottom = clip.iTop + ( 2 * MAP_GRID_Y );
|
||||
clip.iLeft = 2 * ( sScreenX - (UI_MAP.ViewRegion.x + 1 ) );
|
||||
clip.iTop = 2 * ( sScreenY - UI_MAP.ViewRegion.y);
|
||||
clip.iRight = clip.iLeft + ( 2 * UI_MAP.GridSize.iX );
|
||||
clip.iBottom = clip.iTop + ( 2 * UI_MAP.GridSize.iY );
|
||||
|
||||
if( iColor == MAP_SHADE_BLACK )
|
||||
{
|
||||
@@ -1587,7 +1594,7 @@ BOOLEAN ShadeMapElem( INT16 sMapX, INT16 sMapY, INT32 iColor )
|
||||
sScreenY -= 1;
|
||||
|
||||
// simply shade darker
|
||||
ShadowVideoSurfaceRect( guiSAVEBUFFER, sScreenX, sScreenY, sScreenX + MAP_GRID_X - 1, sScreenY + MAP_GRID_Y - 1 );
|
||||
ShadowVideoSurfaceRect( guiSAVEBUFFER, sScreenX, sScreenY, sScreenX + UI_MAP.GridSize.iX - 1, sScreenY + UI_MAP.GridSize.iY - 1 );
|
||||
}
|
||||
else if ( iColor < MAP_SHADE_MAX )
|
||||
{
|
||||
@@ -1658,10 +1665,10 @@ BOOLEAN ShadeMapElements(const INT32(&colorMap)[ MAXIMUM_VALID_Y_COORDINATE ][ M
|
||||
|
||||
// compensate for original BIG_MAP blit being done at MAP_VIEW_START_X + 1
|
||||
SGPRect clip;
|
||||
clip.iLeft = 2 * (sScreenX - (MAP_VIEW_START_X + 1));
|
||||
clip.iTop = 2 * (sScreenY - MAP_VIEW_START_Y);
|
||||
clip.iRight = clip.iLeft + (2 * MAP_GRID_X);
|
||||
clip.iBottom = clip.iTop + (2 * MAP_GRID_Y);
|
||||
clip.iLeft = 2 * (sScreenX - (UI_MAP.ViewRegion.x + 1));
|
||||
clip.iTop = 2 * (sScreenY - UI_MAP.ViewRegion.y);
|
||||
clip.iRight = clip.iLeft + (2 * UI_MAP.GridSize.iX);
|
||||
clip.iBottom = clip.iTop + (2 * UI_MAP.GridSize.iY);
|
||||
|
||||
|
||||
const auto iColor = colorMap[y][x];
|
||||
@@ -1672,8 +1679,8 @@ BOOLEAN ShadeMapElements(const INT32(&colorMap)[ MAXIMUM_VALID_Y_COORDINATE ][ M
|
||||
|
||||
auto X1 = sScreenX;
|
||||
auto Y1 = sScreenY;
|
||||
auto X2 = sScreenX + MAP_GRID_X - 1;
|
||||
auto Y2 = sScreenY + MAP_GRID_Y - 1;
|
||||
auto X2 = sScreenX + UI_MAP.GridSize.iX - 1;
|
||||
auto Y2 = sScreenY + UI_MAP.GridSize.iY - 1;
|
||||
#ifdef _DEBUG
|
||||
if (X1 < 0)
|
||||
X1 = 0;
|
||||
@@ -1746,23 +1753,23 @@ BOOLEAN ShadeMapElements(const INT32(&colorMap)[ MAXIMUM_VALID_Y_COORDINATE ][ M
|
||||
|
||||
void InitializeMilitiaPopup(void)
|
||||
{
|
||||
UINT16 xVal = 330 + xResOffset;
|
||||
UINT16 yVal = 25 + yResOffset;
|
||||
const UINT16 xVal = 330 + xResOffset;
|
||||
const UINT16 yVal = 25 + yResOffset;
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
if (isWidescreenUI() || iResolution >= _1024x768)
|
||||
{
|
||||
MAP_MILITIA_BOX_POS_X = xVal;
|
||||
MAP_MILITIA_BOX_POS_Y = yVal;
|
||||
MAP_MILITIA_BOX_POS_X = xVal + 190;
|
||||
MAP_MILITIA_BOX_POS_Y = yVal + 285;
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
else if (iResolution >= _800x600)
|
||||
{
|
||||
MAP_MILITIA_BOX_POS_X = xVal + 77;
|
||||
MAP_MILITIA_BOX_POS_Y = yVal + 116;
|
||||
}
|
||||
else
|
||||
{
|
||||
MAP_MILITIA_BOX_POS_X = xVal + 190;
|
||||
MAP_MILITIA_BOX_POS_Y = yVal + 285;
|
||||
MAP_MILITIA_BOX_POS_X = xVal;
|
||||
MAP_MILITIA_BOX_POS_Y = yVal;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1779,6 +1786,8 @@ BOOLEAN InitializePalettesForMap( void )
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
strcpy(vs_desc.ImageFile, "INTERFACE\\b_map.pcx");
|
||||
else if (iResolution == _1280x720)
|
||||
strcpy(vs_desc.ImageFile, "INTERFACE\\b_map_1280x720.pcx");
|
||||
else if (iResolution < _1024x768)
|
||||
strcpy(vs_desc.ImageFile, "INTERFACE\\b_map_800x600.pcx");
|
||||
else
|
||||
@@ -2582,8 +2591,8 @@ BOOLEAN TracePathRoute(BOOLEAN fCheckFlag, BOOLEAN fForceUpDate, PathStPtr pPath
|
||||
|
||||
iX=(pNode->uiSectorId%MAP_WORLD_X);
|
||||
iY=(pNode->uiSectorId/MAP_WORLD_X);
|
||||
iX=(iX*MAP_GRID_X)+MAP_VIEW_START_X;
|
||||
iY=(iY*MAP_GRID_Y)+MAP_VIEW_START_Y;
|
||||
iX=(iX*UI_MAP.GridSize.iX) + UI_MAP.ViewRegion.x;
|
||||
iY=(iY*UI_MAP.GridSize.iY) + UI_MAP.ViewRegion.y;
|
||||
|
||||
iArrowX=iX;
|
||||
iArrowY=iY;
|
||||
@@ -2813,8 +2822,8 @@ BOOLEAN TracePathRoute(BOOLEAN fCheckFlag, BOOLEAN fForceUpDate, PathStPtr pPath
|
||||
{
|
||||
iX=(pNode->uiSectorId%MAP_WORLD_X);
|
||||
iY=(pNode->uiSectorId/MAP_WORLD_X);
|
||||
iX=(iX*MAP_GRID_X)+MAP_VIEW_START_X;
|
||||
iY=(iY*MAP_GRID_Y)+MAP_VIEW_START_Y;
|
||||
iX=(iX*UI_MAP.GridSize.iX) + UI_MAP.ViewRegion.x;
|
||||
iY=(iY*UI_MAP.GridSize.iY) + UI_MAP.ViewRegion.y;
|
||||
|
||||
iArrowX=iX;
|
||||
iArrowY=iY;
|
||||
@@ -2917,10 +2926,10 @@ BOOLEAN TracePathRoute(BOOLEAN fCheckFlag, BOOLEAN fForceUpDate, PathStPtr pPath
|
||||
if(!fUTurnFlag)
|
||||
{
|
||||
BltVideoObject(FRAME_BUFFER, hMapHandle, (UINT16)iArrow, iArrowX, iArrowY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
InvalidateRegion( iArrowX, iArrowY, iArrowX + 2 * MAP_GRID_X, iArrowY + 2 * MAP_GRID_Y );
|
||||
InvalidateRegion( iArrowX, iArrowY, iArrowX + 2 * UI_MAP.GridSize.iX, iArrowY + 2 * UI_MAP.GridSize.iY );
|
||||
}
|
||||
|
||||
InvalidateRegion( iX, iY, iX + 2 * MAP_GRID_X, iY + 2 * MAP_GRID_Y );
|
||||
InvalidateRegion( iX, iY, iX + 2 * UI_MAP.GridSize.iX, iY + 2 * UI_MAP.GridSize.iY );
|
||||
|
||||
fUTurnFlag=FALSE;
|
||||
}
|
||||
@@ -3091,23 +3100,23 @@ BOOLEAN TraceCharAnimatedRoute( PathStPtr pPath, BOOLEAN fCheckFlag, BOOLEAN fFo
|
||||
iX = (pCurrentNode->uiSectorId % MAP_WORLD_X);
|
||||
iY = (pCurrentNode->uiSectorId / MAP_WORLD_X);
|
||||
|
||||
iX = (iX*MAP_GRID_X) + MAP_VIEW_START_X;
|
||||
iY = (iY*MAP_GRID_Y) + MAP_VIEW_START_Y;
|
||||
iX = (iX*UI_MAP.GridSize.iX) + UI_MAP.ViewRegion.x;
|
||||
iY = (iY*UI_MAP.GridSize.iY) + UI_MAP.ViewRegion.y;
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
if (isWidescreenUI() || iResolution >= _1024x768)
|
||||
{
|
||||
iArrowX = iX - 4;
|
||||
iArrowY = iY - 4;
|
||||
iArrowX = iX - 6;
|
||||
iArrowY = iY - 6;
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
else if (iResolution >= _800x600)
|
||||
{
|
||||
iArrowX = iX - 5;
|
||||
iArrowY = iY - 5;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
iArrowX = iX - 6;
|
||||
iArrowY = iY - 6;
|
||||
iArrowX = iX - 4;
|
||||
iArrowY = iY - 4;
|
||||
}
|
||||
|
||||
// Find the next node
|
||||
@@ -3313,21 +3322,21 @@ BOOLEAN IsTheCursorAllowedToHighLightThisSector( INT16 sSectorX, INT16 sSectorY
|
||||
void RestoreBackgroundForMapGrid( INT16 sMapX, INT16 sMapY )
|
||||
{
|
||||
// screen values
|
||||
INT16 sX = (sMapX * MAP_GRID_X) + MAP_VIEW_START_X;
|
||||
INT16 sY = (sMapY * MAP_GRID_Y) + MAP_VIEW_START_Y;
|
||||
INT16 sX = (sMapX * UI_MAP.GridSize.iX) + UI_MAP.ViewRegion.x;
|
||||
INT16 sY = (sMapY * UI_MAP.GridSize.iY) + UI_MAP.ViewRegion.y;
|
||||
|
||||
// restore background
|
||||
RestoreExternBackgroundRect( sX, sY ,DMAP_GRID_X ,DMAP_GRID_Y );
|
||||
RestoreExternBackgroundRect( sX, sY , UI_MAP.GridSize.iX + 1, UI_MAP.GridSize.iY + 1);
|
||||
}
|
||||
|
||||
|
||||
void ClipBlitsToMapViewRegion( void )
|
||||
{
|
||||
// the standard mapscreen rectangle doesn't work for clipping while zoomed...
|
||||
SGPRect ZoomedMapScreenClipRect={ MAP_VIEW_START_X + MAP_GRID_X,
|
||||
MAP_VIEW_START_Y + MAP_GRID_Y - 1,
|
||||
MAP_VIEW_START_X + MAP_VIEW_WIDTH + MAP_GRID_X,
|
||||
MAP_VIEW_START_Y + MAP_VIEW_HEIGHT + MAP_GRID_Y - 10 };
|
||||
SGPRect ZoomedMapScreenClipRect={ UI_MAP.ViewRegion.x + UI_MAP.GridSize.iX,
|
||||
UI_MAP.ViewRegion.y + UI_MAP.GridSize.iY - 1,
|
||||
UI_MAP.ViewRegion.x + UI_MAP.ViewRegion.width + UI_MAP.GridSize.iX,
|
||||
UI_MAP.ViewRegion.y + UI_MAP.ViewRegion.height + UI_MAP.GridSize.iY - 10 };
|
||||
SGPRect *pRectToUse;
|
||||
|
||||
pRectToUse = &MapScreenRect;
|
||||
@@ -3480,8 +3489,8 @@ void ShowPeopleInMotion( INT16 sX, INT16 sY )
|
||||
int tYD = sDest / MAP_WORLD_X;
|
||||
|
||||
// Find sector's top-left pixel on the screen.
|
||||
INT16 sSectorPosX = MAP_VIEW_START_X + (sX * MAP_GRID_X);
|
||||
INT16 sSectorPosY = MAP_VIEW_START_Y + (sY * MAP_GRID_Y);
|
||||
INT16 sSectorPosX = UI_MAP.ViewRegion.x + (sX * UI_MAP.GridSize.iX);
|
||||
INT16 sSectorPosY = UI_MAP.ViewRegion.y + (sY * UI_MAP.GridSize.iY);
|
||||
|
||||
// This is the sectorID in plain 0-256. Most of the functions will use this instead of sSource and sDest.
|
||||
INT16 sSourceSector = SECTOR( tXS, tYS );
|
||||
@@ -3591,7 +3600,7 @@ void ShowPeopleInMotion( INT16 sX, INT16 sY )
|
||||
if( !( iDirection % 2 ) )
|
||||
{
|
||||
// guys exiting north or south from this sector. Center the arrow.
|
||||
sOffsetX = (MAP_GRID_X / 2);
|
||||
sOffsetX = (UI_MAP.GridSize.iX / 2);
|
||||
|
||||
if( fEntering > 0 )
|
||||
{
|
||||
@@ -3621,14 +3630,14 @@ void ShowPeopleInMotion( INT16 sX, INT16 sY )
|
||||
else
|
||||
{
|
||||
// going south
|
||||
sOffsetY = MAP_GRID_Y;
|
||||
sOffsetY = UI_MAP.GridSize.iY;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// guys exiting east or west from this sector. Center the arrow.
|
||||
|
||||
sOffsetY = (MAP_GRID_Y / 2);
|
||||
sOffsetY = (UI_MAP.GridSize.iY / 2);
|
||||
|
||||
if( fEntering > 0 )
|
||||
{
|
||||
@@ -3653,7 +3662,7 @@ void ShowPeopleInMotion( INT16 sX, INT16 sY )
|
||||
if( iDirection == 1 )
|
||||
{
|
||||
// going east
|
||||
sOffsetX = MAP_GRID_X;
|
||||
sOffsetX = UI_MAP.GridSize.iX;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4031,7 +4040,7 @@ void ShowNonPlayerGroupsInMotion( INT16 sX, INT16 sY, UINT8 usTeam )
|
||||
if (sDeltaY < 0)
|
||||
{
|
||||
ubDirection = 0;
|
||||
sOffsetX = (MAP_GRID_X / 2);
|
||||
sOffsetX = (UI_MAP.GridSize.iX / 2);
|
||||
sOffsetY = 0;
|
||||
iconOffsetX = -(hIconHandle->pETRLEObject[ubDirection].usWidth / 2);
|
||||
iconOffsetY = -(hIconHandle->pETRLEObject[ubDirection].usHeight);
|
||||
@@ -4039,22 +4048,22 @@ void ShowNonPlayerGroupsInMotion( INT16 sX, INT16 sY, UINT8 usTeam )
|
||||
else if (sDeltaX > 0)
|
||||
{
|
||||
ubDirection = 1;
|
||||
sOffsetX = MAP_GRID_X;
|
||||
sOffsetY = (MAP_GRID_Y / 2);
|
||||
sOffsetX = UI_MAP.GridSize.iX;
|
||||
sOffsetY = (UI_MAP.GridSize.iY / 2);
|
||||
iconOffsetY = -(hIconHandle->pETRLEObject[ubDirection].usHeight / 2);
|
||||
}
|
||||
else if (sDeltaY > 0)
|
||||
{
|
||||
ubDirection = 2;
|
||||
sOffsetX = (MAP_GRID_X / 2);
|
||||
sOffsetY = MAP_GRID_Y;
|
||||
sOffsetX = (UI_MAP.GridSize.iX / 2);
|
||||
sOffsetY = UI_MAP.GridSize.iY;
|
||||
iconOffsetX = -(hIconHandle->pETRLEObject[ubDirection].usWidth / 2);
|
||||
}
|
||||
else if (sDeltaX < 0)
|
||||
{
|
||||
ubDirection = 3;
|
||||
sOffsetX = 0;
|
||||
sOffsetY = (MAP_GRID_Y / 2);
|
||||
sOffsetY = (UI_MAP.GridSize.iY / 2);
|
||||
iconOffsetX = -(hIconHandle->pETRLEObject[ubDirection].usWidth);
|
||||
iconOffsetY = -(hIconHandle->pETRLEObject[ubDirection].usHeight / 2);
|
||||
}
|
||||
@@ -4064,8 +4073,8 @@ void ShowNonPlayerGroupsInMotion( INT16 sX, INT16 sY, UINT8 usTeam )
|
||||
iconOffsetY -= 1;
|
||||
}
|
||||
|
||||
iX = MAP_VIEW_START_X+( sX * MAP_GRID_X ) + sOffsetX + iconOffsetX;
|
||||
iY = MAP_VIEW_START_Y + ( sY * MAP_GRID_Y ) + sOffsetY + iconOffsetY;
|
||||
iX = UI_MAP.ViewRegion.x+( sX * UI_MAP.GridSize.iX ) + sOffsetX + iconOffsetX;
|
||||
iY = UI_MAP.ViewRegion.y + ( sY * UI_MAP.GridSize.iY ) + sOffsetY + iconOffsetY;
|
||||
|
||||
// Flugente: depending on which team's direction we show there is an offset to the images
|
||||
// Note that we also need a x or y offset if multiple teamsare moving in the same sector, but currently that won't happen
|
||||
@@ -4143,7 +4152,7 @@ void ShowMilitiaInMotion( INT16 sX, INT16 sY )
|
||||
if ( StrategicMap[sector].usFlags & MILITIA_MOVE_NORTH )
|
||||
{
|
||||
ubDirection = 4;
|
||||
sOffsetX = (MAP_GRID_X / 2);
|
||||
sOffsetX = (UI_MAP.GridSize.iX / 2);
|
||||
sOffsetY = 0;
|
||||
iconOffsetX = -(hIconHandle->pETRLEObject[ubDirection].usWidth / 2);
|
||||
iconOffsetY = -(hIconHandle->pETRLEObject[ubDirection].usHeight);
|
||||
@@ -4151,22 +4160,22 @@ void ShowMilitiaInMotion( INT16 sX, INT16 sY )
|
||||
else if ( StrategicMap[sector].usFlags & MILITIA_MOVE_EAST )
|
||||
{
|
||||
ubDirection = 5;
|
||||
sOffsetX = MAP_GRID_X;
|
||||
sOffsetY = (MAP_GRID_Y / 2);
|
||||
sOffsetX = UI_MAP.GridSize.iX;
|
||||
sOffsetY = (UI_MAP.GridSize.iY / 2);
|
||||
iconOffsetY = -(hIconHandle->pETRLEObject[ubDirection].usHeight / 2);
|
||||
}
|
||||
else if ( StrategicMap[sector].usFlags & MILITIA_MOVE_SOUTH )
|
||||
{
|
||||
ubDirection = 6;
|
||||
sOffsetX = (MAP_GRID_X / 2);
|
||||
sOffsetY = MAP_GRID_Y;
|
||||
sOffsetX = (UI_MAP.GridSize.iX / 2);
|
||||
sOffsetY = UI_MAP.GridSize.iY;
|
||||
iconOffsetX = -(hIconHandle->pETRLEObject[ubDirection].usWidth / 2);
|
||||
}
|
||||
else if ( StrategicMap[sector].usFlags & MILITIA_MOVE_WEST )
|
||||
{
|
||||
ubDirection = 7;
|
||||
sOffsetX = 0;
|
||||
sOffsetY = (MAP_GRID_Y / 2);
|
||||
sOffsetY = (UI_MAP.GridSize.iY / 2);
|
||||
iconOffsetX = -(hIconHandle->pETRLEObject[ubDirection].usWidth);
|
||||
iconOffsetY = -(hIconHandle->pETRLEObject[ubDirection].usHeight / 2);
|
||||
}
|
||||
@@ -4176,8 +4185,8 @@ void ShowMilitiaInMotion( INT16 sX, INT16 sY )
|
||||
iconOffsetY -= 1;
|
||||
}
|
||||
|
||||
iX = MAP_VIEW_START_X+( sX * MAP_GRID_X ) + sOffsetX + iconOffsetX;
|
||||
iY = MAP_VIEW_START_Y + ( sY * MAP_GRID_Y ) + sOffsetY + iconOffsetY;
|
||||
iX = UI_MAP.ViewRegion.x+( sX * UI_MAP.GridSize.iX ) + sOffsetX + iconOffsetX;
|
||||
iY = UI_MAP.ViewRegion.y + ( sY * UI_MAP.GridSize.iY ) + sOffsetY + iconOffsetY;
|
||||
|
||||
BltVideoObject(guiSAVEBUFFER, hIconHandle, ubDirection , ( INT16 ) iX, ( INT16 ) iY , VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
@@ -4225,19 +4234,19 @@ void DisplayDistancesForHelicopter( void )
|
||||
|
||||
if ( GetMouseMapXY( &sMapX, &sMapY ) && ( sMapY >= 13 ) )
|
||||
{
|
||||
sYPosition = MAP_HELICOPTER_UPPER_ETA_POPUP_Y;
|
||||
sYPosition = UI_MAP.HeliETA.Upper_Popup_Y;
|
||||
}
|
||||
else
|
||||
{
|
||||
sYPosition = MAP_HELICOPTER_ETA_POPUP_Y;
|
||||
sYPosition = UI_MAP.HeliETA.PopupBox.y;
|
||||
}
|
||||
|
||||
if( ( sOldYPosition != 0 ) && ( sOldYPosition != sYPosition ) )
|
||||
{
|
||||
if( !gGameExternalOptions.fAlternativeHelicopterFuelSystem )
|
||||
RestoreExternBackgroundRect( MAP_HELICOPTER_ETA_POPUP_X, sOldYPosition, MAP_HELICOPTER_ETA_POPUP_WIDTH + 20, MAP_HELICOPTER_ETA_POPUP_HEIGHT );
|
||||
RestoreExternBackgroundRect(UI_MAP.HeliETA.PopupBox.x, sOldYPosition, UI_MAP.HeliETA.PopupBox.width + 20, UI_MAP.HeliETA.PopupBox.height);
|
||||
else
|
||||
RestoreExternBackgroundRect( MAP_HELICOPTER_ETA_POPUP_X, sOldYPosition, MAP_HELICOPTER_ETA_POPUP_WIDTH + 20, MAP_HELICOPTER_ETA_POPUP_ALTERNATE_HEIGHT );
|
||||
RestoreExternBackgroundRect(UI_MAP.HeliETA.PopupBox.x, sOldYPosition, UI_MAP.HeliETA .PopupBox.width + 20, UI_MAP.HeliETA.Alternate_Height);
|
||||
}
|
||||
|
||||
sOldYPosition = sYPosition;
|
||||
@@ -4249,14 +4258,16 @@ void DisplayDistancesForHelicopter( void )
|
||||
else
|
||||
GetVideoObject( &hHandle, guiMapBorderHeliSectors );
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
imageIndex = 0;
|
||||
else if (iResolution < _1024x768)
|
||||
if (isWidescreenUI() || iResolution >= _1024x768)
|
||||
{
|
||||
imageIndex = 2;
|
||||
}
|
||||
else if (iResolution >= _800x600)
|
||||
imageIndex = 1;
|
||||
else
|
||||
imageIndex = 2;
|
||||
imageIndex = 0;
|
||||
|
||||
BltVideoObject( FRAME_BUFFER, hHandle, imageIndex, MAP_HELICOPTER_ETA_POPUP_X, sYPosition, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
BltVideoObject( FRAME_BUFFER, hHandle, imageIndex, UI_MAP.HeliETA.PopupBox.x, sYPosition, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
sTotalCanTravel = ( INT16 )GetTotalDistanceHelicopterCanTravel( );
|
||||
sDistanceToGo = ( INT16 )DistanceOfIntendedHelicopterPath( );
|
||||
@@ -4280,7 +4291,7 @@ void DisplayDistancesForHelicopter( void )
|
||||
SetFontBackground( FONT_BLACK );
|
||||
|
||||
swprintf( sString, L"%s", pHelicopterEtaStrings[ STR_HELI_ETA_TOTAL_DISTANCE ] );
|
||||
mprintf( MAP_HELICOPTER_ETA_POPUP_X + 5, sYPosition + 5, sString );
|
||||
mprintf(UI_MAP.HeliETA.PopupBox.x + 5, sYPosition + 5, sString );
|
||||
|
||||
/*
|
||||
if ( IsSectorOutOfTheWay( sMapX, sMapY ) )
|
||||
@@ -4294,27 +4305,27 @@ void DisplayDistancesForHelicopter( void )
|
||||
}
|
||||
|
||||
swprintf( sString, L"%d", sTotalOfTrip );
|
||||
FindFontRightCoordinates( MAP_HELICOPTER_ETA_POPUP_X + 5, MAP_HELICOPTER_ETA_POPUP_Y + 5, MAP_HELICOPTER_ETA_POPUP_WIDTH, 0, sString, MAP_FONT, &sX, &sY );
|
||||
FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, UI_MAP.HeliETA.PopupBox.y + 5, UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY );
|
||||
mprintf( sX, sYPosition + 5, sString );
|
||||
|
||||
SetFontForeground( FONT_LTGREEN );
|
||||
|
||||
swprintf( sString, L"%s", pHelicopterEtaStrings[ STR_HELI_ETA_SAFE ] );
|
||||
mprintf( MAP_HELICOPTER_ETA_POPUP_X + 5, sYPosition + 5 + GetFontHeight( MAP_FONT ), sString );
|
||||
mprintf(UI_MAP.HeliETA.PopupBox.x + 5, sYPosition + 5 + GetFontHeight( MAP_FONT ), sString );
|
||||
|
||||
swprintf( sString, L"%d", sNumSafeSectors );
|
||||
FindFontRightCoordinates( MAP_HELICOPTER_ETA_POPUP_X + 5, ( INT16 ) ( MAP_HELICOPTER_ETA_POPUP_Y + 5 + 2 * GetFontHeight( MAP_FONT ) ), MAP_HELICOPTER_ETA_POPUP_WIDTH, 0, sString, MAP_FONT, &sX, &sY );
|
||||
FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, ( INT16 ) (UI_MAP.HeliETA.PopupBox.y + 5 + 2 * GetFontHeight( MAP_FONT ) ), UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY );
|
||||
mprintf( sX, ( INT16 ) ( sYPosition + 5 + GetFontHeight( MAP_FONT ) ), sString );
|
||||
|
||||
swprintf( sString, L"%s", pHelicopterEtaStrings[ STR_HELI_ETA_UNSAFE ] );
|
||||
mprintf( MAP_HELICOPTER_ETA_POPUP_X + 5, sYPosition + 5 + 2 * GetFontHeight( MAP_FONT ), sString );
|
||||
mprintf(UI_MAP.HeliETA.PopupBox.x + 5, sYPosition + 5 + 2 * GetFontHeight( MAP_FONT ), sString );
|
||||
|
||||
swprintf( sString, L"%d", sNumUnSafeSectors );
|
||||
FindFontRightCoordinates( MAP_HELICOPTER_ETA_POPUP_X + 5, ( INT16 ) ( MAP_HELICOPTER_ETA_POPUP_Y + 5 + 2 * GetFontHeight( MAP_FONT ) ), MAP_HELICOPTER_ETA_POPUP_WIDTH, 0, sString, MAP_FONT, &sX, &sY );
|
||||
FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, ( INT16 ) (UI_MAP.HeliETA.PopupBox.y + 5 + 2 * GetFontHeight( MAP_FONT ) ), UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY );
|
||||
mprintf( sX, ( INT16 ) ( sYPosition + 5 + 2 * GetFontHeight( MAP_FONT ) ), sString );
|
||||
|
||||
swprintf( sString, L"%s", pHelicopterEtaStrings[ STR_HELI_ETA_TOTAL_COST ] );
|
||||
mprintf( MAP_HELICOPTER_ETA_POPUP_X + 5, sYPosition + 5 + 3 * GetFontHeight( MAP_FONT ), sString );
|
||||
mprintf(UI_MAP.HeliETA.PopupBox.x + 5, sYPosition + 5 + 3 * GetFontHeight( MAP_FONT ), sString );
|
||||
|
||||
// calculate the cost of the trip based on the number of safe and unsafe sectors it will pass through
|
||||
// HEADROCK HAM 3.5: Externalized Base Cost. Also includes hourly-calculated facility modifier.
|
||||
@@ -4328,13 +4339,13 @@ void DisplayDistancesForHelicopter( void )
|
||||
swprintf( sString, L"%d", uiTripCost );
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
FindFontRightCoordinates( MAP_HELICOPTER_ETA_POPUP_X + 5, ( INT16 ) ( MAP_HELICOPTER_ETA_POPUP_Y + 5 + 3 * GetFontHeight( MAP_FONT ) ), MAP_HELICOPTER_ETA_POPUP_WIDTH, 0, sString, MAP_FONT, &sX, &sY );
|
||||
FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, ( INT16 ) (UI_MAP.HeliETA.PopupBox.y + 5 + 3 * GetFontHeight( MAP_FONT ) ), UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY );
|
||||
mprintf( sX, ( INT16 ) ( sYPosition + 5 + 3 * GetFontHeight( MAP_FONT ) ), sString );
|
||||
|
||||
SetFontForeground( FONT_LTGREEN );
|
||||
|
||||
swprintf( sString, L"%s", pHelicopterEtaStrings[ STR_HELI_ETA_ETA ] );
|
||||
mprintf( MAP_HELICOPTER_ETA_POPUP_X + 5, sYPosition + 5 + 4 * GetFontHeight( MAP_FONT ), sString );
|
||||
mprintf(UI_MAP.HeliETA.PopupBox.x + 5, sYPosition + 5 + 4 * GetFontHeight( MAP_FONT ), sString );
|
||||
|
||||
// get travel time for the last path segment
|
||||
iTime = GetPathTravelTimeDuringPlotting( pTempHelicopterPath );
|
||||
@@ -4343,38 +4354,38 @@ void DisplayDistancesForHelicopter( void )
|
||||
iTime += GetPathTravelTimeDuringPlotting( pVehicleList[ iHelicopterVehicleId ].pMercPath );
|
||||
|
||||
swprintf( sString, L"%d%s %d%s", iTime / 60, gsTimeStrings[0], iTime % 60, gsTimeStrings[1] );
|
||||
FindFontRightCoordinates( MAP_HELICOPTER_ETA_POPUP_X + 5, ( INT16 ) ( sYPosition + 5 + 4 * GetFontHeight( MAP_FONT ) ), MAP_HELICOPTER_ETA_POPUP_WIDTH, 0, sString, MAP_FONT, &sX, &sY );
|
||||
FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, ( INT16 ) ( sYPosition + 5 + 4 * GetFontHeight( MAP_FONT ) ), UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY );
|
||||
mprintf( sX, ( INT16 ) ( sYPosition + 5 + 4 * GetFontHeight( MAP_FONT ) ), sString );
|
||||
|
||||
|
||||
// show # of passengers aboard the chopper
|
||||
mprintf( MAP_HELICOPTER_ETA_POPUP_X + 5, sYPosition + 5 + 5 * GetFontHeight( MAP_FONT ), pHelicopterEtaStrings[ STR_HELI_ETA_PASSENGERS ] );
|
||||
mprintf(UI_MAP.HeliETA.PopupBox.x + 5, sYPosition + 5 + 5 * GetFontHeight( MAP_FONT ), pHelicopterEtaStrings[ STR_HELI_ETA_PASSENGERS ] );
|
||||
swprintf( sString, L"%d", GetNumberOfPassengersInHelicopter() );
|
||||
FindFontRightCoordinates( MAP_HELICOPTER_ETA_POPUP_X + 5, ( INT16 ) ( MAP_HELICOPTER_ETA_POPUP_Y + 5 + 5 * GetFontHeight( MAP_FONT ) ), MAP_HELICOPTER_ETA_POPUP_WIDTH, 0, sString, MAP_FONT, &sX, &sY );
|
||||
FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, ( INT16 ) (UI_MAP.HeliETA.PopupBox.y + 5 + 5 * GetFontHeight( MAP_FONT ) ), UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY );
|
||||
mprintf( sX, ( INT16 ) ( sYPosition + 5 + 5 * GetFontHeight( MAP_FONT ) ), sString );
|
||||
|
||||
// show remaining fuel
|
||||
mprintf( MAP_HELICOPTER_ETA_POPUP_X + 5, sYPosition + 5 + 6 * GetFontHeight( MAP_FONT ), pHelicopterEtaStrings[ STR_HELI_ETA_REMAINING_FUEL ] );
|
||||
mprintf(UI_MAP.HeliETA.PopupBox.x + 5, sYPosition + 5 + 6 * GetFontHeight( MAP_FONT ), pHelicopterEtaStrings[ STR_HELI_ETA_REMAINING_FUEL ] );
|
||||
swprintf( sString, L"%d", sRemainingFuel );
|
||||
FindFontRightCoordinates( MAP_HELICOPTER_ETA_POPUP_X + 5, ( INT16 ) ( MAP_HELICOPTER_ETA_POPUP_Y + 5 + 6 * GetFontHeight( MAP_FONT ) ), MAP_HELICOPTER_ETA_POPUP_WIDTH, 0, sString, MAP_FONT, &sX, &sY );
|
||||
FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, ( INT16 ) (UI_MAP.HeliETA.PopupBox.y + 5 + 6 * GetFontHeight( MAP_FONT ) ), UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY );
|
||||
if( sRemainingFuel < sDistToRefuelSite )
|
||||
SetFontForeground( FONT_LTRED );
|
||||
mprintf( sX, ( INT16 ) ( sYPosition + 5 + 6 * GetFontHeight( MAP_FONT ) ), sString );
|
||||
SetFontForeground( FONT_LTGREEN );
|
||||
|
||||
// show distance to the nearest refuel site
|
||||
mprintf( MAP_HELICOPTER_ETA_POPUP_X + 5, sYPosition + 5 + 7 * GetFontHeight( MAP_FONT ), pHelicopterEtaStrings[ STR_HELI_ETA_DISTANCE_TO_REFUEL_SITE ] );
|
||||
mprintf(UI_MAP.HeliETA.PopupBox.x + 5, sYPosition + 5 + 7 * GetFontHeight( MAP_FONT ), pHelicopterEtaStrings[ STR_HELI_ETA_DISTANCE_TO_REFUEL_SITE ] );
|
||||
swprintf( sString, L"%d", sDistToRefuelSite );
|
||||
FindFontRightCoordinates( MAP_HELICOPTER_ETA_POPUP_X + 5, ( INT16 ) ( MAP_HELICOPTER_ETA_POPUP_Y + 5 + 7 * GetFontHeight( MAP_FONT ) ), MAP_HELICOPTER_ETA_POPUP_WIDTH, 0, sString, MAP_FONT, &sX, &sY );
|
||||
FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, ( INT16 ) (UI_MAP.HeliETA.PopupBox.y + 5 + 7 * GetFontHeight( MAP_FONT ) ), UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY );
|
||||
if( sRemainingFuel < sDistToRefuelSite )
|
||||
SetFontForeground( FONT_LTRED );
|
||||
mprintf( sX, ( INT16 ) ( sYPosition + 5 + 7 * GetFontHeight( MAP_FONT ) ), sString );
|
||||
SetFontForeground( FONT_LTGREEN );
|
||||
|
||||
if( !gGameExternalOptions.fAlternativeHelicopterFuelSystem )
|
||||
InvalidateRegion( MAP_HELICOPTER_ETA_POPUP_X, sOldYPosition, MAP_HELICOPTER_ETA_POPUP_X + MAP_HELICOPTER_ETA_POPUP_WIDTH + 20, sOldYPosition + MAP_HELICOPTER_ETA_POPUP_HEIGHT );
|
||||
InvalidateRegion(UI_MAP.HeliETA.PopupBox.x, sOldYPosition, UI_MAP.HeliETA.PopupBox.x + UI_MAP.HeliETA.PopupBox.width + 20, sOldYPosition + UI_MAP.HeliETA.PopupBox.height);
|
||||
else
|
||||
InvalidateRegion( MAP_HELICOPTER_ETA_POPUP_X, sOldYPosition, MAP_HELICOPTER_ETA_POPUP_X + MAP_HELICOPTER_ETA_POPUP_WIDTH + 20, sOldYPosition + MAP_HELICOPTER_ETA_POPUP_ALTERNATE_HEIGHT );
|
||||
InvalidateRegion(UI_MAP.HeliETA.PopupBox.x, sOldYPosition, UI_MAP.HeliETA.PopupBox.x + UI_MAP.HeliETA.PopupBox.width + 20, sOldYPosition + UI_MAP.HeliETA.Alternate_Height);
|
||||
}
|
||||
|
||||
|
||||
@@ -4455,10 +4466,10 @@ void DisplayPositionOfHelicopter( void )
|
||||
}
|
||||
|
||||
// grab min and max locations to interpolate sub sector position
|
||||
minX = MAP_VIEW_START_X + MAP_GRID_X * ( pGroup->ubSectorX );
|
||||
maxX = MAP_VIEW_START_X + MAP_GRID_X * ( pGroup->ubNextX );
|
||||
minY = MAP_VIEW_START_Y + MAP_GRID_Y * ( pGroup->ubSectorY );
|
||||
maxY = MAP_VIEW_START_Y + MAP_GRID_Y * ( pGroup->ubNextY );
|
||||
minX = UI_MAP.ViewRegion.x + UI_MAP.GridSize.iX * ( pGroup->ubSectorX );
|
||||
maxX = UI_MAP.ViewRegion.x + UI_MAP.GridSize.iX * ( pGroup->ubNextX );
|
||||
minY = UI_MAP.ViewRegion.y + UI_MAP.GridSize.iY * ( pGroup->ubSectorY );
|
||||
maxY = UI_MAP.ViewRegion.y + UI_MAP.GridSize.iY * ( pGroup->ubNextY );
|
||||
|
||||
AssertMsg( ( minX >= 0 ) && ( minX < SCREEN_WIDTH ), String( "DisplayPositionOfHelicopter: Invalid minX = %d", minX ) );
|
||||
AssertMsg( ( maxX >= 0 ) && ( maxX < SCREEN_WIDTH ), String( "DisplayPositionOfHelicopter: Invalid maxX = %d", maxX ) );
|
||||
@@ -4501,7 +4512,7 @@ void DisplayPositionOfHelicopter( void )
|
||||
SetFontForeground( FONT_WHITE );
|
||||
SetFontBackground( FONT_BLACK );
|
||||
|
||||
mprintf( x + (MAP_GRID_X / 2) - 4, y + (MAP_GRID_Y / 2) - 4, sString );
|
||||
mprintf( x + (UI_MAP.GridSize.iX / 2) - 4, y + (UI_MAP.GridSize.iY / 2) - 4, sString );
|
||||
|
||||
InvalidateRegion( x, y, x + usIconWidth, y + usIconHeight );
|
||||
|
||||
@@ -4555,10 +4566,10 @@ void DisplayPositionOfEnemyHelicopter()
|
||||
UINT8 sector_y = SECTORY( sector );
|
||||
|
||||
// grab min and max locations to interpolate sub sector position
|
||||
minX = MAP_VIEW_START_X + MAP_GRID_X * (sector_x);
|
||||
maxX = MAP_VIEW_START_X + MAP_GRID_X * (sector_x);
|
||||
minY = MAP_VIEW_START_Y + MAP_GRID_Y * (sector_y);
|
||||
maxY = MAP_VIEW_START_Y + MAP_GRID_Y * (sector_y);
|
||||
minX = UI_MAP.ViewRegion.x + UI_MAP.GridSize.iX * (sector_x);
|
||||
maxX = UI_MAP.ViewRegion.x + UI_MAP.GridSize.iX * (sector_x);
|
||||
minY = UI_MAP.ViewRegion.y + UI_MAP.GridSize.iY * (sector_y);
|
||||
maxY = UI_MAP.ViewRegion.y + UI_MAP.GridSize.iY * (sector_y);
|
||||
|
||||
AssertMsg( (minX >= 0) && (minX < SCREEN_WIDTH), String( "DisplayPositionOfHelicopter: Invalid minX = %d", minX ) );
|
||||
AssertMsg( (maxX >= 0) && (maxX < SCREEN_WIDTH), String( "DisplayPositionOfHelicopter: Invalid maxX = %d", maxX ) );
|
||||
@@ -4611,8 +4622,8 @@ void DisplayDestinationOfHelicopter( void )
|
||||
sMapX = sSector % MAP_WORLD_X;
|
||||
sMapY = sSector / MAP_WORLD_X;
|
||||
|
||||
x = MAP_VIEW_START_X + ( MAP_GRID_X * sMapX ) + 1;
|
||||
y = MAP_VIEW_START_Y + ( MAP_GRID_Y * sMapY ) + 3;
|
||||
x = UI_MAP.ViewRegion.x + ( UI_MAP.GridSize.iX * sMapX ) + 1;
|
||||
y = UI_MAP.ViewRegion.y + ( UI_MAP.GridSize.iY * sMapY ) + 3;
|
||||
|
||||
AssertMsg( ( x >= 0 ) && ( x < (UINT32)SCREEN_WIDTH ), String( "DisplayDestinationOfHelicopter: Invalid x = %d. Dest %d,%d", x, sMapX, sMapY ) );
|
||||
AssertMsg( ( y >= 0 ) && ( y < (UINT32)SCREEN_HEIGHT ), String( "DisplayDestinationOfHelicopter: Invalid y = %d. Dest %d,%d", y, sMapX, sMapY ) );
|
||||
@@ -4626,8 +4637,8 @@ void DisplayDestinationOfHelicopter( void )
|
||||
|
||||
if (iResolution >= _800x600)
|
||||
{
|
||||
x = x + (MAP_GRID_X / 2) - 10;
|
||||
y = y + 1 + (MAP_GRID_Y / 2) - 10;
|
||||
x = x + (UI_MAP.GridSize.iX / 2) - 10;
|
||||
y = y + 1 + (UI_MAP.GridSize.iY / 2) - 10;
|
||||
}
|
||||
|
||||
InvalidateRegion( x, y, x + HELI_SHADOW_ICON_WIDTH, y + HELI_SHADOW_ICON_HEIGHT );
|
||||
@@ -4726,12 +4737,12 @@ void BlitMineIcon( INT16 sMapX, INT16 sMapY )
|
||||
GetVideoObject( &hHandle, guiMINEICON );
|
||||
|
||||
pDestBuf2 = LockVideoSurface( guiSAVEBUFFER, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, MAP_VIEW_START_X+MAP_GRID_X - 1, MAP_VIEW_START_Y+MAP_GRID_Y - 1, MAP_VIEW_WIDTH+1,MAP_VIEW_HEIGHT-9 );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, UI_MAP.ViewRegion.x+UI_MAP.GridSize.iX - 1, UI_MAP.ViewRegion.y+UI_MAP.GridSize.iY - 1, UI_MAP.ViewRegion.width+1,UI_MAP.ViewRegion.height-9 );
|
||||
UnLockVideoSurface(guiSAVEBUFFER);
|
||||
|
||||
GetScreenXYFromMapXY( ( INT16 )( sMapX ), ( INT16 )( sMapY ), &sScreenX, &sScreenY );
|
||||
// when not zoomed, the x,y returned is the top left CORNER of the map square in question
|
||||
BltVideoObject( guiSAVEBUFFER, hHandle, 1, sScreenX + MAP_GRID_X / 4, sScreenY + MAP_GRID_Y / 4, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
BltVideoObject( guiSAVEBUFFER, hHandle, 1, sScreenX + UI_MAP.GridSize.iX / 4, sScreenY + UI_MAP.GridSize.iY / 4, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
}
|
||||
|
||||
|
||||
@@ -4745,12 +4756,12 @@ void BlitMineText( INT16 sMapX, INT16 sMapY )
|
||||
GetScreenXYFromMapXY( ( INT16 )( sMapX ), ( INT16 )( sMapY ), &sScreenX, &sScreenY );
|
||||
|
||||
// set coordinates for start of mine text
|
||||
sScreenX += MAP_GRID_X / 2; // centered around middle of mine square
|
||||
sScreenY += MAP_GRID_Y + 1; // slightly below
|
||||
sScreenX += UI_MAP.GridSize.iX / 2; // centered around middle of mine square
|
||||
sScreenY += UI_MAP.GridSize.iY + 1; // slightly below
|
||||
|
||||
// show detailed mine info (name, production rate, daily production)
|
||||
|
||||
SetFontDestBuffer( guiSAVEBUFFER, MAP_VIEW_START_X, MAP_VIEW_START_Y, MAP_VIEW_START_X+MAP_VIEW_WIDTH+MAP_GRID_X, MAP_VIEW_START_Y+MAP_VIEW_HEIGHT+7, FALSE );
|
||||
SetFontDestBuffer( guiSAVEBUFFER, UI_MAP.ViewRegion.x, UI_MAP.ViewRegion.y, UI_MAP.ViewRegion.x+UI_MAP.ViewRegion.width+UI_MAP.GridSize.iX, UI_MAP.ViewRegion.y+UI_MAP.ViewRegion.height+7, FALSE );
|
||||
|
||||
// HEADROCK HAM 5: Variable Font
|
||||
INT32 MapMineLabelsFont;
|
||||
@@ -4851,7 +4862,7 @@ void BlitMineText( INT16 sMapX, INT16 sMapY )
|
||||
}
|
||||
}
|
||||
|
||||
SetFontDestBuffer( FRAME_BUFFER, MAP_VIEW_START_X, MAP_VIEW_START_Y, MAP_VIEW_START_X+MAP_VIEW_WIDTH+MAP_GRID_X, MAP_VIEW_START_Y+MAP_VIEW_HEIGHT+7, FALSE );
|
||||
SetFontDestBuffer( FRAME_BUFFER, UI_MAP.ViewRegion.x, UI_MAP.ViewRegion.y, UI_MAP.ViewRegion.x+UI_MAP.ViewRegion.width+UI_MAP.GridSize.iX, UI_MAP.ViewRegion.y+UI_MAP.ViewRegion.height+7, FALSE );
|
||||
}
|
||||
|
||||
|
||||
@@ -4861,7 +4872,7 @@ void AdjustXForLeftMapEdge(STR16 wString, INT16 *psX, INT32 iFont)
|
||||
INT16 sStartingX, sPastEdge;
|
||||
|
||||
sStartingX = *psX - (StringPixLengthArg( iFont, wcslen(wString), wString ) / 2);
|
||||
sPastEdge = (MAP_VIEW_START_X + 23) - sStartingX;
|
||||
sPastEdge = (UI_MAP.ViewRegion.x + 23) - sStartingX;
|
||||
|
||||
if (sPastEdge > 0)
|
||||
*psX += sPastEdge;
|
||||
@@ -4895,8 +4906,8 @@ void BlitTownGridMarkers( void )
|
||||
{
|
||||
// get location on screen
|
||||
GetScreenXYFromMapXY( ( INT16 )( pTownLocationsList[ iCounter ] % MAP_WORLD_X ), ( INT16 )( pTownLocationsList[ iCounter ] / MAP_WORLD_X ), &sScreenX, &sScreenY );
|
||||
sWidth = MAP_GRID_X - 1;
|
||||
sHeight= MAP_GRID_Y;
|
||||
sWidth = UI_MAP.GridSize.iX - 1;
|
||||
sHeight= UI_MAP.GridSize.iY;
|
||||
|
||||
sScreenX += 2;
|
||||
|
||||
@@ -4955,8 +4966,8 @@ void BlitMineGridMarkers( void )
|
||||
// get location on screen
|
||||
//GetScreenXYFromMapXY( ( INT16 )( gMineLocation[ iCounter ].sSectorX ), ( INT16 )( gMineLocation[ iCounter ].sSectorY ), &sScreenX, &sScreenY );
|
||||
GetScreenXYFromMapXY( ( INT16 )( gMineStatus[ iCounter ].sSectorX ), ( INT16 )( gMineStatus[ iCounter ].sSectorY ), &sScreenX, &sScreenY );
|
||||
sWidth = MAP_GRID_X;
|
||||
sHeight= MAP_GRID_Y;
|
||||
sWidth = UI_MAP.GridSize.iX;
|
||||
sHeight= UI_MAP.GridSize.iY;
|
||||
|
||||
// draw rectangle
|
||||
RectangleDraw( TRUE, sScreenX, sScreenY - 1, sScreenX + sWidth, sScreenY + sHeight - 1, usColor, pDestBuf );
|
||||
@@ -5025,14 +5036,14 @@ void DisplayLevelString( void )
|
||||
return;
|
||||
}
|
||||
|
||||
SetFontDestBuffer( guiSAVEBUFFER, xResOffset + MAP_VIEW_START_X, MAP_VIEW_START_Y, xResOffset + MAP_VIEW_START_X+MAP_VIEW_WIDTH+MAP_GRID_X, MAP_VIEW_START_Y+MAP_VIEW_HEIGHT+7, FALSE );
|
||||
SetFontDestBuffer( guiSAVEBUFFER, UI_MAP.ViewRegion.x, UI_MAP.ViewRegion.y, UI_MAP.ViewRegion.x+UI_MAP.ViewRegion.width+UI_MAP.GridSize.iX, UI_MAP.ViewRegion.y+UI_MAP.ViewRegion.height+7, FALSE );
|
||||
|
||||
SetFont( MAP_FONT );
|
||||
SetFontForeground( MAP_INDEX_COLOR );
|
||||
SetFontBackground( FONT_BLACK );
|
||||
swprintf( sString, L"%s %d", sMapLevelString[ 0 ], iCurrentMapSectorZ );
|
||||
|
||||
mprintf( MAP_LEVEL_STRING_X, MAP_LEVEL_STRING_Y, sString );
|
||||
mprintf(UI_MAP.LevelString.iX, UI_MAP.LevelString.iY, sString );
|
||||
|
||||
SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
|
||||
}
|
||||
@@ -6611,7 +6622,7 @@ BOOLEAN ShadeUndergroundMapElem( INT16 sSectorX, INT16 sSectorY )
|
||||
|
||||
sScreenX += 1;
|
||||
|
||||
ShadowVideoSurfaceRect( guiSAVEBUFFER, sScreenX, sScreenY, sScreenX + MAP_GRID_X - 2, sScreenY + MAP_GRID_Y - 2 );
|
||||
ShadowVideoSurfaceRect( guiSAVEBUFFER, sScreenX, sScreenY, sScreenX + UI_MAP.GridSize.iX - 2, sScreenY + UI_MAP.GridSize.iY - 2 );
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
@@ -6673,6 +6684,12 @@ void HandleLowerLevelMapBlit( void )
|
||||
offsetY = yVal;
|
||||
imageIndex = 0;
|
||||
}
|
||||
else if (iResolution == _1280x720)
|
||||
{
|
||||
offsetX = xVal + 21;
|
||||
offsetY = yVal + 17;
|
||||
imageIndex = 2;
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
{
|
||||
offsetX = xVal + 8;
|
||||
@@ -6687,7 +6704,7 @@ void HandleLowerLevelMapBlit( void )
|
||||
}
|
||||
|
||||
// handle the blt of the sublevel
|
||||
BltVideoObject( guiSAVEBUFFER, hHandle, imageIndex, MAP_VIEW_START_X + offsetX, MAP_VIEW_START_Y + offsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
BltVideoObject( guiSAVEBUFFER, hHandle, imageIndex, UI_MAP.ViewRegion.x + offsetX, UI_MAP.ViewRegion.y + offsetY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
// handle shading of sublevels
|
||||
ShadeSubLevelsNotVisited( );
|
||||
@@ -7138,8 +7155,8 @@ void ShowSAMSitesOnStrategicMap( void )
|
||||
MapSAMSiteFont = FONT14ARIAL;
|
||||
}
|
||||
|
||||
INT16 sLabelX = sX + (MAP_GRID_X / 2);
|
||||
INT16 sLabelY = sY + MAP_GRID_Y + 2;
|
||||
INT16 sLabelX = sX + (UI_MAP.GridSize.iX / 2);
|
||||
INT16 sLabelY = sY + UI_MAP.GridSize.iY + 2;
|
||||
|
||||
wcscpy( wString, pLandTypeStrings[ SAM_SITE ] );
|
||||
|
||||
@@ -7147,8 +7164,8 @@ void ShowSAMSitesOnStrategicMap( void )
|
||||
sLabelX -= StringPixLength( wString, MapSAMSiteFont) / 2;
|
||||
|
||||
// if within view region...render, else don't
|
||||
if( ( sLabelX > MAP_VIEW_START_X + MAP_VIEW_WIDTH ) || ( sLabelX < MAP_VIEW_START_X ) ||
|
||||
( sLabelY > MAP_VIEW_START_Y + MAP_VIEW_HEIGHT ) || ( sLabelY < MAP_VIEW_START_Y ) )
|
||||
if( ( sLabelX > UI_MAP.ViewRegion.x + UI_MAP.ViewRegion.width ) || ( sLabelX < UI_MAP.ViewRegion.x ) ||
|
||||
( sLabelY > UI_MAP.ViewRegion.y + UI_MAP.ViewRegion.height ) || ( sLabelY < UI_MAP.ViewRegion.y ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -7206,17 +7223,17 @@ void ShowSAMSitesOnStrategicMap( void )
|
||||
MapHeliSiteFont = FONT14ARIAL;
|
||||
}
|
||||
|
||||
INT16 sLabelX = sX + (MAP_GRID_X / 2);
|
||||
INT16 sLabelX = sX + (UI_MAP.GridSize.iX / 2);
|
||||
INT16 sLabelY;
|
||||
if ( IsThisSectorASAMSector( sSectorX, sSectorY, 0 ) )
|
||||
{
|
||||
if (iResolution <= _800x600 )
|
||||
sLabelY = sY + MAP_GRID_Y + 10;
|
||||
sLabelY = sY + UI_MAP.GridSize.iY + 10;
|
||||
else
|
||||
sLabelY = sY + MAP_GRID_Y + 16;
|
||||
sLabelY = sY + UI_MAP.GridSize.iY + 16;
|
||||
}
|
||||
else
|
||||
sLabelY = sY + MAP_GRID_Y + 2;
|
||||
sLabelY = sY + UI_MAP.GridSize.iY + 2;
|
||||
|
||||
wcscpy( wString, pLandTypeStrings[ REFUEL_SITE ] );
|
||||
|
||||
@@ -7224,8 +7241,8 @@ void ShowSAMSitesOnStrategicMap( void )
|
||||
sLabelX -= StringPixLength( wString, MapHeliSiteFont) / 2;
|
||||
|
||||
// if within view region...render, else don't
|
||||
if( ( sLabelX > MAP_VIEW_START_X + MAP_VIEW_WIDTH ) || ( sLabelX < MAP_VIEW_START_X ) ||
|
||||
( sLabelY > MAP_VIEW_START_Y + MAP_VIEW_HEIGHT ) || ( sLabelY < MAP_VIEW_START_Y ) )
|
||||
if( ( sLabelX > UI_MAP.ViewRegion.x + UI_MAP.ViewRegion.width ) || ( sLabelX < UI_MAP.ViewRegion.x ) ||
|
||||
( sLabelY > UI_MAP.ViewRegion.y + UI_MAP.ViewRegion.height ) || ( sLabelY < UI_MAP.ViewRegion.y ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -7284,8 +7301,8 @@ void BlitSAMGridMarkers( void )
|
||||
|
||||
// get location on screen
|
||||
GetScreenXYFromMapXY( gpSamSectorX[ iCounter ], gpSamSectorY[ iCounter ], &sScreenX, &sScreenY );
|
||||
sWidth = MAP_GRID_X;
|
||||
sHeight= MAP_GRID_Y;
|
||||
sWidth = UI_MAP.GridSize.iX;
|
||||
sHeight= UI_MAP.GridSize.iY;
|
||||
|
||||
// draw rectangle
|
||||
RectangleDraw( TRUE, sScreenX, sScreenY - 1, sScreenX + sWidth, sScreenY + sHeight - 1, usColor, pDestBuf );
|
||||
@@ -7302,8 +7319,8 @@ void BlitSAMGridMarkers( void )
|
||||
|
||||
// get location on screen
|
||||
GetScreenXYFromMapXY( sRefuelSectorX[ iCounter ], sRefuelSectorY[ iCounter ], &sScreenX, &sScreenY );
|
||||
sWidth = MAP_GRID_X;
|
||||
sHeight= MAP_GRID_Y;
|
||||
sWidth = UI_MAP.GridSize.iX;
|
||||
sHeight= UI_MAP.GridSize.iY;
|
||||
|
||||
// draw rectangle
|
||||
RectangleDraw( TRUE, sScreenX, sScreenY - 1, sScreenX + sWidth, sScreenY + sHeight - 1, usColor, pDestBuf );
|
||||
@@ -7416,8 +7433,8 @@ void ShowDiseaseOnMap()
|
||||
|
||||
if ( pSectorInfo && ((pSectorInfo->usInfectionFlag & SECTORDISEASE_DIAGNOSED_PLAYER) || gubFact[FACT_DISEASE_WHODATA_ACCESS] ) )
|
||||
{
|
||||
sXCorner = (INT16)( MAP_VIEW_START_X + ( sMapX * MAP_GRID_X ) );
|
||||
sYCorner = (INT16)( MAP_VIEW_START_Y + ( sMapY * MAP_GRID_Y ) );
|
||||
sXCorner = (INT16)( UI_MAP.ViewRegion.x + ( sMapX * UI_MAP.GridSize.iX ) );
|
||||
sYCorner = (INT16)( UI_MAP.ViewRegion.y + ( sMapY * UI_MAP.GridSize.iY ) );
|
||||
|
||||
if ( pSectorInfo->usNumCorpses > 0 )
|
||||
{
|
||||
@@ -7425,7 +7442,7 @@ void ShowDiseaseOnMap()
|
||||
|
||||
swprintf( sString, L"%d", pSectorInfo->usNumCorpses );
|
||||
|
||||
FindFontCenterCoordinates( sXCorner, sYCorner, MAP_GRID_X, MAP_GRID_Y, sString, MapItemsFont, &usXPos, &usYPos );
|
||||
FindFontCenterCoordinates( sXCorner, sYCorner, UI_MAP.GridSize.iX, UI_MAP.GridSize.iY, sString, MapItemsFont, &usXPos, &usYPos );
|
||||
|
||||
mprintf( usXPos, usYPos, sString );
|
||||
}
|
||||
@@ -7439,7 +7456,7 @@ void ShowDiseaseOnMap()
|
||||
|
||||
sYCorner += GetFontHeight( MapItemsFont );
|
||||
|
||||
FindFontCenterCoordinates( sXCorner, sYCorner, MAP_GRID_X, MAP_GRID_Y, sString, MapItemsFont, &usXPos, &usYPos );
|
||||
FindFontCenterCoordinates( sXCorner, sYCorner, UI_MAP.GridSize.iX, UI_MAP.GridSize.iY, sString, MapItemsFont, &usXPos, &usYPos );
|
||||
|
||||
mprintf( usXPos, usYPos, sString );
|
||||
}
|
||||
@@ -7492,12 +7509,12 @@ void ShowItemsOnMap( void )
|
||||
|
||||
if ( uiItemCnt > 0 )
|
||||
{
|
||||
sXCorner = ( INT16 )( MAP_VIEW_START_X + ( sMapX * MAP_GRID_X ) );
|
||||
sYCorner = ( INT16 )( MAP_VIEW_START_Y + ( sMapY * MAP_GRID_Y ) );
|
||||
sXCorner = ( INT16 )( UI_MAP.ViewRegion.x + ( sMapX * UI_MAP.GridSize.iX ) );
|
||||
sYCorner = ( INT16 )( UI_MAP.ViewRegion.y + ( sMapY * UI_MAP.GridSize.iY ) );
|
||||
|
||||
swprintf( sString, L"%d", uiItemCnt );
|
||||
|
||||
FindFontCenterCoordinates( sXCorner, sYCorner, MAP_GRID_X, MAP_GRID_Y, sString, MapItemsFont, &usXPos, &usYPos );
|
||||
FindFontCenterCoordinates( sXCorner, sYCorner, UI_MAP.GridSize.iX, UI_MAP.GridSize.iY, sString, MapItemsFont, &usXPos, &usYPos );
|
||||
// sXPos -= StringPixLength( sString, MAP_FONT ) / 2;
|
||||
|
||||
gprintfdirty( usXPos, usYPos, sString );
|
||||
@@ -7527,27 +7544,27 @@ void DrawMapBoxIcon( HVOBJECT hIconHandle, UINT16 usVOIndex, INT16 sMapX, INT16
|
||||
return;
|
||||
}
|
||||
|
||||
if (iResolution >= _640x480 && iResolution < _800x600)
|
||||
if (isWidescreenUI() || iResolution >= _1024x768)
|
||||
{
|
||||
iconSize = 3;
|
||||
iconSize = 6;
|
||||
}
|
||||
else if (iResolution < _1024x768)
|
||||
else if (iResolution >= _800x600)
|
||||
{
|
||||
iconSize = 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
iconSize = 6;
|
||||
iconSize = 3;
|
||||
}
|
||||
|
||||
iColumnNumber = ubIconPosition % MERC_ICONS_PER_LINE;
|
||||
iRowNumber = ubIconPosition / MERC_ICONS_PER_LINE;
|
||||
|
||||
iX = MAP_VIEW_START_X + ( sMapX * MAP_GRID_X ) + iconOffsetX + ( iconSize * iColumnNumber );
|
||||
iY = MAP_VIEW_START_Y + ( sMapY * MAP_GRID_Y ) + iconOffsetY + ( iconSize * iRowNumber );
|
||||
iX = UI_MAP.ViewRegion.x + ( sMapX * UI_MAP.GridSize.iX ) + iconOffsetX + ( iconSize * iColumnNumber );
|
||||
iY = UI_MAP.ViewRegion.y + ( sMapY * UI_MAP.GridSize.iY ) + iconOffsetY + ( iconSize * iRowNumber );
|
||||
|
||||
BltVideoObject( guiSAVEBUFFER, hIconHandle, usVOIndex , iX, iY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
InvalidateRegion( iX, iY, iX + DMAP_GRID_X, iY + DMAP_GRID_Y );
|
||||
InvalidateRegion( iX, iY, iX + UI_MAP.GridSize.iX + 1, iY + UI_MAP.GridSize.iY + 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -7599,8 +7616,8 @@ void DrawBullseye()
|
||||
|
||||
if (iResolution >= _800x600)
|
||||
{
|
||||
sX = sX + MAP_GRID_X / 2 - 10;
|
||||
sY = sY + 1 + MAP_GRID_Y / 2 - 10;
|
||||
sX = sX + UI_MAP.GridSize.iX / 2 - 10;
|
||||
sY = sY + 1 + UI_MAP.GridSize.iY / 2 - 10;
|
||||
}
|
||||
|
||||
BltVideoObject( guiSAVEBUFFER, hHandle, 0, sX, sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
@@ -7616,7 +7633,7 @@ void HideExistenceOfUndergroundMapSector( UINT8 ubSectorX, UINT8 ubSectorY )
|
||||
GetScreenXYFromMapXY( ubSectorX, ubSectorY, &sScreenX, &sScreenY );
|
||||
|
||||
// fill it with near black
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, sScreenX + 1, sScreenY, sScreenX + MAP_GRID_X, sScreenY + MAP_GRID_Y - 1, gusUndergroundNearBlack );
|
||||
ColorFillVideoSurfaceArea( guiSAVEBUFFER, sScreenX + 1, sScreenY, sScreenX + UI_MAP.GridSize.iX, sScreenY + UI_MAP.GridSize.iY - 1, gusUndergroundNearBlack );
|
||||
}
|
||||
|
||||
|
||||
@@ -8686,8 +8703,8 @@ void ShowIntelOnMap()
|
||||
UINT8 sector_y = SECTORY( sector );
|
||||
|
||||
// grab min and max locations to interpolate sub sector position
|
||||
x0 = MAP_VIEW_START_X + MAP_GRID_X * ( sector_x );
|
||||
y0 = MAP_VIEW_START_Y + MAP_GRID_Y * ( sector_y );
|
||||
x0 = UI_MAP.ViewRegion.x + UI_MAP.GridSize.iX * ( sector_x );
|
||||
y0 = UI_MAP.ViewRegion.y + UI_MAP.GridSize.iY * ( sector_y );
|
||||
|
||||
AssertMsg( ( x0 >= 0 ) && ( x0 < SCREEN_WIDTH ), String( "ShowIntelOnMap: Invalid minX = %d", x0 ) );
|
||||
AssertMsg( ( y0 >= 0 ) && ( y0 < SCREEN_HEIGHT ), String( "ShowIntelOnMap: Invalid minY = %d", y0 ) );
|
||||
@@ -8714,7 +8731,7 @@ void ShowIntelOnMap()
|
||||
// restore clip blits
|
||||
RestoreClipRegionToFullScreen();
|
||||
|
||||
FindFontCenterCoordinates( x0, y0, MAP_GRID_X, MAP_GRID_Y, gMapIntelData[sector].shorttext, MapItemsFont, &usXPos, &usYPos );
|
||||
FindFontCenterCoordinates( x0, y0, UI_MAP.GridSize.iX, UI_MAP.GridSize.iY, gMapIntelData[sector].shorttext, MapItemsFont, &usXPos, &usYPos );
|
||||
|
||||
mprintf( usXPos, usYPos, gMapIntelData[sector].shorttext );
|
||||
}
|
||||
|
||||
@@ -305,20 +305,9 @@ extern UINT16 MAP_LEVEL_STRING_X;
|
||||
extern UINT16 MAP_LEVEL_STRING_Y;
|
||||
|
||||
|
||||
// zoomed in grid sizes
|
||||
#define MAP_GRID_ZOOM_X MAP_GRID_X*2
|
||||
#define MAP_GRID_ZOOM_Y MAP_GRID_Y*2
|
||||
|
||||
// number of units wide
|
||||
#define WORLD_MAP_X 18 // WANNE: 18 darf nicht geändert werden!
|
||||
|
||||
// dirty regions for the map
|
||||
#define DMAP_GRID_X ( MAP_GRID_X + 1 )
|
||||
#define DMAP_GRID_Y ( MAP_GRID_Y + 1 )
|
||||
#define DMAP_GRID_ZOOM_X ( MAP_GRID_ZOOM_X+1)
|
||||
#define DMAP_GRID_ZOOM_Y ( MAP_GRID_ZOOM_Y+1)
|
||||
|
||||
|
||||
// Orta position on the map
|
||||
#define ORTA_SECTOR_X 4
|
||||
#define ORTA_SECTOR_Y 11
|
||||
|
||||
@@ -63,6 +63,11 @@
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
extern int CHAR_BAR_INFO_X;
|
||||
extern int CHAR_BAR_INFO_Y;
|
||||
extern UILayout_Map UI_MAP;
|
||||
extern UILayout_CharPanelIconRegion UI_CHAR_Icon;
|
||||
extern UILayout_CharList UI_CHARLIST;
|
||||
|
||||
// marke strogg more mercs
|
||||
extern UINT8 FIRSTmercTOdisplay = 0 ;
|
||||
@@ -870,7 +875,7 @@ void RestoreBackgroundForAssignmentGlowRegionList( void )
|
||||
INT16 yHeight = GetRefreshHeightForMercList();
|
||||
|
||||
// restore background
|
||||
RestoreExternBackgroundRect( 66 + xResOffset, Y_START - 1, 118 + 1 - 67, yHeight );
|
||||
RestoreExternBackgroundRect(UI_CHARLIST.xAssignment, UI_CHARLIST.y - 1, UI_CHARLIST.widthAssignment + 1, yHeight);
|
||||
|
||||
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
|
||||
fTeamPanelDirty = TRUE;
|
||||
@@ -897,7 +902,7 @@ void RestoreBackgroundForDestinationGlowRegionList( void )
|
||||
INT16 yHeight = GetRefreshHeightForMercList();
|
||||
|
||||
// restore background
|
||||
RestoreExternBackgroundRect( 182 + xResOffset, Y_START - 1, 217 + 1 - 182, yHeight );
|
||||
RestoreExternBackgroundRect(UI_CHARLIST.xETA, UI_CHARLIST.y - 1, UI_CHARLIST.widthETA + 1, yHeight );
|
||||
|
||||
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
|
||||
fTeamPanelDirty = TRUE;
|
||||
@@ -927,7 +932,7 @@ void RestoreBackgroundForContractGlowRegionList( void )
|
||||
INT16 yHeight = GetRefreshHeightForMercList();
|
||||
|
||||
// restore background
|
||||
RestoreExternBackgroundRect( 222 + xResOffset, Y_START - 1, 250 + 1 - 222, yHeight ) ;
|
||||
RestoreExternBackgroundRect(UI_CHARLIST.xTimeRemaining, UI_CHARLIST.y - 1, UI_CHARLIST.widthTimeRemaining + 1, yHeight ) ;
|
||||
|
||||
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
|
||||
fTeamPanelDirty = TRUE;
|
||||
@@ -961,7 +966,7 @@ void RestoreBackgroundForSleepGlowRegionList( void )
|
||||
INT16 yHeight = GetRefreshHeightForMercList();
|
||||
|
||||
// restore background
|
||||
RestoreExternBackgroundRect( 123 + xResOffset, Y_START - 1, 142 + 1 - 123, yHeight ) ;
|
||||
RestoreExternBackgroundRect(UI_CHARLIST.xSleep, UI_CHARLIST.y - 1, UI_CHARLIST.widthSleep + 1, yHeight ) ;
|
||||
|
||||
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
|
||||
fTeamPanelDirty = TRUE;
|
||||
@@ -1351,7 +1356,7 @@ void HandleDisplayOfSelectedMercArrows( void )
|
||||
HVOBJECT hHandle;
|
||||
UINT8 ubCount = 0;
|
||||
|
||||
UINT16 selectedCharArrowX = xResOffset + 1;
|
||||
UINT16 selectedCharArrowX = UI_CHARLIST.Region.x + 1;
|
||||
|
||||
// blit an arrow by the name of each merc in a selected list
|
||||
if( bSelectedInfoChar == -1 )
|
||||
@@ -1377,7 +1382,8 @@ void HandleDisplayOfSelectedMercArrows( void )
|
||||
|
||||
// now blit one by the selected merc
|
||||
// marke strogg more mercs
|
||||
sYPosition = Y_START+( ( bSelectedInfoChar - FIRSTmercTOdisplay ) * ( Y_SIZE + 2 ) ) - 1;
|
||||
const auto y = UI_CHARLIST.y;
|
||||
sYPosition = y + ( ( bSelectedInfoChar - FIRSTmercTOdisplay ) * ( Y_SIZE + 2 ) ) - 1;
|
||||
|
||||
GetVideoObject( &hHandle, guiSelectedCharArrow );
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0,selectedCharArrowX, sYPosition , VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
@@ -1393,7 +1399,7 @@ void HandleDisplayOfSelectedMercArrows( void )
|
||||
// are they in the selected list or int he same mvt group as this guy
|
||||
if( ( IsEntryInSelectedListSet( ubCount + FIRSTmercTOdisplay ) == TRUE ) || ( ( GetSelectedDestChar() != - 1 ) ? ( ( Menptr[ gCharactersList[ ubCount + FIRSTmercTOdisplay ].usSolID ].ubGroupID != 0 ) ? ( Menptr[ gCharactersList[GetSelectedDestChar()].usSolID ].ubGroupID == Menptr[ gCharactersList[ ubCount + FIRSTmercTOdisplay ].usSolID ].ubGroupID ) : FALSE ) : FALSE ) )
|
||||
{
|
||||
sYPosition = Y_START+( ubCount * ( Y_SIZE + 2) ) - 1;
|
||||
sYPosition = y + ( ubCount * ( Y_SIZE + 2) ) - 1;
|
||||
|
||||
GetVideoObject( &hHandle, guiSelectedCharArrow );
|
||||
BltVideoObject( guiSAVEBUFFER , hHandle, 0,selectedCharArrowX, sYPosition , VO_BLT_SRCTRANSPARENCY,NULL );
|
||||
@@ -1886,8 +1892,13 @@ void HandleGroupAboutToArrive( void )
|
||||
|
||||
void CreateMapStatusBarsRegion( void )
|
||||
{
|
||||
MSYS_DefineRegion( &gMapStatusBarsRegion, BAR_INFO_X + xResOffset - 3, BAR_INFO_Y + yResOffset - 42,(INT16)( BAR_INFO_X + xResOffset + 17), (INT16)(BAR_INFO_Y + yResOffset), MSYS_PRIORITY_HIGH + 5,
|
||||
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
|
||||
MSYS_DefineRegion( &gMapStatusBarsRegion,
|
||||
CHAR_BAR_INFO_X - 3,
|
||||
CHAR_BAR_INFO_Y - 42,
|
||||
CHAR_BAR_INFO_X + 17,
|
||||
CHAR_BAR_INFO_Y,
|
||||
MSYS_PRIORITY_HIGH + 5, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK)
|
||||
;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -2159,7 +2170,7 @@ void UpdateMapScreenAssignmentPositions( void )
|
||||
else
|
||||
{
|
||||
// marke strogg more mercs
|
||||
giBoxY = ( Y_START + ( bSelectedAssignChar - FIRSTmercTOdisplay ) * ( Y_SIZE + 2 ) );
|
||||
giBoxY = (UI_CHARLIST.y + ( bSelectedAssignChar - FIRSTmercTOdisplay ) * ( Y_SIZE + 2 ) );
|
||||
}
|
||||
|
||||
AssignmentPosition.iY = giBoxY;
|
||||
@@ -2319,7 +2330,7 @@ void UpdateMapScreenMilitiaControlPositions( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
giBoxY = ( Y_START + ( bSelectedAssignChar ) * ( Y_SIZE + 2 ) );
|
||||
giBoxY = (UI_CHARLIST.y + ( bSelectedAssignChar ) * ( Y_SIZE + 2 ) );
|
||||
}
|
||||
|
||||
MilitiaControlPosition.iY = giBoxY;
|
||||
@@ -3730,7 +3741,7 @@ void SetUpMovingListsForSector( INT16 sSectorX, INT16 sSectorY, INT16 sSectorZ )
|
||||
|
||||
void CreatePopUpBoxForMovementBox( void )
|
||||
{
|
||||
SGPPoint MovePosition = {450 + xResOffset, 100 + yResOffset};
|
||||
SGPPoint MovePosition = { UI_MAP.ViewRegion.x + UI_MAP.ViewRegion.width / 2, UI_MAP.ViewRegion.y + 100 };
|
||||
SGPPoint Position;
|
||||
SGPRect Dimensions;
|
||||
|
||||
@@ -3795,15 +3806,15 @@ void CreatePopUpBoxForMovementBox( void )
|
||||
GetBoxSize( ghMoveBox, &Dimensions );
|
||||
|
||||
// adjust position to try to keep it in the map area as best as possible
|
||||
if ( Position.iX + Dimensions.iRight >= ( MAP_VIEW_START_X + MAP_VIEW_WIDTH ) )
|
||||
if ( Position.iX + Dimensions.iRight >= (UI_MAP.ViewRegion.x + UI_MAP.ViewRegion.width) )
|
||||
{
|
||||
Position.iX = max( MAP_VIEW_START_X, ( MAP_VIEW_START_X + MAP_VIEW_WIDTH ) - Dimensions.iRight );
|
||||
Position.iX = max(UI_MAP.ViewRegion.x, (UI_MAP.ViewRegion.x + UI_MAP.ViewRegion.width) - Dimensions.iRight );
|
||||
SetBoxPosition( ghMoveBox, Position );
|
||||
}
|
||||
|
||||
if ( Position.iY + Dimensions.iBottom >= ( MAP_VIEW_START_Y + MAP_VIEW_HEIGHT ) )
|
||||
if ( Position.iY + Dimensions.iBottom >= (UI_MAP.ViewRegion.y + UI_MAP.ViewRegion.height) )
|
||||
{
|
||||
Position.iY = max( MAP_VIEW_START_Y, ( MAP_VIEW_START_Y + MAP_VIEW_HEIGHT ) - Dimensions.iBottom );
|
||||
Position.iY = max( UI_MAP.ViewRegion.y, (UI_MAP.ViewRegion.y + UI_MAP.ViewRegion.height) - Dimensions.iBottom );
|
||||
SetBoxPosition( ghMoveBox, Position );
|
||||
}
|
||||
}
|
||||
@@ -5643,14 +5654,26 @@ void CreateDestroyInsuranceMouseRegionForMercs( BOOLEAN fCreate )
|
||||
|
||||
if( ( fCreated == FALSE ) && ( fCreate == TRUE ) )
|
||||
{
|
||||
MSYS_DefineRegion( &gContractIconRegion, CHAR_ICON_X + xResOffset, CHAR_ICON_CONTRACT_Y + yResOffset, CHAR_ICON_X + xResOffset + CHAR_ICON_WIDTH, CHAR_ICON_CONTRACT_Y + yResOffset + CHAR_ICON_HEIGHT,
|
||||
MSYS_PRIORITY_HIGH - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
|
||||
const auto x = UI_CHAR_Icon.x;
|
||||
const auto y = UI_CHAR_Icon.y;
|
||||
const auto width = UI_CHAR_Icon.width;
|
||||
const auto height = UI_CHAR_Icon.height;
|
||||
const auto spacing = UI_CHAR_Icon.spacing;
|
||||
|
||||
MSYS_DefineRegion( &gInsuranceIconRegion, CHAR_ICON_X + xResOffset, CHAR_ICON_CONTRACT_Y + CHAR_ICON_SPACING + yResOffset, CHAR_ICON_X + xResOffset + CHAR_ICON_WIDTH, CHAR_ICON_CONTRACT_Y + CHAR_ICON_SPACING + yResOffset + CHAR_ICON_HEIGHT,
|
||||
MSYS_PRIORITY_HIGH - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
|
||||
MSYS_DefineRegion( &gContractIconRegion,
|
||||
x, y, x + width, y + height,
|
||||
MSYS_PRIORITY_HIGH - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK
|
||||
);
|
||||
|
||||
MSYS_DefineRegion( &gDepositIconRegion, CHAR_ICON_X + xResOffset, CHAR_ICON_CONTRACT_Y + ( 2 * CHAR_ICON_SPACING ) + yResOffset, CHAR_ICON_X + xResOffset + CHAR_ICON_WIDTH, CHAR_ICON_CONTRACT_Y + ( 2 * CHAR_ICON_SPACING ) + yResOffset + CHAR_ICON_HEIGHT,
|
||||
MSYS_PRIORITY_HIGH - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
|
||||
MSYS_DefineRegion( &gInsuranceIconRegion,
|
||||
x, y + spacing, x + width, y + height + spacing,
|
||||
MSYS_PRIORITY_HIGH - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK
|
||||
);
|
||||
|
||||
MSYS_DefineRegion( &gDepositIconRegion,
|
||||
x, y + ( 2 * spacing), x + width, y + ( 2 * spacing) + height,
|
||||
MSYS_PRIORITY_HIGH - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK
|
||||
);
|
||||
|
||||
fCreated = TRUE;
|
||||
}
|
||||
@@ -6708,14 +6731,14 @@ void HandleBlitOfSectorLocatorIcon( INT16 sSectorX, INT16 sSectorY, INT16 sSecto
|
||||
//Convert the sector value into screen values.
|
||||
GetScreenXYFromMapXY( sSectorX, sSectorY, &sScreenX, &sScreenY );
|
||||
// make sure we are on the border
|
||||
if( sScreenX < MAP_GRID_X )
|
||||
if( sScreenX < UI_MAP.GridSize.iX)
|
||||
{
|
||||
sScreenX = MAP_GRID_X;
|
||||
sScreenX = UI_MAP.GridSize.iX;
|
||||
}
|
||||
sScreenY--; //Carterism ritual
|
||||
if( sScreenY < MAP_GRID_Y )
|
||||
if( sScreenY < UI_MAP.GridSize.iY )
|
||||
{
|
||||
sScreenY = MAP_GRID_Y;
|
||||
sScreenY = UI_MAP.GridSize.iY;
|
||||
}
|
||||
|
||||
uiTimer = GetJA2Clock();
|
||||
@@ -6738,13 +6761,13 @@ void HandleBlitOfSectorLocatorIcon( INT16 sSectorX, INT16 sSectorY, INT16 sSecto
|
||||
}
|
||||
}
|
||||
|
||||
RestoreExternBackgroundRect( (INT16)(sScreenX + 1), (INT16)(sScreenY - 1), MAP_GRID_X , MAP_GRID_Y );
|
||||
RestoreExternBackgroundRect( (INT16)(sScreenX + 1), (INT16)(sScreenY - 1), UI_MAP.GridSize.iX , UI_MAP.GridSize.iY );
|
||||
|
||||
// blit object to frame buffer
|
||||
BltVideoObject( FRAME_BUFFER, hHandle, ubFrame, sScreenX, sScreenY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
// invalidate region on frame buffer
|
||||
InvalidateRegion( sScreenX, sScreenY - 1, sScreenX + MAP_GRID_X , sScreenY + MAP_GRID_Y );
|
||||
InvalidateRegion( sScreenX, sScreenY - 1, sScreenX + UI_MAP.GridSize.iX , sScreenY + UI_MAP.GridSize.iY );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
extern void InitializeTacticalStatusAtBattleStart();
|
||||
extern BOOLEAN gfDelayAutoResolveStart;
|
||||
extern BOOLEAN gfTransitionMapscreenToAutoResolve;
|
||||
extern UILayout_Map UI_MAP;
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
extern BOOLEAN gfExitViewer;
|
||||
@@ -1052,8 +1053,8 @@ void DoTransitionFromMapscreenToPreBattleInterface()
|
||||
uiStartTime = GetJA2Clock();
|
||||
|
||||
GetScreenXYFromMapXY( gubPBSectorX, gubPBSectorY, &sStartLeft, &sStartTop );
|
||||
sStartLeft += MAP_GRID_X / 2;
|
||||
sStartTop += MAP_GRID_Y / 2;
|
||||
sStartLeft += UI_MAP.GridSize.iX / 2;
|
||||
sStartTop += UI_MAP.GridSize.iY / 2;
|
||||
sEndLeft = 131 + xResOffset;
|
||||
sEndTop = 180 + yResOffset;
|
||||
|
||||
|
||||
+2056
-1571
File diff suppressed because it is too large
Load Diff
@@ -52,6 +52,76 @@ extern INT8 NUM_TOWNS;
|
||||
#define FIRST_TOWN OMERTA
|
||||
//#define PALACE NUM_TOWNS
|
||||
|
||||
struct UILayout_CharPanelIconRegion
|
||||
{
|
||||
INT32 x;
|
||||
INT32 y;
|
||||
INT32 width;
|
||||
INT32 height;
|
||||
INT32 spacing;
|
||||
};
|
||||
|
||||
struct UILayout_MapBorderButtons
|
||||
{
|
||||
SGPPoint Town;
|
||||
SGPPoint Mine;
|
||||
SGPPoint Teams;
|
||||
SGPPoint Militia;
|
||||
SGPPoint Airspace;
|
||||
SGPPoint Inventory;
|
||||
SGPPoint Disease;
|
||||
UINT16 Weather_Y; // Dynamic x position
|
||||
UINT16 Intel_Y; // Dynamic x position
|
||||
};
|
||||
|
||||
struct UILayout_ETA
|
||||
{
|
||||
int Start_Y;
|
||||
int Clock_X;
|
||||
int Hour_X;
|
||||
int Min_X;
|
||||
};
|
||||
|
||||
struct UILayout_HeliETA
|
||||
{
|
||||
SGPRectangle PopupBox;
|
||||
int Upper_Popup_Y;
|
||||
int Alternate_Height;
|
||||
};
|
||||
|
||||
struct UILayout_Map
|
||||
{
|
||||
SGPRectangle BorderRegion;
|
||||
SGPRectangle ViewRegion;
|
||||
SGPRectangle Alphabet;
|
||||
SGPRectangle Numbers;
|
||||
SGPRectangle LevelMarkerArea;
|
||||
SGPPoint LevelString;
|
||||
SGPPoint GridSize;
|
||||
UILayout_MapBorderButtons Button;
|
||||
UILayout_ETA ETA;
|
||||
UILayout_HeliETA HeliETA;
|
||||
};
|
||||
|
||||
struct UILayout_CharList
|
||||
{
|
||||
SGPRectangle Region;
|
||||
SGPPoint Title;
|
||||
int y;
|
||||
int yOffset;
|
||||
int xName;
|
||||
int widthName;
|
||||
int xAssignment;
|
||||
int widthAssignment;
|
||||
int xSleep;
|
||||
int widthSleep;
|
||||
int xLocation;
|
||||
int widthLocation;
|
||||
int xETA;
|
||||
int widthETA;
|
||||
int xTimeRemaining;
|
||||
int widthTimeRemaining;
|
||||
};
|
||||
|
||||
extern BOOLEAN fCharacterInfoPanelDirty;
|
||||
extern BOOLEAN fTeamPanelDirty;
|
||||
@@ -105,6 +175,7 @@ BOOLEAN MapCharacterHasAccessibleInventory( INT8 bCharNumber );
|
||||
BOOLEAN InitializeInvPanelCoordsOld( );
|
||||
BOOLEAN InitializeInvPanelCoordsNew( );
|
||||
BOOLEAN InitializeInvPanelCoordsVehicle( );
|
||||
void initMapViewAndBorderCoordinates(void);
|
||||
|
||||
// HEADROCK HAM 3.6: Calculate daily cost for all mercs who have one.
|
||||
INT32 GetTotalContractExpenses ( void );
|
||||
@@ -154,4 +225,6 @@ void ConvertMinTimeToETADayHourMinString( UINT32 uiTimeInMin, STR16 sString );
|
||||
// Flugente: bandaging during retreat
|
||||
void RetreatBandageCallback( UINT8 ubResult );
|
||||
|
||||
bool isWidescreenUI(void);
|
||||
|
||||
#endif
|
||||
@@ -101,6 +101,7 @@
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
extern INV_REGION_DESC gMapScreenInvPocketXY[NUM_INV_SLOTS]; // ARRAY FOR INV PANEL INTERFACE ITEM POSITIONS
|
||||
|
||||
//CHRISL: Moved to Interface Items.h for EDB
|
||||
//#define ITEMDESC_FONT BLOCKFONT2
|
||||
@@ -1652,7 +1653,6 @@ void RenderInvBodyPanel( SOLDIERTYPE *pSoldier, INT16 sX, INT16 sY )
|
||||
else
|
||||
{
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiBodyInvVO[ pSoldier->ubBodyType ][ bSubImageIndex ], 0, sX, sY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2642,38 +2642,6 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
|
||||
if ( fDirtyLevel == DIRTYLEVEL2 )
|
||||
{
|
||||
// CHECK FOR COMPATIBILITY WITH MAGAZINES
|
||||
|
||||
/* OLD VERSION OF GUN/AMMO MATCH HIGHLIGHTING
|
||||
UINT32 uiDestPitchBYTES;
|
||||
UINT8 *pDestBuf;
|
||||
UINT16 usLineColor;
|
||||
|
||||
if ( ( Item [ pSoldier->inv[ HANDPOS ].usItem ].usItemClass & IC_GUN ) && ( Item[ pObject->usItem ].usItemClass & IC_AMMO ) )
|
||||
{
|
||||
// CHECK
|
||||
if (Weapon[pSoldier->inv[ HANDPOS ].usItem].ubCalibre == Magazine[Item[pObject->usItem].ubClassIndex].ubCalibre )
|
||||
{
|
||||
// IT's an OK calibre ammo, do something!
|
||||
// Render Item with specific color
|
||||
//fOutline = TRUE;
|
||||
//sOutlineColor = Get16BPPColor( FROMRGB( 96, 104, 128 ) );
|
||||
//sOutlineColor = Get16BPPColor( FROMRGB( 20, 20, 120 ) );
|
||||
|
||||
// Draw rectangle!
|
||||
pDestBuf = LockVideoSurface( guiSAVEBUFFER, &uiDestPitchBYTES );
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, 640, 480 );
|
||||
|
||||
//usLineColor = Get16BPPColor( FROMRGB( 255, 255, 0 ) );
|
||||
usLineColor = Get16BPPColor( FROMRGB( 230, 215, 196 ) );
|
||||
RectangleDraw( TRUE, (sX+1), (sY+1), (sX + gSMInvData[ sPocket ].sWidth - 2 ),( sY + gSMInvData[ sPocket ].sHeight - 2 ), usLineColor, pDestBuf );
|
||||
|
||||
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, 640, 480 );
|
||||
|
||||
UnLockVideoSurface( guiSAVEBUFFER );
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
if ( gbCompatibleAmmo[ sPocket ] )
|
||||
{
|
||||
fOutline = TRUE;
|
||||
@@ -2693,8 +2661,9 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
|
||||
}
|
||||
else
|
||||
{
|
||||
newX = !UsingNewInventorySystem( ) ? (14 + xResOffset) : (6 + xResOffset);
|
||||
newY = !UsingNewInventorySystem( ) ? (218 + yResOffset) : (217 + yResOffset);
|
||||
newX = gMapScreenInvPocketXY[SECONDHANDPOS].sX - 10;
|
||||
newY = gMapScreenInvPocketXY[SECONDHANDPOS].sY;
|
||||
|
||||
BltVideoObjectFromIndex( guiSAVEBUFFER, guiMapInvSecondHandBlockout, UsingNewInventorySystem(), newX, newY, VO_BLT_SRCTRANSPARENCY, NULL );
|
||||
RestoreExternBackgroundRect( newX, newY, 102, 24 );
|
||||
}
|
||||
@@ -9755,7 +9724,10 @@ BOOLEAN InitSectorStackPopup( SOLDIERTYPE *pSoldier, WORLDITEM *pInventoryPoolLi
|
||||
fInterfacePanelDirty = DIRTYLEVEL2;
|
||||
|
||||
gfInSectorStackPopup = TRUE;
|
||||
fShowInventoryFlag = TRUE;
|
||||
if (!isWidescreenUI())
|
||||
{
|
||||
fShowInventoryFlag = TRUE;
|
||||
}
|
||||
|
||||
//Restrict mouse cursor to panel
|
||||
aRect.iLeft = sInvX + sOffSetX;
|
||||
|
||||
@@ -80,6 +80,10 @@
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
extern int UI_CHARINV_REGION_X;
|
||||
extern int UI_CHARINV_REGION_Y;
|
||||
extern int UI_CHARINV_REGION_W;
|
||||
extern int UI_CHARINV_REGION_H;
|
||||
|
||||
|
||||
/*
|
||||
@@ -1538,7 +1542,14 @@ BOOLEAN InitializeSMPanelCoordsOld()
|
||||
|
||||
//dnl INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
|
||||
//dnl INTERFACE_CLOCK_Y = ( 119 + INV_INTERFACE_START_Y );
|
||||
INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
|
||||
if (isWidescreenUI())
|
||||
{
|
||||
INTERFACE_CLOCK_X = SCREEN_WIDTH - 86;
|
||||
}
|
||||
else
|
||||
{
|
||||
INTERFACE_CLOCK_X = SCREEN_WIDTH - xResOffset - 86;
|
||||
}
|
||||
INTERFACE_CLOCK_Y = SCREEN_HEIGHT - 24;
|
||||
LOCATION_NAME_X = xResOffset + (xResSize - 92);
|
||||
LOCATION_NAME_Y = ( 65 + INTERFACE_START_Y );
|
||||
@@ -1898,7 +1909,14 @@ BOOLEAN InitializeSMPanelCoordsNew()
|
||||
|
||||
//dnl INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
|
||||
//dnl INTERFACE_CLOCK_Y = ( 119 + INV_INTERFACE_START_Y );
|
||||
INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
|
||||
if (isWidescreenUI())
|
||||
{
|
||||
INTERFACE_CLOCK_X = SCREEN_WIDTH - 86;
|
||||
}
|
||||
else
|
||||
{
|
||||
INTERFACE_CLOCK_X = SCREEN_WIDTH - xResOffset - 86;
|
||||
}
|
||||
INTERFACE_CLOCK_Y = SCREEN_HEIGHT - 24;
|
||||
LOCATION_NAME_X = xResOffset + (xResSize - 92);
|
||||
LOCATION_NAME_Y = ( 89 + INTERFACE_START_Y );
|
||||
@@ -7345,8 +7363,8 @@ void KeyRingItemPanelButtonCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// want the inv done button shutdown and the region behind the keyring shaded
|
||||
//ForceButtonUnDirty( giMapInvDoneButton );
|
||||
// shade the background
|
||||
ShadowVideoSurfaceRect( FRAME_BUFFER , 0, 107, 261, 359 );
|
||||
InvalidateRegion( 0, 107, 261, 359 );
|
||||
ShadowVideoSurfaceRect( FRAME_BUFFER, UI_CHARINV_REGION_X, UI_CHARINV_REGION_Y, UI_CHARINV_REGION_X + UI_CHARINV_REGION_W, UI_CHARINV_REGION_Y + UI_CHARINV_REGION_H);
|
||||
InvalidateRegion(UI_CHARINV_REGION_X, UI_CHARINV_REGION_Y, UI_CHARINV_REGION_X + UI_CHARINV_REGION_W, UI_CHARINV_REGION_Y + UI_CHARINV_REGION_H);
|
||||
}
|
||||
|
||||
//CHRISL: In OIV mode, we don't want to offset the keyring popup.
|
||||
|
||||
@@ -84,6 +84,8 @@
|
||||
//const UINT32 INTERFACE_START_Y = ( SCREEN_HEIGHT - INTERFACE_HEIGHT );
|
||||
//const UINT32 INV_INTERFACE_START_Y = ( SCREEN_HEIGHT - INV_INTERFACE_HEIGHT );
|
||||
|
||||
extern UILayout_Map UI_MAP;
|
||||
|
||||
int INTERFACE_WIDTH;// = 640;
|
||||
int INTERFACE_HEIGHT;// = 120;
|
||||
int INV_INTERFACE_HEIGHT;// = 140;
|
||||
@@ -889,7 +891,7 @@ void PopupMovementMenu( UI_EVENT *pUIEvent )
|
||||
}
|
||||
//SetButtonSavedRect( iActionIcons[ WALK_ICON ] );
|
||||
|
||||
if ( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )
|
||||
if (pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE )
|
||||
{
|
||||
SetButtonFastHelpText( iActionIcons[ WALK_ICON ], TacticalStr[ DRIVE_POPUPTEXT ] );
|
||||
}
|
||||
@@ -4563,9 +4565,9 @@ void BeginMapUIMessage( UINT8 ubPosition, STR16 pFontString, ... )
|
||||
// WDS - bug fix: VideoOverlayDesc must be initialized! - 07/16/2007
|
||||
memset( &VideoOverlayDesc, 0, sizeof( VIDEO_OVERLAY_DESC ) );
|
||||
// Set Overlay
|
||||
VideoOverlayDesc.sLeft = 20 + MAP_VIEW_START_X + ( MAP_VIEW_WIDTH - gusUIMessageWidth ) / 2;
|
||||
VideoOverlayDesc.sLeft = 20 + UI_MAP.ViewRegion.x + (UI_MAP.ViewRegion.width - gusUIMessageWidth ) / 2;
|
||||
|
||||
VideoOverlayDesc.sTop = MAP_VIEW_START_Y + ( MAP_VIEW_HEIGHT - gusUIMessageHeight ) / 2;
|
||||
VideoOverlayDesc.sTop = UI_MAP.ViewRegion.y + (UI_MAP.ViewRegion.height - gusUIMessageHeight ) / 2;
|
||||
|
||||
if( ubPosition == MSG_MAP_UI_POSITION_UPPER )
|
||||
{
|
||||
|
||||
@@ -30,7 +30,8 @@ extern BOOLEAN AreInMeanwhile();
|
||||
#include "connect.h"
|
||||
|
||||
extern INT32 iCurrentMapSectorZ;
|
||||
|
||||
extern UINT16 UI_BOTTOM_X;
|
||||
extern UINT16 UI_BOTTOM_Y;
|
||||
void AdjustWorldCenterFromRadarCoords( INT16 sRadarX, INT16 sRadarY );
|
||||
|
||||
|
||||
@@ -80,10 +81,18 @@ MOUSE_REGION gRadarRegionSquadList[ NUMBER_OF_SQUADS ];
|
||||
|
||||
void InitRadarScreenCoords( )
|
||||
{
|
||||
if (isWidescreenUI())
|
||||
{
|
||||
RADAR_WINDOW_STRAT_X = UI_BOTTOM_X + 1182;
|
||||
RADAR_WINDOW_STRAT_Y = UI_BOTTOM_Y + 9;
|
||||
}
|
||||
else
|
||||
{
|
||||
RADAR_WINDOW_STRAT_X = xResOffset + (xResSize - 97);
|
||||
RADAR_WINDOW_STRAT_Y = (SCREEN_HEIGHT - 107);
|
||||
}
|
||||
RADAR_WINDOW_TM_X = xResOffset + (xResSize - 97);
|
||||
RADAR_WINDOW_SM_X = xResOffset + (xResSize - 97);
|
||||
RADAR_WINDOW_STRAT_X = xResOffset + (xResSize - 97);
|
||||
RADAR_WINDOW_STRAT_Y = (SCREEN_HEIGHT - 107);
|
||||
|
||||
RADAR_WINDOW_TM_Y = (INTERFACE_START_Y + 13);
|
||||
RADAR_WINDOW_SM_Y = ((UsingNewInventorySystem() == false)) ? (INV_INTERFACE_START_Y + 33) : (INV_INTERFACE_START_Y + 116);
|
||||
|
||||
@@ -674,6 +674,11 @@ BOOLEAN RestoreExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT1
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN RestoreExternBackgroundRect(SGPRectangle rect)
|
||||
{
|
||||
return RestoreExternBackgroundRect(rect.x, rect.y, rect.width, rect.height);
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN RestoreExternBackgroundRectGivenID( INT32 iBack )
|
||||
{
|
||||
|
||||
@@ -120,6 +120,7 @@ BOOLEAN SaveBackgroundRects(void);
|
||||
BOOLEAN InvalidateBackgroundRects(void);
|
||||
BOOLEAN UpdateSaveBuffer(void);
|
||||
BOOLEAN RestoreExternBackgroundRect( INT16 sLeft, INT16 sTop, INT16 sWidth, INT16 sHeight );
|
||||
BOOLEAN RestoreExternBackgroundRect(SGPRectangle rect);
|
||||
void SetBackgroundRectFilled( UINT32 uiBackgroundID );
|
||||
BOOLEAN EmptyBackgroundRects( void );
|
||||
|
||||
|
||||
+13
-4
@@ -1047,7 +1047,10 @@ void MapScreenMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
|
||||
// HEADROCK HAM 3.6: Allow for longer lines.
|
||||
// Lejardo ARSProject
|
||||
MAP_LINE_WIDTH = (INTERFACE_WIDTH - 330);
|
||||
|
||||
if (iResolution == _1280x720)
|
||||
{
|
||||
MAP_LINE_WIDTH = 685;
|
||||
}
|
||||
pStringWrapperHead=LineWrap(uiFont, MAP_LINE_WIDTH, &usLineWidthIfWordIsWiderThenWidth, DestString);
|
||||
pStringWrapper=pStringWrapperHead;
|
||||
if(!pStringWrapper)
|
||||
@@ -1136,14 +1139,20 @@ void DisplayStringsInMapScreenMessageList( void )
|
||||
UINT8 ubLinesPrinted;
|
||||
INT16 sY;
|
||||
UINT16 usSpacing;
|
||||
|
||||
UINT16 MessageStartX = (SCREEN_WIDTH - INTERFACE_WIDTH) / 2;
|
||||
UINT16 MessageEndX = MessageStartX + (INTERFACE_WIDTH - 330);
|
||||
if (iResolution == _1280x720)
|
||||
{
|
||||
MessageStartX = 0;
|
||||
MessageEndX = 705;
|
||||
}
|
||||
//SetFontDestBuffer( FRAME_BUFFER, 17, 360 + 6, 407, 360 + 101, FALSE );
|
||||
|
||||
// CHRISL: Change both X paramters so they dynamically generate from right edge of screen
|
||||
//SetFontDestBuffer( FRAME_BUFFER, (SCREEN_WIDTH - 509), (SCREEN_HEIGHT - 114), (SCREEN_WIDTH - 233), (SCREEN_HEIGHT - 114) + 101, FALSE );
|
||||
// CHRISL: Use this setup if we want message box on the left side
|
||||
// HEADROCK HAM 3.6: Message window now as wide as possible. The money screen has been moved to the right side.
|
||||
SetFontDestBuffer( FRAME_BUFFER, (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + 17, (SCREEN_HEIGHT - 114), (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + (INTERFACE_WIDTH - 330), (SCREEN_HEIGHT - 114) + 101, FALSE );
|
||||
SetFontDestBuffer( FRAME_BUFFER, MessageStartX + 17, (SCREEN_HEIGHT - 114), MessageEndX, (SCREEN_HEIGHT - 114) + 101, FALSE );
|
||||
|
||||
SetFont( MAP_SCREEN_MESSAGE_FONT ); // no longer supports variable fonts
|
||||
SetFontBackground( FONT_BLACK );
|
||||
@@ -1177,7 +1186,7 @@ void DisplayStringsInMapScreenMessageList( void )
|
||||
// CHRISL: Change X parameter to dynamically generate from right edge of screen
|
||||
//mprintf_coded( (SCREEN_WIDTH - 506), sY, gMapScreenMessageList[ ubCurrentStringIndex ]->pString16 );
|
||||
// CHRISL: Use this line if we want to display from the left edge
|
||||
mprintf_coded( (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + 20, sY, gMapScreenMessageList[ ubCurrentStringIndex ]->pString16 );
|
||||
mprintf_coded(MessageStartX + 20, sY, gMapScreenMessageList[ ubCurrentStringIndex ]->pString16 );
|
||||
|
||||
sY = sY + usSpacing;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user