0x00440A74 company : updatingCompanyId global loc : ax, cx, dx amount : ebx
| 97 | // loc : ax, cx, dx |
| 98 | // amount : ebx |
| 99 | MoneyEffect* MoneyEffect::create(const World::Pos3& loc, const CompanyId company, const currency32_t amount) |
| 100 | { |
| 101 | if (SceneManager::isTitleMode()) |
| 102 | { |
| 103 | return nullptr; |
| 104 | } |
| 105 | |
| 106 | auto* m = static_cast<MoneyEffect*>(EntityManager::createEntityMoney()); |
| 107 | if (m != nullptr) |
| 108 | { |
| 109 | m->amount = amount; |
| 110 | m->spriteWidth = 64; |
| 111 | m->spriteHeightNegative = 20; |
| 112 | m->spriteHeightPositive = 30; |
| 113 | m->baseType = EntityBaseType::effect; |
| 114 | m->var_2E = company; |
| 115 | m->setSubType(EffectType::windowCurrency); |
| 116 | m->frame = 0; |
| 117 | m->numMovements = 0; |
| 118 | m->moveTo(loc); |
| 119 | |
| 120 | StringId strFormat = (amount < 0) ? StringIds::format_currency_expense_red_negative : StringIds::format_currency_income_green; |
| 121 | char buffer[255] = {}; |
| 122 | FormatArguments args{}; |
| 123 | args.push(amount); |
| 124 | StringManager::formatString(buffer, strFormat, args); |
| 125 | |
| 126 | m->offsetX = -Gfx::TextRenderer::getStringWidth(Gfx::Font::medium_bold, buffer) / 2; |
| 127 | m->wiggle = 0; |
| 128 | } |
| 129 | return m; |
| 130 | } |
| 131 | |
| 132 | } |
nothing calls this directly
no test coverage detected