mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-06-25 08:04:22 +00:00
feat: debugger additions (#2013)
* 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 * remove amf3 header Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * fixes --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
#include "dCommonVars.h"
|
||||
#include "Logger.h"
|
||||
#include "Game.h"
|
||||
|
||||
#include <type_traits>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
@@ -368,7 +367,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 +376,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 +391,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