Build1936

Minor adjustments to some of the rendering functions to grant a bit more control to the code.
Adjusted the mouse areas for key and item popup windows.
Added the pocket capacity indicator to sector inventory when using NewInv mode.
Added the right click option to sector inventory so you can view/manipulate stacks and view item descriptions without first equiping an item.
Updated sector inventory so that capacity values appear in all pockets.  Not just currently filled one.
Updated sector inventory so that newly placed items could be right-clicked on for details.
Increased the mouse region for the various stack popups so there is always room to close the popup without activating the description box.
Fixed a bug in the sector inventory description panel that caused a crash when trying to remove an attachment.
Fixed sector inventory so you can add attachments to weapons.
Fixed some weight issues.
Fixed a crash resulting from right-clicking in sector inventory while Item Desc window was already open.
Fixed the "Active Squad" message so it displays the squad that is actually activated.
Fixed a bug that allowed you to start a new game in NewInv mode while in 640x480 resolution.
Updated the Item Description windows so you can load a gun as well as unload.
Added new CTRL+SHIFT+D hotkey to delete all items in sector.
Added new CTRL+SHIFT+S hotkey to sell all items in sector, assuming you have the ALT+LMB option turned on in your INI file.
Fixed a problem with sector inventory item description where the status did not appear for items that couldn't stack.
Fixed a problem with Nails so he always starts with his leather jacket, even if you don't buy his gear.
Incorporated a failsafe so that NewInv mode can't be selected, nor NIV saves loaded, when no custom data path is set.
Add new IC_BELTCLIP item class.
Update pocket definition restrictions to use bitwise compare.
Add failsafe so that you can't merge LBENODEs.
Reset VC2005 so it doesn't point to a specific drive.


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@1936 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
ChrisL
2008-03-29 20:35:03 +00:00
parent 2ff5aabf24
commit bdcc920c63
32 changed files with 603 additions and 180 deletions
+104 -1
View File
@@ -506,6 +506,8 @@ extern UINT16 usVehicleY;
//void DeleteButtonsForScrolling(void);
void BtnMessageUpMapScreenCallback( GUI_BUTTON *btn,INT32 reason );
void BeginSellAllCallBack( UINT8 bExitValue );
void BeginDeleteAllCallBack( UINT8 bExitValue );
BOOLEAN fScrollButtonsInitialized = FALSE;
BOOLEAN fFlashAssignDone = FALSE;
@@ -1049,6 +1051,7 @@ void MapscreenMarkButtonsDirty();
extern BOOLEAN CanRedistributeMilitiaInSector( INT16 sClickedSectorX, INT16 sClickedSectorY, INT8 bClickedTownId );
extern INT32 GetNumberOfMercsInUpdateList( void );
extern INT32 SellItem( OBJECTTYPE& object, BOOLEAN useModifier = TRUE );
void DeleteAllItemsInInventoryPool();
@@ -1058,6 +1061,70 @@ void DumpSectorDifficultyInfo( void );
void DumpItemsList( void );
#endif
void BeginSellAllCallBack( UINT8 bExitValue )
{
INT32 iPrice = 0;
bool anythingSold = false;
if( bExitValue == MSG_BOX_RETURN_YES )
{
fRestoreBackgroundForMessageBox = TRUE;
if ( gpItemPointer != NULL )
{
return;
}
for(UINT32 wItem = 0; wItem < guiNumWorldItems; wItem++)
{
if(0 == pInventoryPoolList[wItem].object.MoveThisObjectTo(gItemPointer,-1,0,NUM_INV_SLOTS,MAX_OBJECTS_PER_SLOT))
{
if (pInventoryPoolList[wItem].object.exists() == false) {
pInventoryPoolList[wItem].object.initialize();
}
// Dirty interface
fMapPanelDirty = TRUE;
gpItemPointer = &gItemPointer;
// Sell Item
iPrice += SellItem( gItemPointer );
gpItemPointer = NULL;
fMapInventoryItem = FALSE;
if (iPrice == 0) {
iPrice = 1;
}
anythingSold = true;
HandleButtonStatesWhileMapInventoryActive();
}
}
if(anythingSold == true)
AddTransactionToPlayersBook( SOLD_ITEMS, 0, GetWorldTotalMin(), iPrice );
}
}
void BeginDeleteAllCallBack( UINT8 bExitValue )
{
if( bExitValue == MSG_BOX_RETURN_YES )
{
fRestoreBackgroundForMessageBox = TRUE;
if ( gpItemPointer != NULL )
{
return;
}
for(UINT32 wItem = 0; wItem < guiNumWorldItems; wItem++)
{
if(0 == pInventoryPoolList[wItem].object.MoveThisObjectTo(gItemPointer,-1,0,NUM_INV_SLOTS,MAX_OBJECTS_PER_SLOT))
{
if (pInventoryPoolList[wItem].object.exists() == false) {
pInventoryPoolList[wItem].object.initialize();
}
// Dirty interface
fMapPanelDirty = TRUE;
gpItemPointer = &gItemPointer;
// Delete Item
gpItemPointer = NULL;
fMapInventoryItem = FALSE;
}
}
}
}
// CHRISL: New functions to handle initialization of inventory coordinates
BOOLEAN InitializeInvPanelCoordsOld()
@@ -4649,7 +4716,7 @@ UINT32 MapScreenHandle(void)
// handle video overlays
ExecuteVideoOverlays( );
if ( InItemStackPopup( ) )
if ( InItemStackPopup( ) || InSectorStackPopup( ) )
{
RenderItemStackPopup( FALSE );
}
@@ -6137,6 +6204,23 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
#endif
break;
case 'D':
if( fCtrl )
{
//CHRISL: Delete all items
if(!fShowMapInventoryPool)
{
fShowMapInventoryPool = TRUE;
CreateDestroyMapInventoryPoolButtons( TRUE );
}
DoMessageBox( MSG_BOX_BASIC_STYLE, NewInvMessage[NIV_DELETE_ALL], guiCurrentScreen, ( UINT8 )MSG_BOX_FLAG_YESNO, BeginDeleteAllCallBack, NULL );
if(fShowMapInventoryPool)
{
fShowMapInventoryPool = FALSE;
}
}
break;
case 'e':
if( gfPreBattleInterfaceActive )
{ //activate enter sector in prebattle interface.
@@ -6462,6 +6546,25 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
RequestTriggerExitFromMapscreen( MAP_EXIT_TO_SAVE );
}
break;
case 'S':
if( fCtrl )
{
//CHRISL: Sell all items
if(gGameExternalOptions.fSellAll == TRUE)
{
if(!fShowMapInventoryPool)
{
fShowMapInventoryPool = TRUE;
CreateDestroyMapInventoryPoolButtons( TRUE );
}
DoMessageBox( MSG_BOX_BASIC_STYLE, NewInvMessage[NIV_SELL_ALL], guiCurrentScreen, ( UINT8 )MSG_BOX_FLAG_YESNO, BeginSellAllCallBack, NULL );
if(fShowMapInventoryPool)
{
fShowMapInventoryPool = FALSE;
}
}
}
break;
case 't':
// Teleport: CTRL-T
if( ( fCtrl )&&( CHEATER_CHEAT_LEVEL( ) ) )