Skip to content

Commit

Permalink
Added the option to ignore ESI for location tracking to get round thi…
Browse files Browse the repository at this point in the history
  • Loading branch information
BitBaboonSteve committed Jun 16, 2020
1 parent 948e919 commit 59fd6a7
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions EVEData/EveManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ public static EveManager Instance
}
}


public bool UseESIForCharacterPositions { get; set; }

/// <summary>
/// Gets or sets the Alliance ID to Name dictionary
/// </summary>
Expand Down
5 changes: 4 additions & 1 deletion EVEData/LocalCharacter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,10 @@ public async Task Update()
UpdateInfoFromESI().Wait();
}

UpdatePositionFromESI().Wait();
if(EveManager.Instance.UseESIForCharacterPositions)
{
UpdatePositionFromESI().Wait();
}
//UpdateFleetInfo();

if (routeNeedsUpdate)
Expand Down
5 changes: 5 additions & 0 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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";

Expand Down
4 changes: 4 additions & 0 deletions MapConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@ public int WarningRange
}
}

public bool UseESIForCharacterPositions { get; set; }


private bool m_SyncActiveCharacterBasedOnActiveEVEClient;
public bool SyncActiveCharacterBasedOnActiveEVEClient
{
Expand Down Expand Up @@ -771,6 +774,7 @@ public void SetDefaults()
StaticJumpPoints = new ObservableCollection<StaticJumpOverlay>();
SOVShowConflicts = true;
SOVBasedITCU = true;
UseESIForCharacterPositions = true;

ShowIhubVunerabilities = true;

Expand Down
1 change: 1 addition & 0 deletions Preferences.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<StackPanel>
<CheckBox IsChecked="{Binding Path=AlwaysOnTop}" Margin="0,3" Content="Always on top"/>
<CheckBox IsChecked="{Binding Path=SyncActiveCharacterBasedOnActiveEVEClient}" Margin="0,3">Auto sync character to active window</CheckBox>
<CheckBox x:Name="syncESIPositionChk" Margin="0,3" Checked="syncESIPositionChk_Checked" Unchecked="syncESIPositionChk_Checked">Use ESI for character positions</CheckBox>
</StackPanel>
</GroupBox>
</StackPanel>
Expand Down
10 changes: 9 additions & 1 deletion Preferences.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Windows;
using SMT.EVEData;
using System.Windows;

namespace SMT
{
Expand All @@ -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)
Expand All @@ -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;
}
}
}

0 comments on commit 59fd6a7

Please sign in to comment.