mirror of
https://github.com/GabsPuNs/Project-Zenith-Main.git
synced 2026-07-10 19:08:32 +00:00
72 lines
1.4 KiB
C++
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
|