rodecomp/Source/UI/Window/UIFrameWnd.cpp
ragnarok-clanker 9aea62bd9b Decompile 47 functions in Source/Client/ClientOptions.cpp, Source/Client/Session.h, ...
Batch #1675 by ragnarok-clanker: 2 byte-identical, 45 confirmed by peer review.

- fn_10839 UIButton::Slot25: logic confirmed by peer review
- fn_10852 UIButton::Slot31: logic confirmed by peer review
- fn_10868 UIButton::Slot27: logic confirmed by peer review
- fn_10930 UIStaticBitmap::SetBitmap: logic confirmed by peer review
- fn_10931 UIBitmapButton::SetBitmap: logic confirmed by peer review
- fn_11320 UIComboBoxEx2::Slot15: logic confirmed by peer review
- fn_11326 UIListBox::Slot15: logic confirmed by peer review
- fn_11327 UIListBoxEx::Slot15: logic confirmed by peer review
- fn_11381 UIScrollBar::Paint: logic confirmed by peer review
- fn_11383 UIScrollBar_Navi::Paint: logic confirmed by peer review
- fn_11425 UIScrollBar::Slot25: logic confirmed by peer review
- fn_11440 UIScrollBar::Slot31: logic confirmed by peer review
- fn_11445 UITextButton::Slot31: logic confirmed by peer review
- fn_11468 UIScrollBar::Slot27: logic confirmed by peer review
- fn_11471 UITextButton::Slot27: logic confirmed by peer review
- fn_11494 UITextButton::Slot33: logic confirmed by peer review
- fn_11779 UIFrameWnd::Slot25: logic confirmed by peer review
- fn_11781 UIFrameWnd::Slot31: logic confirmed by peer review
- fn_11786 UIFrameWnd::Slot27: logic confirmed by peer review
- fn_12610 CSession::GetOption: logic confirmed by peer review
- fn_12689 ActivateShortcut: logic confirmed by peer review
- fn_12711 ShortcutTooltip::Hover: logic confirmed by peer review
- fn_12724 ShortcutDetails::Open: logic confirmed by peer review (already on main)
- fn_12760 UIShortCutWnd::SendMsg: logic confirmed by peer review
- fn_17144 UIWindowMgr::RemoveOrder: logic confirmed by peer review
- fn_17158 UIWindowMgr::Capture: byte-identical
- fn_17180 UIWindowMgr::BringToFront: logic confirmed by peer review
- fn_17192 UIWindowMgr::IsOrderFixed: logic confirmed by peer review
- fn_17232 UIWindowMgr::ReleaseCapture: byte-identical
- fn_17255 UIWindowMgr::SetCapture: logic confirmed by peer review
- fn_20382 CConnection::CConnection: logic confirmed by peer review
- fn_20383 CRagConnection::CRagConnection: logic confirmed by peer review
- fn_20384 CConnection::~CConnection: logic confirmed by peer review (already on main)
- fn_20389 CConnection::Connect: logic confirmed by peer review
- fn_20390 CConnection::Close: logic confirmed by peer review
- fn_20409 GetRagConnection: logic confirmed by peer review
- fn_21406 AutomaticSkills::Complete: logic confirmed by peer review
- fn_03927 CCharacterLinkedUserDataMgr::CompleteLoad: logic confirmed by peer review
- fn_03933 CCharacterLinkedUserDataMgr::Save: logic confirmed by peer review
- fn_03937 CSession::SetOption: logic confirmed by peer review
- fn_11073 UIScrollBar::UIScrollBar: logic confirmed by peer review
- fn_11102 UIComboBoxEx2::~UIComboBoxEx2: logic confirmed by peer review (already on main)
- fn_09150 AutomaticSkills::DisableAll: logic confirmed by peer review
- fn_09153 AutomaticSkills::Use: logic confirmed by peer review
- fn_10689 UIBitmapButton::~UIBitmapButton: logic confirmed by peer review (already on main)
- fn_10795 UIBitmapButton::Paint: logic confirmed by peer review
- fn_10817 UIStaticBitmap::Paint: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
2026-10-28 20:01:00 +00:00

216 lines
5.5 KiB
C++

#include "UI/Window/UIWindowMgr.h"
#include "UI/Layout/SnapMgr.h"
#include "UI/Buttons/UIBitmapButton.h"
#include "UI/Lists/UIReplayListBox.h"
#include "UI/Window/UINoticeWnd.h"
#include "UI/Window/UIFrameWnd.h"
#include "UI/Window/WindowManagerWindows.h"
#include "UI/Layout/WindowSnapping.h"
#include <cstdlib>
#include <windows.h>
#include <timeapi.h>
// OFFSET: 0x008A3700
// FUNCTION: fn_11657
UIFrameWnd::UIFrameWnd(UIWindowContext& windowContext, UIFrameContext& frameContext, unsigned char cached)
: UIWindow(windowContext, cached), m_dragX(0), m_dragY(0), m_message0(600), m_message1(600), m_frameContext(&frameContext) {
this->m_textCache.max_load_factor(1.0f);
this->m_textCache.rehash(8);
}
// OFFSET: 0x008A4E90
// OFFSET: 0x008A60E0
// FUNCTION: fn_11678
UIFrameWnd::~UIFrameWnd() = default;
// OFFSET: 0x005C4640
// FUNCTION: fn_03570
bool UIFrameWnd::Slot02() {
return true;
}
// OFFSET: 0x008AD150
// FUNCTION: fn_11735
void UIFrameWnd::Move(int x, int y) {
this->geometry.Move(x, y);
this->Slot36();
}
// OFFSET: 0x008BB3F0
// FUNCTION: fn_11797
void UIFrameWnd::Slot12() {
this->m_originX = this->geometry.x;
this->m_originY = this->geometry.y;
}
// OFFSET: 0x008AD170
// FUNCTION: fn_11736
void UIFrameWnd::Slot13(int dx, int dy) {
this->geometry.x = this->m_originX + dx;
this->geometry.y = this->m_originY + dy;
}
// OFFSET: 0x00A7D870
// FUNCTION: fn_16956
void UIFrameWnd::ToScreen(int& x, int& y) const {
x += this->geometry.x;
y += this->geometry.y;
for (const UIWindow* node = this->parent; node; node = node->parent) {
x += node->geometry.x;
y += node->geometry.y;
}
}
// OFFSET: 0x008BA1E0
// FUNCTION: fn_11779
void UIFrameWnd::Slot25(int x, int y) {
if (g_dragWindowId != this->geometry.id) {
g_windowMgr.BringToFront(this->geometry.id);
g_dragWindowId = this->geometry.id;
}
g_windowMgr.SetCapture(this);
this->ToScreen(x, y);
this->m_dragX = x;
this->m_dragY = y;
this->m_originX = this->geometry.x;
this->m_originY = this->geometry.y;
this->geometry.targetAlpha = 128;
this->geometry.alphaStart = timeGetTime();
this->m_frameContext->snapping.graph.CaptureOrigins(this);
}
// OFFSET: 0x008BA510
// FUNCTION: fn_11786
void UIFrameWnd::Slot27(int x, int y) {
if (g_windowMgr.Capture() != this || x <= -this->m_frameContext->dragLimitX || y <= -this->m_frameContext->dragLimitY) {
return;
}
this->ToScreen(x, y);
const int dx = x - this->m_dragX;
const int dy = y - this->m_dragY;
WindowSnapping& snapping = this->m_frameContext->snapping;
if (!snapping.graph.Contains(this)) {
this->Move(this->m_originX + dx, this->m_originY + dy);
return;
}
this->Slot13(dx, dy);
int ownX, ownY;
snapping.Constrain(this, ownX, ownY, 0);
int groupX = dx, groupY = dy;
snapping.graph.ConstrainGroup(this, groupX, groupY, snapping);
if (std::abs(groupX) < std::abs(ownX)) {
groupX = ownX;
}
if (std::abs(groupY) < std::abs(ownY)) {
groupY = ownY;
}
this->Slot13(dx + groupX, dy + groupY);
snapping.Store(this);
snapping.graph.MoveConnected(this, dx + groupX, dy + groupY, snapping);
}
// OFFSET: 0x008BA3C0
// FUNCTION: fn_11783
void UIFrameWnd::Slot28(int, int) {
}
// OFFSET: 0x008BA2C0
// FUNCTION: fn_11781
void UIFrameWnd::Slot31(int, int) {
if (g_windowMgr.Capture() != this) {
return;
}
g_dragWindowId = -1;
this->geometry.targetAlpha = 255;
this->geometry.alphaStart = timeGetTime();
g_windowMgr.ReleaseCapture();
this->m_frameContext->snapping.graph.Refresh(this);
}
// OFFSET: 0x008BB340
// FUNCTION: fn_11796
void UIFrameWnd::Slot36() {
WindowSnapping& snapping = this->m_frameContext->snapping;
int x, y;
snapping.Constrain(this, x, y, 0);
this->geometry.x += x;
this->geometry.y += y;
snapping.Store(this);
}
// OFFSET: 0x008BDC90
// FUNCTION: fn_11802
int UIFrameWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) {
if (message == 0 || message == 1) {
const int id = message == 0 ? this->m_message0 : this->m_message1;
if (id) {
this->SendMsg(this, 6, id, 0, 0, 0);
}
} else if (message == 98) {
if (c > 0) {
UIWindow* window = this->m_frameContext->windows.EnsureWindow(12);
if (window) {
window->SendMsg(nullptr, 24, c, 0, 0, 0);
}
}
} else {
return this->UIWindow::SendMsg(sender, message, a, b, c, d);
}
return 0;
}
// OFFSET: 0x005C4420
// FUNCTION: fn_03559
std::vector<std::uint32_t> UIFrameWnd::Slot44() {
return {};
}
// OFFSET: 0x005C44F0
// FUNCTION: fn_03562
int UIFrameWnd::Slot46() {
return 1;
}
// OFFSET: 0x008CF0C0
// FUNCTION: fn_12076
UIBitmapButton* UIFrameWnd::AddCloseButton(UIButtonContext& controls, const char* tooltip, int width) {
if (width == 0) {
width = this->geometry.width;
}
UIBitmapButton* button = new UIBitmapButton(*this->m_context, controls);
button->SetBitmap("유저인터페이스\\basic_interface\\sys_close_off.bmp", 0, 0);
button->SetBitmap("유저인터페이스\\basic_interface\\sys_close_on.bmp", 1, 0);
button->SetBitmap("유저인터페이스\\basic_interface\\sys_close_on.bmp", 2, 0);
button->SetSize(button->BitmapWidth(), button->BitmapHeight());
button->Move(width - 14, 3);
button->SetId(201);
button->SetTooltip(tooltip);
this->AddChild(button);
return button;
}
// OFFSET: 0x008BA280
// FUNCTION: fn_11780
void UIReplayListBox::Slot25(int x, int y) {
this->selected = this->LineAt(x, y);
this->Invalidate();
this->parent->SendMsg(nullptr, 80, 0, 0, 0, 0);
}
// OFFSET: 0x008BA500
// FUNCTION: fn_11785
void UINoticeWnd::Slot28(int, int) {
}