MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / SetValue

Method SetValue

src/openrct2/entity/MoneyEffect.cpp:94–113  ·  view source on GitHub ↗

* Set the value of the money effect */

Source from the content-addressed store, hash-verified

92 * Set the value of the money effect
93 */
94 void MoneyEffect::SetValue(money64 newValue)
95 {
96 value = newValue;
97 spriteData.width = 64;
98 spriteData.heightMin = 20;
99 spriteData.heightMax = 30;
100 moveDelay = 0;
101 numMovements = 0;
102
103 int16_t newOffsetX = 0;
104 if (!gOpenRCT2NoGraphics)
105 {
106 auto [stringId, pairValue] = GetStringId();
107 char buffer[128];
108 FormatStringLegacy(buffer, 128, stringId, &pairValue);
109 newOffsetX = -(Drawing::getStringWidth(buffer, FontStyle::medium) / 2);
110 }
111 offsetX = newOffsetX;
112 wiggle = 0;
113 }
114
115 /**
116 *

Callers 2

value_setMethod · 0.80
CreateAtMethod · 0.80

Calls 2

FormatStringLegacyFunction · 0.85
getStringWidthFunction · 0.85

Tested by

no test coverage detected