OpenTTD Source: src/newgrf_badge_config.h Source File

OpenTTD Source 15.0-RC2

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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
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
16 class BadgeClassConfigItem {
17public:
18 std::string label;
19 uint column = 0;
20 bool show_icon = true;
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);
28void AddBadgeClassesToConfiguration();
29void ResetBadgeClassConfiguration(GrfSpecFeature feature);
30std::pair<const BadgeClassConfigItem &, int> GetBadgeClassConfigItem(GrfSpecFeature feature, std::string_view label);
31
32#endif /* NEWGRF_BADGE_CONFIG_H */
BadgeClassConfigItem
Definition newgrf_badge_config.h:16
BadgeClassConfigItem::label
std::string label
Class label.
Definition newgrf_badge_config.h:18
BadgeClassConfigItem::show_filter
bool show_filter
Set if a drop down filter should be added for this class.
Definition newgrf_badge_config.h:21
BadgeClassConfigItem::show_icon
bool show_icon
Set if the badge icons should be displayed for this class.
Definition newgrf_badge_config.h:20
BadgeClassConfigItem::column
uint column
UI column, feature-dependent.
Definition newgrf_badge_config.h:19
newgrf.h
Base for the NewGRF implementation.
GrfSpecFeature
GrfSpecFeature
Definition newgrf.h:68
BadgeClassLoadConfig
void BadgeClassLoadConfig(const IniFile &ini)
Load badge column preferences.
Definition newgrf_badge_config.cpp:169
AddBadgeClassesToConfiguration
void AddBadgeClassesToConfiguration()
Add current badge classes to user configuration.
Definition newgrf_badge_config.cpp:76
ResetBadgeClassConfiguration
void ResetBadgeClassConfiguration(GrfSpecFeature feature)
Reset badge class configuration for a feature.
Definition newgrf_badge_config.cpp:99
GetBadgeClassConfigItem
std::pair< const BadgeClassConfigItem &, int > GetBadgeClassConfigItem(GrfSpecFeature feature, std::string_view label)
Get configuration for a badge class.
Definition newgrf_badge_config.cpp:119
BadgeClassSaveConfig
void BadgeClassSaveConfig(struct IniFile &ini)
Save badge column preferences.
Definition newgrf_badge_config.cpp:198
GetBadgeClassConfiguration
std::span< BadgeClassConfigItem > GetBadgeClassConfiguration(GrfSpecFeature feature)
Get the badge user configuration for a feature.
Definition newgrf_badge_config.cpp:66
newgrf_badge_type.h
Types related to NewGRF badges.
IniFile
Ini file that supports both loading and saving.
Definition ini_type.h:86