Initial implementation of the Scene object for handling scenes/levels in a more consistent and deliberate way.

This commit is contained in:
Areloch 2019-02-23 15:55:28 -06:00
parent 775ca57047
commit 9bf8337e4a
37 changed files with 509 additions and 140 deletions

View file

@ -354,13 +354,13 @@ function CreateNewNavMeshDlg::create(%this)
if(MeshMissionBounds.isStateOn())
{
if(!isObject(MissionGroup))
if(!isObject(getScene(0)))
{
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(getScene(0));
%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);
getScene(0).add(%mesh);
NavEditorGui.selectObject(%mesh);
Canvas.popDialog(CreateNewNavMeshDlg);

View file

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