From 0af3233f533cf8d61d3bdd8e6867cf421a26396b Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 7 Dec 2017 17:06:55 -0500 Subject: [PATCH] Move Space/Time component into simple menu version Move regular menu to F3 Move easy menu to F2 Remove extra text --- .../openspace/properties/numericalproperty.inl | 4 ++-- modules/imgui/src/guispacetimecomponent.cpp | 5 +---- scripts/common.lua | 18 ++++++++++-------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl index 671e2e7fd2..88104ab3cf 100644 --- a/include/openspace/properties/numericalproperty.inl +++ b/include/openspace/properties/numericalproperty.inl @@ -367,12 +367,12 @@ void NumericalProperty::setMaxValue(T value) { template T NumericalProperty::steppingValue() const { - return _steppingValue; + return _stepping; } template void NumericalProperty::setSteppingValue(T value) { - _steppingValue = std::move(value); + _stepping = std::move(value); } template diff --git a/modules/imgui/src/guispacetimecomponent.cpp b/modules/imgui/src/guispacetimecomponent.cpp index 3106d43a24..0bcbfd8b2c 100644 --- a/modules/imgui/src/guispacetimecomponent.cpp +++ b/modules/imgui/src/guispacetimecomponent.cpp @@ -27,7 +27,6 @@ #include #include - #include #include #include @@ -82,8 +81,6 @@ void GuiSpaceTimeComponent::render() { ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 10.f); - ImGui::Text("%s", "Focus on:"); - ImGui::SameLine(); // Buttons for important SceneGraphNodes for (SceneGraphNode* n : nodes) { const std::vector& tags = n->tags(); @@ -119,7 +116,7 @@ void GuiSpaceTimeComponent::render() { } int currentPosition = static_cast(std::distance(nodes.begin(), iCurrentFocus)); - bool hasChanged = ImGui::Combo("Focus Node", ¤tPosition, nodeNames.c_str()); + bool hasChanged = ImGui::Combo("", ¤tPosition, nodeNames.c_str()); if (hasChanged) { OsEng.scriptEngine().queueScript( "openspace.setPropertyValue('NavigationHandler.Origin', '" + diff --git a/scripts/common.lua b/scripts/common.lua index bec249a5ba..0c63a7747e 100644 --- a/scripts/common.lua +++ b/scripts/common.lua @@ -12,14 +12,6 @@ helper.scheduledScript.reversible = {} -- Function that sets the most common key bindings that are common to most (all?) -- scenes helper.setCommonKeys = function() - openspace.bindKeyLocal( - "F1", - [[local b = openspace.getPropertyValue('Global Properties.ImGUI.Main.Enabled'); - openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.Enabled', not b); - openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.IsHidden', b);]], - "Shows or hides the entire user interface" - ) - openspace.bindKeyLocal( "F2", [[local b = openspace.getPropertyValue('Global Properties.ImGUI.Main.Properties.Enabled'); @@ -31,8 +23,10 @@ helper.setCommonKeys = function() -- windows are hidden openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.IsHidden', false); openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.Properties.Enabled', true); + openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.Space/Time.Enabled', true); else openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.Properties.Enabled', not b); + openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.Space/Time.Enabled', not b); openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.IsHidden', b); end]], "Shows or hides the properties window" @@ -40,6 +34,14 @@ helper.setCommonKeys = function() openspace.bindKeyLocal( "F3", + [[local b = openspace.getPropertyValue('Global Properties.ImGUI.Main.Enabled'); + openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.Enabled', not b); + openspace.setPropertyValueSingle('Global Properties.ImGUI.Main.IsHidden', b);]], + "Shows or hides the entire user interface" + ) + + openspace.bindKeyLocal( + "F4", helper.property.invert("RenderEngine.PerformanceMeasurements"), "Toogles performance measurements that shows rendering time informations." )