OpenTTD Source 20260218-master-g2123fca5ea
settingentry_gui.cpp File Reference

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

#include "stdafx.h"
#include "company_base.h"
#include "company_func.h"
#include "settingentry_gui.h"
#include "settings_gui.h"
#include "settings_internal.h"
#include "stringfilter_type.h"
#include "strings_func.h"
#include "table/sprites.h"
#include "table/strings.h"
#include "safeguards.h"

Go to the source code of this file.

Functions

const void * ResolveObject (const GameSettings *settings_ptr, const IntSettingDesc *sd)
 Resolve the underlying object where to dynamically load/save a setting to.
SettingsContainerGetSettingsTree ()
 Construct settings tree.

Detailed Description

Definitions of classes for handling display of individual configuration settings.

Definition in file settingentry_gui.cpp.

Function Documentation

◆ GetSettingsTree()

◆ ResolveObject()

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

Resolve the underlying object where to dynamically load/save a setting to.

This is primarily to load the settings object of the right company, if the setting is saved per company. When not in the menu and the local company is valid, returns the local company's settings. Otherwise the global client settings.

Parameters
settings_ptrThe settings to fall back to when this setting is not for a company.
sdThe setting to check.
Returns
The resolved object.

Definition at line 246 of file settingentry_gui.cpp.

References _local_company, _settings_client, SettingDesc::flags, PerCompany, and BaseBitSet< Timpl, Tvalue_type, Tstorage, Tmask >::Test().

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