diff --git a/GameSettings.cpp b/GameSettings.cpp index 90f4c7b7..a8548f28 100644 --- a/GameSettings.cpp +++ b/GameSettings.cpp @@ -955,8 +955,8 @@ void LoadGameExternalOptions() //################# Sound Settings ################# - gGameExternalOptions.guiWeaponSoundEffectsVolume = iniReader.ReadInteger("Sound Settings","WEAPON_SOUND_EFFECTS_VOLUME",0, 0, 1000 /*1000 = 10x?*/); - + gGameExternalOptions.guiWeaponSoundEffectsVolume = iniReader.ReadInteger("Sound Settings","WEAPON_SOUND_EFFECTS_VOLUME", 0, 0, 1000 /*1000 = 10x?*/); + gGameExternalOptions.gubMaxPercentNoiseSilencedSound = iniReader.ReadInteger("Sound Settings","MAX_PERCENT_NOISE_SILENCED_SOUND", 35, 0, 100 ); //################# Tactical Interface Settings ################# diff --git a/GameSettings.h b/GameSettings.h index 14798f2f..dfaddfe4 100644 --- a/GameSettings.h +++ b/GameSettings.h @@ -435,6 +435,7 @@ typedef struct //Sound settings UINT32 guiWeaponSoundEffectsVolume; + UINT8 gubMaxPercentNoiseSilencedSound; // WDS - Option to turn off stealing BOOLEAN fStealingDisabled; diff --git a/GameVersion.cpp b/GameVersion.cpp index c439ad76..61e9ecc3 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -15,9 +15,9 @@ #ifdef JA2EDITOR #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.6353 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Unfinished Business - Map Editor v1.13.6484 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.6353 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Map Editor v1.13.6484 (Development Build)" }; #endif // ------------------------------ @@ -27,11 +27,11 @@ //DEBUG BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.6353 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: Unfinished Business - v1.13.6484 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.6353 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: JA2 Demo - v1.13.6484 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Debug: v1.13.6353 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Debug: v1.13.6484 (Development Build)" }; #endif #elif defined CRIPPLED_VERSION @@ -46,16 +46,16 @@ //RELEASE BUILD VERSION #ifdef JA2UB - CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.6353 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release Unfinished Business - v1.13.6484 (Development Build)" }; #elif defined (JA113DEMO) - CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.6353 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release JA2 Demo - v1.13.6484 (Development Build)" }; #else - CHAR16 zVersionLabel[256] = { L"Release v1.13.6353 (Development Build)" }; + CHAR16 zVersionLabel[256] = { L"Release v1.13.6484 (Development Build)" }; #endif #endif -CHAR8 czVersionNumber[16] = { "Build 12.08.24" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 13.10.13" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; // SAVE_GAME_VERSION is defined in header, change it there diff --git a/Laptop/BobbyRMailOrder.cpp b/Laptop/BobbyRMailOrder.cpp index 61709716..9320fb1d 100644 --- a/Laptop/BobbyRMailOrder.cpp +++ b/Laptop/BobbyRMailOrder.cpp @@ -394,6 +394,8 @@ void PurchaseBobbyOrder(); UINT32 CalcPackageTotalWeight(); void DisplayPackageWeight( ); void ShutDownBobbyRNewMailOrders(); +// sorts the list of selected items for the mail order screen +void SortBobbyRayPurchases(); //ppp void DrawOrderGoldRectangle(UINT16 usGridX, UINT16 usGridY); @@ -585,6 +587,10 @@ BOOLEAN EnterBobbyRMailOrder() gfRemoveItemsFromStock = FALSE; + // silversurfer: This sorts the list of items that we marked for purchase. + // This helps us get rid of the empty line display errors in the mail order screen. + SortBobbyRayPurchases(); + RenderBobbyRMailOrder(); return(TRUE); } @@ -1022,7 +1028,7 @@ void DisplayPurchasedItems( BOOLEAN fCalledFromOrderPage, UINT16 usGridX, UINT16 UINT8 *pDestBuf; HVOBJECT hArrowHandle; //JMich TODO add a way to check for empty index in the middle of pBobbyRayPurchase - + // silversurfer: Not necessary anymore. Function SortBobbyRayPurchases() will remove any empty indexes for us before we call the mail order screen. //Output the qty DrawTextToScreen(BobbyROrderFormText[BOBBYR_QTY], (UINT16)(usGridX+BOBBYR_GRID_FIRST_COLUMN_X), (UINT16)(usGridY+BOBBYR_GRID_FIRST_COLUMN_Y-BOBBYR_GRID_TITLE_OFFSET), BOBBYR_GRID_FIRST_COLUMN_WIDTH, BOBBYR_ORDER_STATIC_TEXT_FONT, BOBBYR_ORDER_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED); @@ -2153,15 +2159,20 @@ void SelectGridScrollColumnMovementCallBack(MOUSE_REGION * pRegion, INT32 reason pRegion->uiFlags |= BUTTON_CLICKED_ON ; + // scroll up if( ubPurchaseNumber < gubPurchaseAtTopOfList ) { - gubPurchaseAtTopOfList = ubPurchaseNumber; + gubPurchaseAtTopOfList = ubPurchaseNumber; } + // scroll down if( ubPurchaseNumber > gubPurchaseAtTopOfList ) { - if( ( ubPurchaseNumber - gubPurchaseAtTopOfList ) >= BOBBYR_NUM_DISPLAYED_ITEMS ) - gubPurchaseAtTopOfList = ubPurchaseNumber - BOBBYR_NUM_DISPLAYED_ITEMS + 1; + // silversurfer: No idea what this was supposed to do. We always have only BOBBYR_NUM_DISPLAYED_ITEMS in the list. + // Why should we handle scrolling up and down differently? +/* if( ( ubPurchaseNumber - gubPurchaseAtTopOfList ) >= BOBBYR_NUM_DISPLAYED_ITEMS ) + gubPurchaseAtTopOfList = ubPurchaseNumber - BOBBYR_NUM_DISPLAYED_ITEMS + 1; */ + gubPurchaseAtTopOfList = ubPurchaseNumber; } gfReDrawBobbyOrder = TRUE; gfBobbyRShipmentsDirty = TRUE; @@ -2826,7 +2837,37 @@ UINT16 CountNumberOfBobbyPurchasesThatAreInTransit() return( usItemCount ); } +void SortBobbyRayPurchases() +{ + INT16 ubLastEmptyIndex = -1; + for ( UINT8 i = 0; i < gGameExternalOptions.ubBobbyRayMaxPurchaseAmount; i++ ) + { + // we have no item here + if ( BobbyRayPurchases[i].ubNumberPurchased == 0 ) + { + // store this index as the first last empty index + if ( ubLastEmptyIndex < 0 ) + ubLastEmptyIndex = i; + } + else + { + if ( ubLastEmptyIndex >= 0 ) + { + // move data to last empty index + BobbyRayPurchases[ubLastEmptyIndex] = BobbyRayPurchases[i]; + // clean up data + BobbyRayPurchases[i].bItemQuality = 0; + BobbyRayPurchases[i].fUsed = 0; + BobbyRayPurchases[i].ubNumberPurchased = 0; + BobbyRayPurchases[i].usBobbyItemIndex = 0; + BobbyRayPurchases[i].usItemIndex = 0; + // set new last empty index + ubLastEmptyIndex++; + } + } + } +} BOOLEAN NewWayOfSavingBobbyRMailOrdersToSaveGameFile( HWFILE hFile ) { diff --git a/Tactical/LOS.cpp b/Tactical/LOS.cpp index 59a5fc3a..ae98eaca 100644 --- a/Tactical/LOS.cpp +++ b/Tactical/LOS.cpp @@ -5768,7 +5768,7 @@ INT8 FireBulletGivenTargetTrapOnly( SOLDIERTYPE* pThrower, OBJECTTYPE* pObj, INT { // Switch on silencer... UINT16 noisefactor = GetPercentNoiseVolume( pObj ); - if( noisefactor < MAX_PERCENT_NOISE_VOLUME_FOR_SILENCED_SOUND || Weapon[ pObj->usItem ].ubAttackVolume <= 10 ) + if( noisefactor < gGameExternalOptions.gubMaxPercentNoiseSilencedSound || Weapon[ pObj->usItem ].ubAttackVolume <= 10 ) { INT32 uiSound; diff --git a/Tactical/Soldier Ani.cpp b/Tactical/Soldier Ani.cpp index bb1b9ca9..58ecc1e7 100644 --- a/Tactical/Soldier Ani.cpp +++ b/Tactical/Soldier Ani.cpp @@ -406,7 +406,7 @@ BOOLEAN AdjustToNextAnimationFrame( SOLDIERTYPE *pSoldier ) { // Switch on silencer... INT16 noisefactor = GetPercentNoiseVolume( pObjUsed ); - if( noisefactor < MAX_PERCENT_NOISE_VOLUME_FOR_SILENCED_SOUND || Weapon[ usedGun ].ubAttackVolume <= 10 ) + if( noisefactor < gGameExternalOptions.gubMaxPercentNoiseSilencedSound || Weapon[ usedGun ].ubAttackVolume <= 10 ) { INT32 uiSound; diff --git a/Tactical/Weapons.cpp b/Tactical/Weapons.cpp index cb304132..8e4f64bd 100644 --- a/Tactical/Weapons.cpp +++ b/Tactical/Weapons.cpp @@ -1812,7 +1812,7 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo ) // IF we are silenced? noisefactor = GetPercentNoiseVolume( pObjAttHand ); - if( noisefactor < MAX_PERCENT_NOISE_VOLUME_FOR_SILENCED_SOUND || Weapon[ usUBItem ].ubAttackVolume <= 10 ) + if( noisefactor < gGameExternalOptions.gubMaxPercentNoiseSilencedSound || Weapon[ usUBItem ].ubAttackVolume <= 10 ) { // Pick sound file baed on how many bullets we are going to fire... sprintf( zBurstString, gzBurstSndStrings[ Weapon[ usUBItem ].sSilencedBurstSound ], bShotsToFire ); @@ -1869,7 +1869,7 @@ BOOLEAN UseGunNCTH( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo ) { // Switch on silencer... UINT16 noisefactor = GetPercentNoiseVolume( pObjAttHand ); - if( noisefactor < MAX_PERCENT_NOISE_VOLUME_FOR_SILENCED_SOUND || Weapon[ usUBItem ].ubAttackVolume <= 10 ) + if( noisefactor < gGameExternalOptions.gubMaxPercentNoiseSilencedSound || Weapon[ usUBItem ].ubAttackVolume <= 10 ) { INT32 uiSound; @@ -2390,7 +2390,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo ) // IF we are silenced? UINT16 noisefactor = GetPercentNoiseVolume( pObjUsed ); - if( noisefactor < MAX_PERCENT_NOISE_VOLUME_FOR_SILENCED_SOUND || Weapon[ usUBItem ].ubAttackVolume <= 10 ) + if( noisefactor < gGameExternalOptions.gubMaxPercentNoiseSilencedSound || Weapon[ usUBItem ].ubAttackVolume <= 10 ) { // Pick sound file baed on how many bullets we are going to fire... sprintf( zBurstString, gzBurstSndStrings[ Weapon[ usUBItem ].sSilencedBurstSound ], bShotsToFire ); @@ -2447,7 +2447,7 @@ BOOLEAN UseGun( SOLDIERTYPE *pSoldier , INT32 sTargetGridNo ) { // Switch on silencer... UINT16 noisefactor = GetPercentNoiseVolume( pObjUsed ); - if( noisefactor < MAX_PERCENT_NOISE_VOLUME_FOR_SILENCED_SOUND || Weapon[ usUBItem ].ubAttackVolume <= 10 ) + if( noisefactor < gGameExternalOptions.gubMaxPercentNoiseSilencedSound || Weapon[ usUBItem ].ubAttackVolume <= 10 ) { INT32 uiSound; diff --git a/Tactical/Weapons.h b/Tactical/Weapons.h index c8980b6c..0bbc5d2c 100644 --- a/Tactical/Weapons.h +++ b/Tactical/Weapons.h @@ -47,7 +47,8 @@ void HandleTacticalEffectsOfEquipmentChange( SOLDIERTYPE *pSoldier, UINT32 uiInv #define SOLID_SLUG_RANGE_BONUS 65 #define DUCKBILL_RANGE_BONUS 40 -#define MAX_PERCENT_NOISE_VOLUME_FOR_SILENCED_SOUND 50 //35 silversurfer changed that to make sound suppressors always play the silenced sound +// silversurfer: externalized this to gGameExternalOptions.gubMaxPercentNoiseSilencedSound +//#define MAX_PERCENT_NOISE_VOLUME_FOR_SILENCED_SOUND 35 // JA2 GOLD: for weapons and attachments, give penalties only for status values below 85 #define WEAPON_STATUS_MOD( x ) ( (x) >= 85 ? 100 : (((x) * 100) / 85) )