* Set the value of the money effect */
| 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 | * |
no test coverage detected