0x00428DAB
| 450 | |
| 451 | // 0x00428DAB |
| 452 | static void remove(const MessageId id) |
| 453 | { |
| 454 | if (getGameState().activeMessageIndex != MessageId::null) |
| 455 | { |
| 456 | if (id == getGameState().activeMessageIndex) |
| 457 | { |
| 458 | clearActiveMessage(); |
| 459 | } |
| 460 | else if (enumValue(id) < enumValue(getGameState().activeMessageIndex)) |
| 461 | { |
| 462 | getGameState().activeMessageIndex = static_cast<MessageId>(enumValue(getGameState().activeMessageIndex) - 1); |
| 463 | } |
| 464 | } |
| 465 | setNumMessages(getNumMessages() - 1); |
| 466 | // Move element to end of array (this seems excessive you could just move to end of numMessages) |
| 467 | if (enumValue(id) < Limits::kMaxMessages - 1) |
| 468 | { |
| 469 | std::rotate(get(id), get(id) + 1, std::end(rawMessages())); |
| 470 | } |
| 471 | Ui::WindowManager::invalidate(Ui::WindowType::messages); |
| 472 | } |
| 473 | |
| 474 | // 0x0042851C |
| 475 | void removeAllSubjectRefs(const uint16_t subject, MessageItemArgumentType type) |