From 0c4287947ff298fff450dc47a6a8229f6dcfe2bf Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 06:34:06 +0000 Subject: [PATCH] Decompile 5 functions in Source/UI/Window/UIFrameWnd.cpp, Source/UI/Window/UIFrameWnd.h, ... Batch #4953 by youko: 0 byte-identical, 5 confirmed by peer review. - fn_12070 UIMenuWnd::AddItem: logic confirmed by peer review - fn_12073 UITipboxWnd::ShowTip: logic confirmed by peer review - fn_12083 UIExchangeWnd::Slot10: logic confirmed by peer review - fn_12084 UInCashWnd::Slot10: logic confirmed by peer review - fn_12090 UISkillDescribeWnd::Slot43: logic confirmed by peer review Peer-reviewed-by: eAthena, alisonrag, KWDev Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Acceptance/UIChooseSellBuyWnd.cpp | 78 +++++++++++++++++++++ Source/UI/Buttons/UICheckBox.h | 1 + Source/UI/Dialogs/UIMenuWnd.h | 3 +- Source/UI/Dialogs/UITipboxWnd.h | 1 + Source/UI/Items/UIExchangeWnd.h | 1 + Source/UI/Shop/UInCash_CallWnd.h | 1 + Source/UI/Skill/UISkillDescribeWnd.h | 1 + Source/UI/Window/UIFrameWnd.cpp | 15 ++++ Source/UI/Window/UIFrameWnd.h | 11 +++ Source/UI/WindowOverlay.cpp | 9 +++ 10 files changed, 120 insertions(+), 1 deletion(-) diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index d95caff6..acd9d3e9 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -11,9 +11,11 @@ #include "Contents/Configuration/ServiceConfiguration.h" #include "Contents/Items/ItemDescription.h" #include "Contents/MessageTable.h" +#include "Contents/TipBoxTitles.h" #include "Client/Mode/ModeMgr.h" #include "Client/Mode/CGameMode.h" #include "Client/Mode/ModeEvents.h" +#include "Client/Mode/ModeDragState.h" #include "Client/Replay.h" #include "Client/ReplayPacketRecorder.h" #include "Render/DeviceContext/DeviceContext.h" @@ -67,6 +69,7 @@ #include "UI/Lists/UIComboBoxWnd.h" #include "UI/Lists/UIListBox.h" #include "UI/Party/UIPartySettingWnd.h" +#include "UI/Shortcuts/ShortcutVisibility.h" #include "UI/Shop/ItemDrawing.h" #include "UI/Shop/UInCash_CallWnd.h" #include "UI/Skill/UISkillDescribeWnd.h" @@ -1078,6 +1081,81 @@ ITEM_INFO UIItemParamChangeDisplayWnd::FindEquippedItem(int location) { return ITEM_INFO(0); } +// OFFSET: 0x008CEA60 +// FUNCTION: fn_12070 +void UIMenuWnd::AddItem(const char* text, const std::uint32_t& color) { + this->m_items.push_back(text); + this->m_colors.push_back(color); +} + +// OFFSET: 0x008CEED0 +// FUNCTION: fn_12073 +void UITipboxWnd::ShowTip(int id) { + g_itemTagOwner->SelectTip(id); + this->SendMsg(this, 6, 543, 0, 0, 0); + reinterpret_cast(g_windowMgr).Promote(this); +} + +// OFFSET: 0x008D0230 +// FUNCTION: fn_12083 +void UIExchangeWnd::Slot10(int x, int y, std::intptr_t value) { + CMode* mode = g_modeMgr.GetGameMode(); + if (this->unknown_00CC != 0) { + mode->SendMsg(18, 0, 0, 0, 0); + return; + } + + const ModeDragState* drag = reinterpret_cast(value); + if (drag->source != 1) { + mode->SendMsg(18, 0, 0, 0, 0); + return; + } + + if (drag->quantity == 1) { + this->SendMsg(nullptr, 38, 0, 0, 0, 0); + return; + } + + reinterpret_cast(g_windowMgr).Show(15, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, 13, 5, 0, 0, 0); +} + +// OFFSET: 0x008D02D0 +// FUNCTION: fn_12084 +void UInCashWnd::Slot10(int x, int y, std::intptr_t value) { + if (g_windowMgr.LookupWindow(10011)) { + UIWindow::Slot10(x, y, value); + return; + } + + CMode* mode = g_modeMgr.GetGameMode(); + const ModeDragState* drag = reinterpret_cast(value); + switch (drag->source) { + case 4: + if (x < 445) { + const int quantity = g_session.GetItem1720QuantityByItemId(drag->name.c_str()); + if (quantity < 2) { + this->SendMsg(nullptr, 38, 0, 0, 0, 0); + return; + } + + reinterpret_cast(g_windowMgr).Show(15, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, 13, 20, quantity, 0, 0); + return; + } + break; + case 6: + if (x > 444) { + reinterpret_cast(g_windowMgr).Show(15, 1); + g_windowMgr.window_01EC->SendMsg(nullptr, 13, 19, 0, 0, 0); + return; + } + break; + } + + mode->SendMsg(18, 0, 0, 0, 0); +} + // OFFSET: 0x008D9F00 // FUNCTION: fn_12137 bool UISkillDescribeWnd::Slot42(void*) { diff --git a/Source/UI/Buttons/UICheckBox.h b/Source/UI/Buttons/UICheckBox.h index d8256a4e..c5f433f3 100644 --- a/Source/UI/Buttons/UICheckBox.h +++ b/Source/UI/Buttons/UICheckBox.h @@ -5,6 +5,7 @@ class UICheckBox : public UIWindow { friend class CMergeItemWnd; + friend class UIFrameWnd; public: UICheckBox(UIWindowContext& windowContext, UIButtonContext& controls); diff --git a/Source/UI/Dialogs/UIMenuWnd.h b/Source/UI/Dialogs/UIMenuWnd.h index c7efb99e..c2705625 100644 --- a/Source/UI/Dialogs/UIMenuWnd.h +++ b/Source/UI/Dialogs/UIMenuWnd.h @@ -15,7 +15,7 @@ public: /* 00BC */ int m_itemHeight; /* 00C0 */ std::vector m_items; /* 00CC */ std::uint32_t unknown_00CC; - /* 00D0 */ std::uint32_t* m_colors; + /* 00D0 */ std::vector m_colors; void Move(int x, int y) override; void Slot15(int width, int height) override; @@ -24,6 +24,7 @@ public: void Slot28(int x, int y) override; void Slot31(int x, int y) override; + void AddItem(const char* text, const std::uint32_t& color); int ItemAt(int x, int y); protected: diff --git a/Source/UI/Dialogs/UITipboxWnd.h b/Source/UI/Dialogs/UITipboxWnd.h index 7853e10c..12915769 100644 --- a/Source/UI/Dialogs/UITipboxWnd.h +++ b/Source/UI/Dialogs/UITipboxWnd.h @@ -7,6 +7,7 @@ class UITipboxWnd : public UIFrameWnd { public: + void ShowTip(int id); void TrimAt(std::string& text, const char* marker); }; diff --git a/Source/UI/Items/UIExchangeWnd.h b/Source/UI/Items/UIExchangeWnd.h index c0a13990..4e333c91 100644 --- a/Source/UI/Items/UIExchangeWnd.h +++ b/Source/UI/Items/UIExchangeWnd.h @@ -14,6 +14,7 @@ public: /* 00D4 */ unsigned char unknown_00D4[0x04]; /* 00D8 */ int unknown_00D8; + void Slot10(int x, int y, std::intptr_t value) override; void Slot35(int delta) override; void LayoutButtons(); diff --git a/Source/UI/Shop/UInCash_CallWnd.h b/Source/UI/Shop/UInCash_CallWnd.h index 9034157b..57c21cc6 100644 --- a/Source/UI/Shop/UInCash_CallWnd.h +++ b/Source/UI/Shop/UInCash_CallWnd.h @@ -8,6 +8,7 @@ struct WindowPlacement; class UInCashWnd : public UIFrameWnd { public: bool Slot03() override; + void Slot10(int x, int y, std::intptr_t value) override; void Slot11() override; /* 00B4 */ unsigned char unknown_00B4[0x4C]; diff --git a/Source/UI/Skill/UISkillDescribeWnd.h b/Source/UI/Skill/UISkillDescribeWnd.h index 952b7795..6cd024ff 100644 --- a/Source/UI/Skill/UISkillDescribeWnd.h +++ b/Source/UI/Skill/UISkillDescribeWnd.h @@ -10,6 +10,7 @@ public: void Paint() override; bool Slot42(void* output) override; + void Slot43() override; }; #endif diff --git a/Source/UI/Window/UIFrameWnd.cpp b/Source/UI/Window/UIFrameWnd.cpp index 92d6c8a4..ad6e482f 100644 --- a/Source/UI/Window/UIFrameWnd.cpp +++ b/Source/UI/Window/UIFrameWnd.cpp @@ -1,6 +1,7 @@ #include "UI/Window/UIWindowMgr.h" #include "UI/Layout/SnapMgr.h" #include "UI/Buttons/UIBitmapButton.h" +#include "UI/Buttons/UICheckBox.h" #include "UI/Buttons/UIReplayButton.h" #include "UI/Acceptance/UIJoinPartyAcceptWnd.h" #include "UI/Edit/UIEditCtrl.h" @@ -196,6 +197,10 @@ int UIFrameWnd::Slot46() { return 1; } +// OFFSET: 0x008CEF10 + +// OFFSET: 0x008CEFD0 + // OFFSET: 0x008CF0C0 // FUNCTION: fn_12076 UIBitmapButton* UIFrameWnd::AddCloseButton(UIButtonContext& controls, const char* tooltip, int width) { @@ -216,6 +221,16 @@ UIBitmapButton* UIFrameWnd::AddCloseButton(UIButtonContext& controls, const char return button; } +// OFFSET: 0x008CF2A0 + +// OFFSET: 0x008CF390 + +// OFFSET: 0x008CF870 + +// OFFSET: 0x008CFE50 + +// OFFSET: 0x008CFF40 + // OFFSET: 0x008BA280 // FUNCTION: fn_11780 void UIReplayListBox::Slot25(int x, int y) { diff --git a/Source/UI/Window/UIFrameWnd.h b/Source/UI/Window/UIFrameWnd.h index aec82f63..ac233233 100644 --- a/Source/UI/Window/UIFrameWnd.h +++ b/Source/UI/Window/UIFrameWnd.h @@ -7,6 +7,7 @@ struct WindowSnapping; class WindowManagerWindows; class UIBitmapButton; +class UICheckBox; struct UIButtonContext; struct UIFrameContext { @@ -33,6 +34,16 @@ public: std::vector Slot44() override; int Slot46() override; UIBitmapButton* AddCloseButton(UIButtonContext& controls, const char* tooltip, int width); + UIBitmapButton* AddBaseButton(UIButtonContext& controls); + UIBitmapButton* AddBigCloseButton(UIButtonContext& controls, const char* tooltip, int width); + UIBitmapButton* AddMinimizeButton(UIButtonContext& controls, const char* tooltip, int width); + UIBitmapButton* AddBitmapButton(UIButtonContext& controls, int id, int x, int y, const char* name, const char* tooltip); + UIBitmapButton* AddNumberedButton(UIButtonContext& controls, int id, int x, int y, const char* name, const char* tooltip, bool prefix); + UICheckBox* AddStyledCheckBox( + UIButtonContext& controls, int id, int width, int height, const char* text, int x, int y, bool checked, const char* tooltip, int fontHeight, + std::uint32_t color, const char* checkedImage, const char* uncheckedImage + ); + UICheckBox* AddCheckBox(UIButtonContext& controls, int id, int width, int height, const char* text, int x, int y, int checked, const char* tooltip); void DrawBorder(int x, int y, int width, int height); protected: diff --git a/Source/UI/WindowOverlay.cpp b/Source/UI/WindowOverlay.cpp index da100d58..691ed4f4 100644 --- a/Source/UI/WindowOverlay.cpp +++ b/Source/UI/WindowOverlay.cpp @@ -2,6 +2,15 @@ #include "Render/Renderer.h" #include "Render/TextureQuad.h" #include "UI/Chat/UIWhisperWnd.h" +#include "UI/Skill/UISkillDescribeWnd.h" + +// OFFSET: 0x008D0D80 +// FUNCTION: fn_12090 +void UISkillDescribeWnd::Slot43() { + int x = 0; + int y = 0; + this->ToScreen(x, y); +} // OFFSET: 0x008D0DB0 // FUNCTION: fn_12091