diff --git a/Console/Console_VS2010.vcxproj b/Console/Console_VS2010.vcxproj
index 98557bce..f5ba02e7 100644
--- a/Console/Console_VS2010.vcxproj
+++ b/Console/Console_VS2010.vcxproj
@@ -100,28 +100,28 @@
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
diff --git a/Credits.cpp b/Credits.cpp
index 42b344e4..3dab0450 100644
--- a/Credits.cpp
+++ b/Credits.cpp
@@ -28,13 +28,9 @@
#include "Random.h"
#endif
-
-
//externals
extern HVSURFACE ghFrameBuffer;
-
-
//local Defines
enum
{
@@ -42,32 +38,22 @@ enum
CRDT_RENDER_ALL,
};
-
//nnn
typedef struct _CRDT_NODE
{
- UINT32 uiType; //the type of node
-
- CHAR16 *pString; //string for the node if the node contains a string
-
- UINT32 uiFlags; //various flags
-
+ UINT32 uiType; //the type of node
+ CHAR16 *pString; //string for the node if the node contains a string
+ UINT32 uiFlags; //various flags
INT16 sPosX; //position of the node on the screen if the node is displaying stuff
INT16 sPosY;
-
INT16 sOldPosX; //position of the node on the screen if the node is displaying stuff
INT16 sOldPosY;
-
INT16 sHeightOfString; //The height of the displayed string
-
- BOOLEAN fDelete; //Delete this loop
-
- UINT32 uiLastTime; // The last time the node was udated
-
- UINT32 uiVideoSurfaceImage;
-
+ BOOLEAN fDelete; //Delete this loop
+ UINT32 uiLastTime; // The last time the node was udated
+ UINT32 uiVideoSurfaceImage;
struct _CRDT_NODE *pPrev;
- struct _CRDT_NODE *pNext;
+ struct _CRDT_NODE *pNext;
} CRDT_NODE;
//type of credits
@@ -79,92 +65,52 @@ enum
//flags for the credits
//Flags:
-#define CRDT_FLAG__TITLE 0x00000001
+#define CRDT_FLAG__TITLE 0x00000001
#define CRDT_FLAG__START_SECTION 0x00000002
#define CRDT_FLAG__END_SECTION 0x00000004
+#define CRDT_NAME_OF_CREDIT_FILE "BINARYDATA\\Credits.edt"
+#define CRDT_NAME_OF_MOD_CREDIT_FILE "BINARYDATA\\Credits_Mod.edt"
-//#define CRDT_NAME_OF_CREDIT_FILE "BINARYDATA\\Credits.txt"
-#define CRDT_NAME_OF_CREDIT_FILE "BINARYDATA\\Credits.edt"
-#define CRDT_NAME_OF_MOD_CREDIT_FILE "BINARYDATA\\Credits_Mod.edt"
-
-#define CREDITS_LINESIZE 80 * 2
-
+#define CREDITS_LINESIZE (80 * 2)
//
// Code tokens
//
//new codes:
-#define CRDT_START_CODE '@'
-#define CRDT_SEPARATION_CODE L","
-#define CRDT_END_CODE L";"
+#define CRDT_START_CODE '@'
+#define CRDT_SEPARATION_CODE L","
+#define CRDT_END_CODE L";"
#define CRDT_DELAY_BN_STRINGS_CODE 'D'
#define CRDT_DELAY_BN_SECTIONS_CODE 'B'
-#define CRDT_SCROLL_SPEED 'S'
-#define CRDT_FONT_JUSTIFICATION 'J'
-#define CRDT_TITLE_FONT_COLOR 'C'
-#define CRDT_ACTIVE_FONT_COLOR 'R'
+#define CRDT_SCROLL_SPEED 'S'
+#define CRDT_FONT_JUSTIFICATION 'J'
+#define CRDT_TITLE_FONT_COLOR 'C'
+#define CRDT_ACTIVE_FONT_COLOR 'R'
//Flags:
-#define CRDT_TITLE 'T'
-#define CRDT_START_OF_SECTION '{'
-#define CRDT_END_OF_SECTION '}'
+#define CRDT_TITLE 'T'
+#define CRDT_START_OF_SECTION '{'
+#define CRDT_END_OF_SECTION '}'
+
+#define CRDT_NAME_FONT FONT12ARIAL
+#define CRDT_LINE_NODE_DISAPPEARS_AT 0
-#define CRDT_NAME_LOC_X 375
-#define CRDT_NAME_LOC_Y 420
-#define CRDT_NAME_TITLE_LOC_Y 435
-#define CRDT_NAME_FUNNY_LOC_Y 450
-#define CRDT_NAME_LOC_WIDTH 260
-#define CRDT_NAME_LOC_HEIGHT ( CRDT_NAME_FUNNY_LOC_Y - CRDT_NAME_LOC_Y + GetFontHeight( CRDT_NAME_FONT ) )
-
-#define CRDT_NAME_FONT FONT12ARIAL
-
-#define CRDT_LINE_NODE_DISAPPEARS_AT 0//20
-
-/*
-//new codes:
-enum
-{
- CRDT_ERROR,
- CRDT_CODE_DELAY_BN_STRINGS,
- CRDT_CODE_SCROLL_SPEED,
- CRDT_CODE_FONT_JUSIFICATION,
- CRDT_CODE_FONT_COLOR,
-
- CRDT_NUM_CODES,
-};
-*/
-
-
-#define CRDT_WIDTH_OF_TEXT_AREA 210
-#define CRDT_TEXT_START_LOC 10
-
-
-#define CRDT_SCROLL_PIXEL_AMOUNT 1
-#define CRDT_NODE_DELAY_AMOUNT 25
-#define CRDT_DELAY_BN_NODES 750
-#define CRDT_DELAY_BN_SECTIONS 2500
-
-#define CRDT_SPACE_BN_SECTIONS 50
-#define CRDT_SPACE_BN_NODES 12
-
-#define CRDT_START_POS_Y (SCREEN_HEIGHT - 1) //479
-
-#define CRDT_EYE_WIDTH 30
-#define CRDT_EYE_HEIGHT 12
-
-#define CRDT_EYES_CLOSED_TIME 150
+#define CRDT_WIDTH_OF_TEXT_AREA 210
+#define CRDT_SCROLL_PIXEL_AMOUNT 1
+#define CRDT_NODE_DELAY_AMOUNT 25
+#define CRDT_DELAY_BN_NODES 750
+#define CRDT_DELAY_BN_SECTIONS 2500
+#define CRDT_SPACE_BN_SECTIONS 50
+#define CRDT_SPACE_BN_NODES 12
+#define CRDT_START_POS_Y (SCREEN_HEIGHT - 1)
+#define CRDT_EYE_WIDTH 30
+#define CRDT_EYE_HEIGHT 12
+#define CRDT_EYES_CLOSED_TIME 150
//ddd
-
-
-
-
-
-
-
typedef struct
{
INT16 sX;
@@ -179,8 +125,8 @@ typedef struct
INT16 sMouthY;
INT16 sBlinkFreq;
- UINT32 uiLastBlinkTime;
- UINT32 uiEyesClosedTime;
+ UINT32 uiLastBlinkTime;
+ UINT32 uiEyesClosedTime;
} CDRT_FACE;
@@ -204,189 +150,66 @@ CDRT_FACE gCreditFaces[] =
585, 196, 39, 49, 593, 218, 593, 228, 3500, 0, 0, //Joey
};
-/*
-enum
-{
- CRDT_CAMFIELD,
- CRDT_SHAWN,
- CRDT_KRIS,
- CRDT_IAN,
- CRDT_LINDA,
- CRDT_ERIC,
- CRDT_LYNN,
- CRDT_NORM,
- CRDT_GEORGE,
- CRDT_STACEY,
- CRDT_SCOTT,
- CRDT_EMMONS,
- CRDT_DAVE,
- CRDT_ALEX,
- CRDT_JOEY,
-
- NUM_PEOPLE_IN_CREDITS,
-};
-
-STR16 gzCreditNames[]=
-{
- L"Chris Camfield",
- L"Shaun Lyng",
- L"Kris Maernes",
- L"Ian Currie",
- L"Linda Currie",
- L"Eric \"WTF\" Cheng",
- L"Lynn Holowka",
- L"Norman \"NRG\" Olsen",
- L"George Brooks",
- L"Andrew Stacey",
- L"Scot Loving",
- L"Andrew \"Big Cheese\" Emmons",
- L"Dave \"The Feral\" French",
- L"Alex Meduna",
- L"Joey \"Joeker\" Whelan",
-};
-
-
-STR16 gzCreditNameTitle[]=
-{
- L"Game Internals Programmer", // Chris Camfield
- L"Co-designer/Writer", // Shaun Lyng
- L"Strategic Systems & Editor Programmer", //Kris \"The Cow Rape Man\" Marnes
- L"Producer/Co-designer", // Ian Currie
- L"Co-designer/Map Designer", // Linda Currie
- L"Artist", // Eric \"WTF\" Cheng
- L"Beta Coordinator, Support", // Lynn Holowka
- L"Artist Extraordinaire", // Norman \"NRG\" Olsen
- L"Sound Guru", // George Brooks
- L"Screen Designer/Artist", // Andrew Stacey
- L"Lead Artist/Animator", // Scot Loving
- L"Lead Programmer", // Andrew \"Big Cheese Doddle\" Emmons
- L"Programmer", // Dave French
- L"Strategic Systems & Game Balance Programmer", // Alex Meduna
- L"Portraits Artist", // Joey \"Joeker\" Whelan",
-};
-
-STR16 gzCreditNameFunny[]=
-{
- L"", // Chris Camfield
- L"(still learning punctuation)", // Shaun Lyng
- L"(\"It's done. I'm just fixing it\")", //Kris \"The Cow Rape Man\" Marnes
- L"(getting much too old for this)", // Ian Currie
- L"(and working on Wizardry 8)", // Linda Currie
- L"(forced at gunpoint to also do QA)", // Eric \"WTF\" Cheng
- L"(Left us for the CFSA - go figure...)", // Lynn Holowka
- L"", // Norman \"NRG\" Olsen
- L"", // George Brooks
- L"(Dead Head and jazz lover)", // Andrew Stacey
- L"(his real name is Robert)", // Scot Loving
- L"(the only responsible person)", // Andrew \"Big Cheese Doddle\" Emmons
- L"(can now get back to motocrossing)", // Dave French
- L"(stolen from Wizardry 8)", // Alex Meduna
- L"(did items and loading screens too!)", // Joey \"Joeker\" Whelan",
-};
-
-*/
-
-
//Global Variables
-
MOUSE_REGION gCrdtMouseRegions[ NUM_PEOPLE_IN_CREDITS ];
void SelectCreditFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
void SelectCreditFaceMovementRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
-
-
-UINT32 guiCreditBackGroundImage;
-UINT32 guiCreditFaces;
-BOOLEAN gfCreditsScreenEntry = TRUE;
-BOOLEAN gfCreditsScreenExit = FALSE;
-UINT32 guiCreditsExitScreen;
+UINT32 guiCreditBackGroundImage;
+UINT32 guiCreditFaces;
+BOOLEAN gfCreditsScreenEntry = TRUE;
+BOOLEAN gfCreditsScreenExit = FALSE;
+UINT32 guiCreditsExitScreen;
UINT8 gubCreditScreenRenderFlags = CRDT_RENDER_ALL;
-CRDT_NODE *gCrdtRootNode=NULL;
-CRDT_NODE *gCrdtLastAddedNode=NULL;
+CRDT_NODE *gCrdtRootNode=NULL;
+CRDT_NODE *gCrdtLastAddedNode=NULL;
-BOOLEAN gfCrdtHaveRenderedFirstFrameToSaveBuffer; // need to render background image to save buffer once
+BOOLEAN gfCrdtHaveRenderedFirstFrameToSaveBuffer; // need to render background image to save buffer once
INT32 giCurrentlySelectedFace = -1;
//
//VAriables needed for processing of the nodes:
//
-
-
UINT32 guiCreditScreenActiveFont; // the font that is used
UINT32 guiCreditScreenTitleFont; // the font that is used
-UINT8 gubCreditScreenActiveColor; // color of the font
-UINT8 gubCreditScreenTitleColor; // color of a Title node
-//UINT32 guiCreditScreenActiveDisplayFlags; //
-
+UINT8 gubCreditScreenActiveColor; // color of the font
+UINT8 gubCreditScreenTitleColor; // color of a Title node
UINT32 guiCrdtNodeScrollSpeed = CRDT_NODE_DELAY_AMOUNT; //speed credits go up at
-//UINT32 guiCrdtTimeTillReadNextCredit = CRDT_DELAY_BN_SECTIONS; //the delay before reading the next credit ( normall = guiCrdtDelayBetweenCreditSection or guiCrdtDelayBetweenNodes )
-//UINT32 guiCrdtDelayBetweenCreditSection = CRDT_DELAY_BN_SECTIONS; //delay between major credits sections ( programming and art ) appearing on the screen
-//UINT32 guiCrdtDelayBetweenNodes = CRDT_DELAY_BN_NODES; //delay between credits appearing on the screen
UINT32 guiCrdtLastTimeUpdatingNode=0; // the last time a node was read from the file
-UINT8 gubCrdtJustification = CENTER_JUSTIFIED; // the current justification
-
+UINT8 gubCrdtJustification = CENTER_JUSTIFIED; // the current justification
UINT32 guiGapBetweenCreditSections = CRDT_SPACE_BN_SECTIONS;
UINT32 guiGapBetweenCreditNodes = CRDT_SPACE_BN_NODES;
UINT32 guiGapTillReadNextCredit = CRDT_SPACE_BN_NODES;
-
UINT32 guiCurrentCreditRecord = 0;
BOOLEAN gfPauseCreditScreen = FALSE;
BOOLEAN gfModCredits = TRUE;
-
HWFILE ghFile;
-//ggg
-
-
-
-
-
//Function Prototypes
-
-
BOOLEAN EnterCreditsScreen();
BOOLEAN ExitCreditScreen();
-void HandleCreditScreen();
+void HandleCreditScreen();
BOOLEAN RenderCreditScreen();
-void GetCreditScreenUserInput();
-void SetCreditsExitScreen( UINT32 uiScreenToGoTo );
+void GetCreditScreenUserInput();
+void SetCreditsExitScreen( UINT32 uiScreenToGoTo );
BOOLEAN ShutDownCreditList();
BOOLEAN AddCreditNode( UINT32 uiType, UINT32 uiFlags, STR16 pString );
BOOLEAN InitCreditNode( );
BOOLEAN DisplayCreditNode( CRDT_NODE *pCurrent );
-void HandleCreditNodes();
-void HandleNode_Default( CRDT_NODE *pCurrent );
-void HandleCurrentCreditNode( CRDT_NODE *pCurrent );
+void HandleCreditNodes();
+void HandleNode_Default( CRDT_NODE *pCurrent );
+void HandleCurrentCreditNode( CRDT_NODE *pCurrent );
BOOLEAN DeleteNode( CRDT_NODE *pNodeToDelete );
UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode );
BOOLEAN GetNextCreditFromTextFile();
UINT32 CountNumberOfCreditNodes();
-STR16 GetNextCreditCode( STR16 pString, UINT32 *pSizeOfCode );
-void HandleCreditFlags( UINT32 uiFlags );
-void HandleCreditEyeBlinking();
-void InitCreditEyeBlinking();
-//ppp
-
-
-
-
-
-
-
-
-
-// VSURFACE_DESC vs_desc;
-// HVSURFACE hVSurface;
-
-
-
-
-
-
-
+STR16 GetNextCreditCode( STR16 pString, UINT32 *pSizeOfCode );
+void HandleCreditFlags( UINT32 uiFlags );
+void HandleCreditEyeBlinking();
+void InitCreditEyeBlinking();
UINT32 CreditScreenInit( void )
{
@@ -394,8 +217,6 @@ UINT32 CreditScreenInit( void )
return( 1 );
}
-
-
UINT32 CreditScreenHandle( void )
{
StartFrameBufferRender();
@@ -412,27 +233,17 @@ UINT32 CreditScreenHandle( void )
gfCreditsScreenEntry = FALSE;
gfCreditsScreenExit = FALSE;
}
+
gubCreditScreenRenderFlags = CRDT_RENDER_ALL;
}
GetCreditScreenUserInput();
-
HandleCreditScreen();
- // render buttons marked dirty
-// MarkButtonsDirty( );
-// RenderButtons( );
-
- // render help
-// RenderFastHelp( );
-// RenderButtonsFastHelp( );
-
-
ExecuteBaseDirtyRectQueue();
EndFrameBufferRender();
-
if( gfCreditsScreenExit )
{
ExitCreditScreen();
@@ -440,7 +251,6 @@ UINT32 CreditScreenHandle( void )
gfCreditsScreenExit = FALSE;
}
-
return( guiCreditsExitScreen );
}
@@ -450,48 +260,25 @@ UINT32 CreditScreenShutdown( void )
return( 1 );
}
-
-
-
-
-
-
-
-
-
-//eee
BOOLEAN EnterCreditsScreen()
{
UINT32 uiCnt;
VOBJECT_DESC VObjectDesc;
-/*
-
- VSURFACE_DESC vs_desc;
-
- vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
-
- strcpy(vs_desc.ImageFile, "INTERFACE\\Credits.sti");
-
- if( !AddVideoSurface( &vs_desc, &guiCreditBackGroundImage ) )
- {
- return( FALSE );
- }
-*/
gfModCredits = TRUE;
ColorFillVideoSurfaceArea( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0 );
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- FilenameForBPP("INTERFACE\\Credits.sti", VObjectDesc.ImageFile);
+ FilenameForBPP("INTERFACE\\Credits.sti", VObjectDesc.ImageFile);
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
FilenameForBPP("INTERFACE\\Credits_800x600.sti", VObjectDesc.ImageFile);
}
- else if (iResolution == 2)
+ else
{
FilenameForBPP("INTERFACE\\Credits_1024x768.sti", VObjectDesc.ImageFile);
}
@@ -502,43 +289,31 @@ BOOLEAN EnterCreditsScreen()
FilenameForBPP("INTERFACE\\Credit Faces.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiCreditFaces ));
-
-
//Initialize the root credit node
InitCreditNode( );
guiCreditsExitScreen = CREDIT_SCREEN;
gfCrdtHaveRenderedFirstFrameToSaveBuffer = FALSE;
-
guiCreditScreenActiveFont = FONT12ARIAL;
gubCreditScreenActiveColor = FONT_MCOLOR_DKWHITE;
-
- //gubCreditScreenActiveColor = FONT_MCOLOR_LTBLUE;
-
guiCreditScreenTitleFont = FONT14ARIAL;
gubCreditScreenTitleColor = FONT_MCOLOR_RED;
-// guiCreditScreenActiveDisplayFlags = LEFT_JUSTIFIED;
guiCrdtNodeScrollSpeed = CRDT_NODE_DELAY_AMOUNT;
gubCrdtJustification = CENTER_JUSTIFIED;
guiCurrentCreditRecord = 0;
-// guiCrdtTimeTillReadNextCredit = CRDT_DELAY_BN_SECTIONS;
-// guiCrdtDelayBetweenCreditSection = CRDT_DELAY_BN_SECTIONS;
-// guiCrdtDelayBetweenNodes = CRDT_DELAY_BN_NODES;
-
guiCrdtLastTimeUpdatingNode = GetJA2Clock();
-
guiGapBetweenCreditSections = CRDT_SPACE_BN_SECTIONS;
guiGapBetweenCreditNodes = CRDT_SPACE_BN_NODES;
guiGapTillReadNextCredit = CRDT_SPACE_BN_NODES;
-
for( uiCnt=0; uiCnt < NUM_PEOPLE_IN_CREDITS; uiCnt++)
{
// Make a mouse region
- MSYS_DefineRegion( &gCrdtMouseRegions[uiCnt], gCreditFaces[uiCnt].sX, gCreditFaces[uiCnt].sY, (INT16)(gCreditFaces[uiCnt].sX + gCreditFaces[uiCnt].sWidth), (INT16)(gCreditFaces[uiCnt].sY + gCreditFaces[uiCnt].sHeight), MSYS_PRIORITY_NORMAL,
- CURSOR_WWW, SelectCreditFaceMovementRegionCallBack, SelectCreditFaceRegionCallBack );
+ MSYS_DefineRegion( &gCrdtMouseRegions[uiCnt], gCreditFaces[uiCnt].sX + xResOffset, gCreditFaces[uiCnt].sY + yResOffset, (INT16)(gCreditFaces[uiCnt].sX + gCreditFaces[uiCnt].sWidth + xResOffset), (INT16)(gCreditFaces[uiCnt].sY + gCreditFaces[uiCnt].sHeight + yResOffset), MSYS_PRIORITY_NORMAL,
+ CURSOR_WWW, SelectCreditFaceMovementRegionCallBack, SelectCreditFaceRegionCallBack );
+
// Add region
MSYS_AddRegion( &gCrdtMouseRegions[uiCnt] );
@@ -546,38 +321,21 @@ BOOLEAN EnterCreditsScreen()
MSYS_SetRegionUserData( &gCrdtMouseRegions[uiCnt], 0, uiCnt );
}
-/*
- //open the credit text file
- ghFile = FileOpen( CRDT_NAME_OF_CREDIT_FILE, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE );
- if( !ghFile )
- {
- return( FALSE );
- }
-*/
-
giCurrentlySelectedFace = -1;
gfPauseCreditScreen = FALSE;
InitCreditEyeBlinking();
-
return( TRUE );
}
-
-
BOOLEAN ExitCreditScreen()
{
UINT32 uiCnt;
-
- //Blit the background image
-// DeleteVideoSurfaceFromIndex( guiCreditBackGroundImage );
DeleteVideoObjectFromIndex( guiCreditBackGroundImage );
-
DeleteVideoObjectFromIndex( guiCreditFaces );
-
//ShutDown Credit link list
ShutDownCreditList();
@@ -586,20 +344,20 @@ BOOLEAN ExitCreditScreen()
MSYS_RemoveRegion( &gCrdtMouseRegions[uiCnt] );
}
-/*
- //close the text file
- FileClose( ghFile );
- ghFile = 0;
-*/
-
return( TRUE );
}
//hhh
-void HandleCreditScreen()
+void HandleCreditScreen()
{
-// UINT32 uiTime = GetJA2Clock();
+ UINT16 CRDT_NAME_LOC_X = 375 + xResOffset;
+ UINT16 CRDT_NAME_LOC_Y = 420 + yResOffset;
+ UINT16 CRDT_NAME_TITLE_LOC_Y = 435 + yResOffset;
+ UINT16 CRDT_NAME_FUNNY_LOC_Y = 450 + yResOffset;
+
+ UINT16 CRDT_NAME_LOC_WIDTH = 260;
+ UINT16 CRDT_NAME_LOC_HEIGHT = ( CRDT_NAME_FUNNY_LOC_Y - CRDT_NAME_LOC_Y + GetFontHeight( CRDT_NAME_FONT ) );
if( gubCreditScreenRenderFlags == CRDT_RENDER_ALL )
{
@@ -607,14 +365,12 @@ void HandleCreditScreen()
gubCreditScreenRenderFlags = CRDT_RENDER_NONE;
}
-
//Handle the Credit linked list
HandleCreditNodes();
//Handle the blinkng eyes
HandleCreditEyeBlinking();
-
//is it time to get a new node
if( gCrdtLastAddedNode == NULL || ( CRDT_START_POS_Y - ( gCrdtLastAddedNode->sPosY + gCrdtLastAddedNode->sHeightOfString - 16 ) ) >= (INT16)guiGapTillReadNextCredit )
{
@@ -625,8 +381,6 @@ void HandleCreditScreen()
}
}
-
-
RestoreExternBackgroundRect( CRDT_NAME_LOC_X, CRDT_NAME_LOC_Y, CRDT_NAME_LOC_WIDTH, (INT16)CRDT_NAME_LOC_HEIGHT );
if( giCurrentlySelectedFace != -1 )
@@ -637,21 +391,14 @@ void HandleCreditScreen()
}
}
-
//rrr
BOOLEAN RenderCreditScreen()
{
-
HVOBJECT hPixHandle;
GetVideoObject(&hPixHandle, guiCreditBackGroundImage );
- BltVideoObject( FRAME_BUFFER, hPixHandle, 0, 0, 0, VO_BLT_SRCTRANSPARENCY, NULL);
-/*
- HVSURFACE hVSurface;
+ BltVideoObject( FRAME_BUFFER, hPixHandle, 0, xResOffset, yResOffset, VO_BLT_SRCTRANSPARENCY, NULL);
- GetVideoSurface( &hVSurface, guiCreditBackGroundImage );
- BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, 0, 0, 0, NULL );
-*/
if( !gfCrdtHaveRenderedFirstFrameToSaveBuffer )
{
gfCrdtHaveRenderedFirstFrameToSaveBuffer = TRUE;
@@ -666,12 +413,11 @@ BOOLEAN RenderCreditScreen()
return( TRUE );
}
-
void GetCreditScreenUserInput()
{
InputAtom Event;
- while( DequeueEvent( &Event ) )
+ while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if( Event.usEvent == KEY_DOWN )
{
@@ -683,7 +429,6 @@ void GetCreditScreenUserInput()
SetCreditsExitScreen( MAINMENU_SCREEN );
break;
-//#ifdef JA2TESTVERSION
case 'r':
gubCreditScreenRenderFlags = CRDT_RENDER_ALL;
break;
@@ -707,7 +452,6 @@ void GetCreditScreenUserInput()
else
gfPauseCreditScreen = TRUE;
break;
-//#endif
}
}
}
@@ -792,7 +536,6 @@ BOOLEAN DeleteNode( CRDT_NODE *pNodeToDelete )
pTempNode->pString = NULL;
}
-
//if the node had something to display, delete a surface for it
if( pTempNode->uiType == CRDT_NODE_DEFAULT )
{
@@ -800,7 +543,6 @@ BOOLEAN DeleteNode( CRDT_NODE *pNodeToDelete )
pTempNode->uiVideoSurfaceImage = 0;
}
-
//Free the node
MemFree( pTempNode );
pTempNode = NULL;
@@ -808,7 +550,6 @@ BOOLEAN DeleteNode( CRDT_NODE *pNodeToDelete )
return( TRUE );
}
-
//aaa
BOOLEAN AddCreditNode( UINT32 uiType, UINT32 uiFlags, STR16 pString )
{
@@ -818,6 +559,8 @@ BOOLEAN AddCreditNode( UINT32 uiType, UINT32 uiFlags, STR16 pString )
UINT32 uiFontToUse;
UINT8 uiColorToUse;
+ UINT16 CRDT_TEXT_START_LOC = xResOffset + 10;
+
//if
if( uiType == CRDT_NODE_NONE)
{
@@ -839,18 +582,6 @@ BOOLEAN AddCreditNode( UINT32 uiType, UINT32 uiFlags, STR16 pString )
uiFontToUse = guiCreditScreenTitleFont;
uiColorToUse = gubCreditScreenTitleColor;
}
-/*
- else if ( uiFlags & CRDT_FLAG__START_SECTION )
- {
- uiFontToUse = ;
- uiColorToUse = ;
- }
- else if ( uiFlags & CRDT_FLAG__END_SECTION )
- {
- uiFontToUse = ;
- uiColorToUse = ;
- }
-*/
else
{
uiFontToUse = guiCreditScreenActiveFont;
@@ -918,9 +649,6 @@ BOOLEAN AddCreditNode( UINT32 uiType, UINT32 uiFlags, STR16 pString )
SetFontDestBuffer(FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE);
}
-
-
-
//
// Insert the node into the list
//
@@ -968,7 +696,6 @@ void HandleCreditNodes()
if( gfPauseCreditScreen )
return;
-
pCurrent = gCrdtRootNode;
if( !( GetJA2Clock() - guiCrdtLastTimeUpdatingNode > guiCrdtNodeScrollSpeed ) )
@@ -992,8 +719,6 @@ void HandleCreditNodes()
}
}
-// RestoreExternBackgroundRect( CRDT_TEXT_START_LOC, 0, CRDT_WIDTH_OF_TEXT_AREA, CRDT_LINE_NODE_DISAPPEARS_AT );
-
guiCrdtLastTimeUpdatingNode = GetJA2Clock();
}
@@ -1002,7 +727,6 @@ void HandleCurrentCreditNode( CRDT_NODE *pCurrent )
//switch on the type of node
switch( pCurrent->uiType )
{
-//new codes:
case CRDT_NODE_DEFAULT:
HandleNode_Default( pCurrent );
break;
@@ -1015,33 +739,24 @@ void HandleCurrentCreditNode( CRDT_NODE *pCurrent )
void HandleNode_Default( CRDT_NODE *pCurrent )
{
- //if it is time to update the current node
-// if( ( uiCurrentTime - pCurrent->uiLastTime ) > guiCrdtNodeScrollSpeed )
+ //Display the Current Node
+ DisplayCreditNode( pCurrent );
+
+ //Save the old position
+ pCurrent->sOldPosX = pCurrent->sPosX;
+ pCurrent->sOldPosY = pCurrent->sPosY;
+
+ //Move the current node up
+ pCurrent->sPosY -= CRDT_SCROLL_PIXEL_AMOUNT;
+
+ //if the node is entirely off the screen
+ if( ( pCurrent->sPosY + pCurrent->sHeightOfString ) < CRDT_LINE_NODE_DISAPPEARS_AT )
{
- //Display the Current Node
- DisplayCreditNode( pCurrent );
-
- //Save the old position
- pCurrent->sOldPosX = pCurrent->sPosX;
- pCurrent->sOldPosY = pCurrent->sPosY;
-
- //Move the current node up
- pCurrent->sPosY -= CRDT_SCROLL_PIXEL_AMOUNT;
-
- //if the node is entirely off the screen
- if( ( pCurrent->sPosY + pCurrent->sHeightOfString ) < CRDT_LINE_NODE_DISAPPEARS_AT )
- {
- //mark the node to be deleted this frame
- pCurrent->fDelete = TRUE;
- }
-
- //Update the last time to be the current time
-// pCurrent->uiLastTime = uiCurrentTime + ( uiCurrentTime - ( pCurrent->uiLastTime + guiCrdtNodeScrollSpeed ) );
-
-// pCurrent->uiLastTime = ( uiCurrentTime - ( uiCurrentTime - pCurrent->uiLastTime - guiCrdtNodeScrollSpeed) );
-
- pCurrent->uiLastTime = GetJA2Clock();
+ //mark the node to be deleted this frame
+ pCurrent->fDelete = TRUE;
}
+
+ pCurrent->uiLastTime = GetJA2Clock();
}
@@ -1058,7 +773,6 @@ BOOLEAN DisplayCreditNode( CRDT_NODE *pCurrent )
//if the node is new and we havent displayed it yet
if( pCurrent->uiLastTime == 0 )
{
-
}
//else we have to restore were the string was
@@ -1091,7 +805,6 @@ BOOLEAN DisplayCreditNode( CRDT_NODE *pCurrent )
GetVideoSurface( &hVSurface, pCurrent->uiVideoSurfaceImage );
-
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, pCurrent->sPosX, pCurrent->sPosY, VS_BLT_CLIPPED | VS_BLT_USECOLORKEY, NULL );
return( TRUE );
@@ -1376,7 +1089,6 @@ BOOLEAN GetNextCreditFromTextFile()
//Increment to the next crdit record
guiCurrentCreditRecord++;
-
//if there are no codes in the string
if( zOriginalString[0] != CRDT_START_CODE )
{
@@ -1394,7 +1106,6 @@ BOOLEAN GetNextCreditFromTextFile()
//Retrive all the codes from the string
pzEndCode = wcsstr( zOriginalString, CRDT_END_CODE );
-
//Make a string for the codes
wcscpy( zCodes, zOriginalString );
@@ -1466,10 +1177,6 @@ BOOLEAN GetNextCreditFromTextFile()
//return any flags that need to be set in the node
UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode )
{
-//new codes:
-
-
-
//if the code is to change the delay between strings
if( pzCode[0] == CRDT_DELAY_BN_STRINGS_CODE )
{
@@ -1477,13 +1184,10 @@ UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode )
//Get the delay from the string
swscanf( &pzCode[1], L"%d%*s", &uiNewDelay );
-
-// guiCrdtDelayBetweenNodes = uiNewDelay;
guiGapBetweenCreditNodes = uiNewDelay;
return( CRDT_NODE_NONE );
}
-
//if the code is to change the delay between sections strings
else if( pzCode[0] == CRDT_DELAY_BN_SECTIONS_CODE )
{
@@ -1491,14 +1195,10 @@ UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode )
//Get the delay from the string
swscanf( &pzCode[1], L"%d%*s", &uiNewDelay );
-
-// guiCrdtDelayBetweenCreditSection = uiNewDelay;
guiGapBetweenCreditSections = uiNewDelay;
return( CRDT_NODE_NONE );
}
-
-
else if( pzCode[0] == CRDT_SCROLL_SPEED )
{
UINT32 uiScrollSpeed=0;
@@ -1510,7 +1210,6 @@ UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode )
return( CRDT_NODE_NONE );
}
-
else if( pzCode[0] == CRDT_FONT_JUSTIFICATION )
{
UINT32 uiJustification=0;
@@ -1536,45 +1235,30 @@ UINT32 GetAndHandleCreditCodeFromCodeString( STR16 pzCode )
return( CRDT_NODE_NONE );
}
-
else if( pzCode[0] == CRDT_TITLE_FONT_COLOR )
{
- //Get the new color for the title
-//SB: memory corruption fix
-// swscanf( &pzCode[1], L"%d%*s", &gubCreditScreenTitleColor );
UINT uiBuffer = 0;
swscanf( &pzCode[1], L"%d%*s", &uiBuffer );
gubCreditScreenTitleColor = (UINT8)uiBuffer;
return( CRDT_NODE_NONE );
}
-
else if( pzCode[0] == CRDT_ACTIVE_FONT_COLOR )
{
- //Get the new color for the active text
-//SB: memory corruption fix
-// swscanf( &pzCode[1], L"%d%*s", &gubCreditScreenActiveColor );
UINT uiBuffer = 0;
swscanf( &pzCode[1], L"%d%*s", &uiBuffer );
gubCreditScreenActiveColor = (UINT8)uiBuffer;
return( CRDT_NODE_NONE );
}
-
-
- //else its the title code
else if( pzCode[0] == CRDT_TITLE )
{
return( CRDT_FLAG__TITLE );
}
-
- //else its the title code
else if( pzCode[0] == CRDT_START_OF_SECTION )
{
return( CRDT_FLAG__START_SECTION );
}
-
- //else its the title code
else if( pzCode[0] == CRDT_END_OF_SECTION )
{
return( CRDT_FLAG__END_SECTION );
@@ -1609,8 +1293,6 @@ STR16 GetNextCreditCode( STR16 pString, UINT32 *pSizeOfCode )
//if there is no separation code, then there must be an end code
if( pzNewCode == NULL )
{
- //pzNewCode = wcsstr( pString, CRDT_END_CODE );
-
//we are done
pzNewCode = NULL;
}
@@ -1619,7 +1301,6 @@ STR16 GetNextCreditCode( STR16 pString, UINT32 *pSizeOfCode )
//get rid of separeation code
pzNewCode++;
-
//calc size of sub string
uiSizeOfCode = pzNewCode - pString;
}
@@ -1628,7 +1309,6 @@ STR16 GetNextCreditCode( STR16 pString, UINT32 *pSizeOfCode )
return( pzNewCode );
}
-
//Flags:
void HandleCreditFlags( UINT32 uiFlags )
{
@@ -1638,19 +1318,15 @@ void HandleCreditFlags( UINT32 uiFlags )
if( uiFlags & CRDT_FLAG__START_SECTION )
{
-// guiCrdtTimeTillReadNextCredit = guiCrdtDelayBetweenNodes;
guiGapTillReadNextCredit = guiGapBetweenCreditNodes;
}
if( uiFlags & CRDT_FLAG__END_SECTION )
{
-// guiCrdtTimeTillReadNextCredit = guiCrdtDelayBetweenCreditSection;
guiGapTillReadNextCredit = guiGapBetweenCreditSections;
}
}
-
-
void SelectCreditFaceRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
{
if (iReason & MSYS_CALLBACK_REASON_INIT)
@@ -1700,9 +1376,9 @@ void HandleCreditEyeBlinking()
{
if( ( GetJA2Clock() - gCreditFaces[ubCnt].uiLastBlinkTime ) > (UINT32)gCreditFaces[ubCnt].sBlinkFreq )
{
- BltVideoObject( FRAME_BUFFER, hPixHandle, (UINT8)(ubCnt*3), gCreditFaces[ubCnt].sEyeX, gCreditFaces[ubCnt].sEyeY, VO_BLT_SRCTRANSPARENCY, NULL);
+ BltVideoObject( FRAME_BUFFER, hPixHandle, (UINT8)(ubCnt*3), gCreditFaces[ubCnt].sEyeX + xResOffset, gCreditFaces[ubCnt].sEyeY + yResOffset, VO_BLT_SRCTRANSPARENCY, NULL);
- InvalidateRegion( gCreditFaces[ubCnt].sEyeX, gCreditFaces[ubCnt].sEyeY, gCreditFaces[ubCnt].sEyeX + CRDT_EYE_WIDTH, gCreditFaces[ubCnt].sEyeY + CRDT_EYE_HEIGHT );
+ InvalidateRegion( gCreditFaces[ubCnt].sEyeX + xResOffset, gCreditFaces[ubCnt].sEyeY + yResOffset, gCreditFaces[ubCnt].sEyeX + CRDT_EYE_WIDTH + xResOffset, gCreditFaces[ubCnt].sEyeY + CRDT_EYE_HEIGHT + yResOffset );
gCreditFaces[ubCnt].uiLastBlinkTime = GetJA2Clock();
@@ -1712,7 +1388,7 @@ void HandleCreditEyeBlinking()
{
gCreditFaces[ubCnt].uiEyesClosedTime = 0;
- RestoreExternBackgroundRect( gCreditFaces[ubCnt].sEyeX, gCreditFaces[ubCnt].sEyeY, CRDT_EYE_WIDTH, CRDT_EYE_HEIGHT );
+ RestoreExternBackgroundRect( gCreditFaces[ubCnt].sEyeX + xResOffset, gCreditFaces[ubCnt].sEyeY + yResOffset, CRDT_EYE_WIDTH, CRDT_EYE_HEIGHT );
}
}
}
diff --git a/Editor/Editor_VS2010.vcxproj b/Editor/Editor_VS2010.vcxproj
index 19d9aa89..28e3dd05 100644
--- a/Editor/Editor_VS2010.vcxproj
+++ b/Editor/Editor_VS2010.vcxproj
@@ -143,24 +143,24 @@
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
diff --git a/Editor/LoadScreen.cpp b/Editor/LoadScreen.cpp
index b7acf76c..253ddfd6 100644
--- a/Editor/LoadScreen.cpp
+++ b/Editor/LoadScreen.cpp
@@ -955,7 +955,7 @@ void HandleMouseWheelEvents(void)//dnl ch36 150909
void InitErrorCatchDialog()
{
- SGPRect CenteringRect= {0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1 };
+ SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT };
// do message box and return
giErrorCatchMessageBox = DoMessageBox( MSG_BOX_BASIC_STYLE, gzErrorCatchString,
diff --git a/Editor/messagebox.cpp b/Editor/messagebox.cpp
index 4f4b58ca..2a2b5eaf 100644
--- a/Editor/messagebox.cpp
+++ b/Editor/messagebox.cpp
@@ -76,7 +76,7 @@ BOOLEAN MessageBoxHandled()
{
InputAtom DummyEvent;
- while( DequeueEvent( &DummyEvent ) )
+ while (DequeueSpecificEvent(&DummyEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if ( DummyEvent.usEvent == KEY_DOWN )
{
diff --git a/Editor/popupmenu.cpp b/Editor/popupmenu.cpp
index 33ae1de6..d80cab2f 100644
--- a/Editor/popupmenu.cpp
+++ b/Editor/popupmenu.cpp
@@ -397,7 +397,7 @@ void PopupMenuHandle()
return;
}
//Use keyboard input as well.
- while( DequeueEvent( &InputEvent ) )
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
switch(InputEvent.usEvent)
{
diff --git a/GameInitOptionsScreen.cpp b/GameInitOptionsScreen.cpp
index 628464ba..46e6e9ac 100644
--- a/GameInitOptionsScreen.cpp
+++ b/GameInitOptionsScreen.cpp
@@ -71,6 +71,7 @@
#define GIO_MAIN_TITLE_Y iScreenHeightOffset + 10
#define GIO_MAIN_TITLE_WIDTH SCREEN_WIDTH
+////////////////////////////////////////////////////////////////////////////////////////////////////
//radio box locations
#define GIO_GAP_BN_SETTINGS 35
#define GIO_OFFSET_TO_TEXT 36
@@ -79,64 +80,178 @@
#define GIO_TITLE_DISTANCE 30 // higher means closer
-#define GIO_DIF_SETTING_X iScreenWidthOffset + 48
-#define GIO_DIF_SETTING_Y iScreenHeightOffset + 55
-#define GIO_DIF_SETTING_WIDTH GIO_OFFSET_TO_TOGGLE_BOX - GIO_OFFSET_TO_TEXT
+// ---------------------------------
+// Y-Offset for Combo-Controls
+#define COMBO_Y_OFFSET 63
+// Y-Offset for Check-Controls
+#define CHECK_Y_OFFSET 50
-#define GIO_IMP_SETTING_X GIO_DIF_SETTING_X
-#define GIO_IMP_SETTING_Y GIO_DIF_SETTING_Y + 63
-#define GIO_IMP_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+#define CORRECTION_Y_OFFSET (COMBO_Y_OFFSET - CHECK_Y_OFFSET)
-// old/new traits
-#define GIO_TRAITS_SETTING_X GIO_DIF_SETTING_X + 36
-#define GIO_TRAITS_SETTING_Y GIO_IMP_SETTING_Y + 52
-#define GIO_TRAITS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+// X-Offset for Checkbox-Controls
+#define CHECK_X_OFFSET 36
+#define COMBO_X_OFFSET 0
-// Madd
-#define GIO_GAME_SETTING_X GIO_TRAITS_SETTING_X
-#define GIO_GAME_SETTING_Y GIO_TRAITS_SETTING_Y + 67
-#define GIO_GAME_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+#define CHECK_WIDTH (GIO_OFFSET_TO_TOGGLE_BOX - GIO_OFFSET_TO_TEXT)
+#define COMBO_WIDTH (GIO_OFFSET_TO_TOGGLE_BOX - GIO_OFFSET_TO_TEXT)
-#define GIO_IRON_MAN_SETTING_X GIO_TRAITS_SETTING_X
-#define GIO_IRON_MAN_SETTING_Y GIO_GAME_SETTING_Y + 67
-#define GIO_IRON_MAN_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
-// Tex and Jon
-#define GIO_TERRORISTS_SETTING_X GIO_TRAITS_SETTING_X
-#define GIO_TERRORISTS_SETTING_Y GIO_IRON_MAN_SETTING_Y + 67
-#define GIO_TERRORISTS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+/*********************************
+ FIRST COLUMN
+**********************************/
-#define GIO_BR_SETTING_X iScreenWidthOffset + 370
-#define GIO_BR_SETTING_Y GIO_DIF_SETTING_Y
-#define GIO_BR_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+#define FIRST_COLUMN_X iScreenWidthOffset + 10
+#define FIRST_COLUMN_Y iScreenHeightOffset + 75
-#define GIO_SQUAD_SIZE_SETTING_X GIO_BR_SETTING_X
-#define GIO_SQUAD_SIZE_SETTING_Y GIO_BR_SETTING_Y + 63
-#define GIO_SQUAD_SIZE_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+#define GIO_DIF_SETTING_X FIRST_COLUMN_X + COMBO_X_OFFSET
+#define GIO_DIF_SETTING_Y FIRST_COLUMN_Y
+#define GIO_DIF_SETTING_WIDTH COMBO_WIDTH
-#define GIO_INV_SETTING_X GIO_SQUAD_SIZE_SETTING_X
-#define GIO_INV_SETTING_Y GIO_SQUAD_SIZE_SETTING_Y + 63
-#define GIO_INV_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+#define GIO_IMP_SETTING_X FIRST_COLUMN_X + COMBO_X_OFFSET
+#define GIO_IMP_SETTING_Y GIO_DIF_SETTING_Y + COMBO_Y_OFFSET
+#define GIO_IMP_SETTING_WIDTH COMBO_WIDTH
-#define GIO_DROPALL_SETTING_X GIO_INV_SETTING_X + 36
-#define GIO_DROPALL_SETTING_Y GIO_INV_SETTING_Y + 56
-#define GIO_DROPALL_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+#define GIO_TRAITS_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
+#define GIO_TRAITS_SETTING_Y GIO_IMP_SETTING_Y + CHECK_Y_OFFSET
+#define GIO_TRAITS_SETTING_WIDTH CHECK_WIDTH
-#define GIO_GUN_SETTING_X GIO_DROPALL_SETTING_X
-#define GIO_GUN_SETTING_Y GIO_DROPALL_SETTING_Y + 67
-#define GIO_GUN_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+#define GIO_GAME_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
+#define GIO_GAME_SETTING_Y GIO_TRAITS_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_GAME_SETTING_WIDTH CHECK_WIDTH
-#define GIO_CACHES_SETTING_X GIO_GUN_SETTING_X
-#define GIO_CACHES_SETTING_Y GIO_GUN_SETTING_Y + 67
-#define GIO_CACHES_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+#define GIO_IRON_MAN_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
+#define GIO_IRON_MAN_SETTING_Y GIO_GAME_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_IRON_MAN_SETTING_WIDTH CHECK_WIDTH
-#define GIO_TIMED_TURN_SETTING_X GIO_GUN_SETTING_X
-#define GIO_TIMED_TURN_SETTING_Y GIO_IRON_MAN_SETTING_Y
-#define GIO_TIMED_TURN_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+#define GIO_TIMED_TURN_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
+#define GIO_TIMED_TURN_SETTING_Y GIO_IRON_MAN_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_TIMED_TURN_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_TERRORISTS_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
+#define GIO_TERRORISTS_SETTING_Y GIO_IRON_MAN_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_TERRORISTS_SETTING_WIDTH CHECK_WIDTH
+
+/*********************************
+ SECOND COLUMN
+**********************************/
+
+#define SECOND_COLUMN_X iScreenWidthOffset + 210
+#define SECOND_COLUMN_Y FIRST_COLUMN_Y
+
+#define GIO_INV_SETTING_X SECOND_COLUMN_X + COMBO_X_OFFSET
+#define GIO_INV_SETTING_Y SECOND_COLUMN_Y
+#define GIO_INV_SETTING_WIDTH COMBO_WIDTH
+
+#define GIO_PROGRESS_SETTING_X SECOND_COLUMN_X + COMBO_X_OFFSET
+#define GIO_PROGRESS_SETTING_Y GIO_INV_SETTING_Y + COMBO_Y_OFFSET
+#define GIO_PROGRESS_SETTING_WIDTH COMBO_WIDTH
+
+#define GIO_GUN_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
+#define GIO_GUN_SETTING_Y GIO_PROGRESS_SETTING_Y + CHECK_Y_OFFSET
+#define GIO_GUN_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_DROPALL_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
+#define GIO_DROPALL_SETTING_Y GIO_GUN_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_DROPALL_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_OVERHEATING_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
+#define GIO_OVERHEATING_SETTING_Y GIO_DROPALL_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_OVERHEATING_SETTING_WIDTH CHECK_WIDTH
+
+/*********************************
+ THIRD COLUMN
+**********************************/
+
+#define THIRD_COLUMN_X iScreenWidthOffset + 413
+#define THIRD_COLUMN_Y FIRST_COLUMN_Y
+
+#define GIO_SQUAD_SIZE_SETTING_X THIRD_COLUMN_X + COMBO_X_OFFSET
+#define GIO_SQUAD_SIZE_SETTING_Y THIRD_COLUMN_Y
+#define GIO_SQUAD_SIZE_SETTING_WIDTH COMBO_WIDTH
+
+#define GIO_BR_SETTING_X THIRD_COLUMN_X + COMBO_X_OFFSET
+#define GIO_BR_SETTING_Y GIO_SQUAD_SIZE_SETTING_Y + COMBO_Y_OFFSET
+#define GIO_BR_SETTING_WIDTH COMBO_WIDTH
+
+#define GIO_NCTH_SETTING_X THIRD_COLUMN_X + CHECK_X_OFFSET
+#define GIO_NCTH_SETTING_Y GIO_BR_SETTING_Y + CHECK_Y_OFFSET
+#define GIO_NCTH_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_IIS_SETTING_X THIRD_COLUMN_X + CHECK_X_OFFSET
+#define GIO_IIS_SETTING_Y GIO_NCTH_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_IIS_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_INVENTORY_AP_SETTING_X THIRD_COLUMN_X + CHECK_X_OFFSET
+#define GIO_INVENTORY_AP_SETTING_Y GIO_IIS_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_INVENTORY_AP_SETTING_WIDTH CHECK_WIDTH
+
+////radio box locations
+//#define GIO_GAP_BN_SETTINGS 35
+//#define GIO_OFFSET_TO_TEXT 36
+//#define GIO_OFFSET_TO_TOGGLE_BOX 180
+//#define GIO_OFFSET_TO_TOGGLE_BOX_Y 9
+//
+//#define GIO_TITLE_DISTANCE 30 // higher means closer
+//
+//#define GIO_DIF_SETTING_X iScreenWidthOffset + 48
+//#define GIO_DIF_SETTING_Y iScreenHeightOffset + 55
+//#define GIO_DIF_SETTING_WIDTH GIO_OFFSET_TO_TOGGLE_BOX - GIO_OFFSET_TO_TEXT
+//
+//#define GIO_IMP_SETTING_X GIO_DIF_SETTING_X
+//#define GIO_IMP_SETTING_Y GIO_DIF_SETTING_Y + 63
+//#define GIO_IMP_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//// old/new traits
+//#define GIO_TRAITS_SETTING_X GIO_DIF_SETTING_X + 36
+//#define GIO_TRAITS_SETTING_Y GIO_IMP_SETTING_Y + 52
+//#define GIO_TRAITS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//// Madd
+//#define GIO_GAME_SETTING_X GIO_TRAITS_SETTING_X
+//#define GIO_GAME_SETTING_Y GIO_TRAITS_SETTING_Y + 67
+//#define GIO_GAME_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//#define GIO_IRON_MAN_SETTING_X GIO_TRAITS_SETTING_X
+//#define GIO_IRON_MAN_SETTING_Y GIO_GAME_SETTING_Y + 67
+//#define GIO_IRON_MAN_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//// Tex and Jon
+//#define GIO_TERRORISTS_SETTING_X GIO_TRAITS_SETTING_X
+//#define GIO_TERRORISTS_SETTING_Y GIO_IRON_MAN_SETTING_Y + 67
+//#define GIO_TERRORISTS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//#define GIO_BR_SETTING_X iScreenWidthOffset + 370
+//#define GIO_BR_SETTING_Y GIO_DIF_SETTING_Y
+//#define GIO_BR_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//#define GIO_SQUAD_SIZE_SETTING_X GIO_BR_SETTING_X
+//#define GIO_SQUAD_SIZE_SETTING_Y GIO_BR_SETTING_Y + 63
+//#define GIO_SQUAD_SIZE_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//#define GIO_INV_SETTING_X GIO_SQUAD_SIZE_SETTING_X
+//#define GIO_INV_SETTING_Y GIO_SQUAD_SIZE_SETTING_Y + 63
+//#define GIO_INV_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//#define GIO_DROPALL_SETTING_X GIO_INV_SETTING_X + 36
+//#define GIO_DROPALL_SETTING_Y GIO_INV_SETTING_Y + 56
+//#define GIO_DROPALL_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//#define GIO_GUN_SETTING_X GIO_DROPALL_SETTING_X
+//#define GIO_GUN_SETTING_Y GIO_DROPALL_SETTING_Y + 67
+//#define GIO_GUN_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//#define GIO_CACHES_SETTING_X GIO_GUN_SETTING_X
+//#define GIO_CACHES_SETTING_Y GIO_GUN_SETTING_Y + 67
+//#define GIO_CACHES_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//#define GIO_TIMED_TURN_SETTING_X GIO_GUN_SETTING_X
+//#define GIO_TIMED_TURN_SETTING_Y GIO_IRON_MAN_SETTING_Y
+//#define GIO_TIMED_TURN_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
+//
+//#define GIO_PROGRESS_SETTING_X GIO_SQUAD_SIZE_SETTING_X
+//#define GIO_PROGRESS_SETTING_Y GIO_TERRORISTS_SETTING_Y + 13
+//#define GIO_PROGRESS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
-#define GIO_PROGRESS_SETTING_X GIO_SQUAD_SIZE_SETTING_X
-#define GIO_PROGRESS_SETTING_Y GIO_TERRORISTS_SETTING_Y + 13
-#define GIO_PROGRESS_SETTING_WIDTH GIO_DIF_SETTING_WIDTH
// INI File
@@ -262,10 +377,10 @@ enum
enum
{
- GIO_DROPALL_OFF,
- GIO_DROPALL_ON,
+ GIO_BUTTON_OFF,
+ GIO_BUTTON_ON,
- NUM_DROPALL_OPTIONS,
+ GIO_NUM_ONOFF_BUTTONS,
};
// Gun options
@@ -277,15 +392,6 @@ enum
NUM_GUN_OPTIONS,
};
-enum
-{
- GIO_CACHES_RANDOM,
- GIO_CACHES_ALL,
-
- NUM_CACHES_OPTIONS,
-};
-
-
// Timed turns setting (Multiplayer exclusive)
enum
{
@@ -387,7 +493,6 @@ UINT32 guiGameTextToggles[ NUM_TEXT_STYLES ];
UINT32 guiGameStyleTogglesImage[ NUM_GAME_STYLES ];
UINT32 guiGameStyleToggles[ NUM_GAME_STYLES ];
-
void BtnGIOOffStyleCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIOOnStyleCallback(GUI_BUTTON *btn,INT32 reason);
@@ -399,12 +504,11 @@ void BtnGIOIronManOnCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiRpcOptionTogglesImage[ NUM_RPC_UB_OPTIONS ];
UINT32 guiRpcOptionToggles[ NUM_RPC_UB_OPTIONS ];
-
void BtnGIORpcRandomCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIORpcAllCallback(GUI_BUTTON *btn,INT32 reason);
-UINT32 guiDropAllOptionTogglesImage[ NUM_DROPALL_OPTIONS ];
-UINT32 guiDropAllOptionToggles[ NUM_DROPALL_OPTIONS ];
+UINT32 guiDropAllOptionTogglesImage[ GIO_NUM_ONOFF_BUTTONS ];
+UINT32 guiDropAllOptionToggles[ GIO_NUM_ONOFF_BUTTONS ];
void BtnGIODropAllOffCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIODropAllOnCallback(GUI_BUTTON *btn,INT32 reason);
@@ -414,12 +518,35 @@ UINT32 guiGunOptionToggles[ NUM_GUN_OPTIONS ];
void BtnGIOGunSettingReducedCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIOGunSettingToGCallback(GUI_BUTTON *btn,INT32 reason);
-
UINT32 giGIOSquadSizeButton[ 2 ];
INT32 giGIOSquadSizeButtonImage[ 2 ];
void BtnGIOSquadSizeSelectionLeftCallback( GUI_BUTTON *btn,INT32 reason );
void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason );
+// Inventory AP
+UINT32 guiInventoryAPOptionTogglesImage[ GIO_NUM_ONOFF_BUTTONS ];
+UINT32 guiInventoryAPOptionToggles[ GIO_NUM_ONOFF_BUTTONS ];
+void BtnGIOInventoryAPOffCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIOInventoryAPOnCallback(GUI_BUTTON *btn,INT32 reason);
+
+// NCTH
+UINT32 guiNCTHOptionTogglesImage[ GIO_NUM_ONOFF_BUTTONS ];
+UINT32 guiNCTHOptionToggles[ GIO_NUM_ONOFF_BUTTONS ];
+void BtnGIONCTHOffCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIONCTHOnCallback(GUI_BUTTON *btn,INT32 reason);
+
+// IIS
+UINT32 guiImprovedInterruptOptionTogglesImage[ GIO_NUM_ONOFF_BUTTONS ];
+UINT32 guiImprovedInterruptOptionToggles[ GIO_NUM_ONOFF_BUTTONS ];
+void BtnGIOImprovedInterruptOffCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIOImprovedInterruptOnCallback(GUI_BUTTON *btn,INT32 reason);
+
+// Overheating
+UINT32 guiOverheatingOptionTogglesImage[ GIO_NUM_ONOFF_BUTTONS ];
+UINT32 guiOverheatingOptionToggles[ GIO_NUM_ONOFF_BUTTONS ];
+void BtnGIOOverheatingOffCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIOOverheatingOnCallback(GUI_BUTTON *btn,INT32 reason);
+
UINT32 guiTimedTurnToggles[ GIO_NUM_TIMED_TURN_OPTIONS ];
void BtnTimedTurnsTogglesCallback(GUI_BUTTON *btn,INT32 reason);
@@ -450,6 +577,11 @@ UINT8 GetCurrentTraitsOptionButtonSetting();
UINT8 GetCurrentDropAllButtonSetting();
UINT8 GetCurrentTexAndJohnButtonSetting();
+UINT8 GetCurrentInventoryAPButtonSetting();
+UINT8 GetCurrentNCTHButtonSetting();
+UINT8 GetCurrentIISButtonSetting();
+UINT8 GetCurrentOverheatingButtonSetting();
+
void DoneFadeOutForExitGameInitOptionScreen( void );
void DoneFadeInForExitGameInitOptionScreen( void );
UINT8 GetCurrentTimedTurnsButtonSetting();
@@ -567,13 +699,17 @@ UINT32 GameInitOptionsScreenInit( void )
// Squad size (Default: 6)
UINT8 ubSquadSize = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_SQUAD_SIZE, 6);
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
ubSquadSize = 6;
gGameOptions.ubSquadSize = ubSquadSize;
-
- // Secret Weapon Caches (Default: Random = 0)
- gGameOptions.fEnableAllWeaponCaches = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_SECRET_WEAPON_CACHES, 0);
+
+ //Inventory AP Costs
+ gGameOptions.fInventoryCostsAP = FALSE;
+
+ gGameOptions.fUseNCTH = FALSE;
+ gGameOptions.fImprovedInterruptSystem = FALSE;
+ gGameOptions.fWeaponOverheating = FALSE;
gGameOptions.fAirStrikes = FALSE;
gGameOptions.fTurnTimeLimit = FALSE;
@@ -654,18 +790,12 @@ BOOLEAN EnterGIOScreen()
// load the Main trade screen backgroiund image
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
- {
+ if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround.sti", VObjectDesc.ImageFile);
- }
- else if (iResolution == 1)
- {
+ else if (iResolution < _1024x768)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_800x600.sti", VObjectDesc.ImageFile);
- }
- else if (iResolution == 2)
- {
+ else
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_1024x768.sti", VObjectDesc.ImageFile);
- }
CHECKF(AddVideoObject(&VObjectDesc, &guiGIOMainBackGroundImage ));
@@ -966,31 +1096,31 @@ BOOLEAN EnterGIOScreen()
///////////////////////////////////////////////////////////////////////////////////////////////////////
// DROP ALL ON/OFF SETTING
- guiDropAllOptionTogglesImage[ GIO_DROPALL_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
- guiDropAllOptionToggles[ GIO_DROPALL_OFF ] = CreateIconAndTextButton( guiDropAllOptionTogglesImage[ GIO_DROPALL_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ guiDropAllOptionTogglesImage[ GIO_BUTTON_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiDropAllOptionToggles[ GIO_BUTTON_OFF ] = CreateIconAndTextButton( guiDropAllOptionTogglesImage[ GIO_BUTTON_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
(GIO_DROPALL_SETTING_X), (GIO_DROPALL_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIODropAllOffCallback);
- guiDropAllOptionTogglesImage[ GIO_DROPALL_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
- guiDropAllOptionToggles[ GIO_DROPALL_ON ] = CreateIconAndTextButton( guiDropAllOptionTogglesImage[ GIO_DROPALL_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ guiDropAllOptionTogglesImage[ GIO_BUTTON_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiDropAllOptionToggles[ GIO_BUTTON_ON ] = CreateIconAndTextButton( guiDropAllOptionTogglesImage[ GIO_BUTTON_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
(GIO_DROPALL_SETTING_X + 74), (GIO_DROPALL_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIODropAllOnCallback );
- SpecifyButtonSoundScheme( guiDropAllOptionToggles[ GIO_DROPALL_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
- SpecifyButtonSoundScheme( guiDropAllOptionToggles[ GIO_DROPALL_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
- MSYS_SetBtnUserData(guiDropAllOptionToggles[ GIO_DROPALL_OFF ],0, 0 );
- MSYS_SetBtnUserData(guiDropAllOptionToggles[ GIO_DROPALL_ON ],0, 1 );
+ SpecifyButtonSoundScheme( guiDropAllOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiDropAllOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiDropAllOptionToggles[ GIO_BUTTON_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiDropAllOptionToggles[ GIO_BUTTON_ON ],0, 1 );
if( gGameOptions.fEnemiesDropAllItems )
- ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ ButtonList[ guiDropAllOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
else
- ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ ButtonList[ guiDropAllOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// GUN SETTING
@@ -1023,7 +1153,7 @@ BOOLEAN EnterGIOScreen()
///////////////////////////////////////////////////////////////////////////////////////////////////////
// SQUAD SIZE
- if (iResolution > 0)
+ if (iResolution > _640x480)
{
giGIOSquadSizeButtonImage[ 0 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,0,-1,1,-1 );
giGIOSquadSizeButtonImage[ 1 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,2,-1,3,-1 );
@@ -1056,6 +1186,127 @@ BOOLEAN EnterGIOScreen()
}
}
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // INVENTORY AP COST ON/OFF SETTING
+
+ guiInventoryAPOptionTogglesImage[ GIO_BUTTON_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ] = CreateIconAndTextButton( guiInventoryAPOptionTogglesImage[ GIO_BUTTON_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_INVENTORY_AP_SETTING_X), (GIO_INVENTORY_AP_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOInventoryAPOffCallback);
+
+ guiInventoryAPOptionTogglesImage[ GIO_BUTTON_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiInventoryAPOptionToggles[ GIO_BUTTON_ON ] = CreateIconAndTextButton( guiInventoryAPOptionTogglesImage[ GIO_BUTTON_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_INVENTORY_AP_SETTING_X + 74), (GIO_INVENTORY_AP_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOInventoryAPOnCallback );
+
+ SpecifyButtonSoundScheme( guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiInventoryAPOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiInventoryAPOptionToggles[ GIO_BUTTON_ON ],0, 1 );
+
+ if( gGameOptions.fInventoryCostsAP )
+ ButtonList[ guiInventoryAPOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // NCTH ON/OFF SETTING
+
+ guiNCTHOptionTogglesImage[ GIO_BUTTON_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiNCTHOptionToggles[ GIO_BUTTON_OFF ] = CreateIconAndTextButton( guiNCTHOptionTogglesImage[ GIO_BUTTON_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_NCTH_SETTING_X), (GIO_NCTH_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIONCTHOffCallback);
+
+ guiNCTHOptionTogglesImage[ GIO_BUTTON_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiNCTHOptionToggles[ GIO_BUTTON_ON ] = CreateIconAndTextButton( guiNCTHOptionTogglesImage[ GIO_BUTTON_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_NCTH_SETTING_X + 74), (GIO_NCTH_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIONCTHOnCallback );
+
+ SpecifyButtonSoundScheme( guiNCTHOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiNCTHOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiNCTHOptionToggles[ GIO_BUTTON_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiNCTHOptionToggles[ GIO_BUTTON_ON ],0, 1 );
+
+ if( gGameOptions.fUseNCTH )
+ ButtonList[ guiNCTHOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiNCTHOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // IMPROVED INTERRUPT SYSTEM ON/OFF SETTING
+
+ guiImprovedInterruptOptionTogglesImage[ GIO_BUTTON_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ] = CreateIconAndTextButton( guiImprovedInterruptOptionTogglesImage[ GIO_BUTTON_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_IIS_SETTING_X), (GIO_IIS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOImprovedInterruptOffCallback);
+
+ guiImprovedInterruptOptionTogglesImage[ GIO_BUTTON_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ] = CreateIconAndTextButton( guiImprovedInterruptOptionTogglesImage[ GIO_BUTTON_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_IIS_SETTING_X + 74), (GIO_IIS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOImprovedInterruptOnCallback );
+
+ SpecifyButtonSoundScheme( guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ],0, 1 );
+
+ if( gGameOptions.fImprovedInterruptSystem )
+ ButtonList[ guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // OVERHEATING WEAPONS ON/OFF SETTING
+
+ guiOverheatingOptionTogglesImage[ GIO_BUTTON_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiOverheatingOptionToggles[ GIO_BUTTON_OFF ] = CreateIconAndTextButton( guiOverheatingOptionTogglesImage[ GIO_BUTTON_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_OVERHEATING_SETTING_X), (GIO_OVERHEATING_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOOverheatingOffCallback);
+
+ guiOverheatingOptionTogglesImage[ GIO_BUTTON_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiOverheatingOptionToggles[ GIO_BUTTON_ON ] = CreateIconAndTextButton( guiOverheatingOptionTogglesImage[ GIO_BUTTON_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_OVERHEATING_SETTING_X + 74), (GIO_OVERHEATING_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOOverheatingOnCallback );
+
+ SpecifyButtonSoundScheme( guiOverheatingOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiOverheatingOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiOverheatingOptionToggles[ GIO_BUTTON_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiOverheatingOptionToggles[ GIO_BUTTON_ON ],0, 1 );
+
+ if( gGameOptions.fWeaponOverheating )
+ ButtonList[ guiOverheatingOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiOverheatingOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
//Reset the exit screen
gubGIOExitScreen = GAME_INIT_OPTIONS_SCREEN;
@@ -1660,10 +1911,10 @@ void BtnGIODropAllOffCallback(GUI_BUTTON *btn,INT32 reason)
{
RestoreExternBackgroundRect( (GIO_DROPALL_SETTING_X), (GIO_DROPALL_SETTING_Y + 10), 230, 40 );
- ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ ButtonList[ guiDropAllOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
btn->uiFlags|=(BUTTON_CLICKED_ON);
- PlayButtonSound( guiDropAllOptionToggles[ GIO_DROPALL_OFF ], BUTTON_SOUND_CLICKED_ON );
+ PlayButtonSound( guiDropAllOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_CLICKED_ON );
}
}
void BtnGIODropAllOnCallback(GUI_BUTTON *btn,INT32 reason)
@@ -1675,10 +1926,10 @@ void BtnGIODropAllOnCallback(GUI_BUTTON *btn,INT32 reason)
{
RestoreExternBackgroundRect( (GIO_DROPALL_SETTING_X), (GIO_DROPALL_SETTING_Y + 10), 230, 40 );
- ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ ButtonList[ guiDropAllOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
btn->uiFlags|=(BUTTON_CLICKED_ON);
- PlayButtonSound( guiDropAllOptionToggles[ GIO_DROPALL_ON ], BUTTON_SOUND_CLICKED_ON );
+ PlayButtonSound( guiDropAllOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_CLICKED_ON );
}
}
@@ -1765,7 +2016,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
- if (iResolution == 1)
+ if (iResolution >= _800x600 && iResolution < _1024x768)
maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize )
@@ -1785,7 +2036,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
btn->uiFlags|=(BUTTON_CLICKED_ON);
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
- if (iResolution == 1)
+ if (iResolution >= _800x600 && iResolution < _1024x768)
maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize )
@@ -1809,6 +2060,131 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
}
}
+
+void BtnGIOInventoryAPOffCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_INVENTORY_AP_SETTING_X), (GIO_INVENTORY_AP_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiInventoryAPOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIOInventoryAPOnCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_INVENTORY_AP_SETTING_X), (GIO_INVENTORY_AP_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiInventoryAPOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
+void BtnGIONCTHOffCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_NCTH_SETTING_X), (GIO_NCTH_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiNCTHOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiNCTHOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIONCTHOnCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_NCTH_SETTING_X), (GIO_NCTH_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiNCTHOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiNCTHOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
+void BtnGIOImprovedInterruptOffCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_IIS_SETTING_X), (GIO_IIS_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIOImprovedInterruptOnCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_IIS_SETTING_X), (GIO_IIS_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
+void BtnGIOOverheatingOffCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_OVERHEATING_SETTING_X), (GIO_OVERHEATING_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiOverheatingOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiOverheatingOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIOOverheatingOnCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_OVERHEATING_SETTING_X), (GIO_OVERHEATING_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiOverheatingOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiOverheatingOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
BOOLEAN ExitGIOScreen()
{
UINT16 cnt;
@@ -1890,7 +2266,7 @@ BOOLEAN ExitGIOScreen()
}
// Destroy Drop All setting buttons
- for( cnt=0; cnt 0)
+ if (iResolution > _640x480)
{
RemoveButton( giGIOSquadSizeButton[0] );
RemoveButton( giGIOSquadSizeButton[1] );
UnloadButtonImage( giGIOSquadSizeButtonImage[0] );
UnloadButtonImage( giGIOSquadSizeButtonImage[1] );
}
+
+ // Destroy Inventory AP Cost setting buttons
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+UINT8 GetCurrentNCTHButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+UINT8 GetCurrentIISButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+UINT8 GetCurrentOverheatingButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
void DoneFadeOutForExitGameInitOptionScreen( void )
{
// loop through and get the status of all the buttons
@@ -2321,9 +2792,13 @@ void DoneFadeOutForExitGameInitOptionScreen( void )
gGameUBOptions.fTexAndJohn = GetCurrentTexAndJohnButtonSetting();
gGameOptions.fEnemiesDropAllItems = GetCurrentDropAllButtonSetting();
- gGameOptions.fEnableAllWeaponCaches = FALSE;
gGameOptions.ubProgressSpeedOfItemsChoices = min( GIO_PROGRESS_VERY_FAST, iCurrentProgressSetting );
+ gGameOptions.fInventoryCostsAP = GetCurrentInventoryAPButtonSetting();
+ gGameOptions.fUseNCTH = GetCurrentNCTHButtonSetting();
+ gGameOptions.fImprovedInterruptSystem = GetCurrentIISButtonSetting();
+ gGameOptions.fWeaponOverheating = GetCurrentOverheatingButtonSetting();
+
gubGIOExitScreen = INIT_SCREEN;
//set the fact that we should do the intro videos
@@ -2357,7 +2832,7 @@ void DoneFadeInForExitGameInitOptionScreen( void )
BOOLEAN DoGioMessageBox( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback )
{
- SGPRect CenteringRect= {0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1 };
+ SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT };
// do message box and return
giGioMessageBox = DoMessageBox( ubStyle, zString, uiExitScreen, ( UINT16 ) ( usFlags| MSG_BOX_FLAG_USE_CENTERING_RECT ), ReturnCallback, &CenteringRect );
@@ -2481,9 +2956,6 @@ void RenderGIOSmallSelectionFrame(INT16 sX, INT16 sY)
#define GIO_TITLE_DISTANCE 30 // higher means closer
-#define GIO_OFFSET_TO_TEXT 36
-#define GIO_OFFSET_TO_TOGGLE_BOX 180
-
// ---------------------------------
// Y-Offset for Combo-Controls
#define COMBO_Y_OFFSET 63
@@ -2527,10 +2999,6 @@ void RenderGIOSmallSelectionFrame(INT16 sX, INT16 sY)
#define GIO_IRON_MAN_SETTING_Y GIO_GAME_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
#define GIO_IRON_MAN_SETTING_WIDTH CHECK_WIDTH
-#define GIO_TERRORISTS_SETTING_X FIRST_COLUMN_X + CHECK_X_OFFSET
-#define GIO_TERRORISTS_SETTING_Y GIO_IRON_MAN_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
-#define GIO_TERRORISTS_SETTING_WIDTH CHECK_WIDTH
-
/*********************************
SECOND COLUMN
@@ -2539,29 +3007,25 @@ void RenderGIOSmallSelectionFrame(INT16 sX, INT16 sY)
#define SECOND_COLUMN_X iScreenWidthOffset + 210
#define SECOND_COLUMN_Y FIRST_COLUMN_Y
-#define GIO_BR_SETTING_X SECOND_COLUMN_X + COMBO_X_OFFSET
-#define GIO_BR_SETTING_Y SECOND_COLUMN_Y
-#define GIO_BR_SETTING_WIDTH COMBO_WIDTH
-
-#define GIO_PROGRESS_SETTING_X SECOND_COLUMN_X + COMBO_X_OFFSET
-#define GIO_PROGRESS_SETTING_Y GIO_BR_SETTING_Y + COMBO_Y_OFFSET
-#define GIO_PROGRESS_SETTING_WIDTH COMBO_WIDTH
-
#define GIO_INV_SETTING_X SECOND_COLUMN_X + COMBO_X_OFFSET
-#define GIO_INV_SETTING_Y GIO_PROGRESS_SETTING_Y + COMBO_Y_OFFSET
+#define GIO_INV_SETTING_Y SECOND_COLUMN_Y
#define GIO_INV_SETTING_WIDTH COMBO_WIDTH
-#define GIO_DROPALL_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
-#define GIO_DROPALL_SETTING_Y GIO_INV_SETTING_Y + CHECK_Y_OFFSET
-#define GIO_DROPALL_SETTING_WIDTH CHECK_WIDTH
+#define GIO_PROGRESS_SETTING_X SECOND_COLUMN_X + COMBO_X_OFFSET
+#define GIO_PROGRESS_SETTING_Y GIO_INV_SETTING_Y + COMBO_Y_OFFSET
+#define GIO_PROGRESS_SETTING_WIDTH COMBO_WIDTH
#define GIO_GUN_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
-#define GIO_GUN_SETTING_Y GIO_DROPALL_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_GUN_SETTING_Y GIO_PROGRESS_SETTING_Y + CHECK_Y_OFFSET
#define GIO_GUN_SETTING_WIDTH CHECK_WIDTH
-#define GIO_CACHES_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
-#define GIO_CACHES_SETTING_Y GIO_GUN_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
-#define GIO_CACHES_SETTING_WIDTH CHECK_WIDTH
+#define GIO_DROPALL_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
+#define GIO_DROPALL_SETTING_Y GIO_GUN_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_DROPALL_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_OVERHEATING_SETTING_X SECOND_COLUMN_X + CHECK_X_OFFSET
+#define GIO_OVERHEATING_SETTING_Y GIO_DROPALL_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_OVERHEATING_SETTING_WIDTH CHECK_WIDTH
/*********************************
THIRD COLUMN
@@ -2574,7 +3038,21 @@ void RenderGIOSmallSelectionFrame(INT16 sX, INT16 sY)
#define GIO_SQUAD_SIZE_SETTING_Y THIRD_COLUMN_Y
#define GIO_SQUAD_SIZE_SETTING_WIDTH COMBO_WIDTH
+#define GIO_BR_SETTING_X THIRD_COLUMN_X + COMBO_X_OFFSET
+#define GIO_BR_SETTING_Y GIO_SQUAD_SIZE_SETTING_Y + COMBO_Y_OFFSET
+#define GIO_BR_SETTING_WIDTH COMBO_WIDTH
+#define GIO_NCTH_SETTING_X THIRD_COLUMN_X + CHECK_X_OFFSET
+#define GIO_NCTH_SETTING_Y GIO_BR_SETTING_Y + CHECK_Y_OFFSET
+#define GIO_NCTH_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_IIS_SETTING_X THIRD_COLUMN_X + CHECK_X_OFFSET
+#define GIO_IIS_SETTING_Y GIO_NCTH_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_IIS_SETTING_WIDTH CHECK_WIDTH
+
+#define GIO_INVENTORY_AP_SETTING_X THIRD_COLUMN_X + CHECK_X_OFFSET
+#define GIO_INVENTORY_AP_SETTING_Y GIO_IIS_SETTING_Y + CHECK_Y_OFFSET + CORRECTION_Y_OFFSET
+#define GIO_INVENTORY_AP_SETTING_WIDTH CHECK_WIDTH
@@ -2595,9 +3073,14 @@ void RenderGIOSmallSelectionFrame(INT16 sX, INT16 sY)
#define JA2SP_ENEMIES_DROP_ALL_ITEMS "ENEMIES_DROP_ALL_ITEMS"
#define JA2SP_EXTRA_DIFFICULTY "EXTRA_DIFFICULTY"
#define JA2SP_AVAILABLE_ARSENAL "AVAILABLE_ARSENAL"
-#define JA2SP_NUMBER_OF_TERRORISTS "NUMBER_OF_TERRORISTS"
-#define JA2SP_SECRET_WEAPON_CACHES "SECRET_WEAPON_CACHES"
+//#define JA2SP_NUMBER_OF_TERRORISTS "NUMBER_OF_TERRORISTS"
+//#define JA2SP_SECRET_WEAPON_CACHES "SECRET_WEAPON_CACHES"
#define JA2SP_SQUAD_SIZE "SQUAD_SIZE"
+//#define JA2SP_FAST_BR "FAST_BOBBY_RAY"
+#define JA2SP_INVENTORY_AP "INVENTORY_USE_AP"
+#define JA2SP_USE_NCTH "USE_NCTH"
+#define JA2SP_USE_IIS "IMPROVED_INTERRUPT_SYSTEM"
+#define JA2SP_OVERHEATING "WEAPON_OVERHEATING"
//Difficulty settings
@@ -2637,14 +3120,6 @@ enum
NUM_SAVE_OPTIONS,
};
-enum
-{
- GIO_TERRORISTS_RANDOM,
- GIO_TERRORISTS_ALL,
-
- NUM_TERRORISTS_OPTIONS,
-};
-
// BR options
enum
{
@@ -2688,10 +3163,10 @@ enum
enum
{
- GIO_DROPALL_OFF,
- GIO_DROPALL_ON,
+ GIO_BUTTON_OFF,
+ GIO_BUTTON_ON,
- NUM_DROPALL_OPTIONS,
+ GIO_NUM_ONOFF_BUTTONS,
};
// Gun options
@@ -2703,15 +3178,6 @@ enum
NUM_GUN_OPTIONS,
};
-enum
-{
- GIO_CACHES_RANDOM,
- GIO_CACHES_ALL,
-
- NUM_CACHES_OPTIONS,
-};
-
-
// Timed turns setting (Multiplayer exclusive)
enum
{
@@ -2819,13 +3285,8 @@ UINT32 guiGameSaveToggles[ NUM_SAVE_OPTIONS ];
void BtnGIOIronManOffCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIOIronManOnCallback(GUI_BUTTON *btn,INT32 reason);
-UINT32 guiTerroristsOptionTogglesImage[ NUM_TERRORISTS_OPTIONS ];
-UINT32 guiTerroristsOptionToggles[ NUM_TERRORISTS_OPTIONS ];
-void BtnGIOTerroristsRandomCallback(GUI_BUTTON *btn,INT32 reason);
-void BtnGIOTerroristsAllCallback(GUI_BUTTON *btn,INT32 reason);
-
-UINT32 guiDropAllOptionTogglesImage[ NUM_DROPALL_OPTIONS ];
-UINT32 guiDropAllOptionToggles[ NUM_DROPALL_OPTIONS ];
+UINT32 guiDropAllOptionTogglesImage[ GIO_NUM_ONOFF_BUTTONS ];
+UINT32 guiDropAllOptionToggles[ GIO_NUM_ONOFF_BUTTONS ];
void BtnGIODropAllOffCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIODropAllOnCallback(GUI_BUTTON *btn,INT32 reason);
@@ -2835,16 +3296,33 @@ UINT32 guiGunOptionToggles[ NUM_GUN_OPTIONS ];
void BtnGIOGunSettingReducedCallback(GUI_BUTTON *btn,INT32 reason);
void BtnGIOGunSettingToGCallback(GUI_BUTTON *btn,INT32 reason);
-UINT32 guiWeaponCachesOptionTogglesImage[ NUM_CACHES_OPTIONS ];
-UINT32 guiWeaponCachesOptionToggles[ NUM_CACHES_OPTIONS ];
-void BtnGIOWeaponCachesRandomCallback(GUI_BUTTON *btn,INT32 reason);
-void BtnGIOWeaponCachesAllCallback(GUI_BUTTON *btn,INT32 reason);
-
UINT32 giGIOSquadSizeButton[ 2 ];
INT32 giGIOSquadSizeButtonImage[ 2 ];
void BtnGIOSquadSizeSelectionLeftCallback( GUI_BUTTON *btn,INT32 reason );
void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason );
+UINT32 guiInventoryAPOptionTogglesImage[ GIO_NUM_ONOFF_BUTTONS ];
+UINT32 guiInventoryAPOptionToggles[ GIO_NUM_ONOFF_BUTTONS ];
+void BtnGIOInventoryAPOffCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIOInventoryAPOnCallback(GUI_BUTTON *btn,INT32 reason);
+
+// NCTH
+UINT32 guiNCTHOptionTogglesImage[ GIO_NUM_ONOFF_BUTTONS ];
+UINT32 guiNCTHOptionToggles[ GIO_NUM_ONOFF_BUTTONS ];
+void BtnGIONCTHOffCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIONCTHOnCallback(GUI_BUTTON *btn,INT32 reason);
+
+// IIS
+UINT32 guiImprovedInterruptOptionTogglesImage[ GIO_NUM_ONOFF_BUTTONS ];
+UINT32 guiImprovedInterruptOptionToggles[ GIO_NUM_ONOFF_BUTTONS ];
+void BtnGIOImprovedInterruptOffCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIOImprovedInterruptOnCallback(GUI_BUTTON *btn,INT32 reason);
+
+// Overheating
+UINT32 guiOverheatingOptionTogglesImage[ GIO_NUM_ONOFF_BUTTONS ];
+UINT32 guiOverheatingOptionToggles[ GIO_NUM_ONOFF_BUTTONS ];
+void BtnGIOOverheatingOffCallback(GUI_BUTTON *btn,INT32 reason);
+void BtnGIOOverheatingOnCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiTimedTurnToggles[ GIO_NUM_TIMED_TURN_OPTIONS ];
@@ -2870,11 +3348,12 @@ UINT8 GetCurrentGunButtonSetting();
UINT8 GetCurrentGameSaveButtonSetting();
UINT8 GetCurrentGameStyleButtonSetting();
-// SANDRO - added following
UINT8 GetCurrentTraitsOptionButtonSetting();
UINT8 GetCurrentDropAllButtonSetting();
-UINT8 GetCurrentTerroristsButtonSetting();
-UINT8 GetCurrentWeaponCachesButtonSetting();
+UINT8 GetCurrentInventoryAPButtonSetting();
+UINT8 GetCurrentNCTHButtonSetting();
+UINT8 GetCurrentIISButtonSetting();
+UINT8 GetCurrentOverheatingButtonSetting();
void DoneFadeOutForExitGameInitOptionScreen( void );
void DoneFadeInForExitGameInitOptionScreen( void );
@@ -2983,20 +3462,21 @@ UINT32 GameInitOptionsScreenInit( void )
// Available Arsenal (Default: Tons of Guns = 1)
gGameOptions.fGunNut = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_AVAILABLE_ARSENAL, 1);
- // Number of Terrorists (Default: Random = 0)
- gGameOptions.fEnableAllTerrorists = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_NUMBER_OF_TERRORISTS, 0);
-
- // Secret Weapon Caches (Default: Random = 0)
- gGameOptions.fEnableAllWeaponCaches = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_SECRET_WEAPON_CACHES, 0);
+ // Inventory manipulation costs AP (Default: Off = 0)
+ gGameOptions.fInventoryCostsAP = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_INVENTORY_AP, 0);
// Squad size (Default: 8)
UINT8 ubSquadSize = (UINT8)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_SQUAD_SIZE, 8);
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
ubSquadSize = 6;
gGameOptions.ubSquadSize = ubSquadSize;
-
+
+ gGameOptions.fUseNCTH = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_USE_NCTH, 0);
+ gGameOptions.fImprovedInterruptSystem = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_USE_IIS, 0);
+ gGameOptions.fWeaponOverheating = (BOOLEAN)props.getIntProperty(JA2SP_INI_INITIAL_SECTION, JA2SP_OVERHEATING, 0);
+
// Air strikes
gGameOptions.fAirStrikes = FALSE;
@@ -3077,20 +3557,15 @@ BOOLEAN EnterGIOScreen()
SetCurrentCursorFromDatabase( CURSOR_NORMAL );
// load the Main trade screen backgroiund image
+ ColorFillVideoSurfaceArea( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
- {
+ if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround.sti", VObjectDesc.ImageFile);
- }
- else if (iResolution == 1)
- {
+ else if (iResolution < _1024x768)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_800x600.sti", VObjectDesc.ImageFile);
- }
- else if (iResolution == 2)
- {
+ else
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_1024x768.sti", VObjectDesc.ImageFile);
- }
CHECKF(AddVideoObject(&VObjectDesc, &guiGIOMainBackGroundImage ));
@@ -3251,36 +3726,6 @@ BOOLEAN EnterGIOScreen()
else
ButtonList[ guiGameSaveToggles[ GIO_CAN_SAVE ] ]->uiFlags |= BUTTON_CLICKED_ON;
-
- ///////////////////////////////////////////////////////////////////////////////////////////////////////
- // NUMBER OF TERRORISTS SETTING
-
- guiTerroristsOptionTogglesImage[ GIO_TERRORISTS_RANDOM ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
- guiTerroristsOptionToggles[ GIO_TERRORISTS_RANDOM ] = CreateIconAndTextButton( guiTerroristsOptionTogglesImage[ GIO_TERRORISTS_RANDOM ], gzGIOScreenText[ GIO_TERRORISTS_RANDOM_TEXT ], GIO_TOGGLE_TEXT_FONT,
- GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
- GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
- TEXT_CJUSTIFIED,
- (GIO_TERRORISTS_SETTING_X), (GIO_TERRORISTS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
- DEFAULT_MOVE_CALLBACK, BtnGIOTerroristsRandomCallback);
-
- guiTerroristsOptionTogglesImage[ GIO_TERRORISTS_ALL ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
- guiTerroristsOptionToggles[ GIO_TERRORISTS_ALL ] = CreateIconAndTextButton( guiTerroristsOptionTogglesImage[ GIO_TERRORISTS_ALL ], gzGIOScreenText[ GIO_TERRORISTS_ALL_TEXT ], GIO_TOGGLE_TEXT_FONT,
- GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
- GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
- TEXT_CJUSTIFIED,
- (GIO_TERRORISTS_SETTING_X + 74), (GIO_TERRORISTS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
- DEFAULT_MOVE_CALLBACK, BtnGIOTerroristsAllCallback );
-
- SpecifyButtonSoundScheme( guiTerroristsOptionToggles[ GIO_TERRORISTS_RANDOM ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
- SpecifyButtonSoundScheme( guiTerroristsOptionToggles[ GIO_TERRORISTS_ALL ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
- MSYS_SetBtnUserData(guiTerroristsOptionToggles[ GIO_TERRORISTS_RANDOM ],0, 0 );
- MSYS_SetBtnUserData(guiTerroristsOptionToggles[ GIO_TERRORISTS_ALL ],0, 1 );
-
- if( gGameOptions.fEnableAllTerrorists )
- ButtonList[ guiTerroristsOptionToggles[ GIO_TERRORISTS_ALL ] ]->uiFlags |= BUTTON_CLICKED_ON;
- else
- ButtonList[ guiTerroristsOptionToggles[ GIO_TERRORISTS_RANDOM ] ]->uiFlags |= BUTTON_CLICKED_ON;
-
///////////////////////////////////////////////////////////////////////////////////////////////////////
// BOBBY RAY SETTING
@@ -3387,34 +3832,36 @@ BOOLEAN EnterGIOScreen()
}
}
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
// DROP ALL ON/OFF SETTING
- guiDropAllOptionTogglesImage[ GIO_DROPALL_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
- guiDropAllOptionToggles[ GIO_DROPALL_OFF ] = CreateIconAndTextButton( guiDropAllOptionTogglesImage[ GIO_DROPALL_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ guiDropAllOptionTogglesImage[ GIO_BUTTON_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiDropAllOptionToggles[ GIO_BUTTON_OFF ] = CreateIconAndTextButton( guiDropAllOptionTogglesImage[ GIO_BUTTON_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
(GIO_DROPALL_SETTING_X), (GIO_DROPALL_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIODropAllOffCallback);
- guiDropAllOptionTogglesImage[ GIO_DROPALL_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
- guiDropAllOptionToggles[ GIO_DROPALL_ON ] = CreateIconAndTextButton( guiDropAllOptionTogglesImage[ GIO_DROPALL_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ guiDropAllOptionTogglesImage[ GIO_BUTTON_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiDropAllOptionToggles[ GIO_BUTTON_ON ] = CreateIconAndTextButton( guiDropAllOptionTogglesImage[ GIO_BUTTON_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
(GIO_DROPALL_SETTING_X + 74), (GIO_DROPALL_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, BtnGIODropAllOnCallback );
- SpecifyButtonSoundScheme( guiDropAllOptionToggles[ GIO_DROPALL_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
- SpecifyButtonSoundScheme( guiDropAllOptionToggles[ GIO_DROPALL_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
- MSYS_SetBtnUserData(guiDropAllOptionToggles[ GIO_DROPALL_OFF ],0, 0 );
- MSYS_SetBtnUserData(guiDropAllOptionToggles[ GIO_DROPALL_ON ],0, 1 );
+ SpecifyButtonSoundScheme( guiDropAllOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiDropAllOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiDropAllOptionToggles[ GIO_BUTTON_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiDropAllOptionToggles[ GIO_BUTTON_ON ],0, 1 );
if( gGameOptions.fEnemiesDropAllItems )
- ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ ButtonList[ guiDropAllOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
else
- ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ ButtonList[ guiDropAllOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
///////////////////////////////////////////////////////////////////////////////////////////////////////
// GUN SETTING
@@ -3447,38 +3894,38 @@ BOOLEAN EnterGIOScreen()
///////////////////////////////////////////////////////////////////////////////////////////////////////
- // WEAPON CACHES SETTING
+ // INVENTORY AP COST ON/OFF SETTING
- guiWeaponCachesOptionTogglesImage[ GIO_CACHES_RANDOM ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
- guiWeaponCachesOptionToggles[ GIO_CACHES_RANDOM ] = CreateIconAndTextButton( guiWeaponCachesOptionTogglesImage[ GIO_CACHES_RANDOM ], gzGIOScreenText[ GIO_CACHES_RANDOM_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ guiInventoryAPOptionTogglesImage[ GIO_BUTTON_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ] = CreateIconAndTextButton( guiInventoryAPOptionTogglesImage[ GIO_BUTTON_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
- (GIO_CACHES_SETTING_X), (GIO_CACHES_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
- DEFAULT_MOVE_CALLBACK, BtnGIOWeaponCachesRandomCallback);
+ (GIO_INVENTORY_AP_SETTING_X), (GIO_INVENTORY_AP_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOInventoryAPOffCallback);
- guiWeaponCachesOptionTogglesImage[ GIO_CACHES_ALL ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
- guiWeaponCachesOptionToggles[ GIO_CACHES_ALL ] = CreateIconAndTextButton( guiWeaponCachesOptionTogglesImage[ GIO_CACHES_ALL ], gzGIOScreenText[ GIO_CACHES_ALL_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ guiInventoryAPOptionTogglesImage[ GIO_BUTTON_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiInventoryAPOptionToggles[ GIO_BUTTON_ON ] = CreateIconAndTextButton( guiInventoryAPOptionTogglesImage[ GIO_BUTTON_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
TEXT_CJUSTIFIED,
- (GIO_CACHES_SETTING_X + 74), (GIO_CACHES_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
- DEFAULT_MOVE_CALLBACK, BtnGIOWeaponCachesAllCallback );
+ (GIO_INVENTORY_AP_SETTING_X + 74), (GIO_INVENTORY_AP_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOInventoryAPOnCallback );
- SpecifyButtonSoundScheme( guiWeaponCachesOptionToggles[ GIO_CACHES_RANDOM ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
- SpecifyButtonSoundScheme( guiWeaponCachesOptionToggles[ GIO_CACHES_ALL ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
- MSYS_SetBtnUserData(guiWeaponCachesOptionToggles[ GIO_CACHES_RANDOM ],0, 0 );
- MSYS_SetBtnUserData(guiWeaponCachesOptionToggles[ GIO_CACHES_ALL ],0, 1 );
+ SpecifyButtonSoundScheme( guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiInventoryAPOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiInventoryAPOptionToggles[ GIO_BUTTON_ON ],0, 1 );
- if( gGameOptions.fEnableAllWeaponCaches )
- ButtonList[ guiWeaponCachesOptionToggles[ GIO_CACHES_ALL ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ if( gGameOptions.fInventoryCostsAP )
+ ButtonList[ guiInventoryAPOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
else
- ButtonList[ guiWeaponCachesOptionToggles[ GIO_CACHES_RANDOM ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ ButtonList[ guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
///////////////////////////////////////////////////////////////////////////////////////////////////////
// SQUAD SIZE
- if (iResolution > 0)
+ if (iResolution > _640x480)
{
giGIOSquadSizeButtonImage[ 0 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,0,-1,1,-1 );
giGIOSquadSizeButtonImage[ 1 ]= LoadButtonImage( "INTERFACE\\GIO_SELECTION_ARROWS.STI" ,-1,2,-1,3,-1 );
@@ -3511,6 +3958,98 @@ BOOLEAN EnterGIOScreen()
}
}
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // NCTH ON/OFF SETTING
+
+ guiNCTHOptionTogglesImage[ GIO_BUTTON_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiNCTHOptionToggles[ GIO_BUTTON_OFF ] = CreateIconAndTextButton( guiNCTHOptionTogglesImage[ GIO_BUTTON_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_NCTH_SETTING_X), (GIO_NCTH_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIONCTHOffCallback);
+
+ guiNCTHOptionTogglesImage[ GIO_BUTTON_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiNCTHOptionToggles[ GIO_BUTTON_ON ] = CreateIconAndTextButton( guiNCTHOptionTogglesImage[ GIO_BUTTON_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_NCTH_SETTING_X + 74), (GIO_NCTH_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIONCTHOnCallback );
+
+ SpecifyButtonSoundScheme( guiNCTHOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiNCTHOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiNCTHOptionToggles[ GIO_BUTTON_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiNCTHOptionToggles[ GIO_BUTTON_ON ],0, 1 );
+
+ if( gGameOptions.fUseNCTH )
+ ButtonList[ guiNCTHOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiNCTHOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // IMPROVED INTERRUPT SYSTEM ON/OFF SETTING
+
+ guiImprovedInterruptOptionTogglesImage[ GIO_BUTTON_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ] = CreateIconAndTextButton( guiImprovedInterruptOptionTogglesImage[ GIO_BUTTON_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_IIS_SETTING_X), (GIO_IIS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOImprovedInterruptOffCallback);
+
+ guiImprovedInterruptOptionTogglesImage[ GIO_BUTTON_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ] = CreateIconAndTextButton( guiImprovedInterruptOptionTogglesImage[ GIO_BUTTON_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_IIS_SETTING_X + 74), (GIO_IIS_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOImprovedInterruptOnCallback );
+
+ SpecifyButtonSoundScheme( guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ],0, 1 );
+
+ if( gGameOptions.fImprovedInterruptSystem )
+ ButtonList[ guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ // OVERHEATING WEAPONS ON/OFF SETTING
+
+ guiOverheatingOptionTogglesImage[ GIO_BUTTON_OFF ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiOverheatingOptionToggles[ GIO_BUTTON_OFF ] = CreateIconAndTextButton( guiOverheatingOptionTogglesImage[ GIO_BUTTON_OFF ], gzGIOScreenText[ GIO_DROPALL_OFF_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_OVERHEATING_SETTING_X), (GIO_OVERHEATING_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOOverheatingOffCallback);
+
+ guiOverheatingOptionTogglesImage[ GIO_BUTTON_ON ] = UseLoadedButtonImage( guiTraitsOptionTogglesImage[ GIO_TRAITS_OLD ], -1,1,-1,3,-1 );
+ guiOverheatingOptionToggles[ GIO_BUTTON_ON ] = CreateIconAndTextButton( guiOverheatingOptionTogglesImage[ GIO_BUTTON_ON ], gzGIOScreenText[ GIO_DROPALL_ON_TEXT ], GIO_TOGGLE_TEXT_FONT,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ GIO_TOGGLE_TEXT_COLOR, NO_SHADOW,
+ TEXT_CJUSTIFIED,
+ (GIO_OVERHEATING_SETTING_X + 74), (GIO_OVERHEATING_SETTING_Y + 10), BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ DEFAULT_MOVE_CALLBACK, BtnGIOOverheatingOnCallback );
+
+ SpecifyButtonSoundScheme( guiOverheatingOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ SpecifyButtonSoundScheme( guiOverheatingOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_SCHEME_BIGSWITCH3 );
+ MSYS_SetBtnUserData(guiOverheatingOptionToggles[ GIO_BUTTON_OFF ],0, 0 );
+ MSYS_SetBtnUserData(guiOverheatingOptionToggles[ GIO_BUTTON_ON ],0, 1 );
+
+ if( gGameOptions.fWeaponOverheating )
+ ButtonList[ guiOverheatingOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags |= BUTTON_CLICKED_ON;
+ else
+ ButtonList[ guiOverheatingOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags |= BUTTON_CLICKED_ON;
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////////////////////////////////////////
+
//Reset the exit screen
gubGIOExitScreen = GAME_INIT_OPTIONS_SCREEN;
@@ -4074,37 +4613,6 @@ void BtnGIOIronManOnCallback(GUI_BUTTON *btn,INT32 reason)
}
}
-void BtnGIOTerroristsRandomCallback(GUI_BUTTON *btn,INT32 reason)
-{
- if (!(btn->uiFlags & BUTTON_ENABLED))
- return;
-
- if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
- {
- RestoreExternBackgroundRect( (GIO_TERRORISTS_SETTING_X), (GIO_TERRORISTS_SETTING_Y + 10), 230, 40 );
-
- ButtonList[ guiTerroristsOptionToggles[ GIO_TERRORISTS_ALL ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
- btn->uiFlags|=(BUTTON_CLICKED_ON);
-
- PlayButtonSound( guiTerroristsOptionToggles[ GIO_TERRORISTS_RANDOM ], BUTTON_SOUND_CLICKED_ON );
- }
-}
-void BtnGIOTerroristsAllCallback(GUI_BUTTON *btn,INT32 reason)
-{
- if (!(btn->uiFlags & BUTTON_ENABLED))
- return;
-
- if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
- {
- RestoreExternBackgroundRect( (GIO_TERRORISTS_SETTING_X), (GIO_TERRORISTS_SETTING_Y + 10), 230, 40 );
-
- ButtonList[ guiTerroristsOptionToggles[ GIO_TERRORISTS_RANDOM ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
- btn->uiFlags|=(BUTTON_CLICKED_ON);
-
- PlayButtonSound( guiTerroristsOptionToggles[ GIO_TERRORISTS_ALL ], BUTTON_SOUND_CLICKED_ON );
- }
-}
-
void BtnGIODropAllOffCallback(GUI_BUTTON *btn,INT32 reason)
{
if (!(btn->uiFlags & BUTTON_ENABLED))
@@ -4114,10 +4622,10 @@ void BtnGIODropAllOffCallback(GUI_BUTTON *btn,INT32 reason)
{
RestoreExternBackgroundRect( (GIO_DROPALL_SETTING_X), (GIO_DROPALL_SETTING_Y + 10), 230, 40 );
- ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ ButtonList[ guiDropAllOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
btn->uiFlags|=(BUTTON_CLICKED_ON);
- PlayButtonSound( guiDropAllOptionToggles[ GIO_DROPALL_OFF ], BUTTON_SOUND_CLICKED_ON );
+ PlayButtonSound( guiDropAllOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_CLICKED_ON );
}
}
void BtnGIODropAllOnCallback(GUI_BUTTON *btn,INT32 reason)
@@ -4129,10 +4637,10 @@ void BtnGIODropAllOnCallback(GUI_BUTTON *btn,INT32 reason)
{
RestoreExternBackgroundRect( (GIO_DROPALL_SETTING_X), (GIO_DROPALL_SETTING_Y + 10), 230, 40 );
- ButtonList[ guiDropAllOptionToggles[ GIO_DROPALL_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ ButtonList[ guiDropAllOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
btn->uiFlags|=(BUTTON_CLICKED_ON);
- PlayButtonSound( guiDropAllOptionToggles[ GIO_DROPALL_ON ], BUTTON_SOUND_CLICKED_ON );
+ PlayButtonSound( guiDropAllOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_CLICKED_ON );
}
}
@@ -4167,37 +4675,6 @@ void BtnGIOGunSettingToGCallback(GUI_BUTTON *btn,INT32 reason)
}
}
-void BtnGIOWeaponCachesRandomCallback(GUI_BUTTON *btn,INT32 reason)
-{
- if (!(btn->uiFlags & BUTTON_ENABLED))
- return;
-
- if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
- {
- RestoreExternBackgroundRect( (GIO_CACHES_SETTING_X), (GIO_CACHES_SETTING_Y + 10), 230, 40 );
-
- ButtonList[ guiWeaponCachesOptionToggles[ GIO_CACHES_ALL ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
- btn->uiFlags|=(BUTTON_CLICKED_ON);
-
- PlayButtonSound( guiWeaponCachesOptionToggles[ GIO_CACHES_RANDOM ], BUTTON_SOUND_CLICKED_ON );
- }
-}
-void BtnGIOWeaponCachesAllCallback(GUI_BUTTON *btn,INT32 reason)
-{
- if (!(btn->uiFlags & BUTTON_ENABLED))
- return;
-
- if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
- {
- RestoreExternBackgroundRect( (GIO_CACHES_SETTING_X), (GIO_CACHES_SETTING_Y + 10), 230, 40 );
-
- ButtonList[ guiWeaponCachesOptionToggles[ GIO_CACHES_RANDOM ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
- btn->uiFlags|=(BUTTON_CLICKED_ON);
-
- PlayButtonSound( guiWeaponCachesOptionToggles[ GIO_CACHES_ALL ], BUTTON_SOUND_CLICKED_ON );
- }
-}
-
void BtnGIOSquadSizeSelectionLeftCallback( GUI_BUTTON *btn,INT32 reason )
{
if (!(btn->uiFlags & BUTTON_ENABLED))
@@ -4250,7 +4727,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
- if (iResolution == 1)
+ if (iResolution >= _800x600 && iResolution < _1024x768)
maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize )
@@ -4270,7 +4747,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
btn->uiFlags|=(BUTTON_CLICKED_ON);
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
- if (iResolution == 1)
+ if (iResolution >= _800x600 && iResolution < _1024x768)
maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize )
@@ -4294,6 +4771,130 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
}
}
+void BtnGIOInventoryAPOffCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_INVENTORY_AP_SETTING_X), (GIO_INVENTORY_AP_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiInventoryAPOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIOInventoryAPOnCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_INVENTORY_AP_SETTING_X), (GIO_INVENTORY_AP_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiInventoryAPOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiInventoryAPOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
+void BtnGIONCTHOffCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_NCTH_SETTING_X), (GIO_NCTH_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiNCTHOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiNCTHOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIONCTHOnCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_NCTH_SETTING_X), (GIO_NCTH_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiNCTHOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiNCTHOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
+void BtnGIOImprovedInterruptOffCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_IIS_SETTING_X), (GIO_IIS_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIOImprovedInterruptOnCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_IIS_SETTING_X), (GIO_IIS_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiImprovedInterruptOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiImprovedInterruptOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
+void BtnGIOOverheatingOffCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_OVERHEATING_SETTING_X), (GIO_OVERHEATING_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiOverheatingOptionToggles[ GIO_BUTTON_ON ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiOverheatingOptionToggles[ GIO_BUTTON_OFF ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+void BtnGIOOverheatingOnCallback(GUI_BUTTON *btn,INT32 reason)
+{
+ if (!(btn->uiFlags & BUTTON_ENABLED))
+ return;
+
+ if( reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
+ {
+ RestoreExternBackgroundRect( (GIO_OVERHEATING_SETTING_X), (GIO_OVERHEATING_SETTING_Y + 10), 230, 40 );
+
+ ButtonList[ guiOverheatingOptionToggles[ GIO_BUTTON_OFF ] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ btn->uiFlags|=(BUTTON_CLICKED_ON);
+
+ PlayButtonSound( guiOverheatingOptionToggles[ GIO_BUTTON_ON ], BUTTON_SOUND_CLICKED_ON );
+ }
+}
+
BOOLEAN ExitGIOScreen()
{
UINT16 cnt;
@@ -4357,13 +4958,6 @@ BOOLEAN ExitGIOScreen()
UnloadButtonImage( guiGameSaveTogglesImage[ cnt ] );
}
- // Destroy Terrorists setting buttons
- for( cnt=0; cnt 0)
+ if (iResolution > _640x480)
{
RemoveButton( giGIOSquadSizeButton[0] );
RemoveButton( giGIOSquadSizeButton[1] );
@@ -4404,6 +4991,41 @@ BOOLEAN ExitGIOScreen()
UnloadButtonImage( giGIOSquadSizeButtonImage[1] );
}
+ // Destroy Fast Bobby Ray setting buttons
+ //for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
- {
- return( cnt );
- }
- }
- return( 0 );
-}
-
UINT8 GetCurrentDropAllButtonSetting()
{
UINT8 cnt;
@@ -4712,6 +5329,20 @@ UINT8 GetCurrentDropAllButtonSetting()
return( 0 );
}
+UINT8 GetCurrentInventoryAPButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
UINT8 GetCurrentGunButtonSetting()
{
UINT8 cnt;
@@ -4726,20 +5357,6 @@ UINT8 GetCurrentGunButtonSetting()
return( 0 );
}
-UINT8 GetCurrentWeaponCachesButtonSetting()
-{
- UINT8 cnt;
-
- for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
- {
- return( cnt );
- }
- }
- return( 0 );
-}
-
UINT8 GetCurrentTimedTurnsButtonSetting()
{
UINT8 cnt;
@@ -4754,6 +5371,48 @@ UINT8 GetCurrentTimedTurnsButtonSetting()
return( 0 );
}
+UINT8 GetCurrentNCTHButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+UINT8 GetCurrentIISButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
+UINT8 GetCurrentOverheatingButtonSetting()
+{
+ UINT8 cnt;
+
+ for( cnt=0; cntuiFlags & BUTTON_CLICKED_ON )
+ {
+ return( cnt );
+ }
+ }
+ return( 0 );
+}
+
void DoneFadeOutForExitGameInitOptionScreen( void )
{
// loop through and get the status of all the buttons
@@ -4819,10 +5478,14 @@ void DoneFadeOutForExitGameInitOptionScreen( void )
// SANDRO - added following:
gGameOptions.ubMaxIMPCharacters = min( (gGameExternalOptions.iIMPMaleCharacterCount + gGameExternalOptions.iIMPFemaleCharacterCount), ( max( 1, iCurrentIMPNumberSetting) ));
gGameOptions.fNewTraitSystem = GetCurrentTraitsOptionButtonSetting();
- gGameOptions.fEnableAllTerrorists = GetCurrentTerroristsButtonSetting();
gGameOptions.fEnemiesDropAllItems = GetCurrentDropAllButtonSetting();
- gGameOptions.fEnableAllWeaponCaches = GetCurrentWeaponCachesButtonSetting();
gGameOptions.ubProgressSpeedOfItemsChoices = min( GIO_PROGRESS_VERY_FAST, iCurrentProgressSetting );
+ gGameOptions.fInventoryCostsAP = GetCurrentInventoryAPButtonSetting();
+
+ gGameOptions.fUseNCTH = GetCurrentNCTHButtonSetting();
+ gGameOptions.fImprovedInterruptSystem = GetCurrentIISButtonSetting();
+ gGameOptions.fWeaponOverheating = GetCurrentOverheatingButtonSetting();
+
// gubGIOExitScreen = INIT_SCREEN;
gubGIOExitScreen = INTRO_SCREEN;
@@ -4854,7 +5517,7 @@ void DoneFadeInForExitGameInitOptionScreen( void )
BOOLEAN DoGioMessageBox( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback )
{
- SGPRect CenteringRect= {0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1 };
+ SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT };
// do message box and return
giGioMessageBox = DoMessageBox( ubStyle, zString, uiExitScreen, ( UINT16 ) ( usFlags| MSG_BOX_FLAG_USE_CENTERING_RECT ), ReturnCallback, &CenteringRect );
diff --git a/GameSettings.cpp b/GameSettings.cpp
index 368f9f7c..97cf93a0 100644
--- a/GameSettings.cpp
+++ b/GameSettings.cpp
@@ -37,6 +37,8 @@
#include "displaycover.h"
#endif
+#include "KeyMap.h"
+#include "Timer Control.h"
#include "Text.h"
#include "connect.h"
#include "sgp_logger.h"
@@ -94,7 +96,7 @@ bool UsingNewAttachmentSystem()
bool UsingNewCTHSystem()
{
- return (gGameSettings.fOptions[TOPTION_USE_NCTH] == TRUE);
+ return (gGameOptions.fUseNCTH == TRUE);
}
std::string StringToLower(std::string strToConvert)
@@ -120,7 +122,7 @@ BOOLEAN IsNIVModeValid(bool checkRes)
isValid = FALSE;
// Also check the resolution if needed.
- if(checkRes == true && iResolution == 0)
+ if(checkRes == true && iResolution >= _640x480 && iResolution < _800x600)
isValid = FALSE;
return isValid;
@@ -204,11 +206,12 @@ BOOLEAN LoadGameSettings()
gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALT_MAP_COLOR" , FALSE ); // HEADROCK HAM 4: Strategic Map Colors
gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_ALTERNATE_BULLET_GRAPHICS" , TRUE );
- if (!is_networked)
- gGameSettings.fOptions[TOPTION_USE_NCTH] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_NCTH" , FALSE );
- else
- gGameSettings.fOptions[TOPTION_USE_NCTH] = FALSE;
+ //if (!is_networked)
+ // gGameSettings.fOptions[TOPTION_USE_NCTH] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_USE_NCTH" , FALSE );
+ //else
+ // gGameSettings.fOptions[TOPTION_USE_NCTH] = FALSE;
+ gGameSettings.fOptions[TOPTION_SHOW_MERC_RANKS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_MERC_RANKS" , FALSE );
gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_GEAR] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_TACTICAL_FACE_GEAR" , TRUE );
gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_ICONS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_SHOW_TACTICAL_FACE_ICONS" , TRUE );
gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_CHEAT_MODE_OPTIONS_HEADER" , FALSE );
@@ -227,8 +230,19 @@ BOOLEAN LoadGameSettings()
gGameSettings.fOptions[TOPTION_HIDE_BULLETS] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_HIDE_BULLETS" , FALSE );
gGameSettings.fOptions[TOPTION_TRACKING_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_TRACKING_MODE" , TRUE );
gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_DISABLE_CURSOR_SWAP" , FALSE );
- gGameSettings.fOptions[NUM_ALL_GAME_OPTIONS] = iniReader.ReadBoolean("JA2 Game Settings","NUM_ALL_GAME_OPTIONS" , FALSE );
+
+ if (!is_networked)
+ gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_AUTO_FAST_FORWARD_MODE" , FALSE );
+ else
+ gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = FALSE;
+ // The "HIGHSPEED_TIMER" property from the ja2.ini is not set, disable the option
+ if (!IsHiSpeedClockMode())
+ gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] = FALSE;
+
+ //gGameOptions.fWeaponOverheating = iniReader.ReadBoolean("JA2 Game Settings","TOPTION_WEAPON_OVERHEATING" , FALSE ); // Flugente FTW 1: Weapon Overheating
+
+ gGameSettings.fOptions[NUM_ALL_GAME_OPTIONS] = iniReader.ReadBoolean("JA2 Game Settings","NUM_ALL_GAME_OPTIONS" , FALSE );
DeleteShadeTableDir(); // ary-05/05/2009 : Might be bad idea for it to be here. But its gotta happen for some reason every now and then.
// : The call to DeleteShadeTableDir() used to coincided with reseting an older settings file.
@@ -293,136 +307,139 @@ BOOLEAN SaveGameSettings()
{
if (!is_networked)
{
- //Record the current settings into the game settins structure
- gGameSettings.ubSoundEffectsVolume = (UINT8)GetSoundEffectsVolume( );
- gGameSettings.ubSpeechVolume = (UINT8)GetSpeechVolume( );
- gGameSettings.ubMusicVolumeSetting = (UINT8)MusicGetVolume( );
+ //Record the current settings into the game settins structure
+ gGameSettings.ubSoundEffectsVolume = (UINT8)GetSoundEffectsVolume( );
+ gGameSettings.ubSpeechVolume = (UINT8)GetSpeechVolume( );
+ gGameSettings.ubMusicVolumeSetting = (UINT8)MusicGetVolume( );
- std::stringstream settings;
- const char endl[] = "\r\n";
- settings << ";******************************************************************************************************************************" << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << "; Jagged Alliance 2 --Settings File-- " << endl;
- settings << "; " << endl;
- settings << "; Please note that this file is automatically generated by the game. " << endl;
- settings << "; " << endl;
- settings << "; While it is safe to change things from within this file, not all values are acceptable. Some may break the game, " << endl;
- settings << "; some may be ignored, but most likely they will be acceptable or reset to a default value. " << endl;
- settings << "; " << endl;
- settings << "; Please note, This file and its contents are in a beta phase. Expect changes, however they should be minimal and automated." << endl;
- settings << "; " << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << endl;
- settings << "; The Current Game Setting Struct is defined as : " << endl;
- settings << ";" << endl;
- settings << "; typedef struct" << endl;
- settings << "; {" << endl;
- settings << "; INT8 bLastSavedGameSlot; // The last saved game number goes in here" << endl;
- settings << "; UINT8 ubMusicVolumeSetting; // Volume Setting" << endl;
- settings << "; UINT8 ubSoundEffectsVolume; // Volume Setting" << endl;
- settings << "; UINT8 ubSpeechVolume; // Volume Setting" << endl;
- settings << "; UINT8 fOptions[ NUM_ALL_GAME_OPTIONS ]; // Toggle Options (Speech, Subtitles, Show Tree Tops, etc.. )" << endl;
- settings << "; UINT32 uiMeanwhileScenesSeenFlags; // Bit Vector describing seen 'mean whiles..'" << endl;
- settings << "; BOOLEAN fHideHelpInAllScreens; // Controls Help \"do not show help again\" checkbox" << endl;
- //settings << "; UINT8 ubSizeOfDisplayCover; // The number of grids the player designates thru [Delete + ( = or - )]" << endl;
- //settings << "; UINT8 ubSizeOfLOS; // The number of grids the player designates thru [End + ( = or - )]" << endl;
- settings << "; } GAME_SETTINGS" << endl;
- settings << ";" << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << endl << endl;
- settings << "[JA2 Game Settings]" << endl;
+ std::stringstream settings;
+ const char endl[] = "\r\n";
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << "; Jagged Alliance 2 --Settings File-- " << endl;
+ settings << "; " << endl;
+ settings << "; Please note that this file is automatically generated by the game. " << endl;
+ settings << "; " << endl;
+ settings << "; While it is safe to change things from within this file, not all values are acceptable. Some may break the game, " << endl;
+ settings << "; some may be ignored, but most likely they will be acceptable or reset to a default value. " << endl;
+ settings << "; " << endl;
+ settings << "; Please note, This file and its contents are in a beta phase. Expect changes, however they should be minimal and automated." << endl;
+ settings << "; " << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << endl;
+ settings << "; The Current Game Setting Struct is defined as : " << endl;
+ settings << ";" << endl;
+ settings << "; typedef struct" << endl;
+ settings << "; {" << endl;
+ settings << "; INT8 bLastSavedGameSlot; // The last saved game number goes in here" << endl;
+ settings << "; UINT8 ubMusicVolumeSetting; // Volume Setting" << endl;
+ settings << "; UINT8 ubSoundEffectsVolume; // Volume Setting" << endl;
+ settings << "; UINT8 ubSpeechVolume; // Volume Setting" << endl;
+ settings << "; UINT8 fOptions[ NUM_ALL_GAME_OPTIONS ]; // Toggle Options (Speech, Subtitles, Show Tree Tops, etc.. )" << endl;
+ settings << "; UINT32 uiMeanwhileScenesSeenFlags; // Bit Vector describing seen 'mean whiles..'" << endl;
+ settings << "; BOOLEAN fHideHelpInAllScreens; // Controls Help \"do not show help again\" checkbox" << endl;
+ //settings << "; UINT8 ubSizeOfDisplayCover; // The number of grids the player designates thru [Delete + ( = or - )]" << endl;
+ //settings << "; UINT8 ubSizeOfLOS; // The number of grids the player designates thru [End + ( = or - )]" << endl;
+ settings << "; } GAME_SETTINGS" << endl;
+ settings << ";" << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << endl << endl;
+ settings << "[JA2 Game Settings]" << endl;
- settings << "bLastSavedGameSlot = " << (int)gGameSettings.bLastSavedGameSlot << endl;
- settings << "ubMusicVolumeSetting = " << (int)gGameSettings.ubMusicVolumeSetting << endl;
- settings << "ubSoundEffectsVolume = " << (int)gGameSettings.ubSoundEffectsVolume << endl;
- settings << "ubSpeechVolume = " << (int)gGameSettings.ubSpeechVolume << endl;
- settings << "uiMeanwhileScenesSeenFlags = " << gGameSettings.uiMeanwhileScenesSeenFlags << endl;
- settings << "fHideHelpInAllScreens = " << (gGameSettings.fHideHelpInAllScreens ? "TRUE" : "FALSE" ) << endl;
- //settings << "ubSizeOfDisplayCover = " << (int)gGameSettings.ubSizeOfDisplayCover << endl;
- //settings << "ubSizeOfLOS = " << (int)gGameSettings.ubSizeOfLOS << endl;
- settings << "TOPTION_SPEECH = " << (gGameSettings.fOptions[TOPTION_SPEECH] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_MUTE_CONFIRMATIONS = " << (gGameSettings.fOptions[TOPTION_MUTE_CONFIRMATIONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SUBTITLES = " << (gGameSettings.fOptions[TOPTION_SUBTITLES] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_KEY_ADVANCE_SPEECH = " << (gGameSettings.fOptions[TOPTION_KEY_ADVANCE_SPEECH] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ANIMATE_SMOKE = " << (gGameSettings.fOptions[TOPTION_ANIMATE_SMOKE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_BLOOD_N_GORE = " << (gGameSettings.fOptions[TOPTION_BLOOD_N_GORE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_DONT_MOVE_MOUSE = " << (gGameSettings.fOptions[TOPTION_DONT_MOVE_MOUSE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_OLD_SELECTION_METHOD = " << (gGameSettings.fOptions[TOPTION_OLD_SELECTION_METHOD] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ALWAYS_SHOW_MOVEMENT_PATH = " << (gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SHOW_MISSES = " << (gGameSettings.fOptions[TOPTION_SHOW_MISSES] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_RTCONFIRM = " << (gGameSettings.fOptions[TOPTION_RTCONFIRM] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SLEEPWAKE_NOTIFICATION = " << (gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_USE_METRIC_SYSTEM = " << (gGameSettings.fOptions[TOPTION_USE_METRIC_SYSTEM] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_MERC_ALWAYS_LIGHT_UP = " << (gGameSettings.fOptions[TOPTION_MERC_ALWAYS_LIGHT_UP] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SMART_CURSOR = " << (gGameSettings.fOptions[TOPTION_SMART_CURSOR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SNAP_CURSOR_TO_DOOR = " << (gGameSettings.fOptions[TOPTION_SNAP_CURSOR_TO_DOOR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_GLOW_ITEMS = " << (gGameSettings.fOptions[TOPTION_GLOW_ITEMS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_TOGGLE_TREE_TOPS = " << (gGameSettings.fOptions[TOPTION_TOGGLE_TREE_TOPS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_TOGGLE_WIREFRAME = " << (gGameSettings.fOptions[TOPTION_TOGGLE_WIREFRAME] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_3D_CURSOR = " << (gGameSettings.fOptions[TOPTION_3D_CURSOR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_CTH_CURSOR = " << (gGameSettings.fOptions[TOPTION_CTH_CURSOR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_GL_BURST_CURSOR = " << (gGameSettings.fOptions[TOPTION_GL_BURST_CURSOR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ALLOW_TAUNTS = " << (gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] ? "TRUE" : "FALSE" ) << endl; // changed from drop all - SANDRO
- settings << "TOPTION_GL_HIGH_ANGLE = " << (gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ALLOW_REAL_TIME_SNEAK = " << (gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] ? "TRUE" : "FALSE" ) << endl; // changed from restrict aim levels - SANDRO
- settings << "TOPTION_SPACE_SELECTS_NEXT_SQUAD = " << (gGameSettings.fOptions[TOPTION_SPACE_SELECTS_NEXT_SQUAD] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SHOW_ITEM_SHADOW = " << (gGameSettings.fOptions[TOPTION_SHOW_ITEM_SHADOW] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SHOW_WEAPON_RANGE_IN_TILES = " << (gGameSettings.fOptions[TOPTION_SHOW_WEAPON_RANGE_IN_TILES] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_TRACERS_FOR_SINGLE_FIRE = " << (gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_RAIN_SOUND = " << (gGameSettings.fOptions[TOPTION_RAIN_SOUND] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ALLOW_CROWS = " << (gGameSettings.fOptions[TOPTION_ALLOW_CROWS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ALLOW_SOLDIER_TOOLTIPS = " << (gGameSettings.fOptions[TOPTION_ALLOW_SOLDIER_TOOLTIPS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_USE_AUTO_SAVE = " << (gGameSettings.fOptions[TOPTION_USE_AUTO_SAVE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SILENT_SKYRIDER = " << (gGameSettings.fOptions[TOPTION_SILENT_SKYRIDER] ? "TRUE" : "FALSE" ) << endl;
- //settings << "TOPTION_LOW_CPU_USAGE = " << (gGameSettings.fOptions[TOPTION_LOW_CPU_USAGE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_ENHANCED_DESC_BOX = " << (gGameSettings.fOptions[TOPTION_ENHANCED_DESC_BOX] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_TOGGLE_TURN_MODE = " << (gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_STAT_PROGRESS_BARS = " << (gGameSettings.fOptions[TOPTION_STAT_PROGRESS_BARS] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 3.6: Progress Bars
- settings << "TOPTION_ALT_MAP_COLOR = " << (gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 4: Alt Map Colors
- settings << "TOPTION_ALTERNATE_BULLET_GRAPHICS = " << (gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_USE_NCTH = " << (gGameSettings.fOptions[TOPTION_USE_NCTH] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SHOW_TACTICAL_FACE_GEAR = " << (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_GEAR] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_SHOW_TACTICAL_FACE_ICONS = " << (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_ICONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_DISABLE_CURSOR_SWAP = " << (gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_CHEAT_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_FORCE_BOBBY_RAY_SHIPMENTS = " << (gGameSettings.fOptions[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_CHEAT_MODE_OPTIONS_END = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_END] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_DEBUG_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_REPORT_MISS_MARGIN = " << (gGameSettings.fOptions[TOPTION_REPORT_MISS_MARGIN] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 4: Shot offset report
- settings << "TOPTION_SHOW_RESET_ALL_OPTIONS = " << (gGameSettings.fOptions[TOPTION_SHOW_RESET_ALL_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_RESET_ALL_OPTIONS = " << (gGameSettings.fOptions[TOPTION_RESET_ALL_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE = " << (gGameSettings.fOptions[TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_RENDER_MOUSE_REGIONS = " << (gGameSettings.fOptions[TOPTION_RENDER_MOUSE_REGIONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_DEBUG_MODE_OPTIONS_END = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_END] ? "TRUE" : "FALSE" ) << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << "; Options beyond this point are Code derived options, DO NOT CHANGE THESE UNLESS YOU KNOW WHAT YOUR ARE DOING." << endl;
- settings << "; They are only included here for complete transparency for all GameSettings content. " << endl;
- settings << ";******************************************************************************************************************************" << endl;
- settings << "TOPTION_LAST_OPTION = " << (gGameSettings.fOptions[TOPTION_LAST_OPTION] ? "TRUE" : "FALSE" ) << endl;
- settings << "NUM_GAME_OPTIONS = " << (gGameSettings.fOptions[NUM_GAME_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_MERC_CASTS_LIGHT = " << (gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_HIDE_BULLETS = " << (gGameSettings.fOptions[TOPTION_HIDE_BULLETS] ? "TRUE" : "FALSE" ) << endl;
- settings << "TOPTION_TRACKING_MODE = " << (gGameSettings.fOptions[TOPTION_TRACKING_MODE] ? "TRUE" : "FALSE" ) << endl;
- settings << "NUM_ALL_GAME_OPTIONS = " << (gGameSettings.fOptions[NUM_ALL_GAME_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "bLastSavedGameSlot = " << (int)gGameSettings.bLastSavedGameSlot << endl;
+ settings << "ubMusicVolumeSetting = " << (int)gGameSettings.ubMusicVolumeSetting << endl;
+ settings << "ubSoundEffectsVolume = " << (int)gGameSettings.ubSoundEffectsVolume << endl;
+ settings << "ubSpeechVolume = " << (int)gGameSettings.ubSpeechVolume << endl;
+ settings << "uiMeanwhileScenesSeenFlags = " << gGameSettings.uiMeanwhileScenesSeenFlags << endl;
+ settings << "fHideHelpInAllScreens = " << (gGameSettings.fHideHelpInAllScreens ? "TRUE" : "FALSE" ) << endl;
+ //settings << "ubSizeOfDisplayCover = " << (int)gGameSettings.ubSizeOfDisplayCover << endl;
+ //settings << "ubSizeOfLOS = " << (int)gGameSettings.ubSizeOfLOS << endl;
+ settings << "TOPTION_SPEECH = " << (gGameSettings.fOptions[TOPTION_SPEECH] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_MUTE_CONFIRMATIONS = " << (gGameSettings.fOptions[TOPTION_MUTE_CONFIRMATIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SUBTITLES = " << (gGameSettings.fOptions[TOPTION_SUBTITLES] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_KEY_ADVANCE_SPEECH = " << (gGameSettings.fOptions[TOPTION_KEY_ADVANCE_SPEECH] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ANIMATE_SMOKE = " << (gGameSettings.fOptions[TOPTION_ANIMATE_SMOKE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_BLOOD_N_GORE = " << (gGameSettings.fOptions[TOPTION_BLOOD_N_GORE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_DONT_MOVE_MOUSE = " << (gGameSettings.fOptions[TOPTION_DONT_MOVE_MOUSE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_OLD_SELECTION_METHOD = " << (gGameSettings.fOptions[TOPTION_OLD_SELECTION_METHOD] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ALWAYS_SHOW_MOVEMENT_PATH = " << (gGameSettings.fOptions[TOPTION_ALWAYS_SHOW_MOVEMENT_PATH] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SHOW_MISSES = " << (gGameSettings.fOptions[TOPTION_SHOW_MISSES] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_RTCONFIRM = " << (gGameSettings.fOptions[TOPTION_RTCONFIRM] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SLEEPWAKE_NOTIFICATION = " << (gGameSettings.fOptions[TOPTION_SLEEPWAKE_NOTIFICATION] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_USE_METRIC_SYSTEM = " << (gGameSettings.fOptions[TOPTION_USE_METRIC_SYSTEM] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_MERC_ALWAYS_LIGHT_UP = " << (gGameSettings.fOptions[TOPTION_MERC_ALWAYS_LIGHT_UP] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SMART_CURSOR = " << (gGameSettings.fOptions[TOPTION_SMART_CURSOR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SNAP_CURSOR_TO_DOOR = " << (gGameSettings.fOptions[TOPTION_SNAP_CURSOR_TO_DOOR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_GLOW_ITEMS = " << (gGameSettings.fOptions[TOPTION_GLOW_ITEMS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_TOGGLE_TREE_TOPS = " << (gGameSettings.fOptions[TOPTION_TOGGLE_TREE_TOPS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_TOGGLE_WIREFRAME = " << (gGameSettings.fOptions[TOPTION_TOGGLE_WIREFRAME] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_3D_CURSOR = " << (gGameSettings.fOptions[TOPTION_3D_CURSOR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_CTH_CURSOR = " << (gGameSettings.fOptions[TOPTION_CTH_CURSOR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_GL_BURST_CURSOR = " << (gGameSettings.fOptions[TOPTION_GL_BURST_CURSOR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ALLOW_TAUNTS = " << (gGameSettings.fOptions[TOPTION_ALLOW_TAUNTS] ? "TRUE" : "FALSE" ) << endl; // changed from drop all - SANDRO
+ settings << "TOPTION_GL_HIGH_ANGLE = " << (gGameSettings.fOptions[TOPTION_GL_HIGH_ANGLE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ALLOW_REAL_TIME_SNEAK = " << (gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] ? "TRUE" : "FALSE" ) << endl; // changed from restrict aim levels - SANDRO
+ settings << "TOPTION_SPACE_SELECTS_NEXT_SQUAD = " << (gGameSettings.fOptions[TOPTION_SPACE_SELECTS_NEXT_SQUAD] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SHOW_ITEM_SHADOW = " << (gGameSettings.fOptions[TOPTION_SHOW_ITEM_SHADOW] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SHOW_WEAPON_RANGE_IN_TILES = " << (gGameSettings.fOptions[TOPTION_SHOW_WEAPON_RANGE_IN_TILES] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_TRACERS_FOR_SINGLE_FIRE = " << (gGameSettings.fOptions[TOPTION_TRACERS_FOR_SINGLE_FIRE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_RAIN_SOUND = " << (gGameSettings.fOptions[TOPTION_RAIN_SOUND] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ALLOW_CROWS = " << (gGameSettings.fOptions[TOPTION_ALLOW_CROWS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ALLOW_SOLDIER_TOOLTIPS = " << (gGameSettings.fOptions[TOPTION_ALLOW_SOLDIER_TOOLTIPS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_USE_AUTO_SAVE = " << (gGameSettings.fOptions[TOPTION_USE_AUTO_SAVE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SILENT_SKYRIDER = " << (gGameSettings.fOptions[TOPTION_SILENT_SKYRIDER] ? "TRUE" : "FALSE" ) << endl;
+ //settings << "TOPTION_LOW_CPU_USAGE = " << (gGameSettings.fOptions[TOPTION_LOW_CPU_USAGE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_ENHANCED_DESC_BOX = " << (gGameSettings.fOptions[TOPTION_ENHANCED_DESC_BOX] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_TOGGLE_TURN_MODE = " << (gGameSettings.fOptions[TOPTION_TOGGLE_TURN_MODE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_STAT_PROGRESS_BARS = " << (gGameSettings.fOptions[TOPTION_STAT_PROGRESS_BARS] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 3.6: Progress Bars
+ settings << "TOPTION_ALT_MAP_COLOR = " << (gGameSettings.fOptions[TOPTION_ALT_MAP_COLOR] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 4: Alt Map Colors
+ settings << "TOPTION_ALTERNATE_BULLET_GRAPHICS = " << (gGameSettings.fOptions[TOPTION_ALTERNATE_BULLET_GRAPHICS] ? "TRUE" : "FALSE" ) << endl;
+ //settings << "TOPTION_USE_NCTH = " << (gGameSettings.fOptions[TOPTION_USE_NCTH] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SHOW_MERC_RANKS = " << (gGameSettings.fOptions[TOPTION_SHOW_MERC_RANKS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SHOW_TACTICAL_FACE_GEAR = " << (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_GEAR] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_SHOW_TACTICAL_FACE_ICONS = " << (gGameSettings.fOptions[TOPTION_SHOW_TACTICAL_FACE_ICONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_DISABLE_CURSOR_SWAP = " << (gGameSettings.fOptions[TOPTION_DISABLE_CURSOR_SWAP] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_AUTO_FAST_FORWARD_MODE = " << (gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] ? "TRUE" : "FALSE" ) << endl;
+ //settings << "TOPTION_WEAPON_OVERHEATING = " << (gGameOptions.fWeaponOverheating ? "TRUE" : "FALSE" ) << endl; // Flugente FTW 1: Weapon Overheating
+ settings << "TOPTION_CHEAT_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_FORCE_BOBBY_RAY_SHIPMENTS = " << (gGameSettings.fOptions[TOPTION_FORCE_BOBBY_RAY_SHIPMENTS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_CHEAT_MODE_OPTIONS_END = " << (gGameSettings.fOptions[TOPTION_CHEAT_MODE_OPTIONS_END] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_DEBUG_MODE_OPTIONS_HEADER = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_HEADER] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_REPORT_MISS_MARGIN = " << (gGameSettings.fOptions[TOPTION_REPORT_MISS_MARGIN] ? "TRUE" : "FALSE" ) << endl; // HEADROCK HAM 4: Shot offset report
+ settings << "TOPTION_SHOW_RESET_ALL_OPTIONS = " << (gGameSettings.fOptions[TOPTION_SHOW_RESET_ALL_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_RESET_ALL_OPTIONS = " << (gGameSettings.fOptions[TOPTION_RESET_ALL_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE = " << (gGameSettings.fOptions[TOPTION_RETAIN_DEBUG_OPTIONS_IN_RELEASE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_RENDER_OPTIONS_GROUP] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_RENDER_MOUSE_REGIONS = " << (gGameSettings.fOptions[TOPTION_RENDER_MOUSE_REGIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_DEBUG_MODE_OPTIONS_END = " << (gGameSettings.fOptions[TOPTION_DEBUG_MODE_OPTIONS_END] ? "TRUE" : "FALSE" ) << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << "; Options beyond this point are Code derived options, DO NOT CHANGE THESE UNLESS YOU KNOW WHAT YOUR ARE DOING." << endl;
+ settings << "; They are only included here for complete transparency for all GameSettings content. " << endl;
+ settings << ";******************************************************************************************************************************" << endl;
+ settings << "TOPTION_LAST_OPTION = " << (gGameSettings.fOptions[TOPTION_LAST_OPTION] ? "TRUE" : "FALSE" ) << endl;
+ settings << "NUM_GAME_OPTIONS = " << (gGameSettings.fOptions[NUM_GAME_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_MERC_CASTS_LIGHT = " << (gGameSettings.fOptions[TOPTION_MERC_CASTS_LIGHT] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_HIDE_BULLETS = " << (gGameSettings.fOptions[TOPTION_HIDE_BULLETS] ? "TRUE" : "FALSE" ) << endl;
+ settings << "TOPTION_TRACKING_MODE = " << (gGameSettings.fOptions[TOPTION_TRACKING_MODE] ? "TRUE" : "FALSE" ) << endl;
+ settings << "NUM_ALL_GAME_OPTIONS = " << (gGameSettings.fOptions[NUM_ALL_GAME_OPTIONS] ? "TRUE" : "FALSE" ) << endl;
- try
- {
- vfs::COpenWriteFile wfile(GAME_SETTINGS_FILE,true,true);
- wfile->write(settings.str().c_str(), settings.str().length());
- }
- catch(vfs::Exception& ex)
- {
- SGP_WARNING(ex.what());
- vfs::CFile file(GAME_SETTINGS_FILE);
- if(file.openWrite(true,true))
+ try
{
- vfs::COpenWriteFile wfile( vfs::tWritableFile::cast(&file));
- SGP_TRYCATCH_RETHROW(file.write(settings.str().c_str(), settings.str().length()),L"");
+ vfs::COpenWriteFile wfile(GAME_SETTINGS_FILE,true,true);
+ wfile->write(settings.str().c_str(), settings.str().length());
+ }
+ catch(vfs::Exception& ex)
+ {
+ SGP_WARNING(ex.what());
+ vfs::CFile file(GAME_SETTINGS_FILE);
+ if(file.openWrite(true,true))
+ {
+ vfs::COpenWriteFile wfile( vfs::tWritableFile::cast(&file));
+ SGP_TRYCATCH_RETHROW(file.write(settings.str().c_str(), settings.str().length()),L"");
+ }
}
- }
}
return( TRUE );
@@ -498,8 +515,10 @@ void InitGameSettings()
gGameSettings.fOptions[ TOPTION_ALTERNATE_BULLET_GRAPHICS ] = TRUE;
// CHRISL: HAM 4: Activate/Deactivate NCTH mode
- gGameSettings.fOptions[ TOPTION_USE_NCTH ] = FALSE;
+ //gGameSettings.fOptions[ TOPTION_USE_NCTH ] = FALSE;
+ gGameSettings.fOptions[ TOPTION_SHOW_MERC_RANKS ] = TRUE;
+
// WANNE:
gGameSettings.fOptions[ TOPTION_SHOW_TACTICAL_FACE_GEAR ] = TRUE;
gGameSettings.fOptions[ TOPTION_SHOW_TACTICAL_FACE_ICONS ] = TRUE;
@@ -507,6 +526,10 @@ void InitGameSettings()
gGameSettings.fOptions[ TOPTION_REPORT_MISS_MARGIN ] = FALSE;
gGameSettings.fOptions[ TOPTION_DISABLE_CURSOR_SWAP ] = FALSE;
+ gGameSettings.fOptions[ TOPTION_AUTO_FAST_FORWARD_MODE ] = FALSE;
+
+ // Flugente FTW 1: Weapon Overheating
+ //gGameSettings.fOptions[ TOPTION_WEAPON_OVERHEATING ] = TRUE;
// arynn: Cheat/Debug Menu
gGameSettings.fOptions[ TOPTION_CHEAT_MODE_OPTIONS_HEADER ] = FALSE;
@@ -555,6 +578,15 @@ void InitGameOptions()
gGameOptions.ubGameStyle = STYLE_SCIFI;
gGameOptions.ubDifficultyLevel = DIF_LEVEL_MEDIUM;
+ //Fast Bobby Ray Shipments (CHECK)
+ //gGameOptions.fBobbyRayFastShipments = FALSE;
+ //Inventory AP Costs (CHECK)
+ gGameOptions.fInventoryCostsAP = TRUE;
+
+ gGameOptions.fUseNCTH = FALSE;
+ gGameOptions.fImprovedInterruptSystem = TRUE;
+ gGameOptions.fWeaponOverheating = TRUE;
+
//CHRISL: override default inventory mode when in low res
if(IsNIVModeValid(true) == FALSE)
{
@@ -579,9 +611,7 @@ void InitGameOptions()
gGameOptions.fNewTraitSystem = FALSE;
gGameOptions.ubProgressSpeedOfItemsChoices = ITEM_PROGRESS_NORMAL;
- gGameOptions.fEnableAllTerrorists = FALSE;
gGameOptions.fEnemiesDropAllItems = FALSE;
- gGameOptions.fEnableAllWeaponCaches = FALSE;
}
@@ -621,9 +651,9 @@ void LoadGameExternalOptions()
gGameExternalOptions.iMaxEnemyGroupSize = iniReader.ReadInteger("System Limit Settings","MAX_STRATEGIC_ENEMY_GROUP_SIZE",20, 10, 100);
//JMich
- gGameExternalOptions.guiMaxItemSize = iniReader.ReadInteger("System Limit Settings","MAX_ITEM_SIZE",34, 0, 250);
- gGameExternalOptions.guiMaxWeaponSize = iniReader.ReadInteger("System Limit Settings","MAX_WEAPON_SIZE", 9, 0, 100);
- gGameExternalOptions.guiOIVSizeNumber = iniReader.ReadInteger("System Limit Settings","OLD_INVENTORY_ITEM_NUMBER", 99, 0, 255);
+ gGameExternalOptions.guiMaxItemSize = iniReader.ReadInteger("System Limit Settings","MAX_ITEM_SIZE",34, 0, 65000);
+ gGameExternalOptions.guiMaxWeaponSize = iniReader.ReadInteger("System Limit Settings","MAX_WEAPON_SIZE", 9, 0, 32000);
+ gGameExternalOptions.guiOIVSizeNumber = iniReader.ReadInteger("System Limit Settings","OLD_INVENTORY_ITEM_NUMBER", 99, 0, 65535);
//################# Data File Settings #################
@@ -869,6 +899,9 @@ void LoadGameExternalOptions()
// WANNE: Don't stop and talk in turn based when spotting an item
gGameExternalOptions.fItemSpottedNoTalk = iniReader.ReadBoolean("Tactical Interface Settings","ITEMS_SPOTTED_NO_TALK", FALSE);
+ // Buggler: Exit sector using grid exit in turn based mode?
+ gGameExternalOptions.fGridExitInTurnBased = iniReader.ReadBoolean("Tactical Interface Settings","GRID_EXIT_IN_TURNBASED", TRUE);
+
//DBrot: Stand up after battle?
gGameExternalOptions.fStandUpAfterBattle = iniReader.ReadBoolean("Tactical Interface Settings","STAND_UP_AFTER_BATTLE", TRUE);
// Tactical militia command
@@ -889,17 +922,11 @@ void LoadGameExternalOptions()
// HEADROCK HAM 3.6: Maximum number of messages displayed in Tactical view
gGameExternalOptions.ubMaxMessagesTactical = iniReader.ReadInteger("Tactical Interface Settings","MAXIMUM_MESSAGES_IN_TACTICAL", 6, 1, 36);
// Apply a resolution-based limit.
- switch (iResolution)
- {
- case 0:
- // Max 20 lines in 640x480
- gGameExternalOptions.ubMaxMessagesTactical = __max(20, gGameExternalOptions.ubMaxMessagesTactical);
- break;
- case 1:
- // Max 26 lines in 800x600
- gGameExternalOptions.ubMaxMessagesTactical = __max(26, gGameExternalOptions.ubMaxMessagesTactical);
- break;
- }
+
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ gGameExternalOptions.ubMaxMessagesTactical = __max(20, gGameExternalOptions.ubMaxMessagesTactical);
+ else if (iResolution < _1024x768)
+ gGameExternalOptions.ubMaxMessagesTactical = __max(26, gGameExternalOptions.ubMaxMessagesTactical);
gGameExternalOptions.bTacticalFaceIconStyle = iniReader.ReadInteger("Tactical Interface Settings","TACTICAL_FACE_ICON_STYLE", 0, 0, 3);
@@ -1041,6 +1068,10 @@ void LoadGameExternalOptions()
gGameExternalOptions.fAllowWalkingWithWeaponRaised = iniReader.ReadBoolean("Tactical Gameplay Settings","ALLOW_WALKING_WITH_WEAPON_RAISED", TRUE);
+ gGameExternalOptions.fWeaponResting = iniReader.ReadBoolean("Tactical Gameplay Settings","WEAPON_RESTING",TRUE);
+ gGameExternalOptions.fDisplayWeaponRestingIndicator = iniReader.ReadBoolean("Tactical Gameplay Settings","WEAPON_RESTING_DISPLAY",TRUE);
+ gGameExternalOptions.ubProneModifierPercentage = iniReader.ReadInteger("Tactical Gameplay Settings","WEAPON_RESTING_PRONE_BONI_PERCENTAGE", 50, 0, 100);
+
// WANNE: Externalized grid number of new merc when they arrive with the helicopter (by Jazz)
gGameExternalOptions.iInitialMercArrivalLocation = iniReader.ReadInteger("Tactical Gameplay Settings","INITIAL_MERC_ARRIVAL_LOCATION", 4870 );
@@ -1164,6 +1195,10 @@ void LoadGameExternalOptions()
// Penalty for fire when you don't see enemy (when you see enemy because his see militya or ather merc)
gGameExternalOptions.iPenaltyShootUnSeen = iniReader.ReadInteger("Tactical Interface Settings","SHOOT_UNSEEN_PENALTY",0,0,255);
+ //Inventory AP Weight Divisor
+ gGameExternalOptions.uWeightDivisor = iniReader.ReadFloat("Tactical Interface Settings","INV_AP_WEIGHT_DIVISOR",5,0,100);
+
+
// CtH/2 if the target are out of gun range or invisible for this merc
gGameExternalOptions.fOutOfGunRangeOrSight = iniReader.ReadFloat("Tactical Interface Settings","OUT_OF_SIGHT_OR_GUN_RANGE",2,1,100);
// *** ddd - END
@@ -1181,7 +1216,7 @@ void LoadGameExternalOptions()
gGameExternalOptions.fSoldiersWearAnyArmour = iniReader.ReadBoolean("Tactical Gameplay Settings", "SOLDIERS_ALWAYS_WEAR_ANY_ARMOR", FALSE);
// improved Interrupt System (info: multiplayer game ALWAYS use the old interrupt system, because the new one causes crashes, no problem so far)
- gGameExternalOptions.fImprovedInterruptSystem = iniReader.ReadBoolean("Tactical Gameplay Settings", "IMPROVED_INTERRUPT_SYSTEM", TRUE);
+ //gGameOptions.fImprovedInterruptSystem = iniReader.ReadBoolean("Tactical Gameplay Settings", "IMPROVED_INTERRUPT_SYSTEM", TRUE);
gGameExternalOptions.ubBasicPercentRegisterValueIIS = iniReader.ReadInteger("Tactical Gameplay Settings", "BASIC_PERCENTAGE_APS_REGISTERED", 60, 0, 250);
gGameExternalOptions.ubPercentRegisterValuePerLevelIIS = iniReader.ReadInteger("Tactical Gameplay Settings", "PERCENTAGE_APS_REGISTERED_PER_EXP_LEVEL", 4, 0, 100);
gGameExternalOptions.ubBasicReactionTimeLengthIIS = iniReader.ReadInteger("Tactical Gameplay Settings", "BASIC_REACTION_TIME_LENGTH", 25, 5, 100);
@@ -1281,9 +1316,12 @@ void LoadGameExternalOptions()
gGameExternalOptions.guiProlongLightningIfSeenSomeone = iniReader.ReadInteger("Tactical Weather Settings","DELAY_IN_SECONDS_IF_SEEN_SOMEONE_DURING_LIGHTNING_IN_TURNBASED",5, 1, 60);
gGameExternalOptions.guiChanceToDoLightningBetweenTurns = iniReader.ReadInteger("Tactical Weather Settings","CHANCE_TO_DO_LIGHTNING_BETWEEN_TURNS",35, 0, 100);
+ //################# Tactical Weapon Overheating Settings ##################
+ // Flugente FTW 1: These settings control the behavior of Weapon Overheating, its severity, and its display.
-
-
+ gGameExternalOptions.fDisplayOverheatThermometer = iniReader.ReadBoolean("Tactical Weapon Overheating Settings","OVERHEATING_DISPLAY_THERMOMETER",TRUE);
+ gGameExternalOptions.iCooldownModificatorLonelyBarrel = iniReader.ReadFloat ("Tactical Weapon Overheating Settings","OVERHEATING_COOLDOWN_MODIFICATOR_LONELYBARREL", 1.15f, 1.0f, 10.0f);
+
//################# Strategic Gamestart Settings ##################
//Lalien: Game starting time
@@ -1376,10 +1414,6 @@ void LoadGameExternalOptions()
// Allow reinforcements only between City sectors?
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("Strategic Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",FALSE);
- // SANDRO - moved into the game start screen
- //gGameExternalOptions.fEnableAllTerrorists = iniReader.ReadBoolean("Strategic Gameplay Settings", "ENABLE_ALL_TERRORISTS", FALSE);
- //gGameExternalOptions.fEnableAllWeaponCaches = iniReader.ReadBoolean("Strategic Gameplay Settings", "ENABLE_ALL_WEAPON_CACHES", FALSE);
-
// Kaiden: Vehicle Inventory change - Added INI file Option VEHICLE_INVENTORY
gGameExternalOptions.fVehicleInventory = iniReader.ReadBoolean("Strategic Gameplay Settings", "VEHICLE_INVENTORY", TRUE);
@@ -1403,6 +1437,11 @@ void LoadGameExternalOptions()
// CHRISL: Determine how Skyrider should handle landing in enemy occupied sectors
gGameExternalOptions.ubSkyriderHotLZ = iniReader.ReadInteger("Strategic Gameplay Settings", "ALLOW_SKYRIDER_HOT_LZ", 0);
+ // enable all terrorists
+ gGameExternalOptions.fEnableAllTerrorists = iniReader.ReadBoolean("Strategic Gameplay Settings", "ENABLE_ALL_TERRORISTS", TRUE);
+ // enable all weapon caches
+ gGameExternalOptions.fEnableAllWeaponCaches = iniReader.ReadBoolean("Strategic Gameplay Settings", "ENABLE_ALL_WEAPON_CACHES", FALSE);
+
//################# Laptop Settings ##################
@@ -1418,6 +1457,9 @@ void LoadGameExternalOptions()
// HEADROCK HAM 3: If enabled, tooltipping over Bobby Ray's weapons will show a list of possible attachments to those weapons.
gGameExternalOptions.fBobbyRayTooltipsShowAttachments = iniReader.ReadBoolean("Bobby Ray Settings","BOBBY_RAY_TOOLTIPS_SHOW_POSSIBLE_ATTACHMENTS", FALSE);
+ //JMich - Maximum Purchase Amount for Bobby Ray
+ gGameExternalOptions.ubBobbyRayMaxPurchaseAmount = iniReader.ReadInteger("Bobby Ray Settings", "BOBBY_RAY_MAX_PURCHASE_AMOUNT", 10, 10, 100);
+
// WDS - Option to turn off stealing
gGameExternalOptions.fStealingDisabled = iniReader.ReadBoolean("Bobby Ray Settings","STEALING_FROM_SHIPMENTS_DISABLED",FALSE);
@@ -1643,6 +1685,9 @@ void LoadGameExternalOptions()
// chance that Tony will be in his office - silversurfer/SANDRO
gGameExternalOptions.ubChanceTonyAvailable = iniReader.ReadInteger("Shopkeeper Inventory Settings","CHANCE_TONY_AVAILABLE", 80, 0, 100);
+ // Fast Bobby Ray shipments
+ gGameExternalOptions.fBobbyRayFastShipments = iniReader.ReadBoolean("Shopkeeper Inventory Settings", "FAST_BOBBY_RAY_SHIPMENTS", FALSE);
+
//################# Strategic Assignment Settings ##################
////////// ALL ASSIGNMENTS //////////
@@ -1699,7 +1744,18 @@ void LoadGameExternalOptions()
gGameExternalOptions.fEnableInventoryPoolQ = TRUE;
#else
gGameExternalOptions.fEnableInventoryPoolQ = FALSE;
-#endif
+#endif
+
+ ////////// CLOCK SETTINGS //////////
+
+ // Key to artificially alter the clock so turns run faster
+ STRING512 sFFKeyBuffer;
+ iniReader.ReadString("Clock Settings", "FAST_FORWARD_KEY", NULL, sFFKeyBuffer, _countof(sFFKeyBuffer));
+
+ gGameExternalOptions.iFastForwardKey = ParseKeyString(sFFKeyBuffer);
+ gGameExternalOptions.iFastForwardPeriod = (FLOAT)iniReader.ReadDouble("Clock Settings","FAST_FORWARD_PERIOD", 500, 1, 10000);
+ gGameExternalOptions.fClockSpeedPercent = (FLOAT)iniReader.ReadDouble("Clock Settings","CLOCK_SPEED_PERCENT", 150, 100, 300);
+ gGameExternalOptions.iNotifyFrequency = iniReader.ReadInteger("Clock Settings","UPDATE_FREQUENCY", 16000, 1000, 20000);
}
@@ -2104,6 +2160,33 @@ void LoadGameAPBPConstants()
// HEADROCK HAM 3.2: Modifier for legshot AP loss based on damage
APBPConstants[AP_LOSS_PER_LEGSHOT_DAMAGE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_LOSS_PER_LEGSHOT_DAMAGE",4),4);
+ //Costs to pick up item from position
+ APBPConstants[AP_INV_FROM_NONE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_NONE",0),0);
+ APBPConstants[AP_INV_FROM_HANDS] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_HANDS",0),0);
+ APBPConstants[AP_INV_FROM_EQUIPMENT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_EQUIPMENT",15),15);
+ APBPConstants[AP_INV_FROM_VEST] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_VEST",5),5);
+ APBPConstants[AP_INV_FROM_RIG] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_RIG",4),4);
+ APBPConstants[AP_INV_FROM_CPACK] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_CPACK",6),6);
+ APBPConstants[AP_INV_FROM_BPACK] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_BPACK",8),8);
+ APBPConstants[AP_INV_FROM_SLING] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_SLING",6),6);
+ APBPConstants[AP_INV_FROM_KNIFE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_KNIFE",5),5);
+ APBPConstants[AP_INV_FROM_FACE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_FACE",2),2);
+ APBPConstants[AP_INV_FROM_BIG_POCKET] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_BIG_POCKET",5),5);
+ APBPConstants[AP_INV_FROM_SMALL_POCKET] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_FROM_SMALL_POCKET",4),4);
+ APBPConstants[AP_INV_TO_NONE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_NONE",0),0);
+ APBPConstants[AP_INV_TO_HANDS] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_HANDS",0),0);
+ APBPConstants[AP_INV_TO_EQUIPMENT] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_EQUIPMENT",20),20);
+ APBPConstants[AP_INV_TO_VEST] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_VEST",6),6);
+ APBPConstants[AP_INV_TO_RIG] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_RIG",5),5);
+ APBPConstants[AP_INV_TO_CPACK] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_CPACK",7),7);
+ APBPConstants[AP_INV_TO_BPACK] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_BPACK",9),9);
+ APBPConstants[AP_INV_TO_SLING] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_SLING",7),7);
+ APBPConstants[AP_INV_TO_KNIFE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_KNIFE",6),6);
+ APBPConstants[AP_INV_TO_FACE] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_FACE",2),2);
+ APBPConstants[AP_INV_TO_BIG_POCKET] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_BIG_POCKET",4),4);
+ APBPConstants[AP_INV_TO_SMALL_POCKET] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_TO_SMALL_POCKET",5),5);
+ APBPConstants[AP_INV_MAX_COST] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","AP_INV_MAX_COST",25),25);
+
APBPConstants[DEFAULT_APS] = DynamicAdjustAPConstants(iniReader.ReadInteger("APConstants","DEFAULT_APS",80),80);
APBPConstants[DEFAULT_AIMSKILL] = iniReader.ReadInteger("APConstants","DEFAULT_AIMSKILL",80);
@@ -2301,7 +2384,7 @@ void LoadCTHConstants()
gGameCTHConstants.RECOIL_COUNTER_INCREMENT = iniReader.ReadInteger("Shooting Mechanism","RECOIL_COUNTER_INCREMENT",20, 0, 100);
gGameCTHConstants.RECOIL_COUNTER_INCREMENT_TRACER = iniReader.ReadInteger("Shooting Mechanism","RECOIL_COUNTER_INCREMENT_TRACER",25, 0, 100);
gGameCTHConstants.NORMAL_RECOIL_DISTANCE = iniReader.ReadInteger("Shooting Mechanism","NORMAL_RECOIL_DISTANCE",140, 10, 10000);
- gGameCTHConstants.MAX_BULLET_DEV = iniReader.ReadFloat("Shooting Mechanism","MAX_BULLET_DEV ",10.0, -1000.0, 1000.0);
+ gGameCTHConstants.MAX_BULLET_DEV = iniReader.ReadFloat("Shooting Mechanism","MAX_BULLET_DEV",10.0, -1000.0, 1000.0);
gGameCTHConstants.RANGE_EFFECTS_DEV = iniReader.ReadBoolean("Shooting Mechanism","RANGE_EFFECTS_DEV", TRUE );
gGameCTHConstants.MAX_EFFECTIVE_RANGE_MULTIPLIER = iniReader.ReadFloat("Shooting Mechanism","MAX_EFFECTIVE_RANGE_MULTIPLIER",1.1f, 0.5f, 10.0f);
gGameCTHConstants.MAX_EFFECTIVE_RANGE_REDUCTION = iniReader.ReadFloat("Shooting Mechanism","MAX_EFFECTIVE_RANGE_REDUCTION",0.5f, 0.0f, 1.0f);
@@ -2662,16 +2745,16 @@ void DisplayGameSettings( )
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_GAME_SAVE_STYLE_TEXT ], gzGIOScreenText[ GIO_SAVE_ANYWHERE_TEXT + gGameOptions.fIronManMode ] );
// All Terrorists Option
- if( gGameOptions.fEnableAllTerrorists )
- ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_TERRORISTS_TITLE_TEXT ], gzGIOScreenText[ GIO_TERRORISTS_ALL_TEXT ] );
- else
- ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_TERRORISTS_TITLE_TEXT ], gzGIOScreenText[ GIO_TERRORISTS_RANDOM_TEXT ] );
+ //if( gGameExternalOptions.fEnableAllTerrorists )
+ // ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_TERRORISTS_TITLE_TEXT ], gzGIOScreenText[ GIO_TERRORISTS_ALL_TEXT ] );
+ //else
+ // ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_TERRORISTS_TITLE_TEXT ], gzGIOScreenText[ GIO_TERRORISTS_RANDOM_TEXT ] );
- // All Weapon Caches Option
- if( gGameOptions.fEnableAllWeaponCaches )
- ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_CACHES_TITLE_TEXT ], gzGIOScreenText[ GIO_CACHES_ALL_TEXT ] );
- else
- ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_CACHES_TITLE_TEXT ], gzGIOScreenText[ GIO_CACHES_RANDOM_TEXT ] );
+ //// All Weapon Caches Option
+ //if( gGameOptions.fEnableAllWeaponCaches )
+ // ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_CACHES_TITLE_TEXT ], gzGIOScreenText[ GIO_CACHES_ALL_TEXT ] );
+ //else
+ // ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%s: %s", gzGIOScreenText[ GIO_CACHES_TITLE_TEXT ], gzGIOScreenText[ GIO_CACHES_RANDOM_TEXT ] );
// Tons of Guns Option
if( gGameOptions.fGunNut )
diff --git a/GameSettings.h b/GameSettings.h
index 9c3043fc..8e252265 100644
--- a/GameSettings.h
+++ b/GameSettings.h
@@ -76,13 +76,19 @@ enum
TOPTION_ALTERNATE_BULLET_GRAPHICS,
// CHRISL: HAM 4: Activate/Deactivate NCTH mode
- TOPTION_USE_NCTH,
-
+ //TOPTION_USE_NCTH,
+ //Jenilee's Merc Ranks
+ TOPTION_SHOW_MERC_RANKS,
+
// WANNE:
TOPTION_SHOW_TACTICAL_FACE_GEAR,
TOPTION_SHOW_TACTICAL_FACE_ICONS,
TOPTION_DISABLE_CURSOR_SWAP, // Disable cursor swapping every second between talk and quick exchange
+ TOPTION_AUTO_FAST_FORWARD_MODE, // automatically fast forward through AI turns
+
+ // Flugente FTW 1: Weapon Overheating
+ //TOPTION_WEAPON_OVERHEATING, // allow Overheating of weapons
// arynn: Debug/Cheat
TOPTION_CHEAT_MODE_OPTIONS_HEADER,
@@ -210,12 +216,17 @@ typedef struct
// SANDRO - added variables
UINT8 ubMaxIMPCharacters;
BOOLEAN fNewTraitSystem;
- BOOLEAN fEnableAllTerrorists;
BOOLEAN fEnemiesDropAllItems;
UINT8 ubProgressSpeedOfItemsChoices;
- BOOLEAN fEnableAllWeaponCaches;
+
+ BOOLEAN fInventoryCostsAP; // ubFiller: From 500 to 499
+
+ BOOLEAN fUseNCTH; // ubFiller: From 499 to 498
+ BOOLEAN fImprovedInterruptSystem; // ubFiller: From 498 to 497
+ BOOLEAN fWeaponOverheating; // ubFiller: From 497 to 496
- UINT8 ubFiller[500]; // WANNE: Decrease this filler by 1, for each new UINT8 variable!
+ // WANNE: Decrease this filler by 1, for each new UINT8 / BOOLEAN variable, so we can maintain savegame compatibility!!
+ UINT8 ubFiller[496];
} GAME_OPTIONS;
@@ -318,7 +329,7 @@ typedef struct
BOOLEAN fCamoRemoving;
BOOLEAN fEnhancedCloseCombatSystem;
- BOOLEAN fImprovedInterruptSystem;
+ //BOOLEAN fImprovedInterruptSystem;
UINT8 ubBasicPercentRegisterValueIIS;
UINT8 ubPercentRegisterValuePerLevelIIS;
UINT8 ubBasicReactionTimeLengthIIS;
@@ -417,9 +428,9 @@ typedef struct
UINT32 autoSaveTime;
//JMich
- UINT8 guiMaxWeaponSize;
- UINT8 guiMaxItemSize;
- UINT8 guiOIVSizeNumber;
+ UINT16 guiMaxWeaponSize;
+ UINT16 guiMaxItemSize;
+ UINT16 guiOIVSizeNumber;
//Sight range
UINT32 ubStraightSightRange;
@@ -570,9 +581,8 @@ typedef struct
//Misc settings
BOOLEAN fAmmoDynamicWeight; //Pulmu
BOOLEAN fEnableCrepitus;
- // SANDRO was here - removed these two
- //BOOLEAN fEnableAllWeaponCaches;
- //BOOLEAN fEnableAllTerrorists;
+ BOOLEAN fEnableAllWeaponCaches;
+ BOOLEAN fEnableAllTerrorists;
BOOLEAN gfRevealItems;
BOOLEAN fEnableArmorCoverage; // ShadoWarrior for Captain J's armor coverage
@@ -660,6 +670,9 @@ typedef struct
FLOAT fShotHeadDivisor;
INT16 iPenaltyShootUnSeen;
+ //Inventory AP Weight Divisor
+ FLOAT uWeightDivisor;
+
FLOAT fOutOfGunRangeOrSight;
// WANNE: Always use "prof.dat".
BOOLEAN fUseDifficultyBasedProfDat;
@@ -844,6 +857,9 @@ typedef struct
// HEADROCK HAM 3: If enabled, tooltipping over Bobby Ray's weapons will show a list of possible attachments to those weapons.
BOOLEAN fBobbyRayTooltipsShowAttachments;
+ //JMich Externalized gGameExternalOptions.ubBobbyRayMaxPurchaseAmount for BobbyRay
+ UINT8 ubBobbyRayMaxPurchaseAmount;
+
// CHRISL: Converts the AutoFireToHitBonus value to a percentage for CTH calculations
UINT8 ubFlatAFTHBtoPrecentMultiplier;
@@ -1034,16 +1050,37 @@ typedef struct
FLOAT gMercLevelUpSalaryIncreasePercentage;
UINT8 ubChanceTonyAvailable; // silversurfer/SANDRO
-
+
+ BOOLEAN fBobbyRayFastShipments;
+
+ BOOLEAN fGridExitInTurnBased;
+
BOOLEAN fStandUpAfterBattle;
INT32 iInitialMercArrivalLocation;
+
+ // Keyboard shortcut (as VK) for fastforward key. See Utils/KeyMap
+ INT32 iFastForwardKey;
+ // Turn on fast forward whenever ui is disabled.
+ BOOLEAN fEnableAutoFastForwardMode;
+ // When fast forward is enabled what is the period to update clock in milliseconds.
+ FLOAT iFastForwardPeriod;
+ // Frequency that the screen is updated
+ INT32 iNotifyFrequency;
+ // Frequency that the screen is updated
+ FLOAT fClockSpeedPercent;
+
+ // Flugente FTW 1: Weapon Overheating
+ BOOLEAN fDisplayOverheatThermometer; // Should a 'thermometer' for guns and replacable barrels be displayed?
+ FLOAT iCooldownModificatorLonelyBarrel; // Cooldown modificator for barrels alone in the landscape ;-)
+
+ BOOLEAN fWeaponResting; // Should it be possible to rest your weapon on structures in crouched position?
+ BOOLEAN fDisplayWeaponRestingIndicator; // Should a little indicator show if the weapon is currently rested on something?
+ UINT8 ubProneModifierPercentage; // for boni, use ubProneModifierPercentage*boni[PRONE] + (100 - ubProneModifierPercentage)*boni[CROUCHED]
BOOLEAN gBriefingRoom;
BOOLEAN gEncyclopedia;
-
-
-
+
} GAME_EXTERNAL_OPTIONS;
typedef struct
diff --git a/GameVersion.cpp b/GameVersion.cpp
index 90304a23..1b53bea8 100644
--- a/GameVersion.cpp
+++ b/GameVersion.cpp
@@ -14,14 +14,14 @@
//MAP EDITOR BUILD VERSION
#ifdef JA2UB
-CHAR16 zVersionLabel[256] = { L"Unfinished Business Map Editor v1.13.4882 (Official Release)" };
+CHAR16 zVersionLabel[256] = { L"Unfinished Business v1.5 (15-10-2011) - Map Editor v1.13.4452 (Development Build)" };
#else
-CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.4882 (Official Release)" };
+CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.4452 (Development Build)" };
#endif
#elif defined JA2BETAVERSION
//BETA/TEST BUILD VERSION
-CHAR16 zVersionLabel[256] = { L"Debug v1.13.4882 (Official Release)" };
+CHAR16 zVersionLabel[256] = { L"Debug v1.13.4820 (Development Build)" };
#elif defined CRIPPLED_VERSION
//RELEASE BUILD VERSION s
@@ -31,14 +31,14 @@ CHAR16 zVersionLabel[256] = { L"Beta v. 0.98" };
//RELEASE BUILD VERSION
#ifdef JA2UB
- CHAR16 zVersionLabel[256] = { L"Release Unfinished Business v1.13.4882 (Official Release)" };
+ CHAR16 zVersionLabel[256] = { L"Release Unfinished Business v1.5 (15-10-2011) - v1.13.4462 (Development Build)" };
#else
- CHAR16 zVersionLabel[256] = { L"Release v1.13.4882 (Official Release)" };
+ CHAR16 zVersionLabel[256] = { L"Release v1.13.4462 (Development Build)" };
#endif
#endif
-CHAR8 czVersionNumber[16] = { "Build 12.01.18" }; //YY.MM.DD
+CHAR8 czVersionNumber[16] = { "Build 11.12.05" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" };
diff --git a/Init.cpp b/Init.cpp
index 49c9cdf4..fc4cb906 100644
--- a/Init.cpp
+++ b/Init.cpp
@@ -86,6 +86,7 @@
#include "LuaInitNPCs.h"
#include "Encyclopedia_Data.h"
#include "Encyclopedia.h"
+#include "AimArchives.h"
extern INT16 APBPConstants[TOTAL_APBP_VALUES] = {0};
extern INT16 gubMaxActionPoints[28];//MAXBODYTYPES = 28... JUST GETTING IT TO WORK NOW. GOTTHARD 7/2/08
@@ -1061,6 +1062,44 @@ if ( ReadXMLEmail == TRUE )
}
#endif
+
+ UINT8 p;
+ for(p=0; pNUM_PROFILES-emptyslotsinarchives;p--)
+ {
+ gAimOldArchives[p-1].FaceID=-1;
+ }
+
LuaState::INIT(lua::LUA_STATE_STRATEGIC_MINES_AND_UNDERGROUND, true);
g_luaUnderground.LoadScript(GetLanguagePrefix());
// load Lua for Strategic Mines initialization
@@ -1243,6 +1282,8 @@ UINT32 InitializeJA2(void)
gfIntendOnEnteringEditor = TRUE;
gGameOptions.fGunNut = TRUE;
gGameOptions.fAirStrikes = FALSE;
+ //gGameOptions.fBobbyRayFastShipments = FALSE;
+ gGameOptions.fInventoryCostsAP = FALSE;
useOldJA2Inventory = TRUE;
return( GAME_SCREEN );
@@ -1262,6 +1303,8 @@ UINT32 InitializeJA2(void)
gfIntendOnEnteringEditor = TRUE;
gGameOptions.fGunNut = TRUE;
gGameOptions.fAirStrikes = FALSE;
+ //gGameOptions.fBobbyRayFastShipments = FALSE;
+ gGameOptions.fInventoryCostsAP = FALSE;
return( GAME_SCREEN );
}
if ( strcmp( gzCommandLine, "-EDITOR" ) == 0 )
@@ -1276,6 +1319,8 @@ UINT32 InitializeJA2(void)
gfIntendOnEnteringEditor = TRUE;
gGameOptions.fGunNut = TRUE;
gGameOptions.fAirStrikes = FALSE;
+ //gGameOptions.fBobbyRayFastShipments = FALSE;
+ gGameOptions.fInventoryCostsAP = FALSE;
return( GAME_SCREEN );
}
@@ -1293,6 +1338,8 @@ UINT32 InitializeJA2(void)
gfIntendOnEnteringEditor = TRUE;
gGameOptions.fGunNut = TRUE;
gGameOptions.fAirStrikes = FALSE;
+ //gGameOptions.fBobbyRayFastShipments = FALSE;
+ gGameOptions.fInventoryCostsAP = FALSE;
return( GAME_SCREEN );
#endif
#endif
diff --git a/Init.h b/Init.h
index e3121a09..4b8af54c 100644
--- a/Init.h
+++ b/Init.h
@@ -115,6 +115,35 @@ AP_LOSS_PER_LEGSHOT_DAMAGE,
AUTOFIRE_SHOTS_AP_VALUE,
BAD_AP_COST,
+//Cost to take item from position
+AP_INV_FROM_NONE,
+AP_INV_FROM_HANDS,
+AP_INV_FROM_EQUIPMENT,
+AP_INV_FROM_VEST,
+AP_INV_FROM_RIG,
+AP_INV_FROM_CPACK,
+AP_INV_FROM_BPACK,
+AP_INV_FROM_SLING,
+AP_INV_FROM_KNIFE,
+AP_INV_FROM_FACE,
+AP_INV_FROM_BIG_POCKET,
+AP_INV_FROM_SMALL_POCKET,
+//Cost to move item to position
+AP_INV_TO_NONE,
+AP_INV_TO_HANDS,
+AP_INV_TO_EQUIPMENT,
+AP_INV_TO_VEST,
+AP_INV_TO_RIG,
+AP_INV_TO_CPACK,
+AP_INV_TO_BPACK,
+AP_INV_TO_SLING,
+AP_INV_TO_KNIFE,
+AP_INV_TO_FACE,
+AP_INV_TO_BIG_POCKET,
+AP_INV_TO_SMALL_POCKET,
+//Max inventory cost
+AP_INV_MAX_COST,
+
DEFAULT_APS,
DEFAULT_AIMSKILL,
BP_RATIO_RED_PTS_TO_NORMAL,
diff --git a/Laptop/AimArchives.cpp b/Laptop/AimArchives.cpp
index 5fe95614..437317e7 100644
--- a/Laptop/AimArchives.cpp
+++ b/Laptop/AimArchives.cpp
@@ -12,6 +12,7 @@
#include "Text.h"
#endif
+#include "Soldier Profile.h"
#define AIM_ALUMNI_NAME_FILE "BINARYDATA\\AlumName.edt"
@@ -132,6 +133,9 @@ void BtnAlumniPageButtonCallback(GUI_BUTTON *btn,INT32 reason);
UINT32 guiAlumniPageButton[3];
INT32 guiAlumniPageButtonImage;
+INT8 idPage = -1;
+UINT8 cOldMerc;
+BOOLEAN pageEnabled[4];
void ResetAimArchiveButtons();
void DisableAimArchiveButton();
@@ -142,6 +146,9 @@ void RemoveAimAlumniFaceRegion();
void CreateDestroyDoneMouseRegion(UINT16 usPosY);
void ChangingAimArchiveSubPage( UINT8 ubSubPageNumber );
+BOOLEAN vOldMerc[NUM_PROFILES];
+UINT8 oldMercID;
+OLD_MERC_ARCHIVES_VALUES gAimOldArchives[NUM_PROFILES];
void GameInitAimArchives()
{
@@ -163,7 +170,27 @@ BOOLEAN EnterAimArchives()
VOBJECT_DESC VObjectDesc;
UINT16 usPosX, i;
-
+ idPage = -1;
+
+ for(i=0; iuiFlags & BUTTON_CLICKED_ON)
+ {
+
+ if ( idPage == -1) idPage = 0;
+
+ if ( idPage == 1 && pageEnabled[1] == TRUE && pageEnabled[2] == FALSE ) idPage = -1;
+ if ( idPage == 2 && pageEnabled[2] == TRUE && pageEnabled[3] == FALSE ) idPage = -1;
+ if ( idPage == 3 && pageEnabled[3] == TRUE ) idPage = -1;
+ idPage++;
+
+ btn->uiFlags &= (~BUTTON_CLICKED_ON );
+
+ RemoveAimAlumniFaceRegion();
+
+ ChangingAimArchiveSubPage( idPage );
+
+ gubPageNum = idPage;
+
+ gfReDrawScreen = TRUE;
+
+ gfDestroyPopUpBox = TRUE;
+
+ gunAlumniButtonDown=255;
+ ResetAimArchiveButtons();
+ DisableAimArchiveButton();
+ gfDrawPopUpBox = FALSE;
+
+ InvalidateRegion(AIM_ALUMNI_PAGE1_X,AIM_ALUMNI_PAGE1_Y, AIM_ALUMNI_PAGE_END_X,AIM_ALUMNI_PAGE_END_Y);
+ }
+ }
+ if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
+ {
+ btn->uiFlags &= (~BUTTON_CLICKED_ON );
+ gunAlumniButtonDown=255;
+ DisableAimArchiveButton();
+ InvalidateRegion(AIM_ALUMNI_PAGE1_X,AIM_ALUMNI_PAGE1_Y, AIM_ALUMNI_PAGE_END_X,AIM_ALUMNI_PAGE_END_Y);
+ }
+/*
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
{
btn->uiFlags |= BUTTON_CLICKED_ON;
@@ -441,17 +561,18 @@ void BtnAlumniPageButtonCallback(GUI_BUTTON *btn,INT32 reason)
DisableAimArchiveButton();
InvalidateRegion(AIM_ALUMNI_PAGE1_X,AIM_ALUMNI_PAGE1_Y, AIM_ALUMNI_PAGE_END_X,AIM_ALUMNI_PAGE_END_Y);
}
+*/
}
void ResetAimArchiveButtons()
{
- int i=0;
+ //int i=0;
- for(i=0; i<3; i++)
- {
- ButtonList[ guiAlumniPageButton[i] ]->uiFlags &= ~BUTTON_CLICKED_ON;
- }
+ //for(i=0; i<3; i++)
+ //{
+ // ButtonList[ guiAlumniPageButton[i] ]->uiFlags &= ~BUTTON_CLICKED_ON;
+ //}
}
@@ -459,7 +580,7 @@ void DisableAimArchiveButton()
{
if( gfExitingAimArchives == TRUE)
return;
-
+/*
if( (gubPageNum == 0 ) )
{
ButtonList[ guiAlumniPageButton[ 0 ] ]->uiFlags |= (BUTTON_CLICKED_ON );
@@ -472,6 +593,7 @@ void DisableAimArchiveButton()
{
ButtonList[ guiAlumniPageButton[ 2 ] ]->uiFlags |= (BUTTON_CLICKED_ON );
}
+*/
}
@@ -484,9 +606,9 @@ void DisplayAlumniOldMercPopUp()
HVOBJECT hDoneHandle;
HVOBJECT hFacePaneHandle;
HVOBJECT hFaceHandle;
- CHAR16 sName[AIM_ALUMNI_NAME_SIZE];
- CHAR16 sDesc[AIM_ALUMNI_DECRIPTION_SIZE];
- UINT32 uiStartLoc;
+// CHAR16 sName[AIM_ALUMNI_NAME_SIZE];
+// CHAR16 sDesc[AIM_ALUMNI_DECRIPTION_SIZE];
+ //UINT32 uiStartLoc;
UINT16 usStringPixLength;
GetVideoObject(&hAlumniPopUpHandle, guiAlumniPopUp);
@@ -497,10 +619,11 @@ void DisplayAlumniOldMercPopUp()
ubFontHeight = (UINT8)GetFontHeight(AIM_ALUMNI_POPUP_FONT);
//Load the description
- uiStartLoc = AIM_ALUMNI_FILE_RECORD_SIZE * gubDrawOldMerc + AIM_ALUMNI_FULL_NAME_SIZE;
- LoadEncryptedDataFromFile(AIM_ALUMNI_FILE, sDesc, uiStartLoc, AIM_ALUMNI_DECRIPTION_SIZE);
+ //uiStartLoc = AIM_ALUMNI_FILE_RECORD_SIZE * gubDrawOldMerc + AIM_ALUMNI_FULL_NAME_SIZE;
+ //LoadEncryptedDataFromFile(AIM_ALUMNI_FILE, sDesc, uiStartLoc, AIM_ALUMNI_DECRIPTION_SIZE);
- usStringPixLength = StringPixLength( sDesc, AIM_ALUMNI_POPUP_FONT);
+// usStringPixLength = StringPixLength( sDesc, AIM_ALUMNI_POPUP_FONT);
+ usStringPixLength = StringPixLength( gAimOldArchives[gubDrawOldMerc].szBio, AIM_ALUMNI_POPUP_FONT);
ubNumDescLines = (UINT8) (usStringPixLength / AIM_POPUP_TEXT_WIDTH);
ubNumLines += ubNumDescLines;
@@ -524,23 +647,29 @@ void DisplayAlumniOldMercPopUp()
BltVideoObject(FRAME_BUFFER, hAlumniPopUpHandle, 2,AIM_POPUP_X, usPosY, VO_BLT_SRCTRANSPARENCY,NULL);
BltVideoObject(FRAME_BUFFER, hDoneHandle, 0,AIM_ALUMNI_DONE_X, usPosY-AIM_ALUMNI_DONE_HEIGHT, VO_BLT_SRCTRANSPARENCY,NULL);
DrawTextToScreen(AimAlumniText[AIM_ALUMNI_DONE], (UINT16)(AIM_ALUMNI_DONE_X+1), (UINT16)(usPosY-AIM_ALUMNI_DONE_HEIGHT+3), AIM_ALUMNI_DONE_WIDTH, AIM_ALUMNI_POPUP_NAME_FONT, AIM_ALUMNI_POPUP_NAME_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED);
-
+
CreateDestroyDoneMouseRegion(usPosY);
///blt face panale and the mecs fce
BltVideoObject(FRAME_BUFFER, hFacePaneHandle, 0,AIM_ALUMNI_FACE_PANEL_X, AIM_ALUMNI_FACE_PANEL_Y, VO_BLT_SRCTRANSPARENCY,NULL);
- BltVideoObject(FRAME_BUFFER, hFaceHandle, gubDrawOldMerc, AIM_ALUMNI_FACE_PANEL_X+1, AIM_ALUMNI_FACE_PANEL_Y+1, VO_BLT_SRCTRANSPARENCY,NULL);
+
+ //BltVideoObject(FRAME_BUFFER, hFaceHandle, gubDrawOldMerc, AIM_ALUMNI_FACE_PANEL_X+1, AIM_ALUMNI_FACE_PANEL_Y+1, VO_BLT_SRCTRANSPARENCY,NULL);
+ BltVideoObject(FRAME_BUFFER, hFaceHandle, gAimOldArchives[gubDrawOldMerc].FaceID, AIM_ALUMNI_FACE_PANEL_X+1, AIM_ALUMNI_FACE_PANEL_Y+1, VO_BLT_SRCTRANSPARENCY,NULL);
//Load and display the name
// uiStartLoc = AIM_ALUMNI_NAME_SIZE * gubDrawOldMerc;
// LoadEncryptedDataFromFile(AIM_ALUMNI_NAME_FILE, sName, uiStartLoc, AIM_ALUMNI_NAME_SIZE);
- uiStartLoc = AIM_ALUMNI_FILE_RECORD_SIZE * gubDrawOldMerc;
- LoadEncryptedDataFromFile( AIM_ALUMNI_FILE, sName, uiStartLoc, AIM_ALUMNI_FULL_NAME_SIZE );
+// uiStartLoc = AIM_ALUMNI_FILE_RECORD_SIZE * gubDrawOldMerc;
+// LoadEncryptedDataFromFile( AIM_ALUMNI_FILE, sName, uiStartLoc, AIM_ALUMNI_FULL_NAME_SIZE );
- DrawTextToScreen(sName, AIM_ALUMNI_POPUP_NAME_X, AIM_ALUMNI_POPUP_NAME_Y, 0, AIM_ALUMNI_POPUP_NAME_FONT, AIM_ALUMNI_POPUP_NAME_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
+ //DrawTextToScreen(sName, AIM_ALUMNI_POPUP_NAME_X, AIM_ALUMNI_POPUP_NAME_Y, 0, AIM_ALUMNI_POPUP_NAME_FONT, AIM_ALUMNI_POPUP_NAME_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
+
+ DrawTextToScreen(gAimOldArchives[gubDrawOldMerc].szName, AIM_ALUMNI_POPUP_NAME_X, AIM_ALUMNI_POPUP_NAME_Y, 0, AIM_ALUMNI_POPUP_NAME_FONT, AIM_ALUMNI_POPUP_NAME_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
//Display the description
- DisplayWrappedString(AIM_ALUMNI_POPUP_DESC_X, AIM_ALUMNI_POPUP_DESC_Y, AIM_POPUP_TEXT_WIDTH, 2, AIM_ALUMNI_POPUP_FONT, AIM_ALUMNI_POPUP_COLOR, sDesc, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
+// DisplayWrappedString(AIM_ALUMNI_POPUP_DESC_X, AIM_ALUMNI_POPUP_DESC_Y, AIM_POPUP_TEXT_WIDTH, 2, AIM_ALUMNI_POPUP_FONT, AIM_ALUMNI_POPUP_COLOR, sDesc, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
+ DisplayWrappedString(AIM_ALUMNI_POPUP_DESC_X, AIM_ALUMNI_POPUP_DESC_Y, AIM_POPUP_TEXT_WIDTH, 2, AIM_ALUMNI_POPUP_FONT, AIM_ALUMNI_POPUP_COLOR, gAimOldArchives[gubDrawOldMerc].szBio, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
+
InvalidateRegion(LAPTOP_SCREEN_UL_X,LAPTOP_SCREEN_WEB_UL_Y,LAPTOP_SCREEN_LR_X,LAPTOP_SCREEN_WEB_LR_Y);
}
@@ -556,38 +685,66 @@ void DestroyPopUpBox()
void InitAlumniFaceRegions()
{
- UINT16 usPosX, usPosY,i,x,y, usNumRows;
+ UINT16 usPosX, usPosY,i,x,y, usNumRows, p;
if(gfFaceMouseRegionsActive)
return;
-
+/*
if( gubPageNum == 2 )
usNumRows = 2;
else
usNumRows = AIM_ALUMNI_NUM_FACE_ROWS;
+*/
+
+ usNumRows = AIM_ALUMNI_NUM_FACE_ROWS;
usPosX = AIM_ALUMNI_START_GRID_X;
usPosY = AIM_ALUMNI_START_GRID_Y;
+
+
+ if (gubPageNum == 0)
+ {
+ p=0;
+ }
+ else if (gubPageNum == 1)
+ {
+ p=20;
+ }
+ else if (gubPageNum == 2)
+ {
+ p=40;
+ }
+ else if (gubPageNum == 3)
+ {
+ p=60;
+ }
+ else p=0;
+
i=0;
for(y=0; yuiFlags & BUTTON_CLICKED_ON)
{
- //if we are not already in the video conferemce mode, go in to it
- if( !gubVideoConferencingMode)
- {
-
- gubVideoConferencingMode = AIM_VIDEO_POPUP_MODE;
-// gubVideoConferencingMode = AIM_VIDEO_INIT_MODE;
- gfFirstTimeInContactScreen = TRUE;
+ //if no popup box
+ if( gubPopUpBoxAction != AIM_POPUP_DISPLAY )
+ {
+ //if we are not already in the video conferemce mode, go in to it
+ if( !gubVideoConferencingMode )
+ {
+ gubVideoConferencingMode = AIM_VIDEO_POPUP_MODE;
+// gubVideoConferencingMode = AIM_VIDEO_INIT_MODE;
+ gfFirstTimeInContactScreen = TRUE;
+ }
+ InitCreateDeleteAimPopUpBox(AIM_POPUP_DELETE, NULL, NULL, 0, 0, 0);
}
-
btn->uiFlags &= (~BUTTON_CLICKED_ON );
-
- InitCreateDeleteAimPopUpBox(AIM_POPUP_DELETE, NULL, NULL, 0, 0, 0);
-
- InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
+
+ InvalidateRegion(btn->Area.RegionTopLeftX, btn->Area.RegionTopLeftY, btn->Area.RegionBottomRightX, btn->Area.RegionBottomRightY);
}
}
if(reason & MSYS_CALLBACK_REASON_LOST_MOUSE)
@@ -5019,7 +5020,7 @@ void HandleAimMemberKeyBoardInput()
{
InputAtom InputEvent;
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{//!HandleTextInput( &InputEvent ) &&
if( InputEvent.usEvent == KEY_DOWN )
{
@@ -5058,16 +5059,16 @@ void HandleAimMemberKeyBoardInput()
gfRedrawScreen = TRUE;
break;
case ENTER:
- // contact only if merc alive
- if( !IsMercDead( gbCurrentSoldier ) )
+ // contact only if merc alive & no popup box
+ if( !IsMercDead( gbCurrentSoldier ) && gubPopUpBoxAction != AIM_POPUP_DISPLAY )
{
- if( !gubVideoConferencingMode)
- {
- gubVideoConferencingMode = AIM_VIDEO_POPUP_MODE;
- //gubVideoConferencingMode = AIM_VIDEO_INIT_MODE;
- gfFirstTimeInContactScreen = TRUE;
- }
- InitCreateDeleteAimPopUpBox(AIM_POPUP_DELETE, NULL, NULL, 0, 0, 0);
+ if( !gubVideoConferencingMode)
+ {
+ gubVideoConferencingMode = AIM_VIDEO_POPUP_MODE;
+ //gubVideoConferencingMode = AIM_VIDEO_INIT_MODE;
+ gfFirstTimeInContactScreen = TRUE;
+ }
+ InitCreateDeleteAimPopUpBox(AIM_POPUP_DELETE, NULL, NULL, 0, 0, 0);
}
break;
#ifdef JA2TESTVERSION
@@ -5467,6 +5468,31 @@ void RefreshWeaponKitSelectionButtons()
{
//tais: shorthand function to refresh buttons
DisableWeaponKitSelectionButtons();
+ STR16
+ kit1label = CharacterInfo[AIM_MEMBER_GEAR_KIT_ONE],
+ kit2label = CharacterInfo[AIM_MEMBER_GEAR_KIT_TWO],
+ kit3label = CharacterInfo[AIM_MEMBER_GEAR_KIT_THREE],
+ kit4label = CharacterInfo[AIM_MEMBER_GEAR_KIT_FOUR],
+ kit5label = CharacterInfo[AIM_MEMBER_GEAR_KIT_FIVE];
+
+ if (gbCurrentSoldier != -1)
+ {
+ if (gMercProfileGear[gbCurrentSoldier][0].mGearKitName[0] != '\0')
+ kit1label = gMercProfileGear[gbCurrentSoldier][0].mGearKitName;
+ if (gMercProfileGear[gbCurrentSoldier][1].mGearKitName[0] != '\0')
+ kit2label = gMercProfileGear[gbCurrentSoldier][1].mGearKitName;
+ if (gMercProfileGear[gbCurrentSoldier][2].mGearKitName[0] != '\0')
+ kit3label = gMercProfileGear[gbCurrentSoldier][2].mGearKitName;
+ if (gMercProfileGear[gbCurrentSoldier][3].mGearKitName[0] != '\0')
+ kit4label = gMercProfileGear[gbCurrentSoldier][3].mGearKitName;
+ if (gMercProfileGear[gbCurrentSoldier][4].mGearKitName[0] != '\0')
+ kit5label = gMercProfileGear[gbCurrentSoldier][4].mGearKitName;
+ }
+ SpecifyButtonText( giWeaponboxSelectionButtonOne, kit1label );
+ SpecifyButtonText( giWeaponboxSelectionButtonTwo, kit2label );
+ SpecifyButtonText( giWeaponboxSelectionButtonThree, kit3label );
+ SpecifyButtonText( giWeaponboxSelectionButtonFour, kit4label );
+ SpecifyButtonText( giWeaponboxSelectionButtonFive, kit5label );
EnableWeaponKitSelectionButtons();
}
diff --git a/Laptop/BobbyRGuns.cpp b/Laptop/BobbyRGuns.cpp
index f6c70f04..67969958 100644
--- a/Laptop/BobbyRGuns.cpp
+++ b/Laptop/BobbyRGuns.cpp
@@ -138,7 +138,7 @@
#define BOBBYR_PERCENT_FUNTCIONAL_Y BOBBYR_ORDER_SUBTOTAL_Y + 15
-BobbyRayPurchaseStruct BobbyRayPurchases[ MAX_PURCHASE_AMOUNT ];
+BobbyRayPurchaseStruct BobbyRayPurchases[ 100 ];
//BobbyRayOrderStruct *BobbyRayOrdersOnDeliveryArray=NULL;
//UINT8 usNumberOfBobbyRayOrderItems = 0;
@@ -347,14 +347,14 @@ void GameInitBobbyRGuns()
guiCurrentArmourFilterMode = -1;
guiCurrentMiscFilterMode = -1;
- memset(&BobbyRayPurchases, 0, MAX_PURCHASE_AMOUNT);
+ memset(&BobbyRayPurchases, 0, gGameExternalOptions.ubBobbyRayMaxPurchaseAmount);
}
void EnterInitBobbyRGuns()
{
guiTempCurrentMode=0;
- memset(&BobbyRayPurchases, 0, MAX_PURCHASE_AMOUNT);
+ memset(&BobbyRayPurchases, 0, gGameExternalOptions.ubBobbyRayMaxPurchaseAmount);
}
@@ -1752,7 +1752,7 @@ BOOLEAN DisplayAmmoInfo(UINT16 usIndex, UINT16 usTextPosY, BOOLEAN fUsed, UINT16
usHeight = DisplayCaliber(usHeight, usIndex, usFontHeight);
//Magazine
-// usHeight = DisplayMagazine(usHeight, usIndex, usFontHeight);
+ usHeight = DisplayMagazine(usHeight, usIndex, usFontHeight);
//Display the Cost and the qty bought and on hand
usHeight = DisplayCostAndQty(usTextPosY, usIndex, usFontHeight, usBobbyIndex, fUsed);
@@ -1991,7 +1991,7 @@ UINT16 DisplayMagazine(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight)
CHAR16 sTemp[20];
DrawTextToScreen(BobbyRText[BOBBYR_GUNS_MAGAZINE], BOBBYR_ITEM_WEIGHT_TEXT_X, (UINT16)usPosY, 0, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
- swprintf(sTemp, L"%3d %s", Weapon[usIndex].ubMagSize, pMessageStrings[ MSG_ROUNDS_ABBREVIATION ] );
+ swprintf(sTemp, L"%3d %s", Magazine[Item[usIndex].ubClassIndex].ubMagSize, pMessageStrings[ MSG_ROUNDS_ABBREVIATION ] );
DrawTextToScreen(sTemp, BOBBYR_ITEM_WEIGHT_NUM_X, (UINT16)usPosY, BOBBYR_ITEM_WEIGHT_NUM_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
usPosY += usFontHeight + 2;
return(usPosY);
@@ -2919,7 +2919,9 @@ void PurchaseBobbyRayItem(UINT16 usItemNumber, BOOLEAN fAllItems )
else
{
//display error popup because the player is trying to purchase more thenn 10 items
- DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, BobbyRText[ BOBBYR_MORE_THEN_10_PURCHASES ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
+ CHAR16 sMaxPurchase[255];
+ swprintf(sMaxPurchase, L"%s%d%s", BobbyRText[ BOBBYR_MORE_THEN_10_PURCHASES_A], gGameExternalOptions.ubBobbyRayMaxPurchaseAmount, BobbyRText[ BOBBYR_MORE_THEN_10_PURCHASES_B]);
+ DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sMaxPurchase, LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
}
}
@@ -2965,7 +2967,9 @@ void PurchaseBobbyRayItem(UINT16 usItemNumber, BOOLEAN fAllItems )
else
{
//display error popup because the player is trying to purchase more thenn 10 items
- DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, BobbyRText[ BOBBYR_MORE_THEN_10_PURCHASES ], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
+ CHAR16 sMaxPurchase[255];
+ swprintf(sMaxPurchase, L"%s%d%s", BobbyRText[ BOBBYR_MORE_THEN_10_PURCHASES_A], gGameExternalOptions.ubBobbyRayMaxPurchaseAmount, BobbyRText[ BOBBYR_MORE_THEN_10_PURCHASES_B]);
+ DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sMaxPurchase, LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL);
}
}
// Else If the item is already purchased increment purchase amount. Only if ordering less then the max amount!
@@ -2994,7 +2998,7 @@ UINT8 CheckIfItemIsPurchased(UINT16 usItemNumber)
{
UINT8 i;
- for(i=0; i= AMMO_BOX || (Magazine[ Item[ usItemIndex ].ubClassIndex ].ubMagType < AMMO_BOX && Weapon[i].ubMagSize == Magazine[Item[usItemIndex].ubClassIndex].ubMagSize ))
{
bRetValue = TRUE;
break;
@@ -3735,7 +3745,7 @@ void HandleBobbyRGunsKeyBoardInput()
fCtrl = _KeyDown( CTRL );
fAlt = _KeyDown( ALT );
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN |KEY_REPEAT) == TRUE)
{
if( InputEvent.usEvent == KEY_DOWN )
{
diff --git a/Laptop/BobbyRMailOrder.cpp b/Laptop/BobbyRMailOrder.cpp
index 7a77ac68..e7fafb36 100644
--- a/Laptop/BobbyRMailOrder.cpp
+++ b/Laptop/BobbyRMailOrder.cpp
@@ -80,6 +80,8 @@ enum
#define BOBBYR_ORDER_NUM_SHIPPING_CITIES 17
#define BOBBYR_NUM_DISPLAYED_CITIES 10
+#define BOBBYR_NUM_DISPLAYED_ITEMS 10
+
#define OVERNIGHT_EXPRESS 1
#define TWO_BUSINESS_DAYS 2
#define STANDARD_SERVICE 3
@@ -126,17 +128,17 @@ enum
#define BOBBYR_GRID_ROW_OFFSET 20
#define BOBBYR_GRID_TITLE_OFFSET 27
-#define BOBBYR_GRID_FIRST_COLUMN_X 3//BOBBYR_ORDERGRID_X + 3
+#define BOBBYR_GRID_FIRST_COLUMN_X 23//BOBBYR_ORDERGRID_X + 3
#define BOBBYR_GRID_FIRST_COLUMN_Y 37//BOBBYR_ORDERGRID_Y + 37
#define BOBBYR_GRID_FIRST_COLUMN_WIDTH 23
-#define BOBBYR_GRID_SECOND_COLUMN_X 28//BOBBYR_ORDERGRID_X + 28
+#define BOBBYR_GRID_SECOND_COLUMN_X 48//BOBBYR_ORDERGRID_X + 28
#define BOBBYR_GRID_SECOND_COLUMN_Y BOBBYR_GRID_FIRST_COLUMN_Y
#define BOBBYR_GRID_SECOND_COLUMN_WIDTH 40
-#define BOBBYR_GRID_THIRD_COLUMN_X 70//BOBBYR_ORDERGRID_X + 70
+#define BOBBYR_GRID_THIRD_COLUMN_X 90//BOBBYR_ORDERGRID_X + 70
#define BOBBYR_GRID_THIRD_COLUMN_Y BOBBYR_GRID_FIRST_COLUMN_Y
-#define BOBBYR_GRID_THIRD_COLUMN_WIDTH 111
+#define BOBBYR_GRID_THIRD_COLUMN_WIDTH 91
#define BOBBYR_GRID_FOURTH_COLUMN_X 184//BOBBYR_ORDERGRID_X + 184
#define BOBBYR_GRID_FOURTH_COLUMN_Y BOBBYR_GRID_FIRST_COLUMN_Y
@@ -146,8 +148,18 @@ enum
#define BOBBYR_GRID_FIFTH_COLUMN_Y BOBBYR_GRID_FIRST_COLUMN_Y
#define BOBBYR_GRID_FIFTH_COLUMN_WIDTH 42
+#define BOBBYR_GRID_SCROLL_COLUMN_X 2
+#define BOBBYR_GRID_SCROLL_COLUMN_Y BOBBYR_GRID_FIRST_COLUMN_Y - 2
+#define BOBBYR_GRID_SCROLL_COLUMN_WIDTH 23
+#define BOBBYR_GRID_SCROLL_COLUMN_HEIGHT BOBBYR_GRID_ROW_OFFSET * 10
+#define BOBBYR_GRID_SCROLL_COLUMN_HEIGHT_MINUS_ARROWS ( BOBBYR_GRID_SCROLL_COLUMN_HEIGHT - (2 * BOBBYR_SCROLL_ARROW_HEIGHT) - 8 )
+#define BOBBYR_GRID_SCROLL_UP_ARROW_X BOBBYR_GRID_SCROLL_COLUMN_X + 2
+#define BOBBYR_GRID_SCROLL_UP_ARROW_Y BOBBYR_GRID_SCROLL_COLUMN_Y + 4
+#define BOBBYR_GRID_SCROLL_DOWN_ARROW_X BOBBYR_GRID_SCROLL_UP_ARROW_X
+#define BOBBYR_GRID_SCROLL_DOWN_ARROW_Y BOBBYR_GRID_SCROLL_COLUMN_Y+BOBBYR_GRID_SCROLL_COLUMN_HEIGHT-24
+
#define BOBBYR_SUBTOTAL_WIDTH 212
-#define BOBBYR_SUBTOTAL_X BOBBYR_GRID_FIRST_COLUMN_X
+#define BOBBYR_SUBTOTAL_X BOBBYR_GRID_FIRST_COLUMN_X - 20
#define BOBBYR_SUBTOTAL_Y BOBBYR_GRID_FIRST_COLUMN_Y + BOBBYR_GRID_ROW_OFFSET * 10 + 3
#define BOBBYR_SHIPPING_N_HANDLE_Y BOBBYR_SUBTOTAL_Y + 17
@@ -262,6 +274,14 @@ UINT8 gubDropDownAction;
INT8 gbSelectedCity=-1; //keeps track of the currently selected city
UINT8 gubCityAtTopOfList;
+UINT8 gubPurchaseAtTopOfList;
+UINT8 guidivisor;
+
+BOOLEAN gfDrawGridArrowMouseRegions=FALSE;
+BOOLEAN gfDrawGridColumnMouseRegion=FALSE;
+
+extern BOOLEAN gfBobbyRShipmentsDirty;
+
BOOLEAN gfRemoveItemsFromStock=FALSE;
NewBobbyRayOrderStruct *gpNewBobbyrShipments;
@@ -337,6 +357,14 @@ void SelectTitleLinkRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
MOUSE_REGION gSelectedUpDownArrowOnScrollAreaRegion[2];
void SelectUpDownArrowOnScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
+//mouse region to click on the up or down arrow on the grid scroll area
+MOUSE_REGION gSelectedUpDownArrowOnGridScrollAreaRegion[2];
+void SelectUpDownArrowOnGridScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
+//mouse region for scroll column in the grid area.
+MOUSE_REGION *gSelectedGridScrollColumnRegion;
+void SelectGridScrollColumnRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
+void SelectGridScrollColumnMovementCallBack(MOUSE_REGION * pRegion, INT32 iReason );
+
//Dealtar's Airport Externalization.
INT16 gusCurShipmentDestinationID;
extern CPostalService gPostalService;
@@ -368,6 +396,7 @@ void DisplayPackageWeight( );
void ShutDownBobbyRNewMailOrders();
//ppp
+void DrawOrderGoldRectangle(UINT16 usGridX, UINT16 usGridY);
void GameInitBobbyRMailOrder()
{
@@ -390,6 +419,9 @@ BOOLEAN EnterBobbyRMailOrder()
gfDestroyConfirmGrphiArea = FALSE;
gfCanAcceptOrder = TRUE;
gubDropDownAction = BR_DROP_DOWN_NO_ACTION;
+ gfDrawGridArrowMouseRegions = FALSE;
+ gfDrawGridColumnMouseRegion = FALSE;
+ gubPurchaseAtTopOfList = 0;
gShippingSpeedAreas[0] = iScreenWidthOffset + 585;
gShippingSpeedAreas[1] = iScreenHeightOffset + 218 + LAPTOP_SCREEN_WEB_DELTA_Y;
@@ -547,7 +579,6 @@ BOOLEAN EnterBobbyRMailOrder()
MSYS_AddRegion(&gSelectedCloseDropDownRegion);
MSYS_DisableRegion(&gSelectedCloseDropDownRegion);
-
CreateBobbyRayOrderTitle();
guiShippingCost = 0;
@@ -607,7 +638,18 @@ void ExitBobbyRMailOrder()
MSYS_RemoveRegion( &gSelectedConfirmOrderRegion);
MSYS_RemoveRegion( &gSelectedActivateCityDroDownRegion);
MSYS_RemoveRegion( &gSelectedCloseDropDownRegion);
-
+ if (gfDrawGridArrowMouseRegions == TRUE)
+ {
+ MSYS_DisableRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[0]);
+ MSYS_DisableRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[1]);
+ MSYS_RemoveRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[0]);
+ MSYS_RemoveRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[1]);
+ }
+ if (gfDrawGridColumnMouseRegion == TRUE)
+ {
+ MSYS_DisableRegion( gSelectedGridScrollColumnRegion);
+ MSYS_RemoveRegion( gSelectedGridScrollColumnRegion);
+ }
//if the drop down box is active, destroy it
gubDropDownAction = BR_DROP_DOWN_DESTROY;
@@ -774,11 +816,12 @@ void BtnBobbyRClearOrderCallback(GUI_BUTTON *btn,INT32 reason)
{
btn->uiFlags &= (~BUTTON_CLICKED_ON );
- memset(&BobbyRayPurchases, 0, sizeof(BobbyRayPurchaseStruct) * MAX_PURCHASE_AMOUNT);
+ memset(&BobbyRayPurchases, 0, sizeof(BobbyRayPurchaseStruct) * gGameExternalOptions.ubBobbyRayMaxPurchaseAmount);
gubSelectedLight = 0;
gfReDrawBobbyOrder = TRUE;
gbSelectedCity = -1;
gubCityAtTopOfList = 0;
+ gubPurchaseAtTopOfList = 0;
//Get rid of the city drop dowm, if it is being displayed
gubDropDownAction = BR_DROP_DOWN_DESTROY;
@@ -878,7 +921,7 @@ void BtnBobbyRAcceptOrderCallback(GUI_BUTTON *btn,INT32 reason)
ubCount = 0;
- for(i=0; i 1)
+ {//Scroll Bar
+ usPosX = usGridX + BOBBYR_GRID_SCROLL_COLUMN_X;
+ usPosY = usGridY + BOBBYR_GRID_SCROLL_UP_ARROW_Y + BOBBYR_SCROLL_ARROW_HEIGHT;
+ usHeight = BOBBYR_GRID_SCROLL_COLUMN_HEIGHT_MINUS_ARROWS / guidivisor;
+ gSelectedGridScrollColumnRegion = new MOUSE_REGION[guidivisor];
+ if (gfDrawGridColumnMouseRegion == FALSE)
+ {
+ for(i=0; iuiFlags &= (~BUTTON_CLICKED_ON );
+ InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
+ }
+ else if (reason & MSYS_CALLBACK_REASON_GAIN_MOUSE )
+ {
+ if( gfLeftButtonState )
+ {
+ UINT8 ubPurchaseNumber = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
+
+ pRegion->uiFlags |= BUTTON_CLICKED_ON ;
+
+ if( ubPurchaseNumber < gubPurchaseAtTopOfList )
+ {
+ gubPurchaseAtTopOfList = ubPurchaseNumber;
+ }
+
+ if( ubPurchaseNumber > gubPurchaseAtTopOfList )
+ {
+ if( ( ubPurchaseNumber - gubPurchaseAtTopOfList ) >= BOBBYR_NUM_DISPLAYED_ITEMS )
+ gubPurchaseAtTopOfList = ubPurchaseNumber - BOBBYR_NUM_DISPLAYED_ITEMS + 1;
+ }
+ gfReDrawBobbyOrder = TRUE;
+ gfBobbyRShipmentsDirty = TRUE;
+ InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
+ }
+ }
+}
+
+void SelectGridScrollColumnRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
+{
+ if (iReason & MSYS_CALLBACK_REASON_INIT)
+ {
+ }
+ else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
+ {
+ UINT8 ubPurchaseNumber = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
+
+ if( ubPurchaseNumber < gubPurchaseAtTopOfList )
+ {
+ gubPurchaseAtTopOfList--;
+ }
+
+ if( ubPurchaseNumber > gubPurchaseAtTopOfList )
+ {
+ gubPurchaseAtTopOfList++;
+ }
+
+ }
+ else if (iReason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT)
+ {
+ UINT8 ubPurchaseNumber = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
+
+ pRegion->uiFlags |= BUTTON_CLICKED_ON ;
+
+ if( ubPurchaseNumber < gubPurchaseAtTopOfList )
+ {
+ gubPurchaseAtTopOfList--;
+ }
+
+ if( ubPurchaseNumber > gubPurchaseAtTopOfList )
+ {
+ gubPurchaseAtTopOfList++;
+ }
+
+ gfReDrawBobbyOrder = TRUE;
+ gfBobbyRShipmentsDirty = TRUE;
+ InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
+ }
+}
+
+void SelectUpDownArrowOnGridScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
+{
+ if (iReason & MSYS_CALLBACK_REASON_INIT)
+ {
+ }
+ else if( iReason & MSYS_CALLBACK_REASON_LBUTTON_UP || iReason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
+ {
+ UINT8 ubDownArrow = (UINT8)MSYS_GetRegionUserData( pRegion, 0 );
+
+ if( ubDownArrow )
+ {
+ if( gubPurchaseAtTopOfList < guidivisor-1 )
+ {
+ gubPurchaseAtTopOfList++;
+ }
+ }
+ else
+ {
+ if( gubPurchaseAtTopOfList > 0 )
+ gubPurchaseAtTopOfList--;
+
+ }
+ gfReDrawBobbyOrder = TRUE;
+ gfBobbyRShipmentsDirty = TRUE;
+ InvalidateRegion(pRegion->RegionTopLeftX, pRegion->RegionTopLeftY, pRegion->RegionBottomRightX, pRegion->RegionBottomRightY);
+ }
+}
+
+void DrawOrderGoldRectangle (UINT16 usGridX, UINT16 usGridY)
+{
+ if (guidivisor == 1) return;
+ UINT32 uiDestPitchBYTES;
+ UINT8 *pDestBuf;
+ UINT16 usWidth, usTempHeight, usTempPosY, usHeight;
+ UINT16 usPosX, usPosY;
+ UINT16 temp;
+
+ usTempPosY = usGridY + BOBBYR_GRID_SCROLL_UP_ARROW_Y + BOBBYR_SCROLL_ARROW_HEIGHT;
+ usPosX = usGridX + BOBBYR_GRID_SCROLL_COLUMN_X + 2;
+ usWidth = BOBBYR_GRID_SCROLL_COLUMN_WIDTH - 5;
+ usTempHeight = ( BOBBYR_GRID_SCROLL_COLUMN_HEIGHT - 2 * BOBBYR_SCROLL_ARROW_HEIGHT );
+
+ usHeight = usTempHeight / guidivisor;
+
+ usPosY = usTempPosY + (UINT16)( ( ( BOBBYR_GRID_SCROLL_COLUMN_HEIGHT - 2 * BOBBYR_SCROLL_ARROW_HEIGHT ) / (FLOAT)(guidivisor) ) * gubPurchaseAtTopOfList );
+
+ temp = usGridY + BOBBYR_GRID_SCROLL_COLUMN_Y + BOBBYR_GRID_SCROLL_COLUMN_HEIGHT - BOBBYR_SCROLL_ARROW_HEIGHT - usHeight - 1;
+
+ if( usPosY >= temp )
+ usPosY = usGridY + BOBBYR_GRID_SCROLL_COLUMN_Y + BOBBYR_GRID_SCROLL_COLUMN_HEIGHT - BOBBYR_SCROLL_ARROW_HEIGHT - usHeight - 5;
+
+ ColorFillVideoSurfaceArea( FRAME_BUFFER, usPosX, usPosY, usPosX+usWidth, usPosY+usHeight, Get16BPPColor( FROMRGB( 186, 165, 68 ) ) );
+
+ //display the line
+ pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
+ SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+
+ // draw the shadow line around the rectangle
+ LineDraw(FALSE, usPosX, usPosY, usPosX+usWidth, usPosY, Get16BPPColor( FROMRGB( 65, 49, 6) ), pDestBuf);
+ LineDraw(FALSE, usPosX, usPosY, usPosX, usPosY+usHeight, Get16BPPColor( FROMRGB( 65, 49, 6 ) ), pDestBuf);
+ LineDraw(FALSE, usPosX, usPosY+usHeight, usPosX+usWidth, usPosY+usHeight, Get16BPPColor( FROMRGB( 65, 49, 6 ) ), pDestBuf);
+ LineDraw(FALSE, usPosX+usWidth, usPosY, usPosX+usWidth, usPosY+usHeight, Get16BPPColor( FROMRGB( 65, 49, 6 ) ), pDestBuf);
+
+ // unlock frame buffer
+ UnLockVideoSurface( FRAME_BUFFER );
+}
UINT32 CalcCostFromWeightOfPackage( UINT8 ubTypeOfService )
{
@@ -2001,7 +2271,7 @@ UINT32 CalcCostFromWeightOfPackage( UINT8 ubTypeOfService )
//Get the package's weight
uiTotalWeight = CalcPackageTotalWeight();
-/* for(i=0; i 0; i++)
+ for(int i=0; i < gGameExternalOptions.ubBobbyRayMaxPurchaseAmount && pPurchaseStruct[i].usItemIndex > 0; i++)
{
gPostalService.AddPackageToShipment(usID, pPurchaseStruct[i].usItemIndex, pPurchaseStruct[i].ubNumberPurchased, pPurchaseStruct[i].bItemQuality);
}
diff --git a/Laptop/BobbyRMailOrder.h b/Laptop/BobbyRMailOrder.h
index 886519d8..d14d712f 100644
--- a/Laptop/BobbyRMailOrder.h
+++ b/Laptop/BobbyRMailOrder.h
@@ -59,7 +59,7 @@ typedef struct
BOOLEAN fActive;
UINT8 ubDeliveryLoc; // the city the shipment is going to
UINT8 ubDeliveryMethod; // type of delivery: next day, 2 days ...
- BobbyRayPurchaseStruct BobbyRayPurchase[ MAX_PURCHASE_AMOUNT ];
+ BobbyRayPurchaseStruct BobbyRayPurchase[ 100 ];
UINT8 ubNumberPurchases;
UINT32 uiPackageWeight;
diff --git a/Laptop/BobbyRShipments.cpp b/Laptop/BobbyRShipments.cpp
index 09479fc4..dc6f147e 100644
--- a/Laptop/BobbyRShipments.cpp
+++ b/Laptop/BobbyRShipments.cpp
@@ -69,8 +69,14 @@
//#define BOBBYR_SHIPMENT_
-
-
+extern UINT8 gubPurchaseAtTopOfList;
+extern BOOLEAN gfDrawGridArrowMouseRegions;
+extern BOOLEAN gfDrawGridColumnMouseRegion;
+extern MOUSE_REGION gSelectedUpDownArrowOnGridScrollAreaRegion[2];
+extern void SelectUpDownArrowOnGridScrollAreaRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
+extern MOUSE_REGION *gSelectedGridScrollColumnRegion;
+extern void SelectGridScrollColumnRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason );
+extern void SelectGridScrollColumnMovementCallBack(MOUSE_REGION * pRegion, INT32 iReason );
UINT32 guiBobbyRShipmentGrid;
@@ -107,8 +113,8 @@ INT32 CountNumberValidShipmentForTheShipmentsPage();
//ppp
extern CPostalService gPostalService;
extern vector gShipmentTable;
-
-
+extern UINT32 guiGoldArrowImages;
+extern UINT32 guiBobbyROrderGrid;
//
// Function
//
@@ -130,6 +136,10 @@ BOOLEAN EnterBobbyRShipments()
FilenameForBPP("LAPTOP\\BobbyRay_OnOrder.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiBobbyRShipmentGrid));
+ // Gold Arrow for the scroll area
+ VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+ FilenameForBPP( "LAPTOP\\GoldArrows.sti", VObjectDesc.ImageFile );
+ CHECKF( AddVideoObject( &VObjectDesc, &guiGoldArrowImages ) );
guiBobbyRShipmentBackImage = LoadButtonImage("LAPTOP\\CatalogueButton.sti", -1,0,-1,1,-1 );
guiBobbyRShipmetBack = CreateIconAndTextButton( guiBobbyRShipmentBackImage, BobbyROrderFormText[BOBBYR_BACK], BOBBYR_GUNS_BUTTON_FONT,
@@ -153,6 +163,7 @@ BOOLEAN EnterBobbyRShipments()
CreateBobbyRayOrderTitle();
giBobbyRShipmentSelectedShipment = -1;
+ gubPurchaseAtTopOfList = 0;
/*
//if there are shipments
@@ -194,7 +205,20 @@ BOOLEAN EnterBobbyRShipments()
}
}
-
+ if (gfDrawGridArrowMouseRegions == TRUE)
+ {
+ MSYS_DisableRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[0]);
+ MSYS_DisableRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[1]);
+ MSYS_RemoveRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[0]);
+ MSYS_RemoveRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[1]);
+ gfDrawGridArrowMouseRegions = FALSE;
+ }
+ if (gfDrawGridColumnMouseRegion == TRUE)
+ {
+ MSYS_DisableRegion( gSelectedGridScrollColumnRegion);
+ MSYS_RemoveRegion( gSelectedGridScrollColumnRegion);
+ gfDrawGridColumnMouseRegion = FALSE;
+ }
CreatePreviousShipmentsMouseRegions();
return( TRUE );
@@ -206,6 +230,7 @@ void ExitBobbyRShipments()
DestroyBobbyROrderTitle();
DeleteVideoObjectFromIndex(guiBobbyRShipmentGrid);
+ DeleteVideoObjectFromIndex(guiGoldArrowImages);
UnloadButtonImage( guiBobbyRShipmentBackImage );
UnloadButtonImage( giBobbyRShipmentHomeImage );
@@ -213,6 +238,20 @@ void ExitBobbyRShipments()
RemoveButton( guiBobbyRShipmentHome );
RemovePreviousShipmentsMouseRegions();
+ if (gfDrawGridArrowMouseRegions == TRUE)
+ {
+ MSYS_DisableRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[0]);
+ MSYS_DisableRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[1]);
+ MSYS_RemoveRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[0]);
+ MSYS_RemoveRegion( &gSelectedUpDownArrowOnGridScrollAreaRegion[1]);
+ gfDrawGridArrowMouseRegions = FALSE;
+}
+ if (gfDrawGridColumnMouseRegion == TRUE)
+ {
+ MSYS_DisableRegion( gSelectedGridScrollColumnRegion);
+ MSYS_RemoveRegion( gSelectedGridScrollColumnRegion);
+ gfDrawGridColumnMouseRegion = FALSE;
+ }
}
void HandleBobbyRShipments()
@@ -230,8 +269,8 @@ void RenderBobbyRShipments()
// HVOBJECT hPixHandle;
// Dealtar: this must be static as this is accessed after this function has returned
- static BobbyRayPurchaseStruct brps[MAX_PURCHASE_AMOUNT];
- for(int i = 0; i < MAX_PURCHASE_AMOUNT; i++)
+ static BobbyRayPurchaseStruct brps[100];
+ for(int i = 0; i < 100; i++) //JMich
{
memset(&brps[i], 0, sizeof(BobbyRayPurchaseStruct));
}
@@ -363,15 +402,20 @@ void BtnBobbyRShipmentHomeCallback(GUI_BUTTON *btn,INT32 reason)
void DisplayShipmentGrid()
{
- HVOBJECT hPixHandle;
-
+ HVOBJECT hPixHandle, hPixGrid;
+ VOBJECT_DESC VObjectDesc;
GetVideoObject(&hPixHandle, guiBobbyRShipmentGrid);
-
// Shipment Order Grid
BltVideoObject(FRAME_BUFFER, hPixHandle, 0, BOBBYR_SHIPMENT_DELIVERY_GRID_X, BOBBYR_SHIPMENT_DELIVERY_GRID_Y, VO_BLT_SRCTRANSPARENCY,NULL);
+ VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
+ FilenameForBPP("LAPTOP\\BobbyOrderGrid.sti", VObjectDesc.ImageFile);
+ AddVideoObject(&VObjectDesc, &guiBobbyROrderGrid);
+ GetVideoObject(&hPixGrid, guiBobbyROrderGrid);
+ BltVideoObject(FRAME_BUFFER, hPixGrid, 0, BOBBYR_SHIPMENT_ORDER_GRID_X, BOBBYR_SHIPMENT_ORDER_GRID_Y, VO_BLT_SRCTRANSPARENCY,NULL);
+
// Order Grid
- BltVideoObject(FRAME_BUFFER, hPixHandle, 1, BOBBYR_SHIPMENT_ORDER_GRID_X, BOBBYR_SHIPMENT_ORDER_GRID_Y, VO_BLT_SRCTRANSPARENCY,NULL);
+ //BltVideoObject(FRAME_BUFFER, hPixGrid, 0, BOBBYR_SHIPMENT_ORDER_GRID_X, BOBBYR_SHIPMENT_ORDER_GRID_Y, VO_BLT_SRCTRANSPARENCY,NULL);
}
@@ -497,6 +541,7 @@ void SelectPreviousShipmentsRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason
}
else if(iReason & MSYS_CALLBACK_REASON_LBUTTON_UP)
{
+ gubPurchaseAtTopOfList = 0;
INT32 iSlotID = MSYS_GetRegionUserData( pRegion, 0 );
diff --git a/Laptop/BriefingRoom.cpp b/Laptop/BriefingRoom.cpp
index 936c23ff..49dc1149 100644
--- a/Laptop/BriefingRoom.cpp
+++ b/Laptop/BriefingRoom.cpp
@@ -426,7 +426,7 @@ void GetPlayerKeyBoardInputForBriefingRoomHomePage( void )
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
// HOOK INTO MOUSE HOOKS
/*
diff --git a/Laptop/BriefingRoomM.cpp b/Laptop/BriefingRoomM.cpp
index 45b87f8d..4bcaef4a 100644
--- a/Laptop/BriefingRoomM.cpp
+++ b/Laptop/BriefingRoomM.cpp
@@ -493,7 +493,7 @@ void GetPlayerKeyBoardInputForBriefingRoomEnterHomePage( void )
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
// HOOK INTO MOUSE HOOKS
/*
diff --git a/Laptop/Encyclopedia_Data.cpp b/Laptop/Encyclopedia_Data.cpp
index a28e0432..946e0d7c 100644
--- a/Laptop/Encyclopedia_Data.cpp
+++ b/Laptop/Encyclopedia_Data.cpp
@@ -56,8 +56,9 @@ BOOLEAN ResetVal = FALSE;
UINT32 IDPageEncyData;
void InitData ( BOOLEAN bInit );
-#define ENCYCLOPEDIA_LOCATION_PAGE1_X LAPTOP_SCREEN_UL_X + 100
-#define ENCYCLOPEDIA_LOCATION_PAGE1_Y LAPTOP_SCREEN_WEB_UL_Y + 357
+#define ENCYCLOPEDIA_LOCATION_PAGE1_X (LAPTOP_SCREEN_UL_X + 100)
+#define ENCYCLOPEDIA_LOCATION_PAGE1_Y (LAPTOP_SCREEN_WEB_UL_Y + 357)
+#define ENCYCLOPEDIA_LOCATION_FILTER_Y (LAPTOP_SCREEN_WEB_UL_Y + 10)
#define ENCYCLOPEDIA_LOCATION_PAGE_COLOR_UP FONT_MCOLOR_DKWHITE
#define ENCYCLOPEDIA_LOCATION_PAGE_COLOR_DOWN 138
#define ENCYCLOPEDIA_LOCATION_PAGE_FONT FONT10ARIAL
@@ -708,7 +709,7 @@ void InitSoundButtons()
UINT16 usPosY, i;
guiSoundButtonsImage = LoadButtonImage("BriefingRoom\\BUTTONF.sti", -1,0,-1,1,-1 );
- usPosY = ENCYCLOPEDIA_LOCATION_PAGE1_X+15;
+ usPosY = ENCYCLOPEDIA_LOCATION_FILTER_Y;
for(i=0; i
#include
+#include "Soldier Profile.h"
+
// Changed by ADB (rev 1513) to resolve IMPs created prior to structural changes
//#define IMP_FILENAME_SUFFIX ".dat"
#define OLD_IMP_FILENAME_SUFFIX ".dat"
@@ -52,7 +54,7 @@
typedef struct
{
UINT16 inv;
- UINT8 iSize;
+ UINT16 iSize;
UINT32 iClass;
UINT8 iStatus;
UINT8 iNumber;
@@ -67,10 +69,10 @@ UINT32 giIMPConfirmButton[ 2 ];
UINT32 giIMPConfirmButtonImage[ 2 ];
BOOLEAN fNoAlreadySelected = FALSE;
-IMP_FACE_VALUES gIMPFaceValues[200];
+IMP_FACE_VALUES gIMPFaceValues[NUM_PROFILES];
-IMP_FEMALE_VALUES gIMPFemaleValues[200];
-IMP_MALE_VALUES gIMPMaleValues[200];
+IMP_FEMALE_VALUES gIMPFemaleValues[NUM_PROFILES];
+IMP_MALE_VALUES gIMPMaleValues[NUM_PROFILES];
/*
UINT16 uiEyeXPositions[ ]={
@@ -965,8 +967,8 @@ void MakeProfileInvItemAnySlot(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8
// CHRISL: New function to move initial gear into LBE pockets when LBE items are given during creation
void RedistributeStartingItems(MERCPROFILESTRUCT *pProfile, UINT16 usItem, UINT8 sPocket)
{
- UINT16 lbeIndex;
- UINT8 lbeClass, iSize;
+ UINT16 lbeIndex, iSize;
+ UINT8 lbeClass;
UINT16 inv[NUM_INV_SLOTS], istatus[NUM_INV_SLOTS], inumber[NUM_INV_SLOTS];
lbeIndex = Item[usItem].ubClassIndex;
@@ -1577,10 +1579,12 @@ BOOLEAN LoadImpCharacter( STR nickName )
void ResetIMPCharactersEyesAndMouthOffsets( UINT8 ubMercProfileID )
{
// ATE: Check boundary conditions!
- if( ( ( gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ) > MAX_NEW_IMP_PORTRAITS ) || ( ubMercProfileID >= PROF_HUMMER ) ) // 16
+/*
+ if( ( ( gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ) > MAX_NEW_IMP_PORTRAITS ) || ( ubMercProfileID >= PROF_HUMMER ) ) // 16
{
return;
}
+*/
/*
gMercProfiles[ ubMercProfileID ].usEyesX = gIMPFaceValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiEyeXPositions;
gMercProfiles[ ubMercProfileID ].usEyesY = gIMPFaceValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiEyeYPositions;
@@ -1589,7 +1593,7 @@ void ResetIMPCharactersEyesAndMouthOffsets( UINT8 ubMercProfileID )
gMercProfiles[ ubMercProfileID ].usMouthY = gIMPFaceValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiMouthYPositions;
*/
-
+ /*
if( gMercProfiles[ ubMercProfileID ].bSex == 0 )
{
gMercProfiles[ ubMercProfileID ].usEyesX = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiEyeXPositions;
@@ -1606,7 +1610,25 @@ void ResetIMPCharactersEyesAndMouthOffsets( UINT8 ubMercProfileID )
gMercProfiles[ ubMercProfileID ].usMouthX = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiMouthXPositions;
gMercProfiles[ ubMercProfileID ].usMouthY = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex - 200 ].uiMouthYPositions;
}
+ */
+ if( gMercProfiles[ ubMercProfileID ].bSex == 0 )
+ {
+ gMercProfiles[ ubMercProfileID ].usEyesX = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiEyeXPositions;
+ gMercProfiles[ ubMercProfileID ].usEyesY = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiEyeYPositions;
+
+ gMercProfiles[ ubMercProfileID ].usMouthX = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiMouthXPositions;
+ gMercProfiles[ ubMercProfileID ].usMouthY = gIMPMaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiMouthYPositions;
+ }
+ else
+ {
+ gMercProfiles[ ubMercProfileID ].usEyesX = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiEyeXPositions;
+ gMercProfiles[ ubMercProfileID ].usEyesY = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiEyeYPositions;
+
+ gMercProfiles[ ubMercProfileID ].usMouthX = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiMouthXPositions;
+ gMercProfiles[ ubMercProfileID ].usMouthY = gIMPFemaleValues[ gMercProfiles[ ubMercProfileID ].ubFaceIndex ].uiMouthYPositions;
+ }
+
}
diff --git a/Laptop/IMP Confirm.h b/Laptop/IMP Confirm.h
index 2bba2a9d..e1257d8b 100644
--- a/Laptop/IMP Confirm.h
+++ b/Laptop/IMP Confirm.h
@@ -1,12 +1,14 @@
#ifndef __IMP_CONFIRM_H
#define __IMP_CONFIRM_H
+#include "Soldier Profile.h"
+
void EnterIMPConfirm( void );
void RenderIMPConfirm( void );
void ExitIMPConfirm( void );
void HandleIMPConfirm( void );
-#define MAX_NEW_IMP_PORTRAITS 50
+#define MAX_NEW_IMP_PORTRAITS NUM_PROFILES
typedef struct
{
@@ -27,7 +29,7 @@ typedef struct
} IMP_FACE_VALUES;
-extern IMP_FACE_VALUES gIMPFaceValues[200];
+extern IMP_FACE_VALUES gIMPFaceValues[NUM_PROFILES];
typedef struct
@@ -73,8 +75,8 @@ typedef struct
BOOLEAN bBadAss;
} IMP_FEMALE_VALUES;
-extern IMP_FEMALE_VALUES gIMPFemaleValues[200];
-extern IMP_MALE_VALUES gIMPMaleValues[200];
+extern IMP_FEMALE_VALUES gIMPFemaleValues[NUM_PROFILES];
+extern IMP_MALE_VALUES gIMPMaleValues[NUM_PROFILES];
BOOLEAN AddCharacterToPlayersTeam( void );
BOOLEAN LoadImpCharacter( STR fileName );
diff --git a/Laptop/IMP Finish.cpp b/Laptop/IMP Finish.cpp
index db75e2bf..5679c1f3 100644
--- a/Laptop/IMP Finish.cpp
+++ b/Laptop/IMP Finish.cpp
@@ -325,8 +325,8 @@ void BtnIMPFinishDoneCallback(GUI_BUTTON *btn,INT32 reason)
{
if (btn->uiFlags & BUTTON_CLICKED_ON)
{
- btn->uiFlags&=~(BUTTON_CLICKED_ON);
- iCurrentImpPage = IMP_CONFIRM;
+ btn->uiFlags&=~(BUTTON_CLICKED_ON);
+ iCurrentImpPage = IMP_CONFIRM;
//CreateACharacterFromPlayerEnteredStats( );
fButtonPendingFlag = TRUE;
iCurrentProfileMode = IMP__REGISTRY;
@@ -668,14 +668,16 @@ BOOLEAN LoadCharacterPortrait( void )
{
if ( gIMPMaleValues[ iPortraitNumber ].Enabled == 1 )
{
- sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
+ //sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
}
}
else
{
if ( gIMPFemaleValues[ iPortraitNumber ].Enabled == 1 )
{
- sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
+ //sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
}
}
diff --git a/Laptop/IMP HomePage.cpp b/Laptop/IMP HomePage.cpp
index 2984f25b..0db4b321 100644
--- a/Laptop/IMP HomePage.cpp
+++ b/Laptop/IMP HomePage.cpp
@@ -266,26 +266,8 @@ void GetPlayerKeyBoardInputForIMPHomePage( void )
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
- // HOOK INTO MOUSE HOOKS
- /*
- switch(InputEvent.usEvent)
- {
- case LEFT_BUTTON_DOWN:
- MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
- break;
- case LEFT_BUTTON_UP:
- MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown);
- break;
- case RIGHT_BUTTON_DOWN:
- MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
- break;
- case RIGHT_BUTTON_UP:
- MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
- break;
- }
-*/
if( !HandleTextInput( &InputEvent ) && (InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT || InputEvent.usEvent == KEY_UP ) )
{
switch( InputEvent.usParam )
diff --git a/Laptop/IMP MainPage.cpp b/Laptop/IMP MainPage.cpp
index 5ea7a556..43ab67ad 100644
--- a/Laptop/IMP MainPage.cpp
+++ b/Laptop/IMP MainPage.cpp
@@ -1124,14 +1124,16 @@ BOOLEAN LoadCharacterPortraitForMainPage( void )
{
if ( gIMPMaleValues[ iPortraitNumber ].Enabled == 1 )
{
- sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
+ // sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPMaleValues[ iPortraitNumber ].PortraitId );
}
}
else
{
if ( gIMPFemaleValues[ iPortraitNumber ].Enabled == 1 )
{
- sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
+ //sprintf( VObjectDesc.ImageFile, "Faces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\%02d.sti", gIMPFemaleValues[ iPortraitNumber ].PortraitId );
}
}
//FilenameForBPP( pPlayerSelectedFaceFileNames[ iPortraitNumber ] , VObjectDesc.ImageFile);
diff --git a/Laptop/IMP Minor Trait.cpp b/Laptop/IMP Minor Trait.cpp
index b117c8e6..7cb882a2 100644
--- a/Laptop/IMP Minor Trait.cpp
+++ b/Laptop/IMP Minor Trait.cpp
@@ -1255,7 +1255,7 @@ void AssignMinorTraitHelpText( UINT8 ubNumber )
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[2], gSkillTraitValues.ubSTStealthBonus, L"%");
wcscat( apStr, atStr );
}
- if( gSkillTraitValues.ubSTReducedAPsRegistered != 0 && gGameExternalOptions.fImprovedInterruptSystem )
+ if( gSkillTraitValues.ubSTReducedAPsRegistered != 0 && gGameOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[4], gSkillTraitValues.ubSTReducedAPsRegistered, L"%");
wcscat( apStr, atStr );
diff --git a/Laptop/IMP Portraits.cpp b/Laptop/IMP Portraits.cpp
index 48a45fac..f8e3a3d2 100644
--- a/Laptop/IMP Portraits.cpp
+++ b/Laptop/IMP Portraits.cpp
@@ -131,7 +131,8 @@ BOOLEAN RenderPortrait( INT16 sX, INT16 sY )
if ( gIMPMaleValues[ iCurrentPortrait ].Enabled == 1 )
{
- sprintf( VObjectDesc.ImageFile, "Faces\\BigFaces\\%02d.sti", gIMPMaleValues[ iCurrentPortrait ].PortraitId );
+ ///sprintf( VObjectDesc.ImageFile, "Faces\\BigFaces\\%02d.sti", gIMPMaleValues[ iCurrentPortrait ].PortraitId );
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\BigFaces\\%02d.sti", gIMPMaleValues[ iCurrentPortrait ].PortraitId );
}
@@ -157,7 +158,8 @@ BOOLEAN RenderPortrait( INT16 sX, INT16 sY )
if ( gIMPFemaleValues[ iCurrentPortrait ].Enabled == 1 )
{
- sprintf( VObjectDesc.ImageFile, "Faces\\BigFaces\\%02d.sti", gIMPFemaleValues[ iCurrentPortrait ].PortraitId );
+ // sprintf( VObjectDesc.ImageFile, "Faces\\BigFaces\\%02d.sti", gIMPFemaleValues[ iCurrentPortrait ].PortraitId );
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\BigFaces\\%02d.sti", gIMPFemaleValues[ iCurrentPortrait ].PortraitId );
}
diff --git a/Laptop/IMP Skill Trait.cpp b/Laptop/IMP Skill Trait.cpp
index c6451a8a..e4573b7a 100644
--- a/Laptop/IMP Skill Trait.cpp
+++ b/Laptop/IMP Skill Trait.cpp
@@ -2148,7 +2148,7 @@ void AssignSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLevel )
wcscat( apStr, atStr );
}
}
- if( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving != 0 && gGameExternalOptions.fImprovedInterruptSystem )
+ if( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving != 0 && gGameOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsMartialArts[27], ( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving * (fExpertLevel ? 2 : 1)), L"%");
wcscat( apStr, atStr );
@@ -2185,7 +2185,7 @@ void AssignSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLevel )
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[2], ( gSkillTraitValues.ubSLEffectiveLevelAsStandby * (fExpertLevel ? 2 : 1)));
wcscat( apStr, atStr );
}
- if( gSkillTraitValues.ubSLCollectiveInterruptsBonus != 0 && gGameExternalOptions.fImprovedInterruptSystem )
+ if( gSkillTraitValues.ubSLCollectiveInterruptsBonus != 0 && gGameOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[11], ( gSkillTraitValues.ubSLCollectiveInterruptsBonus * (fExpertLevel ? 2 : 1)), L"%");
wcscat( apStr, atStr );
diff --git a/Laptop/LaptopSave.h b/Laptop/LaptopSave.h
index d46eb145..b20bc791 100644
--- a/Laptop/LaptopSave.h
+++ b/Laptop/LaptopSave.h
@@ -14,7 +14,7 @@ class SOLDIERTYPE;
-#define MAX_PURCHASE_AMOUNT 10
+//#define MAX_PURCHASE_AMOUNT 20
@@ -54,7 +54,7 @@ typedef struct
typedef struct
{
BOOLEAN fActive;
- BobbyRayPurchaseStruct BobbyRayPurchase[ MAX_PURCHASE_AMOUNT ];
+ BobbyRayPurchaseStruct BobbyRayPurchase[ 100 ];
UINT8 ubNumberPurchases;
} BobbyRayOrderStruct;
@@ -170,7 +170,7 @@ typedef struct
extern LaptopSaveInfoStruct LaptopSaveInfo;
-extern BobbyRayPurchaseStruct BobbyRayPurchases[ MAX_PURCHASE_AMOUNT ];
+extern BobbyRayPurchaseStruct BobbyRayPurchases[ 100 ];
diff --git a/Laptop/Laptop_VS2005.vcproj b/Laptop/Laptop_VS2005.vcproj
index 16487660..43fff7a1 100644
--- a/Laptop/Laptop_VS2005.vcproj
+++ b/Laptop/Laptop_VS2005.vcproj
@@ -932,6 +932,10 @@
RelativePath=".\XML_IMPPortraits.cpp"
>
+
+
diff --git a/Laptop/Laptop_VS2008.vcproj b/Laptop/Laptop_VS2008.vcproj
index 135fcb15..2e0a90d3 100644
--- a/Laptop/Laptop_VS2008.vcproj
+++ b/Laptop/Laptop_VS2008.vcproj
@@ -935,6 +935,10 @@
RelativePath=".\XML_IMPPortraits.cpp"
>
+
+
diff --git a/Laptop/Laptop_VS2010.vcxproj b/Laptop/Laptop_VS2010.vcxproj
index 0f45283d..4a3d428b 100644
--- a/Laptop/Laptop_VS2010.vcxproj
+++ b/Laptop/Laptop_VS2010.vcxproj
@@ -173,6 +173,7 @@
+
@@ -239,24 +240,24 @@
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
diff --git a/Laptop/Laptop_VS2010.vcxproj.filters b/Laptop/Laptop_VS2010.vcxproj.filters
index 68e66e5b..cd8ce1ec 100644
--- a/Laptop/Laptop_VS2010.vcxproj.filters
+++ b/Laptop/Laptop_VS2010.vcxproj.filters
@@ -458,5 +458,8 @@
Source Files
+
+ Source Files
+
\ No newline at end of file
diff --git a/Laptop/PostalService.cpp b/Laptop/PostalService.cpp
index 444e227c..35ed33c2 100644
--- a/Laptop/PostalService.cpp
+++ b/Laptop/PostalService.cpp
@@ -55,6 +55,8 @@ extern StrategicMapElement StrategicMap[];
extern INT16 gusCurShipmentDestinationID;
+
+
/////////////////////////////////////////////////////
// CShipmentManipulator member implementation
/////////////////////////////////////////////////////
@@ -208,6 +210,7 @@ BOOLEAN CPostalService::AddPackageToShipment(UINT16 usShipmentID, UINT16 usItemI
BOOLEAN CPostalService::SendShipment(UINT16 usShipmentID)
{
+ static BOOLEAN BR_FAST_SHIP = gGameExternalOptions.fBobbyRayFastShipments;
if( usShipmentID > _UsedShipmentIDList.size() ||
!_UsedShipmentIDList[usShipmentID])
{
@@ -238,9 +241,18 @@ BOOLEAN CPostalService::SendShipment(UINT16 usShipmentID)
}
else
{
- AddFutureDayStrategicEvent( EVENT_POSTAL_SERVICE_SHIPMENT, (8 + Random(4) ) * 60, usShipmentID,
- SHIPMENT(sli).pDestinationDeliveryInfo->bDaysAhead);
+ //JMich
+ //Jenilee: now faster shipments
+ if (!BR_FAST_SHIP)
+ {
+ AddFutureDayStrategicEvent( EVENT_POSTAL_SERVICE_SHIPMENT, (8 + Random(4) ) * 60, usShipmentID, SHIPMENT(sli).pDestinationDeliveryInfo->bDaysAhead);
+ }
+ else
+ {
+ AddStrategicEvent(EVENT_POSTAL_SERVICE_SHIPMENT, GetWorldTotalMin() + ((SHIPMENT(sli).pDestinationDeliveryInfo->bDaysAhead * (5 + Random(3))) * 60), usShipmentID);
+ }
}
+
return TRUE;
}
diff --git a/Laptop/XML_EncyclopediaLocation.cpp b/Laptop/XML_EncyclopediaLocation.cpp
index 7adc16b7..7b49e1f2 100644
--- a/Laptop/XML_EncyclopediaLocation.cpp
+++ b/Laptop/XML_EncyclopediaLocation.cpp
@@ -172,7 +172,7 @@ BOOLEAN LoadGraphicForItem( ENCYCLOPEDIA_LOCATION *pEncy, UINT32 i )
sprintf( zName, "p2item%d", ubGraphic );
}
}
- else
+ else if ( Item[i].ubGraphicType == 3 )
{
if ( ubGraphic < 10 )
{
@@ -183,6 +183,73 @@ BOOLEAN LoadGraphicForItem( ENCYCLOPEDIA_LOCATION *pEncy, UINT32 i )
sprintf( zName, "p3item%d", ubGraphic );
}
}
+//MM: New item tileslots start here
+ else if ( Item[i].ubGraphicType == 4 )
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p4item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p4item%d", ubGraphic );
+ }
+ }
+ else if ( Item[i].ubGraphicType == 5 )
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p5item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p5item%d", ubGraphic );
+ }
+ }
+ else if ( Item[i].ubGraphicType == 6 )
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p6item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p6item%d", ubGraphic );
+ }
+ }
+ else if ( Item[i].ubGraphicType == 7 )
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p7item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p7item%d", ubGraphic );
+ }
+ }
+ else if ( Item[i].ubGraphicType == 8 )
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p8item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p8item%d", ubGraphic );
+ }
+ }
+ else
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p9item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p9item%d", ubGraphic );
+ }
+ }
//Load item
sprintf( zString, "BIGITEMS\\%s%s", zName, ext );
diff --git a/Laptop/XML_IMPPortraits.cpp b/Laptop/XML_IMPPortraits.cpp
index 6aff0331..a6b43fb1 100644
--- a/Laptop/XML_IMPPortraits.cpp
+++ b/Laptop/XML_IMPPortraits.cpp
@@ -8,6 +8,7 @@
#include "Interface.h"
#include "IMP Confirm.h"
#include "IMP Portraits.h"
+ #include "Soldier Profile.h"
#endif
struct
@@ -268,7 +269,7 @@ UINT32 cnt;
UINT32 cnt2 = 0;
UINT32 cnt3 = 0;
- for ( cnt = 0; cnt < 200; cnt++ )
+ for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
{
if (gIMPFaceValues[cnt].bSex == 1 && gIMPFaceValues[cnt].PortraitId !=0)
{
@@ -291,7 +292,7 @@ UINT32 cnt3 = 0;
}
}
- for ( cnt = 0; cnt < 200; cnt++ )
+ for ( cnt = 0; cnt < NUM_PROFILES; cnt++ )
{
if (gIMPFaceValues[cnt].bSex == 0 && gIMPFaceValues[cnt].PortraitId !=0)
{
diff --git a/Laptop/XML_OldAIMArchive.cpp b/Laptop/XML_OldAIMArchive.cpp
new file mode 100644
index 00000000..925d7133
--- /dev/null
+++ b/Laptop/XML_OldAIMArchive.cpp
@@ -0,0 +1,216 @@
+#ifdef PRECOMPILEDHEADERS
+ #include "Tactical All.h"
+#else
+ #include "sgp.h"
+ #include "Debug Control.h"
+ #include "expat.h"
+ #include "XML.h"
+ #include "Interface.h"
+ #include "AimArchives.h"
+#endif
+
+struct
+{
+ PARSE_STAGE curElement;
+
+ CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
+ OLD_MERC_ARCHIVES_VALUES curAimOldArchives;
+ OLD_MERC_ARCHIVES_VALUES * curArray;
+
+ UINT32 maxArraySize;
+ UINT32 curIndex;
+ UINT32 currentDepth;
+ UINT32 maxReadDepth;
+}
+typedef aimOldArchivesParseData;
+
+BOOLEAN AimOldArchives_TextOnly;
+
+static void XMLCALL
+aimOldArchivesStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
+{
+ aimOldArchivesParseData * pData = (aimOldArchivesParseData *)userData;
+
+ if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
+ {
+ if(strcmp(name, "OLD_MERC") == 0 && pData->curElement == ELEMENT_NONE)
+ {
+ pData->curElement = ELEMENT_LIST;
+
+ pData->maxReadDepth++; //we are not skipping this element
+ }
+ else if(strcmp(name, "MERC") == 0 && pData->curElement == ELEMENT_LIST)
+ {
+ pData->curElement = ELEMENT;
+
+ pData->maxReadDepth++; //we are not skipping this element
+ }
+ else if(pData->curElement == ELEMENT &&
+ (strcmp(name, "uiIndex") == 0 ||
+ strcmp(name, "NickName") == 0 ||
+ strcmp(name, "Name") == 0 ||
+ strcmp(name, "Bio") == 0 ||
+ strcmp(name, "FaceID") == 0 ))
+ {
+ pData->curElement = ELEMENT_PROPERTY;
+
+ pData->maxReadDepth++; //we are not skipping this element
+ }
+
+ pData->szCharData[0] = '\0';
+ }
+
+ pData->currentDepth++;
+
+}
+
+static void XMLCALL
+aimOldArchivesCharacterDataHandle(void *userData, const XML_Char *str, int len)
+{
+ aimOldArchivesParseData * pData = (aimOldArchivesParseData *)userData;
+
+ if( (pData->currentDepth <= pData->maxReadDepth) &&
+ (strlen(pData->szCharData) < MAX_CHAR_DATA_LENGTH)
+ ){
+ strncat(pData->szCharData,str,__min((unsigned int)len,MAX_CHAR_DATA_LENGTH-strlen(pData->szCharData)));
+ }
+}
+
+
+static void XMLCALL
+aimOldArchivesEndElementHandle(void *userData, const XML_Char *name)
+{
+ aimOldArchivesParseData * pData = (aimOldArchivesParseData *)userData;
+
+ if(pData->currentDepth <= pData->maxReadDepth)
+ {
+ if(strcmp(name, "OLD_MERC") == 0)
+ {
+ pData->curElement = ELEMENT_NONE;
+ }
+ else if(strcmp(name, "MERC") == 0)
+ {
+ pData->curElement = ELEMENT_LIST;
+
+ if (!AimOldArchives_TextOnly)
+ {
+ gAimOldArchives[pData->curAimOldArchives.uiIndex].uiIndex = pData->curAimOldArchives.uiIndex;
+ gAimOldArchives[pData->curAimOldArchives.uiIndex].FaceID = pData->curAimOldArchives.FaceID;
+ wcscpy(gAimOldArchives[pData->curAimOldArchives.uiIndex].szBio, pData->curAimOldArchives.szBio);
+ wcscpy(gAimOldArchives[pData->curAimOldArchives.uiIndex].szName, pData->curAimOldArchives.szName);
+ wcscpy(gAimOldArchives[pData->curAimOldArchives.uiIndex].szNickName, pData->curAimOldArchives.szNickName);
+ }
+ else
+ {
+ // gAimOldArchives[pData->curAimOldArchives.uiIndex].uiIndex = pData->curAimOldArchives.uiIndex;
+ // gAimOldArchives[pData->curAimOldArchives.uiIndex].FaceID = pData->curAimOldArchives.FaceID;
+
+ wcscpy(gAimOldArchives[pData->curAimOldArchives.uiIndex].szBio, pData->curAimOldArchives.szBio);
+ wcscpy(gAimOldArchives[pData->curAimOldArchives.uiIndex].szName, pData->curAimOldArchives.szName);
+ wcscpy(gAimOldArchives[pData->curAimOldArchives.uiIndex].szNickName, pData->curAimOldArchives.szNickName);
+ }
+ }
+ else if(strcmp(name, "uiIndex") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curAimOldArchives.uiIndex = (UINT8) atol(pData->szCharData);
+ }
+ else if(strcmp(name, "NickName") == 0)
+ {
+
+ pData->curElement = ELEMENT;
+
+ MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curAimOldArchives.szNickName, sizeof(pData->curAimOldArchives.szNickName)/sizeof(pData->curAimOldArchives.szNickName[0]) );
+ pData->curAimOldArchives.szNickName[sizeof(pData->curAimOldArchives.szNickName)/sizeof(pData->curAimOldArchives.szNickName[0]) - 1] = '\0';
+
+ }
+ else if(strcmp(name, "Name") == 0)
+ {
+
+ pData->curElement = ELEMENT;
+
+ MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curAimOldArchives.szName, sizeof(pData->curAimOldArchives.szName)/sizeof(pData->curAimOldArchives.szName[0]) );
+ pData->curAimOldArchives.szName[sizeof(pData->curAimOldArchives.szName)/sizeof(pData->curAimOldArchives.szName[0]) - 1] = '\0';
+
+ }
+ else if(strcmp(name, "Bio") == 0)
+ {
+
+ pData->curElement = ELEMENT;
+
+ MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curAimOldArchives.szBio, sizeof(pData->curAimOldArchives.szBio)/sizeof(pData->curAimOldArchives.szBio[0]) );
+ pData->curAimOldArchives.szBio[sizeof(pData->curAimOldArchives.szBio)/sizeof(pData->curAimOldArchives.szBio[0]) - 1] = '\0';
+
+ }
+ else if(strcmp(name, "FaceID") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curAimOldArchives.FaceID = (INT16) atol(pData->szCharData);
+ }
+
+ pData->maxReadDepth--;
+ }
+ pData->currentDepth--;
+}
+
+BOOLEAN ReadInAimOldArchive(STR fileName, BOOLEAN localizedVersion)
+{
+ HWFILE hFile;
+ UINT32 uiBytesRead;
+ UINT32 uiFSize;
+ CHAR8 * lpcBuffer;
+ XML_Parser parser = XML_ParserCreate(NULL);
+
+ aimOldArchivesParseData pData;
+
+ DebugMsg(TOPIC_JA2, DBG_LEVEL_3, "Loading OldAIMArchive.xml" );
+
+ AimOldArchives_TextOnly = localizedVersion;
+
+ // Open file
+ hFile = FileOpen( fileName, FILE_ACCESS_READ, FALSE );
+ if ( !hFile )
+ return( localizedVersion );
+
+ uiFSize = FileGetSize(hFile);
+ lpcBuffer = (CHAR8 *) MemAlloc(uiFSize+1);
+
+ //Read in block
+ if ( !FileRead( hFile, lpcBuffer, uiFSize, &uiBytesRead ) )
+ {
+ MemFree(lpcBuffer);
+ return( FALSE );
+ }
+
+ lpcBuffer[uiFSize] = 0; //add a null terminator
+
+ FileClose( hFile );
+
+
+ XML_SetElementHandler(parser, aimOldArchivesStartElementHandle, aimOldArchivesEndElementHandle);
+ XML_SetCharacterDataHandler(parser, aimOldArchivesCharacterDataHandle);
+
+
+ memset(&pData,0,sizeof(pData));
+ XML_SetUserData(parser, &pData);
+
+
+ if(!XML_Parse(parser, lpcBuffer, uiFSize, TRUE))
+ {
+ CHAR8 errorBuf[511];
+
+ sprintf(errorBuf, "XML Parser Error in OldAIMArchive.xml: %s at line %d", XML_ErrorString(XML_GetErrorCode(parser)), XML_GetCurrentLineNumber(parser));
+ LiveMessage(errorBuf);
+
+ MemFree(lpcBuffer);
+ return FALSE;
+ }
+
+ MemFree(lpcBuffer);
+
+
+ XML_ParserFree(parser);
+
+
+ return( TRUE );
+}
diff --git a/Laptop/email.cpp b/Laptop/email.cpp
index 78d2e5f1..989aa5b8 100644
--- a/Laptop/email.cpp
+++ b/Laptop/email.cpp
@@ -5596,13 +5596,16 @@ void PreProcessEmail( EmailPtr pMail )
// WANNE: Get the text and replace name!
int iNew113MERCMerc = 0;
int iNew113AIMMerc = 0;
+
int iEmailMERCMessage = 0;
int iEmailAIMMessage = 0;
int iEmailOther = 0;
int iEmailBobbyRMessage = 0;
int iEmailInsurance = 0;
int iNew113CustomUserMerc = 0;
- if ( pMail->EmailVersion == TYPE_EMAIL_EMAIL_EDT )
+
+
+ if ( pMail->EmailVersion == TYPE_EMAIL_EMAIL_EDT )
{
if (pMail->usLength == MERC_UP_LEVEL_GASTON || pMail->usLength == MERC_UP_LEVEL_STOGIE ||
pMail->usLength == MERC_UP_LEVEL_TEX || pMail->usLength == MERC_UP_LEVEL_BIGGENS)
diff --git a/Laptop/florist Order Form.cpp b/Laptop/florist Order Form.cpp
index cedfa599..3afb3fab 100644
--- a/Laptop/florist Order Form.cpp
+++ b/Laptop/florist Order Form.cpp
@@ -1257,7 +1257,7 @@ void HandleFloristOrderKeyBoardInput()
{
InputAtom InputEvent;
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if( !HandleTextInput( &InputEvent ) && InputEvent.usEvent == KEY_DOWN )
{
diff --git a/Laptop/laptop.cpp b/Laptop/laptop.cpp
index 9919db3e..bee8e43c 100644
--- a/Laptop/laptop.cpp
+++ b/Laptop/laptop.cpp
@@ -502,6 +502,9 @@ BOOLEAN gfWWWaitSubSitesVisitedFlags[LAPTOP_MODE_SIRTECH - LAPTOP_MODE_WWW ];
//INT32 iBookMarkList[MAX_BOOKMARKS];
+// flag to see if mouse is captured in the laptop's area or not
+BOOLEAN fMouseCaptured;
+
// mouse regions
MOUSE_REGION gEmailRegion;
MOUSE_REGION gWWWRegion;
@@ -821,6 +824,8 @@ UINT32 LaptopScreenInit()
gfAtLeastOneMercWasHired = FALSE;
+ fMouseCaptured = TRUE;
+
//No longer inits the laptop screens, now InitLaptopAndLaptopScreens() does
#ifdef JA2UB
InitJa25SaveStruct();
@@ -1117,6 +1122,7 @@ void ExitLaptop()
//}
// release cursor
+ fMouseCaptured = false;
FreeMouseCursor( );
// set the fact we are currently not in laptop, for rendering purposes
@@ -2059,16 +2065,16 @@ UINT32 LaptopScreenHandle()
//created in LaptopScreenInit()
// Correct the minor cosmetic bug (laptop zooming start not correct)
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
sXOffset = -2;
sYOffset = -2;
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
sYOffset = -1;
}
- else if (iResolution == 2)
+ else
{
sXOffset = 2;
sYOffset = 1;
@@ -2122,17 +2128,16 @@ UINT32 LaptopScreenHandle()
DstRect.iTop = iScreenHeightOffset; //0
DstRect.iRight = iScreenWidthOffset + 640; //640
DstRect.iBottom = iScreenHeightOffset + 480; //480
- iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19 + sXOffset;
+
+ iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19 + sXOffset - xResOffset;
iLaptopMonitorCenterY = SCREEN_HEIGHT - 70 + 16 + sYOffset;
+
uiTimeRange = 1000;
iPercentage = iRealPercentage = 0;
uiStartTime = GetJA2Clock();
BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, iScreenWidthOffset, iScreenHeightOffset,
640, 480 );
- // Lesh: moved into loop
- //BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset,
- // SCREEN_WIDTH - iScreenWidthOffset, SCREEN_HEIGHT - iScreenHeightOffset );
PlayJA2SampleFromFile( "SOUNDS\\Laptop power up (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
@@ -2195,7 +2200,10 @@ UINT32 LaptopScreenHandle()
RestoreBackgroundRects();
// lock cursor to screen
- RestrictMouseCursor( &LaptopScreenRect );
+ if ( fMouseCaptured == TRUE )
+ {
+ RestrictMouseCursor( &LaptopScreenRect );
+ }
@@ -2399,7 +2407,6 @@ UINT32 LaptopScreenHandle()
-
UINT32 RenderLaptopPanel()
{
@@ -2763,16 +2770,16 @@ BOOLEAN LeaveLapTopScreen( void )
INT16 sXOffset = 0;
// Correct the minor cosmetic bug (laptop zooming start not correct)
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
sXOffset = -2;
sYOffset = -2;
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
sYOffset = -1;
}
- else if (iResolution == 2)
+ else
{
sXOffset = 2;
sYOffset = 1;
@@ -2837,8 +2844,10 @@ BOOLEAN LeaveLapTopScreen( void )
DstRect.iTop = iScreenHeightOffset + 0; // 0
DstRect.iRight = iScreenWidthOffset + 640; // 640
DstRect.iBottom = iScreenHeightOffset + 480; // 480
- iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19 + sXOffset;
+
+ iLaptopMonitorCenterX = SCREEN_WIDTH - 184 + 19 + sXOffset - xResOffset;
iLaptopMonitorCenterY = SCREEN_HEIGHT - 70 + 16 + sYOffset;
+
uiTimeRange = 1000;
iPercentage = iRealPercentage = 100;
uiStartTime = GetJA2Clock();
@@ -2901,7 +2910,6 @@ BOOLEAN LeaveLapTopScreen( void )
return( TRUE );
}
-
BOOLEAN HandleExit( void )
{
// static BOOLEAN fSentImpWarningAlready = FALSE;
@@ -6025,7 +6033,23 @@ void HandleKeyBoardShortCutsForLapTop( UINT16 usEvent, UINT32 usParam, UINT16 us
MarkButtonsDirty( );
}
}
+ else if( ( ( usEvent == KEY_DOWN ) || ( usEvent == KEY_REPEAT ) ) && ( ( usParam == 'z' ) || ( usParam == 'Z' ) || ( usParam == 'y' ) || ( usParam == 'Y' ) ) )
+ {
+ if ( usKeyState & CTRL_DOWN )
+ {
+ if ( fMouseCaptured == TRUE )
+ {
+ fMouseCaptured = FALSE;
+ FreeMouseCursor( );
+ }
+ else
+ {
+ fMouseCaptured = TRUE;
+ RestrictMouseCursor( &LaptopScreenRect );
+ }
+ }
+ }
#ifdef JA2TESTVERSION
else if ((usEvent == KEY_DOWN )&& ( usParam == 'd' ))
diff --git a/Laptop/mercs Files.cpp b/Laptop/mercs Files.cpp
index abe3ae68..83bc74ac 100644
Binary files a/Laptop/mercs Files.cpp and b/Laptop/mercs Files.cpp differ
diff --git a/Laptop/personnel.cpp b/Laptop/personnel.cpp
index 52c951fe..bab4bb43 100644
--- a/Laptop/personnel.cpp
+++ b/Laptop/personnel.cpp
@@ -81,6 +81,9 @@
#define FACES_DIR "FACES\\BIGFACES\\"
#define SMALL_FACES_DIR "FACES\\"
+#define IMP_FACES_DIR "IMPFACES\\BIGFACES\\"
+#define IMP_SMALL_FACES_DIR "IMPFACES\\"
+
#define NEXT_MERC_FACE_X LAPTOP_SCREEN_UL_X + 448
#define MERC_FACE_SCROLL_Y LAPTOP_SCREEN_UL_Y + 150
#define PREV_MERC_FACE_X LAPTOP_SCREEN_UL_X + 285
@@ -834,14 +837,23 @@ void RenderPersonnelFace(INT32 iId, INT32 iSlot, BOOLEAN fDead, BOOLEAN fFired,
// special case?..player generated merc
if (fCurrentTeamMode)
{
- if( ( 50 < profileId )&&( 57 > profileId ) )
+ //if( ( 50 < profileId )&&( 57 > profileId ) )
+ if ( ( profileId >= 0 ) && ( profileId < 100 ) && ( gProfilesIMP[ profileId ].ProfilId == profileId ) )
{
- sprintf( sTemp, "%s%03d.sti", FACES_DIR, gMercProfiles[profileId].ubFaceIndex );
+ sprintf( sTemp, "%s%02d.sti", IMP_FACES_DIR, gMercProfiles[profileId].ubFaceIndex );
}
- else
+ else if ( ( profileId > 99 ) && ( gProfilesIMP[ profileId ].ProfilId == profileId ) )
+ {
+ sprintf(sTemp, "%s%03d.sti", IMP_FACES_DIR, gMercProfiles[profileId].ubFaceIndex);
+ }
+ else if ( ( profileId >= 0 ) && ( profileId < 100 ) )
{
sprintf(sTemp, "%s%02d.sti", FACES_DIR, gMercProfiles[profileId].ubFaceIndex);
}
+ else
+ {
+ sprintf(sTemp, "%s%03d.sti", FACES_DIR, gMercProfiles[profileId].ubFaceIndex);
+ }
// TODO: Check if needed!
if( MercPtrs[iSlot]->flags.uiStatusFlags & SOLDIER_VEHICLE )
@@ -857,7 +869,7 @@ void RenderPersonnelFace(INT32 iId, INT32 iSlot, BOOLEAN fDead, BOOLEAN fFired,
{
return;
}
-
+/*
if( ( 50 < profileId )&&( 57 > profileId ) )
{
sprintf( sTemp, "%s%03d.sti", FACES_DIR, gMercProfiles[profileId].ubFaceIndex );
@@ -866,6 +878,24 @@ void RenderPersonnelFace(INT32 iId, INT32 iSlot, BOOLEAN fDead, BOOLEAN fFired,
{
sprintf(sTemp, "%s%02d.sti", FACES_DIR, gMercProfiles[profileId].ubFaceIndex );
}
+*/
+ if ( ( profileId >= 0 ) && ( profileId < 100 ) && ( gProfilesIMP[ profileId ].ProfilId == profileId ) )
+ {
+ sprintf( sTemp, "%s%02d.sti", IMP_FACES_DIR, gMercProfiles[profileId].ubFaceIndex );
+ }
+ else if ( ( profileId > 99 ) && ( gProfilesIMP[ profileId ].ProfilId == profileId ) )
+ {
+ sprintf(sTemp, "%s%03d.sti", IMP_FACES_DIR, gMercProfiles[profileId].ubFaceIndex);
+ }
+ else if ( ( profileId >= 0 ) && ( profileId < 100 ) )
+ {
+ sprintf(sTemp, "%s%02d.sti", FACES_DIR, gMercProfiles[profileId].ubFaceIndex);
+ }
+ else
+ {
+ sprintf(sTemp, "%s%03d.sti", FACES_DIR, gMercProfiles[profileId].ubFaceIndex);
+ }
+
}
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
@@ -1778,7 +1808,7 @@ void DisplayCharStats(INT32 iId, INT32 iSlot)
for ( UINT8 ubCnt = 0; ubCnt < bNumSkillTraits; ubCnt++ )
{
- if ( ubCnt >= 4 && bNumSkillTraits > 4 )
+ if ( ubCnt >= 4 && bNumSkillTraits > 5 )
{
fDisplayMoreTraits = TRUE;
swprintf( sString, L"%s\n", gzMercSkillTextNew[ ubTempSkillArray[ubCnt] ] );
@@ -2175,6 +2205,25 @@ void DisplayPicturesOfCurrentTeam( void )
} // if
SOLDIERTYPE *pSoldier = MercPtrs[currentTeamList[currentOnSreenIndex]];
+
+ if ( ( pSoldier->ubProfile >= 0 ) && ( pSoldier->ubProfile < 100 ) && ( gProfilesIMP[ pSoldier->ubProfile ].ProfilId == pSoldier->ubProfile ) )
+ {
+ sprintf( sTemp, "%s%02d.sti", IMP_SMALL_FACES_DIR, gMercProfiles[pSoldier->ubProfile].ubFaceIndex );
+ }
+ else if ( ( pSoldier->ubProfile > 99 ) && ( gProfilesIMP[ pSoldier->ubProfile ].ProfilId == pSoldier->ubProfile ) )
+ {
+ sprintf(sTemp, "%s%03d.sti", IMP_SMALL_FACES_DIR, gMercProfiles[pSoldier->ubProfile].ubFaceIndex);
+ }
+ else if ( ( pSoldier->ubProfile >= 0 ) && ( pSoldier->ubProfile < 100 ))
+ {
+ sprintf(sTemp, "%s%02d.sti", SMALL_FACES_DIR, gMercProfiles[pSoldier->ubProfile].ubFaceIndex);
+ }
+ else
+ {
+ sprintf(sTemp, "%s%03d.sti", SMALL_FACES_DIR, gMercProfiles[pSoldier->ubProfile].ubFaceIndex);
+ }
+
+ /*
if ((50 < pSoldier->ubProfile) && (57 > pSoldier->ubProfile))
{
sprintf( sTemp, "%s%03d.sti", SMALL_FACES_DIR, gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
@@ -2190,7 +2239,7 @@ void DisplayPicturesOfCurrentTeam( void )
sprintf(sTemp, "%s%03d.sti", SMALL_FACES_DIR, gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex);
} // else
} // else
-
+ */
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP(sTemp, VObjectDesc.ImageFile);
CHECKV(AddVideoObject(&VObjectDesc, &guiFACE));
@@ -4730,7 +4779,26 @@ void DisplayPortraitOfPastMerc( INT32 iId , INT32 iCounter, BOOLEAN fDead, BOOLE
char sTemp[100];
HVOBJECT hFaceHandle;
VOBJECT_DESC VObjectDesc;
-
+
+
+ if ( ( iId >= 0 ) && ( iId < 100 ) && ( gProfilesIMP[ iId ].ProfilId == iId ) )
+ {
+ sprintf( sTemp, "%s%02d.sti", IMP_FACES_DIR, gMercProfiles[iId].ubFaceIndex );
+ }
+ else if ( ( iId > 99 ) && ( gProfilesIMP[ iId ].ProfilId == iId ) )
+ {
+ sprintf(sTemp, "%s%03d.sti", IMP_FACES_DIR, gMercProfiles[iId].ubFaceIndex);
+ }
+ else if ( ( iId >= 0 ) && ( iId < 100 ))
+ {
+ sprintf(sTemp, "%s%02d.sti", FACES_DIR, gMercProfiles[iId].ubFaceIndex);
+ }
+ else
+ {
+ sprintf(sTemp, "%s%03d.sti", FACES_DIR, gMercProfiles[iId].ubFaceIndex);
+ }
+
+/*
if( ( 50 < iId )&&( 57 > iId ) )
{
sprintf( sTemp, "%s%03d.sti", SMALL_FACES_DIR, gMercProfiles[ iId ].ubFaceIndex );
@@ -4746,7 +4814,7 @@ void DisplayPortraitOfPastMerc( INT32 iId , INT32 iCounter, BOOLEAN fDead, BOOLE
sprintf(sTemp, "%s%03d.sti", SMALL_FACES_DIR, gMercProfiles[ iId ].ubFaceIndex );
}
}
-
+*/
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP(sTemp, VObjectDesc.ImageFile);
CHECKV(AddVideoObject(&VObjectDesc, &guiFACE));
@@ -6351,7 +6419,7 @@ void HandlePersonnelKeyboard( void )
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if ( (InputEvent.usEvent == KEY_DOWN ) && (InputEvent.usParam >= '0' ) && ( InputEvent.usParam <= '9') )
{
@@ -7323,7 +7391,7 @@ void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLeve
wcscat( apStr, atStr );
}
}
- if( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving != 0 && gGameExternalOptions.fImprovedInterruptSystem )
+ if( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving != 0 && gGameOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsMartialArts[27], ( gSkillTraitValues.ubMAReducedAPsRegisteredWhenMoving * (fExpertLevel ? 2 : 1)), L"%");
wcscat( apStr, atStr );
@@ -7361,7 +7429,7 @@ void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLeve
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[2], ( gSkillTraitValues.ubSLEffectiveLevelAsStandby * (fExpertLevel ? 2 : 1)));
wcscat( apStr, atStr );
}
- if( gSkillTraitValues.ubSLCollectiveInterruptsBonus != 0 && gGameExternalOptions.fImprovedInterruptSystem )
+ if( gSkillTraitValues.ubSLCollectiveInterruptsBonus != 0 && gGameOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMajorTraitsHelpTextsSquadleader[11], ( gSkillTraitValues.ubSLCollectiveInterruptsBonus * (fExpertLevel ? 2 : 1)), L"%");
wcscat( apStr, atStr );
@@ -7722,7 +7790,7 @@ void AssignPersonnelSkillTraitHelpText( UINT8 ubTraitNumber, BOOLEAN fExpertLeve
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[2], gSkillTraitValues.ubSTStealthBonus, L"%");
wcscat( apStr, atStr );
}
- if( gSkillTraitValues.ubSTReducedAPsRegistered != 0 && gGameExternalOptions.fImprovedInterruptSystem )
+ if( gSkillTraitValues.ubSTReducedAPsRegistered != 0 && gGameOptions.fImprovedInterruptSystem )
{
swprintf( atStr, gzIMPMinorTraitsHelpTextsStealthy[4], gSkillTraitValues.ubSTReducedAPsRegistered, L"%");
wcscat( apStr, atStr );
diff --git a/Loading Screen.cpp b/Loading Screen.cpp
index 251b4b69..4a0e181f 100644
--- a/Loading Screen.cpp
+++ b/Loading Screen.cpp
@@ -343,17 +343,18 @@ static void BuildLoadscreenFilename(std::string& dst, const char* path, int reso
if (path)
dst.append(path);
- switch (resolution)
- {
- case 1:
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
+ // Nothing to do here
+ }
+ else if (iResolution < _1024x768)
+ {
dst.append("_800x600");
- break;
- case 2:
+ }
+ else
+ {
dst.append("_1024x768");
- break;
- default:
- break;
- }
+ }
if (ext)
{
@@ -454,7 +455,20 @@ void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
// Actual image, depending on the resolution
std::string strBigImage;
- BuildLoadscreenFilename(strBigImage, imagePath.c_str(), iResolution, imageFormat.c_str());
+
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
+ BuildLoadscreenFilename(strBigImage, imagePath.c_str(), 0, imageFormat.c_str());
+ }
+ else if (iResolution < _1024x768)
+ {
+ BuildLoadscreenFilename(strBigImage, imagePath.c_str(), 1, imageFormat.c_str());
+ }
+ else
+ {
+ BuildLoadscreenFilename(strBigImage, imagePath.c_str(), 2, imageFormat.c_str());
+ }
+
strBigImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile)-1);
@@ -467,7 +481,20 @@ void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
strSmallImage.copy(smallImage, sizeof(smallImage)-1);
// Actual image, depending on the resolution
- BuildLoadscreenFilename(strBigImage, LoadScreenNames[1], iResolution, imageFormat.c_str());
+
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
+ BuildLoadscreenFilename(strBigImage, LoadScreenNames[1], 0, imageFormat.c_str());
+ }
+ else if (iResolution < _1024x768)
+ {
+ BuildLoadscreenFilename(strBigImage, LoadScreenNames[1], 1, imageFormat.c_str());
+ }
+ else
+ {
+ BuildLoadscreenFilename(strBigImage, LoadScreenNames[1], 2, imageFormat.c_str());
+ }
+
strBigImage.copy(vs_desc.ImageFile, sizeof(vs_desc.ImageFile)-1);
}
@@ -480,13 +507,38 @@ void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
if (LOADINGSCREEN_NOTHING <= ubLoadScreenID && ubLoadScreenID <= LOADINGSCREEN_NIGHTBALIME)
{
BuildLoadscreenFilename(strSmallImage, LoadScreenNames[ubLoadScreenID], 0, "sti");
- BuildLoadscreenFilename(strBigImage, LoadScreenNames[ubLoadScreenID], iResolution, "sti");
+
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
+ BuildLoadscreenFilename(strBigImage, LoadScreenNames[ubLoadScreenID], 0, "sti");
+ }
+ else if (iResolution < _1024x768)
+ {
+ BuildLoadscreenFilename(strBigImage, LoadScreenNames[ubLoadScreenID], 1, "sti");
+ }
+ else
+ {
+ BuildLoadscreenFilename(strBigImage, LoadScreenNames[ubLoadScreenID], 2, "sti");
+ }
+
}
else
{
// for some reason the heli screen is the default
BuildLoadscreenFilename(strSmallImage, LoadScreenNames[0], 0, "sti");
- BuildLoadscreenFilename(strBigImage, LoadScreenNames[0], iResolution, "sti");
+
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
+ BuildLoadscreenFilename(strBigImage, LoadScreenNames[0], 0, "sti");
+ }
+ else if (iResolution < _1024x768)
+ {
+ BuildLoadscreenFilename(strBigImage, LoadScreenNames[0], 1, "sti");
+ }
+ else
+ {
+ BuildLoadscreenFilename(strBigImage, LoadScreenNames[0], 2, "sti");
+ }
}
strSmallImage.copy(smallImage, sizeof(smallImage)-1);
@@ -525,11 +577,13 @@ void DisplayLoadScreenWithID( UINT8 ubLoadScreenID )
GetVideoSurface(&hVSurface, uiLoadScreen);
// Special case->show the small image centered
- if (iResolution > 0 && bShowSmallImage)
+ if (iResolution > _640x480 && bShowSmallImage)
BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, iScreenWidthOffset, iScreenHeightOffset, 0, NULL );
else
- BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, 0, 0, 0, NULL );
-
+ {
+ BltVideoSurfaceToVideoSurface( ghFrameBuffer, hVSurface, 0, (SCREEN_WIDTH - xResSize) / 2,(SCREEN_HEIGHT - yResSize) / 2, 0, NULL );
+ }
+
DeleteVideoSurfaceFromIndex( uiLoadScreen );
}
else
diff --git a/MPChatScreen.cpp b/MPChatScreen.cpp
index 6f53481d..1eac5143 100644
--- a/MPChatScreen.cpp
+++ b/MPChatScreen.cpp
@@ -757,7 +757,7 @@ UINT32 MPChatScreenHandle( )
// carter, need key shortcuts for clearing up message boxes
// Check for esc
bool bHandled;
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
bHandled = false;
if(InputEvent.usEvent == KEY_DOWN )
diff --git a/MPConnectScreen.cpp b/MPConnectScreen.cpp
index 77447c2f..1b2ca83a 100644
--- a/MPConnectScreen.cpp
+++ b/MPConnectScreen.cpp
@@ -230,20 +230,15 @@ BOOLEAN EnterMPCScreen()
SetCurrentCursorFromDatabase( CURSOR_NORMAL );
- // load the Main trade screen backgroiund image
+ // load the Main trade screen backgroiund image
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
- {
+ if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\MPConnect.sti",VObjectDesc.ImageFile);
- }
- else if (iResolution == 1)
- {
+ else if (iResolution < _1024x768)
FilenameForBPP("INTERFACE\\MPConnect_800x600.sti",VObjectDesc.ImageFile);
- }
- else if (iResolution == 2)
- {
- FilenameForBPP("INTERFACE\\MPConnect_1024x768.sti",VObjectDesc.ImageFile);
- }
+ else
+ FilenameForBPP("INTERFACE\\MPConnect_1024x768.sti", VObjectDesc.ImageFile);
+
CHECKF(AddVideoObject(&VObjectDesc, &guiMPCMainBackGroundImage ));
@@ -361,8 +356,8 @@ BOOLEAN RenderMPCScreen()
//Get the main background screen graphic and blt it
GetVideoObject(&hPixHandle, guiMPCMainBackGroundImage );
- BltVideoObject(FRAME_BUFFER, hPixHandle, 0,0,0, VO_BLT_SRCTRANSPARENCY,NULL);
- //DisplayLoadScreenWithID( loadscreenID );
+
+ BltVideoObject(FRAME_BUFFER, hPixHandle, 0,(SCREEN_WIDTH - xResSize)/2,(SCREEN_HEIGHT - yResSize)/2, VO_BLT_SRCTRANSPARENCY,NULL);
//Shade the background
//ShadowVideoSurfaceRect( FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, iScreenWidthOffset + 640, iScreenHeightOffset + 480 );
@@ -423,7 +418,7 @@ void GetMPCScreenUserInput()
// GetCursorPos(&MousePos);
- while( DequeueEvent( &Event ) )
+ while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
// check if this event is swallowed by text input, otherwise process key
if( Event.usEvent == KEY_DOWN )
diff --git a/MPHostScreen.cpp b/MPHostScreen.cpp
index 2e5d30db..a2e499ec 100644
--- a/MPHostScreen.cpp
+++ b/MPHostScreen.cpp
@@ -234,7 +234,7 @@ void BtnMPHOldTraitsCallback(GUI_BUTTON *btn,INT32 reason)
BOOLEAN DoMPHMessageBox( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback )
{
- SGPRect CenteringRect= {0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1 };
+ SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT };
// do message box and return
giMPHMessageBox = DoMessageBox( ubStyle, zString, uiExitScreen, ( UINT16 ) ( usFlags| MSG_BOX_FLAG_USE_CENTERING_RECT ), ReturnCallback, &CenteringRect );
@@ -1792,21 +1792,17 @@ BOOLEAN EnterMPHScreen()
SetCurrentCursorFromDatabase( CURSOR_NORMAL );
- // load the Main trade screen backgroiund image
+ // load the Main trade screen backgroiund image
+ //ColorFillVideoSurfaceArea( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
- {
+ if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround.sti", VObjectDesc.ImageFile);
- }
- else if (iResolution == 1)
- {
+ else if (iResolution < _1024x768)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_800x600.sti", VObjectDesc.ImageFile);
- }
- else if (iResolution == 2)
- {
+ else
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_1024x768.sti", VObjectDesc.ImageFile);
- }
+
CHECKF(AddVideoObject(&VObjectDesc, &guiMPHMainBackGroundImage ));
@@ -2615,7 +2611,8 @@ BOOLEAN RenderMPHScreen()
//Get the main background screen graphic and blt it
GetVideoObject(&hPixHandle, guiMPHMainBackGroundImage );
- BltVideoObject(FRAME_BUFFER, hPixHandle, 0,0,0, VO_BLT_SRCTRANSPARENCY,NULL);
+
+ BltVideoObject(FRAME_BUFFER, hPixHandle, 0,(SCREEN_WIDTH - xResSize)/2,(SCREEN_HEIGHT - yResSize)/2, VO_BLT_SRCTRANSPARENCY,NULL);
//Shade the background
ShadowVideoSurfaceRect( FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, iScreenWidthOffset + 640, iScreenHeightOffset + 480 );
@@ -2743,7 +2740,7 @@ void GetMPHScreenUserInput()
// GetCursorPos(&MousePos);
- while( DequeueEvent( &Event ) )
+ while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
// check if this event is swallowed by text input, otherwise process key
if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN )
diff --git a/MPJoinScreen.cpp b/MPJoinScreen.cpp
index 6bad8382..341e05a9 100644
--- a/MPJoinScreen.cpp
+++ b/MPJoinScreen.cpp
@@ -408,20 +408,16 @@ BOOLEAN EnterMPJScreen()
SetCurrentCursorFromDatabase( CURSOR_NORMAL );
// load the Main trade screen backgroiund image
+ ColorFillVideoSurfaceArea( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
- {
+ if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround.sti", VObjectDesc.ImageFile);
- }
- else if (iResolution == 1)
- {
+ else if (iResolution < _1024x768)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_800x600.sti", VObjectDesc.ImageFile);
- }
- else if (iResolution == 2)
- {
+ else
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_1024x768.sti", VObjectDesc.ImageFile);
- }
+
CHECKF(AddVideoObject(&VObjectDesc, &guiMPJMainBackGroundImage ));
@@ -641,7 +637,9 @@ BOOLEAN RenderMPJScreen()
//Get the main background screen graphic and blt it
GetVideoObject(&hPixHandle, guiMPJMainBackGroundImage );
- BltVideoObject(FRAME_BUFFER, hPixHandle, 0,0,0, VO_BLT_SRCTRANSPARENCY,NULL);
+
+ BltVideoObject(FRAME_BUFFER, hPixHandle, 0,(SCREEN_WIDTH - xResSize)/2,(SCREEN_HEIGHT - yResSize)/2, VO_BLT_SRCTRANSPARENCY,NULL);
+
//Shade the background
ShadowVideoSurfaceRect( FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, iScreenWidthOffset + 640, iScreenHeightOffset + 480 );
@@ -667,7 +665,7 @@ void GetMPJScreenUserInput()
{
InputAtom Event;
- while( DequeueEvent( &Event ) )
+ while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
// check if this event is swallowed by text input, otherwise process key
if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN )
@@ -761,7 +759,7 @@ void BtnMPJCancelCallback(GUI_BUTTON *btn,INT32 reason)
BOOLEAN DoMPJMessageBox( UINT8 ubStyle, const STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback )
{
- SGPRect CenteringRect= {0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1 };
+ SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT };
// do message box and return
giMPJMessageBox = DoMessageBox( ubStyle, zString, uiExitScreen, ( UINT16 ) ( usFlags| MSG_BOX_FLAG_USE_CENTERING_RECT ), ReturnCallback, &CenteringRect );
diff --git a/MPScoreScreen.cpp b/MPScoreScreen.cpp
index fb1483fa..c018f966 100644
--- a/MPScoreScreen.cpp
+++ b/MPScoreScreen.cpp
@@ -233,20 +233,16 @@ BOOLEAN EnterMPSScreen()
SetCurrentCursorFromDatabase( CURSOR_NORMAL );
// load the Main trade screen backgroiund image
+ ColorFillVideoSurfaceArea( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
- {
+ if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround.sti", VObjectDesc.ImageFile);
- }
- else if (iResolution == 1)
- {
+ else if (iResolution < _1024x768)
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_800x600.sti", VObjectDesc.ImageFile);
- }
- else if (iResolution == 2)
- {
+ else
FilenameForBPP("INTERFACE\\OptionsScreenBackGround_1024x768.sti", VObjectDesc.ImageFile);
- }
+
CHECKF(AddVideoObject(&VObjectDesc, &guiMPSMainBackGroundImage ));
@@ -396,7 +392,8 @@ BOOLEAN RenderMPSScreen()
//Get the main background screen graphic and blt it
GetVideoObject(&hPixHandle, guiMPSMainBackGroundImage );
- BltVideoObject(FRAME_BUFFER, hPixHandle, 0,0,0, VO_BLT_SRCTRANSPARENCY,NULL);
+
+ BltVideoObject(FRAME_BUFFER, hPixHandle, 0,(SCREEN_WIDTH - xResSize)/2,(SCREEN_HEIGHT - yResSize)/2, VO_BLT_SRCTRANSPARENCY,NULL);
//Shade the background
ShadowVideoSurfaceRect( FRAME_BUFFER, iScreenWidthOffset, iScreenHeightOffset, iScreenWidthOffset + 640, iScreenHeightOffset + 480 );
@@ -539,7 +536,7 @@ void GetMPSScreenUserInput()
{
InputAtom Event;
- while( DequeueEvent( &Event ) )
+ while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
// check if this event is swallowed by text input, otherwise process key
if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN )
diff --git a/MainMenuScreen.cpp b/MainMenuScreen.cpp
index cff0fce2..5cfd787c 100644
--- a/MainMenuScreen.cpp
+++ b/MainMenuScreen.cpp
@@ -287,26 +287,26 @@ BOOLEAN InitMainMenu( )
if (gMainMenulayout[iCounter2].Visible == 1)
{
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName);
if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName ) );
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName800x600);
if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName800x600 ) );
}
- else if (iResolution == 2)
+ else
{
strcpy(VObjectDesc.ImageFile, gMainMenulayout[iCounter2].FileName1024x768);
if( !AddVideoObject( &VObjectDesc, &gMainMenulayout[iCounter2].uiIndex ) )
- AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName1024x768 ) );
+ AssertMsg(0, String( "Missing %s", gMainMenulayout[iCounter2].FileName1024x768 ) );
}
}
}
@@ -479,7 +479,7 @@ void HandleMainMenuInput()
InputAtom InputEvent;
// Check for esc
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if( InputEvent.usEvent == KEY_UP )
{
@@ -528,7 +528,7 @@ void HandleHelpScreenInput()
InputAtom InputEvent;
// Check for key
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
switch( InputEvent.usEvent )
{
@@ -613,24 +613,22 @@ BOOLEAN CreateDestroyMainMenuButtons( BOOLEAN fCreate )
SGPFILENAME filenameMP;
INT16 sSlot;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- MAINMENU_Y = gMainMenulayout[0].MAINMENU_Y;
MAINMENU_X = gMainMenulayout[0].MAINMENU_X;
+ MAINMENU_Y = gMainMenulayout[0].MAINMENU_Y;
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
}
-
- if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
- MAINMENU_Y = gMainMenulayout[0].MAINMENU_800x600Y;
- MAINMENU_X = gMainMenulayout[0].MAINMENU_800x600X;
+ MAINMENU_X = gMainMenulayout[0].MAINMENU_800x600X + xResOffset;
+ MAINMENU_Y = gMainMenulayout[0].MAINMENU_800x600Y + yResOffset;
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
}
-
- if (iResolution == 2)
+ else
{
- MAINMENU_Y = gMainMenulayout[0].MAINMENU_1024x768Y;
- MAINMENU_X = gMainMenulayout[0].MAINMENU_1024x768X;
+ MAINMENU_X = gMainMenulayout[0].MAINMENU_1024x768X + xResOffset;
+ MAINMENU_Y = gMainMenulayout[0].MAINMENU_1024x768Y + yResOffset;
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
}
@@ -716,28 +714,26 @@ void RenderMainMenu()
{
if (gMainMenulayout[iCounter2].Visible == 1)
{
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
- BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePositionX, gMainMenulayout[iCounter2].ImagePositionY, VO_BLT_SRCTRANSPARENCY,NULL);
- BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePositionX, gMainMenulayout[iCounter2].ImagePositionY, VO_BLT_SRCTRANSPARENCY,NULL);
+ BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePositionX + xResOffset, gMainMenulayout[iCounter2].ImagePositionY + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
+ BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePositionX + xResOffset, gMainMenulayout[iCounter2].ImagePositionY + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
}
-
- if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
- BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition800x600X, gMainMenulayout[iCounter2].ImagePosition800x600Y, VO_BLT_SRCTRANSPARENCY,NULL);
- BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition800x600X, gMainMenulayout[iCounter2].ImagePosition800x600Y, VO_BLT_SRCTRANSPARENCY,NULL);
+ BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition800x600X + xResOffset, gMainMenulayout[iCounter2].ImagePosition800x600Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
+ BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition800x600X + xResOffset, gMainMenulayout[iCounter2].ImagePosition800x600Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
}
-
- if (iResolution == 2)
+ else
{
GetVideoObject(&hPixHandle, gMainMenulayout[iCounter2].uiIndex);
- BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition1024x768X, gMainMenulayout[iCounter2].ImagePosition1024x768Y, VO_BLT_SRCTRANSPARENCY,NULL);
- BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition1024x768X, gMainMenulayout[iCounter2].ImagePosition1024x768Y, VO_BLT_SRCTRANSPARENCY,NULL);
+ BltVideoObject( guiSAVEBUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition1024x768X + xResOffset, gMainMenulayout[iCounter2].ImagePosition1024x768Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
+ BltVideoObject( FRAME_BUFFER, hPixHandle, 0, gMainMenulayout[iCounter2].ImagePosition1024x768X + xResOffset, gMainMenulayout[iCounter2].ImagePosition1024x768Y + yResOffset, VO_BLT_SRCTRANSPARENCY,NULL);
}
}
- }
+ }
#ifdef TESTFOREIGNFONTS
DrawTextToScreen( L"LARGEFONT1: "/*gzCopyrightText[ 0 ]*/, 0, 105, 640, LARGEFONT1, FONT_MCOLOR_WHITE, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
@@ -774,21 +770,19 @@ void RestoreButtonBackGrounds()
#ifndef TESTFOREIGNFONTS
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
MAINMENU_Y = gMainMenulayout[0].MAINMENU_Y;
MAINMENU_X = gMainMenulayout[0].MAINMENU_X;
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
}
-
- if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
MAINMENU_Y = gMainMenulayout[0].MAINMENU_800x600Y;
MAINMENU_X = gMainMenulayout[0].MAINMENU_800x600X;
MAINMENU_Y_SPACE = gMainMenulayout[0].MAINMENU_Y_SPACE;
}
-
- if (iResolution == 2)
+ else
{
MAINMENU_Y = gMainMenulayout[0].MAINMENU_1024x768Y;
MAINMENU_X = gMainMenulayout[0].MAINMENU_1024x768X;
diff --git a/MessageBoxScreen.cpp b/MessageBoxScreen.cpp
index e5c16bde..052b68a4 100644
--- a/MessageBoxScreen.cpp
+++ b/MessageBoxScreen.cpp
@@ -1165,7 +1165,7 @@ UINT32 MessageBoxScreenHandle( )
// carter, need key shortcuts for clearing up message boxes
// Check for esc
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if( !HandleTextInput( &InputEvent ) && InputEvent.usEvent == KEY_DOWN )
{
diff --git a/Multiplayer/client.cpp b/Multiplayer/client.cpp
index 6080aaa3..15e2f6c5 100644
--- a/Multiplayer/client.cpp
+++ b/Multiplayer/client.cpp
@@ -1094,6 +1094,7 @@ void recieveHIRE(RPCParameters *rpcParameters)
pSoldier->bSide=0; //default coop only
gTacticalStatus.Team[MercCreateStruct.bTeam ].bSide=0;
+ pSoldier->bVisible = 1;
if(MercCreateStruct.ubProfile==64)//slay
{
@@ -1104,6 +1105,7 @@ void recieveHIRE(RPCParameters *rpcParameters)
if(cGameType==MP_TYPE_DEATHMATCH)//all vs all only
{
pSoldier->bSide=1;
+ pSoldier->bVisible = 0;
gTacticalStatus.Team[MercCreateStruct.bTeam ].bSide=1;
}
@@ -1112,6 +1114,7 @@ void recieveHIRE(RPCParameters *rpcParameters)
if(sHireMerc->team != TEAM)
{
pSoldier->bSide=1;
+ pSoldier->bVisible = 0;
gTacticalStatus.Team[MercCreateStruct.bTeam ].bSide=1;
}
}
@@ -1485,7 +1488,7 @@ void send_donegui ( UINT8 ubResult )
info.ready_stage = 3;//done placing mercs
info.status=1;
- SGPRect CenterRect = { 100, 100, SCREEN_WIDTH - 100, 300 };
+ SGPRect CenterRect = { 100 + xResOffset, 100, SCREEN_WIDTH - 100 - xResOffset, 300 };
DoMessageBox( MSG_BOX_BASIC_STYLE, MPClientMessage[12], guiCurrentScreen, MSG_BOX_FLAG_OK | MSG_BOX_FLAG_USE_CENTERING_RECT, send_donegui, &CenterRect );
if(numready==cMaxClients && is_server)//all done
@@ -1669,7 +1672,7 @@ void start_battle ( void )
// Go to "ready" state!
if (numPlayersValid && clientsFinishedDownloading && teamsValid)
{
- SGPRect CenterRect = { 100, 100, SCREEN_WIDTH - 100, 300 };
+ SGPRect CenterRect = { 100 + xResOffset, 100, SCREEN_WIDTH - 100 - xResOffset, 300 };
DoMessageBox( MSG_BOX_BASIC_STYLE, MPClientMessage[35], guiCurrentScreen, MSG_BOX_FLAG_YESNO | MSG_BOX_FLAG_USE_CENTERING_RECT, allowlaptop_callback, &CenterRect );
}
}
@@ -2169,7 +2172,7 @@ void requestSETID(RPCParameters *rpcParameters)
{
serverAddr = rpcParameters->sender;
- SGPRect CenteringRect= {0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1 };
+ SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT };
DoMessageBox( MSG_BOX_BASIC_STYLE , MPClientMessage[64] , guiCurrentScreen, MSG_BOX_FLAG_YESNO | MSG_BOX_FLAG_USE_CENTERING_RECT, allowDownloadCallback, &CenteringRect );
}
}
@@ -2415,7 +2418,7 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = false;
// WANNE: The new improved interrupt system (IIS) does not work with multiplayer, so disable it
- gGameExternalOptions.fImprovedInterruptSystem = false;
+ //gGameOptions.fImprovedInterruptSystem = false;
// Disable Real-Time Mode
// SANDRO - huh? real-time sneak is in preferences
@@ -2424,7 +2427,7 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve
gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] = false;
gGameExternalOptions.fQuietRealTimeSneak = false;
- // WANNE: Take the settings from the ja2_options.ini
+ // WANNE: Take the settings from the ja2_options.ini
// WANNE: Enable fast loading
/*gGameExternalOptions.fDisableLaptopTransition = true;
gGameExternalOptions.fFastWWWSitesLoading = true;
@@ -2471,12 +2474,19 @@ void recieveSETTINGS (RPCParameters *rpcParameters) //recive settings from serve
}
gGameOptions.ubSquadSize = 6;
+
+ //gGameOptions.fBobbyRayFastShipments = FALSE;
+ gGameOptions.fInventoryCostsAP = FALSE;
+
+ gGameOptions.fUseNCTH = FALSE;
+ gGameOptions.fImprovedInterruptSystem = FALSE;
+ gGameOptions.fWeaponOverheating = FALSE;
// Server forces us to play with new Inventory, but NIV is not allowed on the client,
// because of wrong resolution or other stuff
if ( UsingNewInventorySystem() == true && !IsNIVModeValid(true) )
{
- SGPRect CenteringRect= {0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1 };
+ SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH-1 - 2 * xResOffset, SCREEN_HEIGHT-1 };
DoMessageBox( MSG_BOX_BASIC_STYLE , MPClientMessage[69] , guiCurrentScreen, MSG_BOX_FLAG_OK | MSG_BOX_FLAG_USE_CENTERING_RECT, InvalidClientSettingsOkBoxCallback, &CenteringRect );
}
else
@@ -2629,7 +2639,7 @@ void reapplySETTINGS()
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = false;
// WANNE: The new improved interrupt system (IIS) does not work with multiplayer, so disable it
- gGameExternalOptions.fImprovedInterruptSystem = false;
+ //gGameOptions.fImprovedInterruptSystem = false;
// Disable Real-Time Mode
// SANDRO - real-time sneak is in preferences
@@ -2637,7 +2647,7 @@ void reapplySETTINGS()
gGameSettings.fOptions[TOPTION_ALLOW_REAL_TIME_SNEAK] = false;
gGameExternalOptions.fQuietRealTimeSneak = false;
- // WANNE: Take the settings from the ja2_options.ini
+ // WANNE: Take the settings from the ja2_options.ini
// WANNE: Enable fast loading
/*gGameExternalOptions.fDisableLaptopTransition = true;
gGameExternalOptions.fFastWWWSitesLoading = true;
@@ -2685,6 +2695,13 @@ void reapplySETTINGS()
gGameOptions.ubSquadSize = 6;
+ //gGameOptions.fBobbyRayFastShipments = FALSE;
+ gGameOptions.fInventoryCostsAP = FALSE;
+
+ gGameOptions.fUseNCTH = FALSE;
+ gGameOptions.fImprovedInterruptSystem = FALSE;
+ gGameOptions.fWeaponOverheating = FALSE;
+
// WANNE - MP: We have to re-initialize the correct interface
if((UsingNewInventorySystem() == true) && IsNIVModeValid(true))
{
@@ -4131,7 +4148,8 @@ void kick_player (void)
else
swprintf(Cmsg, MPClientMessage[74], client_names[1],client_names[2],client_names[3]);
- SGPRect CenterRect = { 100, 100, SCREEN_WIDTH - 100, 300 };
+ SGPRect CenterRect = { 100 + xResOffset, 100, SCREEN_WIDTH - xResOffset, 300 };
+
DoMessageBox( MSG_BOX_BASIC_STYLE, Cmsg, guiCurrentScreen, MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS | MSG_BOX_FLAG_USE_CENTERING_RECT, kick_callback, &CenterRect );
}
else
@@ -4208,7 +4226,7 @@ void overide_turn (void)
else
swprintf(Cmsg, MPClientMessage[30], client_names[1],client_names[2],client_names[3]);
- SGPRect CenterRect = { 100, 100, SCREEN_WIDTH - 100, 300 };
+ SGPRect CenterRect = { 100 + xResOffset, 100, SCREEN_WIDTH - 100 - xResOffset, 300 };
DoMessageBox( MSG_BOX_BASIC_STYLE, Cmsg, guiCurrentScreen, MSG_BOX_FLAG_FOUR_NUMBERED_BUTTONS | MSG_BOX_FLAG_USE_CENTERING_RECT | MSG_BOX_FLAG_OK, turn_callback, &CenterRect );
}
@@ -4448,7 +4466,7 @@ void HandleClientConnectionLost()
// connection lost, let user know via popup then quit to main menu
iDisconnectedScreen = guiCurrentScreen;
- SGPRect CenteringRect= {0, 0, SCREEN_WIDTH-1, SCREEN_HEIGHT-1 };
+ SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT };
if (wcscmp(gszDisconnectReason,L"")==0)
{
diff --git a/Options Screen.cpp b/Options Screen.cpp
index 76b4553f..8614cedc 100644
Binary files a/Options Screen.cpp and b/Options Screen.cpp differ
diff --git a/SCREENS.cpp b/SCREENS.cpp
index dbfae932..323a6956 100644
--- a/SCREENS.cpp
+++ b/SCREENS.cpp
@@ -26,6 +26,12 @@ UINT16 SCREEN_HEIGHT;
INT16 iScreenWidthOffset;
INT16 iScreenHeightOffset;
+UINT16 xResSize; // 640 / 800 / 1024
+UINT16 yResSize; // 480 / 600 / 768
+
+UINT16 xResOffset; // For ARSP: ((SCREEN_WIDTH - xResSize) / 2)
+UINT16 yResOffset; // For ARSP: ((SCREEN_HEIGHT - yResSize) / 2)
+
BOOLEAN fDisplayOverheadMap;
Screens GameScreens[MAX_SCREENS] =
diff --git a/SaveLoadGame.cpp b/SaveLoadGame.cpp
index f91cbaf6..c039894a 100644
--- a/SaveLoadGame.cpp
+++ b/SaveLoadGame.cpp
@@ -2386,7 +2386,11 @@ BOOLEAN StackedObjectData::Load( INT8** hBuffer, float dMajorMapVersion, UINT8 u
|| (dMajorMapVersion == gdMajorMapVersion && gubMinorMapVersion == ubMinorMapVersion))
{
int size;
- LOADDATA(&(this->data), *hBuffer, sizeof(ObjectData) );
+ // Flugente: changed this, otherwise game would crash when reading WF maps if class ObjectData was different. this is a rough fix and by no means perfect
+ //LOADDATA(&(this->data), *hBuffer, sizeof(ObjectData) );
+ // +1 because we have to account for endOfPOD itself
+ LOADDATA(&(this->data), *hBuffer, SIZEOF_OBJECTDATA_POD+1 );
+
LOADDATA(&size, *hBuffer, sizeof(int) );
attachments.resize(size);
for (attachmentList::iterator iter = attachments.begin(); iter != attachments.end(); ++iter) {
@@ -2906,6 +2910,14 @@ BOOLEAN SaveGame( int ubSaveGameID, STR16 pGameDesc )
SaveGameHeader.sInitialGameOptions.ubSquadSize = gGameOptions.ubSquadSize;
+
+ //SaveGameHeader.sInitialGameOptions.fBobbyRayFastShipments = gGameOptions.fBobbyRayFastShipments;
+ SaveGameHeader.sInitialGameOptions.fInventoryCostsAP = gGameOptions.fInventoryCostsAP;
+
+ SaveGameHeader.sInitialGameOptions.fUseNCTH = gGameOptions.fUseNCTH;
+ SaveGameHeader.sInitialGameOptions.fImprovedInterruptSystem = gGameOptions.fImprovedInterruptSystem;
+ SaveGameHeader.sInitialGameOptions.fWeaponOverheating = gGameOptions.fWeaponOverheating;
+
//
// Save the Save Game header file
//
@@ -3884,6 +3896,8 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
ShutdownNPCQuotes();
+ SetFastForwardMode(FALSE); // FF can sometimes be active if quick-load during AI turn transition
+
//very small TODO
//Bugfix = Stop the chopter sound
@@ -4011,7 +4025,8 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
InitializeInvPanelCoordsOld();
}
- if (gGameOptions.ubSquadSize > 6 && iResolution == 0 || gGameOptions.ubSquadSize > 8 && iResolution == 1)
+ if ((gGameOptions.ubSquadSize == 8 && iResolution < _800x600) ||
+ (gGameOptions.ubSquadSize == 10 && iResolution < _1024x768))
{
FileClose( hFile );
return(FALSE);
@@ -8737,7 +8752,7 @@ void HandleOldBobbyRMailOrders()
//copy over the purchase info
memcpy( gpNewBobbyrShipments[ iNewListCnt ].BobbyRayPurchase,
LaptopSaveInfo.BobbyRayOrdersOnDeliveryArray[iCnt].BobbyRayPurchase,
- sizeof( BobbyRayPurchaseStruct ) * MAX_PURCHASE_AMOUNT );
+ sizeof( BobbyRayPurchaseStruct ) * gGameExternalOptions.ubBobbyRayMaxPurchaseAmount );
gpNewBobbyrShipments[ iNewListCnt ].fActive = TRUE;
gpNewBobbyrShipments[ iNewListCnt ].ubDeliveryLoc = BR_DRASSEN;
diff --git a/SaveLoadScreen.cpp b/SaveLoadScreen.cpp
index da7a1167..19893949 100644
--- a/SaveLoadScreen.cpp
+++ b/SaveLoadScreen.cpp
@@ -2369,7 +2369,7 @@ void DoneFadeOutForSaveLoadScreen( void )
else
{
//CHRISL: New fail message if we failed because of screen res
- if(UsingNewInventorySystem() == true && iResolution == 0)
+ if(UsingNewInventorySystem() == true && iResolution >= _640x480 && iResolution < _800x600)
{
DoSaveLoadMessageBox( MSG_BOX_BASIC_STYLE, zSaveLoadText[SLG_INV_RES_ERROR], SAVE_LOAD_SCREEN, MSG_BOX_FLAG_OK, FailedLoadingGameCallBack );
NextLoopCheckForEnoughFreeHardDriveSpace();
@@ -2379,7 +2379,8 @@ void DoneFadeOutForSaveLoadScreen( void )
DoSaveLoadMessageBox( MSG_BOX_BASIC_STYLE, zSaveLoadText[SLG_INV_CUSTUM_ERROR], SAVE_LOAD_SCREEN, MSG_BOX_FLAG_OK, FailedLoadingGameCallBack );
NextLoopCheckForEnoughFreeHardDriveSpace();
}
- else if ((gGameOptions.ubSquadSize > 6 && iResolution == 0) || (gGameOptions.ubSquadSize > 8 && iResolution == 1))
+ else if ((gGameOptions.ubSquadSize == 8 && iResolution < _800x600) ||
+ (gGameOptions.ubSquadSize == 10 && iResolution < _1024x768))
{
DoSaveLoadMessageBox( MSG_BOX_BASIC_STYLE, zSaveLoadText[SLG_SQUAD_SIZE_RES_ERROR], SAVE_LOAD_SCREEN, MSG_BOX_FLAG_OK, FailedLoadingGameCallBack );
NextLoopCheckForEnoughFreeHardDriveSpace();
diff --git a/Standard Gaming Platform/SGP_VS2005.vcproj b/Standard Gaming Platform/SGP_VS2005.vcproj
index 478efb69..354043ea 100644
--- a/Standard Gaming Platform/SGP_VS2005.vcproj
+++ b/Standard Gaming Platform/SGP_VS2005.vcproj
@@ -42,7 +42,7 @@
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
Optimization="0"
AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NO_ZLIB_COMPRESSION"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NO_ZLIB_COMPRESSION;_WIN32_WINNT=0x0500"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -106,7 +106,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NO_ZLIB_COMPRESSION"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NO_ZLIB_COMPRESSION;_WIN32_WINNT=0x0500"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
@@ -167,7 +167,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NO_ZLIB_COMPRESSION"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NO_ZLIB_COMPRESSION;_WIN32_WINNT=0x0500"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
@@ -229,7 +229,7 @@
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
Optimization="0"
AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NO_ZLIB_COMPRESSION"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;NO_ZLIB_COMPRESSION;_WIN32_WINNT=0x0500"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -294,7 +294,7 @@
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
Optimization="0"
AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NO_ZLIB_COMPRESSION"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;NO_ZLIB_COMPRESSION;_WIN32_WINNT=0x0500"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
diff --git a/Standard Gaming Platform/SGP_VS2010.vcxproj b/Standard Gaming Platform/SGP_VS2010.vcxproj
index 13489454..42ecf187 100644
--- a/Standard Gaming Platform/SGP_VS2010.vcxproj
+++ b/Standard Gaming Platform/SGP_VS2010.vcxproj
@@ -203,24 +203,24 @@
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
diff --git a/Standard Gaming Platform/input.cpp b/Standard Gaming Platform/input.cpp
index 874d87f2..8b6ba921 100644
--- a/Standard Gaming Platform/input.cpp
+++ b/Standard Gaming Platform/input.cpp
@@ -110,6 +110,9 @@ HHOOK ghMouseHook;
BOOLEAN gfCurrentStringInputState;
StringInput *gpCurrentStringDescriptor;
+// Thread
+static CRITICAL_SECTION gcsInputQueueLock;
+
// Local function headers
void QueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam);
@@ -277,6 +280,8 @@ BOOLEAN InitializeInputManager(void)
// ghKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) KeyboardHandler, (HINSTANCE) 0, GetCurrentThreadId());
// DbgMessage(TOPIC_INPUT, DBG_LEVEL_2, String("Set keyboard hook returned %d", ghKeyboardHook));
+ InitializeCriticalSection(&gcsInputQueueLock);
+
ghMouseHook = SetWindowsHookEx(WH_MOUSE, (HOOKPROC) MouseHandler, (HINSTANCE) 0, GetCurrentThreadId());
DbgMessage(TOPIC_INPUT, DBG_LEVEL_2, String("Set mouse hook returned %d", ghMouseHook));
return TRUE;
@@ -289,6 +294,7 @@ void ShutdownInputManager(void)
UnRegisterDebugTopic(TOPIC_INPUT, "Input Manager");
// UnhookWindowsHookEx(ghKeyboardHook);
UnhookWindowsHookEx(ghMouseHook);
+ DeleteCriticalSection(&gcsInputQueueLock);
}
void QueuePureEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
@@ -329,7 +335,7 @@ void QueuePureEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
}
}
-void QueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
+void InternalQueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
{
UINT32 uiTimer;
UINT16 usKeyState;
@@ -452,24 +458,42 @@ void QueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
}
}
-BOOLEAN DequeueSpecificEvent(InputAtom *Event, UINT32 uiMaskFlags )
+void QueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam)
{
- // Is there an event to dequeue
- if (gusQueueCount > 0)
- {
- memcpy( Event, &( gEventQueue[gusHeadIndex] ), sizeof( InputAtom ) );
-
- // Check if it has the masks!
- if ( ( Event->usEvent & uiMaskFlags ) )
- {
- return( DequeueEvent( Event) );
- }
+ EnterCriticalSection(&gcsInputQueueLock);
+ __try {
+ InternalQueueEvent(ubInputEvent, usParam, uiParam);
+ }__finally {
+ LeaveCriticalSection(&gcsInputQueueLock);
}
-
- return( FALSE );
}
-BOOLEAN DequeueEvent(InputAtom *Event)
+BOOLEAN DequeueSpecificEvent(InputAtom *Event, UINT32 uiMaskFlags )
+{
+ EnterCriticalSection(&gcsInputQueueLock);
+ __try
+ {
+ // Is there an event to dequeue
+ if (gusQueueCount > 0)
+ {
+ memcpy( Event, &( gEventQueue[gusHeadIndex] ), sizeof( InputAtom ) );
+
+ // Check if it has the masks!
+ if ( ( Event->usEvent & uiMaskFlags ) )
+ {
+ return( DequeueEvent( Event) );
+ }
+ }
+
+ return( FALSE );
+ }
+ __finally
+ {
+ LeaveCriticalSection(&gcsInputQueueLock);
+ }
+}
+
+BOOLEAN InternalDequeueEvent(InputAtom *Event)
{
HandleSingleClicksAndButtonRepeats( );
@@ -500,6 +524,18 @@ BOOLEAN DequeueEvent(InputAtom *Event)
return FALSE;
}
}
+BOOLEAN DequeueEvent(InputAtom *Event)
+{
+ __try
+ {
+ EnterCriticalSection(&gcsInputQueueLock);
+ return InternalDequeueEvent(Event);
+ }
+ __finally
+ {
+ LeaveCriticalSection(&gcsInputQueueLock);
+ }
+}
void KeyChange(UINT32 usParam, UINT32 uiParam, UINT8 ufKeyState)
{
diff --git a/Standard Gaming Platform/input.h b/Standard Gaming Platform/input.h
index fc5fa577..4c65edb2 100644
--- a/Standard Gaming Platform/input.h
+++ b/Standard Gaming Platform/input.h
@@ -43,7 +43,7 @@
#define BUTTON_REPEAT_TIMEOUT 250
#define BUTTON_REPEAT_TIME 50
-typedef struct
+typedef struct InputAtom
{
UINT32 uiTimeStamp;
UINT16 usKeyState;
diff --git a/Standard Gaming Platform/sgp.cpp b/Standard Gaming Platform/sgp.cpp
index 3cfd9bf4..39ac878e 100644
--- a/Standard Gaming Platform/sgp.cpp
+++ b/Standard Gaming Platform/sgp.cpp
@@ -34,9 +34,9 @@
#include "utilities.h"
#endif
+#include "GameSettings.h"
#include "input.h"
#include "zmouse.h"
-#include "GameSettings.h"
#include
#include
@@ -57,6 +57,7 @@
#include
+#include
#include "ExceptionHandling.h"
#include "dbt.h"
@@ -87,6 +88,8 @@ static vfs::Path s_CodePage;
static vfs::FileLogger *vfslog = NULL;
+int iWindowedMode;
+
void SHOWEXCEPTION(sgp::Exception& ex)
{
try {
@@ -143,11 +146,17 @@ extern BOOLEAN CheckIfGameCdromIsInCDromDrive();
extern void QueueEvent(UINT16 ubInputEvent, UINT32 usParam, UINT32 uiParam);
// Prototype Declarations
-
+INT32 FAR PASCAL SyncWindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LPARAM lParam);
INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LPARAM lParam);
BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow);
void ShutdownStandardGamingPlatform(void);
+void CreateStandardGamingPlatform(HWND hWindow);
void GetRuntimeSettings( );
+void SafeSGPExit(void);
+
+static bool CallGameLoop(bool wait);
+static CRITICAL_SECTION gcsGameLoop;
+
int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCommandLine, int sCommandShow);
@@ -201,6 +210,15 @@ BOOLEAN gfIgnoreMessages=FALSE;
// GLOBAL VARIBLE, SET TO DEFAULT BUT CAN BE CHANGED BY THE GAME IF INIT FILE READ
UINT8 gbPixelDepth = PIXEL_DEPTH;
+INT32 FAR PASCAL SyncWindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LPARAM lParam)
+{
+ INT32 retval;
+ EnterCriticalSection(&gcsGameLoop);
+ retval = WindowProcedure(hWindow, Message, wParam, lParam);
+ LeaveCriticalSection(&gcsGameLoop);
+ return retval;
+}
+
bool s_bExportStrings = false;
extern bool g_bUseXML_Strings;// = false;
bool g_bUseXML_Structures = false;
@@ -509,7 +527,8 @@ INT32 FAR PASCAL WindowProcedure(HWND hWindow, UINT16 Message, WPARAM wParam, LP
break;
case WM_CREATE:
- break;
+ CreateStandardGamingPlatform(hWindow);
+ break;
case WM_DESTROY:
ShutdownStandardGamingPlatform();
@@ -637,7 +656,7 @@ BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow)
FontTranslationTable *pFontTable;
// now required by all (even JA2) in order to call ShutdownSGP
- atexit(SGPExit);
+ atexit(SafeSGPExit);
// First, initialize the registry keys.
InitializeRegistryKeys( "Wizardry8", "Wizardry8key" );
@@ -698,6 +717,8 @@ BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow)
return FALSE;
}
+ InitializeCriticalSection(&gcsGameLoop);
+
FastDebugMsg("Initializing Video Manager");
// Initialize DirectDraw (DirectX 2)
if (InitializeVideoManager(hInstance, (UINT16) sCommandShow, (void *) WindowProcedure) == FALSE)
@@ -723,7 +744,6 @@ BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow)
return FALSE;
}
- InitializeJA2Clock();
//InitializeJA2TimerID();
#ifdef USE_VFS
@@ -873,6 +893,24 @@ BOOLEAN InitializeStandardGamingPlatform(HINSTANCE hInstance, int sCommandShow)
return TRUE;
}
+static void TimerActivatedCallback(INT32 timer, PTR state)
+{
+ if (gfApplicationActive && gfProgramIsRunning)
+ {
+ if (CallGameLoop(false))
+ YieldProcessor();
+ }
+}
+
+void CreateStandardGamingPlatform(HWND hWindow)
+{
+ InitializeJA2Clock();
+
+ if (!IsHiSpeedClockMode())
+ SetTimer( hWindow, 0, 1, NULL);
+ else
+ AddTimerNotifyCallback(TimerActivatedCallback, hWindow);
+}
void ShutdownStandardGamingPlatform(void)
{
@@ -896,6 +934,7 @@ void ShutdownStandardGamingPlatform(void)
//
// Shut down the different components of the SGP
//
+ ClearTimerNotifyCallbacks();
// TEST
SoundServiceStreams();
@@ -905,7 +944,6 @@ void ShutdownStandardGamingPlatform(void)
ShutdownGame();
}
-
ShutdownButtonSystem();
MSYS_Shutdown();
@@ -944,6 +982,8 @@ void ShutdownStandardGamingPlatform(void)
// down the debugging layer
UnRegisterDebugTopic(TOPIC_SGP, "Standard Gaming Platform");
+ DeleteCriticalSection(&gcsGameLoop);
+
ShutdownDebugManager();
sgp::Logger::instance().shutdown();
@@ -1023,12 +1063,25 @@ private:
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pCommandLine, int sCommandShow)
{
+#ifdef _DEBUG
+ // Use this one ONLY if you're having memory corruption issues that can be repeated in a short time
+ // Otherwise it will just run out of memory.
+
+ /****************************************************************************************************/
+ /* */
+ /* DEBUG MEMORY ALLOCATION ON THE HEAP : uncomment when required */
+ /* ------------------------------------------------------------------------ */
+ /* */
+ /* _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_EVERY_1024_DF); */
+ /* _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_DEBUG ); */
+ /* */
+ /****************************************************************************************************/
+#endif
//If we are to use exception handling
#ifdef ENABLE_EXCEPTION_HANDLING
int Result = -1;
-
__try
{
Result = HandledWinMain(hInstance, hPrevInstance, pCommandLine, sCommandShow);
@@ -1058,6 +1111,8 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pC
HWND hPrevInstanceWindow;
UINT32 uiTimer = 0;
+
+
#ifdef USE_VFS
vfs::Log::setSharedString( getGameID() );
#endif
@@ -1193,9 +1248,6 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pC
FastDebugMsg("Running Game");
- // 0verhaul: Use the smallest available timer to make sure all animation updates happen at the speed they're supposed to
- SetTimer( ghWindow, uiTimer, 1, NULL);
-
// At this point the SGP is set up, which means all I/O, Memory, tools, etc... are available. All we need to do is
// attend to the gaming mechanics themselves
Message.wParam = 0;
@@ -1269,8 +1321,6 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pC
}
#endif
- KillTimer( ghWindow, uiTimer);
-
// This is the normal exit point
FastDebugMsg("Exiting Game");
PostQuitMessage(0);
@@ -1283,7 +1333,6 @@ int PASCAL HandledWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR pC
}
-
void SGPExit(void)
{
static BOOLEAN fAlreadyExiting = FALSE;
@@ -1326,7 +1375,12 @@ void SGPExit(void)
void GetRuntimeSettings( )
{
+ int iMaximize;
+
#ifndef USE_VFS
+ CHAR8 zMaximize[ 50 ];
+ CHAR8 zWindowedMode[ 50 ];
+
// Runtime settings - for now use INI file - later use registry
STRING512 INIFile; // Path to the ini file
CHAR8 zScreenResolution[ 50 ];
@@ -1340,12 +1394,20 @@ void GetRuntimeSettings( )
vfs::PropertyContainer oProps;
oProps.initFromIniFile(GAME_INI_FILE);
#endif
- iResolution = -1;
+
#ifndef USE_VFS
if (GetPrivateProfileString( "Ja2 Settings","SCREEN_RESOLUTION", "", zScreenResolution, 50, INIFile ))
{
iResolution = atoi(zScreenResolution);
}
+ if (GetPrivateProfileString( "Ja2 Settings","SCREEN_MODE_WINDOWED_MAXIMIZE", "", zMaximize, 50, INIFile ))
+ {
+ iMaximize = atoi(zMaximize);
+ }
+ if (GetPrivateProfileString( "Ja2 Settings","SCREEN_MODE_WINDOWED", "", zWindowedMode, 50, INIFile ))
+ {
+ iWindowedMode = atoi(zWindowedMode);
+ }
#else
vfs::String loc = oProps.getStringProperty("Ja2 Settings", L"LOCALE");
if(!loc.empty())
@@ -1354,6 +1416,12 @@ void GetRuntimeSettings( )
}
iResolution = (int)oProps.getIntProperty(L"Ja2 Settings", L"SCREEN_RESOLUTION", -1);
+
+ // WANNE: Always enable
+ //iMaximize = (int)oProps.getIntProperty(L"Ja2 Settings", L"SCREEN_MODE_WINDOWED_MAXIMIZE", -1);
+ iMaximize = 1;
+
+ iWindowedMode = (int)oProps.getIntProperty(L"Ja2 Settings", L"SCREEN_MODE_WINDOWED", -1);
vfs::Settings::setUseUnicode( !oProps.getBoolProperty(L"Ja2 Settings", L"VFS_NO_UNICODE", false) );
@@ -1428,23 +1496,120 @@ void GetRuntimeSettings( )
switch (iResolution)
{
- // 640x480
- case 0:
+ case _640x480:
iResX = 640;
iResY = 480;
break;
- // 1024x768
- case 2:
+ case _800x600:
+ iResX = 800;
+ iResY = 600;
+ break;
+ case _1024x600:
+ iResX = 1024;
+ iResY = 600;
+ break;
+ case _1280x720:
+ iResX = 1280;
+ iResY = 720;
+ break;
+ case _1024x768:
iResX = 1024;
iResY = 768;
break;
- // 800x600
- default:
- iResolution = 1;
+ case _1280x768:
+ iResX = 1280;
+ iResY = 768;
+ break;
+ case _1360x768:
+ iResX = 1360;
+ iResY = 768;
+ break;
+ case _1366x768:
+ iResX = 1366;
+ iResY = 768;
+ break;
+ case _1280x800:
+ iResX = 1280;
+ iResY = 800;
+ break;
+ case _1440x900:
+ iResX = 1440;
+ iResY = 900;
+ break;
+ case _1600x900:
+ iResX = 1600;
+ iResY = 900;
+ break;
+ case _1280x960:
+ iResX = 1280;
+ iResY = 960;
+ break;
+ case _1440x960:
+ iResX = 1440;
+ iResY = 960;
+ break;
+ case _1770x1000:
+ iResX = 1770;
+ iResY = 1000;
+ break;
+ case _1280x1024:
+ iResX = 1280;
+ iResY = 1024;
+ break;
+ case _1360x1024:
+ iResX = 1360;
+ iResY = 1024;
+ break;
+ case _1600x1024:
+ iResX = 1600;
+ iResY = 1024;
+ break;
+ case _1440x1050:
+ iResX = 1440;
+ iResY = 1050;
+ break;
+ case _1680x1050:
+ iResX = 1680;
+ iResY = 1050;
+ break;
+ case _1920x1080:
+ iResX = 1920;
+ iResY = 1080;
+ break;
+ case _1600x1200:
+ iResX = 1600;
+ iResY = 1200;
+ break;
+ case _1920x1200:
+ iResX = 1920;
+ iResY = 1200;
+ break;
+ case _2560x1440:
+ iResX = 2560;
+ iResY = 1440;
+ break;
+ case _2560x1600:
+ iResX = 2560;
+ iResY = 1600;
+ break;
+ default: // 800x600
+ iResolution = _800x600;
iResX = 800;
iResY = 600;
break;
}
+
+ if (iWindowedMode == 1 && iMaximize == 1)
+ {
+ if ((iResX - 16) >= 1024)
+ iResX = iResX - 16;
+
+ if ((iResY - 70) >= 768)
+ iResY = iResY - 70;
+ }
+
+ // Adjust again
+
#ifndef USE_VFS
gbPixelDepth = GetPrivateProfileInt( "SGP", "PIXEL_DEPTH", PIXEL_DEPTH, INIFile );
@@ -1462,14 +1627,33 @@ void GetRuntimeSettings( )
// WANNE: Should we play the intro?
iPlayIntro = (int) GetPrivateProfileInt( "Ja2 Settings","PLAY_INTRO", iPlayIntro, INIFile );
#else
- gbPixelDepth = (UINT8)oProps.getIntProperty(L"SGP", L"PIXEL_DEPTH", PIXEL_DEPTH);
+ gbPixelDepth = PIXEL_DEPTH;
- SCREEN_WIDTH = (UINT16)oProps.getIntProperty(L"SGP", L"WIDTH", iResX);
- SCREEN_HEIGHT = (UINT16)oProps.getIntProperty(L"SGP", L"HEIGHT", iResY);
+ SCREEN_WIDTH = iResX;
+ SCREEN_HEIGHT = iResY;
iScreenWidthOffset = (SCREEN_WIDTH - 640) / 2;
iScreenHeightOffset = (SCREEN_HEIGHT - 480) / 2;
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
+ xResOffset = ((SCREEN_WIDTH - 640) / 2);
+ yResOffset = ((SCREEN_HEIGHT - 480) / 2);
+ }
+ else if (iResolution < _1024x768)
+ {
+ xResOffset = ((SCREEN_WIDTH - 800) / 2);
+ yResOffset = ((SCREEN_HEIGHT - 600) / 2);
+ }
+ else
+ {
+ xResOffset = ((SCREEN_WIDTH - 1024) / 2);
+ yResOffset = ((SCREEN_HEIGHT - 768) / 2);
+ }
+
+ xResSize = (SCREEN_WIDTH - 2 * xResOffset); // one of the following: 1024 or 800 or 640
+ yResSize = (SCREEN_HEIGHT - 2 * yResOffset); // one of the follownig: 768 or 600 or 480
+
/* Sergeant_Kolja. 2007-02-20: runtime Windowed mode instead of compile-time */
/* 1 for Windowed, 0 for Fullscreen */
if( !bScreenModeCmdLine )
@@ -1484,9 +1668,28 @@ void GetRuntimeSettings( )
s_DebugKeyboardInput = oProps.getBoolProperty(L"Ja2 Settings", L"DEBUG_KEYS", false);
s_CodePage = oProps.getStringProperty(L"Ja2 Settings", L"CODE_PAGE");
#endif // USE_CODE_PAGE
+
+ // get timer/clock initialization state
+ SetHiSpeedClockMode( oProps.getBoolProperty("Ja2 Settings", "HIGHSPEED_TIMER", false) ? TRUE : FALSE );
#endif
}
+
+void SafeSGPExit(void)
+{
+ // SGPExit tends to use resources that are already uninitialized so handle
+ __try
+ {
+ SGPExit();
+ }
+ __except( EXCEPTION_EXECUTE_HANDLER )
+ {
+ // The application is in exit and best effort to clean up
+ // has failed so just ignore and continue silently
+ }
+}
+
+
void ShutdownWithErrorBox(CHAR8 *pcMessage)
{
strncpy(gzErrorMsg, pcMessage, 255);
@@ -1617,3 +1820,61 @@ void ProcessJa2CommandLineBeforeInitialization(CHAR8 *pCommandLine)
MemFree(pCopy);
}
+
+
+
+static LONG __stdcall SGPExceptionFilter(int exceptionCount, EXCEPTION_POINTERS* pExceptInfo)
+{
+#ifdef ENABLE_EXCEPTION_HANDLING
+
+ if (exceptionCount > 3)
+ {
+ // the exception handler writer can fail with exceptions too
+ __try
+ {
+ RecordExceptionInfo(pExceptInfo);
+ } __except (EXCEPTION_EXECUTE_HANDLER) {}
+ AssertMsg(FALSE, "Unhanded exception processing GameLoop unable to recover.");
+ }
+
+#endif
+
+ return EXCEPTION_EXECUTE_HANDLER;
+}
+
+static bool CallGameLoop(bool wait)
+{
+ static int numUnsuccessfulTries = 0;
+ if (wait)
+ {
+ EnterCriticalSection(&gcsGameLoop);
+ }
+ else
+ {
+ if ( !TryEnterCriticalSection(&gcsGameLoop) )
+ return false;
+ }
+
+ __try
+ {
+ __try
+ {
+ GameLoop();
+ numUnsuccessfulTries = 0;
+ }
+ __except( SGPExceptionFilter(++numUnsuccessfulTries, GetExceptionInformation()) )
+ {
+ }
+ }
+ __finally
+ {
+ LeaveCriticalSection(&gcsGameLoop);
+ }
+
+ // Give it several attempts to recover from random exceptions and to display error screen
+ if (numUnsuccessfulTries > 5)
+ ShutdownWithErrorBox("Unhandled exception. Unable to recover.");
+
+ return true;
+}
+
diff --git a/Standard Gaming Platform/video.cpp b/Standard Gaming Platform/video.cpp
index 95adb585..d9430102 100644
--- a/Standard Gaming Platform/video.cpp
+++ b/Standard Gaming Platform/video.cpp
@@ -1830,7 +1830,7 @@ void RefreshScreen(void *DummyVariable)
}
DirectXAttempt ( ReturnCode, __LINE__, __FILE__ );
- if (ReturnCode == DDERR_SURFACELOST)
+ if (ReturnCode == DDERR_SURFACELOST || ReturnCode == DDERR_SURFACEBUSY)
{
goto ENDOFLOOP;
}
diff --git a/Standard Gaming Platform/vobject.cpp b/Standard Gaming Platform/vobject.cpp
index 1ce9b7a0..fedada09 100644
--- a/Standard Gaming Platform/vobject.cpp
+++ b/Standard Gaming Platform/vobject.cpp
@@ -272,6 +272,7 @@ BOOLEAN GetVideoObject( HVOBJECT *hVObject, UINT32 uiIndex )
}
curr = curr->next;
}
+ *hVObject = NULL;
return FALSE;
}
diff --git a/Strategic/AI Viewer.cpp b/Strategic/AI Viewer.cpp
index c0fe5c23..1a15c9d0 100644
--- a/Strategic/AI Viewer.cpp
+++ b/Strategic/AI Viewer.cpp
@@ -932,7 +932,7 @@ void HandleViewerInput()
{
SECTORINFO *pSector;
InputAtom Event;
- while( DequeueEvent( &Event ) )
+ while( DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP) )
{
if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN )
{
diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp
index fc42692b..d960ea11 100644
--- a/Strategic/Assignments.cpp
+++ b/Strategic/Assignments.cpp
@@ -9587,7 +9587,7 @@ void CreateContractBox( SOLDIERTYPE *pCharacter )
CHAR16 sString[ 50 ];
CHAR16 sDollarString[ 50 ];
- ContractPosition.iX = OrigContractPosition.iX;
+ ContractPosition.iX = (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + OrigContractPosition.iX;
if( giBoxY != 0 )
{
@@ -9847,7 +9847,7 @@ void CreateAssignmentsBox( void )
// will create attribute pop up menu for mapscreen assignments
- AssignmentPosition.iX = OrigAssignmentPosition.iX;
+ AssignmentPosition.iX = (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + OrigAssignmentPosition.iX;
if( giBoxY != 0 )
{
@@ -15536,7 +15536,7 @@ void ResetAllExpensiveFacilityAssignments()
BOOLEAN IsOutstandingFacilityDebtWithErrorReport()
{
CHAR16 sString[256];
- SGPRect pCenteringRect= {0, 0, 640, INV_INTERFACE_START_Y };
+ SGPRect pCenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, INV_INTERFACE_START_Y };
if (giTotalOwedForFacilityOperationsToday && // Owe money
gfOutstandingFacilityDebt ) // Owed money tonight as well
diff --git a/Strategic/Auto Resolve.cpp b/Strategic/Auto Resolve.cpp
index 254f2056..c9bbeeca 100644
--- a/Strategic/Auto Resolve.cpp
+++ b/Strategic/Auto Resolve.cpp
@@ -529,13 +529,13 @@ void DoTransitionFromPreBattleInterfaceToAutoResolve()
iPercentage = 0;
uiStartTime = GetJA2Clock();
- sStartLeft = 59;
+ sStartLeft = 59 + xResOffset;
sStartTop = 69;
sEndLeft = SrcRect.iLeft + gpAR->sWidth / 2;
sEndTop = SrcRect.iTop + gpAR->sHeight / 2;
//save the prebattle/mapscreen interface background
- BlitBufferToBuffer( FRAME_BUFFER, guiEXTRABUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
+ BlitBufferToBuffer( FRAME_BUFFER, guiEXTRABUFFER, 0 + xResOffset, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
//render the autoresolve panel
RenderAutoResolve();
@@ -670,7 +670,7 @@ UINT32 AutoResolveScreenHandle()
SGPRect ClipRect;
gpAR->fEnteringAutoResolve = FALSE;
//Take the framebuffer, shade it, and save it to the SAVEBUFFER.
- ClipRect.iLeft = 0;
+ ClipRect.iLeft = 0 + xResOffset;
ClipRect.iTop = 0;
/*ClipRect.iRight = 640;
ClipRect.iBottom = 480;*/
@@ -681,7 +681,7 @@ UINT32 AutoResolveScreenHandle()
Blt16BPPBufferShadowRect( (UINT16*)pDestBuf, uiDestPitchBYTES, &ClipRect );
UnLockVideoSurface( FRAME_BUFFER );
//BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, 0, 0, 640, 480 );
- BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
+ BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, 0 + xResOffset, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
KillPreBattleInterface();
CalculateAutoResolveInfo();
CalculateSoldierCells( FALSE );
@@ -1369,7 +1369,7 @@ void ExpandWindow()
//The new rect now determines the state of the current rectangle.
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
- SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
+ SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0 + xResOffset, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
RectangleDraw( TRUE, gpAR->ExRect.iLeft, gpAR->ExRect.iTop, gpAR->ExRect.iRight, gpAR->ExRect.iBottom, Get16BPPColor( FROMRGB( 200, 200, 100 ) ), pDestBuf );
UnLockVideoSurface( FRAME_BUFFER );
//left
@@ -2214,7 +2214,7 @@ void CreateAutoResolveInterface()
UINT8 cnt;
//Setup new autoresolve blanket interface.
- MSYS_DefineRegion( &gpAR->AutoResolveRegion, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_HIGH-1, 0,
+ MSYS_DefineRegion( &gpAR->AutoResolveRegion, 0 + xResOffset, 0, SCREEN_WIDTH, SCREEN_HEIGHT, MSYS_PRIORITY_HIGH-1, 0,
MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
gpAR->fRenderAutoResolve = TRUE;
gpAR->fExitAutoResolve = FALSE;
@@ -2286,7 +2286,28 @@ void CreateAutoResolveInterface()
VOBJECT_DESC VObjectDesc;
//Load the face
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+
+ /*
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ gpMercs[ i ].pSoldier->ubProfile ].ubFaceIndex );
+ */
+
+ if ( ( gpMercs[ i ].pSoldier->ubProfile >= 0 ) && ( gpMercs[ i ].pSoldier->ubProfile < 100 ) && ( gProfilesIMP[ gpMercs[ i ].pSoldier->ubProfile ].ProfilId == gpMercs[ i ].pSoldier->ubProfile ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ gpMercs[ i ].pSoldier->ubProfile ].ubFaceIndex );
+ }
+ else if ( ( gpMercs[ i ].pSoldier->ubProfile > 99 ) && ( gProfilesIMP[ gpMercs[ i ].pSoldier->ubProfile ].ProfilId == gpMercs[ i ].pSoldier->ubProfile ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ gpMercs[ i ].pSoldier->ubProfile ].ubFaceIndex );
+ }
+ else if ( ( gpMercs[ i ].pSoldier->ubProfile >= 0 ) && ( gpMercs[ i ].pSoldier->ubProfile < 100 ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ gpMercs[ i ].pSoldier->ubProfile ].ubFaceIndex );
+ }
+ else
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ gpMercs[ i ].pSoldier->ubProfile ].ubFaceIndex );
+ }
+
if( !AddVideoObject( &VObjectDesc, &gpMercs[ i ].uiVObjectID ) )
{
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\speck.sti" );
@@ -2295,6 +2316,8 @@ void CreateAutoResolveInterface()
AssertMsg( 0, String("Failed to load %Faces\\65Face\\%02d.sti or it's placeholder, speck.sti", gMercProfiles[ gpMercs[ i ].pSoldier->ubProfile ].ubFaceIndex) );
}
}
+
+
if( GetVideoObject( &hVObject, gpMercs[ i ].uiVObjectID ) )
{
hVObject->pShades[ 0 ] = Create16BPPPaletteShaded( hVObject->pPaletteEntry, 255, 255, 255, FALSE );
@@ -2433,7 +2456,7 @@ void CreateAutoResolveInterface()
//Build the interface buffer, and blit the "shaded" background. This info won't
//change from now on, but will be used to restore text.
BuildInterfaceBuffer();
- BlitBufferToBuffer( guiSAVEBUFFER, FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
+ BlitBufferToBuffer( guiSAVEBUFFER, FRAME_BUFFER, 0 + xResOffset, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
//If we are bumping up the interface, then also use that piece of info to
//move the buttons up by the same amount.
@@ -3334,7 +3357,7 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Autoresolve3");
InputAtom InputEvent;
BOOLEAN fResetAutoResolve = FALSE;
- while( DequeueEvent( &InputEvent ) )
+ while( DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT) )
{
if( InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT )
{
diff --git a/Strategic/Game Clock.h b/Strategic/Game Clock.h
index 89d63822..55a0fb2d 100644
--- a/Strategic/Game Clock.h
+++ b/Strategic/Game Clock.h
@@ -5,14 +5,15 @@
// where the time string itself is rendered
-#define CLOCK_X (SCREEN_WIDTH - 86) //554
-#define CLOCK_Y (SCREEN_HEIGHT - 21) //459
+#define CLOCK_X (SCREEN_WIDTH - xResSize)/2 + (xResSize - 86)
+#define CLOCK_REGION_START_X (CLOCK_X + 2)
+#define CLOCK_REGION_WIDTH ((xResSize - 20) - CLOCK_REGION_START_X)
+#define CLOCK_Y (SCREEN_HEIGHT - 21)
// the mouse region around the clock (bigger)
-#define CLOCK_REGION_START_X (SCREEN_WIDTH - 88) //552
-#define CLOCK_REGION_START_Y (SCREEN_HEIGHT - 24) //456
-#define CLOCK_REGION_WIDTH ((SCREEN_WIDTH - 20) - CLOCK_REGION_START_X) // ( 620 - CLOCK_REGION_START_X )
-#define CLOCK_REGION_HEIGHT ((SCREEN_HEIGHT - 12) - CLOCK_REGION_START_Y) //( 468 - CLOCK_REGION_START_Y )
+
+#define CLOCK_REGION_START_Y (SCREEN_HEIGHT - 24)
+#define CLOCK_REGION_HEIGHT ((SCREEN_HEIGHT - 12) - CLOCK_REGION_START_Y)
#define NUM_SEC_IN_DAY 86400
#define NUM_SEC_IN_HOUR 3600
diff --git a/Strategic/LuaInitNPCs.cpp b/Strategic/LuaInitNPCs.cpp
index aac56a23..86fa0bdc 100644
--- a/Strategic/LuaInitNPCs.cpp
+++ b/Strategic/LuaInitNPCs.cpp
@@ -3285,23 +3285,23 @@ int i;
static int l_ExecuteTacticalTextBox(lua_State *L)
{
-INT16 sLeftPosition = 110;
-UINT32 idText = 0;
-UINT8 n = lua_gettop(L);
-wchar_t sText[400];
-UINT32 uiStartLoc=0;
-CHAR16 zString[512];
-int i;
+ INT16 sLeftPosition = 110;
+ UINT32 idText = 0;
+ UINT8 n = lua_gettop(L);
+ //wchar_t sText[400];
+ UINT32 uiStartLoc=0;
+ CHAR16 zString[512];
+ int i;
-//#define LANGMESSAGEFILE "BinaryData\\TacticalMessages.EDT"
-//#define EDT_SIZE 400 * 2
+ //#define LANGMESSAGEFILE "BinaryData\\TacticalMessages.EDT"
+ //#define EDT_SIZE 400 * 2
for (i= 1; i<=n; i++ )
- {
- if (i == 1 ) sLeftPosition = lua_tointeger(L,i);
- if (i == 2 ) idText = lua_tointeger(L,i);
-
- }
+ {
+ if (i == 1 ) sLeftPosition = lua_tointeger(L,i);
+ if (i == 2 ) idText = lua_tointeger(L,i);
+
+ }
/*
if ( FileExists(LANGMESSAGEFILE) )
{
@@ -3315,14 +3315,14 @@ int i;
swprintf( zString, L"Empty Text" );
}
*/
- if ( idText >= 0 && idText <= 1000 )
- {
- swprintf( zString, XMLTacticalMessages[idText] );
+ if ( idText >= 0 && idText <= 1000 )
+ {
+ swprintf( zString, XMLTacticalMessages[idText] );
- if ( sLeftPosition <= 0 ) sLeftPosition = 110;
-
- ExecuteTacticalTextBox( sLeftPosition, zString );
- }
+ if ( sLeftPosition <= 0 ) sLeftPosition = 110;
+
+ ExecuteTacticalTextBox( sLeftPosition, zString );
+ }
return 0;
}
diff --git a/Strategic/Map Screen Interface Border.cpp b/Strategic/Map Screen Interface Border.cpp
index 0bebdc80..5b336167 100644
--- a/Strategic/Map Screen Interface Border.cpp
+++ b/Strategic/Map Screen Interface Border.cpp
@@ -157,15 +157,15 @@ BOOLEAN LoadMapBorderGraphics( void )
// will load map border
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- FilenameForBPP( "INTERFACE\\MBS.sti", VObjectDesc.ImageFile );
+ FilenameForBPP( "INTERFACE\\MBS.sti", VObjectDesc.ImageFile );
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
FilenameForBPP( "INTERFACE\\MBS_800x600.sti", VObjectDesc.ImageFile );
}
- else if (iResolution == 2)
+ else
{
FilenameForBPP( "INTERFACE\\MBS_1024x768.sti", VObjectDesc.ImageFile );
}
@@ -220,21 +220,21 @@ void RenderMapBorder( void )
// get and blt border
GetVideoObject(&hHandle, guiMapBorder );
// HEADROCK HAM 4: Load different map border depending on whether we want to display the mobile militia button or not.
+
if (gGameExternalOptions.gfAllowMilitiaGroups)
{
- BltVideoObject( guiSAVEBUFFER , hHandle, 1, MAP_BORDER_X, MAP_BORDER_Y, VO_BLT_SRCTRANSPARENCY,NULL );
+ BltVideoObject( guiSAVEBUFFER , hHandle, 1, xResOffset + MAP_BORDER_X, MAP_BORDER_Y, VO_BLT_SRCTRANSPARENCY,NULL );
}
else
{
- BltVideoObject( guiSAVEBUFFER , hHandle, 0, MAP_BORDER_X, MAP_BORDER_Y, VO_BLT_SRCTRANSPARENCY,NULL );
+ BltVideoObject( guiSAVEBUFFER , hHandle, 0, xResOffset + MAP_BORDER_X, MAP_BORDER_Y, VO_BLT_SRCTRANSPARENCY,NULL );
}
- RestoreExternBackgroundRect( MAP_BORDER_X, MAP_BORDER_Y, SCREEN_WIDTH - MAP_BORDER_X, SCREEN_HEIGHT );
+ RestoreExternBackgroundRect( xResOffset + MAP_BORDER_X, MAP_BORDER_Y, SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset, SCREEN_HEIGHT );
// show the level marker
DisplayCurrentLevelMarker( );
-
return;
}
@@ -297,27 +297,35 @@ void RenderMapBorderEtaPopUp( void )
UINT16 offsetY = 0;
UINT16 offsetBorderY = 0;
- if (iResolution == 0)
+ UINT16 xVal = 215;
+ UINT16 yVal = 291;
+
+ // TODO.RW.ARSP: Check
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- offsetX = 215;
- offsetY = 291;
- offsetBorderY = offsetY + 19;
+ offsetX = xVal + xResOffset;
+ offsetY = yVal + yResOffset;
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
- offsetX = 215 + 80;
- offsetY = 291 + 120;
- offsetBorderY = offsetY + 19;
+ offsetX = xVal + 80; // + xResOffset;
+ offsetY = yVal + 120; // + yResOffset;
}
- else if (iResolution == 2)
+ else
{
- offsetX = 215 + 180;
- offsetY = 291 + 285;
- offsetBorderY = offsetY + 19;
+ offsetX = xVal + 180;// + xResOffset;
+ offsetY = yVal + 285;// + yResOffset;
}
- // TODO.RW: Adjust for 1024x768
- BltVideoObject( FRAME_BUFFER , hHandle, iResolution, MAP_BORDER_X + MAP_BORDER_X_OFFSET + offsetX, MAP_BORDER_Y_OFFSET + offsetY, VO_BLT_SRCTRANSPARENCY,NULL );
+ offsetBorderY = offsetY + 19;
+
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ BltVideoObject( FRAME_BUFFER , hHandle, 0, MAP_BORDER_X + MAP_BORDER_X_OFFSET + offsetX, MAP_BORDER_Y_OFFSET + offsetY, VO_BLT_SRCTRANSPARENCY,NULL );
+ else if (iResolution < _1024x768)
+ BltVideoObject( FRAME_BUFFER , hHandle, 1, MAP_BORDER_X + MAP_BORDER_X_OFFSET + offsetX, MAP_BORDER_Y_OFFSET + offsetY, VO_BLT_SRCTRANSPARENCY,NULL );
+ else
+ BltVideoObject( FRAME_BUFFER , hHandle, 2, MAP_BORDER_X + MAP_BORDER_X_OFFSET + offsetX, MAP_BORDER_Y_OFFSET + offsetY, VO_BLT_SRCTRANSPARENCY,NULL );
+
InvalidateRegion( MAP_BORDER_X + MAP_BORDER_X_OFFSET + offsetX, MAP_BORDER_Y_OFFSET + offsetY, MAP_BORDER_X + MAP_BORDER_X_OFFSET + offsetX + 100 , MAP_BORDER_Y_OFFSET + offsetBorderY);
return;
@@ -1940,36 +1948,36 @@ void InitMapBorderButtonCoordinates()
{
UINT32 buttonOffset = 155; // 160
- MAP_BORDER_TOWN_BTN_X = MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 - 152);
- MAP_BORDER_TOWN_BTN_Y = (SCREEN_HEIGHT - buttonOffset);
- MAP_BORDER_MINE_BTN_X = MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 - 109);
- MAP_BORDER_MINE_BTN_Y = (SCREEN_HEIGHT - buttonOffset);
- MAP_BORDER_TEAMS_BTN_X = MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 - 66);
- MAP_BORDER_TEAMS_BTN_Y = (SCREEN_HEIGHT - buttonOffset);
- MAP_BORDER_AIRSPACE_BTN_X = MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 + 20);
- MAP_BORDER_AIRSPACE_BTN_Y = (SCREEN_HEIGHT - buttonOffset);
- MAP_BORDER_ITEM_BTN_X = MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 + 63);
- MAP_BORDER_ITEM_BTN_Y = (SCREEN_HEIGHT - buttonOffset);
- MAP_BORDER_MILITIA_BTN_X = MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 - 23);
- MAP_BORDER_MILITIA_BTN_Y = (SCREEN_HEIGHT - buttonOffset);
- MAP_BORDER_MOBILE_BTN_X = 0;
- MAP_BORDER_MOBILE_BTN_Y = 0;
+ MAP_BORDER_TOWN_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) - 152;
+ MAP_BORDER_TOWN_BTN_Y = (yResSize - buttonOffset);
+ MAP_BORDER_MINE_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) - 109;
+ MAP_BORDER_MINE_BTN_Y = (yResSize - buttonOffset);
+ MAP_BORDER_TEAMS_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) - 66;
+ MAP_BORDER_TEAMS_BTN_Y = (yResSize - buttonOffset);
+ MAP_BORDER_AIRSPACE_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 20;
+ MAP_BORDER_AIRSPACE_BTN_Y = (yResSize - buttonOffset);
+ MAP_BORDER_ITEM_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 63;
+ MAP_BORDER_ITEM_BTN_Y = (yResSize - buttonOffset);
+ MAP_BORDER_MILITIA_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) - 23;
+ MAP_BORDER_MILITIA_BTN_Y = (yResSize - buttonOffset);
+ MAP_BORDER_MOBILE_BTN_X = xResSize;
+ MAP_BORDER_MOBILE_BTN_Y = 0;
- MAP_LEVEL_MARKER_X = (MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 + 114));
- MAP_LEVEL_MARKER_Y = (SCREEN_HEIGHT - buttonOffset); //(SCREEN_HEIGHT - 157) //323
- MAP_LEVEL_MARKER_DELTA = 8;
- MAP_LEVEL_MARKER_WIDTH = 55; //( (SCREEN_WIDTH - 20) - MAP_LEVEL_MARKER_X )
+ MAP_LEVEL_MARKER_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 114;
+ MAP_LEVEL_MARKER_Y = (yResSize - buttonOffset);
+ MAP_LEVEL_MARKER_DELTA = 8;
+ MAP_LEVEL_MARKER_WIDTH = 55;
if (gGameExternalOptions.gfAllowMilitiaGroups)
{
// Mobile button appears next to Militia button.
- MAP_BORDER_MOBILE_BTN_X = MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 + 16);
- MAP_BORDER_MOBILE_BTN_Y = (SCREEN_HEIGHT - buttonOffset);
+ MAP_BORDER_MOBILE_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 16;
+ MAP_BORDER_MOBILE_BTN_Y = (yResSize - buttonOffset);
// Airspace, Items, ZLevel buttons all moved to the right (+22px, +22px, +10px).
- MAP_BORDER_AIRSPACE_BTN_X = MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 + 42);
- MAP_BORDER_ITEM_BTN_X = MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 + 85);
+ MAP_BORDER_AIRSPACE_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 42;
+ MAP_BORDER_ITEM_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 85;
- MAP_LEVEL_MARKER_X = (MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X) / 2 + 124));
+ MAP_LEVEL_MARKER_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 124;
}
}
diff --git a/Strategic/Map Screen Interface Bottom.cpp b/Strategic/Map Screen Interface Bottom.cpp
index 6d6bfdb6..18d4f0b0 100644
--- a/Strategic/Map Screen Interface Bottom.cpp
+++ b/Strategic/Map Screen Interface Bottom.cpp
@@ -239,15 +239,15 @@ void HandleLoadOfMapBottomGraphics( void )
// will create buttons for interface bottom
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
FilenameForBPP( "INTERFACE\\map_screen_bottom.sti", VObjectDesc.ImageFile );
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
FilenameForBPP( "INTERFACE\\map_screen_bottom_800x600.sti", VObjectDesc.ImageFile );
}
- else if (iResolution == 2)
+ else
{
FilenameForBPP( "INTERFACE\\map_screen_bottom_1024x768.sti", VObjectDesc.ImageFile );
}
@@ -315,8 +315,9 @@ void RenderMapScreenInterfaceBottom( BOOLEAN fForceMapscreenFullRender )
{
// get and blt panel
GetVideoObject(&hHandle, guiMAPBOTTOMPANEL );
- BltVideoObject( guiSAVEBUFFER , hHandle, 0, MAP_BOTTOM_X, MAP_BOTTOM_Y, VO_BLT_SRCTRANSPARENCY,NULL );
+ BltVideoObject( guiSAVEBUFFER , hHandle, 0, xResOffset + MAP_BOTTOM_X, MAP_BOTTOM_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
|| is_networked)
@@ -337,8 +338,8 @@ void RenderMapScreenInterfaceBottom( BOOLEAN fForceMapscreenFullRender )
// dirty buttons
MarkButtonsDirty( );
- // invalidate region
- RestoreExternBackgroundRect( MAP_BOTTOM_X, MAP_BOTTOM_Y, SCREEN_WIDTH - MAP_BOTTOM_X, SCREEN_HEIGHT - MAP_BOTTOM_Y );
+ // 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 );
// re render radar map
RenderRadarScreen( );
@@ -387,20 +388,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 ], (SCREEN_WIDTH - 184), (SCREEN_HEIGHT - 70),
+ guiMapBottomExitButtons[ MAP_EXIT_TO_LAPTOP ] = QuickCreateButton( guiMapBottomExitButtonsImage[ MAP_EXIT_TO_LAPTOP ], xResOffset + (xResSize - 184), (SCREEN_HEIGHT - 70),
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 ], (SCREEN_WIDTH - 144), (SCREEN_HEIGHT - 70),
+ 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);
// 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 ], (SCREEN_WIDTH - 182), (SCREEN_HEIGHT - 108),
+ guiMapBottomExitButtons[ MAP_EXIT_TO_OPTIONS ] = QuickCreateButton( guiMapBottomExitButtonsImage[ MAP_EXIT_TO_OPTIONS ], xResOffset + (xResSize - 182), (SCREEN_HEIGHT - 108),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnOptionsFromMapScreenCallback);
@@ -416,12 +417,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 ], (SCREEN_WIDTH - 112), (SCREEN_HEIGHT - 24),
+ guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_MORE ] = QuickCreateButton( guiMapBottomTimeButtonsImage[ MAP_TIME_COMPRESS_MORE ], xResOffset + (xResSize - 112), (SCREEN_HEIGHT - 24),
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 ], (SCREEN_WIDTH - 174), (SCREEN_HEIGHT - 24),
+ guiMapBottomTimeButtons[ MAP_TIME_COMPRESS_LESS ] = QuickCreateButton( guiMapBottomTimeButtonsImage[ MAP_TIME_COMPRESS_LESS ], xResOffset + (xResSize - 174), (SCREEN_HEIGHT - 24),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 2,
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnTimeCompressLessMapScreenCallback);
@@ -436,21 +437,12 @@ BOOLEAN CreateButtonsForMapScreenInterfaceBottom( void )
// scroll buttons
// CHRISL: Changed coordinates to dynamically place scroll buttons from the right edge of screen.
guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_UP ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,11,4,-1,6,-1 );
-// guiMapMessageScrollButtons[ MAP_SCROLL_MESSAGE_UP ] = QuickCreateButton( guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_UP ], (SCREEN_WIDTH - 533), (SCREEN_HEIGHT - 109),
-// BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
-// (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnMessageUpMapScreenCallback);
-
guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_DOWN ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,12,5,-1,7,-1 );
-// guiMapMessageScrollButtons[ MAP_SCROLL_MESSAGE_DOWN ] = QuickCreateButton( guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_DOWN ], (SCREEN_WIDTH - 533), (SCREEN_HEIGHT - 28),
-// BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
-// (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnMessageDownMapScreenCallback);
-// CHRISL: Use these if we want buttons based on left edge of screen
-// HEADROCK HAM 3.6: Message window is now as wide as possible.
-
- guiMapMessageScrollButtons[ MAP_SCROLL_MESSAGE_UP ] = QuickCreateButton( guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_UP ], (SCREEN_WIDTH - 306), (SCREEN_HEIGHT - 109),
+
+ guiMapMessageScrollButtons[ MAP_SCROLL_MESSAGE_UP ] = QuickCreateButton( guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_UP ], xResOffset + (xResSize - 306), (SCREEN_HEIGHT - 109),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnMessageUpMapScreenCallback);
- guiMapMessageScrollButtons[ MAP_SCROLL_MESSAGE_DOWN ] = QuickCreateButton( guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_DOWN ], (SCREEN_WIDTH - 306), (SCREEN_HEIGHT - 28),
+ guiMapMessageScrollButtons[ MAP_SCROLL_MESSAGE_DOWN ] = QuickCreateButton( guiMapMessageScrollButtonsImage[ MAP_SCROLL_MESSAGE_DOWN ], xResOffset + (xResSize - 306), (SCREEN_HEIGHT - 28),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 1,
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)BtnMessageDownMapScreenCallback);
@@ -459,8 +451,6 @@ BOOLEAN CreateButtonsForMapScreenInterfaceBottom( void )
SetButtonCursor(guiMapMessageScrollButtons[ 0 ], MSYS_NO_CURSOR );
SetButtonCursor(guiMapMessageScrollButtons[ 1 ], MSYS_NO_CURSOR );
-
-
return( TRUE );
}
@@ -636,8 +626,8 @@ void DrawNameOfLoadedSector( void )
GetSectorIDString( sSelMapX, sSelMapY, ( INT8 )( iCurrentMapSectorZ ),sString, TRUE );
ReduceStringLength( sString, 80, COMPFONT );
- //VarFindFontCenterCoordinates( 548, 426, 80, 16, COMPFONT, &sFontX, &sFontY, sString );
- VarFindFontCenterCoordinates( (SCREEN_WIDTH - 92), (SCREEN_HEIGHT - 55), 80, 16, COMPFONT, &sFontX, &sFontY, sString );
+ VarFindFontCenterCoordinates( xResOffset + (xResSize - 92), (SCREEN_HEIGHT - 55), 80, 16, COMPFONT, &sFontX, &sFontY, sString );
+
mprintf( sFontX, sFontY, L"%s", sString );
}
@@ -980,10 +970,9 @@ void DisplayCompressMode( void )
}
}
- //RestoreExternBackgroundRect( 489, 456, 522 - 489, 467 - 454 );
- RestoreExternBackgroundRect( (SCREEN_WIDTH - 151), (SCREEN_HEIGHT - 24), 63, 13 );
-
- SetFontDestBuffer( FRAME_BUFFER, 0,0,SCREEN_WIDTH,SCREEN_HEIGHT, FALSE );
+ // ABCDEFG
+ RestoreExternBackgroundRect( xResOffset + (xResSize - 151), (SCREEN_HEIGHT - 24), 63, 13 );
+ SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
SetFont( COMPFONT );
if( GetJA2Clock() - guiCompressionStringBaseTime >= PAUSE_GAME_TIMER )
@@ -1008,21 +997,17 @@ void DisplayCompressMode( void )
SetFontForeground( usColor );
SetFontBackground( FONT_BLACK );
- //FindFontCenterCoordinates( 489, 456, 522 - 489, 467 - 454, sString, COMPFONT, &sX, &sY );
- FindFontCenterCoordinates( (SCREEN_WIDTH - 151), (SCREEN_HEIGHT - 24), 33, 13, sString, COMPFONT, &sX, &sY );
+ FindFontCenterCoordinates( xResOffset + (xResSize - 151), (SCREEN_HEIGHT - 24), 33, 13, sString, COMPFONT, &sX, &sY );
+
mprintf( sX, sY, sString );
-
return;
}
void CreateCompressModePause( void )
{
- /*MSYS_DefineRegion( &gMapPauseRegion, 487, 456, 522, 467, MSYS_PRIORITY_HIGH,
- MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressModeClickCallback );*/
-
- MSYS_DefineRegion( &gMapPauseRegion, (SCREEN_WIDTH - 153), (SCREEN_HEIGHT - 24), (SCREEN_WIDTH - 118), (SCREEN_HEIGHT - 13), MSYS_PRIORITY_HIGH,
+ MSYS_DefineRegion( &gMapPauseRegion, xResOffset + (xResSize - 153), (SCREEN_HEIGHT - 24), xResOffset + (xResSize - 118), (SCREEN_HEIGHT - 13), MSYS_PRIORITY_HIGH,
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressModeClickCallback );
SetRegionFastHelpText( &gMapPauseRegion, pMapScreenBottomFastHelp[ 7 ] );
@@ -1462,11 +1447,11 @@ void DisplayCurrentBalanceTitleForMapBottom( void )
// center it
// CHRISL: Replaced X coordinate with dynamic coordinate set from right edge of screen
- //VarFindFontCenterCoordinates( (SCREEN_WIDTH - 637), (SCREEN_HEIGHT - 107), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
+ //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( (SCREEN_WIDTH - 278), (SCREEN_HEIGHT - 111), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
+ VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 111), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
// print it
mprintf( sFontX, sFontY, L"%s", sString );
@@ -1475,11 +1460,11 @@ void DisplayCurrentBalanceTitleForMapBottom( void )
// center it
// CHRISL: Replaced X coordinate with dynamic coordinate set from right edge of screen
- //VarFindFontCenterCoordinates( (SCREEN_WIDTH - 637), (SCREEN_HEIGHT - 61), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
+ //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( (SCREEN_WIDTH - 278), (SCREEN_HEIGHT - 74), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
+ VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 74), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
// print it
mprintf( sFontX, sFontY, L"%s", sString );
@@ -1488,13 +1473,14 @@ void DisplayCurrentBalanceTitleForMapBottom( void )
// HEADROCK HAM 3.6: Projected expenses for today, with facilities (and in the future, merc contracts) taken into
// account.
- VarFindFontCenterCoordinates( (SCREEN_WIDTH - 278), (SCREEN_HEIGHT - 37), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
+ VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 37), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
// print it
mprintf( sFontX, sFontY, L"%s", sString );
// ste the font buffer
SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
+
return;
}
@@ -1515,17 +1501,10 @@ void DisplayCurrentBalanceForMapBottom( void )
swprintf( sString, L"%d", LaptopSaveInfo.iCurrentBalance );
// insert
-
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
- // center it
- // CHRISL: Replaced X coordinate with dynamic coordinate set from right edge of screen
- //VarFindFontCenterCoordinates( (SCREEN_WIDTH - 637), (SCREEN_HEIGHT - 91), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
- // CHRISL: Use this if we want to display from the left edge
- //VarFindFontCenterCoordinates( 359, (SCREEN_HEIGHT - 91), 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( (SCREEN_WIDTH - 278), (SCREEN_HEIGHT - 95), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
+ VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 95), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
// print it
mprintf( sFontX, sFontY, L"%s", sString );
@@ -1553,29 +1532,16 @@ void CreateDestroyMouseRegionMasksForTimeCompressionButtons( void )
// check if disabled and not created, create
if( ( fDisabled ) && ( fCreated == FALSE ) )
{
-
// mask over compress more button
- //MSYS_DefineRegion( &gTimeCompressionMask[ 0 ], 528, 456, 528 + 13, 456 + 14, MSYS_PRIORITY_HIGHEST - 1,
- // MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback );
-
- //// mask over compress less button
- //MSYS_DefineRegion( &gTimeCompressionMask[ 1 ], 466, 456, 466 + 13, 456 + 14, MSYS_PRIORITY_HIGHEST - 1,
- // MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback );
-
- //// mask over pause game button
- //MSYS_DefineRegion( &gTimeCompressionMask[ 2 ], 487, 456, 522, 467, MSYS_PRIORITY_HIGHEST - 1,
- // MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback );
-
- // mask over compress more button
- MSYS_DefineRegion( &gTimeCompressionMask[ 0 ], (SCREEN_WIDTH - 112), (SCREEN_HEIGHT - 24), (SCREEN_WIDTH - 112) + 13, (SCREEN_HEIGHT - 24) + 14, MSYS_PRIORITY_HIGHEST - 1,
+ MSYS_DefineRegion( &gTimeCompressionMask[ 0 ], xResOffset + (xResSize - 112), (SCREEN_HEIGHT - 24), xResOffset + (xResSize - 112) + 13, (SCREEN_HEIGHT - 24) + 14, MSYS_PRIORITY_HIGHEST - 1,
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback );
// mask over compress less button
- MSYS_DefineRegion( &gTimeCompressionMask[ 1 ], (SCREEN_WIDTH - 174), (SCREEN_HEIGHT - 24), (SCREEN_WIDTH - 174) + 13, (SCREEN_HEIGHT - 24) + 14, MSYS_PRIORITY_HIGHEST - 1,
+ MSYS_DefineRegion( &gTimeCompressionMask[ 1 ], xResOffset + (xResSize - 174), (SCREEN_HEIGHT - 24), xResOffset + (xResSize - 174) + 13, (SCREEN_HEIGHT - 24) + 14, MSYS_PRIORITY_HIGHEST - 1,
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, CompressMaskClickCallback );
// mask over pause game button
- MSYS_DefineRegion( &gTimeCompressionMask[ 2 ], (SCREEN_WIDTH - 153), (SCREEN_HEIGHT - 24), (SCREEN_WIDTH - 118), (SCREEN_HEIGHT - 13), MSYS_PRIORITY_HIGHEST - 1,
+ 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 );
fCreated = TRUE;
@@ -1635,14 +1601,8 @@ void DisplayProjectedDailyMineIncome( void )
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
- // center it
- // CHRISL: Replaced X coordinate with dynamic coordinate set from right edge of screen
- //VarFindFontCenterCoordinates( (SCREEN_WIDTH - 637), (SCREEN_HEIGHT - 45), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
- // CHRISL: Use this if we want to display from the left edge
- //VarFindFontCenterCoordinates( 359, (SCREEN_HEIGHT - 45), 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( (SCREEN_WIDTH - 278), (SCREEN_HEIGHT - 58), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
-
+ VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 58), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
+
// print it
mprintf( sFontX, sFontY, L"%s", sString );
@@ -1692,8 +1652,7 @@ void DisplayProjectedDailyExpenses( void )
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
- // center it
- VarFindFontCenterCoordinates( (SCREEN_WIDTH - 278), (SCREEN_HEIGHT - 21), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
+ VarFindFontCenterCoordinates( xResOffset + (xResSize - 278), (SCREEN_HEIGHT - 21), 78, 10, COMPFONT, &sFontX, &sFontY, sString );
// print it
mprintf( sFontX, sFontY, L"%s", sString );
@@ -2080,7 +2039,7 @@ void ChangeCurrentMapscreenMessageIndex( UINT8 ubNewMessageIndex )
void InitMapScreenInterfaceBottomCoords( void )
{
// HEADROCK HAM 3.6: Message window is now as wide as possible.
- MESSAGE_SCROLL_AREA_START_X = SCREEN_WIDTH - 307;
- MESSAGE_SCROLL_AREA_END_X = SCREEN_WIDTH - 293;
+ MESSAGE_SCROLL_AREA_START_X = xResOffset + xResSize - 307;
+ MESSAGE_SCROLL_AREA_END_X = xResOffset + xResSize - 293;
}
diff --git a/Strategic/Map Screen Interface Map Inventory.cpp b/Strategic/Map Screen Interface Map Inventory.cpp
index 2b43d5fa..623fb043 100644
--- a/Strategic/Map Screen Interface Map Inventory.cpp
+++ b/Strategic/Map Screen Interface Map Inventory.cpp
@@ -53,32 +53,32 @@ INT32 iCurrentInventoryPoolPageQ[INVPOOLLISTNUM]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
INT32 iLastInventoryPoolPageQ[INVPOOLLISTNUM]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
extern BOOLEAN SaveWorldItemsToTempItemFile( INT16 sMapX, INT16 sMapY, INT8 bMapZ, UINT32 uiNumberOfItems, WORLDITEM* pData );
-#define MAP_INV_X_OFFSET (((SCREEN_WIDTH - 261) - 380) / 2)
-//#define MAP_INV_Y_OFFSET (((SCREEN_HEIGHT - 121) -
+
+#define MAP_INV_X_OFFSET (((SCREEN_WIDTH - 261) - 380) / 2)
// status bar colors
#define DESC_STATUS_BAR FROMRGB( 201, 172, 133 )
#define DESC_STATUS_BAR_SHADOW FROMRGB( 140, 136, 119 )
// page display positions
-#define MAP_INVENTORY_POOL_PAGE_X (MAP_INV_X_OFFSET + 506)
-#define MAP_INVENTORY_POOL_PAGE_Y (SCREEN_HEIGHT - 121 - 23) //336
-#define MAP_INVENTORY_POOL_PAGE_WIDTH 46
-#define MAP_INVENTORY_POOL_PAGE_HEIGHT 13
+#define MAP_INVENTORY_POOL_PAGE_X (MAP_INV_X_OFFSET + 506)
+#define MAP_INVENTORY_POOL_PAGE_Y (SCREEN_HEIGHT - 121 - 23) //336
+#define MAP_INVENTORY_POOL_PAGE_WIDTH 46
+#define MAP_INVENTORY_POOL_PAGE_HEIGHT 13
// the number of items
-#define MAP_INVENTORY_POOL_NUMBER_X (MAP_INV_X_OFFSET + 436)
-#define MAP_INVENTORY_POOL_NUMBER_WIDTH 40
+#define MAP_INVENTORY_POOL_NUMBER_X (MAP_INV_X_OFFSET + 436)
+#define MAP_INVENTORY_POOL_NUMBER_WIDTH 40
// location
-#define MAP_INVENTORY_POOL_LOC_X MAP_INV_X_OFFSET + 326
-#define MAP_INVENTORY_POOL_LOC_WIDTH 40
+#define MAP_INVENTORY_POOL_LOC_X (MAP_INV_X_OFFSET + 326)
+#define MAP_INVENTORY_POOL_LOC_WIDTH 40
// delay for flash of item
-#define DELAY_FOR_HIGHLIGHT_ITEM_FLASH 200
+#define DELAY_FOR_HIGHLIGHT_ITEM_FLASH 200
// inventory slot font
-#define MAP_IVEN_FONT SMALLCOMPFONT
+#define MAP_IVEN_FONT SMALLCOMPFONT
// the position of the background graphic
#define INVEN_POOL_X 261
@@ -236,27 +236,27 @@ BOOLEAN LoadInventoryPoolGraphic( void )
// load the file
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
MAP_INV_SLOT_COLS = 8;
MAP_INVENTORY_POOL_SLOT_COUNT = 40;
MAP_INVENTORY_POOL_SLOT_START_X = 269;
- MAP_INVENTORY_POOL_SLOT_START_Y = 51;
+ MAP_INVENTORY_POOL_SLOT_START_Y = 51;
sprintf( VObjectDesc.ImageFile, "INTERFACE\\sector_inventory.sti" );
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
MAP_INV_SLOT_COLS = 11;
MAP_INVENTORY_POOL_SLOT_COUNT = 77;
- MAP_INVENTORY_POOL_SLOT_START_X = 278;
- MAP_INVENTORY_POOL_SLOT_START_Y = 62;
+ MAP_INVENTORY_POOL_SLOT_START_X = (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + 278;
+ MAP_INVENTORY_POOL_SLOT_START_Y = 62;
sprintf( VObjectDesc.ImageFile, "INTERFACE\\sector_inventory_800x600.sti" );
}
- else if (iResolution == 2)
+ else
{
MAP_INV_SLOT_COLS = 17;
MAP_INVENTORY_POOL_SLOT_COUNT = MAP_INVENTORY_POOL_MAX_SLOTS;
- MAP_INVENTORY_POOL_SLOT_START_X = 282;
+ MAP_INVENTORY_POOL_SLOT_START_X = (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + 282;
MAP_INVENTORY_POOL_SLOT_START_Y = 50;
sprintf( VObjectDesc.ImageFile, "INTERFACE\\sector_inventory_1024x768.sti" );
}
@@ -289,7 +289,7 @@ void BlitInventoryPoolGraphic( void )
// blit inventory pool graphic to the screen
GetVideoObject(&hHandle, guiMapInventoryPoolBackground);
- BltVideoObject( guiSAVEBUFFER , hHandle, 0,INVEN_POOL_X, INVEN_POOL_Y , VO_BLT_SRCTRANSPARENCY,NULL );
+ BltVideoObject( guiSAVEBUFFER , hHandle, 0,(SCREEN_WIDTH - INTERFACE_WIDTH)/2 + INVEN_POOL_X, INVEN_POOL_Y , VO_BLT_SRCTRANSPARENCY,NULL );
// resize list
ResizeInventoryList( );
@@ -319,7 +319,7 @@ void BlitInventoryPoolGraphic( void )
HandleButtonStatesWhileMapInventoryActive( );
// Invalidate
- RestoreExternBackgroundRect(MAP_BORDER_X, MAP_BORDER_Y, SCREEN_WIDTH - MAP_BORDER_X, SCREEN_HEIGHT - 121);
+ RestoreExternBackgroundRect(xResOffset + MAP_BORDER_X, MAP_BORDER_Y, SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset, SCREEN_HEIGHT - 121 - 2 * yResOffset);
return;
}
@@ -891,7 +891,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
}
else if(fValidPointer)
{
- InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, 0, INV_REGION_Y, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) );
+ InitSectorStackPopup( MercPtrs[gCharactersList[bSelectedInfoChar].usSolID], twItem, iCounter, (SCREEN_WIDTH - INTERFACE_WIDTH)/2, -10, 261, ( SCREEN_HEIGHT - PLAYER_INFO_Y ) );
fTeamPanelDirty=TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
}
@@ -1108,15 +1108,15 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
void CreateMapInventoryButtons( void )
{
guiMapInvenButtonImage[ 0 ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" , 10, 1, -1, 3, -1 );
- guiMapInvenButton[ 0 ] = QuickCreateButton( guiMapInvenButtonImage[ 0 ], (MAP_INV_X_OFFSET + 559), (SCREEN_HEIGHT - 144),
- BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
- (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)MapInventoryPoolNextBtn );
+ guiMapInvenButton[ 0 ] = QuickCreateButton( guiMapInvenButtonImage[ 0 ], (MAP_INV_X_OFFSET + 559), (SCREEN_HEIGHT - 144 - 2 * yResOffset),
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
+ (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)MapInventoryPoolNextBtn );
guiMapInvenButtonImage[ 1 ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,9, 0, -1, 2, -1 );
- guiMapInvenButton[ 1 ] = QuickCreateButton( guiMapInvenButtonImage[ 1 ], (MAP_INV_X_OFFSET + 487), (SCREEN_HEIGHT - 144),
- BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
- (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)MapInventoryPoolPrevBtn );
+ guiMapInvenButton[ 1 ] = QuickCreateButton( guiMapInvenButtonImage[ 1 ], (MAP_INV_X_OFFSET + 487), (SCREEN_HEIGHT - 144 - 2 * yResOffset),
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
+ (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)MapInventoryPoolPrevBtn );
// set up fast help text
SetButtonFastHelpText( guiMapInvenButton[ 0 ], pMapScreenInvenButtonHelpText[ 0 ] );
@@ -1745,13 +1745,11 @@ 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 ,MAP_INVENTORY_POOL_PAGE_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
+ FindFontCenterCoordinates(MAP_INVENTORY_POOL_PAGE_X, MAP_INVENTORY_POOL_PAGE_Y - 2 * yResOffset, MAP_INVENTORY_POOL_PAGE_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
mprintf( sX, sY, sString );
SetFontDestBuffer( FRAME_BUFFER, 0,0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
-
-
}
INT32 GetTotalNumberOfItemsInSectorStash( void )
@@ -1809,13 +1807,12 @@ 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 ,MAP_INVENTORY_POOL_NUMBER_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
+ FindFontCenterCoordinates(MAP_INVENTORY_POOL_NUMBER_X, MAP_INVENTORY_POOL_PAGE_Y - 2 * yResOffset, MAP_INVENTORY_POOL_NUMBER_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
mprintf( sX, sY, sString );
SetFontDestBuffer( FRAME_BUFFER, 0,0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
-
return;
}
@@ -1824,9 +1821,10 @@ void CreateMapInventoryPoolDoneButton( void )
{
// create done button
guiMapInvenButtonImage[ 2 ]= LoadButtonImage( "INTERFACE\\done_button.sti" , -1, 0, -1, 1, -1 );
- guiMapInvenButton[ 2 ] = QuickCreateButton( guiMapInvenButtonImage[ 2 ], MAP_INV_X_OFFSET + 587 , (SCREEN_HEIGHT - 147),
- BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
- (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)MapInventoryPoolDoneBtn );
+
+ guiMapInvenButton[ 2 ] = QuickCreateButton( guiMapInvenButtonImage[ 2 ], MAP_INV_X_OFFSET + 587 , (yResSize - 147),
+ BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST,
+ (GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)MapInventoryPoolDoneBtn );
// set up fast help text
SetButtonFastHelpText( guiMapInvenButton[ 2 ], pMapScreenInvenButtonHelpText[ 2 ] );
@@ -1852,7 +1850,6 @@ void DisplayCurrentSector( void )
CHAR16 sString[ 32 ];
INT16 sX, sY;
-
swprintf( sString, L"%s%s%s", pMapVertIndex[ sSelMapY ], pMapHortIndex[ sSelMapX ], pMapDepthIndex[ iCurrentMapSectorZ ] );
// set font stuff
@@ -1864,7 +1861,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 ,MAP_INVENTORY_POOL_LOC_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
+ FindFontCenterCoordinates(MAP_INVENTORY_POOL_LOC_X, MAP_INVENTORY_POOL_PAGE_Y - 2 * yResOffset, MAP_INVENTORY_POOL_LOC_WIDTH ,MAP_INVENTORY_POOL_PAGE_HEIGHT ,sString , MAP_SCREEN_FONT, &sX, &sY);
mprintf( sX, sY, sString );
@@ -1912,7 +1909,6 @@ void ResizeInventoryList( void )
void DrawTextOnMapInventoryBackground( void )
{
-// CHAR16 sString[ 64 ];
UINT16 usStringHeight;
SetFont( MAP_IVEN_FONT );
@@ -1922,21 +1918,13 @@ void DrawTextOnMapInventoryBackground( void )
// set the buffer
SetFontDestBuffer( guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
- ////Calculate the height of the string, as it needs to be vertically centered.
- //usStringHeight = DisplayWrappedString( 268, 342, 53, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 0 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED | DONT_DISPLAY_TEXT );
- //DisplayWrappedString( 268, (UINT16)(342 - (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( 369, 342, 65, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 1 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED | DONT_DISPLAY_TEXT );
- //DisplayWrappedString( 369, (UINT16)(342 - (usStringHeight / 2) ), 65, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 1 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED );
+ //Calculate the height of the string, as it needs to be vertically centered.
+ usStringHeight = DisplayWrappedString(MAP_INV_X_OFFSET + 268, (SCREEN_HEIGHT - 138 - 2 * 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 - 2 * yResOffset) - (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 + 268, (SCREEN_HEIGHT - 138), 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) - (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), 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) - (usStringHeight / 2) ), 65, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 1 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED );
+ usStringHeight = DisplayWrappedString( MAP_INV_X_OFFSET + 369, (SCREEN_HEIGHT - 138 - 2 * 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 - 2 * yResOffset) - (usStringHeight / 2) ), 65, 1, MAP_IVEN_FONT, FONT_BEIGE, pMapInventoryStrings[ 1 ], FONT_BLACK, FALSE, RIGHT_JUSTIFIED );
DrawTextOnSectorInventory( );
@@ -1999,10 +1987,7 @@ void DrawTextOnSectorInventory( void )
swprintf(sString, L"Inventory Pool %c", gInventoryPoolIndex);
SetFontDestBuffer( guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
-
- //FindFontCenterCoordinates( MAP_INV_X_OFFSET + MAP_INVENTORY_POOL_SLOT_START_X, MAP_INVENTORY_POOL_SLOT_START_Y - 20, 630 - MAP_INVENTORY_POOL_SLOT_START_X, GetFontHeight( FONT14ARIAL ), sString, FONT14ARIAL, &sX, &sY );
-
- FindFontCenterCoordinates( 271, 18, SCREEN_WIDTH - 271, GetFontHeight( FONT14ARIAL ), sString, FONT14ARIAL, &sX, &sY );
+ FindFontCenterCoordinates( (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + 271, 18, xResSize - 271, GetFontHeight( FONT14ARIAL ), sString, FONT14ARIAL, &sX, &sY );
SetFont( FONT14ARIAL );
SetFontForeground( FONT_WHITE );
@@ -2011,7 +1996,6 @@ void DrawTextOnSectorInventory( void )
mprintf( sX, sY, sString );
SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
-
}
@@ -2375,22 +2359,14 @@ BOOLEAN LoadInventoryPoolQ (UINT8 ubSaveGameID)
if(MAP_INVENTORY_POOL_SLOT_COUNT <= 0)
{
- switch(iResolution)
- {
- case 0:
+ if (iResolution >= _640x480 && iResolution < _800x600)
MAP_INVENTORY_POOL_SLOT_COUNT = 40;
- break;
- case 1:
+ else if (iResolution < _1024x768)
MAP_INVENTORY_POOL_SLOT_COUNT = 77;
- break;
- case 2:
- MAP_INVENTORY_POOL_SLOT_COUNT = 170;//MAP_INVENTORY_POOL_MAX_SLOTS;
- break;
- default:
- Assert(0);
- break;
- }
+ else
+ MAP_INVENTORY_POOL_SLOT_COUNT = 170;
}
+
ret = FALSE;
CreateSavedGameFileNameFromNumber(ubSaveGameID, tmpbuf);
strcat(tmpbuf, ".IPQ");
@@ -2454,21 +2430,14 @@ BOOLEAN SaveInventoryPoolQ(UINT8 ubSaveGameID)
if(MAP_INVENTORY_POOL_SLOT_COUNT <= 0)
{
- switch(iResolution)
- {
- case 0:
+ if (iResolution >= _640x480 && iResolution < _800x600)
MAP_INVENTORY_POOL_SLOT_COUNT = 40;
- break;
- case 1:
+ else if (iResolution < _1024x768)
MAP_INVENTORY_POOL_SLOT_COUNT = 77;
- case 2:
- MAP_INVENTORY_POOL_SLOT_COUNT = 170;//MAP_INVENTORY_POOL_MAX_SLOTS;
- break;
- default:
- Assert(0);
- break;
- }
+ else
+ MAP_INVENTORY_POOL_SLOT_COUNT = 170;
}
+
ret = FALSE;
CreateSavedGameFileNameFromNumber(ubSaveGameID, tmpbuf);
strcat(tmpbuf, ".IPQ");
diff --git a/Strategic/Map Screen Interface Map.cpp b/Strategic/Map Screen Interface Map.cpp
index 5bea60e8..16c105e9 100644
--- a/Strategic/Map Screen Interface Map.cpp
+++ b/Strategic/Map Screen Interface Map.cpp
@@ -632,23 +632,6 @@ void DrawIconL(INT32 MAP_GRID_X2, INT32 MAP_GRID_Y2, INT32 i, INT32 Sector_X , I
sX = (UINT16) (MAP_VIEW_START_X + MAP_GRID_X + (MAP_GRID_X2 * MAP_GRID_X) / 10);
sY = (UINT16) (MAP_VIEW_START_Y + MAP_GRID_Y + ((MAP_GRID_Y2 * MAP_GRID_Y) / 10) + 1);
- /*
- if (iResolution == 0)
- {
- sY += MAP_GRID_Y2;
- sX += MAP_GRID_X2;
- }
- else if (iResolution == 1)
- {
- sY += + 5 + MAP_GRID_Y2;
- sX += - MAP_GRID_X2 + 3;
- }
- else if (iResolution == 2)
- {
- sY += + 10 + MAP_GRID_Y2;
- sX += - MAP_GRID_X2 + 10;
- }
- */
ubVidObjIndex = 1;
}
@@ -1414,17 +1397,17 @@ void ShowUncertainNumberEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
UINT8 iconOffsetX = 0;
UINT8 iconOffsetY = 0;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
iconOffsetX = 2;
- iconOffsetY = 1;
+ iconOffsetY = 9;
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
iconOffsetX = 8;
iconOffsetY = 12;
}
- else if (iResolution == 2)
+ else
{
iconOffsetX = 12;
iconOffsetY = 13;
@@ -2043,21 +2026,23 @@ BOOLEAN ShadeMapElemZoomIn(INT16 sMapX, INT16 sMapY, INT32 iColor )
void InitializeMilitiaPopup(void)
{
- // WANNE.MAP.TODO:
- if (iResolution == 0)
+ UINT16 xVal = 400;
+ UINT16 yVal = 125;
+
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- MAP_MILITIA_BOX_POS_X = 400;
- MAP_MILITIA_BOX_POS_Y = 125;
+ MAP_MILITIA_BOX_POS_X = xVal;
+ MAP_MILITIA_BOX_POS_Y = yVal;
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
- MAP_MILITIA_BOX_POS_X = 400 + 77;
- MAP_MILITIA_BOX_POS_Y = 125 + 116;
+ MAP_MILITIA_BOX_POS_X = xVal + 77;
+ MAP_MILITIA_BOX_POS_Y = yVal + 116;
}
- else if (iResolution == 2)
+ else
{
- MAP_MILITIA_BOX_POS_X = 400 + 190;
- MAP_MILITIA_BOX_POS_Y = 125 + 285;
+ MAP_MILITIA_BOX_POS_X = xVal + 190;
+ MAP_MILITIA_BOX_POS_Y = yVal + 285;
}
}
@@ -2072,14 +2057,14 @@ BOOLEAN InitializePalettesForMap( void )
// load image
vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
strcpy(vs_desc.ImageFile, "INTERFACE\\b_map.pcx");
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
strcpy(vs_desc.ImageFile, "INTERFACE\\b_map_800x600.pcx");
- else if (iResolution == 2)
+ else
strcpy(vs_desc.ImageFile, "INTERFACE\\b_map_1024x768.pcx");
- CHECKF(AddVideoSurface(&vs_desc, &uiTempMap));
+ CHECKF(AddVideoSurface(&vs_desc, &uiTempMap));
// get video surface
CHECKF( GetVideoSurface( &hSrcVSurface, uiTempMap) );
@@ -4485,17 +4470,17 @@ void ShowPeopleInMotion( INT16 sX, INT16 sY )
UINT8 iconOffsetX = 0;
UINT8 iconOffsetY = 0;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
iconOffsetX = 2;
iconOffsetY = 1;
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
iconOffsetX = 3;
iconOffsetY = 2;
}
- else if (iResolution == 2)
+ else
{
iconOffsetX = 4;
iconOffsetY = 3;
@@ -4755,9 +4740,17 @@ void DisplayDistancesForHelicopter( void )
sOldYPosition = sYPosition;
// blit in background
+ UINT8 imageIndex = 0;
GetVideoObject( &hHandle, guiMapBorderHeliSectors );
- BltVideoObject( FRAME_BUFFER, hHandle, iResolution, MAP_HELICOPTER_ETA_POPUP_X, sYPosition, VO_BLT_SRCTRANSPARENCY, NULL );
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ imageIndex = 0;
+ else if (iResolution < _1024x768)
+ imageIndex = 1;
+ else
+ imageIndex = 2;
+
+ BltVideoObject( FRAME_BUFFER, hHandle, imageIndex, MAP_HELICOPTER_ETA_POPUP_X, sYPosition, VO_BLT_SRCTRANSPARENCY, NULL );
// sTotalCanTravel = ( INT16 )GetTotalDistanceHelicopterCanTravel( );
sDistanceToGo = ( INT16 )DistanceOfIntendedHelicopterPath( );
@@ -4944,7 +4937,7 @@ void DisplayPositionOfHelicopter( void )
GetVideoObject( &hHandle, guiHelicopterIcon );
- if (iResolution > 0)
+ if (iResolution >= _800x600)
{
x = x + (MAP_GRID_X / 2) - 10;
y = y + 1 + (MAP_GRID_Y / 2) - 10;
@@ -5014,7 +5007,7 @@ void DisplayDestinationOfHelicopter( void )
GetVideoObject( &hHandle, guiHelicopterIcon );
BltVideoObject( FRAME_BUFFER, hHandle, HELI_SHADOW_ICON, x, y, VO_BLT_SRCTRANSPARENCY, NULL );
- if (iResolution > 0)
+ if (iResolution >= _800x600)
{
x = x + (MAP_GRID_X / 2) - 10;
y = y + 1 + (MAP_GRID_Y / 2) - 10;
@@ -5456,9 +5449,7 @@ void DisplayLevelString( void )
return;
}
- // otherwise we will have to display the string with the level number
-
- 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, 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 );
SetFont( MAP_FONT );
SetFontForeground( MAP_INDEX_COLOR );
@@ -5596,11 +5587,11 @@ BOOLEAN LoadMilitiaPopUpBox( void )
// load the militia pop up box
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\Militia.sti", VObjectDesc.ImageFile);
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
FilenameForBPP("INTERFACE\\Militia_800x600.sti", VObjectDesc.ImageFile);
- else if (iResolution == 2)
+ else
FilenameForBPP("INTERFACE\\Militia_1024x768.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiMilitia));
@@ -5994,11 +5985,11 @@ void CreateDestroyMilitiaSectorButtons( void )
sY += ( iCounter * ( MILITIA_BTN_HEIGHT ) + 2 );
// set the button image
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
giMapMilitiaButtonImage[ iCounter ]= LoadButtonImage( "INTERFACE\\militia.sti", -1,3,-1,4,-1 );
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
giMapMilitiaButtonImage[ iCounter ]= LoadButtonImage( "INTERFACE\\militia_800x600.sti", -1,3,-1,4,-1 );
- else if (iResolution == 2)
+ else
giMapMilitiaButtonImage[ iCounter ]= LoadButtonImage( "INTERFACE\\militia_1024x768.sti", -1,3,-1,4,-1 );
// set the button value
@@ -6462,17 +6453,17 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Map Screen4");
void CreateMilitiaPanelBottomButton( void )
{
// set the button image
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
giMapMilitiaButtonImage[ 3 ]= LoadButtonImage( "INTERFACE\\militia.sti" ,-1,1,-1,2,-1 );
giMapMilitiaButtonImage[ 4 ]= LoadButtonImage( "INTERFACE\\militia.sti" ,-1,1,-1,2,-1 );
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
giMapMilitiaButtonImage[ 3 ]= LoadButtonImage( "INTERFACE\\militia_800x600.sti" ,-1,1,-1,2,-1 );
giMapMilitiaButtonImage[ 4 ]= LoadButtonImage( "INTERFACE\\militia_800x600.sti" ,-1,1,-1,2,-1 );
}
- else if (iResolution == 2)
+ else
{
giMapMilitiaButtonImage[ 3 ]= LoadButtonImage( "INTERFACE\\militia_1024x768.sti" ,-1,1,-1,2,-1 );
giMapMilitiaButtonImage[ 4 ]= LoadButtonImage( "INTERFACE\\militia_1024x768.sti" ,-1,1,-1,2,-1 );
@@ -6874,24 +6865,30 @@ void HandleLowerLevelMapBlit( void )
return;
}
- if (iResolution == 0)
+ UINT8 xVal = 21;
+ UINT8 yVal = 17;
+ UINT8 imageIndex = 0;
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- offsetX = 21;
- offsetY = 17;
+ offsetX = xVal;
+ offsetY = yVal;
+ imageIndex = 0;
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
- offsetX = 21 + 8;
- offsetY = 17 + 7;
+ offsetX = xVal + 8;
+ offsetY = yVal + 7;
+ imageIndex = 1;
}
- else if (iResolution == 2)
+ else
{
- offsetX = 21 + 21;
- offsetY = 17 + 17;
+ offsetX = xVal + 21;
+ offsetY = yVal + 17;
+ imageIndex = 2;
}
// handle the blt of the sublevel
- BltVideoObject( guiSAVEBUFFER, hHandle, iResolution, MAP_VIEW_START_X + offsetX, MAP_VIEW_START_Y + offsetY, VO_BLT_SRCTRANSPARENCY, NULL );
+ BltVideoObject( guiSAVEBUFFER, hHandle, imageIndex, MAP_VIEW_START_X + offsetX, MAP_VIEW_START_Y + offsetY, VO_BLT_SRCTRANSPARENCY, NULL );
// handle shading of sublevels
ShadeSubLevelsNotVisited( );
@@ -7480,30 +7477,23 @@ void DrawMapBoxIcon( HVOBJECT hIconHandle, UINT16 usVOIndex, INT16 sMapX, INT16
INT32 iX, iY;
- UINT8 iconOffsetX = 0;
- UINT8 iconOffsetY = 0;
+ UINT8 iconOffsetX = 2;
+ UINT8 iconOffsetY = 1;
UINT8 iconSize = 0;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- iconOffsetX = 2;
- iconOffsetY = 1;
iconSize = 3;
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
- iconOffsetX = 2;
- iconOffsetY = 1;
iconSize = 4;
}
- else if (iResolution == 2)
+ else
{
- iconOffsetX = 2;
- iconOffsetY = 1;
iconSize = 6;
}
-
// don't show any more icons than will fit into one sector, to keep them from spilling into sector(s) beneath
if ( ubIconPosition >= ( MERC_ICONS_PER_LINE * ROWS_PER_SECTOR ) )
{
@@ -7625,7 +7615,7 @@ void DrawBullseye()
// draw the bullseye in that sector
GetVideoObject( &hHandle, guiBULLSEYE);
- if (iResolution > 0)
+ if (iResolution >= _800x600)
{
sX = sX + MAP_GRID_X / 2 - 10;
sY = sY + 1 + MAP_GRID_Y / 2 - 10;
diff --git a/Strategic/Map Screen Interface.cpp b/Strategic/Map Screen Interface.cpp
index 3fc6d3eb..b2fa2c98 100644
--- a/Strategic/Map Screen Interface.cpp
+++ b/Strategic/Map Screen Interface.cpp
@@ -76,8 +76,6 @@ extern UINT8 maxNumberOfMercVisibleInStrategyList = 0; // WANNE: Max merc displa
// number of LINKED LISTS for sets of leave items (each slot holds an unlimited # of items)
#define NUM_LEAVE_LIST_SLOTS CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS
-#define SELECTED_CHAR_ARROW_X 1 //8
-
#define SIZE_OF_UPDATE_BOX 20
// as deep as the map goes
@@ -849,7 +847,7 @@ INT16 GetRefreshHeightForMercList( void )
INT16 yHeight = ( INT16 )( ( ( giMAXIMUM_NUMBER_OF_PLAYER_SLOTS + 1 ) * ( Y_SIZE + 2 ) ) + 1 );
// WANNE: Get maximum refresh height depending on the resolution!
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
if (!is_networked)
{
@@ -861,9 +859,8 @@ INT16 GetRefreshHeightForMercList( void )
if (yHeight > 131)
yHeight = 131;
}
-
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
if (!is_networked)
{
@@ -876,7 +873,7 @@ INT16 GetRefreshHeightForMercList( void )
yHeight = 249;
}
}
- else if (iResolution == 2)
+ else
{
if (!is_networked)
{
@@ -927,7 +924,7 @@ void RestoreBackgroundForAssignmentGlowRegionList( void )
INT16 yHeight = GetRefreshHeightForMercList();
// restore background
- RestoreExternBackgroundRect( 66, Y_START - 1, 118 + 1 - 67, yHeight );
+ RestoreExternBackgroundRect( 66 + xResOffset, Y_START - 1, 118 + 1 - 67, yHeight );
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
fTeamPanelDirty = TRUE;
@@ -957,7 +954,7 @@ void RestoreBackgroundForDestinationGlowRegionList( void )
INT16 yHeight = GetRefreshHeightForMercList();
// restore background
- RestoreExternBackgroundRect( 182, Y_START - 1, 217 + 1 - 182, yHeight );
+ RestoreExternBackgroundRect( 182 + xResOffset, Y_START - 1, 217 + 1 - 182, yHeight );
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
fTeamPanelDirty = TRUE;
@@ -987,7 +984,7 @@ void RestoreBackgroundForContractGlowRegionList( void )
INT16 yHeight = GetRefreshHeightForMercList();
// restore background
- RestoreExternBackgroundRect( 222, Y_START - 1, 250 + 1 - 222, yHeight ) ;
+ RestoreExternBackgroundRect( 222 + xResOffset, Y_START - 1, 250 + 1 - 222, yHeight ) ;
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
fTeamPanelDirty = TRUE;
@@ -1021,7 +1018,7 @@ void RestoreBackgroundForSleepGlowRegionList( void )
INT16 yHeight = GetRefreshHeightForMercList();
// restore background
- RestoreExternBackgroundRect( 123, Y_START - 1, 142 + 1 - 123, yHeight ) ;
+ RestoreExternBackgroundRect( 123 + xResOffset, Y_START - 1, 142 + 1 - 123, yHeight ) ;
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
fTeamPanelDirty = TRUE;
@@ -1279,7 +1276,7 @@ INT32 DoMapMessageBoxWithRect( UINT8 ubStyle, const STR16 zString, UINT32 uiExit
INT32 DoMapMessageBox( UINT8 ubStyle, STR16 zString, UINT32 uiExitScreen, UINT16 usFlags, MSGBOX_CALLBACK ReturnCallback )
{
- SGPRect CenteringRect= {0, 0, SCREEN_WIDTH, INV_INTERFACE_START_Y };
+ SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, INV_INTERFACE_START_Y };
// reset the highlighted line
giHighLine = -1;
@@ -1411,6 +1408,8 @@ void HandleDisplayOfSelectedMercArrows( void )
HVOBJECT hHandle;
UINT8 ubCount = 0;
+ UINT16 selectedCharArrowX = xResOffset + 1;
+
// blit an arrow by the name of each merc in a selected list
if( bSelectedInfoChar == -1 )
{
@@ -1438,7 +1437,7 @@ void HandleDisplayOfSelectedMercArrows( void )
sYPosition = Y_START+( ( bSelectedInfoChar - FIRSTmercTOdisplay ) * ( Y_SIZE + 2 ) ) - 1;
GetVideoObject( &hHandle, guiSelectedCharArrow );
- BltVideoObject( guiSAVEBUFFER , hHandle, 0,SELECTED_CHAR_ARROW_X, sYPosition , VO_BLT_SRCTRANSPARENCY,NULL );
+ BltVideoObject( guiSAVEBUFFER , hHandle, 0,selectedCharArrowX, sYPosition , VO_BLT_SRCTRANSPARENCY,NULL );
// now run through the selected list of guys, an arrow for each
@@ -1454,7 +1453,7 @@ void HandleDisplayOfSelectedMercArrows( void )
sYPosition = Y_START+( ubCount * ( Y_SIZE + 2) ) - 1;
GetVideoObject( &hHandle, guiSelectedCharArrow );
- BltVideoObject( guiSAVEBUFFER , hHandle, 0,SELECTED_CHAR_ARROW_X, sYPosition , VO_BLT_SRCTRANSPARENCY,NULL );
+ BltVideoObject( guiSAVEBUFFER , hHandle, 0,selectedCharArrowX, sYPosition , VO_BLT_SRCTRANSPARENCY,NULL );
}
}
}
@@ -1915,177 +1914,17 @@ void SetUpMercAboutToLeaveEquipment( UINT32 ubProfileId, UINT32 uiSlotIndex )
}
-
-/*
-BOOLEAN RemoveItemFromLeaveIndex( MERC_LEAVE_ITEM *pItem, UINT32 uiSlotIndex )
-{
- MERC_LEAVE_ITEM *pCurrentItem = NULL;
-
- Assert( uiSlotIndex < NUM_LEAVE_LIST_SLOTS );
-
- if( pItem == NULL )
- {
- return( FALSE );
- }
-
- // item is head of list?
-//ARM: THIS DOESN'T MAKE SENSE, pCurrentItem is always NULL at this stage!
- if( pItem == pCurrentItem )
- {
- gpLeaveListHead[ uiSlotIndex ] = pCurrentItem->pNext;
- MemFree( pItem );
- pItem = NULL;
- return( TRUE );
- }
-
- // in the body
- while( ( pCurrentItem->pNext != pItem ) && ( pCurrentItem->pNext != NULL ) )
- {
- pCurrentItem = pCurrentItem->pNext;
- }
-
- // item not found
- if( pCurrentItem->pNext == NULL )
- {
- return( FALSE );
- }
-
- // set to next after next
- pCurrentItem->pNext = pCurrentItem->pNext->pNext;
-
- // free space and null ptr
- MemFree( pItem );
- pItem = NULL;
-
- return( TRUE );
-}
-*/
-
-
-
void HandleGroupAboutToArrive( void )
{
// reblit map to change the color of the "people in motion" marker
fMapPanelDirty = TRUE;
- // ARM - commented out - don't see why this is needed
-// fTeamPanelDirty = TRUE;
-// fCharacterInfoPanelDirty = TRUE;
-
return;
}
-
-/*
-void HandleMapScreenUpArrow( void )
-{
- INT32 iValue = 0;
- INT32 iHighLine = 0;
-
- // check state and update
- if( fShowAssignmentMenu == TRUE )
- {
- if( GetBoxShadeFlag( ghAssignmentBox, iValue ) == FALSE )
- {
- if( iHighLine == 0)
- {
- iHighLine = ( INT32 )GetNumberOfLinesOfTextInBox( ghAssignmentBox );
- }
- else
- {
- iHighLine++;
- }
- }
- }
- else
- {
- if( ( giHighLine == 0 ) || ( giHighLine == -1 ) )
- {
- giHighLine = GetNumberOfCharactersOnPlayersTeam( ) - 1;
- fTeamPanelDirty = TRUE;
- }
- else
- {
- giHighLine--;
- fTeamPanelDirty = TRUE;
- }
-
- }
-}
-
-
-void HandleMapScreenDownArrow( void )
-{
- INT32 iValue = 0;
- INT32 iHighLine = 0;
-
- // check state and update
- if( fShowContractMenu == TRUE )
- {
- if( iHighLine == ( INT32 )GetNumberOfLinesOfTextInBox( ghContractBox ) - 1 )
- {
- iHighLine = 0;
- }
- else
- {
- iHighLine++;
- }
-
- HighLightBoxLine( ghContractBox, iHighLine );
- }
- else if( fShowAssignmentMenu == TRUE )
- {
- if( GetBoxShadeFlag( ghAssignmentBox, iValue ) == FALSE )
- {
- if( iHighLine == ( INT32 )GetNumberOfLinesOfTextInBox( ghAssignmentBox ) - 1 )
- {
- iHighLine = 0;
- }
- else
- {
- iHighLine--;
- }
- }
- }
- else
- {
- if( ( giHighLine == GetNumberOfCharactersOnPlayersTeam( ) - 1 ) || ( giHighLine == -1 ) )
- {
- giHighLine = 0;
- fTeamPanelDirty = TRUE;
- }
- else
- {
- giHighLine++;
- fTeamPanelDirty = TRUE;
- }
-
- }
-}
-
-
-INT32 GetNumberOfCharactersOnPlayersTeam( void )
-{
- INT32 iNumberOfPeople = 0, iCounter = 0;
-
- for(iCounter = 0; iCounter < CODE_MAXIMUM_NUMBER_OF_PLAYER_SLOTS; iCounter++ )
- {
- if( gCharactersList[ iCounter ].fValid == TRUE )
- {
- iNumberOfPeople++;
- }
- }
-
- return( iNumberOfPeople );
-}
-*/
-
-
void CreateMapStatusBarsRegion( void )
{
-
- // create the status region over the bSelectedCharacter info region, to get quick rundown of merc's status
- MSYS_DefineRegion( &gMapStatusBarsRegion, BAR_INFO_X - 3, BAR_INFO_Y - 42,(INT16)( BAR_INFO_X + 17), (INT16)(BAR_INFO_Y ), MSYS_PRIORITY_HIGH + 5,
+ MSYS_DefineRegion( &gMapStatusBarsRegion, BAR_INFO_X + xResOffset - 3, BAR_INFO_Y - 42,(INT16)( BAR_INFO_X + xResOffset + 17), (INT16)(BAR_INFO_Y ), MSYS_PRIORITY_HIGH + 5,
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
return;
@@ -2094,7 +1933,6 @@ void CreateMapStatusBarsRegion( void )
void RemoveMapStatusBarsRegion( void )
{
-
// remove the bSelectedInfoCharacter helath, breath and morale bars info region
MSYS_RemoveRegion( &gMapStatusBarsRegion );
@@ -2107,7 +1945,6 @@ void UpdateCharRegionHelpText( void )
CHAR16 pMoraleStr[ 128 ];
SOLDIERTYPE *pSoldier = NULL;
-
if( ( bSelectedInfoChar != -1 ) && ( gCharactersList[ bSelectedInfoChar ].fValid == TRUE ) )
{
// valid soldier selected
@@ -4965,7 +4802,28 @@ void AddSoldierToUpdateBox( SOLDIERTYPE *pSoldier )
{
// add to box
pUpdateSoldierBox[ iCounter ] = pSoldier;
-
+
+
+
+ if ( ( gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ pSoldier->ubProfile ].ProfilId == pSoldier->ubProfile ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
+ }
+ else if ( ( gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ pSoldier->ubProfile ].ProfilId == pSoldier->ubProfile ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
+ }
+ else if( gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex < 100 )
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
+ }
+ else if( gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex > 99 )
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
+ }
+
+
+/*
if( gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex < 100 )
{
// grab filename of face
@@ -4976,7 +4834,7 @@ void AddSoldierToUpdateBox( SOLDIERTYPE *pSoldier )
// grab filename of face
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
}
-
+*/
// load the face
AddVideoObject( &VObjectDesc, (UINT32 *)&giUpdateSoldierFaces[ iCounter ] );
@@ -5672,14 +5530,14 @@ void CreateDestroyInsuranceMouseRegionForMercs( BOOLEAN fCreate )
if( ( fCreated == FALSE ) && ( fCreate == TRUE ) )
{
- MSYS_DefineRegion( &gContractIconRegion, CHAR_ICON_X, CHAR_ICON_CONTRACT_Y, CHAR_ICON_X + CHAR_ICON_WIDTH, CHAR_ICON_CONTRACT_Y + CHAR_ICON_HEIGHT,
+ MSYS_DefineRegion( &gContractIconRegion, CHAR_ICON_X + xResOffset, CHAR_ICON_CONTRACT_Y, CHAR_ICON_X + xResOffset + CHAR_ICON_WIDTH, CHAR_ICON_CONTRACT_Y + CHAR_ICON_HEIGHT,
MSYS_PRIORITY_HIGH - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
- MSYS_DefineRegion( &gInsuranceIconRegion, CHAR_ICON_X, CHAR_ICON_CONTRACT_Y + CHAR_ICON_SPACING, CHAR_ICON_X + CHAR_ICON_WIDTH, CHAR_ICON_CONTRACT_Y + CHAR_ICON_SPACING + CHAR_ICON_HEIGHT,
+ MSYS_DefineRegion( &gInsuranceIconRegion, CHAR_ICON_X + xResOffset, CHAR_ICON_CONTRACT_Y + CHAR_ICON_SPACING, CHAR_ICON_X + xResOffset + CHAR_ICON_WIDTH, CHAR_ICON_CONTRACT_Y + CHAR_ICON_SPACING + CHAR_ICON_HEIGHT,
MSYS_PRIORITY_HIGH - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
- MSYS_DefineRegion( &gDepositIconRegion, CHAR_ICON_X, CHAR_ICON_CONTRACT_Y + ( 2 * CHAR_ICON_SPACING ), CHAR_ICON_X + CHAR_ICON_WIDTH, CHAR_ICON_CONTRACT_Y + ( 2 * CHAR_ICON_SPACING ) + CHAR_ICON_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 ), CHAR_ICON_X + xResOffset + CHAR_ICON_WIDTH, CHAR_ICON_CONTRACT_Y + ( 2 * CHAR_ICON_SPACING ) + CHAR_ICON_HEIGHT,
+ MSYS_PRIORITY_HIGH - 1, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
fCreated = TRUE;
}
@@ -5692,57 +5550,6 @@ void CreateDestroyInsuranceMouseRegionForMercs( BOOLEAN fCreate )
}
}
-
-/*
-void HandlePlayerEnteringMapScreenBeforeGoingToTactical( void )
-{
- CHAR16 sString[ 256 ];
-
- if( !( AnyMercsHired( ) ) )
- {
- // no mercs hired inform player they must hire mercs
- swprintf( sString, pMapScreenJustStartedHelpText[ 0 ] );
- DoMapMessageBox( MSG_BOX_BASIC_STYLE, sString, MAP_SCREEN, MSG_BOX_FLAG_OK, DoneHandlePlayerFirstEntryToMapScreen );
-
- }
- else
- {
- // player has mercs hired, tell them to time compress to get things underway
- swprintf( sString, pMapScreenJustStartedHelpText[ 1 ] );
- fShowMapScreenHelpText = TRUE;
- }
-
-
-
- // now inform the player
-
- if( fShowMapScreenHelpText )
- {
- fShowMapScreenHelpText = FALSE;
- SetUpShutDownMapScreenHelpTextScreenMask( );
- fShowMapScreenHelpText = TRUE;
- }
-
- return;
-}
-
-
-void DoneHandlePlayerFirstEntryToMapScreen( UINT8 bExitValue )
-{
- static BOOLEAN fFirstTime = TRUE;
-
- if( bExitValue == MSG_BOX_RETURN_OK )
- {
- if( fFirstTime == TRUE )
- {
- fFirstTime = FALSE;
- fShowMapScreenHelpText = TRUE;
- }
- }
-}
-*/
-
-
BOOLEAN HandleTimeCompressWithTeamJackedInAndGearedToGo( void )
{
// check a team is ready to go
diff --git a/Strategic/Merc Contract.cpp b/Strategic/Merc Contract.cpp
index a4309e35..226036d8 100644
--- a/Strategic/Merc Contract.cpp
+++ b/Strategic/Merc Contract.cpp
@@ -1103,7 +1103,7 @@ void NotifyPlayerOfMercDepartureAndPromptEquipmentPlacement( SOLDIERTYPE *pSoldi
CHAR16 zShortTownIDString[ 50 ];
// use YES/NO Pop up box, settup for particular screen
- SGPRect pCenteringRect= {0, 0, 640, 480};
+ SGPRect pCenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT};
//GetSectorIDString( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ, zTownIDString, TRUE );
diff --git a/Strategic/PreBattle Interface.cpp b/Strategic/PreBattle Interface.cpp
index 5bb76f57..9db1d2e8 100644
--- a/Strategic/PreBattle Interface.cpp
+++ b/Strategic/PreBattle Interface.cpp
@@ -80,6 +80,8 @@ BOOLEAN gfEnterAutoResolveMode = FALSE;
BOOLEAN gfEnteringMapScreenToEnterPreBattleInterface = FALSE;
BOOLEAN gfIgnoreAllInput = TRUE;
+BOOLEAN gfZoomDone = FALSE;
+
enum //GraphicIDs for the panel
{
MAINPANEL,
@@ -441,7 +443,7 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
}
//Define the blanket region to cover all of the other regions used underneath the panel.
- MSYS_DefineRegion( &PBInterfaceBlanket, 0, 0, 261, 359, MSYS_PRIORITY_HIGHEST - 5, 0, 0, 0 );
+ MSYS_DefineRegion( &PBInterfaceBlanket, 0 + xResOffset, 0, 261 + xResOffset, 359, MSYS_PRIORITY_HIGHEST - 5, 0, 0, 0 );
//Create the panel
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
@@ -455,9 +457,9 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
AssertMsg( 0, "Failed to load interface\\PreBattleButton.sti" );
iPBButtonImage[1] = UseLoadedButtonImage( iPBButtonImage[ 0 ], -1, 0, -1, 1, -1 );
iPBButtonImage[2] = UseLoadedButtonImage( iPBButtonImage[ 0 ], -1, 0, -1, 1, -1 );
- iPBButton[0] = QuickCreateButton( iPBButtonImage[0], 27, 54, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGHEST - 2, DEFAULT_MOVE_CALLBACK, AutoResolveBattleCallback );
- iPBButton[1] = QuickCreateButton( iPBButtonImage[1], 98, 54, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGHEST - 2, DEFAULT_MOVE_CALLBACK, GoToSectorCallback );
- iPBButton[2] = QuickCreateButton( iPBButtonImage[2], 169, 54, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGHEST - 2, DEFAULT_MOVE_CALLBACK, RetreatMercsCallback );
+ iPBButton[0] = QuickCreateButton( iPBButtonImage[0], 27 + xResOffset, 54, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGHEST - 2, DEFAULT_MOVE_CALLBACK, AutoResolveBattleCallback );
+ iPBButton[1] = QuickCreateButton( iPBButtonImage[1], 98 + xResOffset, 54, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGHEST - 2, DEFAULT_MOVE_CALLBACK, GoToSectorCallback );
+ iPBButton[2] = QuickCreateButton( iPBButtonImage[2], 169 + xResOffset, 54, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGHEST - 2, DEFAULT_MOVE_CALLBACK, RetreatMercsCallback );
SpecifyGeneralButtonTextAttributes( iPBButton[0], gpStrategicString[ STR_PB_AUTORESOLVE_BTN ], BLOCKFONT, FONT_BEIGE, 141 );
SpecifyGeneralButtonTextAttributes( iPBButton[1], gpStrategicString[ STR_PB_GOTOSECTOR_BTN ], BLOCKFONT, FONT_BEIGE, 141 );
@@ -874,6 +876,8 @@ void InitPreBattleInterface( GROUP *pBattleGroup, BOOLEAN fPersistantPBI )
void DoTransitionFromMapscreenToPreBattleInterface()
{
+ gfZoomDone = FALSE;
+
SGPRect DstRect, PBIRect;
UINT32 uiStartTime, uiCurrTime;
INT32 iPercentage, iFactor;
@@ -887,9 +891,9 @@ void DoTransitionFromMapscreenToPreBattleInterface()
PauseTime( FALSE );
- PBIRect.iLeft = 0;
+ PBIRect.iLeft = 0 + xResOffset;
PBIRect.iTop = 0;
- PBIRect.iRight = 261;
+ PBIRect.iRight = 261 + xResOffset;
PBIRect.iBottom = 359;
iWidth = 261;
iHeight = 359;
@@ -901,7 +905,7 @@ void DoTransitionFromMapscreenToPreBattleInterface()
GetScreenXYFromMapXY( gubPBSectorX, gubPBSectorY, &sStartLeft, &sStartTop );
sStartLeft += MAP_GRID_X / 2;
sStartTop += MAP_GRID_Y / 2;
- sEndLeft = 131;
+ sEndLeft = 131 + xResOffset;
sEndTop = 180;
//save the mapscreen buffer
@@ -924,13 +928,13 @@ void DoTransitionFromMapscreenToPreBattleInterface()
gfEnterAutoResolveMode = TRUE;
}
- BlitBufferToBuffer( guiSAVEBUFFER, FRAME_BUFFER, 27, 54, 209, 32 );
+ BlitBufferToBuffer( guiSAVEBUFFER, FRAME_BUFFER, 27 + xResOffset, 54, 209, 32 );
RenderButtons();
- BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, 27, 54, 209, 32 );
+ BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, 27 + xResOffset, 54, 209, 32 );
gfRenderPBInterface = TRUE;
//hide the prebattle interface
- BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, 0, 0, 261, 359 );
+ BlitBufferToBuffer( guiEXTRABUFFER, FRAME_BUFFER, 0 + xResOffset, 0, 261 + xResOffset, 359 );
PlayJA2SampleFromFile( "SOUNDS\\Laptop power up (8-11).wav", RATE_11025, HIGHVOLUME, 1, MIDDLEPAN );
InvalidateScreen();
RefreshScreen( NULL );
@@ -970,6 +974,8 @@ void DoTransitionFromMapscreenToPreBattleInterface()
(UINT16)(DstRect.iRight-DstRect.iLeft+1), (UINT16)(DstRect.iBottom-DstRect.iTop+1) );
}
BlitBufferToBuffer( FRAME_BUFFER, guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
+
+ gfZoomDone = TRUE;
}
void KillPreBattleInterface()
@@ -1011,7 +1017,7 @@ void KillPreBattleInterface()
//Enable the options button when the auto resolve screen comes up
EnableDisAbleMapScreenOptionsButton( TRUE );
- ColorFillVideoSurfaceArea( guiSAVEBUFFER, 0, 0, 261, 359, 0 );
+ ColorFillVideoSurfaceArea( guiSAVEBUFFER, 0, 0, 261 + xResOffset, 359, 0 );
EnableTeamInfoPanels();
if( ButtonList[ giMapContractButton ] )
@@ -1084,8 +1090,8 @@ void RenderPBHeader( INT32 *piX, INT32 *piWidth)
}
width = StringPixLength( str, FONT10ARIALBOLD );
x = 130 - width / 2;
- mprintf( x, 4, str );
- InvalidateRegion( 0, 0, 231, 12 );
+ mprintf( x + xResOffset, 4, str );
+ InvalidateRegion( 0, 0, 231 + xResOffset, 12 );
*piX = x;
*piWidth = width;
}
@@ -1102,6 +1108,9 @@ void RenderPreBattleInterface()
UINT8 ubJunk;
//PLAYERGROUP *pPlayer;
+ // Make the background black!
+ //ColorFillVideoSurfaceArea( guiSAVEBUFFER, 0, 0, 261 + xResOffset, SCREEN_HEIGHT - 120, 0 );
+
//This code determines if the cursor is inside the rectangle consisting of the
//retreat button. If it is inside, then we set up the variables so that the retreat
//arrows get drawn in the mapscreen.
@@ -1141,22 +1150,22 @@ void RenderPreBattleInterface()
gfRenderPBInterface = FALSE;
GetVideoObject( &hVObject, uiInterfaceImages );
//main panel
- BltVideoObject( guiSAVEBUFFER, hVObject, MAINPANEL, 0, 0, VO_BLT_SRCTRANSPARENCY, NULL );
+ BltVideoObject( guiSAVEBUFFER, hVObject, MAINPANEL, xResOffset, 0, VO_BLT_SRCTRANSPARENCY, NULL );
//main title
RenderPBHeader( &x, &width );
//now draw the title bars up to the text.
for( i = x - 12; i > 20; i -= 10 )
{
- BltVideoObject( guiSAVEBUFFER, hVObject, TITLE_BAR_PIECE, i, 6, VO_BLT_SRCTRANSPARENCY, NULL );
+ BltVideoObject( guiSAVEBUFFER, hVObject, TITLE_BAR_PIECE, i + xResOffset, 6, VO_BLT_SRCTRANSPARENCY, NULL );
}
for( i = x + width + 2; i < 231; i += 10 )
{
- BltVideoObject( guiSAVEBUFFER, hVObject, TITLE_BAR_PIECE, i, 6, VO_BLT_SRCTRANSPARENCY, NULL );
+ BltVideoObject( guiSAVEBUFFER, hVObject, TITLE_BAR_PIECE, i + xResOffset, 6, VO_BLT_SRCTRANSPARENCY, NULL );
}
y = BOTTOM_Y - ACTUAL_HEIGHT - ROW_HEIGHT * max( guiNumUninvolved, 1 );
- BltVideoObject( guiSAVEBUFFER, hVObject, UNINVOLVED_HEADER, 8, y, VO_BLT_SRCTRANSPARENCY, NULL );
+ BltVideoObject( guiSAVEBUFFER, hVObject, UNINVOLVED_HEADER, 8 + xResOffset, y, VO_BLT_SRCTRANSPARENCY, NULL );
SetFont( BLOCKFONT );
SetFontForeground( FONT_BEIGE );
@@ -1167,7 +1176,7 @@ void RenderPreBattleInterface()
SetFont( BLOCKFONTNARROW );
width = StringPixLength( str, BLOCKFONTNARROW );
}
- mprintf( 65 - width , 17, str );
+ mprintf( 65 - width + xResOffset , 17, str );
SetFont( BLOCKFONT );
if( gubEnemyEncounterCode != CREATURE_ATTACK_CODE )
@@ -1188,7 +1197,7 @@ void RenderPreBattleInterface()
SetFont( BLOCKFONTNARROW );
width = StringPixLength( str, BLOCKFONTNARROW );
}
- mprintf( 54 - width , 38, str );
+ mprintf( 54 + xResOffset - width , 38, str );
SetFont( BLOCKFONT );
swprintf( str, gpStrategicString[ STR_PB_MERCS ] );
@@ -1198,7 +1207,7 @@ void RenderPreBattleInterface()
SetFont( BLOCKFONTNARROW );
width = StringPixLength( str, BLOCKFONTNARROW );
}
- mprintf( 139 - width , 38, str );
+ mprintf( 139 + xResOffset - width , 38, str );
SetFont( BLOCKFONT );
swprintf( str, gpStrategicString[ STR_PB_MILITIA ] );
@@ -1208,20 +1217,20 @@ void RenderPreBattleInterface()
SetFont( BLOCKFONTNARROW );
width = StringPixLength( str, BLOCKFONTNARROW );
}
- mprintf( 224 - width , 38, str );
+ mprintf( 224 + xResOffset - width , 38, str );
//Draw the bottom columns
for( i = 0; i < (INT32)max( guiNumUninvolved, 1 ); i++ )
{
y = BOTTOM_Y - ROW_HEIGHT * (i+1) + 1;
- BltVideoObject( guiSAVEBUFFER, hVObject, BOTTOM_COLUMN, 161, y, VO_BLT_SRCTRANSPARENCY, NULL );
+ BltVideoObject( guiSAVEBUFFER, hVObject, BOTTOM_COLUMN, 161 + xResOffset, y, VO_BLT_SRCTRANSPARENCY, NULL );
}
// WDS - make number of mercenaries, etc. be configurable
for( i = 0; i < (INT32)(/*21*/3+gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs - max( guiNumUninvolved, 1 )); i++ )
{
y = TOP_Y + ROW_HEIGHT * i;
- BltVideoObject( guiSAVEBUFFER, hVObject, TOP_COLUMN, 186, y, VO_BLT_SRCTRANSPARENCY, NULL );
+ BltVideoObject( guiSAVEBUFFER, hVObject, TOP_COLUMN, 186 + xResOffset, y, VO_BLT_SRCTRANSPARENCY, NULL );
}
//location
@@ -1230,7 +1239,7 @@ void RenderPreBattleInterface()
SetFontShadow( FONT_NEARBLACK );
GetSectorIDString( gubPBSectorX, gubPBSectorY, gubPBSectorZ, pSectorName, TRUE );
- mprintf( 70, 17, L"%s %s", gpStrategicString[ STR_PB_SECTOR ], pSectorName );
+ mprintf( 70 + xResOffset, 17, L"%s %s", gpStrategicString[ STR_PB_SECTOR ], pSectorName );
//enemy
SetFont( FONT14ARIAL );
@@ -1252,15 +1261,15 @@ void RenderPreBattleInterface()
}
x = 57 + (27 - StringPixLength( str, FONT14ARIAL )) / 2;
y = 36;
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
//player
swprintf( str, L"%d", guiNumInvolved );
x = 142 + (27 - StringPixLength( str, FONT14ARIAL )) / 2;
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
//militia
swprintf( str, L"%d", CountAllMilitiaInSector( gubPBSectorX, gubPBSectorY ) );
x = 227 + (27 - StringPixLength( str, FONT14ARIAL )) / 2;
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
SetFontShadow( FONT_NEARBLACK );
SetFont( BLOCKFONT2 );
@@ -1283,25 +1292,25 @@ void RenderPreBattleInterface()
//NAME
wcscpy( str, MercPtrs[ i ]->name );
x = 17 + (52-StringPixLength( str, BLOCKFONT2)) / 2;
- mprintf( x , y, str );
+ mprintf( x + xResOffset , y, str );
//ASSIGN
GetMapscreenMercAssignmentString( MercPtrs[ i ], str );
x = 72 + (54-StringPixLength( str, BLOCKFONT2)) / 2;
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
//COND
GetSoldierConditionInfo( MercPtrs[ i ], str, &ubHPPercent, &ubBPPercent );
x = 129 + (58-StringPixLength( str, BLOCKFONT2)) / 2;
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
//HP
swprintf( str, L"%d%%", ubHPPercent );
x = 189 + (25-StringPixLength( str, BLOCKFONT2)) / 2;
wcscat( str, L"%" );
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
//BP
swprintf( str, L"%d%%", ubBPPercent );
x = 217 + (25-StringPixLength( str, BLOCKFONT2)) / 2;
wcscat( str, L"%" );
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
line++;
y += ROW_HEIGHT;
@@ -1317,10 +1326,10 @@ void RenderPreBattleInterface()
wcscpy( str, gpStrategicString[ STR_PB_NONE ] );
x = 17 + (52-StringPixLength( str, BLOCKFONT2)) / 2;
y = BOTTOM_Y - ROW_HEIGHT + 2;
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
}
else
- {
+ {
pGroup = gpGroupList;
y = BOTTOM_Y - ROW_HEIGHT * guiNumUninvolved + 2;
for( i = gTacticalStatus.Team[ OUR_TEAM ].bFirstID; i <= gTacticalStatus.Team[ OUR_TEAM ].bLastID; i++ )
@@ -1337,26 +1346,26 @@ void RenderPreBattleInterface()
//NAME
wcscpy( str, MercPtrs[ i ]->name );
x = 17 + (52-StringPixLength( str, BLOCKFONT2)) / 2;
- mprintf( x , y, str );
+ mprintf( x + xResOffset, y, str );
//ASSIGN
GetMapscreenMercAssignmentString( MercPtrs[ i ], str );
x = 72 + (54-StringPixLength( str, BLOCKFONT2)) / 2;
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
//LOC
GetMapscreenMercLocationString( MercPtrs[ i ], str );
x = 128 + (33-StringPixLength( str, BLOCKFONT2)) / 2;
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
//DEST
GetMapscreenMercDestinationString( MercPtrs[ i ], str );
if( wcslen( str ) > 0 )
{
x = 164 + (41-StringPixLength( str, BLOCKFONT2)) / 2;
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
}
//DEP
GetMapscreenMercDepartureString( MercPtrs[ i ], str, &ubJunk );
x = 208 + (34-StringPixLength( str, BLOCKFONT2)) / 2;
- mprintf( x, y, str );
+ mprintf( x + xResOffset, y, str );
line++;
y += ROW_HEIGHT;
}
@@ -1366,7 +1375,11 @@ void RenderPreBattleInterface()
// mark any and ALL pop up boxes as altered
MarkAllBoxesAsAltered( );
- RestoreExternBackgroundRect( 0, 0, 261, 359 );
+
+ if( !guiNumUninvolved || gfZoomDone == FALSE )
+ RestoreExternBackgroundRect( 0 + xResOffset, 0, 261 + xResOffset, 359 );
+ else
+ RestoreExternBackgroundRect( 0 + xResOffset, 0, 261 + xResOffset, y );
// restore font destinanation buffer to the frame buffer
SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
diff --git a/Strategic/Queen Command.cpp b/Strategic/Queen Command.cpp
index bb1e3009..7af28299 100644
--- a/Strategic/Queen Command.cpp
+++ b/Strategic/Queen Command.cpp
@@ -100,7 +100,7 @@ extern void Ensure_RepairedGarrisonGroup( GARRISON_GROUP **ppGarrison, INT32 *pG
void ValidateEnemiesHaveWeapons()
{
#ifdef JA2BETAVERSION
- SGPRect CenteringRect= {0, 0, 639, 479 };
+ SGPRect CenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, SCREEN_HEIGHT };
INT32 i, iErrorDialog;
SOLDIERTYPE *pSoldier;
INT32 iNumInvalid = 0;
diff --git a/Strategic/Quest Debug System.cpp b/Strategic/Quest Debug System.cpp
index 15baede0..ec2ae91a 100644
--- a/Strategic/Quest Debug System.cpp
+++ b/Strategic/Quest Debug System.cpp
@@ -1311,7 +1311,7 @@ void GetUserInput()
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
- while( DequeueEvent( &Event ) )
+ while( DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT) )
{
if( !HandleTextInput( &Event ) && Event.usEvent == KEY_DOWN )
{
diff --git a/Strategic/Strategic AI.cpp b/Strategic/Strategic AI.cpp
index bcceaa23..aee4c857 100644
--- a/Strategic/Strategic AI.cpp
+++ b/Strategic/Strategic AI.cpp
@@ -1515,7 +1515,7 @@ void InitStrategicAI()
//final thing to do is choose 1 cache map out of 5 possible maps. Simply select the sector randomly,
//set up the flags to use the alternate map, then place 8-12 regular troops there (no ai though).
//changing MAX_STRATEGIC_TEAM_SIZE may require changes to to the defending force here.
- if ( !gGameOptions.fEnableAllWeaponCaches ) // SANDRO - weapon caches settings changed
+ if ( !gGameExternalOptions.fEnableAllWeaponCaches ) // SANDRO - weapon caches settings changed
{
// added a chance to have more than one weapon caches in game
INT8 ubPicked[2] = { 0,0 };
diff --git a/Strategic/Strategic Mines.cpp b/Strategic/Strategic Mines.cpp
index c90bd552..3445dd8b 100644
--- a/Strategic/Strategic Mines.cpp
+++ b/Strategic/Strategic Mines.cpp
@@ -1030,26 +1030,32 @@ void IssueHeadMinerQuote( INT8 bMineIndex, UINT8 ubQuoteType )
switch ( bMineIndex )
{
case MINE_GRUMM:
- sXPos = DEFAULT_EXTERN_PANEL_X_POS, sYPos = DEFAULT_EXTERN_PANEL_Y_POS;
+ sXPos = DEFAULT_EXTERN_PANEL_X_POS;
+ sYPos = DEFAULT_EXTERN_PANEL_Y_POS;
break;
case MINE_CAMBRIA:
- sXPos = DEFAULT_EXTERN_PANEL_X_POS, sYPos = DEFAULT_EXTERN_PANEL_Y_POS;
+ sXPos = DEFAULT_EXTERN_PANEL_X_POS;
+ sYPos = DEFAULT_EXTERN_PANEL_Y_POS;
break;
case MINE_ALMA:
- sXPos = DEFAULT_EXTERN_PANEL_X_POS, sYPos = DEFAULT_EXTERN_PANEL_Y_POS;
+ sXPos = DEFAULT_EXTERN_PANEL_X_POS;
+ sYPos = DEFAULT_EXTERN_PANEL_Y_POS;
break;
case MINE_DRASSEN:
- sXPos = DEFAULT_EXTERN_PANEL_X_POS, sYPos = 135;
+ sXPos = DEFAULT_EXTERN_PANEL_X_POS;
+ sYPos = 135;
break;
case MINE_CHITZENA:
- sXPos = DEFAULT_EXTERN_PANEL_X_POS, sYPos = 117;
+ sXPos = DEFAULT_EXTERN_PANEL_X_POS;
+ sYPos = 117;
break;
// there's no head miner in San Mona, this is an error!
case MINE_SAN_MONA:
default:
//Assert( FALSE );
- sXPos = DEFAULT_EXTERN_PANEL_X_POS, sYPos = DEFAULT_EXTERN_PANEL_Y_POS;
+ sXPos = DEFAULT_EXTERN_PANEL_X_POS;
+ sYPos = DEFAULT_EXTERN_PANEL_Y_POS;
break;
}
diff --git a/Strategic/Strategic Movement.cpp b/Strategic/Strategic Movement.cpp
index 1d3eaac4..f4d89154 100644
--- a/Strategic/Strategic Movement.cpp
+++ b/Strategic/Strategic Movement.cpp
@@ -1650,6 +1650,12 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
return;
}
+ // group arrival already processed?
+ if ( !pGroup->fBetweenSectors && pGroup->ubNextX == 0 && pGroup->ubNextY == 0 )
+ {
+ return;
+ }
+
if( pGroup->fPlayer )
{
//Set the fact we have visited the sector
diff --git a/Strategic/Strategic_VS2010.vcxproj b/Strategic/Strategic_VS2010.vcxproj
index 9a237a7d..128d091d 100644
--- a/Strategic/Strategic_VS2010.vcxproj
+++ b/Strategic/Strategic_VS2010.vcxproj
@@ -198,24 +198,24 @@
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
diff --git a/Strategic/Town Militia.cpp b/Strategic/Town Militia.cpp
index ea36e382..e6bf9b30 100644
--- a/Strategic/Town Militia.cpp
+++ b/Strategic/Town Militia.cpp
@@ -663,7 +663,7 @@ void HandleInterfaceMessageForCostOfTrainingMilitia( SOLDIERTYPE *pSoldier )
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia2");
CHAR16 sString[ 128 ];
- SGPRect pCenteringRect= {0, 0, 640, INV_INTERFACE_START_Y };
+ SGPRect pCenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, INV_INTERFACE_START_Y };
INT32 iNumberOfSectors = 0;
pMilitiaTrainerSoldier = pSoldier;
diff --git a/Strategic/mapscreen.cpp b/Strategic/mapscreen.cpp
index b31b1110..9fd7fe5e 100644
--- a/Strategic/mapscreen.cpp
+++ b/Strategic/mapscreen.cpp
@@ -1112,11 +1112,49 @@ void BeginDeleteAllCallBack( UINT8 bExitValue )
// CHRISL: New functions to handle initialization of inventory coordinates
BOOLEAN InitializeInvPanelCoordsOld()
{
- TOWN_INFO_X = 0;
+ PLAYER_INFO_Y = 107;
TOWN_INFO_Y = 1;
- PLAYER_INFO_X = 0;
- PLAYER_INFO_Y = 107;
+
+ PLAYER_INFO_X = xResOffset + 0;
+ TOWN_INFO_X = xResOffset + 0;
+ MAP_ITEMDESC_START_X = xResOffset + 0;
+ INV_BDROP_X = xResOffset + 0;
+ MAP_WEIGHT_LABEL_X = xResOffset + 173;
+ MAP_ARMOR_LABEL_X = xResOffset + 208;
+ MAP_ARMOR_X = xResOffset + 209;
+ MAP_ARMOR_PERCENT_X = xResOffset + 229;
+ MAP_WEIGHT_X = xResOffset + 176;
+ MAP_WEIGHT_PERCENT_X = xResOffset + 196;
+ MAP_CAMMO_LABEL_X = xResOffset + 178;
+ MAP_CAMMO_X = xResOffset + 176;
+ MAP_CAMMO_PERCENT_X = xResOffset + 196;
+ PLAYER_INFO_FACE_START_X = xResOffset + 9;
+ PLAYER_INFO_FACE_END_X = xResOffset + 60;
+ INV_BODY_X = xResOffset + 71;
+ NAME_X = xResOffset + 4;
+ ASSIGN_X = xResOffset + 60;
+ SLEEP_X = xResOffset + 116;
+ LOC_X = xResOffset + 140;
+ DEST_ETA_X = xResOffset + 177;
+ TIME_REMAINING_X = xResOffset + 215;
+ CONTRACT_X = xResOffset + 185;
+ TRASH_CAN_X = xResOffset + 176;
+ MAP_KEYRING_X = xResOffset + 217;
+ POP_UP_BOX_X = xResOffset + 120;
+ STR_X = xResOffset + 112;
+ LVL_X = xResOffset + 159;
+ CHAR_HP_X = xResOffset + 133;
+ CROSS_X = xResOffset + 195;
+ CHAR_PAY_X = xResOffset + 150;
+ SOLDIER_PIC_X = xResOffset + 9;
+ SOLDIER_HAND_X = xResOffset + 6;
+ CHAR_MORALE_X = xResOffset + 133;
+ PIC_NAME_X = xResOffset + 8;
+ CHAR_NAME_X = xResOffset + 14;
+ CHAR_LOC_X = xResOffset + 76;
+ CHAR_ASSIGN_X = xResOffset + 182;
+ CHAR_TIME_REMAINING_X = xResOffset + 207;
// Inventory slots
gMapScreenInvPocketXY[HELMETPOS].sX = PLAYER_INFO_X + 204; gMapScreenInvPocketXY[HELMETPOS].sY = PLAYER_INFO_Y + 9; // HELMETPOS
@@ -1140,115 +1178,85 @@ BOOLEAN InitializeInvPanelCoordsOld()
gMapScreenInvPocketXY[SMALLPOCK8POS].sX = PLAYER_INFO_X + 60; gMapScreenInvPocketXY[SMALLPOCK8POS].sY = PLAYER_INFO_Y + 216; // SMALLPOCK8
// item description
- MAP_ITEMDESC_START_X = 0;
+ NAME_WIDTH = 51;
+ ASSIGN_WIDTH = 51;
+ SLEEP_WIDTH = 19;
+ LOC_WIDTH = 32;
+ DEST_ETA_WIDTH = 33;
+ TIME_REMAINING_WIDTH = 28;
+ CHAR_HP_WID = 42;
+ CHAR_MORALE_WID = 42;
+ PIC_NAME_WID = 52;
+ CHAR_NAME_WID = 150;
+ CHAR_TIME_REMAINING_WID = 51;
MAP_ITEMDESC_START_Y = PLAYER_INFO_Y;
-
INV_REGION_X = PLAYER_INFO_X;
INV_REGION_Y = PLAYER_INFO_Y;
INV_REGION_WIDTH = 261;
INV_REGION_HEIGHT = 359-94;
INV_BTN_X = PLAYER_INFO_X + 217;
INV_BTN_Y = PLAYER_INFO_Y + 210;
- INV_BDROP_X = 0; // Not used in old inventory
INV_BDROP_Y = 0; // Not used in old inventory
-
- MAP_ARMOR_LABEL_X = 208;
MAP_ARMOR_LABEL_Y = 180;
- MAP_ARMOR_X = 209;
MAP_ARMOR_Y = 189;
- MAP_ARMOR_PERCENT_X = 229;
MAP_ARMOR_PERCENT_Y = 190;
-
- MAP_WEIGHT_LABEL_X = 173;
MAP_WEIGHT_LABEL_Y = 256;
- MAP_WEIGHT_X = 176;
MAP_WEIGHT_Y = 266;
- MAP_WEIGHT_PERCENT_X = 196;
MAP_WEIGHT_PERCENT_Y = 266;
-
- MAP_CAMMO_LABEL_X = 178;
MAP_CAMMO_LABEL_Y = 283;
- MAP_CAMMO_X = 176;
MAP_CAMMO_Y = 292;
- MAP_CAMMO_PERCENT_X = 196;
MAP_CAMMO_PERCENT_Y = 293;
-
MAP_PERCENT_WIDTH = 20;
MAP_PERCENT_HEIGHT = 10;
-
MAP_INV_STATS_TITLE_FONT_COLOR = 6;
MAP_INV_STATS_TEXT_FONT_COLOR = 5;
-
- PLAYER_INFO_FACE_START_X = 9;
PLAYER_INFO_FACE_START_Y = 17;
- PLAYER_INFO_FACE_END_X = 60;
PLAYER_INFO_FACE_END_Y = 76;
-
- INV_BODY_X = 71;
INV_BODY_Y = 116;
- NAME_X = 4;
- NAME_WIDTH = 55 - NAME_X;
-
- ASSIGN_X = 60;
- ASSIGN_WIDTH = 111 - ASSIGN_X;
- SLEEP_X = 116;
- SLEEP_WIDTH = 135 - SLEEP_X;
- LOC_X = 140;
- LOC_WIDTH = 172 - LOC_X;
- DEST_ETA_X = 177;
- DEST_ETA_WIDTH = 210 - DEST_ETA_X;
- TIME_REMAINING_X = 215;
- TIME_REMAINING_WIDTH = 243 - TIME_REMAINING_X;
-
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
CLOCK_Y_START = (MAP_BORDER_Y_OFFSET + 298);
DEST_PLOT_X = (MAP_BORDER_X_OFFSET + 463);
DEST_PLOT_Y = (MAP_BORDER_Y_OFFSET + 345);
- CLOCK_ETA_X = (MAP_BORDER_X_OFFSET + 484);
- CLOCK_HOUR_X_START = (MAP_BORDER_X_OFFSET + 518);
- CLOCK_MIN_X_START = (MAP_BORDER_X_OFFSET + 538);
+ CLOCK_ETA_X = (MAP_BORDER_X_OFFSET + 484) + xResOffset;
+ CLOCK_HOUR_X_START = (MAP_BORDER_X_OFFSET + 518) + xResOffset;
+ CLOCK_MIN_X_START = (MAP_BORDER_X_OFFSET + 538) + xResOffset;
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
CLOCK_Y_START = (MAP_BORDER_Y_OFFSET + 298 + 120);
DEST_PLOT_X = (MAP_BORDER_X_OFFSET + 463 + 80);
DEST_PLOT_Y = (MAP_BORDER_Y_OFFSET + 345 + 120);
- CLOCK_ETA_X = (MAP_BORDER_X_OFFSET + 484 + 80);
- CLOCK_HOUR_X_START = (MAP_BORDER_X_OFFSET + 518 + 80);
- CLOCK_MIN_X_START = (MAP_BORDER_X_OFFSET + 538 + 80);
+ CLOCK_ETA_X = (MAP_BORDER_X_OFFSET + 484 + 80) + xResOffset;
+ CLOCK_HOUR_X_START = (MAP_BORDER_X_OFFSET + 518 + 80) + xResOffset;
+ CLOCK_MIN_X_START = (MAP_BORDER_X_OFFSET + 538 + 80) + xResOffset;
}
- else if (iResolution == 2)
+ else
{
CLOCK_Y_START = (MAP_BORDER_Y_OFFSET + 298 + 285);
DEST_PLOT_X = (MAP_BORDER_X_OFFSET + 463 + 180);
DEST_PLOT_Y = (MAP_BORDER_Y_OFFSET + 345 + 285);
- CLOCK_ETA_X = (MAP_BORDER_X_OFFSET + 484 + 180);
- CLOCK_HOUR_X_START = (MAP_BORDER_X_OFFSET + 518 + 180);
- CLOCK_MIN_X_START = (MAP_BORDER_X_OFFSET + 538 + 180);
+ CLOCK_ETA_X = (MAP_BORDER_X_OFFSET + 484 + 180) + xResOffset;
+ CLOCK_HOUR_X_START = (MAP_BORDER_X_OFFSET + 518 + 180) + xResOffset;
+ CLOCK_MIN_X_START = (MAP_BORDER_X_OFFSET + 538 + 180) + xResOffset;
}
- // -----------------
-
// contract
- CONTRACT_X = 185;
CONTRACT_Y = 50;
// trash can
- TRASH_CAN_X = 176;
TRASH_CAN_Y = 211 + PLAYER_INFO_Y;
TRASH_CAN_WIDTH = 193 - 165;
TRASH_CAN_HEIGHT = 239 - 217;
// keyring
- MAP_KEYRING_X = 217;
MAP_KEYRING_Y = 271;
//Text offsets
@@ -1261,7 +1269,6 @@ BOOLEAN InitializeInvPanelCoordsOld()
TRAIN_HEIG = 47;
STRING_X_OFFSET = 10;
STRING_Y_OFFSET = 5;
- POP_UP_BOX_X = 120;
POP_UP_BOX_Y = 0;
POP_UP_BOX_WIDTH = 60;
POP_UP_BOX_HEIGHT = 100;
@@ -1270,7 +1277,6 @@ BOOLEAN InitializeInvPanelCoordsOld()
TRAIN_TEXT_Y_OFFSET = 4;
// char stat positions
- STR_X = 112;
STR_Y = 42;
DEX_X = STR_X;
DEX_Y = 32;
@@ -1280,7 +1286,6 @@ BOOLEAN InitializeInvPanelCoordsOld()
LDR_Y = 52;
WIS_X = STR_X;
WIS_Y = 62;
- LVL_X = 159;
LVL_Y = AGL_Y;
MRK_X = LVL_X;
MRK_Y = DEX_Y;
@@ -1294,21 +1299,14 @@ BOOLEAN InitializeInvPanelCoordsOld()
STAT_WID = 15;
STAT_HEI = GetFontHeight(CHAR_FONT);
- PIC_NAME_X = 8;
PIC_NAME_Y = (66 + 3);
- PIC_NAME_WID = 60 - PIC_NAME_X;
PIC_NAME_HEI = 75 - PIC_NAME_Y;
- CHAR_NAME_X = 14;
CHAR_NAME_Y = (2 + 3);
- CHAR_NAME_WID = 164 - CHAR_NAME_X;
CHAR_NAME_HEI = 11 - CHAR_NAME_Y;
- CHAR_LOC_X = 76;
CHAR_LOC_Y = 84;
CHAR_LOC_WID = 16;
CHAR_LOC_HEI = 9;
- CHAR_TIME_REMAINING_X = 207;
CHAR_TIME_REMAINING_Y = 65;
- CHAR_TIME_REMAINING_WID = 258 - CHAR_TIME_REMAINING_X;
CHAR_TIME_REMAINING_HEI = GetFontHeight(CHAR_FONT);
CHAR_SALARY_X = CHAR_TIME_REMAINING_X;
CHAR_SALARY_Y = 79;
@@ -1318,51 +1316,78 @@ BOOLEAN InitializeInvPanelCoordsOld()
CHAR_MEDICAL_Y = 93;
CHAR_MEDICAL_WID = CHAR_TIME_REMAINING_WID - 8;
CHAR_MEDICAL_HEI = CHAR_TIME_REMAINING_HEI;
- CHAR_ASSIGN_X = 182;
CHAR_ASSIGN1_Y = 18;
CHAR_ASSIGN2_Y = 31;
CHAR_ASSIGN_WID = 257 - 178;
CHAR_ASSIGN_HEI = 39 - 29;
- CHAR_HP_X = 133;
- CHAR_HP_Y = 77 + 3;
- CHAR_HP_WID = 175 - CHAR_HP_X;
- CHAR_HP_HEI = 90 - CHAR_HP_Y;
- CHAR_MORALE_X = 133;
- CHAR_MORALE_Y = 91 + 3;
- CHAR_MORALE_WID = 175 - CHAR_MORALE_X;
CHAR_MORALE_HEI = 101 - CHAR_MORALE_Y;
-
- CROSS_X = 195;
+ CHAR_HP_Y = 77 + 3;
+ CHAR_HP_HEI = 90 - CHAR_HP_Y;
+ CHAR_MORALE_Y = 91 + 3;
CROSS_Y = 83;
CROSS_HEIGHT = 20;
CROSS_WIDTH = 20;
- CHAR_PAY_X = 150;
CHAR_PAY_Y = 80+4;
CHAR_PAY_HEI = GetFontHeight(CHAR_FONT);
CHAR_PAY_WID = CROSS_X-CHAR_PAY_X;
- SOLDIER_PIC_X = 9;
SOLDIER_PIC_Y = 20;
- SOLDIER_HAND_X = 6;
SOLDIER_HAND_Y = 81;
+ gSCamoXY.sX = INV_BODY_X;
+ gSCamoXY.sY = INV_BODY_Y; // X, Y Location of Map screen's Camouflage region
+
//OJW - MP interface changes
InitializeMPCoordinates();
- gSCamoXY.sX = INV_BODY_X; gSCamoXY.sY = INV_BODY_Y; // X, Y Location of Map screen's Camouflage region
return ( TRUE );
}
BOOLEAN InitializeInvPanelCoordsNew()
{
- TOWN_INFO_X = 0;
+ PLAYER_INFO_Y = 107;
TOWN_INFO_Y = 1;
- PLAYER_INFO_X = 0;
- PLAYER_INFO_Y = 107;
-
- //InitInventoryNew();
+ PLAYER_INFO_X = xResOffset + 0;
+ TOWN_INFO_X = xResOffset + 0;
+ MAP_ITEMDESC_START_X = xResOffset + 0;
+ MAP_ARMOR_LABEL_X = xResOffset + 136;
+ MAP_ARMOR_X = xResOffset + 138;
+ MAP_ARMOR_PERCENT_X = xResOffset + 158;
+ MAP_WEIGHT_LABEL_X = xResOffset + 185;
+ MAP_WEIGHT_X = xResOffset + 188;
+ MAP_WEIGHT_PERCENT_X = xResOffset + 208;
+ MAP_CAMMO_LABEL_X = xResOffset + 226;
+ MAP_CAMMO_X = xResOffset + 224;
+ MAP_CAMMO_PERCENT_X = xResOffset + 244;
+ PLAYER_INFO_FACE_START_X = xResOffset + 9;
+ PLAYER_INFO_FACE_END_X = xResOffset + 60;
+ INV_BODY_X = xResOffset + 31;
+ NAME_X = xResOffset + 4;
+ ASSIGN_X = xResOffset + 60;
+ SLEEP_X = xResOffset + 116;
+ LOC_X = xResOffset + 140;
+ DEST_ETA_X = xResOffset + 177;
+ TIME_REMAINING_X = xResOffset + 215;
+ CONTRACT_X = xResOffset + 185;
+ TRASH_CAN_X = xResOffset + 209;
+ MAP_KEYRING_X = xResOffset + 180;
+ POP_UP_BOX_X = xResOffset + 120;
+ STR_X = xResOffset + 112;
+ LVL_X = xResOffset + 159;
+ PIC_NAME_X = xResOffset + 8;
+ CHAR_NAME_X = xResOffset + 14;
+ CHAR_LOC_X = xResOffset + 76;
+ CHAR_TIME_REMAINING_X = xResOffset + 207;
+ CHAR_ASSIGN_X = xResOffset + 182;
+ CHAR_HP_X = xResOffset + 133;
+ CHAR_MORALE_X = xResOffset + 133;
+ CROSS_X = xResOffset + 195;
+ CHAR_PAY_X = xResOffset + 150;
+ SOLDIER_PIC_X = xResOffset + 9;
+ SOLDIER_HAND_X = xResOffset + 6;
// Inventory slots
- if(iResolution == 0){
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
gMapScreenInvPocketXY[0].sX = PLAYER_INFO_X + 131; gMapScreenInvPocketXY[0].sY = PLAYER_INFO_Y + 9; // HELMETPOS
gMapScreenInvPocketXY[1].sX = PLAYER_INFO_X + 131; gMapScreenInvPocketXY[1].sY = PLAYER_INFO_Y + 38; // VESTPOS
gMapScreenInvPocketXY[2].sX = PLAYER_INFO_X + 131; gMapScreenInvPocketXY[2].sY = PLAYER_INFO_Y + 97; // LEGPOS
@@ -1419,7 +1444,8 @@ BOOLEAN InitializeInvPanelCoordsNew()
gMapScreenInvPocketXY[53].sX = PLAYER_INFO_X + 62; gMapScreenInvPocketXY[53].sY = PLAYER_INFO_Y + 323; // SMALLPOCK29
gMapScreenInvPocketXY[54].sX = PLAYER_INFO_X + 62; gMapScreenInvPocketXY[54].sY = PLAYER_INFO_Y + 344; // SMALLPOCK30
}
- else{
+ else
+ {
gMapScreenInvPocketXY[0].sX = PLAYER_INFO_X + 131; gMapScreenInvPocketXY[0].sY = PLAYER_INFO_Y + 9; // HELMETPOS
gMapScreenInvPocketXY[1].sX = PLAYER_INFO_X + 131; gMapScreenInvPocketXY[1].sY = PLAYER_INFO_Y + 37; // VESTPOS
gMapScreenInvPocketXY[2].sX = PLAYER_INFO_X + 131; gMapScreenInvPocketXY[2].sY = PLAYER_INFO_Y + 97; // LEGPOS
@@ -1478,9 +1504,7 @@ BOOLEAN InitializeInvPanelCoordsNew()
}
// item description
- MAP_ITEMDESC_START_X = 0;
MAP_ITEMDESC_START_Y = PLAYER_INFO_Y;
-
INV_REGION_X = PLAYER_INFO_X;
INV_REGION_Y = PLAYER_INFO_Y;
INV_REGION_WIDTH = 261;
@@ -1490,25 +1514,16 @@ BOOLEAN InitializeInvPanelCoordsNew()
INV_BDROP_X = PLAYER_INFO_X + 220;
INV_BDROP_Y = PLAYER_INFO_Y + 441;
- MAP_ARMOR_LABEL_X = 136;
MAP_ARMOR_LABEL_Y = 177;
- MAP_ARMOR_X = 138;
MAP_ARMOR_Y = 187;
- MAP_ARMOR_PERCENT_X = 158;
MAP_ARMOR_PERCENT_Y = 188;
- MAP_WEIGHT_LABEL_X = 185;
MAP_WEIGHT_LABEL_Y = 209;
- MAP_WEIGHT_X = 188;
MAP_WEIGHT_Y = 219;
- MAP_WEIGHT_PERCENT_X = 208;
MAP_WEIGHT_PERCENT_Y = 219;
- MAP_CAMMO_LABEL_X = 226;
MAP_CAMMO_LABEL_Y = 209;
- MAP_CAMMO_X = 224;
MAP_CAMMO_Y = 219;
- MAP_CAMMO_PERCENT_X = 244;
MAP_CAMMO_PERCENT_Y = 219;
MAP_PERCENT_WIDTH = 20;
@@ -1517,29 +1532,19 @@ BOOLEAN InitializeInvPanelCoordsNew()
MAP_INV_STATS_TITLE_FONT_COLOR = 6;
MAP_INV_STATS_TEXT_FONT_COLOR = 5;
- PLAYER_INFO_FACE_START_X = 9;
PLAYER_INFO_FACE_START_Y = 17;
- PLAYER_INFO_FACE_END_X = 60;
PLAYER_INFO_FACE_END_Y = 76;
- INV_BODY_X = 31;
INV_BODY_Y = 8 + PLAYER_INFO_Y;
+ NAME_WIDTH = 51;
- NAME_X = 4;
- NAME_WIDTH = 55 - NAME_X;
+ ASSIGN_WIDTH = 51;
+ SLEEP_WIDTH = 19;
+ LOC_WIDTH = 32;
+ DEST_ETA_WIDTH = 33;
+ TIME_REMAINING_WIDTH = 28;
- ASSIGN_X = 60;
- ASSIGN_WIDTH = 111 - ASSIGN_X;
- SLEEP_X = 116;
- SLEEP_WIDTH = 135 - SLEEP_X;
- LOC_X = 140;
- LOC_WIDTH = 172 - LOC_X;
- DEST_ETA_X = 177;
- DEST_ETA_WIDTH = 210 - DEST_ETA_X;
- TIME_REMAINING_X = 215;
- TIME_REMAINING_WIDTH = 243 - TIME_REMAINING_X;
-
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
CLOCK_Y_START = (MAP_BORDER_Y_OFFSET + 298);
@@ -1550,41 +1555,38 @@ BOOLEAN InitializeInvPanelCoordsNew()
CLOCK_HOUR_X_START = (MAP_BORDER_X_OFFSET + 518);
CLOCK_MIN_X_START = (MAP_BORDER_X_OFFSET + 538);
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
CLOCK_Y_START = (MAP_BORDER_Y_OFFSET + 298 + 120);
DEST_PLOT_X = (MAP_BORDER_X_OFFSET + 463 + 80);
DEST_PLOT_Y = (MAP_BORDER_Y_OFFSET + 345 + 120);
- CLOCK_ETA_X = (MAP_BORDER_X_OFFSET + 484 + 80);
- CLOCK_HOUR_X_START = (MAP_BORDER_X_OFFSET + 518 + 80);
- CLOCK_MIN_X_START = (MAP_BORDER_X_OFFSET + 538 + 80);
+ CLOCK_ETA_X = (MAP_BORDER_X_OFFSET + 484 + 80) + xResOffset;
+ CLOCK_HOUR_X_START = (MAP_BORDER_X_OFFSET + 518 + 80) + xResOffset;
+ CLOCK_MIN_X_START = (MAP_BORDER_X_OFFSET + 538 + 80) + xResOffset;
}
- else if (iResolution == 2)
+ else
{
CLOCK_Y_START = (MAP_BORDER_Y_OFFSET + 298 + 285);
DEST_PLOT_X = (MAP_BORDER_X_OFFSET + 463 + 180);
DEST_PLOT_Y = (MAP_BORDER_Y_OFFSET + 345 + 285);
- CLOCK_ETA_X = (MAP_BORDER_X_OFFSET + 484 + 180);
- CLOCK_HOUR_X_START = (MAP_BORDER_X_OFFSET + 518 + 180);
- CLOCK_MIN_X_START = (MAP_BORDER_X_OFFSET + 538 + 180);
+ CLOCK_ETA_X = (MAP_BORDER_X_OFFSET + 484 + 180) + xResOffset;
+ CLOCK_HOUR_X_START = (MAP_BORDER_X_OFFSET + 518 + 180) + xResOffset;
+ CLOCK_MIN_X_START = (MAP_BORDER_X_OFFSET + 538 + 180) + xResOffset;
}
// contract
- CONTRACT_X = 185;
CONTRACT_Y = 50;
// trash can
- TRASH_CAN_X = 209;
TRASH_CAN_Y = 59 + PLAYER_INFO_Y;
TRASH_CAN_WIDTH = 193 - 165;
TRASH_CAN_HEIGHT = 239 - 217;
// keyring
- MAP_KEYRING_X = 180;
MAP_KEYRING_Y = 127;
//Text offsets
@@ -1597,7 +1599,6 @@ BOOLEAN InitializeInvPanelCoordsNew()
TRAIN_HEIG = 47;
STRING_X_OFFSET = 10;
STRING_Y_OFFSET = 5;
- POP_UP_BOX_X = 120;
POP_UP_BOX_Y = 0;
POP_UP_BOX_WIDTH = 60;
POP_UP_BOX_HEIGHT = 100;
@@ -1606,7 +1607,6 @@ BOOLEAN InitializeInvPanelCoordsNew()
TRAIN_TEXT_Y_OFFSET = 4;
// char stat positions
- STR_X = 112;
STR_Y = 42;
DEX_X = STR_X;
DEX_Y = 32;
@@ -1616,7 +1616,6 @@ BOOLEAN InitializeInvPanelCoordsNew()
LDR_Y = 52;
WIS_X = STR_X;
WIS_Y = 62;
- LVL_X = 159;
LVL_Y = AGL_Y;
MRK_X = LVL_X;
MRK_Y = DEX_Y;
@@ -1630,21 +1629,18 @@ BOOLEAN InitializeInvPanelCoordsNew()
STAT_WID = 15;
STAT_HEI = GetFontHeight(CHAR_FONT);
- PIC_NAME_X = 8;
PIC_NAME_Y = (66 + 3);
- PIC_NAME_WID = 60 - PIC_NAME_X;
+ PIC_NAME_WID = 52;
PIC_NAME_HEI = 75 - PIC_NAME_Y;
- CHAR_NAME_X = 14;
CHAR_NAME_Y = (2 + 3);
- CHAR_NAME_WID = 164 - CHAR_NAME_X;
+ CHAR_NAME_WID = 150;
CHAR_NAME_HEI = 11 - CHAR_NAME_Y;
- CHAR_LOC_X = 76;
CHAR_LOC_Y = 84;
CHAR_LOC_WID = 16;
CHAR_LOC_HEI = 9;
- CHAR_TIME_REMAINING_X = 207;
+
CHAR_TIME_REMAINING_Y = 65;
- CHAR_TIME_REMAINING_WID = 258 - CHAR_TIME_REMAINING_X;
+ CHAR_TIME_REMAINING_WID = 51;
CHAR_TIME_REMAINING_HEI = GetFontHeight(CHAR_FONT);
CHAR_SALARY_X = CHAR_TIME_REMAINING_X;
CHAR_SALARY_Y = 79;
@@ -1654,34 +1650,28 @@ BOOLEAN InitializeInvPanelCoordsNew()
CHAR_MEDICAL_Y = 93;
CHAR_MEDICAL_WID = CHAR_TIME_REMAINING_WID - 8;
CHAR_MEDICAL_HEI = CHAR_TIME_REMAINING_HEI;
- CHAR_ASSIGN_X = 182;
CHAR_ASSIGN1_Y = 18;
CHAR_ASSIGN2_Y = 31;
CHAR_ASSIGN_WID = 257 - 178;
CHAR_ASSIGN_HEI = 39 - 29;
- CHAR_HP_X = 133;
CHAR_HP_Y = 77 + 3;
- CHAR_HP_WID = 175 - CHAR_HP_X;
+ CHAR_HP_WID = 42;
CHAR_HP_HEI = 90 - CHAR_HP_Y;
- CHAR_MORALE_X = 133;
CHAR_MORALE_Y = 91 + 3;
- CHAR_MORALE_WID = 175 - CHAR_MORALE_X;
+ CHAR_MORALE_WID = 42;
CHAR_MORALE_HEI = 101 - CHAR_MORALE_Y;
- CROSS_X = 195;
CROSS_Y = 83;
CROSS_HEIGHT = 20;
CROSS_WIDTH = 20;
- CHAR_PAY_X = 150;
CHAR_PAY_Y = 80+4;
CHAR_PAY_HEI = GetFontHeight(CHAR_FONT);
CHAR_PAY_WID = CROSS_X-CHAR_PAY_X;
- SOLDIER_PIC_X = 9;
SOLDIER_PIC_Y = 20;
- SOLDIER_HAND_X = 6;
SOLDIER_HAND_Y = 81;
- gSCamoXY.sX = INV_BODY_X; gSCamoXY.sY = INV_BODY_Y; // X, Y Location of Map screen's Camouflage region
+ gSCamoXY.sX = INV_BODY_X;
+ gSCamoXY.sY = INV_BODY_Y; // X, Y Location of Map screen's Camouflage region
//OJW - MP interface changes
InitializeMPCoordinates();
@@ -1692,27 +1682,27 @@ BOOLEAN InitializeInvPanelCoordsNew()
void InitializeMPCoordinates()
{
//OJW - MP interface changes
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
MP_BTN_Y = 268;
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
MP_BTN_Y = 386;
}
- else if (iResolution == 2)
+ else
{
MP_BTN_Y = 554;
}
MP_ROWSTART_Y = MP_BTN_Y + 21;
- MP_PLAYER_X = 5;
+ MP_PLAYER_X = 5 + xResOffset;
MP_PLAYER_W = 75;
- MP_TEAM_X = 84;
+ MP_TEAM_X = 84 + xResOffset;
MP_TEAM_W = 40;
- MP_COMPASS_X = 130;
+ MP_COMPASS_X = 130 + xResOffset;
MP_COMPASS_W = 19;
- MP_GAMEINFO_X = 154;
+ MP_GAMEINFO_X = 154 + xResOffset;
MP_GAMEINFO_W = 81;
// End of MP interface changes
@@ -1720,8 +1710,10 @@ void InitializeMPCoordinates()
BOOLEAN InitializeInvPanelCoordsVehicle( )
{
InitializeInvPanelCoordsNew();
+
// Inventory slots
- if(iResolution == 0){
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
gMapScreenInvPocketXY[14].sX = PLAYER_INFO_X + 37; gMapScreenInvPocketXY[14].sY = PLAYER_INFO_Y + 89;
gMapScreenInvPocketXY[15].sX = PLAYER_INFO_X + 104; gMapScreenInvPocketXY[15].sY = PLAYER_INFO_Y + 89;
gMapScreenInvPocketXY[16].sX = PLAYER_INFO_X + 171; gMapScreenInvPocketXY[16].sY = PLAYER_INFO_Y + 89;
@@ -1762,7 +1754,8 @@ BOOLEAN InitializeInvPanelCoordsVehicle( )
gMapScreenInvPocketXY[51].sX = PLAYER_INFO_X + 104; gMapScreenInvPocketXY[51].sY = PLAYER_INFO_Y + 341;
gMapScreenInvPocketXY[52].sX = PLAYER_INFO_X + 171; gMapScreenInvPocketXY[52].sY = PLAYER_INFO_Y + 341;
}
- else{
+ else
+ {
gMapScreenInvPocketXY[14].sX = PLAYER_INFO_X + 37; gMapScreenInvPocketXY[14].sY = PLAYER_INFO_Y + 156;
gMapScreenInvPocketXY[15].sX = PLAYER_INFO_X + 104; gMapScreenInvPocketXY[15].sY = PLAYER_INFO_Y + 156;
gMapScreenInvPocketXY[16].sX = PLAYER_INFO_X + 171; gMapScreenInvPocketXY[16].sY = PLAYER_INFO_Y + 156;
@@ -1919,16 +1912,13 @@ void ContractBoxGlow( void )
void ContractListRegionBoxGlow( UINT16 usCount )
{
- static INT32 iColorNum =10;
- static BOOLEAN fDelta=FALSE;
- UINT16 usColor;
- UINT32 uiDestPitchBYTES;
- UINT8 *pDestBuf;
- INT16 usY = 0;
-// INT16 sYStart = 0;
- //INT16 usVehicleCount = 0;
- INT16 sYAdd = 0;
-
+ static INT32 iColorNum =10;
+ static BOOLEAN fDelta=FALSE;
+ UINT16 usColor;
+ UINT32 uiDestPitchBYTES;
+ UINT8 *pDestBuf;
+ INT16 usY = 0;
+ INT16 sYAdd = 0;
// if not glowing right now, leave
if( ( giContractHighLine == -1 )||( fResetContractGlow == TRUE ) || fShowInventoryFlag )
@@ -1942,7 +1932,6 @@ void ContractListRegionBoxGlow( UINT16 usCount )
if ( !gfGlowTimerExpired )
return;
-
// change direction of glow?
if((iColorNum==0)||(iColorNum==10))
{
@@ -1988,7 +1977,7 @@ void GlowFace( void )
if( fOldFaceGlow == TRUE )
{
- RestoreExternBackgroundRect( 9, 18, ( UINT16 )( 61 - 9 ), ( UINT16 )( 64 - 18 ) );
+ RestoreExternBackgroundRect( xResOffset + 9, 18, 52, ( UINT16 )( 46 ) );
}
fOldFaceGlow = FALSE;
@@ -1999,13 +1988,12 @@ void GlowFace( void )
if ( !gfGlowTimerExpired )
return;
-
fOldFaceGlow = TRUE;
// change direction of glow?
if((iColorNum==0)||(iColorNum==10))
{
- fDelta=!fDelta;
+ fDelta=!fDelta;
}
// increment color
@@ -2018,25 +2006,25 @@ void GlowFace( void )
usColor=Get16BPPColor( FROMRGB( GlowColorsA[iColorNum].ubRed, GlowColorsA[iColorNum].ubGreen, GlowColorsA[iColorNum].ubBlue ) );
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
- RectangleDraw( TRUE, 9, 18, 60, 63 , usColor, pDestBuf );
- InvalidateRegion( 9, 18, 61, 64 );
- UnLockVideoSurface( FRAME_BUFFER );
+ RectangleDraw( TRUE, xResOffset + 9, 18, xResOffset + 60, 63 , usColor, pDestBuf );
+ InvalidateRegion( xResOffset + 9, 18, xResOffset + 61, 64 );
+ UnLockVideoSurface( FRAME_BUFFER );
+
// restore background
if((iColorNum==0)||(iColorNum==1))
- RestoreExternBackgroundRect( 9, 18, ( UINT16 )( 61 - 9 ), ( UINT16 )( 64 - 18 ) );
+ RestoreExternBackgroundRect( xResOffset + 9, 18, 61 - 9 , ( UINT16 )( 64 - 18 ) );
}
void GlowItem( void )
{
- static INT32 iColorNum =10;
- static BOOLEAN fDelta=FALSE;
- static BOOLEAN fOldItemGlow = FALSE;
- UINT16 usColor;
- UINT32 uiDestPitchBYTES;
- UINT8 *pDestBuf;
-
+ static INT32 iColorNum =10;
+ static BOOLEAN fDelta=FALSE;
+ static BOOLEAN fOldItemGlow = FALSE;
+ UINT16 usColor;
+ UINT32 uiDestPitchBYTES;
+ UINT8 *pDestBuf;
// not glowing right now, leave
if( fShowItemHighLight == FALSE )
@@ -2064,7 +2052,7 @@ void GlowItem( void )
// change direction of glow?
if((iColorNum==0)||(iColorNum==10))
{
- fDelta=!fDelta;
+ fDelta=!fDelta;
}
// increment color
@@ -2076,7 +2064,7 @@ void GlowItem( void )
// restore background
if((iColorNum==0)||(iColorNum==1))
{
- RestoreExternBackgroundRect( 3, 80, ( UINT16 )( 65 - 3 ), ( UINT16 )( 105 - 80 ) );
+ RestoreExternBackgroundRect( xResOffset + 3, 80, (65 - 3 ), ( UINT16 )( 105 - 80 ) );
RenderHandPosItem();
}
@@ -2084,8 +2072,9 @@ void GlowItem( void )
usColor=Get16BPPColor( FROMRGB( GlowColorsA[iColorNum].ubRed, GlowColorsA[iColorNum].ubGreen, GlowColorsA[iColorNum].ubBlue ) );
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
- RectangleDraw( TRUE, 3, 80, 64, 104 , usColor, pDestBuf );
- InvalidateRegion( 3, 80, 65, 105 );
+ RectangleDraw( TRUE, xResOffset + 3, 80, xResOffset + 64, 104 , usColor, pDestBuf );
+ InvalidateRegion( xResOffset + 3, 80, xResOffset + 65, 105 );
+
UnLockVideoSurface( FRAME_BUFFER );
}
@@ -2235,21 +2224,21 @@ void RenderIconsForUpperLeftCornerPiece( INT8 bCharNumber )
if( Menptr[ gCharactersList[ bCharNumber ].usSolID ].ubWhatKindOfMercAmI == MERC_TYPE__AIM_MERC )
{
// finite contract length icon
- BltVideoObject( guiSAVEBUFFER, hHandle, 0, CHAR_ICON_X, CHAR_ICON_CONTRACT_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+ BltVideoObject( guiSAVEBUFFER, hHandle, 0, CHAR_ICON_X + xResOffset, CHAR_ICON_CONTRACT_Y, VO_BLT_SRCTRANSPARENCY, NULL );
}
// if merc has life insurance
if( Menptr[ gCharactersList[ bCharNumber ].usSolID ].usLifeInsurance > 0 )
{
// draw life insurance icon
- BltVideoObject( guiSAVEBUFFER, hHandle, 2, CHAR_ICON_X, CHAR_ICON_CONTRACT_Y + CHAR_ICON_SPACING, VO_BLT_SRCTRANSPARENCY, NULL );
+ BltVideoObject( guiSAVEBUFFER, hHandle, 2, CHAR_ICON_X + xResOffset, CHAR_ICON_CONTRACT_Y + CHAR_ICON_SPACING, VO_BLT_SRCTRANSPARENCY, NULL );
}
// if merc has a medical deposit
if( Menptr[ gCharactersList[ bCharNumber ].usSolID ].usMedicalDeposit > 0 )
{
// draw medical deposit icon
- BltVideoObject( guiSAVEBUFFER, hHandle, 1, CHAR_ICON_X, CHAR_ICON_CONTRACT_Y + ( 2 * CHAR_ICON_SPACING ), VO_BLT_SRCTRANSPARENCY, NULL );
+ BltVideoObject( guiSAVEBUFFER, hHandle, 1, CHAR_ICON_X + xResOffset, CHAR_ICON_CONTRACT_Y + ( 2 * CHAR_ICON_SPACING ), VO_BLT_SRCTRANSPARENCY, NULL );
}
}
@@ -2326,21 +2315,22 @@ void DrawCharBars( void )
}
// current health
- DrawLifeUIBarEx( pSoldier, BAR_INFO_X, BAR_INFO_Y,3,42, TRUE, FRAME_BUFFER );
+ DrawLifeUIBarEx( pSoldier, BAR_INFO_X + xResOffset, BAR_INFO_Y,3,42, TRUE, FRAME_BUFFER );
// robot doesn't have energy/fuel
if ( !AM_A_ROBOT( pSoldier ) )
{
// current energy/fuel
- DrawBreathUIBarEx( pSoldier, BAR_INFO_X + 6, BAR_INFO_Y,3,42, TRUE, FRAME_BUFFER );
+ DrawBreathUIBarEx( pSoldier, BAR_INFO_X + xResOffset + 6, BAR_INFO_Y,3,42, TRUE, FRAME_BUFFER );
}
// vehicles and robot don't have morale
if ( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) && !AM_A_ROBOT( pSoldier ) )
{
// draw morale bar
- DrawMoraleUIBarEx( pSoldier, BAR_INFO_X + 12, BAR_INFO_Y,3,42, TRUE, FRAME_BUFFER );
+ DrawMoraleUIBarEx( pSoldier, BAR_INFO_X + xResOffset + 12, BAR_INFO_Y,3,42, TRUE, FRAME_BUFFER );
}
+
}
return;
@@ -2736,6 +2726,12 @@ void DrawCharHealth( INT16 sCharNum )
SetFontForeground(CHAR_TEXT_FONT_COLOR);
}
+CHAR16* GetRankTitle(INT8 explevel)
+{
+ if (explevel < 1) explevel = 0;
+ if (explevel > 10) explevel = 10;
+ return ranks[explevel];
+}
// "character" refers to hired people AND vehicles
@@ -2804,8 +2800,17 @@ void DrawCharacterInfo(INT16 sCharNumber)
else
{
// soldier
+ //Jenilee: this works
+ if (!gGameSettings.fOptions[TOPTION_SHOW_MERC_RANKS])
+ {
wcscpy(sString, gMercProfiles[usMercProfileID].zName);
}
+ else
+ {
+ swprintf(sString, L"%s%s", GetRankTitle(pSoldier->stats.bExpLevel), gMercProfiles[usMercProfileID].zName);
+ }
+ }
+
FindFontCenterCoordinates(CHAR_NAME_X, CHAR_NAME_Y, CHAR_NAME_WID, CHAR_NAME_HEI, sString, CHAR_FONT, &usX, &usY);
DrawString(sString, usX, usY, CHAR_FONT);
@@ -4488,7 +4493,6 @@ UINT32 MapScreenHandle(void)
// static BOOLEAN fSecondFrame = FALSE;
INT32 iCounter = 0;
INT32 iCounter2 = 0;
- char fileName[500];
//DO NOT MOVE THIS FUNCTION CALL!!!
@@ -4594,7 +4598,7 @@ UINT32 MapScreenHandle(void)
{
vs_desc.fCreateFlags = VSURFACE_CREATE_FROMFILE | VSURFACE_SYSTEM_MEM_USAGE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
// ------------
// 336 x 288 (size without the black area on top and left
@@ -4633,8 +4637,8 @@ UINT32 MapScreenHandle(void)
// Helicopter ETA box
MAP_HELICOPTER_ETA_POPUP_X = (400 + iScreenWidthOffset);
- MAP_HELICOPTER_ETA_POPUP_Y = (250 + iScreenHeightOffset);
- MAP_HELICOPTER_UPPER_ETA_POPUP_Y = (50 + iScreenHeightOffset);
+ MAP_HELICOPTER_ETA_POPUP_Y = (250 + iScreenHeightOffset) - yResOffset;
+ MAP_HELICOPTER_UPPER_ETA_POPUP_Y = (50 + iScreenHeightOffset) - yResOffset;
MAP_HELICOPTER_ETA_POPUP_WIDTH = 120;
MAP_HELICOPTER_ETA_POPUP_HEIGHT = 68;
@@ -4644,7 +4648,7 @@ UINT32 MapScreenHandle(void)
strcpy(vs_desc.ImageFile, "INTERFACE\\b_map.pcx");
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
// ------------
// 480 x 400
@@ -4653,8 +4657,8 @@ UINT32 MapScreenHandle(void)
MAP_GRID_X = 30;
MAP_GRID_Y = 25;
- MAP_BORDER_X_OFFSET = (((SCREEN_WIDTH - 261) - 540) / 2);
- MAP_BORDER_Y_OFFSET = (((SCREEN_HEIGHT - 121) - 480) / 2);
+ MAP_BORDER_X_OFFSET = (SCREEN_WIDTH - 800)/ 2 +(((800 - 261) - 540) / 2);
+ MAP_BORDER_Y_OFFSET = (((600 - 121) - 480) / 2);
MAP_VIEW_START_X = (MAP_BORDER_X + MAP_BORDER_X_OFFSET + 9);
MAP_VIEW_START_Y = (MAP_BORDER_Y + MAP_BORDER_Y_OFFSET + 10);
@@ -4677,18 +4681,18 @@ UINT32 MapScreenHandle(void)
// Helicopter ETA box
MAP_HELICOPTER_ETA_POPUP_X = (400 + iScreenWidthOffset);
- MAP_HELICOPTER_ETA_POPUP_Y = (250 + iScreenHeightOffset + 58);
- MAP_HELICOPTER_UPPER_ETA_POPUP_Y = (50 + iScreenHeightOffset - 40);
+ MAP_HELICOPTER_ETA_POPUP_Y = (250 + iScreenHeightOffset + 58) - yResOffset;
+ MAP_HELICOPTER_UPPER_ETA_POPUP_Y = (50 + iScreenHeightOffset - 40) - yResOffset;
MAP_HELICOPTER_ETA_POPUP_WIDTH = 120;
MAP_HELICOPTER_ETA_POPUP_HEIGHT = 68;
// Map Level string
- MAP_LEVEL_STRING_X = (SCREEN_WIDTH - 208 - 80);
- MAP_LEVEL_STRING_Y = (SCREEN_HEIGHT - 175);
+ MAP_LEVEL_STRING_X = (SCREEN_WIDTH - 800)/ 2 + (800 - 208 - 80);
+ MAP_LEVEL_STRING_Y = 600 -175;
strcpy(vs_desc.ImageFile, "INTERFACE\\b_map_800x600.pcx");
}
- else if (iResolution == 2)
+ else
{
// ------------
// 688 x 560
@@ -4697,8 +4701,8 @@ UINT32 MapScreenHandle(void)
MAP_GRID_X = 43;
MAP_GRID_Y = 35;
- MAP_BORDER_X_OFFSET = (((SCREEN_WIDTH - 261) - 764) / 2);
- MAP_BORDER_Y_OFFSET = (((SCREEN_HEIGHT - 121) - 648) / 2);
+ MAP_BORDER_X_OFFSET = (SCREEN_WIDTH - 1024)/ 2 +(((1024 - 261) - 764) / 2);
+ MAP_BORDER_Y_OFFSET = (((768 - 121) - 648) / 2);
MAP_VIEW_START_X = (MAP_BORDER_X + MAP_BORDER_X_OFFSET + 9);
MAP_VIEW_START_Y = (MAP_BORDER_Y + MAP_BORDER_Y_OFFSET + 10);
@@ -4720,14 +4724,14 @@ UINT32 MapScreenHandle(void)
// Helicopter ETA box
MAP_HELICOPTER_ETA_POPUP_X = (400 + iScreenWidthOffset);
- MAP_HELICOPTER_ETA_POPUP_Y = (250 + iScreenHeightOffset + 120);
- MAP_HELICOPTER_UPPER_ETA_POPUP_Y = (50 + iScreenHeightOffset - 100);
+ MAP_HELICOPTER_ETA_POPUP_Y = (250 + iScreenHeightOffset + 120) - yResOffset;
+ MAP_HELICOPTER_UPPER_ETA_POPUP_Y = (50 + iScreenHeightOffset - 100) - yResOffset;
MAP_HELICOPTER_ETA_POPUP_WIDTH = 120;
MAP_HELICOPTER_ETA_POPUP_HEIGHT = 76;
// Map Level string
- MAP_LEVEL_STRING_X = (SCREEN_WIDTH - 208 - 187);
- MAP_LEVEL_STRING_Y = (SCREEN_HEIGHT - 175);
+ MAP_LEVEL_STRING_X = (SCREEN_WIDTH - 1024)/ 2 + (1024 - 208 - 187);
+ MAP_LEVEL_STRING_Y = 768 - 175;
strcpy(vs_desc.ImageFile, "INTERFACE\\b_map_1024x768.pcx");
}
@@ -4790,15 +4794,15 @@ UINT32 MapScreenHandle(void)
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
if (!is_networked)
{
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
FilenameForBPP("INTERFACE\\newgoldpiece3.sti", VObjectDesc.ImageFile );
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
FilenameForBPP("INTERFACE\\newgoldpiece3_800x600.sti", VObjectDesc.ImageFile );
}
- else if (iResolution == 2)
+ else
{
FilenameForBPP("INTERFACE\\newgoldpiece3_1024x768.sti", VObjectDesc.ImageFile );
}
@@ -4806,15 +4810,15 @@ UINT32 MapScreenHandle(void)
else
{
// OJW - 20081204 - change mapscreen interface for MP games
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
FilenameForBPP("INTERFACE\\mpgoldpiece3.sti", VObjectDesc.ImageFile );
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
FilenameForBPP("INTERFACE\\mpgoldpiece3_800x600.sti", VObjectDesc.ImageFile );
}
- else if (iResolution == 2)
+ else
{
FilenameForBPP("INTERFACE\\mpgoldpiece3_1024x768.sti", VObjectDesc.ImageFile );
}
@@ -4831,11 +4835,11 @@ UINT32 MapScreenHandle(void)
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\boxes.sti", VObjectDesc.ImageFile);
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
FilenameForBPP("INTERFACE\\boxes_800x600.sti", VObjectDesc.ImageFile);
- else if (iResolution == 2)
+ else
FilenameForBPP("INTERFACE\\boxes_1024x768.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiCHARICONS));
@@ -4845,18 +4849,19 @@ UINT32 MapScreenHandle(void)
CHECKF(AddVideoObject(&VObjectDesc, &guiCROSS));
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
FilenameForBPP("INTERFACE\\mapinv.sti", VObjectDesc.ImageFile);
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
FilenameForBPP("INTERFACE\\mapinv_800x600.sti", VObjectDesc.ImageFile);
}
- else if (iResolution == 2)
+ else
{
FilenameForBPP("INTERFACE\\mapinv_1024x768.sti", VObjectDesc.ImageFile);
}
+
if(!AddVideoObject(&VObjectDesc, &guiMAPINV))
{
FilenameForBPP("INTERFACE\\mapinv.sti", VObjectDesc.ImageFile);
@@ -4880,58 +4885,27 @@ UINT32 MapScreenHandle(void)
FilenameForBPP("INTERFACE\\prison.sti", VObjectDesc.ImageFile);
CHECKF(AddVideoObject(&VObjectDesc, &guiTIXAICON));
- //----------- legion 2
for( iCounter2 = 1; iCounter2 < NUM_TOWNS; iCounter2++ )
{
- //if ( gfDrawHiddenTown[iCounter2] == TRUE )
- //{
- //VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
- //FilenameForBPP("INTERFACE\\PRISON.sti", VObjectDesc.ImageFile);
+ VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+
+ if ( gfIconTown[iCounter2] == TRUE )
+ {
+ strcpy(VObjectDesc.ImageFile, gHiddenIcon[iCounter2].IconSti);
+ }
+ else
+ {
+ FilenameForBPP("INTERFACE\\PRISON.sti", VObjectDesc.ImageFile);
+ }
- /*
- if (iResolution == 0)
- {
- strcpy(fileName, gHiddenIcon[iCounter2].IconSti);
- strcat(fileName,".sti");
- }
- if (iResolution == 1)
- {
- strcpy(fileName, gHiddenIcon[iCounter2].IconSti);
- strcat(fileName,"_800x600.sti");
- }
- if (iResolution == 2)
- {
- strcpy(fileName, gHiddenIcon[iCounter2].IconSti);
- strcat(fileName,"_1024x768.sti");
- }
+ if (!FileExists(VObjectDesc.ImageFile))
+ {
+ FilenameForBPP("INTERFACE\\PRISON.sti", VObjectDesc.ImageFile);
+ }
- if ( gfIconTown[iCounter2] == TRUE )
- strcpy(VObjectDesc.ImageFile, fileName);
- else
- FilenameForBPP("INTERFACE\\PRISON.sti", VObjectDesc.ImageFile);
- */
-
- VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
- if ( gfIconTown[iCounter2] == TRUE )
- {
- strcpy(VObjectDesc.ImageFile, gHiddenIcon[iCounter2].IconSti);
- }
- else
- {
- FilenameForBPP("INTERFACE\\PRISON.sti", VObjectDesc.ImageFile);
- }
-
- if (!FileExists(VObjectDesc.ImageFile))
- {
- FilenameForBPP("INTERFACE\\PRISON.sti", VObjectDesc.ImageFile);
- }
-
-
- CHECKF(AddVideoObject(&VObjectDesc, &guiIcon2[iCounter2]));
- //}
- }
- //-------
+ CHECKF(AddVideoObject(&VObjectDesc, &guiIcon2[iCounter2]));
+ }
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\merc_between_sector_icons.sti", VObjectDesc.ImageFile);
@@ -4975,11 +4949,11 @@ UINT32 MapScreenHandle(void)
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
sprintf( VObjectDesc.ImageFile, "INTERFACE\\hilite.sti" );
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
sprintf( VObjectDesc.ImageFile, "INTERFACE\\hilite_800x600.sti" );
- else if (iResolution == 2)
+ else
sprintf( VObjectDesc.ImageFile, "INTERFACE\\hilite_1024x768.sti" );
AddVideoObject( &VObjectDesc, &guiSectorLocatorGraphicID );
@@ -5099,8 +5073,10 @@ UINT32 MapScreenHandle(void)
// set up regions
MSYS_DefineRegion( &gMapViewRegion, MAP_VIEW_START_X + MAP_GRID_X, MAP_VIEW_START_Y + MAP_GRID_Y,MAP_VIEW_START_X + MAP_VIEW_WIDTH+MAP_GRID_X-1, MAP_VIEW_START_Y + MAP_VIEW_HEIGHT-1 + 8, MSYS_PRIORITY_HIGH - 3,
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, MSYS_NO_CALLBACK );
- MSYS_DefineRegion( &gCharInfoHandRegion, ((INT16)( 4 )), ((INT16)( 81 )) ,((INT16)(62)), ((INT16)(103)), MSYS_PRIORITY_HIGH,
- MSYS_NO_CURSOR, ItemRegionMvtCallback , ItemRegionBtnCallback );
+
+ MSYS_DefineRegion( &gCharInfoHandRegion, ((INT16)( xResOffset + 4 )), ((INT16)( 81 )) ,((INT16)(xResOffset + 62)), ((INT16)(103)), MSYS_PRIORITY_HIGH,
+ MSYS_NO_CURSOR, ItemRegionMvtCallback , ItemRegionBtnCallback );
+
MSYS_DefineRegion( &gCharInfoFaceRegion, (INT16) PLAYER_INFO_FACE_START_X, (INT16) PLAYER_INFO_FACE_START_Y, (INT16) PLAYER_INFO_FACE_END_X, (INT16) PLAYER_INFO_FACE_END_Y, MSYS_PRIORITY_HIGH,
MSYS_NO_CURSOR, MSYS_NO_CALLBACK, FaceRegionBtnCallback );
@@ -5132,15 +5108,15 @@ UINT32 MapScreenHandle(void)
CreateMouseRegionForPauseOfClock( CLOCK_REGION_START_X, CLOCK_REGION_START_Y );
// WANNE: The number of merc we can display in the list, depends on the resolution
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
maxNumberOfMercVisibleInStrategyList = 22;
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
maxNumberOfMercVisibleInStrategyList = 34;
}
- else if (iResolution == 2)
+ else
{
if (giMAXIMUM_NUMBER_OF_PLAYER_SLOTS <= 51)
maxNumberOfMercVisibleInStrategyList = giMAXIMUM_NUMBER_OF_PLAYER_SLOTS;
@@ -5633,7 +5609,7 @@ UINT32 MapScreenHandle(void)
// render clock
// WANNE: Renders the clock in the strategy screen
RenderClock(CLOCK_X, CLOCK_Y);
-
+
#ifdef JA2TESTVERSION
if( !gfWorldLoaded )
{
@@ -5939,9 +5915,7 @@ void SetDayAlternate(STR16 pStringA, ...)
SetFontForeground( FONT_LTGREEN );
SetFontBackground( FONT_BLACK );
- //RestoreExternBackgroundRect( uiX, uiY, 20 ,GetFontHeight( ETA_FONT ) );
mprintf( uiX, uiY, String );
-
}
@@ -5974,9 +5948,7 @@ void SetHourAlternate(STR16 pStringA, ...)
SetFontForeground( FONT_LTGREEN );
SetFontBackground( FONT_BLACK );
- //RestoreExternBackgroundRect( uiX, uiY, 20 ,GetFontHeight( ETA_FONT ) );
mprintf( uiX, uiY, String );
-
}
@@ -6003,12 +5975,10 @@ void SetClockHour(STR16 pStringA, ...)
uiX=CLOCK_HOUR_X_START-8;
uiY=CLOCK_Y_START;
-
SetFont( ETA_FONT );
SetFontForeground( FONT_LTGREEN );
SetFontBackground( FONT_BLACK );
- //RestoreExternBackgroundRect( uiX, uiY, 20 ,GetFontHeight( ETA_FONT ) );
mprintf( uiX, uiY, String );
}
@@ -6035,7 +6005,6 @@ void SetClockMin(STR16 pStringA, ...)
SetFontForeground( FONT_LTGREEN );
SetFontBackground( FONT_BLACK );
- //RestoreExternBackgroundRect( CLOCK_MIN_X_START - 5, CLOCK_Y_START, 20 ,GetFontHeight( ETA_FONT ) );
mprintf( CLOCK_MIN_X_START-5, CLOCK_Y_START, String );
}
@@ -6163,7 +6132,6 @@ void DrawAssignment(INT16 sCharNumber, INT16 sRowIndex, INT32 iFont)
UnLockVideoSurface( uiDestBuffer );
}
- //RestoreExternBackgroundRect(ASSIGN_X-2, ((UINT16)(usY+(Y_OFFSET*sRowIndex+1))), ASSIGN_WIDTH+2, Y_SIZE);
DrawString(sString, (UINT16)usX, ((UINT16)(usY+(Y_OFFSET*sRowIndex+1))), iFont);
}
@@ -6811,33 +6779,6 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
while( DequeueEvent( &InputEvent ) )
// while( DequeueSpecificEvent( &InputEvent, KEY_DOWN ) ) // doesn't work for some reason
{
- GetCursorPos(&MousePos);
- ScreenToClient(ghWindow, &MousePos); // In window coords!
-
- // HOOK INTO MOUSE HOOKS
- switch(InputEvent.usEvent)
- {
- case LEFT_BUTTON_DOWN:
- MouseSystemHook(LEFT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
- break;
- case LEFT_BUTTON_UP:
- MouseSystemHook(LEFT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y ,_LeftButtonDown, _RightButtonDown);
- break;
- case RIGHT_BUTTON_DOWN:
- MouseSystemHook(RIGHT_BUTTON_DOWN, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
- break;
- case RIGHT_BUTTON_UP:
- MouseSystemHook(RIGHT_BUTTON_UP, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
- break;
- case RIGHT_BUTTON_REPEAT:
- MouseSystemHook(RIGHT_BUTTON_REPEAT, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
- break;
- case LEFT_BUTTON_REPEAT:
- MouseSystemHook(LEFT_BUTTON_REPEAT, (INT16)MousePos.x, (INT16)MousePos.y,_LeftButtonDown, _RightButtonDown);
- break;
- }
-
-
if( InputEvent.usEvent == KEY_DOWN )
{
// if game is paused because of player, unpause with any key
@@ -7524,10 +7465,12 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
if(bSelectedInfoChar != -1)
{
SOLDIERTYPE *pSoldier = MercPtrs[ gCharactersList[ bSelectedInfoChar ].usSolID ];
+ pSoldier->bInSector = FALSE;
+
//CHRISL: Try to update InSector value so we don't have to "activate" a sector
if(pSoldier->sSectorX == sSelMapX && pSoldier->sSectorY == sSelMapY && pSoldier->bSectorZ == iCurrentMapSectorZ && !pSoldier->flags.fBetweenSectors)
- pSoldier->bInSector=TRUE;
- if(OK_CONTROL_MERC( pSoldier ))
+ pSoldier->bInSector = TRUE;
+ if(OK_CONTROL_MERC( pSoldier ) && pSoldier->bInSector == TRUE)
{
if(!fShowMapInventoryPool)
{
@@ -7678,7 +7621,19 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
// fShowMapScreenHelpText = TRUE;
break;
-
+ case 'H':
+ // swap primary & secondary hand
+ if ( bSelectedInfoChar != -1 && fShowInventoryFlag && !AM_A_ROBOT( MercPtrs[ gCharactersList[ bSelectedInfoChar ].usSolID ] ))
+ {
+ SOLDIERTYPE *pSoldier = MercPtrs[ gCharactersList[ bSelectedInfoChar ].usSolID ];
+ UINT16 usOldHandItem = pSoldier->inv[HANDPOS].usItem;
+ SwapHandItems( pSoldier );
+
+ fTeamPanelDirty = TRUE;
+ fMapPanelDirty = TRUE;
+ fInterfacePanelDirty = DIRTYLEVEL2;
+ }
+ break;
case 'i':
#ifdef JA2TESTVERSION
/*
@@ -8240,6 +8195,10 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
break;
}
}
+ else
+ {
+ HandleDefaultEvent(&InputEvent);
+ }
}
}
@@ -8978,10 +8937,9 @@ void PopupText( STR16 pFontString, ... )
vswprintf(PopupString, pFontString, argptr); // process gprintf string (get output str)
va_end(argptr);
-
FindFontCenterCoordinates( 0, 0, SCREEN_WIDTH, INTERFACE_START_Y, PopupString, LARGEFONT1, &sX, &sY );
-
- BltVideoSurface( FRAME_BUFFER, guiINTEXT, 0, 85, 160, VS_BLT_FAST | VS_BLT_USECOLORKEY, NULL );
+
+ BltVideoSurface( FRAME_BUFFER, guiINTEXT, 0, xResOffset + 85, 160, VS_BLT_FAST | VS_BLT_USECOLORKEY, NULL );
pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES);
@@ -9399,7 +9357,15 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason )
if ( _KeyDown(CTRL) )
{
- CleanUpStack( &( pSoldier->inv[ uiHandPos ] ), NULL );
+ //CleanUpStack( &( pSoldier->inv[ uiHandPos ] ), NULL );
+
+ if( AutoPlaceObjectToWorld(pSoldier, &( pSoldier->inv[ uiHandPos ] ) ) )
+ {
+ //INVRenderINVPanelItem( pSoldier, uiHandPos, DIRTYLEVEL2); // redraw the empty slot
+
+ fTeamPanelDirty = TRUE;
+ RenderTeamRegionBackground();
+ }
}
/* CHRISL: For New Inventory system. Are we removing an existing LBE item? If so, we need to pull
@@ -9786,35 +9752,33 @@ void RenderAttributeStringsForUpperLeftHandCorner( UINT32 uiBufferToRenderTo )
SetFontBackground( FONT_BLACK );
SetFontDestBuffer( uiBufferToRenderTo, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
-
// assignment strings
- DrawString( pUpperLeftMapScreenStrings[ 0 ], (UINT16)(220 - StringPixLength( pUpperLeftMapScreenStrings[0], CHAR_FONT)/2), 6, CHAR_FONT);
+ DrawString( pUpperLeftMapScreenStrings[ 0 ], (UINT16)(xResOffset + 220 - StringPixLength( pUpperLeftMapScreenStrings[0], CHAR_FONT)/2), 6, CHAR_FONT);
// vehicles and robot don't have attributes, contracts, or morale
if ( ( pSoldier == NULL ) || ( !( pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) && !AM_A_ROBOT( pSoldier ) ) )
{
// health
- DrawString(pUpperLeftMapScreenStrings[ 2 ], 87, 80, CHAR_FONT);
+ DrawString(pUpperLeftMapScreenStrings[ 2 ], xResOffset + 87, 80, CHAR_FONT);
for( iCounter = 0; iCounter < 5; iCounter++ )
{
- DrawString(pShortAttributeStrings[ iCounter ], 88, ( INT16 )( 22 + iCounter * 10 ) ,CHAR_FONT );
- DrawString(pShortAttributeStrings[ iCounter + 5 ] ,133, ( INT16 )( 22 + iCounter * 10 ), CHAR_FONT );
+ DrawString(pShortAttributeStrings[ iCounter ], xResOffset + 88, ( INT16 )( 22 + iCounter * 10 ) ,CHAR_FONT );
+ DrawString(pShortAttributeStrings[ iCounter + 5 ] ,xResOffset + 133, ( INT16 )( 22 + iCounter * 10 ), CHAR_FONT );
}
// contract
//DrawString(pUpperLeftMapScreenStrings[ 1 ], 194, 52, CHAR_FONT);
// morale
- DrawString(pUpperLeftMapScreenStrings[ 3 ], 87, 94, CHAR_FONT);
+ DrawString(pUpperLeftMapScreenStrings[ 3 ], xResOffset + 87, 94, CHAR_FONT);
}
else
{
// condition
- DrawString(pUpperLeftMapScreenStrings[ 4 ], 87, 80, CHAR_FONT);
+ DrawString(pUpperLeftMapScreenStrings[ 4 ], xResOffset + 87, 80, CHAR_FONT);
}
-
// restore buffer
SetFontDestBuffer( FRAME_BUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
}
@@ -11371,9 +11335,7 @@ void RenderMapRegionBackground( void )
MapscreenMarkButtonsDirty();
- //RestoreExternBackgroundRect( 261, 0, 379, 359 );
-
- RestoreExternBackgroundRect( 261, 0, SCREEN_WIDTH - 261, SCREEN_HEIGHT - 121 );
+ RestoreExternBackgroundRect( 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
// don't bother if showing sector inventory instead of the map!!!
if( !fShowMapInventoryPool )
@@ -11443,18 +11405,23 @@ void RenderTeamRegionBackground( void )
MarkAllBoxesAsAltered( );
// restore background for area
- if(fShowInventoryFlag == TRUE && UsingNewInventorySystem() == false){
- RestoreExternBackgroundRect( 0, 107, 261, SCREEN_HEIGHT - 106 - 121 );
+ if(fShowInventoryFlag == TRUE && UsingNewInventorySystem() == false)
+ {
+ RestoreExternBackgroundRect( 0 + xResOffset, 107, 261, SCREEN_HEIGHT - 107 - 121 - 2 * yResOffset);
}
- else if(fShowInventoryFlag == TRUE && iResolution == 0){
- RestoreExternBackgroundRect( 0, 107, 261, SCREEN_HEIGHT - 107 );
+ else if(fShowInventoryFlag == TRUE && iResolution >= _640x480 && iResolution < _800x600)
+ {
+ RestoreExternBackgroundRect( 0 + xResOffset, 107, 261, SCREEN_HEIGHT - 107 - 2 * yResOffset );
}
- else if(fShowInventoryFlag == TRUE && iResolution == 1){
- RestoreExternBackgroundRect( 0, 107, 261, SCREEN_HEIGHT - 107 );
+ else if(fShowInventoryFlag == TRUE && iResolution < _1024x768)
+ {
+ RestoreExternBackgroundRect( 0 + xResOffset, 107, 261, SCREEN_HEIGHT - 107 - 2 * yResOffset );
}
- else if(fShowInventoryFlag == FALSE || iResolution == 2){
- RestoreExternBackgroundRect( 0, 107, 261, SCREEN_HEIGHT - 107 - 121 );
+ else if(fShowInventoryFlag == FALSE || iResolution >= _1024x768)
+ {
+ RestoreExternBackgroundRect( 0 + xResOffset, 107, 261, SCREEN_HEIGHT - 107 - 121 - 2 * yResOffset );
}
+
MapscreenMarkButtonsDirty();
return;
@@ -11505,8 +11472,7 @@ void RenderCharacterInfoBackground( void )
MarkAllBoxesAsAltered( );
// restore background for area
- RestoreExternBackgroundRect( 0, 0, 261, 107 );
-
+ RestoreExternBackgroundRect( xResOffset + 0, 0, 261, 107 );
}
void DetermineIfContractMenuCanBeShown( void )
@@ -13278,7 +13244,7 @@ void CreateDestroyMapCharacterScrollButtons( void )
giCharInfoButtonImage[ 0 ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,11,4,-1,6,-1 );
// set the button value
- giCharInfoButton[ 0 ] = QuickCreateButton( giCharInfoButtonImage[ 0 ], 67, 69,
+ giCharInfoButton[ 0 ] = QuickCreateButton( giCharInfoButtonImage[ 0 ], xResOffset + 67, 69,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 5,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)PrevInventoryMapBtnCallback );
@@ -13286,11 +13252,10 @@ void CreateDestroyMapCharacterScrollButtons( void )
giCharInfoButtonImage[ 1 ]= LoadButtonImage( "INTERFACE\\map_screen_bottom_arrows.sti" ,12,5,-1,7,-1 );
// set the button value
- giCharInfoButton[ 1 ] = QuickCreateButton( giCharInfoButtonImage[ 1 ], 67, 87,
+ giCharInfoButton[ 1 ] = QuickCreateButton( giCharInfoButtonImage[ 1 ], xResOffset + 67, 87,
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 5,
BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)NextInventoryMapBtnCallback );
-
SetButtonFastHelpText( giCharInfoButton[ 0 ], pMapScreenPrevNextCharButtonHelpText[ 0 ] );
SetButtonFastHelpText( giCharInfoButton[ 1 ], pMapScreenPrevNextCharButtonHelpText[ 1 ] );
@@ -13308,8 +13273,6 @@ void CreateDestroyMapCharacterScrollButtons( void )
}
}
-
-
void TellPlayerWhyHeCantCompressTime( void )
{
// if we're locked into paused time compression by some event that enforces that
@@ -13469,8 +13432,7 @@ void AddTeamPanelSortButtonsForMapScreen( void )
{
giMapSortButtonImage[ iCounter ] = LoadButtonImage( filename, -1, iImageIndex[ iCounter ] , -1, iImageIndex[ iCounter ] + 6 , -1 );
- // buttonmake
- giMapSortButton[ iCounter ]= QuickCreateButton( giMapSortButtonImage[ iCounter ], ( INT16 )( gMapSortButtons[ iCounter ].iX ), ( INT16 )( gMapSortButtons[ iCounter ].iY ),
+ giMapSortButton[ iCounter ]= QuickCreateButton( giMapSortButtonImage[ iCounter ], ( INT16 )( xResOffset + gMapSortButtons[ iCounter ].iX ), ( INT16 )( gMapSortButtons[ iCounter ].iY ),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 5,
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)MapSortBtnCallback );
@@ -13489,17 +13451,17 @@ void AddMPButtonsForMapScreen( void )
INT32 iPressedIndex[ MAX_MP_BUTTONS+1 ] = { 0 , 2 , 4 , 6 , 8 };
GetMLGFilename( filename, MLG_MP_GOLDPIECEBUTTONS );
-
- // add start game button and hide it...
-
+
for( iCounter = 0; iCounter < MAX_MP_BUTTONS+1; iCounter++ )
- {
+ {
giMapMPButtonImage[ iCounter ] = LoadButtonImage( filename, -1, iImageIndex[ iCounter ] , -1, iPressedIndex[ iCounter ] , -1 );
if (iCounter < MAX_MP_BUTTONS)
{
+ UINT16 xButtonPos = gMapMPButtonsX[ iCounter ] + xResOffset;
+
// buttonmake
- giMapMPButton[ iCounter ]= QuickCreateButton( giMapMPButtonImage[ iCounter ], ( INT16 )( gMapMPButtonsX[ iCounter ] ), ( INT16 )( MP_BTN_Y ),
+ giMapMPButton[ iCounter ]= QuickCreateButton( giMapMPButtonImage[ iCounter ], ( INT16 )( xButtonPos ), ( INT16 )( MP_BTN_Y ),
BUTTON_TOGGLE, MSYS_PRIORITY_HIGHEST - 5,
(GUI_CALLBACK)BtnGenericMouseMoveButtonCallback, (GUI_CALLBACK)MPReadyButtonCallback );
@@ -13980,39 +13942,38 @@ void CheckForAndRenderNewMailOverlay()
if( GetJA2Clock() % 1000 < 667 )
{
if( ButtonList[ guiMapBottomExitButtons[ MAP_EXIT_TO_LAPTOP ] ]->uiFlags & BUTTON_CLICKED_ON )
- { //button is down, so offset the icon
- //BltVideoObjectFromIndex( FRAME_BUFFER, guiNewMailIcons, 1, 465, 418, VO_BLT_SRCTRANSPARENCY, NULL );
- BltVideoObjectFromIndex( FRAME_BUFFER, guiNewMailIcons, 1, (SCREEN_WIDTH - 175), (SCREEN_HEIGHT - 62), VO_BLT_SRCTRANSPARENCY, NULL );
- //InvalidateRegion( 465, 418, 480, 428 );
- InvalidateRegion( (SCREEN_WIDTH - 175), (SCREEN_HEIGHT - 62), (SCREEN_WIDTH - 160), (SCREEN_HEIGHT - 52 ));
+ {
+ BltVideoObjectFromIndex( FRAME_BUFFER, guiNewMailIcons, 1, xResOffset + (xResSize - 175), (SCREEN_HEIGHT - 62), VO_BLT_SRCTRANSPARENCY, NULL );
+ InvalidateRegion( xResOffset + (xResSize - 175), (SCREEN_HEIGHT - 62), xResOffset + (xResSize - 160), (SCREEN_HEIGHT - 52 ));
}
else
- { //button is up, so draw the icon normally
+ {
+ //button is up, so draw the icon normally
//BltVideoObjectFromIndex( FRAME_BUFFER, guiNewMailIcons, 0, 464, 417, VO_BLT_SRCTRANSPARENCY, NULL );
- BltVideoObjectFromIndex( FRAME_BUFFER, guiNewMailIcons, 0, (SCREEN_WIDTH - 176), (SCREEN_HEIGHT - 63), VO_BLT_SRCTRANSPARENCY, NULL );
+ BltVideoObjectFromIndex( FRAME_BUFFER, guiNewMailIcons, 0, xResOffset + (xResSize - 176), (SCREEN_HEIGHT - 63), VO_BLT_SRCTRANSPARENCY, NULL );
if( !(ButtonList[ guiMapBottomExitButtons[ MAP_EXIT_TO_LAPTOP ] ]->uiFlags & BUTTON_ENABLED ) )
{
UINT32 uiDestPitchBYTES;
UINT8 *pDestBuf;
- SGPRect area = { (SCREEN_WIDTH - 177), (SCREEN_HEIGHT - 63), (SCREEN_WIDTH - 163), (SCREEN_HEIGHT - 55) };
+ SGPRect area = { xResOffset + (xResSize - 177), (SCREEN_HEIGHT - 63), xResOffset + (xResSize - 163), (SCREEN_HEIGHT - 55) };
- pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
+ pDestBuf = LockVideoSurface( FRAME_BUFFER, &uiDestPitchBYTES );
Blt16BPPBufferHatchRect( (UINT16*)pDestBuf, uiDestPitchBYTES, &area );
UnLockVideoSurface( FRAME_BUFFER );
}
- InvalidateRegion( (SCREEN_WIDTH - 177), (SCREEN_HEIGHT - 63), (SCREEN_WIDTH - 159), (SCREEN_HEIGHT - 50) );
+ InvalidateRegion( xResOffset + (xResSize - 177), (SCREEN_HEIGHT - 63), xResOffset + (xResSize - 159), (SCREEN_HEIGHT - 50) );
}
}
else
- { //The blink is now off, so mark the button dirty so that it'll render next frame.
+ {
+ //The blink is now off, so mark the button dirty so that it'll render next frame.
MarkAButtonDirty( guiMapBottomExitButtons[ MAP_EXIT_TO_LAPTOP ] );
}
}
}
-
BOOLEAN CanToggleSelectedCharInventory( void )
{
SOLDIERTYPE *pSoldier = NULL;
@@ -15823,16 +15784,9 @@ void RestoreMapSectorCursor( INT16 sMapX, INT16 sMapY )
sScreenY -= 1;
-/*
- if(fZoomFlag)
- RestoreExternBackgroundRect( ((INT16)( sScreenX - MAP_GRID_X )), ((INT16)( sScreenY - MAP_GRID_Y )), DMAP_GRID_ZOOM_X, DMAP_GRID_ZOOM_Y);
- else
-*/
RestoreExternBackgroundRect( sScreenX, sScreenY, DMAP_GRID_X, DMAP_GRID_Y );
}
-
-
void RequestToggleMercInventoryPanel( void )
{
if( IsMapScreenHelpTextUp() )
diff --git a/Tactical/Auto Bandage.cpp b/Tactical/Auto Bandage.cpp
index 82fcaf4a..dd84db42 100644
--- a/Tactical/Auto Bandage.cpp
+++ b/Tactical/Auto Bandage.cpp
@@ -279,7 +279,7 @@ BOOLEAN HandleAutoBandage( )
// Deque all game events
DequeAllGameEvents( TRUE );
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if ( InputEvent.usEvent == KEY_UP )
{
@@ -1078,6 +1078,45 @@ BOOLEAN AddFacesToAutoBandageBox( void )
// find a free slot
if( iDoctorList[ iCounter ] != -1 )
{
+
+
+ if( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
+ {
+ // grab filename of face
+ if ((iDoctorList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ))
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ else
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+ else
+ {
+ // grab filename of face
+ if ((iDoctorList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ))
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ else
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+
+
+ /*
+ if ( ( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+ else if ( ( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+ else if(( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+ else if(( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+
+
if( gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
{
// grab filename of face
@@ -1088,9 +1127,18 @@ BOOLEAN AddFacesToAutoBandageBox( void )
// grab filename of face
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iDoctorList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
+ */
// load the face
- AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter ] );
+ // AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter ] );
+
+ if( !AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter ] ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\speck.sti" );
+ AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter ] );
+
+ }
+
iNumberOfDoctors++;
}
@@ -1101,6 +1149,43 @@ BOOLEAN AddFacesToAutoBandageBox( void )
// find a free slot
if( iPatientList[ iCounter ] != -1 )
{
+
+ if( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
+ {
+ // grab filename of face
+ if ((iPatientList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ))
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ else
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+ else
+ {
+ // grab filename of face
+ if ((iPatientList[ iCounter ] != -1) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ))
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ else
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+
+ /*
+ if ( ( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+ else if ( ( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+ else if(( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+ else if(( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex > 99 ) && ( gProfilesIMP[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ProfilId == -1 ))
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
+ }
+
+
if( gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex < 100 )
{
// grab filename of face
@@ -1111,10 +1196,17 @@ BOOLEAN AddFacesToAutoBandageBox( void )
// grab filename of face
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", gMercProfiles[ ( Menptr[ iPatientList[ iCounter ] ] ).ubProfile ].ubFaceIndex );
}
-
+ */
// load the face
- AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter + iNumberOfDoctors ] );
+ // AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter + iNumberOfDoctors ] );
+
+ if( !AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter + iNumberOfDoctors ] ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\speck.sti" );
+ AddVideoObject( &VObjectDesc, (UINT32 *)&giAutoBandagesSoldierFaces[ iCounter + iNumberOfDoctors ] );
+ }
+
}
}
diff --git a/Tactical/Campaign.cpp b/Tactical/Campaign.cpp
index 709529a1..cef37da9 100644
--- a/Tactical/Campaign.cpp
+++ b/Tactical/Campaign.cpp
@@ -779,7 +779,7 @@ void ChangeStat( MERCPROFILESTRUCT *pProfile, SOLDIERTYPE *pSoldier, UINT8 ubSta
// DEF: 03/06/99 Now sets an event that will be processed later in the day
// ubEmailOffset = MERC_UP_LEVEL_BIFF + MERC_UP_LEVEL_LENGTH_BIFF * ( ubMercMercIdValue );
// AddEmail( ubEmailOffset, MERC_UP_LEVEL_LENGTH_BIFF, SPECK_FROM_MERC, GetWorldTotalMin() );
-
+
AddStrategicEvent( EVENT_MERC_MERC_WENT_UP_LEVEL_EMAIL_DELAY, GetWorldTotalMin( ) + 60 + Random( 60 ), ubMercMercIdValue );
fChangeSalary = TRUE;
@@ -1996,57 +1996,55 @@ void MERCMercWentUpALevelSendEmail( UINT8 ubMercMercIdValue )
// Read from EmailMercAvailable.xml
if ( ReadXMLEmail == TRUE )
{
- oMerc = ubMercMercIdValue;
- iMerc = oMerc * 1;
-
- if ( oMerc != 0 )
- pMerc = oMerc + 1;
- else
- pMerc = 0;
- if ( gProfilesMERC[ubMercMercIdValue].ProfilId == ubMercMercIdValue )
- AddEmailTypeXML( pMerc, iMerc, iMerc, GetWorldTotalMin(), -1 , TYPE_EMAIL_MERC_LEVEL_UP);
+ oMerc = ubMercMercIdValue;
+ iMerc = oMerc * 1;
+
+ if ( oMerc != 0 )
+ pMerc = oMerc + 1;
+ else
+ pMerc = 0;
+ if ( gProfilesMERC[ubMercMercIdValue].ProfilId == ubMercMercIdValue )
+ AddEmailTypeXML( pMerc, iMerc, iMerc, GetWorldTotalMin(), -1 , TYPE_EMAIL_MERC_LEVEL_UP);
}
else
{
- // TODO.RW: This workaround should not be needed anymore, because we now have all the emails externalized to XML files (TableData\Email)
-
- // Read from Email.edt and sender (nickname) from MercProfiles.xml
- // WANNE: TODO: Tex, Biggins, Stoggy and Gaston have special handling because they are the new MERC merc in 1.13
- // There is no letter template in Email.edt. We have them hardcoded in the source code.
- if (ubMercMercIdValue == 124 || ubMercMercIdValue == 125 || ubMercMercIdValue == 126 || ubMercMercIdValue == 127)
+ // Read from Email.edt and sender (nickname) from MercProfiles.xml
+ // WANNE: TODO: Tex, Biggins, Stoggy and Gaston have special handling because they are the new MERC merc in 1.13
+ // There is no letter template in Email.edt. We have them hardcoded in the source code.
+ if (ubMercMercIdValue == 124 || ubMercMercIdValue == 125 || ubMercMercIdValue == 126 || ubMercMercIdValue == 127)
+ {
+ // Gaston
+ if (ubMercMercIdValue == 124)
{
- // Gaston
- if (ubMercMercIdValue == 124)
- {
- ubEmailOffset = MERC_UP_LEVEL_BIFF;
- iMsgLength = MERC_UP_LEVEL_GASTON;
- }
- // Stogie
- else if (ubMercMercIdValue == 125)
- {
- ubEmailOffset = MERC_UP_LEVEL_BIFF;
- iMsgLength = MERC_UP_LEVEL_STOGIE;
- }
- // Tex
- else if (ubMercMercIdValue == 126)
- {
- ubEmailOffset = MERC_UP_LEVEL_BIFF;
- iMsgLength = MERC_UP_LEVEL_TEX;
- }
- // Biggens
- else if (ubMercMercIdValue == 127)
- {
- ubEmailOffset = MERC_UP_LEVEL_BIFF;
- iMsgLength = MERC_UP_LEVEL_BIGGENS;
- }
+ ubEmailOffset = MERC_UP_LEVEL_BIFF;
+ iMsgLength = MERC_UP_LEVEL_GASTON;
}
- else
+ // Stogie
+ else if (ubMercMercIdValue == 125)
{
- iMsgLength = MERC_UP_LEVEL_LENGTH_BIFF;
- ubEmailOffset = MERC_UP_LEVEL_BIFF + MERC_UP_LEVEL_LENGTH_BIFF * ( ubMercMercIdValue );
+ ubEmailOffset = MERC_UP_LEVEL_BIFF;
+ iMsgLength = MERC_UP_LEVEL_STOGIE;
}
+ // Tex
+ else if (ubMercMercIdValue == 126)
+ {
+ ubEmailOffset = MERC_UP_LEVEL_BIFF;
+ iMsgLength = MERC_UP_LEVEL_TEX;
+ }
+ // Biggens
+ else if (ubMercMercIdValue == 127)
+ {
+ ubEmailOffset = MERC_UP_LEVEL_BIFF;
+ iMsgLength = MERC_UP_LEVEL_BIGGENS;
+ }
+ }
+ else
+ {
+ iMsgLength = MERC_UP_LEVEL_LENGTH_BIFF;
+ ubEmailOffset = MERC_UP_LEVEL_BIFF + MERC_UP_LEVEL_LENGTH_BIFF * ( ubMercMercIdValue );
+ }
- AddEmail( ubEmailOffset, iMsgLength, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT_NAME_MERC);
+ AddEmail( ubEmailOffset, iMsgLength, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1, TYPE_EMAIL_EMAIL_EDT_NAME_MERC);
}
#endif
diff --git a/Tactical/Dialogue Control.cpp b/Tactical/Dialogue Control.cpp
index 6a4db2c3..19b17dc3 100644
--- a/Tactical/Dialogue Control.cpp
+++ b/Tactical/Dialogue Control.cpp
@@ -2222,12 +2222,12 @@ void DisplayTextForExternalNPC( UINT8 ubCharacterNum, STR16 zQuoteStr )
if ( guiCurrentScreen == MAP_SCREEN )
{
- sLeft = ( gsExternPanelXPosition + 97 );
+ sLeft = ( gsExternPanelXPosition + 97 + xResOffset );
gsTopPosition = gsExternPanelYPosition;
}
else
{
- sLeft = ( 110 );
+ sLeft = ( 110 + xResOffset );
}
ExecuteTacticalTextBox( sLeft, gTalkPanel.zQuoteStr );
@@ -2250,8 +2250,16 @@ void HandleTacticalTextUI( INT32 iFaceIndex, SOLDIERTYPE *pSoldier, STR16 zQuote
#else
swprintf( zText, L"\"%s\"", zQuoteStr );
#endif
- sLeft = 110;
+ // TODO.RW: Wenn wir in tactical sind, dann normal. In strategy den offset dazurechnen!
+ if ( guiCurrentScreen == GAME_SCREEN )
+ {
+ sLeft = 110;
+ }
+ else
+ {
+ sLeft = 110 + xResOffset;
+ }
//previous version
//sLeft = 110;
@@ -2345,7 +2353,7 @@ void HandleExternNPCSpeechFace( INT32 iIndex )
if ( guiCurrentScreen != MAP_SCREEN )
{
// Setup video overlay!
- VideoOverlayDesc.sLeft = 10;
+ VideoOverlayDesc.sLeft = 10 + xResOffset;
VideoOverlayDesc.sTop = 20;
VideoOverlayDesc.sRight = VideoOverlayDesc.sLeft + 99;
VideoOverlayDesc.sBottom = VideoOverlayDesc.sTop + 98;
@@ -2357,7 +2365,7 @@ void HandleExternNPCSpeechFace( INT32 iIndex )
{
// Setup video overlay!
- VideoOverlayDesc.sLeft = gsExternPanelXPosition;
+ VideoOverlayDesc.sLeft = gsExternPanelXPosition + xResOffset;
VideoOverlayDesc.sTop = gsExternPanelYPosition;
VideoOverlayDesc.sRight = VideoOverlayDesc.sLeft + 99;
diff --git a/Tactical/Faces.cpp b/Tactical/Faces.cpp
index 692cbfc7..5cc14c65 100644
--- a/Tactical/Faces.cpp
+++ b/Tactical/Faces.cpp
@@ -180,6 +180,25 @@ INT32 InternalInitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitF
// Check if we are a big-face....
if ( uiInitFlags & FACE_BIGFACE )
{
+
+ if ( ( iFaceFileID < 100 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\b%02d.sti", iFaceFileID );
+ }
+ else if ( ( iFaceFileID > 99 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\b%03d.sti", iFaceFileID );
+ }
+ else if( iFaceFileID < 100 )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\b%02d.sti", iFaceFileID );
+ }
+ else if( iFaceFileID > 99 )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\b%03d.sti", iFaceFileID );
+ }
+
+ /*
// The filename is the profile ID!
if( iFaceFileID < 100 )
{
@@ -189,7 +208,7 @@ INT32 InternalInitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitF
{
sprintf( VObjectDesc.ImageFile, "FACES\\b%03d.sti", iFaceFileID );
}
-
+ */
// ATE: Check for profile - if elliot , use special face :)
if ( usMercProfileID == ELLIOT )
{
@@ -260,6 +279,106 @@ INT32 InternalInitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitF
if (gGameExternalOptions.fShowCamouflageFaces == TRUE )
{
+
+
+ if ( ( iFaceFileID < 100 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\%02d.sti", iFaceFileID );
+
+ if ( gCamoFace[usMercProfileID].gCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\WoodCamo\\%02d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gUrbanCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\UrbanCamo\\%02d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gDesertCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\DesertCamo\\%02d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gSnowCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\SnowCamo\\%02d.sti", iFaceFileID );
+ }
+
+ if (!FileExists(VObjectDesc.ImageFile))
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\%02d.sti", iFaceFileID );
+ }
+ else if ( ( iFaceFileID > 99 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\%03d.sti", iFaceFileID );
+
+ if ( gCamoFace[usMercProfileID].gCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\Woodcamo\\%03d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gUrbanCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\UrbanCamo\\%03d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gDesertCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\DesertCamo\\%03d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gSnowCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\SnowCamo\\%03d.sti", iFaceFileID );
+ }
+
+ if (!FileExists(VObjectDesc.ImageFile))
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\%03d.sti", iFaceFileID );
+ }
+ else if( iFaceFileID < 100 )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\%02d.sti", iFaceFileID );
+
+ if ( gCamoFace[usMercProfileID].gCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\WoodCamo\\%02d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gUrbanCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\UrbanCamo\\%02d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gDesertCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\DesertCamo\\%02d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gSnowCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\SnowCamo\\%02d.sti", iFaceFileID );
+ }
+
+ if (!FileExists(VObjectDesc.ImageFile))
+ sprintf( VObjectDesc.ImageFile, "FACES\\%02d.sti", iFaceFileID );
+ }
+ else if( iFaceFileID > 99 )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\%03d.sti", iFaceFileID );
+
+ if ( gCamoFace[usMercProfileID].gCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\Woodcamo\\%03d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gUrbanCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\UrbanCamo\\%03d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gDesertCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\DesertCamo\\%03d.sti", iFaceFileID );
+ }
+ else if ( gCamoFace[usMercProfileID].gSnowCamoface == TRUE )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\SnowCamo\\%03d.sti", iFaceFileID );
+ }
+
+ if (!FileExists(VObjectDesc.ImageFile))
+ sprintf( VObjectDesc.ImageFile, "FACES\\%03d.sti", iFaceFileID );
+ }
+
+ /*
if( iFaceFileID < 100 )
{
// The filename is the profile ID!
@@ -311,9 +430,29 @@ INT32 InternalInitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitF
sprintf( VObjectDesc.ImageFile, "FACES\\%03d.sti", iFaceFileID );
}
+ */
}
else if (gGameExternalOptions.fShowCamouflageFaces == FALSE )
{
+
+ if ( ( iFaceFileID < 100 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\%02d.sti", iFaceFileID );
+ }
+ else if ( ( iFaceFileID > 99 ) && ( gProfilesIMP[ usMercProfileID ].ProfilId == usMercProfileID ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFACES\\%03d.sti", iFaceFileID );
+ }
+ else if( iFaceFileID < 100 )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\%02d.sti", iFaceFileID );
+ }
+ else if( iFaceFileID > 99 )
+ {
+ sprintf( VObjectDesc.ImageFile, "FACES\\%03d.sti", iFaceFileID );
+ }
+
+ /*
if( iFaceFileID < 100 )
{
// The filename is the profile ID!
@@ -323,6 +462,7 @@ INT32 InternalInitFace( UINT8 usMercProfileID, UINT8 ubSoldierID, UINT32 uiInitF
{
sprintf( VObjectDesc.ImageFile, "FACES\\%03d.sti", iFaceFileID );
}
+ */
}
}
diff --git a/Tactical/Handle Items.cpp b/Tactical/Handle Items.cpp
index 273fb5a9..a2ccf165 100644
--- a/Tactical/Handle Items.cpp
+++ b/Tactical/Handle Items.cpp
@@ -2292,6 +2292,11 @@ OBJECTTYPE* InternalAddItemToPool( INT32 *psGridNo, OBJECTTYPE *pObject, INT8 bV
// IF SO, DONT'T ADD!
bTerrainID = GetTerrainType( *psGridNo );
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+ if ( TERRAIN_IS_WATER( bTerrainID) && ubLevel > 0 )
+ bTerrainID = FLAT_GROUND;
+
if ( TERRAIN_IS_WATER( bTerrainID) )
{
// if ( Item[ pObject->usItem ].fFlags & ITEM_SINKS )
diff --git a/Tactical/Handle UI.cpp b/Tactical/Handle UI.cpp
index 281819a0..c7e12d60 100644
--- a/Tactical/Handle UI.cpp
+++ b/Tactical/Handle UI.cpp
@@ -1002,13 +1002,20 @@ void SetUIMouseCursor( )
if ( fOkForExit )
{
- if ( gfUIConfirmExitArrows )
+ if ( gGameExternalOptions.fGridExitInTurnBased || ( gTacticalStatus.uiFlags & REALTIME ) || !( gTacticalStatus.uiFlags & INCOMBAT ) )
{
- guiNewUICursor = CONFIRM_EXIT_GRID_UICURSOR;
+ if ( gfUIConfirmExitArrows )
+ {
+ guiNewUICursor = CONFIRM_EXIT_GRID_UICURSOR;
+ }
+ else
+ {
+ guiNewUICursor = EXIT_GRID_UICURSOR;
+ }
}
else
{
- guiNewUICursor = EXIT_GRID_UICURSOR;
+ guiNewUICursor = NOEXIT_GRID_UICURSOR;
}
}
else
diff --git a/Tactical/Interface Enhanced.cpp b/Tactical/Interface Enhanced.cpp
index b2eda8bd..3de0b115 100644
--- a/Tactical/Interface Enhanced.cpp
+++ b/Tactical/Interface Enhanced.cpp
@@ -113,7 +113,7 @@ extern void HelpTextDoneCallback( void );
UINT8 UsingEDBSystem()
{
- if(iResolution == 0) //640x480, never allow EDB
+ if (iResolution >= _640x480 && iResolution < _800x600) //640x480, never allow EDB
return 0;
if(gGameSettings.fOptions[ TOPTION_ENHANCED_DESC_BOX ] == TRUE)
@@ -212,6 +212,9 @@ void InitEDBCoords(OBJECTTYPE * pObject)
// CONS text
gItemDescTextRegions[6].sLeft = 50 + UDBOffsetX; gItemDescTextRegions[6].sTop = 292 + UDBOffsetY; gItemDescTextRegions[6].sRight = 230 + UDBOffsetX; gItemDescTextRegions[6].sBottom = 300 + UDBOffsetY;
+ // Flugente FTW 1: Temperature. Is displayed between Weight and the PROS label, so the indexes should be moved... but it is unclear if this description is needed, anyway
+ gItemDescTextRegions[7].sLeft = 20 + UDBOffsetX; gItemDescTextRegions[7].sTop = 254 + UDBOffsetY; gItemDescTextRegions[7].sRight = 230 + UDBOffsetX; gItemDescTextRegions[7].sBottom = 262 + UDBOffsetY;
+
////////////////// MONEY TEXT COORDINATES
gMoneyStats[0].sX = 20 + UDBOffsetX; gMoneyStats[0].sY = 230 + UDBOffsetY; // Money
gMoneyStats[1].sX = 63 + UDBOffsetX; gMoneyStats[1].sY = 230 + UDBOffsetY; // Remaining
@@ -509,6 +512,11 @@ void InitEDBCoords(OBJECTTYPE * pObject)
gItemDescAdvRegions[11][1].sLeft = 130 + UDBOffsetX; gItemDescAdvRegions[11][1].sTop = 281 + UDBOffsetY; gItemDescAdvRegions[11][1].sRight = 157 + UDBOffsetX; gItemDescAdvRegions[11][1].sBottom = 293 + UDBOffsetY;
gItemDescAdvRegions[11][2].sLeft = 162 + UDBOffsetX; gItemDescAdvRegions[11][2].sTop = 281 + UDBOffsetY; gItemDescAdvRegions[11][2].sRight = 189 + UDBOffsetX; gItemDescAdvRegions[11][2].sBottom = 293 + UDBOffsetY;
gItemDescAdvRegions[11][3].sLeft = 194 + UDBOffsetX; gItemDescAdvRegions[11][3].sTop = 281 + UDBOffsetY; gItemDescAdvRegions[11][3].sRight = 221 + UDBOffsetX; gItemDescAdvRegions[11][3].sBottom = 293 + UDBOffsetY;
+
+ gItemDescAdvRegions[12][0].sLeft = 12 + UDBOffsetX; gItemDescAdvRegions[12][0].sTop = 294 + UDBOffsetY; gItemDescAdvRegions[12][0].sRight = 126 + UDBOffsetX; gItemDescAdvRegions[12][0].sBottom = 306 + UDBOffsetY;
+ gItemDescAdvRegions[12][1].sLeft = 130 + UDBOffsetX; gItemDescAdvRegions[12][1].sTop = 294 + UDBOffsetY; gItemDescAdvRegions[12][1].sRight = 157 + UDBOffsetX; gItemDescAdvRegions[12][1].sBottom = 306 + UDBOffsetY;
+ gItemDescAdvRegions[12][2].sLeft = 162 + UDBOffsetX; gItemDescAdvRegions[12][2].sTop = 294 + UDBOffsetY; gItemDescAdvRegions[12][2].sRight = 189 + UDBOffsetX; gItemDescAdvRegions[12][2].sBottom = 306 + UDBOffsetY;
+ gItemDescAdvRegions[12][3].sLeft = 194 + UDBOffsetX; gItemDescAdvRegions[12][3].sTop = 294 + UDBOffsetY; gItemDescAdvRegions[12][3].sRight = 221 + UDBOffsetX; gItemDescAdvRegions[12][3].sBottom = 306 + UDBOffsetY;
}
else // ODB
{
@@ -894,7 +902,8 @@ void InitLBECoords()
gLBEStats[18].sX = 694; gLBEStats[18].sY = 33; gLBEStats[18].sValDx = 0; //Vest 7
gLBEStats[19].sX = 730; gLBEStats[19].sY = 33; gLBEStats[19].sValDx = 0; //Vest 8
gLBEStats[20].sX = 766; gLBEStats[20].sY = 33; gLBEStats[20].sValDx = 0; //Vest 9
- if(iResolution == 2)
+
+ if (iResolution >= _1024x768)
{
gLBEStats[16].sX = 802; gLBEStats[16].sY = 9; gLBEStats[16].sValDx = 0; //Vest 5
gLBEStats[21].sX = 802; gLBEStats[21].sY = 33; gLBEStats[21].sValDx = 0; //Vest 10
@@ -908,6 +917,7 @@ void InitLBECoords()
gLBEStats[22].sX = 724; gLBEStats[22].sY = 57; gLBEStats[22].sValDx = 0; //Vest 11
gLBEStats[23].sX = 724; gLBEStats[23].sY = 81; gLBEStats[23].sValDx = 0; //Vest 12
}
+
gLBEStats[24].sX = 658; gLBEStats[24].sY = 9; gLBEStats[24].sValDx = 0; //CPack 1
gLBEStats[25].sX = 694; gLBEStats[25].sY = 9; gLBEStats[25].sValDx = 0; //CPack 2
gLBEStats[26].sX = 658; gLBEStats[26].sY = 33; gLBEStats[26].sValDx = 0; //CPack 3
@@ -957,7 +967,8 @@ void InitLBECoords()
gLBEStats[19].sX = 669; gLBEStats[19].sY = 33; gLBEStats[19].sValDx = 0; //Vest 8
gLBEStats[20].sX = 705; gLBEStats[20].sY = 33; gLBEStats[20].sValDx = 0; //Vest 9
gLBEStats[21].sX = 741; gLBEStats[21].sY = 33; gLBEStats[21].sValDx = 0; //Vest 10
- if(iResolution == 2)
+
+ if (iResolution >= _1024x768)
{
gLBEStats[22].sX = 777; gLBEStats[22].sY = 9; gLBEStats[22].sValDx = 0; //Vest 11
gLBEStats[23].sX = 777; gLBEStats[23].sY = 33; gLBEStats[23].sValDx = 0; //Vest 12
@@ -1687,7 +1698,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
CHAR16 pStr[1000];
///////////////// PRIMARY DATA - ICONS
- for (cnt = 0; cnt < 3; cnt++)
+ for (cnt = 0; cnt < 4; cnt++)
{
MSYS_DefineRegion( &gUDBFasthelpRegions[ iRegionsCreated ],
(INT16)(gItemDescGenRegions[cnt][0].sLeft),
@@ -1765,7 +1776,7 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
CHAR16 pStr[1000];
///////////////// PRIMARY DATA - ICONS
- for (cnt = 0; cnt < 3; cnt++)
+ for (cnt = 0; cnt < 4; cnt++)
{
MSYS_DefineRegion( &gUDBFasthelpRegions[ iRegionsCreated ],
(INT16)(gItemDescGenRegions[cnt][0].sLeft),
@@ -1798,6 +1809,13 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 2 ] );
}
+ if ( gGameOptions.fWeaponOverheating ) // Flugente FTW 1.1
+ {
+ //////////////////// TEMPERATURE MODIFICATOR
+ {
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + 3 ] );
+ }
+ }
}
}
@@ -3478,6 +3496,218 @@ void InternalInitEDBTooltipRegion( OBJECTTYPE * gpItemDescObject, UINT32 guiCurr
}
}
+ // Flugente FTW 1.1:
+ if ( gGameOptions.fWeaponOverheating )
+ {
+ if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), gzUDBGenIndexTooltipText[ 0 ] );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+
+ iRegionsCreated++;
+
+ for (cnt2 = 1; cnt2 < 4; cnt2++)
+ {
+ MSYS_DefineRegion( &gUDBFasthelpRegions[ iRegionsCreated ],
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sLeft),
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sTop),
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sRight),
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sBottom),
+ MSYS_PRIORITY_HIGHEST, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, ItemDescCallback );
+
+ MSYS_AddRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]);
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), gzUDBGenIndexTooltipText[ cnt2 ] );
+ SetRegionHelpEndCallback( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), HelpTextDoneCallback );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2] );
+
+ iRegionsCreated++;
+ }
+ }
+ ++cnt;
+
+ ///////////////////// SINGLE SHOT TEMPERATURE
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_WEAPON|IC_PUNCH))
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 48 ], szUDBAdvStatsExplanationsTooltipTextForWeapons[ 48 ]);
+ }
+ else
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 48 ], szUDBAdvStatsExplanationsTooltipText[ 48 ]);
+ }
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+ }
+ cnt++;
+
+ ///////////////////// COOLDOWN FACTOR
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_WEAPON|IC_PUNCH))
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 49 ], szUDBAdvStatsExplanationsTooltipTextForWeapons[ 49 ]);
+ }
+ else
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 49 ], szUDBAdvStatsExplanationsTooltipText[ 49 ]);
+ }
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+ }
+ cnt++;
+
+ ///////////////////// JAM THRESHOLD
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_WEAPON|IC_PUNCH))
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 50 ], szUDBAdvStatsExplanationsTooltipTextForWeapons[ 50 ]);
+ }
+ else
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 50 ], szUDBAdvStatsExplanationsTooltipText[ 50 ]);
+ }
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+ }
+ cnt++;
+
+ ///////////////////// DAMAGE THRESHOLD
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ if (Item[ gpItemDescObject->usItem ].usItemClass & (IC_WEAPON|IC_PUNCH))
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 51 ], szUDBAdvStatsExplanationsTooltipTextForWeapons[ 51 ]);
+ }
+ else
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 51 ], szUDBAdvStatsExplanationsTooltipText[ 51 ]);
+ }
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+ }
+ cnt++;
+ }
+ else if ( Item[gpItemDescObject->usItem].barrel == TRUE ) // for barrel items
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), gzUDBGenIndexTooltipText[ 0 ] );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+
+ iRegionsCreated++;
+
+ for (cnt2 = 1; cnt2 < 4; cnt2++)
+ {
+ MSYS_DefineRegion( &gUDBFasthelpRegions[ iRegionsCreated ],
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sLeft),
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sTop),
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sRight),
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sBottom),
+ MSYS_PRIORITY_HIGHEST, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, ItemDescCallback );
+
+ MSYS_AddRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]);
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), gzUDBGenIndexTooltipText[ cnt2 ] );
+ SetRegionHelpEndCallback( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), HelpTextDoneCallback );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2] );
+
+ iRegionsCreated++;
+ }
+ }
+ ++cnt;
+
+ ///////////////////// COOLDOWN FACTOR
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 49 ], szUDBAdvStatsExplanationsTooltipText[ 49 ]);
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+ }
+ cnt++;
+ }
+
+ // other stuff: various overheat modificators
+ if ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), gzUDBGenIndexTooltipText[ 0 ] );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+
+ iRegionsCreated++;
+
+ for (cnt2 = 1; cnt2 < 4; cnt2++)
+ {
+ MSYS_DefineRegion( &gUDBFasthelpRegions[ iRegionsCreated ],
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sLeft),
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sTop),
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sRight),
+ (INT16)(gItemDescAdvIndexRegions[cnt-sFirstLine][cnt2].sBottom),
+ MSYS_PRIORITY_HIGHEST, MSYS_NO_CURSOR, MSYS_NO_CALLBACK, ItemDescCallback );
+
+ MSYS_AddRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]);
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), gzUDBGenIndexTooltipText[ cnt2 ] );
+ SetRegionHelpEndCallback( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2]), HelpTextDoneCallback );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) + cnt2] );
+
+ iRegionsCreated++;
+ }
+ }
+ ++cnt;
+
+ ///////////////////// TEMPERATURE MODIFICATOR
+ if ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 52 ], szUDBAdvStatsExplanationsTooltipText[ 52 ]);
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+ }
+ cnt++;
+ }
+
+ ///////////////////// COOLDOWN FACTOR MODIFICATOR
+ if ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 53 ], szUDBAdvStatsExplanationsTooltipText[ 53 ]);
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+ }
+ cnt++;
+ }
+
+ ///////////////////// JAM THRESHOLD MODIFICATOR
+ if ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 54 ], szUDBAdvStatsExplanationsTooltipText[ 54 ]);
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+ }
+ cnt++;
+ }
+
+ ///////////////////// DAMAGE THRESHOLD MODIFICATOR
+ if ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ swprintf( pStr, L"%s%s", szUDBAdvStatsTooltipText[ 55 ], szUDBAdvStatsExplanationsTooltipText[ 55 ]);
+ SetRegionFastHelpText( &(gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ]), pStr );
+ MSYS_EnableRegion( &gUDBFasthelpRegions[ iFirstDataRegion + (cnt-sFirstLine) ] );
+ }
+ cnt++;
+ }
+ }
+ }
+
gubDescBoxTotalAdvLines = (UINT8)cnt;
}
}
@@ -3759,6 +3989,14 @@ void DrawAmmoStats( OBJECTTYPE * gpItemDescObject )
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAmmoIcon, 2, gItemDescGenRegions[2][0].sLeft+sOffsetX, gItemDescGenRegions[2][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
}
+ if ( gGameOptions.fWeaponOverheating ) // Flugente FTW 1.1
+ {
+ //////////////// TEMPERATURE MODIFICATOR
+ {
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAmmoIcon, 16, gItemDescGenRegions[3][0].sLeft+sOffsetX, gItemDescGenRegions[3][0].sTop+sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
+ }
+ }
+
DrawSecondaryStats( gpItemDescObject );
}
else if (gubDescBoxPage == 2)
@@ -4523,6 +4761,98 @@ void DrawAdvancedStats( OBJECTTYPE * gpItemDescObject )
cnt++;
}
}
+
+
+ // Flugente FTW 1.1
+ if ( gGameOptions.fWeaponOverheating )
+ {
+ if( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
+ {
+ ++cnt; // for the new index-line
+ ///////////////////// SINGLE SHOT TEMPERATURE
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 51, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
+ }
+ cnt++;
+
+ ///////////////////// COOLDOWN FACTOR
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 47, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
+ }
+ cnt++;
+
+ ///////////////////// JAM THRESHOLD
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 45, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
+ }
+ cnt++;
+
+ ///////////////////// DAMAGE THRESHOLD
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 46, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
+ }
+ cnt++;
+ }
+ else if( Item[gpItemDescObject->usItem].barrel == TRUE ) // for barrel items
+ {
+ ++cnt; // for the new index-line
+ ///////////////////// COOLDOWN FACTOR
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 47, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
+ }
+ cnt++;
+ }
+
+ // for overheat modifiers on attachments and wherenot
+ if ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) )
+ {
+ ++cnt; // for the new index-line
+ ///////////////////// TEMPERATURE MODIFICATOR
+ if ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 44, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
+ }
+ cnt++;
+ }
+
+ ///////////////////// COOLDOWN FACTOR MODIFICATOR
+ if ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 48, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
+ }
+ cnt++;
+ }
+
+ ///////////////////// JAM THRESHOLD MODIFICATOR
+ if ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 49, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
+ }
+ cnt++;
+ }
+
+ ///////////////////// DAMAGE THRESHOLD MODIFICATOR
+ if ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemInfoAdvancedIcon, 50, gItemDescAdvRegions[cnt-sFirstLine][0].sLeft + sOffsetX, gItemDescAdvRegions[cnt-sFirstLine][0].sTop + sOffsetY, VO_BLT_SRCTRANSPARENCY, NULL );
+ }
+ cnt++;
+ }
+ }
+ }
}
void DrawMiscStats( OBJECTTYPE * gpItemDescObject )
@@ -6632,6 +6962,68 @@ void DrawAmmoValues( OBJECTTYPE * gpItemDescObject, int shotsLeft )
FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
mprintf( usX, usY, pStr );
}
+
+
+ if ( gGameOptions.fWeaponOverheating ) // Flugente FTW 1.1
+ {
+ ///////////////////// TEMPERATURE MODIFICATOR
+ // Set line to draw into
+ ubNumLine = 3;
+ // Set Y coordinates
+ sTop = gItemDescGenRegions[ubNumLine][1].sTop;
+ sHeight = gItemDescGenRegions[ubNumLine][1].sBottom - sTop;
+
+ // base modificator
+ FLOAT basevalue = AmmoTypes[Magazine[ Item[ gpItemDescObject->usItem ].ubClassIndex].ubAmmoType].temperatureModificator;
+ FLOAT modificator = 0; // Does not exist (yet?)
+ FLOAT finalvalue = basevalue - modificator;
+
+ // Print base value
+ SetFontForeground( 5 );
+ if ( basevalue > 0.0 )
+ {
+ SetFontForeground( ITEMDESC_FONTNEGATIVE );
+ }
+ else if ( basevalue < 0.0 )
+ {
+ SetFontForeground( ITEMDESC_FONTPOSITIVE );
+ }
+ sLeft = gItemDescGenRegions[ubNumLine][1].sLeft;
+ sWidth = gItemDescGenRegions[ubNumLine][1].sRight - sLeft;
+ swprintf( pStr, L"%3.2f", basevalue );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ mprintf( usX, usY, pStr );
+
+ // modifier
+ SetFontForeground( 5 );
+ if ( modificator > 0 )
+ {
+ SetFontForeground( ITEMDESC_FONTNEGATIVE );
+ swprintf( pStr, L"%3.2f", modificator );
+ }
+ else if ( modificator < 0 )
+ {
+ SetFontForeground( ITEMDESC_FONTPOSITIVE );
+ swprintf( pStr, L"%3.2f", modificator );
+ }
+ else
+ {
+ swprintf( pStr, L"--" );
+ }
+
+ sLeft = gItemDescGenRegions[ubNumLine][2].sLeft;
+ sWidth = gItemDescGenRegions[ubNumLine][2].sRight - sLeft;
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ mprintf( usX, usY, pStr );
+
+ // Print final value
+ SetFontForeground( FONT_MCOLOR_WHITE );
+ sLeft = gItemDescGenRegions[ubNumLine][3].sLeft;
+ sWidth = gItemDescGenRegions[ubNumLine][3].sRight - sLeft;
+ swprintf( pStr, L"%3.2f", finalvalue );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ mprintf( usX, usY, pStr );
+ }
}
else if (gubDescBoxPage == 2)
{
@@ -9695,6 +10087,586 @@ void DrawAdvancedValues( OBJECTTYPE *gpItemDescObject )
}
cnt++;
}
+
+ // Flugente FTW 1.1
+ if ( gGameOptions.fWeaponOverheating )
+ {
+ if ( Item[gpItemDescObject->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
+ {
+ ///////////////////////////////////////////////////// INDEXES
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ SetFontForeground( FONT_MCOLOR_WHITE );
+
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ // Repeatedly draw each index: four separate column headers per index.
+ for (UINT8 i = 0; i < 4; i++)
+ {
+ // Select "PROPERTY", "0", "+" or "=" as appropriate.
+ swprintf(pStr, L"%s", gzItemDescGenIndexes[ i ]);
+
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][i].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][i].sRight - sLeft;
+
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+
+ mprintf( usX, usY, pStr );
+ }
+ }
+ ++cnt;
+
+ ///////////////////// SINGLE SHOT TEMPERATURE
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ iFloatModifier[0] = Weapon[ Item[gpItemDescObject->usItem].ubClassIndex].usOverheatingSingleShotTemperature;
+
+ iFloatModifier[1] = GetSingleShotTemperature( gpItemDescObject ) - iFloatModifier[0];
+ iFloatModifier[2] = GetSingleShotTemperature( gpItemDescObject );
+
+ // Print Values
+ for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
+ {
+ SetFontForeground( 5 );
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
+ if (iFloatModifier[cnt2] > 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTNEGATIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else if (iFloatModifier[cnt2] < 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTPOSITIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else
+ {
+ swprintf( pStr, L"--" );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ }
+ mprintf( usX, usY, pStr );
+ }
+ }
+ cnt++;
+
+ ///////////////////// COOLDOWN FACTOR
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ iFloatModifier[0] = Item[gpItemDescObject->usItem].usOverheatingCooldownFactor;
+ iFloatModifier[1] = GetItemCooldownFactor(gpItemDescObject) - iFloatModifier[0];
+ iFloatModifier[2] = GetItemCooldownFactor(gpItemDescObject);
+
+ // Print Values
+ for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
+ {
+ SetFontForeground( 5 );
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
+ if (iFloatModifier[cnt2] > 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTPOSITIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else if (iFloatModifier[cnt2] < 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTNEGATIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else
+ {
+ swprintf( pStr, L"--" );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ }
+ mprintf( usX, usY, pStr );
+ }
+ }
+ cnt++;
+
+ ///////////////////// JAM THRESHOLD
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ iFloatModifier[0] = Weapon[ Item[gpItemDescObject->usItem].ubClassIndex].usOverheatingJamThreshold;
+ iFloatModifier[1] = GetOverheatJamThreshold(gpItemDescObject) - iFloatModifier[0];
+ iFloatModifier[2] = GetOverheatJamThreshold(gpItemDescObject);
+
+ // Print Values
+ for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
+ {
+ SetFontForeground( 5 );
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
+ if (iFloatModifier[cnt2] > 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTPOSITIVE );
+
+ swprintf( pStr, L"%4.0f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else if (iFloatModifier[cnt2] < 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTNEGATIVE );
+
+ swprintf( pStr, L"%4.0f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else
+ {
+ swprintf( pStr, L"--" );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ }
+ mprintf( usX, usY, pStr );
+ }
+ }
+ cnt++;
+
+ ///////////////////// DAMAGE THRESHOLD
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ iFloatModifier[0] = Weapon[ Item[gpItemDescObject->usItem].ubClassIndex].usOverheatingDamageThreshold;
+ iFloatModifier[1] = GetOverheatDamageThreshold(gpItemDescObject) - iFloatModifier[0];
+ iFloatModifier[2] = GetOverheatDamageThreshold(gpItemDescObject);
+
+ // Print Values
+ for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
+ {
+ SetFontForeground( 5 );
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
+ if (iFloatModifier[cnt2] > 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTPOSITIVE );
+
+ swprintf( pStr, L"%4.0f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else if (iFloatModifier[cnt2] < 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTNEGATIVE );
+
+ swprintf( pStr, L"%4.0f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else
+ {
+ swprintf( pStr, L"--" );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ }
+ mprintf( usX, usY, pStr );
+ }
+ }
+ cnt++;
+
+ }
+ else if ( Item[gpItemDescObject->usItem].barrel == TRUE ) // display for barrel items
+ {
+ ///////////////////////////////////////////////////// INDEXES
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ SetFontForeground( FONT_MCOLOR_WHITE );
+
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ // Repeatedly draw each index: four separate column headers per index.
+ for (UINT8 i = 0; i < 4; i++)
+ {
+ // Select "PROPERTY", "0", "+" or "=" as appropriate.
+ swprintf(pStr, L"%s", gzItemDescGenIndexes[ i ]);
+
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][i].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][i].sRight - sLeft;
+
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+
+ mprintf( usX, usY, pStr );
+ }
+ }
+ ++cnt;
+
+ ///////////////////// COOLDOWN FACTOR
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ iFloatModifier[0] = Item[gpItemDescObject->usItem].usOverheatingCooldownFactor;
+ iFloatModifier[1] = GetItemCooldownFactor(gpItemDescObject) - iFloatModifier[0];
+ iFloatModifier[2] = GetItemCooldownFactor(gpItemDescObject);
+
+ // Print Values
+ for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
+ {
+ SetFontForeground( 5 );
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
+ if (iFloatModifier[cnt2] > 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTPOSITIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else if (iFloatModifier[cnt2] < 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTNEGATIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else
+ {
+ swprintf( pStr, L"--" );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ }
+ mprintf( usX, usY, pStr );
+ }
+ }
+ cnt++;
+ }
+
+ // various overheating modificators
+ if ( ( Item[gpItemDescObject->usItem].overheatTemperatureModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatCooldownModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatJamThresholdModificator != 0.0 ) || ( Item[gpItemDescObject->usItem].overheatDamageThresholdModificator != 0.0 ) )
+ {
+ ///////////////////////////////////////////////////// INDEXES
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ SetFontForeground( FONT_MCOLOR_WHITE );
+
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ // Repeatedly draw each index: four separate column headers per index.
+ for (UINT8 i = 0; i < 4; i++)
+ {
+ // Select "PROPERTY", "0", "+" or "=" as appropriate.
+ swprintf(pStr, L"%s", gzItemDescGenIndexes[ i ]);
+
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][i].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][i].sRight - sLeft;
+
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+
+ mprintf( usX, usY, pStr );
+ }
+ }
+ ++cnt;
+
+ ///////////////////// TEMPERATURE MODIFICATOR
+ iFloatModifier[0] = Item[gpItemDescObject->usItem].overheatTemperatureModificator;
+ iFloatModifier[1] = 0.0; // doesn't exist (yet?)
+ iFloatModifier[2] = iFloatModifier[0];
+
+ if ( iFloatModifier[0] != 0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ // Print Values
+ for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
+ {
+ SetFontForeground( 5 );
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
+ if (iFloatModifier[cnt2] > 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTNEGATIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else if (iFloatModifier[cnt2] < 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTPOSITIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else
+ {
+ swprintf( pStr, L"--" );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ }
+ mprintf( usX, usY, pStr );
+ }
+ }
+ cnt++;
+ }
+
+ ///////////////////// COOLDOWN FACTOR MODIFICATOR
+ iFloatModifier[0] = Item[gpItemDescObject->usItem].overheatCooldownModificator;
+ iFloatModifier[1] = 0.0; // doesn't exist (yet?)
+ iFloatModifier[2] = iFloatModifier[0];
+
+ if ( iFloatModifier[0] != 0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ // Print Values
+ for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
+ {
+ SetFontForeground( 5 );
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
+ if (iFloatModifier[cnt2] > 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTPOSITIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else if (iFloatModifier[cnt2] < 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTNEGATIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else
+ {
+ swprintf( pStr, L"--" );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ }
+ mprintf( usX, usY, pStr );
+ }
+ }
+ cnt++;
+ }
+
+ ///////////////////// JAM THRESHOLD FACTOR MODIFICATOR
+ iFloatModifier[0] = Item[gpItemDescObject->usItem].overheatJamThresholdModificator;
+ iFloatModifier[1] = 0.0; // doesn't exist (yet?)
+ iFloatModifier[2] = iFloatModifier[0];
+
+ if ( iFloatModifier[0] != 0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ // Print Values
+ for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
+ {
+ SetFontForeground( 5 );
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
+ if (iFloatModifier[cnt2] > 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTNEGATIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else if (iFloatModifier[cnt2] < 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTPOSITIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else
+ {
+ swprintf( pStr, L"--" );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ }
+ mprintf( usX, usY, pStr );
+ }
+ }
+ cnt++;
+ }
+
+ ///////////////////// DAMAGE THRESHOLD MODIFICATOR
+ iFloatModifier[0] = Item[gpItemDescObject->usItem].overheatDamageThresholdModificator;
+ iFloatModifier[1] = 0.0; // doesn't exist (yet?)
+ iFloatModifier[2] = iFloatModifier[0];
+
+ if ( iFloatModifier[0] != 0 )
+ {
+ if (cnt >= sFirstLine && cnt < sLastLine)
+ {
+ // Set Y coordinates
+ sTop = gItemDescAdvRegions[cnt-sFirstLine][1].sTop;
+ sHeight = gItemDescAdvRegions[cnt-sFirstLine][1].sBottom - sTop;
+
+ // Print Values
+ for (UINT8 cnt2 = 0; cnt2 < 3; cnt2++)
+ {
+ SetFontForeground( 5 );
+ sLeft = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sLeft;
+ sWidth = gItemDescAdvRegions[cnt-sFirstLine][cnt2+1].sRight - sLeft;
+ if (iFloatModifier[cnt2] > 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTNEGATIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else if (iFloatModifier[cnt2] < 0)
+ {
+ if ( cnt2 == 1 )
+ SetFontForeground( ITEMDESC_FONTPOSITIVE );
+
+ swprintf( pStr, L"%4.2f", iFloatModifier[cnt2] );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ #ifdef CHINESE
+ wcscat( pStr, ChineseSpecString1 );
+ #else
+ wcscat( pStr, L"%" );
+ #endif
+ }
+ else
+ {
+ swprintf( pStr, L"--" );
+ FindFontCenterCoordinates( sLeft, sTop, sWidth, sHeight, pStr, BLOCKFONT2, &usX, &usY);
+ }
+ mprintf( usX, usY, pStr );
+ }
+ }
+ cnt++;
+ }
+ }
+
+ }
}
void DrawMiscValues( OBJECTTYPE * gpItemDescObject )
diff --git a/Tactical/Interface Items.cpp b/Tactical/Interface Items.cpp
index e7acebc9..b618a5d5 100644
--- a/Tactical/Interface Items.cpp
+++ b/Tactical/Interface Items.cpp
@@ -139,6 +139,8 @@ INT16 ITEMDESC_WIDTH;
extern int SM_ITEMDESC_START_X;
extern int SM_ITEMDESC_START_Y;
+extern int INV_REGION_Y;
+
#define CAMO_REGION_HEIGHT 75
#define CAMO_REGION_WIDTH 75
@@ -411,6 +413,8 @@ extern void StartSKIDescriptionBox( void );
void UpdateItemHatches();
+void ShadowNIVPanel();
+
extern void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot );
UINT8 ubRGBItemCyclePlacedItemColors[] =
@@ -523,7 +527,7 @@ INV_DESC_REGIONS gItemDescGenHeaderRegions[3]; // Header text regions for variou
INV_DESC_REGIONS gItemDescGenIndexRegions[3][4]; // Index text regions for various parts of the General Tab
INV_DESC_REGIONS gItemDescGenRegions[NUM_UDB_GEN_LINES * 2][4]; // Data regions, 4 sub-columns each
INV_DESC_REGIONS gItemDescGenSecondaryRegions[26]; // Secondary data regions, 3x5
-INV_DESC_REGIONS gItemDescTextRegions[7]; // Main description regions
+INV_DESC_REGIONS gItemDescTextRegions[8]; // Main description regions
INV_DESC_REGIONS gItemDescAdvIndexRegions[1][4];
INV_DESC_REGIONS gItemDescAdvRegions[NUM_UDB_ADV_LINES][4]; // Advanced data regions, 4 sub-columns each
@@ -1035,7 +1039,8 @@ void InitInventoryNew()
ResetInvData();
- if(iResolution == 0){
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
InitInvData(gSMInvData[0], FALSE, INV_BAR_DX, INV_BAR_DY, HEAD_INV_SLOT_WIDTH, HEAD_INV_SLOT_HEIGHT, 0, 0); // HELMETPOS
InitInvData(gSMInvData[1], FALSE, INV_BAR_DX, INV_BAR_DY, VEST_INV_SLOT_WIDTH, VEST_INV_SLOT_HEIGHT, 0, 0); // VESTPOS
InitInvData(gSMInvData[2], FALSE, INV_BAR_DX, INV_BAR_DY, LEGS_INV_SLOT_WIDTH, LEGS_INV_SLOT_HEIGHT, 0, 0); // LEGPOS
@@ -1679,14 +1684,14 @@ void INVRenderINVPanelItem( SOLDIERTYPE *pSoldier, INT16 sPocket, UINT8 fDirtyLe
// CHRISL: Change coords for STI that covers 2nd hand location when carrying a 2handed weapon
if( guiCurrentItemDescriptionScreen != MAP_SCREEN )
{
- newX = ((UsingNewInventorySystem() == false)) ? 217 : 114;
+ newX = ((UsingNewInventorySystem() == false)) ? (xResOffset + 217) : ((SCREEN_WIDTH - xResSize)/2 + 114);
newY = ((UsingNewInventorySystem() == false)) ? sY : (sY - 1);
BltVideoObjectFromIndex( guiSAVEBUFFER, guiSecItemHiddenVO, UsingNewInventorySystem(), newX, newY, VO_BLT_SRCTRANSPARENCY, NULL );
RestoreExternBackgroundRect( newX, newY, 72, 28 );
}
else
- {
- newX = ((UsingNewInventorySystem() == false)) ? 14 : 6;
+ {
+ newX = ((UsingNewInventorySystem() == false)) ? (14 + xResOffset) : (6 + xResOffset);
newY = ((UsingNewInventorySystem() == false)) ? 218 : 217;
BltVideoObjectFromIndex( guiSAVEBUFFER, guiMapInvSecondHandBlockout, UsingNewInventorySystem(), newX, newY, VO_BLT_SRCTRANSPARENCY, NULL );
RestoreExternBackgroundRect( newX, newY, 102, 24 );
@@ -2638,6 +2643,33 @@ void INVRenderSilhouette( UINT32 uiBuffer, INT16 PocketIndex, INT16 SilIndex, IN
}
}
+// Flugente FTW 1: Function to get the number of the item condition string
+UINT8 GetTemperatureString( FLOAT overheatpercentage, UINT32* apRed, UINT32* apGreen, UINT32* abBlue )
+{
+ *apRed = (UINT32) ( 100 + 155 * ( (max(1.0, overheatpercentage) - 1.0)/(max(1.0, overheatpercentage)) ) );
+ *apGreen = 0;
+ *abBlue = 0;
+
+ if (overheatpercentage < 0.17) // very low
+ return 0;
+ else if (overheatpercentage < 0.33) // low
+ return 1;
+ else if (overheatpercentage < 0.5) // medium
+ return 2;
+ else if (overheatpercentage < 0.67) // high
+ return 3;
+ else if (overheatpercentage < 0.83) // very high
+ return 4;
+ else if (overheatpercentage < 1.0) // dangerous
+ return 5;
+ else if (overheatpercentage < 2.0) // CRITICAL
+ return 6;
+ else // DRAMATIC
+ return 7;
+
+ // Default: unknown
+ return 8;
+}
void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObject, INT16 sX, INT16 sY, INT16 sWidth, INT16 sHeight, UINT8 fDirtyLevel, UINT8 *pubHighlightCounter, UINT8 ubStatusIndex, BOOLEAN fOutline, INT16 sOutlineColor, UINT8 iter )
{
@@ -2743,6 +2775,10 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
sNewY = sY + sHeight - 10;
sNewX = sX + 1;
+ // Flugente: If we display the thermometer for overheating, move the ammo counter a bit to the right
+ if ( gGameOptions.fWeaponOverheating == TRUE && gGameExternalOptions.fDisplayOverheatThermometer == TRUE )
+ sNewX = sX + 6;
+
SetFontForeground ( AmmoTypes[(*pObject)[iter]->data.gun.ubGunAmmoType].fontColour );
//switch ((*pObject)[iter]->data.gun.ubGunAmmoType)
//{
@@ -2790,6 +2826,8 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
mprintf( sNewX, sNewY, pStr );
gprintfinvalidate( sNewX, sNewY, pStr );
+ sNewX = sX + 1;
+
SetFontForeground( FONT_MCOLOR_DKGRAY );
// Display 'JAMMED' if we are jammed
@@ -2866,7 +2904,41 @@ void INVRenderItem( UINT32 uiBuffer, SOLDIERTYPE * pSoldier, OBJECTTYPE *pObjec
}
mprintf( sNewX, sNewY, pStr );
gprintfinvalidate( sNewX, sNewY, pStr );
+ }
+ // Flugente FTW 1
+ if ( gGameOptions.fWeaponOverheating == TRUE && gGameExternalOptions.fDisplayOverheatThermometer == TRUE && ( pItem->usItemClass & (IC_GUN | IC_LAUNCHER) || Item[pObject->usItem].barrel == TRUE ) )
+ {
+ FLOAT overheatjampercentage = GetGunOverheatJamPercentage( pObject);
+
+ UINT32 red, green, blue;
+ UINT8 TemperatureStringNum = GetTemperatureString( overheatjampercentage, &red, &green, &blue );
+
+ UINT16 colour = Get16BPPColor( FROMRGB( red, green, blue ) );
+
+ DrawItemUIBarEx( pObject, DRAW_ITEM_TEMPERATURE, sX, sY + sHeight-1, ITEMDESC_ITEM_STATUS_WIDTH, sHeight-1, colour, colour, TRUE, guiSAVEBUFFER );
+ }
+
+ // display symbol if we are leaning our weapon on something
+ // display only if eapon resting is allowed, display is allowed, item is a gun/launcher, we are a person, we hold the gun in our hand, and we are resting the gun
+ if ( gGameExternalOptions.fWeaponResting && gGameExternalOptions.fDisplayWeaponRestingIndicator && pItem->usItemClass & (IC_GUN | IC_LAUNCHER) && pSoldier && pSoldier->bActive && pSoldier->bInSector && &(pSoldier->inv[pSoldier->ubAttackingHand]) == pObject && pSoldier->IsWeaponMounted() )
+ {
+ SetRGBFontForeground( 95, 160, 154 );
+
+ sNewY = sY + sHeight - 24;
+ swprintf( pStr, L"M" );
+
+ // Get length of string
+ uiStringLength=StringPixLength(pStr, ITEM_FONT );
+
+ sNewX = sX + 25;
+
+ if ( uiBuffer == guiSAVEBUFFER )
+ {
+ RestoreExternBackgroundRect( sNewX, sNewY, 15, 15 );
+ }
+ mprintf( sNewX, sNewY, pStr );
+ gprintfinvalidate( sNewX, sNewY, pStr );
}
if((UsingNewInventorySystem() == true))
@@ -3085,7 +3157,7 @@ void InitItemDescriptionBoxStartCoords( BOOLEAN fIsEnhanced, BOOLEAN fUsingNAS )
if(fUsingNAS){
if( UsingNewInventorySystem() == true ) // NIV
{
- ITEMDESC_START_X = 115;
+ ITEMDESC_START_X = INTERFACE_START_X + 115;
ITEMDESC_START_Y = (1 + INV_INTERFACE_START_Y);
ITEMDESC_HEIGHT = 195;
ITEMDESC_WIDTH = 335;
@@ -3094,53 +3166,46 @@ void InitItemDescriptionBoxStartCoords( BOOLEAN fIsEnhanced, BOOLEAN fUsingNAS )
{
ITEMDESC_HEIGHT = 193;
ITEMDESC_WIDTH = 430;
- ITEMDESC_START_X = 214;
+ ITEMDESC_START_X = INTERFACE_START_X + 214;
ITEMDESC_START_Y = (1-(ITEMDESC_HEIGHT-INV_INTERFACE_HEIGHT) + INV_INTERFACE_START_Y);
}
if(UsingNewInventorySystem() == true && (guiCurrentScreen == GAME_SCREEN || guiCurrentScreen == SHOPKEEPER_SCREEN))
{
- if(iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
ITEMDESC_WIDTH = 526;
- else if(iResolution == 1)
+ else if (iResolution < _1024x768)
ITEMDESC_WIDTH = 686;
- else if(iResolution == 2)
+ else
ITEMDESC_WIDTH = 910;
}
//CHRISL: This allows EDB to work in Strategic OIV mode
if(guiCurrentScreen == MAP_SCREEN)
{
- if(iResolution == 0) // 640x480 res
+ if (iResolution >= _640x480 && iResolution < _800x600)
ITEMDESC_HEIGHT = 268;
- else if(iResolution == 2 || UsingNewInventorySystem() == true) // 1024x768 or NIV
+ else if(iResolution >= _1024x768 || UsingNewInventorySystem() == true) // 1024x768 or NIV
ITEMDESC_HEIGHT = 490;
- else if(iResolution == 1) // 800x600
+ else if (iResolution < _1024x768)
ITEMDESC_HEIGHT = (mode > 0) ? 490 : 373;
- ITEMDESC_WIDTH = ((UsingNewInventorySystem() == true && iResolution != 0)) ? 272 : 272;
+
+ ITEMDESC_WIDTH = ((UsingNewInventorySystem() == true && iResolution >= _800x600)) ? 272 : 272;
}
- } else {
+ }
+ else
+ {
if( UsingNewInventorySystem() == true ) // ODB/NIV
{
- //if (guiCurrentItemDescriptionScreen != SHOPKEEPER_SCREEN)
- {
- // HEADROCK HAM 4:
- ITEMDESC_START_X = 115;
- ITEMDESC_START_Y = (1 + INV_INTERFACE_START_Y);
- ITEMDESC_HEIGHT = 195;
- ITEMDESC_WIDTH = 335; // OIV only
- }
- //else
- //{
- // ITEMDESC_START_X = 259;
- // ITEMDESC_START_Y = (1 + INV_INTERFACE_START_Y);
- // ITEMDESC_HEIGHT = guiCurrentItemDescriptionScreen == SHOPKEEPER_SCREEN ? 133 : 195;
- // ITEMDESC_WIDTH = 320; // OIV only
- //}
+ // HEADROCK HAM 4:
+ ITEMDESC_START_X = INTERFACE_START_X + 115;
+ ITEMDESC_START_Y = (1 + INV_INTERFACE_START_Y);
+ ITEMDESC_HEIGHT = 195;
+ ITEMDESC_WIDTH = 335; // OIV only
}
else // ODB/OIV
{
- ITEMDESC_START_X = 214;
+ ITEMDESC_START_X = INTERFACE_START_X + 214;
ITEMDESC_START_Y = (1 + INV_INTERFACE_START_Y);
ITEMDESC_HEIGHT = 133;
ITEMDESC_WIDTH = 320; // OIV only
@@ -3148,24 +3213,25 @@ void InitItemDescriptionBoxStartCoords( BOOLEAN fIsEnhanced, BOOLEAN fUsingNAS )
if(UsingNewInventorySystem() == true && guiCurrentScreen == GAME_SCREEN || guiCurrentScreen == SHOPKEEPER_SCREEN)
{
- if(iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
ITEMDESC_WIDTH = 526;
- else if(iResolution == 1)
+ else if (iResolution < _1024x768)
ITEMDESC_WIDTH = 686;
- else if(iResolution == 2)
+ else
ITEMDESC_WIDTH = 910;
}
//CHRISL: This allows EDB to work in Strategic OIV mode
if(guiCurrentScreen == MAP_SCREEN)
{
- if(iResolution == 0) // 640x480 res
+ if (iResolution >= _640x480 && iResolution < _800x600)
ITEMDESC_HEIGHT = 268;
- else if(iResolution == 2 || UsingNewInventorySystem() == true) // 1024x768 or NIV
+ else if(iResolution >= _1024x768 || UsingNewInventorySystem() == true) // 1024x768 or NIV
ITEMDESC_HEIGHT = 490;
- else if(iResolution == 1) // 800x600
+ else if (iResolution < _1024x768)
ITEMDESC_HEIGHT = 373;
- ITEMDESC_WIDTH = ((UsingNewInventorySystem() == true && iResolution != 0)) ? 272 : 272;
+
+ ITEMDESC_WIDTH = ((UsingNewInventorySystem() == true && iResolution >= _800x600)) ? 272 : 272;
}
}
}
@@ -4002,7 +4068,7 @@ void ItemDescAmmoCallback(GUI_BUTTON *btn,INT32 reason)
gfItemAmmoDown = FALSE;
//CHRISL: We dont' want to be able to reload guns using the ammo crate from this function
- if(gpItemPointer != NULL && Item[gpItemPointer->usItem].ammocrate)
+ if(gpItemPointer != NULL && Magazine[Item[gpItemPointer->usItem].ubClassIndex].ubMagType >= AMMO_BOX)
{
fInterfacePanelDirty = DIRTYLEVEL2;
btn->uiFlags &= (~BUTTON_CLICKED_ON );
@@ -4378,60 +4444,6 @@ void ItemDescAttachmentsCallback( MOUSE_REGION * pRegion, INT32 iReason )
}
}
-/*INT8 DetermineShowBox( )
-INT8 DetermineShowBox( )
-{
- if(gpItemDescObject == NULL)
- return 0;
-
- if(iResolution == 0)
- return 0;
- else if(UsingNewInventorySystem() == false) //OIV
- {
- if (UsingEDBSystem() == 2)
- {
- if (Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_EXPLOSV|IC_AMMO|IC_ARMOUR|IC_PUNCH) && UsingEDBSystem() > 0 )
- return(UsingNewAttachmentSystem()==true ? 8 : 6);
- else
- return(UsingNewAttachmentSystem()==true ? 9 : 7);
- }
- else if (guiCurrentItemDescriptionScreen == MAP_SCREEN)
- {
- if (Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_EXPLOSV|IC_AMMO|IC_ARMOUR|IC_PUNCH) && UsingEDBSystem() > 0 )
- return(UsingNewAttachmentSystem()==true ? 7 : 6);
- else
- if(UsingEDBSystem() > 0)
- return(UsingNewAttachmentSystem()==true ? 8 : 1);
- else
- return(UsingNewAttachmentSystem()==true ? 6 : 1);
- }
- else
- return(UsingNewAttachmentSystem()==true ? 5 : 0);
- }
- else if(UsingNewInventorySystem() == true) //NIV
- {
- if(gpItemDescObject->IsActiveLBE(gubItemDescStatusIndex))
- return (gpItemDescObject->GetLBEPointer(gubItemDescStatusIndex)->lbeClass + (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 1 : 0));
- else if(Item[gpItemDescObject->usItem].usItemClass == IC_LBEGEAR)
- return (LoadBearingEquipment[Item[gpItemDescObject->usItem].ubClassIndex].lbeClass + (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 1 : 0));
- else if (Item[gpItemDescObject->usItem].usItemClass & (IC_WEAPON|IC_EXPLOSV|IC_AMMO|IC_ARMOUR|IC_PUNCH) && UsingEDBSystem() > 0 ){
- if(UsingNewAttachmentSystem()==true)
- return (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 7 : 8);
- else
- return (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 6 : 5);
- }else{
- if(UsingNewAttachmentSystem()==true && UsingEDBSystem() > 0 && Item[gpItemDescObject->usItem].usItemClass != IC_MONEY)
- return (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 8 : 9);
- else if(UsingNewAttachmentSystem()==true && Item[gpItemDescObject->usItem].usItemClass != IC_MONEY)
- return (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 6 : 5);
- else
- return (guiCurrentItemDescriptionScreen == MAP_SCREEN ? 1 : 0);
- }
- }
-
- return 0;
-}*/
-
INT8 DetermineShowBox( )
{
INT8 bShowBox = 0;
@@ -4441,7 +4453,7 @@ INT8 DetermineShowBox( )
if(gpItemDescObject == NULL)
return 0;
- if(iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
return 0;
if(UsingEDBSystem() <= 0)
@@ -4593,7 +4605,7 @@ INT8 DetermineShowLBE( )
if(gpItemDescObject == NULL)
return -1;
- if(iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
return -1;
if(!UsingNewInventorySystem())
@@ -4731,7 +4743,18 @@ void RenderItemDescriptionBox( )
else
{
if(guiItemDescBoxBackground != 0)
- BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemDescBoxBackground, iResolution, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+ {
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemDescBoxBackground, 0, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+ else if (iResolution < _1024x768)
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemDescBoxBackground, 1, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+ else
+ BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemDescBoxBackground, 2, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+
+ // WANNE: Yes here we want to overlay image!
+ //ShadowNIVPanel();
+ }
+
BltVideoObjectFromIndex( guiSAVEBUFFER, guiItemDescBox, showBox, gsInvDescX, gsInvDescY, VO_BLT_SRCTRANSPARENCY, NULL );
}
@@ -4844,6 +4867,18 @@ void RenderItemDescriptionBox( )
sCenX = sCenX + gItemDescAttachmentsXY[cnt].sBarDx;
sCenY = sCenY + gItemDescAttachmentsXY[cnt].sBarDy;
DrawItemUIBarEx( gpItemDescObject, (UINT8)(DRAW_ITEM_STATUS_ATTACHMENT1 + cnt), sCenX, sCenY, ITEM_BAR_WIDTH, ITEM_BAR_HEIGHT, Get16BPPColor( STATUS_BAR ), Get16BPPColor( STATUS_BAR_SHADOW ), TRUE , guiSAVEBUFFER, gubItemDescStatusIndex );
+
+ if ( gGameOptions.fWeaponOverheating && ( Item[ (iter)->usItem ].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[ (iter)->usItem ].barrel == TRUE) ) // Flugente FTW 1.1
+ {
+ FLOAT overheatjampercentage = GetGunOverheatJamPercentage( &(*iter));
+
+ UINT32 red, green, blue;
+ UINT8 TemperatureStringNum = GetTemperatureString( overheatjampercentage, &red, &green, &blue );
+
+ UINT16 colour = Get16BPPColor( FROMRGB( red, green, blue ) );
+
+ DrawItemUIBarEx( &(*iter), DRAW_ITEM_TEMPERATURE, sCenX+4, sCenY, ITEM_BAR_WIDTH, ITEM_BAR_HEIGHT, colour, colour, TRUE, guiSAVEBUFFER );
+ }
}
}
@@ -4998,6 +5033,43 @@ void RenderItemDescriptionBox( )
////////// label
if (UsingEDBSystem())
{
+ // Flugente FTW 1: display temperature string
+ if ( gGameOptions.fWeaponOverheating && ( Item[ gpItemDescObject->usItem ].usItemClass == IC_GUN || Item[gpItemDescObject->usItem].usItemClass == IC_LAUNCHER || Item[gpItemDescObject->usItem].barrel == TRUE ) )
+ {
+ // UDB system displays a string with colored condition text.
+ int regionindex = 7;
+ SetFontForeground( ForegroundColor );
+ swprintf( pStr, L"%s", gTemperatureDesc[0] ); // "Temperature is "
+ mprintf( gItemDescTextRegions[regionindex].sLeft, gItemDescTextRegions[regionindex].sTop, pStr );
+ // Record length
+ INT16 indent = StringPixLength( gTemperatureDesc[0], ITEMDESC_FONT );
+
+ FLOAT overheatjampercentage = GetGunOverheatJamPercentage( gpItemDescObject);
+
+ UINT32 red, green, blue;
+ UINT8 TemperatureStringNum = GetTemperatureString( overheatjampercentage, &red, &green, &blue );
+ swprintf( pStr, L"%s", gTemperatureDesc[TemperatureStringNum+1 ] );
+
+ // text is coloured only in case of danger
+ if ( overheatjampercentage >= 1.0 )
+ SetRGBFontForeground( red, green, blue );
+
+ mprintf( gItemDescTextRegions[regionindex].sLeft+indent+2, gItemDescTextRegions[regionindex].sTop, pStr );
+ // Record length
+ indent += StringPixLength( gTemperatureDesc[TemperatureStringNum + 1], ITEMDESC_FONT );
+
+ SetFontForeground( ForegroundColor );
+ swprintf( pStr, L"%s", gTemperatureDesc[10] ); // "."
+ mprintf( gItemDescTextRegions[regionindex].sLeft + indent + 2, gItemDescTextRegions[regionindex].sTop, pStr );
+
+ // to get the text to the left side...
+ swprintf( pStr, L"");
+
+ FindFontRightCoordinates( gItemDescTextRegions[regionindex].sLeft, gItemDescTextRegions[regionindex].sTop, gItemDescTextRegions[regionindex].sRight - gItemDescTextRegions[regionindex].sLeft ,gItemDescTextRegions[regionindex].sBottom - gItemDescTextRegions[regionindex].sTop ,pStr, BLOCKFONT2, &usX, &usY);
+
+ mprintf( usX, usY, pStr );
+ }
+
// UDB system displays a string with colored condition text.
SetFontForeground( ForegroundColor );
swprintf( pStr, L"%s", gConditionDesc[0] ); // "In "
@@ -5508,7 +5580,7 @@ void RenderLBENODEItems( OBJECTTYPE *pObj, int subObject )
int usX, usY;
// Start by verifying that this item is an LBENODE
- if(Item[pObj->usItem].usItemClass != IC_LBEGEAR || iResolution == 0)
+ if(Item[pObj->usItem].usItemClass != IC_LBEGEAR || (iResolution >= _640x480 && iResolution < _800x600))
return;
// Set selected merc
@@ -7058,7 +7130,8 @@ BOOLEAN InitItemStackPopup( SOLDIERTYPE *pSoldier, UINT8 ubPosition, INT16 sInvX
INT16 sItemWidth = 0;
static CHAR16 pStr[ 512 ];
-
+ //sOffSetX = xResOffset;
+
RenderBackpackButtons(DEACTIVATE_BUTTON); /* CHRISL: Needed for new inventory backpack buttons */
if( guiCurrentScreen == MAP_SCREEN )
{
@@ -7071,7 +7144,7 @@ BOOLEAN InitItemStackPopup( SOLDIERTYPE *pSoldier, UINT8 ubPosition, INT16 sInvX
}
// Set some globals
- gsItemPopupInvX = sInvX;
+ gsItemPopupInvX = sInvX + xResOffset;
gsItemPopupInvY = sInvY;
gsItemPopupInvWidth = sInvWidth;
gsItemPopupInvHeight = sInvHeight;
@@ -7094,14 +7167,14 @@ BOOLEAN InitItemStackPopup( SOLDIERTYPE *pSoldier, UINT8 ubPosition, INT16 sInvX
strcpy( VObjectDesc.ImageFile, "INTERFACE\\extra_inventory.STI" );
CHECKF( AddVideoObject( &VObjectDesc, &guiItemPopupBoxes) );
- if(UsingNewInventorySystem() == true)
- {
- VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
- strcpy( VObjectDesc.ImageFile, "INTERFACE\\infobox_background.sti" );
- CHECKF( AddVideoObject( &VObjectDesc, &guiItemDescBoxBackground) );
- }
- else
- guiItemDescBoxBackground = 0;
+ //if(UsingNewInventorySystem() == true)
+ //{
+ // /*VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+ // strcpy( VObjectDesc.ImageFile, "INTERFACE\\infobox_background.sti" );
+ // CHECKF( AddVideoObject( &VObjectDesc, &guiItemDescBoxBackground) );*/
+ //}
+ //else
+ // guiItemDescBoxBackground = 0;
// Get size
GetVideoObject( &hVObject, guiItemPopupBoxes );
@@ -7205,7 +7278,7 @@ BOOLEAN InitItemStackPopup( SOLDIERTYPE *pSoldier, UINT8 ubPosition, INT16 sInvX
gfInItemStackPopup = TRUE;
//Reserict mouse cursor to panel
- aRect.iLeft = sInvX + sOffSetX;
+ aRect.iLeft = sInvX + xResOffset;
aRect.iTop = sInvY + sOffSetY;
aRect.iRight = aRect.iLeft + sItemWidth * usPopupWidth;
aRect.iBottom = aRect.iTop + (INT32)(ceil((float)cnt/(float)sItemWidth)+1) * usPopupHeight;
@@ -7227,9 +7300,39 @@ void EndItemStackPopupWithItemInHand( )
}
}
+void ShadowNIVPanel()
+{
+ // WANNE: Instead of blitting the sti overlap interface, shade the inventory. Looks much better and is the same than in OIV
+ UINT16 startX1, startX2, startX3;
+ UINT16 startY1, startY2, startY3;
+ UINT16 endX1, endX2, endX3;
+ UINT16 endY1, endY2, endY3;
+
+ // First rectangle
+ startX1 = gsItemPopupInvX;
+ startY1 = gsItemPopupInvY;
+ endX1 = SCREEN_WIDTH - xResOffset;
+ endY1 = startY1 + 109;
+ ShadowVideoSurfaceRect( FRAME_BUFFER, startX1, startY1, endX1 , endY1 );
+
+ // Second rectangle
+ startX2 = startX1;
+ startY2 = endY1;
+ endX2 = SCREEN_WIDTH - xResOffset - 155;
+ endY2 = SCREEN_HEIGHT;
+ ShadowVideoSurfaceRect( FRAME_BUFFER, startX2, startY2, endX2 , endY2 );
+
+ // Third rectangle
+ startX3 = startX1 - 140;
+ startY3 = startY1 + 65;
+ endX3 = startX3 + 140;
+ endY3 = SCREEN_HEIGHT;
+ ShadowVideoSurfaceRect( FRAME_BUFFER, startX3, startY3, endX3 , endY3 );
+}
+
void RenderItemStackPopup( BOOLEAN fFullRender )
{
- ETRLEObject *pTrav;
+ ETRLEObject *pTrav;
UINT32 usHeight, usWidth;
HVOBJECT hVObject;
UINT32 cnt;
@@ -7261,8 +7364,20 @@ void RenderItemStackPopup( BOOLEAN fFullRender )
{
if(UsingNewInventorySystem() == false || guiCurrentScreen == MAP_SCREEN)
ShadowVideoSurfaceRect( FRAME_BUFFER, gsItemPopupInvX, gsItemPopupInvY, gsItemPopupInvX + gsItemPopupInvWidth , gsItemPopupInvY + gsItemPopupInvHeight );
- else if(UsingNewInventorySystem() == true && iResolution != 0 && guiItemDescBoxBackground != 0 && guiCurrentScreen != MAP_SCREEN)
- BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, iResolution, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+ else if(UsingNewInventorySystem() == true && iResolution >= _800x600 /* && guiItemDescBoxBackground != 0 */ && guiCurrentScreen != MAP_SCREEN)
+ {
+ ShadowNIVPanel();
+
+
+ /*
+ if(iResolution >= _640x480 && iResolution < _800x600)
+ BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 0, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+ else if (iResolution < _1024x768)
+ BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 1, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+ else
+ BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 2, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+ */
+ }
}
}
@@ -7294,7 +7409,7 @@ void RenderItemStackPopup( BOOLEAN fFullRender )
sItemWidth -= 1;
usWidth = 58;
sWidth = 43;
- image = 1;
+ image = 1;
}
}
@@ -7305,9 +7420,9 @@ void RenderItemStackPopup( BOOLEAN fFullRender )
sX = (INT16)(gsItemPopupX + ( cnt % sItemWidth * usWidth ));
sY = (INT16)(gsItemPopupY + sOffSetY + ( cnt / sItemWidth * usHeight ));
BltVideoObjectFromIndex( FRAME_BUFFER, guiItemPopupBoxes, image, (INT16)sX, ( INT16 )sY, VO_BLT_SRCTRANSPARENCY, NULL );
-
+
if ( cnt < gpItemPopupObject->ubNumberOfObjects )
- {
+ {
// CHRISL: Coord updates to work with mutliple rows
//sX = (INT16)(gsItemPopupX + ( cnt * usWidth ) + 11);
//sY = (INT16)( gsItemPopupY + 3 );
@@ -7324,7 +7439,7 @@ void RenderItemStackPopup( BOOLEAN fFullRender )
}
//RestoreExternBackgroundRect( gsItemPopupInvX, gsItemPopupInvY, gsItemPopupInvWidth, gsItemPopupInvHeight );
- InvalidateRegion( gsItemPopupInvX, gsItemPopupInvY, gsItemPopupInvX + gsItemPopupInvWidth, gsItemPopupInvY + gsItemPopupInvHeight );
+ InvalidateRegion( gsItemPopupInvX, INV_REGION_Y, gsItemPopupInvX + gsItemPopupInvWidth, INV_REGION_Y + gsItemPopupInvHeight );
}
@@ -7387,16 +7502,16 @@ BOOLEAN InitKeyRingPopup( SOLDIERTYPE *pSoldier, INT16 sInvX, INT16 sInvY, INT16
RenderBackpackButtons(DEACTIVATE_BUTTON); /* CHRISL: Needed for new inventory backpack buttons */
if( guiCurrentScreen == MAP_SCREEN )
{
- gsKeyRingPopupInvX = 0;
- sKeyRingItemWidth = MAP_KEY_RING_ROW_WIDTH;
+ gsKeyRingPopupInvX = xResOffset;
+ sKeyRingItemWidth = MAP_KEY_RING_ROW_WIDTH;
sOffSetX = 40;
sOffSetY = 15;
}
else
{
- // Set some globals
- gsKeyRingPopupInvX = sInvX + TACTICAL_INVENTORY_KEYRING_GRAPHIC_OFFSET_X;
- sKeyRingItemWidth = KEY_RING_ROW_WIDTH;
+ // Set some globals
+ gsKeyRingPopupInvX = xResOffset + sInvX + TACTICAL_INVENTORY_KEYRING_GRAPHIC_OFFSET_X;
+ sKeyRingItemWidth = KEY_RING_ROW_WIDTH;
sOffSetY = 8;
}
@@ -7413,9 +7528,9 @@ BOOLEAN InitKeyRingPopup( SOLDIERTYPE *pSoldier, INT16 sInvX, INT16 sInvY, INT16
if(UsingNewInventorySystem() == true)
{
- VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+ /*VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
strcpy( VObjectDesc.ImageFile, "INTERFACE\\infobox_background.sti" );
- CHECKF( AddVideoObject( &VObjectDesc, &guiItemDescBoxBackground) );
+ CHECKF( AddVideoObject( &VObjectDesc, &guiItemDescBoxBackground) );*/
}
else
guiItemDescBoxBackground = 0;
@@ -7513,10 +7628,20 @@ void RenderKeyRingPopup( BOOLEAN fFullRender )
{
if(UsingNewInventorySystem() == false || guiCurrentScreen == MAP_SCREEN)
ShadowVideoSurfaceRect( FRAME_BUFFER, 0, gsKeyRingPopupInvY, gsKeyRingPopupInvX + gsKeyRingPopupInvWidth , gsKeyRingPopupInvY + gsKeyRingPopupInvHeight );
- else if(UsingNewInventorySystem() == true && iResolution != 0 && guiItemDescBoxBackground != 0 && guiCurrentScreen != MAP_SCREEN)
- BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, iResolution, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
- }
+ else if(UsingNewInventorySystem() == true && iResolution >= _800x600 /* && guiItemDescBoxBackground != 0 */ && guiCurrentScreen != MAP_SCREEN)
+ {
+ ShadowNIVPanel();
+ /*
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 0, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+ else if (iResolution < _1024x768)
+ BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 1, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+ else
+ BltVideoObjectFromIndex( FRAME_BUFFER, guiItemDescBoxBackground, 2, SM_ITEMDESC_START_X, SM_ITEMDESC_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
+ */
+ }
+ }
}
gTempObject.usItem = KEY_1;
@@ -7626,11 +7751,42 @@ UINT32 GetInterfaceGraphicForItem( INVTYPE *pItem )
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP2ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP2ITEMS,
L"Failed to retrieve P2 item image" );
}
- else
+ else if ( pItem->ubGraphicType == 3 )
{
SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP3ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP3ITEMS,
L"Failed to retrieve P3 item image" );
}
+ //MM: New item tileslots start here
+ else if ( pItem->ubGraphicType == 4 )
+ {
+ SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP4ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP4ITEMS,
+ L"Failed to retrieve P4 item image" );
+ }
+ else if ( pItem->ubGraphicType == 5 )
+ {
+ SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP5ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP5ITEMS,
+ L"Failed to retrieve P5 item image" );
+ }
+ else if ( pItem->ubGraphicType == 6 )
+ {
+ SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP6ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP6ITEMS,
+ L"Failed to retrieve P6 item image" );
+ }
+ else if ( pItem->ubGraphicType == 7 )
+ {
+ SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP7ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP7ITEMS,
+ L"Failed to retrieve P7 item image" );
+ }
+ else if ( pItem->ubGraphicType == 8 )
+ {
+ SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP8ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP8ITEMS,
+ L"Failed to retrieve P8 item image" );
+ }
+ else
+ {
+ SGP_TRYCATCH_RETHROW( id = g_bUsePngItemImages ? g_oP9ITEMS.getVObjectForItem(pItem->ubGraphicNum) : guiP9ITEMS,
+ L"Failed to retrieve P9 item image" );
+ }
return id;
}
@@ -7654,10 +7810,35 @@ UINT16 GetTileGraphicForItem( INVTYPE *pItem )
{
GetTileIndexFromTypeSubIndex( P2ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
- else
+ else if ( pItem->ubGraphicType == 3 )
{
GetTileIndexFromTypeSubIndex( P3ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
}
+ //MM: New item tileslots start here
+ else if ( pItem->ubGraphicType == 4 )
+ {
+ GetTileIndexFromTypeSubIndex( P4ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
+ }
+ else if ( pItem->ubGraphicType == 5 )
+ {
+ GetTileIndexFromTypeSubIndex( P5ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
+ }
+ else if ( pItem->ubGraphicType == 6 )
+ {
+ GetTileIndexFromTypeSubIndex( P6ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
+ }
+ else if ( pItem->ubGraphicType == 7 )
+ {
+ GetTileIndexFromTypeSubIndex( P7ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
+ }
+ else if ( pItem->ubGraphicType == 8 )
+ {
+ GetTileIndexFromTypeSubIndex( P8ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
+ }
+ else
+ {
+ GetTileIndexFromTypeSubIndex( P9ITEMS, (INT16)(pItem->ubGraphicNum+1), &usIndex );
+ }
if ( pItem->ubClassIndex >= M900 )
DebugMsg(TOPIC_JA2, DBG_LEVEL_3, String("GetTileGraphicForItem: db index %d",usIndex));
@@ -7715,22 +7896,7 @@ BOOLEAN LoadTileGraphicForItem( INVTYPE *pItem, UINT32 *puiVo )
sprintf( zName, "p2item%d", ubGraphic );
}
}
-/*
-#ifdef JA2UB
- else if ( pItem->ubGraphicType == 9 ) // UB Items
- {
- if ( ubGraphic < 10 )
- {
- sprintf( zName, "GUN_UB0%d", ubGraphic );
- }
- else
- {
- sprintf( zName, "GUN_UB%d", ubGraphic );
- }
- }
-#endif
-*/
- else
+ else if ( pItem->ubGraphicType == 3 )
{
if ( ubGraphic < 10 )
{
@@ -7741,6 +7907,73 @@ BOOLEAN LoadTileGraphicForItem( INVTYPE *pItem, UINT32 *puiVo )
sprintf( zName, "p3item%d", ubGraphic );
}
}
+ //MM: New item tileslots start here
+ else if ( pItem->ubGraphicType == 4 )
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p4item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p4item%d", ubGraphic );
+ }
+ }
+ else if ( pItem->ubGraphicType == 5 )
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p5item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p5item%d", ubGraphic );
+ }
+ }
+ else if ( pItem->ubGraphicType == 6 )
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p6item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p6item%d", ubGraphic );
+ }
+ }
+ else if ( pItem->ubGraphicType == 7 )
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p7item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p7item%d", ubGraphic );
+ }
+ }
+ else if ( pItem->ubGraphicType == 8 )
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p8item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p8item%d", ubGraphic );
+ }
+ }
+ else
+ {
+ if ( ubGraphic < 10 )
+ {
+ sprintf( zName, "p9item0%d", ubGraphic );
+ }
+ else
+ {
+ sprintf( zName, "p9item%d", ubGraphic );
+ }
+ }
//Load item
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
diff --git a/Tactical/Interface Items.h b/Tactical/Interface Items.h
index 5fe62ddd..123c604b 100644
--- a/Tactical/Interface Items.h
+++ b/Tactical/Interface Items.h
@@ -20,7 +20,7 @@
#define HEAD_INV_SLOT_HEIGHT 24
#define NUM_UDB_GEN_LINES 12
-#define NUM_UDB_ADV_LINES 12
+#define NUM_UDB_ADV_LINES 13 // Flugente FTW 1.1: 12->13
// HEADROCK HAM 4: These rectangle definitions are used in UDB to determine locations for icons, data, and tooltip
// regions. They replace the plethora of region data provided in EDB.
@@ -37,7 +37,7 @@ extern INV_DESC_REGIONS gItemDescGenHeaderRegions[3]; // Header text regions for
extern INV_DESC_REGIONS gItemDescGenIndexRegions[3][4]; // Index text regions for various parts of the General Tab
extern INV_DESC_REGIONS gItemDescGenRegions[NUM_UDB_GEN_LINES * 2][4]; // Data regions, 4 sub-columns each
extern INV_DESC_REGIONS gItemDescGenSecondaryRegions[26]; // Secondary data regions, 3x5 for now (possible 3x6?)
-extern INV_DESC_REGIONS gItemDescTextRegions[7]; // Main description regions
+extern INV_DESC_REGIONS gItemDescTextRegions[8]; // Main description regions
extern INV_DESC_REGIONS gItemDescAdvIndexRegions[1][4];
extern INV_DESC_REGIONS gItemDescAdvRegions[NUM_UDB_ADV_LINES][4]; // Advanced data regions, 4 sub-columns each
diff --git a/Tactical/Interface Panels.cpp b/Tactical/Interface Panels.cpp
index e6682aef..0ad8c1f0 100644
--- a/Tactical/Interface Panels.cpp
+++ b/Tactical/Interface Panels.cpp
@@ -1404,10 +1404,16 @@ UINT16 GetSMPanelCurrentMerc( )
// CHRISL: New functions to define initial settings for New Inventory system
void InitNewInventorySystem( )
{
- INTERFACE_WIDTH = 640;
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ INTERFACE_WIDTH = 640;
+ else if (iResolution < _1024x768)
+ INTERFACE_WIDTH = 800;
+ else
+ INTERFACE_WIDTH = 1024;
+
+ INTERFACE_START_X = (SCREEN_WIDTH - INTERFACE_WIDTH)/2;
INTERFACE_HEIGHT = 120;
INV_INTERFACE_HEIGHT = 200;
- INTERFACE_START_X = 0;
INTERFACE_START_Y = ( SCREEN_HEIGHT - INTERFACE_HEIGHT );
INV_INTERFACE_START_Y = ( SCREEN_HEIGHT - INV_INTERFACE_HEIGHT );
}
@@ -1415,10 +1421,16 @@ void InitNewInventorySystem( )
// CHRISL: New functions to define initial settings for Old Inventory system
void InitOldInventorySystem( )
{
- INTERFACE_WIDTH = 640;
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ INTERFACE_WIDTH = 640;
+ else if (iResolution < _1024x768)
+ INTERFACE_WIDTH = 800;
+ else
+ INTERFACE_WIDTH = 1024;
+
+ INTERFACE_START_X = (SCREEN_WIDTH - INTERFACE_WIDTH)/2;
INTERFACE_HEIGHT = 120;
INV_INTERFACE_HEIGHT = 140;
- INTERFACE_START_X = 0;
INTERFACE_START_Y = ( SCREEN_HEIGHT - INTERFACE_HEIGHT );
INV_INTERFACE_START_Y = ( SCREEN_HEIGHT - INV_INTERFACE_HEIGHT );
}
@@ -1532,9 +1544,12 @@ BOOLEAN InitializeSMPanelCoordsOld()
SM_STEALTHMODE_X = ( 187 + INTERFACE_START_X );
SM_STEALTHMODE_Y = ( 73 + INV_INTERFACE_START_Y );
- SM_DONE_X = (SCREEN_WIDTH - 97);//( 543 + INTERFACE_START_X );
+ SM_DONE_X = xResOffset + (xResSize - 97);
+ SM_MAPSCREEN_X = xResOffset + (xResSize - 51);
+ INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
+ LOCATION_NAME_X = xResOffset + (xResSize - 92);
+
SM_DONE_Y = ( 4 + INV_INTERFACE_START_Y );
- SM_MAPSCREEN_X = (SCREEN_WIDTH - 51);//( 589 + INTERFACE_START_X );
SM_MAPSCREEN_Y = ( 4 + INV_INTERFACE_START_Y );
SM_POSITIONB_X = ( 106 + INTERFACE_START_X );
@@ -1598,13 +1613,11 @@ BOOLEAN InitializeSMPanelCoordsOld()
STATS_TEXT_FONT_COLOR = 5;
// ow and te clock and location i will put it here
- INTERFACE_CLOCK_X = (SCREEN_WIDTH - 86); //( 554 + INTERFACE_START_X );
INTERFACE_CLOCK_Y = ( 119 + INV_INTERFACE_START_Y );
- LOCATION_NAME_X = (SCREEN_WIDTH - 92); //( 548 + INTERFACE_START_X );
LOCATION_NAME_Y = ( 65 + INTERFACE_START_Y );
- // Keyring
- KEYRING_X = 494; //487;
+ // Keyring
+ KEYRING_X = xResOffset + 494;
KEYRING_Y = (105 + INV_INTERFACE_START_Y);
// so we got everything "dynamic" now we just return TRUE
@@ -1623,7 +1636,8 @@ BOOLEAN InitializeSMPanelCoordsNew()
to allow the new inventory interface to function properly. Also altered many of the interface coords
so that the new interface would line up correctly.*/
// Inventory slots
- if(iResolution == 0){
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
gSMInvPocketXY[0].sX = INTERFACE_START_X + 239; gSMInvPocketXY[0].sY = INV_INTERFACE_START_Y + 68; // HELMETPOS
gSMInvPocketXY[1].sX = INTERFACE_START_X + 239; gSMInvPocketXY[1].sY = INV_INTERFACE_START_Y + 96; // VESTPOS
gSMInvPocketXY[2].sX = INTERFACE_START_X + 239; gSMInvPocketXY[2].sY = INV_INTERFACE_START_Y + 157; // LEGPOS
@@ -1680,7 +1694,8 @@ BOOLEAN InitializeSMPanelCoordsNew()
gSMInvPocketXY[53].sX = INTERFACE_START_X + 559; gSMInvPocketXY[53].sY = INV_INTERFACE_START_Y + 58; // SMALLPOCK29
gSMInvPocketXY[54].sX = INTERFACE_START_X + 559; gSMInvPocketXY[54].sY = INV_INTERFACE_START_Y + 82; // SMALLPOCK30
}
- else if(iResolution == 1){
+ else if (iResolution < _1024x768)
+ {
gSMInvPocketXY[0].sX = INTERFACE_START_X + 258; gSMInvPocketXY[0].sY = INV_INTERFACE_START_Y + 68; // HELMETPOS
gSMInvPocketXY[1].sX = INTERFACE_START_X + 258; gSMInvPocketXY[1].sY = INV_INTERFACE_START_Y + 97; // VESTPOS
gSMInvPocketXY[2].sX = INTERFACE_START_X + 258; gSMInvPocketXY[2].sY = INV_INTERFACE_START_Y + 157; // LEGPOS
@@ -1737,7 +1752,8 @@ BOOLEAN InitializeSMPanelCoordsNew()
gSMInvPocketXY[53].sX = INTERFACE_START_X + 693; gSMInvPocketXY[53].sY = INV_INTERFACE_START_Y + 58; // SMALLPOCK29
gSMInvPocketXY[54].sX = INTERFACE_START_X + 693; gSMInvPocketXY[54].sY = INV_INTERFACE_START_Y + 82; // SMALLPOCK30
}
- else if(iResolution == 2){
+ else
+ {
//1024x768 resolution
gSMInvPocketXY[0].sX = INTERFACE_START_X + 258; gSMInvPocketXY[0].sY = INV_INTERFACE_START_Y + 68; // HELMETPOS
gSMInvPocketXY[1].sX = INTERFACE_START_X + 258; gSMInvPocketXY[1].sY = INV_INTERFACE_START_Y + 97; // VESTPOS
@@ -1841,11 +1857,13 @@ BOOLEAN InitializeSMPanelCoordsNew()
SM_SELMERC_PLATE_HEIGHT = 65;
SM_SELMERC_PLATE_WIDTH = 83;
- if(iResolution == 0){
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
SM_BODYINV_X = ( 141 + INTERFACE_START_X );
SM_BODYINV_Y = ( 68 + INV_INTERFACE_START_Y );
}
- else{
+ else
+ {
SM_BODYINV_X = ( 151 + INTERFACE_START_X );
SM_BODYINV_Y = ( 68 + INV_INTERFACE_START_Y );
}
@@ -1879,24 +1897,18 @@ BOOLEAN InitializeSMPanelCoordsNew()
SM_NEXTMERCB_Y = ( 130 + INV_INTERFACE_START_Y );
SM_OPTIONSB_X = ( 10 + INTERFACE_START_X );
SM_OPTIONSB_Y = ( 165 + INV_INTERFACE_START_Y );
+
// CHRISL: Backpack buttons
- if(iResolution == 0){
- SM_DROPPACK_X = ( 504 + INTERFACE_START_X );
- SM_DROPPACK_Y = ( 39 + INV_INTERFACE_START_Y );
- SM_ZIPPER_X = ( 482 + INTERFACE_START_X );
- SM_ZIPPER_Y = ( 39 + INV_INTERFACE_START_Y );
- }
- else{
- SM_DROPPACK_X = ( 612 + INTERFACE_START_X );
- SM_DROPPACK_Y = ( 39 + INV_INTERFACE_START_Y );
- SM_ZIPPER_X = ( 590 + INTERFACE_START_X );
- SM_ZIPPER_Y = ( 39 + INV_INTERFACE_START_Y );
- }
+ SM_DROPPACK_X = ( 612 + INTERFACE_START_X );
+ SM_DROPPACK_Y = ( 39 + INV_INTERFACE_START_Y );
+ SM_ZIPPER_X = ( 590 + INTERFACE_START_X );
+ SM_ZIPPER_Y = ( 39 + INV_INTERFACE_START_Y );
+ SM_MAPSCREEN_X = xResOffset + (xResSize - 146); // 152
+ SM_DONE_X = xResOffset + (xResSize - 146); // 152
+ INTERFACE_CLOCK_X = xResOffset + (xResSize - 86);
+ LOCATION_NAME_X = xResOffset + (xResSize - 92);
- // WANNE 2
- SM_DONE_X = (SCREEN_WIDTH - 146); // 152
SM_DONE_Y = ( 118 + INV_INTERFACE_START_Y );
- SM_MAPSCREEN_X = (SCREEN_WIDTH - 146); // 152
SM_MAPSCREEN_Y = ( 140 + INV_INTERFACE_START_Y );
SM_POSITIONB_X = ( 106 + INTERFACE_START_X );
@@ -1907,7 +1919,8 @@ BOOLEAN InitializeSMPanelCoordsNew()
SM_PERCENT_WIDTH = 20;
SM_PERCENT_HEIGHT = 10;
- if(iResolution == 0){
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ {
SM_ARMOR_X = ( 245 + INTERFACE_START_X );
SM_ARMOR_Y = ( 141 + INV_INTERFACE_START_Y );
SM_ARMOR_LABEL_X = ( 260 + INTERFACE_START_X );
@@ -1915,7 +1928,8 @@ BOOLEAN InitializeSMPanelCoordsNew()
SM_ARMOR_PERCENT_X = ( 265 + INTERFACE_START_X );
SM_ARMOR_PERCENT_Y = ( 141 + INV_INTERFACE_START_Y );
}
- else{
+ else
+ {
SM_ARMOR_X = ( 264 + INTERFACE_START_X );
SM_ARMOR_Y = ( 141 + INV_INTERFACE_START_Y );
SM_ARMOR_LABEL_X = ( 279 + INTERFACE_START_X );
@@ -1971,13 +1985,11 @@ BOOLEAN InitializeSMPanelCoordsNew()
STATS_TEXT_FONT_COLOR = 5;
// ow and te clock and location i will put it here
- INTERFACE_CLOCK_X = (SCREEN_WIDTH - 86);
INTERFACE_CLOCK_Y = ( 117 + INV_INTERFACE_START_Y );
- LOCATION_NAME_X = (SCREEN_WIDTH - 92);
LOCATION_NAME_Y = ( 89 + INTERFACE_START_Y );
//Keyring
- KEYRING_X = 217; // 209
+ KEYRING_X = xResOffset + 217; //209;
KEYRING_Y = (5 + INV_INTERFACE_START_Y);
// so we got everything "dynamic" now we just return TRUE
@@ -1999,15 +2011,15 @@ BOOLEAN InitializeSMPanel( )
// failing the CHECKF after this will cause you to lose your mouse
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- strcpy( VObjectDesc.ImageFile, "INTERFACE\\inventory_bottom_panel.STI" );
+ strcpy( VObjectDesc.ImageFile, "INTERFACE\\inventory_bottom_panel.STI" );
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
strcpy( VObjectDesc.ImageFile, "INTERFACE\\inventory_bottom_panel_800x600.STI" );
}
- else if (iResolution == 2)
+ else
{
strcpy( VObjectDesc.ImageFile, "INTERFACE\\inventory_bottom_panel_1024x768.STI" );
}
@@ -3408,15 +3420,156 @@ BOOLEAN UIHandleItemPlacement( UINT8 ubHandPos, UINT16 usOldItemIndex, UINT16 us
}
+//Jenilee
+INT32 uiLastHandPos = -1;
+
+#define SLOT_NONE 0
+#define SLOT_HANDS 1
+#define SLOT_EQUIPMENT 2
+#define SLOT_VEST 3
+#define SLOT_RIG 4
+#define SLOT_CPACK 5
+#define SLOT_BPACK 6
+#define SLOT_SLING 7
+#define SLOT_KNIFE 8
+#define SLOT_FACE 9
+
+STR16 uiSlotTypeName[] =
+{
+ L"", //0
+ L"Hands", //1
+ L"Equipment", //2
+ L"Vest", //3
+ L"Leg Rig", //4
+ L"Combat Pack", //5
+ L"Backpack", //6
+ L"Sling", //7
+ L"Knife", //8
+ L"Face", //9
+ L"Large Pocket", //10
+ L"Small Pocket" //11
+};
+
+INT16 uiNIVSlotType[NUM_INV_SLOTS] = {
+ 2, 2, 2, //0-2
+ 9, 9, //3-4
+ 1, 1, //5-6
+ 2, 2, 2, 2, 2, //7-11
+ 7, //12
+ 8, //13
+ 5, 5, 5, //14-16
+ 6, 6, 6, 6, //17-20
+ 3, 3, //21-22
+ 4, 4, //23-24
+ 3, 3, 3, 3, 3, //25-29
+ 3, 3, 3, 3, 3, //30-34
+ 4, 4, 4, 4, //35-38
+ 4, 4, 4, 4, //39-42
+ 5, 5, 5, 5, //43-46
+ 6, 6, 6, 6, //47-50
+ 6, 6, 6, 6 //51-54
+ };
+
+UINT16 uiOIVSlotType[NUM_INV_SLOTS] = {
+ 2, 2, 2, //0-2
+ 9, 9, //3-4
+ 1, 1, //5-6
+ 0, 0, 0, 0, 0, 0, 0, //7-13
+ 10, 10, 10, 10, //14-17
+ 0, 0, 0, 0, 0, 0, 0, //18-24
+ 11, 11, 11, 11, 11, 11, 11, 11, //25-32
+ 0, 0, 0, 0, 0, 0, 0, 0, //33-40
+ 0, 0, 0, 0, 0, 0, 0, 0, //41-48
+ 0, 0, 0, 0, 0, 0 //49-54
+};
+
+UINT32 GetInvMovementCost(UINT16 item, UINT32 old_pos, UINT32 new_pos)
+{
+ if (!(gTacticalStatus.uiFlags & INCOMBAT) || //Not in combat
+ (old_pos == -1 || new_pos == -1)|| //Either position is invalid
+ (old_pos == new_pos)) //Old position same as new position
+ return 0;
+ INT16 src_type;
+ INT16 dst_type;
+ if (UsingNewInventorySystem() == TRUE)
+ {
+ src_type = uiNIVSlotType[old_pos];
+ dst_type = uiNIVSlotType[new_pos];
+ }
+ else
+ {
+ src_type = uiOIVSlotType[old_pos];
+ dst_type = uiOIVSlotType[new_pos];
+ }
+ if (src_type == dst_type) //Moving to same lbe type
+ return 0;
+
+ //If these 2 arrays are initiated outside the function, APBPConstants will not have been initialized, and all values will be 0
+ INT16 uiAPCostFromSlot[12] =
+ {
+ APBPConstants[AP_INV_FROM_NONE],
+ APBPConstants[AP_INV_FROM_HANDS],
+ APBPConstants[AP_INV_FROM_EQUIPMENT],
+ APBPConstants[AP_INV_FROM_VEST],
+ APBPConstants[AP_INV_FROM_RIG],
+ APBPConstants[AP_INV_FROM_CPACK],
+ APBPConstants[AP_INV_FROM_BPACK],
+ APBPConstants[AP_INV_FROM_SLING],
+ APBPConstants[AP_INV_FROM_KNIFE],
+ APBPConstants[AP_INV_FROM_FACE],
+ APBPConstants[AP_INV_FROM_BIG_POCKET],
+ APBPConstants[AP_INV_FROM_SMALL_POCKET]
+ };
+ INT16 uiAPCostToSlot[12] =
+ {
+ APBPConstants[AP_INV_TO_NONE],
+ APBPConstants[AP_INV_TO_HANDS],
+ APBPConstants[AP_INV_TO_EQUIPMENT],
+ APBPConstants[AP_INV_TO_VEST],
+ APBPConstants[AP_INV_TO_RIG],
+ APBPConstants[AP_INV_TO_CPACK],
+ APBPConstants[AP_INV_TO_BPACK],
+ APBPConstants[AP_INV_TO_SLING],
+ APBPConstants[AP_INV_TO_KNIFE],
+ APBPConstants[AP_INV_TO_FACE],
+ APBPConstants[AP_INV_TO_BIG_POCKET],
+ APBPConstants[AP_INV_TO_SMALL_POCKET]
+ };
+ FLOAT Weight_Divisor = gGameExternalOptions.uWeightDivisor;
+ UINT16 weight_modifier;
+ if (Weight_Divisor != 0)
+ weight_modifier = DynamicAdjustAPConstants((int)((Item[item].ubWeight) / Weight_Divisor),(int)((Item[item].ubWeight) / Weight_Divisor));
+ else
+ weight_modifier = 0;
+
+ UINT32 cost = 0;
+
+ cost += uiAPCostFromSlot[src_type];
+ cost += uiAPCostToSlot[dst_type];
+ cost += weight_modifier;
+
+ if (cost > APBPConstants[AP_INV_MAX_COST])
+ cost = APBPConstants[AP_INV_MAX_COST];
+
+#ifdef _DEBUG
+ CHAR16 szTemp[255];
+ swprintf(szTemp, L"Moving item from %s to %s (costs: %d/%d/%d/%d)", uiSlotTypeName[src_type], uiSlotTypeName[dst_type], uiAPCostFromSlot[src_type], uiAPCostToSlot[dst_type], weight_modifier, cost);
+ ScreenMsg(FONT_MCOLOR_LTGREEN, MSG_CHAT, szTemp);
+#endif
+ return cost;
+}
+
void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
{
UINT32 uiHandPos;
// Copyies of values
UINT16 usOldItemIndex, usNewItemIndex;
UINT16 usItemPrevInItemPointer;
+ UINT16 usCostToMoveItem = 0; //Jenilee
BOOLEAN fNewItem = FALSE;
static BOOLEAN fRightDown = FALSE;
static BOOLEAN fLeftDown = FALSE;
+ static bool INV_AP_COST = bool(gGameOptions.fInventoryCostsAP);
uiHandPos = MSYS_GetRegionUserData( pRegion, 0 );
@@ -3510,6 +3663,10 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
usOldItemIndex = gpSMCurrentMerc->inv[ uiHandPos ].usItem;
+ //Jenilee: remember our last selected slot
+ uiLastHandPos = uiHandPos;
+
+
// move item into the mouse cursor
BeginItemPointer( gpSMCurrentMerc, (UINT8)uiHandPos );
@@ -3536,8 +3693,23 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
if ( ubSrcID == ubDestID )
{
+ if (INV_AP_COST)
+ //Jenilee: determine the cost of moving this item around in our inventory
+ usCostToMoveItem = GetInvMovementCost(gpItemPointer->usItem, uiLastHandPos, uiHandPos);
+
+ if (gpSMCurrentMerc->bActionPoints >= usCostToMoveItem)
+ {
+ fOKToGo = TRUE;
+ uiLastHandPos = uiHandPos;
+ }
+ else //we dont have enough APs to move it to this slot, show a warning message
+ {
+ ScreenMsg(FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, TacticalStr[NOT_ENOUGH_APS_STR]);
+ fOKToGo = FALSE;
+ }
+
// We are doing this ourselve, continue
- fOKToGo = TRUE;
+// fOKToGo = TRUE;
}
else
{
@@ -3655,6 +3827,10 @@ void SMInvClickCallback( MOUSE_REGION * pRegion, INT32 iReason )
// try to place the item in the cursor into this inventory slot
if ( UIHandleItemPlacement( (UINT8) uiHandPos, usOldItemIndex, usNewItemIndex, fDeductPoints ) )
{
+ //Jenilee: pay the price
+ //just make sure to handle that if we are putting it back in the SAME slot, the cost should be 0!!!
+ gpSMCurrentMerc->bActionPoints -= usCostToMoveItem;
+
RenderBackpackButtons(ACTIVATE_BUTTON); /* CHRISL: Needed for new inventory backpack buttons */
// it worked! if we're in the SKI...
if( guiTacticalInterfaceFlags & INTERFACE_SHOPKEEP_INTERFACE )
@@ -4719,17 +4895,19 @@ void BtnPositionShowCallback(GUI_BUTTON *btn,INT32 reason)
BOOLEAN InitializeTEAMPanelCoords( )
{
-
TM_FACE_WIDTH = 48;
TM_FACE_HEIGHT = 43;
TM_APPANEL_HEIGHT = 56;
TM_APPANEL_WIDTH = 16;
- TM_ENDTURN_X = (SCREEN_WIDTH - 131); //( 507 + INTERFACE_START_X );
+ TM_ENDTURN_X = xResOffset + (xResSize - 131);
+ TM_ROSTERMODE_X = xResOffset + (xResSize - 131);
+ TM_DISK_X = xResOffset + (xResSize - 131);
+ INTERFACE_CLOCK_TM_X = xResOffset + (xResSize - 86 );
+ LOCATION_NAME_TM_X = xResOffset + (xResSize - 92 );
+
TM_ENDTURN_Y = ( 9 + INTERFACE_START_Y );
- TM_ROSTERMODE_X = (SCREEN_WIDTH - 131); //( 507 + INTERFACE_START_X );
TM_ROSTERMODE_Y = ( 45 + INTERFACE_START_Y );
- TM_DISK_X = (SCREEN_WIDTH - 131); //( 507 + INTERFACE_START_X );
TM_DISK_Y = ( 81 + INTERFACE_START_Y );
TM_NAME_WIDTH = 60;
@@ -4846,9 +5024,8 @@ BOOLEAN InitializeTEAMPanelCoords( )
// ufff to much copy&paste :D
*/
// CHRISL: New definitions for the team panel clock and location coordinates
- INTERFACE_CLOCK_TM_X = ( SCREEN_WIDTH - 86 );
+
INTERFACE_CLOCK_TM_Y = ( 99 + INTERFACE_START_Y );
- LOCATION_NAME_TM_X = ( SCREEN_WIDTH - 92 );
LOCATION_NAME_TM_Y = ( 65 + INTERFACE_START_Y );
return ( TRUE );
@@ -4883,37 +5060,34 @@ BOOLEAN InitializeTEAMPanel( )
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
//SQUAD10 FIX: Use panels with more slots if SquadSize at current resolution is > 6
- switch (iResolution)
+
+ if (iResolution >= _640x480 && iResolution < _800x600)
+ FilenameForBPP("INTERFACE\\bottom_bar.sti", VObjectDesc.ImageFile);
+ else if (iResolution < _1024x768)
{
- case 0:
- FilenameForBPP("INTERFACE\\bottom_bar.sti", VObjectDesc.ImageFile);
- break;
- case 1:
- if (gGameOptions.ubSquadSize > 6)
- {
- FilenameForBPP("INTERFACE\\bottom_bar_8_800x600.sti", VObjectDesc.ImageFile);
- }
- else
- {
- FilenameForBPP("INTERFACE\\bottom_bar_800x600.sti", VObjectDesc.ImageFile);
- }
- break;
- case 2:
- if (gGameOptions.ubSquadSize > 8)
- {
- FilenameForBPP("INTERFACE\\bottom_bar_10_1024x768.sti", VObjectDesc.ImageFile);
- }
- else if (gGameOptions.ubSquadSize > 6)
- {
- FilenameForBPP("INTERFACE\\bottom_bar_8_1024x768.sti", VObjectDesc.ImageFile);
- }
- else
- {
- FilenameForBPP("INTERFACE\\bottom_bar_1024x768.sti", VObjectDesc.ImageFile);
- }
- break;
- default:
- FilenameForBPP("INTERFACE\\bottom_bar.sti", VObjectDesc.ImageFile);
+ if (gGameOptions.ubSquadSize > 6)
+ {
+ FilenameForBPP("INTERFACE\\bottom_bar_8_800x600.sti", VObjectDesc.ImageFile);
+ }
+ else
+ {
+ FilenameForBPP("INTERFACE\\bottom_bar_800x600.sti", VObjectDesc.ImageFile);
+ }
+ }
+ else
+ {
+ if (gGameOptions.ubSquadSize > 8)
+ {
+ FilenameForBPP("INTERFACE\\bottom_bar_10_1024x768.sti", VObjectDesc.ImageFile);
+ }
+ else if (gGameOptions.ubSquadSize > 6)
+ {
+ FilenameForBPP("INTERFACE\\bottom_bar_8_1024x768.sti", VObjectDesc.ImageFile);
+ }
+ else
+ {
+ FilenameForBPP("INTERFACE\\bottom_bar_1024x768.sti", VObjectDesc.ImageFile);
+ }
}
CHECKF( AddVideoObject( &VObjectDesc, &guiTEAMPanel ) );
diff --git a/Tactical/Interface Utils.cpp b/Tactical/Interface Utils.cpp
index 1c48e76b..8d7a9cd3 100644
--- a/Tactical/Interface Utils.cpp
+++ b/Tactical/Interface Utils.cpp
@@ -20,6 +20,7 @@
#include "line.h"
#include "WCheck.h"
#include "Vehicles.h"
+ #include "GameSettings.h"
#endif
#define LIFE_BAR_SHADOW FROMRGB( 108, 12, 12 )
@@ -388,7 +389,7 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
if ( ubStatus >= DRAW_ITEM_STATUS_ATTACHMENT1 )
{
- sValue = 0;
+ sValue = 0;
OBJECTTYPE* pAttachment = (*pObject)[iter]->GetAttachmentAtIndex( ubStatus - DRAW_ITEM_STATUS_ATTACHMENT1 );
if (pAttachment->exists()) {
sValue = (*pAttachment)[iter]->data.objectStatus;
@@ -427,10 +428,23 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
sValue =100;
}
+ // Flugente FTW 1.2
+ if ( ubStatus == DRAW_ITEM_TEMPERATURE )
+ {
+ sValue = (INT16) (100 * GetGunOverheatJamPercentage( pObject) );
+
+ // if temperature is 0 or below, do not display anything
+ if ( sValue < 1)
+ return;
+
+ // cut off temperature at 100%, otherwise the bar will be out of its box
+ sValue = min(sValue, 100);
+ }
+
// ATE: Subtract 1 to exagerate bad status
if ( sValue < 100 && sValue > 1 )
{
- sValue--;
+ sValue--;
}
// Erase what was there
@@ -441,8 +455,7 @@ void DrawItemUIBarEx( OBJECTTYPE *pObject, UINT8 ubStatus, INT16 sXPos, INT16 sY
pDestBuf = LockVideoSurface( uiBuffer, &uiDestPitchBYTES );
SetClippingRegionAndImageWidth( uiDestPitchBYTES, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT );
-
-
+
// FIRST DO BREATH
dPercentage = (FLOAT)sValue / (FLOAT)100;
dEnd = dPercentage * sHeight;
diff --git a/Tactical/Interface Utils.h b/Tactical/Interface Utils.h
index f4946b2b..04e2c2dc 100644
--- a/Tactical/Interface Utils.h
+++ b/Tactical/Interface Utils.h
@@ -7,6 +7,7 @@
#define DRAW_ITEM_STATUS_ATTACHMENT2 201
#define DRAW_ITEM_STATUS_ATTACHMENT3 202
#define DRAW_ITEM_STATUS_ATTACHMENT4 203
+#define DRAW_ITEM_TEMPERATURE 204 // Flugente FTW 1.2
void DrawMoraleUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWidth, INT16 sHeight, BOOLEAN fErase, UINT32 uiBuffer );
void DrawBreathUIBarEx( SOLDIERTYPE *pSoldier, INT16 sXPos, INT16 sYPos, INT16 sWidth, INT16 sHeight, BOOLEAN fErase, UINT32 uiBuffer );
diff --git a/Tactical/Interface.cpp b/Tactical/Interface.cpp
index e3772619..749146dc 100644
--- a/Tactical/Interface.cpp
+++ b/Tactical/Interface.cpp
@@ -105,9 +105,6 @@ CIV_NAMES_VALUES zCivGroupName[NUM_CIV_GROUPS];
BOOLEAN gfInMovementMenu = FALSE;
INT32 giMenuAnchorX, giMenuAnchorY;
-
-
-#define PROG_BAR_START_X 5
//*ddd
//#define PROG_BAR_START_Y 2
@@ -285,7 +282,6 @@ UINT32 CalcUIMessageDuration( STR16 wString );
BOOLEAN InitializeFaceGearGraphics()
{
- VSURFACE_DESC vs_desc;
VOBJECT_DESC VObjectDesc;
char fileName[500];
@@ -382,10 +378,8 @@ BOOLEAN InitializeTacticalInterface( )
VSURFACE_DESC vs_desc;
VOBJECT_DESC VObjectDesc;
- UINT32 iCounter2;
+ //UINT32 iCounter2;
- char fileName[500];
-
// CHRISL: Setup default interface coords based on inventory system in use
if((UsingNewInventorySystem() == true))
{
@@ -4333,36 +4327,35 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
UINT32 uiBarToUseInUpDate=0;
BOOLEAN fDoLimitBar = FALSE;
FLOAT dNumStepsPerEnemy, dLength, dCurSize;
- INT16 iProgBarLength = SCREEN_WIDTH - 13;
+ INT16 iProgBarLength;
STR fn;
memset( &VObjectDesc, 0, sizeof( VObjectDesc ) );
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
- switch (iResolution)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- case 0: //640
- if (gGameExternalOptions.fSmallSizeProgressbar)
- fn = "INTERFACE\\rect_Thin.sti";
- else
- fn = "INTERFACE\\rect.sti";
- break;
- case 1: //800
- if (gGameExternalOptions.fSmallSizeProgressbar)
- fn = "INTERFACE\\rect_800x600Thin.sti";
- else
- fn = "INTERFACE\\rect_800x600.sti";
- break;
- case 2:
- if (gGameExternalOptions.fSmallSizeProgressbar)
- fn = "INTERFACE\\rect_1024x768Thin.sti";
- else
- fn = "INTERFACE\\rect_1024x768.sti";
- break;
- default:
- AssertMsg( 0, "Invalid resolution");
- return;
- break;
+ iProgBarLength = 640 - 13;
+ if (gGameExternalOptions.fSmallSizeProgressbar)
+ fn = "INTERFACE\\rect_Thin.sti";
+ else
+ fn = "INTERFACE\\rect.sti";
+ }
+ else if (iResolution < _1024x768)
+ {
+ iProgBarLength = 800 - 13;
+ if (gGameExternalOptions.fSmallSizeProgressbar)
+ fn = "INTERFACE\\rect_800x600Thin.sti";
+ else
+ fn = "INTERFACE\\rect_800x600.sti";
+ }
+ else
+ {
+ iProgBarLength = 1024 - 13;
+ if (gGameExternalOptions.fSmallSizeProgressbar)
+ fn = "INTERFACE\\rect_1024x768Thin.sti";
+ else
+ fn = "INTERFACE\\rect_1024x768.sti";
}
FilenameForBPP(fn, VObjectDesc.ImageFile);
@@ -4373,30 +4366,26 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
AssertMsg(0, fn );
}
- switch (iResolution)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- case 0: //640
- if (gGameExternalOptions.fSmallSizeProgressbar)
- fn = "INTERFACE\\timebargreen_Thin.sti";
- else
- fn = "INTERFACE\\timebargreen.sti";
- break;
- case 1: //800
- if (gGameExternalOptions.fSmallSizeProgressbar)
- fn = "INTERFACE\\timebargreen_800x600Thin.sti";
- else
- fn = "INTERFACE\\timebargreen_800x600.sti";
- break;
- case 2:
- if (gGameExternalOptions.fSmallSizeProgressbar)
- fn = "INTERFACE\\timebargreen_1024x768Thin.sti";
- else
- fn = "INTERFACE\\timebargreen_1024x768.sti";
- break;
- default:
- AssertMsg( 0, "Invalid resolution");
- return;
- break;
+ if (gGameExternalOptions.fSmallSizeProgressbar)
+ fn = "INTERFACE\\timebargreen_Thin.sti";
+ else
+ fn = "INTERFACE\\timebargreen.sti";
+ }
+ else if (iResolution < _1024x768)
+ {
+ if (gGameExternalOptions.fSmallSizeProgressbar)
+ fn = "INTERFACE\\timebargreen_800x600Thin.sti";
+ else
+ fn = "INTERFACE\\timebargreen_800x600.sti";
+ }
+ else
+ {
+ if (gGameExternalOptions.fSmallSizeProgressbar)
+ fn = "INTERFACE\\timebargreen_1024x768Thin.sti";
+ else
+ fn = "INTERFACE\\timebargreen_1024x768.sti";
}
FilenameForBPP(fn, VObjectDesc.ImageFile);
@@ -4406,30 +4395,26 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
AssertMsg(0, fn );
}
- switch (iResolution)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- case 0: //640
- if (gGameExternalOptions.fSmallSizeProgressbar)
- fn = "INTERFACE\\timebaryellow_Thin.sti";
- else
- fn = "INTERFACE\\timebaryellow.sti";
- break;
- case 1: //800
- if (gGameExternalOptions.fSmallSizeProgressbar)
- fn = "INTERFACE\\timebaryellow_800x600Thin.sti";
- else
- fn = "INTERFACE\\timebaryellow_800x600.sti";
- break;
- case 2:
- if (gGameExternalOptions.fSmallSizeProgressbar)
- fn = "INTERFACE\\timebaryellow_1024x768Thin.sti";
- else
- fn = "INTERFACE\\timebaryellow_1024x768.sti";
- break;
- default:
- AssertMsg( 0, "Invalid resolution");
- return;
- break;
+ if (gGameExternalOptions.fSmallSizeProgressbar)
+ fn = "INTERFACE\\timebaryellow_Thin.sti";
+ else
+ fn = "INTERFACE\\timebaryellow.sti";
+ }
+ else if (iResolution < _1024x768)
+ {
+ if (gGameExternalOptions.fSmallSizeProgressbar)
+ fn = "INTERFACE\\timebaryellow_800x600Thin.sti";
+ else
+ fn = "INTERFACE\\timebaryellow_800x600.sti";
+ }
+ else
+ {
+ if (gGameExternalOptions.fSmallSizeProgressbar)
+ fn = "INTERFACE\\timebaryellow_1024x768Thin.sti";
+ else
+ fn = "INTERFACE\\timebaryellow_1024x768.sti";
}
FilenameForBPP(fn, VObjectDesc.ImageFile);
@@ -4450,8 +4435,8 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
case MILITIA_INTERRUPT_MESSAGE:
case AIR_RAID_TURN_MESSAGE:
- // Render rect into surface
- BltVideoObjectFromIndex( uiSurface, uiBAR, 0, 0, 0, VO_BLT_SRCTRANSPARENCY, NULL );
+ // Render rect into surface
+ BltVideoObjectFromIndex( uiSurface, uiBAR, 0, xResOffset, 0, VO_BLT_SRCTRANSPARENCY, NULL );
SetFontBackground( FONT_MCOLOR_BLACK );
SetFontForeground( FONT_MCOLOR_WHITE );
@@ -4461,8 +4446,8 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
case PLAYER_INTERRUPT_MESSAGE:
- // Render rect into surface
- BltVideoObjectFromIndex( uiSurface, uiINTBAR, 0, 0, 0, VO_BLT_SRCTRANSPARENCY, NULL );
+ // Render rect into surface
+ BltVideoObjectFromIndex( uiSurface, uiINTBAR, 0, xResOffset, 0, VO_BLT_SRCTRANSPARENCY, NULL );
SetFontBackground( FONT_MCOLOR_BLACK );
SetFontForeground( FONT_MCOLOR_WHITE );
@@ -4472,7 +4457,8 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
case PLAYER_TURN_MESSAGE:
- BltVideoObjectFromIndex( uiSurface, uiPLAYERBAR, 0, 0, 0, VO_BLT_SRCTRANSPARENCY, NULL );
+ // Render rect into surface
+ BltVideoObjectFromIndex( uiSurface, uiPLAYERBAR, 0, xResOffset, 0, VO_BLT_SRCTRANSPARENCY, NULL );
SetFontBackground( FONT_MCOLOR_BLACK );
SetFontForeground( FONT_MCOLOR_WHITE );
@@ -4494,7 +4480,7 @@ void CreateTopMessage( UINT32 uiSurface, UINT8 ubType, STR16 psString )
dNumStepsPerEnemy = (FLOAT)( (FLOAT)iProgBarLength / (FLOAT)gTacticalStatus.usTactialTurnLimitMax );
// Render end peice
- sBarX = PROG_BAR_START_X;
+ sBarX = (SCREEN_WIDTH - xResSize) / 2 + 5;
BltVideoObjectFromIndex( uiSurface, uiBarToUseInUpDate, 1, sBarX, PROG_BAR_START_Y, VO_BLT_SRCTRANSPARENCY, NULL );
// Determine Length
diff --git a/Tactical/InterfaceItemImages.cpp b/Tactical/InterfaceItemImages.cpp
index ccf6ff76..7ea26abe 100644
--- a/Tactical/InterfaceItemImages.cpp
+++ b/Tactical/InterfaceItemImages.cpp
@@ -16,12 +16,29 @@ UINT32 guiGUNSM;
UINT32 guiP1ITEMS;
UINT32 guiP2ITEMS;
UINT32 guiP3ITEMS;
+
+//MM: New item tileslots start here
+UINT32 guiP4ITEMS;
+UINT32 guiP5ITEMS;
+UINT32 guiP6ITEMS;
+UINT32 guiP7ITEMS;
+UINT32 guiP8ITEMS;
+UINT32 guiP9ITEMS;
+
// new item image handles
MDItemVideoObjects g_oGUNSM;
MDItemVideoObjects g_oP1ITEMS;
MDItemVideoObjects g_oP2ITEMS;
MDItemVideoObjects g_oP3ITEMS;
+//MM: New item tileslots start here
+MDItemVideoObjects g_oP4ITEMS;
+MDItemVideoObjects g_oP5ITEMS;
+MDItemVideoObjects g_oP6ITEMS;
+MDItemVideoObjects g_oP7ITEMS;
+MDItemVideoObjects g_oP8ITEMS;
+MDItemVideoObjects g_oP9ITEMS;
+
/******************************************************************************/
MDItemVideoObjects::MDItemVideoObjects()
@@ -154,6 +171,85 @@ bool RegisterItemImages()
return false;
}
+ //MM: New item tileslots start here
+ // LOAD INTERFACE ITEM PICTURES
+ if(!g_bUsePngItemImages)
+ {
+ VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+ FilenameForBPP("INTERFACE\\mdp4items.sti", VObjectDesc.ImageFile);
+ if( !AddVideoObject( &VObjectDesc, &guiP4ITEMS ) )
+ AssertMsg(0, "Missing INTERFACE\\mdp4items.sti" );
+ }
+ else if(!g_oP4ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP4ITEMS/*.png"))
+ {
+ return false;
+ }
+
+ // LOAD INTERFACE ITEM PICTURES
+ if(!g_bUsePngItemImages)
+ {
+ VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+ FilenameForBPP("INTERFACE\\mdp5items.sti", VObjectDesc.ImageFile);
+ if( !AddVideoObject( &VObjectDesc, &guiP5ITEMS ) )
+ AssertMsg(0, "Missing INTERFACE\\mdp5items.sti" );
+ }
+ else if(!g_oP5ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP5ITEMS/*.png"))
+ {
+ return false;
+ }
+
+ // LOAD INTERFACE ITEM PICTURES
+ if(!g_bUsePngItemImages)
+ {
+ VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+ FilenameForBPP("INTERFACE\\mdp6items.sti", VObjectDesc.ImageFile);
+ if( !AddVideoObject( &VObjectDesc, &guiP6ITEMS ) )
+ AssertMsg(0, "Missing INTERFACE\\mdp6items.sti" );
+ }
+ else if(!g_oP6ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP6ITEMS/*.png"))
+ {
+ return false;
+ }
+
+ // LOAD INTERFACE ITEM PICTURES
+ if(!g_bUsePngItemImages)
+ {
+ VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+ FilenameForBPP("INTERFACE\\mdp7items.sti", VObjectDesc.ImageFile);
+ if( !AddVideoObject( &VObjectDesc, &guiP7ITEMS ) )
+ AssertMsg(0, "Missing INTERFACE\\mdp7items.sti" );
+ }
+ else if(!g_oP7ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP7ITEMS/*.png"))
+ {
+ return false;
+ }
+
+ // LOAD INTERFACE ITEM PICTURES
+ if(!g_bUsePngItemImages)
+ {
+ VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+ FilenameForBPP("INTERFACE\\mdp8items.sti", VObjectDesc.ImageFile);
+ if( !AddVideoObject( &VObjectDesc, &guiP8ITEMS ) )
+ AssertMsg(0, "Missing INTERFACE\\mdp8items.sti" );
+ }
+ else if(!g_oP8ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP8ITEMS/*.png"))
+ {
+ return false;
+ }
+
+ // LOAD INTERFACE ITEM PICTURES
+ if(!g_bUsePngItemImages)
+ {
+ VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+ FilenameForBPP("INTERFACE\\mdp9items.sti", VObjectDesc.ImageFile);
+ if( !AddVideoObject( &VObjectDesc, &guiP9ITEMS ) )
+ AssertMsg(0, "Missing INTERFACE\\mdp9items.sti" );
+ }
+ else if(!g_oP9ITEMS.registerItemsFromFilePattern(L"INTERFACE/MDP9ITEMS/*.png"))
+ {
+ return false;
+ }
+
return true;
}
diff --git a/Tactical/InterfaceItemImages.h b/Tactical/InterfaceItemImages.h
index 1d8c3c62..20d887f9 100644
--- a/Tactical/InterfaceItemImages.h
+++ b/Tactical/InterfaceItemImages.h
@@ -26,12 +26,29 @@ extern UINT32 guiGUNSM;
extern UINT32 guiP1ITEMS;
extern UINT32 guiP2ITEMS;
extern UINT32 guiP3ITEMS;
+
+//MM: New item tileslots start here
+extern UINT32 guiP4ITEMS;
+extern UINT32 guiP5ITEMS;
+extern UINT32 guiP6ITEMS;
+extern UINT32 guiP7ITEMS;
+extern UINT32 guiP8ITEMS;
+extern UINT32 guiP9ITEMS;
+
// new item image handles
extern MDItemVideoObjects g_oGUNSM;
extern MDItemVideoObjects g_oP1ITEMS;
extern MDItemVideoObjects g_oP2ITEMS;
extern MDItemVideoObjects g_oP3ITEMS;
+//MM: New item tileslots start here
+extern MDItemVideoObjects g_oP4ITEMS;
+extern MDItemVideoObjects g_oP5ITEMS;
+extern MDItemVideoObjects g_oP6ITEMS;
+extern MDItemVideoObjects g_oP7ITEMS;
+extern MDItemVideoObjects g_oP8ITEMS;
+extern MDItemVideoObjects g_oP9ITEMS;
+
bool RegisterItemImages();
#endif // _ITERFACEITEMIMAGES_H_
diff --git a/Tactical/Item Types.cpp b/Tactical/Item Types.cpp
index 7960e3db..0a969e33 100644
--- a/Tactical/Item Types.cpp
+++ b/Tactical/Item Types.cpp
@@ -1023,6 +1023,7 @@ ObjectData::ObjectData(const ObjectData& src)
this->bTrap = src.bTrap;
this->fUsed = src.fUsed;
this->ubImprintID = src.ubImprintID;
+ this->bTemperature = src.bTemperature;
//copy over the union
this->gun = src.gun;
@@ -1041,6 +1042,7 @@ ObjectData& ObjectData::operator =(const ObjectData& src)
this->bTrap = src.bTrap;
this->fUsed = src.fUsed;
this->ubImprintID = src.ubImprintID;
+ this->bTemperature = src.bTemperature;
//copy over the union
this->gun = src.gun;
@@ -1312,6 +1314,7 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
(*this)[0]->data.bTrap = src.bTrap; // 1-10 exp_lvl to detect
(*this)[0]->data.ubImprintID = src.ubImprintID; // ID of merc that item is imprinted on
(*this)[0]->data.fUsed = src.fUsed; // flags for whether the item is used or not
+ (*this)[0]->data.bTemperature = 0.0;
if(src.usItem == OWNERSHIP)//dnl ch29 120909
{
@@ -1342,6 +1345,7 @@ OBJECTTYPE& OBJECTTYPE::operator=(const OLD_OBJECTTYPE_101& src)
(*this)[x]->data.bTrap = src.bTrap; // 1-10 exp_lvl to detect
(*this)[x]->data.ubImprintID = src.ubImprintID; // ID of merc that item is imprinted on
(*this)[x]->data.fUsed = src.fUsed; // flags for whether the item is used or not
+ (*this)[x]->data.bTemperature = 0.0;
}
}
diff --git a/Tactical/Item Types.h b/Tactical/Item Types.h
index e950dc5b..c33e8261 100644
--- a/Tactical/Item Types.h
+++ b/Tactical/Item Types.h
@@ -444,8 +444,15 @@ public:
INT8 bTrap; // 1-10 exp_lvl to detect
UINT8 fUsed; // flags for whether the item is used or not
UINT8 ubImprintID; // ID of merc that item is imprinted on
-};
+ // Flugente: due do inconsistencies with WF maps, where data from a map is laoded differently, I had to add this marker.
+ // New values, like bTemperature, have to come after this. And please, don't destroy ObjectData's POD-ness.
+ char endOfPOD;
+
+ FLOAT bTemperature; // Flugente FTW 1.2: temperature of gun
+};
+// Flugente: needed for reading WF maps
+#define SIZEOF_OBJECTDATA_POD (offsetof(ObjectData, endOfPOD))
typedef std::list attachmentList;
class StackedObjectData {
@@ -688,7 +695,7 @@ typedef struct
UINT16 ubGraphicNum;
UINT16 ubWeight; //2 units per kilogram; roughly 1 unit per pound
UINT8 ubPerPocket;
- UINT8 ItemSize;
+ UINT16 ItemSize;
UINT16 usPrice;
UINT8 ubCoolness;
INT8 bReliability;
@@ -731,7 +738,6 @@ typedef struct
BOOLEAN gasmask;
BOOLEAN lockbomb;
BOOLEAN flare;
- BOOLEAN ammocrate;
INT16 percentnoisereduction;
INT16 bipod;
INT16 tohitbonus;
@@ -843,6 +849,14 @@ typedef struct
FLOAT projectionfactor;
BOOLEAN speeddot;
+ // Flugente FTW 1.2
+ BOOLEAN barrel; // item can be used on some guns as an exchange barrel
+ FLOAT usOverheatingCooldownFactor; // every turn/5 seconds, a gun's temperature is lowered by this amount
+ FLOAT overheatTemperatureModificator; // percentage modifier of heat a shot generates (read from attachments)
+ FLOAT overheatCooldownModificator; // percentage modifier of cooldown amount (read from attachments, applies to guns & barrels)
+ FLOAT overheatJamThresholdModificator; // percentage modifier of a gun's jam threshold (read from attachments)
+ FLOAT overheatDamageThresholdModificator; // percentage modifier of a gun's damage threshold (read from attachments)
+
} INVTYPE;
// CHRISL: Added new structures to handle LBE gear and the two new XML files that will be needed to deal
@@ -1307,7 +1321,7 @@ typedef enum
DEFAULT_CPACK = 442,
DEFAULT_BPACK = 448,
- MAXITEMS = 5001
+ MAXITEMS = 16001
} ITEMDEFINE;
/* CHRISL: Arrays to track ic group information. These allow us to determine which LBE slots control which pockets and
@@ -1330,15 +1344,15 @@ const INT8 vehicleInv[NUM_INV_SLOTS]= { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
// Determines the default pocket
const INT16 icDefault[NUM_INV_SLOTS] = {
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK,
- DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK,
- DEFAULT_VEST, DEFAULT_VEST,
- DEFAULT_THIGH, DEFAULT_THIGH,
- DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST,
- DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH,
- DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK,
- DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK};
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,//0-13
+ DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK,//14,15,16
+ DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK,//17,18,19,20
+ DEFAULT_VEST, DEFAULT_VEST,//21,22
+ DEFAULT_THIGH, DEFAULT_THIGH,//23,24
+ DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST, DEFAULT_VEST,//24-34
+ DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH, DEFAULT_THIGH,//35-42
+ DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK, DEFAULT_CPACK,//43,44,45,46
+ DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK, DEFAULT_BPACK};//47+
#define FIRST_HELMET STEEL_HELMET
#define LAST_HELMET SPECTRA_HELMET_Y
@@ -1417,7 +1431,8 @@ typedef enum
EASY_MERGE,
ELECTRONIC_MERGE,
USE_ITEM,
- USE_ITEM_HARD
+ USE_ITEM_HARD,
+ TEMPERATURE
} MergeType;
extern UINT16 Merge[MAXITEMS+1][6];
diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp
index c8bcf598..4865542d 100644
--- a/Tactical/Items.cpp
+++ b/Tactical/Items.cpp
@@ -1260,7 +1260,7 @@ BOOLEAN ItemIsLegal( UINT16 usItemIndex, BOOLEAN fIgnoreCoolness )
// CHRISL: Restrict system specific items
if( (UsingNewInventorySystem() == true) )
{
- if(Item[usItemIndex].ItemSize == 99)
+ if(Item[usItemIndex].ItemSize == gGameExternalOptions.guiOIVSizeNumber)
return FALSE;
}
else
@@ -1430,7 +1430,7 @@ UINT8 ItemSlotLimit( OBJECTTYPE * pObject, INT16 bSlot, SOLDIERTYPE *pSoldier, B
else if(pSoldier != NULL && (pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE))
return (max(1, LBEPocketType[VEHICLE_POCKET_TYPE].ItemCapacityPerSize[__min(gGameExternalOptions.guiMaxItemSize,Item[pObject->usItem].ItemSize)])); //JMich
else
- return (max(1, min(255,LBEPocketType[VEHICLE_POCKET_TYPE].ItemCapacityPerSize[__min(34,Item[pObject->usItem].ItemSize)]*4)));
+ return (max(1, min(255,LBEPocketType[VEHICLE_POCKET_TYPE].ItemCapacityPerSize[__min(gGameExternalOptions.guiMaxItemSize,Item[pObject->usItem].ItemSize)]*4)));
}
if (UsingNewInventorySystem() == false) {
@@ -1480,7 +1480,7 @@ UINT8 ItemSlotLimit( OBJECTTYPE * pObject, INT16 bSlot, SOLDIERTYPE *pSoldier, B
}
else
iSize = Item[pObject->usItem].ItemSize;
- iSize = __min(iSize,34);
+ iSize = __min(iSize,gGameExternalOptions.guiMaxItemSize);
ubSlotLimit = LBEPocketType[pIndex].ItemCapacityPerSize[iSize];
//this could be changed, we know guns are physically able to stack
@@ -2734,23 +2734,24 @@ UINT16 CalculateItemSize( OBJECTTYPE *pObject )
// Determine default ItemSize based on item and attachments
cisIndex = pObject->usItem;
iSize = Item[cisIndex].ItemSize;
- if(iSize>34)
- iSize = 34;
+ if(iSize>gGameExternalOptions.guiMaxItemSize)
+ iSize = gGameExternalOptions.guiMaxItemSize;
//for each object in the stack, hopefully there is only 1
for (int numStacked = 0; numStacked < pObject->ubNumberOfObjects; ++numStacked) {
//some weapon attachments can adjust the ItemSize of a weapon
- if(iSize<10) {
+ if(iSizeattachments.begin(); iter != (*pObject)[numStacked]->attachments.end(); ++iter) {
if (iter->exists() == true) {
iSize += Item[iter->usItem].itemsizebonus;
// CHRISL: This is to catch things if we try and reduce ItemSize when we're already at 0
- if(iSize > 34 || iSize < 0)
- iSize = 0;
- if(iSize > 9)
- iSize = 9;
}
}
+ if(iSize > gGameExternalOptions.guiMaxItemSize || iSize < 0) //JMich
+ iSize = 0;
+ if(iSize > gGameExternalOptions.guiMaxWeaponSize) //JMich
+ iSize = gGameExternalOptions.guiMaxWeaponSize; //JMich
+
}
// LBENODE has it's ItemSize adjusted based on what it's storing
@@ -3580,6 +3581,7 @@ INT8 FindAmmoToReload( SOLDIERTYPE * pSoldier, INT8 bWeaponIn, INT8 bExcludeSlot
{
OBJECTTYPE * pObj;
INT8 bSlot;
+ UINT16 magSize;
if (pSoldier == NULL)
{
@@ -3594,13 +3596,12 @@ INT8 FindAmmoToReload( SOLDIERTYPE * pSoldier, INT8 bWeaponIn, INT8 bExcludeSlot
if ( Item[pObj->usItem].usItemClass == IC_GUN && !Item[pObj->usItem].cannon )
{
- // look for same ammo as before
- //bSlot = FindObjExcludingSlot( pSoldier, (*pObj)[0]->data.gun.usGunAmmoItem, bExcludeSlot );
- //if (bSlot != NO_SLOT)
- //{
- // reload using this ammo!
- // return( bSlot );
- //}
+ //MM: make reload use crates/boxes if not in combat...
+ if ( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) )
+ magSize = GetMagSize(pObj);
+ else
+ magSize = ANY_MAGSIZE;
+
// look for any ammo that matches which is of the same calibre and magazine size
bSlot = FindAmmo( pSoldier, Weapon[pObj->usItem].ubCalibre, GetMagSize(pObj), GetAmmoType(pObj), bExcludeSlot );
if (bSlot != NO_SLOT)
@@ -4839,6 +4840,28 @@ BOOLEAN OBJECTTYPE::AttachObjectNAS( SOLDIERTYPE * pSoldier, OBJECTTYPE * pAttac
pSoldier->DoMercBattleSound( BATTLE_SOUND_CURSE1 );
}
break;
+
+ case TEMPERATURE:
+ {
+ // check if this can work
+ if ( Item[ this->usItem ].usItemClass == IC_GUN && Item[pAttachment->usItem].barrel == TRUE )
+ {
+ FLOAT guntemperature = (*this)[subObject]->data.bTemperature;
+ FLOAT barreltemperature = (*pAttachment)[0]->data.bTemperature;
+
+ (*pAttachment)[0]->data.bTemperature = guntemperature;
+ (*this)[subObject]->data.bTemperature = barreltemperature;
+ }
+
+ UINT16 usOldItem = this->usItem;
+ this->usItem = usResult;
+
+ //WarmSteel - Replaced this with one that also checks default attachments, otherwise you could not replace built-in bonuses with default inseperable attachments.
+ //RemoveProhibitedAttachments(pSoldier, this, usResult);
+ ReInitMergedItem(pSoldier, this, usOldItem);
+ }
+ break;
+
case ELECTRONIC_MERGE:
if ( pSoldier )
{
@@ -5841,7 +5864,7 @@ BOOLEAN PlaceObject( SOLDIERTYPE * pSoldier, INT8 bPos, OBJECTTYPE * pObj )
if (Weapon[pInSlot->usItem].ubCalibre == Magazine[Item[pObj->usItem].ubClassIndex].ubCalibre)
{
//CHRISL: Work differently with ammo crates but only when not in combat
- if(Item[pObj->usItem].ammocrate == TRUE)
+ if(Magazine[Item[pObj->usItem].ubClassIndex].ubMagType >= AMMO_BOX)
{
if(!(gTacticalStatus.uiFlags & INCOMBAT))
{
@@ -5958,7 +5981,7 @@ BOOLEAN PlaceObject( SOLDIERTYPE * pSoldier, INT8 bPos, OBJECTTYPE * pObj )
}
// CHRISL: When holding ammo and clicking on an appropriate ammo crate, add ammo to crate
- if(Item[pInSlot->usItem].ammocrate == TRUE && Item[pObj->usItem].usItemClass == IC_AMMO)
+ if(Magazine[Item[pInSlot->usItem].ubClassIndex].ubMagType >= AMMO_BOX && Item[pObj->usItem].usItemClass == IC_AMMO && Magazine[Item[pObj->usItem].ubClassIndex].ubMagType < AMMO_BOX )
{
if(Magazine[Item[pInSlot->usItem].ubClassIndex].ubCalibre == Magazine[Item[pObj->usItem].ubClassIndex].ubCalibre &&
Magazine[Item[pInSlot->usItem].ubClassIndex].ubAmmoType == Magazine[Item[pObj->usItem].ubClassIndex].ubAmmoType)
@@ -7096,6 +7119,9 @@ BOOLEAN CreateGun( UINT16 usItem, INT16 bStatus, OBJECTTYPE * pObj )
pStackedObject->data.gun.bGunStatus = bStatus;
pStackedObject->data.ubImprintID = NO_PROFILE;
+ // Flugente FTW 1: temperature on creation is 0
+ pStackedObject->data.bTemperature = 0.0;
+
if (Weapon[ usItem ].ubWeaponClass == MONSTERCLASS)
{
pStackedObject->data.gun.ubGunShotsLeft = GetMagSize(pObj);
@@ -11402,10 +11428,18 @@ UINT8 AllowedAimingLevelsNCTH( SOLDIERTYPE *pSoldier, INT32 sGridNo )
aimLevels = 4;
}
}
-
- // HEADROCK HAM 4: This modifier from the weapon and its attachments replaces the generic bipod bonus.
- aimLevels += GetAimLevelsModifier( &pSoldier->inv[pSoldier->ubAttackingHand], gAnimControl[ pSoldier->usAnimState ].ubHeight );
+ // HEADROCK HAM 4: This modifier from the weapon and its attachments replaces the generic bipod bonus.
+ UINT8 stance = gAnimControl[ pSoldier->usAnimState ].ubEndHeight;
+
+ // Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
+ if ( gGameExternalOptions.fWeaponResting && pSoldier->IsWeaponMounted() )
+ stance = ANIM_PRONE;
+
+ INT32 moda = GetAimLevelsModifier( &pSoldier->inv[pSoldier->ubAttackingHand], stance );
+ INT32 modb = GetAimLevelsModifier( &pSoldier->inv[pSoldier->ubAttackingHand], gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
+ aimLevels += (INT32) ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
+
aimLevels += GetAimLevelsTraitModifier( pSoldier, &pSoldier->inv[pSoldier->ubAttackingHand]);
aimLevels = __max(1, aimLevels);
@@ -11543,12 +11577,18 @@ UINT8 AllowedAimingLevels(SOLDIERTYPE * pSoldier, INT32 sGridNo)
}
// Determine whether a bipod is being used (prone)
- if (GetBipodBonus(&pSoldier->inv[pSoldier->ubAttackingHand])>0 && gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE )
+
+ UINT8 stance = gAnimControl[ pSoldier->usAnimState ].ubEndHeight;
+
+ // Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
+ if ( gGameExternalOptions.fWeaponResting && pSoldier->IsWeaponMounted() )
+ stance = ANIM_PRONE;
+
+ if (GetBipodBonus(&pSoldier->inv[pSoldier->ubAttackingHand])>0 && stance == ANIM_PRONE )
{
fUsingBipod = TRUE;
}
-
// don't break compatibility, let the users choose
if (gGameExternalOptions.iAimLevelsCompatibilityOption != 0)
sScopeBonus = OldWayOfCalculatingScopeBonus(pSoldier);
@@ -12366,3 +12406,28 @@ static UINT16 OldWayOfCalculatingScopeBonus(SOLDIERTYPE *pSoldier)
return max(0, GetMinRangeForAimBonus(& pSoldier->inv[pSoldier->ubAttackingHand])
* gGameExternalOptions.iAimLevelsCompatibilityOption / gGameExternalOptions.ubStraightSightRange);
}
+
+
+// Flugente FTW 1.2
+FLOAT GetItemCooldownFactor( OBJECTTYPE * pObj )
+{
+ FLOAT cooldownfactor = Item[pObj->usItem].usOverheatingCooldownFactor; // ... get item-specific cooldown factor ...
+
+ FLOAT modificator = 1.0;
+
+ if ( pObj->exists() == true )
+ {
+ attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
+ for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
+ {
+ if (iter->exists())
+ {
+ modificator += Item[iter->usItem].overheatCooldownModificator;
+ }
+ }
+ }
+
+ cooldownfactor *= modificator;
+
+ return cooldownfactor;
+}
diff --git a/Tactical/Items.h b/Tactical/Items.h
index d660fe05..7e81f868 100644
--- a/Tactical/Items.h
+++ b/Tactical/Items.h
@@ -15,6 +15,10 @@ class SOLDIERTYPE;
#define NIGHTSIGHTGOGGLES_BONUS 2 * STRAIGHT_RATIO
#define UVGOGGLES_BONUS 4 * STRAIGHT_RATIO
+
+
+
+
extern UINT8 SlotToPocket[7];
extern BOOLEAN WeaponInHand( SOLDIERTYPE * pSoldier );
@@ -426,6 +430,9 @@ INT16 ReduceCamoFromSoldier( SOLDIERTYPE * pSoldier, INT16 iCamoToRemove, INT16
BOOLEAN HasExtendedEarOn( SOLDIERTYPE * pSoldier );
BOOLEAN UseTotalMedicalKitPoints( SOLDIERTYPE * pSoldier, UINT16 usPointsToConsume );
+// Flugente FTW 1.2
+FLOAT GetItemCooldownFactor( OBJECTTYPE * pObj );
+
#endif
diff --git a/Tactical/LOS.cpp b/Tactical/LOS.cpp
index c1033f6c..959be69a 100644
--- a/Tactical/LOS.cpp
+++ b/Tactical/LOS.cpp
@@ -7048,10 +7048,18 @@ void CalcTargetMovementOffset( SOLDIERTYPE *pShooter, SOLDIERTYPE *pTarget, OBJE
// beginning to compensate for the target's speed, pointing the gun ahead of the target ("Leading the target").
UINT8 uiTilesForMaxPenalty = (100-uiCombinedSkill) / (100 / gGameCTHConstants.MOVEMENT_TRACKING_DIFFICULTY);
+ UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
+
+ // Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
+ if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
+ stance = ANIM_PRONE;
+
// Add a percentage-based modifier from the weapon and its attachments. Movement tracking devices will
// provide faster compensation for target movement, allowing the shooter to begin adjusting the muzzle
// after the target moves a smaller number of tiles.
- uiTilesForMaxPenalty += (INT16)(uiTilesForMaxPenalty * GetTargetTrackingModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
+ INT32 moda = (INT32)(uiTilesForMaxPenalty * GetTargetTrackingModifier( pWeapon, stance )) / 100;
+ INT32 modb = (INT32)(uiTilesForMaxPenalty * GetTargetTrackingModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
+ uiTilesForMaxPenalty += (UINT8)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
if (uiTilesForMaxPenalty == 0)
{
@@ -7208,7 +7216,15 @@ void CalcRangeCompensationOffset( SOLDIERTYPE *pShooter, FLOAT *dMuzzleOffsetY,
// The weapon and/or its attachments can increase our skill by a certain percentage. Windage sights on long-range
// weapons (like sniper rifles and launchers) are sometimes designed specifically for this purpose.
- iCombinedSkill += (iCombinedSkill * GetDropCompensationModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
+ UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
+
+ // Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
+ if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
+ stance = ANIM_PRONE;
+
+ FLOAT moda = (iCombinedSkill * GetDropCompensationModifier( pWeapon, stance )) / 100;
+ FLOAT modb = (iCombinedSkill * GetDropCompensationModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
+ iCombinedSkill += ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
// Limit this to a scale of 0-100.
UINT32 uiCombinedSkill = (UINT32)__max(__min(iCombinedSkill,100), 0);
@@ -7533,8 +7549,16 @@ UINT32 CalcCounterForceFrequency(SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon)
iCounterForceFrequency += bDifference;
}
+ UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
+
+ // Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
+ if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
+ stance = ANIM_PRONE;
+
// Percent Modifier from weapon and its attachments
- iCounterForceFrequency += (iCounterForceFrequency * GetCounterForceFrequencyModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
+ FLOAT moda = (iCounterForceFrequency * GetCounterForceFrequencyModifier( pWeapon, stance )) / 100;
+ FLOAT modb = (iCounterForceFrequency * GetCounterForceFrequencyModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight )) / 100;
+ iCounterForceFrequency += ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
// Limit to 1-100.
iCounterForceFrequency = __min(100, iCounterForceFrequency);
@@ -7600,7 +7624,17 @@ UINT32 CalcCounterForceAccuracy(SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon, UINT
// Add the effects from the weapon and its attachments. A foregrip or bipod are very useful for this.
// Attachment bonuses are applied as a percentage to the accuracy of the shooter.
- INT32 iModifier = GetCounterForceAccuracyModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubHeight );
+
+ UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
+
+ // Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
+ if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
+ stance = ANIM_PRONE;
+
+ INT32 moda = GetCounterForceAccuracyModifier( pWeapon, stance );
+ INT32 modb = GetCounterForceAccuracyModifier( pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight );
+ INT32 iModifier = (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
+
UINT32 uiCounterForceAccuracy = (UINT32)(iCounterForceAccuracy + ((iCounterForceAccuracy * iModifier) / 100));
// Now add the effect of the AutoWeapons skill. It "bridges" a portion of the gap between shooter's actual accuracy
@@ -7708,7 +7742,17 @@ void CalcPreRecoilOffset( SOLDIERTYPE *pShooter, OBJECTTYPE *pWeapon, FLOAT *dMu
INT8 bGunRecoilX;
INT8 bGunRecoilY;
FLOAT dDistanceRatio = (FLOAT)(uiRange / gGameCTHConstants.NORMAL_RECOIL_DISTANCE);
- FLOAT iCounterForceMax = CalcCounterForceMax(pShooter, pWeapon);
+
+ UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
+
+ // Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
+ if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
+ stance = ANIM_PRONE;
+
+ FLOAT moda = CalcCounterForceMax(pShooter, pWeapon, stance);
+ FLOAT modb = CalcCounterForceMax(pShooter, pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight);
+ FLOAT iCounterForceMax = ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
+
UINT32 uiCounterForceAccuracy = CalcCounterForceAccuracy(pShooter, pWeapon, uiRange, FALSE, true);
UINT32 uiCounterForceFrequency = CalcCounterForceFrequency(pShooter, pWeapon);
@@ -7955,8 +7999,16 @@ void CalcRecoilOffset( SOLDIERTYPE *pShooter, FLOAT *dMuzzleOffsetX, FLOAT *dMuz
// maximum counter-force that can be applied. By default, it is based primarily on the strength of the shooter,
// although agility is also helpful.
- FLOAT iCounterForceMax = CalcCounterForceMax(pShooter, pWeapon);
+ UINT8 stance = gAnimControl[ pShooter->usAnimState ].ubEndHeight;
+ // Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
+ if ( gGameExternalOptions.fWeaponResting && pShooter->IsWeaponMounted() )
+ stance = ANIM_PRONE;
+
+ FLOAT moda = CalcCounterForceMax(pShooter, pWeapon, stance);
+ FLOAT modb = CalcCounterForceMax(pShooter, pWeapon, gAnimControl[ pShooter->usAnimState ].ubEndHeight);
+ FLOAT iCounterForceMax = ((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
+
// iCounterForceMax is now the absolute limit.
// STEP 2: Now we need to determine how accurate the shooter is when applying counter-force. He won't always apply
diff --git a/Tactical/Overhead.cpp b/Tactical/Overhead.cpp
index 97c32888..4106c55e 100644
--- a/Tactical/Overhead.cpp
+++ b/Tactical/Overhead.cpp
@@ -1890,7 +1890,7 @@ BOOLEAN ExecuteOverhead( )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - hack! - resolve possible pending interrupt
- if(GetSoldier(&pSoldier, gusSelectedSoldier) && gGameExternalOptions.fImprovedInterruptSystem )
+ if(GetSoldier(&pSoldier, gusSelectedSoldier) && gGameOptions.fImprovedInterruptSystem )
{
if ( pSoldier->bActive )
{
@@ -2831,7 +2831,7 @@ BOOLEAN HandleAtNewGridNo( SOLDIERTYPE *pSoldier, BOOLEAN *pfKeepMoving )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - if pending interrupt flag was set for movement type of interupt, resolve it here
- if ( gGameExternalOptions.fImprovedInterruptSystem )
+ if ( gGameOptions.fImprovedInterruptSystem )
{
if ( ResolvePendingInterrupt( pSoldier, MOVEMENT_INTERRUPT ) )
{
@@ -8662,7 +8662,7 @@ SOLDIERTYPE *InternalReduceAttackBusyCount( )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - if pending interrupt flag was set for after-shot type of interupt, try to resolve it now
- if ( gGameExternalOptions.fImprovedInterruptSystem )
+ if ( gGameOptions.fImprovedInterruptSystem )
{
if ( ResolvePendingInterrupt( pSoldier, AFTERSHOT_INTERRUPT ) )
{
diff --git a/Tactical/PATHAI.cpp b/Tactical/PATHAI.cpp
index dab831c3..4e64a23e 100644
--- a/Tactical/PATHAI.cpp
+++ b/Tactical/PATHAI.cpp
@@ -4440,8 +4440,16 @@ INT32 PlotPath( SOLDIERTYPE *pSold, INT32 sDestGridNo, INT8 bCopyRoute, INT8 bPl
usMovementModeToUseForAPs = usMovementMode;
+
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+ UINT8 ubTerrainID = gpWorldLevelData[ sTempGrid ].ubTerrainID;
+
+ if ( TERRAIN_IS_WATER( ubTerrainID) && pSold->pathing.bLevel > 0 )
+ ubTerrainID = FLAT_GROUND;
+
// ATE - MAKE MOVEMENT ALWAYS WALK IF IN WATER
- if ( TERRAIN_IS_WATER( gpWorldLevelData[ sTempGrid ].ubTerrainID) )
+ if ( TERRAIN_IS_WATER( ubTerrainID) )
{
usMovementModeToUseForAPs = WALKING;
}
diff --git a/Tactical/Points.cpp b/Tactical/Points.cpp
index 3163978b..506c4bb3 100644
--- a/Tactical/Points.cpp
+++ b/Tactical/Points.cpp
@@ -284,8 +284,15 @@ INT16 TerrainBreathPoints(SOLDIERTYPE * pSoldier, INT32 sGridNo, INT8 bDir, UINT
iPoints = iPoints * BreathPointAdjustmentForCarriedWeight( pSoldier ) / 100;
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+ UINT8 ubTerrainID = gpWorldLevelData[ sGridNo ].ubTerrainID;
+
+ if ( TERRAIN_IS_WATER( ubTerrainID) && pSoldier->pathing.bLevel > 0 )
+ ubTerrainID = FLAT_GROUND;
+
// ATE - MAKE MOVEMENT ALWAYS WALK IF IN WATER
- if ( TERRAIN_IS_WATER( gpWorldLevelData[ sGridNo ].ubTerrainID) )
+ if ( TERRAIN_IS_WATER( ubTerrainID) )
{
usMovementMode = WALKING;
}
@@ -359,13 +366,22 @@ INT16 ActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir, UINT16 u
// Tile cost should not be reduced based on movement mode...
if ( sSwitchValue == TRAVELCOST_FENCE )
{
- return( sTileCost );
+ return( sTileCost );
}
+
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+ UINT8 ubTerrainID = gpWorldLevelData[ sGridNo ].ubTerrainID;
+
+ if ( TERRAIN_IS_WATER( ubTerrainID) && pSoldier->pathing.bLevel > 0 )
+ ubTerrainID = FLAT_GROUND;
+
+
// ATE - MAKE MOVEMENT ALWAYS WALK IF IN WATER
- if ( TERRAIN_IS_WATER( gpWorldLevelData[ sGridNo ].ubTerrainID) )
+ if ( TERRAIN_IS_WATER( ubTerrainID) )
{
- usMovementMode = WALKING;
+ usMovementMode = WALKING;
}
// so, then we must modify it for other movement styles and accumulate
@@ -503,8 +519,17 @@ INT16 EstimateActionPointCost( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bDir,
{
return( sTileCost );
}
+
+
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+ UINT8 ubTerrainID = gpWorldLevelData[ sGridNo ].ubTerrainID;
+
+ if ( TERRAIN_IS_WATER( ubTerrainID) && pSoldier->pathing.bLevel > 0 )
+ ubTerrainID = FLAT_GROUND;
+
// ATE - MAKE MOVEMENT ALWAYS WALK IF IN WATER
- if ( TERRAIN_IS_WATER( gpWorldLevelData[ sGridNo ].ubTerrainID) )
+ if ( TERRAIN_IS_WATER( ubTerrainID) )
{
usMovementMode = WALKING;
}
@@ -848,7 +873,7 @@ void DeductPoints( SOLDIERTYPE *pSoldier, INT16 sAPCost, INT32 iBPCost, UINT8 ub
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - Interrupt counter
- if( gGameExternalOptions.fImprovedInterruptSystem && sAPCost > 0 && ubInterruptType != DISABLED_INTERRUPT )
+ if( gGameOptions.fImprovedInterruptSystem && sAPCost > 0 && ubInterruptType != DISABLED_INTERRUPT )
{
UINT8 ubPointsRegistered = 0;
UINT16 uCnt = 0;
@@ -892,8 +917,9 @@ void DeductPoints( SOLDIERTYPE *pSoldier, INT16 sAPCost, INT32 iBPCost, UINT8 ub
// adjust by range to target
//INT32 iRange = GetRangeInCellCoordsFromGridNoDiff( pOpponent->sGridNo, pSoldier->sGridNo ); // calculate actual range
//INT16 iDistVisible = (pOpponent->GetMaxDistanceVisible(pOpponent->sGridNo, pOpponent->bTargetLevel, CALC_FROM_ALL_DIRS ) * CELL_X_SIZE); // how far do we see
- ubPointsRegistered -= ( 25 * GetRangeInCellCoordsFromGridNoDiff( pOpponent->sGridNo, pSoldier->sGridNo ) /
- (pOpponent->GetMaxDistanceVisible(pOpponent->sGridNo, pOpponent->bTargetLevel, CALC_FROM_ALL_DIRS ) * CELL_X_SIZE) ); // -1% registered by 4% of the difference of how far we can see and how far is the target
+ INT16 iDistVisible = pOpponent->GetMaxDistanceVisible(pOpponent->sGridNo, pOpponent->bTargetLevel, CALC_FROM_ALL_DIRS ) * CELL_X_SIZE; // -1% registered by 4% of the difference of how far we can see and how far is the target
+ iDistVisible = max(iDistVisible, CELL_X_SIZE);
+ ubPointsRegistered -= ( 25 * GetRangeInCellCoordsFromGridNoDiff( pOpponent->sGridNo, pSoldier->sGridNo ) / iDistVisible );
if ( gGameOptions.fNewTraitSystem )
{
@@ -2232,12 +2258,17 @@ INT8 PtsToMoveDirection(SOLDIERTYPE *pSoldier, INT8 bDirection )
// ATE: Check if the new place is watter and we were tying to run....
bOverTerrainType = GetTerrainType( sGridNo );
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+ if ( TERRAIN_IS_WATER( bOverTerrainType) && pSoldier->pathing.bLevel > 0 )
+ bOverTerrainType = FLAT_GROUND;
+
if ( TERRAIN_IS_WATER( bOverTerrainType) )
{
usMoveModeToUse = WALKING;
}
- sCost = ActionPointCost( pSoldier, sGridNo, bDirection , usMoveModeToUse );
+ sCost = ActionPointCost( pSoldier, sGridNo, bDirection , usMoveModeToUse );
if ( gubWorldMovementCosts[ sGridNo ][ bDirection ][ pSoldier->pathing.bLevel ] != TRAVELCOST_FENCE )
{
diff --git a/Tactical/ShopKeeper Interface.cpp b/Tactical/ShopKeeper Interface.cpp
index 2753a360..4c7a7190 100644
--- a/Tactical/ShopKeeper Interface.cpp
+++ b/Tactical/ShopKeeper Interface.cpp
@@ -1043,8 +1043,18 @@ ATM:
gubArrayOfEmployedMercs[ gubNumberMercsInArray ] = pSoldier->ubProfile;
//Create the string for the face file name
+ //sprintf( zTemp, "FACES\\33FACE\\%02d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
+
+
+ if ( gProfilesIMP[ pSoldier->ubProfile ].ProfilId == pSoldier->ubProfile )
+ {
+ sprintf( zTemp, "IMPFACES\\33FACE\\%02d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
+ }
+ else
+ {
sprintf( zTemp, "FACES\\33FACE\\%02d.sti", gMercProfiles[ pSoldier->ubProfile ].ubFaceIndex );
-
+ }
+
//While we are at it, add their small face
VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
FilenameForBPP( zTemp, VObjectDesc.ImageFile);
@@ -1728,7 +1738,7 @@ void GetShopKeeperInterfaceUserInput()
GetCursorPos(&MousePos);
ScreenToClient(ghWindow, &MousePos); // In window coords!
- while( DequeueEvent( &Event ) )
+ while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
// HOOK INTO MOUSE HOOKS
/* removed warning condition C4060 (jonathanl)
diff --git a/Tactical/Soldier Ani.cpp b/Tactical/Soldier Ani.cpp
index e9a84cbd..ff0570ff 100644
--- a/Tactical/Soldier Ani.cpp
+++ b/Tactical/Soldier Ani.cpp
@@ -599,7 +599,7 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - if pending interrupt flag was set for after-attack type of interupt, try to resolve it now
- else if ( gGameExternalOptions.fImprovedInterruptSystem )
+ else if ( gGameOptions.fImprovedInterruptSystem )
{
if ( ResolvePendingInterrupt( pSoldier, AFTERACTION_INTERRUPT ) )
{
@@ -2052,7 +2052,7 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - if pending interrupt flag was set for before-attack type of interupt, try to resolve it now
- if ( gGameExternalOptions.fImprovedInterruptSystem )
+ if ( gGameOptions.fImprovedInterruptSystem )
{
if ( ResolvePendingInterrupt( pSoldier, BEFORESHOT_INTERRUPT ) )
{
@@ -2667,7 +2667,7 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - if pending interrupt flag was set for after-attack type of interupt, try to resolve it now
- if ( gGameExternalOptions.fImprovedInterruptSystem )
+ if ( gGameOptions.fImprovedInterruptSystem )
{
ResolvePendingInterrupt( pSoldier, AFTERACTION_INTERRUPT );
}
@@ -4135,6 +4135,12 @@ BOOLEAN OKFallDirection( SOLDIERTYPE *pSoldier, INT32 sGridNo, INT8 bLevel, UINT
}
bOverTerrainType = GetTerrainType( sGridNo);
+
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+ if ( TERRAIN_IS_WATER( bOverTerrainType) && bLevel > 0 )
+ bOverTerrainType = FLAT_GROUND;
+
//NOT ok if in water....
if ( TERRAIN_IS_WATER( bOverTerrainType) )
{
diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp
index c6e345f5..2794f462 100644
--- a/Tactical/Soldier Control.cpp
+++ b/Tactical/Soldier Control.cpp
@@ -4503,6 +4503,13 @@ void SOLDIERTYPE::SetSoldierGridNo( INT32 sNewGridNo, BOOLEAN fForceRemove )
}
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+ if ( (TERRAIN_IS_WATER( this->bOverTerrainType) || TERRAIN_IS_WATER( this->bOldOverTerrainType)) && this->pathing.bLevel > 0 )
+ {
+ this->bOverTerrainType = FLAT_GROUND;
+ this->bOldOverTerrainType = FLAT_GROUND;
+ }
// OK, If we were not in deep water but we are now, handle deep animations!
if ( TERRAIN_IS_DEEP_WATER( this->bOverTerrainType) && !TERRAIN_IS_DEEP_WATER( this->bOldOverTerrainType) )
@@ -4510,20 +4517,17 @@ void SOLDIERTYPE::SetSoldierGridNo( INT32 sNewGridNo, BOOLEAN fForceRemove )
// Based on our current animation, change!
switch( this->usAnimState )
{
- case WALKING:
- case WALKING_PISTOL_RDY:
- case WALKING_RIFLE_RDY:
- case WALKING_DUAL_RDY:
- case RUNNING:
-
- // IN deep water, swim!
-
- // Make transition from low to deep
- this->EVENT_InitNewSoldierAnim( LOW_TO_DEEP_WATER, 0 , FALSE );
- this->usPendingAnimation = DEEP_WATER_SWIM;
- this->usDontUpdateNewGridNoOnMoveAnimChange = 1;
- PlayJA2Sample( ENTER_DEEP_WATER_1, RATE_11025, SoundVolume( MIDVOLUME, this->sGridNo ), 1, SoundDir( this->sGridNo ) );
-
+ case WALKING:
+ case WALKING_PISTOL_RDY:
+ case WALKING_RIFLE_RDY:
+ case WALKING_DUAL_RDY:
+ case RUNNING:
+ // IN deep water, swim!
+ // Make transition from low to deep
+ this->EVENT_InitNewSoldierAnim( LOW_TO_DEEP_WATER, 0 , FALSE );
+ this->usPendingAnimation = DEEP_WATER_SWIM;
+ this->usDontUpdateNewGridNoOnMoveAnimChange = 1;
+ PlayJA2Sample( ENTER_DEEP_WATER_1, RATE_11025, SoundVolume( MIDVOLUME, this->sGridNo ), 1, SoundDir( this->sGridNo ) );
}
}
@@ -4532,7 +4536,7 @@ void SOLDIERTYPE::SetSoldierGridNo( INT32 sNewGridNo, BOOLEAN fForceRemove )
{
WaterDamage( this );
}
-
+
// OK, If we were in deep water but we are NOT now, handle mid animations!
if ( !TERRAIN_IS_DEEP_WATER( this->bOverTerrainType) && TERRAIN_IS_DEEP_WATER( this->bOldOverTerrainType) )
{
@@ -4702,7 +4706,7 @@ void SOLDIERTYPE::EVENT_FireSoldierWeapon( INT32 sTargetGridNo )
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// SANDRO - hack! - an interrupt pending before shot
- if ( gGameExternalOptions.fImprovedInterruptSystem )
+ if ( gGameOptions.fImprovedInterruptSystem )
{
if ( ResolvePendingInterrupt( this, BEFORESHOT_INTERRUPT ) )
{
@@ -7294,6 +7298,11 @@ void SOLDIERTYPE::EVENT_BeginMercTurn( BOOLEAN fFromRealTime, INT32 iRealTimeCou
this->sOldXPos = sStartPosX;
this->sOldYPos = sStartPosY;
+ // Flugente FTW 1: Cool down all weapons in inventory
+ if ( gGameOptions.fWeaponOverheating )
+ {
+ this->SoldierInventoryCoolDown();
+ }
}
// UTILITY FUNCTIONS CALLED BY OVERHEAD.H
@@ -10811,8 +10820,11 @@ void ReleaseSoldiersAttacker( SOLDIERTYPE *pSoldier )
BOOLEAN SOLDIERTYPE::MercInWater( void )
{
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+
// Our water texture , for now is of a given type
- if ( TERRAIN_IS_WATER( this->bOverTerrainType))
+ if ( TERRAIN_IS_WATER( this->bOverTerrainType) && this->pathing.bLevel <= 0 )
{
return( TRUE );
}
@@ -10824,8 +10836,11 @@ BOOLEAN SOLDIERTYPE::MercInWater( void )
BOOLEAN SOLDIERTYPE::MercInShallowWater( void )
{
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+
// Our water texture , for now is of a given type
- if ( TERRAIN_IS_SHALLOW_WATER( this->bOverTerrainType))
+ if ( TERRAIN_IS_SHALLOW_WATER( this->bOverTerrainType) && this->pathing.bLevel <= 0 )
{
return( TRUE );
}
@@ -10838,8 +10853,11 @@ BOOLEAN SOLDIERTYPE::MercInShallowWater( void )
BOOLEAN SOLDIERTYPE::MercInDeepWater( void )
{
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+
// Our water texture , for now is of a given type
- if ( TERRAIN_IS_DEEP_WATER( this->bOverTerrainType))
+ if ( TERRAIN_IS_DEEP_WATER( this->bOverTerrainType) && this->pathing.bLevel <= 0 )
{
return( TRUE );
}
@@ -10851,8 +10869,11 @@ BOOLEAN SOLDIERTYPE::MercInDeepWater( void )
BOOLEAN SOLDIERTYPE::MercInHighWater( void )
{
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+
// Our water texture , for now is of a given type
- if ( TERRAIN_IS_HIGH_WATER( this->bOverTerrainType))
+ if ( TERRAIN_IS_HIGH_WATER( this->bOverTerrainType) && this->pathing.bLevel <= 0 )
{
return( TRUE );
}
@@ -12858,10 +12879,148 @@ BOOLEAN SOLDIERTYPE::SoldierCarriesTwoHandedWeapon( void )
}
return( FALSE );
-
}
+// Flugente FTW 1: Cool down all items in inventory
+void SOLDIERTYPE::SoldierInventoryCoolDown(void)
+{
+ INT8 invsize = (INT8)this->inv.size(); // remember inventorysize, so we don't call size() repeatedly
+ for ( INT8 bLoop = 0; bLoop < invsize; ++bLoop) // ... for all items in our inventory ...
+ {
+ // ... if Item exists and is a gun, a launcher or a barrel ...
+ if (this->inv[bLoop].exists() == true && ( Item[this->inv[bLoop].usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[this->inv[bLoop].usItem].barrel == TRUE ) )
+ {
+ OBJECTTYPE * pObj = &(this->inv[bLoop]); // ... get pointer for this item ...
+
+ if ( pObj != NULL ) // ... if pointer is not obviously useless ...
+ {
+ for(INT16 i = 0; i < pObj->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ...
+ {
+ FLOAT temperature = (*pObj)[i]->data.bTemperature; // ... get temperature of item ...
+
+ FLOAT cooldownfactor = GetItemCooldownFactor(pObj); // ... get cooldown factor ...
+
+ FLOAT newtemperature = max(0.0, temperature - cooldownfactor); // ... calculate new temperature ...
+ (*pObj)[i]->data.bTemperature = newtemperature; // ... set new temperature
+
+#if 0//def JA2TESTVERSION
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Item temperature lowered from %4.2f to %4.2f", temperature, newtemperature );
+#endif
+ // for every objects, we also have to check wether there are weapon attachments (eg. underbarrel grenade launchers), and cool them down too
+ attachmentList::iterator iterend = (*pObj)[i]->attachments.end();
+ for (attachmentList::iterator iter = (*pObj)[i]->attachments.begin(); iter != iterend; ++iter)
+ {
+ if ( iter->exists() && Item[ iter->usItem ].usItemClass & (IC_LAUNCHER|IC_LAUNCHER) )
+ {
+ FLOAT temperature = (*iter)[i]->data.bTemperature; // ... get temperature of item ...
+
+ FLOAT cooldownfactor = GetItemCooldownFactor( &(*iter) ); // ... get cooldown factor ...
+
+ FLOAT newtemperature = max(0.0, temperature - cooldownfactor); // ... calculate new temperature ...
+ (*iter)[i]->data.bTemperature = newtemperature; // ... set new temperature
+
+#if 0//def JA2TESTVERSION
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Item temperature lowered from %4.2f to %4.2f", temperature, newtemperature );
+#endif
+
+ // we assume that there can exist only 1 UGL per weapon
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+// Flugente: determien if we can rest our weapon on something. This can only happen when STANDING/CROUCHED. As a result, we get superior handling modifiers (we apply the PRONE modfiers)
+BOOLEAN SOLDIERTYPE::IsWeaponMounted( void )
+{
+ BOOLEAN applybipod = FALSE;
+
+ // not possible if already prone
+ if ( gAnimControl[ this->usAnimState ].ubEndHeight == ANIM_PRONE )
+ return( FALSE );
+
+ BOOLEAN onroof = FALSE;
+ // not possible to get this bonus on a roof, as there are no objects on the roof on which we could rest our gun
+ if ( this->pathing.bLevel == 1 )
+ onroof = TRUE;
+
+ // we determine the height of the next tile in our direction. Because of the way structures are handled, we sometimes have to take the very tile we're occupying right now
+ INT32 nextGridNoinSight = this->sGridNo;
+ if ( this->ubDirection == NORTH || this->ubDirection == SOUTHWEST || this->ubDirection == WEST || this->ubDirection == NORTHWEST )
+ nextGridNoinSight = NewGridNo( nextGridNoinSight, DirectionInc( this->ubDirection ) );
+
+ INT8 adjacenttileheight = GetTallestStructureHeight( nextGridNoinSight, FALSE );
+
+ // if the tile actually has a bit of height, we can rest our gun on it
+ if ( gAnimControl[ this->usAnimState ].ubEndHeight == ANIM_CROUCH && (adjacenttileheight == 1 || adjacenttileheight == 2 ) )
+ {
+ // now we really want to check the next tile
+ nextGridNoinSight = NewGridNo( this->sGridNo, DirectionInc( this->ubDirection ) );
+
+ // for some nefarious reason, trees also have height 2, so we have to check for that too...
+ STRUCTURE * pStructure = FindStructure( nextGridNoinSight, STRUCTURE_TREE );
+
+ if (!pStructure)
+ {
+ // for some reason I find EXTREMELY FRUSTRATING, we might get a heigth of 2 on a totally empty tile... so we check if we could occupy the tile
+ if ( !IsLocationSittable( nextGridNoinSight, onroof ) )
+ // resting our gun on people would be rude - only allow if nobody is there
+ if( WhoIsThere2( nextGridNoinSight, onroof ) == NOBODY )
+ applybipod = TRUE;
+ }
+ }
+ else if ( gAnimControl[ this->usAnimState ].ubEndHeight == ANIM_CROUCH && adjacenttileheight == 4)
+ {
+ // tile is as high as a building, but there might be a window, we could look through that
+ // note that we also check for STRUCTURE_OPEN - the window has to be open (smashed)
+ STRUCTURE * pStructure = FindStructure( nextGridNoinSight, STRUCTURE_WALLNWINDOW );
+
+ if ( pStructure )
+ {
+ if ( ( this->ubDirection == SOUTH || this->ubDirection == NORTH )
+ && (pStructure->ubWallOrientation == OUTSIDE_TOP_LEFT || pStructure->ubWallOrientation == INSIDE_TOP_LEFT )
+ && pStructure->fFlags & STRUCTURE_WALLNWINDOW && pStructure->fFlags & STRUCTURE_OPEN )
+ {
+ applybipod = TRUE;
+ }
+ else if ( ( this->ubDirection == EAST || this->ubDirection == WEST )
+ && ( pStructure->ubWallOrientation == OUTSIDE_TOP_RIGHT || pStructure->ubWallOrientation == INSIDE_TOP_RIGHT )
+ && pStructure->fFlags & STRUCTURE_WALLNWINDOW && pStructure->fFlags & STRUCTURE_OPEN )
+ {
+ applybipod = TRUE;
+ }
+ else if ( ( this->ubDirection == SOUTHWEST || this->ubDirection == NORTHWEST || this->ubDirection == SOUTHEAST || this->ubDirection == NORTHEAST)
+ && (pStructure->ubWallOrientation == OUTSIDE_TOP_LEFT || pStructure->ubWallOrientation == INSIDE_TOP_LEFT || pStructure->ubWallOrientation == OUTSIDE_TOP_RIGHT || pStructure->ubWallOrientation == INSIDE_TOP_RIGHT)
+ && pStructure->fFlags & STRUCTURE_WALLNWINDOW && pStructure->fFlags & STRUCTURE_OPEN )
+ {
+ applybipod = TRUE;
+ }
+ }
+ }
+ else if ( gAnimControl[ this->usAnimState ].ubEndHeight == ANIM_STAND && adjacenttileheight == 3 )
+ {
+ // now we really want to check the next tile
+ nextGridNoinSight = NewGridNo( this->sGridNo, DirectionInc( this->ubDirection ) );
+
+ // for some nefarious reason, trees also have height 2, so we have to check for that too...
+ STRUCTURE * pStructure = FindStructure( nextGridNoinSight, STRUCTURE_TREE );
+
+ if (!pStructure)
+ {
+ // for some reason I find EXTREMELY FRUSTRATING, we might get a heigth of 2 on a totally empty tile... so we check if we could occupy the tile
+ if ( !IsLocationSittable( nextGridNoinSight, onroof ) )
+ // resting our gun on people would be rude - only allow if nobody is there
+ if( WhoIsThere2( nextGridNoinSight, onroof ) == NOBODY )
+ applybipod = TRUE;
+ }
+ }
+
+ return( applybipod );
+}
INT32 CheckBleeding( SOLDIERTYPE *pSoldier )
{
@@ -14985,6 +15144,8 @@ BOOLEAN ResolvePendingInterrupt( SOLDIERTYPE * pSoldier, UINT8 ubInterruptType )
continue; // not enemy
if ( CONSIDERED_NEUTRAL( pSoldier, pInterrupter ) )
continue; // neutral
+ if ( CONSIDERED_NEUTRAL( pInterrupter, pSoldier ) )
+ continue; // neutral
/////////////////////////////////////////////////////////////
// Calculate Reaction Time (i.e. interrupt counter length) //
diff --git a/Tactical/Soldier Control.h b/Tactical/Soldier Control.h
index 6ca2bc89..8851cee6 100644
--- a/Tactical/Soldier Control.h
+++ b/Tactical/Soldier Control.h
@@ -1318,6 +1318,8 @@ public:
BOOLEAN IsValidSecondHandShot( void );
BOOLEAN IsValidSecondHandShotForReloadingPurposes( void );
BOOLEAN SoldierCarriesTwoHandedWeapon( void );
+ void SoldierInventoryCoolDown( void ); // Flugente FTW 1: Cool down all items in inventory
+ BOOLEAN IsWeaponMounted( void );
}; // SOLDIERTYPE;
diff --git a/Tactical/Soldier Profile.cpp b/Tactical/Soldier Profile.cpp
index 518f0d57..2128b3db 100644
--- a/Tactical/Soldier Profile.cpp
+++ b/Tactical/Soldier Profile.cpp
@@ -996,12 +996,6 @@ void DecideActiveTerrorists( void )
break;
}
- //////////////////////////////////////////////////////////////////////////
- // this makes no sense now, we just set the exact number of them below
- //if ( gGameExternalOptions.fEnableAllTerrorists )
- // uiChance = 100;
- //////////////////////////////////////////////////////////////////////////
-
// add at least 2 more
ubNumAdditionalTerrorists = 2;
for (ubLoop = 0; ubLoop < (MAX_ADDITIONAL_TERRORISTS - 3); ubLoop++) // -3 instead of -2 because we increased MAX_ADDITIONAL_TERRORISTS above by 1
@@ -1013,8 +1007,8 @@ void DecideActiveTerrorists( void )
}
/////////////////////////////////////////////////////
- // Added so with ENABLE_ALL_TERRORISTS you really get all of them (5 + Charlie)
- if ( gGameOptions.fEnableAllTerrorists )
+ // Added, so with ENABLE_ALL_TERRORISTS you really get all of them (5 + Charlie)
+ if ( gGameExternalOptions.fEnableAllTerrorists )
ubNumAdditionalTerrorists = 5;
/////////////////////////////////////////////////////
@@ -1037,7 +1031,7 @@ void DecideActiveTerrorists( void )
ubTerrorist = gubTerrorists[ ubLoop ];
// random 40% chance of adding this terrorist if not yet placed
- if ( ( gMercProfiles[ ubTerrorist ].sSectorX == 0 ) && (( Random( 100 ) < 40 ) || gGameOptions.fEnableAllTerrorists ) ) // also added the check because it makes no sense to choose randomly which terrorist will be in game, all of them should
+ if ( ( gMercProfiles[ ubTerrorist ].sSectorX == 0 ) && (( Random( 100 ) < 40 ) || gGameExternalOptions.fEnableAllTerrorists ) ) // also added the check because it makes no sense to choose randomly which terrorist will be in game, all of them should
{
//fFoundSpot = FALSE;
// Since there are 5 spots per terrorist and a maximum of 5 terrorists, we
diff --git a/Tactical/Soldier Tile.cpp b/Tactical/Soldier Tile.cpp
index 2ba54cfd..af73a945 100644
--- a/Tactical/Soldier Tile.cpp
+++ b/Tactical/Soldier Tile.cpp
@@ -480,6 +480,11 @@ BOOLEAN HandleNextTile( SOLDIERTYPE *pSoldier, INT8 bDirection, INT32 sGridNo, I
bOverTerrainType = GetTerrainType( sGridNo );
+ // WANNE.WATER: If our soldier is not on the ground level and the tile is a "water" tile, then simply set the tile to "FLAT_GROUND"
+ // This should fix "problems" for special modified maps
+ if ( TERRAIN_IS_WATER( bOverTerrainType) && pSoldier->pathing.bLevel > 0 )
+ bOverTerrainType = FLAT_GROUND;
+
// Check if we are going into water!
if ( TERRAIN_IS_WATER( bOverTerrainType) )
{
diff --git a/Tactical/Strategic Exit GUI.cpp b/Tactical/Strategic Exit GUI.cpp
index 9ca74be4..f6ff728b 100644
--- a/Tactical/Strategic Exit GUI.cpp
+++ b/Tactical/Strategic Exit GUI.cpp
@@ -620,7 +620,7 @@ void RenderSectorExitMenu( )
gsGlobalCursorYOffset = 0;
SetCurrentCursorFromDatabase( CURSOR_NORMAL );
- while( DequeueEvent( &Event ) )
+ while (DequeueSpecificEvent(&Event, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if( Event.usEvent == KEY_DOWN )
{
diff --git a/Tactical/Tactical Turns.cpp b/Tactical/Tactical Turns.cpp
index 0046d5fe..c9edd937 100644
--- a/Tactical/Tactical Turns.cpp
+++ b/Tactical/Tactical Turns.cpp
@@ -151,6 +151,8 @@ void HandleTacticalEndTurn( )
// OK, Do a number of things here....
// Every few turns......
+ SetFastForwardMode(FALSE); // Cancel FF at end of battle
+
// Get time elasped
uiTime = GetWorldTotalSeconds( );
@@ -269,6 +271,8 @@ void HandleTacticalEndTurn( )
HandleRPCDescription( );
#endif
+ // Flugente FTW 1: Cool down all items not in a soldier's inventory
+ CoolDownWorldItems();
}
diff --git a/Tactical/Tactical_VS2010.vcxproj b/Tactical/Tactical_VS2010.vcxproj
index 1e4ebfbd..dff54fd7 100644
--- a/Tactical/Tactical_VS2010.vcxproj
+++ b/Tactical/Tactical_VS2010.vcxproj
@@ -290,24 +290,24 @@
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
diff --git a/Tactical/TeamTurns.cpp b/Tactical/TeamTurns.cpp
index ebc88329..777dde60 100644
--- a/Tactical/TeamTurns.cpp
+++ b/Tactical/TeamTurns.cpp
@@ -166,6 +166,7 @@ void StartPlayerTeamTurn( BOOLEAN fDoBattleSnd, BOOLEAN fEnteringCombatMode )
DebugMsg (TOPIC_JA2INTERRUPT,DBG_LEVEL_3,"StartPlayerTeamTurn");
// SOLDIERTYPE *pSoldier;
// EV_S_BEGINTURN SBeginTurn;
+ SetFastForwardMode(FALSE);
// Start the turn of player charactors
@@ -486,6 +487,20 @@ void BeginTeamTurn( UINT8 ubTeam )
if( !LightningEndOfTurn( ubTeam ) )return;
//end rain
+ // disable for our turn and enable for other teams
+ if ( gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] )
+ {
+ if (is_networked)
+ {
+ // Only allow fast forward mode on enemy team!
+ SetFastForwardMode( (ubTeam == ENEMY_TEAM) );
+ }
+ else
+ {
+ // Allow fast forward mode on all teams except our team!
+ SetFastForwardMode( (ubTeam != OUR_TEAM) );
+ }
+ }
while( 1 )
{
@@ -812,6 +827,9 @@ void StartInterrupt( void )
UINT8 ubInterrupters = 0;
INT32 iSquad, iCounter;
+ // disable ff mode
+ SetFastForwardMode(FALSE);
+
// build string for display of who gets interrupt
//while( 1 )
for( iCounter = 0; iCounter <= MAX_NUM_SOLDIERS; iCounter++ )
@@ -833,83 +851,122 @@ void StartInterrupt( void )
}
}
- wcscpy( sTemp, Message[ STR_INTERRUPT_FOR ] );
+ // TODO: check here to see if we really can do anything with available mercs on this team
+ // if not then end interrupt. Probably should check if actions for for the interrupter but then we
+ // would lose potential XP for being able to radio rest of team about enemy from the interrupt
+ // Theoretically ubInterrupter is enemy causing interrupt
- // build string in separate loop here, want to linearly process squads...
- for ( iSquad = 0; iSquad < NUMBER_OF_SQUADS; iSquad++ )
+
+ BOOL handleInterrupt = TRUE;
+ if (ubInterrupter != NOBODY)
{
- for ( iCounter = 0; iCounter < NUMBER_OF_SOLDIERS_PER_SQUAD; iCounter++ )
- {
- pTempSoldier = Squad[ iSquad ][ iCounter ];
- if ( pTempSoldier && pTempSoldier->bActive && pTempSoldier->bInSector && !pTempSoldier->aiData.bMoved )
- {
- // then this guy got an interrupt...
- ubInterrupters++;
- if ( ubInterrupters > 6 )
- {
- // flush... display string, then clear it (we could have 20 names!)
- // add comma to end, we know we have another person after this...
- wcscat( sTemp, L", " );
- ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, sTemp );
- wcscpy( sTemp, L"" );
- ubInterrupters = 1;
- }
+ handleInterrupt = FALSE;
- if ( ubInterrupters > 1 )
+ // build string in separate loop here, want to linearly process squads...
+ SOLDIERTYPE *pInterruptedSoldier = MercPtrs[ubInterrupter];
+ for ( iSquad = 0; iSquad < NUMBER_OF_SQUADS; iSquad++ )
+ {
+ for ( iCounter = 0; iCounter < NUMBER_OF_SOLDIERS_PER_SQUAD; iCounter++ )
+ {
+ pTempSoldier = Squad[ iSquad ][ iCounter ];
+ if ( pTempSoldier && pTempSoldier->bActive && pTempSoldier->bInSector && !pTempSoldier->aiData.bMoved )
{
- wcscat( sTemp, L", " );
+ INT16 ubMinAPcost = MinAPsToAttack(pSoldier,pInterruptedSoldier->sGridNo,ADDTURNCOST);
+ // if we don't have enough APs left to shoot even a snap-shot at this guy
+ if (ubMinAPcost < pSoldier->bActionPoints)
+ {
+ handleInterrupt = TRUE;
+ }
}
- wcscat( sTemp, pTempSoldier->name );
}
}
}
-
- ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, sTemp );
-
- DebugMsg( TOPIC_JA2INTERRUPT, DBG_LEVEL_3, String("INTERRUPT: starting interrupt for %d", ubFirstInterrupter ) );
- // gusSelectedSoldier should become the topmost guy on the interrupt list
- //gusSelectedSoldier = ubFirstInterrupter;
-
- // Remove deadlock message
- EndDeadlockMsg( );
-
- // Select guy....
- SelectSoldier( ubFirstInterrupter, TRUE, TRUE );
-
- // ATE; Slide to guy who got interrupted!
- SlideTo( NOWHERE, gubLastInterruptedGuy, NOBODY, SETLOCATOR);
-
- // Dirty panel interface!
- fInterfacePanelDirty = DIRTYLEVEL2;
- gTacticalStatus.ubCurrentTeam = pSoldier->bTeam;
-
- // Signal UI done enemy's turn
- guiPendingOverrideEvent = LU_ENDUILOCK;
-
- if (is_networked)
- guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
-
- HandleTacticalUI( );
-
- InitPlayerUIBar( TRUE );
- //AddTopMessage( PLAYER_INTERRUPT_MESSAGE, Message[STR_INTERRUPT] );
-
- PlayJA2Sample( ENDTURN_1, RATE_11025, MIDVOLUME, 1, MIDDLEPAN );
-
- // report any close call quotes for us here
- for ( iCounter = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; iCounter <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; iCounter++ )
+ if (!handleInterrupt)
{
- if ( OK_INSECTOR_MERC( MercPtrs[ iCounter ] ) )
+ // no mercs can take even a snapshot at the guy
+ EndInterrupt(TRUE);
+ }
+ else
+ {
+ wcscpy( sTemp, Message[ STR_INTERRUPT_FOR ] );
+
+ // build string in separate loop here, want to linearly process squads...
+ ubInterrupters = 0;
+ for ( iSquad = 0; iSquad < NUMBER_OF_SQUADS; iSquad++ )
{
- if ( MercPtrs[ iCounter ]->flags.fCloseCall )
+ for ( iCounter = 0; iCounter < NUMBER_OF_SOLDIERS_PER_SQUAD; iCounter++ )
{
- if ( MercPtrs[ iCounter ]->bNumHitsThisTurn == 0 && !(MercPtrs[ iCounter ]->usQuoteSaidExtFlags & SOLDIER_QUOTE_SAID_EXT_CLOSE_CALL) && Random( 3 ) == 0 )
+ pTempSoldier = Squad[ iSquad ][ iCounter ];
+ if ( pTempSoldier && pTempSoldier->bActive && pTempSoldier->bInSector && !pTempSoldier->aiData.bMoved )
{
- // say close call quote!
- TacticalCharacterDialogue( MercPtrs[ iCounter ], QUOTE_CLOSE_CALL );
- MercPtrs[ iCounter ]->usQuoteSaidExtFlags |= SOLDIER_QUOTE_SAID_EXT_CLOSE_CALL;
+ // then this guy got an interrupt...
+ ubInterrupters++;
+ if ( ubInterrupters > 6 )
+ {
+ // flush... display string, then clear it (we could have 20 names!)
+ // add comma to end, we know we have another person after this...
+ wcscat( sTemp, L", " );
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, sTemp );
+ wcscpy( sTemp, L"" );
+ ubInterrupters = 1;
+ }
+
+ if ( ubInterrupters > 1 )
+ {
+ wcscat( sTemp, L", " );
+ }
+ wcscat( sTemp, pTempSoldier->name );
+ }
+ }
+ }
+
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, sTemp );
+
+ DebugMsg( TOPIC_JA2INTERRUPT, DBG_LEVEL_3, String("INTERRUPT: starting interrupt for %d", ubFirstInterrupter ) );
+ // gusSelectedSoldier should become the topmost guy on the interrupt list
+ //gusSelectedSoldier = ubFirstInterrupter;
+
+ // Remove deadlock message
+ EndDeadlockMsg( );
+
+ // Select guy....
+ SelectSoldier( ubFirstInterrupter, TRUE, TRUE );
+
+ // ATE; Slide to guy who got interrupted!
+ SlideTo( NOWHERE, gubLastInterruptedGuy, NOBODY, SETLOCATOR);
+
+ // Dirty panel interface!
+ fInterfacePanelDirty = DIRTYLEVEL2;
+ gTacticalStatus.ubCurrentTeam = pSoldier->bTeam;
+
+ // Signal UI done enemy's turn
+ guiPendingOverrideEvent = LU_ENDUILOCK;
+
+ if (is_networked)
+ guiPendingOverrideEvent = LA_ENDUIOUTURNLOCK;
+
+ HandleTacticalUI( );
+
+ InitPlayerUIBar( TRUE );
+ //AddTopMessage( PLAYER_INTERRUPT_MESSAGE, Message[STR_INTERRUPT] );
+
+ PlayJA2Sample( ENDTURN_1, RATE_11025, MIDVOLUME, 1, MIDDLEPAN );
+
+ // report any close call quotes for us here
+ for ( iCounter = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; iCounter <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; iCounter++ )
+ {
+ if ( OK_INSECTOR_MERC( MercPtrs[ iCounter ] ) )
+ {
+ if ( MercPtrs[ iCounter ]->flags.fCloseCall )
+ {
+ if ( MercPtrs[ iCounter ]->bNumHitsThisTurn == 0 && !(MercPtrs[ iCounter ]->usQuoteSaidExtFlags & SOLDIER_QUOTE_SAID_EXT_CLOSE_CALL) && Random( 3 ) == 0 )
+ {
+ // say close call quote!
+ TacticalCharacterDialogue( MercPtrs[ iCounter ], QUOTE_CLOSE_CALL );
+ MercPtrs[ iCounter ]->usQuoteSaidExtFlags |= SOLDIER_QUOTE_SAID_EXT_CLOSE_CALL;
+ }
+ MercPtrs[ iCounter ]->flags.fCloseCall = FALSE;
}
- MercPtrs[ iCounter ]->flags.fCloseCall = FALSE;
}
}
}
@@ -969,7 +1026,7 @@ void StartInterrupt( void )
//if ( gTacticalStatus.ubCurrentTeam == OUR_TEAM )//hayden
// if ( pSoldier->bTeam > OUR_TEAM && pSoldier->bTeam < 6) // cheap disable
// SANDRO - we don't use the "hidden interrupt" feature with IIS
- if (!is_networked && gTacticalStatus.ubCurrentTeam == OUR_TEAM && !gGameExternalOptions.fImprovedInterruptSystem
+ if (!is_networked && gTacticalStatus.ubCurrentTeam == OUR_TEAM && !gGameOptions.fImprovedInterruptSystem
&& MercPtrs[ LATEST_INTERRUPT_GUY ]->aiData.bOppList[pTempSoldier->ubID] != SEEN_CURRENTLY
&& MercPtrs[ LATEST_INTERRUPT_GUY ]->aiData.bOppList[pTempSoldier->ubID] != SEEN_THIS_TURN )
{
@@ -1357,6 +1414,20 @@ void EndInterrupt( BOOLEAN fMarkInterruptOccurred )
fInterfacePanelDirty = DIRTYLEVEL2;
}
+
+ if ( gGameSettings.fOptions[TOPTION_AUTO_FAST_FORWARD_MODE] )
+ {
+ if (is_networked)
+ {
+ // Only allow fast forward mode on enemy team!
+ SetFastForwardMode( (gTacticalStatus.ubCurrentTeam == ENEMY_TEAM) );
+ }
+ else
+ {
+ // Allow fast forward mode on all teams except our team!
+ SetFastForwardMode( (gTacticalStatus.ubCurrentTeam != OUR_TEAM) );
+ }
+ }
}
@@ -2365,7 +2436,7 @@ void ResolveInterruptsVs( SOLDIERTYPE * pSoldier, UINT8 ubInterruptType)
// add this guy to everyone's interrupt queue
AddToIntList(ubIntList[ubSmallestSlot],TRUE,TRUE);
// SANDRO - for IIS, reset counter if we got here
- if ( gGameExternalOptions.fImprovedInterruptSystem )
+ if ( gGameOptions.fImprovedInterruptSystem )
{
// reset the counter
MercPtrs[ ubIntList[ubSmallestSlot] ]->aiData.ubInterruptCounter[pSoldier->ubID] = 0;
diff --git a/Tactical/Turn Based Input.cpp b/Tactical/Turn Based Input.cpp
index 5ffa1727..dc1e9513 100644
--- a/Tactical/Turn Based Input.cpp
+++ b/Tactical/Turn Based Input.cpp
@@ -116,8 +116,10 @@
#include "Strategic AI.h"
#endif
-#include "Quest Debug System.h"
+#include "Quest Debug System.h"
#include "connect.h"
+#include "fresh_header.h"
+
//forward declarations of common classes to eliminate includes
class OBJECTTYPE;
class SOLDIERTYPE;
@@ -190,7 +192,11 @@ BOOLEAN gfNextFireJam = FALSE;
INT16 brstmode = 0; //dddd
extern INT16 ITEMDESC_START_X;
extern INT16 ITEMDESC_START_Y;
-#include "fresh_header.h"
+
+
+BOOLEAN gfMouseLockedOnBorder = FALSE;
+extern int iWindowedMode;
+
//Little functions called by keyboard input
void SwapGoggles(SOLDIERTYPE *pTeamSoldier);
@@ -1550,29 +1556,62 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
}
#endif
-
- // It is not allowed in a network game to go to the load screen, because if you cancel the load screen it is always your turn!
+
+ // BEGIN: by Lejardo for mouse-locking in game screen
+ // WANNE: If the game runs in windowed mode, the user can "lock" / "unlock" the mouse cursor
+ if (iWindowedMode)
+ {
+ SGPRect LJDRect;
+ if ((InputEvent.usEvent == KEY_DOWN ) && ( InputEvent.usParam == 'z' || InputEvent.usParam == 'y'))
+ {
+ if( (InputEvent.usKeyState & CTRL_DOWN) && !(InputEvent.usKeyState & ALT_DOWN))
+ {
+ // Unlock the mouse cursor
+ if (gfMouseLockedOnBorder)
+ {
+ FreeMouseCursor();
+
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_WINDOWED_MODE_RELEASE_MOUSE] );
+ }
+ // Lock the mouse cursor
+ else
+ {
+ LJDRect.iLeft = 0;
+ LJDRect.iTop = 0;
+ LJDRect.iRight = SCREEN_WIDTH;
+ LJDRect.iBottom = SCREEN_HEIGHT;
+ RestrictMouseCursor( &LJDRect );
+
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[MSG_WINDOWED_MODE_LOCK_MOUSE] );
+ }
+
+ gfMouseLockedOnBorder = !gfMouseLockedOnBorder;
+ }
+ }
+ }
+ // END: by Lejardo for mouse-locking in game screen
+
+ // WANNE: Just disabled for now, because we don't need it yet.
+ /*
+ // WANNE: If the game hangs on enemy turn, just press ALT + CTRL + E and the game will continue with enemy turn!!
+ if ( (InputEvent.usEvent == KEY_DOWN )&& (InputEvent.usKeyState & CTRL_DOWN) && ( InputEvent.usParam == 'e') )
+ {
+ if( InputEvent.usKeyState & ALT_DOWN )
+ {
+ if (gTacticalStatus.ubCurrentTeam != 0)
+ {
+ if( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) )
+ {
+ EndTurn( 1 );
+ }
+ }
+ }
+ }
+ */
+
if (!is_networked)
{
- // WANNE: Just disabled for now
- /*
- // WANNE: If the game hangs on enemy turn, just press ALT + CTRL + E and the game will continue with enemy turn!!
- if ( (InputEvent.usEvent == KEY_DOWN )&& (InputEvent.usKeyState & CTRL_DOWN) && ( InputEvent.usParam == 'e') )
- {
- if( InputEvent.usKeyState & ALT_DOWN )
- {
- if (gTacticalStatus.ubCurrentTeam != 0)
- {
- if( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) )
- {
- EndTurn( 1 );
- }
- }
- }
- }
- */
-
- /// Allow to load everywhere
+ // Allow to load everywhere
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'l') )
{
if( InputEvent.usKeyState & ALT_DOWN )
@@ -1593,7 +1632,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
else if( InputEvent.usKeyState & CTRL_DOWN )
{
// WANNE: Do not allow saving via the save screen when it is not our turn,
- // because there is an explit when you close the save window without saving, you can move your merc even it is not your turn
+ // because there is an exploit when you close the save window without saving, you can move your merc even it is not your turn
// IF UI HAS LOCKED, ONLY ALLOW EXIT!
if ( gfDisableRegionActive || gfUserTurnRegionActive )
{
@@ -1609,7 +1648,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
LeaveTacticalScreen( SAVE_LOAD_SCREEN );
}
}
- }
+ }
}
if (is_networked)
@@ -1668,8 +1707,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
{
overide_turn();
}
- }
-
+ }
}
if ((InputEvent.usEvent == KEY_DOWN )&& ( InputEvent.usParam == 'k') )
@@ -1686,8 +1724,11 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
// OJW - 090209 - ingame chat
if (InputEvent.usEvent == KEY_UP && InputEvent.usParam == 'y')
{
- OpenChatMsgBox();
- continue;
+ if( !(InputEvent.usKeyState & ALT_DOWN) && !(InputEvent.usKeyState & CTRL_DOWN))
+ {
+ OpenChatMsgBox();
+ continue;
+ }
}
} // end is_networked
@@ -2541,14 +2582,23 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
case 'A':
//CHRISL: Ammo Crate
- if ( fCtrl )
+ //MM: Ammo Box
+ if(!(gTacticalStatus.fEnemyInSector))
{
- if(!(gTacticalStatus.fEnemyInSector))
+ INT32 crateItem;
+ INT32 worldItem;
+ UINT8 magType;
+ bool mergeSuccessful, ammoPresent;
+ OBJECTTYPE newCrate;
+ ammoPresent = true;
+
+ if (fCtrl)
+ magType = AMMO_CRATE;
+ else
+ magType = AMMO_BOX;
+
+ while (ammoPresent)
{
- INT32 crateItem;
- INT32 worldItem;
- bool mergeSuccessful;
- OBJECTTYPE newCrate;
//look through all sector items for ammo.
for(unsigned int wItem = 0; wItem < guiNumWorldItems; wItem++)
{
@@ -2557,20 +2607,25 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
if(Item[gWorldItems[wItem].object.usItem].usItemClass == IC_AMMO && gWorldItems[wItem].bVisible == TRUE && gWorldItems[wItem].fExists && (gWorldItems[wItem].usFlags & WORLD_ITEM_REACHABLE) && !(gWorldItems[wItem].usFlags & WORLD_ITEM_ARMED_BOMB))
{
worldItem = gWorldItems[wItem].object.usItem;
- //we don't want to do anything if the world item is already an ammo crate
- if(Item[worldItem].ammocrate == TRUE)
+ //we don't want to do anything if the world item is already an ammo crate/box
+ if(Magazine[Item[worldItem].ubClassIndex].ubMagType == magType)
continue;
+
//we have a valid, ammo item. Look through Items.xml and see if we have an ammo crate for
// this ammo type
for(int iLoop = 0; iLoop < MAXITEMS; iLoop++)
{
- //if ammocrate && calibers match && Ammo Types match
- if(Item[iLoop].ammocrate == TRUE && Magazine[Item[iLoop].ubClassIndex].ubCalibre == Magazine[Item[worldItem].ubClassIndex].ubCalibre && Magazine[Item[iLoop].ubClassIndex].ubAmmoType == Magazine[Item[worldItem].ubClassIndex].ubAmmoType)
+ if (Item[iLoop].usItemClass == 0)
+ break; //no more valid items after this point
+
+ //if ammo crate && calibers match && Ammo Types match
+ if(Item[iLoop].usItemClass == IC_AMMO && Magazine[Item[iLoop].ubClassIndex].ubMagType == magType && Magazine[Item[iLoop].ubClassIndex].ubCalibre == Magazine[Item[worldItem].ubClassIndex].ubCalibre && Magazine[Item[iLoop].ubClassIndex].ubAmmoType == Magazine[Item[worldItem].ubClassIndex].ubAmmoType)
{
crateItem = iLoop;
break;
}
}
+
//if we found a crateItem in the list, we first want to see if we already have an item created
if(crateItem != 0)
{
@@ -2588,9 +2643,10 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
break;
}
}
+
}
//no crates in sector inventory. search merc inventories
- if(mergeSuccessful == false)
+ if(!mergeSuccessful)
{
for(int loop=0; loop<(int)gGameExternalOptions.ubGameMaximumNumberOfPlayerMercs; loop++)
{
@@ -2616,7 +2672,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
}
//no crates in merc inventory. create a new sector item
- if(mergeSuccessful == false)
+ if(!mergeSuccessful)
{
CreateAmmo(crateItem, &newCrate, 0);
DistributeStatus(&gWorldItems[wItem].object, &newCrate, Magazine[Item[crateItem].ubClassIndex].ubMagSize);
@@ -2629,10 +2685,29 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
}
}
+ else // MM: no crate item, so we must be missing a crate item from the xmls. Set ammoPresent to false to avoid infinitely looping.
+ ammoPresent = false;
}
}
- ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
+
+ //MM: loop through ammo multiple times, as boxes and crates may take a few passes to fill
+ ammoPresent = false;
+ for(unsigned int wItem = 0; wItem < guiNumWorldItems; wItem++)
+ {
+ if(Item[gWorldItems[wItem].object.usItem].usItemClass == IC_AMMO && gWorldItems[wItem].bVisible == TRUE && gWorldItems[wItem].fExists && (gWorldItems[wItem].usFlags & WORLD_ITEM_REACHABLE) && !(gWorldItems[wItem].usFlags & WORLD_ITEM_ARMED_BOMB))
+ {
+ worldItem = gWorldItems[wItem].object.usItem;
+ if(Magazine[Item[worldItem].ubClassIndex].ubMagType == magType)
+ continue;
+
+ ammoPresent = true;
+ break;
+ }
+ }
+
+ StackAndSort(TRUE);
}
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
}
break;
case 'J':
@@ -3043,6 +3118,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
SeperateItems();
if( fCtrl )
StackAndSort( TRUE );
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
break;
case 'D':
@@ -3134,6 +3210,18 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
break;
case 'H':
+ // swap primary & secondary hand
+ if ( gusSelectedSoldier != NOBODY && !AM_A_ROBOT( MercPtrs[ gusSelectedSoldier ] ))
+ {
+ SOLDIERTYPE *pSoldier = MercPtrs[ gusSelectedSoldier ];
+ UINT16 usOldHandItem = pSoldier->inv[HANDPOS].usItem;
+ SwapHandItems( pSoldier );
+ pSoldier->ReLoadSoldierAnimationDueToHandItemChange( usOldHandItem, pSoldier->inv[HANDPOS].usItem );
+
+ fCharacterInfoPanelDirty = TRUE;
+ fInterfacePanelDirty = DIRTYLEVEL2;
+ }
+ break;
case 'h':
if ( fAlt )
{
@@ -3276,12 +3364,49 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
SOLDIERTYPE *pSoldier = MercPtrs[ gusSelectedSoldier ];
BOOLEAN handFit = (CanItemFitInPosition(pSoldier, &pSoldier->inv[HANDPOS], GUNSLINGPOCKPOS, FALSE) || (pSoldier->inv[HANDPOS].exists() == false && pSoldier->inv[SECONDHANDPOS].exists() == false));
BOOLEAN slingFit = (CanItemFitInPosition(pSoldier, &pSoldier->inv[GUNSLINGPOCKPOS], HANDPOS, FALSE) || pSoldier->inv[GUNSLINGPOCKPOS].exists() == false);
+
if(Item[pSoldier->inv[GUNSLINGPOCKPOS].usItem].twohanded && pSoldier->inv[SECONDHANDPOS].exists() == true)
handFit = FALSE;
+
if( handFit == TRUE && slingFit == TRUE)
{
- SwapObjs(&pSoldier->inv[HANDPOS], &pSoldier->inv[GUNSLINGPOCKPOS]);
- HandleTacticalEffectsOfEquipmentChange(pSoldier, HANDPOS, pSoldier->inv[GUNSLINGPOCKPOS].usItem, pSoldier->inv[HANDPOS].usItem);
+ if (gGameOptions.fInventoryCostsAP)
+ {
+ UINT8 APCost = 0;
+ if (pSoldier->inv[GUNSLINGPOCKPOS].exists())
+ {
+ APCost += ( APBPConstants [ AP_INV_FROM_SLING ] + APBPConstants [ AP_INV_TO_HANDS ] );
+ if (gGameExternalOptions.uWeightDivisor != 0)
+ APCost += DynamicAdjustAPConstants((int)((Item[pSoldier->inv[GUNSLINGPOCKPOS].usItem].ubWeight) / gGameExternalOptions.uWeightDivisor),(int)((Item[pSoldier->inv[GUNSLINGPOCKPOS].usItem].ubWeight) / gGameExternalOptions.uWeightDivisor));
+ }
+ if (pSoldier->inv[HANDPOS].exists())
+ {
+ APCost += ( APBPConstants [ AP_INV_TO_SLING ] + APBPConstants [ AP_INV_FROM_HANDS ] );
+ if (gGameExternalOptions.uWeightDivisor != 0)
+ APCost += DynamicAdjustAPConstants((int)((Item[pSoldier->inv[HANDPOS].usItem].ubWeight) / gGameExternalOptions.uWeightDivisor),(int)((Item[pSoldier->inv[HANDPOS].usItem].ubWeight) / gGameExternalOptions.uWeightDivisor));
+ }
+ APCost = __min(APCost, APBPConstants[AP_INV_MAX_COST]);
+ if (pSoldier->bActionPoints >= APCost)
+ {
+ // SANDRO - I dared to change this to use the apropriate function, as that function is actually important for IIS
+ //pSoldier->bActionPoints -= APCost;
+ DeductPoints( pSoldier, APCost, 0 );
+
+ SwapObjs(&pSoldier->inv[HANDPOS], &pSoldier->inv[GUNSLINGPOCKPOS]);
+ HandleTacticalEffectsOfEquipmentChange(pSoldier, HANDPOS, pSoldier->inv[GUNSLINGPOCKPOS].usItem, pSoldier->inv[HANDPOS].usItem);
+ }
+ else
+ {
+ CHAR16 zOutputString[512];
+ swprintf( zOutputString, New113Message[MSG113_INVENTORY_APS_INSUFFICIENT], APCost, pSoldier->bActionPoints);
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, zOutputString );
+ }
+ }
+ else
+ {
+ SwapObjs(&pSoldier->inv[HANDPOS], &pSoldier->inv[GUNSLINGPOCKPOS]);
+ HandleTacticalEffectsOfEquipmentChange(pSoldier, HANDPOS, pSoldier->inv[GUNSLINGPOCKPOS].usItem, pSoldier->inv[HANDPOS].usItem);
+ }
}
fCharacterInfoPanelDirty = TRUE;
fInterfacePanelDirty = DIRTYLEVEL2;
@@ -3694,7 +3819,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
{
SOLDIERTYPE *pTeamSoldier;
INT8 bLoop;
- OBJECTTYPE *pGun, *pAmmo;
+ UINT16 bullets;
+ OBJECTTYPE *pGun, *pAmmo, *pAmmoMags;
// Search for soldier
for (bLoop=gTacticalStatus.Team[gbPlayerNum].bFirstID, pTeamSoldier=MercPtrs[bLoop]; bLoop <= gTacticalStatus.Team[gbPlayerNum].bLastID; bLoop++, pTeamSoldier++)
@@ -3747,6 +3873,96 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
}
}
+
+ //MM: loop thru the soldiers again (lazy copy/paste :p). could do it all at once, but then there may not be enough ammo from the world items to fill everyone's guns first
+ for (bLoop=gTacticalStatus.Team[gbPlayerNum].bFirstID, pTeamSoldier=MercPtrs[bLoop]; bLoop <= gTacticalStatus.Team[gbPlayerNum].bLastID; bLoop++, pTeamSoldier++)
+ {
+ if ( OK_CONTROLLABLE_MERC( pTeamSoldier ) && pTeamSoldier->bAssignment == CurrentSquad( ) && !AM_A_ROBOT( pTeamSoldier ) )
+ {
+ // Search for ammo in soldier inventory
+ for (UINT32 bLoop2 = 0; bLoop2 < pTeamSoldier->inv.size(); bLoop2++)
+ {
+ if ( Item[pTeamSoldier->inv[bLoop2].usItem].usItemClass & IC_AMMO )
+ {
+ pAmmoMags = &(pTeamSoldier->inv[bLoop2]);
+
+ for ( UINT16 stackMag = 0; stackMag < (*pAmmoMags).ubNumberOfObjects; stackMag++ )
+ {
+ if ( (*pAmmoMags)[stackMag]->data.ubShotsLeft < Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubMagSize )
+ {
+ // Search for ammo in sector
+ for ( UINT32 uiLoop = 0; uiLoop < guiNumWorldItems; uiLoop++ )
+ {
+ if ( (gWorldItems[ uiLoop ].bVisible == TRUE) && (gWorldItems[ uiLoop ].fExists) && (gWorldItems[ uiLoop ].usFlags & WORLD_ITEM_REACHABLE) && !(gWorldItems[ uiLoop ].usFlags & WORLD_ITEM_ARMED_BOMB) )//item exists, is reachable, is visible and is not trapped
+ {
+ if ( ( Item[ gWorldItems[ uiLoop ].object.usItem ].usItemClass & IC_AMMO ) ) // the item is ammo
+ {
+ pAmmo = &( gWorldItems[ uiLoop ].object );
+
+ if ( Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubCalibre == Magazine[Item[pAmmo->usItem].ubClassIndex].ubCalibre ) // same calibre
+ {
+ // same ammo type
+ if ( Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubAmmoType == Magazine[Item[pAmmo->usItem].ubClassIndex].ubAmmoType )
+ {
+ bullets = Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubMagSize - (*pAmmoMags)[stackMag]->data.ubShotsLeft;
+
+ if ((*pAmmo)[0]->data.ubShotsLeft < bullets)
+ bullets = (*pAmmo)[0]->data.ubShotsLeft;
+
+ (*pAmmoMags)[stackMag]->data.ubShotsLeft += bullets;
+ (*pAmmo)[0]->data.ubShotsLeft -= bullets;
+
+ fCharacterInfoPanelDirty = TRUE;
+ fInterfacePanelDirty = DIRTYLEVEL2;
+ }
+
+ if ((*pAmmo)[0]->data.ubShotsLeft == 0)
+ {
+ RemoveItemFromPool( gWorldItems[ uiLoop ].sGridNo, uiLoop, gWorldItems[ uiLoop ].ubLevel );
+ }
+ }
+ }
+ }
+ }
+
+ //MM: if magazines still are partly empty, look through inventory for boxes and crates
+ if ( (*pAmmoMags)[stackMag]->data.ubShotsLeft < Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubMagSize )
+ {
+ for (UINT32 uiLoop = 0; uiLoop < pTeamSoldier->inv.size(); uiLoop++)
+ {
+ if ( (Item[pTeamSoldier->inv[uiLoop].usItem].usItemClass & IC_AMMO) && Magazine[Item[pTeamSoldier->inv[uiLoop].usItem].ubClassIndex].ubMagType >= AMMO_BOX )
+ {
+ pAmmo = &(pTeamSoldier->inv[uiLoop]);
+
+ if ( Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubCalibre == Magazine[Item[pAmmo->usItem].ubClassIndex].ubCalibre ) // same calibre
+ {
+ // same ammo type
+ if ( Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubAmmoType == Magazine[Item[pAmmo->usItem].ubClassIndex].ubAmmoType )
+ {
+ bullets = Magazine[Item[pAmmoMags->usItem].ubClassIndex].ubMagSize - (*pAmmoMags)[stackMag]->data.ubShotsLeft;
+
+ if ((*pAmmo)[0]->data.ubShotsLeft < bullets)
+ bullets = (*pAmmo)[0]->data.ubShotsLeft;
+
+ (*pAmmoMags)[stackMag]->data.ubShotsLeft += bullets;
+ (*pAmmo)[0]->data.ubShotsLeft -= bullets;
+
+ fCharacterInfoPanelDirty = TRUE;
+ fInterfacePanelDirty = DIRTYLEVEL2;
+ }
+
+ if ((*pAmmo)[0]->data.ubShotsLeft == 0)
+ DeleteObj(pAmmo);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
}
else
{
@@ -3858,6 +4074,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
case 'S':
StackAndSort( TRUE );
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
break;
case 's':
@@ -4144,7 +4361,7 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
//else if( gusSelectedSoldier != NOBODY )
break;
case 'z':
- if( fCtrl )
+ if( fCtrl && fAlt )
{
if ( INFORMATION_CHEAT_LEVEL( ) )
{
@@ -4451,6 +4668,10 @@ BOOLEAN HandleCheckForExitArrowsInput( BOOLEAN fAdjustConfirm )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, str );
gubLoneMercAttemptingToAbandonEPCs = FALSE;
}
+ else if( !gGameExternalOptions.fGridExitInTurnBased && ( gTacticalStatus.uiFlags & TURNBASED ) && ( gTacticalStatus.uiFlags & INCOMBAT ) )
+ {
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, TacticalStr[ CANNOT_LEAVE_IN_TURN_MODE_STR ] );
+ }
else
{
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, TacticalStr[ MERC_IS_TOO_FAR_AWAY_STR ], MercPtrs[ gusSelectedSoldier ]->name );
@@ -6398,7 +6619,6 @@ void StackAndSort( BOOLEAN fRestrictToAmmo )
}
NotifySoldiersToLookforItems( );
//HandleAllReachAbleItemsInTheSector( gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
- ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
}
}
diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp
index 2b8884c8..6d85613a 100644
--- a/Tactical/Weapons.cpp
+++ b/Tactical/Weapons.cpp
@@ -334,7 +334,8 @@ bool gbForceWeaponNotReady = false;
bool gbForceWeaponReady = false;
-
+// Flugente: define for maximum temperature
+#define OVERHEATING_MAX_TEMPERATURE 60000.0
enum
{
@@ -423,7 +424,10 @@ weaponStartElementHandle(void *userData, const XML_Char *name, const XML_Char **
strcmp(name, "bRecoilX") == 0 || // HEADROCK HAM 4:
strcmp(name, "bRecoilY") == 0 || // HEADROCK HAM 4:
strcmp(name, "ubRecoilDelay") == 0 || // HEADROCK HAM 4:
- strcmp(name, "Handling") == 0)) // CHRISL HAM 4:
+ strcmp(name, "Handling") == 0 || // CHRISL HAM 4
+ strcmp(name, "usOverheatingJamThreshold") == 0 || // Flugente FTW 1
+ strcmp(name, "usOverheatingDamageThreshold") == 0 || // Flugente FTW 1
+ strcmp(name, "usOverheatingSingleShotTemperature") == 0)) // Flugente FTW 1
{
pData->curElement = WEAPON_ELEMENT_WEAPON_PROPERY;
@@ -688,6 +692,21 @@ weaponEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = WEAPON_ELEMENT_WEAPON;
pData->curWeapon.ubHandling = (UINT8) atol(pData->szCharData);
}
+ else if(strcmp(name, "usOverheatingJamThreshold") == 0) // Flugente FTW 1
+ {
+ pData->curElement = WEAPON_ELEMENT_WEAPON;
+ pData->curWeapon.usOverheatingJamThreshold = (FLOAT) atof(pData->szCharData);
+ }
+ else if(strcmp(name, "usOverheatingDamageThreshold") == 0) // Flugente FTW 1
+ {
+ pData->curElement = WEAPON_ELEMENT_WEAPON;
+ pData->curWeapon.usOverheatingDamageThreshold = (FLOAT) atof(pData->szCharData);
+ }
+ else if(strcmp(name, "usOverheatingSingleShotTemperature") == 0) // Flugente FTW 1
+ {
+ pData->curElement = WEAPON_ELEMENT_WEAPON;
+ pData->curWeapon.usOverheatingSingleShotTemperature = (FLOAT) atof(pData->szCharData);
+ }
pData->maxReadDepth--;
}
@@ -861,8 +880,10 @@ BOOLEAN WriteWeaponStats()
FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubAimLevels );
FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].EasyUnjam);
FilePrintf(hFile,"\t\t%d\r\n", Weapon[cnt].ubHandling);
-
-
+ FilePrintf(hFile,"\t\t%4.2f\r\n", Weapon[cnt].usOverheatingJamThreshold); // Flugente FTW 1
+ FilePrintf(hFile,"\t\t%4.2f\r\n", Weapon[cnt].usOverheatingDamageThreshold);
+ FilePrintf(hFile,"\t\t%4.2f\r\n", Weapon[cnt].usOverheatingSingleShotTemperature);
+
FilePrintf(hFile,"\t\r\n");
}
@@ -1137,7 +1158,7 @@ BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier )
// should jams apply to enemies?
if (pSoldier->flags.uiStatusFlags & SOLDIER_PC)
{
- if ( Item[pSoldier->usAttackingWeapon].usItemClass == IC_GUN && !EXPLOSIVE_GUN( pSoldier->usAttackingWeapon ) )
+ if ( Item[pSoldier->usAttackingWeapon].usItemClass == IC_GUN && !EXPLOSIVE_GUN( pSoldier->usAttackingWeapon ) && !(pSoldier->bWeaponMode == WM_ATTACHED_GL || pSoldier->bWeaponMode == WM_ATTACHED_GL_BURST || pSoldier->bWeaponMode == WM_ATTACHED_GL_AUTO) )
{
pObj = &(pSoldier->inv[pSoldier->ubAttackingHand]);
if ((*pObj)[0]->data.gun.bGunAmmoStatus > 0)
@@ -1148,6 +1169,19 @@ BOOLEAN CheckForGunJam( SOLDIERTYPE * pSoldier )
int condition = (*pObj)[0]->data.gun.bGunStatus;
int invertedBaseJamChance = condition + (reliability * 2) -
gGameExternalOptions.ubWeaponReliabilityReductionPerRainIntensity * gbCurrentRainIntensity;
+
+ // Flugente FTW 1: If overheating is allowed, a gun will be prone to more overheating if its temperature is high
+ if ( gGameOptions.fWeaponOverheating )
+ {
+ FLOAT overheatjampercentage = GetGunOverheatJamPercentage( pObj ); // how much above the gun's usOverheatingJamThreshold are we? ...
+
+ int overheatjamfactor = (int)(100* overheatjampercentage); // We need an integer value and rough percentages
+
+ overheatjamfactor = max(0, overheatjamfactor - 100); // If we haven't reached the OverheatJamThreshold, no increased chance of jamming because of overheating
+
+ invertedBaseJamChance -= overheatjamfactor; // lower invertedBaseJamChance (thereby increasing jamChance later on)
+ }
+
if (invertedBaseJamChance < 0)
invertedBaseJamChance = 0;
else if (invertedBaseJamChance > 100)
@@ -2075,6 +2109,20 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
pSoldier->bDoBurst++;
}
+ INT16 iOverheatReliabilityMalus = 0;
+ // Flugente FTW 1: Increase Weapon Temperature
+ if ( gGameOptions.fWeaponOverheating )
+ {
+ FLOAT overheatjampercentage = GetGunOverheatDamagePercentage( &(pSoldier->inv[ pSoldier->ubAttackingHand ]) ); // ... how much above the gun's usOverheatingDamageThreshold are we? ...
+
+ if ( overheatjampercentage > 1.0 )
+ {
+ iOverheatReliabilityMalus = (INT16)floor(overheatjampercentage*overheatjampercentage);
+ }
+
+ GunIncreaseHeat( &(pSoldier->inv[ pSoldier->ubAttackingHand ]) );
+ }
+
// CJC: since jamming is no longer affected by reliability, increase chance of status going down for really unreliabile guns
//INT16 ammoReliability = 0; // Madd: ammo reliability affects gun
@@ -2084,7 +2132,8 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
// ammoReliability = Item[(*pGun)[0]->data.gun.usGunAmmoItem].bReliability;
//}
- uiDepreciateTest = max( BASIC_DEPRECIATE_CHANCE + 3 * GetReliability( &(pSoldier->inv[pSoldier->ubAttackingHand]) ), 0);
+ // Flugente FTW 1: Added a malus to reliability for overheated guns
+ uiDepreciateTest = max( BASIC_DEPRECIATE_CHANCE + 3 * GetReliability( &(pSoldier->inv[pSoldier->ubAttackingHand]) ) - iOverheatReliabilityMalus, 0);
if ( !PreRandom( uiDepreciateTest ) && ( pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.objectStatus > 1) )
{
@@ -2625,6 +2674,20 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
pSoldier->bDoBurst++;
}
+ INT16 iOverheatReliabilityMalus = 0;
+ // Flugente FTW 1: Increase Weapon Temperature
+ if ( gGameOptions.fWeaponOverheating )
+ {
+ FLOAT overheatjampercentage = GetGunOverheatDamagePercentage( &(pSoldier->inv[ pSoldier->ubAttackingHand ])); // ... how much above the gun's usOverheatingDamageThreshold are we? ...
+
+ if ( overheatjampercentage > 1.0 )
+ {
+ iOverheatReliabilityMalus = (INT16)floor(overheatjampercentage*overheatjampercentage);
+ }
+
+ GunIncreaseHeat( &(pSoldier->inv[ pSoldier->ubAttackingHand ]) );
+ }
+
/* //WarmSteel - Replaced with GetReliability( pObj )
// CJC: since jamming is no longer affected by reliability, increase chance of status going down for really unreliabile guns
INT16 ammoReliability = 0; // Madd: ammo reliability affects gun
@@ -2637,7 +2700,8 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo )
}
*/
- uiDepreciateTest = max( BASIC_DEPRECIATE_CHANCE + 3 * ( GetReliability( &(pSoldier->inv[ pSoldier->ubAttackingHand ]) ) ), 0);
+ // Flugente FTW 1: Added a malus to reliability for overheated guns
+ uiDepreciateTest = max( BASIC_DEPRECIATE_CHANCE + 3 * ( GetReliability( &(pSoldier->inv[ pSoldier->ubAttackingHand ]) ) ) - iOverheatReliabilityMalus, 0);
if ( !PreRandom( uiDepreciateTest ) && ( pSoldier->inv[ pSoldier->ubAttackingHand ][0]->data.objectStatus > 1) )
{
@@ -3654,9 +3718,28 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo )
// RemoveAttachment( pObj, bAttachPos);
//}
+ // Flugente fix: until now, pobj was always used to determine wether the explosive weapon will fail - but in the case of underbarrel weapons that wasn't the gun fired
+ // we now determine the real weapon being fired
+ OBJECTTYPE* pgunobj = pObj;
+ if ( pSoldier->bWeaponMode & (WM_ATTACHED_GL|WM_ATTACHED_GL_BURST|WM_ATTACHED_GL_AUTO) )
+ {
+ // firing an attached weapon
+ attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
+ for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
+ {
+ if ( iter->exists() && Item[ iter->usItem ].usItemClass & (IC_LAUNCHER|IC_LAUNCHER) )
+ {
+ pgunobj = &(*iter);
+ break;
+ }
+ }
+ }
+
// ATE: Check here if the launcher should fail 'cause of bad status.....
- if ( WillExplosiveWeaponFail( pSoldier, pObj ) )
+ if ( WillExplosiveWeaponFail( pSoldier, pgunobj ) )
{
+ if ( gGameOptions.fWeaponOverheating )
+ GunIncreaseHeat( pgunobj );
// Explode dude!
// So we still should have ABC > 0
@@ -3673,6 +3756,9 @@ BOOLEAN UseLauncher( SOLDIERTYPE *pSoldier, INT32 sTargetGridNo )
return( FALSE );
}
+ if ( gGameOptions.fWeaponOverheating )
+ GunIncreaseHeat( pgunobj );
+
if ( Weapon[ usItemNum ].sSound != NO_WEAPON_SOUND )
{
if (Item[ usItemNum ].usItemClass == IC_GUN )
@@ -4517,6 +4603,12 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
FLOAT iGunBaseDifficulty = iGunDifficulty;
FLOAT iGunAimDifficulty = iGunDifficulty;
+ UINT8 stance = gAnimControl[ pSoldier->usAnimState ].ubEndHeight;
+
+ // Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
+ if ( gGameExternalOptions.fWeaponResting && pSoldier->IsWeaponMounted() )
+ stance = ANIM_PRONE;
+
/////////////////////////////////////////////////////////////////////////////////////////////////////
//
// CALCULATE LINE OF SIGHT
@@ -4618,8 +4710,10 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
iChance = (INT32)iCombinedSkill;
// Add a flat Base bonus from the item and its attachments.
- iChance += GetFlatBaseModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
-
+ INT32 moda = GetFlatBaseModifier( pInHand, stance );
+ INT32 modb = GetFlatBaseModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
+ iChance += (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
+
// We now begin adding up factors that may increase or decrease Base CTH. They are pooled together to form a percentage
// value.
@@ -4856,8 +4950,10 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
}
// Percent based modifier from the gun and its attachments
- iGunBaseDifficulty += (iGunBaseDifficulty * GetPercentHandlingModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
-
+ FLOAT umoda = (iGunBaseDifficulty * GetPercentHandlingModifier( pInHand, stance )) / 100;
+ FLOAT umodb = (iGunBaseDifficulty * GetPercentHandlingModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
+ iGunBaseDifficulty += ((gGameExternalOptions.ubProneModifierPercentage * umoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * umodb)/100);
+
// End gun difficulty modifiers
/////////////////////////////////////////////
@@ -5013,8 +5109,10 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
}
// Percentage based-modifier from the weapon and its attachments
- iBaseModifier += GetPercentBaseModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
-
+ umoda = (iGunBaseDifficulty * GetPercentBaseModifier( pInHand, stance )) / 100;
+ umodb = (iGunBaseDifficulty * GetPercentBaseModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
+ iBaseModifier += ((gGameExternalOptions.ubProneModifierPercentage * umoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * umodb)/100);
+
////////////////////////////////////
// Finish BASE CTH calculation:
@@ -5158,7 +5256,9 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
iGunAimDifficulty += iTempPenalty;
}
- iGunAimDifficulty += (iGunAimDifficulty * GetPercentHandlingModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
+ FLOAT umoda = (iGunAimDifficulty * GetPercentHandlingModifier( pInHand, stance )) / 100;
+ FLOAT umodb = (iGunAimDifficulty * GetPercentHandlingModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
+ iGunAimDifficulty += (gGameExternalOptions.ubProneModifierPercentage * umoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * umodb)/100;
// End Gun Handling modifiers
//////////////////////////////////////////
@@ -5313,9 +5413,11 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
{
iAimModifier += gGameCTHConstants.AIM_DIFFICULTY[gGameOptions.ubDifficultyLevel];
}
-
+
// Percent modifier from the weapon and its attachments
- iAimModifier += GetPercentAimModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
+ INT32 moda = GetPercentAimModifier( pInHand, stance );
+ INT32 modb = GetPercentAimModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
+ iAimModifier += (gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100;
// Calculate final max aiming
@@ -5331,7 +5433,9 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
UINT32 uiCap = (UINT32)iCombinedSkill;
// Add percent-based modifier from the gun and its attachments
- uiCap += (INT32)(uiCap * GetPercentCapModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
+ UINT32 uimoda = (UINT32)(uiCap * GetPercentCapModifier( pInHand, stance )) / 100;
+ UINT32 uimodb = (UINT32)(uiCap * GetPercentCapModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
+ uiCap += (UINT32)((gGameExternalOptions.ubProneModifierPercentage * uimoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * uimodb)/100);
// Add bonuses from Sniper Skill. Applies only when using a scope at or above its "best" range.
INT16 sDifference = 99 - uiCap;
@@ -5412,7 +5516,9 @@ UINT32 CalcNewChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTi
{
iAimPoints += iAimPointFraction * (ubAllowedAimingLevels-x);
// Add Flat Modifier from the weapon and its attachments
- iAimPoints += GetFlatAimModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
+ INT32 moda = GetFlatAimModifier( pInHand, stance );
+ INT32 modb = GetFlatAimModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight );
+ iAimPoints += (gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100;
}
// Finally, add the appropriate number of CTH points to our chance-to-hit, and limit it into good values.
@@ -5838,6 +5944,12 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
MAX_TARGET_COWERING_PENALTY = gGameExternalOptions.usMaxTargetCoweringPenalty;
/////////////////////////////////////////////////////////////////////////////////////
+ UINT8 stance = gAnimControl[ pSoldier->usAnimState ].ubEndHeight;
+
+ // Flugente: new feature: if the next tile in our sight direction has a height so that we could rest our weapon on it, we do that, thereby gaining the prone boni instead. This includes bipods
+ if ( gGameExternalOptions.fWeaponResting && pSoldier->IsWeaponMounted() )
+ stance = ANIM_PRONE;
+
/////////////////////////////////////////////////////////////////////////////////////
// Assign range variables -- all range values are in units (10 units = 1 tile)
iRange = GetRangeInCellCoordsFromGridNoDiff( pSoldier->sGridNo, sGridNo ); // calculate actual range
@@ -6027,7 +6139,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
break;
case ANIM_STAND:
// if we are prone and at close range, then penalize shots to the torso or head!
- if ( iRange <= MIN_PRONE_RANGE && gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE )
+ if ( iRange <= MIN_PRONE_RANGE && stance == ANIM_PRONE )
{
if ( ubAimPos == AIM_SHOT_RANDOM || ubAimPos == AIM_SHOT_GLAND )
{
@@ -6285,8 +6397,35 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
{
iBonus = AIM_BONUS_CROUCHING;
}
+
+ // if our weapon is rested, factor in the prone position
+ if ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight != stance )
+ {
+ INT32 pronebonus = iRange / 10;
+ if (pronebonus > AIM_BONUS_PRONE)
+ {
+ pronebonus = AIM_BONUS_PRONE;
+ }
+
+ iBonus = (INT32)((gGameExternalOptions.ubProneModifierPercentage * pronebonus + (100 - gGameExternalOptions.ubProneModifierPercentage) * iBonus)/100);
+ }
+
iChance += iBonus;
}
+ else if ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_STAND )
+ {
+ // if our weapon is rested, factor in the prone position
+ if ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight != stance )
+ {
+ iBonus = iRange / 10;
+ if (iBonus > AIM_BONUS_PRONE)
+ {
+ iBonus = AIM_BONUS_PRONE;
+ }
+
+ iChance += (INT32)((gGameExternalOptions.ubProneModifierPercentage * iBonus )/100);
+ }
+ }
// if shooter is prone, he aims even better, except at really close range
else if ( gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE )
{
@@ -6300,6 +6439,7 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
iChance += iBonus;
}
}
+
//Madd: inherent weapon accuracy bonus
//iChance += Weapon[usInHand].bAccuracy;
/////////////////////////////////////////////////////////////////////////////////////
@@ -6363,14 +6503,20 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
Bipods also grant their flat CTH bonus so we don't need to mess this that here*/
if(gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier)
{
- iBonus = GetBurstToHitBonus(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
+ INT16 moda = GetBurstToHitBonus(pInHand, stance == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
+ INT16 modb = GetBurstToHitBonus(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
+ iBonus = (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
+
iPenalty = Weapon[pInHand->usItem].ubBurstPenalty * (pSoldier->bDoBurst - 1) * (gGameExternalOptions.bAimedBurstEnabled?gGameExternalOptions.uAimedBurstPenalty:1);
iPenalty = max(0, (iPenalty * (100 - iBonus))/100 );
}
else
{
// Snap: bipod may reduce burst penalty
- iPenalty = GetBurstPenalty(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
+ INT16 moda = GetBurstPenalty(pInHand, stance == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
+ INT16 modb = GetBurstPenalty(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
+ iPenalty = (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
+
if(gGameExternalOptions.bAimedBurstEnabled)
iPenalty += Weapon[usInHand].ubBurstPenalty * (pSoldier->bDoBurst - 1) * gGameExternalOptions.uAimedBurstPenalty;
}
@@ -6399,14 +6545,20 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
Bipods also grant their flat CTH bonus so we don't need to mess this that here*/
if(gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier)
{
- iBonus = GetAutoToHitBonus(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
+ INT16 moda = GetAutoToHitBonus(pInHand, stance == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
+ INT16 modb = GetAutoToHitBonus(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * gGameExternalOptions.ubFlatAFTHBtoPrecentMultiplier;
+ iBonus = (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
+
iPenalty = Weapon[pInHand->usItem].AutoPenalty * (pSoldier->bDoBurst - 1) * (gGameExternalOptions.bAimedBurstEnabled?gGameExternalOptions.uAimedBurstPenalty:1);
iPenalty = max(0, (iPenalty * (100 - iBonus))/100 );
}
else
{
// Snap: bipod may reduce auto penalty
- iPenalty = GetAutoPenalty(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
+ INT16 moda = GetAutoPenalty(pInHand, stance == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
+ INT16 modb = GetAutoPenalty(pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE) * (pSoldier->bDoBurst - 1);
+ iPenalty = (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
+
if(gGameExternalOptions.bAimedBurstEnabled)
iPenalty += Weapon[usInHand].AutoPenalty * (pSoldier->bDoBurst - 1) * gGameExternalOptions.uAimedBurstPenalty;
}
@@ -6606,7 +6758,10 @@ UINT32 CalcChanceToHitGun(SOLDIERTYPE *pSoldier, INT32 sGridNo, INT16 ubAimTime,
/////////////////////////////////////////////////////////////////////////////////////
// Equipment Modifiers
iChance += GetGearToHitBonus ( pSoldier );
- iChance += GetToHitBonus( pInHand, iRange, bLightLevel,gAnimControl[ pSoldier->usAnimState ].ubEndHeight == ANIM_PRONE && iRange > MIN_PRONE_RANGE );
+
+ INT16 moda = GetToHitBonus( pInHand, iRange, bLightLevel, stance && iRange > MIN_PRONE_RANGE );
+ INT16 modb = GetToHitBonus( pInHand, iRange, bLightLevel, gAnimControl[ pSoldier->usAnimState ].ubEndHeight && iRange > MIN_PRONE_RANGE );
+ iChance += (INT32)((gGameExternalOptions.ubProneModifierPercentage * moda + (100 - gGameExternalOptions.ubProneModifierPercentage) * modb)/100);
/////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////
@@ -10444,7 +10599,19 @@ BOOLEAN WillExplosiveWeaponFail( SOLDIERTYPE *pSoldier, OBJECTTYPE *pObj )
{
if ( pSoldier->bTeam == gbPlayerNum || pSoldier->bVisible == 1 )
{
- if ( (INT8)(PreRandom( 40 ) + PreRandom( 40 ) ) > (*pObj)[0]->data.objectStatus )
+ // malus for overheating
+ INT16 iOverheatMalus = 0;
+ if ( gGameOptions.fWeaponOverheating )
+ {
+ FLOAT overheatjampercentage = GetGunOverheatDamagePercentage( pObj);
+
+ if ( overheatjampercentage > 1.0 )
+ iOverheatMalus = (INT16)floor(5*overheatjampercentage*overheatjampercentage);
+
+ iOverheatMalus = max(0, iOverheatMalus - 1);
+ }
+
+ if ( (INT8)(PreRandom( 40 ) + PreRandom( 40 ) + iOverheatMalus) > (*pObj)[0]->data.objectStatus )
{
// Do second dice roll
if ( PreRandom( 2 ) == 1 )
@@ -10840,3 +11007,130 @@ void CalcMagFactorSimple( SOLDIERTYPE *pSoldier, FLOAT d2DDistance, INT16 bAimTi
gCTHDisplay.FinalMagFactor = iHighestMagFactor;
}
+
+// Flugente FTW 1: Increase temperature of gun in ubAttackingHand
+void GunIncreaseHeat( OBJECTTYPE *pObj )
+{
+ if ( Item[pObj->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) ) // if item is a gun pr launcher...
+ {
+ FLOAT guntemperature = (*pObj)[0]->data.bTemperature; // ... get current temperature ...
+
+ FLOAT singleshottemperature = GetSingleShotTemperature( pObj ); // ... get temperature rise ...
+
+ FLOAT newguntemperature = min(guntemperature + singleshottemperature, (FLOAT)(OVERHEATING_MAX_TEMPERATURE) ); // ... calculate new temperature ...
+
+ (*pObj)[0]->data.bTemperature = newguntemperature; // ... apply new temperature
+
+#ifdef JA2TESTVERSION
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Gun temperature increased from %4.2f to %4.2f", guntemperature, newguntemperature );
+#endif
+ }
+}
+
+// Flugente: Overheating Weapons
+FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj )
+{
+ FLOAT singleshottemperature = 0.0;
+
+ if ( Item[pObj->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
+ {
+ singleshottemperature = Weapon[ pObj->usItem ].usOverheatingSingleShotTemperature;
+
+ // determine modificator according to attachments
+ FLOAT modificator = 1.0;
+
+ attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
+ for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
+ {
+ if (iter->exists())
+ {
+ modificator += Item[iter->usItem].overheatTemperatureModificator;
+ }
+ }
+
+ // determine modificator according to ammo
+ modificator += AmmoTypes[(*pObj)[0]->data.gun.ubGunAmmoType].temperatureModificator;
+
+ singleshottemperature *= modificator;
+ }
+
+ return singleshottemperature;
+}
+
+// Flugente FTW 1: Get percentage: temperature/damagethreshold
+FLOAT GetGunOverheatDamagePercentage( OBJECTTYPE * pObj )
+{
+ FLOAT damagethreshold = GetOverheatDamageThreshold(pObj);
+
+ FLOAT temperature = (*pObj)[0]->data.bTemperature;
+
+ // to avert nonsense...
+ damagethreshold = max( (FLOAT)(1.0), damagethreshold);
+
+ return temperature/ damagethreshold ;
+}
+
+// Flugente FTW 1: Get percentage: temperature/jamthreshold
+FLOAT GetGunOverheatJamPercentage( OBJECTTYPE * pObj )
+{
+ FLOAT jamthreshold = GetOverheatJamThreshold(pObj);
+
+ FLOAT temperature = (*pObj)[0]->data.bTemperature;
+
+ // to avert nonsense...
+ jamthreshold = max( (FLOAT)(1.0), jamthreshold);
+
+ return temperature/ jamthreshold ;
+}
+
+FLOAT GetOverheatJamThreshold( OBJECTTYPE *pObj )
+{
+ FLOAT jamthreshold = (FLOAT) (OVERHEATING_MAX_TEMPERATURE / 4.0);
+
+ if ( Item[pObj->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
+ {
+ jamthreshold = Weapon[ pObj->usItem ].usOverheatingJamThreshold;
+
+ // determine modificator according to attachments
+ FLOAT modificator = 1.0;
+
+ attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
+ for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
+ {
+ if (iter->exists())
+ {
+ modificator += Item[iter->usItem].overheatJamThresholdModificator;
+ }
+ }
+
+ jamthreshold *= modificator;
+ }
+
+ return jamthreshold;
+}
+
+FLOAT GetOverheatDamageThreshold( OBJECTTYPE *pObj )
+{
+ FLOAT damagethreshold = (FLOAT) (OVERHEATING_MAX_TEMPERATURE / 4.0);
+
+ if ( Item[pObj->usItem].usItemClass & (IC_GUN|IC_LAUNCHER) )
+ {
+ damagethreshold = Weapon[ pObj->usItem ].usOverheatingDamageThreshold;
+
+ // determine modificator according to attachments
+ FLOAT modificator = 1.0;
+
+ attachmentList::iterator iterend = (*pObj)[0]->attachments.end();
+ for (attachmentList::iterator iter = (*pObj)[0]->attachments.begin(); iter != iterend; ++iter)
+ {
+ if (iter->exists())
+ {
+ modificator += Item[iter->usItem].overheatDamageThresholdModificator;
+ }
+ }
+
+ damagethreshold *= modificator;
+ }
+
+ return damagethreshold;
+}
diff --git a/Tactical/Weapons.h b/Tactical/Weapons.h
index 8c6332b4..1abb1a0e 100644
--- a/Tactical/Weapons.h
+++ b/Tactical/Weapons.h
@@ -125,6 +125,14 @@ enum
AMMO9H
};
+enum
+{
+ AMMO_MAGAZINE = 0,
+ AMMO_BULLET,
+ AMMO_BOX,
+ AMMO_CRATE
+};
+
enum
{
AMMO_REGULAR = 0,
@@ -184,6 +192,7 @@ typedef struct
BOOLEAN acidic;
INT16 lockBustingPower;
BOOLEAN tracerEffect;
+ FLOAT temperatureModificator; // Flugente FTW 1.1: modificator for weapon temperature
//zilpin: pellet spread patterns externalized in XML
INT32 spreadPattern;
@@ -308,12 +317,18 @@ typedef struct
// chooses automatically based on the type of gun (see AllowedAimingLevels() ).
UINT8 ubHandling; // CHRISL HAM 4: This value replaces ubReadyTime for determining a weapons base handling characteristics.
+ // Flugente FTW 1
+ FLOAT usOverheatingJamThreshold; // if a gun's temperature is above this treshold, it is increasingly prone to jamming
+ FLOAT usOverheatingDamageThreshold; // if a gun is fired while its temperature is above this value, it degrades much faster
+ FLOAT usOverheatingSingleShotTemperature; // a single shot raises a gun's temperature by this amount
+
} WEAPONTYPE;
typedef struct
{
UINT8 ubCalibre;
UINT16 ubMagSize;
UINT8 ubAmmoType;
+ UINT8 ubMagType;
UINT32 uiIndex;
} MAGTYPE;
@@ -426,4 +441,12 @@ void CalcMagFactorSimple( SOLDIERTYPE *pSoldier, FLOAT d2DDistance, INT16 bAimTi
// HEADROCK HAM 4: This gets the Z of a target regardless of what's there.
FLOAT GetTargetZPos( SOLDIERTYPE *pShooter, INT32 sTargetGridNo );
+// Flugente: Overheating Weapons
+void GunIncreaseHeat( OBJECTTYPE *pObj );
+FLOAT GetSingleShotTemperature( OBJECTTYPE *pObj );
+FLOAT GetGunOverheatDamagePercentage( OBJECTTYPE * pObj ); // Flugente FTW 1: Get percentage: temperature/damagethreshold
+FLOAT GetGunOverheatJamPercentage( OBJECTTYPE * pObj ); // Flugente FTW 1: Get percentage: temperature/jamthreshold
+FLOAT GetOverheatJamThreshold( OBJECTTYPE *pObj );
+FLOAT GetOverheatDamageThreshold( OBJECTTYPE *pObj );
+
#endif
diff --git a/Tactical/World Items.cpp b/Tactical/World Items.cpp
index bb12cce6..5934145e 100644
--- a/Tactical/World Items.cpp
+++ b/Tactical/World Items.cpp
@@ -809,3 +809,64 @@ void RefreshWorldItemsIntoItemPools( WORLDITEM * pItemList, INT32 iNumberOfItems
}
}
+
+
+// Flugente FTW 1: Cool down all items in the world (no, really)
+void CoolDownWorldItems( void )
+{
+ if ( gGameOptions.fWeaponOverheating ) // if Overheating is used ...
+ {
+ for( UINT32 uiCount = 0; uiCount < guiNumWorldItems; ++uiCount ) // ... for all items in the world ...
+ {
+ if( gWorldItems[ uiCount ].fExists ) // ... if item exists ...
+ {
+ // ... if Item exists and is a gun, a launcher or a barrel ...
+ if (Item[gWorldItems[ uiCount ].object.usItem].usItemClass & (IC_GUN|IC_LAUNCHER) || Item[gWorldItems[ uiCount ].object.usItem].barrel == TRUE )
+ {
+ OBJECTTYPE* pObj = &(gWorldItems[ uiCount ].object); // ... get pointer for this item ...
+
+ if ( pObj != NULL ) // ... if pointer is not obviously useless ...
+ {
+ for(INT16 i = 0; i < pObj->ubNumberOfObjects; ++i) // ... there might be multiple items here (item stack), so for each one ...
+ {
+ FLOAT guntemperature = (*pObj)[i]->data.bTemperature; // ... get temperature ...
+
+ FLOAT cooldownfactor = GetItemCooldownFactor(pObj); // ... get item cooldown factor provided of attachments ...
+
+ if ( Item[gWorldItems[ uiCount ].object.usItem].barrel == TRUE ) // ... a barrel lying around cools down a bit faster ...
+ cooldownfactor *= gGameExternalOptions.iCooldownModificatorLonelyBarrel;
+
+ FLOAT newguntemperatre = max(0.0, guntemperature - cooldownfactor); // ... calculate new temperature ...
+ (*pObj)[i]->data.bTemperature = newguntemperatre; // ... set new temperature
+
+#if 0//def JA2TESTVERSION
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"World: Item temperature lowered from %4.2f to %4.2f", guntemperature, newguntemperatre );
+#endif
+ // for every objects, we also have to check wether there are weapon attachments (eg. underbarrel grenade launchers), and cool them down too
+ attachmentList::iterator iterend = (*pObj)[i]->attachments.end();
+ for (attachmentList::iterator iter = (*pObj)[i]->attachments.begin(); iter != iterend; ++iter)
+ {
+ if ( iter->exists() && Item[ iter->usItem ].usItemClass & (IC_LAUNCHER|IC_LAUNCHER) )
+ {
+ FLOAT temperature = (*iter)[i]->data.bTemperature; // ... get temperature of item ...
+
+ FLOAT cooldownfactor = GetItemCooldownFactor( &(*iter) ); // ... get cooldown factor ...
+
+ FLOAT newtemperature = max(0.0, temperature - cooldownfactor); // ... calculate new temperature ...
+ (*iter)[i]->data.bTemperature = newtemperature; // ... set new temperature
+
+#if 0//def JA2TESTVERSION
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"World: Item temperature lowered from %4.2f to %4.2f", temperature, newtemperature );
+#endif
+
+ // we assume that there can exist only 1 UGL per weapon
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/Tactical/World Items.h b/Tactical/World Items.h
index 1be0dc4c..2274cdef 100644
--- a/Tactical/World Items.h
+++ b/Tactical/World Items.h
@@ -119,5 +119,6 @@ extern void FindPanicBombsAndTriggers( void );
extern INT32 FindWorldItemForBombInGridNo( INT32 sGridNo, INT8 bLevel);
void RefreshWorldItemsIntoItemPools( WORLDITEM * pItemList, INT32 iNumberOfItems );
+void CoolDownWorldItems( void ); // Flugente FTW 1: Cool down all items in the world (no, really)
#endif
\ No newline at end of file
diff --git a/Tactical/XML.h b/Tactical/XML.h
index c7b9a4bb..bc8a250d 100644
--- a/Tactical/XML.h
+++ b/Tactical/XML.h
@@ -236,6 +236,8 @@ typedef PARSE_STAGE;
#define ENCYCLOPEDIAQUESTSFILENAME "Encyclopedia\\EncyclopediaQuests.xml"
#define BRIEFINGROOMFILENAME "BriefingRoom\\BriefingRoom.xml"
+#define OLDAIMARCHIVEFILENAME "OldAIMArchive.xml"
+
extern BOOLEAN ReadInItemStats(STR fileName, BOOLEAN localizedVersion);
extern BOOLEAN WriteItemStats();
@@ -457,4 +459,5 @@ extern void InitNewVehicles ();
extern BOOLEAN ReadInLanguageLocation(STR fileName, BOOLEAN localizedVersion, LANGUAGE_LOCATION *Lang, UINT32 FileType2 );
+extern BOOLEAN ReadInAimOldArchive(STR fileName, BOOLEAN localizedVersion);
#endif
diff --git a/Tactical/XML_AmmoTypes.cpp b/Tactical/XML_AmmoTypes.cpp
index f295e481..33570c38 100644
--- a/Tactical/XML_AmmoTypes.cpp
+++ b/Tactical/XML_AmmoTypes.cpp
@@ -78,7 +78,8 @@ ammotypeStartElementHandle(void *userData, const XML_Char *name, const XML_Char
strcmp(name, "lockBustingPower") == 0 ||
strcmp(name, "acidic") == 0 ||
strcmp(name, "tracerEffect") == 0 ||
- strcmp(name, "monsterSpit") == 0 ))
+ strcmp(name, "monsterSpit") == 0 ||
+ strcmp(name, "temperatureModificator") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
@@ -276,6 +277,11 @@ ammotypeEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curAmmoType.tracerEffect = (BOOLEAN) atol(pData->szCharData);
}
+ else if(strcmp(name, "temperatureModificator") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curAmmoType.temperatureModificator = (FLOAT) atof(pData->szCharData);
+ }
pData->maxReadDepth--;
}
@@ -397,6 +403,7 @@ BOOLEAN WriteAmmoTypeStats()
FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].ignoreArmour );
FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].lockBustingPower );
FilePrintf(hFile,"\t\t%d\r\n", AmmoTypes[cnt].tracerEffect );
+ FilePrintf(hFile,"\t\t%4.2f\r\n", AmmoTypes[cnt].temperatureModificator );
FilePrintf(hFile,"\t\r\n");
diff --git a/Tactical/XML_LBEPocket.cpp b/Tactical/XML_LBEPocket.cpp
index 59de0717..9ccdc539 100644
--- a/Tactical/XML_LBEPocket.cpp
+++ b/Tactical/XML_LBEPocket.cpp
@@ -28,20 +28,48 @@ typedef lbepocketParseData;
BOOLEAN onlyLocalizedText;
BOOLEAN lbepocketStartElementHandleLoop(const XML_Char *name, lbepocketParseData * pData) //Tais
{
- UINT8 i=0;
- CHAR8 str1 [40] = "";
- CHAR8 str2 [40] = "";
- for (i=0; i<=gGameExternalOptions.guiMaxItemSize;i++)
- {
- sprintf(str1,"ItemCapacityPerSize.%d",i);
- sprintf(str2,"ItemCapacityPerSize%d",i);
- if(strcmp(name, str1)==0||strcmp(name, str2)==0)
- {
+ //DBrot: same routine as the actual reading part below, but no data is read here, only the validity check
+ CHAR8 refstr[20] = "ItemCapacityPerSize";
+ UINT8 pos = 19;
+ if(strncmp(refstr, name, 19) == 0){
+ if(name[pos]=='.'){
+ pos++;
+ }
+ CHAR8 index[5] = "\0\0\0\0";
+ UINT8 i = 0;
+ while(name[pos]!='\0' && i < 5){
+ index[i]=name[pos];
+ pos++;
+ i++;
+ }
+ UINT16 size = (UINT16) atol(index);
+ if(size<=gGameExternalOptions.guiMaxItemSize){
return true;
}
}
return false;
}
+/* DBrot: Replaced with a more efficient way
+ UINT16 i=0;
+ CHAR8 str1 [40] = "";
+ for (i=0; i<=gGameExternalOptions.guiMaxItemSize;i++)
+ {
+ sprintf(str1,"ItemCapacityPerSize%d",i);
+ if(strcmp(name, str1)==0)
+ {
+ return true;
+ }
+ }
+ for (i=0; i<=gGameExternalOptions.guiMaxItemSize;i++)
+ {
+ sprintf(str1,"ItemCapacityPerSize.%d",i);
+ if(strcmp(name, str1)==0)
+ {
+ return true;
+ }
+ }
+ return false;
+}*/
static void XMLCALL
lbepocketStartElementHandle(void *userData, const XML_Char *name, const XML_Char **atts)
{
@@ -138,9 +166,8 @@ lbepocketCharacterDataHandle(void *userData, const XML_Char *str, int len)
static void XMLCALL
lbepocketEndElementHandle(void *userData, const XML_Char *name)
{
-UINT8 i=0;
-CHAR8 str1 [40] = "";
-CHAR8 str2 [40] = "";
+//UINT16 i=0;
+//CHAR8 str1 [40] = "";
lbepocketParseData * pData = (lbepocketParseData *)userData;
if(pData->currentDepth <= pData->maxReadDepth) //we're at the end of an element that we've been reading
@@ -194,19 +221,52 @@ lbepocketParseData * pData = (lbepocketParseData *)userData;
pData->curLBEPocket.pRestriction = (UINT32) atol(pData->szCharData);
} //Tais fixed this.
else
- {
+ { //DBrot: Enhanced parsing routine to avoid excessive load times for larger (~1000) numbers of item sizes
+ //-test the prefix if we have an "ItemCapacityPerSize###" tag
+ //-get the only significant portion of that tag, the item size in question
+ //-convert it to a useable index, check against max_item_size and get the data
+ CHAR8 refstr[20] = "ItemCapacityPerSize";
+ UINT8 pos = 19;
+ if(strncmp(refstr, name, 19) == 0){
+ if(name[pos]=='.'){
+ pos++;
+ }
+ CHAR8 index[5] = "\0\0\0\0";
+ UINT8 i = 0;
+ while(name[pos]!='\0' && i < 5){
+ index[i]=name[pos];
+ pos++;
+ i++;
+ }
+ UINT16 size = (UINT16) atol(index);
+ if(size<=gGameExternalOptions.guiMaxItemSize){
+ pData->curElement = ELEMENT;
+ pData->curLBEPocket.ItemCapacityPerSize[size] = (UINT8) atol(pData->szCharData);
+ }
+ }
+ }
+ /* DBrot: Replaced with a more efficient way
for (i=0; i<=gGameExternalOptions.guiMaxItemSize;i++)
{
- sprintf(str1,"ItemCapacityPerSize.%d",i);
- sprintf(str2,"ItemCapacityPerSize%d",i);
- if(strcmp(name, str1)==0||strcmp(name, str2)==0)
+ sprintf(str1,"ItemCapacityPerSize%d",i);
+ if(strcmp(name, str1)==0)
{
pData->curElement = ELEMENT;
pData->curLBEPocket.ItemCapacityPerSize[i] = (UINT8) atol(pData->szCharData);
break;
}
}
- }
+ for (i=0; i<=gGameExternalOptions.guiMaxItemSize;i++)
+ {
+ sprintf(str1,"ItemCapacityPerSize.%d",i);
+ if(strcmp(name, str1)==0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curLBEPocket.ItemCapacityPerSize[i] = (UINT8) atol(pData->szCharData);
+ break;
+ }
+ }
+ }*/
/* JMich - these are no longer needed
else if(strcmp(name, "ItemCapacityPerSize.0") == 0 || strcmp(name, "ItemCapacityPerSize0") == 0)
{
@@ -460,7 +520,7 @@ BOOLEAN ReadInLBEPocketStats(STR fileName, BOOLEAN localizedVersion)
}
BOOLEAN WriteLBEPocketEquipmentStats()
{
- UINT8 i;
+ UINT16 i;
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"writelbepocketsstats");
HWFILE hFile;
diff --git a/Tactical/XML_Magazine.cpp b/Tactical/XML_Magazine.cpp
index 972e0d09..38479b08 100644
--- a/Tactical/XML_Magazine.cpp
+++ b/Tactical/XML_Magazine.cpp
@@ -50,7 +50,8 @@ magazineStartElementHandle(void *userData, const XML_Char *name, const XML_Char
(strcmp(name, "uiIndex") == 0 ||
strcmp(name, "ubCalibre") == 0 ||
strcmp(name, "ubMagSize") == 0 ||
- strcmp(name, "ubAmmoType") == 0 ))
+ strcmp(name, "ubAmmoType") == 0 ||
+ strcmp(name, "ubMagType") == 0 ))
{
pData->curElement = ELEMENT_PROPERTY;
@@ -117,6 +118,11 @@ magazineEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curMagazine.ubAmmoType = (UINT8) atol(pData->szCharData);
}
+ else if(strcmp(name, "ubMagType") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curMagazine.ubMagType = (UINT8) atol(pData->szCharData);
+ }
pData->maxReadDepth--;
}
@@ -213,6 +219,7 @@ BOOLEAN WriteMagazineStats()
FilePrintf(hFile,"\t\t%d\r\n", Magazine[cnt].ubCalibre );
FilePrintf(hFile,"\t\t%d\r\n", Magazine[cnt].ubMagSize );
FilePrintf(hFile,"\t\t%d\r\n", Magazine[cnt].ubAmmoType );
+ FilePrintf(hFile,"\t\t%d\r\n", Magazine[cnt].ubMagType );
FilePrintf(hFile,"\t\r\n");
}
diff --git a/Tactical/XML_MercStartingGear.cpp b/Tactical/XML_MercStartingGear.cpp
index c412de1f..b8af320e 100644
--- a/Tactical/XML_MercStartingGear.cpp
+++ b/Tactical/XML_MercStartingGear.cpp
@@ -72,6 +72,7 @@ MercStartingGearStartElementHandle(void *userData, const XML_Char *name, const X
}
else if(pData->curElement == ELEMENT_SUBLIST &&
(strcmp(name, "mAbsolutePrice") == 0 ||
+ strcmp(name, "mGearKitName") == 0 ||
strcmp(name, "mPriceMod") == 0 ||
strcmp(name, "mHelmet") == 0 ||
strcmp(name, "mHelmetStatus") == 0 ||
@@ -209,6 +210,7 @@ MercStartingGearEndElementHandle(void *userData, const XML_Char *name)
//CHRISL: after writing the gearkit, we need to clear gear data so it won't inadvertantly be reused
pData->curMercStartingGear.PriceModifier = 0;
pData->curMercStartingGear.AbsolutePrice = -1;
+ pData->curMercStartingGear.mGearKitName[0] = '\0';
for(unsigned int i = 0; i < pData->curMercStartingGear.inv.size(); i++)
{
pData->curMercStartingGear.inv[i] = 0;
@@ -237,6 +239,12 @@ MercStartingGearEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT_SUBLIST;
pData->curMercStartingGear.AbsolutePrice = (int) atol(pData->szCharData);
}
+ else if(strcmp(name, "mGearKitName") == 0)
+ {
+ pData->curElement = ELEMENT_SUBLIST;
+ MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->curMercStartingGear.mGearKitName, sizeof(pData->curMercStartingGear.mGearKitName)/sizeof(pData->curMercStartingGear.mGearKitName[0]) );
+ pData->curMercStartingGear.mGearKitName[sizeof(pData->curMercStartingGear.mGearKitName)/sizeof(pData->curMercStartingGear.mGearKitName[0]) - 1] = '\0';
+ }
else if(strcmp(name, "mHelmet") == 0)
{
pData->curElement = ELEMENT_SUBLIST;
diff --git a/Tactical/opplist.cpp b/Tactical/opplist.cpp
index ef6e437f..64d80258 100644
--- a/Tactical/opplist.cpp
+++ b/Tactical/opplist.cpp
@@ -56,6 +56,8 @@
#include "Ja25_Tactical.h"
#endif
+#include "connect.h"
+
//rain
//#define VIS_DIST_DECREASE_PER_RAIN_INTENSITY 20
//end rain
@@ -868,7 +870,7 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
if ((gTacticalStatus.uiFlags & TURNBASED) &&
(gTacticalStatus.uiFlags & INCOMBAT) &&
(ubSightFlags & SIGHT_INTERRUPT) &&
- (!gGameExternalOptions.fImprovedInterruptSystem || gGameExternalOptions.fAllowInstantInterruptsOnSight ) )
+ (!gGameOptions.fImprovedInterruptSystem || gGameExternalOptions.fAllowInstantInterruptsOnSight ) )
{
ResolveInterruptsVs( pSoldier, SIGHTINTERRUPT );
}
@@ -896,9 +898,13 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
RadioSightings(pSoldier,EVERYBODY, MILITIA_TEAM);
#endif*/
//ddd{
-if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
-RadioSightings(pSoldier,EVERYBODY, MILITIA_TEAM);
-
+if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
+ RadioSightings(pSoldier,EVERYBODY, MILITIA_TEAM);
+
+//haydent
+if(is_networked && pSoldier->bSide == 0 && pSoldier->bTeam != OUR_TEAM)
+ RadioSightings(pSoldier,EVERYBODY, OUR_TEAM);
+
//ddd}
// if it's our local player's merc
if (PTR_OURTEAM)
@@ -1403,15 +1409,23 @@ void EndMuzzleFlash( SOLDIERTYPE * pSoldier )
*/
//ddd{
-if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
-{ if ( pSoldier->bTeam != gbPlayerNum && pSoldier->bTeam != MILITIA_TEAM )
- pSoldier->bVisible = 0; // indeterminate state
+//haydent
+if(is_networked && pSoldier->bSide == 0)
+{
+ //stay visible
}
else
{
- if ( pSoldier->bTeam != gbPlayerNum )
- pSoldier->bVisible = 0; // indeterminate state
-}
+ if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
+ { if ( pSoldier->bTeam != gbPlayerNum && pSoldier->bTeam != MILITIA_TEAM )
+ pSoldier->bVisible = 0; // indeterminate state
+ }
+ else
+ {
+ if ( pSoldier->bTeam != gbPlayerNum )
+ pSoldier->bVisible = 0; // indeterminate state
+ }
+}//haydent
//ddd}
for (uiLoop = 0; uiLoop < guiNumMercSlots; uiLoop++)
@@ -1454,6 +1468,9 @@ else
pSoldier->bVisible = TRUE; // yes, still seen
}
//ddd}
+
+ //haydent
+ if(is_networked && pOtherSoldier->bSide == 0 && pOtherSoldier->bTeam != OUR_TEAM)pSoldier->bVisible = TRUE; // yes, still seen
}
}
}
@@ -1814,16 +1831,24 @@ void HandleManNoLongerSeen( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOpponent, INT
}
*/
//ddd{
-if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
-{ if ( (pSoldier->bTeam == gbPlayerNum || pSoldier->bTeam == MILITIA_TEAM) && !(pOpponent->bTeam == gbPlayerNum || pOpponent->bTeam == MILITIA_TEAM ) )
- pOpponent->bVisible = 0;
+//haydent
+if(is_networked && pSoldier->bSide == 0)
+{
+ //stay visible
}
else
-{ if ( pSoldier->bTeam == gbPlayerNum && pOpponent->bTeam != gbPlayerNum )
- pOpponent->bVisible = 0;
-}
-//ddd}
-
+{
+ if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
+ { if ( (pSoldier->bTeam == gbPlayerNum || pSoldier->bTeam == MILITIA_TEAM) && !(pOpponent->bTeam == gbPlayerNum || pOpponent->bTeam == MILITIA_TEAM ) )
+ pOpponent->bVisible = 0;
+ }
+ else
+ {
+ if ( pSoldier->bTeam == gbPlayerNum && pOpponent->bTeam != gbPlayerNum )
+ pOpponent->bVisible = 0;
+ }
+ //ddd}
+}//haydent
}
}
#ifdef TESTOPPLIST
@@ -2591,6 +2616,10 @@ else
if (PTR_OURTEAM && (pOpponent->bVisible <= 0))
SEE_MENT = TRUE;
}
+
+//haydent
+if((is_networked && pSoldier->bSide == 0 && pSoldier->bTeam != OUR_TEAM) && (pOpponent->bVisible <= 0))SEE_MENT = TRUE;
+
//ddd}
/*comm by ddd
@@ -2770,16 +2799,28 @@ void OtherTeamsLookForMan(SOLDIERTYPE *pOpponent)
}
*/
//ddd{
-if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
-{
- if ((pOpponent->bTeam != gbPlayerNum && pOpponent->bTeam != MILITIA_TEAM) && (pOpponent->bVisible >= 0 && pOpponent->bVisible < 2) && pOpponent->stats.bLife)
- pOpponent->bVisible = 0;
+
+//haydent
+if(is_networked && pOpponent->bSide == 0)
+{
+ //stay visible
}
else
{
-if ((pOpponent->bTeam != gbPlayerNum) && (pOpponent->bVisible >= 0 && pOpponent->bVisible < 2) && pOpponent->stats.bLife)
-pOpponent->bVisible = 0;
-}
+
+ if(gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
+ {
+ if ((pOpponent->bTeam != gbPlayerNum && pOpponent->bTeam != MILITIA_TEAM) && (pOpponent->bVisible >= 0 && pOpponent->bVisible < 2) && pOpponent->stats.bLife)
+ pOpponent->bVisible = 0;
+ }
+ else
+ {
+ if ((pOpponent->bTeam != gbPlayerNum) && (pOpponent->bVisible >= 0 && pOpponent->bVisible < 2) && pOpponent->stats.bLife)
+ pOpponent->bVisible = 0;
+ }
+
+}//haydent
+
//ddd}
#ifdef TESTOPPLIST
DebugMsg( TOPIC_JA2OPPLIST, DBG_LEVEL_3,
@@ -3269,6 +3310,14 @@ void BetweenTurnsVisibilityAdjustments(void)
{
//ddd{
BOOLEAN SEE_MENT = FALSE;
+
+ if(is_networked && pSoldier->bSide == 0)//haydent
+ {
+ //stay visible
+ }
+ else
+ {
+
if (gGameExternalOptions.bWeSeeWhatMilitiaSeesAndViceVersa)
{if (!PTR_OURTEAM && pSoldier->bTeam != MILITIA_TEAM)
SEE_MENT = TRUE;
@@ -3276,6 +3325,8 @@ void BetweenTurnsVisibilityAdjustments(void)
else
{ if (!PTR_OURTEAM) SEE_MENT = TRUE;
}
+
+ }//haydent
//ddd}
/*comm by ddd
#ifdef WE_SEE_WHAT_MILITIA_SEES_AND_VICE_VERSA
@@ -3284,6 +3335,7 @@ void BetweenTurnsVisibilityAdjustments(void)
if (!PTR_OURTEAM)
#endif
*/
+
if(SEE_MENT)
{
// check if anyone on our team currently sees him (exclude NOBODY)
diff --git a/Tactical/soldier profile type.h b/Tactical/soldier profile type.h
index fc9c5666..b12b0a7b 100644
--- a/Tactical/soldier profile type.h
+++ b/Tactical/soldier profile type.h
@@ -337,6 +337,7 @@ public:
UINT16 mIndex;
INT16 PriceModifier;
INT16 AbsolutePrice;
+ CHAR16 mGearKitName[80];
CHAR8 mName[80];
char endOfPOD; // marker for end of POD (plain old data)
std::vector inv;
diff --git a/TacticalAI/TacticalAI_VS2010.vcxproj b/TacticalAI/TacticalAI_VS2010.vcxproj
index 157d03bd..0293e8a0 100644
--- a/TacticalAI/TacticalAI_VS2010.vcxproj
+++ b/TacticalAI/TacticalAI_VS2010.vcxproj
@@ -110,24 +110,24 @@
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
diff --git a/TileEngine/Radar Screen.cpp b/TileEngine/Radar Screen.cpp
index d2682d56..e799ee93 100644
--- a/TileEngine/Radar Screen.cpp
+++ b/TileEngine/Radar Screen.cpp
@@ -91,14 +91,15 @@ MOUSE_REGION gRadarRegionSquadList[ NUMBER_OF_SQUADS ];
void InitRadarScreenCoords( )
{
- RADAR_WINDOW_TM_X = (SCREEN_WIDTH - 97);
- RADAR_WINDOW_SM_X = (SCREEN_WIDTH - 97);
- RADAR_WINDOW_TM_Y = (INTERFACE_START_Y + 13);
- RADAR_WINDOW_SM_Y = ((UsingNewInventorySystem() == false)) ? (INV_INTERFACE_START_Y + 33) : (INV_INTERFACE_START_Y + 116);
- RADAR_WINDOW_WIDTH = 88;
- RADAR_WINDOW_HEIGHT = 44;
- RADAR_WINDOW_STRAT_X = (SCREEN_WIDTH - 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);
+ RADAR_WINDOW_WIDTH = 88;
+ RADAR_WINDOW_HEIGHT = 44;
}
// WANNE.RADAR: This method is called in the main menu, so the mouse region is initialized too early. We should initialize the mouse region later, when reaching
@@ -566,14 +567,8 @@ void RenderRadarScreen( )
// Don't place guys in radar until visible!
if ( pSoldier->bVisible == -1 && !(gTacticalStatus.uiFlags&SHOW_ALL_MERCS) && !(pSoldier->ubMiscSoldierFlags & SOLDIER_MISC_XRAYED) )
{
- //hayden
- if(is_networked && pSoldier->bSide==0)
- {
- }
- else
- {
continue;// ie dont render
- }
+
}
// Don't render guys if they are dead!
@@ -753,22 +748,20 @@ BOOLEAN CreateDestroyMouseRegionsForSquadList( void )
{
// create regions
// load graphics
- VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
- FilenameForBPP("INTERFACE\\squadpanel.sti", VObjectDesc.ImageFile);
- CHECKF(AddVideoObject(&VObjectDesc, &uiHandle));
+ VObjectDesc.fCreateFlags=VOBJECT_CREATE_FROMFILE;
+ FilenameForBPP("INTERFACE\\squadpanel.sti", VObjectDesc.ImageFile);
+ CHECKF(AddVideoObject(&VObjectDesc, &uiHandle));
- GetVideoObject(&hHandle, uiHandle);
+ GetVideoObject(&hHandle, uiHandle);
-
- BltVideoObject( guiSAVEBUFFER , hHandle, 0,(SCREEN_WIDTH - 102 - 1), gsVIEWPORT_END_Y, VO_BLT_SRCTRANSPARENCY,NULL );
- RestoreExternBackgroundRect ((SCREEN_WIDTH - 102 - 1), gsVIEWPORT_END_Y, 102,( INT16 ) ( SCREEN_HEIGHT - gsVIEWPORT_END_Y ) );
+ BltVideoObject( guiSAVEBUFFER , hHandle, 0,(xResOffset + xResSize - 102 - 1), gsVIEWPORT_END_Y, VO_BLT_SRCTRANSPARENCY,NULL );
+ RestoreExternBackgroundRect ((xResOffset + xResSize - 102 - 1), gsVIEWPORT_END_Y, 102,( INT16 ) ( SCREEN_HEIGHT - gsVIEWPORT_END_Y ) );
for( sCounter = 0; sCounter < NUMBER_OF_SQUADS; sCounter++ )
{
// run through list of squads and place appropriatly
if( sCounter < NUMBER_OF_SQUADS / 2 )
{
-
// left half of list
// CHRISL:
MSYS_DefineRegion( &gRadarRegionSquadList[ sCounter ], RADAR_WINDOW_TM_X , ( INT16 )( SQUAD_WINDOW_TM_Y + ( sCounter * ( ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / ( NUMBER_OF_SQUADS / 2 ) ) ) ), RADAR_WINDOW_TM_X + RADAR_WINDOW_WIDTH / 2 - 1, ( INT16 )( SQUAD_WINDOW_TM_Y + ( ( sCounter + 1 ) * ( ( SQUAD_REGION_HEIGHT - SUBTRACTOR_FOR_SQUAD_LIST ) / ( NUMBER_OF_SQUADS / 2 ) ) ) ) ,MSYS_PRIORITY_HIGHEST,
diff --git a/TileEngine/Render Dirty.cpp b/TileEngine/Render Dirty.cpp
index e3b29325..24831fee 100644
--- a/TileEngine/Render Dirty.cpp
+++ b/TileEngine/Render Dirty.cpp
@@ -45,14 +45,19 @@ void SaveVideoOverlayArea( UINT32 uiSrcBuffer, UINT32 uiCount );
//UINT32 guiNumTopmostSaves=0;
// do zmiany
-SGPRect gDirtyClipRect = { 0, 0, 1024, 768 };
-
+//SGPRect gDirtyClipRect = { 0, 0, 2560, 1600 };
+SGPRect gDirtyClipRect = { 0, 0, 0, 0 };
BOOLEAN gfViewportDirty=FALSE;
BOOLEAN InitializeBaseDirtyRectQueue( )
{
+ gDirtyClipRect.iLeft = 0;
+ gDirtyClipRect.iTop = 0;
+ gDirtyClipRect.iRight = SCREEN_WIDTH;
+ gDirtyClipRect.iBottom = SCREEN_HEIGHT;
+
return( TRUE );
}
diff --git a/TileEngine/Tactical Placement GUI.cpp b/TileEngine/Tactical Placement GUI.cpp
index 59e73eb0..5454b711 100644
--- a/TileEngine/Tactical Placement GUI.cpp
+++ b/TileEngine/Tactical Placement GUI.cpp
@@ -262,15 +262,15 @@ void InitTacticalPlacementGUI()
//Load the images
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- sprintf( VObjectDesc.ImageFile, "Interface\\OverheadInterface.sti" );
- if( !AddVideoObject( &VObjectDesc, (UINT32 *)&giOverheadPanelImage ) )
- {
- AssertMsg( 0, "Failed to load Interface\\OverheadInterface.sti" );
+ sprintf( VObjectDesc.ImageFile, "Interface\\OverheadInterface.sti" );
+ if( !AddVideoObject( &VObjectDesc, (UINT32 *)&giOverheadPanelImage ) )
+ {
+ AssertMsg( 0, "Failed to load Interface\\OverheadInterface.sti" );
+ }
}
- }
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
sprintf( VObjectDesc.ImageFile, "Interface\\OverheadInterface_800x600.sti" );
if( !AddVideoObject( &VObjectDesc, (UINT32 *)&giOverheadPanelImage ) )
@@ -278,7 +278,7 @@ void InitTacticalPlacementGUI()
AssertMsg( 0, "Failed to load Interface\\OverheadInterface_800x600.sti" );
}
}
- else if (iResolution == 2)
+ else
{
sprintf( VObjectDesc.ImageFile, "Interface\\OverheadInterface_1024x768.sti" );
if( !AddVideoObject( &VObjectDesc, (UINT32 *)&giOverheadPanelImage ) )
@@ -304,25 +304,25 @@ void InitTacticalPlacementGUI()
//Create the buttons which provide automatic placements.
iTPButtons[ CLEAR_BUTTON ] =
- QuickCreateButton( giOverheadButtonImages[ CLEAR_BUTTON ], 11, SCREEN_HEIGHT - 148, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
+ QuickCreateButton( giOverheadButtonImages[ CLEAR_BUTTON ], 11 + xResOffset, SCREEN_HEIGHT - 148, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, ClearPlacementsCallback );
SpecifyGeneralButtonTextAttributes( iTPButtons[ CLEAR_BUTTON ], gpStrategicString[ STR_TP_CLEAR ], BLOCKFONT, FONT_BEIGE, 141 );
SetButtonFastHelpText( iTPButtons[ CLEAR_BUTTON ], gpStrategicString[ STR_TP_CLEARHELP ] );
SetBtnHelpEndCallback( iTPButtons[ CLEAR_BUTTON ], FastHelpRemoved2Callback );
iTPButtons[ SPREAD_BUTTON ] =
- QuickCreateButton( giOverheadButtonImages[ SPREAD_BUTTON ], 11, SCREEN_HEIGHT - 113, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
+ QuickCreateButton( giOverheadButtonImages[ SPREAD_BUTTON ], 11 + xResOffset, SCREEN_HEIGHT - 113, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, SpreadPlacementsCallback );
SpecifyGeneralButtonTextAttributes( iTPButtons[ SPREAD_BUTTON ], gpStrategicString[ STR_TP_SPREAD ], BLOCKFONT, FONT_BEIGE, 141 );
SetButtonFastHelpText( iTPButtons[ SPREAD_BUTTON ], gpStrategicString[ STR_TP_SPREADHELP ] );
SetBtnHelpEndCallback( iTPButtons[ SPREAD_BUTTON ], FastHelpRemovedCallback );
iTPButtons[ GROUP_BUTTON ] =
- QuickCreateButton( giOverheadButtonImages[ GROUP_BUTTON ], 11, SCREEN_HEIGHT - 78, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
+ QuickCreateButton( giOverheadButtonImages[ GROUP_BUTTON ], 11 + xResOffset, SCREEN_HEIGHT - 78, BUTTON_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, GroupPlacementsCallback );
SpecifyGeneralButtonTextAttributes( iTPButtons[ GROUP_BUTTON ], gpStrategicString[ STR_TP_GROUP ], BLOCKFONT, FONT_BEIGE, 141 );
SetButtonFastHelpText( iTPButtons[ GROUP_BUTTON ], gpStrategicString[ STR_TP_GROUPHELP ] );
SetBtnHelpEndCallback( iTPButtons[ GROUP_BUTTON ], FastHelpRemovedCallback );
iTPButtons[ DONE_BUTTON ] =
- QuickCreateButton( giOverheadButtonImages[ DONE_BUTTON ], 11, SCREEN_HEIGHT - 43, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
+ QuickCreateButton( giOverheadButtonImages[ DONE_BUTTON ], 11 + xResOffset, SCREEN_HEIGHT - 43, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
DEFAULT_MOVE_CALLBACK, DoneOverheadPlacementClickCallback );
SpecifyGeneralButtonTextAttributes( iTPButtons[ DONE_BUTTON ], gpStrategicString[ STR_TP_DONE ], BLOCKFONT, FONT_BEIGE, 141 );
SetButtonFastHelpText( iTPButtons[ DONE_BUTTON ], gpStrategicString[ STR_TP_DONEHELP ] );
@@ -422,11 +422,34 @@ void InitTacticalPlacementGUI()
//Load the faces
{
+
ubFaceIndex = gMercProfiles[ gMercPlacement[ i ].pSoldier->ubProfile ].ubFaceIndex;
+
+ /*
if( ubFaceIndex < 100 )
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", ubFaceIndex );
else
sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", ubFaceIndex );
+
+ */
+
+ if ( ( ubFaceIndex < 100 ) && ( gProfilesIMP[ gMercPlacement[ i ].pSoldier->ubProfile ].ProfilId == gMercPlacement[ i ].pSoldier->ubProfile ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%02d.sti", ubFaceIndex );
+ }
+ else if ( ( ubFaceIndex > 99 ) && ( gProfilesIMP[ gMercPlacement[ i ].pSoldier->ubProfile ].ProfilId == gMercPlacement[ i ].pSoldier->ubProfile ) )
+ {
+ sprintf( VObjectDesc.ImageFile, "IMPFaces\\65Face\\%03d.sti", ubFaceIndex );
+ }
+ else if( ubFaceIndex < 100 )
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%02d.sti", ubFaceIndex );
+ }
+ else if( ubFaceIndex > 99 )
+ {
+ sprintf( VObjectDesc.ImageFile, "Faces\\65Face\\%03d.sti", ubFaceIndex );
+ }
+
}
if( !AddVideoObject( &VObjectDesc, &gMercPlacement[ i ].uiVObjectID ) )
@@ -439,7 +462,7 @@ void InitTacticalPlacementGUI()
}
- xp = 91 + (i / 2) * 54;
+ xp = (xResOffset) + 91 + (i / 2) * 54;
if (i % 2)
{
@@ -601,7 +624,7 @@ void RenderTacticalPlacementGUI()
//of it's region, then we will clear the hilighted ID, and refresh the display.
if( !gfTacticalPlacementGUIDirty && gbHilightedMercID != -1 )
{
- xp = 91 + (gbHilightedMercID / 2) * 54;
+ xp = xResOffset + 91 + (gbHilightedMercID / 2) * 54;
if (gbHilightedMercID % 2)
{
@@ -625,8 +648,8 @@ void RenderTacticalPlacementGUI()
//If the display is dirty render the entire panel.
if( gfTacticalPlacementGUIDirty )
{
- BltVideoObjectFromIndex( FRAME_BUFFER, giOverheadPanelImage, 0, 0, SCREEN_HEIGHT - 160, VO_BLT_SRCTRANSPARENCY, 0 );
- InvalidateRegion( 0, SCREEN_HEIGHT - 160, 320, SCREEN_HEIGHT );
+ BltVideoObjectFromIndex( FRAME_BUFFER, giOverheadPanelImage, 0, xResOffset, SCREEN_HEIGHT - 160, VO_BLT_SRCTRANSPARENCY, 0 );
+ InvalidateRegion( 0 + xResOffset, SCREEN_HEIGHT - 160, 320 + xResOffset, SCREEN_HEIGHT );
gfTacticalPlacementGUIDirty = FALSE;
MarkButtonsDirty();
//DisableHilightsAndHelpText();
@@ -637,7 +660,7 @@ void RenderTacticalPlacementGUI()
pSoldier = gMercPlacement[ i ].pSoldier;
- xp = 95 + (i / 2) * 54;
+ xp = xResOffset + 95 + (i / 2) * 54;
if (i % 2)
{
@@ -683,7 +706,7 @@ void RenderTacticalPlacementGUI()
GetSectorIDString( gubPBSectorX, gubPBSectorY, gubPBSectorZ, str, TRUE );
- mprintf(120, SCREEN_HEIGHT - 145, L"%s %s -- %s...", gpStrategicString[ STR_TP_SECTOR ], str, gpStrategicString[ STR_TP_CHOOSEENTRYPOSITIONS ] );
+ mprintf(120 + xResOffset, SCREEN_HEIGHT - 145, L"%s %s -- %s...", gpStrategicString[ STR_TP_SECTOR ], str, gpStrategicString[ STR_TP_CHOOSEENTRYPOSITIONS ] );
//Shade out the part of the tactical map that isn't considered placable.
BlitBufferToBuffer(FRAME_BUFFER, guiSAVEBUFFER, 0, SCREEN_HEIGHT - 160, SCREEN_WIDTH, 160);
@@ -846,7 +869,7 @@ void RenderTacticalPlacementGUI()
{ //Render the merc's names
pSoldier = gMercPlacement[ i ].pSoldier;
- xp = 95 + (i / 2) * 54;
+ xp = xResOffset + 95 + (i / 2) * 54;
if (i % 2)
{
@@ -931,7 +954,7 @@ void lockui (bool unlock) //lock onluck ui for lan //hayden
DisableButton( iTPButtons[ GROUP_BUTTON ] );
DisableButton( iTPButtons[ CLEAR_BUTTON ] );
- SGPRect CenterRect = { 100, 100, SCREEN_WIDTH - 100, 300 };
+ SGPRect CenterRect = { 100 + xResOffset, 100, SCREEN_WIDTH - 100 - xResOffset, 300 };
DoMessageBox( MSG_BOX_BASIC_STYLE, MPServerMessage[8], guiCurrentScreen, MSG_BOX_FLAG_OK | MSG_BOX_FLAG_USE_CENTERING_RECT, DialogRemoved, &CenterRect );
//send loaded
@@ -972,7 +995,7 @@ void TacticalPlacementHandle()
gpTacticalPlacementSelectedSoldier = NULL;
}
- while( DequeueEvent( &InputEvent ) )
+ while( DequeueSpecificEvent( &InputEvent, KEY_DOWN ) )
{
if( InputEvent.usEvent == KEY_DOWN )
{
@@ -1443,7 +1466,7 @@ void HandleTacticalPlacementClicksInOverheadMap( MOUSE_REGION *reg, INT32 reason
&& gusMouseXPos > iOffsetHorizontal && gusMouseXPos < (iOffsetHorizontal + 640))
{
//Report error due to invalid placement.
- SGPRect CenterRect = { 100, 100, SCREEN_WIDTH - 100, 300 };
+ SGPRect CenterRect = { 100 + xResOffset, 100 + 0, SCREEN_WIDTH - 100 - xResOffset, 300 };
DoMessageBox( MSG_BOX_BASIC_STYLE, gpStrategicString[ STR_TP_INACCESSIBLE_MESSAGE ], guiCurrentScreen, MSG_BOX_FLAG_OK | MSG_BOX_FLAG_USE_CENTERING_RECT, DialogRemoved, &CenterRect );
}
}
@@ -1462,8 +1485,8 @@ void HandleTacticalPlacementClicksInOverheadMap( MOUSE_REGION *reg, INT32 reason
if (gusMouseYPos < (iOffsetVertical + 320) && gusMouseYPos > iOffsetVertical
&& gusMouseXPos > iOffsetHorizontal && gusMouseXPos < (iOffsetHorizontal + 640))
{
- SGPRect CenterRect = { 100, 100, SCREEN_WIDTH - 100, 300 };
- DoMessageBox( MSG_BOX_BASIC_STYLE, gpStrategicString[ STR_TP_INVALID_MESSAGE ], guiCurrentScreen, MSG_BOX_FLAG_OK | MSG_BOX_FLAG_USE_CENTERING_RECT, DialogRemoved, &CenterRect );
+ SGPRect CenterRect = { 100 + xResOffset, 100, SCREEN_WIDTH - 100 - xResOffset, 300 };
+ DoMessageBox( MSG_BOX_BASIC_STYLE, gpStrategicString[ STR_TP_INVALID_MESSAGE ], guiCurrentScreen, MSG_BOX_FLAG_OK | MSG_BOX_FLAG_USE_CENTERING_RECT, DialogRemoved, &CenterRect );
}
}
}
diff --git a/TileEngine/TileDat.cpp b/TileEngine/TileDat.cpp
index bd5b0050..137ba285 100644
--- a/TileEngine/TileDat.cpp
+++ b/TileEngine/TileDat.cpp
@@ -586,7 +586,16 @@ UINT16 gNumTilesPerType[ NUMBEROFTILETYPES ] =
FIRSTMISS5 - FIRSTMISS1 + 1,
SECONDMISS5 - SECONDMISS1 + 1,
THIRDMISS14 - THIRDMISS1 + 1,
- WIREFRAMES15 - WIREFRAMES1 + 1
+ WIREFRAMES15 - WIREFRAMES1 + 1,
+
+//MM: New item tileslots start here
+ P4ITEM5000 - P4ITEM1 + 1,
+ P5ITEM5000 - P5ITEM1 + 1,
+ P6ITEM5000 - P6ITEM1 + 1,
+ P7ITEM5000 - P7ITEM1 + 1,
+ P8ITEM5000 - P8ITEM1 + 1,
+ P9ITEM5000 - P9ITEM1 + 1
+
};
UINT8 gTileTypeLogicalHeight[ NUMBEROFTILETYPES ] =
diff --git a/TileEngine/TileDat.h b/TileEngine/TileDat.h
index 217dcf62..a85aef4d 100644
--- a/TileEngine/TileDat.h
+++ b/TileEngine/TileDat.h
@@ -3014,6 +3014,79 @@ enum TileDefines
WIREFRAMES14,
WIREFRAMES15,
+ //MM: New item tileslots start here
+ P4ITEM1,
+ P4ITEM2,
+ P4ITEM3,
+ P4ITEM4,
+ P4ITEM5,
+ P4ITEM6,
+ P4ITEM7,
+ P4ITEM8,
+ P4ITEM9,
+ P4ITEM10,
+ P4ITEM5000 = P4ITEM10 + 4990,
+
+ P5ITEM1,
+ P5ITEM2,
+ P5ITEM3,
+ P5ITEM4,
+ P5ITEM5,
+ P5ITEM6,
+ P5ITEM7,
+ P5ITEM8,
+ P5ITEM9,
+ P5ITEM10,
+ P5ITEM5000 = P5ITEM10 + 4990,
+
+ P6ITEM1,
+ P6ITEM2,
+ P6ITEM3,
+ P6ITEM4,
+ P6ITEM5,
+ P6ITEM6,
+ P6ITEM7,
+ P6ITEM8,
+ P6ITEM9,
+ P6ITEM10,
+ P6ITEM5000 = P6ITEM10 + 4990,
+
+ P7ITEM1,
+ P7ITEM2,
+ P7ITEM3,
+ P7ITEM4,
+ P7ITEM5,
+ P7ITEM6,
+ P7ITEM7,
+ P7ITEM8,
+ P7ITEM9,
+ P7ITEM10,
+ P7ITEM5000 = P7ITEM10 + 4990,
+
+ P8ITEM1,
+ P8ITEM2,
+ P8ITEM3,
+ P8ITEM4,
+ P8ITEM5,
+ P8ITEM6,
+ P8ITEM7,
+ P8ITEM8,
+ P8ITEM9,
+ P8ITEM10,
+ P8ITEM5000 = P8ITEM10 + 4990,
+
+ P9ITEM1,
+ P9ITEM2,
+ P9ITEM3,
+ P9ITEM4,
+ P9ITEM5,
+ P9ITEM6,
+ P9ITEM7,
+ P9ITEM8,
+ P9ITEM9,
+ P9ITEM10,
+ P9ITEM5000 = P9ITEM10 + 4990,
+
NUMBEROFTILES
};
@@ -3217,6 +3290,14 @@ enum TileTypeDefines
WIREFRAMES,
+ //MM: New item tileslots start here
+ P4ITEMS,
+ P5ITEMS,
+ P6ITEMS,
+ P7ITEMS,
+ P8ITEMS,
+ P9ITEMS,
+
NUMBEROFTILETYPES
};
diff --git a/TileEngine/TileEngine_VS2010.vcxproj b/TileEngine/TileEngine_VS2010.vcxproj
index a83d0848..99e6f9e6 100644
--- a/TileEngine/TileEngine_VS2010.vcxproj
+++ b/TileEngine/TileEngine_VS2010.vcxproj
@@ -169,24 +169,24 @@
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
diff --git a/TileEngine/overhead map.cpp b/TileEngine/overhead map.cpp
index 3fa6cf8b..1b56c11f 100644
--- a/TileEngine/overhead map.cpp
+++ b/TileEngine/overhead map.cpp
@@ -593,21 +593,21 @@ void GoIntoOverheadMap( )
// LOAD CLOSE ANIM
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
- VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
- FilenameForBPP("INTERFACE\\MAP_BORD.sti", VObjectDesc.ImageFile);
- if( !AddVideoObject( &VObjectDesc, &uiOVERMAP ) )
- AssertMsg(0, "Missing INTERFACE\\MAP_BORD.sti" );
+ VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
+ FilenameForBPP("INTERFACE\\MAP_BORD.sti", VObjectDesc.ImageFile);
+ if( !AddVideoObject( &VObjectDesc, &uiOVERMAP ) )
+ AssertMsg(0, "Missing INTERFACE\\MAP_BORD.sti" );
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\MAP_BORD_800x600.sti", VObjectDesc.ImageFile);
if( !AddVideoObject( &VObjectDesc, &uiOVERMAP ) )
AssertMsg(0, "Missing INTERFACE\\MAP_BORD_800x600.sti" );
}
- else if (iResolution == 2)
+ else
{
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
FilenameForBPP("INTERFACE\\MAP_BORD_1024x768.sti", VObjectDesc.ImageFile);
@@ -674,7 +674,7 @@ void HandleOverheadUI(void)
ScrollOverheadMap();
- while(DequeueEvent(&InputEvent) == TRUE)
+ while(DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_REPEAT) == TRUE)
{
if(InputEvent.usEvent == KEY_DOWN || InputEvent.usEvent == KEY_REPEAT)
{
@@ -1221,8 +1221,8 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
ColorFillVideoSurfaceArea( FRAME_BUFFER, sX1, sY1, sX2, sY2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
}
- if(!fFromMapUtility)
- BltVideoObjectFromIndex(FRAME_BUFFER, uiOVERMAP, 0, 0, 0, VO_BLT_SRCTRANSPARENCY, NULL);// Render border!
+ if(!fFromMapUtility) //LJDOldSM
+ BltVideoObjectFromIndex(FRAME_BUFFER, uiOVERMAP, 0, xResOffset, yResOffset, VO_BLT_SRCTRANSPARENCY, NULL);// Render border!
// Update the save buffer
UINT32 uiDestPitchBYTES, uiSrcPitchBYTES;
@@ -1233,8 +1233,10 @@ void RenderOverheadMap( INT16 sStartPointX_M, INT16 sStartPointY_M, INT16 sStart
GetCurrentVideoSettings( &usWidth, &usHeight, &ubBitDepth );
pSrcBuf = LockVideoSurface(guiRENDERBUFFER, &uiSrcPitchBYTES);
pDestBuf = LockVideoSurface(guiSAVEBUFFER, &uiDestPitchBYTES);
+
if(gbPixelDepth == 16)// BLIT HERE
Blt16BPPTo16BPP((UINT16 *)pDestBuf, uiDestPitchBYTES, (UINT16 *)pSrcBuf, uiSrcPitchBYTES, 0, 0, 0, 0, usWidth, usHeight );
+
UnLockVideoSurface(guiRENDERBUFFER);
UnLockVideoSurface(guiSAVEBUFFER);
}
@@ -1288,14 +1290,7 @@ void RenderOverheadOverlays()
if( !gfTacticalPlacementGUIActive && pSoldier->bLastRenderVisibleValue == -1 && !(gTacticalStatus.uiFlags&SHOW_ALL_MERCS) )
{
- //hayden
- if(is_networked && pSoldier->bSide==0)
- {
- }
- else
- {
continue;// ie dont render
- }
}
if (TileIsOutOfBounds(pSoldier->sGridNo))
diff --git a/TileEngine/renderworld.cpp b/TileEngine/renderworld.cpp
index 26f5b5a4..5c5c5d01 100644
--- a/TileEngine/renderworld.cpp
+++ b/TileEngine/renderworld.cpp
@@ -497,7 +497,8 @@ UINT32 gRenderFlags=0;
* any questions? joker
*/
SGPRect gClippingRect;// = { 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT - INTERFACE_HEIGHT};
-SGPRect gOldClipRect = { 0, 0, 1024, 768 }; // 0verhaul: This MUST mirror the gDirtyClipRect init, otherwise funkiness with video overlays will happen
+//SGPRect gOldClipRect = { 0, 0, 2560, 1600 };
+SGPRect gOldClipRect = { 0, 0, 0, 0 };
INT16 gsRenderCenterX;
INT16 gsRenderCenterY;
INT16 gsRenderWorldOffsetX = 0; //lal was -1 : bugfix for merc screen position in tactical on high resolution
@@ -3832,6 +3833,11 @@ void ScrollWorld( )
void InitializeViewPort()
{
+ gOldClipRect.iLeft = 0;
+ gOldClipRect.iTop = 0;
+ gOldClipRect.iRight = SCREEN_WIDTH;
+ gOldClipRect.iBottom = SCREEN_HEIGHT;
+
gsVIEWPORT_START_X = 0;
gsVIEWPORT_START_Y = 0;
gsVIEWPORT_WINDOW_START_Y = 0;
diff --git a/TileEngine/worlddef.cpp b/TileEngine/worlddef.cpp
index 6278c5fa..b5d81b0b 100644
--- a/TileEngine/worlddef.cpp
+++ b/TileEngine/worlddef.cpp
@@ -2857,6 +2857,9 @@ BOOLEAN LoadWorld(const STR8 puiFilename, FLOAT* pMajorMapVersion, UINT8* pMinor
// Uncheck "vanilla map saving", because it is not allowed on maps > 160x160
UnclickEditorButton(OPTIONS_VANILLA_MODE);
+
+ // Reset
+ gfResizeMapOnLoading = FALSE;
}
else
{
diff --git a/Utils/Animated ProgressBar.cpp b/Utils/Animated ProgressBar.cpp
index 2de88ebd..7d6425ef 100644
--- a/Utils/Animated ProgressBar.cpp
+++ b/Utils/Animated ProgressBar.cpp
@@ -35,24 +35,24 @@ void CreateLoadingScreenProgressBar()
// Special case->show small image centered
if (bShowSmallImage == TRUE)
{
- if (iResolution > 0)
+ if (iResolution >= _800x600)
{
CreateProgressBar(0, iScreenWidthOffset + 162, iScreenHeightOffset + 427, iScreenWidthOffset + 480, iScreenHeightOffset + 443);
}
}
else
{
- if (iResolution == 0)
+ if (iResolution >= _640x480 && iResolution < _800x600)
{
CreateProgressBar(0, 162, 427, 480, 443);
}
- else if (iResolution == 1)
+ else if (iResolution < _1024x768)
{
- CreateProgressBar(0, 202, 533, 600, 554);
+ CreateProgressBar(0, (202 + (SCREEN_WIDTH - 800)/2), 533 + ((SCREEN_HEIGHT - 600) / 2), 600 + ((SCREEN_WIDTH - 800) / 2), 554 + ((SCREEN_HEIGHT - 600) / 2));
}
- else if (iResolution == 2)
+ else
{
- CreateProgressBar(0, 259, 683, 767, 708);
+ CreateProgressBar(0, 259 + ((SCREEN_WIDTH - 1024) / 2), 683 + ((SCREEN_HEIGHT - 768) / 2), 767 + ((SCREEN_WIDTH - 1024) / 2), 708 + ((SCREEN_HEIGHT - 768) / 2));
}
}
diff --git a/Utils/ExportStrings.cpp b/Utils/ExportStrings.cpp
index 493afd6e..f70ef843 100644
--- a/Utils/ExportStrings.cpp
+++ b/Utils/ExportStrings.cpp
@@ -302,8 +302,8 @@ bool Loc::ExportStrings()
ExportSection(props, L"MoneyWithdrawMessage", Loc::gzMoneyWithdrawMessageText, 0, TEXT_NUM_MONEY_WITHDRAW);
ExportSection(props, L"Copyright", Loc::gzCopyrightText, 0, 1);
- ExportSection(props, L"OptionsToggle", Loc::zOptionsToggleText, 0, 48);
- ExportSection(props, L"OptionsScreenHelp", Loc::zOptionsScreenHelpText, 0, 48);
+ ExportSection(props, L"OptionsToggle", Loc::zOptionsToggleText, 0, 49);
+ ExportSection(props, L"OptionsScreenHelp", Loc::zOptionsScreenHelpText, 0, 49);
ExportSection(props, L"GIOScreen", Loc::gzGIOScreenText, 0, TEXT_NUM_GIO_TEXT);
ExportSection(props, L"MPJScreen", Loc::gzMPJScreenText, 0, TEXT_NUM_MPJ_TEXT);
ExportSection(props, L"MPJHelpText", Loc::gzMPJHelpText, 0, 10);
diff --git a/Utils/INIReader.cpp b/Utils/INIReader.cpp
index 36656609..e16978f7 100644
--- a/Utils/INIReader.cpp
+++ b/Utils/INIReader.cpp
@@ -73,6 +73,14 @@ CIniReader::CIniReader(const STR8 szFileName)
rev_order.pop();
}
}
+ // check for override file
+ {
+ CHAR8 OvrFileName[256], Drive[128], Dir[128], Name[128], Ext[128];
+ _splitpath(szFileName, Drive, Dir, Name, Ext);
+ _makepath(OvrFileName, Drive, Dir, Name, "Override");
+ if(getVFS()->fileExists(OvrFileName))
+ m_oProps.initFromIniFile(vfs::Path(OvrFileName));
+ }
#endif
}
diff --git a/Utils/KeyMap.cpp b/Utils/KeyMap.cpp
new file mode 100644
index 00000000..c8c212a7
--- /dev/null
+++ b/Utils/KeyMap.cpp
@@ -0,0 +1,314 @@
+#ifdef PRECOMPILEDHEADERS
+#include "Utils All.h"
+#else
+#include "KeyMap.h"
+#include
+#endif
+
+// Enumeration support
+typedef struct EnumLookupType {
+ int value;
+ const STR name;
+} EnumLookupType;
+
+static const STR EnumToString(int value, const EnumLookupType *table);
+static int StringToEnum(const STR value, const EnumLookupType *table);
+static int EnumToIndex(int value, const EnumLookupType *table);
+static inline STR Trim(STR&p);
+
+static EnumLookupType gKeyTable[] =
+{
+ {VK_LBUTTON, "LBUTTON"},
+ {VK_RBUTTON, "RBUTTON"},
+ {VK_CANCEL, "CANCEL"},
+ {VK_MBUTTON, "MBUTTON"},
+ #if(_WIN32_WINNT >= 0x0500)
+ {VK_XBUTTON1, "XBUTTON1"},
+ {VK_XBUTTON2, "XBUTTON2"},
+ #endif /* _WIN32_WINNT >= 0x0500 */
+ {VK_BACK, "BACK"},
+ {VK_TAB, "TAB"},
+ {VK_CLEAR, "CLEAR"},
+ {VK_RETURN, "RETURN"},
+ {VK_SHIFT, "SHIFT"},
+ {VK_CONTROL, "CONTROL"},
+ {VK_MENU, "MENU"},
+ {VK_PAUSE, "PAUSE"},
+ {VK_CAPITAL, "CAPITAL"},
+ {VK_KANA, "KANA"},
+ {VK_HANGEUL, "HANGEUL"},
+ {VK_HANGUL, "HANGUL"},
+ {VK_JUNJA, "JUNJA"},
+ {VK_FINAL, "FINAL"},
+ {VK_HANJA, "HANJA"},
+ {VK_KANJI, "KANJI"},
+ {VK_ESCAPE, "ESCAPE"},
+ {VK_CONVERT, "CONVERT"},
+ {VK_NONCONVERT, "NONCONVERT"},
+ {VK_ACCEPT, "ACCEPT"},
+ {VK_MODECHANGE, "MODECHANGE"},
+ {VK_SPACE, "SPACE"},
+ {VK_PRIOR, "PRIOR"},
+ {VK_NEXT, "NEXT"},
+ {VK_END, "END"},
+ {VK_HOME, "HOME"},
+ {VK_LEFT, "LEFT"},
+ {VK_UP, "UP"},
+ {VK_RIGHT, "RIGHT"},
+ {VK_DOWN, "DOWN"},
+ {VK_SELECT, "SELECT"},
+ {VK_PRINT, "PRINT"},
+ {VK_EXECUTE, "EXECUTE"},
+ {VK_SNAPSHOT, "SNAPSHOT"},
+ {VK_INSERT, "INSERT"},
+ {VK_DELETE, "DELETE"},
+ {VK_HELP, "HELP"},
+
+ { '0', "0"},
+ { '1', "1"},
+ { '2', "2"},
+ { '3', "3"},
+ { '4', "4"},
+ { '5', "5"},
+ { '6', "6"},
+ { '7', "7"},
+ { '8', "8"},
+ { '9', "9"},
+ { ':', ":"},
+ { ';', ";"},
+ { '<', "<"},
+ { '=', "="},
+ { '>', ">"},
+ { '?', "?"},
+ { 'A', "A"},
+ { 'B', "B"},
+ { 'C', "C"},
+ { 'D', "D"},
+ { 'E', "E"},
+ { 'F', "F"},
+ { 'G', "G"},
+ { 'H', "H"},
+ { 'I', "I"},
+ { 'J', "J"},
+ { 'K', "K"},
+ { 'L', "L"},
+ { 'M', "M"},
+ { 'N', "N"},
+ { 'O', "O"},
+ { 'P', "P"},
+ { 'Q', "Q"},
+ { 'R', "R"},
+ { 'S', "S"},
+ { 'T', "T"},
+ { 'U', "U"},
+ { 'V', "V"},
+ { 'W', "W"},
+ { 'X', "X"},
+ { 'Y', "Y"},
+ { 'Z', "Z"},
+
+ {VK_LWIN, "LWIN"},
+ {VK_RWIN, "RWIN"},
+ {VK_APPS, "APPS"},
+ {VK_SLEEP, "SLEEP"},
+ {VK_NUMPAD0, "NUMPAD0"},
+ {VK_NUMPAD1, "NUMPAD1"},
+ {VK_NUMPAD2, "NUMPAD2"},
+ {VK_NUMPAD3, "NUMPAD3"},
+ {VK_NUMPAD4, "NUMPAD4"},
+ {VK_NUMPAD5, "NUMPAD5"},
+ {VK_NUMPAD6, "NUMPAD6"},
+ {VK_NUMPAD7, "NUMPAD7"},
+ {VK_NUMPAD8, "NUMPAD8"},
+ {VK_NUMPAD9, "NUMPAD9"},
+ {VK_MULTIPLY, "MULTIPLY"},
+ {VK_ADD, "ADD"},
+ {VK_SEPARATOR, "SEPARATOR"},
+ {VK_SUBTRACT, "SUBTRACT"},
+ {VK_DECIMAL, "DECIMAL"},
+ {VK_DIVIDE, "DIVIDE"},
+ {VK_F1, "F1"},
+ {VK_F2, "F2"},
+ {VK_F3, "F3"},
+ {VK_F4, "F4"},
+ {VK_F5, "F5"},
+ {VK_F6, "F6"},
+ {VK_F7, "F7"},
+ {VK_F8, "F8"},
+ {VK_F9, "F9"},
+ {VK_F10, "F10"},
+ {VK_F11, "F11"},
+ {VK_F12, "F12"},
+ {VK_F13, "F13"},
+ {VK_F14, "F14"},
+ {VK_F15, "F15"},
+ {VK_F16, "F16"},
+ {VK_F17, "F17"},
+ {VK_F18, "F18"},
+ {VK_F19, "F19"},
+ {VK_F20, "F20"},
+ {VK_F21, "F21"},
+ {VK_F22, "F22"},
+ {VK_F23, "F23"},
+ {VK_F24, "F24"},
+ {VK_NUMLOCK, "NUMLOCK"},
+ {VK_SCROLL, "SCROLL"},
+ {VK_OEM_NEC_EQUAL, "OEM_NEC_EQUAL"},
+ {VK_OEM_FJ_JISHO, "OEM_FJ_JISHO"},
+ {VK_OEM_FJ_MASSHOU, "OEM_FJ_MASSHOU"},
+ {VK_OEM_FJ_TOUROKU, "OEM_FJ_TOUROKU"},
+ {VK_OEM_FJ_LOYA, "OEM_FJ_LOYA"},
+ {VK_OEM_FJ_ROYA, "OEM_FJ_ROYA"},
+ {VK_LSHIFT, "LSHIFT"},
+ {VK_RSHIFT, "RSHIFT"},
+ {VK_LCONTROL, "LCONTROL"},
+ {VK_RCONTROL, "RCONTROL"},
+ {VK_LMENU, "LMENU"},
+ {VK_RMENU, "RMENU"},
+
+ #if(_WIN32_WINNT >= 0x0500)
+ {VK_BROWSER_BACK, "BROWSER_BACK"},
+ {VK_BROWSER_FORWARD, "BROWSER_FORWARD"},
+ {VK_BROWSER_REFRESH, "BROWSER_REFRESH"},
+ {VK_BROWSER_STOP, "BROWSER_STOP"},
+ {VK_BROWSER_SEARCH, "BROWSER_SEARCH"},
+ {VK_BROWSER_FAVORITES, "BROWSER_FAVORITES"},
+ {VK_BROWSER_HOME, "BROWSER_HOME"},
+
+ {VK_VOLUME_MUTE, "VOLUME_MUTE"},
+ {VK_VOLUME_DOWN, "VOLUME_DOWN"},
+ {VK_VOLUME_UP, "VOLUME_UP"},
+ {VK_MEDIA_NEXT_TRACK, "MEDIA_NEXT_TRACK"},
+ {VK_MEDIA_PREV_TRACK, "MEDIA_PREV_TRACK"},
+ {VK_MEDIA_STOP, "MEDIA_STOP"},
+ {VK_MEDIA_PLAY_PAUSE, "MEDIA_PLAY_PAUSE"},
+ {VK_LAUNCH_MAIL, "LAUNCH_MAIL"},
+ {VK_LAUNCH_MEDIA_SELECT, "LAUNCH_MEDIA_SELECT"},
+ {VK_LAUNCH_APP1, "LAUNCH_APP1"},
+ {VK_LAUNCH_APP2, "LAUNCH_APP2"},
+
+ #endif /* _WIN32_WINNT >= 0x0500 */
+
+ {VK_OEM_1, "OEM_1"},
+ {VK_OEM_PLUS, "OEM_PLUS"},
+ {VK_OEM_COMMA, "OEM_COMMA"},
+ {VK_OEM_MINUS, "OEM_MINUS"},
+ {VK_OEM_PERIOD, "OEM_PERIOD"},
+ {VK_OEM_2, "OEM_2"},
+ {VK_OEM_3, "OEM_3"},
+ {VK_OEM_4, "OEM_4"},
+ {VK_OEM_5, "OEM_5"},
+ {VK_OEM_6, "OEM_6"},
+ {VK_OEM_7, "OEM_7"},
+ {VK_OEM_8, "OEM_8"},
+ {VK_OEM_AX, "OEM_AX"},
+ {VK_OEM_102, "OEM_102"},
+ {VK_ICO_HELP, "ICO_HELP"},
+ {VK_ICO_00, "ICO_00"},
+ #if(WINVER >= 0x0400)
+ {VK_PROCESSKEY, "PROCESSKEY"},
+ #endif /* WINVER >= 0x0400 */
+ {VK_ICO_CLEAR, "ICO_CLEAR"},
+ #if(_WIN32_WINNT >= 0x0500)
+ {VK_PACKET, "PACKET"},
+ #endif /* _WIN32_WINNT >= 0x0500 */
+ {VK_OEM_RESET, "OEM_RESET"},
+ {VK_OEM_JUMP, "OEM_JUMP"},
+ {VK_OEM_PA1, "OEM_PA1"},
+ {VK_OEM_PA2, "OEM_PA2"},
+ {VK_OEM_PA3, "OEM_PA3"},
+ {VK_OEM_WSCTRL, "OEM_WSCTRL"},
+ {VK_OEM_CUSEL, "OEM_CUSEL"},
+ {VK_OEM_ATTN, "OEM_ATTN"},
+ {VK_OEM_FINISH, "OEM_FINISH"},
+ {VK_OEM_COPY, "OEM_COPY"},
+ {VK_OEM_AUTO, "OEM_AUTO"},
+ {VK_OEM_ENLW, "OEM_ENLW"},
+ {VK_OEM_BACKTAB, "OEM_BACKTAB"},
+ {VK_ATTN, "ATTN"},
+ {VK_CRSEL, "CRSEL"},
+ {VK_EXSEL, "EXSEL"},
+ {VK_EREOF, "EREOF"},
+ {VK_PLAY, "PLAY"},
+ {VK_ZOOM, "ZOOM"},
+ {VK_NONAME, "NONAME"},
+ {VK_PA1, "PA1"},
+ {VK_OEM_CLEAR, "OEM_CLEAR"},
+ {0, NULL}
+};
+
+
+
+// Enumeration Support
+const STR EnumToString(int value, const EnumLookupType *table) {
+ for (const EnumLookupType *itr = table; itr->name != NULL; ++itr) {
+ if (itr->value == value) return itr->name;
+ }
+ return NULL;
+}
+
+int StringToEnum(const STR value, const EnumLookupType *table) {
+ if (NULL == value || 0 == *value)
+ return 0;
+
+ for (const EnumLookupType *itr = table; itr->name != NULL; ++itr) {
+ if (0 == _stricmp(value, itr->name))
+ return itr->value;
+ }
+ STR end = NULL;
+ return (int)strtol(value, &end, 0);
+}
+
+int EnumToIndex(int value, const EnumLookupType *table) {
+ int i = 0;
+ for (const EnumLookupType *itr = table; itr->name != NULL; ++itr, ++i) {
+ if (itr->value == value) return i;
+ }
+ return -1;
+}
+
+static inline STR Trim(STR &p) {
+ while(isspace(*p)) *p++ = 0;
+ TCHAR *e = p + strlen(p) - 1;
+ while (e > p && isspace(*e)) *e-- = 0;
+ return p;
+}
+
+// Checks VK for each byte in the integer, all must be true to return TRUE.
+extern BOOLEAN IsKeyPressed(int value)
+{
+ if (!value)
+ return 0;
+
+ BOOLEAN ok = 0;
+ UINT8* ptr = (UINT8*)&value;
+ int len = sizeof(int) / sizeof(UINT8);
+ for (int i=0;i 0 && ichr <= 0xFF)
+ ptr[idx++] = (UINT8)ichr;
+ }
+ return iresult;
+}
diff --git a/Utils/KeyMap.h b/Utils/KeyMap.h
new file mode 100644
index 00000000..9b9a6d7e
--- /dev/null
+++ b/Utils/KeyMap.h
@@ -0,0 +1,4 @@
+#include
+
+extern int ParseKeyString(const STR value);
+extern BOOLEAN IsKeyPressed(int value);
diff --git a/Utils/MapUtility.cpp b/Utils/MapUtility.cpp
index 76bbbe42..5a6ced33 100644
--- a/Utils/MapUtility.cpp
+++ b/Utils/MapUtility.cpp
@@ -101,7 +101,7 @@ UINT32 MapUtilScreenHandle(void)
INT32 cnt, iX, iY, iSubX1, iSubY1, iSubX2, iSubY2, iWindowX, iWindowY, iCount;
FLOAT dX, dY, dStartX, dStartY;
- while(DequeueEvent(&InputEvent) == TRUE)
+ while(DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP) == TRUE)
{
if(InputEvent.usParam == ESC)
{
diff --git a/Utils/Text.h b/Utils/Text.h
index fc654f55..95f97a01 100644
--- a/Utils/Text.h
+++ b/Utils/Text.h
@@ -437,6 +437,8 @@ enum
MSG_SAVE_AUTOSAVE_ENDTURN_SLOT, // 102
MSG_SAVE_NORMAL_SLOT, // 103
+ MSG_WINDOWED_MODE_LOCK_MOUSE, // 104
+ MSG_WINDOWED_MODE_RELEASE_MOUSE, // 105
TEXT_NUM_MSG,
};
@@ -606,6 +608,9 @@ extern STR16 gzItemDescGenIndexes[ 4 ];
// HEADROCK HAM 4: Added list of condition strings
extern STR16 gConditionDesc[ 9 ];
+// Flugente FTW1: Added list of temperature descriptions
+extern STR16 gTemperatureDesc[ 11 ];
+
extern CHAR16 gMoneyStatsDesc[][ 13 ];
// HEADROCK: Altered value to 16 //WarmSteel - And I need 17.
extern CHAR16 gWeaponStatsDesc[][ 17 ];
@@ -623,15 +628,15 @@ extern STR16 szUDBGenWeaponsStatsTooltipText[ 22 ];
extern STR16 szUDBGenWeaponsStatsExplanationsTooltipText[ 22 ];
extern STR16 szUDBGenArmorStatsTooltipText[ 3 ];
extern STR16 szUDBGenArmorStatsExplanationsTooltipText[ 3 ];
-extern STR16 szUDBGenAmmoStatsTooltipText[ 3 ];
-extern STR16 szUDBGenAmmoStatsExplanationsTooltipText[ 3 ];
+extern STR16 szUDBGenAmmoStatsTooltipText[ 4 ]; // Flugente Overheating Weapons: 3->4
+extern STR16 szUDBGenAmmoStatsExplanationsTooltipText[ 4 ];
extern STR16 szUDBGenExplosiveStatsTooltipText[ 18 ];
extern STR16 szUDBGenExplosiveStatsExplanationsTooltipText[ 18 ];
extern STR16 szUDBGenSecondaryStatsTooltipText[ 26 ];
extern STR16 szUDBGenSecondaryStatsExplanationsTooltipText[ 26 ];
-extern STR16 szUDBAdvStatsTooltipText[ 48 ];
-extern STR16 szUDBAdvStatsExplanationsTooltipText[ 48 ];
-extern STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[ 48 ];
+extern STR16 szUDBAdvStatsTooltipText[ 56 ]; // Flugente Overheating Weapons: 48->56
+extern STR16 szUDBAdvStatsExplanationsTooltipText[ 56 ]; // Flugente Overheating Weapons: 48->56
+extern STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[ 52 ]; // Flugente Overheating Weapons: 48->52
// Headrock: End Externs
extern STR16 sKeyDescriptionStrings[2];
@@ -753,6 +758,7 @@ enum
EXIT_GUI_GOTO_SECTOR_STR,
EXIT_GUI_GOTO_MAP_STR,
CANNOT_LEAVE_SECTOR_FROM_SIDE_STR,
+ CANNOT_LEAVE_IN_TURN_MODE_STR,
MERC_IS_TOO_FAR_AWAY_STR,
REMOVING_TREETOPS_STR,
SHOWING_TREETOPS_STR,
@@ -1131,7 +1137,8 @@ enum
BOBBYR_GUNS_SUB_TOTAL,
BOBBYR_GUNS_PERCENT_FUNCTIONAL,
- BOBBYR_MORE_THEN_10_PURCHASES,
+ BOBBYR_MORE_THEN_10_PURCHASES_A,
+ BOBBYR_MORE_THEN_10_PURCHASES_B,
BOBBYR_MORE_NO_MORE_IN_STOCK,
BOBBYR_NO_MORE_STOCK,
TEXT_NUM_BOBBYR_GUNS,
@@ -1747,6 +1754,15 @@ enum
GIO_SQUAD_SIZE_8_TEXT,
GIO_SQUAD_SIZE_10_TEXT,
+ //GIO_FAST_BR_TITLE_TEXT,
+
+ //Inventory AP Cost
+ GIO_INVENTORY_AP_TITLE_TEXT,
+
+ GIO_NCTH_TITLE_TEXT,
+ GIO_IIS_TITLE_TEXT,
+ GIO_OVERHEATING_TITLE_TEXT,
+
////////////////////////////////////
TEXT_NUM_GIO_TEXT
};
@@ -2077,6 +2093,8 @@ enum
MSG113_ENEMY_FOUND_DEAD_BODY,
MSG113_AMMO_SPEC_STRING,
+ MSG113_INVENTORY_APS_INSUFFICIENT,
+
TEXT_NUM_MSG113,
};
@@ -2118,6 +2136,8 @@ enum
ADDTEXT_16BPP_REQUIRED,
};
extern STR16 Additional113Text[];
+extern STR16 ranks[];
+extern STR16 ranks[];
#endif
diff --git a/Utils/Timer Control.cpp b/Utils/Timer Control.cpp
index e8436fa4..4b5ec7e7 100644
--- a/Utils/Timer Control.cpp
+++ b/Utils/Timer Control.cpp
@@ -14,6 +14,7 @@
#include "worlddef.h"
#include "renderworld.h"
#include "interface control.h"
+ #include "keymap.h"
#endif
#ifndef WIN32_LEAN_AND_MEAN
@@ -21,6 +22,14 @@
#endif
#include "Soldier Control.h"
+#include "connect.h"
+
+// Base resolution of callback timer
+static INT32 BASETIMESLICE = 10;
+const INT32 FASTFORWARDTIMESLICE = 1000;
+const UINT32 FREQUENCY_CONST = 1000000;
+static INT32 MIN_NOTIFY_TIME = 16000;
+static INT32 UPDATETIMESLICE = 10000;
INT32 giClockTimer = -1;
INT32 giTimerDiag = 0;
@@ -29,35 +38,48 @@ UINT32 guiBaseJA2Clock = 0;
UINT32 guiBaseJA2NoPauseClock = 0;
BOOLEAN gfPauseClock = FALSE;
+BOOLEAN gfHispeedClockMode = FALSE;
+
+const inline UINT32 TIME_US_TO_MS(UINT32 value) { return value / 1000; }
+const inline UINT32 TIME_MS_TO_US(UINT32 value) { return value * 1000; }
+
+UINT32 giFastForwardPeriod = FASTFORWARDTIMESLICE;
+BOOLEAN giFastForwardMode = FALSE;
+INT32 giFastForwardKey = 0;
+UINT32 guiTimeSlice = 0;
+FLOAT gfClockSpeedPercent = 1.0;
+LARGE_INTEGER gliPerfFreq = {0};
+LARGE_INTEGER gliPerfCount = {0};
+LARGE_INTEGER gliPerfCountNext = {0};
INT32 giTimerIntervals[ NUMTIMERS ] =
{
- 5, // Tactical Overhead
- 20, // NEXTSCROLL
- 200, // Start Scroll
- 200, // Animate tiles
- 1000, // FPS Counter
- 80, // PATH FIND COUNTER
- 150, // CURSOR TIMER
- 250, // RIGHT CLICK FOR MENU
- 300, // LEFT
- 30, // SLIDING TEXT
- 200, // TARGET REFINE TIMER
- 150, // CURSOR/AP FLASH
- 60, // FADE MERCS OUT
- 160, // PANEL SLIDE
- 1000, // CLOCK UPDATE DELAY
- 20, // PHYSICS UPDATE
- 100, // FADE ENEMYS
- 20, // STRATEGIC OVERHEAD
- 40,
- 500, // NON GUN TARGET REFINE TIMER
- 250, // IMPROVED CURSOR FLASH
- 500, // 2nd CURSOR FLASH
- 400, // RADARMAP BLINK AND OVERHEAD MAP BLINK SHOUDL BE THE SAME
- 400,
- 10, // Music Overhead
- 100, // Rubber band start delay
+ 5, // Tactical Overhead
+ 20, // NEXTSCROLL
+ 200, // Start Scroll
+ 200, // Animate tiles
+ 1000, // FPS Counter
+ 80, // PATH FIND COUNTER
+ 150, // CURSOR TIMER
+ 250, // RIGHT CLICK FOR MENU
+ 300, // LEFT
+ 30, // SLIDING TEXT
+ 200, // TARGET REFINE TIMER
+ 150, // CURSOR/AP FLASH
+ 60, // FADE MERCS OUT
+ 160, // PANEL SLIDE
+ 1000, // CLOCK UPDATE DELAY
+ 20, // PHYSICS UPDATE
+ 100, // FADE ENEMYS
+ 20, // STRATEGIC OVERHEAD
+ 40,
+ 500, // NON GUN TARGET REFINE TIMER
+ 250, // IMPROVED CURSOR FLASH
+ 500, // 2nd CURSOR FLASH
+ 400, // RADARMAP BLINK AND OVERHEAD MAP BLINK SHOUDL BE THE SAME
+ 400,
+ 10, // Music Overhead
+ 100, // Rubber band start delay
};
// TIMER COUNTERS
@@ -73,6 +95,16 @@ CUSTOMIZABLE_TIMER_CALLBACK gpCustomizableTimerCallback = NULL;
// Clock Callback event ID
MMRESULT gTimerID;
+TIMECAPS gtc;
+
+HANDLE ghClockThread;
+DWORD gdwClockThreadId;
+HANDLE ghClockThreadShutdown;
+
+HANDLE ghNotifyThread;
+DWORD gdwNotifyThreadId;
+HANDLE ghNotifyThreadEvent;
+HANDLE ghNotifyThreadShutdownComplete;
// GLOBALS FOR CALLBACK
UINT32 gCNT;
@@ -97,13 +129,28 @@ extern INT32 giFlashContractBaseTime;
extern UINT32 guiFlashCursorBaseTime;
extern INT32 giPotCharPathBaseTime;
+typedef void (*TIMER_NOTIFY_CALLBACK) ( INT32 timer, PTR state );
+struct TIMER_NOTIFY_ITEM
+{
+ TIMER_NOTIFY_CALLBACK callback;
+ PTR state;
+};
+typedef std::list TIMER_NOTIFY_ITEM_LIST;
+typedef TIMER_NOTIFY_ITEM_LIST::iterator TIMER_NOTIFY_ITEM_ITERATOR;
+static TIMER_NOTIFY_ITEM_LIST glNotifyCallbacks;
+static CRITICAL_SECTION gcsNotifyLock;
+
+static bool HasTimerNotifyCallbacks( );
+static void BroadcastTimerNotify(INT32 );
+static BOOLEAN UpdateTimeCounter( INT32 &counter, INT32 &iTimeLeft );
+static BOOLEAN UpdateCounter( INT32 counter, INT32 &iTimeLeft);
+static void UpdateTimer();
UINT32 InitializeJA2TimerCallback( UINT32 uiDelay, LPTIMECALLBACK TimerProc, UINT32 uiUser );
// CALLBACKS
void CALLBACK FlashItem( UINT uiID, UINT uiMsg, DWORD uiUser, DWORD uiDw1, DWORD uiDw2 );
-
void CALLBACK TimeProc( UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2 )
{
static BOOLEAN fInFunction = FALSE;
@@ -113,87 +160,183 @@ void CALLBACK TimeProc( UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2
{
fInFunction = TRUE;
- guiBaseJA2NoPauseClock += BASETIMESLICE;
+ BOOLEAN timerDone = FALSE;
+ BOOLEAN tickTime = FALSE;
+ INT32 iTimeLeft = 0;
-
- if ( !gfPauseClock )
+ // Use QPC to check if BASETIMESLICE (in ms) has passed
+ if (IsHiSpeedClockMode())
{
- guiBaseJA2Clock += BASETIMESLICE;
-
- for ( gCNT = 0; gCNT < NUMTIMERS; gCNT++ )
+ // Only advance time when sufficient time has passed to exceed next time
+ QueryPerformanceCounter(&gliPerfCount);
+ if (gliPerfCount.QuadPart > gliPerfCountNext.QuadPart)
{
- UPDATECOUNTER( gCNT );
+ INT32 iNext = IsFastForwardMode() ? giFastForwardPeriod : UPDATETIMESLICE;
+ gliPerfCountNext.QuadPart = gliPerfCount.QuadPart + (iNext * gliPerfFreq.QuadPart) / FREQUENCY_CONST;
+ iTimeLeft = iNext;
+ timerDone = IsFastForwardMode();
+ tickTime = TRUE;
}
-
- // Update some specialized countdown timers...
- UPDATETIMECOUNTER( giTimerAirRaidQuote );
- UPDATETIMECOUNTER( giTimerAirRaidDiveStarted );
- UPDATETIMECOUNTER( giTimerAirRaidUpdate );
- UPDATETIMECOUNTER( giTimerTeamTurnUpdate );
-
- if ( gpCustomizableTimerCallback )
- {
- UPDATETIMECOUNTER( giTimerCustomizable );
- }
-
-#ifndef BOUNDS_CHECKER
-
- // If mapscreen...
- if( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN )
- {
- // IN Mapscreen, loop through player's team.....
- for ( gCNT = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; gCNT <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; gCNT++ )
- {
- gPSOLDIER = MercPtrs[ gCNT ];
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.PortraitFlashCounter );
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.PanelAnimateCounter );
- }
}
else
{
- // Set update flags for soldiers
- ////////////////////////////
- for ( gCNT = 0; gCNT < guiNumMercSlots; gCNT++ )
- {
- gPSOLDIER = MercSlots[ gCNT ];
+ // When using millisecond timer, advance time everytime this function is called
+ tickTime = TRUE;
+ timerDone = !IsFastForwardMode();
+ }
+ if (tickTime)
+ {
+ guiBaseJA2NoPauseClock += BASETIMESLICE;
- if ( gPSOLDIER != NULL )
+ if ( !gfPauseClock )
+ {
+ guiBaseJA2Clock += BASETIMESLICE;
+
+ for ( gCNT = 0; gCNT < NUMTIMERS; gCNT++ )
{
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.UpdateCounter );
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.DamageCounter );
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.ReloadCounter );
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.FlashSelCounter );
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.BlinkSelCounter );
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.PortraitFlashCounter );
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.AICounter );
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.FadeCounter );
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.NextTileCounter );
- UPDATETIMECOUNTER( gPSOLDIER->timeCounters.PanelAnimateCounter );
-#ifdef JA2UB
- UPDATETIMECOUNTER( gPSOLDIER->GetupFromJA25StartCounter );
-#endif
+ timerDone |= UpdateCounter( gCNT, iTimeLeft );
}
+
+ // Update some specialized countdown timers...
+ timerDone |= UpdateTimeCounter( giTimerAirRaidQuote, iTimeLeft );
+ timerDone |= UpdateTimeCounter( giTimerAirRaidDiveStarted, iTimeLeft );
+ timerDone |= UpdateTimeCounter( giTimerAirRaidUpdate, iTimeLeft );
+ timerDone |= UpdateTimeCounter( giTimerTeamTurnUpdate, iTimeLeft );
+
+ if ( gpCustomizableTimerCallback )
+ {
+ timerDone |= UpdateTimeCounter( giTimerCustomizable, iTimeLeft );
+ }
+
+#ifndef BOUNDS_CHECKER
+
+ // If mapscreen...
+ if( guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN )
+ {
+ // IN Mapscreen, loop through player's team.....
+ for ( gCNT = gTacticalStatus.Team[ gbPlayerNum ].bFirstID; gCNT <= gTacticalStatus.Team[ gbPlayerNum ].bLastID; gCNT++ )
+ {
+ gPSOLDIER = MercPtrs[ gCNT ];
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.PortraitFlashCounter, iTimeLeft );
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.PanelAnimateCounter, iTimeLeft );
+ }
+ }
+ else
+ {
+ // Set update flags for soldiers
+ ////////////////////////////
+ for ( gCNT = 0; gCNT < guiNumMercSlots; gCNT++ )
+ {
+ gPSOLDIER = MercSlots[ gCNT ];
+
+ if ( gPSOLDIER != NULL )
+ {
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.UpdateCounter, iTimeLeft );
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.DamageCounter, iTimeLeft );
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.ReloadCounter, iTimeLeft );
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.FlashSelCounter, iTimeLeft );
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.BlinkSelCounter, iTimeLeft );
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.PortraitFlashCounter, iTimeLeft );
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.AICounter, iTimeLeft );
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.FadeCounter, iTimeLeft );
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.NextTileCounter, iTimeLeft );
+ timerDone |= UpdateTimeCounter( gPSOLDIER->timeCounters.PanelAnimateCounter, iTimeLeft );
+#ifdef JA2UB
+ timerDone |= UpdateTimeCounter( gPSOLDIER->GetupFromJA25StartCounter, iTimeLeft );
+#endif
+ }
+ }
+ }
+#endif
}
}
-#endif
- }
-
+ if (timerDone)
+ SetEvent(ghNotifyThreadEvent);
fInFunction = FALSE;
}
-
}
-
-
-BOOLEAN InitializeJA2Clock(void)
+static UINT32 MIN_TIMER(UINT32 timer, UINT32 other)
{
+ UINT32 value = TIME_MS_TO_US(timer);
+ return ( value && value < other ? value : other );
+}
+// Returns the smallest time interval for a counter currently in use
+UINT32 GetNextCounterDoneTime(void)
+{
+ QueryPerformanceCounter(&gliPerfCount);
+ INT32 time = (INT32)(((gliPerfCountNext.QuadPart - gliPerfCount.QuadPart) * FREQUENCY_CONST) / gliPerfFreq.QuadPart);
+ return (UINT32)((time > 0) ? time : 0);
+}
+
+// Function to test if there are any outstanding timers. Used in fast forward routines
+BOOLEAN IsTimerActive(void)
+{
+ return GetNextCounterDoneTime() <= FASTFORWARDTIMESLICE ? TRUE : FALSE;
+}
+
+DWORD WINAPI JA2ClockThread( LPVOID lpParam )
+{
+ __try
+ {
+ for(;;)
+ {
+ TimeProc(0, 0, 0, 0, 0);
+
+ DWORD dwResult = WaitForSingleObject(ghClockThreadShutdown, 0);
+ if (dwResult == WAIT_OBJECT_0 || dwResult == WAIT_ABANDONED)
+ break;
+ YieldProcessor();
+
+ // Sleep for a couple of milliseconds if not in fast forward mode
+ if (!IsFastForwardMode())
+ Sleep( TIME_US_TO_MS( GetNextCounterDoneTime() ) );
+ }
+ }
+ __except( EXCEPTION_EXECUTE_HANDLER )
+ {
+ // Unhandled exception just exit
+ }
+ return 0L;
+}
+
+DWORD WINAPI JA2NotifyThread( LPVOID lpParam )
+{
+ HANDLE waitHandles[] = {ghClockThreadShutdown, ghNotifyThreadEvent};
+ for(;;)
+ {
+ DWORD dwResult = WaitForSingleObject(ghClockThreadShutdown, 0);
+ if (dwResult == WAIT_OBJECT_0 || dwResult == WAIT_ABANDONED)
+ break;
+
+ DWORD waitTime = (!IsFastForwardMode()) ? max(TIME_US_TO_MS(MIN_NOTIFY_TIME), TIME_US_TO_MS( GetNextCounterDoneTime() ) ) : 0;
+ dwResult = WaitForMultipleObjectsEx(_countof(waitHandles), waitHandles, FALSE, waitTime, FALSE);
+ if (dwResult == WAIT_OBJECT_0)
+ break;
+ if (dwResult >= WAIT_ABANDONED_0 && dwResult <= (WAIT_ABANDONED_0 + _countof(waitHandles)))
+ break;
+ if ( dwResult == WAIT_FAILED || dwResult == WAIT_TIMEOUT || (dwResult-WAIT_OBJECT_0) == 1)
+ {
+ if (HasTimerNotifyCallbacks())
+ {
+ BroadcastTimerNotify(-1);
+ }
+ }
+ else
+ {
+ // unexpected failure
+ }
+ }
+ SetEvent(ghNotifyThreadShutdownComplete);
+ return 0L;
+}
+
+BOOLEAN InitializeJA2Clock()
+{
#ifdef CALLBACKTIMER
-
-
MMRESULT mmResult;
- TIMECAPS tc;
INT32 cnt;
// Init timer delays
@@ -204,21 +347,48 @@ BOOLEAN InitializeJA2Clock(void)
// First get timer resolutions
- mmResult = timeGetDevCaps( &tc, sizeof( tc ) );
+ mmResult = timeGetDevCaps( >c, sizeof( gtc ) );
if ( mmResult != TIMERR_NOERROR )
{
DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not get timer properties");
}
- // Set timer at lowest resolution. Could use middle of lowest/highest, we'll see how this performs first
- gTimerID = timeSetEvent( BASETIMESLICE, BASETIMESLICE, TimeProc, (DWORD)0, TIME_PERIODIC );
-
- if ( !gTimerID )
+ if ( !QueryPerformanceFrequency(&gliPerfFreq) )
{
- DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not create timer callback");
+ DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not get performance frequency");
+ }
+ if ( !QueryPerformanceCounter(&gliPerfCount) )
+ {
+ DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not get performance frequency");
}
+ InitializeCriticalSection(&gcsNotifyLock);
+
+ if (IsHiSpeedClockMode())
+ {
+ ghClockThreadShutdown = CreateEvent(NULL, TRUE, FALSE, NULL);
+ ghNotifyThreadEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ ghNotifyThreadShutdownComplete = CreateEvent(NULL, TRUE, FALSE, NULL);
+ ghClockThread = CreateThread(
+ NULL, // default security attributes
+ 0, // use default stack size
+ JA2ClockThread, // thread function
+ NULL, // argument to thread function
+ 0, // use default creation flags
+ &gdwClockThreadId);// returns the thread identifier
+ ghNotifyThread = CreateThread(
+ NULL, // default security attributes
+ 0, // use default stack size
+ JA2NotifyThread, // thread function
+ NULL, // argument to thread function
+ 0, // use default creation flags
+ &gdwNotifyThreadId);// returns the thread identifier
+ }
+ else
+ {
+ UpdateTimer();
+ }
#endif
return TRUE;
@@ -226,24 +396,41 @@ BOOLEAN InitializeJA2Clock(void)
void ShutdownJA2Clock(void)
{
- // Make sure we kill the timer
+ if (IsHiSpeedClockMode())
+ {
+ SetEvent(ghClockThreadShutdown);
+ WaitForSingleObject(ghNotifyThreadShutdownComplete, 2000);
+ HANDLE waitHandles[] = {ghClockThread, ghNotifyThread};
+ WaitForMultipleObjects(_countof(waitHandles), waitHandles, TRUE, 1000);
+ CloseHandle(ghClockThreadShutdown);
+ CloseHandle(ghClockThread);
+ CloseHandle(ghNotifyThreadEvent);
+ CloseHandle(ghNotifyThread);
+ // During ungraceful shutdowns notify lock may be in use in notify thread
+ if (TryEnterCriticalSection(&gcsNotifyLock))
+ {
+ LeaveCriticalSection(&gcsNotifyLock);
+ DeleteCriticalSection(&gcsNotifyLock);
+ }
+ }
+ else
+ {
+ // Make sure we kill the timer
#ifdef CALLBACKTIMER
-
- timeKillEvent( gTimerID );
-
+ timeKillEvent( gTimerID );
#endif
-
+ }
}
+
UINT32 InitializeJA2TimerCallback( UINT32 uiDelay, LPTIMECALLBACK TimerProc, UINT32 uiUser )
{
MMRESULT mmResult;
- TIMECAPS tc;
MMRESULT TimerID;
// First get timer resolutions
- mmResult = timeGetDevCaps( &tc, sizeof( tc ) );
+ mmResult = timeGetDevCaps( >c, sizeof( gtc ) );
if ( mmResult != TIMERR_NOERROR )
{
@@ -272,10 +459,10 @@ UINT32 InitializeJA2TimerID( UINT32 uiDelay, UINT32 uiCallbackID, UINT32 uiUser
{
switch( uiCallbackID )
{
- case ITEM_LOCATOR_CALLBACK:
+ case ITEM_LOCATOR_CALLBACK:
- return( InitializeJA2TimerCallback( uiDelay, FlashItem, uiUser ) );
- break;
+ return( InitializeJA2TimerCallback( uiDelay, FlashItem, uiUser ) );
+ break;
}
@@ -359,3 +546,237 @@ void SetTileAnimCounter( INT32 iTime )
{
giTimerIntervals[ ANIMATETILES ] = iTime;
}
+void SetFastForwardPeriod(DOUBLE value)
+{
+ giFastForwardPeriod = (UINT32)(value);
+ if (giFastForwardPeriod <= 1)
+ giFastForwardPeriod = 1;
+}
+
+void SetFastForwardKey(INT32 key)
+{
+ giFastForwardKey = key;
+}
+
+BOOLEAN IsFastForwardKeyPressed()
+{
+ // WANNE: In a multiplayer game it is not allowed for the "pure" client to do fast forward
+ // Only the server is allowed to do, because the AI is generated on the server
+ if (is_networked)
+ {
+ if (!is_server) // It is not allowed when we are not the server
+ return false;
+ else if (gTacticalStatus.ubCurrentTeam != 1) // It is not allowed, when it is not the enemy turn!
+ return false;
+ }
+
+ return giFastForwardKey && IsKeyPressed(giFastForwardKey);
+}
+
+void SetFastForwardMode(BOOLEAN enable)
+{
+ giFastForwardMode = enable;
+ UpdateTimer();
+}
+
+BOOLEAN IsFastForwardMode()
+{
+ return giFastForwardMode || IsFastForwardKeyPressed();
+}
+
+LONGLONG GetJA2Microseconds()
+{
+ return gliPerfCount.QuadPart * FREQUENCY_CONST / gliPerfFreq.QuadPart;
+}
+
+void AddTimerNotifyCallback( TIMER_NOTIFY_CALLBACK callback, PTR state )
+{
+ EnterCriticalSection(&gcsNotifyLock);
+ BOOL addItem = TRUE;
+ for (TIMER_NOTIFY_ITEM_ITERATOR itr = glNotifyCallbacks.begin(); itr != glNotifyCallbacks.end(); ++itr) {
+ if ( callback == (*itr).callback && state == (*itr).state ){
+ addItem = FALSE;
+ break;
+ }
+ }
+ if (addItem)
+ {
+ TIMER_NOTIFY_ITEM item;
+ item.callback = callback;
+ item.state = state;
+ glNotifyCallbacks.push_back(item);
+ }
+ LeaveCriticalSection(&gcsNotifyLock);
+}
+
+void RemoveTimerNotifyCallback( TIMER_NOTIFY_CALLBACK callback, PTR state )
+{
+ EnterCriticalSection(&gcsNotifyLock);
+ for ( TIMER_NOTIFY_ITEM_ITERATOR itr = glNotifyCallbacks.begin(); itr != glNotifyCallbacks.end(); )
+ {
+ if ( callback == (*itr).callback && state == (*itr).state )
+ itr = glNotifyCallbacks.erase(itr);
+ else
+ ++itr;
+ }
+ LeaveCriticalSection(&gcsNotifyLock);
+}
+
+void ClearTimerNotifyCallbacks()
+{
+ // If we cannot get the lock it is likely due to exception while handling notification and we are shutting down
+ if ( TryEnterCriticalSection(&gcsNotifyLock) )
+ {
+ glNotifyCallbacks.clear();
+ LeaveCriticalSection(&gcsNotifyLock);
+ }
+}
+
+static bool HasTimerNotifyCallbacks( )
+{
+ return !glNotifyCallbacks.empty();
+}
+
+
+// Call timer notify routine
+// Separate the callback notifies with normal try/catch
+// as SEH __try/__except are incompatible with C++ exceptions
+static void InnerTimerNotify(INT32 timer)
+{
+ try
+ {
+ for (TIMER_NOTIFY_ITEM_ITERATOR itr = glNotifyCallbacks.begin(); itr != glNotifyCallbacks.end(); ++itr)
+ {
+ if ( NULL != (*itr).callback)
+ (*itr).callback( timer, (*itr).state );
+ }
+ }
+ catch (...) {}
+}
+static void BroadcastTimerNotify(INT32 timer)
+{
+ EnterCriticalSection(&gcsNotifyLock);
+ __try
+ {
+ __try { InnerTimerNotify(timer); }
+ __except( EXCEPTION_EXECUTE_HANDLER )
+ { /* Not sure. exit? */ }
+ }
+ __finally
+ {
+ LeaveCriticalSection(&gcsNotifyLock);
+ }
+}
+
+BOOLEAN UpdateTimeCounter( INT32 &counter, INT32 &iTimeLeft)
+{
+ if (counter == 0) {
+ return FALSE;
+ } else if ( ( counter - BASETIMESLICE ) < 0 ) {
+ counter = 0;
+ return TRUE;
+ } else {
+ counter -= BASETIMESLICE;
+ if ( counter < iTimeLeft )
+ iTimeLeft = counter;
+ return FALSE;
+ }
+ return FALSE;
+}
+
+BOOLEAN UpdateCounter( INT32 counterIdx, INT32 &iTimeLeft )
+{
+ INT32& counter = giTimerCounters[ counterIdx ];
+ return UpdateTimeCounter(counter, iTimeLeft);
+}
+
+BOOLEAN UpdateCounter( INT32 counterIdx )
+{
+ INT32 iDummy = 0;
+ return UpdateCounter(counterIdx, iDummy);
+}
+
+void ResetCounter(INT32 counterIdx)
+{
+ giTimerCounters[ counterIdx ] = giTimerIntervals[ counterIdx ];
+}
+
+BOOLEAN CounterDone(INT32 counterIdx)
+{
+ return ( giTimerCounters[ counterIdx ] == 0 ) ? TRUE : FALSE;
+}
+
+void ResetTimerCounter(INT32 &timer, INT32 value)
+{
+ timer = value;
+}
+
+BOOLEAN TimeCounterDone(INT32 timer)
+{
+ return ( timer == 0 ) ? TRUE : FALSE;
+}
+
+void ZeroTimeCounter(INT32& timer)
+{
+ timer = 0;
+}
+
+BOOLEAN IsJA2TimerThread()
+{
+ return (GetCurrentThreadId() == gdwClockThreadId);
+}
+
+#ifndef GetJA2Clock
+UINT32 GetJA2Clock()
+{
+ return guiBaseJA2Clock;
+}
+#endif
+
+#ifndef GetJA2NoPauseClock
+UINT32 GetJA2NoPauseClock()
+{
+ return guiBaseJA2NoPauseClock;
+}
+#endif
+
+void SetHiSpeedClockMode(BOOLEAN enable)
+{
+ gfHispeedClockMode = enable;
+}
+
+BOOLEAN IsHiSpeedClockMode()
+{
+ return gfHispeedClockMode;
+}
+
+void SetNotifyFrequencyKey(INT32 value)
+{
+ MIN_NOTIFY_TIME = value;
+}
+
+void SetClockSpeedPercent(FLOAT value)
+{
+ gfClockSpeedPercent = value;
+ UPDATETIMESLICE = (UINT32)((FLOAT)TIME_MS_TO_US(BASETIMESLICE) * 100.0f / value);
+ UpdateTimer();
+}
+
+void UpdateTimer()
+{
+ // Set timer at lowest resolution. Could use middle of lowest/highest, we'll see how this performs first
+ if (!IsHiSpeedClockMode())
+ {
+ UINT uiTimeSlice = giFastForwardMode ? gtc.wPeriodMin : max(gtc.wPeriodMin, TIME_US_TO_MS(UPDATETIMESLICE));
+ if (uiTimeSlice != guiTimeSlice)
+ {
+ guiTimeSlice = uiTimeSlice;
+ if (gTimerID != 0) timeKillEvent(gTimerID);
+ gTimerID = timeSetEvent( uiTimeSlice, uiTimeSlice, TimeProc, (DWORD)0, TIME_PERIODIC );
+ if ( !gTimerID )
+ {
+ DebugMsg( TOPIC_JA2, DBG_LEVEL_3, "Could not create timer callback");
+ }
+ }
+ }
+}
diff --git a/Utils/Timer Control.h b/Utils/Timer Control.h
index 816d9d75..2cd89303 100644
--- a/Utils/Timer Control.h
+++ b/Utils/Timer Control.h
@@ -54,9 +54,6 @@ enum
NUMTIMERS
};
-// Base resultion of callback timer
-#define BASETIMESLICE 10
-
// TIMER INTERVALS
extern INT32 giTimerIntervals[ NUMTIMERS ];
// TIMER COUNTERS
@@ -73,6 +70,7 @@ BOOLEAN InitializeJA2Clock( void );
void ShutdownJA2Clock( void );
#define GetJA2Clock() guiBaseJA2Clock
+#define GetJA2NoPauseClock() guiBaseJA2NoPauseClock
UINT32 GetPauseJA2Clock( );
@@ -84,47 +82,49 @@ void PauseTime( BOOLEAN fPaused );
void SetCustomizableTimerCallbackAndDelay( INT32 iDelay, CUSTOMIZABLE_TIMER_CALLBACK pCallback, BOOLEAN fReplace );
void CheckCustomizableTimer( void );
+void SetFastForwardPeriod(DOUBLE value);
+void SetFastForwardKey(INT32 key);
+BOOLEAN IsFastForwardKeyPressed();
+void SetFastForwardMode(BOOLEAN enable);
+BOOLEAN IsFastForwardMode();
+INT32 GetFastForwardLoopCount();
+void SetFastForwardLoopCount(INT32 value);
+
+void SetNotifyFrequencyKey(INT32 value);
+void SetClockSpeedPercent(FLOAT value);
+
+BOOLEAN IsTimerActive();
+BOOLEAN IsJA2TimerThread();
+
+BOOLEAN IsHiSpeedClockMode();
+void SetHiSpeedClockMode(BOOLEAN enable);
+
//Don't modify this value
extern UINT32 guiBaseJA2Clock;
extern UINT32 guiBaseJA2NoPauseClock;
extern CUSTOMIZABLE_TIMER_CALLBACK gpCustomizableTimerCallback;
-// MACROS
-// CHeck if new counter < 0 | set to 0 | Decrement
+typedef void (*TIMER_NOTIFY_CALLBACK) ( INT32 timer, PTR state );
+void AddTimerNotifyCallback( TIMER_NOTIFY_CALLBACK callback, PTR state );
+void RemoveTimerNotifyCallback( TIMER_NOTIFY_CALLBACK callback, PTR state );
+void ClearTimerNotifyCallbacks();
-#ifdef CALLBACKTIMER
+BOOLEAN UpdateCounter(INT32 iTimer);
+void ResetCounter(INT32 iTimer);
+BOOLEAN CounterDone(INT32 iTimer);
+void ResetTimerCounter(INT32 &timer, INT32 value);
+BOOLEAN TimeCounterDone(INT32 timer);
+void ZeroTimeCounter(INT32& timer);
-#define UPDATECOUNTER( c ) ( ( giTimerCounters[ c ] - BASETIMESLICE ) < 0 ) ? ( giTimerCounters[ c ] = 0 ) : ( giTimerCounters[ c ] -= BASETIMESLICE )
-#define RESETCOUNTER( c ) ( giTimerCounters[ c ] = giTimerIntervals[ c ] )
-#define COUNTERDONE( c ) ( giTimerCounters[ c ] == 0 ) ? TRUE : FALSE
-
-#define UPDATETIMECOUNTER( c ) ( ( c - BASETIMESLICE ) < 0 ) ? ( c = 0 ) : ( c -= BASETIMESLICE )
-#define RESETTIMECOUNTER( c, d ) ( c = d )
-
-#ifdef BOUNDS_CHECKER
- #define TIMECOUNTERDONE( c, d ) ( TRUE )
-#else
- #define TIMECOUNTERDONE( c, d ) ( c == 0 ) ? TRUE : FALSE
-#endif
-
-#define SYNCTIMECOUNTER( )
-#define ZEROTIMECOUNTER( c ) ( c = 0 )
-
-#else
-
-#define UPDATECOUNTER( c )
-#define RESETCOUNTER( c ) ( giTimerCounters[ c ] = giClockTimer )
-#define COUNTERDONE( c ) ( ( ( giClockTimer = GetJA2Clock() ) - giTimerCounters[ c ] ) > giTimerIntervals[ c ] ) ? TRUE : FALSE
-
-#define UPDATETIMECOUNTER( c )
-#define RESETTIMECOUNTER( c, d ) ( c = giClockTimer )
-#define TIMECOUNTERDONE( c, d ) ( giClockTimer - c > d ) ? TRUE : FALSE
-#define SYNCTIMECOUNTER( ) ( giClockTimer = GetJA2Clock() )
-
-#endif
+#define UPDATECOUNTER( c ) UpdateCounter(c)
+#define RESETCOUNTER( c ) ResetCounter(c)
+#define COUNTERDONE( c ) CounterDone(c)
+#define UPDATETIMECOUNTER( c ) UpdateTimeCounter(c)
+#define RESETTIMECOUNTER( c, d ) ResetTimerCounter(c, d)
+#define TIMECOUNTERDONE(c, d) TimeCounterDone(c)
+#define SYNCTIMECOUNTER( )
+#define ZEROTIMECOUNTER(c) ZeroTimeCounter(c)
void SetTileAnimCounter( INT32 iTime );
-
-
#endif
\ No newline at end of file
diff --git a/Utils/Utils All.h b/Utils/Utils All.h
index af7425af..a8ed4673 100644
--- a/Utils/Utils All.h
+++ b/Utils/Utils All.h
@@ -103,6 +103,7 @@
#include "vobject.h"
#include "overhead types.h"
#include "tactical save.h"
+#include "KeyMap.h"
//#include
//#include
//#include
diff --git a/Utils/Utils_VS2005.vcproj b/Utils/Utils_VS2005.vcproj
index 46f213ff..e6395ae3 100644
--- a/Utils/Utils_VS2005.vcproj
+++ b/Utils/Utils_VS2005.vcproj
@@ -42,10 +42,11 @@
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
Optimization="0"
AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0500"
MinimalRebuild="true"
+ ExceptionHandling="1"
BasicRuntimeChecks="3"
- RuntimeLibrary="1"
+ RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
WarningLevel="3"
@@ -106,7 +107,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0500"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
@@ -167,7 +168,7 @@
Name="VCCLCompilerTool"
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0500"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
@@ -229,7 +230,7 @@
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
Optimization="0"
AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
+ PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_WIN32_WINNT=0x0500"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -294,7 +295,7 @@
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
Optimization="0"
AdditionalIncludeDirectories=""
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_WIN32_WINNT=0x0500"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
@@ -426,6 +427,10 @@
RelativePath=".\INIReader.h"
>
+
+
@@ -664,6 +669,10 @@
RelativePath=".\INIReader.cpp"
>
+
+
diff --git a/Utils/Utils_VS2008.vcproj b/Utils/Utils_VS2008.vcproj
index fc2e0950..b7ccb371 100644
--- a/Utils/Utils_VS2008.vcproj
+++ b/Utils/Utils_VS2008.vcproj
@@ -1,7 +1,7 @@
+
+
@@ -666,6 +669,10 @@
RelativePath="INIReader.cpp"
>
+
+
diff --git a/Utils/Utils_VS2010.vcxproj b/Utils/Utils_VS2010.vcxproj
index dcb77ea0..5954c327 100644
--- a/Utils/Utils_VS2010.vcxproj
+++ b/Utils/Utils_VS2010.vcxproj
@@ -37,6 +37,7 @@
+
@@ -87,6 +88,7 @@
+
@@ -197,24 +199,24 @@
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
diff --git a/Utils/Utils_VS2010.vcxproj.filters b/Utils/Utils_VS2010.vcxproj.filters
index dafca07f..6b74e20b 100644
--- a/Utils/Utils_VS2010.vcxproj.filters
+++ b/Utils/Utils_VS2010.vcxproj.filters
@@ -156,6 +156,9 @@
Header Files
+
+ Header Files
+
@@ -332,5 +335,8 @@
Source Files
+
+ Source Files
+
\ No newline at end of file
diff --git a/Utils/XML_Items.cpp b/Utils/XML_Items.cpp
index b818f2ce..b3886247 100644
--- a/Utils/XML_Items.cpp
+++ b/Utils/XML_Items.cpp
@@ -215,7 +215,6 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "Flare") == 0 ||
strcmp(name, "MetalDetector") == 0 ||
strcmp(name, "FingerPrintID") == 0 ||
- strcmp(name, "AmmoCrate") == 0 ||
strcmp(name, "Cannon") == 0 ||
strcmp(name, "RocketRifle") == 0 ||
strcmp(name, "MedicalKit") == 0 ||
@@ -251,6 +250,12 @@ itemStartElementHandle(void *userData, const XML_Char *name, const XML_Char **at
strcmp(name, "RecoilModifierX") == 0 ||
strcmp(name, "RecoilModifierY") == 0 ||
strcmp(name, "PercentRecoilModifier") == 0 ||
+ strcmp(name, "barrel") == 0 ||
+ strcmp(name, "usOverheatingCooldownFactor") == 0 ||
+ strcmp(name, "overheatTemperatureModificator") == 0 ||
+ strcmp(name, "overheatCooldownModificator") == 0 ||
+ strcmp(name, "overheatJamThresholdModificator") == 0 ||
+ strcmp(name, "overheatDamageThresholdModificator") == 0 ||
strcmp(name, "fFlags") == 0 ))
{
@@ -563,7 +568,7 @@ itemEndElementHandle(void *userData, const XML_Char *name)
else if(strcmp(name, "ItemSize") == 0)
{
pData->curElement = ELEMENT;
- pData->curItem.ItemSize = (UINT8) atol(pData->szCharData);
+ pData->curItem.ItemSize = (UINT16) atol(pData->szCharData);
}
else if(strcmp(name, "usPrice") == 0)
{
@@ -1093,11 +1098,6 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
pData->curItem.fingerprintid = (BOOLEAN) atol(pData->szCharData);
}
- else if(strcmp(name, "AmmoCrate") == 0)
- {
- pData->curElement = ELEMENT;
- pData->curItem.ammocrate = (BOOLEAN) atol(pData->szCharData);
- }
else if(strcmp(name, "Rock") == 0)
{
pData->curElement = ELEMENT;
@@ -1246,6 +1246,38 @@ itemEndElementHandle(void *userData, const XML_Char *name)
pData->curElement = ELEMENT;
}
+ // Flugente FTW 1.2
+ else if(strcmp(name, "barrel") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curItem.barrel = (BOOLEAN) atol(pData->szCharData);
+ }
+ else if(strcmp(name, "usOverheatingCooldownFactor") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curItem.usOverheatingCooldownFactor = (FLOAT) atof(pData->szCharData);
+ }
+ else if(strcmp(name, "overheatTemperatureModificator") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curItem.overheatTemperatureModificator = (FLOAT) atof(pData->szCharData);
+ }
+ else if(strcmp(name, "overheatCooldownModificator") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curItem.overheatCooldownModificator = (FLOAT) atof(pData->szCharData);
+ }
+ else if(strcmp(name, "overheatJamThresholdModificator") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curItem.overheatJamThresholdModificator = (FLOAT) atof(pData->szCharData);
+ }
+ else if(strcmp(name, "overheatDamageThresholdModificator") == 0)
+ {
+ pData->curElement = ELEMENT;
+ pData->curItem.overheatDamageThresholdModificator = (FLOAT) atof(pData->szCharData);
+ }
+
pData->maxReadDepth--;
}
@@ -1790,7 +1822,6 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].containsliquid );
FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].metaldetector );
FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].fingerprintid );
- FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].ammocrate );
// HEADROCK HAM 4: Print out new values
FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].scopemagfactor );
@@ -1843,6 +1874,15 @@ BOOLEAN WriteItemStats()
FilePrintf(hFile,"\t\t\t%d\r\n", Item[cnt].aimlevelsmodifier[2] );
FilePrintf(hFile,"\t\t\r\n");
+ // Flugente FTW 1.2
+ FilePrintf(hFile,"\t\t%d\r\n", Item[cnt].barrel );
+ FilePrintf(hFile,"\t\t%4.2f\r\n", Item[cnt].usOverheatingCooldownFactor );
+ FilePrintf(hFile,"\t\t%4.2f\r\n", Item[cnt].overheatTemperatureModificator );
+ FilePrintf(hFile,"\t\t%4.2f\r\n", Item[cnt].overheatCooldownModificator );
+ FilePrintf(hFile,"\t\t%4.2f\r\n", Item[cnt].overheatJamThresholdModificator );
+ FilePrintf(hFile,"\t\t%4.2f\r\n", Item[cnt].overheatDamageThresholdModificator );
+
+
FilePrintf(hFile,"\t\r\n");
}
FilePrintf(hFile,"\r\n");
diff --git a/Utils/_ChineseText.cpp b/Utils/_ChineseText.cpp
index 3e4e1b51..5c6609ee 100644
--- a/Utils/_ChineseText.cpp
+++ b/Utils/_ChineseText.cpp
@@ -254,13 +254,13 @@ STR16 pEncyclopediaShortInventoryText[] =
L"枪械",
L"弹药",
L"携行具",
- L"附件",
+ L"杂项",
L"全部", //5
L"枪械",
L"弹药",
L"携行具",
- L"附件",
+ L"杂项",
};
STR16 BoxFilter[] =
@@ -290,7 +290,7 @@ STR16 BoxFilter[] =
L"枪械",
L"护甲",
L"携行具",
- L"附件", //20
+ L"杂项", //20
// Armour
L"头盔",
@@ -308,7 +308,7 @@ STR16 BoxFilter[] =
L"工具",
L"通讯等",
L"携行具",
- L"附件", //34
+ L"杂项", //34
};
//-----------
@@ -2873,6 +2873,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"前往分区",
L"前往地图",
L"你不能从这边离开这个分区。",
+ L"You can't leave in turn based mode.", // TODO.Translate
L"%s太远了。",
L"不显示树冠",
L"显示树冠",
@@ -4400,9 +4401,9 @@ STR16 BobbyRFilter[] =
L"炸药", //"Bombs",
L"医疗用品", //"Med. Kits",
L"工具套装", //"Kits",
- L"通讯/夜视", //"Face Items",
+ L"头部装备", //"Face Items",
L"携行具", //"LBE Gear",
- L"附件/瞄准具", //"Misc.",
+ L"杂项", //"Misc.",
};
@@ -4451,7 +4452,8 @@ STR16 BobbyRText[] =
//Popup that tells the player that they can only order 10 items at a time
- L"靠! 我们这里的在线订单一次只接受10件物品的订购。如果你想要订购更多东西(我们希望如此),请接受我们的歉意,再开一份订单。",
+ L"靠! 我们这里的在线订单一次只接受" ,//First part
+ L"件物品的订购。如果你想要订购更多东西(我们希望如此),请接受我们的歉意,再开一份订单。",
// A popup that tells the user that they are trying to order more items then the store has in stock
@@ -5062,10 +5064,13 @@ STR16 zOptionsToggleText[] =
L"属性进度条", //L"Stat Progress Bars", // Show progress towards stat increase //ham3.6
L"替代战略地图颜色", // Change color scheme of Strategic Map
L"替代子弹图像", // Show alternate bullet graphics (tracers)
- L"开启新的瞄准系统(NCTH)", // use NCTH
+ //L"开启新的瞄准系统(NCTH)", // use NCTH
+ L"显示佣兵军衔", // shows mercs ranks
L"显示脸部装备图",
L"显示脸部装备图标",
L"禁止光标切换", // Disable Cursor Swap
+ L"自动加速敌军回合", // Automatic fast forward through AI turns
+ //L"武器过热",
L"--作弊模式选项--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"强制 Bobby Ray 送货", // force all pending Bobby Ray shipments
L"-----------------", // TOPTION_CHEAT_MODE_OPTIONS_END
@@ -5167,10 +5172,12 @@ STR16 zOptionsScreenHelpText[] =
L"打开时,显示各属性的增长进度。", // L"When ON, shows character progress towards gaining levels.", //ham3.6
L"打开时, 战略地图将会根据探索状态显示不同的着色。",
L"打开时, 当你射击时会显示间隔子弹图像。",
- L"打开时, 使用新命中率系统(NCTH)和光标。",
+ //L"打开时, 使用新命中率系统(NCTH)和光标。",
+ L"打开时,在战略界面的佣兵名旁显示军衔。",
L"打开时, 显示佣兵脸部装备图。",
L"打开时, 佣兵肖像右下角显示脸部装备图标",
- L"打开时,在交换位置和其它动作时光标不切换。键入 |x 可以快速切换。", // L"When ON, the cursor will not toggle between exchange position and other actions. Press |x to initiate quick exchange.",
+ L"打开时,在交换位置和其它动作时光标不切换。键入 |x 可以快速切换。",
+ //L"打开时,武器连续射击时温度逐渐升高引起过热。",
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"强制 Bobby Ray 出货",
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_END",
@@ -5268,6 +5275,12 @@ STR16 gzGIOScreenText[] =
L"6",
L"8",
L"10",
+ //L"Bobby Ray 快速出货", //L"Faster Bobby Ray Shipments",
+ L"战斗时取放物品消耗AP", //L"Inventory Manipulation Costs AP",
+ // TODO: Translate
+ L"新命中率系统(NCTH)", //L"New Chance to Hit System",
+ L"改进的中断系统(IIS)", //L"Improved Interrupt System",
+ L"武器过热", //L"Weapon Overheating",
};
STR16 gzMPJScreenText[] =
@@ -5585,6 +5598,9 @@ STR16 pMessageStrings[] =
L"AutoSaveGame%02d.sav", // 101
L"Auto%02d.sav", // 102
L"SaveGame%02d.sav", //103
+ // Lock / release mouse in windowed mode (window boundary)
+ L"鼠标已锁定,鼠标移动范围强制限制在游戏窗口内部区域。", // 104
+ L"鼠标已释放,鼠标移动范围不再受限于游戏窗口内部区域。", // 105
};
@@ -5650,7 +5666,7 @@ STR16 gzLaptopHelpText[] =
L"McGillicutty公墓",
L"联合花卉服务公司",
L"A.I.M指定保险代理人",
- //New Bookmarks // TODO.Translate
+ //New Bookmarks
L"",
L"百科全书",
L"简报室",
@@ -5964,7 +5980,7 @@ STR16 gzLateLocalizedString[] =
L"%s多打了%d发子弹!", //"%s fires %d more rounds than intended!",
L"%s多打了1发子弹!", //"%s fires %d more round than intended!",
- L"You need to close the item description box first!", // TODO.Translate
+ L"你得先关闭物品信息界面!",
};
// HEADROCK HAM 3.5: Added sector name
@@ -6069,7 +6085,8 @@ STR16 New113Message[] =
L"%s 命根子中弹,痛苦的倒下了!",// L"%s is hit to groin and falls down in pain!",
//////////////////////////////////////////////////////////////////////////////////////
L"注意: 敌人尸体被发现!!!",
- L"%s [%d rnds]\n%s %1.1f %s",
+ L"%s [%d rnds]\n%s %1.1f %s",
+ L"AP不够!需要%d,你只有%d。", //L"Insufficient AP Points! Cost %d, you have %d.",
};
STR16 New113HAMMessage[] =
@@ -6306,10 +6323,10 @@ STR16 MPClientMessage[] =
L"点击 '准备' 进入战术画面。",// L"Press 'Ready' to enter tactical screen.",
L"不能连接到服务器,因为你的版本 %S 和服务器端的版本 %S 不同。",
L"你击毙了一个敌人。",
- L"无法启动游戏,因为所有小队都一样。", //L"Cannot start the game, because all teams are the same.", // TODO.Translate
+ L"无法启动游戏,因为所有小队都一样。", //L"Cannot start the game, because all teams are the same.",
L"The server has choosen New Inventory (NIV), but your screen resolution does not support NIV.",
- // 70 // TODO.Translate
- L"Could not save received file '%S'",
+ // 70
+ L"Could not save received file '%S'", // TODO.Translate
L"%s's bomb was disarmed by %s",
L"You loose, what a shame", // All over red rover
L"Spectator mode disabled",
@@ -6319,7 +6336,7 @@ STR16 MPClientMessage[] =
L"Client failed to start. Terminating.",
L"Client disconnected and shutdown.",
L"Client is not running.",
- L"INFO: If the game is stuck (the opponents progress bar is not moving), notify the server to press ALT + E to give the turn back to you!", // TODO.Translate
+ L"INFO: If the game is stuck (the opponents progress bar is not moving), notify the server to press ALT + E to give the turn back to you!",
};
STR16 gszMPEdgesText[] =
@@ -6843,6 +6860,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]=
L"|侵|彻|力|(|穿|甲|弹|)",
L"|翻|搅|力|(|开|花|弹|)",
L"|爆|炸|力|(|炸|子|儿|)",
+ L"\n \nA multiplier to the bullet's heat.\n \nLower is better.", // TODO.Translate
};
STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
@@ -6850,6 +6868,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
L"\n \n即子弹穿透目标护甲的能力。\n \n该值大于1时,被子弹命中的护甲的防护值会成比例减少。\n \n反之,当该值小于1时,\n则增加了目标护甲的防护值。\n \n该数值越高越好。",
L"\n \n该值决定子弹打穿护甲击中身体时的伤害力\n加成。\n \n该值大于1时,子弹在穿过护甲后会增加伤害。\n \n当该值小于1时,子弹穿过护甲后会减少伤害。\n \n该数值越高越好。",
L"\n \n该值是子弹在击中目标前已经造成的潜在伤害的倍率。\n \n大于1的数值可以增加伤害,\n反之则减少伤害。\n \n该数值越高越好。",
+ L"\n \n子弹温度系数。\n \n该数值越低越好。",
};
STR16 szUDBGenExplosiveStatsTooltipText[]=
@@ -7006,6 +7025,14 @@ STR16 szUDBAdvStatsTooltipText[]=
L"|制|退|力|频|次",
L"|命|中|率|修|正",
L"|精|瞄|修|正",
+ L"|单|发|射|击|温|度",
+ L"|冷|却|参|数",
+ L"|卡|壳|阈|值",
+ L"|损|坏|阈|值",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|o|r", // TODO.Translate
+ L"|C|o|o|l|d|o|w|n |M|o|d|i|f|i|c|a|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
};
// Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular.
@@ -7059,6 +7086,14 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]=
L"\n \n这是射手在点射或者连发时,频繁评估\n制退力大小以应对后坐力的能力。\n \n较高的频率使连发的总体精度更高,此外,由于射手能\n正确制退后坐力,其长点射也更\n加准确。\n \n该数值越低越好。",
L"\n \n当安装于远程武器上时,该物品修正武器的命\n中率。\n \n命中率的提高使该武器在精瞄时更容易命中\n目标。\n \n该数值越高越好。",
L"\n \n当安装于远程武器上时,该物品修正武器的精\n瞄加成。\n \n精瞄加成的提高使该武器在精瞄时更容易命\n中远距离的目标。\n \n该数值越高越好。",
+ L"\n \nA single shot causes this much heat.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will jam more frequently.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will be damaged more easily.\n \nHigher is better.",
+ L"\n \nA gun's single shot temperature is\nincreased by this percentage.\n \nLower is better.",
+ L"\n \nA gun's cooldown factor is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.",
};
STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
@@ -7111,6 +7146,11 @@ STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
L"\n \n这是射手频繁估量制退力大小以应对后坐力的能力。\n \n如果武器缺乏点射和连发功能,则此能力无\n效。\n \n低修正值能提高连发的总体精度,此外,由于射手能\n正确制退后坐力,其长点射也更\n加准确。\n \n该数值越低越好。",
L"\n \n由于所装的附件,弹药或其内置特性,这件武\n器的命中率得到了修正。\n \n命中率的提高使该武器在精瞄时\n更容易命中目标。\n \n该数值越高越好。",
L"\n \n由于所装的附件,弹药或其内置特性,这件武\n器的精瞄加成得到了修正。\n \n精瞄加成的提高能够使该武器在精瞄时更容易命\n中远距离的目标。\n \n该数值越高越好。",
+ L"\n \n单发射击所造成的温度。\n所使用的子弹类型对本值有影响。",
+ L"\n \n每回合自动冷却所降低的温度值。",
+ L"\n \n当武器温度超过卡壳阈值时,\n卡壳将更容易发生。",
+ L"\n \n当武器温度超过损坏阈值时,\n武器将更容易损坏。",
+
};
// HEADROCK HAM 4: Text for the new CTH indicator.
@@ -7123,6 +7163,37 @@ STR16 gzNCTHlabels[]=
// HEADROCK HAM 4: End new UDB texts and tooltips
//////////////////////////////////////////////////////
+// Flugente FTW 1: Temperature-based text similar to HAM 4's condition-based text.
+STR16 gTemperatureDesc[] =
+{
+ L"当前温度为: ",
+ L"很低",
+ L"低",
+ L"中等",
+ L"高",
+ L"很高",
+ L"危险",
+ L"很危险",
+ L"致命",
+ L"未知",
+ L"."
+};
+
+
+CHAR16* ranks[] =
+{ L"", //ExpLevel 0
+ L"列兵 ", //L"Pvt. ", //ExpLevel 1
+ L"下士 ", //L"Pfc. ", //ExpLevel 2
+ L"中士 ", //L"Cpl. " //ExpLevel 3
+ L"上士 ", //L"Sgt. ", //ExpLevel 4
+ L"少尉 ", //L"Lt. ", //ExpLevel 5
+ L"中尉 ", //L"Cpt. ", //ExpLevel 6
+ L"上尉 ", //L"Maj. ", //ExpLevel 7
+ L"少校 ", //L"Lt.Col. ", //ExpLevel 8
+ L"上校 ", //L"Col. ", //ExpLevel 9
+ L"将军 " //L"Gen. " //ExpLevel 10
+};
+
STR16 gzNewLaptopMessages[]=
{
diff --git a/Utils/_DutchText.cpp b/Utils/_DutchText.cpp
index b95dc1a6..7a6d5487 100644
--- a/Utils/_DutchText.cpp
+++ b/Utils/_DutchText.cpp
@@ -2869,6 +2869,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Naar Sector", // L"Go to Sector",
L"Naar Landk.", // L"Go to Map",
L"Vanaf deze kant kun je de sector niet verlaten.", // L"You can't leave the sector from this side.",
+ L"You can't leave in turn based mode.", // TODO.Translate
L"%s is te ver weg.", // L"%s is too far away.",
L"Verwijder Boomtoppen", // L"Removing Treetops",
L"Tonen Boomtoppen", // L"Showing Treetops",
@@ -4450,7 +4451,8 @@ STR16 BobbyRText[] =
//Popup that tells the player that they can only order 10 items at a time
- L"Verdraaid! Dit on-line bestelformulier accepteert maar 10 items per keer. Als je meer wil bestellen (en dat hopen we), plaats dan afzonderlijke orders en accepteer onze excuses.",
+ L"Verdraaid! Dit on-line bestelformulier accepteert maar " ,//First part
+ L" items per keer. Als je meer wil bestellen (en dat hopen we), plaats dan afzonderlijke orders en accepteer onze excuses.",
// A popup that tells the user that they are trying to order more items then the store has in stock
@@ -5060,10 +5062,13 @@ STR16 zOptionsToggleText[] =
L"Stat Progress Bars", // Show progress towards stat increase // TODO.Translate
L"Alternate Strategy-Map Colors", // Change color scheme of Strategic Map
L"Alternate bullet graphics", // Show alternate bullet graphics (tracers) // TODO.Translate
- L"Activate New CTH system", // use NCTH
+ //L"Activate New CTH system", // use NCTH
+ L"Show Merc Ranks", // shows mercs ranks // TODO.Translate
L"Show Face gear graphics", // TODO.Translate
L"Show Face gear icons",
- L"Disable Cursor Swap", // Disable Cursor Swap // TODO.Translate
+ L"Uit te schakelen Cursor Swap", // Disable Cursor Swap
+ L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
+ //L"Weapons Overheating", // TODO.Translate
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments
L"-----------------", // TOPTION_CHEAT_MODE_OPTIONS_END
@@ -5165,10 +5170,13 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, shows character progress towards gaining levels.", // TODO.Translate
L"When ON, the Strategic Map will be colored differently based on exploration.",
L"When ON, alternate bullet graphics will be shown when you shoot.", // TODO.Translate
- L"When ON, New CTH system and cursor is used.",
+ //L"When ON, New CTH system and cursor is used.",
+ L"When ON, ranks will be displayed before merc names in the strategic view.", // TODO.Translate
L"When ON, you will see the equipped face gear on the merc portraits.", // TODO.Translate
L"When ON, you will see icons for the equipped face gear on the merc portraits in the lower right corner.",
- L"When ON, the cursor will not toggle between exchange position and other actions. Press |x to initiate quick exchange.", // TODO.Translate
+ L"Wanneer ingeschakeld, zal de cursor niet te schakelen tussen uitwisseling positie en andere acties. Druk op |x om snelle uitwisseling te starten.",
+ L"When ON, AI turns will be much faster.", // TODO.Translate
+ //L"When ON, weapons can be overheated when firing.", // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Force all pending Bobby Ray shipments",
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_END",
@@ -5262,11 +5270,18 @@ STR16 gzGIOScreenText[] =
L"New / Old",
L"New / New",
+ // TODO.Translate
// Squad Size
L"Max. Squad Size",
L"6",
L"8",
L"10",
+ //L"Faster Bobby Ray Shipments",
+ L"Inventory Manipulation Costs AP",
+
+ L"New Chance to Hit System",
+ L"Improved Interrupt System",
+ L"Weapon Overheating",
};
STR16 gzMPJScreenText[] =
@@ -5589,6 +5604,9 @@ STR16 pMessageStrings[] =
L"AutoSaveGame%02d.sav", // 101
L"Auto%02d.sav", // 102
L"SaveGame%02d.sav", //103
+ // Lock / release mouse in windowed mode (window boundary) // TODO.Translate
+ L"Locking mouse cursor to stay within window boundary.", // 104
+ L"Releasing mouse cursor to move outside window boundary.", // 105
};
@@ -6069,6 +6087,7 @@ STR16 New113Message[] =
//////////////////////////////////////////////////////////////////////////////////////
L"Warning: enemy corpse found!!!",
L"%s [%d rnds]\n%s %1.1f %s",
+ L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
};
// TODO.Translate
@@ -6836,6 +6855,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]=
L"|A|r|m|o|r |P|i|e|r|c|i|n|g",
L"|B|u|l|l|e|t |T|u|m|b|l|e",
L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate
};
STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
@@ -6843,6 +6863,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
L"\n \nThis is the bullet's ability to penetrate\na target's armor.\n \nWhen above 1.0, the bullet proportionally\nreduces the Protection value of any\narmor it hits.\n \nWhen below 1.0, the bullet increases the\nprotection value of the armor instead.\n \nHigher is better.",
L"\n \nDetermines a proportional increase of damage\npotential once the bullet gets through the\ntarget's armor and hits the bodypart behind it.\n \nWhen above 1.0, the bullet's damage\nincreases after penetrating the armor.\n \nWhen below 1.0, the bullet's damage\npotential decreases after passing through armor.\n \nHigher is better.",
L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.",
+ L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate
};
STR16 szUDBGenExplosiveStatsTooltipText[]=
@@ -6999,6 +7020,14 @@ STR16 szUDBAdvStatsTooltipText[]=
L"|C|o|u|n|t|e|r|-|F|o|r|c|e |F|r|e|q|u|e|n|c|y",
L"|T|o|-|H|i|t |B|o|n|u|s",
L"|A|i|m |B|o|n|u|s",
+ L"|S|i|n|g|l|e |S|h|o|t |T|e|m|p|e|r|a|t|u|r|e", // TODO.Translate
+ L"|C|o|o|l|d|o|w|n |F|a|c|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|o|r",
+ L"|C|o|o|l|d|o|w|n |M|o|d|i|f|i|c|a|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
};
// Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular.
@@ -7052,6 +7081,14 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil, during Burst\nor Autofire volleys.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's CTH value.\n \nIncreased CTH allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's Aim Bonus.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will jam more frequently.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will be damaged more easily.\n \nHigher is better.",
+ L"\n \nA gun's single shot temperature is\nincreased by this percentage.\n \nLower is better.",
+ L"\n \nA gun's cooldown factor is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.",
};
STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
@@ -7104,6 +7141,10 @@ STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil.\n \nNaturally, this has no effect if the weapon lacks\nboth Burst and Auto-Fire modes.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nThis weapon's to-hit is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased To-Hit allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nThis weapon's Aim Bonus is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nThe type of ammunition can affect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\nWeapon attachments can affect this.\n \nHigher is better.",
+ L"\n \nIf a gun's temperature is above this,\nit will jam more frequently.",
+ L"\n \nIf a gun's temperature is above this,\nit will be damaged more easily.",
};
// HEADROCK HAM 4: Text for the new CTH indicator.
@@ -7116,6 +7157,38 @@ STR16 gzNCTHlabels[]=
// HEADROCK HAM 4: End new UDB texts and tooltips
//////////////////////////////////////////////////////
+// Flugente FTW 1: Temperature-based text similar to HAM 4's condition-based text.
+STR16 gTemperatureDesc[] = // TODO.Translate
+{
+ L"Temperature is ",
+ L"very low",
+ L"low",
+ L"medium",
+ L"high",
+ L"very high",
+ L"dangerous",
+ L"CRITICAL",
+ L"DRAMATIC",
+ L"unknown",
+ L"."
+};
+
+
+// TODO.Translate
+CHAR16* ranks[] =
+{ L"", //ExpLevel 0
+ L"Pvt. ", //ExpLevel 1
+ L"Pfc. ", //ExpLevel 2
+ L"Cpl. ", //ExpLevel 3
+ L"Sgt. ", //ExpLevel 4
+ L"Lt. ", //ExpLevel 5
+ L"Cpt. ", //ExpLevel 6
+ L"Maj. ", //ExpLevel 7
+ L"Lt.Col. ", //ExpLevel 8
+ L"Col. ", //ExpLevel 9
+ L"Gen. " //ExpLevel 10
+};
+
STR16 gzNewLaptopMessages[]=
{
L"Ask about our special offer!",
diff --git a/Utils/_EnglishText.cpp b/Utils/_EnglishText.cpp
index db233888..d56d89d9 100644
--- a/Utils/_EnglishText.cpp
+++ b/Utils/_EnglishText.cpp
@@ -2872,6 +2872,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Go to Sector",
L"Go to Map",
L"You can't leave the sector from this side.",
+ L"You can't leave in turn based mode.",
L"%s is too far away.",
L"Removing Treetops",
L"Showing Treetops",
@@ -4436,7 +4437,7 @@ STR16 BobbyRText[] =
L"Weight:", // Weight of all the items of the same type
L"Cal:", // the caliber of the gun
- L"Mag:", // number of rounds of ammo the Magazine can hold
+ L"Size:", // number of rounds of ammo the Magazine can hold
L"Rng:", // The range of the gun
L"Dam:", // Damage of the weapon
L"ROF:", // Weapon's Rate Of Fire, acronym ROF
@@ -4450,7 +4451,8 @@ STR16 BobbyRText[] =
//Popup that tells the player that they can only order 10 items at a time
- L"Darn! This on-line order form will only accept 10 items per order. If you're looking to order more stuff (and we hope you are), kindly make a separate order and accept our apologies.",
+ L"Darn! This on-line order form will only accept " ,//First part
+ L" items per order. If you're looking to order more stuff (and we hope you are), kindly make a separate order and accept our apologies.", //Second part
// A popup that tells the user that they are trying to order more items then the store has in stock
@@ -4889,7 +4891,8 @@ STR16 zSaveLoadText[] =
L"Loaded the game successfully",
L"ERROR loading the game!",
- L"The game version in the saved game file is different from the current version. It is most likely safe to continue. Continue?",
+ L"The game version in the saved game file is different than the current version. It is most likely safe to continue. Continue?",
+
L"The saved game files may be invalidated. Do you want them all deleted?",
//Translators, the next two strings are for the same thing. The first one is for beta version releases and the second one
@@ -5060,10 +5063,13 @@ STR16 zOptionsToggleText[] =
L"Stat Progress Bars", // Show progress towards stat increase
L"Alternate Strategy Map Colors", // Change color scheme of Strategic Map
L"Alternate Bullet Graphics", // Show alternate bullet graphics (tracers)
- L"Use new Chance to Hit System", // use NCTH
+// L"Use new Chance to Hit System", // use NCTH
+ L"Show Merc Ranks", // shows mercs ranks
L"Show Face Gear Graphics",
L"Show Face Gear Icons",
L"Disable Cursor Swap", // Disable Cursor Swap
+ L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns
+ //L"Weapons Overheating", // TODO.Translate
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments
L"-----------------", // TOPTION_CHEAT_MODE_OPTIONS_END
@@ -5165,10 +5171,13 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, shows character progress towards gaining levels.",
L"When ON, the strategic map will be colored differently based on exploration.",
L"When ON, alternate bullet graphics will be shown when you shoot.",
- L"When ON, the new chance to hit system and cursor is used.",
+// L"When ON, the new chance to hit system and cursor is used.",
+ L"When ON, ranks will be displayed before merc names in the strategic view.", // TODO.Translate
L"When ON, you will see the equipped face gear on the merc portraits.",
L"When ON, you will see icons for the equipped face gear on the merc portraits in the lower right corner.",
L"When ON, the cursor will not toggle between exchange position and other actions. Press |x to initiate quick exchange.",
+ L"When ON, AI turns will be much faster.",
+ //L"When ON, weapons can be overheated when firing.", // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Force all pending Bobby Ray shipments",
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_END",
@@ -5260,12 +5269,18 @@ STR16 gzGIOScreenText[] =
L"Old / Old",
L"New / Old",
L"New / New",
-
+
// Squad Size
L"Max. Squad Size",
L"6",
L"8",
L"10",
+ //L"Faster Bobby Ray Shipments",
+ L"Inventory Manipulation Costs AP",
+
+ L"New Chance to Hit System",
+ L"Improved Interrupt System",
+ L"Weapon Overheating",
};
STR16 gzMPJScreenText[] =
@@ -5583,6 +5598,9 @@ STR16 pMessageStrings[] =
L"AutoSaveGame%02d.sav", // 101
L"Auto%02d.sav", // 102
L"SaveGame%02d.sav", //103
+ // Lock / release mouse in windowed mode (window boundary)
+ L"Locking mouse cursor to stay within window boundary.", // 104
+ L"Releasing mouse cursor to move outside window boundary.", // 105
};
@@ -6067,7 +6085,8 @@ STR16 New113Message[] =
L"%s is hit to groin and falls down in pain!",
//////////////////////////////////////////////////////////////////////////////////////
L"Warning: enemy corpse found!!!",
- L"%s [%d rnds]\n%s %1.1f %s",
+ L"%s [%d rnds]\n%s %1.1f %s",
+ L"Insufficient AP Points! Cost %d, you have %d.",
};
STR16 New113HAMMessage[] =
@@ -6102,6 +6121,7 @@ STR16 New113HAMMessage[] =
};
+// WANNE: This hardcoded text should not be used anymore in the game, because we now have those texts externalized in the "TableData\Email\EmailMercLevelUp.xml" file!
// WANNE: This are the email texts, when one of the 4 new 1.13 MERC mercs have levelled up, that Speck sends
// INFO: Do not replace the ± characters. They indicate the (-> Newline) from the edt files
STR16 New113MERCMercMailTexts[] =
@@ -6116,6 +6136,7 @@ STR16 New113MERCMercMailTexts[] =
L"Please take note. Due to the improved performance of Biggens his fees for services rendered have undergone an increase. ± ± Speck T. Kline ± ",
};
+// WANNE: This hardcoded text should not be used anymore in the game, because we now have those texts externalized in the "TableData\Email\EmailMercAvailable.xml" file!
// WANNE: This is email text (each 2 line), when we left a message on AIM and now the merc is back
STR16 New113AIMMercMailTexts[] =
{
@@ -6832,6 +6853,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]=
L"|A|r|m|o|r |P|i|e|r|c|i|n|g",
L"|B|u|l|l|e|t |T|u|m|b|l|e",
L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n",
};
STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
@@ -6839,6 +6861,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
L"\n \nThis is the bullet's ability to penetrate\na target's armor.\n \nWhen above 1.0, the bullet proportionally\nreduces the Protection value of any\narmor it hits.\n \nWhen below 1.0, the bullet increases the\nprotection value of the armor instead.\n \nHigher is better.",
L"\n \nDetermines a proportional increase of damage\npotential once the bullet gets through the\ntarget's armor and hits the bodypart behind it.\n \nWhen above 1.0, the bullet's damage\nincreases after penetrating the armor.\n \nWhen below 1.0, the bullet's damage\npotential decreases after passing through armor.\n \nHigher is better.",
L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.",
+ L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.",
};
STR16 szUDBGenExplosiveStatsTooltipText[]=
@@ -6995,6 +7018,14 @@ STR16 szUDBAdvStatsTooltipText[]=
L"|C|o|u|n|t|e|r|-|F|o|r|c|e |F|r|e|q|u|e|n|c|y",
L"|T|o|-|H|i|t |B|o|n|u|s",
L"|A|i|m |B|o|n|u|s",
+ L"|S|i|n|g|l|e |S|h|o|t |T|e|m|p|e|r|a|t|u|r|e",
+ L"|C|o|o|l|d|o|w|n |F|a|c|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|o|r",
+ L"|C|o|o|l|d|o|w|n |M|o|d|i|f|i|c|a|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
};
// Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular.
@@ -7048,6 +7079,14 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil, during Burst\nor Autofire volleys.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's CTH value.\n \nIncreased CTH allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's Aim Bonus.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.",
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will jam more frequently.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will be damaged more easily.\n \nHigher is better.",
+ L"\n \nA gun's single shot temperature is\nincreased by this percentage.\n \nLower is better.",
+ L"\n \nA gun's cooldown factor is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.",
};
STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
@@ -7100,6 +7139,10 @@ STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil.\n \nNaturally, this has no effect if the weapon lacks\nboth Burst and Auto-Fire modes.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nThis weapon's to-hit is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased To-Hit allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nThis weapon's Aim Bonus is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nThe type of ammunition can affect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\nWeapon attachments can affect this.\n \nHigher is better.",
+ L"\n \nIf a gun's temperature is above this,\nit will jam more frequently.",
+ L"\n \nIf a gun's temperature is above this,\nit will be damaged more easily.",
};
// HEADROCK HAM 4: Text for the new CTH indicator.
@@ -7112,6 +7155,37 @@ STR16 gzNCTHlabels[]=
// HEADROCK HAM 4: End new UDB texts and tooltips
//////////////////////////////////////////////////////
+// Flugente FTW 1: Temperature-based text similar to HAM 4's condition-based text.
+STR16 gTemperatureDesc[] =
+{
+ L"Temperature is ",
+ L"very low",
+ L"low",
+ L"medium",
+ L"high",
+ L"very high",
+ L"dangerous",
+ L"CRITICAL",
+ L"DRAMATIC",
+ L"unknown",
+ L"."
+};
+
+CHAR16* ranks[] =
+{ L"", //ExpLevel 0
+ L"Pvt. ", //ExpLevel 1
+ L"Pfc. ", //ExpLevel 2
+ L"Cpl. ", //ExpLevel 3
+ L"Sgt. ", //ExpLevel 4
+ L"Lt. ", //ExpLevel 5
+ L"Cpt. ", //ExpLevel 6
+ L"Maj. ", //ExpLevel 7
+ L"Lt.Col. ", //ExpLevel 8
+ L"Col. ", //ExpLevel 9
+ L"Gen. " //ExpLevel 10
+};
+
+
STR16 gzNewLaptopMessages[]=
{
L"Ask about our special offer!",
diff --git a/Utils/_FrenchText.cpp b/Utils/_FrenchText.cpp
index 6d643c5b..d816b41c 100644
--- a/Utils/_FrenchText.cpp
+++ b/Utils/_FrenchText.cpp
@@ -2871,6 +2871,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"GO",
L"Carte",
L"Vous ne pouvez pas quitter ce secteur par ce côté.",
+ L"You can't leave in turn based mode.", // TODO.Translate
L"%s est trop loin.",
L"Enlever cime des arbres",
L"Afficher cime des arbres",
@@ -4440,7 +4441,8 @@ STR16 BobbyRText[] =
//Popup that tells the player that they can only order 10 items at a time
- L"Pas de chance ! Vous ne pouvez commander que 10 objets à la fois. Si vous désirez passer une commande plus importante, il vous faudra remplir un nouveau bon de commande.",
+ L"Pas de chance ! Vous ne pouvez commander que " ,//First part
+ L" objets à la fois. Si vous désirez passer une commande plus importante, il vous faudra remplir un nouveau bon de commande.",
// A popup that tells the user that they are trying to order more items then the store has in stock
@@ -5050,10 +5052,13 @@ STR16 zOptionsToggleText[] =
L"Afficher deviation balle", // Screen messages showing amount and direction of shot deviation.
L"Couleur alternative map", // Change color scheme of Strategic Map
L"Montrer tirs alternatifs", // Show alternate bullet graphics (tracers)
- L"Activé NCTH", // use NCTH
+ //L"Activé NCTH", // use NCTH
+ L"Show Merc Ranks", // shows mercs ranks // TODO.Translate
L"Afficher équipments portrait",
L"Afficher icones portraits",
- L"Désactiver échange curseur", // Disable Cursor Swap
+ L"Désactiver échange curseur", // Disable Cursor Swap
+ L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
+ //L"Weapons Overheating", // TODO.Translate
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Forcer envois Bobby Ray", // force all pending Bobby Ray shipments
L"-----------------", // TOPTION_CHEAT_MODE_OPTIONS_END
@@ -5155,10 +5160,13 @@ STR16 zOptionsScreenHelpText[] =
L"Si activé, montre la progression des caractères à travers le gain de niveaux.",
L"Si activé, la carte stratégique sera coloré différemment selon l'exploration.",
L"Si activé, le graphisme des tirs alternatifs sera affiché quand vous tirerez.",
- L"Si activé, le nouveau systéme NCTH (chance de toucher) \nainsi que le nouveau curseur seront utilisés.",
+ //L"Si activé, le nouveau systéme NCTH (chance de toucher) \nainsi que le nouveau curseur seront utilisés.",
+ L"When ON, ranks will be displayed before merc names in the strategic view.", // TODO.Translate
L"Si activé, vous verrez l'équipement du mercenaire à travers son portrait.",
L"Si activé, vous verrez les icones correspondant à l'équipement porté en bas à droite du portrait.",
L"Si activé, le curseur ne basculera pas entre changer de position et une autre action. Appuyez sur |x pour initier un échange rapide.",
+ L"When ON, AI turns will be much faster.", // TODO.Translate
+ //L"When ON, weapons can be overheated when firing.", // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Forcer tous les envois en attente de Bobby Ray",
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_END",
@@ -5250,11 +5258,18 @@ STR16 gzGIOScreenText[] =
L"Nouveau / Ancien",
L"Nouveau / Nouveau",
+ // TODO.Translate
// Squad Size
L"Max. Squad Size",
L"6",
L"8",
L"10",
+ //L"Faster Bobby Ray Shipments",
+ L"Inventory Manipulation Costs AP",
+
+ L"New Chance to Hit System",
+ L"Improved Interrupt System",
+ L"Weapon Overheating",
};
STR16 gzMPJScreenText[] =
@@ -5575,6 +5590,9 @@ STR16 pMessageStrings[] =
L"AutoSaveGame%02d.sav", // 101
L"Auto%02d.sav", // 102
L"SaveGame%02d.sav", //103
+ // Lock / release mouse in windowed mode (window boundary) // TODO.Translate
+ L"Locking mouse cursor to stay within window boundary.", // 104
+ L"Releasing mouse cursor to move outside window boundary.", // 105
};
@@ -6051,6 +6069,7 @@ STR16 New113Message[] =
//////////////////////////////////////////////////////////////////////////////////////
L"Attention: Cadavre ennemi trouvé !!!",
L"%s [%d rnds]\n%s %1.1f %s",
+ L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
};
STR16 New113HAMMessage[] =
@@ -6811,6 +6830,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]=
L"|T|a|u|x |d|e |p|é|n|é|t|r|a|t|i|o|n",
L"|C|u|l|b|u|t|e |d|e |b|a|l|l|e",
L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate
};
STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
@@ -6818,6 +6838,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
L"\n \nCeci est la capacité de la balle à pénétrer\nl'armure de la cible.\n \nAvec une valeur supérieure à 1.0, la balle réduiera fortement\nla valeur de protection de l'armure touchée.\n \nValeur élevée recommandée.",
L"\n \nDétermine le potentiel de la balle à faire des dégâts\nsur le corps après avoir traversée l'armure.\n \nAvec une valeur supérieure à 1.0, la balle fera de lourds dégâts\naprès pénétration\nAvec une valeur inférieure à 1.0, la balle fera des dégâts moindre\naprès pénétration.\n \nValeur élevée recommandée.",
L"\n \nMultiplicateur de potentiel de dégâts juste avant\nl'impact de la balle.\n \nAvec une valeur supérieure à 1.0, la balle fera de lourds dégâts\nUne valeur inférieure à 1.0 fera des dégâts moindre.\n \nValeur élevée recommandée.",
+ L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate
};
STR16 szUDBGenExplosiveStatsTooltipText[]=
@@ -6974,6 +6995,14 @@ STR16 szUDBAdvStatsTooltipText[]=
L"|F|r|é|q|u|e|n|c|e |C|o|n|t|r|e|-|f|o|r|c|e",
L"|B|o|n|u|s |c|h|a|n|c|e |d|e |t|o|u|c|h|e|r",
L"|B|o|n|u|s |d|e |v|i|s|é|e",
+ L"|S|i|n|g|l|e |S|h|o|t |T|e|m|p|e|r|a|t|u|r|e", // TODO.Translate
+ L"|C|o|o|l|d|o|w|n |F|a|c|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|o|r",
+ L"|C|o|o|l|d|o|w|n |M|o|d|i|f|i|c|a|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
};
// Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular.
@@ -7027,6 +7056,14 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]=
L"\n \nFréquence de recalcule du tireur pour ajuster la force\nqu'il doit mettre pour contrer le recul de l'arme, lors d'un tir\nen mode Rafale ou Auto.\n \nUne fréquence faible rend la salve plus précise en supposant que\nle tireur puisse surmonter le recul correctement.\n \nValeur faible recommandée.",
L"\n \nLorsque attaché à une arme de distance, cet objet\nmodifie sa chance de toucher la cible (CTH).\n \nAugmenter son CTH permet de toucher plus souvent\nune cible,en supposant que le tireur a bien visé.\n \nValeur élevée recommandée.",
L"\n \nLorsque attaché à une arme de distance, cet objet\nmodifie ses bonus de visée.\n \nAugmenter les bonus de visées permet de toucher\nune cible à longue distance plus souvent, en supposant\nque le tireur a bien visé.\n \nValeur élevée recommandée.",
+ L"\n \nA single shot causes this much heat.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will jam more frequently.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will be damaged more easily.\n \nHigher is better.",
+ L"\n \nA gun's single shot temperature is\nincreased by this percentage.\n \nLower is better.",
+ L"\n \nA gun's cooldown factor is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.",
};
STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
@@ -7079,6 +7116,10 @@ STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
L"\n \nFréquence de recalcule du tireur pour ajuster la force\nqu'il doit mettre pour contrer le recul de l'arme, lors d'un tir\nen mode Rafale ou Auto.\n \nUne fréquence faible rend la salve plus précise en supposant que\nle tireur puisse surmonter le recul correctement.\n \nValeur faible recommandée.",
L"\n \nLa chance de toucher la cible avec cette arme\na été modifié par une munition, un accessoire ou\nun attribut inhérent à l'arme.\n \nAugmenter la chance de toucher permet de toucher plus souvent\nune cible,en supposant que le tireur a bien visé.\n \nValeur élevée recommandée.",
L"\n \nLes bonus de visée de cette arme ont été modifié\npar une munition, un accessoire ou un attribut inhérent à l'arme.\n \nAugmenter les bonus de visées permet de toucher\nune cible à longue distance plus souvent, en supposant\nque le tireur a bien visé.\n \nValeur élevée recommandée.",
+ L"\n \nA single shot causes this much heat.\nThe type of ammunition can affect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\nWeapon attachments can affect this.\n \nHigher is better.",
+ L"\n \nIf a gun's temperature is above this,\nit will jam more frequently.",
+ L"\n \nIf a gun's temperature is above this,\nit will be damaged more easily.",
};
// HEADROCK HAM 4: Text for the new CTH indicator.
@@ -7091,6 +7132,37 @@ STR16 gzNCTHlabels[]=
// HEADROCK HAM 4: End new UDB texts and tooltips
//////////////////////////////////////////////////////
+// Flugente FTW 1: Temperature-based text similar to HAM 4's condition-based text.
+STR16 gTemperatureDesc[] = // TODO.Translate
+{
+ L"Temperature is ",
+ L"very low",
+ L"low",
+ L"medium",
+ L"high",
+ L"very high",
+ L"dangerous",
+ L"CRITICAL",
+ L"DRAMATIC",
+ L"unknown",
+ L"."
+};
+
+// TODO.Translate
+CHAR16* ranks[] =
+{ L"", //ExpLevel 0
+ L"Pvt. ", //ExpLevel 1
+ L"Pfc. ", //ExpLevel 2
+ L"Cpl. ", //ExpLevel 3
+ L"Sgt. ", //ExpLevel 4
+ L"Lt. ", //ExpLevel 5
+ L"Cpt. ", //ExpLevel 6
+ L"Maj. ", //ExpLevel 7
+ L"Lt.Col. ", //ExpLevel 8
+ L"Col. ", //ExpLevel 9
+ L"Gen. " //ExpLevel 10
+};
+
STR16 gzNewLaptopMessages[]=
{
L"Ask about our special offer!",
diff --git a/Utils/_GermanText.cpp b/Utils/_GermanText.cpp
index cc0a4063..73fd8b55 100644
--- a/Utils/_GermanText.cpp
+++ b/Utils/_GermanText.cpp
@@ -2876,6 +2876,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Gehe zu Karte",
L"Sie können den Sektor von dieser Seite aus nicht verlassen.",
+ L"Sie können den Sektor nicht verlassen im Rundenmodus.",
L"%s ist zu weit weg.",
L"Baumkronen entfernen",
L"Baumkronen zeigen",
@@ -4349,7 +4350,8 @@ STR16 BobbyRText[] =
L"* %% funktionstüchtig", // if the item is damaged, displays the percent function of the item
//Popup that tells the player that they can only order 10 items at a time
- L"Mist! Mit diesem Formular können Sie nur 10 Sachen bestellen. Wenn Sie mehr wollen (was wir sehr hoffen), füllen Sie bitte noch ein Formular aus.",
+ L"Mist! Mit diesem Formular können Sie nur " ,//First part
+ L" Sachen bestellen. Wenn Sie mehr wollen (was wir sehr hoffen), füllen Sie bitte noch ein Formular aus.",
// A popup that tells the user that they are trying to order more items then the store has in stock
@@ -4910,10 +4912,13 @@ STR16 zOptionsToggleText[] =
L"Status Trainingsfortschritt", // Show progress towards stat increase
L"Alternatives Kartenfarbschema", // Change color scheme of Strategic Map
L"Alternative Projektil-Grafik", // Show alternate bullet graphics (tracers)
- L"Neues Zielsystem verwenden", // use NCTH
+ //L"Neues Zielsystem verwenden", // use NCTH
+ L"Söldnerrang anzeigen.", // shows mercs ranks
L"Gesichtsequipment-Grafiken",
L"Gesichtsequipment-Icons",
L"Cursor-Wechsel deaktivieren", // Disable Cursor Swap
+ L"Autom. schnelle Gegner-Züge", // Automatic fast forward through AI turns
+ //L"Waffen können überhitzen",
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Erzwinge BR Lieferung", // force all pending Bobby Ray shipments
L"-----------------", // TOPTION_CHEAT_MODE_OPTIONS_END
@@ -5015,10 +5020,13 @@ STR16 zOptionsScreenHelpText[] =
L"Wenn diese Funktion aktiviert ist, werden die Söldnerwerte visuell mit ihrem Trainingsfortschritt unterlegt.",
L"Wenn diese Funktion aktiviert ist, wird die Strategische Karte entsprechend Ihres Erkundungsfortschrittes unterschiedlich eingefärbt.",
L"Wenn diese Funktion aktiviert ist, werden geschossene Projektile visuell mit Tracer-Effekten dargestellt.",
- L"Wenn diese Funktion aktiviert ist, wird das neue Zielsystem und der neue Zielcursor verwendet.",
+ //L"Wenn diese Funktion aktiviert ist, wird das neue Zielsystem und der neue Zielcursor verwendet.",
+ L"Wenn diese Funktion aktiviert ist, werden die Ränge der Söldner in der Strategischen Karte vor dem Namen angezeigt.",
L"Wenn diese Funktion aktiviert ist, sehen sie das Gesichtsequipment Ihrer Söldner direkt auf dem Portrait.",
L"Wenn diese Funktion aktiviert ist, sehen sie Icons für das Gesichtsequipment in der rechten unteren Ecke des Portraits.",
L"Wenn diese Funktion aktiviert ist, wird der Mauscursor nicht automatisch wechseln zwischen Personen-Positionswechsel und weiteren Aktionen.\nFür manuellen Positionswechsel drücken Sie |x.",
+ L"Wenn diese Funktion aktiviert ist, werden gegnerische Züge schneller durchgeführt.",
+ //L"Wenn diese Funktion aktiviert ist, können sich Waffen überhiten bei schneller Schussfolge.",
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Force all pending Bobby Ray shipments",
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_END",
@@ -5114,6 +5122,11 @@ STR16 gzGIOScreenText[] =
L"6",
L"8",
L"10",
+ //L"Schneller Bobby Ray Lieferungen",
+ L"Inventarzugriff kostet APs",
+ L"Neues Zielsystem",
+ L"Verbesserte Unterbrechungen",
+ L"Waffen-Überhitzung",
};
STR16 gzMPJScreenText[] =
@@ -5429,6 +5442,9 @@ STR16 pMessageStrings[] =
L"AutoSpielstand%02d.sav", // 101
L"Auto%02d.sav", // 102
L"Spielstand%02d.sav", //103
+ // Lock / release mouse in windowed mode (window boundary)
+ L"Mausberech begrenzen, damit Mauscursor innerhalb des Spielfensters bleibt.", // 104
+ L"Mausbereich wieder freigeben, um uneingeschränkte Mausbewebung zu erhalten.", // 105
};
CHAR16 ItemPickupHelpPopup[][40] =
@@ -5794,7 +5810,7 @@ STR16 gzLateLocalizedString[] =
L"%s feuert %d Schüsse mehr als beabsichtigt!",
L"%s feuert einen Schuss mehr als beabsichtigt!",
- L"Sie müssen zuerst das Gegenstandsbeschreibungsfenster schließen!", // TODO.Translate
+ L"Sie müssen zuerst das Gegenstandsbeschreibungsfenster schließen!",
};
STR16 gzCWStrings[] =
@@ -5899,6 +5915,7 @@ STR16 New113Message[] =
//////////////////////////////////////////////////////////////////////////////////////
L"Warning: enemy corpse found!!!",
L"%s [%d rnds]\n%s %1.1f %s",
+ L"Zu wenig APs! Es werden %d APs benötigt, Sie haben aber nur %d APs.",
};
STR16 New113HAMMessage[] =
@@ -6663,6 +6680,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]=
L"|R|ü|s|t|u|n|g|s|d|u|r|c|h|s|c|h|l|a|g",
L"|K|u|g|e|l|s|t|u|r|z",
L"|E|x|p|l|o|s|i|o|n |v|o|r |E|i|n|s|c|h|l|a|g",
+ L"|T|e|m|p|e|r|a|t|u|r |M|o|d|i|f|i|k|a|t|o|r",
};
STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
@@ -6670,6 +6688,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
L"\n \nDas ist die Fähigkeit der Kugel, in die Rüstung\neines Ziels einzudringen.\n \nWenn der Wert grösser als 1.0 ist, reduziert die Kugel \nverhältnismäßig den Schutz jeglicher Rüstung auf die sie eintrifft.\n \nIst der Wert kleiner als 1.0, tritt die Kugel weniger tief in die Rüstung des Ziels ein.\n \nHöher ist besser.",
L"\n \nBestimmt eine verhältnismäßige Zunahme des Schadenspotentials,\nsobald die Kugel die Rüstung des Ziels\ndurchbricht und den Körper dahinter trifft.\n \nWerte über 1.0 erhöhen, Werte unter 1.0 reduzieren das Schadenspotential\nder durchbrochenen Kugel.\n \nHöher ist besser.",
L"\n \nEin Multiplikator zum Schadenspotential der Kugel,\nder vor dem Treffen des Zieles angewandt wird.\n \nWerte über 1.0 erhöhen, Werte unter 1.0 reduzieren den Schaden.\n \nHöher ist besser.",
+ L"\n \nProzentuale zusätzliche Hitze\ndurch diese Munitionsart.\n \nNiedriger ist besser.",
};
STR16 szUDBGenExplosiveStatsTooltipText[]=
@@ -6826,6 +6845,14 @@ STR16 szUDBAdvStatsTooltipText[]=
L"|G|e|g|e|n|w|i|r|k|e|n|-|H|ä|u|f|i|g|k|e|i|t",
L"|T|r|e|f|f|e|r|b|o|n|u|s",
L"|Z|i|e|l|b|o|n|u|s",
+ L"|E|r|z|e|u|g|t|e |H|i|t|z|e",
+ L"|A|b|k|ü|h|l|f|a|k|t|o|r",
+ L"|L|a|d|e|h|e|m|m|u|n|g|s|s|c|h|r|a|n|k|e",
+ L"|H|i|t|z|e|s|c|h|a|d|e|n|s|s|c|h|r|a|n|k|e",
+ L"|M|o|d|i|f|i|k|a|t|o|r|-|E|r|z|e|u|g|t|e |H|i|t|z|e",
+ L"|M|o|d|i|f|i|k|a|t|o|r|-|A|b|k|ü|h|l|f|a|k|t|o|r",
+ L"|M|o|d|i|f|i|k|a|t|o|r|-|L|a|d|e|h|e|m|m|u|n|g|s|s|c|h|r|a|n|k|e",
+ L"|M|o|d|i|f|i|k|a|t|o|r|-|H|i|t|z|e|s|c|h|a|d|e|n|s|s|c|h|r|a|n|k|e",
};
// Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular.
@@ -6879,6 +6906,14 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]=
L"\n \nDie Fähigkeit des Schützen einzuschätzen\nwieviel Kraft er während Feuerstoß-/Autofeuersalven\nbenötigt um den Rückstoß auszugleichen.\n \nNiedriger ist besser.",
L"\n \nDieser Gegenstand beeinflusst die Trefferchance\n, wenn er getragen oder an einen\ngetragenen Gegenstand angebracht wird.\n \nHöher ist besser.",
L"\n \nDieser Gegenstand beeinflusst den Zielbonus\n, wenn er getragen oder an einen\ngetragenen Gegenstand angebracht wird.\n \nHöher ist besser.",
+ L"\n \nEin Schuss erzeugt soviel Hitze. Munitionstypen und Anbauten können diesen Wert verändern.\n \nNiedriger ist besser.",
+ L"\n \nIn jedem Zug wird die Temperatur um diesen Wert gesenkt.\n \nHöher ist besser.",
+ L"\n \nWenn die Temperatur diesen Wert überschreitet, kommt es leichter zu Ladehemmungen.\n \nHöher ist besser.",
+ L"\n \nWenn die Temperatur diesen Wert überschreitet, wird der Gegenstand leichter beschädigt.\n \nHöher ist besser.",
+ L"\n \nErzeugte Hitze wird um diesen Prozentsatz erhöht.\n \nNiedriger ist besser.",
+ L"\n \nAbkühlung wird um diesen Prozentsatz erhöht.\n \nHöher ist besser.",
+ L"\n \nLadehemmungsschranke wird um diesen Prozentsatz erhöht.\n \nHöher ist besser.",
+ L"\n \nHitzeschadensschranke wird um diesen Prozentsatz erhöht.\n \nHöher is besser.",
};
STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
@@ -6931,6 +6966,10 @@ STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
L"\n \nDas ist die Fähigkeit des Schützen Rückstöße\ngenauer auszugleichen.\n \nDies hat keine Wirkung bei Einzelschüssen!\n \nEin hoher Wert hilft dem Schützen die Mündung der Waffe\nbei Salven genauer auf das Ziel zu richten.\n \nNiedriger ist besser.",
L"\n \nDer Treffer Modifikator wird verändert durch\nMunition, Erweiterungen oder eingebauter Attribute.\n \nEin erhöhter Treffer Modifikator erlaubt es entfernte Ziele\n öfter zu treffen sofern\nanständig gezielt wird.\n \nHöher ist besser.",
L"\n \nDer Zielbonus wird verändert durch\nMunition, Erweiterungen oder eingebauter Attribute.\n \nEin erhöhter Zielbonus erlaubt es entfernte Ziele\n öfter zu treffen sofern\nanständig gezielt wird.\n \nHöher ist besser.",
+ L"\n \nA single shot causes this much heat.\nThe type of ammunition can affect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\nWeapon attachments can affect this.\n \nHigher is better.",
+ L"\n \nIf a gun's temperature is above this,\nit will jam more frequently.",
+ L"\n \nIf a gun's temperature is above this,\nit will be damaged more easily.",
};
// HEADROCK HAM 4: Text for the new CTH indicator.
@@ -6943,6 +6982,35 @@ STR16 gzNCTHlabels[]=
// HEADROCK HAM 4: End new UDB texts and tooltips
//////////////////////////////////////////////////////
+// Flugente FTW 1: Temperature-based text similar to HAM 4's condition-based text.
+STR16 gTemperatureDesc[] = // TODO.Translate
+{
+ L"Temperature is ",
+ L"very low",
+ L"low",
+ L"medium",
+ L"high",
+ L"very high",
+ L"dangerous",
+ L"CRITICAL",
+ L"DRAMATIC",
+ L"unknown",
+ L"."
+};
+
+CHAR16* ranks[] =
+{ L"", //ExpLevel 0
+ L"Rekr. ", //ExpLevel 1
+ L"Gfr. ", //ExpLevel 2
+ L"Kpl. ", //ExpLevel 3
+ L"Zgf. ", //ExpLevel 4
+ L"Lt. ", //ExpLevel 5
+ L"Hptm. ", //ExpLevel 6
+ L"Mjr. ", //ExpLevel 7
+ L"Bgdr. ", //ExpLevel 8
+ L"GenLt. ", //ExpLevel 9
+ L"Gen. " //ExpLevel 10
+};
STR16 gzNewLaptopMessages[]=
{
diff --git a/Utils/_ItalianText.cpp b/Utils/_ItalianText.cpp
index c2865297..23c72cd3 100644
--- a/Utils/_ItalianText.cpp
+++ b/Utils/_ItalianText.cpp
@@ -2864,6 +2864,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Vai nel settore",
L"Vai alla mappa",
L"Non puoi uscire dal settore da questa parte.",
+ L"You can't leave in turn based mode.", // TODO.Translate
L"%s è troppo lontano.",
L"Rimuovi le fronde degli alberi",
L"Mostra le fronde degli alberi",
@@ -4438,7 +4439,8 @@ STR16 BobbyRText[] =
//Popup that tells the player that they can only order 10 items at a time
- L"Darn! Quest'ordine qui accetterà solo 10 oggetti. Se avete intenzione di ordinare più merce (ed è quello che speriamo), fate un ordine a parte e accettate le nostre scuse.",
+ L"Darn! Quest'ordine qui accetterà solo " ,//First part
+ L" oggetti. Se avete intenzione di ordinare più merce (ed è quello che speriamo), fate un ordine a parte e accettate le nostre scuse.",
// A popup that tells the user that they are trying to order more items then the store has in stock
@@ -5046,10 +5048,13 @@ STR16 zOptionsToggleText[] =
L"Stat Progress Bars", // Show progress towards stat increase // TODO.Translate
L"Alternate Strategy-Map Colors", // Change color scheme of Strategic Map
L"Alternate bullet graphics", // Show alternate bullet graphics (tracers) // TODO.Translate
- L"Activate New CTH system", // use NCTH
+ //L"Activate New CTH system", // use NCTH
+ L"Show Merc Ranks", // shows mercs ranks // TODO.Translate
L"Show Face gear graphics", // TODO.Translate
L"Show Face gear icons",
- L"Disable Cursor Swap", // Disable Cursor Swap // TODO.Translate
+ L"Disabilita Swap Cursore", // Disable Cursor Swap
+ L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
+ //L"Weapons Overheating", // TODO.Translate
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments
L"-----------------", // TOPTION_CHEAT_MODE_OPTIONS_END
@@ -5151,10 +5156,13 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, shows character progress towards gaining levels.", // TODO.Translate
L"When ON, the Strategic Map will be colored differently based on exploration.",
L"When ON, alternate bullet graphics will be shown when you shoot.", // TODO.Translate
- L"When ON, New CTH system and cursor is used.",
+ //L"When ON, New CTH system and cursor is used.",
+ L"When ON, ranks will be displayed before merc names in the strategic view.", // TODO.Translate
L"When ON, you will see the equipped face gear on the merc portraits.", // TODO.Translate
L"When ON, you will see icons for the equipped face gear on the merc portraits in the lower right corner.",
- L"When ON, the cursor will not toggle between exchange position and other actions. Press |x to initiate quick exchange.", // TODO.Translate
+ L"Se attivato, il cursore non si alternerà tra la posizione di scambio e altre azioni. Premere |x per avviare lo scambio rapido.",
+ L"When ON, AI turns will be much faster.", // TODO.Translate
+ //L"When ON, weapons can be overheated when firing.", // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Force all pending Bobby Ray shipments",
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_END",
@@ -5249,11 +5257,18 @@ STR16 gzGIOScreenText[] =
L"New / Old",
L"New / New",
+ // TODO.Translate
// Squad Size
L"Max. Squad Size",
L"6",
L"8",
L"10",
+ //L"Faster Bobby Ray Shipments",
+ L"Inventory Manipulation Costs AP",
+
+ L"New Chance to Hit System",
+ L"Improved Interrupt System",
+ L"Weapon Overheating",
};
STR16 gzMPJScreenText[] =
@@ -5576,6 +5591,9 @@ STR16 pMessageStrings[] =
L"AutoSaveGame%02d.sav", // 101
L"Auto%02d.sav", // 102
L"SaveGame%02d.sav", //103
+ // Lock / release mouse in windowed mode (window boundary) // TODO.Translate
+ L"Locking mouse cursor to stay within window boundary.", // 104
+ L"Releasing mouse cursor to move outside window boundary.", // 105
};
@@ -6059,6 +6077,7 @@ STR16 New113Message[] =
//////////////////////////////////////////////////////////////////////////////////////
L"Warning: enemy corpse found!!!",
L"%s [%d rnds]\n%s %1.1f %s",
+ L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
};
// TODO.Translate
@@ -6825,6 +6844,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]=
L"|A|r|m|o|r |P|i|e|r|c|i|n|g",
L"|B|u|l|l|e|t |T|u|m|b|l|e",
L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate
};
STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
@@ -6832,6 +6852,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
L"\n \nThis is the bullet's ability to penetrate\na target's armor.\n \nWhen above 1.0, the bullet proportionally\nreduces the Protection value of any\narmor it hits.\n \nWhen below 1.0, the bullet increases the\nprotection value of the armor instead.\n \nHigher is better.",
L"\n \nDetermines a proportional increase of damage\npotential once the bullet gets through the\ntarget's armor and hits the bodypart behind it.\n \nWhen above 1.0, the bullet's damage\nincreases after penetrating the armor.\n \nWhen below 1.0, the bullet's damage\npotential decreases after passing through armor.\n \nHigher is better.",
L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.",
+ L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate
};
STR16 szUDBGenExplosiveStatsTooltipText[]=
@@ -6988,6 +7009,14 @@ STR16 szUDBAdvStatsTooltipText[]=
L"|C|o|u|n|t|e|r|-|F|o|r|c|e |F|r|e|q|u|e|n|c|y",
L"|T|o|-|H|i|t |B|o|n|u|s",
L"|A|i|m |B|o|n|u|s",
+ L"|S|i|n|g|l|e |S|h|o|t |T|e|m|p|e|r|a|t|u|r|e", // TODO.Translate
+ L"|C|o|o|l|d|o|w|n |F|a|c|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|o|r",
+ L"|C|o|o|l|d|o|w|n |M|o|d|i|f|i|c|a|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
};
// Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular.
@@ -7041,6 +7070,14 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil, during Burst\nor Autofire volleys.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's CTH value.\n \nIncreased CTH allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's Aim Bonus.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will jam more frequently.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will be damaged more easily.\n \nHigher is better.",
+ L"\n \nA gun's single shot temperature is\nincreased by this percentage.\n \nLower is better.",
+ L"\n \nA gun's cooldown factor is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.",
};
STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
@@ -7093,6 +7130,10 @@ STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil.\n \nNaturally, this has no effect if the weapon lacks\nboth Burst and Auto-Fire modes.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nThis weapon's to-hit is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased To-Hit allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nThis weapon's Aim Bonus is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nThe type of ammunition can affect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\nWeapon attachments can affect this.\n \nHigher is better.",
+ L"\n \nIf a gun's temperature is above this,\nit will jam more frequently.",
+ L"\n \nIf a gun's temperature is above this,\nit will be damaged more easily.",
};
// HEADROCK HAM 4: Text for the new CTH indicator.
@@ -7105,6 +7146,37 @@ STR16 gzNCTHlabels[]=
// HEADROCK HAM 4: End new UDB texts and tooltips
//////////////////////////////////////////////////////
+// Flugente FTW 1: Temperature-based text similar to HAM 4's condition-based text.
+STR16 gTemperatureDesc[] = // TODO.Translate
+{
+ L"Temperature is ",
+ L"very low",
+ L"low",
+ L"medium",
+ L"high",
+ L"very high",
+ L"dangerous",
+ L"CRITICAL",
+ L"DRAMATIC",
+ L"unknown",
+ L"."
+};
+
+// TODO.Translate
+CHAR16* ranks[] =
+{ L"", //ExpLevel 0
+ L"Pvt. ", //ExpLevel 1
+ L"Pfc. ", //ExpLevel 2
+ L"Cpl. ", //ExpLevel 3
+ L"Sgt. ", //ExpLevel 4
+ L"Lt. ", //ExpLevel 5
+ L"Cpt. ", //ExpLevel 6
+ L"Maj. ", //ExpLevel 7
+ L"Lt.Col. ", //ExpLevel 8
+ L"Col. ", //ExpLevel 9
+ L"Gen. " //ExpLevel 10
+};
+
STR16 gzNewLaptopMessages[]=
{
L"Ask about our special offer!",
diff --git a/Utils/_PolishText.cpp b/Utils/_PolishText.cpp
index 00a920ce..e0798512 100644
--- a/Utils/_PolishText.cpp
+++ b/Utils/_PolishText.cpp
@@ -2879,6 +2879,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Idź do sektora",
L"Otwórz mapę",
L"Nie można opuŚcić sektora z tej strony.",
+ L"You can't leave in turn based mode.", // TODO.Translate
L"%s jest zbyt daleko.",
L"Usuń korony drzew",
L"Pokaż korony drzew",
@@ -4446,7 +4447,8 @@ STR16 BobbyRText[] =
//Popup that tells the player that they can only order 10 items at a time
- L"Przepraszamy za to utrudnienie, ale na jednym zamówieniu może się znajdować tylko 10 pozycji! JeŚli potrzebujesz więcej, złóż kolejne zamówienie.",
+ L"Przepraszamy za to utrudnienie, ale na jednym zamówieniu może się znajdować tylko " ,//First part
+ L" pozycji! JeŚli potrzebujesz więcej, złóż kolejne zamówienie.",
// A popup that tells the user that they are trying to order more items then the store has in stock
@@ -5057,10 +5059,13 @@ STR16 zOptionsToggleText[] =
L"Stat Progress Bars", // Show progress towards stat increase // TODO.Translate
L"Alternate Strategy-Map Colors", // Change color scheme of Strategic Map
L"Alternate bullet graphics", // Show alternate bullet graphics (tracers) // TODO.Translate
- L"Activate New CTH system", // use NCTH
+ //L"Activate New CTH system", // use NCTH
+ L"Show Merc Ranks", // shows mercs ranks // TODO.Translate
L"Show Face gear graphics", // TODO.Translate
L"Show Face gear icons",
L"Disable Cursor Swap", // Disable Cursor Swap // TODO.Translate
+ L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
+ //L"Weapons Overheating", // TODO.Translate
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments
L"-----------------", // TOPTION_CHEAT_MODE_OPTIONS_END
@@ -5162,10 +5167,13 @@ STR16 zOptionsScreenHelpText[] =
L"Gdy WŁ¥CZONE, pokazuje postęp w doŚwiadczeniu postaci.",
L"When ON, the Strategic Map will be colored differently based on exploration.",
L"Gdy WŁ¥CZONE, zastępuje starą animację pocisku nową.",
- L"When ON, New CTH system and cursor is used.",
+ //L"When ON, New CTH system and cursor is used.",
+ L"When ON, ranks will be displayed before merc names in the strategic view.", // TODO.Translate
L"When ON, you will see the equipped face gear on the merc portraits.", // TODO.Translate
L"When ON, you will see icons for the equipped face gear on the merc portraits in the lower right corner.",
L"When ON, the cursor will not toggle between exchange position and other actions. Press |x to initiate quick exchange.", // TODO.Translate
+ L"When ON, AI turns will be much faster.", // TODO.Translate
+ //L"When ON, weapons can be overheated when firing.", // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"WymuŚ wszystkie oczekiwane dostawy od Bobby Ray's.",
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_END",
@@ -5257,11 +5265,18 @@ STR16 gzGIOScreenText[] =
L"Nowe / Stare",
L"Nowe / Nowe",
+ // TODO.Translate
// Squad Size
L"Max. Squad Size",
L"6",
L"8",
L"10",
+ //L"Faster Bobby Ray Shipments",
+ L"Inventory Manipulation Costs AP",
+
+ L"New Chance to Hit System",
+ L"Improved Interrupt System",
+ L"Weapon Overheating",
};
STR16 gzMPJScreenText[] =
@@ -5583,6 +5598,9 @@ STR16 pMessageStrings[] =
L"AutoSaveGame%02d.sav", // 101
L"Auto%02d.sav", // 102
L"SaveGame%02d.sav", //103
+ // Lock / release mouse in windowed mode (window boundary) // TODO.Translate
+ L"Locking mouse cursor to stay within window boundary.", // 104
+ L"Releasing mouse cursor to move outside window boundary.", // 105
};
@@ -6065,6 +6083,7 @@ STR16 New113Message[] =
//////////////////////////////////////////////////////////////////////////////
L"Warning: enemy corpse found!!!",
L"%s [%d rnds]\n%s %1.1f %s",
+ L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
};
STR16 New113HAMMessage[] =
@@ -6834,6 +6853,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]=
L"|A|r|m|o|r |P|i|e|r|c|i|n|g",
L"|B|u|l|l|e|t |T|u|m|b|l|e",
L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate
};
STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
@@ -6841,6 +6861,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
L"\n \nThis is the bullet's ability to penetrate\na target's armor.\n \nWhen above 1.0, the bullet proportionally\nreduces the Protection value of any\narmor it hits.\n \nWhen below 1.0, the bullet increases the\nprotection value of the armor instead.\n \nHigher is better.",
L"\n \nDetermines a proportional increase of damage\npotential once the bullet gets through the\ntarget's armor and hits the bodypart behind it.\n \nWhen above 1.0, the bullet's damage\nincreases after penetrating the armor.\n \nWhen below 1.0, the bullet's damage\npotential decreases after passing through armor.\n \nHigher is better.",
L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.",
+ L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate
};
STR16 szUDBGenExplosiveStatsTooltipText[]=
@@ -6997,6 +7018,14 @@ STR16 szUDBAdvStatsTooltipText[]=
L"|C|o|u|n|t|e|r|-|F|o|r|c|e |F|r|e|q|u|e|n|c|y",
L"|T|o|-|H|i|t |B|o|n|u|s",
L"|A|i|m |B|o|n|u|s",
+ L"|S|i|n|g|l|e |S|h|o|t |T|e|m|p|e|r|a|t|u|r|e", // TODO.Translate
+ L"|C|o|o|l|d|o|w|n |F|a|c|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|o|r",
+ L"|C|o|o|l|d|o|w|n |M|o|d|i|f|i|c|a|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
};
// Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular.
@@ -7050,6 +7079,14 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil, during Burst\nor Autofire volleys.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's CTH value.\n \nIncreased CTH allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's Aim Bonus.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will jam more frequently.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will be damaged more easily.\n \nHigher is better.",
+ L"\n \nA gun's single shot temperature is\nincreased by this percentage.\n \nLower is better.",
+ L"\n \nA gun's cooldown factor is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.",
};
STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
@@ -7102,6 +7139,10 @@ STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil.\n \nNaturally, this has no effect if the weapon lacks\nboth Burst and Auto-Fire modes.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nThis weapon's to-hit is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased To-Hit allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nThis weapon's Aim Bonus is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nThe type of ammunition can affect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\nWeapon attachments can affect this.\n \nHigher is better.",
+ L"\n \nIf a gun's temperature is above this,\nit will jam more frequently.",
+ L"\n \nIf a gun's temperature is above this,\nit will be damaged more easily.",
};
// HEADROCK HAM 4: Text for the new CTH indicator.
@@ -7114,6 +7155,37 @@ STR16 gzNCTHlabels[]=
// HEADROCK HAM 4: End new UDB texts and tooltips
//////////////////////////////////////////////////////
+// Flugente FTW 1: Temperature-based text similar to HAM 4's condition-based text.
+STR16 gTemperatureDesc[] = // TODO.Translate
+{
+ L"Temperature is ",
+ L"very low",
+ L"low",
+ L"medium",
+ L"high",
+ L"very high",
+ L"dangerous",
+ L"CRITICAL",
+ L"DRAMATIC",
+ L"unknown",
+ L"."
+};
+
+// TODO.Translate
+CHAR16* ranks[] =
+{ L"", //ExpLevel 0
+ L"Pvt. ", //ExpLevel 1
+ L"Pfc. ", //ExpLevel 2
+ L"Cpl. ", //ExpLevel 3
+ L"Sgt. ", //ExpLevel 4
+ L"Lt. ", //ExpLevel 5
+ L"Cpt. ", //ExpLevel 6
+ L"Maj. ", //ExpLevel 7
+ L"Lt.Col. ", //ExpLevel 8
+ L"Col. ", //ExpLevel 9
+ L"Gen. " //ExpLevel 10
+};
+
//Ja25 UB
STR16 gzNewLaptopMessages[]=
diff --git a/Utils/_RussianText.cpp b/Utils/_RussianText.cpp
index a1e0ca37..f8cdb22b 100644
--- a/Utils/_RussianText.cpp
+++ b/Utils/_RussianText.cpp
@@ -2872,6 +2872,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Идти в сектор",
L"Идти на карту",
L"Этот сектор отсюда покинуть нельзя.",
+ L"You can't leave in turn based mode.", // TODO.Translate
L"%s слишком далеко.",
L"Скрыть кроны деревьев",
L"Показать кроны деревьев",
@@ -4437,7 +4438,8 @@ STR16 BobbyRText[] =
//Popup that tells the player that they can only order 10 items at a time
- L"Чёрт! В эту форму можно внести не более 10 позиций для одного заказа. Если вы хотите заказать больше (а мы надеемся, вы хотите), то заполните еще один заказ и примите наши извинения за неудобства.",
+ L"Чёрт! В эту форму можно внести не более " ,//First part
+ L" позиций для одного заказа. Если вы хотите заказать больше (а мы надеемся, вы хотите), то заполните еще один заказ и примите наши извинения за неудобства.",
// A popup that tells the user that they are trying to order more items then the store has in stock
@@ -5040,10 +5042,13 @@ STR16 zOptionsToggleText[] =
L"Подсветить навык к повышению", //Stat Progress Bars // Show progress towards stat increase
L"Новая расцветка стратег. карты", //Alternate Strategy-Map Colors //Change color scheme of Strategic Map
L"Заметная летящая пуля", // Show alternate bullet graphics (tracers)
- L"Новая система прицеливания", // use NCTH
+ //L"Новая система прицеливания", // use NCTH
+ L"Show Merc Ranks", // shows mercs ranks // TODO.Translate
L"Показать снаряжение на голове", //Show Face gear graphics
L"Показать иконки снаряжения",
L"Disable Cursor Swap", // Disable Cursor Swap // TODO.Translate
+ L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
+ //L"Weapons Overheating", // TODO.Translate
L"--Читерские настройки--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Ускорить доставку Бобби Рэя", // force all pending Bobby Ray shipments
L"-----------------", // TOPTION_CHEAT_MODE_OPTIONS_END
@@ -5145,10 +5150,13 @@ STR16 zOptionsScreenHelpText[] =
L"Если включено, навык, \nкоторый вскоре повысится будет подсвечен.",
L"Если включено, необследованные сектрора \nна стратегической карте будут чёрно-белыми.",
L"Если включено, летящая пуля будет более заметной.",
- L"Если включено, будет задействована новая система прицеливания \nи новый курсор прицеливания.",
+ //L"Если включено, будет задействована новая система прицеливания \nи новый курсор прицеливания.",
+ L"When ON, ranks will be displayed before merc names in the strategic view.", // TODO.Translate
L"Если включено, на портрете наёмника будет отображено одетое головное снаряжение.",
L"Если включено, в правом нижнем углу \nна портрете наёмника будут отображены иконки \nодетого головного снаряжения.",
L"When ON, the cursor will not toggle between exchange position and other actions. Press |x to initiate quick exchange.", // TODO.Translate
+ L"When ON, AI turns will be much faster.", // TODO.Translate
+ //L"When ON, weapons can be overheated when firing.", // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Выберите этот пункт чтобы груз Бобби Рэя прибыл немедленно.",
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_END",
@@ -5241,11 +5249,18 @@ STR16 gzGIOScreenText[] =
L"новый / старая",
L"новый / новая",
+ // TODO.Translate
// Squad Size
L"Max. Squad Size",
L"6",
L"8",
L"10",
+ //L"Faster Bobby Ray Shipments",
+ L"Inventory Manipulation Costs AP",
+
+ L"New Chance to Hit System",
+ L"Improved Interrupt System",
+ L"Weapon Overheating",
};
STR16 gzMPJScreenText[] =
@@ -5563,6 +5578,9 @@ STR16 pMessageStrings[] =
L"AutoSaveGame%02d.sav", // 101
L"Auto%02d.sav", // 102
L"SaveGame%02d.sav", //103
+ // Lock / release mouse in windowed mode (window boundary) // TODO.Translate
+ L"Locking mouse cursor to stay within window boundary.", // 104
+ L"Releasing mouse cursor to move outside window boundary.", // 105
};
@@ -6042,6 +6060,7 @@ STR16 New113Message[] =
/////
L"Внимание: враг обнаружил труп!!!",
L"%s [%d патр.]\n%s %1.1f %s",
+ L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
};
STR16 New113HAMMessage[] =
@@ -6802,6 +6821,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]=
L"|П|р|о|н|з|и|т|е|л|ь|н|о|с|т|ь |ч|е|р|е|з |б|р|о|н|ю",
L"|П|а|д|е|н|и|е |п|а|т|р|о|н|ы",
L"|П|р|е|д|в|а|р|и|т|е|л|ь|н|о|е |в|л|и|я|н|и|е |в|з|р|ы|в|а",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate
};
STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
@@ -6809,6 +6829,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
L"\n \nThis is the bullet's ability to penetrate\na target's armor.\n \nWhen above 1.0, the bullet proportionally\nreduces the Protection value of any\narmor it hits.\n \nWhen below 1.0, the bullet increases the\nprotection value of the armor instead.\n \nHigher is better.",
L"\n \nDetermines a proportional increase of damage\npotential once the bullet gets through the\ntarget's armor and hits the bodypart behind it.\n \nWhen above 1.0, the bullet's damage\nincreases after penetrating the armor.\n \nWhen below 1.0, the bullet's damage\npotential decreases after passing through armor.\n \nHigher is better.",
L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.",
+ L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate
};
STR16 szUDBGenExplosiveStatsTooltipText[]=
@@ -6965,6 +6986,14 @@ STR16 szUDBAdvStatsTooltipText[]=
L"|Ч|а|с|т|о|т|а |к|о|н|т|р|-|с|и|л|ы",
L"|Б|о|н|у|с| |п|о|п|а|д|а|н|и|я",
L"|Б|о|ну|с |п|р|и|ц|е|л|и|в|а|н|и|я",
+ L"|S|i|n|g|l|e |S|h|o|t |T|e|m|p|e|r|a|t|u|r|e", // TODO.Translate
+ L"|C|o|o|l|d|o|w|n |F|a|c|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|o|r",
+ L"|C|o|o|l|d|o|w|n |M|o|d|i|f|i|c|a|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
};
// Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular.
@@ -7018,6 +7047,14 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil, during Burst\nor Autofire volleys.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's CTH value.\n \nIncreased CTH allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's Aim Bonus.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will jam more frequently.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will be damaged more easily.\n \nHigher is better.",
+ L"\n \nA gun's single shot temperature is\nincreased by this percentage.\n \nLower is better.",
+ L"\n \nA gun's cooldown factor is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.",
};
STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
@@ -7070,6 +7107,10 @@ STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil.\n \nNaturally, this has no effect if the weapon lacks\nboth Burst and Auto-Fire modes.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nThis weapon's to-hit is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased To-Hit allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nThis weapon's Aim Bonus is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nThe type of ammunition can affect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\nWeapon attachments can affect this.\n \nHigher is better.",
+ L"\n \nIf a gun's temperature is above this,\nit will jam more frequently.",
+ L"\n \nIf a gun's temperature is above this,\nit will be damaged more easily.",
};
// HEADROCK HAM 4: Text for the new CTH indicator.
@@ -7082,6 +7123,37 @@ STR16 gzNCTHlabels[]=
// HEADROCK HAM 4: End new UDB texts and tooltips
//////////////////////////////////////////////////////
+// Flugente FTW 1: Temperature-based text similar to HAM 4's condition-based text.
+STR16 gTemperatureDesc[] = // TODO.Translate
+{
+ L"Temperature is ",
+ L"very low",
+ L"low",
+ L"medium",
+ L"high",
+ L"very high",
+ L"dangerous",
+ L"CRITICAL",
+ L"DRAMATIC",
+ L"unknown",
+ L"."
+};
+
+// TODO.Translate
+CHAR16* ranks[] =
+{ L"", //ExpLevel 0
+ L"Pvt. ", //ExpLevel 1
+ L"Pfc. ", //ExpLevel 2
+ L"Cpl. ", //ExpLevel 3
+ L"Sgt. ", //ExpLevel 4
+ L"Lt. ", //ExpLevel 5
+ L"Cpt. ", //ExpLevel 6
+ L"Maj. ", //ExpLevel 7
+ L"Lt.Col. ", //ExpLevel 8
+ L"Col. ", //ExpLevel 9
+ L"Gen. " //ExpLevel 10
+};
+
STR16 gzNewLaptopMessages[]=
{
L"Ask about our special offer!",
diff --git a/Utils/_TaiwaneseText.cpp b/Utils/_TaiwaneseText.cpp
index a1332350..43a40dd8 100644
--- a/Utils/_TaiwaneseText.cpp
+++ b/Utils/_TaiwaneseText.cpp
@@ -2873,6 +2873,7 @@ CHAR16 TacticalStr[][ MED_STRING_LENGTH ] =
L"Go to Sector",
L"Go to Map",
L"You can't leave the sector from this side.",
+ L"You can't leave in turn based mode.",
L"%s is too far away.",
L"Removing Treetops",
L"Showing Treetops",
@@ -4451,7 +4452,8 @@ STR16 BobbyRText[] =
//Popup that tells the player that they can only order 10 items at a time
- L"Darn! This on-line order form will only accept 10 items per order. If you're looking to order more stuff (and we hope you are), kindly make a separate order and accept our apologies.",
+ L"Darn! This on-line order form will only accept " ,//First part
+ L" items per order. If you're looking to order more stuff (and we hope you are), kindly make a separate order and accept our apologies.",
// A popup that tells the user that they are trying to order more items then the store has in stock
@@ -5061,10 +5063,13 @@ STR16 zOptionsToggleText[] =
L"Stat Progress Bars", // Show progress towards stat increase // TODO.Translate
L"Alternate Strategy-Map Colors", // Change color scheme of Strategic Map
L"Alternate bullet graphics", // Show alternate bullet graphics (tracers) // TODO.Translate
- L"Activate New CTH system", // use NCTH
+ //L"Activate New CTH system", // use NCTH
+ L"Show Merc Ranks", // shows mercs ranks // TODO.Translate
L"Show Face gear graphics", // TODO.Translate
L"Show Face gear icons",
- L"Disable Cursor Swap", // Disable Cursor Swap // TODO.Translate
+ L"Disable Cursor Swap", // Disable Cursor Swap
+ L"Auto Fast Forward AI Turns", // Automatic fast forward through AI turns // TODO.Translate
+ //L"Weapons Overheating", // TODO.Translate
L"--Cheat Mode Options--", // TOPTION_CHEAT_MODE_OPTIONS_HEADER,
L"Force Bobby Ray shipments", // force all pending Bobby Ray shipments
L"-----------------", // TOPTION_CHEAT_MODE_OPTIONS_END
@@ -5166,10 +5171,13 @@ STR16 zOptionsScreenHelpText[] =
L"When ON, shows character progress towards gaining levels.", // TODO.Translate
L"When ON, the Strategic Map will be colored differently based on exploration.",
L"When ON, alternate bullet graphics will be shown when you shoot.", // TODO.Translate
- L"When ON, New CTH system and cursor is used.",
+ //L"When ON, New CTH system and cursor is used.",
+ L"When ON, ranks will be displayed before merc names in the strategic view.", // TODO.Translate
L"When ON, you will see the equipped face gear on the merc portraits.", // TODO.Translate
L"When ON, you will see icons for the equipped face gear on the merc portraits in the lower right corner.",
- L"When ON, the cursor will not toggle between exchange position and other actions. Press |x to initiate quick exchange.", // TODO.Translate
+ L"When ON, the cursor will not toggle between exchange position and other actions. Press |x to initiate quick exchange.",
+ L"When ON, AI turns will be much faster.", // TODO.Translate
+ //L"When ON, weapons can be overheated when firing.", // TODO.Translate
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_HEADER",
L"Force all pending Bobby Ray shipments",
L"(text not rendered)TOPTION_CHEAT_MODE_OPTIONS_END",
@@ -5264,11 +5272,18 @@ STR16 gzGIOScreenText[] =
L"New / Old",
L"New / New",
+ // TODO.Translate
// Squad Size
L"Max. Squad Size",
L"6",
L"8",
L"10",
+ //L"Faster Bobby Ray Shipments",
+ L"Inventory Manipulation Costs AP",
+
+ L"New Chance to Hit System",
+ L"Improved Interrupt System",
+ L"Weapon Overheating",
};
STR16 gzMPJScreenText[] =
@@ -5591,6 +5606,9 @@ STR16 pMessageStrings[] =
L"AutoSaveGame%02d.sav", // 101
L"Auto%02d.sav", // 102
L"SaveGame%02d.sav", //103
+ // Lock / release mouse in windowed mode (window boundary) // TODO.Translate
+ L"Locking mouse cursor to stay within window boundary.", // 104
+ L"Releasing mouse cursor to move outside window boundary.", // 105
};
@@ -6072,6 +6090,7 @@ STR16 New113Message[] =
//////////////////////////////////////////////////////////////////////////////////////
L"Warning: enemy corpse found!!!",
L"%s [%d rnds]\n%s %1.1f %s",
+ L"Insufficient AP Points! Cost %d, you have %d.", // TODO.Translate
};
// TODO.Translate
@@ -6839,6 +6858,7 @@ STR16 szUDBGenAmmoStatsTooltipText[]=
L"|A|r|m|o|r |P|i|e|r|c|i|n|g",
L"|B|u|l|l|e|t |T|u|m|b|l|e",
L"|P|r|e|-|I|m|p|a|c|t |E|x|p|l|o|s|i|o|n",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|i|o|n", // TODO.Translate
};
STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
@@ -6846,6 +6866,7 @@ STR16 szUDBGenAmmoStatsExplanationsTooltipText[]=
L"\n \nThis is the bullet's ability to penetrate\na target's armor.\n \nWhen above 1.0, the bullet proportionally\nreduces the protection value of any\narmor it hits.\n \nWhen below 1.0, the bullet has a minor impact on the protection value of the armor.\n \nHigher is better.",
L"\n \nDetermines a proportional increase of damage\npotential once the bullet gets through the\ntarget's armor and hits the bodypart behind it.\n \nWhen above 1.0, the bullet's damage\nincreases after penetrating the armor.\n \nWhen below 1.0, the bullet's damage\npotential decreases after passing through armor.\n \nHigher is better.",
L"\n \nA multiplier to the bullet's damage potential\nthat is applied immediately before hitting the\ntarget.\n \nValues above 1.0 indicate an increase in damage,\nvalues below 1.0 indicate a decrease.\n \nHigher is better.",
+ L"\n \nAdditional heat generated by this ammunition.\n \nLower is better.", // TODO.Translate
};
STR16 szUDBGenExplosiveStatsTooltipText[]=
@@ -7002,6 +7023,14 @@ STR16 szUDBAdvStatsTooltipText[]=
L"|C|o|u|n|t|e|r|-|F|o|r|c|e |F|r|e|q|u|e|n|c|y",
L"|T|o|-|H|i|t |B|o|n|u|s",
L"|A|i|m |B|o|n|u|s",
+ L"|S|i|n|g|l|e |S|h|o|t |T|e|m|p|e|r|a|t|u|r|e", // TODO.Translate
+ L"|C|o|o|l|d|o|w|n |F|a|c|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d",
+ L"|T|e|m|p|e|r|a|t|u|r|e |M|o|d|i|f|i|c|a|t|o|r",
+ L"|C|o|o|l|d|o|w|n |M|o|d|i|f|i|c|a|t|o|r",
+ L"|J|a|m |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
+ L"|D|a|m|a|g|e |T|r|e|s|h|o|l|d |M|o|d|i|f|i|c|a|t|o|r",
};
// Alternate tooltip text for weapon Advanced Stats. Just different wording, nothing spectacular.
@@ -7055,6 +7084,14 @@ STR16 szUDBAdvStatsExplanationsTooltipText[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil, during Burst\nor Autofire volleys.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's CTH value.\n \nIncreased CTH allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nWhen attached to a ranged weapon, this item\nmodifies the weapon's Aim Bonus.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nAmmunition types and attachments can\naffect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will jam more frequently.\n \nHigher is better.",
+ L"\n \nIf an item's temperature is above this,\nit will be damaged more easily.\n \nHigher is better.",
+ L"\n \nA gun's single shot temperature is\nincreased by this percentage.\n \nLower is better.",
+ L"\n \nA gun's cooldown factor is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's jam threshold is\nincreased by this percentage.\n \nHigher is better.",
+ L"\n \nA gun's damage threshold is\nincreased by this percentage.\n \nHigher is better.",
};
STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
@@ -7107,6 +7144,10 @@ STR16 szUDBAdvStatsExplanationsTooltipTextForWeapons[]=
L"\n \nThis is the shooter's ability to\nfrequently reasses how much counter-force they\nneed to apply against a gun's recoil.\n \nNaturally, this has no effect if the weapon lacks\nboth Burst and Auto-Fire modes.\n \nLower frequency makes volleys more accurate on the whole,\nand also makes longer volleys more accurate assuming\nthe shooter can overcome recoil correctly.\n \nLower is better.",
L"\n \nThis weapon's to-hit is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased To-Hit allows the gun to hit targets\nmore often, assuming it is also well-aimed.\n \nHigher is better.",
L"\n \nThis weapon's Aim Bonus is being modified by\nan ammo, attachment, or built-in attributes.\n \nIncreased Aim Bonus allows the gun to hit\ntargets at longer ranges more often, assuming\nit is also well-aimed.\n \nHigher is better.",
+ L"\n \nA single shot causes this much heat.\nThe type of ammunition can affect this value.\n \nLower is better.", // TODO.Translate
+ L"\n \nEvery turn, the temperature is lowered\nby this amount.\nWeapon attachments can affect this.\n \nHigher is better.",
+ L"\n \nIf a gun's temperature is above this,\nit will jam more frequently.",
+ L"\n \nIf a gun's temperature is above this,\nit will be damaged more easily.",
};
// HEADROCK HAM 4: Text for the new CTH indicator.
@@ -7119,6 +7160,37 @@ STR16 gzNCTHlabels[]=
// HEADROCK HAM 4: End new UDB texts and tooltips
//////////////////////////////////////////////////////
+// Flugente FTW 1: Temperature-based text similar to HAM 4's condition-based text.
+STR16 gTemperatureDesc[] = // TODO.Translate
+{
+ L"Temperature is ",
+ L"very low",
+ L"low",
+ L"medium",
+ L"high",
+ L"very high",
+ L"dangerous",
+ L"CRITICAL",
+ L"DRAMATIC",
+ L"unknown",
+ L"."
+};
+
+// TODO.Translate
+CHAR16* ranks[] =
+{ L"", //ExpLevel 0
+ L"Pvt. ", //ExpLevel 1
+ L"Pfc. ", //ExpLevel 2
+ L"Cpl. ", //ExpLevel 3
+ L"Sgt. ", //ExpLevel 4
+ L"Lt. ", //ExpLevel 5
+ L"Cpt. ", //ExpLevel 6
+ L"Maj. ", //ExpLevel 7
+ L"Lt.Col. ", //ExpLevel 8
+ L"Col. ", //ExpLevel 9
+ L"Gen. " //ExpLevel 10
+};
+
STR16 gzNewLaptopMessages[]=
{
L"Ask about our special offer!",
diff --git a/Utils/message.cpp b/Utils/message.cpp
index 2f695ead..5434bdad 100644
--- a/Utils/message.cpp
+++ b/Utils/message.cpp
@@ -1045,7 +1045,8 @@ void MapScreenMessage( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ... )
}
// HEADROCK HAM 3.6: Allow for longer lines.
- MAP_LINE_WIDTH = (SCREEN_WIDTH - 330);
+ // Lejardo ARSProject
+ MAP_LINE_WIDTH = (INTERFACE_WIDTH - 330);
pStringWrapperHead=LineWrap(uiFont, MAP_LINE_WIDTH, &usLineWidthIfWordIsWiderThenWidth, DestString);
pStringWrapper=pStringWrapperHead;
@@ -1142,7 +1143,7 @@ void DisplayStringsInMapScreenMessageList( void )
//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, 17, (SCREEN_HEIGHT - 114), (SCREEN_WIDTH - 330), (SCREEN_HEIGHT - 114) + 101, FALSE );
+ 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 );
SetFont( MAP_SCREEN_MESSAGE_FONT ); // no longer supports variable fonts
SetFontBackground( FONT_BLACK );
@@ -1176,7 +1177,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( 20, sY, gMapScreenMessageList[ ubCurrentStringIndex ]->pString16 );
+ mprintf_coded( (SCREEN_WIDTH - INTERFACE_WIDTH)/2 + 20, sY, gMapScreenMessageList[ ubCurrentStringIndex ]->pString16 );
sY = sY + usSpacing;
diff --git a/aniviewscreen.cpp b/aniviewscreen.cpp
index 10fe121e..55b19ef6 100644
--- a/aniviewscreen.cpp
+++ b/aniviewscreen.cpp
@@ -185,7 +185,7 @@ UINT32 AniEditScreenHandle(void)
}
- if (DequeueEvent(&InputEvent) == TRUE)
+ if (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if ((InputEvent.usEvent == KEY_DOWN)&&(InputEvent.usParam == ESC))
{
diff --git a/gameloop.cpp b/gameloop.cpp
index 743393ce..bfa23fdf 100644
--- a/gameloop.cpp
+++ b/gameloop.cpp
@@ -146,6 +146,12 @@ BOOLEAN InitializeGame(void)
InitButtonSystem();
InitCursors( );
+ SetFastForwardPeriod(gGameExternalOptions.iFastForwardPeriod);
+ SetFastForwardKey(gGameExternalOptions.iFastForwardKey);
+ SetNotifyFrequencyKey(gGameExternalOptions.iNotifyFrequency);
+ SetClockSpeedPercent(gGameExternalOptions.fClockSpeedPercent);
+
+
// Init Fonts
if ( !InitializeFonts( ) )
{
@@ -510,7 +516,7 @@ void HandleShortCutExitState( void )
// look at the state of fGameIsRunning, if set false, then prompt user for confirmation
// use YES/NO Pop up box, settup for particular screen
- SGPRect pCenteringRect= {0, 0, SCREEN_WIDTH, INV_INTERFACE_START_Y };
+ SGPRect pCenteringRect= {0 + xResOffset, 0, SCREEN_WIDTH - xResOffset, INV_INTERFACE_START_Y };
if( guiCurrentScreen == ERROR_SCREEN )
{ //an assert failure, don't bring up the box!
@@ -589,3 +595,21 @@ void NextLoopCheckForEnoughFreeHardDriveSpace()
{
gubCheckForFreeSpaceOnHardDriveCount = 0;
}
+
+
+// Called by any game loop after all known events were handled
+void HandleDefaultEvent(InputAtom *Event)
+{
+ const int MouseButtonEvents = LEFT_BUTTON_REPEAT|RIGHT_BUTTON_REPEAT|
+ LEFT_BUTTON_DOWN|LEFT_BUTTON_UP|MIDDLE_BUTTON_UP|X1_BUTTON_UP|X2_BUTTON_UP|
+ RIGHT_BUTTON_DOWN|RIGHT_BUTTON_UP|MIDDLE_BUTTON_DOWN|X1_BUTTON_DOWN|X2_BUTTON_DOWN|
+ MOUSE_WHEEL_UP|MOUSE_WHEEL_DOWN;
+
+ if (Event != NULL && Event->usEvent & MouseButtonEvents)
+ {
+ POINT MousePos;
+ GetCursorPos(&MousePos);
+ ScreenToClient(ghWindow, &MousePos); // In window coords!
+ MouseSystemHook(Event->usEvent, (UINT16)MousePos.x ,(UINT16)MousePos.y ,_LeftButtonDown, _RightButtonDown);
+ }
+}
diff --git a/gameloop.h b/gameloop.h
index b7c7e7b1..e9ccfbc2 100644
--- a/gameloop.h
+++ b/gameloop.h
@@ -18,5 +18,7 @@ void HandleShortCutExitState( void );
void SetPendingNewScreen( UINT32 uiNewScreen );
+struct InputAtom;
+void HandleDefaultEvent(InputAtom *Event);
#endif
diff --git a/ja2.props b/ja2.props
index aad6ffbe..fcd4a46b 100644
--- a/ja2.props
+++ b/ja2.props
@@ -1,15 +1,51 @@
-
+
+ JA2
+ EN
+ ENGLISH
+
<_PropertySheetDisplayName>ja2
+
+
+ $(JA2Config)
+
+
+ $(JA2LangPrefix)
+
+
+ $(JA2Language)
+
+
..\.;.\.;.\ext\VFS\include;..\ext\VFS\include;..\Utils;.\Utils;..\TileEngine;.\TileEngine;..\TacticalAI;.\TacticalAI;..\Tactical;.\Tactical;..\Strategic;.\Strategic;..\Standard Gaming Platform;.\Standard Gaming Platform;..\Res;.\Res;..\lua;.\lua;..\Laptop;.\Laptop;..\Multiplayer;.\Multiplayer;..\Multiplayer\raknet;.\Multiplayer\raknet;..\Editor;.\Editor;..\Console;.\Console;.\ext\libpng;..\ext\libpng;.\ext\zlib;..\ext\zlib;;$(NOINHERIT)
- JA2;CINTERFACE;XML_STATIC;VFS_STATIC;VFS_WITH_SLF;VFS_WITH_7ZIP;USE_VFS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)
+ JA2;CINTERFACE;XML_STATIC;VFS_STATIC;VFS_WITH_SLF;VFS_WITH_7ZIP;USE_VFS;_CRT_SECURE_NO_DEPRECATE;$(JA2Language);%(PreprocessorDefinitions)
-
+
+
+ JA2MAPS;%(PreprocessorDefinitions)
+
+
+
+
+ JA2UB;%(PreprocessorDefinitions)
+
+
+
+
+ JA2UBMAPS;%(PreprocessorDefinitions)
+
+
+
+
+ JA2EDITOR;JA2BETAVERSION;%(PreprocessorDefinitions)
+
+
+
+
\ No newline at end of file
diff --git a/ja2_LinkerVS2010.props b/ja2_LinkerVS2010.props
index 5b424718..31b44215 100644
--- a/ja2_LinkerVS2010.props
+++ b/ja2_LinkerVS2010.props
@@ -7,7 +7,7 @@
- lib\VS2010\$(Configuration);%(AdditionalLibraryDirectories)
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration);$(SolutionDir)\lib\VS2010\$(Configuration);%(AdditionalLibraryDirectories)
Console.lib;Editor.lib;Laptop.lib;lua.lib;SGP.lib;Strategic.lib;Tactical.lib;TacticalAI.lib;TileEngine.lib;Utils.lib;VFS.lib;7z.lib;libpng.lib;zlib.lib;%(AdditionalDependencies)
diff --git a/ja2_VS2005.vcproj b/ja2_VS2005.vcproj
index 7cd68a63..2c9f3095 100644
--- a/ja2_VS2005.vcproj
+++ b/ja2_VS2005.vcproj
@@ -66,7 +66,7 @@
true
- bin\VS2010\$(Configuration)\
- build\VS2010\$(ProjectName)_$(Configuration)\
- JA2_EN_Debug.exe
-
+ $(SolutionDir)\bin\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(JA2Config)_$(JA2LangPrefix)_$(Configuration)
+ .exe
true
- bin\VS2010\$(Configuration)\
- build\VS2010\$(ProjectName)_$(Configuration)\
-
-
- MapEditor_EN_Debug.exe
+ $(SolutionDir)\bin\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ .exe
+ $(JA2Config)_$(JA2LangPrefix)_$(Configuration)
false
- bin\VS2010\$(Configuration)\
- build\VS2010\$(ProjectName)_$(Configuration)\
- JA2_PO_Release.exe
-
+ $(SolutionDir)\bin\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(JA2Config)_$(JA2LangPrefix)_$(Configuration)
+ .exe
false
- bin\VS2010\$(Configuration)\
- build\VS2010\$(ProjectName)_$(Configuration)\
- MapEditor_EN_Release.exe
-
+ $(SolutionDir)\bin\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(JA2Config)_$(JA2LangPrefix)_$(Configuration)
+ .exe
false
- bin\VS2010\$(Configuration)\
- build\VS2010\$(ProjectName)_$(Configuration)\
- JA2_EN_ReleaseDebugInfo.exe
-
+ $(SolutionDir)\bin\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(JA2Config)_$(JA2LangPrefix)_$(Configuration)
+ .exe
@@ -145,7 +144,6 @@
true
Multiplayer\raknet;%(AdditionalLibraryDirectories)
Winmm.lib;RakNetLibStatic.lib;ws2_32.lib;DbgHelp.lib;%(AdditionalDependencies)
- $(OutDir)\JA2_EN_Debug.exe
@@ -226,7 +224,6 @@
true
Multiplayer\raknet;%(AdditionalLibraryDirectories)
Winmm.lib;RakNetLibStatic.lib;ws2_32.lib;DbgHelp.lib;%(AdditionalDependencies)
- $(OutDir)\JA2_EN_ReleaseDebugInfo.exe
diff --git a/jascreens.cpp b/jascreens.cpp
index 75b4646a..5639d63e 100644
--- a/jascreens.cpp
+++ b/jascreens.cpp
@@ -321,7 +321,7 @@ UINT32 ErrorScreenHandle(void)
EndFrameBufferRender( );
// Check for esc
- while (DequeueEvent(&InputEvent) == TRUE)
+ while (DequeueSpecificEvent(&InputEvent, KEY_DOWN|KEY_UP|KEY_REPEAT))
{
if( InputEvent.usEvent == KEY_DOWN )
{
diff --git a/local.h b/local.h
index fbaaad9e..4ac7bc2e 100644
--- a/local.h
+++ b/local.h
@@ -34,6 +34,45 @@ extern int iPlayIntro;
extern INT16 iScreenWidthOffset;
extern INT16 iScreenHeightOffset;
+extern UINT16 xResOffset;
+extern UINT16 yResOffset;
+
+extern UINT16 xResSize; // 640 / 800 / 1024
+extern UINT16 yResSize; // 480 / 600 / 768
+
+typedef enum
+{
+ // The 640x480 resolution should always be the FIRST entry in this enum
+ _640x480 = 0,
+
+ // Place all resolutions that have both (a lower height AND a lower width) BEFORE the 800x600 resolution
+ _800x600 = 1,
+ _1024x600 = 2,
+ _1280x720 = 3,
+
+ // Place all resolutions that have both (a lower height AND a lower width) BEFORE the 1024x768 resolution
+ _1024x768 = 4,
+ _1280x768 = 5,
+ _1360x768 = 6,
+ _1366x768 = 7,
+ _1280x800 = 8,
+ _1440x900 = 9,
+ _1600x900 = 10,
+ _1280x960 = 11,
+ _1440x960 = 12,
+ _1770x1000 = 13,
+ _1280x1024 = 14,
+ _1360x1024 = 15,
+ _1600x1024 = 16,
+ _1440x1050 = 17,
+ _1680x1050 = 18,
+ _1920x1080 = 19,
+ _1600x1200 = 20,
+ _1920x1200 = 21,
+ _2560x1440 = 22,
+ _2560x1600 = 23,
+} SCREEN_RESOLUTION;
+
extern BOOLEAN fDisplayOverheadMap;
#define PIXEL_DEPTH 16
diff --git a/lua/lua_VS2010.vcxproj b/lua/lua_VS2010.vcxproj
index 47fd14e8..acb0e72a 100644
--- a/lua/lua_VS2010.vcxproj
+++ b/lua/lua_VS2010.vcxproj
@@ -110,24 +110,24 @@
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
- ..\build\VS2010\$(ProjectName)_$(Configuration)\
- ..\lib\VS2010\$(Configuration)\
+ $(SolutionDir)\build\VS2010\$(JA2Config)\$(ProjectName)_$(Configuration)\
+ $(SolutionDir)\lib\VS2010\$(JA2Config)\$(Configuration)\
diff --git a/readme.txt b/readme.txt
index 37b3c0d0..57b14dcd 100644
--- a/readme.txt
+++ b/readme.txt
@@ -1,3 +1,5 @@
+Last 1.13 SVN 4721
+
Compilation of UB :
Set #define JA2UB and #define JA2UBMAPS in file builddefines.h.
@@ -19,3 +21,5 @@ JA2 :
//#define JA2UB
//#define JA2UBMAPS
+
+www.legion.zone.zg.pl
\ No newline at end of file