Change: Unify station/waypoint/roadstop/object build-picker window code.

These windows now share a common code base for choosing and display class and types.

An additional text filter is added to search types by name instead of just classes.
This commit is contained in:
2024-05-07 12:13:48 +01:00
committed by Peter Nelson
parent d2c8b476b5
commit cdc356e7bf
16 changed files with 1261 additions and 1691 deletions

View File

@@ -42,6 +42,9 @@ private:
static void InsertDefaults();
public:
using spec_type = Tspec;
using index_type = Tindex;
uint32_t global_id; ///< Global ID for class, e.g. 'DFLT', 'WAYP', etc.
StringID name; ///< Name of this class.
@@ -67,8 +70,6 @@ public:
uint GetSpecCount() const { return static_cast<uint>(this->spec.size()); }
/** Get the number of potentially user-available specs within the class. */
uint GetUISpecCount() const { return this->ui_count; }
int GetUIFromIndex(int index) const;
int GetIndexFromUI(int ui_index) const;
const Tspec *GetSpec(uint index) const;
@@ -80,7 +81,6 @@ public:
static void Assign(Tspec *spec);
static uint GetClassCount();
static uint GetUIClassCount();
static Tindex GetUIClass(uint index);
static NewGRFClass *Get(Tindex class_index);
static const Tspec *GetByGrf(uint32_t grfid, uint16_t local_id);