Exemple #1
0
 public StrategicVictoryConditions(Actor self, StrategicVictoryConditionsInfo svcInfo)
 {
     info      = svcInfo;
     TicksLeft = info.TicksToHold;
     player    = self.Owner;
     mo        = self.Trait <MissionObjectives>();
 }
        void PopulateObjectivesList(MissionObjectives mo, ScrollPanelWidget parent, ContainerWidget template)
        {
            parent.RemoveChildren();

            foreach (var o in mo.Objectives.OrderBy(o => o.Type))
            {
                var objective = o; // Work around the loop closure issue in older versions of C#
                var widget = template.Clone();

                var label = widget.Get<LabelWidget>("OBJECTIVE_TYPE");
                label.GetText = () => objective.Type == ObjectiveType.Primary ? "Primary" : "Secondary";

                var checkbox = widget.Get<CheckboxWidget>("OBJECTIVE_STATUS");
                checkbox.IsChecked = () => objective.State != ObjectiveState.Incomplete;
                checkbox.GetCheckType = () => objective.State == ObjectiveState.Completed ? "checked" : "crossed";
                checkbox.GetText = () => objective.Description;

                parent.AddChild(widget);
            }
        }
 public MissionObjectiveProperties(ScriptContext context, Player player)
     : base(context, player)
 {
     mo = player.PlayerActor.Trait<MissionObjectives>();
 }
 public ConquestVictoryConditions(Actor self, ConquestVictoryConditionsInfo cvcInfo)
 {
     info = cvcInfo;
     mo   = self.Trait <MissionObjectives>();
 }