2
3
4
5
9#include "Core/Input/Input.h"
10#include "Systems/SlateSystem.h"
12#include "Edit/ImguiEdit.h"
13#include "Window/ImguiWindow.h"
14#include "Create/ImguiCreateEntity.h"
15#include "Help/ImguiHelp.h"
16#include "Render/Vulkan/VulkanRenderBackend.h"
17#include "..\..\..\Core\Thread\ThreadModel.h"
18#include "Slate/SlateStyleLayout.h"
19#include <imgui_internal.h>
24 const std::string& panelName ,
32
33
35 m_File = SlateSystem::GetRegister()->Register<ImguiFile> (
false,
"File");
36 m_Edit = SlateSystem::GetRegister()->Register<ImguiEdit> (
false,
"Edit");
37 m_Create = SlateSystem::GetRegister()->Register<ImguiCreateEntity>(
false,
"Create");
38 m_Window = SlateSystem::GetRegister()->Register<ImguiWindow> (
false,
"Window");
39 m_Help = SlateSystem::GetRegister()->Register<ImguiHelp> (
false,
"Help");
47 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(6.0f, 6.0f));
48 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4.0f, 4.0f));
52
53
54
55 if (ImGui::BeginMainMenuBar())
57 m_PanelSize = ImGui::GetContentRegionAvail();
60
61
66
67
72
73
78
79
84
85
89 if (ImGui::BeginMenu(
"Tools"))
93 if (ImGui::BeginMenu(
ICON_TEXT(ICON_MD_CHECK, Variants)))
95 if (ImGui::MenuItem(
ICON_TEXT(ICON_MD_CHECK, Variant Editor))) {}
96 if (ImGui::MenuItem(
ICON_TEXT(ICON_MD_CHECK, Variant Presenter))) {}
100 if (ImGui::MenuItem(
ICON_TEXT(ICON_MD_CHECK, Section))) {}
101 if (ImGui::MenuItem(
ICON_TEXT(ICON_MD_CHECK, Paint))) {}
102 if (ImGui::MenuItem(
ICON_TEXT(ICON_MD_CHECK, Pivot))) {}
103 if (ImGui::MenuItem(
ICON_TEXT(ICON_MD_CHECK, Randomizer))) {}
104 if (ImGui::BeginMenu(
ICON_TEXT(ICON_MD_CHECK, Animation)))
106 if (ImGui::BeginMenu(
ICON_TEXT(ICON_MD_CHECK, Curve Processing)))
108 if (ImGui::MenuItem(
ICON_TEXT(ICON_MD_CHECK, Simplify Curve))) {}
112 if (ImGui::BeginMenu(
ICON_TEXT(ICON_MD_CHECK, Convert)))
114 if (ImGui::MenuItem(
ICON_TEXT(ICON_MD_CHECK, USD TimeSample to Curves))) {}
121 if (ImGui::MenuItem(
ICON_TEXT(ICON_MD_CHECK, Measure))) {}
122 if (ImGui::MenuItem(
ICON_TEXT(ICON_MD_CHECK, Array))) {}
123 if (ImGui::MenuItem(
ICON_TEXT(ICON_MD_CHECK, Distribute))) {}
130
131
132 if (ImGui::BeginMenu(
"Layout"))
138 if (ImGui::MenuItem(
"Default",
"Ctrl+1"))
140 AsyncTask(ThreadPoolEnum::Game, []() {
141 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::Default);
144 if (ImGui::MenuItem(
"Animation",
"Ctrl+2"))
146 AsyncTask(ThreadPoolEnum::Game, []() {
147 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::Animation);
150 if (ImGui::MenuItem(
"Animation Graph",
"Ctrl+3"))
152 AsyncTask(ThreadPoolEnum::Game, []() {
153 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::AnimationGraph);
156 if (ImGui::MenuItem(
"Paint",
"Ctrl+4"))
158 AsyncTask(ThreadPoolEnum::Game, []() {
159 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::Paint);
162 if (ImGui::MenuItem(
"Rendering",
"Ctrl+5"))
164 AsyncTask(ThreadPoolEnum::Game, []() {
165 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::Rendering);
168 if (ImGui::MenuItem(
"Visual Scripting",
"Ctrl+6"))
170 AsyncTask(ThreadPoolEnum::Game, []() {
171 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::VisualScripting);
174 if (ImGui::MenuItem(
"Physics Authoring",
"Ctrl+9"))
176 AsyncTask(ThreadPoolEnum::Game, []() {
177 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::PhysicsAuthoring);
181 if (ImGui::MenuItem(
"UI Toggle Visibility",
"F11"))
183 AsyncTask(ThreadPoolEnum::Game, []() {
184 SlateSystem::GetRegister()->GetViewPort()->Toggle();
187 if (ImGui::MenuItem(
"Fullscreen Mode"))
189 static bool isFullScreen =
false;
190 isFullScreen = !isFullScreen;
192 const GLFWvidmode* mode = glfwGetVideoMode(glfwGetPrimaryMonitor());
196 glfwSetWindowMonitor(VulkanRenderBackend::GetState().m_Windows, glfwGetPrimaryMonitor(), 0, 0, mode->width, mode->height, mode->refreshRate);
200 glfwSetWindowMonitor(VulkanRenderBackend::GetState().m_Windows,
nullptr, 0.05 * mode->width, 0.05 * mode->height, 0.9 * mode->width, 0.9 * mode->height, mode->refreshRate);
204 if (ImGui::MenuItem(
"Save Layout"))
208 if (ImGui::MenuItem(
"Load Layout"))
213 if (ImGui::MenuItem(
"Quick Save",
"Ctrl+7"))
215 AsyncTask(ThreadPoolEnum::Game, []() {
216 SlateStyleLayout::Get()->QuickStoreLayout();
219 if (ImGui::MenuItem(
"Quick Load",
"Ctrl+8"))
221 AsyncTask(ThreadPoolEnum::Game, []() {
222 SlateStyleLayout::Get()->QuickLoadLayout();
230
231
236
237
241 ImGui::SameLine(m_PanelSize.x - 6.0f * ImGuiH::GetLineItemSize().x);
242 ImGui::Text(
ICON_TEXT(ICON_MD_FLASH_ON,LIVE));
243 ImGui::Button(ICON_MD_KEYBOARD_ARROW_DOWN, ImGuiH::GetLineItemSize());
244 ImGui::Text(
"CACHE:ON");
248
249
250 ImGui::EndMainMenuBar();
254 ImGui::PopStyleVar(2);
263 const auto isPressedCtrl = []() {
273 AsyncTask(ThreadPoolEnum::Game, []() {
274 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::Default);
283 AsyncTask(ThreadPoolEnum::Game, []() {
284 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::Animation);
293 AsyncTask(ThreadPoolEnum::Game, []() {
294 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::AnimationGraph);
303 AsyncTask(ThreadPoolEnum::Game, []() {
304 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::Paint);
313 AsyncTask(ThreadPoolEnum::Game, []() {
314 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::Rendering);
323 AsyncTask(ThreadPoolEnum::Game, []() {
324 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::VisualScripting);
333 AsyncTask(ThreadPoolEnum::Game, []() {
334 SlateStyleLayout::Get()->QuickStoreLayout();
343 AsyncTask(ThreadPoolEnum::Game, []() {
344 SlateStyleLayout::Get()->QuickLoadLayout();
353 AsyncTask(ThreadPoolEnum::Game, []() {
354 SlateStyleLayout::Get()->SetLayout(StyleLayoutEnum::PhysicsAuthoring);
#define ICON_TEXT(icon, text)
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
EventDispatcher(Event &event)
Constructor Function.
This Class store a Specific Event type first and Dispatch a event handle function to it.
This Class is the basic Event Class. Inherit from it and create specific event class.
FrameInfo Class. This class defines the FrameInfo data.
static void MainMenuTitleSeparator()
Draw main menu titile separator.
The ImGuiH Class. This class defines helper function for slate render.
virtual void OnRender() override
This interface is called On SlateRenderer Render.
ImguiMainMenu(const std::string &panelName, FrameInfo &frameInfo)
Constructor Function.
virtual void OnEvent(Event &event) override
This interface is called On Global Event Function Pointer is called.
The ImguiMainMenu Class. This class defines how to render a main menu.
ImguiSlate(const std::string &panelName, FrameInfo &frameInfo)
Constructor Function. Init with Slate's name.
This Class defines the basic behaves of specific slate. When we add an new Slate, we need inherit fro...
const int & GetKeyCode() const
Get Key Input Code.
This Class is inherited from KeyEvent Class.
static std::shared_ptr< SlateStyleLayout > Get()
Get this single instance.
Wrappers of Slate StyleLayout Functions.