.Trait[OrDefault]<Trait> => .Info.Traits.Get[OrDefault]<TraitInfo> where applicable

This commit is contained in:
atlimit8
2015-08-02 18:31:57 -05:00
parent 8162fa27ab
commit 6970959ef1
16 changed files with 55 additions and 81 deletions

View File

@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
var playerWidgets = Game.LoadWidget(world, "PLAYER_WIDGETS", playerRoot, new WidgetArgs());
var sidebarTicker = playerWidgets.Get<LogicTickerWidget>("SIDEBAR_TICKER");
var objectives = world.LocalPlayer.PlayerActor.TraitOrDefault<MissionObjectives>();
var objectives = world.LocalPlayer.PlayerActor.Info.Traits.GetOrDefault<MissionObjectivesInfo>();
sidebarTicker.OnTick = () =>
{
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (world.LocalPlayer.WinState != WinState.Undefined && !loadingObserverWidgets)
{
loadingObserverWidgets = true;
Game.RunAfterDelay(objectives != null ? objectives.Info.GameOverDelay : 0, () =>
Game.RunAfterDelay(objectives != null ? objectives.GameOverDelay : 0, () =>
{
playerRoot.RemoveChildren();
Game.LoadWidget(world, "OBSERVER_WIDGETS", playerRoot, new WidgetArgs());