SpiecsEngine
 
Loading...
Searching...
No Matches

◆ OnRender()

void Spices::ImguiPreferences::OnRender ( )
overridevirtual

This interface is called On SlateRenderer Render.

Begin render Preferences.

End render GBuffer Preferences.

Begin render Preferences.

End render GBuffer Preferences.

Implements Spices::ImguiSlate.

Definition at line 31 of file ImguiPreferences.cpp.

32 {
34
35 if (!m_IsSlateOn) return;
36
40 Begin();
41
42 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2.0f, 4.0f));
43
44 {
45 SPICES_PROFILE_ZONEN("ImguiPreferences::Reset");
46
47 ImGui::Spacing();
48 ImGui::SetWindowFontScale(1.15f);
49 ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.204f, 0.78f, 1.0f, 1.0f));
50 ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImGui::GetStyle().Colors[ImGuiCol_ButtonHovered]);
51 ImGui::Button(" Reset to Default ");
52 ImGui::PopStyleColor(2);
53 ImGui::SetWindowFontScale(1.0f);
54 ImGui::SetItemTooltip("This will reset all settings back to installed state after the application is restarted");
55 ImGui::Spacing();
56 }
57
58 const float columeWidth = ImGuiH::GetLineItemSize().x * 9.0f;
59 static ImguiSlate* selectedSlate = nullptr;
60
61 {
62 SPICES_PROFILE_ZONEN("ImguiPreferences::ItemLists");
63
64 ImGui::PushID("ImguiPreferences::ItemLists");
65 ImGui::Columns(2, 0, false);
66
67 ImGui::SetColumnWidth(0, columeWidth);
68
69 float itemHeight = ImGui::GetStyle().ItemSpacing.y;
70 if (ImGui::BeginChild("ImguiPreferences::ItemLists", ImVec2(0, -itemHeight), ImGuiChildFlags_None, ImGuiWindowFlags_HorizontalScrollbar))
71 {
72 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(6.0f, 6.0f));
73 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(4.0f, 4.0f));
74 ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.267f, 0.282f, 0.282f, 1.0f));
75 ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(0.121f, 0.129f, 0.137f, 1.0f));
76
77 if (ImGui::MenuItem(ICON_TEXT(" ", Animation))) { selectedSlate = nullptr; }
78 if (ImGui::MenuItem(ICON_TEXT(" ", Audio))) { selectedSlate = nullptr; }
79 if (ImGui::MenuItem(ICON_TEXT(" ", Capture Screenshot))) { selectedSlate = nullptr; }
80 if (ImGui::MenuItem(ICON_TEXT(" ", Curve Tools))) { selectedSlate = nullptr; }
81 if (ImGui::MenuItem(ICON_TEXT(" ", Datetime Format))) { selectedSlate = nullptr; }
82 if (ImGui::MenuItem(ICON_TEXT(" ", Display Options))) { selectedSlate = m_ImguiDisplayOptions.get(); }
83 if (ImGui::MenuItem(ICON_TEXT(" ", Post Processing))) { selectedSlate = m_ImguiPostProcessing.get(); }
84 if (ImGui::MenuItem(ICON_TEXT(" ", Environment))) { selectedSlate = nullptr; }
85 if (ImGui::MenuItem(ICON_TEXT(" ", Live))) { selectedSlate = nullptr; }
86 if (ImGui::MenuItem(ICON_TEXT(" ", Material))) { selectedSlate = nullptr; }
87 if (ImGui::MenuItem(ICON_TEXT(" ", Material Thumbnail))) { selectedSlate = nullptr; }
88 if (ImGui::MenuItem(ICON_TEXT(" ", Measure))) { selectedSlate = nullptr; }
89 if (ImGui::MenuItem(ICON_TEXT(" ", Metrics Assembler))) { selectedSlate = nullptr; }
90 if (ImGui::MenuItem(ICON_TEXT(" ", Navigation))) { selectedSlate = nullptr; }
91 if (ImGui::MenuItem(ICON_TEXT(" ", Particle System))) { selectedSlate = nullptr; }
92 if (ImGui::MenuItem(ICON_TEXT(" ", Physics))) { selectedSlate = nullptr; }
93 if (ImGui::MenuItem(ICON_TEXT(" ", Property Widgets))) { selectedSlate = nullptr; }
94 if (ImGui::MenuItem(ICON_TEXT(" ", Rendering))) { selectedSlate = nullptr; }
95 if (ImGui::MenuItem(ICON_TEXT(" ", Resource Monitor))) { selectedSlate = nullptr; }
96 if (ImGui::MenuItem(ICON_TEXT(" ", Stage))) { selectedSlate = nullptr; }
97 if (ImGui::MenuItem(ICON_TEXT(" ", Tagging))) { selectedSlate = nullptr; }
98 if (ImGui::MenuItem(ICON_TEXT(" ", Template Startup))) { selectedSlate = nullptr; }
99 if (ImGui::MenuItem(ICON_TEXT(" ", Thumbnail Generation))) { selectedSlate = nullptr; }
100 if (ImGui::MenuItem(ICON_TEXT(" ", Viewport))) { selectedSlate = nullptr; }
101 if (ImGui::MenuItem(ICON_TEXT(" ", Visual Scripting))) { selectedSlate = nullptr; }
102 if (ImGui::MenuItem(ICON_TEXT(" ", Visualization))) { selectedSlate = nullptr; }
103
104 ImGui::PopStyleColor(2);
105 ImGui::PopStyleVar(2);
106 }
107 ImGui::EndChild();
108
109 ImGui::NextColumn();
110 }
111
112 {
113 SPICES_PROFILE_ZONEN("ImguiPreferences::Item");
114
115 float itemHeight = ImGui::GetStyle().ItemSpacing.y;
116 if (ImGui::BeginChild("ImguiPreferences::Item", ImVec2(0, -itemHeight), ImGuiChildFlags_None, ImGuiWindowFlags_HorizontalScrollbar))
117 {
118 ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4, 1));
119
120 if (selectedSlate)
121 {
122 selectedSlate->OnRender();
123 }
124
125 ImGui::PopStyleVar();
126 }
127 ImGui::EndChild();
128
129 ImGui::Columns(1);
130 ImGui::PopID();
131 }
132
133 ImGui::PopStyleVar();
134
138 End();
139 }
#define ICON_TEXT(icon, text)
Definition ImguiHelper.h:24
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
static ImVec2 GetLineItemSize()
Get Line Width's Square Size.
std::shared_ptr< ImguiDisplayOptions > m_ImguiDisplayOptions
std::shared_ptr< ImguiPostProcessing > m_ImguiPostProcessing
void Begin(float alpha=1.0f, ImGuiWindowFlags flags=0)
Begin a common slate.
void End()
End a slate.
ImguiSlate(const std::string &panelName, FrameInfo &frameInfo)
Constructor Function. Init with Slate's name.
Definition ImguiUtils.h:35
const char * Metrics[]
The following metrics are for demonstration purposes only. For a more comprehensive set of single-pas...

References Spices::ImguiSlate::End(), Spices::ImguiSlate::m_IsSlateOn, and Spices::ImguiSlate::OnRender().