Exemplo n.º 1
0
        private void DefaultMenuLoadProfileClicked(object sender, EventArgs e)
        {
            var OFD = new OpenFileDialog
            {
                InitialDirectory = Path.Combine(FolderPaths.sTrinityPluginPath, "Config", "Defaults"),
                RestoreDirectory = false,
                Filter           = "xml files (*.xml)|*.xml|All files (*.*)|*.*",
                Title            = "Open Settings",
            };
            DialogResult OFD_Result = OFD.ShowDialog();

            if (OFD_Result == System.Windows.Forms.DialogResult.OK)
            {
                try
                {
                    MessageBoxResult confirm = MessageBox.Show(funkyConfigWindow, "Are you sure you want to overwrite settings with selected profile?", "Confirm Overwrite", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);
                    if (confirm == MessageBoxResult.Yes)
                    {
                        Logger.DBLog.InfoFormat("Creating new settings for {0} -- {1} using file {2}", Bot.Character.Account.CurrentAccountName, Bot.Character.Account.CurrentHeroName, OFD.FileName);
                        Settings_Funky newSettings = Settings_Funky.DeserializeFromXML(OFD.FileName);
                        Bot.Settings = newSettings;
                        funkyConfigWindow.Close();
                    }
                }
                catch
                {
                }
            }
        }
Exemplo n.º 2
0
        private void DefaultMenuLevelingClicked(object sender, EventArgs e)
        {
            var confirm = MessageBox.Show(funkyConfigWindow,
                                          "Are you sure you want to overwrite settings with default settings?",
                                          "Confirm Overwrite", MessageBoxButton.YesNoCancel, MessageBoxImage.Question);

            if (confirm == MessageBoxResult.Yes)
            {
                string DefaultLeveling = Path.Combine(FolderPaths.sTrinityPluginPath, "Config", "Defaults", "LowLevel.xml");
                Logger.DBLog.InfoFormat("Creating new settings for {0} -- {1} using file {2}", Bot.Character.Account.CurrentAccountName, Bot.Character.Account.CurrentHeroName, DefaultLeveling);
                Settings_Funky newSettings = Settings_Funky.DeserializeFromXML(DefaultLeveling);
                Bot.Settings = newSettings;
                funkyConfigWindow.Close();
            }
        }