2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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 <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file texteff.hpp Functions related to text effects. */
|
|
|
|
|
2007-06-21 16:17:47 +00:00
|
|
|
#ifndef TEXTEFF_HPP
|
|
|
|
#define TEXTEFF_HPP
|
|
|
|
|
2011-02-07 22:22:20 +00:00
|
|
|
#include "economy_type.h"
|
2008-03-28 16:38:18 +00:00
|
|
|
#include "gfx_type.h"
|
2010-01-15 16:41:15 +00:00
|
|
|
#include "strings_type.h"
|
2008-03-28 16:38:18 +00:00
|
|
|
|
2007-06-21 16:17:47 +00:00
|
|
|
/**
|
|
|
|
* Text effect modes.
|
|
|
|
*/
|
2023-09-09 15:40:59 +00:00
|
|
|
enum TextEffectMode : uint8_t {
|
2007-06-21 16:17:47 +00:00
|
|
|
TE_RISING, ///< Make the text effect slowly go upwards
|
|
|
|
TE_STATIC, ///< Keep the text effect static
|
|
|
|
};
|
|
|
|
|
2023-09-09 15:40:59 +00:00
|
|
|
using TextEffectID = uint16_t;
|
2007-06-21 16:17:47 +00:00
|
|
|
|
2023-09-09 15:38:59 +00:00
|
|
|
static const TextEffectID INVALID_TE_ID = UINT16_MAX;
|
|
|
|
|
2023-05-08 17:01:06 +00:00
|
|
|
TextEffectID AddTextEffect(StringID msg, int x, int y, uint8_t duration, TextEffectMode mode);
|
2007-06-21 16:17:47 +00:00
|
|
|
void InitTextEffects();
|
|
|
|
void DrawTextEffects(DrawPixelInfo *dpi);
|
|
|
|
void UpdateTextEffect(TextEffectID effect_id, StringID msg);
|
|
|
|
void RemoveTextEffect(TextEffectID effect_id);
|
2021-05-02 09:43:14 +00:00
|
|
|
void UpdateAllTextEffectVirtCoords();
|
2007-06-21 16:17:47 +00:00
|
|
|
|
|
|
|
/* misc_gui.cpp */
|
2023-05-08 17:01:06 +00:00
|
|
|
TextEffectID ShowFillingPercent(int x, int y, int z, uint8_t percent, StringID colour);
|
|
|
|
void UpdateFillingPercent(TextEffectID te_id, uint8_t percent, StringID colour);
|
2008-09-21 18:28:35 +00:00
|
|
|
void HideFillingPercent(TextEffectID *te_id);
|
2007-06-21 16:17:47 +00:00
|
|
|
|
2011-02-07 22:22:20 +00:00
|
|
|
void ShowCostOrIncomeAnimation(int x, int y, int z, Money cost);
|
2013-02-17 14:50:54 +00:00
|
|
|
void ShowFeederIncomeAnimation(int x, int y, int z, Money transfer, Money income);
|
2011-02-07 22:22:20 +00:00
|
|
|
|
2007-06-21 16:17:47 +00:00
|
|
|
#endif /* TEXTEFF_HPP */
|