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 )
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
using OpenRA.Traits;
|
||||
@@ -24,7 +25,7 @@ namespace OpenRA.Mods.RA
|
||||
static CPos viewportOrigin;
|
||||
Dictionary<string, Actor> actors;
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
var b = w.Map.Bounds;
|
||||
viewportOrigin = new CPos(b.Left + b.Width / 2, b.Top + b.Height / 2);
|
||||
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
@@ -28,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Missions
|
||||
Dictionary<string, Actor> actors;
|
||||
Dictionary<string, Player> players;
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
players = w.Players.ToDictionary(p => p.InternalName);
|
||||
actors = w.WorldActor.Trait<SpawnMapActors>().Actors;
|
||||
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Cnc;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
@@ -162,7 +163,7 @@ namespace OpenRA.Mods.Cnc.Missions
|
||||
nr3.QueueActivity(nr3.Trait<Mobile>().ScriptedMove(nr3.Location - new CVec(0, -5)));
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
nod = w.Players.Single(p => p.InternalName == "NOD");
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
@@ -36,7 +37,7 @@ namespace OpenRA.Mods.RA
|
||||
this.world = self.World;
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
Bridges = new Bridge[w.Map.MapSize.X, w.Map.MapSize.Y];
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
@@ -28,7 +29,7 @@ namespace OpenRA.Mods.RA
|
||||
this.Info = Info;
|
||||
}
|
||||
|
||||
public void WorldLoaded(World world)
|
||||
public void WorldLoaded(World world, WorldRenderer wr)
|
||||
{
|
||||
// Clear any existing widget state
|
||||
if (Info.ClearRoot)
|
||||
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Network;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -26,7 +27,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
public Dictionary<Player, CPos> Start = new Dictionary<Player, CPos>();
|
||||
|
||||
public void WorldLoaded(World world)
|
||||
public void WorldLoaded(World world, WorldRenderer wr)
|
||||
{
|
||||
var taken = world.LobbyInfo.Clients.Where(c => c.SpawnPoint != 0 && c.Slot != null)
|
||||
.Select(c => (CPos) world.Map.GetSpawnPoints()[c.SpawnPoint-1]).ToList();
|
||||
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
@@ -274,7 +275,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
actor.Trait<AutoTarget>().stance = UnitStance.Defend;
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
@@ -270,7 +271,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
{
|
||||
new LocationInit(yakEntryPoint.Location),
|
||||
new OwnerInit(soviets),
|
||||
new FacingInit(Util.GetFacing(yakAttackPoint.Location - yakEntryPoint.Location, 0)),
|
||||
new FacingInit(Traits.Util.GetFacing(yakAttackPoint.Location - yakEntryPoint.Location, 0)),
|
||||
new AltitudeInit(Rules.Info[YakName].Traits.Get<PlaneInfo>().CruiseAltitude)
|
||||
});
|
||||
}
|
||||
@@ -405,7 +406,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
unit.QueueActivity(new AttackMove.AttackMoveActivity(unit, new Move.Move(townPoint.Location, SovietTownMoveNearEnough)));
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
@@ -335,7 +336,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
{
|
||||
new OwnerInit(owner),
|
||||
new LocationInit(entry),
|
||||
new FacingInit(Util.GetFacing(to - entry, 0))
|
||||
new FacingInit(Traits.Util.GetFacing(to - entry, 0))
|
||||
});
|
||||
unit.QueueActivity(new Move.Move(to));
|
||||
return unit;
|
||||
@@ -380,7 +381,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
}
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
@@ -350,7 +351,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
actor.Trait<AutoTarget>().stance = UnitStance.Defend;
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -23,7 +24,7 @@ namespace OpenRA.Mods.RA
|
||||
Dictionary<string, Actor> Actors;
|
||||
static CPos ViewportOrigin;
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
var b = w.Map.Bounds;
|
||||
ViewportOrigin = new CPos(b.Left + b.Width/2, b.Top + b.Height/2);
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
@@ -90,7 +91,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
{
|
||||
var actor = OffmapAttackers.Random(world.SharedRandom);
|
||||
var spawn = offmapAttackerSpawns.Random(world.SharedRandom);
|
||||
var u = world.CreateActor(actor, soviets, spawn.Location, Util.GetFacing(attackLocation.Location - spawn.Location, 0));
|
||||
var u = world.CreateActor(actor, soviets, spawn.Location, Traits.Util.GetFacing(attackLocation.Location - spawn.Location, 0));
|
||||
var cargo = u.TraitOrDefault<Cargo>();
|
||||
if (cargo != null)
|
||||
{
|
||||
@@ -176,7 +177,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
{
|
||||
foreach (var tank in HeavyTanks)
|
||||
{
|
||||
var u = world.CreateActor(tank, soviets, heavyTankSpawn.Location, Util.GetFacing(heavyTankWP.Location - heavyTankSpawn.Location, 0));
|
||||
var u = world.CreateActor(tank, soviets, heavyTankSpawn.Location, Traits.Util.GetFacing(heavyTankWP.Location - heavyTankSpawn.Location, 0));
|
||||
u.QueueActivity(new AttackMove.AttackMoveActivity(u, new Move.Move(heavyTankWP.Location, 0)));
|
||||
}
|
||||
ironCurtain.Trait<IronCurtainPower>().Activate(ironCurtain, new Order { TargetLocation = heavyTankSpawn.Location });
|
||||
@@ -187,7 +188,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
var chronoInfo = new List<Pair<Actor, CPos>>();
|
||||
foreach (var tank in MediumTanks.Select((x, i) => new { x, i }))
|
||||
{
|
||||
var u = world.CreateActor(tank.x, allies, mediumTankChronoSpawn.Location, Util.GetFacing(heavyTankWP.Location - mediumTankChronoSpawn.Location, 0));
|
||||
var u = world.CreateActor(tank.x, allies, mediumTankChronoSpawn.Location, Traits.Util.GetFacing(heavyTankWP.Location - mediumTankChronoSpawn.Location, 0));
|
||||
chronoInfo.Add(Pair.New(u, new CPos(mediumTankChronoSpawn.Location.X + tank.i, mediumTankChronoSpawn.Location.Y)));
|
||||
}
|
||||
RASpecialPowers.Chronoshift(world, chronoInfo, chronosphere, -1, false);
|
||||
@@ -201,7 +202,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
{
|
||||
new OwnerInit(soviets),
|
||||
new LocationInit(waypoints[0]),
|
||||
new FacingInit(Util.GetFacing(waypoints[1] - waypoints[0], 0))
|
||||
new FacingInit(Traits.Util.GetFacing(waypoints[1] - waypoints[0], 0))
|
||||
});
|
||||
foreach (var waypoint in waypoints)
|
||||
m.QueueActivity(Fly.ToCell(waypoint));
|
||||
@@ -210,7 +211,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
|
||||
void SendChinookReinforcements(CPos entry, Actor lz)
|
||||
{
|
||||
var chinook = world.CreateActor("tran", allies, entry, Util.GetFacing(lz.Location - entry, 0));
|
||||
var chinook = world.CreateActor("tran", allies, entry, Traits.Util.GetFacing(lz.Location - entry, 0));
|
||||
var cargo = chinook.Trait<Cargo>();
|
||||
|
||||
while (cargo.HasSpace(1))
|
||||
@@ -234,7 +235,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
alliedWarFactory.Trait<PrimaryBuilding>().SetPrimaryProducer(alliedWarFactory, true);
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
@@ -342,7 +343,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
|
||||
bool SpawnVehicles = true;
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
soviets = w.Players.Single(p => p.InternalName == "Soviets");
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
@@ -258,7 +259,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
{
|
||||
Sound.Play("reinfor1.aud");
|
||||
foreach (var unit in units)
|
||||
world.CreateActor(unit, greece, startEntryPoint.Location, Util.GetFacing(startBridgeEndPoint.CenterPosition - startEntryPoint.CenterPosition, 0))
|
||||
world.CreateActor(unit, greece, startEntryPoint.Location, Traits.Util.GetFacing(startBridgeEndPoint.CenterPosition - startEntryPoint.CenterPosition, 0))
|
||||
.QueueActivity(new Move.Move(startMovePoint.Location, 0));
|
||||
}
|
||||
|
||||
@@ -266,7 +267,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
{
|
||||
Sound.Play("reinfor1.aud");
|
||||
foreach (var unit in units)
|
||||
world.CreateActor(unit, greece, alliedBaseEntryPoint.Location, Util.GetFacing(alliedBaseMovePoint.CenterPosition - alliedBaseEntryPoint.CenterPosition, 0))
|
||||
world.CreateActor(unit, greece, alliedBaseEntryPoint.Location, Traits.Util.GetFacing(alliedBaseMovePoint.CenterPosition - alliedBaseEntryPoint.CenterPosition, 0))
|
||||
.QueueActivity(new Move.Move(alliedBaseMovePoint.Location, 0));
|
||||
}
|
||||
|
||||
@@ -294,7 +295,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
OnObjectivesUpdated(true);
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Air;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
@@ -107,7 +108,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
{
|
||||
new OwnerInit(ussr),
|
||||
new LocationInit(entry),
|
||||
new FacingInit(Util.GetFacing(airfield.Location - entry, 0)),
|
||||
new FacingInit(Traits.Util.GetFacing(airfield.Location - entry, 0)),
|
||||
new AltitudeInit(Rules.Info["yak"].Traits.Get<PlaneInfo>().CruiseAltitude)
|
||||
});
|
||||
|
||||
@@ -133,7 +134,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
}));
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Buildings;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
@@ -271,7 +272,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
OnObjectivesUpdated(true);
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ using System.Linq;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
using OpenRA.Traits;
|
||||
@@ -351,7 +352,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
|
||||
bool producing = true;
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
allies = w.Players.SingleOrDefault(p => p.InternalName == "Allies");
|
||||
|
||||
@@ -12,6 +12,7 @@ using System;
|
||||
using System.Linq;
|
||||
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
using OpenRA.Traits;
|
||||
|
||||
@@ -21,7 +22,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public class SpawnMPUnits : IWorldLoaded
|
||||
{
|
||||
public void WorldLoaded(World world)
|
||||
public void WorldLoaded(World world, WorldRenderer wr)
|
||||
{
|
||||
foreach (var s in world.WorldActor.Trait<MPStartLocations>().Start)
|
||||
SpawnUnitsForPlayer(world, s.Key, s.Value);
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
@@ -20,7 +21,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
public Dictionary<string, Actor> Actors = new Dictionary<string, Actor>();
|
||||
|
||||
public void WorldLoaded(World world)
|
||||
public void WorldLoaded(World world, WorldRenderer wr)
|
||||
{
|
||||
foreach (var actorReference in world.Map.Actors.Value)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA
|
||||
World world;
|
||||
public bool Visible;
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
this.world = w;
|
||||
this.refreshTick = 0;
|
||||
|
||||
@@ -14,6 +14,7 @@ using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Move;
|
||||
using OpenRA.Support;
|
||||
using OpenRA.Traits;
|
||||
@@ -27,7 +28,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
Dictionary<uint, MovementClassDomainIndex> domainIndexes;
|
||||
|
||||
public void WorldLoaded(World world)
|
||||
public void WorldLoaded(World world, WorldRenderer wr)
|
||||
{
|
||||
domainIndexes = new Dictionary<uint, MovementClassDomainIndex>();
|
||||
var movementClasses = new HashSet<uint>(
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.Widgets;
|
||||
|
||||
@@ -30,7 +31,7 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public PlayMusicOnMapLoad(PlayMusicOnMapLoadInfo info) { Info = info; }
|
||||
|
||||
public void WorldLoaded(World w) { PlayMusic(); }
|
||||
public void WorldLoaded(World w, WorldRenderer wr) { PlayMusic(); }
|
||||
|
||||
void PlayMusic()
|
||||
{
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
@@ -34,7 +35,7 @@ namespace OpenRA.Mods.RA
|
||||
}
|
||||
}
|
||||
|
||||
public void WorldLoaded(OpenRA.World w)
|
||||
public void WorldLoaded(OpenRA.World w, WorldRenderer wr)
|
||||
{
|
||||
// NOTE(jsd): 32 seems a sane default initial capacity for the total # of harvesters in a game. Purely a guesstimate.
|
||||
claimByCell = new Dictionary<CPos, ResourceClaim>(32);
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.RA
|
||||
smudgeSprites = Info.Types.Select(x => Game.modData.SpriteLoader.LoadAllSprites(x)).ToArray();
|
||||
}
|
||||
|
||||
public void WorldLoaded(World w)
|
||||
public void WorldLoaded(World w, WorldRenderer wr)
|
||||
{
|
||||
world = w;
|
||||
tiles = new Dictionary<CPos, TileReference<byte, byte>>();
|
||||
|
||||
Reference in New Issue
Block a user