Decompile 31 functions in Source/Contents/NavigationManager.h, Source/Contents/NavigationRequest.cpp, ...

Batch #1503 by ragnarok-clanker: 12 byte-identical, 19 confirmed by peer review.

- fn_19461 CNavi_Object::GetFlag: logic confirmed by peer review
- fn_19474 CNavi_Object::GetTitle: byte-identical
- fn_19476 CNaviInfo::GetTitle: byte-identical
- fn_19477 CNavi_Object::GetName: byte-identical
- fn_19484 CNavi_Object::GetCell: logic confirmed by peer review
- fn_19485 CNaviInfo::GetName: byte-identical
- fn_19488 CNavi_Object::GetIndex: byte-identical
- fn_19493 CNavi_Object::GetType: byte-identical
- fn_19495 CNavi_Object::GetId: byte-identical
- fn_19498 CNavi_Object::GetInfo: byte-identical
- fn_19376 CNavigationManager::FindObject: logic confirmed by peer review
- fn_19378 CNaviData::GetCell: logic confirmed by peer review
- fn_19380 CNaviData::GetInfo: byte-identical
- fn_19430 CNavi_Object::~CNavi_Object: logic confirmed by peer review
- fn_19434 CNaviInfo::HasName: logic confirmed by peer review
- fn_19604 CNavigationManager::SelectedNodeText: logic confirmed by peer review
- fn_19605 CNavigationManager::SubDestinationText: logic confirmed by peer review
- fn_19606 CNavigationManager::DestinationText: logic confirmed by peer review
- fn_19607 CNavigationManager::DestinationTitle: logic confirmed by peer review
- fn_19613 CNavigationManager::LoadSettings: logic confirmed by peer review
- fn_19618 CNavigationManager::FitToSquare: logic confirmed by peer review
- fn_45449 CNaviData::Clear: logic confirmed by peer review
- fn_19588 CNavigationManager::GetCurrentTarget: logic confirmed by peer review
- fn_19589 CNavigationManager::GetCurrentTargetName: logic confirmed by peer review
- fn_19590 CNavigationManager::GetSavedTarget: logic confirmed by peer review
- fn_19591 CNavigationManager::GetDestinationInfo: byte-identical
- fn_19592 CNavigationManager::GetDestinationCell: logic confirmed by peer review
- fn_19594 CNavigationManager::ClearData: logic confirmed by peer review
- fn_19596 CNavigationManager::IsCurrentTarget: logic confirmed by peer review
- fn_19597 CNavigationManager::GetCurrentTargetType: byte-identical
- fn_19635 CNavigationManager::SaveCurrentTarget: byte-identical

Reviewed-by: ragnarok-clanker
Adds to the build: Source/Contents/NavigationRequest.cpp
This commit is contained in:
ragnarok-clanker 2026-10-28 17:20:17 +00:00
commit 3c5e940a6d
6 changed files with 540 additions and 25 deletions

View file

@ -3,14 +3,15 @@
#include "Client/Registry.h"
#include "Utility/RegistryKey.h"
#include <cstdio>
#include <cstring>
// OFFSET: 0x00B88800
// FUNCTION: fn_19376
NavigationObject* NavigationManager::FindObject(const char* name) const {
for (NavigationObject* object : this->objects) {
if (object->HasName(name)) {
return object;
CNaviInfo* CNavigationManager::FindObject(const char* name) const {
for (CNaviInfo* info : this->data.destinations) {
if (info->HasName(name)) {
return info;
}
}
return nullptr;
@ -18,13 +19,133 @@ NavigationObject* NavigationManager::FindObject(const char* name) const {
// OFFSET: 0x00B8D270
// FUNCTION: fn_19434
bool NavigationObject::HasName(const char* name) const {
bool CNaviInfo::HasName(const char* name) const {
return std::strcmp(this->name.c_str(), name) == 0;
}
// OFFSET: 0x00B97FC0
// FUNCTION: fn_19604
std::string CNavigationManager::SelectedNodeText() {
char buffer[0x32];
std::memset(buffer, 0, sizeof(buffer));
if (!this->nodes.empty() && this->selectedNode >= 0) {
if (this->nodes.size() <= static_cast<unsigned>(this->selectedNode)) {
this->selectedNodeText.assign(buffer, std::strlen(buffer));
return this->selectedNodeText;
}
CNavi_Object* node = this->nodes[this->selectedNode];
NaviCell cellY;
NaviCell cellX;
const int y = node->GetCell(&cellY)->y;
const int x = node->GetCell(&cellX)->x;
std::sprintf(buffer, "%s %d %d...", node->GetInfo()->GetName(), x, y);
} else if (this->unknown_1258 == 2) {
CNaviInfo* info = this->data.GetInfo();
if (info != nullptr) {
NaviCell cellY;
NaviCell cellX;
const int y = this->data.GetCell(&cellY)->y;
const int x = this->data.GetCell(&cellX)->x;
std::sprintf(buffer, "%s %d %d...", info->GetName(), x, y);
}
}
this->selectedNodeText.assign(buffer, std::strlen(buffer));
return this->selectedNodeText;
}
// OFFSET: 0x00B981A0
// FUNCTION: fn_19605
std::string CNavigationManager::SubDestinationText() {
char buffer[0x32];
std::memset(buffer, 0, sizeof(buffer));
CNaviInfo* info = this->data.GetInfo();
if (info != nullptr) {
NaviCell cell;
if (this->data.GetCell(&cell)->x > 0) {
NaviCell cellY;
NaviCell cellX;
const int y = this->data.GetCell(&cellY)->y;
const int x = this->data.GetCell(&cellX)->x;
std::sprintf(buffer, ">.%s %d %d", info->GetName(), x, y);
} else {
std::sprintf(buffer, ">.%s", info->GetName());
}
}
this->subDestinationText.assign(buffer, std::strlen(buffer));
return this->subDestinationText;
}
// OFFSET: 0x00B982D0
// FUNCTION: fn_19606
std::string CNavigationManager::DestinationText() {
char buffer[0x32];
std::memset(buffer, 0, sizeof(buffer));
if (!this->nodes.empty() && this->selectedNode >= 0) {
if (this->nodes.size() <= static_cast<unsigned>(this->selectedNode)) {
this->destinationText.assign(buffer, std::strlen(buffer));
return this->destinationText;
}
CNavi_Object* node = this->nodes[this->selectedNode];
NaviCell cellY;
NaviCell cellX;
const int y = node->GetCell(&cellY)->y;
const int x = node->GetCell(&cellX)->x;
std::sprintf(buffer, "%s %d %d", node->GetInfo()->GetName(), x, y);
} else if (this->unknown_1258 == 2) {
CNaviInfo* info = this->data.GetInfo();
if (info != nullptr) {
NaviCell cellY;
NaviCell cellX;
const int y = this->data.GetCell(&cellY)->y;
const int x = this->data.GetCell(&cellX)->x;
std::sprintf(buffer, "%s %d %d", info->GetName(), x, y);
}
}
this->destinationText.assign(buffer, std::strlen(buffer));
return this->destinationText;
}
// OFFSET: 0x00B984C0
// FUNCTION: fn_19607
std::string CNavigationManager::DestinationTitle() {
char buffer[0x32];
std::memset(buffer, 0, sizeof(buffer));
if (!this->nodes.empty() && this->selectedNode >= 0) {
if (this->nodes.size() <= static_cast<unsigned>(this->selectedNode)) {
this->destinationTitle.assign(buffer, std::strlen(buffer));
return this->destinationTitle;
}
this->destinationTitle.assign(this->nodes[this->selectedNode]->GetInfo()->GetTitle());
return this->destinationTitle;
}
if (this->unknown_1258 == 2) {
NaviCell cell;
this->data.GetCell(&cell);
CNaviInfo* info = this->data.GetInfo();
if (info != nullptr) {
this->destinationTitle.assign(info->GetTitle());
return this->destinationTitle;
}
}
this->destinationTitle.assign(buffer, std::strlen(buffer));
return this->destinationTitle;
}
// OFFSET: 0x00B996D0
// FUNCTION: fn_19613
void NavigationManager::LoadSettings() {
void CNavigationManager::LoadSettings() {
RegistryKey key;
std::string subKey(g_subKey);
subKey += "\Navigation";
@ -38,7 +159,7 @@ void NavigationManager::LoadSettings() {
// OFFSET: 0x00B9C020
// FUNCTION: fn_19618
float NavigationManager::FitToSquare(int* offsetX, int* offsetY, int width, int height, float size) const {
float CNavigationManager::FitToSquare(int* offsetX, int* offsetY, int width, int height, float size) const {
float scale;
if (width > height) {
scale = size / width;
@ -55,3 +176,49 @@ float NavigationManager::FitToSquare(int* offsetX, int* offsetY, int width, int
}
return scale;
}
// OFFSET: 0x00B888F0
// FUNCTION: fn_19378
NaviCell* CNaviData::GetCell(NaviCell* out) {
out->x = this->cellX;
out->y = this->cellY;
return out;
}
// OFFSET: 0x00B88920
// FUNCTION: fn_19380
CNaviInfo* CNaviData::GetInfo() {
return this->info;
}
// OFFSET: 0x00B88A00
// FUNCTION: fn_45449
void CNaviData::Clear() {
this->unknown_0034.clear();
this->info = nullptr;
this->cellX = 0;
this->cellY = 0;
this->range = 50000;
this->unknown_0040.clear();
for (NaviDataEntry& entry : this->unknown_0028) {
entry.unknown_0000 = -1;
entry.unknown_0004 = 0;
entry.unknown_0008 = 0;
}
this->unknown_0028.clear();
}
// OFFSET: 0x00B8CD60
// FUNCTION: fn_19430
CNavi_Object::~CNavi_Object() {
this->id = -1;
this->type = 101;
this->index = -1;
this->name.clear();
this->title.clear();
this->cellX = 0;
this->cellY = 0;
this->info = nullptr;
this->links.clear();
}