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);
|
const Badge *badge = GetBadge(index);
|
||||||
if (badge == nullptr || badge->name == STR_NULL) continue;
|
if (badge == nullptr || badge->name == STR_NULL) continue;
|
||||||
if (badge->class_index != class_index) continue;
|
if (badge->class_index != class_index) continue;
|
||||||
|
if (badge->flags.Test(BadgeFlag::NameListSkip)) continue;
|
||||||
|
|
||||||
if (!s.empty()) {
|
if (!s.empty()) {
|
||||||
if (badge->flags.Test(BadgeFlag::NameListFirstOnly)) continue;
|
if (badge->flags.Test(BadgeFlag::NameListFirstOnly)) continue;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ enum class BadgeFlag : uint8_t {
|
|||||||
NameListStop = 1, ///< Stop adding names to the name list after this badge.
|
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.
|
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.
|
HasText, ///< Internal flag set if the badge has text.
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user