Exemplo n.º 1
0
        public static void ChangeSelectedTab()
        {
            currentTab.Hide();

            currentTab = OptionScript.tabs[string.Concat(selectedModIndex.ToString("D3") + "_" + selectedTabIndex.ToString("D2"))];

            currentTab.Show();
        }
Exemplo n.º 2
0
        public void ResetCurrentConfig()
        {
            if (!currentInterface.Configuable())
            {
                return;
            }

            foreach (OpTab tab in currentInterface.Tabs)
            {
                foreach (UIelement element in tab.items)
                {
                    foreach (MenuObject obj in element.subObjects)
                    {
                        obj.RemoveSprites();
                        this.pages[0].subObjects.Remove(obj);
                    }
                    this.pages[0].Container.RemoveChild(element.myContainer);
                    element.myContainer.RemoveFromContainer();
                }
                tab.Unload();
            }
            int i = 0;

            do
            {
                string key = string.Concat(selectedModIndex.ToString("D3") + "_" + i.ToString("D2"));
                if (OptionScript.tabs.ContainsKey(key))
                {
                    OptionScript.tabs.Remove(key);
                }
                else
                {
                    break;
                }
                i++;
            } while (i < 100);

            currentInterface.Initialize();
            for (i = 0; i < currentInterface.Tabs.Length; i++)
            {
                string key = string.Concat(selectedModIndex.ToString("D3") + "_" + i.ToString("D2"));
                OptionScript.tabs.Add(key, currentInterface.Tabs[i]);
                foreach (UIelement element in currentInterface.Tabs[i].items)
                {
                    foreach (RectangularMenuObject obj in element.subObjects)
                    {
                        this.pages[0].subObjects.Add(obj);
                    }
                    this.pages[0].Container.AddChild(element.myContainer);
                }
                currentInterface.Tabs[i].Hide();
            }

            selectedTabIndex = 0;
            currentTab       = currentInterface.Tabs[0];
            currentTab.Show();
            currentInterface.SaveConfig(currentInterface.GrabConfig());
            currentInterface.ConfigOnChange();

            //OptionScript.configChanged = false;
        }