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 | 66a136be0972c9c8a8039b5bec722fb67cd38909 (patch) | |
tree | 9a8cf5e86397687ed30d3da2567447b1d843509d /src/misc_gui.cpp | |
parent | 21711da99d9260296b86e755974e3a697db0aae4 (diff) | |
download | openttd-66a136be0972c9c8a8039b5bec722fb67cd38909.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[] = { |