OpenTTD Source
20241108-master-g80f628063a
|
Information about one grf parameter. More...
#include <newgrf_config.h>
Public Member Functions | |
GRFParameterInfo (uint nr) | |
Create a new empty GRFParameterInfo object. More... | |
uint32_t | GetValue (struct GRFConfig *config) const |
Get the value of this user-changeable parameter from the given config. More... | |
void | SetValue (struct GRFConfig *config, uint32_t value) |
Set the value of this user-changeable parameter in the given config. More... | |
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. | |
GRFParameterType | type |
The type of this parameter. | |
uint32_t | min_value |
The minimal value this parameter can have. | |
uint32_t | max_value |
The maximal value of this parameter. | |
uint32_t | def_value |
Default value of this parameter. | |
uint8_t | param_nr |
GRF parameter to store content in. | |
uint8_t | first_bit |
First bit to use in the GRF parameter. | |
uint8_t | num_bit |
Number of bits to use for this parameter. | |
std::map< uint32_t, GRFTextList > | value_names |
Names for each value. | |
bool | complete_labels |
True if all values have a label. | |
Information about one grf parameter.
Definition at line 126 of file newgrf_config.h.
GRFParameterInfo::GRFParameterInfo | ( | uint | nr | ) |
Create a new empty GRFParameterInfo object.
nr | The newgrf parameter that is changed. |
Definition at line 182 of file newgrf_config.cpp.
uint32_t GRFParameterInfo::GetValue | ( | struct GRFConfig * | config | ) | const |
Get the value of this user-changeable parameter from the given config.
config | The GRFConfig to get the value from. |
Definition at line 201 of file newgrf_config.cpp.
References GB(), num_bit, GRFConfig::param, and param_nr.
void GRFParameterInfo::SetValue | ( | struct GRFConfig * | config, |
uint32_t | value | ||
) |
Set the value of this user-changeable parameter in the given config.
config | The GRFConfig to set the value in. |
value | The new value. |
Definition at line 213 of file newgrf_config.cpp.
References num_bit, GRFConfig::num_params, GRFConfig::param, param_nr, SB(), SetWindowDirty(), WC_GAME_OPTIONS, and WN_GAME_OPTIONS_NEWGRF_STATE.