From 31c19653317573a33d0fb0a0583670a92e49d7d2 Mon Sep 17 00:00:00 2001 From: Pcornat Date: Mon, 24 Jan 2022 21:00:25 +0100 Subject: [PATCH] Separated --- include/gui/gui.hpp | 11 ++++++ src/gui/gui.cpp | 86 ++++++++++++++++++++++++++------------------- 2 files changed, 60 insertions(+), 37 deletions(-) diff --git a/include/gui/gui.hpp b/include/gui/gui.hpp index 0273aad..3772008 100644 --- a/include/gui/gui.hpp +++ b/include/gui/gui.hpp @@ -23,6 +23,17 @@ namespace gui { const fs::path font; bool initialized{ false }; + + void habilete_menu() noexcept; + + void adresse_menu() noexcept; + + void endurance_menu() noexcept; + + void chance_menu() noexcept; + + void stat_second_menu() noexcept; + public: Gui() = delete; diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 2565a05..d523920 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -58,50 +58,20 @@ void gui::Gui::render_gui(const Controller &controller) { } ImGui::BeginGroup(); - { - ImGui::BeginChild("habilete", ImVec2(ImGui::GetWindowWidth() / 3, ImGui::GetWindowHeight() * 0.2f), true); - ImGui::Text("Habileté"); - ImGui::EndChild(); - } + habilete_menu(); ImGui::SameLine(); - { - ImGui::BeginChild("adresse", ImVec2(ImGui::GetWindowWidth() / 3, ImGui::GetWindowHeight() * 0.2f), true); - ImGui::Text("Adresse"); - ImGui::Text("Bottom pane1"); - ImGui::Text("Bottom pane2"); - ImGui::Text("Bottom pane3"); - ImGui::Text("Bottom pane4"); - ImGui::EndChild(); - } + adresse_menu(); - { - ImGui::BeginChild("endurance", ImVec2(ImGui::GetWindowWidth() / 3, ImGui::GetWindowHeight() * 0.2f), true); - ImGui::Text("Endurance"); - ImGui::Text("Bottom pane1"); - ImGui::Text("Bottom pane2"); - ImGui::Text("Bottom pane3"); - ImGui::Text("Bottom pane4"); - ImGui::EndChild(); - } + endurance_menu(); ImGui::SameLine(); - { - ImGui::BeginChild("chance", ImVec2(ImGui::GetWindowWidth() / 3, ImGui::GetWindowHeight() * 0.2f), true); - ImGui::Text("Chance"); - ImGui::Text("Bottom pane1"); - ImGui::Text("Bottom pane2"); - ImGui::Text("Bottom pane3"); - ImGui::Text("Bottom pane4"); - ImGui::EndChild(); - } + chance_menu(); ImGui::EndGroup(); + ImGui::SameLine(); - { - ImGui::BeginChild("stats secondaire", ImVec2(ImGui::GetWindowWidth() / 3, ImGui::GetWindowHeight() * 0.4f), true); - ImGui::Text("STAT. SECONDAIRES"); - ImGui::EndChild(); - } + + stat_second_menu(); ImGui::End(); @@ -117,3 +87,45 @@ void gui::Gui::render_gpu() const { ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); } } + +void gui::Gui::habilete_menu() noexcept { + ImGui::BeginChild("habilete", ImVec2(ImGui::GetWindowWidth() / 3, ImGui::GetWindowHeight() * 0.2f), true); + ImGui::Text("Habileté"); + ImGui::EndChild(); +} + +void gui::Gui::adresse_menu() noexcept { + ImGui::BeginChild("adresse", ImVec2(ImGui::GetWindowWidth() / 3, ImGui::GetWindowHeight() * 0.2f), true); + ImGui::Text("Adresse"); + ImGui::Text("Bottom pane1"); + ImGui::Text("Bottom pane2"); + ImGui::Text("Bottom pane3"); + ImGui::Text("Bottom pane4"); + ImGui::EndChild(); +} + +void gui::Gui::endurance_menu() noexcept { + ImGui::BeginChild("endurance", ImVec2(ImGui::GetWindowWidth() / 3, ImGui::GetWindowHeight() * 0.2f), true); + ImGui::Text("Endurance"); + ImGui::Text("Bottom pane1"); + ImGui::Text("Bottom pane2"); + ImGui::Text("Bottom pane3"); + ImGui::Text("Bottom pane4"); + ImGui::EndChild(); +} + +void gui::Gui::chance_menu() noexcept { + ImGui::BeginChild("chance", ImVec2(ImGui::GetWindowWidth() / 3, ImGui::GetWindowHeight() * 0.2f), true); + ImGui::Text("Chance"); + ImGui::Text("Bottom pane1"); + ImGui::Text("Bottom pane2"); + ImGui::Text("Bottom pane3"); + ImGui::Text("Bottom pane4"); + ImGui::EndChild(); +} + +void gui::Gui::stat_second_menu() noexcept { + ImGui::BeginChild("stats secondaire", ImVec2(ImGui::GetWindowWidth() / 3, ImGui::GetWindowHeight() * 0.4f), true); + ImGui::Text("STAT. SECONDAIRES"); + ImGui::EndChild(); +}