mirror of
https://github.com/1dot13/source.git
synced 2026-07-29 13:52:17 +02:00
use FormatMoney everywhere
This commit is contained in:
committed by
majcosta
parent
0dd32c4670
commit
3d29eff4d8
+6
-12
@@ -3228,35 +3228,29 @@ void DrawCharacterInfo(INT16 sCharNumber)
|
||||
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 y = UI_CHARPANEL.Text.Salary.y;
|
||||
const auto w = UI_CHARPANEL.Text.Salary.width;
|
||||
const auto h = UI_CHARPANEL.Text.Salary.height;
|
||||
FindFontRightCoordinates(x, y, w, h, sString, CHAR_FONT, &usX, &usY);
|
||||
DrawString(sString, usX, usY, CHAR_FONT);
|
||||
FindFontRightCoordinates(x, y, w, h, tmpMoney.data(), CHAR_FONT, &usX, &usY);
|
||||
DrawString(tmpMoney.data(), usX, usY, CHAR_FONT);
|
||||
}
|
||||
|
||||
// medical deposit
|
||||
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 y = UI_CHARPANEL.Text.Medical.y;
|
||||
const auto w = UI_CHARPANEL.Text.Medical.width;
|
||||
const auto h = UI_CHARPANEL.Text.Medical.height;
|
||||
FindFontRightCoordinates(x, y, w, h, sString, CHAR_FONT, &usX, &usY);
|
||||
DrawString(sString, usX, y, CHAR_FONT);
|
||||
FindFontRightCoordinates(x, y, w, h, tmpMoney.data(), CHAR_FONT, &usX, &usY);
|
||||
DrawString(tmpMoney.data(), usX, y, CHAR_FONT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user