mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
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:
@@ -1866,7 +1866,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
{
|
||||
HandleLocateSelectMerc( pNewSoldier->ubID, LOCATEANDSELECT_MERC );
|
||||
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( CurrentSquad( ) + 1 ) );
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( CurrentSquad( ) + 1 ) );
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_SQUAD_ACTIVE ], ( pNewSoldier->bAssignment + 1 ) );
|
||||
|
||||
// Center to guy....
|
||||
LocateSoldier( gusSelectedSoldier, SETLOCATOR );
|
||||
@@ -2327,93 +2328,96 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
|
||||
//CHRISL: Ammo Crate
|
||||
if ( fCtrl )
|
||||
{
|
||||
INT32 crateItem;
|
||||
INT32 worldItem;
|
||||
bool mergeSuccessful;
|
||||
OBJECTTYPE newCrate;
|
||||
//look through all sector items for ammo.
|
||||
for(unsigned int wItem = 0; wItem < guiNumWorldItems; wItem++)
|
||||
if(!(gTacticalStatus.fEnemyInSector))
|
||||
{
|
||||
crateItem = 0;
|
||||
mergeSuccessful = false;
|
||||
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))
|
||||
INT32 crateItem;
|
||||
INT32 worldItem;
|
||||
bool mergeSuccessful;
|
||||
OBJECTTYPE newCrate;
|
||||
//look through all sector items for ammo.
|
||||
for(unsigned int wItem = 0; wItem < guiNumWorldItems; wItem++)
|
||||
{
|
||||
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)
|
||||
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++)
|
||||
crateItem = 0;
|
||||
mergeSuccessful = false;
|
||||
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))
|
||||
{
|
||||
//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)
|
||||
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)
|
||||
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++)
|
||||
{
|
||||
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)
|
||||
{
|
||||
//look through world items first
|
||||
for(unsigned int loop=0; loop < guiNumWorldItems; loop++)
|
||||
{
|
||||
if(gWorldItems[loop].object.usItem == crateItem)
|
||||
//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)
|
||||
{
|
||||
DistributeStatus(&gWorldItems[wItem].object, &gWorldItems[loop].object, Magazine[Item[crateItem].ubClassIndex].ubMagSize);
|
||||
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)
|
||||
{
|
||||
//look through world items first
|
||||
for(unsigned int loop=0; loop < guiNumWorldItems; loop++)
|
||||
{
|
||||
if(gWorldItems[loop].object.usItem == crateItem)
|
||||
{
|
||||
DistributeStatus(&gWorldItems[wItem].object, &gWorldItems[loop].object, Magazine[Item[crateItem].ubClassIndex].ubMagSize);
|
||||
if(gWorldItems[wItem].object.ubNumberOfObjects < 1)
|
||||
{
|
||||
mergeSuccessful = true;
|
||||
RemoveItemFromPool(gWorldItems[wItem].sGridNo,(wItem),gWorldItems[wItem].ubLevel);
|
||||
RemoveItemFromWorld(wItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//no crates in sector inventory. search merc inventories
|
||||
if(mergeSuccessful == false)
|
||||
{
|
||||
for(int loop=0; loop<18; loop++)
|
||||
{
|
||||
if(MercPtrs[loop]->bActive && MercPtrs[loop]->bInSector)
|
||||
{
|
||||
for(unsigned int pocket=0; pocket < MercPtrs[loop]->inv.size(); pocket++)
|
||||
{
|
||||
if(MercPtrs[loop]->inv[pocket].usItem == crateItem)
|
||||
{
|
||||
DistributeStatus(&gWorldItems[wItem].object, &MercPtrs[loop]->inv[pocket], Magazine[Item[crateItem].ubClassIndex].ubMagSize);
|
||||
if(gWorldItems[wItem].object.ubNumberOfObjects < 1)
|
||||
{
|
||||
mergeSuccessful = true;
|
||||
RemoveItemFromPool(gWorldItems[wItem].sGridNo,(wItem),gWorldItems[wItem].ubLevel);
|
||||
RemoveItemFromWorld(wItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(mergeSuccessful == true)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//no crates in merc inventory. create a new sector item
|
||||
if(mergeSuccessful == false)
|
||||
{
|
||||
CreateAmmo(crateItem, &newCrate, 0);
|
||||
DistributeStatus(&gWorldItems[wItem].object, &newCrate, Magazine[Item[crateItem].ubClassIndex].ubMagSize);
|
||||
AddItemToPool(gWorldItems[wItem].sGridNo, &newCrate, 1, gWorldItems[wItem].ubLevel, gWorldItems[wItem].usFlags, gWorldItems[wItem].bRenderZHeightAboveLevel);
|
||||
if(gWorldItems[wItem].object.ubNumberOfObjects < 1)
|
||||
{
|
||||
mergeSuccessful = true;
|
||||
RemoveItemFromPool(gWorldItems[wItem].sGridNo,(wItem),gWorldItems[wItem].ubLevel);
|
||||
RemoveItemFromWorld(wItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//no crates in sector inventory. search merc inventories
|
||||
if(mergeSuccessful == false)
|
||||
{
|
||||
for(int loop=0; loop<18; loop++)
|
||||
{
|
||||
if(MercPtrs[loop]->bActive && MercPtrs[loop]->bInSector)
|
||||
{
|
||||
for(unsigned int pocket=0; pocket < MercPtrs[loop]->inv.size(); pocket++)
|
||||
{
|
||||
if(MercPtrs[loop]->inv[pocket].usItem == crateItem)
|
||||
{
|
||||
DistributeStatus(&gWorldItems[wItem].object, &MercPtrs[loop]->inv[pocket], Magazine[Item[crateItem].ubClassIndex].ubMagSize);
|
||||
if(gWorldItems[wItem].object.ubNumberOfObjects < 1)
|
||||
{
|
||||
mergeSuccessful = true;
|
||||
RemoveItemFromPool(gWorldItems[wItem].sGridNo,(wItem),gWorldItems[wItem].ubLevel);
|
||||
RemoveItemFromWorld(wItem);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(mergeSuccessful == true)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
//no crates in merc inventory. create a new sector item
|
||||
if(mergeSuccessful == false)
|
||||
{
|
||||
CreateAmmo(crateItem, &newCrate, 0);
|
||||
DistributeStatus(&gWorldItems[wItem].object, &newCrate, Magazine[Item[crateItem].ubClassIndex].ubMagSize);
|
||||
AddItemToPool(gWorldItems[wItem].sGridNo, &newCrate, 1, gWorldItems[wItem].ubLevel, gWorldItems[wItem].usFlags, gWorldItems[wItem].bRenderZHeightAboveLevel);
|
||||
if(gWorldItems[wItem].object.ubNumberOfObjects < 1)
|
||||
{
|
||||
mergeSuccessful = true;
|
||||
RemoveItemFromPool(gWorldItems[wItem].sGridNo,(wItem),gWorldItems[wItem].ubLevel);
|
||||
RemoveItemFromWorld(wItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
|
||||
}
|
||||
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pImpButtonText[11] );
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user