OpenTTD Source 20241224-master-gee860a5c8e
GRFParameterInfo Struct Reference

Information about one grf parameter. More...

#include <newgrf_config.h>

Public Member Functions

 GRFParameterInfo (uint nr)
 Create a new empty GRFParameterInfo object.
 
void Finalize ()
 Finalize Action 14 info after file scan is finished.
 

Data Fields

GRFTextList name = {}
 The name of this parameter.
 
GRFTextList desc = {}
 The description of this parameter.
 
uint32_t min_value = 0
 The minimal value this parameter can have.
 
uint32_t max_value = UINT32_MAX
 The maximal value of this parameter.
 
uint32_t def_value = 0
 Default value of this parameter.
 
GRFParameterType type = PTYPE_UINT_ENUM
 The type of this parameter.
 
uint8_t param_nr
 GRF parameter to store content in.
 
uint8_t first_bit = 0
 First bit to use in the GRF parameter.
 
uint8_t num_bit = 32
 Number of bits to use for this parameter.
 
bool complete_labels = false
 True if all values have a label.
 
std::map< uint32_t, GRFTextListvalue_names = {}
 Names for each value.
 

Detailed Description

Information about one grf parameter.

Definition at line 126 of file newgrf_config.h.

Constructor & Destructor Documentation

◆ GRFParameterInfo()

GRFParameterInfo::GRFParameterInfo ( uint  nr)
inlineexplicit

Create a new empty GRFParameterInfo object.

Parameters
nrThe newgrf parameter that is changed.

Definition at line 131 of file newgrf_config.h.

Member Function Documentation

◆ Finalize()

void GRFParameterInfo::Finalize ( )

Finalize Action 14 info after file scan is finished.

Definition at line 212 of file newgrf_config.cpp.

References complete_labels, max_value, min_value, and value_names.

Field Documentation

◆ complete_labels

bool GRFParameterInfo::complete_labels = false

True if all values have a label.

Definition at line 146 of file newgrf_config.h.

Referenced by Finalize().

◆ def_value

uint32_t GRFParameterInfo::def_value = 0

Default value of this parameter.

Definition at line 138 of file newgrf_config.h.

Referenced by ChangeGRFParamDefault().

◆ desc

GRFTextList GRFParameterInfo::desc = {}

The description of this parameter.

Definition at line 134 of file newgrf_config.h.

Referenced by ChangeGRFParamDescription().

◆ first_bit

uint8_t GRFParameterInfo::first_bit = 0

First bit to use in the GRF parameter.

Definition at line 143 of file newgrf_config.h.

Referenced by ChangeGRFParamMask().

◆ max_value

uint32_t GRFParameterInfo::max_value = UINT32_MAX

The maximal value of this parameter.

Definition at line 137 of file newgrf_config.h.

Referenced by ChangeGRFParamLimits(), ChangeGRFParamValueNames(), and Finalize().

◆ min_value

uint32_t GRFParameterInfo::min_value = 0

The minimal value this parameter can have.

Definition at line 136 of file newgrf_config.h.

Referenced by ChangeGRFParamLimits(), and Finalize().

◆ name

GRFTextList GRFParameterInfo::name = {}

The name of this parameter.

Definition at line 133 of file newgrf_config.h.

Referenced by ChangeGRFParamName().

◆ num_bit

uint8_t GRFParameterInfo::num_bit = 32

Number of bits to use for this parameter.

Definition at line 144 of file newgrf_config.h.

Referenced by ChangeGRFParamMask().

◆ param_nr

uint8_t GRFParameterInfo::param_nr

GRF parameter to store content in.

Definition at line 142 of file newgrf_config.h.

Referenced by ChangeGRFParamMask(), NewGRFParametersWindow::GetDummyParameterInfo(), GRFConfig::GetValue(), and GRFConfig::SetValue().

◆ type

GRFParameterType GRFParameterInfo::type = PTYPE_UINT_ENUM

◆ value_names

std::map<uint32_t, GRFTextList> GRFParameterInfo::value_names = {}

Names for each value.

Definition at line 148 of file newgrf_config.h.

Referenced by ChangeGRFParamValueNames(), and Finalize().


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