OpenTTD Source: src/settingentry_gui.h File Reference

OpenTTD Source 15.3

Data Structures | Typedefs | Enumerations | Functions | Variables
settingentry_gui.h File Reference

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

`#include "core/enum_type.hpp"`
`#include "settings_internal.h"`
`#include "stringfilter_type.h"`

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
SettingsContainer & | GetSettingsTree ()
| Construct settings tree.
const void * | ResolveObject (const GameSettings *settings_ptr, const IntSettingDesc *sd)

## Variables
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

using SettingEntryFlags = EnumBitSet<SettingEntryFlag, uint8_t>

Definition at line 27 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 32 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 21 of file settingentry_gui.h.

## Function Documentation

## ◆ GetSettingsTree()

SettingsContainer & GetSettingsTree | ( |  | ) |

Construct settings tree.

Definition at line 619 of file settingentry_gui.cpp.

Referenced by GameOptionsWindow::DrawWidget(), GameOptionsWindow::OnClick(), GameOptionsWindow::OnDropdownSelect(), GameOptionsWindow::OnEditboxChanged(), GameOptionsWindow::OnInvalidateData(), and ResetAllSettingsConfirmationCallback().

## ◆ ResolveObject()

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

Definition at line 249 of file settingentry_gui.cpp.

## Variable Documentation

## ◆ SEF_BUTTONS_MASK

constexpr SettingEntryFlags SEF_BUTTONS_MASK = {SettingEntryFlag::LeftDepressed, SettingEntryFlag::RightDepressed}
| staticconstexpr

Mask for button flags.

Definition at line 29 of file settingentry_gui.h.

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