Browse Source

Urho3D Editor: Show "Window" commands now toggle visibility

example: CTRL + I, will show the inspector if not visible and hide it if
it is visible
JSandusky 10 years ago
parent
commit
80ba2ed375

+ 7 - 2
bin/Data/Scripts/Editor/EditorHierarchyWindow.as

@@ -97,8 +97,13 @@ void CreateHierarchyWindow()
 
 
 bool ShowHierarchyWindow()
 bool ShowHierarchyWindow()
 {
 {
-    hierarchyWindow.visible = true;
-    hierarchyWindow.BringToFront();
+    if (hierarchyWindow.visible == false)
+    {
+        hierarchyWindow.visible = true;
+        hierarchyWindow.BringToFront();
+    }
+    else
+        HideHierarchyWindow();
     return true;
     return true;
 }
 }
 
 

+ 7 - 2
bin/Data/Scripts/Editor/EditorInspectorWindow.as

@@ -168,8 +168,13 @@ void ToggleInspectorLock()
 
 
 bool ShowAttributeInspectorWindow()
 bool ShowAttributeInspectorWindow()
 {
 {
-    attributeInspectorWindow.visible = true;
-    attributeInspectorWindow.BringToFront();
+    if (attributeInspectorWindow.visible == false)
+    {
+        attributeInspectorWindow.visible = true;
+        attributeInspectorWindow.BringToFront();
+    }
+    else
+        HideAttributeInspectorWindow();
     return true;
     return true;
 }
 }
 
 

+ 8 - 3
bin/Data/Scripts/Editor/EditorMaterial.as

@@ -54,9 +54,14 @@ void CreateMaterialEditor()
 
 
 bool ShowMaterialEditor()
 bool ShowMaterialEditor()
 {
 {
-    RefreshMaterialEditor();
-    materialWindow.visible = true;
-    materialWindow.BringToFront();
+    if (materialWindow.visible == false)
+    {
+        RefreshMaterialEditor();
+        materialWindow.visible = true;
+        materialWindow.BringToFront();
+    }
+    else
+        HideMaterialEditor();
     return true;
     return true;
 }
 }
 
 

+ 8 - 3
bin/Data/Scripts/Editor/EditorParticleEffect.as

@@ -794,9 +794,14 @@ void EditParticleEffectRelative(StringHash eventType, VariantMap& eventData)
 
 
 bool ShowParticleEffectEditor()
 bool ShowParticleEffectEditor()
 {
 {
-    RefreshParticleEffectEditor();
-    particleEffectWindow.visible = true;
-    particleEffectWindow.BringToFront();
+    if (particleEffectWindow.visible == false)
+    {
+        RefreshParticleEffectEditor();
+        particleEffectWindow.visible = true;
+        particleEffectWindow.BringToFront();
+    }
+    else
+        HideParticleEffectEditor();
     return true;
     return true;
 }
 }
 
 

+ 8 - 3
bin/Data/Scripts/Editor/EditorPreferences.as

@@ -222,9 +222,14 @@ void EditLanguageSelector(StringHash eventType, VariantMap& eventData)
 
 
 bool ShowEditorPreferencesDialog()
 bool ShowEditorPreferencesDialog()
 {
 {
-    UpdateEditorPreferencesDialog();
-    preferencesDialog.visible = true;
-    preferencesDialog.BringToFront();
+    if (preferencesDialog.visible == false)
+    {
+        UpdateEditorPreferencesDialog();
+        preferencesDialog.visible = true;
+        preferencesDialog.BringToFront();
+    }
+    else
+        preferencesDialog.visible = false;
     return true;
     return true;
 }
 }
 
 

+ 8 - 3
bin/Data/Scripts/Editor/EditorResourceBrowser.as

@@ -521,9 +521,14 @@ void HideResourceBrowserWindow()
 
 
 bool ShowResourceBrowserWindow()
 bool ShowResourceBrowserWindow()
 {
 {
-    browserWindow.visible = true;
-    browserWindow.BringToFront();
-    ui.focusElement = browserSearch;
+    if (browserWindow.visible == false)
+    {
+        browserWindow.visible = true;
+        browserWindow.BringToFront();
+        ui.focusElement = browserSearch;
+    }
+    else
+        HideResourceBrowserWindow();
     return true;
     return true;
 }
 }
 
 

+ 8 - 3
bin/Data/Scripts/Editor/EditorSettings.as

@@ -176,9 +176,14 @@ void UpdateEditorSettingsDialog()
 
 
 bool ShowEditorSettingsDialog()
 bool ShowEditorSettingsDialog()
 {
 {
-    UpdateEditorSettingsDialog();
-    settingsDialog.visible = true;
-    settingsDialog.BringToFront();
+    if (settingsDialog.visible == false)
+    {
+        UpdateEditorSettingsDialog();
+        settingsDialog.visible = true;
+        settingsDialog.BringToFront();
+    }
+    else
+        HideEditorSettingsDialog();
     return true;
     return true;
 }
 }
 
 

+ 8 - 3
bin/Data/Scripts/Editor/EditorSoundType.as

@@ -182,9 +182,14 @@ void EditGain(StringHash eventType, VariantMap& eventData)
 
 
 bool ShowSoundTypeEditor()
 bool ShowSoundTypeEditor()
 {
 {
-    RefreshSoundTypeEditorWindow();
-    soundTypeEditorWindow.visible = true;
-    soundTypeEditorWindow.BringToFront();
+    if (soundTypeEditorWindow.visible == false)
+    {
+        RefreshSoundTypeEditorWindow();
+        soundTypeEditorWindow.visible = true;
+        soundTypeEditorWindow.BringToFront();
+    }
+    else
+        HideSoundTypeEditor();
     return true;
     return true;
 }
 }
 
 

+ 7 - 2
bin/Data/Scripts/Editor/EditorSpawn.as

@@ -76,8 +76,13 @@ void CreateSpawnEditor()
 
 
 bool ShowSpawnEditor()
 bool ShowSpawnEditor()
 {
 {
-    spawnWindow.visible = true;
-    spawnWindow.BringToFront();
+    if (spawnWindow.visible == false)
+    {
+        spawnWindow.visible = true;
+        spawnWindow.BringToFront();
+    }
+    else
+        HideSpawnWindow();
     return true;
     return true;
 }
 }