public static DownloadNewAddresses ( ) : void | ||
Результат | void |
private void oldAddressesApplyButton_Click(object sender, EventArgs e) { int selection = oldAddressesDropDownList.SelectedIndex; if (selection >= 0 && selection < Constants.OldMemoryAddresses.Length) { MainTab.DownloadNewAddresses(String.Format("https://raw.githubusercontent.com/Mytherin/Tibialyzer/master/Addresses/Addresses-{0}", Constants.OldMemoryAddresses[selection].Replace(".", ""))); // automatic update always downloads the new addresses; if the user is manually downloading old addresses // it would be confusing to replace the old addresses with new addresses on startup SettingsManager.setSetting("AutomaticallyDownloadAddresses", false); } }
public MainForm() { startup = true; Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.InvariantCulture; mainForm = this; InitializeComponent(); Constants.InitializeConstants(); SettingsManager.Initialize(); if (File.Exists(Constants.SettingsTemporaryBackup)) { // a temporary backup file exists, this might indicate a problem occurred while writing a settings file (e.g. unexpected shutdown) try { SettingsManager.LoadSettings(Constants.SettingsTemporaryBackup); if (SettingsManager.settings.Count == 0) { throw new Exception("Failed to read backup settings."); } if (File.Exists(Constants.SettingsFile)) { File.Delete(Constants.SettingsFile); } File.Copy(Constants.SettingsTemporaryBackup, Constants.SettingsFile); File.Delete(Constants.SettingsTemporaryBackup); } catch (Exception ex) { DisplayWarning(String.Format("Backup settings file found, but could not read: {0}", ex.Message)); } } SettingsManager.LoadSettings(Constants.SettingsFile); LootDatabaseManager.LootChanged += NotificationManager.UpdateLootDisplay; LootDatabaseManager.LootChanged += UpdateLogDisplay; GlobalDataManager.ExperienceChanged += NotificationManager.UpdateExperienceDisplay; GlobalDataManager.DamageChanged += NotificationManager.UpdateDamageDisplay; GlobalDataManager.UsedItemsChanged += NotificationManager.UpdateUsedItemsDisplay; if (!File.Exists(Constants.DatabaseFile)) { ExitWithError("Fatal Error", String.Format("Could not find database file {0}.", Constants.DatabaseFile)); } if (!File.Exists(Constants.NodeDatabase)) { ExitWithError("Fatal Error", String.Format("Could not find database file {0}.", Constants.NodeDatabase)); } LootDatabaseManager.Initialize(); StyleManager.InitializeStyle(); NotificationForm.Initialize(); Parser.Initialize(); PopupManager.Initialize(this.notifyIcon1); prevent_settings_update = true; try { StorageManager.InitializeStorage(); } catch (Exception e) { ExitWithError("Fatal Error", String.Format("Corrupted database {0}.\nMessage: {1}", Constants.DatabaseFile, e.Message)); } try { OutfiterManager.Initialize(); } catch (Exception e) { ExitWithError("Fatal Error", String.Format("Corrupted outfiter database {0}.\nMessage: {1}", Constants.OutfiterDatabaseFile, e.Message)); } ProcessManager.Initialize(); this.initializeSettings(); try { Pathfinder.LoadFromDatabase(Constants.NodeDatabase); } catch (Exception e) { ExitWithError("Fatal Error", String.Format("Corrupted database {0}.\nMessage: {1}", Constants.NodeDatabase, e.Message)); } TaskManager.Initialize(); prevent_settings_update = false; ChangeLanguage(SettingsManager.getSettingString("TibialyzerLanguage")); this.InitializeTabs(); switchTab(0); makeDraggable(this.Controls); if (SettingsManager.getSettingBool("StartAutohotkeyAutomatically")) { AutoHotkeyManager.StartAutohotkey(); } ReadMemoryManager.Initialize(); HuntManager.Initialize(); UIManager.Initialize(); MemoryReader.Initialize(); HUDManager.Initialize(); GlobalDataManager.Initialize(); if (SettingsManager.getSettingBool("AutomaticallyDownloadAddresses")) { MainTab.DownloadNewAddresses(); } this.Load += MainForm_Load; fileWriter = new StreamWriter(Constants.BigLootFile, true); tibialyzerLogo.MouseDown += new System.Windows.Forms.MouseEventHandler(this.draggable_MouseDown); startup = false; ScanningManager.StartScanning(); scan_tooltip.AutoPopDelay = 60000; scan_tooltip.InitialDelay = 500; scan_tooltip.ReshowDelay = 0; scan_tooltip.ShowAlways = true; scan_tooltip.UseFading = true; SetScanningImage("scanningbar-red.gif", "No Tibia Client Found...", true); }