Implemented new IMP gear selection interface to replace the dropdown menus. Requires GameDir rev 2652.

Enrico's letter is forced to the first hired merc in old inventory, similar to new inventory in case a free item pocket is not found.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@9391 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Asdow
2022-08-01 21:15:34 +00:00
parent 058a2cd40f
commit 1f095b7d31
14 changed files with 1553 additions and 868 deletions
+64 -1
View File
@@ -40,7 +40,6 @@ UINT32 guiATTRIBUTEBAR;
UINT32 guiBUTTON2IMAGE;
UINT32 guiBUTTON1IMAGE;
UINT32 guiBUTTON4IMAGE;
//UINT32 guiPORTRAITFRAME; // duplicate definition, look up a few lines (jonathanl)
UINT32 guiMAININDENT;
UINT32 guiLONGINDENT;
UINT32 guiSHORTINDENT;
@@ -56,6 +55,10 @@ UINT32 guiSHORT2HINDENT;
// These 2 added - SANDRO
UINT32 guiASTARTLEVEL;
UINT32 guiCOLORCHOICEFRAME;
UINT32 gIMPINVENTORY;
SGPRectangle gIMPGearLayout;
SGPRectangle gIMPInvPoolLayout;
// position defines
#define CHAR_PROFILE_BACKGROUND_TILE_WIDTH 125
@@ -1495,3 +1498,63 @@ void RenderColorChoiceFrame(INT16 sX, INT16 sY)
BOOLEAN LoadImpGearSelection(void)
{
VOBJECT_DESC VObjectDesc;
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
//if (UsingNewInventorySystem())
{
FilenameForBPP("INTERFACE\\ImpGearSelection.sti", VObjectDesc.ImageFile);
}
CHECKF(AddVideoObject(&VObjectDesc, &gIMPINVENTORY));
gIMPGearLayout = { LAPTOP_SCREEN_UL_X + 37, LAPTOP_SCREEN_WEB_UL_Y + 48, 429, 257 };
if (!UsingNewInventorySystem())
{
gIMPGearLayout = { LAPTOP_SCREEN_UL_X + 118, LAPTOP_SCREEN_WEB_UL_Y + 48, 261, 249 };
}
gIMPInvPoolLayout = { LAPTOP_SCREEN_UL_X + 57, LAPTOP_SCREEN_WEB_UL_Y + 68, 389, 217};
return (TRUE);
}
void DeleteImpGearSelection(void)
{
DeleteVideoObjectFromIndex(gIMPINVENTORY);
return;
}
extern BOOLEAN Blt8BPPDataTo16BPPBufferTransparent(UINT16* pBuffer, UINT32 uiDestPitchBYTES, HVOBJECT hSrcVObject, INT32 iX, INT32 iY, UINT16 usIndex);
void RenderImpGearSelection(void)
{
UINT32 uiDestPitchBYTES;
UINT16* pDestBuf;
HVOBJECT hCharListHandle;
UINT8 stiIndex = 0;
if (!UsingNewInventorySystem())
{
stiIndex = 5;
}
pDestBuf = (UINT16*)LockVideoSurface(FRAME_BUFFER, &uiDestPitchBYTES);
GetVideoObject(&hCharListHandle, gIMPINVENTORY);
Blt8BPPDataTo16BPPBufferTransparent(pDestBuf, uiDestPitchBYTES, hCharListHandle, gIMPGearLayout.x, gIMPGearLayout.y, stiIndex);
UnLockVideoSurface(FRAME_BUFFER);
}
void RenderImpGearSelectionGrid(void)
{
UINT32 uiDestPitchBYTES;
UINT16* pDestBuf;
HVOBJECT hCharListHandle;
UINT8 stiIndex = 1;
pDestBuf = (UINT16*)LockVideoSurface(FRAME_BUFFER, &uiDestPitchBYTES);
GetVideoObject(&hCharListHandle, gIMPINVENTORY);
Blt8BPPDataTo16BPPBufferTransparent(pDestBuf, uiDestPitchBYTES, hCharListHandle, gIMPInvPoolLayout.x, gIMPInvPoolLayout.y, stiIndex);
UnLockVideoSurface(FRAME_BUFFER);
}