OpenTTD Source: src/texteff.hpp Source File

OpenTTD Source 15.0-RC2

texteff.hpp
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
6 */
7
10#ifndef TEXTEFF_HPP
11#define TEXTEFF_HPP
12
13#include "economy_type.h"
14#include "gfx_type.h"
15#include "strings_type.h"
16
20 enum TextEffectMode : uint8_t {
21 TE_INVALID,
22 TE_RISING,
23 TE_STATIC,
24};
25
26using TextEffectID = uint16_t;
27
28static const TextEffectID INVALID_TE_ID = UINT16_MAX;
29
30TextEffectID AddTextEffect(EncodedString &&msg, int x, int y, uint8_t duration, TextEffectMode mode);
31void InitTextEffects();
32void DrawTextEffects(DrawPixelInfo *dpi);
33void UpdateTextEffect(TextEffectID effect_id, EncodedString &&msg);
34void RemoveTextEffect(TextEffectID effect_id);
35void UpdateAllTextEffectVirtCoords();
36
37/* misc_gui.cpp */
38TextEffectID ShowFillingPercent(int x, int y, int z, uint8_t percent, StringID colour);
39void UpdateFillingPercent(TextEffectID te_id, uint8_t percent, StringID colour);
40void HideFillingPercent(TextEffectID *te_id);
41
42void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost);
43void ShowFeederIncomeAnimation(int x, int y, int z, Money transfer, Money income);
44
45#endif /* TEXTEFF_HPP */
EncodedString
Container for an encoded string, created by GetEncodedString.
Definition strings_type.h:98
OverflowSafeInt< int64_t >
economy_type.h
Types related to the economy.
gfx_type.h
Types related to the graphics and/or input devices.
strings_type.h
Types related to strings.
StringID
uint32_t StringID
Numeric value that represents a string, independent of the selected language.
Definition strings_type.h:19
DrawPixelInfo
Data about how and where to blit pixels.
Definition gfx_type.h:157
ShowFillingPercent
TextEffectID ShowFillingPercent(int x, int y, int z, uint8_t percent, StringID colour)
Display vehicle loading indicators.
Definition misc_gui.cpp:561
HideFillingPercent
void HideFillingPercent(TextEffectID *te_id)
Hide vehicle loading indicators.
Definition misc_gui.cpp:586
ShowCostOrIncomeAnimation
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost)
Display animated income or costs on the map.
Definition misc_gui.cpp:513
TextEffectMode
TextEffectMode
Text effect modes.
Definition texteff.hpp:20
TE_STATIC
@ TE_STATIC
Keep the text effect static.
Definition texteff.hpp:23
TE_RISING
@ TE_RISING
Make the text effect slowly go upwards.
Definition texteff.hpp:22
TE_INVALID
@ TE_INVALID
Text effect is invalid.
Definition texteff.hpp:21
UpdateFillingPercent
void UpdateFillingPercent(TextEffectID te_id, uint8_t percent, StringID colour)
Update vehicle loading indicators.
Definition misc_gui.cpp:575
ShowFeederIncomeAnimation
void ShowFeederIncomeAnimation(int x, int y, int z, Money transfer, Money income)
Display animated feeder income.
Definition misc_gui.cpp:536