From 79eaa7364c9ae5ca72cce9b9bfa28215a081e2e3 Mon Sep 17 00:00:00 2001 From: sippeangelo Date: Mon, 18 Jan 2016 23:59:46 +0100 Subject: [PATCH] Editor toolbox buttons --- assets | 2 +- src/Engine/Editor/EditorGUI.cpp | 32 +++++++++++++++++++++++++------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/assets b/assets index a1bb17db..e794bef3 160000 --- a/assets +++ b/assets @@ -1 +1 @@ -Subproject commit a1bb17dbe0da3d55932c2e187da50bc0257691f4 +Subproject commit e794bef3a75ddcfb9bd87c1bd0f439c72e81036f diff --git a/src/Engine/Editor/EditorGUI.cpp b/src/Engine/Editor/EditorGUI.cpp index 94aaceb4..b7a7fbb9 100644 --- a/src/Engine/Editor/EditorGUI.cpp +++ b/src/Engine/Editor/EditorGUI.cpp @@ -36,22 +36,39 @@ void EditorGUI::drawTools() GLuint translateIcon = 0; try { - translateIcon = ResourceManager::Load("Textures/Icons/shaft.png")->m_Texture; + translateIcon = ResourceManager::Load("Textures/Icons/Translate.png")->m_Texture; } catch (const std::exception&) { } GLuint rotateIcon = 0; try { - rotateIcon = ResourceManager::Load("Textures/Icons/circulararrows3.png")->m_Texture; + rotateIcon = ResourceManager::Load("Textures/Icons/Rotate.png")->m_Texture; } catch (const std::exception&) { } GLuint scaleIcon = 0; try { - scaleIcon = ResourceManager::Load("Textures/Icons/increase10.png")->m_Texture; + scaleIcon = ResourceManager::Load("Textures/Icons/Scale.png")->m_Texture; } catch (const std::exception&) { } - ImGui::ImageButton((void*)translateIcon, ImVec2(24, 24)); + ImGui::ImageButton((void*)translateIcon, ImVec2(24, 24), ImVec2(0, 1), ImVec2(1, 0)); ImGui::SameLine(); - ImGui::ImageButton((void*)rotateIcon, ImVec2(24, 24)); + ImGui::ImageButton((void*)rotateIcon, ImVec2(24, 24), ImVec2(0, 1), ImVec2(1, 0)); ImGui::SameLine(); - ImGui::ImageButton((void*)scaleIcon, ImVec2(24, 24)); + ImGui::ImageButton((void*)scaleIcon, ImVec2(24, 24), ImVec2(0, 1), ImVec2(1, 0)); + ImGui::SameLine(); + ImGui::ItemSize(ImVec2(5, 0)); + ImGui::SameLine(); + + GLuint playIcon = 0; + try { + playIcon = ResourceManager::Load("Textures/Icons/Play.png")->m_Texture; + } catch (const std::exception&) { } + GLuint pauseIcon = 0; + try { + pauseIcon = ResourceManager::Load("Textures/Icons/Pause.png")->m_Texture; + } catch (const std::exception&) { } + + + ImGui::ImageButton((void*)playIcon, ImVec2(24, 24), ImVec2(0, 1), ImVec2(1, 0), -1, ImVec4(0, 0, 0, 0), ImVec4(0, 1, 0, 1)); + ImGui::SameLine(); + ImGui::ImageButton((void*)pauseIcon, ImVec2(24, 24), ImVec2(0, 1), ImVec2(1, 0)); ImGui::End(); } @@ -169,8 +186,9 @@ void EditorGUI::drawComponents(EntityWrapper entity) std::stringstream title; title << "Components"; if (entity.Valid()) { - title << formatEntityName(entity) << "###Components"; + title << " " << formatEntityName(entity); } + title << "###Components"; if (!ImGui::Begin(title.str().c_str())) { ImGui::End(); return;