OpenTTD Source 20241224-master-gee860a5c8e
SignList Struct Reference
Inheritance diagram for SignList:
SignListWindow SignWindow

Public Types

typedef GUIList< const Sign *, std::nullptr_t, StringFilter & > GUISignList
 A GUIList contains signs and uses a StringFilter for filtering.
 

Public Member Functions

 SignList ()
 Creates a SignList with filtering disabled by default.
 
void BuildSignsList ()
 
void SortSignsList ()
 
void FilterSignList ()
 Filter out signs from the sign list that does not match the name filter.
 

Static Public Member Functions

static bool SignNameSorter (const Sign *const &a, const Sign *const &b)
 Sort signs by their name.
 
static bool SignNameFilter (const Sign *const *a, StringFilter &filter)
 Filter sign list by sign name.
 
static bool OwnerDeityFilter (const Sign *const *a, StringFilter &)
 Filter sign list excluding OWNER_DEITY.
 
static bool OwnerVisibilityFilter (const Sign *const *a, StringFilter &)
 Filter sign list by owner.
 

Data Fields

GUISignList signs
 
StringFilter string_filter
 The match string to be used when the GUIList is (re)-sorted.
 

Static Public Attributes

static bool match_case = false
 Should case sensitive matching be used?
 
static std::string default_name
 Default sign name, used if Sign::name is nullptr.
 

Detailed Description

Definition at line 40 of file signs_gui.cpp.

Member Typedef Documentation

◆ GUISignList

typedef GUIList<const Sign *, std::nullptr_t, StringFilter &> SignList::GUISignList

A GUIList contains signs and uses a StringFilter for filtering.

Definition at line 44 of file signs_gui.cpp.

Constructor & Destructor Documentation

◆ SignList()

SignList::SignList ( )
inline

Creates a SignList with filtering disabled by default.

Definition at line 55 of file signs_gui.cpp.

Member Function Documentation

◆ BuildSignsList()

void SignList::BuildSignsList ( )
inline

Definition at line 59 of file signs_gui.cpp.

◆ FilterSignList()

void SignList::FilterSignList ( )
inline

Filter out signs from the sign list that does not match the name filter.

Definition at line 122 of file signs_gui.cpp.

References _display_opt, DO_SHOW_COMPETITOR_SIGNS, GUIList< T, P, F >::Filter(), HasBit(), OwnerDeityFilter(), OwnerVisibilityFilter(), and SignNameFilter().

◆ OwnerDeityFilter()

static bool SignList::OwnerDeityFilter ( const Sign *const *  a,
StringFilter  
)
inlinestatic

Filter sign list excluding OWNER_DEITY.

Definition at line 107 of file signs_gui.cpp.

References OWNER_DEITY.

Referenced by FilterSignList().

◆ OwnerVisibilityFilter()

static bool SignList::OwnerVisibilityFilter ( const Sign *const *  a,
StringFilter  
)
inlinestatic

Filter sign list by owner.

Definition at line 114 of file signs_gui.cpp.

References _display_opt, _local_company, DO_SHOW_COMPETITOR_SIGNS, HasBit(), and OWNER_DEITY.

Referenced by FilterSignList().

◆ SignNameFilter()

static bool SignList::SignNameFilter ( const Sign *const *  a,
StringFilter filter 
)
inlinestatic

Filter sign list by sign name.

Definition at line 96 of file signs_gui.cpp.

References StringFilter::AddLine(), default_name, StringFilter::GetState(), and StringFilter::ResetState().

Referenced by FilterSignList().

◆ SignNameSorter()

static bool SignList::SignNameSorter ( const Sign *const &  a,
const Sign *const &  b 
)
inlinestatic

◆ SortSignsList()

void SignList::SortSignsList ( )
inline

Definition at line 90 of file signs_gui.cpp.

Field Documentation

◆ default_name

std::string SignList::default_name
static

Default sign name, used if Sign::name is nullptr.

Definition at line 50 of file signs_gui.cpp.

Referenced by SignListWindow::OnInit(), SignNameFilter(), and SignNameSorter().

◆ match_case

bool SignList::match_case = false
static

Should case sensitive matching be used?

Definition at line 49 of file signs_gui.cpp.

Referenced by SignListWindow::OnClick().

◆ signs

GUISignList SignList::signs

Definition at line 46 of file signs_gui.cpp.

◆ string_filter

StringFilter SignList::string_filter

The match string to be used when the GUIList is (re)-sorted.

Definition at line 48 of file signs_gui.cpp.


The documentation for this struct was generated from the following file: