summaryrefslogtreecommitdiff
path: root/src/texteff.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/texteff.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/texteff.cpp')
-rw-r--r--src/texteff.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/texteff.cpp b/src/texteff.cpp
index 981453c10..fd2001716 100644
--- a/src/texteff.cpp
+++ b/src/texteff.cpp
@@ -20,6 +20,7 @@
/** Container for all information about a text effect */
struct TextEffect : public ViewportSign {
uint64 params_1; ///< DParam parameter
+ uint64 params_2; ///< second DParam parameter
StringID string_id; ///< String to draw for the text effect, if INVALID_STRING_ID then it's not valid
uint8 duration; ///< How long the text effect should stay, in ticks (applies only when mode == TE_RISING)
TextEffectMode mode; ///< Type of text effect
@@ -52,6 +53,7 @@ TextEffectID AddTextEffect(StringID msg, int center, int y, uint8 duration, Text
te->string_id = msg;
te->duration = duration;
te->params_1 = GetDParam(0);
+ te->params_2 = GetDParam(1);
te->mode = mode;
/* Make sure we only dirty the new area */
@@ -68,6 +70,7 @@ void UpdateTextEffect(TextEffectID te_id, StringID msg)
if (msg == te->string_id && GetDParam(0) == te->params_1) return;
te->string_id = msg;
te->params_1 = GetDParam(0);
+ te->params_2 = GetDParam(1);
te->UpdatePosition(te->center, te->top, msg);
}
@@ -109,7 +112,7 @@ void DrawTextEffects(DrawPixelInfo *dpi)
for (TextEffect *te = _text_effects.Begin(); te != end; te++) {
if (te->string_id == INVALID_STRING_ID) continue;
if (te->mode == TE_RISING || (_settings_client.gui.loading_indicators && !IsTransparencySet(TO_LOADING))) {
- ViewportAddString(dpi, ZOOM_LVL_OUT_8X, te, te->string_id, te->string_id - 1, 0, te->params_1);
+ ViewportAddString(dpi, ZOOM_LVL_OUT_8X, te, te->string_id, te->string_id - 1, 0, te->params_1, te->params_2);
}
}
}