From fe80e4579a70a4e2bdb850502f5f69ea95463d79 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 14:49:22 +0000 Subject: [PATCH] Decompile fn_12778 (UIRoMapWnd::DrawKafraMarkers) Batch #8179 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_12778 UIRoMapWnd::DrawKafraMarkers: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Yommy, secret Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/UI/Window/UIRoMapWnd.cpp | 43 +++++++++++++++++++++++++++++++++ Source/UI/Window/UIRoMapWnd.h | 1 + 2 files changed, 44 insertions(+) diff --git a/Source/UI/Window/UIRoMapWnd.cpp b/Source/UI/Window/UIRoMapWnd.cpp index 9707f8e5..f59f6129 100644 --- a/Source/UI/Window/UIRoMapWnd.cpp +++ b/Source/UI/Window/UIRoMapWnd.cpp @@ -605,6 +605,49 @@ void CKafraMoveMapServiceInfo::Update(UIRoMapWnd* wnd, float elapsed) { this->markers.clear(); } +// OFFSET: 0x00940510 +// FUNCTION: fn_12778 +void UIRoMapWnd::DrawKafraMarkers(float elapsed) { + if (!this) { + return; + } + + this->m_kafraMarkers.Update(this, elapsed); + this->m_kafraTop = 0; + this->m_kafraBottom = 0; + this->m_kafraLeft = 0; + this->m_kafraRight = 0; + if (this->m_kafraMarkers.markers.empty()) { + return; + } + + std::map targets; + const int count = static_cast(this->m_kafraMarkers.markers.size()); + for (int i = 0; i < count; ++i) { + RoMapMarker from = this->m_kafraMarkers.current; + RoMapMarker to = this->m_kafraMarkers.markers[i]; + targets.insert(std::pair(to.name, to)); + if (to.name.size() == 10 && std::memcmp(to.name.c_str(), "izlude.rsw", 10) == 0) { + from.centerX = static_cast(from.area.right); + to.centerX = to.width * 0.8f + static_cast(to.area.left); + to.centerY = static_cast(to.area.top); + } + + CTexture* head = g_texMgr.Load("mapArrow_head.bmp", 0, true, true, false); + CTexture* body = g_texMgr.Load("mapArrow_body.bmp", 1, true, true, false); + this->DrawArrow( + from.centerX, from.centerY, to.centerX, to.centerY, static_cast(from.area.left), static_cast(from.area.top), + static_cast(from.area.right), static_cast(from.area.bottom), static_cast(to.area.left), static_cast(to.area.top), + static_cast(to.area.right), static_cast(to.area.bottom), 10, body, 20, head, this->m_kafraMarkers.blend, 0xAAFFFFFF + ); + } + + this->DrawKafraIcon(static_cast(this->m_kafraMarkers.current.area.right), static_cast(this->m_kafraMarkers.current.area.top)); + for (std::map::iterator it = targets.begin(); it != targets.end(); ++it) { + this->DrawMapMarker(it->second, 1); + } +} + // OFFSET: 0x009409E0 // FUNCTION: fn_12779 void UIRoMapWnd::DrawMapMarker(const RoMapMarker& marker, unsigned char skipSelected) { diff --git a/Source/UI/Window/UIRoMapWnd.h b/Source/UI/Window/UIRoMapWnd.h index e1fbb4b2..e907e774 100644 --- a/Source/UI/Window/UIRoMapWnd.h +++ b/Source/UI/Window/UIRoMapWnd.h @@ -78,6 +78,7 @@ public: float startX, float startY, float endX, float endY, int stepWidth, int thickness, CTexture* body, int headSize, CTexture* head, float progress, std::uint32_t color, int offset ); + void DrawKafraMarkers(float elapsed); void DrawMapMarker(const RoMapMarker& marker, unsigned char skipSelected); void RefreshPartyRecords(); bool LocateRecord(WorldViewRecord& record);