From 446d50f6580d6d71ac30d6d64b72cb3e5c4c3aaa Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 17 Feb 2013 14:50:54 +0000 Subject: (svn r25011) -Codechange: allow vehicle transfer and profit text effects to be shown at the same time (fonsinchen) --- src/texteff.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/texteff.cpp') 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); } } } -- cgit v1.2.3-54-g00ecf