feat: debugger additions

Add type field for links in flash
Add warning level for dangerous buttons
fix uninitialzied memory with jetpack variable
remove a bunch of duplicated position push code

tested that the ui is still functional and components with multiple physics components have all their details visible.
tested that jetpack is initialized now
This commit is contained in:
David Markowitz
2026-06-24 02:43:45 -07:00
parent 5d523a1e7b
commit 7338319fac
17 changed files with 82 additions and 106 deletions

View File

@@ -4,6 +4,7 @@
#include "dCommonVars.h"
#include "Logger.h"
#include "Game.h"
#include "StringifiedEnum.h"
#include <type_traits>
#include <unordered_map>
@@ -368,7 +369,7 @@ public:
}
template<typename AmfType = AMFArrayValue>
AmfType& PushDebug(const std::string_view name) {
AmfType& PushDebug(const std::string_view name, const std::string& objectType = "", const uint32_t warningLevel = 0) {
size_t i = 0;
for (; i < m_Dense.size(); i++) {
const auto& cast = dynamic_cast<AMFArrayValue*>(m_Dense[i].get());
@@ -377,6 +378,14 @@ public:
const auto& nameValue = cast->Get<std::string>("name");
if (!nameValue || nameValue->GetValue() != name) continue;
if (!objectType.empty()) {
cast->Insert<std::string>("type", objectType);
}
if (warningLevel != 0) {
cast->Insert<double>("warningLevel", warningLevel);
}
// found a duplicate, return this instead
auto valueCast = dynamic_cast<AmfType*>(cast->Get("value"));
if (valueCast) return *valueCast;
@@ -384,6 +393,13 @@ public:
auto* value = PushArray();
value->Insert<std::string>("name", name.data());
if (!objectType.empty()) {
value->Insert<std::string>("type", objectType);
}
if (warningLevel != 0) {
value->Insert<double>("warningLevel", warningLevel);
}
return value->Insert<AmfType>("value", std::make_unique<AmfType>());
}