Skip to content

Commit

Permalink
esi data popup
Browse files Browse the repository at this point in the history
  • Loading branch information
Slazanger committed Jun 25, 2017
1 parent e6b3484 commit 8a62274
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 5 deletions.
2 changes: 1 addition & 1 deletion About.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
Title="Slazangers Map Tool (SMT)" Height="200" Width="400" WindowStartupLocation="CenterOwner" ResizeMode="NoResize">
<Grid>
<Image x:Name="image" HorizontalAlignment="Left" Height="149" Margin="10,10,0,0" VerticalAlignment="Top" Width="172" Source="Images/Slazanger.png" RenderTransformOrigin="0.695,0.632"/>
<TextBlock x:Name="textBlock" HorizontalAlignment="Left" Margin="168,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="149" Width="214"><Run Text="Version "/><Run Text="0.25"/><LineBreak/><Run/><LineBreak/><Run Text="Created By "/><Hyperlink x:Name="SlazLink" NavigateUri="https://evewho.com/pilot/Slazanger" RequestNavigate="SlazLink_RequestNavigate"><Run Text="Slazanger"/></Hyperlink><LineBreak/><LineBreak/><Run Text="All Donations, feedback and "/><Run Text="f"/><Run Text="eature requests welcome.. feel free to evemail in game."/></TextBlock>
<TextBlock x:Name="textBlock" HorizontalAlignment="Left" Margin="168,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="149" Width="214"><Run Text="Version "/><Run Text="0.27"/><LineBreak/><Run/><LineBreak/><Run Text="Created By "/><Hyperlink x:Name="SlazLink" NavigateUri="https://evewho.com/pilot/Slazanger" RequestNavigate="SlazLink_RequestNavigate"><Run Text="Slazanger"/></Hyperlink><LineBreak/><LineBreak/><Run Text="All Donations, feedback and "/><Run Text="f"/><Run Text="eature requests welcome.. feel free to evemail in game."/></TextBlock>
</Grid>
</Window>
30 changes: 29 additions & 1 deletion MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,36 @@
<Viewbox HorizontalAlignment="Left" VerticalAlignment="Top">
<Canvas x:Name="MainCanvas" Margin="5" Width="1050" Height="800" />
</Viewbox>

</Grid>

<Popup x:Name="SystemInfoPopup" IsOpen="False" AllowsTransparency="True" Width="100">
<StackPanel Background="#FF959595">
<Label Content="{Binding Name}" FontWeight="Bold"/>

<StackPanel Orientation="Horizontal" Margin="10,0,0,0">
<Label Content="Jumps" Width="50" Padding="1"/>
<Label Content="{Binding JumpsLastHour}" Padding="1" FontWeight="Bold"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="10,0,0,0">
<Label Content="Pods" Width="50" Padding="1" />
<Label Content="{Binding PodKillsLastHour}" Padding="1" FontWeight="Bold"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="10,0,0,0">
<Label Content="Ships" Width="50" Padding="1" />
<Label Content="{Binding ShipKillsLastHour}" Padding="1" FontWeight="Bold"/>
</StackPanel>

<StackPanel Orientation="Horizontal" Margin="10,0,0,0">
<Label Content="NPCs" Width="50" Padding="1" />
<Label Content="{Binding NPCKillsLastHour}" Padding="1" FontWeight="Bold"/>
</StackPanel>

</StackPanel>
</Popup>


<GridSplitter Background="#FF575757" Width="2" Margin="1,1,1,1" Grid.RowSpan="2" Grid.Column="0"/>
<Grid Grid.Row="0" Grid.Column="1" Grid.RowSpan="2">
<GridSplitter />
Expand Down
31 changes: 29 additions & 2 deletions MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void ReDrawMap()
}


void ShapeMouseHandler(object sender, MouseButtonEventArgs e)
void ShapeMouseDownHandler(object sender, MouseButtonEventArgs e)
{
Shape obj = sender as Shape;
EVEData.RegionData currentRegion = RegionDropDown.SelectedItem as EVEData.RegionData;
Expand Down Expand Up @@ -233,6 +233,30 @@ void ShapeMouseHandler(object sender, MouseButtonEventArgs e)
}
}

void ShapeMouseOverHandler(object sender, MouseEventArgs e)
{
Shape obj = sender as Shape;
EVEData.RegionData currentRegion = RegionDropDown.SelectedItem as EVEData.RegionData;

EVEData.System selectedSys = obj.DataContext as EVEData.System;
if(obj.IsMouseOver && MapConf.ShowSystemPopup)
{
SystemInfoPopup.PlacementTarget = obj;
SystemInfoPopup.VerticalOffset = 5;
SystemInfoPopup.HorizontalOffset = 15;
SystemInfoPopup.DataContext = selectedSys;

SystemInfoPopup.IsOpen = true;
}
else
{
SystemInfoPopup.IsOpen = false;

}
}



private void SelectSystem(string name)
{
EVEData.RegionData rd = RegionDropDown.SelectedItem as EVEData.RegionData;
Expand Down Expand Up @@ -558,7 +582,10 @@ private void AddSystemsToMap()
}

systemShape.DataContext = sys;
systemShape.MouseDown += ShapeMouseHandler;
systemShape.MouseDown += ShapeMouseDownHandler;
systemShape.MouseEnter += ShapeMouseOverHandler;
systemShape.MouseLeave += ShapeMouseOverHandler;



Canvas.SetLeft(systemShape, sys.DotlanX - circleOffset);
Expand Down
8 changes: 7 additions & 1 deletion MapConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,12 @@ protected void OnPropertyChanged(string name)
[DisplayName("Selected System")]
public Color SelectedSystemColour { get; set; }

[Category("General")]
[DisplayName("System Popup")]
public bool ShowSystemPopup { get; set; }



[Category("Character")]
[DisplayName("Highlight")]
public Color CharacterHighlightColour { get; set; }
Expand Down Expand Up @@ -246,7 +252,7 @@ public void SetDefaults()
ConstellationGateColour = Color.FromRgb(128, 128, 128);

SelectedSystemColour = Color.FromRgb(255, 255, 255);

ShowSystemPopup = true;

CharacterHighlightColour = Color.FromRgb(70, 130, 180);
CharacterTextColour = Color.FromRgb(0, 0, 0);
Expand Down

0 comments on commit 8a62274

Please sign in to comment.