Exemplo n.º 1
0
        private void configurationWizardToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormConfigWizard ui = new FormConfigWizard(this);

            if (ui.ShowDialog() == DialogResult.OK)
            {
                AssistantEngine.ApplyWizardResults(ui.results);
                AssistantEngine.ScheduleSearcherDbWipeOnNextRun();
                MessageBox.Show("Wurm Assistant must restart now");
                Application.Restart();
            }
        }
Exemplo n.º 2
0
        //first part of init, close program if this fails
        //all requirements for starting assistant should be here
        public static bool Init1_Settings(WurmAssistant mainForm)
        {
            AssistantForm = mainForm;
            SetupDataDirectories();
            Logger.SetLogSaveDir(Path.Combine(DataDir, "Logs"));
            Logger.SetTBOutput(AssistantForm.GetTextBoxForLog());
            Logger.SetConsoleHandlingMode(Logger.ConsoleHandlingOption.SendConsoleToLoggerOutputINFO);

            Logger.LogDiag("-------------");
            Logger.LogDiag("-------------");
            Logger.LogDiag("STARTING WURM ASSISTANT " + Assembly.GetEntryAssembly().GetName().Version.ToString());

            Settings.FilePath = Path.Combine(DataDir, "AssistantSettings.xml");
            Logger.LogDiag("loading settings");
            bool settingsLoaded = Settings.Load();

            AssistantForm.ButtonBuyBeerHidden = BeerButtonHidden;

            if (!settingsLoaded || !Settings.Value.WizardCompleted)
            {
                Logger.LogDiag("launching configuration wizard");
                FormConfigWizard wizard = new FormConfigWizard();
                if (wizard.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    Logger.LogDiag("applying wizard choices");
                    ApplyWizardResults(wizard.results);
                    Settings.Value.WizardCompleted = true;
                    Logger.LogDiag("saving updated settings");
                    Settings.Save();
                    return true;
                }
                else return false;
            }

            if (Settings.Value.WurmDirOverride != null && !WurmState.WurmClient.InitSuccessful)
            {
                WurmState.WurmClient.OverrideWurmDir(Settings.Value.WurmDirOverride);
            }

            return true;
        }