#include <tool.h>
Public Types | |
enum | BlendMode : u8 { BLEND_MODE_CONSTANT , BLEND_MODE_LINEAR , BlendMode_END } |
Public Member Functions | |
WearBarParams (const std::map< f32, video::SColor > &colorStops, BlendMode blend) | |
WearBarParams (const video::SColor color) | |
void | serialize (std::ostream &os) const |
void | serializeJson (std::ostream &os) const |
video::SColor | getWearBarColor (f32 durabilityPercent) |
Static Public Member Functions | |
static WearBarParams | deserialize (std::istream &is) |
static std::optional< WearBarParams > | deserializeJson (std::istream &is) |
Public Attributes | |
std::map< f32, video::SColor > | colorStops |
BlendMode | blend |
Static Public Attributes | |
constexpr static const EnumString | es_BlendMode [3] |
enum WearBarParams::BlendMode : u8 |
|
inline |
|
inline |
|
static |
References WearBarParams(), blend, BlendMode_END, colorStops, readARGB8(), readF32(), readU16(), and readU8().
Referenced by ItemDefinition::deSerialize().
|
static |
References WearBarParams(), blend, colorStops, es_BlendMode, parseColorString(), stof, and string_to_enum().
Referenced by ItemStackMetadata::updateWearBarParams().
video::SColor WearBarParams::getWearBarColor | ( | f32 | durabilityPercent | ) |
References blend, BLEND_MODE_CONSTANT, BLEND_MODE_LINEAR, BlendMode_END, and colorStops.
void WearBarParams::serialize | ( | std::ostream & | os | ) | const |
References blend, colorStops, writeARGB8(), writeF32(), writeU16(), and writeU8().
void WearBarParams::serializeJson | ( | std::ostream & | os | ) | const |
References blend, colorStops, encodeHexColorString(), es_BlendMode, fastWriteJson(), ftos(), and EnumString::str.
Referenced by ItemStackMetadata::setWearBarParams().
BlendMode WearBarParams::blend |
Referenced by deserialize(), deserializeJson(), getWearBarColor(), push_wear_bar_params(), serialize(), and serializeJson().
std::map<f32, video::SColor> WearBarParams::colorStops |
Referenced by deserialize(), deserializeJson(), getWearBarColor(), push_wear_bar_params(), serialize(), and serializeJson().
|
staticconstexpr |
Referenced by deserializeJson(), push_wear_bar_params(), read_wear_bar_params(), and serializeJson().