Failed to get the Scene changes for the Full template rolled up. This corrects that.

This commit is contained in:
Areloch 2019-03-31 22:12:38 -05:00
parent 582e4f0130
commit 5cefad72b3
31 changed files with 167 additions and 68 deletions

View file

@ -1884,6 +1884,7 @@ function Editor::open(%this)
%this.editorEnabled(); %this.editorEnabled();
Canvas.setContent(EditorGui); Canvas.setContent(EditorGui);
$isFirstPersonVar = true;
EditorGui.syncCameraGui(); EditorGui.syncCameraGui();
} }

View file

@ -219,7 +219,7 @@ function AggregateControl::callMethod(%this, %method, %args)
function parseMissionGroup( %className, %childGroup ) function parseMissionGroup( %className, %childGroup )
{ {
if( getWordCount( %childGroup ) == 0) if( getWordCount( %childGroup ) == 0)
%currentGroup = "MissionGroup"; %currentGroup = getRootScene();
else else
%currentGroup = %childGroup; %currentGroup = %childGroup;
@ -240,7 +240,7 @@ function parseMissionGroup( %className, %childGroup )
function parseMissionGroupForIds( %className, %childGroup ) function parseMissionGroupForIds( %className, %childGroup )
{ {
if( getWordCount( %childGroup ) == 0) if( getWordCount( %childGroup ) == 0)
%currentGroup = "MissionGroup"; %currentGroup = getRootScene();
else else
%currentGroup = %childGroup; %currentGroup = %childGroup;

View file

@ -49,7 +49,7 @@ function GameConnection::loadMission(%this)
else else
{ {
commandToClient(%this, 'MissionStartPhase1', $missionSequence, commandToClient(%this, 'MissionStartPhase1', $missionSequence,
$Server::MissionFile, MissionGroup.musicTrack); $Server::MissionFile, getRootScene().musicTrack);
echo("*** Sending mission load to client: " @ $Server::MissionFile); echo("*** Sending mission load to client: " @ $Server::MissionFile);
} }
} }

View file

@ -96,12 +96,12 @@ function loadMissionStage2()
// to caching mission lighting. // to caching mission lighting.
$missionCRC = getFileCRC( %file ); $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); 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() function endMission()
{ {
if (!isObject( MissionGroup )) if (!isObject( getRootScene() ))
return; return;
echo("*** ENDING MISSION"); echo("*** ENDING MISSION");
@ -163,7 +163,7 @@ function endMission()
} }
// Delete everything // Delete everything
MissionGroup.delete(); getRootScene().delete();
MissionCleanup.delete(); MissionCleanup.delete();
clearServerPaths(); clearServerPaths();

View file

@ -1,5 +1,5 @@
//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE BEGIN ---
new SimGroup(MissionGroup) { new Scene(EmptyLevel) {
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
Enabled = "1"; Enabled = "1";

View file

@ -1,39 +1,57 @@
//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE BEGIN ---
new SimGroup(MissionGroup) { new Scene(EmptyTerrainLevel) {
canSave = "1";
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
isSubscene = "0";
isEditing = "0";
isDirty = "0";
enabled = "1"; enabled = "1";
new LevelInfo(theLevelInfo) { new LevelInfo(theLevelInfo) {
nearClip = "0.1"; nearClip = "0.1";
visibleDistance = "2000"; visibleDistance = "2000";
visibleGhostDistance = "0";
decalBias = "0.0015"; decalBias = "0.0015";
fogColor = "1 1 0.6 1"; fogColor = "1 1 0.6 1";
fogDensity = "0.001"; fogDensity = "0.001";
fogDensityOffset = "10"; fogDensityOffset = "10";
fogAtmosphereHeight = "100"; fogAtmosphereHeight = "100";
canvasClearColor = "233 220 143 255"; canvasClearColor = "233 220 143 255";
ambientLightBlendPhase = "1";
ambientLightBlendCurve = "0 0 -1 -1";
advancedLightmapSupport = "0"; advancedLightmapSupport = "0";
soundAmbience = "AudioAmbienceDefault";
soundDistanceModel = "Linear";
canSave = "1";
canSaveDynamicFields = "1";
desc0 = "An empty terrain ready to be populated with Torque objects."; desc0 = "An empty terrain ready to be populated with Torque objects.";
LevelName = "Empty Terrain"; levelName = "Empty Terrain";
}; };
new ScatterSky() { new ScatterSky() {
skyBrightness = "30"; skyBrightness = "30";
mieScattering = "0.0015"; sunSize = "1";
colorizeAmount = "0";
colorize = "0 0 0 1";
rayleighScattering = "0.0035"; rayleighScattering = "0.0035";
sunScale = "1 1 0.8 1"; sunScale = "1 1 0.8 1";
ambientScale = "0.5 0.5 0.4 1"; ambientScale = "0.5 0.5 0.4 1";
fogScale = "1 1 1 1";
exposure = "0.85"; exposure = "0.85";
zOffset = "0";
azimuth = "84"; azimuth = "84";
elevation = "54"; elevation = "54";
moonAzimuth = "0";
moonElevation = "45";
castShadows = "1"; castShadows = "1";
staticRefreshFreq = "8";
dynamicRefreshFreq = "8";
brightness = "1"; brightness = "1";
flareType = "SunFlareExample1";
flareScale = "1"; flareScale = "1";
nightColor = "0.0196078 0.0117647 0.109804 1"; nightColor = "0.0196078 0.0117647 0.109804 1";
nightFogColor = "0.0196078 0.0117647 0.109804 1";
moonEnabled = "1"; moonEnabled = "1";
moonTexture = "core/art/skies/night/moon_wglow";
moonScale = "0.3"; moonScale = "0.3";
moonTint = "0.192157 0.192157 0.192157 1"; moonLightColor = "0.192157 0.192157 0.192157 1";
useNightCubemap = "0"; useNightCubemap = "0";
attenuationRatio = "0 1 1"; attenuationRatio = "0 1 1";
shadowType = "PSSM"; shadowType = "PSSM";
@ -51,40 +69,86 @@ new SimGroup(MissionGroup) {
position = "0 0 0"; position = "0 0 0";
rotation = "1 0 0 0"; rotation = "1 0 0 0";
scale = "1 1 1"; scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
mieScattering = "0.0015";
moonTexture = "core/art/skies/night/moon_wglow";
moonTint = "0.192157 0.192157 0.192157 1";
sunBrightness = "50"; sunBrightness = "50";
}; };
new TerrainBlock(theTerrain) { new TerrainBlock(theTerrain) {
terrainFile = "art/terrains/Empty Terrain_0.ter"; terrainFile = "art/terrains/Empty Terrain_0.ter";
castShadows = "1";
squareSize = "2"; squareSize = "2";
tile = "0";
baseTexSize = "1024"; baseTexSize = "1024";
baseTexFormat = "DDS";
lightMapSize = "256";
screenError = "16"; screenError = "16";
ignoreZodiacs = "0";
position = "-1024 -1024 179.978"; position = "-1024 -1024 179.978";
rotation = "1 0 0 0"; rotation = "1 0 0 0";
scale = "1 1 1"; canSave = "1";
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
scale = "1 1 1";
tile = "0";
}; };
new SimGroup(PlayerDropPoints) { new SimGroup(PlayerDropPoints) {
canSave = "1";
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
enabled = "1"; enabled = "1";
new SpawnSphere() { new SpawnSphere() {
autoSpawn = "0"; autoSpawn = "0";
spawnTransform = "0";
radius = "1"; radius = "1";
sphereWeight = "1"; sphereWeight = "1";
indoorWeight = "1"; indoorWeight = "1";
outdoorWeight = "1"; outdoorWeight = "1";
isAIControlled = "0";
dataBlock = "SpawnSphereMarker"; dataBlock = "SpawnSphereMarker";
position = "0 0 241.772"; position = "0 0 241.772";
rotation = "1 0 0 0"; rotation = "1 0 0 0";
scale = "1 1 1"; scale = "1 1 1";
canSave = "1";
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
enabled = "1"; enabled = "1";
homingCount = "0"; homingCount = "0";
lockCount = "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 --- //--- OBJECT WRITE END ---

View file

@ -1,5 +1,5 @@
//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE BEGIN ---
new SimGroup(MissionGroup) { new Scene(OutpostLevel) {
canSave = "1"; canSave = "1";
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
enabled = "1"; enabled = "1";

View file

@ -134,12 +134,12 @@ package GameCore
// to caching mission lighting. // to caching mission lighting.
$missionCRC = getFileCRC( %file ); $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); exec(%file);
if( !isObject(MissionGroup) ) if( !isObject(getRootScene()) )
{ {
$Server::LoadFailMsg = "No 'MissionGroup' found in mission \"" @ %file @ "\"."; $Server::LoadFailMsg = "No Scene found in mission \"" @ %file @ "\".";
} }
} }

View file

@ -92,7 +92,7 @@ function ItemData::onThrow(%this, %user, %amount)
rotation = "0 0 1 "@ (getRandom() * 360); rotation = "0 0 1 "@ (getRandom() * 360);
count = %amount; count = %amount;
}; };
MissionGroup.add(%obj); getRootScene().add(%obj);
%obj.schedulePop(); %obj.schedulePop();
return %obj; return %obj;
} }

View file

@ -87,7 +87,7 @@ function TurretShapeData::onRemove(%this, %obj)
} }
// This is on MissionGroup so it doesn't happen when the mission has ended // 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)() %turret = new (%className)()
{ {
@ -97,7 +97,7 @@ function MissionGroup::respawnTurret(%this, %datablock, %className, %transform,
}; };
%turret.setTransform(%transform); %turret.setTransform(%transform);
MissionGroup.add(%turret); getRootScene().add(%turret);
return %turret; return %turret;
} }
@ -149,7 +149,7 @@ function TurretShapeData::onDestroyed(%this, %obj, %lastState)
if (%obj.doRespawn()) 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; client = %user.client;
isAiControlled = true; isAiControlled = true;
}; };
MissionGroup.add(%obj); getRootScene().add(%obj);
// Let the turret know that we're a firend // Let the turret know that we're a firend
%obj.addToIgnoreList(%user); %obj.addToIgnoreList(%user);

View file

@ -1 +0,0 @@
/procedural/

View file

@ -0,0 +1,2 @@
*.hlsl
*.glsl

View file

@ -189,7 +189,7 @@ function ConvexEditorPlugin::onSaveMission( %this, %missionFile )
{ {
if( ConvexEditorGui.isDirty ) if( ConvexEditorGui.isDirty )
{ {
MissionGroup.save( %missionFile ); getRootScene().save( %missionFile );
ConvexEditorGui.isDirty = false; ConvexEditorGui.isDirty = false;
} }
} }

View file

@ -1584,7 +1584,7 @@ function ColladaImportDlg::onOK(%this)
function ColladaImportDlg::loadLights(%this) function ColladaImportDlg::loadLights(%this)
{ {
// Get the ID of the last object added // 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 // Create a new SimGroup to hold the model and lights
%group = new SimGroup(); %group = new SimGroup();
@ -1596,7 +1596,7 @@ function ColladaImportDlg::loadLights(%this)
{ {
%group.add(%obj); %group.add(%obj);
%group.bringToFront(%obj); %group.bringToFront(%obj);
MissionGroup.add(%group); getRootScene().add(%group);
if (EditorTree.isVisible()) if (EditorTree.isVisible())
{ {
EditorTree.removeItem(EditorTree.findItemByObjectId(%obj)); EditorTree.removeItem(EditorTree.findItemByObjectId(%obj));

View file

@ -1,5 +1,5 @@
//--- OBJECT WRITE BEGIN --- //--- OBJECT WRITE BEGIN ---
new SimGroup(MissionGroup) { new Scene(EditorTemplateLevel) {
canSaveDynamicFields = "1"; canSaveDynamicFields = "1";
cdTrack = "2"; cdTrack = "2";
CTF_scoreLimit = "5"; CTF_scoreLimit = "5";

View file

@ -1051,7 +1051,7 @@ function MaterialEditorGui::updateActiveMaterialName(%this, %name)
// Some objects (ConvexShape, DecalRoad etc) reference Materials by name => need // 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 // to find and update all these references so they don't break when we rename the
// Material. // Material.
MaterialEditorGui.updateMaterialReferences( MissionGroup, %action.oldName, %action.newName ); MaterialEditorGui.updateMaterialReferences( getRootScene(), %action.oldName, %action.newName );
} }
function MaterialEditorGui::updateMaterialReferences( %this, %obj, %oldName, %newName ) function MaterialEditorGui::updateMaterialReferences( %this, %obj, %oldName, %newName )

View file

@ -187,7 +187,7 @@ function ActionUpdateActiveMaterialAnimationFlags::undo(%this)
function ActionUpdateActiveMaterialName::redo(%this) function ActionUpdateActiveMaterialName::redo(%this)
{ {
%this.material.setName(%this.newName); %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 ) if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{ {
@ -199,7 +199,7 @@ function ActionUpdateActiveMaterialName::redo(%this)
function ActionUpdateActiveMaterialName::undo(%this) function ActionUpdateActiveMaterialName::undo(%this)
{ {
%this.material.setName(%this.oldName); %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 ) if( MaterialEditorPreviewWindow.isVisible() && MaterialEditorGui.currentMaterial == %this.material )
{ {

View file

@ -164,7 +164,7 @@ function MeshRoadEditorPlugin::onSaveMission( %this, %missionFile )
{ {
if( MeshRoadEditorGui.isDirty ) if( MeshRoadEditorGui.isDirty )
{ {
MissionGroup.save( %missionFile ); getRootScene().save( %missionFile );
MeshRoadEditorGui.isDirty = false; MeshRoadEditorGui.isDirty = false;
} }
} }

View file

@ -114,7 +114,7 @@ function MissionAreaEditorPlugin::createNewMissionArea(%this)
%newMissionArea = new MissionArea(); %newMissionArea = new MissionArea();
%newMissionArea.area = "-256 -256 512 512"; %newMissionArea.area = "-256 -256 512 512";
MissionGroup.add(%newMissionArea); getRootScene().add(%newMissionArea);
EditorGui.setEditor(MissionAreaEditorPlugin); EditorGui.setEditor(MissionAreaEditorPlugin);

View file

@ -354,13 +354,13 @@ function CreateNewNavMeshDlg::create(%this)
if(MeshMissionBounds.isStateOn()) 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; return;
} }
// Get maximum extents of all objects. // Get maximum extents of all objects.
%box = MissionBoundsExtents(MissionGroup); %box = MissionBoundsExtents(getRootScene());
%pos = GetBoxCenter(%box); %pos = GetBoxCenter(%box);
%scale = (GetWord(%box, 3) - GetWord(%box, 0)) / 2 + 5 %scale = (GetWord(%box, 3) - GetWord(%box, 0)) / 2 + 5
SPC (GetWord(%box, 4) - GetWord(%box, 1)) / 2 + 5 SPC (GetWord(%box, 4) - GetWord(%box, 1)) / 2 + 5
@ -380,7 +380,7 @@ function CreateNewNavMeshDlg::create(%this)
scale = %this-->MeshScale.getText(); scale = %this-->MeshScale.getText();
}; };
} }
MissionGroup.add(%mesh); getRootScene().add(%mesh);
NavEditorGui.selectObject(%mesh); NavEditorGui.selectObject(%mesh);
Canvas.popDialog(CreateNewNavMeshDlg); Canvas.popDialog(CreateNewNavMeshDlg);

View file

@ -205,7 +205,7 @@ function NavEditorPlugin::onSaveMission(%this, %missionFile)
{ {
if(NavEditorGui.isDirty) if(NavEditorGui.isDirty)
{ {
MissionGroup.save(%missionFile); getRootScene().save(%missionFile);
NavEditorGui.isDirty = false; NavEditorGui.isDirty = false;
} }
} }

View file

@ -178,7 +178,7 @@ function RiverEditorPlugin::onSaveMission( %this, %missionFile )
{ {
if( RiverEditorGui.isDirty ) if( RiverEditorGui.isDirty )
{ {
MissionGroup.save( %missionFile ); getRootScene().save( %missionFile );
RiverEditorGui.isDirty = false; RiverEditorGui.isDirty = false;
} }
} }

View file

@ -156,7 +156,7 @@ function RoadEditorPlugin::onSaveMission( %this, %missionFile )
{ {
if( RoadEditorGui.isDirty ) if( RoadEditorGui.isDirty )
{ {
MissionGroup.save( %missionFile ); getRootScene().save( %missionFile );
RoadEditorGui.isDirty = false; RoadEditorGui.isDirty = false;
} }
} }

View file

@ -168,7 +168,7 @@ function ShapeEditorPlugin::open(%this, %filename)
ShapeEdNodes-->worldTransform.setStateOn(1); ShapeEdNodes-->worldTransform.setStateOn(1);
// Initialise and show the shape editor // Initialise and show the shape editor
ShapeEdShapeTreeView.open(MissionGroup); ShapeEdShapeTreeView.open(getRootScene());
ShapeEdShapeTreeView.buildVisibleTree(true); ShapeEdShapeTreeView.buildVisibleTree(true);
ShapeEdPreviewGui.setVisible(true); ShapeEdPreviewGui.setVisible(true);

View file

@ -184,11 +184,11 @@ function TimeAdjustSliderCtrl::onAction(%this)
if ( !isObject( %this.tod ) ) 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" ) if ( %obj.getClassName() $= "TimeOfDay" )
{ {

View file

@ -947,10 +947,10 @@ function ObjectBuilderGui::buildPlayerDropPoint(%this)
%this.addField("spawnClass", "TypeString", "Spawn Class", "Player"); %this.addField("spawnClass", "TypeString", "Spawn Class", "Player");
%this.addField("spawnDatablock", "TypeDataBlock", "Spawn Data", "PlayerData DefaultPlayerData"); %this.addField("spawnDatablock", "TypeDataBlock", "Spawn Data", "PlayerData DefaultPlayerData");
if( EWCreatorWindow.objectGroup.getID() == MissionGroup.getID() ) if( EWCreatorWindow.objectGroup.getID() == getRootScene().getID() )
{ {
if( !isObject("PlayerDropPoints") ) if( !isObject("PlayerDropPoints") )
MissionGroup.add( new SimGroup("PlayerDropPoints") ); getRootScene().add( new SimGroup("PlayerDropPoints") );
%this.objectGroup = "PlayerDropPoints"; %this.objectGroup = "PlayerDropPoints";
} }
@ -967,10 +967,10 @@ function ObjectBuilderGui::buildObserverDropPoint(%this)
%this.addField("spawnClass", "TypeString", "Spawn Class", "Camera"); %this.addField("spawnClass", "TypeString", "Spawn Class", "Camera");
%this.addField("spawnDatablock", "TypeDataBlock", "Spawn Data", "CameraData Observer"); %this.addField("spawnDatablock", "TypeDataBlock", "Spawn Data", "CameraData Observer");
if( EWCreatorWindow.objectGroup.getID() == MissionGroup.getID() ) if( EWCreatorWindow.objectGroup.getID() == getRootScene().getID() )
{ {
if( !isObject("ObserverDropPoints") ) if( !isObject("ObserverDropPoints") )
MissionGroup.add( new SimGroup("ObserverDropPoints") ); getRootScene().add( new SimGroup("ObserverDropPoints") );
%this.objectGroup = "ObserverDropPoints"; %this.objectGroup = "ObserverDropPoints";
} }

View file

@ -645,7 +645,7 @@ function EditorGui::addCameraBookmark( %this, %name )
if( !isObject(CameraBookmarks) ) if( !isObject(CameraBookmarks) )
{ {
%grp = new SimGroup(CameraBookmarks); %grp = new SimGroup(CameraBookmarks);
MissionGroup.add(%grp); getRootScene().add(%grp);
} }
CameraBookmarks.add( %obj ); CameraBookmarks.add( %obj );
@ -843,12 +843,17 @@ function EditorGui::syncCameraGui( %this )
function WorldEditorPlugin::onActivated( %this ) function WorldEditorPlugin::onActivated( %this )
{ {
if(!isObject(Scenes))
$scenesRootGroup = new SimGroup(Scenes);
$scenesRootGroup.add(getRootScene());
EditorGui.bringToFront( EWorldEditor ); EditorGui.bringToFront( EWorldEditor );
EWorldEditor.setVisible(true); EWorldEditor.setVisible(true);
EditorGui.menuBar.insert( EditorGui.worldMenu, EditorGui.menuBar.dynamicItemInsertPos ); EditorGui.menuBar.insert( EditorGui.worldMenu, EditorGui.menuBar.dynamicItemInsertPos );
EWorldEditor.makeFirstResponder(true); EWorldEditor.makeFirstResponder(true);
EditorTree.open(MissionGroup,true); EditorTree.open($scenesRootGroup,true);
EWCreatorWindow.setNewObjectGroup(MissionGroup); EWCreatorWindow.setNewObjectGroup(getRootScene());
EWorldEditor.syncGui(); EWorldEditor.syncGui();
@ -1472,7 +1477,7 @@ function EditorTree::onDeleteObject( %this, %object )
return true; return true;
if( %object == EWCreatorWindow.objectGroup ) if( %object == EWCreatorWindow.objectGroup )
EWCreatorWindow.setNewObjectGroup( MissionGroup ); EWCreatorWindow.setNewObjectGroup( getRootScene() );
// Append it to our list. // Append it to our list.
%this.undoDeleteList = %this.undoDeleteList TAB %object; %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();"; %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 else
{ {
%popup.object = %obj; %popup.object = %obj;
@ -1681,8 +1693,8 @@ function EditorTree::onRightMouseUp( %this, %itemId, %mouse, %obj )
if( %haveObjectEntries ) if( %haveObjectEntries )
{ {
%popup.enableItem( 0, %obj.isNameChangeAllowed() && %obj.getName() !$= "MissionGroup" ); %popup.enableItem( 0, %obj.isNameChangeAllowed() && %obj.getName() !$= getRootScene() );
%popup.enableItem( 1, %obj.getName() !$= "MissionGroup" ); %popup.enableItem( 1, %obj.getName() !$= getRootScene() );
if( %haveLockAndHideEntries ) if( %haveLockAndHideEntries )
{ {
@ -2034,21 +2046,21 @@ function EWorldEditor::syncToolPalette( %this )
function EWorldEditor::addSimGroup( %this, %groupCurrentSelection ) function EWorldEditor::addSimGroup( %this, %groupCurrentSelection )
{ {
%activeSelection = %this.getActiveSelection(); %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; return;
} }
// Find our parent. // Find our parent.
%parent = MissionGroup; %parent = getRootScene();
if( !%groupCurrentSelection && isObject( %activeSelection ) && %activeSelection.getCount() > 0 ) if( !%groupCurrentSelection && isObject( %activeSelection ) && %activeSelection.getCount() > 0 )
{ {
%firstSelectedObject = %activeSelection.getObject( 0 ); %firstSelectedObject = %activeSelection.getObject( 0 );
if( %firstSelectedObject.isMemberOfClass( "SimGroup" ) ) if( %firstSelectedObject.isMemberOfClass( "SimGroup" ) )
%parent = %firstSelectedObject; %parent = %firstSelectedObject;
else if( %firstSelectedObject.getId() != MissionGroup.getId() ) else if( %firstSelectedObject.getId() != getRootScene().getId() )
%parent = %firstSelectedObject.parentGroup; %parent = %firstSelectedObject.parentGroup;
} }

View file

@ -40,7 +40,7 @@ function ESelectObjectsWindow::toggleVisibility( %this )
/// to start searching for objects. /// to start searching for objects.
function ESelectObjectsWindow::getRootGroup( %this ) function ESelectObjectsWindow::getRootGroup( %this )
{ {
return MissionGroup; return getRootScene();
} }
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------

View file

@ -179,7 +179,7 @@ function EWCreatorWindow::createStatic( %this, %file )
return; return;
if( !isObject(%this.objectGroup) ) if( !isObject(%this.objectGroup) )
%this.setNewObjectGroup( MissionGroup ); %this.setNewObjectGroup( getRootScene() );
%objId = new TSStatic() %objId = new TSStatic()
{ {
@ -197,7 +197,7 @@ function EWCreatorWindow::createPrefab( %this, %file )
return; return;
if( !isObject(%this.objectGroup) ) if( !isObject(%this.objectGroup) )
%this.setNewObjectGroup( MissionGroup ); %this.setNewObjectGroup( getRootScene() );
%objId = new Prefab() %objId = new Prefab()
{ {
@ -215,7 +215,7 @@ function EWCreatorWindow::createObject( %this, %cmd )
return; return;
if( !isObject(%this.objectGroup) ) if( !isObject(%this.objectGroup) )
%this.setNewObjectGroup( MissionGroup ); %this.setNewObjectGroup( getRootScene() );
pushInstantGroup(); pushInstantGroup();
%objId = eval(%cmd); %objId = eval(%cmd);

View file

@ -124,6 +124,12 @@ function WorldEditor::onSelectionCentroidChanged( %this )
Inspector.refresh(); Inspector.refresh();
} }
function WorldEditor::setSceneAsDirty(%this)
{
EWorldEditor.isDirty = true;
}
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
function WorldEditor::init(%this) function WorldEditor::init(%this)
@ -198,7 +204,7 @@ function WorldEditor::export(%this)
function WorldEditor::doExport(%this, %file) function WorldEditor::doExport(%this, %file)
{ {
missionGroup.save("~/editor/" @ %file, true); getRootScene().save("~/editor/" @ %file, true);
} }
function WorldEditor::import(%this) function WorldEditor::import(%this)

View file

@ -272,7 +272,7 @@ function EditorSaveMission()
// now write the terrain and mission files out: // now write the terrain and mission files out:
if(EWorldEditor.isDirty || ETerrainEditor.isMissionDirty) if(EWorldEditor.isDirty || ETerrainEditor.isMissionDirty)
MissionGroup.save($Server::MissionFile); getRootScene().save($Server::MissionFile);
if(ETerrainEditor.isDirty) if(ETerrainEditor.isDirty)
{ {
// Find all of the terrain files // 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() function EditorExportToCollada()
{ {