/// <summary>
            /// Adds a terminal page to the category
            /// </summary>
            public void Add(TerminalPageBase page)
            {
                page.Element.TextBoard.AutoResize = false;
                page.Element.Padding = new Vector2(20f, 6f);

                treeBox.Add(page);
                pages.Add(page);
            }
Exemplo n.º 2
0
                private void HandleSelectionChange()
                {
                    if (lastPage != null)
                    {
                        var pageElement = lastPage.AssocMember as HudElementBase;
                        int index       = bodyChain.FindIndex(x => x.Element == pageElement);

                        bodyChain.RemoveAt(index);
                    }

                    if (SelectedPage != null)
                    {
                        bodyChain.Add(SelectedPage.AssocMember as HudElementBase);
                    }

                    lastPage = SelectedPage;
                }
Exemplo n.º 3
0
                    /// <summary>
                    /// Opens to the given terminal page
                    /// </summary>
                    public void SetSelection(ModControlRoot modRoot, TerminalPageBase newPage)
                    {
                        listInput.SetSelection(modRoot);

                        if (SelectedPage != newPage)
                        {
                            TerminalPageCategoryBase subcategory = null;
                            bool contains = false;

                            foreach (TerminalPageBase page in modRoot.Pages)
                            {
                                if (page == newPage)
                                {
                                    contains = true;
                                    break;
                                }
                            }

                            if (!contains)
                            {
                                foreach (TerminalPageCategoryBase cat in modRoot.Subcategories)
                                {
                                    foreach (TerminalPageBase page in cat.Pages)
                                    {
                                        if (page == newPage)
                                        {
                                            subcategory = cat;
                                            contains    = true;
                                            break;
                                        }
                                    }
                                }
                            }

                            if (subcategory != null)
                            {
                                modRoot.SetSelection(subcategory);
                                subcategory.SetSelection(newPage);
                            }
                            else
                            {
                                modRoot.SetSelection(newPage);
                            }
                        }
                    }
 /// <summary>
 /// Sets the current page to the one given
 /// </summary>
 public static void SetPage(TerminalPageBase newPage)
 {
     _instance.settingsMenu.SetSelection(_instance.root, newPage);
 }
 /// <summary>
 /// Sets the current page to the one given
 /// </summary>
 public static void OpenToPage(TerminalPageBase newPage)
 {
     OpenMenu();
     _instance.settingsMenu.SetSelection(_instance.root, newPage);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Sets the current page to the one given
 /// </summary>
 public static void SetPage(TerminalPageBase newPage)
 {
     _instance.GetOrSetMembersFunc(new MyTuple <object, object>(_instance.menuRoot.ID, newPage.ID), (int)TerminalAccessors.SetPage);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Opens the given terminal page
 /// </summary>
 public void SetSelection(ModControlRoot modRoot, TerminalPageBase newPage) =>
 modList.SetSelection(modRoot, newPage);
Exemplo n.º 8
0
 /// <summary>
 /// Adds the given <see cref="TerminalPageBase"/> to the object.
 /// </summary>
 public void Add(TerminalPageBase page) =>
 GetOrSetMemberFunc(page.ID, (int)TerminalPageCategoryAccessors.AddPage);