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

Function ShowFeederIncomeAnimation

src/misc_gui.cpp:536–550  ·  view source on GitHub ↗

* Display animated feeder income. * @param x World X position of the animation location. * @param y World Y position of the animation location. * @param z World Z position of the animation location. * @param transfer Estimated feeder income. * @param income Real income from goods being delivered to their final destination. */

Source from the content-addressed store, hash-verified

534 * @param income Real income from goods being delivered to their final destination.
535 */
536void ShowFeederIncomeAnimation(int x, int y, int z, Money transfer, Money income)
537{
538 Point pt = RemapCoords(x, y, z);
539
540 if (income == 0) {
541 AddTextEffect(GetEncodedString(STR_FEEDER, transfer), pt.x, pt.y, Ticks::DAY_TICKS, TE_RISING);
542 } else {
543 StringID msg = STR_FEEDER_COST;
544 if (income < 0) {
545 income = -income;
546 msg = STR_FEEDER_INCOME;
547 }
548 AddTextEffect(GetEncodedString(msg, transfer, income), pt.x, pt.y, Ticks::DAY_TICKS, TE_RISING);
549 }
550}
551
552/**
553 * Display vehicle loading indicators.

Callers 1

~CargoPaymentMethod · 0.85

Calls 3

RemapCoordsFunction · 0.85
AddTextEffectFunction · 0.85
GetEncodedStringFunction · 0.70

Tested by

no test coverage detected