- Timestamp:
- 06/10/11 01:47:20 (14 years ago)
- Location:
- ps/trunk
- Files:
-
- 8 edited
-
build/premake/premake.lua (modified) (1 diff)
-
source/graphics/MapReader.cpp (modified) (2 diffs)
-
source/simulation2/Simulation2.cpp (modified) (1 diff)
-
source/simulation2/Simulation2.h (modified) (1 diff)
-
source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.h (modified) (2 diffs)
-
source/tools/atlas/AtlasUI/ScenarioEditor/SectionLayout.cpp (modified) (2 diffs)
-
source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp (modified) (1 diff)
-
source/tools/atlas/GameInterface/Messages.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ps/trunk/build/premake/premake.lua
r9607 r9609 824 824 "ScenarioEditor/Sections/Map", 825 825 "ScenarioEditor/Sections/Object", 826 "ScenarioEditor/Sections/Player", 826 827 "ScenarioEditor/Sections/Terrain", 827 828 "ScenarioEditor/Sections/Trigger", -
ps/trunk/source/graphics/MapReader.cpp
r9366 r9609 849 849 XMBElementList entities = parent.GetChildNodes(); 850 850 851 CSimulation2& sim = *m_MapReader.pSimulation2; 852 CmpPtr<ICmpPlayerManager> cmpPlayerManager(sim.GetSimContext(), SYSTEM_ENTITY); 853 851 854 while (entity_idx < entities.Count) 852 855 { … … 904 907 } 905 908 906 CSimulation2& sim = *m_MapReader.pSimulation2;907 909 entity_id_t ent = sim.AddEntity(TemplateName, EntityUid); 908 910 if (ent == INVALID_ENTITY) 911 { 909 912 LOGERROR(L"Failed to load entity template '%ls'", TemplateName.c_str()); 910 else 911 { 913 } 914 else if (cmpPlayerManager->GetPlayerByID(PlayerID) != INVALID_ENTITY) 915 { // Don't add entities with invalid player IDs 916 // TODO: Is a warning OK or should it just silently fail? 917 912 918 CmpPtr<ICmpPosition> cmpPosition(sim, ent); 913 919 if (!cmpPosition.null()) -
ps/trunk/source/simulation2/Simulation2.cpp
r9550 r9609 593 593 std::string CSimulation2::GetPlayerDefaults() 594 594 { 595 VfsPath path = VfsPath(L"simulation/data/player_defaults.json"); 596 595 return ReadJSON(L"simulation/data/player_defaults.json"); 596 } 597 598 std::string CSimulation2::GetMapSizes() 599 { 600 return ReadJSON(L"simulation/data/map_sizes.json"); 601 } 602 603 std::string CSimulation2::ReadJSON(VfsPath path) 604 { 597 605 std::string data; 598 606 -
ps/trunk/source/simulation2/Simulation2.h
r9410 r9609 227 227 std::string GetPlayerDefaults(); 228 228 229 /** 230 * Get map sizes data 231 * 232 * @return string containing JSON format data 233 */ 234 std::string GetMapSizes(); 235 229 236 private: 230 237 CSimulation2Impl* m; 231 238 239 // Helper for reading JSON files 240 std::string ReadJSON(VfsPath path); 241 232 242 NONCOPYABLE(CSimulation2); 233 243 }; -
ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.h
r9566 r9609 65 65 ScriptInterface& GetScriptInterface() const { return m_ScriptInterface; } 66 66 Observable<ObjectSettings>& GetObjectSettings() { return m_ObjectSettings; } 67 Observable<AtObj>& GetMapSettings() { return m_MapSettings; } 67 68 68 69 ToolManager& GetToolManager() { return m_ToolManager; } … … 78 79 79 80 Observable<ObjectSettings> m_ObjectSettings; 81 Observable<AtObj> m_MapSettings; 80 82 81 83 void SetOpenFilename(const wxString& filename); -
ps/trunk/source/tools/atlas/AtlasUI/ScenarioEditor/SectionLayout.cpp
r9569 r9609 32 32 #include "Sections/Map/Map.h" 33 33 #include "Sections/Object/Object.h" 34 #include "Sections/Player/Player.h" 34 35 #include "Sections/Terrain/Terrain.h" 35 36 #include "Sections/Trigger/Trigger.h" … … 289 290 290 291 ADD_SIDEBAR(MapSidebar, _T("map.png"), _("Map")); 292 ADD_SIDEBAR(PlayerSidebar, _T("player.png"), _("Player")); 291 293 ADD_SIDEBAR(TerrainSidebar, _T("terrain.png"), _("Terrain")); 292 294 ADD_SIDEBAR(ObjectSidebar, _T("object.png"), _("Object")); -
ps/trunk/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp
r9566 r9609 140 140 } 141 141 142 MESSAGEHANDLER(SetMapSettings) 143 { 144 g_Game->GetSimulation2()->SetMapSettings(*msg->settings); 145 } 142 QUERYHANDLER(GetMapSizes) 143 { 144 msg->sizes = g_Game->GetSimulation2()->GetMapSizes(); 145 } 146 147 BEGIN_COMMAND(SetMapSettings) 148 { 149 void Do() 150 { 151 Redo(); 152 } 153 154 void Undo() 155 { 156 // TODO 157 debug_warn(L"Can't undo SetMapSettings"); 158 } 159 160 void Redo() 161 { 162 g_Game->GetSimulation2()->SetMapSettings(*msg->settings); 163 } 164 }; 165 END_COMMAND(SetMapSettings) 146 166 147 167 QUERYHANDLER(GetRMSData) -
ps/trunk/source/tools/atlas/GameInterface/Messages.h
r9566 r9609 153 153 ); 154 154 155 MESSAGE(SetMapSettings, 155 QUERY(GetMapSizes, 156 , 157 ((std::string, sizes)) 158 ); 159 160 COMMAND(SetMapSettings, NOMERGE, 156 161 ((std::string, settings)) 157 162 );
Note:
See TracChangeset
for help on using the changeset viewer.
