From dfa456d091f0fed09177e13298ebf060de3b7137 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 11 Nov 2026 13:04:28 +0000 Subject: [PATCH] Decompile fn_04314 (UIReputeWnd::Paint) Batch #17054 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_04314 UIReputeWnd::Paint: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Yommy, br4yan Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Repute/UIReputeWnd.cpp | 20 +++++++------------- Source/UI/Window/UIFrameWnd.cpp | 6 +++++- Source/UI/Window/WindowMouseHit.cpp | 10 +++++----- 3 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Source/UI/Repute/UIReputeWnd.cpp b/Source/UI/Repute/UIReputeWnd.cpp index 37da15078..23d614908 100644 --- a/Source/UI/Repute/UIReputeWnd.cpp +++ b/Source/UI/Repute/UIReputeWnd.cpp @@ -136,13 +136,11 @@ void UIReputeWnd::Paint() { DrawRectangleBorder(*this, 0, titleHeight - 1, this->geometry.width, this->geometry.height - barHeight - titleHeight + 2, 0xC6C6C6); DrawRectangleBorder(*this, 0, titleHeight, this->geometry.width, 1, 0); - if (Singleton::GetInstance()->m_waitingForPoints) { + if (Singleton::GetInstance()->m_waitingForPoints == true) { DrawRoundedBorder(*this, 225, 155, 190, 140, 0xCE9484); DrawFilledRoundedBorder(*this, 226, 156, 188, 138, 0xFFE7DE); DrawFilledRoundedBorder(*this, 231, 161, 178, 128, 0xFFFFFF); - CBitmapRes* bitmap = - static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\notice_poring.bmp"))); - this->DrawBitmap(288, 182, bitmap, true); + this->DrawBitmap(288, 182, static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\basic_interface\\notice_poring.bmp"))), true); this->DrawCenteredText(225, 260, LookupMessage(MSI_ENCHANT_TAB_GENERAL), 190, 0, 15, 0xC89482, 1); return; } @@ -160,7 +158,7 @@ void UIReputeWnd::Paint() { const int left = (i & 1) * 316; const int top = (i >> 1) * 86; - const char* background = info->updated ? "유저인터페이스\\Reputation\\bg_highlight.bmp" : "유저인터페이스\\Reputation\\bg_info.bmp"; + const char* background = info->updated == true ? "유저인터페이스\\Reputation\\bg_highlight.bmp" : "유저인터페이스\\Reputation\\bg_info.bmp"; CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(background))); this->DrawBitmap(left + 7, top + 50, bitmap, false); this->DrawTextAt(left + 12, top + 56, info->name.c_str(), 0, 0, 12, 0, 1, 0); @@ -169,13 +167,11 @@ void UIReputeWnd::Paint() { if (point < 0) { const std::int64_t value = -point; for (std::uint64_t k = 0; k < info->maxPointNegative / 1000; ++k) { - bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\Reputation\\light_empty.bmp"))); - this->DrawBitmap(left + 12 + static_cast(k) * 14, top + 72, bitmap, true); + this->DrawBitmap(left + 12 + static_cast(k) * 14, top + 72, static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\Reputation\\light_empty.bmp"))), true); } for (std::uint64_t k = 0; k < value / 1000; ++k) { - bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\Reputation\\light_red.bmp"))); - this->DrawBitmap(left + 12 + static_cast(k) * 14, top + 72, bitmap, true); + this->DrawBitmap(left + 12 + static_cast(k) * 14, top + 72, static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\Reputation\\light_red.bmp"))), true); } const std::uint64_t remain = value % 1000; @@ -183,13 +179,11 @@ void UIReputeWnd::Paint() { this->DrawRightAlignedText(left + 311, top + 114, FormatOwnedString(LookupMessage(MSI_GRADE_ENCHANT_ADDITIONAL_SOURCE_RESET), remain).c_str(), 0, 0, 12, 0, 1); } else { for (std::uint64_t k = 0; k < info->maxPointPositive / 1000; ++k) { - bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\Reputation\\light_empty.bmp"))); - this->DrawBitmap(left + 12 + static_cast(k) * 14, top + 72, bitmap, true); + this->DrawBitmap(left + 12 + static_cast(k) * 14, top + 72, static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\Reputation\\light_empty.bmp"))), true); } for (std::uint64_t k = 0; k < info->point / 1000; ++k) { - bitmap = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\Reputation\\light_blue.bmp"))); - this->DrawBitmap(left + 12 + static_cast(k) * 14, top + 72, bitmap, true); + this->DrawBitmap(left + 12 + static_cast(k) * 14, top + 72, static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\Reputation\\light_blue.bmp"))), true); } const std::uint64_t remain = info->point % 1000; diff --git a/Source/UI/Window/UIFrameWnd.cpp b/Source/UI/Window/UIFrameWnd.cpp index 56308e614..ae844ba30 100644 --- a/Source/UI/Window/UIFrameWnd.cpp +++ b/Source/UI/Window/UIFrameWnd.cpp @@ -118,7 +118,7 @@ void UIWindow::ToScreen(int& x, int& y) const { // INLINED static __forceinline void RaiseWindow(UIWindow* window) { - if (window && g_windowMgr.lastWindowId != window->geometry.id) { + if (g_windowMgr.lastWindowId != window->geometry.id) { g_windowMgr.BringToFront(window->geometry.id); g_windowMgr.lastWindowId = window->geometry.id; } @@ -127,6 +127,10 @@ static __forceinline void RaiseWindow(UIWindow* window) { // OFFSET: 0x008BA1E0 // FUNCTION: fn_11779 void UIFrameWnd::OnLBtnDown(int x, int y) { + if (this == nullptr) { + return; + } + RaiseWindow(this); g_windowMgr.SetCapture(this); int screenX = x; diff --git a/Source/UI/Window/WindowMouseHit.cpp b/Source/UI/Window/WindowMouseHit.cpp index 075c31a7e..80f4526bc 100644 --- a/Source/UI/Window/WindowMouseHit.cpp +++ b/Source/UI/Window/WindowMouseHit.cpp @@ -185,10 +185,9 @@ int UIWindowMgr::ProcessMouse() { this->deferredDeletion.clear(); for (auto account = this->closedMiniPartyIds.begin(); account != this->closedMiniPartyIds.end(); ++account) { - const int accountId = *account; for (auto entry = this->snapExcluded.begin(); entry != this->snapExcluded.end();) { UIWindow* window = *entry; - if (static_cast(PartyMember(static_cast(window)).accountId) == accountId) { + if (*account == static_cast(PartyMember(static_cast(window)).accountId)) { this->Destroy(window); entry = this->snapExcluded.erase(entry); } else { @@ -224,8 +223,6 @@ int UIWindowMgr::ProcessMouse() { int left; int top; WindowScreenPosition(this->inputWindow, left, top); - const int localX = x - left; - const int localY = y - top; if (g_mouse.buttons[0] == 1) { UIWindow* root = this->inputWindow->Root(); @@ -233,9 +230,12 @@ int UIWindowMgr::ProcessMouse() { PromoteWindow(this, root); } - this->inputWindow->OnLBtnDown(localX, localY); + this->inputWindow->OnLBtnDown(x - left, y - top); } + const int localX = x - left; + const int localY = y - top; + if (g_mouse.buttons[0] == 4 && (g_replayAnimationScaling == 0 || g_modeMgr.state == 0)) { this->inputWindow->OnLBtnDown(localX, localY); this->inputWindow->OnLBtnDblClk(localX, localY);