Skip to content

Commit

Permalink
Add UDMUX proxy status as server info, fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Jul 20, 2023
1 parent 890f7a1 commit 5c267c7
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Bloxstrap/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,9 @@ protected override void OnStartup(StartupEventArgs e)

// this ordering is very important as all wpf windows are shown as modal dialogs, mess it up and you'll end up blocking input to one of them
dialog?.ShowBootstrapper();
NotifyIcon?.InitializeContextMenu();

if (Settings.Prop.EnableActivityTracking)
NotifyIcon?.InitializeContextMenu();

bootstrapperTask.Wait();

Expand Down
12 changes: 8 additions & 4 deletions Bloxstrap/UI/Elements/ContextMenu/ServerInformation.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
Title="Server information"
MinWidth="0"
MinHeight="0"
Width="400"
Width="420"
SizeToContent="Height"
ResizeMode="NoResize"
Background="{ui:ThemeResource ApplicationBackgroundBrush}"
Expand All @@ -31,20 +31,24 @@
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<TextBlock Grid.Row="0" Grid.Column="0" Margin="0,0,16,8" VerticalAlignment="Center" Text="Type" />
<TextBlock Grid.Row="0" Grid.Column="0" Margin="0,0,16,12" VerticalAlignment="Center" Text="Type" />
<TextBlock Grid.Row="0" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ServerType, Mode=OneWay}" />

<TextBlock Grid.Row="1" Grid.Column="0" Margin="0,0,16,8" VerticalAlignment="Center" Text="Instance ID" />
<TextBlock Grid.Row="1" Grid.Column="0" Margin="0,0,16,12" VerticalAlignment="Center" Text="Instance ID" />
<TextBlock Grid.Row="1" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding InstanceId, Mode=OneWay}" />

<TextBlock Grid.Row="2" Grid.Column="0" Margin="0,0,16,0" VerticalAlignment="Center" Text="Location" />
<TextBlock Grid.Row="2" Grid.Column="0" Margin="0,0,16,12" VerticalAlignment="Center" Text="Location" />
<TextBlock Grid.Row="2" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding ServerLocation, Mode=OneWay}" />

<TextBlock Grid.Row="3" Grid.Column="0" Margin="0,0,16,0" VerticalAlignment="Center" Text="UDMUX proxied" />
<TextBlock Grid.Row="3" Grid.Column="1" Foreground="{DynamicResource TextFillColorTertiaryBrush}" Text="{Binding UdmuxProxied, Mode=OneWay}" />
</Grid>

<Border Grid.Row="2" Padding="15" Background="{ui:ThemeResource SolidBackgroundFillColorSecondaryBrush}">
Expand Down
4 changes: 2 additions & 2 deletions Bloxstrap/UI/Elements/Menu/Pages/IntegrationsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<ui:CardControl Margin="0,8,0,0" IsEnabled="{Binding IsChecked, ElementName=ActivityTrackingEnabledToggle, Mode=OneWay}">
<ui:CardControl.Header>
<StackPanel>
<TextBlock FontSize="14" Text="Know where your server's located" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="When you join a game, you'll be notified of the server's location. Won't show in fullscreen." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
<TextBlock FontSize="14" Text="See server location when joining a game" />
<TextBlock Margin="0,2,0,0" FontSize="12" Text="When you join a game, you'll be notified of where your server's located. Won't show in fullscreen." Foreground="{DynamicResource TextFillColorTertiaryBrush}" />
</StackPanel>
</ui:CardControl.Header>
<ui:ToggleSwitch IsChecked="{Binding ShowServerDetailsEnabled, Mode=TwoWay}" />
Expand Down
2 changes: 2 additions & 0 deletions Bloxstrap/UI/NotifyIconWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public void InitializeContextMenu()
if (_menuContainer is not null)
return;

App.Logger.WriteLine("[NotifyIconWrapper::InitializeContextMenu] Initializing context menu");

_menuContainer = new(_activityWatcher, _richPresenceHandler);
_menuContainer.ShowDialog();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ internal class ServerInformationViewModel : NotifyPropertyChangedViewModel
public string InstanceId => _activityWatcher.ActivityJobId;
public string ServerType => $"{_activityWatcher.ActivityServerType} server";
public string ServerLocation { get; private set; } = "Loading, please wait...";
public string UdmuxProxied => _activityWatcher.ActivityMachineUDMUX ? "Yes" : "No";

public ICommand CopyInstanceIdCommand => new RelayCommand(CopyInstanceId);
public ICommand CloseWindowCommand => new RelayCommand(_window.Close);
Expand Down

0 comments on commit 5c267c7

Please sign in to comment.