mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-30 06:17:49 +02:00
new scripting system
This commit is contained in:
21
core/src/gui/menus/scripting.cpp
Normal file
21
core/src/gui/menus/scripting.cpp
Normal 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(); }
|
||||
}
|
||||
}
|
||||
}
|
6
core/src/gui/menus/scripting.h
Normal file
6
core/src/gui/menus/scripting.h
Normal file
@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace scriptingmenu {
|
||||
void init();
|
||||
void draw(void* ctx);
|
||||
}
|
Reference in New Issue
Block a user