Skip to content

Commit

Permalink
updated version number
Browse files Browse the repository at this point in the history
added multiple range spheres to the universe view
  • Loading branch information
BitBaboonSteve committed Feb 26, 2020
1 parent d0412f7 commit b83215b
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 16 deletions.
4 changes: 2 additions & 2 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace SMT
public partial class MainWindow : Window
{

public string SMTVersion = "SMT_073";
public string SMTVersion = "SMT_074";


/// <summary>
Expand Down Expand Up @@ -94,7 +94,7 @@ public MainWindow()

InitializeComponent();

Title = "SMT (Experimental Peter Han Edition : " + SMTVersion + ")";
Title = "SMT (Experimental Multi-Circle Val Edition : " + SMTVersion + ")";

CheckGitHubVersion();

Expand Down
5 changes: 5 additions & 0 deletions MapColours.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public class MapColours
[DisplayName("In Range Highlight")]
public Color JumpRangeInColourHighlight { get; set; }

[Category("Navigation")]
[DisplayName("Jump Overlap Highlight")]
public Color JumpRangeOverlapHighlight { get; set; }



[Category("Incursion")]
[DisplayName("Active Incursion")]
Expand Down
5 changes: 5 additions & 0 deletions MapConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ public void SetDefaultColours()

defaultColours.JumpRangeInColour = Color.FromRgb(255, 165, 0);
defaultColours.JumpRangeInColourHighlight = Color.FromArgb(156, 82, 135, 155);
defaultColours.JumpRangeOverlapHighlight = Colors.DarkBlue;


defaultColours.ActiveIncursionColour = Color.FromRgb(110, 82, 77);
Expand Down Expand Up @@ -674,6 +675,7 @@ public void SetDefaultColours()
blueColours.SystemTextSize = 12;
blueColours.JumpRangeInColour = Color.FromRgb(0, 255, 0);
blueColours.JumpRangeInColourHighlight = Color.FromArgb(156, 82, 135, 155);
blueColours.JumpRangeOverlapHighlight = Colors.DarkBlue;
blueColours.ActiveIncursionColour = Color.FromRgb(110, 82, 77);

blueColours.SOVStructureVunerableColour = Colors.Red;
Expand Down Expand Up @@ -716,6 +718,7 @@ public void SetDefaultColours()
greyAndRed.SystemTextSize = 12;
greyAndRed.JumpRangeInColour = Color.FromRgb(0, 255, 0);
greyAndRed.JumpRangeInColourHighlight = Color.FromArgb(156, 82, 135, 155);
greyAndRed.JumpRangeOverlapHighlight = Colors.DarkBlue;
greyAndRed.ActiveIncursionColour = Color.FromRgb(110, 82, 77);

greyAndRed.SOVStructureVunerableColour = Colors.Red;
Expand Down Expand Up @@ -758,6 +761,7 @@ public void SetDefaultColours()
dark.SystemTextSize = 12;
dark.JumpRangeInColour = Color.FromRgb(0, 255, 0);
dark.JumpRangeInColourHighlight = Color.FromArgb(156, 82, 135, 155);
dark.JumpRangeOverlapHighlight = Colors.DarkBlue;
dark.ActiveIncursionColour = Color.FromRgb(110, 82, 77);

dark.SOVStructureVunerableColour = Colors.Red;
Expand Down Expand Up @@ -799,6 +803,7 @@ public void SetDefaultColours()
lateNight.SystemTextSize = 13;
lateNight.JumpRangeInColour = Color.FromRgb(0, 255, 0);
lateNight.JumpRangeInColourHighlight = Color.FromArgb(156, 82, 135, 155);
lateNight.JumpRangeOverlapHighlight = Colors.DarkBlue;
lateNight.ActiveIncursionColour = Color.FromRgb(110, 82, 77);

lateNight.SOVStructureVunerableColour = Colors.Red;
Expand Down
87 changes: 73 additions & 14 deletions UniverseControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ public event RoutedEventHandler RequestRegionSystem


private List<GateHelper> universeSysLinksCache;

private List<KeyValuePair<string, double>> activeJumpSpheres;

private double universeWidth;
private double universeDepth;
private double universeXMin;
Expand Down Expand Up @@ -313,6 +316,7 @@ public void Init()


universeSysLinksCache = new List<GateHelper>();
activeJumpSpheres = new List<KeyValuePair<string, double>>();


universeXMin = 0.0;
Expand Down Expand Up @@ -434,44 +438,92 @@ private void SetJumpRange_Click(object sender, RoutedEventArgs e)

if (LY == 0.0)
{
activeJumpSpheres.Clear();
return;
}


double Radius = 9460730472580800.0 * LY * universeScale;
foreach (KeyValuePair<string, double> kvp in activeJumpSpheres)
{
if (kvp.Key == sys.Name)
{
activeJumpSpheres.Remove(kvp);
break;
}
}

activeJumpSpheres.Add(new KeyValuePair<string, double>(sys.Name, LY));




Brush rangeCol = new SolidColorBrush(MapConf.ActiveColourScheme.JumpRangeInColourHighlight);
Brush rangeOverlapCol = new SolidColorBrush(MapConf.ActiveColourScheme.JumpRangeOverlapHighlight);
Brush sysCentreCol = new SolidColorBrush(MapConf.ActiveColourScheme.SelectedSystemColour);
Brush sysRangeCol = new SolidColorBrush(MapConf.ActiveColourScheme.JumpRangeInColour);

rangeCol.Freeze();
rangeOverlapCol.Freeze();
sysCentreCol.Freeze();
sysRangeCol.Freeze();

double X = (sys.ActualX - universeXMin) * universeScale; ;
double Z = (universeDepth - (sys.ActualZ - universeZMin)) * universeScale;



// Create an instance of a DrawingVisual.
System.Windows.Media.DrawingVisual rangeCircleDV = new System.Windows.Media.DrawingVisual();
DrawingContext drawingContext = rangeCircleDV.RenderOpen();

drawingContext.DrawEllipse(rangeCol, new Pen(rangeCol, 1), new Point(X, Z), Radius, Radius);
drawingContext.DrawRectangle(sysCentreCol, new Pen(sysCentreCol, 1), new Rect(X - 5, Z - 5, 10, 10));

drawingContext.Close();
foreach (KeyValuePair<string, double> kvp in activeJumpSpheres)
{

EVEData.System ssys = EM.GetEveSystem(kvp.Key);

double Radius = 9460730472580800.0 * kvp.Value * universeScale;


double X = (ssys.ActualX - universeXMin) * universeScale; ;
double Z = (universeDepth - (ssys.ActualZ - universeZMin)) * universeScale;


// Create an instance of a DrawingVisual.

drawingContext.DrawEllipse(rangeCol, new Pen(rangeCol, 1), new Point(X, Z), Radius, Radius);
drawingContext.DrawRectangle(sysCentreCol, new Pen(sysCentreCol, 1), new Rect(X - 5, Z - 5, 10, 10));



}
VHRangeSpheres.AddChild(rangeCircleDV);
drawingContext.Close();





foreach (EVEData.System es in EM.Systems)
{
bool inRange = false;
bool overlap = false;

double Distance = EM.GetRangeBetweenSystems(sys.Name, es.Name);
Distance = Distance / 9460730472580800.0;
foreach (KeyValuePair<string, double> kvp in activeJumpSpheres)
{
double Distance = EM.GetRangeBetweenSystems(kvp.Key, es.Name);
Distance = Distance / 9460730472580800.0;

if (Distance < kvp.Value && Distance > 0.0 && es.TrueSec <= 0.45)
{
if(inRange == true)
{
overlap = true;
}
inRange = true;
}


}

double Max = LY;

if (Distance < Max && Distance > 0.0 && es.TrueSec <= 0.45)

if (inRange)
{
double irX = (es.ActualX - universeXMin) * universeScale; ;
double irZ = (universeDepth - (es.ActualZ - universeZMin)) * universeScale;
Expand All @@ -480,8 +532,15 @@ private void SetJumpRange_Click(object sender, RoutedEventArgs e)

// Retrieve the DrawingContext from the DrawingVisual.
DrawingContext dcR = rangeSquareDV.RenderOpen();
if(overlap)
{
dcR.DrawRectangle(sysRangeCol, new Pen(rangeOverlapCol, 1), new Rect(irX - 5, irZ - 5, 10, 10));
}
else
{
dcR.DrawRectangle(sysRangeCol, new Pen(sysRangeCol, 1), new Rect(irX - 5, irZ - 5, 10, 10));
}

dcR.DrawRectangle(sysRangeCol, new Pen(sysRangeCol, 1), new Rect(irX - 5, irZ - 5, 10, 10));
dcR.Close();

VHRangeHighlights.AddChild(rangeSquareDV);
Expand Down

0 comments on commit b83215b

Please sign in to comment.