new scripting system

This commit is contained in:
Ryzerth
2020-10-07 14:44:39 +02:00
parent ac068036b8
commit 46d5b8a750
16 changed files with 105440 additions and 7 deletions

View File

@ -0,0 +1,21 @@
#include <gui/menus/scripting.h>
#include <core.h>
#include <gui/style.h>
namespace scriptingmenu {
void init() {
}
void draw(void* ctx) {
float menuWidth = ImGui::GetContentRegionAvailWidth();
for (const auto& [name, script] : core::scriptManager.scripts) {
bool running = script->running;
if (running) { style::beginDisabled(); }
if (ImGui::Button(name.c_str(), ImVec2(menuWidth, 0))) {
script->run();
}
if (running) { style::endDisabled(); }
}
}
}

View File

@ -0,0 +1,6 @@
#pragma once
namespace scriptingmenu {
void init();
void draw(void* ctx);
}