rodecomp/Source/UI/Chat/ChatNotifications.cpp
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

45 lines
1.1 KiB
C++

#include "UI/Chat/ChatNotifications.h"
#include "UI/Shortcuts/ShortcutVisibility.h"
#include "UI/Text/TextWrapping.h"
#include "UI/Window/UIWindow.h"
#include <cstring>
#include <vector>
// OFFSET: 0x00AA9100
// FUNCTION: fn_17253
void ChatNotifications::Text(const char* text, std::uint32_t color, const char* extra, int value, bool alternate) {
if (this->restricted != 0 && !this->allowsRestricted) {
return;
}
if (color == 0) {
color = 0xFFFFFF;
}
if (this->chat) {
if (std::strcmp(text, "No Msg") != 0 && std::strcmp(text, "NO MSG") != 0) {
this->chat->SendMsg(nullptr, alternate ? 115 : 37, reinterpret_cast<std::intptr_t>(text), color, reinterpret_cast<std::intptr_t>(extra), value);
}
return;
}
std::vector<std::string> lines;
WrapPlainText(text, lines, 94, this->codePage, this->inlineCharset);
for (const auto& line : lines) {
this->queued.push_back({line, color});
}
}
// OFFSET: 0x00AA9100
// FUNCTION: fn_17253
void ChatNotifications::Refresh() {
this->shortcuts.Show(1);
if (this->chat) {
this->chat->SendMsg(nullptr, 16, 0, 0, 0, 0);
}
}