// c'tor public LiveFeedDisplay() { this.msNewsFeed = new NewsFeeds(); this.smallblob = new TextBlob(UI2D.Shared.GetGameFont18Bold, Strings.Localize("mainMenu.news"), 300); this.smallblob.Justification = UIGridElement.Justification.Left; this.flagMoreBlob = new TextBlob(expandFlagFont, Strings.Localize("mainMenu.more"), 80); this.flagLessBlob = new TextBlob(expandFlagFont, Strings.Localize("mainMenu.less"), 80); this.newsScroller = new ItemScroller(scrollBoxPos, FeedSize, new Color(0.0f, 0.0f, 0.0f, 0.0f), null, null); this.hitBox = new AABB2D(new Vector2(0, 0), FeedSize); // this.Header_bg = BokuGame.Load<Texture2D>(BokuGame.Settings.MediaPath + @"Textures\twitter_Icon"); this.cloudTR = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\MainMenu\cloudTR"); this.cloudBR = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\MainMenu\cloudBR"); this.cloudTL = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\MainMenu\cloudTL"); this.cloudBL = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\MainMenu\cloudBL"); this.cloudTC = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\MainMenu\cloudTC"); this.cloudBC = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\MainMenu\cloudBC"); this.cloudLC = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\MainMenu\cloudLC"); this.cloudRC = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\MainMenu\cloudRC"); this.cloudCenter = BokuGame.Load <Texture2D>(BokuGame.Settings.MediaPath + @"Textures\MainMenu\cloudCenter"); newsScroller.Clear(); FeedMs item = new FeedMs(FeedSize, "Getting News feed...", TitleFont, DateFont, BodyFont); newsScroller.AddItem(item); //Twitter.GetTweets(); msNewsFeed.BeginFetchNews(); gettingFeeds = true; } // end of c'tor
private void UpdateDisplayWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Error == null && !e.Cancelled) { var response = (e.Result as DisplayResponse); ItemScroller.BindData(response.DisplayItems); var itemCount = response.DisplayItems.Count(); if (itemCount > 0) { if (displayState.CurrentState == CurrentStates.RootGenres) { ResultSize.Text = string.Format("Choose from {0} Genre{1}", itemCount, (itemCount != 1 ? "s" : "")); } else if (displayState.CurrentState == CurrentStates.SubGenres) { ResultSize.Text = string.Format("Choose from {0} Sub-Genre{1}", itemCount, (itemCount != 1 ? "s" : "")); } else if (displayState.CurrentState == CurrentStates.Titles) { ResultSize.Text = string.Format("Choose from {0} Title{1}", itemCount, (itemCount != 1 ? "s" : "")); } else { ResultSize.Text = ""; } } breadcrumb.Text = response.HeaderText; LayoutRoot.Visibility = System.Windows.Visibility.Visible; } HideLoading(); }
public void Activate() { if (state != States.Active) { this.useBackgroundThumbnail = true;// useBackgroundThumbnail; // this.useOverscanForHitTesting = useOverscanForHitTesting; if (newsScroller == null) { newsScroller = new ItemScroller(scrollBoxPos, FeedSize, new Color(0.0f, 0.0f, 0.0f, 0.0f), null, null); hitBox = new AABB2D(scrollBoxPos, FeedSize); } // FeedSize = ResetScrollBoxSize; newsScroller.Activate(); state = States.Active; expanded = true; } } // end of Activate
public void Activate() { if (state != States.Active) { this.useBackgroundThumbnail = true;// useBackgroundThumbnail; // this.useOverscanForHitTesting = useOverscanForHitTesting; if (newsScroller == null) { newsScroller = new ItemScroller(scrollBoxPos, FeedSize, new Color(0.0f, 0.0f, 0.0f, 0.0f), null, null); hitBox = new AABB2D(scrollBoxPos, FeedSize); } // Do stack handling here. If we do it in the update object we have no // clue which order things get pushed and popped and madness ensues. CommandStack.Push(commandMap); // FeedSize = ResetScrollBoxSize; newsScroller.Activate(); state = States.Active; expanded = true; } } // end of Activate
// c'tor public LiveFeedDisplay() { blob = new TextBlob(UI2D.Shared.GetGameFont24, "NEWSFEED", 150); newsScroller = new ItemScroller(GetScrollBoxSize, new Color(0.0f, 0.0f, 0.0f, 0.0f), null, null); } // end of c'tor
private void keyUp(object sender, KeyEventArgs e) { if (captureKeyEvents) { e.Handled = true; if (e.Key == Key.Left) { ItemScroller.ShiftLeft(); } else if (e.Key == Key.Right) { ItemScroller.ShiftRight(); } else if (e.Key == Key.Up) { HideErrorMessage(); switch (displayState.CurrentState) { case CurrentStates.SubGenres: UpdateDisplay(CurrentStates.RootGenres, DisplayActions.Return); break; case CurrentStates.Titles: UpdateDisplay(CurrentStates.SubGenres, DisplayActions.Return); break; case CurrentStates.Reviews: UpdateDisplay(CurrentStates.Titles, DisplayActions.Return); break; default: ShowErrorMessage("Unable to go up, please choose a genre."); break; } } else if (e.Key == Key.Down) { HideErrorMessage(); switch (displayState.CurrentState) { case CurrentStates.RootGenres: UpdateDisplay(CurrentStates.SubGenres, DisplayActions.Select); break; case CurrentStates.SubGenres: UpdateDisplay(CurrentStates.Titles, DisplayActions.Select); break; case CurrentStates.Titles: ShowErrorMessage("Unable to go down, press menu to play movie."); break; default: Beep(); break; } } else if (e.Key == Key.Enter) { if (!duplicateMenu) { duplicateMenu = true; string titleId = null; if (displayState.CurrentState >= CurrentStates.Titles) { titleId = (ItemScroller.CurrentDataItem as TitleDisplayItem).TitleId; } var menu = new MainMenu(titleId); menu.ShowInTaskbar = false; StopCapturingKeyEvents(); menu.ShowDialog(); if (!string.IsNullOrWhiteSpace(menu.MessageText)) { this.ShowErrorMessage(menu.MessageText); } menu.Close(); StartCapturingKeyEvents(); } else { duplicateMenu = false; } } } }