summaryrefslogtreecommitdiff
path: root/src/misc_gui.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-02-17 14:50:54 +0000
committerrubidium <rubidium@openttd.org>2013-02-17 14:50:54 +0000
commit446d50f6580d6d71ac30d6d64b72cb3e5c4c3aaa (patch)
tree93495ae2a17ce8b5dcc66ae264f9aef50e09cbf0 /src/misc_gui.cpp
parentd6e2a8aa56337af68f2960cf404edf0ac03f405b (diff)
downloadopenttd-446d50f6580d6d71ac30d6d64b72cb3e5c4c3aaa.tar.xz
(svn r25011) -Codechange: allow vehicle transfer and profit text effects to be shown at the same time (fonsinchen)
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 979b41813..bd390c7bf 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -543,17 +543,28 @@ void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
/**
* 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 cost Estimated 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.
*/
-void ShowFeederIncomeAnimation(int x, int y, int z, Money cost)
+void ShowFeederIncomeAnimation(int x, int y, int z, Money transfer, Money income)
{
Point pt = RemapCoords(x, y, z);
- SetDParam(0, cost);
- AddTextEffect(STR_FEEDER, pt.x, pt.y, DAY_TICKS, TE_RISING);
+ SetDParam(0, transfer);
+ if (income == 0) {
+ AddTextEffect(STR_FEEDER, pt.x, pt.y, DAY_TICKS, TE_RISING);
+ } else {
+ StringID msg = STR_FEEDER_COST;
+ if (income < 0) {
+ income = -income;
+ msg = STR_FEEDER_INCOME;
+ }
+ SetDParam(1, income);
+ AddTextEffect(msg, pt.x, pt.y, DAY_TICKS, TE_RISING);
+ }
}
/**