|
OpenTTD Source 20251117-master-g7398d2e290
|
Functions related to text effects. More...
Go to the source code of this file.
Typedefs | |
| using | TextEffectID = uint16_t |
Enumerations | |
| enum | TextEffectMode : uint8_t { TE_INVALID , TE_RISING , TE_STATIC } |
| Text effect modes. More... | |
Functions | |
| TextEffectID | AddTextEffect (EncodedString &&msg, int x, int y, uint8_t duration, TextEffectMode mode) |
| void | InitTextEffects () |
| void | DrawTextEffects (DrawPixelInfo *dpi) |
| void | UpdateTextEffect (TextEffectID effect_id, EncodedString &&msg) |
| void | RemoveTextEffect (TextEffectID effect_id) |
| void | UpdateAllTextEffectVirtCoords () |
| TextEffectID | ShowFillingPercent (int x, int y, int z, uint8_t percent, StringID colour) |
| Display vehicle loading indicators. | |
| void | UpdateFillingPercent (TextEffectID te_id, uint8_t percent, StringID colour) |
| Update vehicle loading indicators. | |
| void | HideFillingPercent (TextEffectID *te_id) |
| Hide vehicle loading indicators. | |
| void | ShowCostOrIncomeAnimation (int x, int y, int z, Money cost) |
| Display animated income or costs on the map. | |
| void | ShowFeederIncomeAnimation (int x, int y, int z, Money transfer, Money income) |
| Display animated feeder income. | |
Variables | |
| static const TextEffectID | INVALID_TE_ID = UINT16_MAX |
Functions related to text effects.
Definition in file texteff.hpp.
| using TextEffectID = uint16_t |
Definition at line 26 of file texteff.hpp.
| enum TextEffectMode : uint8_t |
Text effect modes.
| Enumerator | |
|---|---|
| TE_INVALID | Text effect is invalid. |
| TE_RISING | Make the text effect slowly go upwards. |
| TE_STATIC | Keep the text effect static. |
Definition at line 20 of file texteff.hpp.
| TextEffectID AddTextEffect | ( | EncodedString && | msg, |
| int | x, | ||
| int | y, | ||
| uint8_t | duration, | ||
| TextEffectMode | mode | ||
| ) |
Definition at line 42 of file texteff.cpp.
| void DrawTextEffects | ( | DrawPixelInfo * | dpi | ) |
Definition at line 117 of file texteff.cpp.
| void HideFillingPercent | ( | TextEffectID * | te_id | ) |
Hide vehicle loading indicators.
| *te_id | TextEffectID which is supposed to be hidden. |
Definition at line 581 of file misc_gui.cpp.
Referenced by CmdReverseTrainDirection(), Train::Crash(), Vehicle::LeaveStation(), and Vehicle::PreDestructor().
| void InitTextEffects | ( | ) |
Definition at line 111 of file texteff.cpp.
| void RemoveTextEffect | ( | TextEffectID | effect_id | ) |
Definition at line 86 of file texteff.cpp.
| void ShowCostOrIncomeAnimation | ( | int | x, |
| int | y, | ||
| int | z, | ||
| Money | cost | ||
| ) |
Display animated income or costs on the map.
Does nothing if cost is zero.
| x | World X position of the animation location. |
| y | World Y position of the animation location. |
| z | World Z position of the animation location. |
| cost | Estimated cost (or income if negative). |
Definition at line 508 of file misc_gui.cpp.
References Ticks::DAY_TICKS, GetEncodedString(), RemapCoords(), TE_RISING, Coord2D< T >::x, and Coord2D< T >::y.
Referenced by CmdChangeBankBalance(), CommandHelperBase::InternalPostResult(), and VehicleEnterDepot().
Display animated feeder income.
| x | World X position of the animation location. |
| y | World Y position of the animation location. |
| z | World Z position of the animation location. |
| transfer | Estimated feeder income. |
| income | Real income from goods being delivered to their final destination. |
Definition at line 531 of file misc_gui.cpp.
References Ticks::DAY_TICKS, GetEncodedString(), RemapCoords(), TE_RISING, Coord2D< T >::x, and Coord2D< T >::y.
| TextEffectID ShowFillingPercent | ( | int | x, |
| int | y, | ||
| int | z, | ||
| uint8_t | percent, | ||
| StringID | string | ||
| ) |
Display vehicle loading indicators.
| x | World X position of the animation location. |
| y | World Y position of the animation location. |
| z | World Z position of the animation location. |
| percent | Estimated feeder income. |
| string | String which is drawn on the map. |
Definition at line 556 of file misc_gui.cpp.
References GetEncodedString(), RemapCoords(), TE_STATIC, Coord2D< T >::x, and Coord2D< T >::y.
Referenced by LoadUnloadVehicle().
| void UpdateAllTextEffectVirtCoords | ( | ) |
Definition at line 77 of file texteff.cpp.
| void UpdateFillingPercent | ( | TextEffectID | te_id, |
| uint8_t | percent, | ||
| StringID | string | ||
| ) |
Update vehicle loading indicators.
| te_id | TextEffectID to be updated. |
| string | String which is printed. |
Definition at line 570 of file misc_gui.cpp.
References GetEncodedString().
Referenced by LoadUnloadVehicle().
| void UpdateTextEffect | ( | TextEffectID | effect_id, |
| EncodedString && | msg | ||
| ) |
Definition at line 67 of file texteff.cpp.
|
static |
Definition at line 28 of file texteff.hpp.