bridge setup as trait; wired to RA & CNC
This commit is contained in:
@@ -73,7 +73,6 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Bridges.cs" />
|
|
||||||
<Compile Include="Chat.cs" />
|
<Compile Include="Chat.cs" />
|
||||||
<Compile Include="Chrome.cs" />
|
<Compile Include="Chrome.cs" />
|
||||||
<Compile Include="Combat.cs" />
|
<Compile Include="Combat.cs" />
|
||||||
@@ -118,6 +117,7 @@
|
|||||||
<Compile Include="Support\OpenAlInterop.cs" />
|
<Compile Include="Support\OpenAlInterop.cs" />
|
||||||
<Compile Include="Support\PerfHistory.cs" />
|
<Compile Include="Support\PerfHistory.cs" />
|
||||||
<Compile Include="Sync.cs" />
|
<Compile Include="Sync.cs" />
|
||||||
|
<Compile Include="Traits\BridgeLoadHook.cs" />
|
||||||
<Compile Include="Traits\ChoosePaletteOnSelect.cs" />
|
<Compile Include="Traits\ChoosePaletteOnSelect.cs" />
|
||||||
<Compile Include="Traits\CrateSpawner.cs" />
|
<Compile Include="Traits\CrateSpawner.cs" />
|
||||||
<Compile Include="Traits\OreGrowth.cs" />
|
<Compile Include="Traits\OreGrowth.cs" />
|
||||||
|
|||||||
@@ -2,13 +2,14 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using OpenRa.Traits;
|
|
||||||
|
|
||||||
namespace OpenRa
|
namespace OpenRa.Traits
|
||||||
{
|
{
|
||||||
static class Bridges
|
class BridgeLoadHookInfo : StatelessTraitInfo<BridgeLoadHook> { }
|
||||||
|
|
||||||
|
class BridgeLoadHook : ILoadWorldHook
|
||||||
{
|
{
|
||||||
public static void MakeBridges(World w)
|
static void MakeBridges(World w)
|
||||||
{
|
{
|
||||||
var mini = w.Map.XOffset; var maxi = w.Map.XOffset + w.Map.Width;
|
var mini = w.Map.XOffset; var maxi = w.Map.XOffset + w.Map.Width;
|
||||||
var minj = w.Map.YOffset; var maxj = w.Map.YOffset + w.Map.Height;
|
var minj = w.Map.YOffset; var maxj = w.Map.YOffset + w.Map.Height;
|
||||||
@@ -63,5 +64,7 @@ namespace OpenRa
|
|||||||
{
|
{
|
||||||
return w.TileSet.walk[t].Bridge != null;
|
return w.TileSet.walk[t].Bridge != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void WorldLoaded(World w) { MakeBridges(w); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,4 +102,5 @@ namespace OpenRa.Traits
|
|||||||
public interface ITraitPrerequisite<T> { }
|
public interface ITraitPrerequisite<T> { }
|
||||||
|
|
||||||
public interface INotifySelection { void SelectionChanged(); }
|
public interface INotifySelection { void SelectionChanged(); }
|
||||||
|
public interface ILoadWorldHook { void WorldLoaded(World w); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,9 +77,11 @@ namespace OpenRa
|
|||||||
Queries = new AllQueries( this );
|
Queries = new AllQueries( this );
|
||||||
Timer.Time( "queries: {0}" );
|
Timer.Time( "queries: {0}" );
|
||||||
|
|
||||||
Bridges.MakeBridges(this);
|
foreach (var wlh in WorldActor.traits.WithInterface<ILoadWorldHook>())
|
||||||
|
wlh.WorldLoaded(this);
|
||||||
|
|
||||||
PathFinder = new PathFinder(this);
|
PathFinder = new PathFinder(this);
|
||||||
Timer.Time( "bridge, pathing: {0}" );
|
Timer.Time( "hooks, pathing: {0}" );
|
||||||
|
|
||||||
Minimap = new Minimap(this, Game.renderer);
|
Minimap = new Minimap(this, Game.renderer);
|
||||||
Timer.Time( "minimap: {0}" );
|
Timer.Time( "minimap: {0}" );
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ World:
|
|||||||
WaterPaletteRotation:
|
WaterPaletteRotation:
|
||||||
BuildingInfluence:
|
BuildingInfluence:
|
||||||
UnitInfluence:
|
UnitInfluence:
|
||||||
|
BridgeLoadHook:
|
||||||
PaletteFromFile@terrain_temperat:
|
PaletteFromFile@terrain_temperat:
|
||||||
Name: terrain
|
Name: terrain
|
||||||
Theater: temperat
|
Theater: temperat
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ World:
|
|||||||
BuildingInfluence:
|
BuildingInfluence:
|
||||||
UnitInfluence:
|
UnitInfluence:
|
||||||
ChoosePaletteOnSelect:
|
ChoosePaletteOnSelect:
|
||||||
|
BridgeLoadHook:
|
||||||
PaletteFromFile@terrain_temperat:
|
PaletteFromFile@terrain_temperat:
|
||||||
Name: terrain
|
Name: terrain
|
||||||
Filename: temperat.pal
|
Filename: temperat.pal
|
||||||
|
|||||||
Reference in New Issue
Block a user