Only use red text colour for expenditure sums (#1095)

This commit is contained in:
Aaron van Geffen 2021-08-10 15:14:01 +02:00 committed by GitHub
parent 8461ad721b
commit ae294ad80e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 10 deletions

View File

@ -3,6 +3,7 @@
- Fix: [#1035] Incorrect colour selection when building buildings. - Fix: [#1035] Incorrect colour selection when building buildings.
- Fix: [#1070] Crash when naming stations after exhausting natural names. - Fix: [#1070] Crash when naming stations after exhausting natural names.
- Fix: [#1094] Repeated clicking on construction window not always working. - Fix: [#1094] Repeated clicking on construction window not always working.
- Fix: [#1095] Individual expenses are drawn in red, not just the expenditure sums.
- Change: [#298] Planting clusters of trees now costs money and influences ratings outside of editor mode. - Change: [#298] Planting clusters of trees now costs money and influences ratings outside of editor mode.
- Change: [#1079] Allow rotating buildings in town list by keyboard shortcut. - Change: [#1079] Allow rotating buildings in town list by keyboard shortcut.

View File

@ -1827,24 +1827,16 @@ namespace OpenLoco::Ui::Windows::CompanyWindow
currency48_t expenditures = company.expenditures[columnIndex][j]; currency48_t expenditures = company.expenditures[columnIndex][j];
sum += expenditures; sum += expenditures;
string_id mainFormat = StringIds::black_stringid;
string_id currFormat = StringIds::plus_currency48;
if (expenditures < 0)
{
mainFormat = StringIds::red_stringid;
currFormat = StringIds::currency48;
}
if (expenditures != 0) if (expenditures != 0)
{ {
auto args = FormatArguments::common(currFormat, expenditures); auto args = FormatArguments::common(StringIds::currency48, expenditures);
Gfx::drawString_494C78( Gfx::drawString_494C78(
*context, *context,
x, x,
y, y,
Colour::black, Colour::black,
mainFormat, StringIds::black_stringid,
&args); &args);
} }
y += 10; y += 10;