0x0046E07B
| 318 | |
| 319 | // 0x0046E07B |
| 320 | void loadCurrency() |
| 321 | { |
| 322 | const auto* currencyObject = ObjectManager::get<CurrencyObject>(); |
| 323 | if (currencyObject == nullptr) |
| 324 | { |
| 325 | return; |
| 326 | } |
| 327 | |
| 328 | const auto loadCurrencySymbol = [](const auto font, const auto imageId, const auto dstImageId, int offsetWidth) { |
| 329 | const auto* image = getG1Element(imageId); |
| 330 | if (image == nullptr) |
| 331 | { |
| 332 | return; |
| 333 | } |
| 334 | |
| 335 | auto* currencyElement = getG1Element(dstImageId); |
| 336 | if (currencyElement == nullptr) |
| 337 | { |
| 338 | return; |
| 339 | } |
| 340 | |
| 341 | Gfx::setCharacterWidth(font, U'£', image->width + offsetWidth); |
| 342 | *currencyElement = *image; |
| 343 | }; |
| 344 | |
| 345 | loadCurrencySymbol(Gfx::Font::small, currencyObject->objectIcon, ImageIds::characters_small_currency_sign, -1); |
| 346 | loadCurrencySymbol(Gfx::Font::medium_normal, currencyObject->objectIcon + 1, ImageIds::characters_medium_normal_currency_sign, -1); |
| 347 | loadCurrencySymbol(Gfx::Font::medium_bold, currencyObject->objectIcon + 2, ImageIds::characters_medium_bold_currency_sign, -1); |
| 348 | loadCurrencySymbol(Gfx::Font::large, currencyObject->objectIcon + 3, ImageIds::characters_large_currency_sign, 1); |
| 349 | |
| 350 | invalidateScreen(); |
| 351 | } |
| 352 | |
| 353 | // 0x00452457 |
| 354 | void loadPalette(uint32_t imageIndex, uint8_t modifier) |
no test coverage detected