示例#1
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++;
                }
            }
        }
        public void Reset()
        {
            if (ResetDialog)
            {
                var panel = ResetDialog.GetPanel <OptionsDialogPanel>();

                if (panel)
                {
                    panel.Show(new string[] { "OK", "Cancel" },
                               (opt) =>
                    {
                        if (opt == "OK")
                        {
                            Back();

                            AppManager.Instance.Reset();
                        }
                    });
                }
            }
            else
            {
                Back();

                AppManager.Instance.Reset();
            }
        }
        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();
                        }
                    }
                });
            }
        }
示例#4
0
 public virtual Panel GetSelectedLocationPanel()
 {
     return(SelectedLocationPanel != null?
            SelectedLocationPanel.GetPanel() : null);
 }