public void TutorialButtonClick(object sender, RoutedEventArgs e) { TutorialButton.Background = Brushes.Blue; /* This function goes through each piece of text on the UI, highlights it, and tells the user what it is. * It is like a super quick start guide for users who just want to learn what each button is. */ // How you win CustomMessageBox.ShowText("The way that you win is by killing the TROLL KING before he destroys every VILLAGE without dying.", "TUTORIAL", NORMAL_BACK, NORMAL_FORE); CustomMessageBox.ShowText("You receive GOLD from killing ENEMIES and doing QUESTS.", "TUTORIAL", NORMAL_BACK, NORMAL_FORE); CustomMessageBox.ShowText("You can get stronger by spending GOLD on weapons from MERCHANTS in VILLAGES.", "TUTORIAL", NORMAL_BACK, NORMAL_FORE); CustomMessageBox.ShowText("You can also get significantly stronger by going to the SHRINES, acquiring the ARTEFACTS, and bringing them to MAEJA to learn how to use them.", "TUTORIAL", NORMAL_BACK, NORMAL_FORE); // Map CustomMessageBox.ShowText("The VILLAGE marked with METAL (grey) weapons is the location of HAWK.", "TUTORIAL", NORMAL_BACK, NORMAL_FORE); CustomMessageBox.ShowText("And the VILLAGE marked with MAGIC (blue) weapons is the location of MAEJA.", "TUTORIAL", NORMAL_BACK, NORMAL_FORE); // Aurora CustomMessageBox.ShowText("The POWER is how much damage you do each hit.", "TUTORIAL", NORMAL_BACK, NORMAL_FORE); CustomMessageBox.ShowText("You can only strike when your PREPAREDNESS reaches the TIME value (shown by the bar).", "TUTORIAL", NORMAL_BACK, NORMAL_FORE); // Shortcuts CustomMessageBox.ShowText("Shortcuts:\n[W] = NORTH/WAIT\n[A]=WEST\n[S]=SOUTH/STRIKE\n[D]=EAST\n[R]=RETREAT", "TUTORIAL", NORMAL_BACK, NORMAL_FORE); // End CustomMessageBox.ShowText("Congratulations, this is the end of the tutorial. Now go save Trurene!!!", "TUTORIAL", GOLD_BACK, GOLD_FORE); TutorialButton.Background = Brushes.LightBlue; }
// Miscellaneous buttons public void LoadButtonClick(object sender, RoutedEventArgs e) { LoadButton.Background = Brushes.Gray; try { Program.Load(CustomMessageBox.ShowTextEntry("Filename", "LOAD")); } catch { CustomMessageBox.ShowText("Filename or file format is invalid!", "LOAD ERROR", WARNING_BACK, WARNING_FORE); // Will happen if file format is wrong or file doesn't exist with that filename. } LoadButton.Background = Brushes.LightGray; }
public void OnShutdown(object sender, System.ComponentModel.CancelEventArgs e) { /* This function stops all of the threads, timers... to prevent any exceptions occuring by the tasks being cancelled. * And it also adds a little bit of a twist. */ PrepareTimer.Stop(); SaveTimer.Stop(); UpdateEverythingTimer.Stop(); UpdateNotificationsTimer.Stop(); if (Program.world.aurora.health <= 0) { CustomMessageBox.ShowText("Keep trying, keep an eye on your health.", "THE END", WARNING_BACK, WARNING_FORE); } else if (Program.world.trollKing.health <= 0) { CustomMessageBox.ShowText("Very well done.", "THE END", GOLD_BACK, GOLD_FORE); } else { CustomMessageBox.ShowText("Trurene needs you. Don't give up.", "THE END", WARNING_BACK, WARNING_FORE); } Thread.Sleep(1000); }