mirror of
https://github.com/OpenTTD/OpenTTD
synced 2025-12-10 06:52:05 +01:00
Add: [NewGRF] Allow badges to be excluded from badge name list. (#14818)
This allows badges to have names that can be filtered, but avoid cluttering the purchase text.
This commit is contained in:
@@ -133,6 +133,7 @@ int DrawBadgeNameList(Rect r, std::span<const BadgeID> badges, GrfSpecFeature)
|
||||
const Badge *badge = GetBadge(index);
|
||||
if (badge == nullptr || badge->name == STR_NULL) continue;
|
||||
if (badge->class_index != class_index) continue;
|
||||
if (badge->flags.Test(BadgeFlag::NameListSkip)) continue;
|
||||
|
||||
if (!s.empty()) {
|
||||
if (badge->flags.Test(BadgeFlag::NameListFirstOnly)) continue;
|
||||
|
||||
@@ -24,10 +24,11 @@ template <> struct std::hash<BadgeClassID> {
|
||||
};
|
||||
|
||||
enum class BadgeFlag : uint8_t {
|
||||
Copy = 0, ///< Copy badge to related things.
|
||||
NameListStop = 1, ///< Stop adding names to the name list after this badge.
|
||||
Copy = 0, ///< Copy badge to related things.
|
||||
NameListStop = 1, ///< Stop adding names to the name list after this badge.
|
||||
NameListFirstOnly = 2, ///< Don't add this name to the name list if not first.
|
||||
UseCompanyColour = 3, ///< Apply company colour palette to this badge.
|
||||
UseCompanyColour = 3, ///< Apply company colour palette to this badge.
|
||||
NameListSkip = 4, ///< Don't show name in name list at all.
|
||||
|
||||
HasText, ///< Internal flag set if the badge has text.
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user