|
OpenTTD Source 20260129-master-g2bb01bd0e4
|
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 |
| Type of variable. | |
| 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 |
| Name of the configurable component of the face. | |
Information about the valid values of CompanyManagerFace bitgroups as well as the sprites to draw.
Definition at line 29 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 64 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 43 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 105 of file company_manager_face.h.
|
inline |
Checks whether the company manager's face bits have a valid range.
| cmf | The face to check. |
Definition at line 82 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 93 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 53 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 35 of file company_manager_face.h.
| uint8_t FaceVar::length |
Number of bits used in the CompanyManagerFace.
Definition at line 33 of file company_manager_face.h.
Referenced by ScaleBits().
| StringID FaceVar::name = STR_NULL |
Name of the configurable component of the face.
Definition at line 36 of file company_manager_face.h.
Referenced by SelectCompanyManagerFaceWindow::DrawWidget(), and FindFaceVar().
| uint8_t FaceVar::offset |
Offset in bits into the CompanyManagerFace.
Definition at line 32 of file company_manager_face.h.
| uint8_t FaceVar::position |
Position in UI.
Definition at line 31 of file company_manager_face.h.
Referenced by SelectCompanyManagerFaceWindow::UpdateData().
| FaceVarType FaceVar::type |
Type of variable.
Definition at line 30 of file company_manager_face.h.
Referenced by SelectCompanyManagerFaceWindow::DrawWidget(), and FindFaceVar().
| uint8_t FaceVar::valid_values |
The number of valid values.
Definition at line 34 of file company_manager_face.h.
Referenced by ChangeBits(), SelectCompanyManagerFaceWindow::DrawWidget(), and IsValid().