MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ShowFillingPercent

Function ShowFillingPercent

src/misc_gui.cpp:561–568  ·  view source on GitHub ↗

* Display vehicle loading indicators. * @param x World X position of the animation location. * @param y World Y position of the animation location. * @param z World Z position of the animation location. * @param percent Estimated feeder income. * @param string String which is drawn on the map. * @return TextEffectID to be used for future updates of the loading indic

Source from the content-addressed store, hash-verified

559 * @return TextEffectID to be used for future updates of the loading indicators.
560 */
561TextEffectID ShowFillingPercent(int x, int y, int z, uint8_t percent, StringID string)
562{
563 Point pt = RemapCoords(x, y, z);
564
565 assert(string != STR_NULL);
566
567 return AddTextEffect(GetEncodedString(string, percent), pt.x, pt.y, 0, TE_STATIC);
568}
569
570/**
571 * Update vehicle loading indicators.

Callers 1

LoadUnloadVehicleFunction · 0.85

Calls 3

RemapCoordsFunction · 0.85
AddTextEffectFunction · 0.85
GetEncodedStringFunction · 0.70

Tested by

no test coverage detected