OpenTTD Source 20250711-master-gaaf5d39b15
newgrf_badge_config.h
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#ifndef NEWGRF_BADGE_CONFIG_H
11#define NEWGRF_BADGE_CONFIG_H
12
13#include "newgrf.h"
14#include "newgrf_badge_type.h"
15
17public:
18 std::string label;
19 int column = -1;
20 bool show_icon = false;
21 bool show_filter = false;
22};
23
24void BadgeClassLoadConfig(const struct IniFile &ini);
25void BadgeClassSaveConfig(struct IniFile &ini);
26
27std::span<BadgeClassConfigItem> GetBadgeClassConfiguration(GrfSpecFeature feature);
30std::pair<const BadgeClassConfigItem &, int> GetBadgeClassConfigItem(GrfSpecFeature feature, std::string_view label);
31
32#endif /* NEWGRF_BADGE_CONFIG_H */
std::string label
Class label.
bool show_filter
Set if a drop down filter should be added for this class.
int column
UI column, feature-dependent.
bool show_icon
Set if the badge icons should be displayed for this class.
Base for the NewGRF implementation.
GrfSpecFeature
Definition newgrf.h:69
void BadgeClassLoadConfig(const IniFile &ini)
Load badge column preferences.
void AddBadgeClassesToConfiguration()
Add current badge classes to user configuration.
void ResetBadgeClassConfiguration(GrfSpecFeature feature)
Reset badge class configuration for a feature.
std::pair< const BadgeClassConfigItem &, int > GetBadgeClassConfigItem(GrfSpecFeature feature, std::string_view label)
Get configuration for a badge class.
void BadgeClassSaveConfig(struct IniFile &ini)
Save badge column preferences.
std::span< BadgeClassConfigItem > GetBadgeClassConfiguration(GrfSpecFeature feature)
Get the badge user configuration for a feature.
Types related to NewGRF badges.
Ini file that supports both loading and saving.
Definition ini_type.h:86