Exemple #1
0
        internal void RefreshMenuChoices()
        {
            SuspendExists = Global.suspend_file_info != null;
            MenuChoices[(int)Main_Menu_Selections.Resume].Visible = SuspendExists;
            MenuChoices[(int)Main_Menu_Selections.Extras].Visible = Global.progress.ExtrasAccessible;

            if (SuspendExists)
            {
                SuspendPanel              = new Suspend_Info_Panel(true);
                SuspendPanel.loc          = new Vector2(-16, 8);
                SuspendPanel.stereoscopic = Config.TITLE_MENU_DEPTH;
            }
            else
            {
                SuspendPanel = null;
            }

            StartGamePanel = new StartGame_Info_Panel(
                Global.latest_save_id, MainMenuChoicePanel.PANEL_WIDTH, true);
            // Show preview of the latest save, if there is one
            StartGamePanel.active       = Global.latest_save_id != -1;
            StartGamePanel.loc          = new Vector2(-16, 8);
            StartGamePanel.stereoscopic = Config.TITLE_MENU_DEPTH;

            RefreshLocs();

            IEnumerable <MainMenuChoicePanel> nodes = new List <MainMenuChoicePanel>(MenuChoices);

            nodes       = nodes.Where(x => x.Visible);
            ChoiceNodes = new UINodeSet <MainMenuChoicePanel>(nodes);
            ChoiceNodes.CursorMoveSound  = System_Sounds.Menu_Move1;
            ChoiceNodes.SoundOnMouseMove = true;

            ChoiceNodes.set_active_node(MenuChoices[(int)Selection]);
            RefreshLocs();
        }
Exemple #2
0
        private void initialize(int fileId)
        {
            Cursor                   = new Hand_Cursor();
            Cursor.draw_offset       = new Vector2(-8, 4);
            Cursor.stereoscopic      = Config.TITLE_MENU_DEPTH;
            Move_Cursor              = new Hand_Cursor();
            Move_Cursor.draw_offset  = new Vector2(-8, 4);
            Move_Cursor.tint         = new Color(160, 160, 160, 255);
            Move_Cursor.stereoscopic = Config.TITLE_MENU_DEPTH;

            for (int i = 0; i < Panels.Length; i++)
            {
                Panels[i] = new StartGame_Info_Panel(Page * Config.SAVES_PER_PAGE + i + 1, PANEL_WIDTH);
                Panels[i].stereoscopic = Config.TITLE_MENU_DEPTH;
            }

            refresh_panel_locations();
            PanelNodes = new UINodeSet <StartGame_Info_Panel>(Panels);
            PanelNodes.CursorMoveSound  = System_Sounds.Menu_Move1;
            PanelNodes.WrapVerticalMove = true;

            // Page Arrows
            Left_Page_Arrow                = new Page_Arrow();
            Left_Page_Arrow.loc            = new Vector2(-4, 68);
            Left_Page_Arrow.stereoscopic   = Config.TITLE_MENU_DEPTH - 1;
            Left_Page_Arrow.ArrowClicked  += Left_Page_Arrow_ArrowClicked;
            Right_Page_Arrow               = new Page_Arrow();
            Right_Page_Arrow.loc           = new Vector2(PANEL_WIDTH - 4, 68);
            Right_Page_Arrow.mirrored      = true;
            Right_Page_Arrow.stereoscopic  = Config.TITLE_MENU_DEPTH - 1;
            Right_Page_Arrow.ArrowClicked += Right_Page_Arrow_ArrowClicked;

            create_cancel_button();

            this.file_id = fileId;
        }