Skip to content

Commit 39e3f23

Browse files
Single LandTable Load Improvement (#289)
* Implemented single landtable loading through background worker in SALVL. * Fixed uncleared data on single landtable load. Moved reset for level select if a project is still loaded. * Properly disable project save button if a project is loaded when a single landtable is loaded. Uncheck selected level in level menu strip item if single landtable is loaded.
1 parent 6739cc7 commit 39e3f23

File tree

5 files changed

+754
-696
lines changed

5 files changed

+754
-696
lines changed

Libraries/SAEditorCommon/DataTypes/LevelData.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,11 @@ public static void Clear()
379379
ClearSETItems();
380380
ClearLevelGeoAnims();
381381
ClearLevelGeometry();
382+
StartPositions = null;
383+
DeathZones = null;
384+
leveleff = null;
385+
LevelSplines = null;
386+
InvalidateRenderState();
382387

383388
changes.Push("Clear Stage");
384389
}

Libraries/SAEditorCommon/UI/SceneGraphControl.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,9 +264,12 @@ void LoadFullTree()
264264
}
265265
}
266266

267-
foreach (SplineData splineData in LevelData.LevelSplines)
267+
if (LevelData.LevelSplines != null)
268268
{
269-
splineNode.Nodes.Add("spline_" + splineData.Code.ToString("X"));
269+
foreach (SplineData splineData in LevelData.LevelSplines)
270+
{
271+
splineNode.Nodes.Add("spline_" + splineData.Code.ToString("X"));
272+
}
270273
}
271274

272275
if (LevelData.MissionSETItems != null && LevelData.MissionSETItems[LevelData.Character] != null)

SALVL/DrawLevel.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,13 @@ internal void DrawLevel()
142142
#endregion
143143

144144
#region Adding splines
145-
if (viewSplinesToolStripMenuItem.Checked)
145+
if (LevelData.LevelSplines != null)
146146
{
147-
foreach (SplineData spline in LevelData.LevelSplines)
148-
renderlist_set.AddRange(spline.Render(d3ddevice, cam, transform));
147+
if (viewSplinesToolStripMenuItem.Checked)
148+
{
149+
foreach (SplineData spline in LevelData.LevelSplines)
150+
renderlist_set.AddRange(spline.Render(d3ddevice, cam, transform));
151+
}
149152
}
150153
#endregion
151154

0 commit comments

Comments
 (0)