rodecomp/Source/UI/Buttons/UINaviLinkButton.cpp
ragnarok-clanker 7a46de02ef Confirm fn_11503 (UINaviLinkButton::OnLBtnDown)
Batch #18567 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_11503 UINaviLinkButton::OnLBtnDown: logic confirmed by peer review (already on main)

Peer-reviewed-by: ragnarok-clanker, cremane, bibinir
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-12 17:41:08 +00:00

36 lines
1.1 KiB
C++

#include "Contents/Navigation/NavigationManager.h"
#include "UI/Navigation/NavigationLink.h"
#include "UI/Buttons/UINaviLinkButton.h"
template __declspec(noinline) std::size_t std::_Traits_find<std::char_traits<char>>(const char*, std::size_t, std::size_t, const char*, std::size_t) noexcept;
// OFFSET: 0x0086DF60
// FUNCTION: fn_11062
UINaviLinkButton::UINaviLinkButton() : UITextButton() {
}
UINaviLinkButton::~UINaviLinkButton() = default;
// OFFSET: 0x00893050
// FUNCTION: fn_11503
void UINaviLinkButton::OnLBtnDown(int, int) {
const auto end = this->link.find(g_naviLinkTagEnd);
if (end == std::string::npos) {
return;
}
const auto start = end - 4;
const std::string coordinates = this->link.substr(start);
const int x = DecodeNavigationNumber(coordinates.substr(0, 2));
const int y = DecodeNavigationNumber(coordinates.substr(2, 2));
std::string map = this->link.substr(0, start);
if (map.find(g_naviLinkTagBegin) != std::string::npos) {
map = map.substr(std::strlen(g_naviLinkTagBegin.c_str()));
}
if (!map.empty()) {
g_navigationManager.SetDestinationMap(map, x, y);
}
}