MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ShowEstimatedCostOrIncome

Function ShowEstimatedCostOrIncome

src/misc_gui.cpp:495–504  ·  view source on GitHub ↗

* Display estimated costs. * @param cost Estimated cost (or income if negative). * @param x X position of the notification window. * @param y Y position of the notification window. */

Source from the content-addressed store, hash-verified

493 * @param y Y position of the notification window.
494 */
495void ShowEstimatedCostOrIncome(Money cost, int x, int y)
496{
497 StringID msg = STR_MESSAGE_ESTIMATED_COST;
498
499 if (cost < 0) {
500 cost = -cost;
501 msg = STR_MESSAGE_ESTIMATED_INCOME;
502 }
503 ShowErrorMessage(GetEncodedString(msg, cost), {}, WL_INFO, x, y);
504}
505
506/**
507 * Display animated income or costs on the map. Does nothing if cost is zero.

Callers 1

InternalPostResultMethod · 0.85

Calls 2

ShowErrorMessageFunction · 0.85
GetEncodedStringFunction · 0.70

Tested by

no test coverage detected