Index: source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.h =================================================================== --- source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.h +++ source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -26,6 +26,7 @@ ObjectSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer); ~ObjectSidebar(); void FilterObjects(); + bool Show(bool show) override; protected: virtual void OnFirstDisplay(); Index: source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp =================================================================== --- source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp +++ source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2022 Wildfire Games. * This file is part of 0 A.D. * * 0 A.D. is free software: you can redistribute it and/or modify @@ -300,6 +300,16 @@ delete m_Impl; } +//Intercept on hide to close the actorviewer +bool ObjectSidebar::Show(bool show) +{ + if (!show) + { + m_ScenarioEditor.GetToolManager().SetCurrentTool(_T(""), NULL); + } + return Sidebar::Show(show); +} + void ObjectSidebar::OnToolChange(ITool* tool) { if (wxString(tool->GetClassInfo()->GetClassName()) == _T("ActorViewerTool"))