use FormatMoney everywhere

This commit is contained in:
Marco Antonio J. Costa
2025-10-08 05:36:37 -03:00
committed by majcosta
parent 0dd32c4670
commit 3d29eff4d8
25 changed files with 160 additions and 477 deletions
+1 -7
View File
@@ -1398,7 +1398,6 @@ BOOLEAN DisplaySaveGameEntry( INT32 bEntryID )
CHAR16 zDateString[128]; CHAR16 zDateString[128];
CHAR16 zLocationString[128]; CHAR16 zLocationString[128];
CHAR16 zNumMercsString[128]; CHAR16 zNumMercsString[128];
CHAR16 zBalanceString[128];
SAVED_GAME_HEADER SaveGameHeader; SAVED_GAME_HEADER SaveGameHeader;
HVOBJECT hPixHandle; HVOBJECT hPixHandle;
UINT16 usPosX=SLG_FIRST_SAVED_SPOT_X; UINT16 usPosX=SLG_FIRST_SAVED_SPOT_X;
@@ -1669,11 +1668,6 @@ BOOLEAN DisplaySaveGameEntry( INT32 bEntryID )
} }
} }
//Get the current balance
swprintf( zBalanceString, L"%d", SaveGameHeader.iCurrentBalance);
InsertCommasForDollarFigure( zBalanceString );
InsertDollarSignInToString( zBalanceString );
// //
// Display the Saved game information // Display the Saved game information
// //
@@ -1692,7 +1686,7 @@ BOOLEAN DisplaySaveGameEntry( INT32 bEntryID )
//The balance //The balance
if(!is_networked) if(!is_networked)
DrawTextToScreen( zBalanceString, (UINT16)(usPosX+SLG_BALANCE_OFFSET_X), (UINT16)(usPosY+SLG_BALANCE_OFFSET_Y), 0, uiFont, ubFontColor, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(FormatMoney(SaveGameHeader.iCurrentBalance).data(), (UINT16)(usPosX + SLG_BALANCE_OFFSET_X), (UINT16)(usPosY + SLG_BALANCE_OFFSET_Y), 0, uiFont, ubFontColor, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
if( gbSaveGameArray[ VAL_SLOT_START + bEntryID ] || ( gfSaveGame && !gfUserInTextInputMode && ( gbSelectedSaveLocation == bEntryID ) ) ) if( gbSaveGameArray[ VAL_SLOT_START + bEntryID ] || ( gfSaveGame && !gfUserInTextInputMode && ( gbSelectedSaveLocation == bEntryID ) ) )
{ {
+11 -35
View File
@@ -1099,7 +1099,6 @@ BOOLEAN RenderAIMMembers()
HVOBJECT hPriceHandle; HVOBJECT hPriceHandle;
HVOBJECT hWeaponBoxHandle; HVOBJECT hWeaponBoxHandle;
UINT16 x, uiPosX; UINT16 x, uiPosX;
CHAR16 wTemp[50];
DrawAimDefaults(); DrawAimDefaults();
@@ -1144,11 +1143,8 @@ BOOLEAN RenderAIMMembers()
//Display Option Gear Cost text //Display Option Gear Cost text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_MEMBER_OPTIONAL_GEAR_X_NSGI, EXPLOSIVE_Y_NSGI, AIM_CONTRACT_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED );
swprintf(wTemp, L"%d", gMercProfiles[gbCurrentSoldier].usOptionalGearCost);
InsertCommasForDollarFigure( wTemp );
InsertDollarSignInToString( wTemp );
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5; uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X_NSGI + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR_NSGI], AIM_M_FONT_STATIC_TEXT) + 5;
DrawTextToScreen(wTemp, AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].usOptionalGearCost).data(), AIM_MEMBER_OPTIONAL_GEAR_COST_X_NSGI, EXPLOSIVE_Y_NSGI, FEE_WIDTH_NSGI, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
#endif // JA2UB #endif // JA2UB
} }
else else
@@ -1191,11 +1187,8 @@ BOOLEAN RenderAIMMembers()
//Display Option Gear Cost text //Display Option Gear Cost text
DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_MEMBER_OPTIONAL_GEAR_X, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_STATIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
swprintf(wTemp, L"%d", gMercProfiles[gbCurrentSoldier].usOptionalGearCost);
InsertCommasForDollarFigure( wTemp );
InsertDollarSignInToString( wTemp );
uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5; uiPosX = AIM_MEMBER_OPTIONAL_GEAR_X + StringPixLength( CharacterInfo[AIM_MEMBER_OPTIONAL_GEAR], AIM_M_FONT_STATIC_TEXT) + 5;
DrawTextToScreen(wTemp, uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen(FormatMoney(gMercProfiles[gbCurrentSoldier].usOptionalGearCost).data(), uiPosX, AIM_MEMBER_OPTIONAL_GEAR_Y, 0, AIM_M_FONT_STATIC_TEXT, AIM_M_COLOR_DYNAMIC_TEXT, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
#endif #endif
} }
@@ -1337,15 +1330,10 @@ BOOLEAN UpdateMercInfo(void)
//if medical deposit is required //if medical deposit is required
if( gMercProfiles[gbCurrentSoldier].bMedicalDeposit ) if( gMercProfiles[gbCurrentSoldier].bMedicalDeposit )
{ {
CHAR16 zTemp[40];
CHAR16 sMedicalString[40]; CHAR16 sMedicalString[40];
// Display the medical cost // Display the medical cost
swprintf( zTemp, L"%d", gMercProfiles[ gbCurrentSoldier ].sMedicalDepositAmount ); swprintf( sMedicalString, L"%s %s", FormatMoney(gMercProfiles[gbCurrentSoldier].sMedicalDepositAmount).data(), CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
InsertCommasForDollarFigure( zTemp );
InsertDollarSignInToString( zTemp );
swprintf( sMedicalString, L"%s %s", zTemp, CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
// If the string will be displayed in more then 2 lines, recenter the string // If the string will be displayed in more then 2 lines, recenter the string
if( ( DisplayWrappedString( 0, 0, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | DONT_DISPLAY_TEXT ) / GetFontHeight( AIM_FONT12ARIAL ) ) > 2 ) if( ( DisplayWrappedString( 0, 0, AIM_MEDICAL_DEPOSIT_WIDTH_NSGI, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | DONT_DISPLAY_TEXT ) / GetFontHeight( AIM_FONT12ARIAL ) ) > 2 )
@@ -1403,11 +1391,7 @@ BOOLEAN UpdateMercInfo(void)
CHAR16 sMedicalString[40]; CHAR16 sMedicalString[40];
// Display the medical cost // Display the medical cost
swprintf( zTemp, L"%d", gMercProfiles[ gbCurrentSoldier ].sMedicalDepositAmount ); swprintf( sMedicalString, L"%s %s", FormatMoney(gMercProfiles[gbCurrentSoldier].sMedicalDepositAmount).data(), CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
InsertCommasForDollarFigure( zTemp );
InsertDollarSignInToString( zTemp );
swprintf( sMedicalString, L"%s %s", zTemp, CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
// If the string will be displayed in more then 2 lines, recenter the string // If the string will be displayed in more then 2 lines, recenter the string
if( ( DisplayWrappedString( 0, 0, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | DONT_DISPLAY_TEXT ) / GetFontHeight( AIM_FONT12ARIAL ) ) > 2 ) if( ( DisplayWrappedString( 0, 0, AIM_MEDICAL_DEPOSIT_WIDTH, 2, AIM_FONT12ARIAL, AIM_M_COLOR_DYNAMIC_TEXT, sMedicalString, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED | DONT_DISPLAY_TEXT ) / GetFontHeight( AIM_FONT12ARIAL ) ) > 2 )
@@ -2686,7 +2670,6 @@ void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
UINT32 DisplayMercChargeAmount() UINT32 DisplayMercChargeAmount()
{ {
CHAR16 wTemp[50]; CHAR16 wTemp[50];
CHAR16 wDollarTemp[50];
HVOBJECT hImageHandle; HVOBJECT hImageHandle;
@@ -2732,24 +2715,17 @@ UINT32 DisplayMercChargeAmount()
} }
swprintf( wDollarTemp, L"%d", giContractAmount);
InsertCommasForDollarFigure( wDollarTemp );
InsertDollarSignInToString( wDollarTemp );
//if the merc hasnt just been hired //if the merc hasnt just been hired
// if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL ) // if( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL )
{ {
#ifdef JA2UB auto contractAmount{ FormatMoney(giContractAmount) };
// Don't even have to pay for medical insurance! What a DEAL! #ifndef JA2UB
swprintf(wTemp, L"%s", wDollarTemp); if (gMercProfiles[gbCurrentSoldier].bMedicalDeposit)
#else contractAmount += L" ";
if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit ) contractAmount += VideoConfercingText[AIM_MEMBER_WITH_MEDICAL];
swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] ); #endif
else
swprintf(wTemp, L"%s", wDollarTemp );
#endif // JA2UB
DrawTextToScreen(wTemp, AIM_CONTRACT_CHARGE_AMOUNNT_X+1, AIM_CONTRACT_CHARGE_AMOUNNT_Y+3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen(contractAmount.data(), AIM_CONTRACT_CHARGE_AMOUNNT_X + 1, AIM_CONTRACT_CHARGE_AMOUNNT_Y + 3, 0, AIM_M_VIDEO_CONTRACT_AMOUNT_FONT, AIM_M_VIDEO_CONTRACT_AMOUNT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
} }
return(giContractAmount); return(giContractAmount);
+3 -12
View File
@@ -1424,8 +1424,6 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
UINT8 ubCount=0; UINT8 ubCount=0;
UINT16 PosY, usTextPosY; UINT16 PosY, usTextPosY;
UINT16 usItemIndex; UINT16 usItemIndex;
CHAR16 sDollarTemp[60];
CHAR16 sTemp[60];
CHAR16 sPage[60]; CHAR16 sPage[60];
INT16 pItemNumbers[ BOBBYR_NUM_WEAPONS_ON_PAGE ]; INT16 pItemNumbers[ BOBBYR_NUM_WEAPONS_ON_PAGE ];
BOOLEAN bAddItem = FALSE; BOOLEAN bAddItem = FALSE;
@@ -1434,11 +1432,8 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
usTextPosY = BOBBYR_ITEM_DESC_START_Y; usTextPosY = BOBBYR_ITEM_DESC_START_Y;
//Display the subtotal at the bottom of the screen //Display the subtotal at the bottom of the screen
swprintf( sDollarTemp, L"%d", CalculateTotalPurchasePrice() ); auto subtotal{ std::wstring(BobbyRText[BOBBYR_GUNS_SUB_TOTAL]) + std::wstring(L" ") + FormatMoney(CalculateTotalPurchasePrice()) };
InsertCommasForDollarFigure( sDollarTemp ); DrawTextToScreen(subtotal.data(), BOBBYR_ORDER_SUBTOTAL_X, BOBBYR_ORDER_SUBTOTAL_Y, 0, BOBBYR_ORDER_TITLE_FONT, BOBBYR_ORDER_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED | TEXT_SHADOWED);
InsertDollarSignInToString( sDollarTemp );
swprintf( sTemp, L"%s %s", BobbyRText[BOBBYR_GUNS_SUB_TOTAL], sDollarTemp );
DrawTextToScreen(sTemp, BOBBYR_ORDER_SUBTOTAL_X, BOBBYR_ORDER_SUBTOTAL_Y, 0, BOBBYR_ORDER_TITLE_FONT, BOBBYR_ORDER_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED | TEXT_SHADOWED);
//Buggler: Display the current page & total pages at the bottom of the screen //Buggler: Display the current page & total pages at the bottom of the screen
swprintf( sPage, L"%d / %d", gubCurPage + 1, gubNumPages ); swprintf( sPage, L"%d / %d", gubCurPage + 1, gubNumPages );
@@ -2059,11 +2054,7 @@ UINT16 DisplayCostAndQty(UINT16 usPosY, UINT16 usIndex, UINT16 usFontHeight, UIN
DrawTextToScreen(BobbyRText[BOBBYR_GUNS_COST], BOBBYR_ITEM_COST_TEXT_X, (UINT16)usPosY, BOBBYR_ITEM_COST_TEXT_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen(BobbyRText[BOBBYR_GUNS_COST], BOBBYR_ITEM_COST_TEXT_X, (UINT16)usPosY, BOBBYR_ITEM_COST_TEXT_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
usPosY += usFontHeight + 2; usPosY += usFontHeight + 2;
swprintf(sTemp, L"%d", CalcBobbyRayCost( usIndex, usBobbyIndex, fUsed )); DrawTextToScreen(FormatMoney(CalcBobbyRayCost(usIndex, usBobbyIndex, fUsed)).data(), BOBBYR_ITEM_COST_NUM_X, (UINT16)usPosY, BOBBYR_ITEM_COST_TEXT_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp );
DrawTextToScreen(sTemp, BOBBYR_ITEM_COST_NUM_X, (UINT16)usPosY, BOBBYR_ITEM_COST_TEXT_WIDTH, BOBBYR_ITEM_DESC_TEXT_FONT, BOBBYR_ITEM_DESC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
usPosY += usFontHeight + 2; usPosY += usFontHeight + 2;
+12 -43
View File
@@ -1127,19 +1127,11 @@ void DisplayPurchasedItems( BOOLEAN fCalledFromOrderPage, UINT16 usGridX, UINT16
DrawTextToScreen(sText, (UINT16)(usGridX+BOBBYR_GRID_THIRD_COLUMN_X+2), usPosY, BOBBYR_GRID_THIRD_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED); DrawTextToScreen(sText, (UINT16)(usGridX+BOBBYR_GRID_THIRD_COLUMN_X+2), usPosY, BOBBYR_GRID_THIRD_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED);
//unit price //unit price
swprintf(sTemp, L"%d", CalcBobbyRayCost( pBobbyRayPurchase[i].usItemIndex, pBobbyRayPurchase[i].usBobbyItemIndex, pBobbyRayPurchase[i].fUsed )); DrawTextToScreen(FormatMoney(CalcBobbyRayCost(pBobbyRayPurchase[i].usItemIndex, pBobbyRayPurchase[i].usBobbyItemIndex, pBobbyRayPurchase[i].fUsed)).data(), (UINT16)(usGridX+BOBBYR_GRID_FOURTH_COLUMN_X-2), usPosY, BOBBYR_GRID_FOURTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp );
DrawTextToScreen(sTemp, (UINT16)(usGridX+BOBBYR_GRID_FOURTH_COLUMN_X-2), usPosY, BOBBYR_GRID_FOURTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
uiTotal += CalcBobbyRayCost( pBobbyRayPurchase[i].usItemIndex, pBobbyRayPurchase[i].usBobbyItemIndex, pBobbyRayPurchase[i].fUsed ) * pBobbyRayPurchase[i].ubNumberPurchased; uiTotal += CalcBobbyRayCost( pBobbyRayPurchase[i].usItemIndex, pBobbyRayPurchase[i].usBobbyItemIndex, pBobbyRayPurchase[i].fUsed ) * pBobbyRayPurchase[i].ubNumberPurchased;
swprintf(sTemp, L"%d", uiTotal ); DrawTextToScreen(FormatMoney(uiTotal).data(), (UINT16)(usGridX+BOBBYR_GRID_FIFTH_COLUMN_X-2), usPosY, BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp );
DrawTextToScreen(sTemp, (UINT16)(usGridX+BOBBYR_GRID_FIFTH_COLUMN_X-2), usPosY, BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
usPosY += BOBBYR_GRID_ROW_OFFSET; usPosY += BOBBYR_GRID_ROW_OFFSET;
} }
@@ -1259,7 +1251,6 @@ void DisplayPurchasedItems( BOOLEAN fCalledFromOrderPage, UINT16 usGridX, UINT16
void DisplayShippingCosts( BOOLEAN fCalledFromOrderPage, INT32 iSubTotal, UINT16 usGridX, UINT16 usGridY, INT32 iOrderNum ) void DisplayShippingCosts( BOOLEAN fCalledFromOrderPage, INT32 iSubTotal, UINT16 usGridX, UINT16 usGridY, INT32 iOrderNum )
{ {
CHAR16 sTemp[20];
HVOBJECT hPixHandle; HVOBJECT hPixHandle;
INT32 iShippingCost = 0; INT32 iShippingCost = 0;
// INT32 iTotal; // INT32 iTotal;
@@ -1331,27 +1322,15 @@ void DisplayShippingCosts( BOOLEAN fCalledFromOrderPage, INT32 iSubTotal, UINT16
if( iSubTotal ) if( iSubTotal )
{ {
//Display the subtotal //Display the subtotal
swprintf(sTemp, L"%d", iSubTotal ); DrawTextToScreen(FormatMoney(iSubTotal).data(), (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X - 2), (UINT16)(usGridY + BOBBYR_SUBTOTAL_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp );
DrawTextToScreen(sTemp, (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X-2), (UINT16)(usGridY + BOBBYR_SUBTOTAL_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
//Display the shipping and handling charge //Display the shipping and handling charge
swprintf(sTemp, L"%d", iShippingCost ); DrawTextToScreen(FormatMoney(iShippingCost).data(), (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X - 2), (UINT16)(usGridY + BOBBYR_SHIPPING_N_HANDLE_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp );
DrawTextToScreen(sTemp, (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X-2), (UINT16)(usGridY + BOBBYR_SHIPPING_N_HANDLE_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
//Display the grand total //Display the grand total
giGrandTotal = iSubTotal + iShippingCost; giGrandTotal = iSubTotal + iShippingCost;
swprintf(sTemp, L"%d", giGrandTotal ); DrawTextToScreen(FormatMoney(giGrandTotal).data(), (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X - 2), (UINT16)(usGridY + BOBBYR_GRAND_TOTAL_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp );
DrawTextToScreen(sTemp, (UINT16)(usGridX + BOBBYR_GRID_FIFTH_COLUMN_X-2), (UINT16)(usGridY + BOBBYR_GRAND_TOTAL_Y), BOBBYR_GRID_FIFTH_COLUMN_WIDTH, BOBBYR_ORDER_DYNAMIC_TEXT_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
} }
InvalidateRegion(iScreenWidthOffset + 333,iScreenHeightOffset + 326,iScreenWidthOffset + 374,iScreenHeightOffset + 400); InvalidateRegion(iScreenWidthOffset + 333,iScreenHeightOffset + 326,iScreenWidthOffset + 374,iScreenHeightOffset + 400);
@@ -1830,7 +1809,7 @@ void DrawSelectedCity( UINT8 ubCityNumber )
void DisplayShippingLocationCity() void DisplayShippingLocationCity()
{ {
CHAR16 sTemp[40]; std::wstring sTemp{ L"$0" };
UINT16 usPosY; UINT16 usPosY;
//display the name on the title bar //display the name on the title bar
@@ -1853,39 +1832,29 @@ void DisplayShippingLocationCity()
//Display the shipping cost //Display the shipping cost
usPosY = BOBBYR_OVERNIGHT_EXPRESS_Y; usPosY = BOBBYR_OVERNIGHT_EXPRESS_Y;
wcscpy(sTemp, L"$0");
if( gbSelectedCity != -1 ) if( gbSelectedCity != -1 )
{ {
// swprintf( sTemp, L"%d", ( INT32 )(BobbyROrderLocations[gbSelectedCity].usOverNightExpress/GetWeightBasedOnMetricOption( 1 ) ) ); // swprintf( sTemp, L"%d", ( INT32 )(BobbyROrderLocations[gbSelectedCity].usOverNightExpress/GetWeightBasedOnMetricOption( 1 ) ) );
swprintf( sTemp, L"%d", ( INT32 )(gPostalService.GetDestinationFee(0, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption( 1 ) ) ); sTemp = FormatMoney(static_cast<INT32>(gPostalService.GetDestinationFee(0, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption(1)));
InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp );
} }
DrawTextToScreen(sTemp, BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(sTemp.data(), BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
usPosY +=BOBBYR_GRID_ROW_OFFSET; usPosY +=BOBBYR_GRID_ROW_OFFSET;
if( gbSelectedCity != -1 ) if( gbSelectedCity != -1 )
{ {
// swprintf( sTemp, L"%d", ( INT32 )( BobbyROrderLocations[gbSelectedCity].us2DaysService / GetWeightBasedOnMetricOption( 1 ) ) ); sTemp = FormatMoney(static_cast<INT32>(gPostalService.GetDestinationFee(1, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption(1)));
swprintf( sTemp, L"%d", ( INT32 )(gPostalService.GetDestinationFee(1, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption( 1 ) ) );
InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp );
} }
DrawTextToScreen(sTemp, BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(sTemp.data(), BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
usPosY +=BOBBYR_GRID_ROW_OFFSET; usPosY +=BOBBYR_GRID_ROW_OFFSET;
if( gbSelectedCity != -1 ) if( gbSelectedCity != -1 )
{ {
// swprintf( sTemp, L"%d", (INT32 )( BobbyROrderLocations[gbSelectedCity].usStandardService / GetWeightBasedOnMetricOption( 1 ) ) ); sTemp = FormatMoney(static_cast<INT32>(gPostalService.GetDestinationFee(2, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption(1)));
swprintf( sTemp, L"%d", ( INT32 )(gPostalService.GetDestinationFee(2, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption( 1 ) ) );
InsertCommasForDollarFigure( sTemp );
InsertDollarSignInToString( sTemp );
} }
DrawTextToScreen(sTemp, BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen(sTemp.data(), BOBBYR_SHIPPING_SPEED_NUMBER_X, usPosY, BOBBYR_SHIPPING_SPEED_NUMBER_WIDTH, BOBBYR_DROPDOWN_FONT, BOBBYR_ORDER_DYNAMIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
} }
void SelectCloseDroDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason ) void SelectCloseDroDownRegionCallBack(MOUSE_REGION * pRegion, INT32 iReason )
+1 -8
View File
@@ -6165,15 +6165,8 @@ BOOLEAN ReplaceMercNameAndAmountWithProperData( CHAR16 *pFinishedString, EmailPt
} }
else else
{ {
CHAR16 sDollarAmount[64];
swprintf( sDollarAmount, L"%d", pMail->iFirstData );
InsertCommasForDollarFigure( sDollarAmount );
InsertDollarSignInToString( sDollarAmount );
//add the mercs name to the string //add the mercs name to the string
wcscat( pFinishedString, sDollarAmount ); wcscat( pFinishedString, FormatMoney(pMail->iFirstData).data() );
} }
} }
else else
+34 -114
View File
@@ -808,31 +808,15 @@ void DrawRecordsText( void )
if(pCurFinance->iAmount >=0) if(pCurFinance->iAmount >=0)
{ {
// increase in asset - debit // increase in asset - debit
swprintf(sString, L"%d", pCurFinance->iAmount); swprintf(sString, L"%s", FormatMoney(pCurFinance->iAmount).data());
// insert commas
InsertCommasForDollarFigure( sString );
// insert dollar sight for first record in the list
//DEF: 3/19/99: removed cause we want to see the dollar sign on ALL entries
// if( iCounter == 0 )
{
InsertDollarSignInToString( sString );
}
FindFontCenterCoordinates(RECORD_DEBIT_X,0,RECORD_DEBIT_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY); FindFontCenterCoordinates(RECORD_DEBIT_X,0,RECORD_DEBIT_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY);
mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString); mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString);
} }
else else
{ {
// decrease in asset - credit // decrease in asset - credit
swprintf(sString, L"%d", pCurFinance->iAmount * (-1)); swprintf(sString, L"%s", FormatMoney(pCurFinance->iAmount * (-1)).data());
SetFontForeground(FONT_RED); SetFontForeground(FONT_RED);
InsertCommasForDollarFigure( sString );
// insert dollar sight for first record in the list
//DEF: 3/19/99: removed cause we want to see the dollar sign on ALL entries
// if( iCounter == 0 )
{
InsertDollarSignInToString( sString );
}
FindFontCenterCoordinates(RECORD_CREDIT_X ,0 , RECORD_CREDIT_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY); FindFontCenterCoordinates(RECORD_CREDIT_X ,0 , RECORD_CREDIT_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY);
mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString); mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString);
@@ -860,15 +844,7 @@ void DrawRecordsText( void )
// print the balance string // print the balance string
swprintf(sString, L"%d", iBalance); swprintf(sString, L"%s", FormatMoney(iBalance).data());
InsertCommasForDollarFigure( sString );
// insert dollar sight for first record in the list
//DEF: 3/19/99: removed cause we want to see the dollar sign on ALL entries
// if( iCounter == 0 )
{
InsertDollarSignInToString( sString );
}
FindFontCenterCoordinates(RECORD_BALANCE_X,0,RECORD_BALANCE_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY); FindFontCenterCoordinates(RECORD_BALANCE_X,0,RECORD_BALANCE_WIDTH,0, sString, FINANCE_TEXT_FONT,&usX, &usY);
mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString); mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString);
@@ -921,7 +897,7 @@ void InvalidateLapTopScreen( void )
void DrawSummaryText( void ) void DrawSummaryText( void )
{ {
INT16 usX, usY; INT16 usX, usY;
CHAR16 pString[100]; std::wstring tmp{};
INT32 iBalance = 0; INT32 iBalance = 0;
@@ -949,98 +925,68 @@ void DrawSummaryText( void )
// yesterdays income // yesterdays income
iBalance = GetPreviousDaysIncome( ); iBalance = GetPreviousDaysIncome( );
swprintf(pString, L"%d", iBalance ); tmp = FormatMoney(iBalance);
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0, tmp.data(), FINANCE_TEXT_FONT, &usX, &usY);
InsertCommasForDollarFigure( pString ); mprintf(usX,YESTERDAYS_INCOME,tmp.data());
if( iBalance != 0 )
InsertDollarSignInToString( pString );
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
mprintf(usX,YESTERDAYS_INCOME,pString);
SetFontForeground( FONT_BLACK ); SetFontForeground( FONT_BLACK );
// yesterdays other // yesterdays other
iBalance = GetYesterdaysOtherDeposits( ); iBalance = GetYesterdaysOtherDeposits( );
swprintf(pString, L"%d", iBalance ); tmp = FormatMoney(iBalance);
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0, tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
InsertCommasForDollarFigure( pString ); mprintf(usX,YESTERDAYS_OTHER,tmp.data());
if( iBalance != 0 )
InsertDollarSignInToString( pString );
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
mprintf(usX,YESTERDAYS_OTHER,pString);
SetFontForeground( FONT_RED ); SetFontForeground( FONT_RED );
// yesterdays debits // yesterdays debits
iBalance = GetYesterdaysDebits( );
if( iBalance < 0 ) if( iBalance < 0 )
{ {
SetFontForeground( FONT_RED ); SetFontForeground( FONT_RED );
iBalance *= -1; iBalance *= -1;
} }
tmp = FormatMoney(iBalance);
swprintf(pString, L"%d", iBalance ); FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0, tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
InsertCommasForDollarFigure( pString ); mprintf(usX,YESTERDAYS_DEBITS,tmp.data());
if( iBalance != 0 )
InsertDollarSignInToString( pString );
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
mprintf(usX,YESTERDAYS_DEBITS,pString);
SetFontForeground( FONT_BLACK ); SetFontForeground( FONT_BLACK );
// yesterdays balance..ending balance..so todays balance then // yesterdays balance..ending balance..so todays balance then
iBalance = GetTodaysBalance( ); iBalance = GetTodaysBalance( );
if( iBalance < 0 ) if( iBalance < 0 )
{ {
SetFontForeground( FONT_RED ); SetFontForeground( FONT_RED );
iBalance *= -1; iBalance *= -1;
} }
tmp = FormatMoney(iBalance);
swprintf(pString, L"%d", iBalance ); FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0, tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
InsertCommasForDollarFigure( pString );
if( iBalance != 0 )
InsertDollarSignInToString( pString );
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY); mprintf(usX,YESTERDAYS_BALANCE,tmp.data());
mprintf(usX,YESTERDAYS_BALANCE,pString);
SetFontForeground( FONT_BLACK ); SetFontForeground( FONT_BLACK );
// todays income // todays income
iBalance = GetTodaysDaysIncome( ); iBalance = GetTodaysDaysIncome( );
swprintf(pString, L"%d", iBalance ); tmp = FormatMoney(iBalance);
InsertCommasForDollarFigure( pString ); FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
if( iBalance != 0 )
InsertDollarSignInToString( pString );
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY); mprintf(usX,TODAYS_INCOME,tmp.data());
mprintf(usX,TODAYS_INCOME,pString);
SetFontForeground( FONT_BLACK ); SetFontForeground( FONT_BLACK );
// todays other // todays other
iBalance = GetTodaysOtherDeposits( ); iBalance = GetTodaysOtherDeposits( );
swprintf(pString, L"%d", iBalance ); tmp = FormatMoney(iBalance);
InsertCommasForDollarFigure( pString ); FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
if( iBalance != 0 )
InsertDollarSignInToString( pString );
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY); mprintf(usX,TODAYS_OTHER,tmp.data());
mprintf(usX,TODAYS_OTHER,pString);
SetFontForeground( FONT_RED ); SetFontForeground( FONT_RED );
@@ -1053,15 +999,11 @@ void DrawSummaryText( void )
iBalance *= ( -1 ); iBalance *= ( -1 );
} }
swprintf(pString, L"%d", iBalance ); tmp = FormatMoney(iBalance);
InsertCommasForDollarFigure( pString ); FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
if( iBalance != 0 )
InsertDollarSignInToString( pString );
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY); mprintf(usX,TODAYS_DEBITS,tmp.data());
mprintf(usX,TODAYS_DEBITS,pString);
SetFontForeground( FONT_BLACK ); SetFontForeground( FONT_BLACK );
@@ -1069,36 +1011,23 @@ void DrawSummaryText( void )
iBalance = GetCurrentBalance( ); iBalance = GetCurrentBalance( );
if( iBalance < 0 ) if( iBalance < 0 )
{ {
iBalance *= -1;
SetFontForeground( FONT_RED ); SetFontForeground( FONT_RED );
swprintf(pString, L"%d", iBalance );
iBalance *= -1; iBalance *= -1;
} }
else
{
swprintf(pString, L"%d", iBalance );
}
InsertCommasForDollarFigure( pString ); tmp = FormatMoney(iBalance);
if( iBalance != 0 ) FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
InsertDollarSignInToString( pString ); mprintf(usX,TODAYS_CURRENT_BALANCE,tmp.data());
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
mprintf(usX,TODAYS_CURRENT_BALANCE,pString);
SetFontForeground( FONT_BLACK ); SetFontForeground( FONT_BLACK );
// todays forcast income // todays forcast income
iBalance = GetProjectedTotalDailyIncome( ); iBalance = GetProjectedTotalDailyIncome( );
swprintf(pString, L"%d", iBalance ); tmp = FormatMoney(iBalance);
InsertCommasForDollarFigure( pString ); FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
if( iBalance != 0 )
InsertDollarSignInToString( pString );
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY); mprintf(usX,TODAYS_CURRENT_FORCAST_INCOME,tmp.data());
mprintf(usX,TODAYS_CURRENT_FORCAST_INCOME,pString);
SetFontForeground( FONT_BLACK ); SetFontForeground( FONT_BLACK );
@@ -1107,22 +1036,13 @@ void DrawSummaryText( void )
iBalance = GetCurrentBalance( ) + GetProjectedTotalDailyIncome( ); iBalance = GetCurrentBalance( ) + GetProjectedTotalDailyIncome( );
if( iBalance < 0 ) if( iBalance < 0 )
{ {
iBalance *= -1;
SetFontForeground( FONT_RED ); SetFontForeground( FONT_RED );
swprintf(pString, L"%d", iBalance );
iBalance *= -1; iBalance *= -1;
} }
else
{
swprintf(pString, L"%d", iBalance );
}
InsertCommasForDollarFigure( pString ); tmp = FormatMoney(iBalance);
if( iBalance != 0 ) FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
InsertDollarSignInToString( pString ); mprintf(usX,TODAYS_CURRENT_FORCAST_BALANCE,tmp.data());
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
mprintf(usX,TODAYS_CURRENT_FORCAST_BALANCE,pString);
SetFontForeground( FONT_BLACK ); SetFontForeground( FONT_BLACK );
+4 -6
View File
@@ -700,6 +700,7 @@ BOOLEAN DisplayOrderGrid( UINT8 ubGridNumber, UINT8 ubMercID )
iCostOfContract = 0; iCostOfContract = 0;
} }
std::wstring amountRefund{};
if( iCostOfContract < 0 ) if( iCostOfContract < 0 )
{ {
//shouldnt get in here now since we can longer give refunds //shouldnt get in here now since we can longer give refunds
@@ -712,19 +713,16 @@ BOOLEAN DisplayOrderGrid( UINT8 ubGridNumber, UINT8 ubMercID )
DrawTextToScreen( sText, (UINT16)(usPosX+INS_CTRCT_EMPLYMNT_CNTRCT_TEXT_OFFSET_X), INS_CTRCT_ORDER_GRID1_Y+INS_CTRCT_PREMIUM_OWING_OFFSET_Y, INS_CTRCT_ORDER_GRID_WIDTH, INS_FONT_MED, INS_FONT_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED ); DrawTextToScreen( sText, (UINT16)(usPosX+INS_CTRCT_EMPLYMNT_CNTRCT_TEXT_OFFSET_X), INS_CTRCT_ORDER_GRID1_Y+INS_CTRCT_PREMIUM_OWING_OFFSET_Y, INS_CTRCT_ORDER_GRID_WIDTH, INS_FONT_MED, INS_FONT_COLOR, FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
//display the amount of refund //display the amount of refund
swprintf( sText, L"%d", iCostOfContract ); amountRefund = FormatMoney(iCostOfContract);
InsertCommasForDollarFigure( sText );
InsertDollarSignInToString( sText );
} }
if( IsMercDead( ubMercID ) ) if( IsMercDead( ubMercID ) )
{ {
swprintf( sText, L"0"); amountRefund = L"$0";
InsertDollarSignInToString( sText );
} }
//display the amount owing //display the amount owing
DrawTextToScreen( sText, (UINT16)(usPosX+32), INS_CTRCT_ORDER_GRID1_Y+179, 72, INS_FONT_MED, INS_FONT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED ); DrawTextToScreen( amountRefund.data(), (UINT16)(usPosX + 32), INS_CTRCT_ORDER_GRID1_Y + 179, 72, INS_FONT_MED, INS_FONT_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
+7 -18
View File
@@ -5084,36 +5084,28 @@ void ShouldNewMailBeDisplayed()
void DisplayPlayersBalanceToDate( void ) void DisplayPlayersBalanceToDate( void )
{ {
// print players balance to date // print players balance to date
CHAR16 sString[ 100 ];
INT16 sX, sY; INT16 sX, sY;
// initialize string
memset( sString, 0, sizeof( sString ) );
// font stuff // font stuff
SetFont( FONT10ARIAL); SetFont( FONT10ARIAL);
SetFontForeground( 142 ); SetFontForeground( 142 );
SetFontShadow(NO_SHADOW); SetFontShadow(NO_SHADOW);
// parse straigth number // parse straigth number
swprintf( sString, L"%d", LaptopSaveInfo.iCurrentBalance ); std::wstring sString{FormatMoney(LaptopSaveInfo.iCurrentBalance)};
// put in commas, then dollar sign
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
// get center // get center
FindFontCenterCoordinates( (INT16)LAPTOP_ICON_TEXT_X, iScreenHeightOffset, (INT16)(LAPTOP_ICON_TEXT_WIDTH) ,(INT16)(LAPTOP_ICON_TEXT_HEIGHT), sString, LAPTOPICONFONT, &sX, &sY ); FindFontCenterCoordinates( (INT16)LAPTOP_ICON_TEXT_X, iScreenHeightOffset, (INT16)(LAPTOP_ICON_TEXT_WIDTH) ,(INT16)(LAPTOP_ICON_TEXT_HEIGHT), sString.data(), LAPTOPICONFONT, &sX, &sY);
// gprintfdirty( sX , LAPTOP_ICON_TEXT_FINANCIAL_Y + 10, sString ); // gprintfdirty( sX , LAPTOP_ICON_TEXT_FINANCIAL_Y + 10, sString );
// printf it! // printf it!
if( ButtonList[ gLaptopButton[ 5 ] ]->uiFlags & BUTTON_CLICKED_ON ) if( ButtonList[ gLaptopButton[ 5 ] ]->uiFlags & BUTTON_CLICKED_ON )
{ {
mprintf( sX + 5, LAPTOP_ICON_TEXT_FINANCIAL_Y + 10 + 5, sString); mprintf( sX + 5, LAPTOP_ICON_TEXT_FINANCIAL_Y + 10 + 5, sString.data());
} }
else else
{ {
mprintf( sX, LAPTOP_ICON_TEXT_FINANCIAL_Y + 10, sString); mprintf( sX, LAPTOP_ICON_TEXT_FINANCIAL_Y + 10, sString.data());
} }
// reset shadow // reset shadow
@@ -6207,7 +6199,6 @@ void DeleteDesktopBackground( void )
void PrintBalance( void ) void PrintBalance( void )
{ {
CHAR16 pString[ 32 ];
// UINT16 usX, usY; // UINT16 usX, usY;
SetFont( FONT10ARIAL ); SetFont( FONT10ARIAL );
@@ -6215,17 +6206,15 @@ void PrintBalance( void )
SetFontBackground( FONT_BLACK ); SetFontBackground( FONT_BLACK );
SetFontShadow( NO_SHADOW ); SetFontShadow( NO_SHADOW );
swprintf(pString, L"%d", LaptopSaveInfo.iCurrentBalance); std::wstring pString{ FormatMoney(LaptopSaveInfo.iCurrentBalance) };
InsertCommasForDollarFigure( pString );
InsertDollarSignInToString( pString );
if( ButtonList[ gLaptopButton[ 5 ] ]->uiFlags & BUTTON_CLICKED_ON ) if( ButtonList[ gLaptopButton[ 5 ] ]->uiFlags & BUTTON_CLICKED_ON )
{ {
mprintf(iScreenWidthOffset + 48, iScreenHeightOffset + 273,pString); mprintf(iScreenWidthOffset + 48, iScreenHeightOffset + 273,pString.data());
} }
else else
{ {
mprintf(iScreenWidthOffset + 47, iScreenHeightOffset + 272,pString); mprintf(iScreenWidthOffset + 47, iScreenHeightOffset + 272,pString.data());
} }
+1 -6
View File
@@ -446,13 +446,8 @@ void BtnMercAuthorizeButtonCallback(GUI_BUTTON *btn,INT32 reason)
btn->uiFlags &= (~BUTTON_CLICKED_ON ); btn->uiFlags &= (~BUTTON_CLICKED_ON );
swprintf( wzDollarAmount, L"%d", giMercTotalContractCharge );
InsertCommasForDollarFigure( wzDollarAmount );
InsertDollarSignInToString( wzDollarAmount );
//create the string to show to the user //create the string to show to the user
swprintf( wzAuthorizeString, MercAccountText[MERC_ACCOUNT_AUTHORIZE_CONFIRMATION], wzDollarAmount ); swprintf( wzAuthorizeString, MercAccountText[MERC_ACCOUNT_AUTHORIZE_CONFIRMATION], FormatMoney(giMercTotalContractCharge).data());
DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, wzAuthorizeString, LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercAuthorizePaymentMessageBoxCallBack ); DoLapTopMessageBox( MSG_BOX_BLUE_ON_GREY, wzAuthorizeString, LAPTOP_SCREEN, MSG_BOX_FLAG_YESNO, MercAuthorizePaymentMessageBoxCallBack );
+9 -20
View File
@@ -977,8 +977,7 @@ void DisplayMercsStats( UINT8 ubMercID )
{ {
UINT16 usPosY, usPosX; UINT16 usPosY, usPosX;
CHAR16 sPage[60]; CHAR16 sPage[60];
CHAR16 sTemp[128]; std::wstring sString{};
CHAR16 sString[128];
CHAR16 NsString[128]; CHAR16 NsString[128];
CHAR16 N2sString[128]; CHAR16 N2sString[128];
UINT8 ubColor; UINT8 ubColor;
@@ -1058,21 +1057,15 @@ void DisplayMercsStats( UINT8 ubMercID )
DrawTextToScreen( CharacterInfo[AIM_MEMBER_FEE], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_TITLE_FONT, MERC_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen( CharacterInfo[AIM_MEMBER_FEE], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_TITLE_FONT, MERC_TITLE_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( CharacterInfo[AIM_MEMBER_FEE], MERC_NAME_FONT ); usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( CharacterInfo[AIM_MEMBER_FEE], MERC_NAME_FONT );
swprintf( sString, L"%d", gMercProfiles[ubMercID].uiWeeklySalary ); sString = FormatMoney(gMercProfiles[ubMercID].uiWeeklySalary);
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
#else #else
DrawTextToScreen( MercInfo[MERC_FILES_SALARY], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED ); DrawTextToScreen( MercInfo[MERC_FILES_SALARY], MERC_STATS_SECOND_COL_X, usPosY, 0, MERC_STATS_FONT, MERC_STATIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT ); usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT );
swprintf( sString, L"%d", gMercProfiles[ubMercID].sSalary ); sString = FormatMoney(gMercProfiles[ubMercID].sSalary) + L" " + std::wstring(MercInfo[MERC_FILES_PER_DAY]);
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
swprintf( sTemp, L" %s", MercInfo[MERC_FILES_PER_DAY] );
#endif // JA2UB #endif // JA2UB
wcscat( sString, sTemp ); DrawTextToScreen( sString.data(), usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
DrawTextToScreen( sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
// Buggler: Display current MERC index & total MERC members at the bottom of the screen // Buggler: Display current MERC index & total MERC members at the bottom of the screen
swprintf( sPage, L"%d / %d", gubCurMercIndex + 1, LaptopSaveInfo.gubLastMercIndex + 1 ); swprintf( sPage, L"%d / %d", gubCurMercIndex + 1, LaptopSaveInfo.gubLastMercIndex + 1 );
@@ -1103,10 +1096,8 @@ void DisplayMercsStats( UINT8 ubMercID )
#endif // JA2UB #endif // JA2UB
swprintf( NsString, L"+ " ); swprintf( NsString, L"+ " );
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost); sString = FormatMoney(gMercProfiles[ ubMercID ].usOptionalGearCost);
InsertCommasForDollarFigure( sTemp ); wcscat( NsString, sString.data() );
InsertDollarSignInToString( sTemp );
wcscat( NsString, sTemp );
DrawTextToScreen( NsString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED); DrawTextToScreen( NsString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
usPosY += MERC_SPACE_BN_LINES; usPosY += MERC_SPACE_BN_LINES;
@@ -1115,13 +1106,11 @@ void DisplayMercsStats( UINT8 ubMercID )
swprintf(N2sString, L"= "); swprintf(N2sString, L"= ");
#ifdef JA2UB #ifdef JA2UB
swprintf( sTemp, L"%d", gMercProfiles[ubMercID].usOptionalGearCost + gMercProfiles[ubMercID].uiWeeklySalary ); sString = FormatMoney(gMercProfiles[ubMercID].usOptionalGearCost + gMercProfiles[ubMercID].uiWeeklySalary);
#else #else
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost+gMercProfiles[ ubMercID ].sSalary); sString = FormatMoney(gMercProfiles[ ubMercID ].usOptionalGearCost+gMercProfiles[ ubMercID ].sSalary);
#endif #endif
InsertCommasForDollarFigure( sTemp ); wcscat( N2sString, sString.data() );
InsertDollarSignInToString( sTemp );
wcscat( N2sString, sTemp );
DrawTextToScreen( N2sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED); DrawTextToScreen( N2sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
} }
} }
+21 -58
View File
@@ -3298,7 +3298,6 @@ INT32 GetHighestDailyCostOfCurrentTeam( void )
void DisplayCostOfCurrentTeam( void ) void DisplayCostOfCurrentTeam( void )
{ {
// display number on team // display number on team
CHAR16 sString[ 32 ];
INT16 sX, sY; INT16 sX, sY;
// font stuff // font stuff
@@ -3307,38 +3306,30 @@ void DisplayCostOfCurrentTeam( void )
SetFontForeground( PERS_TEXT_FONT_COLOR ); SetFontForeground( PERS_TEXT_FONT_COLOR );
if (fCurrentTeamMode) { if (fCurrentTeamMode) {
std::wstring sString{};
// daily cost // daily cost
mprintf( PERS_CURR_TEAM_COST_X, PERS_CURR_TEAM_COST_Y, pPersonelTeamStrings[ 2 ] ); mprintf( PERS_CURR_TEAM_COST_X, PERS_CURR_TEAM_COST_Y, pPersonelTeamStrings[ 2 ] );
swprintf( sString, L"%d", GetTotalDailyCostOfCurrentTeam( ) ); sString = FormatMoney( GetTotalDailyCostOfCurrentTeam( ) );
InsertCommasForDollarFigure( sString ); FindFontRightCoordinates((INT16)(PERS_CURR_TEAM_COST_X),0,PERS_CURR_TEAM_WIDTH,0,sString.data(), PERS_FONT, &sX, &sY);
InsertDollarSignInToString( sString );
FindFontRightCoordinates((INT16)(PERS_CURR_TEAM_COST_X),0,PERS_CURR_TEAM_WIDTH,0,sString, PERS_FONT, &sX, &sY); mprintf( sX ,PERS_CURR_TEAM_COST_Y, sString.data() );
mprintf( sX ,PERS_CURR_TEAM_COST_Y, sString );
// highest cost // highest cost
mprintf( PERS_CURR_TEAM_COST_X, PERS_CURR_TEAM_HIGHEST_Y, pPersonelTeamStrings[ 3 ] ); mprintf( PERS_CURR_TEAM_COST_X, PERS_CURR_TEAM_HIGHEST_Y, pPersonelTeamStrings[ 3 ] );
swprintf( sString, L"%d", GetHighestDailyCostOfCurrentTeam( ) ); sString = FormatMoney( GetHighestDailyCostOfCurrentTeam( ) );
InsertCommasForDollarFigure( sString ); FindFontRightCoordinates((INT16)(PERS_CURR_TEAM_COST_X),0,PERS_CURR_TEAM_WIDTH,0,sString.data(), PERS_FONT, &sX, &sY);
InsertDollarSignInToString( sString );
FindFontRightCoordinates((INT16)(PERS_CURR_TEAM_COST_X),0,PERS_CURR_TEAM_WIDTH,0,sString, PERS_FONT, &sX, &sY); mprintf( sX ,PERS_CURR_TEAM_HIGHEST_Y, sString.data() );
mprintf( sX ,PERS_CURR_TEAM_HIGHEST_Y, sString );
// the lowest cost // the lowest cost
mprintf( PERS_CURR_TEAM_COST_X, PERS_CURR_TEAM_LOWEST_Y, pPersonelTeamStrings[ 4 ] ); mprintf( PERS_CURR_TEAM_COST_X, PERS_CURR_TEAM_LOWEST_Y, pPersonelTeamStrings[ 4 ] );
swprintf( sString, L"%d", GetLowestDailyCostOfCurrentTeam( ) ); sString = FormatMoney( GetLowestDailyCostOfCurrentTeam( ) );
InsertCommasForDollarFigure( sString ); FindFontRightCoordinates((INT16)(PERS_CURR_TEAM_COST_X),0,PERS_CURR_TEAM_WIDTH,0,sString.data(), PERS_FONT, &sX, &sY);
InsertDollarSignInToString( sString );
FindFontRightCoordinates((INT16)(PERS_CURR_TEAM_COST_X),0,PERS_CURR_TEAM_WIDTH,0,sString, PERS_FONT, &sX, &sY); mprintf( sX ,PERS_CURR_TEAM_LOWEST_Y, sString.data() );
mprintf( sX ,PERS_CURR_TEAM_LOWEST_Y, sString );
} }
} }
@@ -5931,7 +5922,7 @@ void DisplayAmountOnCurrentMerc( void )
{ {
// will display the amount that the merc is carrying on him or herself // will display the amount that the merc is carrying on him or herself
SOLDIERTYPE *pSoldier = NULL; SOLDIERTYPE *pSoldier = NULL;
CHAR16 sString[ 64 ]; std::wstring sString{};
INT16 sX, sY; INT16 sX, sY;
if (currentTeamIndex == -1) { if (currentTeamIndex == -1) {
@@ -5941,13 +5932,7 @@ void DisplayAmountOnCurrentMerc( void )
pSoldier = currentTeamList[currentTeamIndex]; pSoldier = currentTeamList[currentTeamIndex];
} }
INT32 iFunds = GetFundsOnMerc( pSoldier ); sString = FormatMoney( GetFundsOnMerc( pSoldier ) );
swprintf( sString, L"%d", iFunds );
// insert commas and dollar sign
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
// set font // set font
SetFont( ATM_FONT ); SetFont( ATM_FONT );
@@ -5957,10 +5942,10 @@ void DisplayAmountOnCurrentMerc( void )
SetFontBackground( FONT_BLACK ); SetFontBackground( FONT_BLACK );
// right justify // right justify
FindFontRightCoordinates( ATM_DISPLAY_X, ATM_DISPLAY_Y, ATM_DISPLAY_WIDTH, ATM_DISPLAY_HEIGHT, sString, ATM_FONT, &sX, &sY ); FindFontRightCoordinates( ATM_DISPLAY_X, ATM_DISPLAY_Y, ATM_DISPLAY_WIDTH, ATM_DISPLAY_HEIGHT, sString.data(), ATM_FONT, &sX, &sY);
// print string // print string
mprintf( sX, sY, sString ); mprintf( sX, sY, sString.data() );
} }
void HandlePersonnelKeyboard( void ) void HandlePersonnelKeyboard( void )
@@ -6292,11 +6277,7 @@ void DisplayEmploymentinformation( SoldierID iId, INT32 iSlot )
swprintf( sString, L"%d", gMercProfiles[ Menptr[ iId ].ubProfile ].uiTotalCostToDate ); swprintf( sString, L"%d", gMercProfiles[ Menptr[ iId ].ubProfile ].uiTotalCostToDate );
} }
*/ */
swprintf( sString, L"%d", pMercProfile->uiTotalCostToDate ); swprintf( sString, L"%s", FormatMoney(pMercProfile->uiTotalCostToDate).data() );
// insert commas and dollar sign
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
/* /*
DEF:3/19/99: DEF:3/19/99:
@@ -6321,34 +6302,22 @@ DEF:3/19/99:
if( pSoldier->bTypeOfLastContract == CONTRACT_EXTEND_2_WEEK ) if( pSoldier->bTypeOfLastContract == CONTRACT_EXTEND_2_WEEK )
{ {
// 2 week contract // 2 week contract
swprintf( sStringA, L"%d", pMercProfile->uiBiWeeklySalary / 14 ); swprintf( sString, L"%s", FormatMoney( pMercProfile->uiBiWeeklySalary / 14 ).data() );
InsertCommasForDollarFigure( sStringA );
InsertDollarSignInToString( sStringA );
swprintf( sString, L"%s", sStringA );
} }
else if( pSoldier->bTypeOfLastContract == CONTRACT_EXTEND_1_WEEK ) else if( pSoldier->bTypeOfLastContract == CONTRACT_EXTEND_1_WEEK )
{ {
// 1 week contract // 1 week contract
swprintf( sStringA, L"%d", pMercProfile->uiWeeklySalary / 7 ); swprintf( sString, L"%s", FormatMoney( pMercProfile->uiWeeklySalary / 7 ).data() );
InsertCommasForDollarFigure( sStringA );
InsertDollarSignInToString( sStringA );
swprintf( sString, L"%s", sStringA );
} }
else else
{ {
// daily rate // daily rate
swprintf( sStringA, L"%d", pMercProfile->sSalary ); swprintf( sString, L"%s", FormatMoney( pMercProfile->sSalary ).data() );
InsertCommasForDollarFigure( sStringA );
InsertDollarSignInToString( sStringA );
swprintf( sString, L"%s", sStringA );
} }
} }
else else
{ {
swprintf( sStringA, L"%d", pMercProfile->sSalary ); swprintf( sString, L"%s", FormatMoney( pMercProfile->sSalary ).data() );
InsertCommasForDollarFigure( sStringA );
InsertDollarSignInToString( sStringA );
swprintf( sString, L"%s", sStringA );
} }
FindFontRightCoordinates( (INT16)(x + Prsnl_DATA_OffSetX), 0, TEXT_BOX_WIDTH - 20, 0, sString, PERS_FONT, &sX, &sY ); FindFontRightCoordinates( (INT16)(x + Prsnl_DATA_OffSetX), 0, TEXT_BOX_WIDTH - 20, 0, sString, PERS_FONT, &sX, &sY );
@@ -6369,9 +6338,7 @@ DEF:3/19/99:
{ {
mprintf((INT16)(pPersonnelScreenPoints[iCounter-1].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter-1].y,pPersonnelScreenStrings[PRSNL_TXT_UNPAID_AMOUNT]); mprintf((INT16)(pPersonnelScreenPoints[iCounter-1].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter-1].y,pPersonnelScreenStrings[PRSNL_TXT_UNPAID_AMOUNT]);
swprintf( sString, L"%d", pMercProfile->sSalary * pMercProfile->iMercMercContractLength ); swprintf( sString, L"%s", FormatMoney( pMercProfile->sSalary * pMercProfile->iMercMercContractLength ).data() );
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter-1].x+(iSlot*TEXT_BOX_WIDTH)+Prsnl_DATA_OffSetX),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY); FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter-1].x+(iSlot*TEXT_BOX_WIDTH)+Prsnl_DATA_OffSetX),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter-1].y,sString); mprintf(sX,pPersonnelScreenPoints[iCounter-1].y,sString);
@@ -6380,11 +6347,7 @@ DEF:3/19/99:
{ {
mprintf((INT16)(pPersonnelScreenPoints[iCounter-1].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter-1].y,pPersonnelScreenStrings[PRSNL_TXT_MED_DEPOSIT]); mprintf((INT16)(pPersonnelScreenPoints[iCounter-1].x+(iSlot*TEXT_BOX_WIDTH)),pPersonnelScreenPoints[iCounter-1].y,pPersonnelScreenStrings[PRSNL_TXT_MED_DEPOSIT]);
swprintf(sString, L"%d",pMercProfile->sMedicalDepositAmount); swprintf(sString, L"%s", FormatMoney(pMercProfile->sMedicalDepositAmount).data());
// insert commas and dollar sign
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter-1].x+(iSlot*TEXT_BOX_WIDTH)+Prsnl_DATA_OffSetX),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY); FindFontRightCoordinates((INT16)(pPersonnelScreenPoints[iCounter-1].x+(iSlot*TEXT_BOX_WIDTH)+Prsnl_DATA_OffSetX),0,TEXT_BOX_WIDTH-20,0,sString, PERS_FONT, &sX, &sY);
mprintf(sX,pPersonnelScreenPoints[iCounter-1].y,sString); mprintf(sX,pPersonnelScreenPoints[iCounter-1].y,sString);
+9 -21
View File
@@ -15169,14 +15169,12 @@ void CreateContractBox( SOLDIERTYPE *pCharacter )
if( pCharacter->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC ) if( pCharacter->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC )
{ {
swprintf( sDollarString, L"%d", 0 ); swprintf( sDollarString, L"%s", FormatMoney(0).data() );
} }
else else
{ {
swprintf( sDollarString, L"%d", gMercProfiles[ pCharacter->ubProfile ].sSalary ); swprintf( sDollarString, L"%s", FormatMoney(gMercProfiles[ pCharacter->ubProfile ].sSalary).data() );
} }
InsertCommasForDollarFigure( sDollarString );
InsertDollarSignInToString( sDollarString );
swprintf( sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString); swprintf( sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString);
AddMonoString(&hStringHandle, sString); AddMonoString(&hStringHandle, sString);
break; break;
@@ -15184,15 +15182,13 @@ void CreateContractBox( SOLDIERTYPE *pCharacter )
if( pCharacter->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC ) if( pCharacter->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC )
{ {
swprintf( sDollarString, L"%d", 0 ); swprintf( sDollarString, L"%s", FormatMoney(0).data() );
} }
else else
{ {
swprintf( sDollarString, L"%d", gMercProfiles[ pCharacter->ubProfile ].uiWeeklySalary ); swprintf( sDollarString, L"%s", FormatMoney(gMercProfiles[ pCharacter->ubProfile ].uiWeeklySalary).data() );
} }
InsertCommasForDollarFigure( sDollarString );
InsertDollarSignInToString( sDollarString );
swprintf( sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString ); swprintf( sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString );
AddMonoString(&hStringHandle, sString); AddMonoString(&hStringHandle, sString);
break; break;
@@ -15200,16 +15196,14 @@ void CreateContractBox( SOLDIERTYPE *pCharacter )
if( pCharacter->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC ) if( pCharacter->ubWhatKindOfMercAmI != MERC_TYPE__AIM_MERC )
{ {
swprintf( sDollarString, L"%d", 0 ); swprintf( sDollarString, L"%s", FormatMoney(0).data() );
} }
else else
{ {
swprintf( sDollarString, L"%d", gMercProfiles[ pCharacter->ubProfile ].uiBiWeeklySalary ); swprintf( sDollarString, L"%s", FormatMoney(gMercProfiles[ pCharacter->ubProfile ].uiBiWeeklySalary).data() );
} }
InsertCommasForDollarFigure( sDollarString );
InsertDollarSignInToString( sDollarString );
swprintf( sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString); swprintf( sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString);
AddMonoString(&hStringHandle, sString); AddMonoString(&hStringHandle, sString);
break; break;
@@ -15299,10 +15293,8 @@ void CreateContractBoxMultiSelect(INT32 DailySalaries, INT32 WeeklySalaries, INT
//} //}
//else //else
{ {
swprintf(sDollarString, L"%d", DailySalaries); swprintf(sDollarString, L"%s", FormatMoney(DailySalaries).data() );
} }
InsertCommasForDollarFigure(sDollarString);
InsertDollarSignInToString(sDollarString);
swprintf(sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString); swprintf(sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString);
AddMonoString(&hStringHandle, sString); AddMonoString(&hStringHandle, sString);
break; break;
@@ -15314,11 +15306,9 @@ void CreateContractBoxMultiSelect(INT32 DailySalaries, INT32 WeeklySalaries, INT
//} //}
//else //else
{ {
swprintf(sDollarString, L"%d", WeeklySalaries); swprintf(sDollarString, L"%s", FormatMoney(WeeklySalaries).data());
} }
InsertCommasForDollarFigure(sDollarString);
InsertDollarSignInToString(sDollarString);
swprintf(sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString); swprintf(sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString);
AddMonoString(&hStringHandle, sString); AddMonoString(&hStringHandle, sString);
break; break;
@@ -15330,12 +15320,10 @@ void CreateContractBoxMultiSelect(INT32 DailySalaries, INT32 WeeklySalaries, INT
//} //}
//else //else
{ {
swprintf(sDollarString, L"%d", BiweeklySalaries); swprintf(sDollarString, L"%s", FormatMoney(BiweeklySalaries).data());
} }
InsertCommasForDollarFigure(sDollarString);
InsertDollarSignInToString(sDollarString);
swprintf(sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString); swprintf(sString, L"%s ( %s )", pContractStrings[uiCounter], sDollarString);
AddMonoString(&hStringHandle, sString); AddMonoString(&hStringHandle, sString);
break; break;
+11 -24
View File
@@ -1562,7 +1562,7 @@ void DisplayCurrentBalanceTitleForMapBottom( void )
void DisplayCurrentBalanceForMapBottom( void ) void DisplayCurrentBalanceForMapBottom( void )
{ {
// show the current balance for the player on the map panel bottom // show the current balance for the player on the map panel bottom
CHAR16 sString[ 128 ]; std::wstring sString;
INT16 sFontX, sFontY; INT16 sFontX, sFontY;
// ste the font buffer // ste the font buffer
@@ -1573,22 +1573,18 @@ void DisplayCurrentBalanceForMapBottom( void )
SetFontForeground( 183 ); SetFontForeground( 183 );
SetFontBackground( FONT_BLACK ); SetFontBackground( FONT_BLACK );
swprintf( sString, L"%d", LaptopSaveInfo.iCurrentBalance ); sString = FormatMoney( LaptopSaveInfo.iCurrentBalance );
// insert
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
VarFindFontCenterCoordinates( VarFindFontCenterCoordinates(
UI_BOTTOM.Text.CurrentBalance.x, UI_BOTTOM.Text.CurrentBalance.x,
UI_BOTTOM.Text.CurrentBalance.y, UI_BOTTOM.Text.CurrentBalance.y,
UI_BOTTOM.Text.CurrentBalance.width, UI_BOTTOM.Text.CurrentBalance.width,
UI_BOTTOM.Text.CurrentBalance.height, UI_BOTTOM.Text.CurrentBalance.height,
COMPFONT, &sFontX, &sFontY, sString COMPFONT, &sFontX, &sFontY, sString.data()
); );
// print it // print it
mprintf( sFontX, sFontY, L"%s", sString ); mprintf( sFontX, sFontY, L"%s", sString.data() );
return; return;
} }
@@ -1667,7 +1663,7 @@ void DisplayProjectedDailyMineIncome( void )
{ {
INT32 iRate = 0; INT32 iRate = 0;
static INT32 iOldRate = -1; static INT32 iOldRate = -1;
CHAR16 sString[ 128 ]; std::wstring sString;
INT16 sFontX, sFontY; INT16 sFontX, sFontY;
// grab the rate from the financial system // grab the rate from the financial system
@@ -1692,22 +1688,18 @@ void DisplayProjectedDailyMineIncome( void )
SetFontForeground( 183 ); SetFontForeground( 183 );
SetFontBackground( FONT_BLACK ); SetFontBackground( FONT_BLACK );
swprintf( sString, L"%d", iRate ); sString = FormatMoney( iRate );
// insert
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
VarFindFontCenterCoordinates( VarFindFontCenterCoordinates(
UI_BOTTOM.Text.CurrentIncome.x, UI_BOTTOM.Text.CurrentIncome.x,
UI_BOTTOM.Text.CurrentIncome.y, UI_BOTTOM.Text.CurrentIncome.y,
UI_BOTTOM.Text.CurrentIncome.width, UI_BOTTOM.Text.CurrentIncome.width,
UI_BOTTOM.Text.CurrentIncome.height, UI_BOTTOM.Text.CurrentIncome.height,
COMPFONT, &sFontX, &sFontY, sString COMPFONT, &sFontX, &sFontY, sString.data()
); );
// print it // print it
mprintf( sFontX, sFontY, L"%s", sString ); mprintf( sFontX, sFontY, L"%s", sString.data() );
return; return;
} }
@@ -1716,7 +1708,6 @@ void DisplayProjectedDailyExpenses( void )
{ {
INT32 iRate = 0; INT32 iRate = 0;
static INT32 iOldExpensesRate = -1; static INT32 iOldExpensesRate = -1;
CHAR16 sString[ 128 ];
INT16 sFontX, sFontY; INT16 sFontX, sFontY;
// grab the rate from the financial system // grab the rate from the financial system
@@ -1749,22 +1740,18 @@ void DisplayProjectedDailyExpenses( void )
} }
SetFontBackground( FONT_BLACK ); SetFontBackground( FONT_BLACK );
swprintf( sString, L"%d", iRate ); auto rate{FormatMoney(iRate)};
// insert extra characters
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
VarFindFontCenterCoordinates( VarFindFontCenterCoordinates(
UI_BOTTOM.Text.CurrentExpenses.x, UI_BOTTOM.Text.CurrentExpenses.x,
UI_BOTTOM.Text.CurrentExpenses.y, UI_BOTTOM.Text.CurrentExpenses.y,
UI_BOTTOM.Text.CurrentExpenses.width, UI_BOTTOM.Text.CurrentExpenses.width,
UI_BOTTOM.Text.CurrentExpenses.height, UI_BOTTOM.Text.CurrentExpenses.height,
COMPFONT, &sFontX, &sFontY, sString COMPFONT, &sFontX, &sFontY, rate.data()
); );
// print it // print it
mprintf( sFontX, sFontY, L"%s", sString ); mprintf( sFontX, sFontY, L"%s", rate.data());
return; return;
} }
+2 -6
View File
@@ -4378,9 +4378,7 @@ void DisplayDistancesForHelicopter( void )
if( (INT32)uiTripCost > LaptopSaveInfo.iCurrentBalance ) if( (INT32)uiTripCost > LaptopSaveInfo.iCurrentBalance )
SetFontForeground( FONT_LTRED ); SetFontForeground( FONT_LTRED );
swprintf( sString, L"%d", uiTripCost ); swprintf( sString, L"%s", FormatMoney(uiTripCost).data());
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, ( INT16 ) (UI_MAP.HeliETA.PopupBox.y + 5 + 3 * GetFontHeight( MAP_FONT ) ), UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY ); FindFontRightCoordinates(UI_MAP.HeliETA.PopupBox.x + 5, ( INT16 ) (UI_MAP.HeliETA.PopupBox.y + 5 + 3 * GetFontHeight( MAP_FONT ) ), UI_MAP.HeliETA.PopupBox.width, 0, sString, MAP_FONT, &sX, &sY );
mprintf( sX, ( INT16 ) ( sYPosition + 5 + 3 * GetFontHeight( MAP_FONT ) ), sString ); mprintf( sX, ( INT16 ) ( sYPosition + 5 + 3 * GetFontHeight( MAP_FONT ) ), sString );
@@ -4857,9 +4855,7 @@ void BlitMineText( INT16 sMapX, INT16 sMapY )
if (PlayerControlsMine(ubMineIndex) && !gMineStatus[ ubMineIndex ].fEmpty) if (PlayerControlsMine(ubMineIndex) && !gMineStatus[ ubMineIndex ].fEmpty)
{ {
// show current production // show current production
swprintf( wSubString, L"%d", PredictDailyIncomeFromAMine(ubMineIndex, TRUE) ); swprintf( wSubString, L"%s", FormatMoney(PredictDailyIncomeFromAMine(ubMineIndex, TRUE)).data());
InsertCommasForDollarFigure( wSubString );
InsertDollarSignInToString( wSubString );
wcscpy( wString, wSubString ); wcscpy( wString, wSubString );
/* /*
@@ -549,20 +549,14 @@ void AddTextToMineBox( void )
swprintf( wString, L"%s:", pwMineStrings[ 3 ]); swprintf( wString, L"%s:", pwMineStrings[ 3 ]);
AddMonoString( &hStringHandle, wString ); AddMonoString( &hStringHandle, wString );
swprintf( wString, L"%d", PredictDailyIncomeFromAMine( ubMineIndex, TRUE ) ); AddSecondColumnMonoString( &hStringHandle, FormatMoney(PredictDailyIncomeFromAMine(ubMineIndex, TRUE)).data() );
InsertCommasForDollarFigure( wString );
InsertDollarSignInToString( wString );
AddSecondColumnMonoString( &hStringHandle, wString );
// potential production // potential production
swprintf( wString, L"%s:", pwMineStrings[ 4 ]); swprintf( wString, L"%s:", pwMineStrings[ 4 ]);
AddMonoString( &hStringHandle, wString ); AddMonoString( &hStringHandle, wString );
swprintf( wString, L"%d", GetMaxDailyRemovalFromMine( ubMineIndex ) ); AddSecondColumnMonoString( &hStringHandle, FormatMoney(GetMaxDailyRemovalFromMine(ubMineIndex)).data());
InsertCommasForDollarFigure( wString );
InsertDollarSignInToString( wString );
AddSecondColumnMonoString( &hStringHandle, wString );
// if potential is not nil // if potential is not nil
@@ -616,9 +610,7 @@ void AddTextToMineBox( void )
wcscpy( wString, L"Remaining (DEBUG):"); wcscpy( wString, L"Remaining (DEBUG):");
AddMonoString( &hStringHandle, wString ); AddMonoString( &hStringHandle, wString );
swprintf( wString, L"%d", GetTotalLeftInMine( ubMineIndex ) ); swprintf( wString, L"%s", FormatMoney( GetTotalLeftInMine( ubMineIndex ) ).data() );
InsertCommasForDollarFigure( wString );
InsertDollarSignInToString( wString );
AddSecondColumnMonoString( &hStringHandle, wString ); AddSecondColumnMonoString( &hStringHandle, wString );
#endif #endif
+1 -5
View File
@@ -6261,11 +6261,7 @@ BOOLEAN NotifyPlayerWhenEnemyTakesControlOfImportantSector( INT16 sSectorX, INT1
iValue = GetProjectedTotalDailyIncome( ); iValue = GetProjectedTotalDailyIncome( );
// parse the string // parse the string
swprintf( sStringC, L"%d", iValue ); swprintf( sStringC, L"%s", FormatMoney(iValue).data());
// insert
InsertCommasForDollarFigure( sStringC );
InsertDollarSignInToString( sStringC );
swprintf( sStringB, pMapErrorString[ 16 ], sString, sStringC ); swprintf( sStringB, pMapErrorString[ 16 ], sString, sStringC );
+1 -9
View File
@@ -1518,16 +1518,8 @@ void HandleNotifyPlayerCantAffordInsurance( void )
void HandleNotifyPlayerCanAffordInsurance( SOLDIERTYPE *pSoldier, UINT8 ubLength, INT32 iCost ) void HandleNotifyPlayerCanAffordInsurance( SOLDIERTYPE *pSoldier, UINT8 ubLength, INT32 iCost )
{ {
CHAR16 sString[ 128 ]; CHAR16 sString[ 128 ];
CHAR16 sStringA[ 32 ];
//parse the cost swprintf( sString, zMarksMapScreenText[ 10 ], pSoldier->GetName(), FormatMoney(iCost).data(), ubLength );
swprintf( sStringA, L"%d",iCost );
// insert the commans and dollar sign
InsertCommasForDollarFigure( sStringA );
InsertDollarSignInToString( sStringA );
swprintf( sString, zMarksMapScreenText[ 10 ], pSoldier->GetName(), sStringA, ubLength );
//Set the length to the global variable ( so we know how long the contract is in the callback ) //Set the length to the global variable ( so we know how long the contract is in the callback )
gubContractLength = ubLength; gubContractLength = ubLength;
+1 -8
View File
@@ -318,15 +318,8 @@ void MercDailyUpdate()
} }
else else
{ {
CHAR16 zMoney[128];
//create a string for the salary owed to the npc
swprintf( zMoney, L"%d", sSalary );
InsertCommasForDollarFigure( zMoney );
InsertDollarSignInToString( zMoney );
//Display a screen msg indicating that the npc was NOT paid //Display a screen msg indicating that the npc was NOT paid
ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, pMessageStrings[ MSG_CANT_AFFORD_TO_PAY_NPC_DAILY_SALARY_MSG ], gMercProfiles[ pSoldier->ubProfile ].zNickname, zMoney ); ScreenMsg( FONT_MCOLOR_WHITE, MSG_INTERFACE, pMessageStrings[ MSG_CANT_AFFORD_TO_PAY_NPC_DAILY_SALARY_MSG ], gMercProfiles[ pSoldier->ubProfile ].zNickname, FormatMoney(sSalary).data() );
//if the merc hasnt been paid for NUM_DAYS_TILL_UNPAID_RPC_QUITS days, the merc will quit //if the merc hasnt been paid for NUM_DAYS_TILL_UNPAID_RPC_QUITS days, the merc will quit
if( ( gMercProfiles[ pSoldier->ubProfile ].iBalance - sSalary ) <= -( sSalary * NUM_DAYS_TILL_UNPAID_RPC_QUITS ) ) if( ( gMercProfiles[ pSoldier->ubProfile ].iBalance - sSalary ) <= -( sSalary * NUM_DAYS_TILL_UNPAID_RPC_QUITS ) )
+6 -12
View File
@@ -3228,35 +3228,29 @@ void DrawCharacterInfo(INT16 sCharNumber)
iDailyCost = gMercProfiles[ pSoldier->ubProfile ].sSalary; iDailyCost = gMercProfiles[ pSoldier->ubProfile ].sSalary;
} }
swprintf(sString, L"%d", iDailyCost );
// insert commas and dollar sign
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
{ {
auto tmpMoney{ FormatMoney(iDailyCost) };
const auto x = UI_CHARPANEL.Text.Salary.x; const auto x = UI_CHARPANEL.Text.Salary.x;
const auto y = UI_CHARPANEL.Text.Salary.y; const auto y = UI_CHARPANEL.Text.Salary.y;
const auto w = UI_CHARPANEL.Text.Salary.width; const auto w = UI_CHARPANEL.Text.Salary.width;
const auto h = UI_CHARPANEL.Text.Salary.height; const auto h = UI_CHARPANEL.Text.Salary.height;
FindFontRightCoordinates(x, y, w, h, sString, CHAR_FONT, &usX, &usY); FindFontRightCoordinates(x, y, w, h, tmpMoney.data(), CHAR_FONT, &usX, &usY);
DrawString(sString, usX, usY, CHAR_FONT); DrawString(tmpMoney.data(), usX, usY, CHAR_FONT);
} }
// medical deposit // medical deposit
if( gMercProfiles[ gCharactersList[ sCharNumber ].usSolID->ubProfile ].sMedicalDepositAmount > 0 ) if( gMercProfiles[ gCharactersList[ sCharNumber ].usSolID->ubProfile ].sMedicalDepositAmount > 0 )
{ {
swprintf(sString, L"%d", gMercProfiles[ gCharactersList[ sCharNumber ].usSolID->ubProfile ].sMedicalDepositAmount ); auto tmpMoney{ FormatMoney(gMercProfiles[gCharactersList[sCharNumber].usSolID->ubProfile].sMedicalDepositAmount) };
// insert commas and dollar sign
InsertCommasForDollarFigure( sString );
InsertDollarSignInToString( sString );
{ {
const auto x = UI_CHARPANEL.Text.Medical.x; const auto x = UI_CHARPANEL.Text.Medical.x;
const auto y = UI_CHARPANEL.Text.Medical.y; const auto y = UI_CHARPANEL.Text.Medical.y;
const auto w = UI_CHARPANEL.Text.Medical.width; const auto w = UI_CHARPANEL.Text.Medical.width;
const auto h = UI_CHARPANEL.Text.Medical.height; const auto h = UI_CHARPANEL.Text.Medical.height;
FindFontRightCoordinates(x, y, w, h, sString, CHAR_FONT, &usX, &usY); FindFontRightCoordinates(x, y, w, h, tmpMoney.data(), CHAR_FONT, &usX, &usY);
DrawString(sString, usX, y, CHAR_FONT); DrawString(tmpMoney.data(), usX, y, CHAR_FONT);
} }
} }
+3 -6
View File
@@ -474,7 +474,6 @@ void HandleDialogue( )
BOOLEAN fDoneTalking = FALSE; BOOLEAN fDoneTalking = FALSE;
SOLDIERTYPE *pSoldier = NULL; SOLDIERTYPE *pSoldier = NULL;
CHAR16 zText[ 512 ]; CHAR16 zText[ 512 ];
CHAR16 zMoney[128];
// we don't want to just delay action of some events, we want to pause the whole queue, regardless of the event // we don't want to just delay action of some events, we want to pause the whole queue, regardless of the event
if( gfDialogueQueuePaused ) if( gfDialogueQueuePaused )
@@ -1055,18 +1054,16 @@ void HandleDialogue( )
if ( QItem.uiSpecialEventFlag & DIALOGUE_SPECIAL_EVENT_SHOPKEEPER ) if ( QItem.uiSpecialEventFlag & DIALOGUE_SPECIAL_EVENT_SHOPKEEPER )
{ {
std::wstring zMoney{};
if( QItem.uiSpecialEventData < 3 ) if( QItem.uiSpecialEventData < 3 )
{ {
// post a notice if the player wants to withdraw money from thier account to cover the difference? // post a notice if the player wants to withdraw money from thier account to cover the difference?
swprintf( zMoney, L"%d", QItem.uiSpecialEventData2 ); zMoney = FormatMoney(QItem.uiSpecialEventData2);
InsertCommasForDollarFigure( zMoney );
InsertDollarSignInToString( zMoney );
} }
else if ( QItem.uiSpecialEventData > 7 ) else if ( QItem.uiSpecialEventData > 7 )
{ {
// post a notice if the player wants to withdraw money from thier account to cover the difference? // post a notice if the player wants to withdraw money from thier account to cover the difference?
swprintf( zMoney, L"%d", QItem.uiSpecialEventData2 ); zMoney = FormatMoney(QItem.uiSpecialEventData2);
InsertCommasForDollarFigure( zMoney );
} }
switch( QItem.uiSpecialEventData ) switch( QItem.uiSpecialEventData )
+4 -8
View File
@@ -4634,8 +4634,7 @@ void StartDialogueMessageBox( UINT8 ubProfileID, UINT16 usMessageBoxType )
case NPC_ACTION_ASK_ABOUT_PAYING_RPC: case NPC_ACTION_ASK_ABOUT_PAYING_RPC:
case NPC_ACTION_ASK_ABOUT_PAYING_RPC_WITH_DAILY_SALARY: case NPC_ACTION_ASK_ABOUT_PAYING_RPC_WITH_DAILY_SALARY:
case NPC_ACTION_REDUCE_CONRAD_SALARY_CONDITIONS: case NPC_ACTION_REDUCE_CONRAD_SALARY_CONDITIONS:
swprintf( zTemp2, L"%d", gMercProfiles[ubProfileID].sSalary ); swprintf( zTemp2, L"%s", FormatMoney(gMercProfiles[ubProfileID].sSalary).data());
InsertDollarSignInToString( zTemp2 );
swprintf( zTemp, TacticalStr[ HIRE_PROMPT ], gMercProfiles[ubProfileID].zNickname, zTemp2 ); swprintf( zTemp, TacticalStr[ HIRE_PROMPT ], gMercProfiles[ubProfileID].zNickname, zTemp2 );
DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL ); DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL );
break; break;
@@ -4644,8 +4643,7 @@ void StartDialogueMessageBox( UINT8 ubProfileID, UINT16 usMessageBoxType )
DoMessageBox( MSG_BOX_BASIC_STYLE, TacticalStr[ BOXING_PROMPT ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL ); DoMessageBox( MSG_BOX_BASIC_STYLE, TacticalStr[ BOXING_PROMPT ], GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL );
break; break;
case NPC_ACTION_BUY_LEATHER_KEVLAR_VEST: case NPC_ACTION_BUY_LEATHER_KEVLAR_VEST:
swprintf( zTemp2, L"%d", Item[LEATHER_JACKET_W_KEVLAR].usPrice ); swprintf( zTemp2, L"%s", FormatMoney(Item[LEATHER_JACKET_W_KEVLAR].usPrice).data());
InsertDollarSignInToString( zTemp2 );
swprintf( zTemp, TacticalStr[ BUY_VEST_PROMPT ], ItemNames[LEATHER_JACKET_W_KEVLAR], zTemp2 ); swprintf( zTemp, TacticalStr[ BUY_VEST_PROMPT ], ItemNames[LEATHER_JACKET_W_KEVLAR], zTemp2 );
DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL ); DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL );
break; break;
@@ -4666,15 +4664,13 @@ void StartDialogueMessageBox( UINT8 ubProfileID, UINT16 usMessageBoxType )
{ {
iTemp -= giHospitalRefund; iTemp -= giHospitalRefund;
} }
swprintf( zTemp2, L"%ld", iTemp ); swprintf( zTemp2, L"%s", FormatMoney(iTemp).data());
InsertDollarSignInToString( zTemp2 );
swprintf( zTemp, TacticalStr[ PAY_MONEY_PROMPT ], zTemp2 ); swprintf( zTemp, TacticalStr[ PAY_MONEY_PROMPT ], zTemp2 );
DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL ); DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL );
break; break;
case NPC_ACTION_BUY_VEHICLE_REQUESTOR: case NPC_ACTION_BUY_VEHICLE_REQUESTOR:
swprintf( zTemp2, L"%ld", 10000 ); swprintf( zTemp2, L"%s", FormatMoney(10000).data());
InsertDollarSignInToString( zTemp2 );
swprintf( zTemp, TacticalStr[ PAY_MONEY_PROMPT ], zTemp2 ); swprintf( zTemp, TacticalStr[ PAY_MONEY_PROMPT ], zTemp2 );
DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL ); DoMessageBox( MSG_BOX_BASIC_STYLE, zTemp, GAME_SCREEN, ( UINT8 )MSG_BOX_FLAG_YESNO, DialogueMessageBoxCallBack, NULL );
+6 -18
View File
@@ -7931,9 +7931,7 @@ void RenderItemDescriptionBox( )
//Display the total amount of money remaining //Display the total amount of money remaining
SetFontForeground( 5 ); SetFontForeground( 5 );
swprintf( pStr, L"%ld", gRemoveMoney.uiMoneyRemaining ); swprintf( pStr, L"%s", FormatMoney(gRemoveMoney.uiMoneyRemaining).data() );
InsertCommasForDollarFigure( pStr );
InsertDollarSignInToString( pStr );
if (UsingNewInventorySystem() == true) if (UsingNewInventorySystem() == true)
FindFontRightCoordinates( gMoneyStats[ 4 ].sX + 50, gMoneyStats[ 4 ].sY, ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY); FindFontRightCoordinates( gMoneyStats[ 4 ].sX + 50, gMoneyStats[ 4 ].sY, ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY);
else else
@@ -7942,9 +7940,7 @@ void RenderItemDescriptionBox( )
//Display the total amount of money removing //Display the total amount of money removing
SetFontForeground( 5 ); SetFontForeground( 5 );
swprintf( pStr, L"%ld", gRemoveMoney.uiMoneyRemoving ); swprintf( pStr, L"%s", FormatMoney(gRemoveMoney.uiMoneyRemoving).data() );
InsertCommasForDollarFigure( pStr );
InsertDollarSignInToString( pStr );
if (UsingNewInventorySystem() == true) if (UsingNewInventorySystem() == true)
FindFontRightCoordinates( gMoneyStats[ 5 ].sX + 50, gMoneyStats[ 5 ].sY, ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY); FindFontRightCoordinates( gMoneyStats[ 5 ].sX + 50, gMoneyStats[ 5 ].sY, ITEM_STATS_WIDTH ,ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY);
else else
@@ -7973,9 +7969,7 @@ void RenderItemDescriptionBox( )
// { // {
SetFontForeground( FONT_FCOLOR_WHITE ); SetFontForeground( FONT_FCOLOR_WHITE );
SetFontShadow( DEFAULT_SHADOW ); SetFontShadow( DEFAULT_SHADOW );
swprintf( pStr, L"%ld", (*gpItemDescObject)[gubItemDescStatusIndex]->data.money.uiMoneyAmount ); swprintf( pStr, L"%s", FormatMoney((*gpItemDescObject)[gubItemDescStatusIndex]->data.money.uiMoneyAmount).data() );
InsertCommasForDollarFigure( pStr );
InsertDollarSignInToString( pStr );
if( guiCurrentItemDescriptionScreen == MAP_SCREEN ) if( guiCurrentItemDescriptionScreen == MAP_SCREEN )
FindFontRightCoordinates( (INT16)(ITEMDESC_NAME_X), (INT16)(ITEMDESC_NAME_Y ), 245, ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY); FindFontRightCoordinates( (INT16)(ITEMDESC_NAME_X), (INT16)(ITEMDESC_NAME_Y ), 245, ITEM_STATS_HEIGHT ,pStr, BLOCKFONT2, &usX, &usY);
else if ( UsingEDBSystem() > 0 ) else if ( UsingEDBSystem() > 0 )
@@ -11470,9 +11464,7 @@ void RenderItemPickupMenu( )
if ( Item[ pObject->usItem ].usItemClass == IC_MONEY ) if ( Item[ pObject->usItem ].usItemClass == IC_MONEY )
{ {
CHAR16 pStr2[20]; CHAR16 pStr2[20];
swprintf( pStr2, L"%ld", (*pObject)[0]->data.money.uiMoneyAmount ); swprintf( pStr2, L"%s", FormatMoney((*pObject)[0]->data.money.uiMoneyAmount ).data());
InsertCommasForDollarFigure( pStr2 );
InsertDollarSignInToString( pStr2 );
swprintf( pStr, L"%s (%ls)", ItemNames[ pObject->usItem ], pStr2 ); swprintf( pStr, L"%s (%ls)", ItemNames[ pObject->usItem ], pStr2 );
} }
@@ -12216,9 +12208,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
case MONEY: case MONEY:
//Money //Money
{ {
swprintf( pStr, L"%ld", (*pObject)[subObject]->data.money.uiMoneyAmount ); swprintf( pStr, L"%s", FormatMoney((*pObject)[subObject]->data.money.uiMoneyAmount ).data());
InsertCommasForDollarFigure( pStr );
InsertDollarSignInToString( pStr );
} }
break; break;
@@ -12227,9 +12217,7 @@ void GetHelpTextForItem( STR16 pzStr, OBJECTTYPE *pObject, SOLDIERTYPE *pSoldier
//if ( Item[ usItem ].usItemClass == IC_MONEY ) //if ( Item[ usItem ].usItemClass == IC_MONEY )
{ {
CHAR16 pStr2[20]; CHAR16 pStr2[20];
swprintf( pStr2, L"%ld", (*pObject)[subObject]->data.money.uiMoneyAmount ); swprintf( pStr2, L"%s", FormatMoney((*pObject)[subObject]->data.money.uiMoneyAmount ).data());
InsertCommasForDollarFigure( pStr2 );
InsertDollarSignInToString( pStr2 );
swprintf( pStr, L"%s (%ls)", ItemNames[ usItem ], pStr2 ); swprintf( pStr, L"%s (%ls)", ItemNames[ usItem ], pStr2 );
} }
+1 -4
View File
@@ -7783,10 +7783,7 @@ void SMInvMoneyButtonCallback( MOUSE_REGION * pRegion, INT32 iReason )
guiPendingOverrideEvent = A_CHANGE_TO_MOVE; guiPendingOverrideEvent = A_CHANGE_TO_MOVE;
HandleTacticalUI( ); HandleTacticalUI( );
swprintf( zMoney, L"%d", (*gpItemPointer)[0]->data.money.uiMoneyAmount ); swprintf( zMoney, L"%s", FormatMoney((*gpItemPointer)[0]->data.money.uiMoneyAmount ).data());
InsertCommasForDollarFigure( zMoney );
InsertDollarSignInToString( zMoney );
//ask the user if they are sure they want to deposit the money //ask the user if they are sure they want to deposit the money
swprintf( zText, gzMoneyWithdrawMessageText[ CONFIRMATION_TO_DEPOSIT_MONEY_TO_ACCOUNT ], zMoney ); swprintf( zText, gzMoneyWithdrawMessageText[ CONFIRMATION_TO_DEPOSIT_MONEY_TO_ACCOUNT ], zMoney );
+7 -16
View File
@@ -1524,9 +1524,7 @@ BOOLEAN RenderShopKeeperInterface()
// display shopkeeper budget // display shopkeeper budget
DisplayWrappedString( SKI_BUDGET_X, SKI_BUDGET_Y, SKI_BUDGET_WIDTH, 2, SKI_LABEL_FONT, SKI_TITLE_COLOR, SKI_Text[SKI_TEXT_BUDGET], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED ); DisplayWrappedString( SKI_BUDGET_X, SKI_BUDGET_Y, SKI_BUDGET_WIDTH, 2, SKI_LABEL_FONT, SKI_TITLE_COLOR, SKI_Text[SKI_TEXT_BUDGET], FONT_MCOLOR_BLACK, FALSE, CENTER_JUSTIFIED );
swprintf( zMoney, L"%d", gArmsDealerStatus[gbSelectedArmsDealerID].uiArmsDealersCash ); swprintf( zMoney, L"%s", FormatMoney(gArmsDealerStatus[gbSelectedArmsDealerID].uiArmsDealersCash).data() );
InsertCommasForDollarFigure( zMoney );
CHAR16 zTemp2[64]; CHAR16 zTemp2[64];
if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL )
@@ -1554,14 +1552,12 @@ BOOLEAN RenderShopKeeperInterface()
//Display the players current balance value //Display the players current balance value
if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL )
{ {
swprintf( zMoney, L"%d", (int)(GetIntel()) ); swprintf( zMoney, L"%s", FormatMoney((int)(GetIntel()) ).data());
InsertCommasForDollarFigure( zMoney );
swprintf( zTemp2, L"%s Intel", zMoney ); swprintf( zTemp2, L"%s Intel", zMoney );
} }
else else
{ {
swprintf( zMoney, L"%d", LaptopSaveInfo.iCurrentBalance ); swprintf( zMoney, L"%s", FormatMoney(LaptopSaveInfo.iCurrentBalance ).data());
InsertCommasForDollarFigure( zMoney );
swprintf( zTemp2, L"$%s", zMoney ); swprintf( zTemp2, L"$%s", zMoney );
} }
@@ -1732,9 +1728,7 @@ void DisplayAllDealersCash()
DrawTextToScreen( gMercProfiles[ armsDealerInfo[ bArmsDealer ].ubShopKeeperID ].zNickname, SCREEN_X_OFFSET + 540, SCREEN_Y_OFFSET + usPosY, 0, FONT10ARIAL, SKI_TITLE_COLOR, FONT_MCOLOR_BLACK, TRUE, LEFT_JUSTIFIED ); DrawTextToScreen( gMercProfiles[ armsDealerInfo[ bArmsDealer ].ubShopKeeperID ].zNickname, SCREEN_X_OFFSET + 540, SCREEN_Y_OFFSET + usPosY, 0, FONT10ARIAL, SKI_TITLE_COLOR, FONT_MCOLOR_BLACK, TRUE, LEFT_JUSTIFIED );
//Display the arms dealer cash on hand //Display the arms dealer cash on hand
swprintf( zTemp, L"%d", gArmsDealerStatus[ bArmsDealer ].uiArmsDealersCash ); swprintf( zTemp, L"%s", FormatMoney(gArmsDealerStatus[ bArmsDealer ].uiArmsDealersCash ).data());
InsertCommasForDollarFigure( zTemp );
if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL )
swprintf( zTemp2, L"%s Intel", zTemp ); swprintf( zTemp2, L"%s Intel", zTemp );
@@ -2789,8 +2783,7 @@ UINT32 DisplayInvSlot( UINT16 ubSlotNum, UINT16 usItemIndex, UINT16 usPosX, UINT
//if the item has a price, display it //if the item has a price, display it
if( uiItemCost != 0 ) if( uiItemCost != 0 )
{ {
swprintf( zTemp, L"%d", uiItemCost ); swprintf( zTemp, L"%s", FormatMoney(uiItemCost).data() );
InsertCommasForDollarFigure( zTemp );
CHAR16 zTemp2[64]; CHAR16 zTemp2[64];
if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL )
@@ -3462,8 +3455,7 @@ void DisplayArmsDealerOfferArea()
if( gubSkiDirtyLevel == SKI_DIRTY_LEVEL2 ) if( gubSkiDirtyLevel == SKI_DIRTY_LEVEL2 )
{ {
//Display the total cost text //Display the total cost text
swprintf( zTemp, L"%d", uiTotalCost ); swprintf( zTemp, L"%s", FormatMoney(uiTotalCost).data() );
InsertCommasForDollarFigure( zTemp );
CHAR16 zTemp2[64]; CHAR16 zTemp2[64];
if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL )
@@ -3727,8 +3719,7 @@ void DisplayPlayersOfferArea()
if( gubSkiDirtyLevel == SKI_DIRTY_LEVEL2 ) if( gubSkiDirtyLevel == SKI_DIRTY_LEVEL2 )
{ {
//Display the total cost text //Display the total cost text
swprintf( zTemp, L"%d", uiTotalCost ); swprintf( zTemp, L"%s", FormatMoney(uiTotalCost).data() );
InsertCommasForDollarFigure( zTemp );
CHAR16 zTemp2[64]; CHAR16 zTemp2[64];
if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL ) if ( armsDealerInfo[gbSelectedArmsDealerID].uiFlags & ARMS_DEALER_DEALWITHINTEL )
+1 -2
View File
@@ -1546,8 +1546,7 @@ BOOLEAN HandleNPCBeingGivenMoneyByPlayer( UINT8 ubNPC, UINT32 uiMoneyAmount, UIN
{ {
CHAR16 sTempString[ 100 ]; CHAR16 sTempString[ 100 ];
swprintf( sTempString, L"%ld", iCost - uiMoneyAmount - giHospitalTempBalance ); swprintf( sTempString, L"%s", FormatMoney(iCost - uiMoneyAmount - giHospitalTempBalance).data());
InsertDollarSignInToString( sTempString );
// not enough cash // not enough cash
ScreenMsg( FONT_MCOLOR_LTYELLOW, ScreenMsg( FONT_MCOLOR_LTYELLOW,