void btnCredits_Click(object sender, SdlDotNet.Widgets.MouseButtonEventArgs e) { this.Close(); WindowManager.FindWindow("winUpdates").Close(); WindowManager.FindWindow("winLogin").Close(); WindowSwitcher.AddWindow(new winCredits()); }
void lblUseCharacter_Click(object sender, SdlDotNet.Widgets.MouseButtonEventArgs e) { bool charSelected = false; if (btnChar1.Selected) { WindowSwitcher.GameWindow = new winGame(); Messenger.SendUseChar(1); charSelected = true; } else if (btnChar2.Selected) { WindowSwitcher.GameWindow = new winGame(); Messenger.SendUseChar(2); charSelected = true; } else if (btnChar3.Selected) { WindowSwitcher.GameWindow = new winGame(); Messenger.SendUseChar(3); charSelected = true; } if (charSelected) { this.Close(); WindowManager.AddWindow(new winLoading()); ((winLoading)WindowSwitcher.FindWindow("winLoading")).UpdateLoadText("Logging in..."); } }
void lblLoginScreen_Click(object sender, SdlDotNet.Widgets.MouseButtonEventArgs e) { this.Close(); NetworkManager.Disconnect(); NetworkManager.Connect(); WindowSwitcher.ShowMainMenu(); }
void lblUseCharacter_OnClick(object sender, SdlDotNet.Input.MouseButtonEventArgs e) { bool charSelected = false; if (btnChar1.Focused) { WindowSwitcher.GetWindow(WindowSwitcher.Window.Game, true); Tcp.TcpResponder.SendUseChar(1); charSelected = true; } else if (btnChar2.Focused) { WindowSwitcher.GetWindow(WindowSwitcher.Window.Game, true); Tcp.TcpResponder.SendUseChar(2); charSelected = true; } else if (btnChar3.Focused) { WindowSwitcher.GetWindow(WindowSwitcher.Window.Game, true); Tcp.TcpResponder.SendUseChar(3); charSelected = true; } if (charSelected) { WindowManager.RemoveWindow(this); WindowManager.AddWindow(WindowSwitcher.Window.Loading); Windows.WindowSwitcher.LoadingWindow.UpdateLoadText("Logging in..."); } }
public static void RemoveWindow(WindowSwitcher.Window windowToRemove) { if (WindowSwitcher.GetWindow(windowToRemove, false) != null) { RemoveWindow(WindowSwitcher.GetWindow(windowToRemove, false)); } }
void btnSave_Click(object sender, MouseButtonEventArgs e) { if (cmbSkinSelect.SelectedItem != null) { SkinManager.ChangeActiveSkin(cmbSkinSelect.SelectedItem.TextIdentifier); SkinManager.PlaySkinMusic(); } WindowSwitcher.ShowMainMenu(); this.Close(); }
public override void OnKeyboardDown(SdlDotNet.Input.KeyboardEventArgs e) { base.OnKeyboardDown(e); switch (e.Key) { case SdlDotNet.Input.Key.Backspace: { WindowSwitcher.ShowMainMenu(); } break; } }
void lblDelete_Click(object sender, SdlDotNet.Widgets.MouseButtonEventArgs e) { string account = txtName.Text; string password = txtPassword.Text; if (NetworkManager.TcpClient.Socket.Connected) { Messenger.SendDeleteAccount(account, password); this.Close(); WindowSwitcher.AddWindow(new winLoading()); ((Windows.winLoading)WindowManager.FindWindow("winLoading")).UpdateLoadText("Deleting account..."); } else { this.Close(); WindowSwitcher.ShowMainMenu(); SdlDotNet.Widgets.MessageBox.Show("You are not connected to the Server!", "----"); } }
private void SelectItem(int itemNum) { if (itemNum == 3) { if (tempAutoSaveSpeed < 10) { tempAutoSaveSpeed++; ShowOption(3); } } else if (itemNum < 12) { tempOptions[itemNum] = !tempOptions[itemNum]; ShowOption(itemNum); } else { //Save method goes here IO.Options.PlayerName = tempOptions[0]; IO.Options.PlayerDamage = tempOptions[1]; IO.Options.PlayerBar = tempOptions[2]; IO.Options.AutoSaveSpeed = tempAutoSaveSpeed; IO.Options.NpcName = tempOptions[4]; IO.Options.NpcDamage = tempOptions[5]; IO.Options.NpcBar = tempOptions[6]; IO.Options.Music = tempOptions[7]; IO.Options.Sound = tempOptions[8]; IO.Options.SpeechBubbles = tempOptions[9]; IO.Options.Timestamps = tempOptions[10]; IO.Options.AutoScroll = tempOptions[11]; WindowSwitcher.ShowMainMenu(); this.Close(); } }
public override void OnKeyboardDown(SdlDotNet.Input.KeyboardEventArgs e) { base.OnKeyboardDown(e); switch (e.Key) { case SdlDotNet.Input.Key.DownArrow: { if (itemPicker.SelectedItem == MAX_ITEMS) { ChangeSelected(0); } else { ChangeSelected(itemPicker.SelectedItem + 1); } } break; case SdlDotNet.Input.Key.UpArrow: { if (itemPicker.SelectedItem == 0) { ChangeSelected(MAX_ITEMS); } else { ChangeSelected(itemPicker.SelectedItem - 1); } } break; case SdlDotNet.Input.Key.LeftArrow: { if (itemPicker.SelectedItem == 3) { if (tempAutoSaveSpeed > 1) { tempAutoSaveSpeed--; ShowOption(3); } } else if (itemPicker.SelectedItem != 12) { SelectItem(itemPicker.SelectedItem); } } break; case SdlDotNet.Input.Key.RightArrow: { if (itemPicker.SelectedItem == 3) { if (tempAutoSaveSpeed < 10) { tempAutoSaveSpeed++; ShowOption(3); } } else if (itemPicker.SelectedItem != 12) { SelectItem(itemPicker.SelectedItem); } } break; case SdlDotNet.Input.Key.Return: { SelectItem(itemPicker.SelectedItem); } break; case SdlDotNet.Input.Key.Backspace: { // goes to the main menu; should it? WindowSwitcher.ShowMainMenu(); } break; } }
private void SelectItem(int itemNum) { if (itemNum == 3) { if (tempAutoSaveSpeed < 11) { tempAutoSaveSpeed++; ShowOption(3); } if (tempAutoSaveSpeed == 11) { tempAutoSaveSpeed = 0; tempAutoSaveSpeed2 = 1; ShowOption(3); } } else if (itemNum < 12) { tempOptions[itemNum] = !tempOptions[itemNum]; ShowOption(itemNum); } else if (itemNum == 13) { if (tempAutoSaveSpeed > 0) { tempAutoSaveSpeed--; ShowOption(3); } if (tempAutoSaveSpeed == 0) { tempAutoSaveSpeed2++; ShowOption(3); } if (tempAutoSaveSpeed2 == 2) { tempAutoSaveSpeed = 10; tempAutoSaveSpeed2 = 0; ShowOption(3); } } else { //Save method goes here IO.Options.PlayerName = tempOptions[0]; IO.Options.PlayerDamage = tempOptions[1]; IO.Options.PlayerBar = tempOptions[2]; IO.Options.AutoSaveSpeed = tempAutoSaveSpeed; IO.Options.NpcName = tempOptions[4]; IO.Options.NpcDamage = tempOptions[5]; IO.Options.NpcBar = tempOptions[6]; IO.Options.Music = tempOptions[7]; IO.Options.Sound = tempOptions[8]; IO.Options.SpeechBubbles = tempOptions[9]; IO.Options.Timestamps = tempOptions[10]; IO.Options.AutoScroll = tempOptions[11]; if (IO.Options.Music == false) { Logic.Music.Music.AudioPlayer.StopMusic(); } WindowSwitcher.ShowMainMenu(); this.Close(); } }
void lblBack_Click(object sender, SdlDotNet.Widgets.MouseButtonEventArgs e) { this.Close(); WindowSwitcher.ShowAccountSettings(); }
public static bool IsWindowOpen(WindowSwitcher.Window windowToCheck) { return IsWindowOpen(WindowSwitcher.GetWindow(windowToCheck)); }
public static bool IsWindowOpen(WindowSwitcher.Window windowToCheck) { return(IsWindowOpen(WindowSwitcher.GetWindow(windowToCheck))); }
public static void AddWindow(WindowSwitcher.Window windowToAdd) { AddWindow(WindowSwitcher.GetWindow(windowToAdd, true)); }
void btnCancel_Click(object sender, MouseButtonEventArgs e) { WindowSwitcher.ShowMainMenu(); this.Close(); }
void lblBack_Click(object sender, SdlDotNet.Widgets.MouseButtonEventArgs e) { this.Close(); WindowSwitcher.ShowMainMenu(); }