Index: ps/trunk/build/premake/premake4.lua
===================================================================
--- ps/trunk/build/premake/premake4.lua
+++ ps/trunk/build/premake/premake4.lua
@@ -1115,7 +1115,7 @@
"Misc",
"ScenarioEditor",
"ScenarioEditor/Sections/Common",
- "ScenarioEditor/Sections/Cinematic",
+ "ScenarioEditor/Sections/Cinema",
"ScenarioEditor/Sections/Environment",
"ScenarioEditor/Sections/Map",
"ScenarioEditor/Sections/Object",
Index: ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/SectionLayout.cpp
===================================================================
--- ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/SectionLayout.cpp
+++ ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/SectionLayout.cpp
@@ -1,4 +1,4 @@
-/* Copyright (C) 2013 Wildfire Games.
+/* Copyright (C) 2017 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 @@
#include "ScenarioEditor.h"
+#include "Sections/Cinema/Cinema.h"
#include "Sections/Environment/Environment.h"
#include "Sections/Map/Map.h"
#include "Sections/Object/Object.h"
@@ -290,6 +291,7 @@
ADD_SIDEBAR(TerrainSidebar, _T("terrain.png"), _("Terrain"));
ADD_SIDEBAR(ObjectSidebar, _T("object.png"), _("Object"));
ADD_SIDEBAR(EnvironmentSidebar, _T("environment.png"), _("Environment"));
+ ADD_SIDEBAR(CinemaSidebar, _T("cinematic.png"), _("Cinema"));
#undef ADD_SIDEBAR
Index: ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.h
===================================================================
--- ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.h
+++ ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.h
@@ -0,0 +1,36 @@
+/* Copyright (C) 2017 Wildfire Games.
+* This file is part of 0 A.D.
+*
+* 0 A.D. is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 2 of the License, or
+* (at your option) any later version.
+*
+* 0 A.D. is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with 0 A.D. If not, see .
+*/
+
+#include "../Common/Sidebar.h"
+
+class CinemaSidebar : public Sidebar
+{
+public:
+ CinemaSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer);
+
+ virtual void OnMapReload();
+ virtual void OnTogglePathsDrawing(wxCommandEvent& evt);
+
+protected:
+ virtual void OnFirstDisplay();
+
+private:
+ wxScrolledWindow* scrolledWindow;
+ wxCheckBox* m_DrawPath;
+
+ DECLARE_EVENT_TABLE();
+};
Index: ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.cpp
===================================================================
--- ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.cpp
+++ ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Cinema/Cinema.cpp
@@ -0,0 +1,77 @@
+/* Copyright (C) 2017 Wildfire Games.
+* This file is part of 0 A.D.
+*
+* 0 A.D. is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 2 of the License, or
+* (at your option) any later version.
+*
+* 0 A.D. is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with 0 A.D. If not, see .
+*/
+
+#include "precompiled.h"
+
+#include "Cinema.h"
+
+#include "GameInterface/Messages.h"
+#include "ScenarioEditor/ScenarioEditor.h"
+#include "CustomControls/ColorDialog/ColorDialog.h"
+
+using AtlasMessage::Shareable;
+
+enum {
+ ID_PathsDrawing,
+};
+
+// Helper function for adding tooltips
+static wxWindow* Tooltipped(wxWindow* window, const wxString& tip)
+{
+ window->SetToolTip(tip);
+ return window;
+}
+
+CinemaSidebar::CinemaSidebar(ScenarioEditor& scenarioEditor, wxWindow* sidebarContainer, wxWindow* bottomBarContainer)
+ : Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer)
+{
+ wxSizer* scrollSizer = new wxBoxSizer(wxVERTICAL);
+ scrolledWindow = new wxScrolledWindow(this);
+ scrolledWindow->SetScrollRate(10, 10);
+ scrolledWindow->SetSizer(scrollSizer);
+ m_MainSizer->Add(scrolledWindow, wxSizerFlags().Proportion(1).Expand());
+
+ wxSizer* commonSizer = new wxStaticBoxSizer(wxVERTICAL, scrolledWindow, _T("Common settings"));
+ scrollSizer->Add(commonSizer, wxSizerFlags().Expand());
+
+ wxFlexGridSizer* gridSizer = new wxFlexGridSizer(2, 5, 5);
+ gridSizer->AddGrowableCol(1);
+
+ gridSizer->Add(Tooltipped(m_DrawPath = new wxCheckBox(scrolledWindow, ID_PathsDrawing, _("Draw all paths")),
+ _("Display every cinematic path added to the map")));
+
+ commonSizer->Add(gridSizer, wxSizerFlags().Expand());
+}
+
+void CinemaSidebar::OnFirstDisplay()
+{
+ m_DrawPath->SetValue(false);
+}
+
+void CinemaSidebar::OnMapReload()
+{
+ m_DrawPath->SetValue(false);
+}
+
+void CinemaSidebar::OnTogglePathsDrawing(wxCommandEvent& evt)
+{
+ POST_COMMAND(SetCinemaPathsDrawing, (evt.IsChecked()));
+}
+
+BEGIN_EVENT_TABLE(CinemaSidebar, Sidebar)
+EVT_CHECKBOX(ID_PathsDrawing, CinemaSidebar::OnTogglePathsDrawing)
+END_EVENT_TABLE();
Index: ps/trunk/source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp
===================================================================
--- ps/trunk/source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp
+++ ps/trunk/source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp
@@ -196,6 +196,24 @@
};
END_COMMAND(SetCinemaPaths)
+BEGIN_COMMAND(SetCinemaPathsDrawing)
+{
+ void Do()
+ {
+ if (g_Game && g_Game->GetView() && g_Game->GetView()->GetCinema())
+ g_Game->GetView()->GetCinema()->SetPathsDrawing(msg->drawPaths);
+ }
+
+ void Redo()
+ {
+ }
+
+ void Undo()
+ {
+ }
+};
+END_COMMAND(SetCinemaPathsDrawing)
+
QUERYHANDLER(GetCinemaPaths)
{
msg->paths = GetCurrentPaths();
Index: ps/trunk/source/tools/atlas/GameInterface/Messages.h
===================================================================
--- ps/trunk/source/tools/atlas/GameInterface/Messages.h
+++ ps/trunk/source/tools/atlas/GameInterface/Messages.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2016 Wildfire Games.
+/* Copyright (C) 2017 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -658,6 +658,8 @@
((std::vector, paths))
);
+COMMAND(SetCinemaPathsDrawing, NOMERGE, ((bool, drawPaths)));
+
MESSAGE(CinemaEvent,
((std::wstring, path))
((int, mode))