OpenTTD Source 20250905-master-g122023be8d
|
Information about the valid values of CompanyManagerFace bitgroups as well as the sprites to draw. More...
#include <company_manager_face.h>
Public Member Functions | |
uint | GetBits (const CompanyManagerFace &cmf) const |
Gets the company manager's face bits. | |
void | SetBits (CompanyManagerFace &cmf, uint val) const |
Sets the company manager's face bits. | |
void | ChangeBits (CompanyManagerFace &cmf, int8_t amount) const |
Increase/Decrease the company manager's face variable by the given amount. | |
bool | IsValid (const CompanyManagerFace &cmf) const |
Checks whether the company manager's face bits have a valid range. | |
uint | ScaleBits (uint val) const |
Scales a company manager's face bits variable to the correct scope. | |
SpriteID | GetSprite (const CompanyManagerFace &cmf) const |
Gets the sprite to draw. | |
Data Fields | |
FaceVarType | type |
uint8_t | position |
Position in UI. | |
uint8_t | offset |
Offset in bits into the CompanyManagerFace. | |
uint8_t | length |
Number of bits used in the CompanyManagerFace. | |
uint8_t | valid_values |
The number of valid values. | |
std::variant< SpriteID, uint64_t, std::pair< uint64_t, uint64_t > > | data |
The first sprite. | |
StringID | name = STR_NULL |
Information about the valid values of CompanyManagerFace bitgroups as well as the sprites to draw.
Definition at line 28 of file company_manager_face.h.
|
inline |
Increase/Decrease the company manager's face variable by the given amount.
The value wraps around to stay in the valid range.
cmf | The face to write the bits to. |
amount | the amount to change the value |
Definition at line 63 of file company_manager_face.h.
References GetBits(), SetBits(), and valid_values.
|
inline |
Gets the company manager's face bits.
cmf | The face to extract the bits from. |
Definition at line 42 of file company_manager_face.h.
References CompanyManagerFace::bits, and GB().
Referenced by ChangeBits(), and GetSprite().
|
inline |
Gets the sprite to draw.
cmf | The face to extract the data from |
Definition at line 104 of file company_manager_face.h.
References GetBits().
|
inline |
Checks whether the company manager's face bits have a valid range.
cmf | The face to check. |
Definition at line 81 of file company_manager_face.h.
References CompanyManagerFace::bits, GB(), and valid_values.
|
inline |
Scales a company manager's face bits variable to the correct scope.
vars | The face variables of the face style. |
Definition at line 92 of file company_manager_face.h.
References length.
|
inline |
Sets the company manager's face bits.
cmf | The face to write the bits to. |
val | The new value. |
Definition at line 52 of file company_manager_face.h.
References CompanyManagerFace::bits, and SB().
Referenced by ChangeBits().
std::variant<SpriteID, uint64_t, std::pair<uint64_t, uint64_t> > FaceVar::data |
The first sprite.
Definition at line 34 of file company_manager_face.h.
uint8_t FaceVar::length |
Number of bits used in the CompanyManagerFace.
Definition at line 32 of file company_manager_face.h.
Referenced by ScaleBits().
StringID FaceVar::name = STR_NULL |
Definition at line 35 of file company_manager_face.h.
uint8_t FaceVar::offset |
Offset in bits into the CompanyManagerFace.
Definition at line 31 of file company_manager_face.h.
uint8_t FaceVar::position |
Position in UI.
Definition at line 30 of file company_manager_face.h.
Referenced by SelectCompanyManagerFaceWindow::UpdateData().
FaceVarType FaceVar::type |
Definition at line 29 of file company_manager_face.h.
uint8_t FaceVar::valid_values |
The number of valid values.
Definition at line 33 of file company_manager_face.h.
Referenced by ChangeBits(), SelectCompanyManagerFaceWindow::DrawWidget(), and IsValid().