From 6aa5150787706ea57b3f6891428c8b33469d064d Mon Sep 17 00:00:00 2001 From: parax0 Date: Sat, 9 Jan 2016 10:24:39 -0700 Subject: [PATCH] Implemented Unhide All --- src/Editor/CSceneViewport.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/Editor/CSceneViewport.cpp b/src/Editor/CSceneViewport.cpp index 7a89b559..4594bc13 100644 --- a/src/Editor/CSceneViewport.cpp +++ b/src/Editor/CSceneViewport.cpp @@ -3,6 +3,7 @@ #include "Editor/Undo/UndoCommands.h" #include #include +#include #include CSceneViewport::CSceneViewport(QWidget *pParent) @@ -344,7 +345,32 @@ void CSceneViewport::OnHideLayer() void CSceneViewport::OnUnhideAll() { - // implement when scene iterator is implemented! + CSceneIterator it(mpScene, eScriptNode | eLightNode, true); + + while (!it.DoneIterating()) + { + if (!it->IsVisible()) + { + if (it->NodeType() == eLightNode) + it->SetVisible(true); + + else + { + CScriptNode *pScript = static_cast(*it); + + if (!pScript->MarkedVisible()) + pScript->SetVisible(true); + + else + { + pScript->Template()->SetVisible(true); + pScript->Object()->Layer()->SetVisible(true); + } + } + } + + ++it; + } } void CSceneViewport::OnContextMenuClose()