rodecomp/Source/UI/UIPreviewEquipWnd.cpp
ragnarok-clanker 7385c5b790 Decompile fn_09883 (UIPreviewEquipWnd::Paint)
Batch #5772 by willerthal: 0 byte-identical, 1 confirmed by peer review.

- fn_09883 UIPreviewEquipWnd::Paint: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, Yommy, SapitoSucio
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-10-30 15:32:28 +00:00

147 lines
4.4 KiB
C++

#include "UI/UIPreviewEquipWnd.h"
#include "Client/Session.h"
#include "Contents/Actors/CharacterRender.h"
#include "Contents/Items/ItemInfo.h"
#include "Contents/UserData/NormalItemSlots.h"
#include "Render/Renderer.h"
#include "UI/Window/FuncDrawWNDChar.h"
#include "Utility/Math/AffineMatrix.h"
// OFFSET: 0x007F2F90
// FUNCTION: fn_09879
UIPreviewEquipWnd::UIPreviewEquipWnd(UIWindowContext& windows, UIFrameContext& frames)
: UIFrameWnd(windows, frames, 1), saved(nullptr), m_render(nullptr), m_leftButton(nullptr), m_rightButton(nullptr), unknown_00C4(0) {
}
// OFFSET: 0x007F3090
// FUNCTION: fn_09880
UIPreviewEquipWnd::~UIPreviewEquipWnd() {
delete this->m_render;
}
// OFFSET: 0x007F3590
// OFFSET: 0x007F3CD0
// FUNCTION: fn_09883
void UIPreviewEquipWnd::Paint() {
this->SetSolid(this->m_context->primitives, this->geometry.width, this->geometry.height, 0);
this->DrawNamed(this->m_context->primitives, 0, 0, "유저인터페이스\\equip_preview\\bg_mounting2.bmp", 0xffffffff, 0, 0);
void (UIPreviewEquipWnd::*draw)() = &UIPreviewEquipWnd::DrawCharacter;
(this->*draw)();
}
// OFFSET: 0x007F43E0
// FUNCTION: fn_09887
void UIPreviewEquipWnd::RefreshHeadgearLocations() {
if (this->m_render->unknown_0028) {
ITEM_INFO equipped = g_session.GetItem17F0(0);
if (this->m_render->unknown_0028 == equipped.unknown_0070) {
this->m_render->unknown_0034 = 1;
if (equipped.unknown_0000[2] == 0x301) {
this->m_render->unknown_0034 = 0x301;
this->m_render->unknown_0038 = 0x301;
this->m_render->unknown_003C = 0x301;
}
}
ITEM_INFO costume = g_session.GetItem2B50(0);
if (this->m_render->unknown_0028 == costume.unknown_0070) {
this->m_render->unknown_0034 = 1;
if (costume.unknown_0000[2] == 0x1C00) {
this->m_render->unknown_0034 = 0x301;
this->m_render->unknown_0038 = 0x301;
this->m_render->unknown_003C = 0x301;
}
}
}
if (this->m_render->unknown_002C) {
ITEM_INFO equipped = g_session.GetItem17F0(8);
if (this->m_render->unknown_002C == equipped.unknown_0070) {
if (equipped.unknown_0000[2] == 0x100) {
this->m_render->unknown_0038 = 0x100;
}
if (equipped.unknown_0000[2] == 0x101) {
this->m_render->unknown_0038 = 0x101;
this->m_render->unknown_0034 = 0x101;
}
if (equipped.unknown_0000[2] == 0x300) {
this->m_render->unknown_0038 = 0x300;
this->m_render->unknown_003C = 0x300;
}
if (equipped.unknown_0000[2] == 0x301) {
this->m_render->unknown_0034 = 0x301;
this->m_render->unknown_0038 = 0x301;
this->m_render->unknown_003C = 0x301;
}
}
ITEM_INFO costume = g_session.GetItem2B50(8);
if (this->m_render->unknown_002C == costume.unknown_0070) {
if (costume.unknown_0000[2] == 0x400) {
this->m_render->unknown_0038 = 0x100;
}
if (costume.unknown_0000[2] == 0x1400) {
this->m_render->unknown_0038 = 0x101;
this->m_render->unknown_0034 = 0x101;
}
if (costume.unknown_0000[2] == 0xC00) {
this->m_render->unknown_0038 = 0x300;
this->m_render->unknown_003C = 0x300;
}
if (costume.unknown_0000[2] == 0x1C00) {
this->m_render->unknown_0034 = 0x301;
this->m_render->unknown_0038 = 0x301;
this->m_render->unknown_003C = 0x301;
}
}
}
if (this->m_render->unknown_0030) {
ITEM_INFO equipped = g_session.GetItem17F0(9);
if (this->m_render->unknown_0030 == equipped.unknown_0070) {
if (equipped.unknown_0000[2] == 0x200) {
this->m_render->unknown_003C = 0x200;
}
if (equipped.unknown_0000[2] == 0x201) {
this->m_render->unknown_003C = 0x201;
this->m_render->unknown_0034 = 0x201;
}
}
ITEM_INFO costume = g_session.GetItem2B50(9);
if (this->m_render->unknown_0030 == costume.unknown_0070) {
if (costume.unknown_0000[2] == 0x800) {
this->m_render->unknown_003C = 0x200;
}
if (costume.unknown_0000[2] == 0x1800) {
this->m_render->unknown_003C = 0x201;
this->m_render->unknown_0034 = 0x201;
}
}
}
}
// OFFSET: 0x007F4830
// FUNCTION: fn_09888
void UIPreviewEquipWnd::Slot11() {
if (this->saved) {
this->saved->x = this->geometry.x;
this->saved->y = this->geometry.y;
}
}
// OFFSET: 0x007F3DB0
// FUNCTION: fn_09884
void UIPreviewEquipWnd::Slot19() {
this->Invalidate();
}