eradicate dumb UserSettings stuff that causes desyncs

This commit is contained in:
Chris Forbes
2010-03-16 20:14:57 +13:00
parent 7114f4b4ba
commit 2dde4eff07
4 changed files with 14 additions and 22 deletions

View File

@@ -151,14 +151,9 @@ namespace OpenRA
ChangeMap(mapName);
if( Settings.Replay != "" )
{
var connection = new ReplayConnection( Settings.Replay );
orderManager = new OrderManager( connection );
}
orderManager = new OrderManager( new ReplayConnection( Settings.Replay ) );
else
{
JoinLocal();
}
}
internal static void JoinServer(string host, int port)
@@ -421,7 +416,7 @@ namespace OpenRA
renderer = new Renderer(resolution, windowed);
resolution = renderer.Resolution;
var controller = new Controller(); /* a bit of insane input routing */
var controller = new Controller();
Game.Initialize(Game.Settings.Map, renderer, new int2(resolution), Game.Settings.Player, controller);

View File

@@ -50,10 +50,5 @@ namespace OpenRA.GameRules
public readonly int ExternalPort = 1234;
public readonly bool InternetServer = true;
public readonly string MasterServer = "http://open-ra.org/master/";
// Gameplay options
// TODO: These need to die
public readonly bool RepairRequiresConyard = true;
public readonly bool PowerDownBuildings = true;
}
}

View File

@@ -52,9 +52,6 @@ namespace OpenRA.Orders
public void Tick( World world )
{
if (!Game.Settings.RepairRequiresConyard)
return;
var hasFact = world.Queries.OwnedBy[world.LocalPlayer]
.WithTrait<ConstructionYard>()
.Any();

View File

@@ -24,20 +24,25 @@ namespace OpenRA.Traits
public void OnClick() { Game.controller.ToggleInputMode<SellOrderGenerator>(); }
}
class RepairButtonInfo : StatelessTraitInfo<RepairButton> { }
class RepairButtonInfo : ITraitInfo
{
public readonly bool RequiresConstructionYard = true;
public object Create(Actor self) { return new RepairButton(this); }
}
class RepairButton : IChromeButton
{
public string Image { get { return "repair"; } } // todo: art
RepairButtonInfo info;
public RepairButton( RepairButtonInfo info ) { this.info = info; }
public string Image { get { return "repair"; } }
public bool Enabled
{
get
{
if (!Game.Settings.RepairRequiresConyard)
return true;
return Game.world.Queries.OwnedBy[Game.world.LocalPlayer]
.WithTrait<ConstructionYard>().Any();
return !info.RequiresConstructionYard ||
Game.world.Queries.OwnedBy[Game.world.LocalPlayer]
.WithTrait<ConstructionYard>().Any();
}
}