RunUnsynced, do not recalculate sync hash on reentry. Cache debug settings.
This commit is contained in:
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
var optionsButton = root.GetOrNull<MenuButtonWidget>("OPTIONS_BUTTON");
|
||||
world.SetPauseState(false);
|
||||
if (optionsButton != null)
|
||||
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, optionsButton.OnClick);
|
||||
Sync.RunUnsynced(world, optionsButton.OnClick);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
foreach (var sel in a.TraitsImplementing<INotifySelected>())
|
||||
sel.Selected(a);
|
||||
|
||||
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => world.OrderGenerator.SelectionChanged(world, actors));
|
||||
Sync.RunUnsynced(world, () => world.OrderGenerator.SelectionChanged(world, actors));
|
||||
foreach (var ns in worldNotifySelection)
|
||||
ns.SelectionChanged();
|
||||
}
|
||||
@@ -66,7 +66,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (actors.Remove(a))
|
||||
{
|
||||
UpdateHash();
|
||||
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => world.OrderGenerator.SelectionChanged(world, actors));
|
||||
Sync.RunUnsynced(world, () => world.OrderGenerator.SelectionChanged(world, actors));
|
||||
foreach (var ns in worldNotifySelection)
|
||||
ns.SelectionChanged();
|
||||
}
|
||||
@@ -121,7 +121,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
foreach (var sel in a.TraitsImplementing<INotifySelected>())
|
||||
sel.Selected(a);
|
||||
|
||||
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => world.OrderGenerator.SelectionChanged(world, actors));
|
||||
Sync.RunUnsynced(world, () => world.OrderGenerator.SelectionChanged(world, actors));
|
||||
foreach (var ns in worldNotifySelection)
|
||||
ns.SelectionChanged();
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
actors.Clear();
|
||||
UpdateHash();
|
||||
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => world.OrderGenerator.SelectionChanged(world, actors));
|
||||
Sync.RunUnsynced(world, () => world.OrderGenerator.SelectionChanged(world, actors));
|
||||
foreach (var ns in worldNotifySelection)
|
||||
ns.SelectionChanged();
|
||||
}
|
||||
@@ -170,7 +170,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (removed > 0)
|
||||
{
|
||||
UpdateHash();
|
||||
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, () => world.OrderGenerator.SelectionChanged(world, actors));
|
||||
Sync.RunUnsynced(world, () => world.OrderGenerator.SelectionChanged(world, actors));
|
||||
foreach (var ns in worldNotifySelection)
|
||||
ns.SelectionChanged();
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
var optionsButton = playerRoot.GetOrNull<MenuButtonWidget>("OPTIONS_BUTTON");
|
||||
if (optionsButton != null)
|
||||
Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, world, optionsButton.OnClick);
|
||||
Sync.RunUnsynced(world, optionsButton.OnClick);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
|
||||
public override string GetCursor(int2 screenPos)
|
||||
{
|
||||
return Sync.RunUnsynced(Game.Settings.Debug.SyncCheckUnsyncedCode, World, () =>
|
||||
return Sync.RunUnsynced(World, () =>
|
||||
{
|
||||
// Always show an arrow while selecting
|
||||
if (IsValidDragbox)
|
||||
|
||||
Reference in New Issue
Block a user