From 143b77fbf631ffcdec701d80bbd8ae6dd2f010a1 Mon Sep 17 00:00:00 2001 From: Steve Sharp Date: Tue, 12 May 2020 18:49:52 +0100 Subject: [PATCH] Fix for Intel Size New Jump bridge list New jump bridge functionality (recalc, remove, disable) jump bridge re-calc on delete / diable of JB Disabled jump bridge colour --- EVEData/JumpBridge.cs | 34 ++- EVEData/LocalCharacter.cs | 9 +- EVEData/Navigation.cs | 16 +- MainWindow.xaml | 472 +++++++++++++++++++------------------- MainWindow.xaml.cs | 67 +++++- MapColours.cs | 5 + MapConfig.cs | 1 + RegionControl.xaml.cs | 28 ++- 8 files changed, 382 insertions(+), 250 deletions(-) diff --git a/EVEData/JumpBridge.cs b/EVEData/JumpBridge.cs index 77f71631..4e043995 100644 --- a/EVEData/JumpBridge.cs +++ b/EVEData/JumpBridge.cs @@ -2,12 +2,15 @@ // Jump Bridge //----------------------------------------------------------------------- +using System.ComponentModel; +using System.Xml.Serialization; + namespace SMT.EVEData { /// /// A Player owned link between systems /// - public class JumpBridge + public class JumpBridge : INotifyPropertyChanged { /// /// Initializes a new instance of the class. @@ -28,7 +31,24 @@ public JumpBridge(string f, string t) } - + private bool m_Disabled; + + [XmlIgnoreAttribute] + public bool Disabled + { + get + { + return m_Disabled; + } + set + { + m_Disabled = value; + + OnPropertyChanged("Disabled"); + } + } + + public event PropertyChangedEventHandler PropertyChanged; /// @@ -55,5 +75,15 @@ public override string ToString() { return $"{From} <==> {To}"; } + + + protected void OnPropertyChanged(string name) + { + PropertyChangedEventHandler handler = PropertyChanged; + if (handler != null) + { + handler(this, new PropertyChangedEventArgs(name)); + } + } } } \ No newline at end of file diff --git a/EVEData/LocalCharacter.cs b/EVEData/LocalCharacter.cs index 7f53f4d8..a2c92783 100644 --- a/EVEData/LocalCharacter.cs +++ b/EVEData/LocalCharacter.cs @@ -310,7 +310,12 @@ public async Task> FindJumpGates(string JumpBridgeFilterString return jbl; } - + public void RecalcRoute() + { + routeNeedsUpdate = true; + esiRouteNeedsUpdate = true; + } + public string GetWayPointText() { string ClipboardText = "Waypoints\n==============\n"; @@ -506,7 +511,7 @@ private async void UpdateActiveRoute() ActiveRoute.Clear(); }), DispatcherPriority.Normal); - // loop through all the waypoints and query ESI for the route + // loop through all the waypoints for (int i = 0; i < Waypoints.Count; i++) { start = end; diff --git a/EVEData/Navigation.cs b/EVEData/Navigation.cs index 158514d2..f986e529 100644 --- a/EVEData/Navigation.cs +++ b/EVEData/Navigation.cs @@ -103,11 +103,7 @@ public static void InitNavigation(List eveSystems, List jump MapNodes[mn.Name] = mn; } - foreach (JumpBridge jb in jumpBridges) - { - MapNodes[jb.From].JBConnection = jb.To; - MapNodes[jb.To].JBConnection = jb.From; - } + UpdateJumpBridges(jumpBridges); double MaxRange = 10 * 9460730472580800.0; @@ -399,15 +395,13 @@ public static void UpdateJumpBridges(List jumpBridges) { foreach (JumpBridge jb in jumpBridges) { - if (jb.FromID != 0) + if(jb.Disabled) { - MapNodes[jb.From].JBConnection = jb.To; + continue; } - if (jb.ToID != 0) - { - MapNodes[jb.To].JBConnection = jb.From; - } + MapNodes[jb.From].JBConnection = jb.To; + MapNodes[jb.To].JBConnection = jb.From; } } diff --git a/MainWindow.xaml b/MainWindow.xaml index 5a4a98ab..7d17c578 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -1,4 +1,4 @@ - - + @@ -27,10 +28,8 @@ - - + + @@ -38,7 +37,7 @@ AncestorType={x:Type Window}}, Path=MapConf.IntelTextSize}"/> - + @@ -59,27 +58,27 @@ AncestorType={x:Type Window}}, Path=MapConf.IntelTextSize}"/> - EVE Time : + - + - Tranquility Version: + - + - + @@ -92,211 +91,6 @@ AncestorType={x:Type Window}}, Path=MapConf.IntelTextSize}"/> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -