From 76264ff4927ea0f445a7adccb060f0d4110cdd0f Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 01:24:44 +0000 Subject: [PATCH] Decompile 3 functions in Source/UI/Acceptance/UIChooseSellBuyWnd.cpp, Source/UI/Dialogs/UISayDialogWnd.h, ... Batch #6587 by superintelligence: 0 byte-identical, 3 confirmed by peer review. - fn_12071 UIItemTagCtrl::MeasureText: logic confirmed by peer review - fn_12197 UISayDialogWnd::Slot15: logic confirmed by peer review - fn_12362 UINotifyJobLevelUpWnd::SendMsg: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, SapitoSucio, pedrao, 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 | 37 +++++++++++++++++++++ Source/UI/Dialogs/UINotifyJobLevelUpWnd.h | 11 ++++++ Source/UI/Dialogs/UISayDialogWnd.h | 5 ++- Source/UI/Edit/UIItemTagCtrl.h | 1 + 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 Source/UI/Dialogs/UINotifyJobLevelUpWnd.h diff --git a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp index 6f027bad..178e5352 100644 --- a/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp +++ b/Source/UI/Acceptance/UIChooseSellBuyWnd.cpp @@ -34,6 +34,7 @@ #include "UI/Buttons/UISpriteButton.h" #include "UI/Chat/UIWhisperWnd.h" #include "UI/Edit/UIEditCtrl.h" +#include "UI/Edit/UIItemTagCtrl.h" #include "UI/Dialogs/UIBookWnd.h" #include "UI/Dialogs/UIChooseWarpWnd.h" #include "UI/Dialogs/UIChooseWnd.h" @@ -46,6 +47,7 @@ #include "UI/Dialogs/UINoticeConfirmWnd.h" #include "UI/Dialogs/UINpcEditDialogWnd.h" #include "UI/Dialogs/UIPasswordWnd.h" +#include "UI/Dialogs/UINotifyJobLevelUpWnd.h" #include "UI/Dialogs/UINotifyLevelUpWnd.h" #include "UI/Dialogs/UINotifyQuestWnd.h" #include "UI/Dialogs/UIPetTamingDeceiveWnd.h" @@ -78,6 +80,7 @@ #include "UI/Text/ColoredText.h" #include "UI/Text/PixelTextWrapping.h" #include "UI/Text/UIStaticText.h" +#include "UI/Text/UITagTextViewer.h" #include "UI/Text/UITextViewer.h" #include "UI/Window/InputFocus.h" #include "UI/Window/UIMonsterDisplayWnd.h" @@ -2439,3 +2442,37 @@ int UILoadingWnd::SendMsg(UIWindow*, int message, std::intptr_t argument1, std:: } return 0; } + +// OFFSET: 0x008CED00 +// FUNCTION: fn_12071 +int UIItemTagCtrl::MeasureText(const std::string& text, const unsigned& bytes) { + return this->TextWidth(this->m_context->fonts, this->m_context->locale, text.c_str(), bytes, 0, 12, 0, 0); +} + +// OFFSET: 0x008E8390 +// FUNCTION: fn_12197 +void UISayDialogWnd::Slot15(int width, int height) { + auto* viewer = new UITagTextViewer(*this->m_context); + this->m_viewer = viewer; + viewer->SetSize(width - 20, height - 40); + viewer->m_backgroundColor = 0xFFF2F2F2; + viewer->Invalidate(); + viewer->m_textWidth = width - 65; + viewer->Move(10, 10); + this->AddChild(viewer); + this->m_message0 = 600; + this->unknown_00CC = 0; + this->unknown_00D4 = 0; +} + +// OFFSET: 0x008FFBA0 +// FUNCTION: fn_12362 +int UINotifyJobLevelUpWnd::SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) { + if (message != 6) { + return UIWindow::SendMsg(sender, message, a, b, c, d); + } + if (a == 192) { + reinterpret_cast(g_windowMgr).Promote(g_windowMgr.EnsureWindow(37)); + } + return 0; +} diff --git a/Source/UI/Dialogs/UINotifyJobLevelUpWnd.h b/Source/UI/Dialogs/UINotifyJobLevelUpWnd.h new file mode 100644 index 00000000..b7995e9d --- /dev/null +++ b/Source/UI/Dialogs/UINotifyJobLevelUpWnd.h @@ -0,0 +1,11 @@ +#ifndef RAGNAROK_SOURCE_UI_DIALOGS_UINOTIFYJOBLEVELUPWND_H +#define RAGNAROK_SOURCE_UI_DIALOGS_UINOTIFYJOBLEVELUPWND_H + +#include "UI/Window/UIFrameWnd.h" + +class UINotifyJobLevelUpWnd : public UIFrameWnd { +public: + int SendMsg(UIWindow* sender, int message, std::intptr_t a, std::intptr_t b, std::intptr_t c, std::intptr_t d) override; +}; + +#endif diff --git a/Source/UI/Dialogs/UISayDialogWnd.h b/Source/UI/Dialogs/UISayDialogWnd.h index 0704c7c4..4050e038 100644 --- a/Source/UI/Dialogs/UISayDialogWnd.h +++ b/Source/UI/Dialogs/UISayDialogWnd.h @@ -11,9 +11,12 @@ class UISayDialogWnd : public UIFrameWnd { public: /* 00B4 */ UIWindow* m_viewer; /* 00B8 */ std::list m_buttons; - /* 00C0 */ unsigned char unknown_00C0[0x10]; + /* 00C0 */ unsigned char unknown_00C0[0x0C]; + /* 00CC */ int unknown_00CC; /* 00D0 */ WindowPlacement* m_placement; + /* 00D4 */ int unknown_00D4; + void Slot15(int width, int height) override; void Resize(int width, int height) override; void Slot11() override; void Slot19() override; diff --git a/Source/UI/Edit/UIItemTagCtrl.h b/Source/UI/Edit/UIItemTagCtrl.h index 37b71282..c25e9db4 100644 --- a/Source/UI/Edit/UIItemTagCtrl.h +++ b/Source/UI/Edit/UIItemTagCtrl.h @@ -15,6 +15,7 @@ public: virtual bool CanInsertTag(const std::string& name, int width); std::string AppendTag(const std::string& name); + int MeasureText(const std::string& text, const unsigned& bytes); bool SyncTagsWithText(); void SetTaggedText(const std::string& text, int width); void sub_89CFE0(const ITEM_INFO& item, unsigned int color);