コード例 #1
0
        private void LoadProfile()
        {
            var dlg = new OpenFileDialog
            {
                InitialDirectory = AppDomain.CurrentDomain.BaseDirectory,
                Filter           = @"Profiles (*.xml)|*.xml"
            };

            if (dlg.ShowDialog() == DialogResult.OK)
            {
                _profileToLoad = dlg.FileName;
                if (_profileToLoad.Contains(".xml"))
                {
                    FlyingEngine.CurrentProfile = new FlyingProfile();
                    FlyingEngine.CurrentProfile.LoadFile(_profileToLoad);
                    FlyingSettings.Profile = _profileToLoad;
                    FlyingSettings.SaveSettings();
                    UpdateControls();
                }
                else
                {
                    Logging.Write(LogType.Warning, "Please select a valid profile type.");
                }
            }
        }
コード例 #2
0
 private void SaveProfile()
 {
     var dlg = new SaveFileDialog
                   {
                       InitialDirectory = AppDomain.CurrentDomain.BaseDirectory,
                       Filter = @"Profiles (*.xml)|*.xml"
                   };
     if (dlg.ShowDialog() == DialogResult.OK)
     {
         FlyingEngine.CurrentProfile.SaveFile(dlg.FileName);
         FlyingSettings.Profile = dlg.FileName;
         FlyingSettings.SaveSettings();
     }
 }
コード例 #3
0
 private void ProfileChanged(object sender, EProfileDownloaded e)
 {
     string profileToLoad = e.Path;
     if (profileToLoad.Contains(".xml"))
     {
         FlyingEngine.CurrentProfile = new FlyingProfile();
         FlyingEngine.CurrentProfile.LoadFile(profileToLoad);
         FlyingSettings.Profile = profileToLoad;
         FlyingSettings.SaveSettings();
         UpdateControls();
     }
     else
     {
         MessageBox.Show("Could not load the downloaded profile, invalid profile type");
     }
 }
コード例 #4
0
ファイル: Settings.cs プロジェクト: semi420/lazybot
        private void SaveSettingsClick(object sender, EventArgs e)
        {
            FlyingSettings.Herb                        = SetupCBHerb.Checked;
            FlyingSettings.Mine                        = SetupCBMine.Checked;
            FlyingSettings.ApproachModifier            = (float)Convert.ToDouble(SetupTBApproachModifier.Text);
            FlyingSettings.MaxUnits                    = SetupTBMaxUnits.Text;
            FlyingSettings.StopOnDeath                 = SetupCBStopOnDeath.Checked;
            FlyingSettings.StopHarvestWithPlayerAround = SetupCBStopHarvest.Checked;
            FlyingSettings.AvoidPlayers                = SetupCBAvoidPlayers.Checked;
            FlyingSettings.FlyingMountBar              = KeysFlyingMountBar.SelectedItem.ToString();
            FlyingSettings.FlyingMountKey              = KeysFlyingMountKey.SelectedItem.ToString();
            FlyingSettings.AutoBlacklist               = CBAutoBlacklist.Checked;
            FlyingSettings.AvoidElites                 = CBAvoidElites.Checked;
            FlyingSettings.FindCorpse                  = SetupCBFindCorpse.Checked;
            FlyingSettings.StopOnFullBags              = CBStopOnFullBags.Checked;
            FlyingSettings.WaitForRessSick             = CBRessWait.Checked;
            FlyingSettings.WaitForLoot                 = CBWaitForLoot.Checked;
            FlyingSettings.DruidAvoidCombat            = CBDruidAvoidCombat.Checked;
            FlyingSettings.ExtraBar                    = KeysExtraBar.SelectedItem.ToString();
            FlyingSettings.ExtraKey                    = KeysExtraKey.SelectedItem.ToString();
            FlyingSettings.SendKeyOnStartCombat        = CBSendKeyOnStartCombat.Checked;
            //Fish
            FlyingSettings.Fish            = CBFish.Checked;
            FlyingSettings.Lure            = CBUseLure.Checked;
            FlyingSettings.MaxTimeAtSchool = SetupTBMaxTimeAtSchool.Value;
            FlyingSettings.FishApproach    = SetupTBFishApproach.Value;
            FlyingSettings.LureBar         = KeysLureBar.SelectedItem.ToString();
            FlyingSettings.LureKey         = KeysLureKey.SelectedItem.ToString();
            FlyingSettings.WaterwalkBar    = KeysWaterwalkBar.SelectedItem.ToString();
            FlyingSettings.WaterwalkKey    = KeysWaterwalkKey.SelectedItem.ToString();

            FlyingSettings.SaveSettings();
            SaveHerbList();
            SaveMineList();
            SaveSchoolList();
            Close();
        }
コード例 #5
0
ファイル: FlyingEngine.cs プロジェクト: semi420/lazybot
 public void Close()
 {
     FlyingSettings.SaveSettings();
     Navigator.Stop();
     CloseWindows();
 }