10#ifndef NEWGRF_BADGE_GUI_H
11#define NEWGRF_BADGE_GUI_H
33 inline std::span<const Element> GetClasses()
const
35 return this->gui_classes;
38 inline std::span<const uint> GetColumnWidths()
const
40 return this->column_widths;
46 std::vector<Element> gui_classes{};
47 std::vector<uint> column_widths{};
51void DrawBadgeColumn(
Rect r,
int column_group,
const GUIBadgeClasses &gui_classes, std::span<const BadgeID> badges,
GrfSpecFeature feature, std::optional<TimerGameCalendar::Date> introduction_date,
PaletteID remap);
53std::unique_ptr<DropDownListItem> MakeDropDownListBadgeItem(
const std::shared_ptr<GUIBadgeClasses> &gui_classes, std::span<const BadgeID> badges,
GrfSpecFeature feature, std::optional<TimerGameCalendar::Date> introduction_date, std::string &&str,
int value,
bool masked =
false,
bool shaded =
false);
54std::unique_ptr<DropDownListItem> MakeDropDownListBadgeIconItem(
const std::shared_ptr<GUIBadgeClasses> &gui_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 =
false,
bool shaded =
false);
56DropDownList BuildBadgeClassConfigurationList(
const class GUIBadgeClasses &badge_class, uint columns, std::span<const StringID> column_separators);
57bool HandleBadgeConfigurationDropDownClick(
GrfSpecFeature feature, uint columns,
int result,
int click_result, BadgeFilterChoices &choices);
66 std::string GetStringParameter(
const BadgeFilterChoices &choices)
const;
74void ResetBadgeFilter(BadgeFilterChoices &choices,
BadgeClassID badge_class_index);
75void SetBadgeFilter(BadgeFilterChoices &choices,
BadgeID badge_index);
uint GetTotalColumnsWidth() const
Get total width of all columns.
Utility class to create a list of badge classes used by a feature.
Types related to the drop down widget.
std::vector< std::unique_ptr< const DropDownListItem > > DropDownList
A drop down list is a collection of drop down list items.
uint32_t SpriteID
The number of a sprite, without mapping bits and colourtables.
uint32_t PaletteID
The number of the palette.
Base for the NewGRF implementation.
Functions related to NewGRF badges.
Types related to NewGRF badges.
Dimensions (a width and height) of a rectangle in 2D.
Dimension size
Maximal size of this element.
uint sort_order
Order of element.
std::string_view label
Class label (string owned by the class badge)
BadgeClassID class_index
Badge class index.
bool visible
Whether the icon is visible.
uint8_t column_group
Column group in UI. 0 = left, 1 = centre, 2 = right.
Specification of a rectangle with absolute coordinates of all edges.
Definition of the game-calendar-timer.