public MissionObjectivesLogic(World world, Widget widget) { var gameRoot = Ui.Root.Get("INGAME_ROOT"); primaryPanel = widget.Get("PRIMARY_OBJECTIVES"); secondaryPanel = widget.Get("SECONDARY_OBJECTIVES"); primaryTemplate = primaryPanel.Get("PRIMARY_OBJECTIVE_TEMPLATE"); secondaryTemplate = secondaryPanel.Get("SECONDARY_OBJECTIVE_TEMPLATE"); objectives = world.WorldActor.TraitsImplementing<IHasObjectives>().First(); objectivesButton = gameRoot.Get<ButtonWidget>("OBJECTIVES_BUTTON"); objectivesButton.IsHighlighted = () => Game.LocalTick % 50 < 25 && objectivesButton.Highlighted; objectivesButton.OnClick += () => objectivesButton.Highlighted = false; objectives.OnObjectivesUpdated += UpdateObjectives; UpdateObjectives(true); Game.ConnectionStateChanged += RemoveHandlers; }
public MissionObjectivesLogic(World world, Widget widget) { var gameRoot = Ui.Root.Get("INGAME_ROOT"); primaryPanel = widget.Get("PRIMARY_OBJECTIVES"); secondaryPanel = widget.Get("SECONDARY_OBJECTIVES"); primaryTemplate = primaryPanel.Get("PRIMARY_OBJECTIVE_TEMPLATE"); secondaryTemplate = secondaryPanel.Get("SECONDARY_OBJECTIVE_TEMPLATE"); objectives = world.WorldActor.TraitsImplementing <IHasObjectives>().First(); objectivesButton = gameRoot.Get <ButtonWidget>("OBJECTIVES_BUTTON"); objectivesButton.IsHighlighted = () => Game.LocalTick % 50 < 25 && objectivesButton.Highlighted; objectivesButton.OnClick += () => objectivesButton.Highlighted = false; objectives.OnObjectivesUpdated += UpdateObjectives; UpdateObjectives(true); Game.ConnectionStateChanged += RemoveHandlers; }