| 353 | } |
| 354 | |
| 355 | std::string GetWidgetString(WidgetID widget, StringID stringid) const override |
| 356 | { |
| 357 | switch (widget) { |
| 358 | case WID_CF_CAPTION: |
| 359 | return GetString(STR_FINANCES_CAPTION, this->window_number, this->window_number); |
| 360 | |
| 361 | case WID_CF_BALANCE_VALUE: { |
| 362 | const Company *c = Company::Get(this->window_number); |
| 363 | return GetString(STR_FINANCES_BANK_BALANCE, c->money); |
| 364 | } |
| 365 | |
| 366 | case WID_CF_LOAN_VALUE: { |
| 367 | const Company *c = Company::Get(this->window_number); |
| 368 | return GetString(STR_FINANCES_TOTAL_CURRENCY, c->current_loan); |
| 369 | } |
| 370 | |
| 371 | case WID_CF_OWN_VALUE: { |
| 372 | const Company *c = Company::Get(this->window_number); |
| 373 | return GetString(STR_FINANCES_TOTAL_CURRENCY, c->money - c->current_loan); |
| 374 | } |
| 375 | |
| 376 | case WID_CF_INTEREST_RATE: |
| 377 | return GetString(STR_FINANCES_INTEREST_RATE, _settings_game.difficulty.initial_interest); |
| 378 | |
| 379 | case WID_CF_MAXLOAN_VALUE: { |
| 380 | const Company *c = Company::Get(this->window_number); |
| 381 | return GetString(STR_FINANCES_MAX_LOAN, c->GetMaxLoan()); |
| 382 | } |
| 383 | |
| 384 | case WID_CF_INCREASE_LOAN: |
| 385 | return GetString(STR_FINANCES_BORROW_BUTTON, LOAN_INTERVAL); |
| 386 | |
| 387 | case WID_CF_REPAY_LOAN: |
| 388 | return GetString(STR_FINANCES_REPAY_BUTTON, LOAN_INTERVAL); |
| 389 | |
| 390 | default: |
| 391 | return this->Window::GetWidgetString(widget, stringid); |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override |
| 396 | { |
nothing calls this directly
no test coverage detected