F4MP/tiltedcode/Code/client/Services/Debug/Views/CellView.cpp
Jous99 37b16f1547 code upload
codigo original de f4mp y tilted para referencias
2026-01-06 18:45:00 +01:00

53 lines
1.9 KiB
C++

#include <Services/DebugService.h>
#include <imgui.h>
#include <inttypes.h>
#include <Games/TES.h>
#include <PlayerCharacter.h>
#include <Forms/TESObjectCELL.h>
#include <Forms/TESWorldSpace.h>
void DebugService::DrawCellView()
{
ImGui::Begin("Cell");
PlayerCharacter* pPlayer = PlayerCharacter::Get();
if (auto* pWorldSpace = pPlayer->GetWorldSpace())
{
if (ImGui::CollapsingHeader("World space", ImGuiTreeNodeFlags_DefaultOpen))
{
const uint32_t worldFormId = pWorldSpace->formID;
ImGui::InputScalar("Id", ImGuiDataType_U32, (void*)&worldFormId, nullptr, nullptr, "%" PRIx32, ImGuiInputTextFlags_ReadOnly | ImGuiInputTextFlags_CharsHexadecimal);
char* pName = (char*)pWorldSpace->GetName();
size_t nameLen = strlen(pName);
ImGui::InputText("Name", pName, nameLen, ImGuiInputTextFlags_ReadOnly);
char* pEditorId = (char*)pWorldSpace->GetFormEditorID();
size_t editorIdLen = strlen(pEditorId);
ImGui::InputText("Editor ID", pEditorId, editorIdLen, ImGuiInputTextFlags_ReadOnly);
}
}
if (auto* pCell = pPlayer->parentCell)
{
if (ImGui::CollapsingHeader("Parent cell", ImGuiTreeNodeFlags_DefaultOpen))
{
const uint32_t cellId = pCell->formID;
ImGui::InputScalar("Id", ImGuiDataType_U32, (void*)&cellId, nullptr, nullptr, "%" PRIx32, ImGuiInputTextFlags_ReadOnly | ImGuiInputTextFlags_CharsHexadecimal);
char* pName = (char*)pCell->GetName();
size_t nameLen = strlen(pName);
ImGui::InputText("Name", pName, nameLen, ImGuiInputTextFlags_ReadOnly);
char* pEditorId = (char*)pCell->GetFormEditorID();
size_t editorIdLen = strlen(pEditorId);
ImGui::InputText("Editor ID", pEditorId, editorIdLen, ImGuiInputTextFlags_ReadOnly);
}
}
ImGui::End();
}