diff --git a/AutoTrackR2/HomePage.xaml b/AutoTrackR2/HomePage.xaml index 9c08122..58c0e95 100644 --- a/AutoTrackR2/HomePage.xaml +++ b/AutoTrackR2/HomePage.xaml @@ -42,19 +42,20 @@ </ScrollViewer> </Border> - <!-- StackPanel for Start and Stop buttons --> + <!-- Border and StackPanel for player info --> <Border Background="{DynamicResource BackgroundDarkBrush}" BorderBrush="{DynamicResource AccentBrush}" Grid.Row="0" Grid.Column="1" BorderThickness="2" CornerRadius="5" - Margin="0,0,0,82"/> - <StackPanel Grid.Column="1" - VerticalAlignment="Center" + Margin="0,0,0,10" + VerticalAlignment="Top"> + <StackPanel + VerticalAlignment="Top" HorizontalAlignment="Center" - Height="269" - Width="152"> + Width="152" + Margin="10,5,10,5"> <TextBlock Name="PilotNameTitle" Text="Pilot" Width="152" @@ -112,6 +113,25 @@ Foreground="{DynamicResource TextBrush}" FontSize="10" TextAlignment="Center"/> + <TextBlock Name="LocationTitle" + Text="Location" + Width="152" + Height="20" + Background="Transparent" + FontFamily="{StaticResource Orbitron}" + Margin="0,5,0,0" + Foreground="{DynamicResource AltTextBrush}" + FontSize="14"/> + <TextBlock Name="LocationTextBox" + Text="Unknown" + Width="152" + Height="20" + Background="Transparent" + FontFamily="{StaticResource Orbitron}" + Margin="0,0,0,0" + Foreground="{DynamicResource TextBrush}" + FontSize="10" + TextAlignment="Center"/> <TextBlock Name="KillTallyTitle" Text="Kill Tally" Width="152" @@ -141,7 +161,8 @@ FontSize="8" BorderThickness="0" Margin="0,9,0,0"/> - </StackPanel> + </StackPanel> + </Border> <StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" diff --git a/AutoTrackR2/HomePage.xaml.cs b/AutoTrackR2/HomePage.xaml.cs index b765f0a..91ca40f 100644 --- a/AutoTrackR2/HomePage.xaml.cs +++ b/AutoTrackR2/HomePage.xaml.cs @@ -77,9 +77,11 @@ public partial class HomePage : UserControl GameModeTextBox.Text = "Unknown"; PlayerShipTextBox.Text = "Unknown"; PilotNameTextBox.Text = "Unknown"; + LocationTextBox.Text = "Unknown"; LocalPlayerData.CurrentGameMode = GameMode.Unknown; LocalPlayerData.PlayerShip = string.Empty; LocalPlayerData.Username = string.Empty; + LocalPlayerData.LastSeenVehicleLocation = "Unknown"; // Stop log monitoring if it's running if (_isLogHandlerRunning) @@ -139,6 +141,8 @@ public partial class HomePage : UserControl AdjustFontSize(PlayerShipTextBox); LocalPlayerData.PlayerShip = data.ShipName; LocalPlayerData.LastSeenVehicleLocation = data.Location; + LocationTextBox.Text = data.Location; + AdjustFontSize(LocationTextBox); }); }; @@ -216,7 +220,12 @@ public partial class HomePage : UserControl // Vehicle Destruction TrackREventDispatcher.VehicleDestructionEvent += (data) => { - LocalPlayerData.LastSeenVehicleLocation = data.VehicleZone; + Dispatcher.Invoke(() => + { + LocalPlayerData.LastSeenVehicleLocation = data.VehicleZone; + LocationTextBox.Text = data.VehicleZone; + AdjustFontSize(LocationTextBox); + }); }; _UIEventsRegistered = true;