2023-08-05 05:22:20 +03:00
|
|
|
#include <imgui.h>
|
2024-01-22 01:04:19 +02:00
|
|
|
#include <Hotkey.h>
|
2023-07-30 06:14:30 +03:00
|
|
|
#include "camera.h"
|
|
|
|
#include "player.h"
|
2023-08-02 00:54:12 +03:00
|
|
|
#include "world.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-22 01:04:19 +02:00
|
|
|
KeyBindToggle toggleKey = KeyBindToggle(KeyBind::F5);
|
2023-07-30 06:14:30 +03:00
|
|
|
bool isOpen = false;
|
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-08 06:08:20 +02:00
|
|
|
ImGui::Begin("EGameTools", &Menu::isOpen, windowFlags); {
|
2023-07-30 06:14:30 +03:00
|
|
|
if (ImGui::BeginTabBar("##MainTabBar")) {
|
|
|
|
if (ImGui::BeginTabItem("Player")) {
|
|
|
|
Menu::Player::Render();
|
|
|
|
ImGui::EndTabItem();
|
|
|
|
}
|
|
|
|
if (ImGui::BeginTabItem("Camera")) {
|
|
|
|
Menu::Camera::Render();
|
|
|
|
ImGui::EndTabItem();
|
|
|
|
}
|
|
|
|
if (ImGui::BeginTabItem("World")) {
|
2023-08-02 00:54:12 +03:00
|
|
|
Menu::World::Render();
|
2023-07-30 06:14:30 +03:00
|
|
|
ImGui::EndTabItem();
|
|
|
|
}
|
|
|
|
ImGui::EndTabBar();
|
|
|
|
}
|
2024-01-08 06:08:20 +02:00
|
|
|
|
|
|
|
ImGui::Separator();
|
|
|
|
|
2024-01-22 01:04:19 +02:00
|
|
|
ImGui::Hotkey("Menu Toggle Key", toggleKey);
|
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
|
|
|
}
|
|
|
|
}
|