示例#1
0
        private void _GotoTitleScreen()
        {
            OuiTitleScreen title = Overworld.Goto <OuiTitleScreen>();

            title.IsStart(Overworld, Overworld.StartMode.Titlescreen);
            title.IsStart(Overworld, Overworld.StartMode.MainMenu);

            DynData <OuiTitleScreen> data = new DynData <OuiTitleScreen>(title);

            data.Set <float>("alpha", 0);
            title.Visible = true;
        }
示例#2
0
        public void RebuildMainAndTitle()
        {
            Overworld oui = Overworld;

            oui.UIs.Remove(oui.GetUI <OuiTitleScreen>());
            Oui title = new OuiTitleScreen()
            {
                Visible = false
            };

            title.IsStart(oui, Overworld.StartMode.MainMenu);
            oui.Add(title);
            oui.UIs.Add(title);

            MenuButton selected = null;

            foreach (MenuButton button in buttons)
            {
                if (!button.Selected)
                {
                    continue;
                }
                selected = button;
                break;
            }

            CreateButtons();

            if (selected is MainMenuClimb)
            {
                foreach (MenuButton button in buttons)
                {
                    button.SetSelected(button is MainMenuClimb);
                }
            }
            else
            {
                string selectedLabel = (selected as MainMenuSmallButton)?.GetLabelName();
                foreach (MenuButton button in buttons)
                {
                    button.SetSelected((button as MainMenuSmallButton)?.GetLabelName() == selectedLabel);
                }
            }
        }