OpenTTD Source 20250328-master-gc3457cd4c0
newgrf_badge.cpp
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 <http://www.gnu.org/licenses/>.
6 */
7
10#include "stdafx.h"
11#include "dropdown_type.h"
12#include "newgrf.h"
13#include "newgrf_badge.h"
14#include "newgrf_badge_type.h"
15#include "newgrf_spritegroup.h"
16#include "stringfilter_type.h"
17#include "strings_func.h"
19#include "window_gui.h"
20#include "zoom_func.h"
21
22#include "table/strings.h"
23
25
26#include "safeguards.h"
27
29static constexpr char BADGE_CLASS_SEPARATOR = '/';
30
32class Badges {
33public:
34 std::vector<BadgeID> classes;
35 std::vector<Badge> specs;
36};
37
39static Badges _badges = {};
40
47{
48 auto it = std::ranges::find(_badges.classes, index);
49 if (it == std::end(_badges.classes)) {
50 it = _badges.classes.emplace(it, index);
51 }
52
53 return static_cast<BadgeClassID>(std::distance(std::begin(_badges.classes), it));
54}
55
60{
61 _badges = {};
62}
63
69Badge &GetOrCreateBadge(std::string_view label)
70{
71 /* Check if the label exists. */
72 auto it = std::ranges::find(_badges.specs, label, &Badge::label);
73 if (it != std::end(_badges.specs)) return *it;
74
75 BadgeClassID class_index;
76
77 /* Extract class. */
78 auto sep = label.find_first_of(BADGE_CLASS_SEPARATOR);
79 if (sep != std::string_view::npos) {
80 /* There is a separator, find (and create if necessary) the class label. */
81 class_index = GetOrCreateBadge(label.substr(0, sep)).class_index;
82 it = std::end(_badges.specs);
83 }
84
85 BadgeID index = BadgeID(std::distance(std::begin(_badges.specs), it));
86 if (sep == std::string_view::npos) {
87 /* There is no separator, so this badge is a class badge. */
88 class_index = GetOrCreateBadgeClass(index);
89 }
90
91 it = _badges.specs.emplace(it, label, index, class_index);
92 return *it;
93}
94
101{
102 if (index.base() >= std::size(_badges.specs)) return nullptr;
103 return &_badges.specs[index.base()];
104}
105
111Badge *GetBadgeByLabel(std::string_view label)
112{
113 auto it = std::ranges::find(_badges.specs, label, &Badge::label);
114 if (it == std::end(_badges.specs)) return nullptr;
115
116 return &*it;
117}
118
125{
126 if (class_index.base() >= std::size(_badges.classes)) return nullptr;
127 return GetBadge(_badges.classes[class_index.base()]);
128}
129
132 const Badge &badge;
133 const std::optional<TimerGameCalendar::Date> introduction_date;
134
141 BadgeScopeResolver(ResolverObject &ro, const Badge &badge, const std::optional<TimerGameCalendar::Date> introduction_date)
142 : ScopeResolver(ro), badge(badge), introduction_date(introduction_date) { }
143
144 uint32_t GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const override;
145};
146
147/* virtual */ uint32_t BadgeScopeResolver::GetVariable(uint8_t variable, [[maybe_unused]] uint32_t parameter, bool &available) const
148{
149 switch (variable) {
150 case 0x40:
151 if (this->introduction_date.has_value()) return this->introduction_date->base();
152 return TimerGameCalendar::date.base();
153
154 default: break;
155 }
156
157 available = false;
158 return UINT_MAX;
159}
160
163 BadgeScopeResolver self_scope;
164
165 BadgeResolverObject(const Badge &badge, GrfSpecFeature feature, std::optional<TimerGameCalendar::Date> introduction_date, CallbackID callback = CBID_NO_CALLBACK, uint32_t callback_param1 = 0, uint32_t callback_param2 = 0);
166
167 ScopeResolver *GetScope(VarSpriteGroupScope scope = VSG_SCOPE_SELF, uint8_t relative = 0) override
168 {
169 switch (scope) {
170 case VSG_SCOPE_SELF: return &this->self_scope;
171 default: return ResolverObject::GetScope(scope, relative);
172 }
173 }
174
175 GrfSpecFeature GetFeature() const override;
176 uint32_t GetDebugID() const override;
177};
178
180{
181 return GSF_BADGES;
182}
183
185{
186 return this->self_scope.badge.index.base();
187}
188
198BadgeResolverObject::BadgeResolverObject(const Badge &badge, GrfSpecFeature feature, std::optional<TimerGameCalendar::Date> introduction_date, CallbackID callback, uint32_t callback_param1, uint32_t callback_param2)
199 : ResolverObject(badge.grf_prop.grffile, callback, callback_param1, callback_param2), self_scope(*this, badge, introduction_date)
200{
201 assert(feature <= GSF_END);
202 this->root_spritegroup = this->self_scope.badge.grf_prop.GetSpriteGroup(feature);
203 if (this->root_spritegroup == nullptr) this->root_spritegroup = this->self_scope.badge.grf_prop.GetSpriteGroup(GSF_END);
204}
205
213uint32_t GetBadgeVariableResult(const GRFFile &grffile, std::span<const BadgeID> badges, uint32_t parameter)
214{
215 if (parameter >= std::size(grffile.badge_list)) return UINT_MAX;
216
217 BadgeID index = grffile.badge_list[parameter];
218 return std::ranges::find(badges, index) != std::end(badges);
219}
220
225{
226 Badge *b = GetBadge(index);
227 assert(b != nullptr);
228 b->features.Set(feature);
229}
230
238void AppendCopyableBadgeList(std::vector<BadgeID> &dst, std::span<const BadgeID> src, GrfSpecFeature feature)
239{
240 for (const BadgeID &index : src) {
241 /* Is badge already present? */
242 if (std::ranges::find(dst, index) != std::end(dst)) continue;
243
244 /* Is badge copyable? */
245 Badge *badge = GetBadge(index);
246 if (badge == nullptr) continue;
247 if (!badge->flags.Test(BadgeFlag::Copy)) continue;
248
249 dst.push_back(index);
250 badge->features.Set(feature);
251 }
252}
253
256{
257 for (const Badge &badge : _badges.specs) {
258 Badge *class_badge = GetClassBadge(badge.class_index);
259 assert(class_badge != nullptr);
260 class_badge->features.Set(badge.features);
261 }
262}
263
264static constexpr uint MAX_BADGE_HEIGHT = 12;
265static constexpr uint MAX_BADGE_WIDTH = MAX_BADGE_HEIGHT * 2;
266
275static PalSpriteID GetBadgeSprite(const Badge &badge, GrfSpecFeature feature, std::optional<TimerGameCalendar::Date> introduction_date, PaletteID remap)
276{
277 BadgeResolverObject object(badge, feature, introduction_date);
278 const SpriteGroup *group = object.Resolve();
279 if (group == nullptr) return {0, PAL_NONE};
280
281 PaletteID pal = badge.flags.Test(BadgeFlag::UseCompanyColour) ? remap : PAL_NONE;
282
283 return {group->GetResult(), pal};
284}
285
293{
294 Dimension d = { 0, MAX_BADGE_HEIGHT };
295
296 for (const auto &badge : _badges.specs) {
297 if (badge.class_index != class_index) continue;
298
299 PalSpriteID ps = GetBadgeSprite(badge, feature, std::nullopt, PAL_NONE);
300 if (ps.sprite == 0) continue;
301
302 d.width = std::max(d.width, GetSpriteSize(ps.sprite, nullptr, ZOOM_LVL_NORMAL).width);
303 if (d.width > MAX_BADGE_WIDTH) break;
304 }
305
306 d.width = std::min(d.width, MAX_BADGE_WIDTH);
307 return d;
308}
309
312public:
318 {
319 for (auto index : _badges.classes) {
320 Badge *class_badge = GetBadge(index);
321 if (!class_badge->features.Test(feature)) continue;
322
323 this->classes.push_back(class_badge->class_index);
324 }
325
326 std::ranges::sort(this->classes, [](const BadgeClassID &a, const BadgeClassID &b)
327 {
328 return GetClassBadge(a)->label < GetClassBadge(b)->label;
329 });
330 }
331
332 std::span<const BadgeClassID> Classes() const { return this->classes; }
333
334private:
335 std::vector<BadgeClassID> classes;
336};
337
338static bool operator<(const GUIBadgeClasses::Element &a, const GUIBadgeClasses::Element &b)
339{
340 if (a.column_group != b.column_group) return a.column_group < b.column_group;
341 if (a.sort_order != b.sort_order) return a.sort_order < b.sort_order;
342 return a.label < b.label;
343}
344
349GUIBadgeClasses::GUIBadgeClasses(GrfSpecFeature feature)
350{
351 /* Get list of classes used by feature. */
352 UsedBadgeClasses used(feature);
353
354 uint max_column = 0;
355 for (BadgeClassID class_index : used.Classes()) {
356 Dimension size = GetBadgeMaximalDimension(class_index, feature);
357 if (size.width == 0) continue;
358
359 uint8_t column = 0;
360 bool visible = true;
361 uint sort_order = UINT_MAX;
362
363 std::string_view label = GetClassBadge(class_index)->label;
364
365 this->gui_classes.emplace_back(class_index, column, visible, sort_order, size, label);
366 if (visible) max_column = std::max<uint>(max_column, column);
367 }
368
369 std::sort(std::begin(this->gui_classes), std::end(this->gui_classes));
370
371 /* Determine total width of visible badge columns. */
372 this->column_widths.resize(max_column + 1);
373 for (const auto &el : this->gui_classes) {
374 if (!el.visible) continue;
375 this->column_widths[el.column_group] += ScaleGUITrad(el.size.width) + WidgetDimensions::scaled.hsep_normal;
376 }
377
378 /* Replace trailing `hsep_normal` spacer with wider `hsep_wide` spacer. */
379 for (uint &badge_width : this->column_widths) {
380 if (badge_width == 0) continue;
382 }
383}
384
390{
391 return std::accumulate(std::begin(this->column_widths), std::end(this->column_widths), 0U);
392}
393
400{
401 /* Do not filter if the filter text box is empty */
402 if (filter.IsEmpty()) return;
403
404 /* Pre-build list of badges that match by string. */
405 for (const auto &badge : _badges.specs) {
406 if (badge.name == STR_NULL) continue;
407 if (!badge.features.Test(feature)) continue;
408
409 filter.ResetState();
410 filter.AddLine(GetString(badge.name));
411 if (!filter.GetState()) continue;
412
413 auto it = std::ranges::lower_bound(this->badges, badge.index);
414 if (it != std::end(this->badges) && *it == badge.index) continue;
415
416 this->badges.insert(it, badge.index);
417 }
418}
419
425bool BadgeTextFilter::Filter(std::span<const BadgeID> badges) const
426{
427 return std::ranges::any_of(badges, [this](const BadgeID &badge) { return std::ranges::binary_search(this->badges, badge); });
428}
429
437int DrawBadgeNameList(Rect r, std::span<const BadgeID> badges, GrfSpecFeature)
438{
439 if (badges.empty()) return r.top;
440
441 std::set<BadgeClassID> classes;
442 for (const BadgeID &index : badges) classes.insert(GetBadge(index)->class_index);
443
444 std::string_view list_separator = GetListSeparator();
445 for (const BadgeClassID &class_index : classes) {
446 const Badge *class_badge = GetClassBadge(class_index);
447 if (class_badge == nullptr || class_badge->name == STR_NULL) continue;
448
449 std::string s;
450 for (const BadgeID &index : badges) {
451 const Badge *badge = GetBadge(index);
452 if (badge == nullptr || badge->name == STR_NULL) continue;
453 if (badge->class_index != class_index) continue;
454
455 if (!s.empty()) {
456 if (badge->flags.Test(BadgeFlag::NameListFirstOnly)) continue;
457 s += list_separator;
458 }
459 AppendStringInPlace(s, badge->name);
460 if (badge->flags.Test(BadgeFlag::NameListStop)) break;
461 }
462
463 if (s.empty()) continue;
464
465 r.top = DrawStringMultiLine(r, GetString(STR_BADGE_NAME_LIST, class_badge->name, std::move(s)), TC_BLACK);
466 }
467
468 return r.top;
469}
470
481void DrawBadgeColumn(Rect r, int column_group, const GUIBadgeClasses &badge_classes, std::span<const BadgeID> badges, GrfSpecFeature feature, std::optional<TimerGameCalendar::Date> introduction_date, PaletteID remap)
482{
483 bool rtl = _current_text_dir == TD_RTL;
484 for (const auto &badge_class : badge_classes.GetClasses()) {
485 if (badge_class.column_group != column_group) continue;
486 if (!badge_class.visible) continue;
487
488 int width = ScaleGUITrad(badge_class.size.width);
489 for (const BadgeID &index : badges) {
490 const Badge &badge = *GetBadge(index);
491 if (badge.class_index != badge_class.badge_class) continue;
492
493 PalSpriteID ps = GetBadgeSprite(badge, feature, introduction_date, remap);
494 if (ps.sprite == 0) continue;
495
496 DrawSpriteIgnorePadding(ps.sprite, ps.pal, r.WithWidth(width, rtl), SA_CENTER);
497 break;
498 }
499
500 r = r.Indent(width + WidgetDimensions::scaled.hsep_normal, rtl);
501 }
502}
503
505template <class TBase, bool TEnd = true, FontSize TFs = FS_NORMAL>
506class DropDownBadges : public TBase {
507public:
508 template <typename... Args>
509 explicit DropDownBadges(const std::shared_ptr<GUIBadgeClasses> &badge_classes, std::span<const BadgeID> badges, GrfSpecFeature feature, std::optional<TimerGameCalendar::Date> introduction_date, Args&&... args)
510 : TBase(std::forward<Args>(args)...), badge_classes(badge_classes), badges(badges), feature(feature), introduction_date(introduction_date)
511 {
512 for (const auto &badge_class : badge_classes->GetClasses()) {
513 if (badge_class.column_group != 0) continue;
514 dim.width += badge_class.size.width + WidgetDimensions::scaled.hsep_normal;
515 dim.height = std::max(dim.height, badge_class.size.height);
516 }
517 }
518
519 uint Height() const override { return std::max<uint>(this->dim.height, this->TBase::Height()); }
520 uint Width() const override { return this->dim.width + WidgetDimensions::scaled.hsep_wide + this->TBase::Width(); }
521
522 void Draw(const Rect &full, const Rect &r, bool sel, Colours bg_colour) const override
523 {
524 bool rtl = TEnd ^ (_current_text_dir == TD_RTL);
525
526 DrawBadgeColumn(r.WithWidth(this->dim.width, rtl), 0, *this->badge_classes, this->badges, this->feature, this->introduction_date, PAL_NONE);
527
528 this->TBase::Draw(full, r.Indent(this->dim.width + WidgetDimensions::scaled.hsep_wide, rtl), sel, bg_colour);
529 }
530
531private:
532 std::shared_ptr<GUIBadgeClasses> badge_classes;
533
534 const std::span<const BadgeID> badges;
535 const GrfSpecFeature feature;
536 const std::optional<TimerGameCalendar::Date> introduction_date;
537
538 Dimension dim{};
539
540};
541
544
545std::unique_ptr<DropDownListItem> MakeDropDownListBadgeItem(const std::shared_ptr<GUIBadgeClasses> &badge_classes, std::span<const BadgeID> badges, GrfSpecFeature feature, std::optional<TimerGameCalendar::Date> introduction_date, std::string &&str, int value, bool masked, bool shaded)
546{
547 return std::make_unique<DropDownListBadgeItem>(badge_classes, badges, feature, introduction_date, std::move(str), value, masked, shaded);
548}
549
550std::unique_ptr<DropDownListItem> MakeDropDownListBadgeIconItem(const std::shared_ptr<GUIBadgeClasses> &badge_classes, std::span<const BadgeID> badges, GrfSpecFeature feature, std::optional<TimerGameCalendar::Date> introduction_date, const Dimension &dim, SpriteID sprite, PaletteID palette, std::string &&str, int value, bool masked, bool shaded)
551{
552 return std::make_unique<DropDownListBadgeIconItem>(badge_classes, badges, feature, introduction_date, dim, sprite, palette, std::move(str), value, masked, shaded);
553}
bool Filter(std::span< const BadgeID > badges) const
Test if any of the given badges matches the filtered badge list.
BadgeTextFilter(struct StringFilter &filter, GrfSpecFeature feature)
Construct a badge text filter.
VariableGRFFileProps grf_prop
Sprite information.
BadgeClassID class_index
Index of class this badge belongs to.
std::string label
Label of badge.
BadgeID index
Index assigned to badge.
BadgeFlags flags
Display flags.
GrfSpecFeatures features
Bitmask of which features use this badge.
StringID name
Short name.
Global state for badge definitions.
std::vector< BadgeID > classes
List of known badge classes.
std::vector< Badge > specs
List of known badges.
constexpr bool Test(Tvalue_type value) const
Test if the value-th bit is set.
constexpr Timpl & Set()
Set all bits.
Drop down element that draws a list of badges.
uint GetTotalColumnsWidth() const
Get total width of all columns.
static Date date
Current date in days (day counter).
Utility class to create a list of badge classes used by a feature.
std::vector< BadgeClassID > classes
List of badge classes.
UsedBadgeClasses(GrfSpecFeature feature)
Create a list of used badge classes for a feature.
static WidgetDimensions scaled
Widget dimensions scaled for current zoom level.
Definition window_gui.h:29
int hsep_wide
Wide horizontal spacing.
Definition window_gui.h:62
int hsep_normal
Normal horizontal spacing.
Definition window_gui.h:61
Common drop down list components.
Types related to the drop down widget.
Dimension GetSpriteSize(SpriteID sprid, Point *offset, ZoomLevel zoom)
Get the size of a sprite.
Definition gfx.cpp:923
int DrawStringMultiLine(int left, int right, int top, int bottom, std::string_view str, TextColour colour, StringAlignment align, bool underline, FontSize fontsize)
Draw string, possibly over multiple lines.
Definition gfx.cpp:775
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
Definition gfx_type.h:17
@ SA_CENTER
Center both horizontally and vertically.
Definition gfx_type.h:387
uint32_t PaletteID
The number of the palette.
Definition gfx_type.h:18
Base for the NewGRF implementation.
GrfSpecFeature
Definition newgrf.h:70
int DrawBadgeNameList(Rect r, std::span< const BadgeID > badges, GrfSpecFeature)
Draw names for a list of badge labels.
static Badges _badges
Static instance of badge state.
Badge * GetBadge(BadgeID index)
Get a badge if it exists.
void ApplyBadgeFeaturesToClassBadges()
Apply features from all badges to their badge classes.
void MarkBadgeSeen(BadgeID index, GrfSpecFeature feature)
Mark a badge a seen (used) by a feature.
void AppendCopyableBadgeList(std::vector< BadgeID > &dst, std::span< const BadgeID > src, GrfSpecFeature feature)
Append copyable badges from a list onto another.
Badge * GetClassBadge(BadgeClassID class_index)
Get the badge class of a badge label.
static constexpr char BADGE_CLASS_SEPARATOR
Separator to identify badge classes from a label.
static constexpr uint MAX_BADGE_HEIGHT
Maximal height of a badge sprite.
static BadgeClassID GetOrCreateBadgeClass(BadgeID index)
Assign a BadgeClassID to the given badge.
static constexpr uint MAX_BADGE_WIDTH
Maximal width.
Badge & GetOrCreateBadge(std::string_view label)
Register a badge label and return its global index.
uint32_t GetBadgeVariableResult(const GRFFile &grffile, std::span< const BadgeID > badges, uint32_t parameter)
Test for a matching badge in a list of badges, returning the number of matching bits.
static Dimension GetBadgeMaximalDimension(BadgeClassID class_index, GrfSpecFeature feature)
Get the largest badge size (within limits) for a badge class.
Badge * GetBadgeByLabel(std::string_view label)
Get a badge by label if it exists.
void DrawBadgeColumn(Rect r, int column_group, const GUIBadgeClasses &badge_classes, std::span< const BadgeID > badges, GrfSpecFeature feature, std::optional< TimerGameCalendar::Date > introduction_date, PaletteID remap)
Draw a badge column group.
static PalSpriteID GetBadgeSprite(const Badge &badge, GrfSpecFeature feature, std::optional< TimerGameCalendar::Date > introduction_date, PaletteID remap)
Get sprite for the given badge.
void ResetBadges()
Reset badges to the default state.
Functions related to NewGRF badges.
Badge * GetClassBadge(BadgeClassID class_index)
Get the badge class of a badge label.
Types related to NewGRF badges.
@ NameListStop
Stop adding names to the name list after this badge.
@ UseCompanyColour
Apply company colour palette to this badge.
@ NameListFirstOnly
Don't add this name to the name list if not first.
@ Copy
Copy badge to related things.
CallbackID
List of implemented NewGRF callbacks.
@ CBID_NO_CALLBACK
Set when using the callback resolve system, but not to resolve a callback.
Action 2 handling.
VarSpriteGroupScope
@ VSG_SCOPE_SELF
Resolved object itself.
A number of safeguards to prevent using unsafe methods.
Definition of base types and functions in a cross-platform compatible way.
Searching and filtering using a stringterm.
std::string_view GetListSeparator()
Get the list separator string for the current language.
Definition strings.cpp:310
void AppendStringInPlace(std::string &result, StringID string)
Resolve the given StringID and append in place into an existing std::string with formatting but no pa...
Definition strings.cpp:436
std::string GetString(StringID string)
Resolve the given StringID into a std::string with formatting but no parameters.
Definition strings.cpp:426
TextDirection _current_text_dir
Text direction of the currently selected language.
Definition strings.cpp:56
Functions related to OTTD's strings.
@ TD_RTL
Text is written right-to-left by default.
Resolver of badges.
GrfSpecFeature GetFeature() const override
Get the feature number being resolved for.
BadgeResolverObject(const Badge &badge, GrfSpecFeature feature, std::optional< TimerGameCalendar::Date > introduction_date, CallbackID callback=CBID_NO_CALLBACK, uint32_t callback_param1=0, uint32_t callback_param2=0)
Constructor of the badge resolver.
ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0) override
Get a resolver for the scope.
uint32_t GetDebugID() const override
Get an identifier for the item being resolved.
Resolver for a badge scope.
BadgeScopeResolver(ResolverObject &ro, const Badge &badge, const std::optional< TimerGameCalendar::Date > introduction_date)
Scope resolver of a badge.
uint32_t GetVariable(uint8_t variable, uint32_t parameter, bool &available) const override
Get a variable value.
Dimensions (a width and height) of a rectangle in 2D.
Dynamic data of a loaded NewGRF.
Definition newgrf.h:113
std::vector< BadgeID > badge_list
Badge translation table (local index -> global index)
Definition newgrf.h:137
uint sort_order
Order of element.
std::string_view label
Class label (string owned by the class badge)
uint8_t column_group
Column group in UI. 0 = left, 1 = centre, 2 = right.
Combination of a palette sprite and a 'real' sprite.
Definition gfx_type.h:22
SpriteID sprite
The 'real' sprite.
Definition gfx_type.h:23
PaletteID pal
The palette (use PAL_NONE) if not needed)
Definition gfx_type.h:24
Specification of a rectangle with absolute coordinates of all edges.
Rect WithWidth(int width, bool end) const
Copy Rect and set its width.
Rect Indent(int indent, bool end) const
Copy Rect and indent it from its position.
Interface for SpriteGroup-s to access the gamestate.
uint32_t callback_param2
Second parameter (var 18) of the callback.
CallbackID callback
Callback being resolved.
uint32_t callback_param1
First parameter (var 10) of the callback.
const SpriteGroup * root_spritegroup
Root SpriteGroup to use for resolving.
virtual ScopeResolver * GetScope(VarSpriteGroupScope scope=VSG_SCOPE_SELF, uint8_t relative=0)
Get a resolver for the scope.
Interface to query and set values specific to a single VarSpriteGroupScope (action 2 scope).
ResolverObject & ro
Surrounding resolver object.
virtual const SpriteGroup * Resolve(ResolverObject &object) const
Base sprite group resolver.
String filter and state.
bool IsEmpty() const
Check whether any filter words were entered.
void ResetState()
Reset the matching state to process a new item.
bool GetState() const
Get the matching state of the current item.
const struct SpriteGroup * GetSpriteGroup(size_t index) const
Get the SpriteGroup at the specified index.
int16_t Height
Fixed point type for heights.
Definition tgp.cpp:153
Definition of the game-calendar-timer.
static RectPadding ScaleGUITrad(const RectPadding &r)
Scale a RectPadding to GUI zoom level.
Definition widget.cpp:48
Functions, definitions and such used only by the GUI.
Functions related to zooming.
@ ZOOM_LVL_NORMAL
The normal zoom level.
Definition zoom_type.h:21