Add WorldRenderer parameter to WorldLoaded.
This commit is contained in:
@@ -213,8 +213,11 @@ namespace OpenRA
|
||||
viewport = new Viewport(new int2(Renderer.Resolution), map.Bounds, Renderer);
|
||||
orderManager.world = new World(modData.Manifest, map, orderManager, isShellmap);
|
||||
worldRenderer = new WorldRenderer(orderManager.world);
|
||||
orderManager.world.LoadComplete(worldRenderer);
|
||||
|
||||
if (orderManager.GameStarted)
|
||||
return;
|
||||
|
||||
if (orderManager.GameStarted) return;
|
||||
Ui.MouseFocusWidget = null;
|
||||
Ui.KeyboardFocusWidget = null;
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ namespace OpenRA.Traits
|
||||
public interface UsesInit<T> where T : IActorInit { }
|
||||
|
||||
public interface INotifySelection { void SelectionChanged(); }
|
||||
public interface IWorldLoaded { void WorldLoaded(World w); }
|
||||
public interface IWorldLoaded { void WorldLoaded(World w, WorldRenderer wr); }
|
||||
public interface ICreatePlayers { void CreatePlayers(World w); }
|
||||
|
||||
public interface IBotInfo { string Name { get; } }
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace OpenRA.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
this.world = w;
|
||||
content = new CellContents[w.Map.MapSize.X, w.Map.MapSize.Y];
|
||||
|
||||
@@ -135,8 +135,12 @@ namespace OpenRA
|
||||
p.Stances[q] = Stance.Neutral;
|
||||
|
||||
Sound.SoundVolumeModifier = 1.0f;
|
||||
}
|
||||
|
||||
public void LoadComplete(WorldRenderer wr)
|
||||
{
|
||||
foreach (var wlh in WorldActor.TraitsImplementing<IWorldLoaded>())
|
||||
wlh.WorldLoaded(this);
|
||||
wlh.WorldLoaded(this, wr);
|
||||
}
|
||||
|
||||
public Actor CreateActor( string name, TypeDictionary initDict )
|
||||
|
||||
Reference in New Issue
Block a user