//We use the saveButton_Click event to make a save from the UI control values and to write a new file0
        private void saveButton_Click(object sender, RoutedEventArgs e)
        {
            if (areTextBoxesFull())
            {
                makeSave();
                makeINI();

                if (SAVE.SAVEFile.AskToWrite(thisSave, thisINI))
                {
                    MXA2SE.play_sound(soundEngine, "Assets//Sounds//fileSaved.wav");
                    ((MainWindow)this.Owner).populateSavesCombo();

                    Dictionary <Characters, string> messageDict = new Dictionary <Characters, string>()
                    {
                        { Characters.Alphys, "N-n-no problem! I've made the \"" + thisSave.SaveName + "\" save file successfully!" },
                        { Characters.Asgore, "Not a problem at all, human. The \"" + thisSave.SaveName + "\" save file has been created successfully!" },
                        { Characters.Asriel, "Hey, howdy! I've made the \"" + thisSave.SaveName + "\" save successfully!" },
                        { Characters.Flowey, "URGH, don't you think I've got something better to do? I've made the \"" + thisSave.SaveName + "\" save for you." },
                        { Characters.Papyrus, "FEAR NOT, HUMAN! I'VE MASTERFULLY PREPARED THE \"" + thisSave.SaveName + "\" SAVE FOR YOU." },
                        { Characters.Sans, "sure thing buddy. i've created the \"" + thisSave.SaveName + "\" save for you." },
                        { Characters.Toriel, "I would be glad to assist you my child. The \"" + thisSave.SaveName + "\" save has been created successfully." },
                        { Characters.Undyne, "FUHUHUH! No problem, bestie! I've created the \"" + thisSave.SaveName + "\" save for you." },
                        { Characters.None, "Save \"" + thisSave.SaveName + "\" created successfully!" }
                    };

                    UTMessageBox.Show(messageDict, Constants.CharacterReactions.Positive, MessageBoxButton.OK);
                    Close();
                }
            }

            else
            {
                System.Windows.MessageBox.Show("Error! Some text boxes contain empty or invalid data! Please ensure the highlighted text boxes are corrected and then try again.", "Error!", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
示例#2
0
        public void About_Click(object sender, RoutedEventArgs e)
        {
            MXA2SE.play_sound(soundEngine, "Assets//Sounds//bark.wav");
            AboutWindow window = new AboutWindow();

            window.Owner = Application.Current.MainWindow;
            window.ShowDialog();
        }
        //We use the loadButton_Click event to open a new folder browser to allow the user to load a save and set up the UI for the loaded save
        private void loadButton_Click(object sender, RoutedEventArgs e)
        {
            FolderBrowser2 directoryFolderBrowser = new FolderBrowser2();

            directoryFolderBrowser.ShowDialog(null);

            if (File.Exists(directoryFolderBrowser.DirectoryPath + "//file0"))
            {
                SAVE.SAVEFile saveFile = SAVE.SAVEFile.LoadSaveFile(directoryFolderBrowser.DirectoryPath);
                loadSAVE(saveFile);
                thisINI = INI.ReadINI(saveFile);
                loadINI();

                Routes.GameRoutes closestRoute = SAVE.SAVEFile.GetClosestRoute(saveFile);

                if (closestRoute == Routes.GameRoutes.Genocide)
                {
                    genocideRadio.IsChecked = true;
                }

                else if (closestRoute >= Routes.GameRoutes.TruePacifistDate)
                {
                    pacifistRadio.IsChecked = true;
                    routeCombo.SelectedItem = Routes.GetEnumDescription(SAVE.SAVEFile.GetClosestRoute(thisSave));
                }

                else
                {
                    neutralRadio.IsChecked  = true;
                    routeCombo.SelectedItem = Routes.GetEnumDescription(SAVE.SAVEFile.GetClosestRoute(thisSave));
                }

                MXA2SE.play_sound(soundEngine, "Assets//Sounds//fileLoaded.wav");
            }

            else
            {
                Dictionary <Characters, string> messageDict = new Dictionary <Characters, string>()
                {
                    { Characters.Alphys, "S-s-sorry, that folder doesn't contain a valid Undertale save file." },
                    { Characters.Asgore, "Human, I'm sorry, but folder doesn't contain a valid Undertale save file." },
                    { Characters.Asriel, "I'm really sorry, I tried, but couldn't find a valid Undertale save file in that folder." },
                    { Characters.Flowey, "YOU. IDIOT! That folder doesn't contain a valid Undertale save file!" },
                    { Characters.Papyrus, "NYOO HOO HOO. I, THE GREAT PAPYRUS, HAVE FAILED TO FIND A VALID SAVE FILE IN THAT FOLDER." },
                    { Characters.Sans, "heyo, pal. try again. i couldn't find an Undertale save file in that folder." },
                    { Characters.Toriel, "My child, I am sorry, but I was unable to find a valid Undertale save file in that folder." },
                    { Characters.Undyne, "HEY, PUNK! I CAN'T FIND AN UNDERTALE SAVE FILE IN THAT FOLDER!" },
                    { Characters.None, "The folder specified does not contain a valid Undertale save file!" }
                };

                UTMessageBox.Show(messageDict, Constants.CharacterReactions.Negative, MessageBoxButton.OK);
            }
        }
示例#4
0
        private void PlayCharacterVoice()
        {
            switch (_Character)
            {
            case Characters.Alphys:
                MXA2SE.play_sound(soundEngine, "Assets//Sounds//Characters//Alphys.wav");
                break;

            case Characters.Asgore:
                MXA2SE.play_sound(soundEngine, "Assets//Sounds//Characters//Asgore.wav");
                break;

            case Characters.Asriel:
                MXA2SE.play_sound(soundEngine, "Assets//Sounds//Characters//Asriel.wav");
                break;

            case Characters.Flowey:
                if (_Reaction == Constants.CharacterReactions.Negative)
                {
                    MXA2SE.play_sound(soundEngine, "Assets//Sounds//Characters//FloweyNegative.wav");
                }

                else
                {
                    MXA2SE.play_sound(soundEngine, "Assets//Sounds//Characters//Flowey.wav");
                }
                break;

            case Characters.Papyrus:
                MXA2SE.play_sound(soundEngine, "Assets//Sounds//Characters//Papyrus.wav");
                break;

            case Characters.Sans:
                MXA2SE.play_sound(soundEngine, "Assets//Sounds//Characters//Sans.wav");
                break;

            case Characters.Toriel:
                MXA2SE.play_sound(soundEngine, "Assets//Sounds//Characters//Toriel.wav");
                break;

            case Characters.Undyne:
                MXA2SE.play_sound(soundEngine, "Assets//Sounds//Characters//Undyne.wav");
                break;
            }
        }
示例#5
0
 private void Button_MouseDown(object sender, RoutedEventArgs e)
 {
     MXA2SE.play_sound(soundEngine, "Assets/Sounds/buttonClick.wav");
 }
示例#6
0
 private void Button_MouseEnter(object sender, RoutedEventArgs e)
 {
     MXA2SE.play_sound(soundEngine, "Assets/Sounds/buttonHover.wav");
 }
示例#7
0
 public void TabItemHover(object sender, RoutedEventArgs e)
 {
     MXA2SE.play_sound(soundEngine, "Assets/Sounds/buttonHover.wav");
 }