diff --git a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs index d75728978..8cc951a99 100644 --- a/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs +++ b/Templates/BaseGame/game/tools/worldEditor/scripts/EditorGui.ed.cs @@ -1884,6 +1884,7 @@ function Editor::open(%this) %this.editorEnabled(); Canvas.setContent(EditorGui); + $isFirstPersonVar = true; EditorGui.syncCameraGui(); } diff --git a/Templates/Full/game/core/scripts/client/helperfuncs.cs b/Templates/Full/game/core/scripts/client/helperfuncs.cs index f8988a270..511a47d4a 100644 --- a/Templates/Full/game/core/scripts/client/helperfuncs.cs +++ b/Templates/Full/game/core/scripts/client/helperfuncs.cs @@ -219,7 +219,7 @@ function AggregateControl::callMethod(%this, %method, %args) function parseMissionGroup( %className, %childGroup ) { if( getWordCount( %childGroup ) == 0) - %currentGroup = "MissionGroup"; + %currentGroup = getRootScene(); else %currentGroup = %childGroup; @@ -240,7 +240,7 @@ function parseMissionGroup( %className, %childGroup ) function parseMissionGroupForIds( %className, %childGroup ) { if( getWordCount( %childGroup ) == 0) - %currentGroup = "MissionGroup"; + %currentGroup = getRootScene(); else %currentGroup = %childGroup; diff --git a/Templates/Full/game/core/scripts/server/missionDownload.cs b/Templates/Full/game/core/scripts/server/missionDownload.cs index 2b1168b39..b3bf07ef2 100644 --- a/Templates/Full/game/core/scripts/server/missionDownload.cs +++ b/Templates/Full/game/core/scripts/server/missionDownload.cs @@ -49,7 +49,7 @@ function GameConnection::loadMission(%this) else { commandToClient(%this, 'MissionStartPhase1', $missionSequence, - $Server::MissionFile, MissionGroup.musicTrack); + $Server::MissionFile, getRootScene().musicTrack); echo("*** Sending mission load to client: " @ $Server::MissionFile); } } diff --git a/Templates/Full/game/core/scripts/server/missionLoad.cs b/Templates/Full/game/core/scripts/server/missionLoad.cs index d85b15516..f5acb588b 100644 --- a/Templates/Full/game/core/scripts/server/missionLoad.cs +++ b/Templates/Full/game/core/scripts/server/missionLoad.cs @@ -96,12 +96,12 @@ function loadMissionStage2() // to caching mission lighting. $missionCRC = getFileCRC( %file ); - // Exec the mission. The MissionGroup (loaded components) is added to the ServerGroup + // Exec the mission. The Scene (loaded components) is added to the ServerGroup exec(%file); - if( !isObject(MissionGroup) ) + if( !isObject(getRootScene()) ) { - $Server::LoadFailMsg = "No 'MissionGroup' found in mission \"" @ %file @ "\"."; + $Server::LoadFailMsg = "No 'Scene' found in mission \"" @ %file @ "\"."; } } @@ -145,7 +145,7 @@ function loadMissionStage2() function endMission() { - if (!isObject( MissionGroup )) + if (!isObject( getRootScene() )) return; echo("*** ENDING MISSION"); @@ -163,7 +163,7 @@ function endMission() } // Delete everything - MissionGroup.delete(); + getRootScene().delete(); MissionCleanup.delete(); clearServerPaths(); diff --git a/Templates/Full/game/levels/Empty Room.mis b/Templates/Full/game/levels/Empty Room.mis index c3ba059a4..fdb4665ba 100644 --- a/Templates/Full/game/levels/Empty Room.mis +++ b/Templates/Full/game/levels/Empty Room.mis @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -new SimGroup(MissionGroup) { +new Scene(EmptyLevel) { canSaveDynamicFields = "1"; Enabled = "1"; diff --git a/Templates/Full/game/levels/Empty Terrain.mis b/Templates/Full/game/levels/Empty Terrain.mis index 0428ece36..aa77b6c6b 100644 --- a/Templates/Full/game/levels/Empty Terrain.mis +++ b/Templates/Full/game/levels/Empty Terrain.mis @@ -1,39 +1,57 @@ //--- OBJECT WRITE BEGIN --- -new SimGroup(MissionGroup) { +new Scene(EmptyTerrainLevel) { + canSave = "1"; canSaveDynamicFields = "1"; + isSubscene = "0"; + isEditing = "0"; + isDirty = "0"; enabled = "1"; new LevelInfo(theLevelInfo) { nearClip = "0.1"; visibleDistance = "2000"; + visibleGhostDistance = "0"; decalBias = "0.0015"; fogColor = "1 1 0.6 1"; fogDensity = "0.001"; fogDensityOffset = "10"; fogAtmosphereHeight = "100"; canvasClearColor = "233 220 143 255"; + ambientLightBlendPhase = "1"; + ambientLightBlendCurve = "0 0 -1 -1"; advancedLightmapSupport = "0"; + soundAmbience = "AudioAmbienceDefault"; + soundDistanceModel = "Linear"; + canSave = "1"; + canSaveDynamicFields = "1"; desc0 = "An empty terrain ready to be populated with Torque objects."; - LevelName = "Empty Terrain"; + levelName = "Empty Terrain"; }; new ScatterSky() { skyBrightness = "30"; - mieScattering = "0.0015"; + sunSize = "1"; + colorizeAmount = "0"; + colorize = "0 0 0 1"; rayleighScattering = "0.0035"; sunScale = "1 1 0.8 1"; ambientScale = "0.5 0.5 0.4 1"; + fogScale = "1 1 1 1"; exposure = "0.85"; + zOffset = "0"; azimuth = "84"; elevation = "54"; + moonAzimuth = "0"; + moonElevation = "45"; castShadows = "1"; + staticRefreshFreq = "8"; + dynamicRefreshFreq = "8"; brightness = "1"; - flareType = "SunFlareExample1"; flareScale = "1"; nightColor = "0.0196078 0.0117647 0.109804 1"; + nightFogColor = "0.0196078 0.0117647 0.109804 1"; moonEnabled = "1"; - moonTexture = "core/art/skies/night/moon_wglow"; moonScale = "0.3"; - moonTint = "0.192157 0.192157 0.192157 1"; + moonLightColor = "0.192157 0.192157 0.192157 1"; useNightCubemap = "0"; attenuationRatio = "0 1 1"; shadowType = "PSSM"; @@ -51,40 +69,86 @@ new SimGroup(MissionGroup) { position = "0 0 0"; rotation = "1 0 0 0"; scale = "1 1 1"; + canSave = "1"; canSaveDynamicFields = "1"; + mieScattering = "0.0015"; + moonTexture = "core/art/skies/night/moon_wglow"; + moonTint = "0.192157 0.192157 0.192157 1"; sunBrightness = "50"; }; new TerrainBlock(theTerrain) { terrainFile = "art/terrains/Empty Terrain_0.ter"; + castShadows = "1"; squareSize = "2"; - tile = "0"; baseTexSize = "1024"; + baseTexFormat = "DDS"; + lightMapSize = "256"; screenError = "16"; + ignoreZodiacs = "0"; position = "-1024 -1024 179.978"; rotation = "1 0 0 0"; - scale = "1 1 1"; + canSave = "1"; canSaveDynamicFields = "1"; + scale = "1 1 1"; + tile = "0"; }; new SimGroup(PlayerDropPoints) { + canSave = "1"; canSaveDynamicFields = "1"; enabled = "1"; new SpawnSphere() { autoSpawn = "0"; + spawnTransform = "0"; radius = "1"; sphereWeight = "1"; indoorWeight = "1"; outdoorWeight = "1"; + isAIControlled = "0"; dataBlock = "SpawnSphereMarker"; position = "0 0 241.772"; rotation = "1 0 0 0"; scale = "1 1 1"; + canSave = "1"; canSaveDynamicFields = "1"; enabled = "1"; homingCount = "0"; lockCount = "0"; - TypeBool locked = "False"; }; }; + new ConvexShape() { + Material = "Grid512_OrangeLines_Mat"; + position = "6.31688 13.7911 241.9"; + rotation = "0.475487 0.209976 -0.854296 13.8377"; + scale = "1 1 1"; + canSave = "1"; + canSaveDynamicFields = "1"; + + surface = "0 0 0 1 0 0 1.58549"; + surface = "0 1 0 0 0 0 -1.58549"; + surface = "0.707107 0 0 0.707107 0 4.99426 0"; + surface = "0 0.707107 -0.707107 0 0 -4.99426 0"; + surface = "0.5 0.5 -0.5 0.5 -4.01359 0 0"; + surface = "0.5 -0.5 0.5 0.5 4.01359 0 0"; + }; + new MeshRoad() { + topMaterial = "DefaultRoadMaterialTop"; + bottomMaterial = "DefaultRoadMaterialOther"; + sideMaterial = "DefaultRoadMaterialOther"; + textureLength = "5"; + breakAngle = "3"; + widthSubdivisions = "0"; + position = "46.4415 52.221 236.031"; + rotation = "1 0 0 0"; + scale = "1 1 1"; + canSave = "1"; + canSaveDynamicFields = "1"; + + Node = "46.4415 52.221 236.031 10 5 0 0 1"; + Node = "21.9538 4.57701 242.652 10 5 0 0 1"; + Node = "1.52535 -12.3952 243.532 10 5 0 0 1"; + Node = "-47.4526 30.2515 249.092 10 5 0 0 1"; + Node = "-26.0405 51.9559 255.77 10 5 0 0 1"; + }; }; //--- OBJECT WRITE END --- diff --git a/Templates/Full/game/levels/Outpost.mis b/Templates/Full/game/levels/Outpost.mis index 6a7045e30..8b1cda54b 100644 --- a/Templates/Full/game/levels/Outpost.mis +++ b/Templates/Full/game/levels/Outpost.mis @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -new SimGroup(MissionGroup) { +new Scene(OutpostLevel) { canSave = "1"; canSaveDynamicFields = "1"; enabled = "1"; diff --git a/Templates/Full/game/scripts/server/gameCore.cs b/Templates/Full/game/scripts/server/gameCore.cs index bb7aed714..9917d1048 100644 --- a/Templates/Full/game/scripts/server/gameCore.cs +++ b/Templates/Full/game/scripts/server/gameCore.cs @@ -134,12 +134,12 @@ package GameCore // to caching mission lighting. $missionCRC = getFileCRC( %file ); - // Exec the mission. The MissionGroup (loaded components) is added to the ServerGroup + // Exec the mission. The Scene (loaded components) is added to the ServerGroup exec(%file); - if( !isObject(MissionGroup) ) + if( !isObject(getRootScene()) ) { - $Server::LoadFailMsg = "No 'MissionGroup' found in mission \"" @ %file @ "\"."; + $Server::LoadFailMsg = "No Scene found in mission \"" @ %file @ "\"."; } } diff --git a/Templates/Full/game/scripts/server/item.cs b/Templates/Full/game/scripts/server/item.cs index f4f355386..ad6859b9e 100644 --- a/Templates/Full/game/scripts/server/item.cs +++ b/Templates/Full/game/scripts/server/item.cs @@ -92,7 +92,7 @@ function ItemData::onThrow(%this, %user, %amount) rotation = "0 0 1 "@ (getRandom() * 360); count = %amount; }; - MissionGroup.add(%obj); + getRootScene().add(%obj); %obj.schedulePop(); return %obj; } diff --git a/Templates/Full/game/scripts/server/turret.cs b/Templates/Full/game/scripts/server/turret.cs index 19b19ed22..be43d7043 100644 --- a/Templates/Full/game/scripts/server/turret.cs +++ b/Templates/Full/game/scripts/server/turret.cs @@ -87,7 +87,7 @@ function TurretShapeData::onRemove(%this, %obj) } // This is on MissionGroup so it doesn't happen when the mission has ended -function MissionGroup::respawnTurret(%this, %datablock, %className, %transform, %static, %respawn) +function Scene::respawnTurret(%this, %datablock, %className, %transform, %static, %respawn) { %turret = new (%className)() { @@ -97,7 +97,7 @@ function MissionGroup::respawnTurret(%this, %datablock, %className, %transform, }; %turret.setTransform(%transform); - MissionGroup.add(%turret); + getRootScene().add(%turret); return %turret; } @@ -149,7 +149,7 @@ function TurretShapeData::onDestroyed(%this, %obj, %lastState) if (%obj.doRespawn()) { - MissionGroup.schedule($TurretShape::RespawnTime, "respawnTurret", %this, %obj.getClassName(), %obj.getTransform(), true, true); + getRootScene().schedule($TurretShape::RespawnTime, "respawnTurret", %this, %obj.getClassName(), %obj.getTransform(), true, true); } } @@ -331,7 +331,7 @@ function AITurretShapeData::onThrow(%this, %user, %amount) client = %user.client; isAiControlled = true; }; - MissionGroup.add(%obj); + getRootScene().add(%obj); // Let the turret know that we're a firend %obj.addToIgnoreList(%user); diff --git a/Templates/Full/game/shaders/.gitignore b/Templates/Full/game/shaders/.gitignore deleted file mode 100644 index 5baa4d384..000000000 --- a/Templates/Full/game/shaders/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/procedural/ diff --git a/Templates/Full/game/shaders/procedural/.gitignore b/Templates/Full/game/shaders/procedural/.gitignore new file mode 100644 index 000000000..013488d4e --- /dev/null +++ b/Templates/Full/game/shaders/procedural/.gitignore @@ -0,0 +1,2 @@ +*.hlsl +*.glsl \ No newline at end of file diff --git a/Templates/Full/game/tools/convexEditor/main.cs b/Templates/Full/game/tools/convexEditor/main.cs index 496140cd4..54de25d02 100644 --- a/Templates/Full/game/tools/convexEditor/main.cs +++ b/Templates/Full/game/tools/convexEditor/main.cs @@ -189,7 +189,7 @@ function ConvexEditorPlugin::onSaveMission( %this, %missionFile ) { if( ConvexEditorGui.isDirty ) { - MissionGroup.save( %missionFile ); + getRootScene().save( %missionFile ); ConvexEditorGui.isDirty = false; } } diff --git a/Templates/Full/game/tools/gui/colladaImport.ed.gui b/Templates/Full/game/tools/gui/colladaImport.ed.gui index 30838c76d..b83c1e477 100644 --- a/Templates/Full/game/tools/gui/colladaImport.ed.gui +++ b/Templates/Full/game/tools/gui/colladaImport.ed.gui @@ -1584,7 +1584,7 @@ function ColladaImportDlg::onOK(%this) function ColladaImportDlg::loadLights(%this) { // Get the ID of the last object added - %obj = MissionGroup.getObject(MissionGroup.getCount()-1); + %obj = getRootScene().getObject(getRootScene().getCount()-1); // Create a new SimGroup to hold the model and lights %group = new SimGroup(); @@ -1596,7 +1596,7 @@ function ColladaImportDlg::loadLights(%this) { %group.add(%obj); %group.bringToFront(%obj); - MissionGroup.add(%group); + getRootScene().add(%group); if (EditorTree.isVisible()) { EditorTree.removeItem(EditorTree.findItemByObjectId(%obj)); diff --git a/Templates/Full/game/tools/levels/BlankRoom.mis b/Templates/Full/game/tools/levels/BlankRoom.mis index 5ca65ed5a..bbef5d24f 100644 --- a/Templates/Full/game/tools/levels/BlankRoom.mis +++ b/Templates/Full/game/tools/levels/BlankRoom.mis @@ -1,5 +1,5 @@ //--- OBJECT WRITE BEGIN --- -new SimGroup(MissionGroup) { +new Scene(EditorTemplateLevel) { canSaveDynamicFields = "1"; cdTrack = "2"; CTF_scoreLimit = "5"; diff --git a/Templates/Full/game/tools/materialEditor/scripts/materialEditor.ed.cs b/Templates/Full/game/tools/materialEditor/scripts/materialEditor.ed.cs index b4e85229f..5d4a9a7ba 100644 --- a/Templates/Full/game/tools/materialEditor/scripts/materialEditor.ed.cs +++ b/Templates/Full/game/tools/materialEditor/scripts/materialEditor.ed.cs @@ -1051,7 +1051,7 @@ function MaterialEditorGui::updateActiveMaterialName(%this, %name) // Some objects (ConvexShape, DecalRoad etc) reference Materials by name => need // to find and update all these references so they don't break when we rename the // Material. - MaterialEditorGui.updateMaterialReferences( MissionGroup, %action.oldName, %action.newName ); + MaterialEditorGui.updateMaterialReferences( getRootScene(), %action.oldName, %action.newName ); } function MaterialEditorGui::updateMaterialReferences( %this, %obj, %oldName, %newName ) diff --git a/Templates/Full/game/tools/materialEditor/scripts/materialEditorUndo.ed.cs b/Templates/Full/game/tools/materialEditor/scripts/materialEditorUndo.ed.cs index 184f02ce4..2adf419ca 100644 --- a/Templates/Full/game/tools/materialEditor/scripts/materialEditorUndo.ed.cs +++ b/Templates/Full/game/tools/materialEditor/scripts/materialEditorUndo.ed.cs @@ -187,7 +187,7 @@ function ActionUpdateActiveMaterialAnimationFlags::undo(%this) function ActionUpdateActiveMaterialName::redo(%this) { %this.material.setName(%this.newName); - MaterialEditorGui.updateMaterialReferences( MissionGroup, %this.oldName, %this.newName ); + MaterialEditorGui.updateMaterialReferences( getRootScene(), %this.oldName, %this.newName ); if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material ) { @@ -199,7 +199,7 @@ function ActionUpdateActiveMaterialName::redo(%this) function ActionUpdateActiveMaterialName::undo(%this) { %this.material.setName(%this.oldName); - MaterialEditorGui.updateMaterialReferences( MissionGroup, %this.newName, %this.oldName ); + MaterialEditorGui.updateMaterialReferences( getRootScene(), %this.newName, %this.oldName ); if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material ) { diff --git a/Templates/Full/game/tools/meshRoadEditor/main.cs b/Templates/Full/game/tools/meshRoadEditor/main.cs index d101e50b0..5b76bcd63 100644 --- a/Templates/Full/game/tools/meshRoadEditor/main.cs +++ b/Templates/Full/game/tools/meshRoadEditor/main.cs @@ -164,7 +164,7 @@ function MeshRoadEditorPlugin::onSaveMission( %this, %missionFile ) { if( MeshRoadEditorGui.isDirty ) { - MissionGroup.save( %missionFile ); + getRootScene().save( %missionFile ); MeshRoadEditorGui.isDirty = false; } } diff --git a/Templates/Full/game/tools/missionAreaEditor/main.cs b/Templates/Full/game/tools/missionAreaEditor/main.cs index 000197bc6..ebb62bb9c 100644 --- a/Templates/Full/game/tools/missionAreaEditor/main.cs +++ b/Templates/Full/game/tools/missionAreaEditor/main.cs @@ -114,7 +114,7 @@ function MissionAreaEditorPlugin::createNewMissionArea(%this) %newMissionArea = new MissionArea(); %newMissionArea.area = "-256 -256 512 512"; - MissionGroup.add(%newMissionArea); + getRootScene().add(%newMissionArea); EditorGui.setEditor(MissionAreaEditorPlugin); diff --git a/Templates/Full/game/tools/navEditor/CreateNewNavMeshDlg.gui b/Templates/Full/game/tools/navEditor/CreateNewNavMeshDlg.gui index 755bce30a..af39140c9 100644 --- a/Templates/Full/game/tools/navEditor/CreateNewNavMeshDlg.gui +++ b/Templates/Full/game/tools/navEditor/CreateNewNavMeshDlg.gui @@ -354,13 +354,13 @@ function CreateNewNavMeshDlg::create(%this) if(MeshMissionBounds.isStateOn()) { - if(!isObject(MissionGroup)) + if(!isObject(getRootScene())) { - MessageBoxOk("Error", "You must have a MissionGroup to use the mission bounds function."); + MessageBoxOk("Error", "You must have a Scene to use the mission bounds function."); return; } // Get maximum extents of all objects. - %box = MissionBoundsExtents(MissionGroup); + %box = MissionBoundsExtents(getRootScene()); %pos = GetBoxCenter(%box); %scale = (GetWord(%box, 3) - GetWord(%box, 0)) / 2 + 5 SPC (GetWord(%box, 4) - GetWord(%box, 1)) / 2 + 5 @@ -380,7 +380,7 @@ function CreateNewNavMeshDlg::create(%this) scale = %this-->MeshScale.getText(); }; } - MissionGroup.add(%mesh); + getRootScene().add(%mesh); NavEditorGui.selectObject(%mesh); Canvas.popDialog(CreateNewNavMeshDlg); diff --git a/Templates/Full/game/tools/navEditor/main.cs b/Templates/Full/game/tools/navEditor/main.cs index 6af3abf19..2a742bf51 100644 --- a/Templates/Full/game/tools/navEditor/main.cs +++ b/Templates/Full/game/tools/navEditor/main.cs @@ -205,7 +205,7 @@ function NavEditorPlugin::onSaveMission(%this, %missionFile) { if(NavEditorGui.isDirty) { - MissionGroup.save(%missionFile); + getRootScene().save(%missionFile); NavEditorGui.isDirty = false; } } diff --git a/Templates/Full/game/tools/riverEditor/main.cs b/Templates/Full/game/tools/riverEditor/main.cs index eafb3c3c8..1c6ce72ed 100644 --- a/Templates/Full/game/tools/riverEditor/main.cs +++ b/Templates/Full/game/tools/riverEditor/main.cs @@ -178,7 +178,7 @@ function RiverEditorPlugin::onSaveMission( %this, %missionFile ) { if( RiverEditorGui.isDirty ) { - MissionGroup.save( %missionFile ); + getRootScene().save( %missionFile ); RiverEditorGui.isDirty = false; } } diff --git a/Templates/Full/game/tools/roadEditor/main.cs b/Templates/Full/game/tools/roadEditor/main.cs index f45823670..9b2f70f56 100644 --- a/Templates/Full/game/tools/roadEditor/main.cs +++ b/Templates/Full/game/tools/roadEditor/main.cs @@ -156,7 +156,7 @@ function RoadEditorPlugin::onSaveMission( %this, %missionFile ) { if( RoadEditorGui.isDirty ) { - MissionGroup.save( %missionFile ); + getRootScene().save( %missionFile ); RoadEditorGui.isDirty = false; } } diff --git a/Templates/Full/game/tools/shapeEditor/main.cs b/Templates/Full/game/tools/shapeEditor/main.cs index 721313e95..1c021cb01 100644 --- a/Templates/Full/game/tools/shapeEditor/main.cs +++ b/Templates/Full/game/tools/shapeEditor/main.cs @@ -168,7 +168,7 @@ function ShapeEditorPlugin::open(%this, %filename) ShapeEdNodes-->worldTransform.setStateOn(1); // Initialise and show the shape editor - ShapeEdShapeTreeView.open(MissionGroup); + ShapeEdShapeTreeView.open(getRootScene()); ShapeEdShapeTreeView.buildVisibleTree(true); ShapeEdPreviewGui.setVisible(true); diff --git a/Templates/Full/game/tools/worldEditor/gui/TimeAdjustGui.ed.gui b/Templates/Full/game/tools/worldEditor/gui/TimeAdjustGui.ed.gui index 8eaf11d4c..9f36921ad 100644 --- a/Templates/Full/game/tools/worldEditor/gui/TimeAdjustGui.ed.gui +++ b/Templates/Full/game/tools/worldEditor/gui/TimeAdjustGui.ed.gui @@ -184,11 +184,11 @@ function TimeAdjustSliderCtrl::onAction(%this) if ( !isObject( %this.tod ) ) { - if ( isObject( MissionGroup ) ) + if ( isObject( getRootScene() ) ) { - for ( %i = 0; %i < MissionGroup.getCount(); %i++ ) + for ( %i = 0; %i < getRootScene().getCount(); %i++ ) { - %obj = MissionGroup.getObject( %i ); + %obj = getRootScene().getObject( %i ); if ( %obj.getClassName() $= "TimeOfDay" ) { diff --git a/Templates/Full/game/tools/worldEditor/gui/objectBuilderGui.ed.gui b/Templates/Full/game/tools/worldEditor/gui/objectBuilderGui.ed.gui index 74f1200c6..a1bc87507 100644 --- a/Templates/Full/game/tools/worldEditor/gui/objectBuilderGui.ed.gui +++ b/Templates/Full/game/tools/worldEditor/gui/objectBuilderGui.ed.gui @@ -947,10 +947,10 @@ function ObjectBuilderGui::buildPlayerDropPoint(%this) %this.addField("spawnClass", "TypeString", "Spawn Class", "Player"); %this.addField("spawnDatablock", "TypeDataBlock", "Spawn Data", "PlayerData DefaultPlayerData"); - if( EWCreatorWindow.objectGroup.getID() == MissionGroup.getID() ) + if( EWCreatorWindow.objectGroup.getID() == getRootScene().getID() ) { if( !isObject("PlayerDropPoints") ) - MissionGroup.add( new SimGroup("PlayerDropPoints") ); + getRootScene().add( new SimGroup("PlayerDropPoints") ); %this.objectGroup = "PlayerDropPoints"; } @@ -967,10 +967,10 @@ function ObjectBuilderGui::buildObserverDropPoint(%this) %this.addField("spawnClass", "TypeString", "Spawn Class", "Camera"); %this.addField("spawnDatablock", "TypeDataBlock", "Spawn Data", "CameraData Observer"); - if( EWCreatorWindow.objectGroup.getID() == MissionGroup.getID() ) + if( EWCreatorWindow.objectGroup.getID() == getRootScene().getID() ) { if( !isObject("ObserverDropPoints") ) - MissionGroup.add( new SimGroup("ObserverDropPoints") ); + getRootScene().add( new SimGroup("ObserverDropPoints") ); %this.objectGroup = "ObserverDropPoints"; } diff --git a/Templates/Full/game/tools/worldEditor/scripts/EditorGui.ed.cs b/Templates/Full/game/tools/worldEditor/scripts/EditorGui.ed.cs index 329846cb5..f8bb433ff 100644 --- a/Templates/Full/game/tools/worldEditor/scripts/EditorGui.ed.cs +++ b/Templates/Full/game/tools/worldEditor/scripts/EditorGui.ed.cs @@ -645,7 +645,7 @@ function EditorGui::addCameraBookmark( %this, %name ) if( !isObject(CameraBookmarks) ) { %grp = new SimGroup(CameraBookmarks); - MissionGroup.add(%grp); + getRootScene().add(%grp); } CameraBookmarks.add( %obj ); @@ -843,12 +843,17 @@ function EditorGui::syncCameraGui( %this ) function WorldEditorPlugin::onActivated( %this ) { + if(!isObject(Scenes)) + $scenesRootGroup = new SimGroup(Scenes); + + $scenesRootGroup.add(getRootScene()); + EditorGui.bringToFront( EWorldEditor ); EWorldEditor.setVisible(true); EditorGui.menuBar.insert( EditorGui.worldMenu, EditorGui.menuBar.dynamicItemInsertPos ); EWorldEditor.makeFirstResponder(true); - EditorTree.open(MissionGroup,true); - EWCreatorWindow.setNewObjectGroup(MissionGroup); + EditorTree.open($scenesRootGroup,true); + EWCreatorWindow.setNewObjectGroup(getRootScene()); EWorldEditor.syncGui(); @@ -1472,7 +1477,7 @@ function EditorTree::onDeleteObject( %this, %object ) return true; if( %object == EWCreatorWindow.objectGroup ) - EWCreatorWindow.setNewObjectGroup( MissionGroup ); + EWCreatorWindow.setNewObjectGroup( getRootScene() ); // Append it to our list. %this.undoDeleteList = %this.undoDeleteList TAB %object; @@ -1604,6 +1609,13 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj ) { %popup.item[ 0 ] = "Add Camera Bookmark" TAB "" TAB "EditorGui.addCameraBookmarkByGui();"; } + else if( %obj.isMemberOfClass( "Scene" )) + { + %popup.item[ 0 ] = "Set as Active Scene" TAB "" TAB "EditorTree.showItemRenameCtrl( EditorTree.findItemByObjectId(" @ %popup.object @ ") );"; + %popup.item[ 1 ] = "Delete" TAB "" TAB "EWorldEditor.deleteMissionObject(" @ %popup.object @ ");"; + %popup.item[ 2 ] = "Inspect" TAB "" TAB "inspectObject(" @ %popup.object @ ");"; + %popup.item[ 3 ] = "-"; + } else { %popup.object = %obj; @@ -1681,8 +1693,8 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj ) if( %haveObjectEntries ) { - %popup.enableItem( 0, %obj.isNameChangeAllowed() && %obj.getName() !$= "MissionGroup" ); - %popup.enableItem( 1, %obj.getName() !$= "MissionGroup" ); + %popup.enableItem( 0, %obj.isNameChangeAllowed() && %obj.getName() !$= getRootScene() ); + %popup.enableItem( 1, %obj.getName() !$= getRootScene() ); if( %haveLockAndHideEntries ) { @@ -2034,21 +2046,21 @@ function EWorldEditor::syncToolPalette( %this ) function EWorldEditor::addSimGroup( %this, %groupCurrentSelection ) { %activeSelection = %this.getActiveSelection(); - if ( %activeSelection.getObjectIndex( MissionGroup ) != -1 ) + if ( %activeSelection.getObjectIndex( getRootScene() ) != -1 ) { - MessageBoxOK( "Error", "Cannot add MissionGroup to a new SimGroup" ); + MessageBoxOK( "Error", "Cannot add Scene to a new SimGroup" ); return; } // Find our parent. - %parent = MissionGroup; + %parent = getRootScene(); if( !%groupCurrentSelection && isObject( %activeSelection ) && %activeSelection.getCount() > 0 ) { %firstSelectedObject = %activeSelection.getObject( 0 ); if( %firstSelectedObject.isMemberOfClass( "SimGroup" ) ) %parent = %firstSelectedObject; - else if( %firstSelectedObject.getId() != MissionGroup.getId() ) + else if( %firstSelectedObject.getId() != getRootScene().getId() ) %parent = %firstSelectedObject.parentGroup; } diff --git a/Templates/Full/game/tools/worldEditor/scripts/SelectObjectsWindow.ed.cs b/Templates/Full/game/tools/worldEditor/scripts/SelectObjectsWindow.ed.cs index 2c436f74f..f6c11b41b 100644 --- a/Templates/Full/game/tools/worldEditor/scripts/SelectObjectsWindow.ed.cs +++ b/Templates/Full/game/tools/worldEditor/scripts/SelectObjectsWindow.ed.cs @@ -40,7 +40,7 @@ function ESelectObjectsWindow::toggleVisibility( %this ) /// to start searching for objects. function ESelectObjectsWindow::getRootGroup( %this ) { - return MissionGroup; + return getRootScene(); } //--------------------------------------------------------------------------------------------- diff --git a/Templates/Full/game/tools/worldEditor/scripts/editors/creator.ed.cs b/Templates/Full/game/tools/worldEditor/scripts/editors/creator.ed.cs index 006031668..1271bf33d 100644 --- a/Templates/Full/game/tools/worldEditor/scripts/editors/creator.ed.cs +++ b/Templates/Full/game/tools/worldEditor/scripts/editors/creator.ed.cs @@ -179,7 +179,7 @@ function EWCreatorWindow::createStatic( %this, %file ) return; if( !isObject(%this.objectGroup) ) - %this.setNewObjectGroup( MissionGroup ); + %this.setNewObjectGroup( getRootScene() ); %objId = new TSStatic() { @@ -197,7 +197,7 @@ function EWCreatorWindow::createPrefab( %this, %file ) return; if( !isObject(%this.objectGroup) ) - %this.setNewObjectGroup( MissionGroup ); + %this.setNewObjectGroup( getRootScene() ); %objId = new Prefab() { @@ -215,7 +215,7 @@ function EWCreatorWindow::createObject( %this, %cmd ) return; if( !isObject(%this.objectGroup) ) - %this.setNewObjectGroup( MissionGroup ); + %this.setNewObjectGroup( getRootScene() ); pushInstantGroup(); %objId = eval(%cmd); diff --git a/Templates/Full/game/tools/worldEditor/scripts/editors/worldEditor.ed.cs b/Templates/Full/game/tools/worldEditor/scripts/editors/worldEditor.ed.cs index eb89d1a30..1258fe8fa 100644 --- a/Templates/Full/game/tools/worldEditor/scripts/editors/worldEditor.ed.cs +++ b/Templates/Full/game/tools/worldEditor/scripts/editors/worldEditor.ed.cs @@ -124,6 +124,12 @@ function WorldEditor::onSelectionCentroidChanged( %this ) Inspector.refresh(); } +function WorldEditor::setSceneAsDirty(%this) +{ + EWorldEditor.isDirty = true; + +} + ////////////////////////////////////////////////////////////////////////// function WorldEditor::init(%this) @@ -198,7 +204,7 @@ function WorldEditor::export(%this) function WorldEditor::doExport(%this, %file) { - missionGroup.save("~/editor/" @ %file, true); + getRootScene().save("~/editor/" @ %file, true); } function WorldEditor::import(%this) diff --git a/Templates/Full/game/tools/worldEditor/scripts/menuHandlers.ed.cs b/Templates/Full/game/tools/worldEditor/scripts/menuHandlers.ed.cs index f476ccaeb..9b3518469 100644 --- a/Templates/Full/game/tools/worldEditor/scripts/menuHandlers.ed.cs +++ b/Templates/Full/game/tools/worldEditor/scripts/menuHandlers.ed.cs @@ -272,7 +272,7 @@ function EditorSaveMission() // now write the terrain and mission files out: if(EWorldEditor.isDirty || ETerrainEditor.isMissionDirty) - MissionGroup.save($Server::MissionFile); + getRootScene().save($Server::MissionFile); if(ETerrainEditor.isDirty) { // Find all of the terrain files @@ -483,6 +483,21 @@ function EditorOpenMission(%filename) } } +function EditorOpenSceneAppend(%levelAsset) +{ + //Load the asset's level file + exec(%levelAsset.levelFile); + + //We'll assume the scene name and assetname are the same for now + %sceneName = %levelAsset.AssetName; + %scene = nameToID(%sceneName); + if(isObject(%scene)) + { + //Append it to our scene heirarchy + $scenesRootGroup.add(%scene); + } +} + function EditorExportToCollada() {