rodecomp/Source/UI/Acceptance/UIJoinPartyAcceptWnd.cpp
ragnarok-clanker 858265cc69 Maintenance: Second pass: name remaining numeric switch case labels (identifier-only; no code change). ~3,500 more labels across 150
Batch #14936 by ragnarok-clanker: no function's compiled code changes; checked with 158 compiled unit(s), including every includer of Source/Client/Mode/GameModeEnums.h, Source/Client/Mode/ModeMessage.h, Source/Contents/Actors/ActorEnums.h, Source/Contents/Actors/PetEnums.h, Source/Contents/Combat/CombatTypes.h, Source/Contents/Configuration/ServiceEnums.h, Source/Contents/Effects/EffectPrimId.h, Source/Contents/Hotkeys/InterfaceHotkey.h, Source/Contents/Items/ItemId.h, Source/Contents/Items/ItemType.h, Source/Network/Packets/ModeResultEnums.h, Source/Network/Packets/NoticeEnums.h, Source/Network/Packets/PacketId.h, Source/UI/Window/UIEnums.h, Source/UI/Window/WindowId.h.
2026-11-08 12:37:46 +00:00

92 lines
2.4 KiB
C++

#include "Client/Mode/CMode.h"
#include "UI/Window/UIEnums.h"
#include "Client/Mode/ModeMgr.h"
#include "Contents/MessageTable.h"
#include "Client/Mode/ModeEvents.h"
#include "Client/Replay.h"
#include "UI/Buttons/UIButton.h"
#include "UI/Acceptance/UIJoinPartyAcceptWnd.h"
#include "UI/Text/UITextViewer.h"
#include "UI/Window/UINewSelectCharWnd.h"
#include "UI/Window/WindowManagerWindows.h"
#include <cstring>
// OFFSET: 0x008C8240
// FUNCTION: fn_11950
UIJoinPartyAcceptWnd::UIJoinPartyAcceptWnd()
: UIExchangeAcceptWnd() {
}
UIJoinPartyAcceptWnd::~UIJoinPartyAcceptWnd() = default;
// OFFSET: 0x008FE780
// FUNCTION: fn_12353
int UIJoinPartyAcceptWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
switch (message) {
case UM_COMMAND:
this->RecordResponse(static_cast<int>(a), b, c, d);
switch (a) {
case ID_OK:
g_windowMgr.CloseWindow(35);
g_modeMgr.gameMode->SendMsg(60, this->identity, 1, 0, 0);
break;
case ID_CANCEL:
g_windowMgr.CloseWindow(35);
g_modeMgr.gameMode->SendMsg(60, this->identity, 0, 0, 0);
break;
}
return 0;
case UM_SET_JOIN_PARTY_MSG: {
this->identity = static_cast<std::uint32_t>(a);
std::string text = "(";
text += reinterpret_cast<const char*>(b);
text += ")";
text += LookupMessage(94);
this->viewer->Clear();
this->viewer->SendMsg(nullptr, 29, reinterpret_cast<std::intptr_t>(text.c_str()), 38, 0, 0);
return 0;
}
case 123: {
const auto* bytes = reinterpret_cast<const unsigned char*>(a);
std::uint16_t marker;
std::memcpy(&marker, bytes, sizeof(marker));
unsigned offset = 6;
if (marker == 21750) {
while (static_cast<unsigned>(b) > offset) {
std::int16_t kind;
std::uint32_t size;
std::memcpy(&kind, bytes + offset, sizeof(kind));
std::memcpy(&size, bytes + offset + 2, sizeof(size));
offset += 6;
switch (kind) {
case 21751:
return 0;
case 21752: {
char text[260] = {};
std::memcpy(text, bytes + offset, size);
offset += size;
this->SendMsg(nullptr, 56, 0, reinterpret_cast<std::intptr_t>(text), 0, 0);
break;
}
default:
offset += size;
break;
}
}
}
return 0;
}
default:
return this->UIFrameWnd::SendMsg(sender, message, a, b, c, d);
}
}