diff options
author | truelight <truelight@openttd.org> | 2007-06-21 16:17:47 +0000 |
---|---|---|
committer | truelight <truelight@openttd.org> | 2007-06-21 16:17:47 +0000 |
commit | 56eb1738ee6de39367047a3cd0f20011560eb393 (patch) | |
tree | 9a8cf5e86397687ed30d3da2567447b1d843509d /src/misc_gui.cpp | |
parent | 2792019b78fbfd10702b93a2d570562397cf8cb2 (diff) | |
download | openttd-56eb1738ee6de39367047a3cd0f20011560eb393.tar.xz |
(svn r10254) -Feature: loading indicator, which shows in % how full a vehicle is while loading/unloading (TheJosh)
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r-- | src/misc_gui.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 5d887cc17..1a5b9bbd8 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -633,7 +633,7 @@ void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost) msg = STR_0803_INCOME; } SetDParamMoney(0, cost); - AddTextEffect(msg, pt.x, pt.y, 0x250); + AddTextEffect(msg, pt.x, pt.y, 0x250, TE_RISING); } void ShowFeederIncomeAnimation(int x, int y, int z, Money cost) @@ -641,7 +641,26 @@ void ShowFeederIncomeAnimation(int x, int y, int z, Money cost) Point pt = RemapCoords(x,y,z); SetDParamMoney(0, cost); - AddTextEffect(STR_FEEDER, pt.x, pt.y, 0x250); + AddTextEffect(STR_FEEDER, pt.x, pt.y, 0x250, TE_RISING); +} + +TextEffectID ShowFillingPercent(int x, int y, int z, uint8 percent) +{ + Point pt = RemapCoords(x, y, z); + + SetDParam(0, percent); + return AddTextEffect(STR_PERCENT_FULL, pt.x, pt.y, 0xFFFF, TE_STATIC); +} + +void UpdateFillingPercent(TextEffectID te_id, uint8 percent) +{ + SetDParam(0, percent); + UpdateTextEffect(te_id, STR_PERCENT_FULL); +} + +void HideFillingPercent(TextEffectID te_id) +{ + if (te_id != INVALID_TE_ID) RemoveTextEffect(te_id); } static const Widget _tooltips_widgets[] = { |