public EventDisplayItem(EventDistribution eventDist, IGameSave gameSave) { InitializeComponent(); this.eventDist = eventDist; this.gameSave = gameSave; this.labeTitle.Content = eventDist.GetTitle(gameSave) + (PokeManager.IsEventCompletedBy(eventDist.ID, gameSave) ? " (Completed)" : ""); BitmapSource image = eventDist.SmallSprite; this.imageSprite.Width = image.PixelWidth; this.imageSprite.Height = image.PixelHeight; this.imageSprite.Source = image; }
private void UpdateDetails() { int count = 0; int completed = 0; for (int i = 0; i < PokeManager.NumEvents; i++) { EventDistribution eventDist = PokeManager.GetEventAt(i); if (eventDist.AllowedGames.HasFlag((GameTypeFlags)(1 << ((int)gameSave.GameType - 1)))) { count++; if (PokeManager.IsEventCompletedBy(eventDist.ID, gameSave)) { completed++; } } } labelPocket.Content = "Events Completed " + completed + "/" + count; }
private void OnItemListSelectionChanged(object sender, SelectionChangedEventArgs e) { int index = listViewItems.SelectedIndex; if (index < listViewItems.Items.Count) { if (index != -1) { selectedIndex = index; } if (selectedIndex != -1 && selectedIndex < listViewItems.Items.Count) { selectedEvent = (listViewItems.Items[selectedIndex] as EventDisplayItem).Event; this.labelTitle.Content = selectedEvent.GetTitle(gameSave) + (PokeManager.IsEventCompletedBy(selectedEvent.ID, gameSave) ? " (Completed)" : ""); this.textBlockDescription.Text = selectedEvent.GetDescription(gameSave); this.textBlockRequirements.Text = selectedEvent.GetRequirements(gameSave); this.imageSprite.Width = selectedEvent.BigSprite.PixelWidth; this.imageSprite.Height = selectedEvent.BigSprite.PixelHeight; this.imageSprite.Source = selectedEvent.BigSprite; this.buttonActivate.IsEnabled = !PokeManager.IsEventCompletedBy(selectedEvent.ID, gameSave) && selectedEvent.IsRequirementsFulfilled(gameSave); } else { selectedEvent = null; this.labelTitle.Content = ""; this.textBlockDescription.Text = ""; this.textBlockRequirements.Text = ""; this.imageSprite.Source = null; this.buttonActivate.IsEnabled = false; } } else { selectedEvent = null; selectedIndex = -1; this.labelTitle.Content = ""; this.textBlockDescription.Text = ""; this.textBlockRequirements.Text = ""; this.imageSprite.Source = null; this.buttonActivate.IsEnabled = false; } }
public void UpdateDisplay() { this.labeTitle.Content = eventDist.GetTitle(gameSave) + (PokeManager.IsEventCompletedBy(eventDist.ID, gameSave) ? " (Completed)" : ""); }