mirror of
https://github.com/BubbaGumpShrump/AutoTrackR2.git
synced 2025-06-20 05:29:07 +00:00
Fixed Theme's not being applied correctly
Sometimes when switching themes it wouldn't apply the theme correctly.
This commit is contained in:
parent
5fc670b652
commit
f116793591
1 changed files with 54 additions and 50 deletions
|
@ -99,7 +99,8 @@ public partial class HomePage : UserControl
|
|||
return;
|
||||
|
||||
// Username
|
||||
TrackREventDispatcher.PlayerLoginEvent += (username) => {
|
||||
TrackREventDispatcher.PlayerLoginEvent += (username) =>
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
PilotNameTextBox.Text = username;
|
||||
|
@ -109,17 +110,19 @@ public partial class HomePage : UserControl
|
|||
};
|
||||
|
||||
// Ship
|
||||
TrackREventDispatcher.JumpDriveStateChangedEvent += (shipName) => {
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
PlayerShipTextBox.Text = shipName;
|
||||
AdjustFontSize(PlayerShipTextBox);
|
||||
LocalPlayerData.PlayerShip = shipName;
|
||||
});
|
||||
TrackREventDispatcher.JumpDriveStateChangedEvent += (shipName) =>
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
PlayerShipTextBox.Text = shipName;
|
||||
AdjustFontSize(PlayerShipTextBox);
|
||||
LocalPlayerData.PlayerShip = shipName;
|
||||
});
|
||||
};
|
||||
|
||||
// Game Mode
|
||||
TrackREventDispatcher.PlayerChangedGameModeEvent += (mode) => {
|
||||
TrackREventDispatcher.PlayerChangedGameModeEvent += (mode) =>
|
||||
{
|
||||
Dispatcher.Invoke(() =>
|
||||
{
|
||||
GameModeTextBox.Text = mode.ToString();
|
||||
|
@ -129,12 +132,14 @@ public partial class HomePage : UserControl
|
|||
};
|
||||
|
||||
// Game Version
|
||||
TrackREventDispatcher.GameVersionEvent += (version) => {
|
||||
LocalPlayerData.GameVersion = version;
|
||||
TrackREventDispatcher.GameVersionEvent += (version) =>
|
||||
{
|
||||
LocalPlayerData.GameVersion = version;
|
||||
};
|
||||
|
||||
// Actor Death
|
||||
TrackREventDispatcher.ActorDeathEvent += async (actorDeathData) => {
|
||||
TrackREventDispatcher.ActorDeathEvent += async (actorDeathData) =>
|
||||
{
|
||||
if (actorDeathData.VictimPilot != LocalPlayerData.Username)
|
||||
{
|
||||
var playerData = await WebHandler.GetPlayerData(actorDeathData.VictimPilot);
|
||||
|
@ -187,7 +192,8 @@ public partial class HomePage : UserControl
|
|||
};
|
||||
|
||||
// Vehicle Destruction
|
||||
TrackREventDispatcher.VehicleDestructionEvent += (data) => {
|
||||
TrackREventDispatcher.VehicleDestructionEvent += (data) =>
|
||||
{
|
||||
LocalPlayerData.LastSeenVehicleLocation = data.VehicleZone;
|
||||
};
|
||||
|
||||
|
@ -295,15 +301,13 @@ public partial class HomePage : UserControl
|
|||
};
|
||||
|
||||
// Create a Border around the Image
|
||||
var imageBorder = new Border
|
||||
{
|
||||
BorderBrush = accentColorBrush, // Set the border color
|
||||
BorderThickness = new Thickness(2), // Set the border thickness
|
||||
Padding = new Thickness(0), // Optional padding inside the border
|
||||
CornerRadius = new CornerRadius(5),
|
||||
Margin = new Thickness(10,18,15,18),
|
||||
Child = profileImage // Set the Image as the content of the Border
|
||||
};
|
||||
var imageBorder = new Border();
|
||||
imageBorder.SetResourceReference(Border.BorderBrushProperty, "AccentBrush");
|
||||
imageBorder.BorderThickness = new Thickness(2);
|
||||
imageBorder.Padding = new Thickness(0);
|
||||
imageBorder.CornerRadius = new CornerRadius(5);
|
||||
imageBorder.Margin = new Thickness(10, 18, 15, 18);
|
||||
imageBorder.Child = profileImage;
|
||||
|
||||
// Add the Border (with the image inside) to the Grid
|
||||
Grid.SetColumn(imageBorder, 1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue