OpenTTD Source: GRFParameterInfo Struct Reference

OpenTTD Source 15.3

Public Types | Public Member Functions | Data Fields
GRFParameterInfo Struct Reference

Information about one grf parameter. More...

`#include <newgrf_config.h>`

## Public Types
using | ValueName = std::pair< uint32_t, GRFTextList >

## 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::vector< ValueName > | value_names
| Names for each value.

## Detailed Description

Information about one grf parameter.

Definition at line 129 of file newgrf_config.h.

## Member Typedef Documentation

## ◆ ValueName

using GRFParameterInfo::ValueName = std::pair<uint32_t, GRFTextList>

Definition at line 151 of file newgrf_config.h.

## Constructor & Destructor Documentation

## ◆ GRFParameterInfo()

GRFParameterInfo::GRFParameterInfo | ( | uint | nr | ) |
| inlineexplicit

Create a new empty GRFParameterInfo object.

Parameters

  nr | The newgrf parameter that is changed.

Definition at line 134 of file newgrf_config.h.

## Member Function Documentation

## ◆ Finalize()

void GRFParameterInfo::Finalize | ( |  | ) |

Finalize Action 14 info after file scan is finished.

Definition at line 200 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 149 of file newgrf_config.h.

Referenced by NewGRFParametersWindow::DrawWidget(), Finalize(), and NewGRFParametersWindow::OnClick().

## ◆ def_value

uint32_t GRFParameterInfo::def_value = 0

Default value of this parameter.

Definition at line 141 of file newgrf_config.h.

Referenced by ChangeGRFParamDefault().

## ◆ desc

GRFTextList GRFParameterInfo::desc = {}

The description of this parameter.

Definition at line 137 of file newgrf_config.h.

Referenced by ChangeGRFParamDescription(), and NewGRFParametersWindow::DrawWidget().

## ◆ first_bit

uint8_t GRFParameterInfo::first_bit = 0

First bit to use in the GRF parameter.

Definition at line 146 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 140 of file newgrf_config.h.

Referenced by ChangeGRFParamLimits(), ChangeGRFParamValueNames(), NewGRFParametersWindow::DrawWidget(), Finalize(), and NewGRFParametersWindow::OnClick().

## ◆ min_value

uint32_t GRFParameterInfo::min_value = 0

The minimal value this parameter can have.

Definition at line 139 of file newgrf_config.h.

Referenced by ChangeGRFParamLimits(), NewGRFParametersWindow::DrawWidget(), Finalize(), and NewGRFParametersWindow::OnClick().

## ◆ name

GRFTextList GRFParameterInfo::name = {}

The name of this parameter.

Definition at line 136 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 147 of file newgrf_config.h.

Referenced by ChangeGRFParamMask().

## ◆ param_nr

uint8_t GRFParameterInfo::param_nr

GRF parameter to store content in.

Definition at line 145 of file newgrf_config.h.

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

## ◆ type

GRFParameterType GRFParameterInfo::type = PTYPE_UINT_ENUM

The type of this parameter.

Definition at line 143 of file newgrf_config.h.

Referenced by ChangeGRFParamLimits(), ChangeGRFParamType(), NewGRFParametersWindow::DrawWidget(), and NewGRFParametersWindow::OnClick().

## ◆ value_names

std::vector<ValueName> GRFParameterInfo::value_names

Names for each value.

Definition at line 152 of file newgrf_config.h.

Referenced by ChangeGRFParamValueNames(), Finalize(), and NewGRFParametersWindow::OnClick().

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

- src/newgrf_config.h
- src/newgrf_config.cpp