36 inline bool IsValid()
const {
return this->mode !=
TE_INVALID; }
44 if (_game_mode == GM_MENU)
return INVALID_TE_ID;
49 if (
_text_effects.size() >= INVALID_TE_ID)
return INVALID_TE_ID;
56 te.
msg = std::move(msg);
64 return static_cast<TextEffectID
>(it - std::begin(
_text_effects));
71 if (msg == te.
msg)
return;
72 te.
msg = std::move(msg);
77void UpdateAllTextEffectVirtCoords()
80 if (!te.IsValid())
continue;
86void RemoveTextEffect(TextEffectID te_id)
96 if (!te.IsValid())
continue;
106 te.
top -= count * ZOOM_BASE;
111void InitTextEffects()
127 if (!te.IsValid())
continue;
131 if (str ==
nullptr)
continue;
constexpr Timpl & Set()
Set all bits.
constexpr bool Any(const Timpl &other) const
Test if any of the given values are set.
Container for an encoded string, created by GetEncodedString.
std::string GetDecodedString() const
Decode the encoded string.
An interval timer will fire every interval, and will continue to fire until it is deleted.
Types related to commands.
@ CMDPL_NO_CONSTRUCTION
No construction actions may be executed.
PauseModes _pause_mode
The current pause mode.
void MarkDirty(ZoomLevel maxzoom=ZOOM_LVL_MAX) const
Mark the sign dirty in all viewports.
A number of safeguards to prevent using unsafe methods.
GameSettings _settings_game
Game settings of a running game or the scenario editor.
ClientSettings _settings_client
The current settings for this game.
Types related to global configuration settings.
Definition of base types and functions in a cross-platform compatible way.
Functions related to OTTD's strings.
GUISettings gui
settings related to the GUI
uint8_t command_pause_level
level/amount of commands that can't be executed while paused
Data about how and where to blit pixels.
uint8_t loading_indicators
show loading indicators
ConstructionSettings construction
construction of things in-game
Container for all information about a text effect.
TextEffectMode mode
Type of text effect.
uint8_t duration
How long the text effect should stay, in ticks (applies only when mode == TE_RISING)
void Reset()
Reset the text effect.
EncodedString msg
Encoded message for text effect.
Location information about a sign as seen on the viewport.
int32_t center
The center position of the sign.
uint16_t width_normal
The width when not zoomed out (normal font)
void UpdatePosition(int center, int top, std::string_view str, std::string_view str_small={})
Update the position of the viewport sign.
int32_t top
The top of the sign.
IntervalTimer< TimerWindow > move_all_text_effects_interval
Slowly move text effects upwards.
static std::vector< TextEffect > _text_effects
Text effects are stored there.
Functions related to text effects.
TextEffectMode
Text effect modes.
@ TE_RISING
Make the text effect slowly go upwards.
@ TE_INVALID
Text effect is invalid.
Definition of Interval and OneShot timers.
Definition of the Window system.
Functions related to transparency.
bool IsTransparencySet(TransparencyOption to)
Check if the transparency option bit is set and if we aren't in the game menu (there's never transpar...
@ TO_TEXT
loading and cost/income text
std::string * ViewportAddString(const DrawPixelInfo *dpi, const ViewportSign *sign, ViewportStringFlags flags, Colours colour)
Add a string to draw in the current viewport.
Functions related to (drawing on) viewports.
@ Small
Draw using the small font.
@ ZOOM_LVL_TEXT_EFFECT
All zoom levels above this will not show text effects.