Fix some other things

This commit is contained in:
pizzaboxer 2024-09-05 11:14:46 +01:00
parent 2805263a63
commit 0d5be93616
No known key found for this signature in database
GPG Key ID: 59D4A1DBAD0F2BA8
3 changed files with 18 additions and 7 deletions

View File

@ -494,7 +494,7 @@ namespace Bloxstrap
string oldStartPath = Path.Combine(Paths.WindowsStartMenu, "Bloxstrap");
if (File.Exists(oldDesktopPath))
File.Move(oldDesktopPath, DesktopShortcut);
File.Move(oldDesktopPath, DesktopShortcut, true);
if (Directory.Exists(oldStartPath))
{

View File

@ -226,7 +226,7 @@ namespace Bloxstrap.Integrations
{
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;
}
}

View File

@ -28,6 +28,8 @@ namespace Bloxstrap.UI.Elements.ContextMenu
private ServerInformation? _serverInformationWindow;
private ServerHistory? _gameHistoryWindow;
public MenuContainer(Watcher watcher)
{
InitializeComponent();
@ -51,13 +53,13 @@ namespace Bloxstrap.UI.Elements.ContextMenu
{
if (_serverInformationWindow is null)
{
_serverInformationWindow = new ServerInformation(_watcher);
_serverInformationWindow = new(_watcher);
_serverInformationWindow.Closed += (_, _) => _serverInformationWindow = null;
}
if (!_serverInformationWindow.IsVisible)
_serverInformationWindow.Show();
_serverInformationWindow.ShowDialog();
else
_serverInformationWindow.Activate();
}
@ -135,7 +137,16 @@ namespace Bloxstrap.UI.Elements.ContextMenu
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();
}
}
}