mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
use FormatMoney everywhere
This commit is contained in:
committed by
majcosta
parent
0dd32c4670
commit
3d29eff4d8
+11
-35
@@ -1099,7 +1099,6 @@ BOOLEAN RenderAIMMembers()
|
||||
HVOBJECT hPriceHandle;
|
||||
HVOBJECT hWeaponBoxHandle;
|
||||
UINT16 x, uiPosX;
|
||||
CHAR16 wTemp[50];
|
||||
|
||||
DrawAimDefaults();
|
||||
|
||||
@@ -1144,11 +1143,8 @@ BOOLEAN RenderAIMMembers()
|
||||
//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 );
|
||||
|
||||
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;
|
||||
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
|
||||
}
|
||||
else
|
||||
@@ -1191,11 +1187,8 @@ BOOLEAN RenderAIMMembers()
|
||||
//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 );
|
||||
|
||||
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;
|
||||
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
|
||||
}
|
||||
|
||||
@@ -1337,15 +1330,10 @@ BOOLEAN UpdateMercInfo(void)
|
||||
//if medical deposit is required
|
||||
if( gMercProfiles[gbCurrentSoldier].bMedicalDeposit )
|
||||
{
|
||||
CHAR16 zTemp[40];
|
||||
CHAR16 sMedicalString[40];
|
||||
|
||||
// Display the medical cost
|
||||
swprintf( zTemp, L"%d", gMercProfiles[ gbCurrentSoldier ].sMedicalDepositAmount );
|
||||
InsertCommasForDollarFigure( zTemp );
|
||||
InsertDollarSignInToString( zTemp );
|
||||
|
||||
swprintf( sMedicalString, L"%s %s", zTemp, CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
|
||||
swprintf( sMedicalString, L"%s %s", FormatMoney(gMercProfiles[gbCurrentSoldier].sMedicalDepositAmount).data(), CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
|
||||
|
||||
// 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 )
|
||||
@@ -1403,11 +1391,7 @@ BOOLEAN UpdateMercInfo(void)
|
||||
CHAR16 sMedicalString[40];
|
||||
|
||||
// Display the medical cost
|
||||
swprintf( zTemp, L"%d", gMercProfiles[ gbCurrentSoldier ].sMedicalDepositAmount );
|
||||
InsertCommasForDollarFigure( zTemp );
|
||||
InsertDollarSignInToString( zTemp );
|
||||
|
||||
swprintf( sMedicalString, L"%s %s", zTemp, CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
|
||||
swprintf( sMedicalString, L"%s %s", FormatMoney(gMercProfiles[gbCurrentSoldier].sMedicalDepositAmount).data(), CharacterInfo[AIM_MEMBER_MEDICAL_DEPOSIT_REQ] );
|
||||
|
||||
// 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 )
|
||||
@@ -2686,7 +2670,6 @@ void DisplaySelectLights(BOOLEAN fContractDown, BOOLEAN fBuyEquipDown)
|
||||
UINT32 DisplayMercChargeAmount()
|
||||
{
|
||||
CHAR16 wTemp[50];
|
||||
CHAR16 wDollarTemp[50];
|
||||
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( FindSoldierByProfileID( gbCurrentSoldier, TRUE ) == NULL )
|
||||
{
|
||||
#ifdef JA2UB
|
||||
// Don't even have to pay for medical insurance! What a DEAL!
|
||||
swprintf(wTemp, L"%s", wDollarTemp);
|
||||
#else
|
||||
if( gMercProfiles[ gbCurrentSoldier ].bMedicalDeposit )
|
||||
swprintf(wTemp, L"%s %s", wDollarTemp, VideoConfercingText[AIM_MEMBER_WITH_MEDICAL] );
|
||||
else
|
||||
swprintf(wTemp, L"%s", wDollarTemp );
|
||||
#endif // JA2UB
|
||||
auto contractAmount{ FormatMoney(giContractAmount) };
|
||||
#ifndef JA2UB
|
||||
if (gMercProfiles[gbCurrentSoldier].bMedicalDeposit)
|
||||
contractAmount += L" ";
|
||||
contractAmount += VideoConfercingText[AIM_MEMBER_WITH_MEDICAL];
|
||||
#endif
|
||||
|
||||
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);
|
||||
|
||||
+3
-12
@@ -1424,8 +1424,6 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
|
||||
UINT8 ubCount=0;
|
||||
UINT16 PosY, usTextPosY;
|
||||
UINT16 usItemIndex;
|
||||
CHAR16 sDollarTemp[60];
|
||||
CHAR16 sTemp[60];
|
||||
CHAR16 sPage[60];
|
||||
INT16 pItemNumbers[ BOBBYR_NUM_WEAPONS_ON_PAGE ];
|
||||
BOOLEAN bAddItem = FALSE;
|
||||
@@ -1434,11 +1432,8 @@ BOOLEAN DisplayItemInfo(UINT32 uiItemClass, INT32 iFilter, INT32 iSubFilter)
|
||||
usTextPosY = BOBBYR_ITEM_DESC_START_Y;
|
||||
|
||||
//Display the subtotal at the bottom of the screen
|
||||
swprintf( sDollarTemp, L"%d", CalculateTotalPurchasePrice() );
|
||||
InsertCommasForDollarFigure( sDollarTemp );
|
||||
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);
|
||||
auto subtotal{ std::wstring(BobbyRText[BOBBYR_GUNS_SUB_TOTAL]) + std::wstring(L" ") + FormatMoney(CalculateTotalPurchasePrice()) };
|
||||
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);
|
||||
|
||||
//Buggler: Display the current page & total pages at the bottom of the screen
|
||||
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);
|
||||
usPosY += usFontHeight + 2;
|
||||
|
||||
swprintf(sTemp, L"%d", CalcBobbyRayCost( usIndex, usBobbyIndex, fUsed ));
|
||||
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);
|
||||
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);
|
||||
usPosY += usFontHeight + 2;
|
||||
|
||||
|
||||
|
||||
+12
-43
@@ -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);
|
||||
|
||||
//unit price
|
||||
swprintf(sTemp, L"%d", CalcBobbyRayCost( pBobbyRayPurchase[i].usItemIndex, pBobbyRayPurchase[i].usBobbyItemIndex, pBobbyRayPurchase[i].fUsed ));
|
||||
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);
|
||||
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);
|
||||
|
||||
uiTotal += CalcBobbyRayCost( pBobbyRayPurchase[i].usItemIndex, pBobbyRayPurchase[i].usBobbyItemIndex, pBobbyRayPurchase[i].fUsed ) * pBobbyRayPurchase[i].ubNumberPurchased;
|
||||
|
||||
swprintf(sTemp, L"%d", uiTotal );
|
||||
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);
|
||||
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);
|
||||
|
||||
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 )
|
||||
{
|
||||
CHAR16 sTemp[20];
|
||||
HVOBJECT hPixHandle;
|
||||
INT32 iShippingCost = 0;
|
||||
// INT32 iTotal;
|
||||
@@ -1331,27 +1322,15 @@ void DisplayShippingCosts( BOOLEAN fCalledFromOrderPage, INT32 iSubTotal, UINT16
|
||||
if( iSubTotal )
|
||||
{
|
||||
//Display the subtotal
|
||||
swprintf(sTemp, L"%d", iSubTotal );
|
||||
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);
|
||||
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);
|
||||
|
||||
//Display the shipping and handling charge
|
||||
swprintf(sTemp, L"%d", iShippingCost );
|
||||
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);
|
||||
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);
|
||||
|
||||
|
||||
//Display the grand total
|
||||
giGrandTotal = iSubTotal + iShippingCost;
|
||||
swprintf(sTemp, L"%d", giGrandTotal );
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
InvalidateRegion(iScreenWidthOffset + 333,iScreenHeightOffset + 326,iScreenWidthOffset + 374,iScreenHeightOffset + 400);
|
||||
@@ -1830,7 +1809,7 @@ void DrawSelectedCity( UINT8 ubCityNumber )
|
||||
|
||||
void DisplayShippingLocationCity()
|
||||
{
|
||||
CHAR16 sTemp[40];
|
||||
std::wstring sTemp{ L"$0" };
|
||||
UINT16 usPosY;
|
||||
|
||||
//display the name on the title bar
|
||||
@@ -1853,39 +1832,29 @@ void DisplayShippingLocationCity()
|
||||
//Display the shipping cost
|
||||
usPosY = BOBBYR_OVERNIGHT_EXPRESS_Y;
|
||||
|
||||
wcscpy(sTemp, L"$0");
|
||||
|
||||
if( gbSelectedCity != -1 )
|
||||
{
|
||||
// swprintf( sTemp, L"%d", ( INT32 )(BobbyROrderLocations[gbSelectedCity].usOverNightExpress/GetWeightBasedOnMetricOption( 1 ) ) );
|
||||
swprintf( sTemp, L"%d", ( INT32 )(gPostalService.GetDestinationFee(0, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption( 1 ) ) );
|
||||
InsertCommasForDollarFigure( sTemp );
|
||||
InsertDollarSignInToString( sTemp );
|
||||
sTemp = FormatMoney(static_cast<INT32>(gPostalService.GetDestinationFee(0, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption(1)));
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
if( gbSelectedCity != -1 )
|
||||
{
|
||||
// swprintf( sTemp, L"%d", ( INT32 )( BobbyROrderLocations[gbSelectedCity].us2DaysService / GetWeightBasedOnMetricOption( 1 ) ) );
|
||||
swprintf( sTemp, L"%d", ( INT32 )(gPostalService.GetDestinationFee(1, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption( 1 ) ) );
|
||||
InsertCommasForDollarFigure( sTemp );
|
||||
InsertDollarSignInToString( sTemp );
|
||||
sTemp = FormatMoney(static_cast<INT32>(gPostalService.GetDestinationFee(1, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption(1)));
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
if( gbSelectedCity != -1 )
|
||||
{
|
||||
// swprintf( sTemp, L"%d", (INT32 )( BobbyROrderLocations[gbSelectedCity].usStandardService / GetWeightBasedOnMetricOption( 1 ) ) );
|
||||
swprintf( sTemp, L"%d", ( INT32 )(gPostalService.GetDestinationFee(2, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption( 1 ) ) );
|
||||
InsertCommasForDollarFigure( sTemp );
|
||||
InsertDollarSignInToString( sTemp );
|
||||
sTemp = FormatMoney(static_cast<INT32>(gPostalService.GetDestinationFee(2, gDestinationTable[gbSelectedCity]->usID) / GetWeightBasedOnMetricOption(1)));
|
||||
}
|
||||
|
||||
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 )
|
||||
|
||||
+1
-8
@@ -6165,15 +6165,8 @@ BOOLEAN ReplaceMercNameAndAmountWithProperData( CHAR16 *pFinishedString, EmailPt
|
||||
}
|
||||
else
|
||||
{
|
||||
CHAR16 sDollarAmount[64];
|
||||
|
||||
swprintf( sDollarAmount, L"%d", pMail->iFirstData );
|
||||
|
||||
InsertCommasForDollarFigure( sDollarAmount );
|
||||
InsertDollarSignInToString( sDollarAmount );
|
||||
|
||||
//add the mercs name to the string
|
||||
wcscat( pFinishedString, sDollarAmount );
|
||||
wcscat( pFinishedString, FormatMoney(pMail->iFirstData).data() );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
+34
-114
@@ -808,31 +808,15 @@ void DrawRecordsText( void )
|
||||
if(pCurFinance->iAmount >=0)
|
||||
{
|
||||
// increase in asset - debit
|
||||
swprintf(sString, L"%d", pCurFinance->iAmount);
|
||||
// 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 );
|
||||
}
|
||||
|
||||
swprintf(sString, L"%s", FormatMoney(pCurFinance->iAmount).data());
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
// decrease in asset - credit
|
||||
swprintf(sString, L"%d", pCurFinance->iAmount * (-1));
|
||||
swprintf(sString, L"%s", FormatMoney(pCurFinance->iAmount * (-1)).data());
|
||||
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);
|
||||
mprintf(usX, 12+RECORD_Y + (iCounter * ( GetFontHeight( FINANCE_TEXT_FONT ) + 6 ) ), sString);
|
||||
@@ -860,15 +844,7 @@ void DrawRecordsText( void )
|
||||
|
||||
|
||||
// print the balance string
|
||||
swprintf(sString, L"%d", iBalance);
|
||||
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 );
|
||||
}
|
||||
|
||||
swprintf(sString, L"%s", FormatMoney(iBalance).data());
|
||||
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);
|
||||
|
||||
@@ -921,7 +897,7 @@ void InvalidateLapTopScreen( void )
|
||||
void DrawSummaryText( void )
|
||||
{
|
||||
INT16 usX, usY;
|
||||
CHAR16 pString[100];
|
||||
std::wstring tmp{};
|
||||
INT32 iBalance = 0;
|
||||
|
||||
|
||||
@@ -949,98 +925,68 @@ void DrawSummaryText( void )
|
||||
|
||||
// yesterdays income
|
||||
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 );
|
||||
|
||||
if( iBalance != 0 )
|
||||
InsertDollarSignInToString( pString );
|
||||
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
mprintf(usX,YESTERDAYS_INCOME,pString);
|
||||
mprintf(usX,YESTERDAYS_INCOME,tmp.data());
|
||||
|
||||
SetFontForeground( FONT_BLACK );
|
||||
|
||||
// yesterdays other
|
||||
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 );
|
||||
if( iBalance != 0 )
|
||||
InsertDollarSignInToString( pString );
|
||||
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
mprintf(usX,YESTERDAYS_OTHER,pString);
|
||||
mprintf(usX,YESTERDAYS_OTHER,tmp.data());
|
||||
|
||||
SetFontForeground( FONT_RED );
|
||||
|
||||
// yesterdays debits
|
||||
iBalance = GetYesterdaysDebits( );
|
||||
if( iBalance < 0 )
|
||||
{
|
||||
SetFontForeground( FONT_RED );
|
||||
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_DEBITS,pString);
|
||||
mprintf(usX,YESTERDAYS_DEBITS,tmp.data());
|
||||
|
||||
SetFontForeground( FONT_BLACK );
|
||||
|
||||
// yesterdays balance..ending balance..so todays balance then
|
||||
iBalance = GetTodaysBalance( );
|
||||
|
||||
if( iBalance < 0 )
|
||||
{
|
||||
SetFontForeground( FONT_RED );
|
||||
iBalance *= -1;
|
||||
}
|
||||
tmp = FormatMoney(iBalance);
|
||||
|
||||
swprintf(pString, L"%d", iBalance );
|
||||
InsertCommasForDollarFigure( pString );
|
||||
if( iBalance != 0 )
|
||||
InsertDollarSignInToString( pString );
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0, tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
mprintf(usX,YESTERDAYS_BALANCE,pString);
|
||||
mprintf(usX,YESTERDAYS_BALANCE,tmp.data());
|
||||
|
||||
SetFontForeground( FONT_BLACK );
|
||||
|
||||
// todays income
|
||||
iBalance = GetTodaysDaysIncome( );
|
||||
swprintf(pString, L"%d", iBalance );
|
||||
tmp = FormatMoney(iBalance);
|
||||
|
||||
InsertCommasForDollarFigure( pString );
|
||||
if( iBalance != 0 )
|
||||
InsertDollarSignInToString( pString );
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
mprintf(usX,TODAYS_INCOME,pString);
|
||||
mprintf(usX,TODAYS_INCOME,tmp.data());
|
||||
|
||||
SetFontForeground( FONT_BLACK );
|
||||
|
||||
// todays other
|
||||
iBalance = GetTodaysOtherDeposits( );
|
||||
swprintf(pString, L"%d", iBalance );
|
||||
tmp = FormatMoney(iBalance);
|
||||
|
||||
InsertCommasForDollarFigure( pString );
|
||||
if( iBalance != 0 )
|
||||
InsertDollarSignInToString( pString );
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
mprintf(usX,TODAYS_OTHER,pString);
|
||||
mprintf(usX,TODAYS_OTHER,tmp.data());
|
||||
|
||||
SetFontForeground( FONT_RED );
|
||||
|
||||
@@ -1053,15 +999,11 @@ void DrawSummaryText( void )
|
||||
iBalance *= ( -1 );
|
||||
}
|
||||
|
||||
swprintf(pString, L"%d", iBalance );
|
||||
tmp = FormatMoney(iBalance);
|
||||
|
||||
InsertCommasForDollarFigure( pString );
|
||||
if( iBalance != 0 )
|
||||
InsertDollarSignInToString( pString );
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
mprintf(usX,TODAYS_DEBITS,pString);
|
||||
mprintf(usX,TODAYS_DEBITS,tmp.data());
|
||||
|
||||
SetFontForeground( FONT_BLACK );
|
||||
|
||||
@@ -1069,36 +1011,23 @@ void DrawSummaryText( void )
|
||||
iBalance = GetCurrentBalance( );
|
||||
if( iBalance < 0 )
|
||||
{
|
||||
iBalance *= -1;
|
||||
SetFontForeground( FONT_RED );
|
||||
swprintf(pString, L"%d", iBalance );
|
||||
iBalance *= -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf(pString, L"%d", iBalance );
|
||||
}
|
||||
|
||||
InsertCommasForDollarFigure( pString );
|
||||
if( iBalance != 0 )
|
||||
InsertDollarSignInToString( pString );
|
||||
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
||||
mprintf(usX,TODAYS_CURRENT_BALANCE,pString);
|
||||
tmp = FormatMoney(iBalance);
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||
mprintf(usX,TODAYS_CURRENT_BALANCE,tmp.data());
|
||||
SetFontForeground( FONT_BLACK );
|
||||
|
||||
|
||||
// todays forcast income
|
||||
iBalance = GetProjectedTotalDailyIncome( );
|
||||
swprintf(pString, L"%d", iBalance );
|
||||
tmp = FormatMoney(iBalance);
|
||||
|
||||
InsertCommasForDollarFigure( pString );
|
||||
if( iBalance != 0 )
|
||||
InsertDollarSignInToString( pString );
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
||||
|
||||
mprintf(usX,TODAYS_CURRENT_FORCAST_INCOME,pString);
|
||||
mprintf(usX,TODAYS_CURRENT_FORCAST_INCOME,tmp.data());
|
||||
|
||||
SetFontForeground( FONT_BLACK );
|
||||
|
||||
@@ -1107,22 +1036,13 @@ void DrawSummaryText( void )
|
||||
iBalance = GetCurrentBalance( ) + GetProjectedTotalDailyIncome( );
|
||||
if( iBalance < 0 )
|
||||
{
|
||||
iBalance *= -1;
|
||||
SetFontForeground( FONT_RED );
|
||||
swprintf(pString, L"%d", iBalance );
|
||||
iBalance *= -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf(pString, L"%d", iBalance );
|
||||
}
|
||||
|
||||
InsertCommasForDollarFigure( pString );
|
||||
if( iBalance != 0 )
|
||||
InsertDollarSignInToString( pString );
|
||||
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,pString,FINANCE_TEXT_FONT, &usX, &usY);
|
||||
mprintf(usX,TODAYS_CURRENT_FORCAST_BALANCE,pString);
|
||||
tmp = FormatMoney(iBalance);
|
||||
FindFontRightCoordinates(0,0,iScreenWidthOffset + 580,0,tmp.data(),FINANCE_TEXT_FONT, &usX, &usY);
|
||||
mprintf(usX,TODAYS_CURRENT_FORCAST_BALANCE,tmp.data());
|
||||
SetFontForeground( FONT_BLACK );
|
||||
|
||||
|
||||
|
||||
@@ -700,6 +700,7 @@ BOOLEAN DisplayOrderGrid( UINT8 ubGridNumber, UINT8 ubMercID )
|
||||
iCostOfContract = 0;
|
||||
}
|
||||
|
||||
std::wstring amountRefund{};
|
||||
if( iCostOfContract < 0 )
|
||||
{
|
||||
//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 );
|
||||
|
||||
//display the amount of refund
|
||||
swprintf( sText, L"%d", iCostOfContract );
|
||||
InsertCommasForDollarFigure( sText );
|
||||
InsertDollarSignInToString( sText );
|
||||
amountRefund = FormatMoney(iCostOfContract);
|
||||
}
|
||||
|
||||
|
||||
if( IsMercDead( ubMercID ) )
|
||||
{
|
||||
swprintf( sText, L"0");
|
||||
InsertDollarSignInToString( sText );
|
||||
amountRefund = L"$0";
|
||||
}
|
||||
//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
@@ -5084,36 +5084,28 @@ void ShouldNewMailBeDisplayed()
|
||||
void DisplayPlayersBalanceToDate( void )
|
||||
{
|
||||
// print players balance to date
|
||||
CHAR16 sString[ 100 ];
|
||||
INT16 sX, sY;
|
||||
|
||||
// initialize string
|
||||
memset( sString, 0, sizeof( sString ) );
|
||||
|
||||
// font stuff
|
||||
SetFont( FONT10ARIAL);
|
||||
SetFontForeground( 142 );
|
||||
SetFontShadow(NO_SHADOW);
|
||||
|
||||
// parse straigth number
|
||||
swprintf( sString, L"%d", LaptopSaveInfo.iCurrentBalance );
|
||||
|
||||
// put in commas, then dollar sign
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
std::wstring sString{FormatMoney(LaptopSaveInfo.iCurrentBalance)};
|
||||
|
||||
// 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 );
|
||||
// printf it!
|
||||
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
|
||||
{
|
||||
mprintf( sX, LAPTOP_ICON_TEXT_FINANCIAL_Y + 10, sString);
|
||||
mprintf( sX, LAPTOP_ICON_TEXT_FINANCIAL_Y + 10, sString.data());
|
||||
}
|
||||
|
||||
// reset shadow
|
||||
@@ -6207,7 +6199,6 @@ void DeleteDesktopBackground( void )
|
||||
|
||||
void PrintBalance( void )
|
||||
{
|
||||
CHAR16 pString[ 32 ];
|
||||
// UINT16 usX, usY;
|
||||
|
||||
SetFont( FONT10ARIAL );
|
||||
@@ -6215,17 +6206,15 @@ void PrintBalance( void )
|
||||
SetFontBackground( FONT_BLACK );
|
||||
SetFontShadow( NO_SHADOW );
|
||||
|
||||
swprintf(pString, L"%d", LaptopSaveInfo.iCurrentBalance);
|
||||
InsertCommasForDollarFigure( pString );
|
||||
InsertDollarSignInToString( pString );
|
||||
std::wstring pString{ FormatMoney(LaptopSaveInfo.iCurrentBalance) };
|
||||
|
||||
if( ButtonList[ gLaptopButton[ 5 ] ]->uiFlags & BUTTON_CLICKED_ON )
|
||||
{
|
||||
mprintf(iScreenWidthOffset + 48, iScreenHeightOffset + 273,pString);
|
||||
mprintf(iScreenWidthOffset + 48, iScreenHeightOffset + 273,pString.data());
|
||||
}
|
||||
else
|
||||
{
|
||||
mprintf(iScreenWidthOffset + 47, iScreenHeightOffset + 272,pString);
|
||||
mprintf(iScreenWidthOffset + 47, iScreenHeightOffset + 272,pString.data());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -446,13 +446,8 @@ void BtnMercAuthorizeButtonCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
|
||||
btn->uiFlags &= (~BUTTON_CLICKED_ON );
|
||||
|
||||
swprintf( wzDollarAmount, L"%d", giMercTotalContractCharge );
|
||||
|
||||
InsertCommasForDollarFigure( wzDollarAmount );
|
||||
InsertDollarSignInToString( wzDollarAmount );
|
||||
|
||||
//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 );
|
||||
|
||||
|
||||
+9
-20
@@ -977,8 +977,7 @@ void DisplayMercsStats( UINT8 ubMercID )
|
||||
{
|
||||
UINT16 usPosY, usPosX;
|
||||
CHAR16 sPage[60];
|
||||
CHAR16 sTemp[128];
|
||||
CHAR16 sString[128];
|
||||
std::wstring sString{};
|
||||
CHAR16 NsString[128];
|
||||
CHAR16 N2sString[128];
|
||||
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 );
|
||||
|
||||
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( CharacterInfo[AIM_MEMBER_FEE], MERC_NAME_FONT );
|
||||
swprintf( sString, L"%d", gMercProfiles[ubMercID].uiWeeklySalary );
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
sString = FormatMoney(gMercProfiles[ubMercID].uiWeeklySalary);
|
||||
#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 );
|
||||
|
||||
usPosX = MERC_STATS_SECOND_COL_X + StringPixLength( MercInfo[MERC_FILES_SALARY], MERC_NAME_FONT );
|
||||
swprintf( sString, L"%d", gMercProfiles[ubMercID].sSalary );
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
swprintf( sTemp, L" %s", MercInfo[MERC_FILES_PER_DAY] );
|
||||
sString = FormatMoney(gMercProfiles[ubMercID].sSalary) + L" " + std::wstring(MercInfo[MERC_FILES_PER_DAY]);
|
||||
#endif // JA2UB
|
||||
|
||||
wcscat( sString, sTemp );
|
||||
DrawTextToScreen( sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||
DrawTextToScreen( sString.data(), 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
|
||||
swprintf( sPage, L"%d / %d", gubCurMercIndex + 1, LaptopSaveInfo.gubLastMercIndex + 1 );
|
||||
@@ -1103,10 +1096,8 @@ void DisplayMercsStats( UINT8 ubMercID )
|
||||
#endif // JA2UB
|
||||
|
||||
swprintf( NsString, L"+ " );
|
||||
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost);
|
||||
InsertCommasForDollarFigure( sTemp );
|
||||
InsertDollarSignInToString( sTemp );
|
||||
wcscat( NsString, sTemp );
|
||||
sString = FormatMoney(gMercProfiles[ ubMercID ].usOptionalGearCost);
|
||||
wcscat( NsString, sString.data() );
|
||||
DrawTextToScreen( NsString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||
usPosY += MERC_SPACE_BN_LINES;
|
||||
|
||||
@@ -1115,13 +1106,11 @@ void DisplayMercsStats( UINT8 ubMercID )
|
||||
|
||||
swprintf(N2sString, L"= ");
|
||||
#ifdef JA2UB
|
||||
swprintf( sTemp, L"%d", gMercProfiles[ubMercID].usOptionalGearCost + gMercProfiles[ubMercID].uiWeeklySalary );
|
||||
sString = FormatMoney(gMercProfiles[ubMercID].usOptionalGearCost + gMercProfiles[ubMercID].uiWeeklySalary);
|
||||
#else
|
||||
swprintf(sTemp, L"%d",gMercProfiles[ ubMercID ].usOptionalGearCost+gMercProfiles[ ubMercID ].sSalary);
|
||||
sString = FormatMoney(gMercProfiles[ ubMercID ].usOptionalGearCost+gMercProfiles[ ubMercID ].sSalary);
|
||||
#endif
|
||||
InsertCommasForDollarFigure( sTemp );
|
||||
InsertDollarSignInToString( sTemp );
|
||||
wcscat( N2sString, sTemp );
|
||||
wcscat( N2sString, sString.data() );
|
||||
DrawTextToScreen( N2sString, usPosX, usPosY, 95, MERC_NAME_FONT, MERC_DYNAMIC_STATS_COLOR, FONT_MCOLOR_BLACK, FALSE, RIGHT_JUSTIFIED);
|
||||
}
|
||||
}
|
||||
|
||||
+21
-58
@@ -3298,7 +3298,6 @@ INT32 GetHighestDailyCostOfCurrentTeam( void )
|
||||
void DisplayCostOfCurrentTeam( void )
|
||||
{
|
||||
// display number on team
|
||||
CHAR16 sString[ 32 ];
|
||||
INT16 sX, sY;
|
||||
|
||||
// font stuff
|
||||
@@ -3307,38 +3306,30 @@ void DisplayCostOfCurrentTeam( void )
|
||||
SetFontForeground( PERS_TEXT_FONT_COLOR );
|
||||
|
||||
if (fCurrentTeamMode) {
|
||||
std::wstring sString{};
|
||||
// daily cost
|
||||
mprintf( PERS_CURR_TEAM_COST_X, PERS_CURR_TEAM_COST_Y, pPersonelTeamStrings[ 2 ] );
|
||||
|
||||
swprintf( sString, L"%d", GetTotalDailyCostOfCurrentTeam( ) );
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
sString = FormatMoney( GetTotalDailyCostOfCurrentTeam( ) );
|
||||
FindFontRightCoordinates((INT16)(PERS_CURR_TEAM_COST_X),0,PERS_CURR_TEAM_WIDTH,0,sString.data(), PERS_FONT, &sX, &sY);
|
||||
|
||||
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 );
|
||||
mprintf( sX ,PERS_CURR_TEAM_COST_Y, sString.data() );
|
||||
|
||||
// highest cost
|
||||
mprintf( PERS_CURR_TEAM_COST_X, PERS_CURR_TEAM_HIGHEST_Y, pPersonelTeamStrings[ 3 ] );
|
||||
|
||||
swprintf( sString, L"%d", GetHighestDailyCostOfCurrentTeam( ) );
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
sString = FormatMoney( GetHighestDailyCostOfCurrentTeam( ) );
|
||||
FindFontRightCoordinates((INT16)(PERS_CURR_TEAM_COST_X),0,PERS_CURR_TEAM_WIDTH,0,sString.data(), PERS_FONT, &sX, &sY);
|
||||
|
||||
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 );
|
||||
mprintf( sX ,PERS_CURR_TEAM_HIGHEST_Y, sString.data() );
|
||||
|
||||
// the lowest cost
|
||||
mprintf( PERS_CURR_TEAM_COST_X, PERS_CURR_TEAM_LOWEST_Y, pPersonelTeamStrings[ 4 ] );
|
||||
|
||||
swprintf( sString, L"%d", GetLowestDailyCostOfCurrentTeam( ) );
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
sString = FormatMoney( GetLowestDailyCostOfCurrentTeam( ) );
|
||||
FindFontRightCoordinates((INT16)(PERS_CURR_TEAM_COST_X),0,PERS_CURR_TEAM_WIDTH,0,sString.data(), PERS_FONT, &sX, &sY);
|
||||
|
||||
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 );
|
||||
mprintf( sX ,PERS_CURR_TEAM_LOWEST_Y, sString.data() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5931,7 +5922,7 @@ void DisplayAmountOnCurrentMerc( void )
|
||||
{
|
||||
// will display the amount that the merc is carrying on him or herself
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
CHAR16 sString[ 64 ];
|
||||
std::wstring sString{};
|
||||
INT16 sX, sY;
|
||||
|
||||
if (currentTeamIndex == -1) {
|
||||
@@ -5941,13 +5932,7 @@ void DisplayAmountOnCurrentMerc( void )
|
||||
pSoldier = currentTeamList[currentTeamIndex];
|
||||
}
|
||||
|
||||
INT32 iFunds = GetFundsOnMerc( pSoldier );
|
||||
|
||||
swprintf( sString, L"%d", iFunds );
|
||||
|
||||
// insert commas and dollar sign
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
sString = FormatMoney( GetFundsOnMerc( pSoldier ) );
|
||||
|
||||
// set font
|
||||
SetFont( ATM_FONT );
|
||||
@@ -5957,10 +5942,10 @@ void DisplayAmountOnCurrentMerc( void )
|
||||
SetFontBackground( FONT_BLACK );
|
||||
|
||||
// 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
|
||||
mprintf( sX, sY, sString );
|
||||
mprintf( sX, sY, sString.data() );
|
||||
}
|
||||
|
||||
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", pMercProfile->uiTotalCostToDate );
|
||||
|
||||
// insert commas and dollar sign
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
swprintf( sString, L"%s", FormatMoney(pMercProfile->uiTotalCostToDate).data() );
|
||||
|
||||
/*
|
||||
DEF:3/19/99:
|
||||
@@ -6321,34 +6302,22 @@ DEF:3/19/99:
|
||||
if( pSoldier->bTypeOfLastContract == CONTRACT_EXTEND_2_WEEK )
|
||||
{
|
||||
// 2 week contract
|
||||
swprintf( sStringA, L"%d", pMercProfile->uiBiWeeklySalary / 14 );
|
||||
InsertCommasForDollarFigure( sStringA );
|
||||
InsertDollarSignInToString( sStringA );
|
||||
swprintf( sString, L"%s", sStringA );
|
||||
swprintf( sString, L"%s", FormatMoney( pMercProfile->uiBiWeeklySalary / 14 ).data() );
|
||||
}
|
||||
else if( pSoldier->bTypeOfLastContract == CONTRACT_EXTEND_1_WEEK )
|
||||
{
|
||||
// 1 week contract
|
||||
swprintf( sStringA, L"%d", pMercProfile->uiWeeklySalary / 7 );
|
||||
InsertCommasForDollarFigure( sStringA );
|
||||
InsertDollarSignInToString( sStringA );
|
||||
swprintf( sString, L"%s", sStringA );
|
||||
swprintf( sString, L"%s", FormatMoney( pMercProfile->uiWeeklySalary / 7 ).data() );
|
||||
}
|
||||
else
|
||||
{
|
||||
// daily rate
|
||||
swprintf( sStringA, L"%d", pMercProfile->sSalary );
|
||||
InsertCommasForDollarFigure( sStringA );
|
||||
InsertDollarSignInToString( sStringA );
|
||||
swprintf( sString, L"%s", sStringA );
|
||||
swprintf( sString, L"%s", FormatMoney( pMercProfile->sSalary ).data() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
swprintf( sStringA, L"%d", pMercProfile->sSalary );
|
||||
InsertCommasForDollarFigure( sStringA );
|
||||
InsertDollarSignInToString( sStringA );
|
||||
swprintf( sString, L"%s", sStringA );
|
||||
swprintf( sString, L"%s", FormatMoney( pMercProfile->sSalary ).data() );
|
||||
}
|
||||
|
||||
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]);
|
||||
|
||||
swprintf( sString, L"%d", pMercProfile->sSalary * pMercProfile->iMercMercContractLength );
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
swprintf( sString, L"%s", FormatMoney( pMercProfile->sSalary * pMercProfile->iMercMercContractLength ).data() );
|
||||
|
||||
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);
|
||||
@@ -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]);
|
||||
|
||||
swprintf(sString, L"%d",pMercProfile->sMedicalDepositAmount);
|
||||
|
||||
// insert commas and dollar sign
|
||||
InsertCommasForDollarFigure( sString );
|
||||
InsertDollarSignInToString( sString );
|
||||
swprintf(sString, L"%s", FormatMoney(pMercProfile->sMedicalDepositAmount).data());
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user