Add: Configuration of NewGRF badges.

This commit is contained in:
Peter Nelson
2025-05-23 17:44:19 +01:00
committed by Peter Nelson
parent daef052329
commit c2d4098afa
12 changed files with 470 additions and 9 deletions

View File

@@ -10,6 +10,7 @@
#include "stdafx.h"
#include "newgrf.h"
#include "newgrf_badge.h"
#include "newgrf_badge_config.h"
#include "newgrf_badge_type.h"
#include "newgrf_spritegroup.h"
#include "stringfilter_type.h"
@@ -42,6 +43,15 @@ std::span<const Badge> GetBadges()
return _badges.specs;
}
/**
* Get a read-only view of class badge index.
* @return Span of badges.
*/
std::span<const BadgeID> GetClassBadges()
{
return _badges.classes;
}
/**
* Assign a BadgeClassID to the given badge.
* @param index Badge ID of badge that should be assigned.