OpenTTD Source 20250312-master-gcdcc6b491d
settingentry_gui.h File Reference

Declarations of classes for handling display of individual configuration settings. More...

Go to the source code of this file.

Data Structures

struct  SettingFilter
 Filter for settings list. More...
 
struct  BaseSettingEntry
 Data structure describing a single setting in a tab. More...
 
struct  SettingEntry
 Standard setting. More...
 
struct  SettingsContainer
 Containers for BaseSettingEntry. More...
 
struct  SettingsPage
 Data structure describing one page of settings in the settings window. More...
 

Typedefs

using SettingEntryFlags = EnumBitSet< SettingEntryFlag, uint8_t >
 

Enumerations

enum class  SettingEntryFlag : uint8_t { LeftDepressed , RightDepressed , LastField , Filtered }
 Flags for SettingEntry. More...
 
enum  RestrictionMode : uint8_t {
  RM_BASIC , RM_ADVANCED , RM_ALL , RM_CHANGED_AGAINST_DEFAULT ,
  RM_CHANGED_AGAINST_NEW , RM_END
}
 How the list of advanced settings is filtered. More...
 

Functions

SettingsContainerGetSettingsTree ()
 Construct settings tree.
 
const void * ResolveObject (const GameSettings *settings_ptr, const IntSettingDesc *sd)
 

Variables

Dimension _circle_size
 Dimension of the circle +/- icon. This is here as not all users are within the class of the settings window.
 
int SETTING_HEIGHT
 Height of a single setting in the tree view in pixels.
 
static constexpr SettingEntryFlags SEF_BUTTONS_MASK = {SettingEntryFlag::LeftDepressed, SettingEntryFlag::RightDepressed}
 Mask for button flags.
 

Detailed Description

Declarations of classes for handling display of individual configuration settings.

Definition in file settingentry_gui.h.

Typedef Documentation

◆ SettingEntryFlags

Definition at line 30 of file settingentry_gui.h.

Enumeration Type Documentation

◆ RestrictionMode

enum RestrictionMode : uint8_t

How the list of advanced settings is filtered.

Enumerator
RM_BASIC 

Display settings associated to the "basic" list.

RM_ADVANCED 

Display settings associated to the "advanced" list.

RM_ALL 

List all settings regardless of the default/newgame/... values.

RM_CHANGED_AGAINST_DEFAULT 

Show only settings which are different compared to default values.

RM_CHANGED_AGAINST_NEW 

Show only settings which are different compared to the user's new game setting values.

RM_END 

End for iteration.

Definition at line 35 of file settingentry_gui.h.

◆ SettingEntryFlag

enum class SettingEntryFlag : uint8_t
strong

Flags for SettingEntry.

Note
The SEF_BUTTONS_MASK matches expectations of the formal parameter 'state' of DrawArrowButtons
Enumerator
LeftDepressed 

Of a numeric setting entry, the left button is depressed.

RightDepressed 

Of a numeric setting entry, the right button is depressed.

LastField 

This entry is the last one in a (sub-)page.

Filtered 

Entry is hidden by the string filter.

Definition at line 24 of file settingentry_gui.h.

Function Documentation

◆ GetSettingsTree()

◆ ResolveObject()

const void * ResolveObject ( const GameSettings settings_ptr,
const IntSettingDesc sd 
)

Definition at line 258 of file settingentry_gui.cpp.

Variable Documentation

◆ _circle_size

Dimension _circle_size
extern

Dimension of the circle +/- icon. This is here as not all users are within the class of the settings window.

Definition at line 80 of file settings_gui.cpp.

Referenced by BaseSettingEntry::Draw(), SettingsPage::DrawSetting(), and GameSettingsWindow::UpdateWidgetSize().

◆ SEF_BUTTONS_MASK

Mask for button flags.

Definition at line 32 of file settingentry_gui.h.

Referenced by SettingEntry::DrawSetting(), and SettingEntry::SetButtons().

◆ SETTING_HEIGHT

int SETTING_HEIGHT
extern