2024-01-22 01:04:19 +02:00
|
|
|
#include <Hotkey.h>
|
2024-01-27 19:59:26 +02:00
|
|
|
#include <imgui.h>
|
|
|
|
#include "menu.h"
|
2023-07-30 06:14:30 +03:00
|
|
|
|
|
|
|
namespace Menu {
|
|
|
|
static const ImGuiWindowFlags windowFlags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_AlwaysAutoResize;
|
2023-08-05 05:22:20 +03:00
|
|
|
static const ImVec2 minWndSize = ImVec2(0.0f, 0.0f);
|
2024-01-06 03:33:37 +02:00
|
|
|
static const ImVec2 maxWndSize = ImVec2(900.0f, 675.0f);
|
2023-07-30 06:14:30 +03:00
|
|
|
|
2024-01-25 00:58:38 +02:00
|
|
|
KeyBindOption menuToggle = KeyBindOption(VK_F5);
|
2024-01-09 02:29:23 +02:00
|
|
|
float transparency = 99.0f;
|
2023-07-30 06:14:30 +03:00
|
|
|
|
|
|
|
void Render() {
|
2024-01-08 06:08:20 +02:00
|
|
|
ImGuiStyle* style = &ImGui::GetStyle();
|
|
|
|
style->Colors[ImGuiCol_WindowBg] = ImVec4(style->Colors[ImGuiCol_WindowBg].x, style->Colors[ImGuiCol_WindowBg].y, style->Colors[ImGuiCol_WindowBg].z, static_cast<float>(transparency) / 100.0f);
|
|
|
|
|
2023-08-05 05:22:20 +03:00
|
|
|
ImGui::SetNextWindowSizeConstraints(minWndSize, maxWndSize);
|
2024-01-25 00:58:38 +02:00
|
|
|
ImGui::Begin("EGameTools", &menuToggle.value, windowFlags); {
|
2023-07-30 06:14:30 +03:00
|
|
|
if (ImGui::BeginTabBar("##MainTabBar")) {
|
2024-01-29 01:52:08 +02:00
|
|
|
for (auto& tab : *MenuTab::GetInstances()) {
|
|
|
|
if (ImGui::BeginTabItem(tab.second->tabName.data())) {
|
|
|
|
tab.second->Render();
|
|
|
|
ImGui::EndTabItem();
|
|
|
|
}
|
2023-07-30 06:14:30 +03:00
|
|
|
}
|
|
|
|
ImGui::EndTabBar();
|
|
|
|
}
|
2024-01-08 06:08:20 +02:00
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
2024-01-25 00:58:38 +02:00
|
|
|
ImGui::Hotkey("Menu Toggle Key", menuToggle);
|
2024-01-09 02:23:28 +02:00
|
|
|
ImGui::SliderFloat("Menu Transparency", &transparency, 0.0f, 100.0f, "%.1f%%", ImGuiSliderFlags_AlwaysClamp);
|
2024-01-08 06:08:20 +02:00
|
|
|
ImGui::End();
|
|
|
|
}
|
2023-07-30 06:14:30 +03:00
|
|
|
}
|
|
|
|
}
|