Beispiel #1
0
 void hbm_ModeChanged(object sender, EventArgs e)
 {
     if (currentPanel != null)
     {
         while (focusManager.CurrentFocusObject != hbm)
         {
             focusManager.RemoveFocus();
         }
     }
     currentPanel = panelList[hbm.CurrentMode];
     focusManager.Focus(currentPanel);
 }
Beispiel #2
0
        void startPanel_SettingFinished(object sender, EventArgs e)
        {
            this.ClearChildren();
            focusManager.Focus(hbm);
            focusManager.Focus(fp);
            currentPanel = fp;
            this.AddChild(hbm);
            this.AddChild(header);
            this.AddChild(sp);
            this.AddChild(mp);
            this.AddChild(glp);
            this.AddChild(fp);
            this.AddChild(back);

            PPDGeneralSetting.Setting.IsFirstExecution = false;
            (GameHost as MyGame).KeyConfigManager.Write("keyconfig.ini");
            (GameHost as MyGame).Input.AssignMode = false;
        }
Beispiel #3
0
        public override bool Load()
        {
            base.Load();
            OnLoadProgressed(0);
            back = new PictureObject(device, ResourceManager, Utility.Path.Combine("background.png"));
            OnLoadProgressed(1);
            hbm = new HomeBottomMenu(device, ResourceManager, Sound);
            OnLoadProgressed(10);
            header = new HomeTopHeader(device, ResourceManager, hbm);
            OnLoadProgressed(20);
            focusManager        = new FocusManager(this);
            sp                  = new SettingPanel(device, ResourceManager, GameHost as MyGame, Sound);
            mp                  = new MoviePanel(device, GameHost as MyGame, ResourceManager, Sound);
            glp                 = new GameListPanel(device, ResourceManager, Sound);
            fp                  = new FeedPanel(device, GameHost, ResourceManager, Sound);
            sp.LoadProgressed  += panel_LoadProgressed;
            mp.LoadProgressed  += panel_LoadProgressed;
            glp.LoadProgressed += panel_LoadProgressed;
            fp.LoadProgressed  += panel_LoadProgressed;

            glp.GameStarted += glp_GameStarted;
            hbm.ModeChanged += hbm_ModeChanged;

            panelList = new SortedList <HomeBottomMenu.Mode, HomePanelBase>
            {
                { HomeBottomMenu.Mode.Feed, fp }, { HomeBottomMenu.Mode.Game, glp }, { HomeBottomMenu.Mode.Movie, mp }, { HomeBottomMenu.Mode.Setting, sp }
            };

            sp.Load();
            mp.Load();
            glp.Load();
            fp.Load();

            foreach (HomePanelBase panel in panelList.Values)
            {
                if (panel != currentPanel)
                {
                    panel.Alpha = 0;
                }
            }
            if (!PPDGeneralSetting.Setting.IsFirstExecution)
            {
                focusManager.Focus(hbm);
                focusManager.Focus(fp);
                currentPanel = fp;
                this.AddChild(hbm);
                this.AddChild(header);
                this.AddChild(sp);
                this.AddChild(mp);
                this.AddChild(glp);
                this.AddChild(fp);
            }
            else
            {
                startPanel = new StartPanel(device, GameHost as MyGame, ResourceManager);
                startPanel.SettingFinished += startPanel_SettingFinished;
                this.AddChild(startPanel);
            }
            this.AddChild(back);

            ChangeControllerConfig();
            OnLoadProgressed(100);

            return(true);
        }