Minor Update - UI Update - V10.3.0

This commit is contained in:
CatChow0 2025-05-08 17:28:06 +02:00
parent 8d32f51e8c
commit 5c3c6d944c
3 changed files with 186 additions and 99 deletions

View File

@ -6,8 +6,8 @@
<component name="ChangeListManager">
<list default="true" id="e81d6e08-efc7-40a0-909d-ec4943d948e9" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.KhaoticEngineReborn/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/inc/system/applicationclass.h" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/applicationclass.cpp" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/imgui.ini" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/imgui.ini" afterDir="false" />
<change beforePath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" beforeDir="false" afterPath="$PROJECT_DIR$/enginecustom/src/src/system/imguiManager.cpp" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -179,7 +179,7 @@
<workItem from="1746538260893" duration="5781000" />
<workItem from="1746546014271" duration="1814000" />
<workItem from="1746619988287" duration="12282000" />
<workItem from="1746711806997" duration="4930000" />
<workItem from="1746711806997" duration="5928000" />
</task>
<task id="LOCAL-00001" summary="Minor update - viewport window tweak">
<option name="closed" value="true" />

View File

@ -4,28 +4,28 @@ Size=400,400
Collapsed=0
[Window][Khaotic Engine]
Pos=1233,27
Size=343,599
Pos=1303,19
Size=281,842
Collapsed=0
DockId=0x00000005,0
[Window][Objects]
Pos=8,27
Size=289,547
Pos=0,19
Size=281,307
Collapsed=0
DockId=0x00000007,0
[Window][Terrain]
Pos=8,27
Size=281,599
Pos=0,328
Size=281,306
Collapsed=0
DockId=0x00000008,0
[Window][Light]
Pos=8,27
Size=290,866
Pos=0,328
Size=281,306
Collapsed=0
DockId=0x0000000B,1
DockId=0x00000008,1
[Window][Shader Manager]
Pos=8,27
@ -34,8 +34,8 @@ Collapsed=0
DockId=0x00000001,2
[Window][Engine Settings]
Pos=8,27
Size=289,547
Pos=0,19
Size=281,307
Collapsed=0
DockId=0x00000007,1
@ -66,32 +66,32 @@ Collapsed=0
DockId=0x0000000C,0
[Window][Log Window]
Pos=8,37
Size=16,19
Pos=652,636
Size=649,225
Collapsed=0
DockId=0x00000006,0
[Window][Render Stats]
Pos=8,628
Size=1568,225
Pos=0,636
Size=650,225
Collapsed=0
DockId=0x0000000E,0
DockId=0x00000004,0
[Docking][Data]
DockSpace ID=0xC0DFADC4 Pos=8,27 Size=1568,826 Split=X
DockNode ID=0x00000001 Parent=0xC0DFADC4 SizeRef=330,1094 Selected=0x393905AB
DockNode ID=0x00000003 Parent=0xC0DFADC4 SizeRef=1700,1094 CentralNode=1
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=8,27 Size=1568,826 Split=Y
DockNode ID=0x0000000A Parent=0xCCBD8CF7 SizeRef=1568,599 Split=Y
DockNode ID=0x00000004 Parent=0x0000000A SizeRef=1568,598 Split=X
DockNode ID=0x00000009 Parent=0x00000004 SizeRef=281,974 Split=Y Selected=0x031DC75C
DockNode ID=0x00000007 Parent=0x00000009 SizeRef=289,547 Selected=0x031DC75C
DockNode ID=0x00000008 Parent=0x00000009 SizeRef=289,545 Selected=0x393905AB
DockNode ID=0x0000000D Parent=0x00000004 SizeRef=1285,974 Split=X
DockNode ID=0x00000002 Parent=0x0000000D SizeRef=940,826 Split=Y
DockNode ID=0x0000000B Parent=0x00000002 SizeRef=1568,637 CentralNode=1
DockNode ID=0x0000000C Parent=0x00000002 SizeRef=1568,335 Selected=0x139FDA3F
DockNode ID=0x00000005 Parent=0x0000000D SizeRef=343,826 Selected=0x9F035453
DockNode ID=0x00000006 Parent=0x0000000A SizeRef=1568,226 Selected=0xAB74BEE9
DockNode ID=0x0000000E Parent=0xCCBD8CF7 SizeRef=1568,225 Selected=0xD99DEA49
DockSpace ID=0xC0DFADC4 Pos=8,27 Size=1568,826 Split=X
DockNode ID=0x00000001 Parent=0xC0DFADC4 SizeRef=330,1094 Selected=0x393905AB
DockNode ID=0x00000003 Parent=0xC0DFADC4 SizeRef=1700,1094 CentralNode=1
DockSpace ID=0xCCBD8CF7 Window=0x3DA2F1DE Pos=0,19 Size=1584,842 Split=X
DockNode ID=0x00000002 Parent=0xCCBD8CF7 SizeRef=1285,826 Split=Y
DockNode ID=0x0000000A Parent=0x00000002 SizeRef=1568,599 Split=X
DockNode ID=0x00000009 Parent=0x0000000A SizeRef=281,974 Split=Y Selected=0x031DC75C
DockNode ID=0x00000007 Parent=0x00000009 SizeRef=289,547 Selected=0x0B098C4B
DockNode ID=0x00000008 Parent=0x00000009 SizeRef=289,545 Selected=0x393905AB
DockNode ID=0x0000000D Parent=0x0000000A SizeRef=1285,974 Split=Y
DockNode ID=0x0000000B Parent=0x0000000D SizeRef=1568,637 CentralNode=1 Selected=0x321620B2
DockNode ID=0x0000000C Parent=0x0000000D SizeRef=1568,335 Selected=0x139FDA3F
DockNode ID=0x0000000E Parent=0x00000002 SizeRef=1568,225 Split=X Selected=0xD99DEA49
DockNode ID=0x00000004 Parent=0x0000000E SizeRef=882,225 Selected=0xD99DEA49
DockNode ID=0x00000006 Parent=0x0000000E SizeRef=881,225 Selected=0xAB74BEE9
DockNode ID=0x00000005 Parent=0xCCBD8CF7 SizeRef=281,826 Selected=0x9F035453

View File

@ -19,32 +19,112 @@ imguiManager::~imguiManager()
bool imguiManager::Initialize(HWND hwnd, ID3D11Device* device, ID3D11DeviceContext* deviceContext)
{
Logger::Get().Log("Initializing imgui", __FILE__, __LINE__, Logger::LogLevel::Initialize);
Logger::Get().Log("Initializing imgui", __FILE__, __LINE__, Logger::LogLevel::Initialize);
m_device = device;
m_deviceContext = deviceContext;
IMGUI_CHECKVERSION();
ImGui::CreateContext();
io = &ImGui::GetIO();
io->ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard; // Enable Keyboard Controls
io->ConfigFlags |= ImGuiConfigFlags_DockingEnable; // Enable Docking
m_device = device;
m_deviceContext = deviceContext;
IMGUI_CHECKVERSION();
ImGui::CreateContext();
io = &ImGui::GetIO();
io->ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard;
io->ConfigFlags |= ImGuiConfigFlags_DockingEnable;
ImGui_ImplWin32_Init(hwnd);
ImGui_ImplDX11_Init(m_device, m_deviceContext);
ImGui_ImplWin32_Init(hwnd);
ImGui_ImplDX11_Init(m_device, m_deviceContext);
// Setup style
ImGui::StyleColorsDark();
// Set the window background color to be a transparent black/gray
ImGui::GetStyle().Colors[ImGuiCol_WindowBg] = ImVec4(0, 0, 0, 0.5f);
// Set the menu bar background color to be a transparent black/gray
ImGui::GetStyle().Colors[ImGuiCol_MenuBarBg] = ImVec4(0, 0, 0, 0.5f);
Logger::Get().Log("imgui initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
return true;
// Appliquer un thème sombre de base
ImGui::StyleColorsDark();
// Définir les couleurs pour une interface de type éditeur sobre
ImGuiStyle& style = ImGui::GetStyle();
// Palette de couleurs sobres inspirée des éditeurs modernes
ImVec4 background_dark = ImVec4(0.10f, 0.10f, 0.10f, 1.00f); // Fond foncé
ImVec4 background = ImVec4(0.15f, 0.15f, 0.15f, 1.00f); // Fond principal
ImVec4 background_light = ImVec4(0.20f, 0.20f, 0.20f, 1.00f); // Fond clair
ImVec4 accent = ImVec4(0.14f, 0.44f, 0.80f, 0.50f); // Accent bleu
ImVec4 accent_light = ImVec4(0.14f, 0.44f, 0.80f, 1.00f); // Accent bleu vif
ImVec4 text = ImVec4(0.85f, 0.85f, 0.85f, 1.00f); // Texte
ImVec4 text_dim = ImVec4(0.50f, 0.50f, 0.50f, 1.00f); // Texte secondaire
// Ajustements de style généraux
style.WindowPadding = ImVec2(4.0f, 4.0f); // Moins de padding dans les fenêtres
style.FramePadding = ImVec2(4.0f, 3.0f); // Moins de padding dans les cadres
style.ItemSpacing = ImVec2(4.0f, 3.0f); // Moins d'espace entre les widgets
style.ItemInnerSpacing = ImVec2(3.0f, 3.0f); // Moins d'espace interne
style.DisplayWindowPadding = ImVec2(0.0f, 0.0f); // Pas de padding pour l'affichage
style.DisplaySafeAreaPadding = ImVec2(0.0f, 0.0f);
style.TouchExtraPadding = ImVec2(0.0f, 0.0f);
style.IndentSpacing = 20.0f;
style.ScrollbarSize = 14.0f;
style.GrabMinSize = 10.0f;
// Arrondis
style.WindowRounding = 4.0f;
style.ChildRounding = 4.0f;
style.FrameRounding = 3.0f;
style.PopupRounding = 4.0f;
style.ScrollbarRounding = 9.0f;
style.GrabRounding = 3.0f;
style.TabRounding = 4.0f;
// Couleurs principales
style.Colors[ImGuiCol_Text] = text;
style.Colors[ImGuiCol_TextDisabled] = text_dim;
style.Colors[ImGuiCol_WindowBg] = background;
style.Colors[ImGuiCol_ChildBg] = background_dark;
style.Colors[ImGuiCol_PopupBg] = background_dark;
style.Colors[ImGuiCol_Border] = ImVec4(0.25f, 0.25f, 0.27f, 1.00f);
style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
// Encadrements
style.Colors[ImGuiCol_FrameBg] = background_light;
style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f);
style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.30f, 0.30f, 0.30f, 1.00f);
// Titres
style.Colors[ImGuiCol_TitleBg] = background_dark;
style.Colors[ImGuiCol_TitleBgActive] = accent;
style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.12f, 0.12f, 0.12f, 0.90f);
// Éléments de menu
style.Colors[ImGuiCol_MenuBarBg] = background_dark;
style.Colors[ImGuiCol_ScrollbarBg] = background_dark;
style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.40f, 0.40f, 0.40f, 1.00f);
style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.60f, 0.60f, 0.60f, 1.00f);
// Boutons et interactions
style.Colors[ImGuiCol_CheckMark] = accent_light;
style.Colors[ImGuiCol_SliderGrab] = accent;
style.Colors[ImGuiCol_SliderGrabActive] = accent_light;
style.Colors[ImGuiCol_Button] = background_light;
style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.30f, 0.30f, 0.30f, 1.00f);
style.Colors[ImGuiCol_ButtonActive] = accent;
// En-têtes et onglets
style.Colors[ImGuiCol_Header] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f);
style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.25f, 0.25f, 0.25f, 1.00f);
style.Colors[ImGuiCol_HeaderActive] = accent;
style.Colors[ImGuiCol_Separator] = ImVec4(0.28f, 0.28f, 0.28f, 1.00f);
style.Colors[ImGuiCol_SeparatorHovered] = ImVec4(0.45f, 0.45f, 0.45f, 1.00f);
style.Colors[ImGuiCol_SeparatorActive] = accent;
style.Colors[ImGuiCol_Tab] = background_dark;
style.Colors[ImGuiCol_TabHovered] = accent;
style.Colors[ImGuiCol_TabActive] = accent;
style.Colors[ImGuiCol_TabUnfocused] = background_dark;
style.Colors[ImGuiCol_TabUnfocusedActive] = background;
// Autres éléments
style.Colors[ImGuiCol_DockingPreview] = accent;
style.Colors[ImGuiCol_DockingEmptyBg] = background_light;
Logger::Get().Log("imgui initialized", __FILE__, __LINE__, Logger::LogLevel::Initialize);
return true;
}
void imguiManager::Shutdown()
@ -77,54 +157,61 @@ void imguiManager::NewFrame()
}
void imguiManager::SetupDockspace(ApplicationClass* app) {
ImGuiWindowFlags window_flags = ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking;
ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(viewport->Pos);
ImGui::SetNextWindowSize(viewport->Size);
ImGui::SetNextWindowViewport(viewport->ID);
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus;
// Configuration du style pour supprimer l'espace autour des fenêtres dockées
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f);
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
// Configuration du style pour les nœuds de dock
ImGui::PushStyleVar(ImGuiStyleVar_DockingSeparatorSize, 1.0f); // Réduit l'épaisseur des séparateurs
// Configuration de la fenêtre principale
ImGuiWindowFlags window_flags = ImGuiWindowFlags_MenuBar | ImGuiWindowFlags_NoDocking;
ImGuiViewport* viewport = ImGui::GetMainViewport();
ImGui::SetNextWindowPos(viewport->Pos);
ImGui::SetNextWindowSize(viewport->Size);
ImGui::SetNextWindowViewport(viewport->ID);
window_flags |= ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove;
window_flags |= ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus;
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0));
ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0, 0, 0, 0));
ImGui::Begin("DockSpace", nullptr, window_flags);
// Pop des styles après avoir créé la fenêtre principale
ImGui::PopStyleVar(4); // 4 car nous avons poussé 4 variables de style
ImGui::PopStyleColor();
ImGui::Begin("DockSpace", nullptr, window_flags);
ImGui::PopStyleVar(2);
ImGui::PopStyleColor();
// Configuration du DockSpace
ImGuiID dockspace_id = ImGui::GetID("MainDockSpace");
ImGuiDockNodeFlags dockspace_flags = ImGuiDockNodeFlags_PassthruCentralNode;
ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags);
if (ImGui::BeginMenuBar()) {
if (ImGui::BeginMenu("Windows")) {
ImGui::MenuItem("Object Window", NULL, &showObjectWindow);
ImGui::MenuItem("Terrain Window", NULL, &showTerrainWindow);
ImGui::MenuItem("Light Window", NULL, &showLightWindow);
ImGui::MenuItem("Engine Settings Window", NULL, &showEngineSettingsWindow);
ImGui::MenuItem("Log Window", NULL, &showLogWindow);
ImGui::MenuItem("Render Stats", NULL, &showStatsWindow);
ImGui::EndMenu();
}
if (ImGui::BeginMenuBar()) {
if (ImGui::BeginMenu("Windows")) {
ImGui::MenuItem("Object Window", NULL, &showObjectWindow);
ImGui::MenuItem("Terrain Window", NULL, &showTerrainWindow);
ImGui::MenuItem("Light Window", NULL, &showLightWindow);
ImGui::MenuItem("Engine Settings Window", NULL, &showEngineSettingsWindow);
ImGui::MenuItem("Log Window", NULL, &showLogWindow);
ImGui::MenuItem("Render Stats", NULL, &showStatsWindow);
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Scene")) {
if (ImGui::MenuItem("Save Scene")) {
app->SaveScene();
}
if (ImGui::MenuItem("Load Scene")) {
app->LoadScene();
}
ImGui::EndMenu();
}
// Scene file menu
if (ImGui::BeginMenu("Scene")) {
if (ImGui::MenuItem("Save Scene")) {
// Save the scene
app->SaveScene();
}
if (ImGui::MenuItem("Load Scene")) {
// Load the scene
app->LoadScene();
}
ImGui::EndMenu();
}
ImGui::EndMenuBar();
}
ImGui::EndMenuBar();
}
ImGuiID dockspace_id = ImGui::GetID("MainDockSpace");
ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_PassthruCentralNode);
ImGui::End();
ImGui::End();
}
void imguiManager::WidgetSpeedSlider(float* speed)