From 59fd6a7b383504d8ea266107e30c5fef5bad3e3a Mon Sep 17 00:00:00 2001 From: Steve Sharp Date: Tue, 16 Jun 2020 20:58:08 +0100 Subject: [PATCH] Added the option to ignore ESI for location tracking to get round this bug : https://github.com/esi/esi-issues/issues/828 --- EVEData/EveManager.cs | 3 +++ EVEData/LocalCharacter.cs | 5 ++++- MainWindow.xaml.cs | 5 +++++ MapConfig.cs | 4 ++++ Preferences.xaml | 1 + Preferences.xaml.cs | 10 +++++++++- 6 files changed, 26 insertions(+), 2 deletions(-) diff --git a/EVEData/EveManager.cs b/EVEData/EveManager.cs index 7bef782b..0fb009f3 100644 --- a/EVEData/EveManager.cs +++ b/EVEData/EveManager.cs @@ -145,6 +145,9 @@ public static EveManager Instance } } + + public bool UseESIForCharacterPositions { get; set; } + /// /// Gets or sets the Alliance ID to Name dictionary /// diff --git a/EVEData/LocalCharacter.cs b/EVEData/LocalCharacter.cs index d3cc8467..5c1f1e94 100644 --- a/EVEData/LocalCharacter.cs +++ b/EVEData/LocalCharacter.cs @@ -424,7 +424,10 @@ public async Task Update() UpdateInfoFromESI().Wait(); } - UpdatePositionFromESI().Wait(); + if(EveManager.Instance.UseESIForCharacterPositions) + { + UpdatePositionFromESI().Wait(); + } //UpdateFleetInfo(); if (routeNeedsUpdate) diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index c6cd09f2..f8c57dbb 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -108,6 +108,8 @@ public MainWindow() EVEManager = new EVEData.EveManager(SMT_VERSION); EVEData.EveManager.Instance = EVEManager; + EVEManager.UseESIForCharacterPositions = MapConf.UseESIForCharacterPositions; + // if we want to re-build the data as we've changed the format, recreate it all from scratch bool initFromScratch = false; if (initFromScratch) @@ -294,6 +296,9 @@ private void MainWindow_Closed(object sender, EventArgs e) try { + // Save off any explicit items + MapConf.UseESIForCharacterPositions = EVEManager.UseESIForCharacterPositions; + // Save the Map Colours string mapConfigFileName = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\SMT\\" + SMT_VERSION + "\\MapConfig.dat"; diff --git a/MapConfig.cs b/MapConfig.cs index 4c706269..94f20e2d 100644 --- a/MapConfig.cs +++ b/MapConfig.cs @@ -675,6 +675,9 @@ public int WarningRange } } + public bool UseESIForCharacterPositions { get; set; } + + private bool m_SyncActiveCharacterBasedOnActiveEVEClient; public bool SyncActiveCharacterBasedOnActiveEVEClient { @@ -771,6 +774,7 @@ public void SetDefaults() StaticJumpPoints = new ObservableCollection(); SOVShowConflicts = true; SOVBasedITCU = true; + UseESIForCharacterPositions = true; ShowIhubVunerabilities = true; diff --git a/Preferences.xaml b/Preferences.xaml index 398c9333..34dd646c 100644 --- a/Preferences.xaml +++ b/Preferences.xaml @@ -22,6 +22,7 @@ Auto sync character to active window + Use ESI for character positions diff --git a/Preferences.xaml.cs b/Preferences.xaml.cs index 59aae322..e3ec5ea2 100644 --- a/Preferences.xaml.cs +++ b/Preferences.xaml.cs @@ -1,4 +1,5 @@ -using System.Windows; +using SMT.EVEData; +using System.Windows; namespace SMT { @@ -12,6 +13,8 @@ public partial class PreferencesWindow : Window public PreferencesWindow() { InitializeComponent(); + + syncESIPositionChk.IsChecked = EveManager.Instance.UseESIForCharacterPositions; } private void Prefs_OK_Click(object sender, RoutedEventArgs e) @@ -26,5 +29,10 @@ private void Prefs_Default_Click(object sender, RoutedEventArgs e) MapConf.SetDefaults(); } } + + private void syncESIPositionChk_Checked(object sender, RoutedEventArgs e) + { + EveManager.Instance.UseESIForCharacterPositions = (bool)syncESIPositionChk.IsChecked; + } } }