Skip to content

Commit

Permalink
Universe and Region Select
Browse files Browse the repository at this point in the history
Universe using Colours
Dotlan / ZKill right click
  • Loading branch information
BitBaboonSteve committed Dec 20, 2019
1 parent 18c615b commit 9d50a89
Show file tree
Hide file tree
Showing 7 changed files with 159 additions and 51 deletions.
59 changes: 35 additions & 24 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public partial class MainWindow : Window

private Xceed.Wpf.AvalonDock.Layout.LayoutDocument RegionLayoutDoc { get; }

private Xceed.Wpf.AvalonDock.Layout.LayoutDocument UniverseLayoutDoc { get; }


// Timer to Re-draw the map
private System.Windows.Threading.DispatcherTimer uiRefreshTimer;
Expand Down Expand Up @@ -105,29 +107,7 @@ public MainWindow()
}

RegionLayoutDoc = FindDocWithContentID(dockManager.Layout, "MapRegionContentID");

/* // now update the RegionLayoutDoc because the layout loading breaks the binding
foreach (Xceed.Wpf.AvalonDock.Layout.ILayoutElement ile in dockManager.Layout.Children)
{
if(ile is Xceed.Wpf.AvalonDock.Layout.ILayoutContainer )
{
Xceed.Wpf.AvalonDock.Layout.ILayoutContainer ilc = ile as Xceed.Wpf.AvalonDock.Layout.ILayoutContainer;
foreach (Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPane ldp in ilc.Children.OfType<Xceed.Wpf.AvalonDock.Layout.LayoutDocumentPane>())
{
foreach (Xceed.Wpf.AvalonDock.Layout.LayoutDocument ld in ldp.Children.OfType<Xceed.Wpf.AvalonDock.Layout.LayoutDocument>())
{
if (ld.ContentId == "MapRegionContentID")
{
RegionLayoutDoc = ld;
}
}
}
}
}
*/
UniverseLayoutDoc = FindDocWithContentID(dockManager.Layout, "FullUniverseViewID");

// load any custom map settings off disk
string mapConfigFileName = AppDomain.CurrentDomain.BaseDirectory + @"\MapConfig.dat";
Expand Down Expand Up @@ -210,9 +190,13 @@ public MainWindow()

RegionRC.RegionChanged += RegionRC_RegionChanged;
RegionRC.CharacterSelectionChanged += RegionRC_CharacterSelectionChanged;
RegionRC.UniverseSystemSelect += RegionRC_UniverseSystemSelect;



UniverseUC.MapConf = MapConf;
UniverseUC.Init();
UniverseUC.RequestRegionSystem += UniverseUC_RequestRegionSystem;


// load the anom data
Expand Down Expand Up @@ -284,6 +268,31 @@ public MainWindow()

}

private void UniverseUC_RequestRegionSystem(object sender, RoutedEventArgs e)
{
string sysName = e.OriginalSource as string;
RegionRC.FollowCharacter = false;
RegionRC.SelectSystem(sysName, true);

if (RegionLayoutDoc != null)
{
RegionLayoutDoc.IsSelected = true;
}

}

private void RegionRC_UniverseSystemSelect(object sender, RoutedEventArgs e)
{
string sysName = e.OriginalSource as string;
UniverseUC.ShowSystem(sysName);

if(UniverseLayoutDoc != null)
{
UniverseLayoutDoc.IsSelected = true;
}

}

private void RegionRC_CharacterSelectionChanged(object sender, PropertyChangedEventArgs e)
{
CollectionViewSource.GetDefaultView(ZKBFeed.ItemsSource).Refresh();
Expand Down Expand Up @@ -325,8 +334,10 @@ private void MapConf_PropertyChanged(object sender, PropertyChangedEventArgs e)
}

RegionRC.ReDrawMap(true);
UniverseUC.ReDrawMap(true,true,true);


if(e.PropertyName == "ShowRegionStandings")
if (e.PropertyName == "ShowRegionStandings")
{
RedrawUniverse(true);
}
Expand Down
4 changes: 4 additions & 0 deletions MapColours.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public class MapColours
[DisplayName("In Range")]
public Color JumpRangeInColour { get; set; }

[Category("Navigation")]
[DisplayName("In Range Highlight")]
public Color JumpRangeInColourHighlight { get; set; }


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

defaultColours.JumpRangeInColour = Color.FromRgb(135, 206, 235);
defaultColours.JumpRangeInColourHighlight = Color.FromArgb(156, 82, 135, 155);


defaultColours.ActiveIncursionColour = Color.FromRgb(110, 82, 77);

defaultColours.SOVStructureVunerableColour = Color.FromRgb(64,64,64);
Expand Down Expand Up @@ -592,6 +595,7 @@ public void SetDefaultColours()
blueColours.CharacterTextSize = 8;
blueColours.SystemTextSize = 12;
blueColours.JumpRangeInColour = Color.FromRgb(0, 255, 0);
blueColours.JumpRangeInColourHighlight = Color.FromArgb(156, 82, 135, 155);
blueColours.ActiveIncursionColour = Color.FromRgb(110, 82, 77);

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

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

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

lateNight.SOVStructureVunerableColour = Colors.Red;
Expand Down
3 changes: 2 additions & 1 deletion RegionControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
<MenuItem Header="DotLan" Click="SysContexMenuItemDotlan_Click" />
<MenuItem Header="ZKillBoard" Click="SysContexMenuItemZKB_Click" />
<MenuItem Header="Copy Name" Click="SysContexMenuItemCopy_Click" />
<MenuItem Header="Show In Universe" Click="SysContexMenuItemShowInUniverse_Click" />


</ContextMenu>
Expand Down Expand Up @@ -86,7 +87,7 @@
<StackPanel x:Name="AllianceNameListStackPanel" VerticalAlignment="Bottom"/>
</Border>

<Border BorderThickness="2" BorderBrush="Black" Background="#FF232223" Width="190" Height="140" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,20,20" CornerRadius="4" Panel.ZIndex="111" Grid.Row="1" Visibility="{Binding Path=MapConf.ShowToolBox, Converter={StaticResource BoolToVis}, diag:PresentationTraceSources.TraceLevel=High}" >
<Border BorderThickness="2" BorderBrush="Black" Background="#FF232223" Width="190" Height="140" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,20,20" CornerRadius="4" Panel.ZIndex="111" Grid.Row="1" Visibility="{Binding Path=MapConf.ShowToolBox, Converter={StaticResource BoolToVis}}" >
<Canvas x:Name="ToolBoxCanvas">
<Grid Canvas.Left="0" Canvas.Top="2" Width="210" >

Expand Down
18 changes: 18 additions & 0 deletions RegionControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,13 @@ public bool FollowCharacter
}


public static readonly RoutedEvent UniverseSystemSelectEvent = EventManager.RegisterRoutedEvent("UniverseSystemSelect", RoutingStrategy.Bubble, typeof(RoutedEventHandler), typeof(UniverseControl));

public event RoutedEventHandler UniverseSystemSelect
{
add { AddHandler(UniverseSystemSelectEvent, value); }
remove { RemoveHandler(UniverseSystemSelectEvent, value); }
}


public event PropertyChangedEventHandler PropertyChanged;
Expand Down Expand Up @@ -2417,6 +2423,18 @@ private void SysContexMenuItemCopy_Click(object sender, RoutedEventArgs e)
catch { }
}

private void SysContexMenuItemShowInUniverse_Click(object sender, RoutedEventArgs e)
{
EVEData.MapSystem eveSys = ((System.Windows.FrameworkElement)((System.Windows.FrameworkElement)sender).Parent).DataContext as EVEData.MapSystem;

RoutedEventArgs newEventArgs = new RoutedEventArgs(UniverseSystemSelectEvent, eveSys.Name);
RaiseEvent(newEventArgs);
}





/// <summary>
/// Dotlan Clicked
/// </summary>
Expand Down
5 changes: 5 additions & 0 deletions UniverseControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
<MenuItem Header="JF/Rorq (10.0LY)" DataContext="10" Click="SetJumpRange_Click"/>
</MenuItem>

<MenuItem Header="DotLan" Click="SysContexMenuItemDotlan_Click" />
<MenuItem Header="ZKillBoard" Click="SysContexMenuItemZKB_Click" />
<MenuItem Header="Show In Regions" Click="SysContexMenuShowInRegion_Click" />


</ContextMenu>
</UserControl.Resources>

Expand Down
Loading

0 comments on commit 9d50a89

Please sign in to comment.