public HomeTopHeader(PPDDevice device, PPDFramework.Resource.ResourceManager resourceManager, HomeBottomMenu hbm) : base(device) { this.resourceManager = resourceManager; this.hbm = hbm; strings = new TextureString[HomeBottomMenu.ModeArray.Length]; for (int i = 0; i < strings.Length; i++) { strings[i] = new TextureString(device, Utility.Language[HomeBottomMenu.ModeArray[i].ToString()], 18, true, PPDColors.White) { Position = new SharpDX.Vector2(400, 5) }; strings[i].Alpha = 0; this.AddChild(strings[i]); } hbm.ModeChanged += hbm_ModeChanged; this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("l.png")) { Position = new SharpDX.Vector2(5, 5) }); this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("r.png")) { Position = new SharpDX.Vector2(760, 5) }); this.AddChild(new PictureObject(device, resourceManager, Utility.Path.Combine("header.png"))); }
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); }