Files
GabsPuNs-Project_Zenith_Main/Minecraft.Client/Windows64/Libs/RmlUi/Source/Debugger/Debugger.cpp
2026-06-10 16:12:51 +02:00

72 lines
1.4 KiB
C++

#include "../../Include/RmlUi/Debugger/Debugger.h"
#include "../../Include/RmlUi/Core/Core.h"
#include "DebuggerPlugin.h"
namespace Rml {
namespace Debugger {
bool Initialise(Context* context)
{
if (DebuggerPlugin::GetInstance() != nullptr)
{
Log::Message(Log::LT_WARNING, "Unable to initialise debugger plugin, already initialised!");
return false;
}
DebuggerPlugin* plugin = new DebuggerPlugin();
if (!plugin->Initialise(context))
{
Log::Message(Log::LT_WARNING, "Unable to initialise debugger plugin.");
delete plugin;
return false;
}
SetContext(context);
RegisterPlugin(plugin);
return true;
}
void Shutdown()
{
DebuggerPlugin* plugin = DebuggerPlugin::GetInstance();
if (!plugin)
{
Log::Message(Log::LT_WARNING, "Unable to shutdown debugger plugin, it was not initialised!");
return;
}
UnregisterPlugin(plugin);
}
bool SetContext(Context* context)
{
DebuggerPlugin* plugin = DebuggerPlugin::GetInstance();
if (plugin == nullptr)
return false;
plugin->SetContext(context);
return true;
}
void SetVisible(bool visibility)
{
DebuggerPlugin* plugin = DebuggerPlugin::GetInstance();
if (plugin != nullptr)
plugin->SetVisible(visibility);
}
bool IsVisible()
{
DebuggerPlugin* plugin = DebuggerPlugin::GetInstance();
if (plugin == nullptr)
return false;
return plugin->IsVisible();
}
} // namespace Debugger
} // namespace Rml