mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-27 00:54:22 +00:00
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:
@@ -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>());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user