remove UIM-debug from settings (now in DeveloperMode trait)

This commit is contained in:
Bob
2010-10-20 17:38:43 +13:00
committed by Chris Forbes
parent 6012f1d592
commit de92a2fc0c
4 changed files with 11 additions and 10 deletions

View File

@@ -32,7 +32,6 @@ namespace OpenRA.GameRules
{
public bool PerfGraph = false;
public bool RecordSyncReports = true;
public bool ShowCollisions = false;
public float LongTickThreshold = 0.001f;
}

View File

@@ -18,6 +18,7 @@ namespace OpenRA.Traits
public bool FastCharge = false;
public bool DisableShroud = false;
public bool PathDebug = false;
public bool UnitInfluenceDebug = false;
public object Create (ActorInitializer init) { return new DeveloperMode(this); }
}
@@ -30,6 +31,7 @@ namespace OpenRA.Traits
[Sync] public bool FastBuild;
[Sync] public bool DisableShroud;
[Sync] public bool PathDebug;
[Sync] public bool UnitInfluenceDebug;
public DeveloperMode(DeveloperModeInfo info)
{
@@ -38,6 +40,7 @@ namespace OpenRA.Traits
FastCharge = Info.FastCharge;
DisableShroud = Info.DisableShroud;
PathDebug = Info.PathDebug;
UnitInfluenceDebug = info.UnitInfluenceDebug;
}
public void ResolveOrder (Actor self, Order order)
@@ -80,8 +83,7 @@ namespace OpenRA.Traits
}
case "DevUnitDebug":
{
if (self.World.LocalPlayer == self.Owner)
Game.Settings.Debug.ShowCollisions ^= true;
UnitInfluenceDebug ^= true;
break;
}
case "DevGiveExploration":

View File

@@ -41,7 +41,7 @@ namespace OpenRA
public void Draw( WorldRenderer wr, World world )
{
if (Game.Settings.Debug.ShowCollisions)
if (world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().UnitInfluenceDebug)
{
var uim = world.WorldActor.Trait<UnitInfluence>();

View File

@@ -48,7 +48,7 @@ namespace OpenRA.Widgets.Delegates
};
devmodeBG.GetWidget<CheckboxWidget>("CHECKBOX_UNITDEBUG").Checked =
() => Game.Settings.Debug.ShowCollisions;
() => world.LocalPlayer.PlayerActor.Trait<DeveloperMode>().UnitInfluenceDebug;
devmodeBG.GetWidget("CHECKBOX_UNITDEBUG").OnMouseDown = mi =>
{
world.IssueOrder(new Order("DevUnitDebug", world.LocalPlayer.PlayerActor));