Exemple #1
0
        public void ProcessReward(ValuablesCollection valuables, Action onReward)
        {
            // If there's a reward panel, add the valuables to the inventory after
            // the player confirms.
            if (RewardPanel)
            {
                if (ApplyRewardOnPanelClose)
                {
                    RewardPanel.Push(valuables, onReward);
                }
                else
                {
                    RewardPanel.Push(valuables);

                    if (onReward != null)
                    {
                        onReward();
                    }
                }
            }
            else
            {
                if (onReward != null)
                {
                    onReward();
                }
            }
        }
        void PopulateContent(ActiveResourceContainer <LocationAttractionItemProperties> attractionContent)
        {
            var isUnlocked = Data.IsUnlocked(attractionContent.ActivationContext, attractionContent.Resource);

            PanelLink toPush = null;

            var contentItem = attractionContent.Resource.GetItem();

            if (contentItem is ScreenMessage)
            {
                toPush = ScreenMessagePanelLink;
            }
            else if (contentItem is MediaContent)
            {
                toPush = AudioPanelLink;
            }

            var item = AddSelectableItem(AttractionContentItem, (_item) =>
            {
                if (toPush)
                {
                    toPush.Push(contentItem);
                }
            });

            item.Selectable = isUnlocked;

            item.SetText(attractionContent.Resource.Title);
            item.SetText(item.Description, attractionContent.Resource.Description);

            item.Locked.SetActive(!isUnlocked);
            item.Unlocked.SetActive(isUnlocked);
        }
Exemple #3
0
 public override void Populate(TaskObjective obj)
 {
     if (ObjectiveInfoPanel)
     {
         ObjectiveInfoPanel.Push(obj);
     }
 }
Exemple #4
0
 public void EnterFullScreen()
 {
     if (FullScreenPanelLink)
     {
         FullScreenPanelLink.Push(Data);
     }
 }
Exemple #5
0
        void Todo_Updated()
        {
            var assnDriver = Data ?? TaskManager.Instance.FirstAssignment;

            if (m_pushedItem != null &&
                m_pushedItem.IsComplete &&
                AssignmentItemPanel.GetPanel().Data == m_pushedItem)
            {
                AssignmentItemPanel.Back();
            }

            if (TodoManager.Instance.CurrentTodoDriver != null &&
                assnDriver != null &&
                assnDriver.Assignment.Objectives != null)
            {
                var idx = 1;

                foreach (var obj in TaskManager.Instance.GetActiveObjectivesForAssignment(assnDriver.Assignment))
                {
                    var task = TaskManager.Instance.GetTaskDriverForObjective(obj.Objective);

                    if (task == TodoManager.Instance.CurrentTodoDriver)
                    {
                        m_pushedItem = new TaskAssignmentItem(assnDriver, task, idx);

                        AssignmentItemPanel.Push(m_pushedItem);
                    }

                    idx++;
                }
            }
        }
Exemple #6
0
 public override void Populate(AssignmentItem obj)
 {
     if (AssignmentItemInfoPanel)
     {
         AssignmentItemInfoPanel.Push(obj);
     }
 }
 public override void Populate(IPlayerTaskDriver obj)
 {
     if (TaskInfoPanel)
     {
         TaskInfoPanel.Push(obj);
     }
 }
 public override void Populate(Recipe recipe)
 {
     if (ExecuteRecipePanel)
     {
         ExecuteRecipePanel.Push(recipe);
     }
 }
Exemple #9
0
        public override void Populate(AssignmentDriver obj)
        {
            if (AssignmentCompletePanel)
            {
                if (obj.IsComplete)
                {
                    AssignmentCompletePanel.Push(obj);
                }
                else
                {
                    AssignmentCompletePanel.Back();
                }
            }

            base.Populate(obj);
        }
Exemple #10
0
        public override void Populate()
        {
            Table.Clear();

            foreach (var attraction in AttractionManager.Instance.ActiveAttractions)
            {
                var arg = attraction;

                var item = AddSelectableItem(LocationAttractionItem, (_item) =>
                {
                    if (AttractionDetailsPanel)
                    {
                        AttractionDetailsPanel.Push(arg);
                    }
                });

                item.Populate(attraction);
            }
        }
        public void PushCraftScreen()
        {
            var data = Data;

            if (CraftScreen)
            {
                var p = CraftScreen.GetPanel <ExecuteRecipePanel>();
                CraftScreen.Push(Data, () =>
                {
                    if (p && p.NumCrafted > 0)
                    {
                        if (OnExecuteRecipe != null)
                        {
                            OnExecuteRecipe.Invoke();
                        }

                        if (CloseOnExecute)
                        {
                            Back();
                        }
                    }
                });
            }
        }