Fixed editing lagginess when project window open, and fixed editing widget deadlock issue

This commit is contained in:
dexy 2018-12-17 00:07:20 +11:00
parent 37afa2335c
commit 439d10e23a
2 changed files with 339 additions and 429 deletions

View File

@ -4738,6 +4738,14 @@ namespace CodeWalker.Project
catch { }
}
public void OnWorldSelectionModified(MapSelection sel, List<MapSelection> items)
{
try
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { OnWorldSelectionModified(sel, items); }));
}
else
{
if (sel.MultipleSelection)
{
@ -4780,15 +4788,10 @@ namespace CodeWalker.Project
OnWorldAudioPlacementModified(sel.Audio);
}
}
private void OnWorldEntityModified(YmapEntityDef ent)
{
try
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { OnWorldEntityModified(ent); }));
}
else
catch { }
}
private void OnWorldEntityModified(YmapEntityDef ent)
{
if ((ent.Ymap == null) && (ent.MloParent == null))
{
@ -4859,18 +4862,7 @@ namespace CodeWalker.Project
}
}
}
}
catch { }
}
private void OnWorldCarGenModified(YmapCarGen cargen)
{
try
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { OnWorldCarGenModified(cargen); }));
}
else
{
if (cargen?.Ymap == null) return;
@ -4905,18 +4897,7 @@ namespace CodeWalker.Project
}
}
}
catch { }
}
private void OnWorldPathNodeModified(YndNode node, YndLink link)
{
try
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { OnWorldPathNodeModified(node, link); }));
}
else
{
if (node?.Ynd == null) return;
@ -4956,20 +4937,8 @@ namespace CodeWalker.Project
SetYndHasChanged(true);
}
}
}
}
catch { }
}
private void OnWorldNavPolyModified(YnvPoly poly)
{
try
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { OnWorldNavPolyModified(poly); }));
}
else
{
if (poly?.Ynv == null) return;
@ -5004,18 +4973,7 @@ namespace CodeWalker.Project
}
}
}
catch { }
}
private void OnWorldNavPointModified(YnvPoint point)
{
try
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { OnWorldNavPointModified(point); }));
}
else
{
if (point?.Ynv == null) return;
@ -5050,18 +5008,7 @@ namespace CodeWalker.Project
}
}
}
catch { }
}
private void OnWorldNavPortalModified(YnvPortal portal)
{
try
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { OnWorldNavPortalModified(portal); }));
}
else
{
if (portal?.Ynv == null) return;
@ -5096,18 +5043,7 @@ namespace CodeWalker.Project
}
}
}
catch { }
}
private void OnWorldTrainNodeModified(TrainTrackNode node)
{
try
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { OnWorldTrainNodeModified(node); }));
}
else
{
if (node?.Track == null) return;
@ -5139,18 +5075,7 @@ namespace CodeWalker.Project
}
}
}
}
catch { }
}
private void OnWorldScenarioNodeModified(ScenarioNode node)
{
try
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { OnWorldScenarioNodeModified(node); }));
}
else
{
if (node?.Ymt == null) return;
@ -5183,18 +5108,7 @@ namespace CodeWalker.Project
}
}
}
}
catch { }
}
private void OnWorldAudioPlacementModified(AudioPlacement audio)
{
try
{
if (InvokeRequired)
{
BeginInvoke(new Action(() => { OnWorldAudioPlacementModified(audio); }));
}
else
{
if (audio?.RelFile == null) return;
@ -5243,10 +5157,6 @@ namespace CodeWalker.Project
SetAudioFileHasChanged(true);
}
}
}
}
catch { }
}

View File

@ -3375,7 +3375,7 @@ namespace CodeWalker
if (mhit.HasValue)
{
//make sure the path link gets changed (sub-selection!)
lock (Renderer.RenderSyncRoot)
//lock (Renderer.RenderSyncRoot)
{
SelectedItem.PathLink = mhitv.PathLink;
SelectedItem.ScenarioEdge = mhitv.ScenarioEdge;