Added location to the homepage.

This commit is contained in:
Heavy Bob 2025-04-09 05:57:19 +10:00
parent 2b805428eb
commit ab6b95a281
2 changed files with 38 additions and 8 deletions

View file

@ -42,19 +42,20 @@
</ScrollViewer> </ScrollViewer>
</Border> </Border>
<!-- StackPanel for Start and Stop buttons --> <!-- Border and StackPanel for player info -->
<Border Background="{DynamicResource BackgroundDarkBrush}" <Border Background="{DynamicResource BackgroundDarkBrush}"
BorderBrush="{DynamicResource AccentBrush}" BorderBrush="{DynamicResource AccentBrush}"
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
BorderThickness="2" BorderThickness="2"
CornerRadius="5" CornerRadius="5"
Margin="0,0,0,82"/> Margin="0,0,0,10"
<StackPanel Grid.Column="1" VerticalAlignment="Top">
VerticalAlignment="Center" <StackPanel
VerticalAlignment="Top"
HorizontalAlignment="Center" HorizontalAlignment="Center"
Height="269" Width="152"
Width="152"> Margin="10,5,10,5">
<TextBlock Name="PilotNameTitle" <TextBlock Name="PilotNameTitle"
Text="Pilot" Text="Pilot"
Width="152" Width="152"
@ -112,6 +113,25 @@
Foreground="{DynamicResource TextBrush}" Foreground="{DynamicResource TextBrush}"
FontSize="10" FontSize="10"
TextAlignment="Center"/> 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" <TextBlock Name="KillTallyTitle"
Text="Kill Tally" Text="Kill Tally"
Width="152" Width="152"
@ -141,7 +161,8 @@
FontSize="8" FontSize="8"
BorderThickness="0" BorderThickness="0"
Margin="0,9,0,0"/> Margin="0,9,0,0"/>
</StackPanel> </StackPanel>
</Border>
<StackPanel Grid.Row="1" <StackPanel Grid.Row="1"
Grid.Column="1" Grid.Column="1"
VerticalAlignment="Center" VerticalAlignment="Center"

View file

@ -77,9 +77,11 @@ public partial class HomePage : UserControl
GameModeTextBox.Text = "Unknown"; GameModeTextBox.Text = "Unknown";
PlayerShipTextBox.Text = "Unknown"; PlayerShipTextBox.Text = "Unknown";
PilotNameTextBox.Text = "Unknown"; PilotNameTextBox.Text = "Unknown";
LocationTextBox.Text = "Unknown";
LocalPlayerData.CurrentGameMode = GameMode.Unknown; LocalPlayerData.CurrentGameMode = GameMode.Unknown;
LocalPlayerData.PlayerShip = string.Empty; LocalPlayerData.PlayerShip = string.Empty;
LocalPlayerData.Username = string.Empty; LocalPlayerData.Username = string.Empty;
LocalPlayerData.LastSeenVehicleLocation = "Unknown";
// Stop log monitoring if it's running // Stop log monitoring if it's running
if (_isLogHandlerRunning) if (_isLogHandlerRunning)
@ -139,6 +141,8 @@ public partial class HomePage : UserControl
AdjustFontSize(PlayerShipTextBox); AdjustFontSize(PlayerShipTextBox);
LocalPlayerData.PlayerShip = data.ShipName; LocalPlayerData.PlayerShip = data.ShipName;
LocalPlayerData.LastSeenVehicleLocation = data.Location; LocalPlayerData.LastSeenVehicleLocation = data.Location;
LocationTextBox.Text = data.Location;
AdjustFontSize(LocationTextBox);
}); });
}; };
@ -216,7 +220,12 @@ public partial class HomePage : UserControl
// Vehicle Destruction // Vehicle Destruction
TrackREventDispatcher.VehicleDestructionEvent += (data) => TrackREventDispatcher.VehicleDestructionEvent += (data) =>
{ {
LocalPlayerData.LastSeenVehicleLocation = data.VehicleZone; Dispatcher.Invoke(() =>
{
LocalPlayerData.LastSeenVehicleLocation = data.VehicleZone;
LocationTextBox.Text = data.VehicleZone;
AdjustFontSize(LocationTextBox);
});
}; };
_UIEventsRegistered = true; _UIEventsRegistered = true;