Ticket #1022: Atlas-ActorViewer-PlayerColour(1022).patch
File Atlas-ActorViewer-PlayerColour(1022).patch, 3.2 KB (added by , 12 years ago) |
---|
-
source/tools/atlas/AtlasUI/ScenarioEditor/Sections/Object/Object.cpp
97 97 98 98 struct ObjectSidebarImpl 99 99 { 100 ObjectSidebarImpl( ) :100 ObjectSidebarImpl(ScenarioEditor& scenarioEditor) : 101 101 m_ObjectListBox(NULL), m_ActorViewerActive(false), 102 m_ActorViewerEntity(_T("actor|structures/fndn_1x1.xml")), m_ActorViewerAnimation(_T("idle")), m_ActorViewerSpeed(0.f) 102 m_ActorViewerEntity(_T("actor|structures/fndn_1x1.xml")), 103 m_ActorViewerAnimation(_T("idle")), m_ActorViewerSpeed(0.f), 104 m_ObjectSettings(scenarioEditor.GetObjectSettings()) 103 105 { 104 106 } 105 107 … … 111 113 wxString m_ActorViewerEntity; 112 114 wxString m_ActorViewerAnimation; 113 115 float m_ActorViewerSpeed; 116 ObjectSettings& m_ObjectSettings; 114 117 115 118 void ActorViewerPostToGame() 116 119 { 117 POST_MESSAGE(SetActorViewer, ((std::wstring)m_ActorViewerEntity.wc_str(), (std::wstring)m_ActorViewerAnimation.wc_str(), m_ ActorViewerSpeed, false));120 POST_MESSAGE(SetActorViewer, ((std::wstring)m_ActorViewerEntity.wc_str(), (std::wstring)m_ActorViewerAnimation.wc_str(), m_ObjectSettings.GetPlayerID(), m_ActorViewerSpeed, false)); 118 121 } 119 122 }; 120 123 … … 124 127 wxWindow* bottomBarContainer 125 128 ) 126 129 : Sidebar(scenarioEditor, sidebarContainer, bottomBarContainer), 127 p(new ObjectSidebarImpl( ))130 p(new ObjectSidebarImpl(scenarioEditor)) 128 131 { 129 132 wxBoxSizer* sizer = new wxBoxSizer(wxHORIZONTAL); 130 133 sizer->Add(new wxStaticText(this, wxID_ANY, _("Filter")), wxSizerFlags().Align(wxALIGN_CENTER)); -
source/tools/atlas/GameInterface/Messages.h
340 340 MESSAGE(SetActorViewer, 341 341 ((std::wstring, id)) 342 342 ((std::wstring, animation)) 343 ((int, playerId)) 343 344 ((float, speed)) 344 345 ((bool, flushcache)) // true => unload all actor files before starting the preview (because we don't have proper hotloading yet) 345 346 ); -
source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp
34 34 #include "ps/GameSetup/Config.h" 35 35 #include "ps/GameSetup/GameSetup.h" 36 36 #include "renderer/Renderer.h" 37 #include "simulation2/components/ICmpOwnership.h" 38 #include "simulation2/Simulation2.h" 37 39 38 40 namespace AtlasMessage { 39 41 … … 154 156 } 155 157 AtlasView::GetView_Actor()->SetSpeedMultiplier(msg->speed); 156 158 AtlasView::GetView_Actor()->GetActorViewer().SetActor(*msg->id, *msg->animation); 159 160 AtlasViewActor* view = AtlasView::GetView_Actor(); 161 CmpPtr<ICmpOwnership> cmpOwnership(*view->GetSimulation2(), view->GetActorViewer().GetEntity()); 162 if (cmpOwnership) 163 cmpOwnership->SetOwner(msg->playerId); 157 164 } 158 165 159 166 //////////////////////////////////////////////////////////////////////////