private void NavigateButton_Click(object sender, RoutedEventArgs e) { Click(); Button b = (Button)sender; OptionsButton.Visibility = Visibility.Visible; if (b.Name.Equals("UpgradesButton")) { InnerFrame.Navigate(typeof(UpgradesPage), Data); } else if (b.Name.Equals("SpecialButton")) { InnerFrame.Navigate(typeof(SpecialPage), Data); } else if (b.Name.Equals("StatsButton")) { InnerFrame.Navigate(typeof(StatsPage), Data); } else if (b.Name.Equals("AchievementsButton")) { InnerFrame.Navigate(typeof(AchievementsPage), Data); } else if (b.Name.Equals("OptionsButton")) { InnerFrame.Navigate(typeof(OptionsPage), Data); OptionsButton.Visibility = Visibility.Collapsed; } BackButton.Visibility = Visibility.Visible; }
private void BackButton_Click(object sender, RoutedEventArgs e) { Click(); InnerFrame.Navigate(typeof(ButtonPage), Data); BackButton.Visibility = Visibility.Collapsed; OptionsButton.Visibility = Visibility.Visible; }
public MainPage() { this.InitializeComponent(); InnerFrame.Navigate(typeof(Financial)); text.Text = " Financial "; BackButton.Visibility = Visibility.Collapsed; }
private void GoBackButton_Click(object sender, RoutedEventArgs e) { if (InnerFrame.CanGoBack) { InnerFrame.GoBack(); } }
private void GoBackButton_Click(object sender, RoutedEventArgs e) { InnerFrame.GoBack(); this.GoBackButton.IsEnabled = InnerFrame.BackStack.Any(); SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = InnerFrame.BackStack.Any() ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed; }
private void IconsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (ItemsListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(ItemPage)); ToItems(); } }
private void MainPage_BackRequested(object sender, BackRequestedEventArgs e) { if (InnerFrame.BackStack.Any()) { e.Handled = true; InnerFrame.GoBack(); } }
private void BackButton_Click(object sender, RoutedEventArgs e) { if (InnerFrame.CanGoBack) { InnerFrame.GoBack(); BackButton.Visibility = Visibility.Collapsed; Title.Text = "Financial"; } }
private void IconsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (FinancialListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(Financial)); ToFinancial(); } else if (FoodListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(Food)); ToFood(); } }
protected override void Update(float deltaTime) { if (type == Type.InGame) { Vector2 initialPos = new Vector2(0.0f, GameMain.GraphicsHeight); Vector2 defaultPos = new Vector2(0.0f, HUDLayoutSettings.InventoryAreaLower.Y - InnerFrame.Rect.Height - 20 * GUI.Scale); Vector2 endPos = new Vector2(GameMain.GraphicsWidth, defaultPos.Y); /*for (int i = MessageBoxes.IndexOf(this); i >= 0; i--) * { * if (MessageBoxes[i] is GUIMessageBox otherMsgBox && otherMsgBox != this && otherMsgBox.type == type && !otherMsgBox.closing) * { * defaultPos = new Vector2( * Math.Max(otherMsgBox.InnerFrame.RectTransform.AbsoluteOffset.X + 10 * GUI.Scale, defaultPos.X), * Math.Max(otherMsgBox.InnerFrame.RectTransform.AbsoluteOffset.Y + 10 * GUI.Scale, defaultPos.Y)); * } * }*/ if (!closing) { InnerFrame.RectTransform.AbsoluteOffset = Vector2.SmoothStep(initialPos, defaultPos, openState).ToPoint(); openState = Math.Min(openState + deltaTime * 2.0f, 1.0f); if (GUI.MouseOn != InnerFrame && !InnerFrame.IsParentOf(GUI.MouseOn)) { inGameCloseTimer += deltaTime; } if (inGameCloseTimer >= inGameCloseTime) { Close(); } } else { openState += deltaTime * 2.0f; InnerFrame.RectTransform.AbsoluteOffset = Vector2.SmoothStep(defaultPos, endPos, openState - 1.0f).ToPoint(); if (openState >= 2.0f) { if (Parent != null) { Parent.RemoveChild(this); } if (MessageBoxes.Contains(this)) { MessageBoxes.Remove(this); } } } } }
private void IconsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (FinancialListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(Financial)); BackButton.Visibility = Visibility.Collapsed; Title.Text = "Financial"; } else if (FoodListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(Food)); BackButton.Visibility = Visibility.Visible; Title.Text = "Food"; } }
private void IconsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (EPICListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(EPIC)); } else if (LearnYourselfListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(Learn_Yourself)); } else if (WelcomeListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(Welcome)); WelcomeListBoxItem.IsSelected = false; } }
public MainPage() { this.InitializeComponent(); Data.CommitsClickIncrement = 1; Data.Commits = 0; Data.CommitsPerSecond = 0; Data.Specialpoints = 0; InnerFrame.Navigate(typeof(ButtonPage), Data); BackButton.Visibility = Visibility.Collapsed; timer = new DispatcherTimer(); timer.Interval = new TimeSpan(0, 0, 0, 1); timer.Tick += DispatcherTimer_Tick; timer.Start(); PopupText.Text = "Click on the Gear on the \nbottom left for instructions."; PopupTitleText.Text = "Welcome to CommitClicker!"; Popup.IsOpen = true; }
private void IconsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (HomeListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(Home)); Title.Text = "Home"; } else if (InfoListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(Info)); Title.Text = "Info"; } else if (SettingsListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(Settings)); Title.Text = "Play"; } SettingsListBoxItem.IsSelected = false; }
/// <summary> /// Navigates between pages when their corresponding item is selected. /// </summary> private void IconsListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (CalculatorListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(Calculator), currentUser); LocationTextBlock2.Visibility = Visibility.Collapsed; LocationTextBlock3.Visibility = Visibility.Collapsed; LocationTextBlock.Visibility = Visibility.Visible; } else if (HistoryListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(History), currentUser); LocationTextBlock2.Visibility = Visibility.Visible; LocationTextBlock3.Visibility = Visibility.Collapsed; LocationTextBlock.Visibility = Visibility.Collapsed; } else if (SettingsListBoxItem.IsSelected) { InnerFrame.Navigate(typeof(Settings), currentUser); LocationTextBlock2.Visibility = Visibility.Collapsed; LocationTextBlock3.Visibility = Visibility.Visible; LocationTextBlock.Visibility = Visibility.Collapsed; } }
public MainPage() { this.InitializeComponent(); InnerFrame.Navigate(typeof(LoginPage)); }
protected override void Update(float deltaTime) { if (Draggable) { GUIComponent parent = GUI.MouseOn?.Parent?.Parent; if ((GUI.MouseOn == InnerFrame || InnerFrame.IsParentOf(GUI.MouseOn)) && !(GUI.MouseOn is GUIButton || GUI.MouseOn is GUIColorPicker || GUI.MouseOn is GUITextBox || parent is GUITextBox)) { GUI.MouseCursor = CursorState.Move; if (PlayerInput.PrimaryMouseButtonDown()) { DraggingPosition = RectTransform.ScreenSpaceOffset.ToVector2() - PlayerInput.MousePosition; } } if (PlayerInput.PrimaryMouseButtonHeld() && DraggingPosition != Vector2.Zero) { GUI.MouseCursor = CursorState.Dragging; RectTransform.ScreenSpaceOffset = (PlayerInput.MousePosition + DraggingPosition).ToPoint(); } else { DraggingPosition = Vector2.Zero; } } if (type == Type.InGame) { Vector2 initialPos = new Vector2(0.0f, GameMain.GraphicsHeight); Vector2 defaultPos = new Vector2(0.0f, HUDLayoutSettings.InventoryAreaLower.Y - InnerFrame.Rect.Height - 20 * GUI.Scale); Vector2 endPos = new Vector2(GameMain.GraphicsWidth, defaultPos.Y); if (!closing) { Point step = Vector2.SmoothStep(initialPos, defaultPos, openState).ToPoint(); InnerFrame.RectTransform.AbsoluteOffset = step; if (BackgroundIcon != null) { BackgroundIcon.RectTransform.AbsoluteOffset = new Point(InnerFrame.Rect.Location.X - (int)(BackgroundIcon.Rect.Size.X / 1.25f), (int)defaultPos.Y - BackgroundIcon.Rect.Size.Y / 2); if (!MathUtils.NearlyEqual(openState, 1.0f)) { BackgroundIcon.Color = ToolBox.GradientLerp(openState, Color.Transparent, Color.White); } } if (!(Screen.Selected is RoundSummaryScreen) && !MessageBoxes.Any(mb => mb.UserData is RoundSummary)) { openState = Math.Min(openState + deltaTime * 2.0f, 1.0f); } if (GUI.MouseOn != InnerFrame && !InnerFrame.IsParentOf(GUI.MouseOn) && AutoClose) { inGameCloseTimer += deltaTime; } if (inGameCloseTimer >= inGameCloseTime) { Close(); } } else { openState += deltaTime * 2.0f; Point step = Vector2.SmoothStep(defaultPos, endPos, openState - 1.0f).ToPoint(); InnerFrame.RectTransform.AbsoluteOffset = step; if (BackgroundIcon != null) { BackgroundIcon.Color *= 0.9f; } if (openState >= 2.0f) { if (Parent != null) { Parent.RemoveChild(this); } if (MessageBoxes.Contains(this)) { MessageBoxes.Remove(this); } } } if (newBackgroundIcon != null) { if (!iconSwitching) { if (BackgroundIcon != null) { BackgroundIcon.Color *= 0.9f; if (BackgroundIcon.Color.A == 0) { BackgroundIcon = null; iconSwitching = true; RemoveChild(BackgroundIcon); } } else { iconSwitching = true; } iconState = 0; } else { newBackgroundIcon.SetAsFirstChild(); newBackgroundIcon.RectTransform.AbsoluteOffset = new Point(InnerFrame.Rect.Location.X - (int)(newBackgroundIcon.Rect.Size.X / 1.25f), (int)defaultPos.Y - newBackgroundIcon.Rect.Size.Y / 2); newBackgroundIcon.Color = ToolBox.GradientLerp(iconState, Color.Transparent, Color.White); if (newBackgroundIcon.Color.A == 255) { BackgroundIcon = newBackgroundIcon; BackgroundIcon.SetAsFirstChild(); newBackgroundIcon = null; iconSwitching = false; } iconState = Math.Min(iconState + deltaTime * 2.0f, 1.0f); } } } }
private void CompleteClick(object sender, RoutedEventArgs e) { InnerFrame.Navigate(typeof(CompletePage)); }
private void ScheduleClick(object sender, RoutedEventArgs e) { InnerFrame.Navigate(typeof(SchedulePage)); }
private void DonutClick(object sender, RoutedEventArgs e) { InnerFrame.Navigate(typeof(DonutPage)); }
protected override void Update(float deltaTime) { if (type != Type.InGame) { return; } Vector2 initialPos = new Vector2(0.0f, GameMain.GraphicsHeight); Vector2 defaultPos = new Vector2(0.0f, HUDLayoutSettings.InventoryAreaLower.Y - InnerFrame.Rect.Height - 20 * GUI.Scale); Vector2 endPos = new Vector2(GameMain.GraphicsWidth, defaultPos.Y); if (!closing) { Point step = Vector2.SmoothStep(initialPos, defaultPos, openState).ToPoint(); InnerFrame.RectTransform.AbsoluteOffset = step; if (BackgroundIcon != null) { BackgroundIcon.RectTransform.AbsoluteOffset = new Point(InnerFrame.Rect.Location.X - (int)(BackgroundIcon.Rect.Size.X / 1.25f), (int)defaultPos.Y - BackgroundIcon.Rect.Size.Y / 2); if (!MathUtils.NearlyEqual(openState, 1.0f)) { BackgroundIcon.Color = ToolBox.GradientLerp(openState, Color.Transparent, Color.White); } } if (!(Screen.Selected is RoundSummaryScreen) && !MessageBoxes.Any(mb => mb.UserData is RoundSummary)) { openState = Math.Min(openState + deltaTime * 2.0f, 1.0f); } if (GUI.MouseOn != InnerFrame && !InnerFrame.IsParentOf(GUI.MouseOn) && AutoClose) { inGameCloseTimer += deltaTime; } if (inGameCloseTimer >= inGameCloseTime) { Close(); } } else { openState += deltaTime * 2.0f; Point step = Vector2.SmoothStep(defaultPos, endPos, openState - 1.0f).ToPoint(); InnerFrame.RectTransform.AbsoluteOffset = step; if (BackgroundIcon != null) { BackgroundIcon.Color *= 0.9f; } if (openState >= 2.0f) { if (Parent != null) { Parent.RemoveChild(this); } if (MessageBoxes.Contains(this)) { MessageBoxes.Remove(this); } } } if (newBackgroundIcon != null) { if (!iconSwitching) { if (BackgroundIcon != null) { BackgroundIcon.Color *= 0.9f; if (BackgroundIcon.Color.A == 0) { BackgroundIcon = null; iconSwitching = true; RemoveChild(BackgroundIcon); } } else { iconSwitching = true; } iconState = 0; } else { newBackgroundIcon.SetAsFirstChild(); newBackgroundIcon.RectTransform.AbsoluteOffset = new Point(InnerFrame.Rect.Location.X - (int)(newBackgroundIcon.Rect.Size.X / 1.25f), (int)defaultPos.Y - newBackgroundIcon.Rect.Size.Y / 2); newBackgroundIcon.Color = ToolBox.GradientLerp(iconState, Color.Transparent, Color.White); if (newBackgroundIcon.Color.A == 255) { BackgroundIcon = newBackgroundIcon; BackgroundIcon.SetAsFirstChild(); newBackgroundIcon = null; iconSwitching = false; } iconState = Math.Min(iconState + deltaTime * 2.0f, 1.0f); } } }
protected override void Update(float deltaTime) { if (type == Type.InGame) { Vector2 initialPos = new Vector2(0.0f, GameMain.GraphicsHeight); Vector2 defaultPos = new Vector2(0.0f, HUDLayoutSettings.InventoryAreaLower.Y - InnerFrame.Rect.Height - 20 * GUI.Scale); Vector2 endPos = new Vector2(GameMain.GraphicsWidth, defaultPos.Y); /*for (int i = MessageBoxes.IndexOf(this); i >= 0; i--) * { * if (MessageBoxes[i] is GUIMessageBox otherMsgBox && otherMsgBox != this && otherMsgBox.type == type && !otherMsgBox.closing) * { * defaultPos = new Vector2( * Math.Max(otherMsgBox.InnerFrame.RectTransform.AbsoluteOffset.X + 10 * GUI.Scale, defaultPos.X), * Math.Max(otherMsgBox.InnerFrame.RectTransform.AbsoluteOffset.Y + 10 * GUI.Scale, defaultPos.Y)); * } * }*/ if (!closing) { Point step = Vector2.SmoothStep(initialPos, defaultPos, openState).ToPoint(); InnerFrame.RectTransform.AbsoluteOffset = step; if (BackgroundIcon != null) { BackgroundIcon.RectTransform.AbsoluteOffset = new Point(InnerFrame.Rect.Location.X - (int)(BackgroundIcon.Rect.Size.X / 1.25f), (int)defaultPos.Y - BackgroundIcon.Rect.Size.Y / 2); if (!MathUtils.NearlyEqual(openState, 1.0f)) { BackgroundIcon.Color = ToolBox.GradientLerp(openState, Color.Transparent, Color.White); } } openState = Math.Min(openState + deltaTime * 2.0f, 1.0f); if (GUI.MouseOn != InnerFrame && !InnerFrame.IsParentOf(GUI.MouseOn) && AutoClose) { inGameCloseTimer += deltaTime; } if (inGameCloseTimer >= inGameCloseTime) { Close(); } } else { openState += deltaTime * 2.0f; Point step = Vector2.SmoothStep(defaultPos, endPos, openState - 1.0f).ToPoint(); InnerFrame.RectTransform.AbsoluteOffset = step; if (BackgroundIcon != null) { BackgroundIcon.Color *= 0.9f; } if (openState >= 2.0f) { if (Parent != null) { Parent.RemoveChild(this); } if (MessageBoxes.Contains(this)) { MessageBoxes.Remove(this); } } } if (newBackgroundIcon != null) { if (!iconSwitching) { if (BackgroundIcon != null) { BackgroundIcon.Color *= 0.9f; if (BackgroundIcon.Color.A == 0) { BackgroundIcon = null; iconSwitching = true; RemoveChild(BackgroundIcon); } } else { iconSwitching = true; } iconState = 0; } else { newBackgroundIcon.SetAsFirstChild(); newBackgroundIcon.RectTransform.AbsoluteOffset = new Point(InnerFrame.Rect.Location.X - (int)(newBackgroundIcon.Rect.Size.X / 1.25f), (int)defaultPos.Y - newBackgroundIcon.Rect.Size.Y / 2); newBackgroundIcon.Color = ToolBox.GradientLerp(iconState, Color.Transparent, Color.White); if (newBackgroundIcon.Color.A == 255) { BackgroundIcon = newBackgroundIcon; BackgroundIcon.SetAsFirstChild(); newBackgroundIcon = null; iconSwitching = false; } iconState = Math.Min(iconState + deltaTime * 2.0f, 1.0f); } } } }
private void BackButton_Click(object sender, RoutedEventArgs e) { text.Text = " Financial "; BackButton.Visibility = Visibility.Collapsed; InnerFrame.Navigate(typeof(Financial)); }
public MainPage() { this.InitializeComponent(); InnerFrame.Navigate(typeof(SearchPage), sharedData); }
public NavigationFlow() { InitializeComponent(); // Inner frame used to contain source and destination pages InnerFrame.Navigate(typeof(NavigationFlowSourcePage)); }
private void CoffeePageButton_Click(object sender, RoutedEventArgs e) { InnerFrame.Navigate(typeof(CoffeePage)); }
/// <summary> /// Invoked when the page is nagivated to, and initializes the user's data and displays /// the <c>History</c> page first. /// </summary> /// <param name="e">CurrentUser object</param> protected override void OnNavigatedTo(NavigationEventArgs e) { currentUser = (CurrentUser)e.Parameter; InnerFrame.Navigate(typeof(History), currentUser); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); InnerFrame.Navigate(typeof(BlankSubPage1)); this.GoBackButton.IsEnabled = InnerFrame.BackStack.Any(); }