Backend abstraction

This commit is contained in:
AlexandreRouma
2022-01-29 20:35:08 +01:00
parent 3c19081561
commit 9969ce018b
18 changed files with 410 additions and 315 deletions

View File

@ -3,6 +3,7 @@
#include <gui/gui.h>
#include <sched_task.h>
#include <map>
#include <keybinds.h>
SDRPP_MOD_INFO{
/* Name: */ "scheduler",
@ -100,8 +101,8 @@ private:
if (ImGui::Selectable((name + "##_freq_mgr_bkm_name_" + _this->name).c_str(), &bm.selected, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_SelectOnClick)) {
// if shift or control isn't pressed, deselect all others
if (!ImGui::IsKeyDown(GLFW_KEY_LEFT_SHIFT) && !ImGui::IsKeyDown(GLFW_KEY_RIGHT_SHIFT) &&
!ImGui::IsKeyDown(GLFW_KEY_LEFT_CONTROL) && !ImGui::IsKeyDown(GLFW_KEY_RIGHT_CONTROL)) {
if (!ImGui::IsKeyDown(KB_KEY_LSHIFT) && !ImGui::IsKeyDown(KB_KEY_RSHIFT) &&
!ImGui::IsKeyDown(KB_KEY_LCTRL) && !ImGui::IsKeyDown(KB_KEY_RCTRL)) {
for (auto& [_name, _bm] : _this->tasks) {
if (name == _name) { continue; }
_bm.selected = false;

View File

@ -3,6 +3,7 @@
#include <imgui.h>
#include <gui/style.h>
#include <sched_action.h>
#include <keybinds.h>
class Task {
public:
@ -77,8 +78,8 @@ public:
if (ImGui::Selectable((act->getName() + "##scheduler_task_actions_entry").c_str(), &act->selected, ImGuiSelectableFlags_SpanAllColumns | ImGuiSelectableFlags_SelectOnClick)) {
// if shift or control isn't pressed, deselect all others
if (!ImGui::IsKeyDown(GLFW_KEY_LEFT_SHIFT) && !ImGui::IsKeyDown(GLFW_KEY_RIGHT_SHIFT) &&
!ImGui::IsKeyDown(GLFW_KEY_LEFT_CONTROL) && !ImGui::IsKeyDown(GLFW_KEY_RIGHT_CONTROL)) {
if (!ImGui::IsKeyDown(KB_KEY_LSHIFT) && !ImGui::IsKeyDown(KB_KEY_RSHIFT) &&
!ImGui::IsKeyDown(KB_KEY_LCTRL) && !ImGui::IsKeyDown(KB_KEY_RCTRL)) {
int _id = 0;
for (auto& _act : actions) {
if (_id == id) { continue; }