Skip to content

Commit

Permalink
Fix some other things
Browse files Browse the repository at this point in the history
  • Loading branch information
pizzaboxer committed Sep 5, 2024
1 parent 2805263 commit 0d5be93
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Bloxstrap/Installer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ public static void HandleUpgrade()
string oldStartPath = Path.Combine(Paths.WindowsStartMenu, "Bloxstrap");

if (File.Exists(oldDesktopPath))
File.Move(oldDesktopPath, DesktopShortcut);
File.Move(oldDesktopPath, DesktopShortcut, true);

if (Directory.Exists(oldStartPath))
{
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/Integrations/ActivityWatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ private void ReadLogEntry(string entry)
{
var lastActivity = History.First();

if (lastActivity is not null && Data.UniverseId == lastActivity.UniverseId && Data.IsTeleport)
if (Data.UniverseId == lastActivity.UniverseId && Data.IsTeleport)
Data.RootActivity = lastActivity.RootActivity ?? lastActivity;
}
}
Expand Down
21 changes: 16 additions & 5 deletions Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public partial class MenuContainer

private ServerInformation? _serverInformationWindow;

private ServerHistory? _gameHistoryWindow;

public MenuContainer(Watcher watcher)
{
InitializeComponent();
Expand All @@ -51,14 +53,14 @@ public void ShowServerInformationWindow()
{
if (_serverInformationWindow is null)
{
_serverInformationWindow = new ServerInformation(_watcher);
_serverInformationWindow = new(_watcher);
_serverInformationWindow.Closed += (_, _) => _serverInformationWindow = null;
}

if (!_serverInformationWindow.IsVisible)
_serverInformationWindow.Show();

_serverInformationWindow.Activate();
_serverInformationWindow.ShowDialog();
else
_serverInformationWindow.Activate();
}

public void ActivityWatcher_OnLogOpen(object? sender, EventArgs e) =>
Expand Down Expand Up @@ -135,7 +137,16 @@ private void JoinLastServerMenuItem_Click(object sender, RoutedEventArgs e)
if (_activityWatcher is null)
throw new ArgumentNullException(nameof(_activityWatcher));

new ServerHistory(_activityWatcher).ShowDialog();
if (_gameHistoryWindow is null)
{
_gameHistoryWindow = new(_activityWatcher);
_gameHistoryWindow.Closed += (_, _) => _gameHistoryWindow = null;
}

if (!_gameHistoryWindow.IsVisible)
_gameHistoryWindow.ShowDialog();
else
_gameHistoryWindow.Activate();
}
}
}

0 comments on commit 0d5be93

Please sign in to comment.