Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zarzakh bugfix, Multi Window option, Multi Character Display #162

Merged
merged 2 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions SMT/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public partial class MainWindow : Window
{
public static MainWindow AppWindow;
private LogonWindow logonBrowserWindow;
private Overlay overlayWindow;
private List<Overlay> overlayWindows;

private MediaPlayer mediaPlayer;
private PreferencesWindow preferencesWindow;
Expand Down Expand Up @@ -2475,19 +2475,32 @@ private void btnUnseenFits_Click(object sender, RoutedEventArgs e)

private void OverlayWindow_MenuItem_Click(object sender, RoutedEventArgs e)
{
if (overlayWindow != null)
if (overlayWindows == null) overlayWindows = new List<Overlay>();

if (MapConf.OverlayIndividualCharacterWindows)
{
return;
if (activeCharacter == null || overlayWindows.Any(w => w.OverlayCharacter == activeCharacter))
{
return;
}
}
else
{
if (overlayWindows.Count > 0)
{
return;
}
}

overlayWindow = new Overlay(this);
overlayWindow.Closing += OnOverlayWindowClosing;
overlayWindow.Show();
Overlay newOverlayWindow = new Overlay(this);
newOverlayWindow.Closing += OnOverlayWindowClosing;
newOverlayWindow.Show();
overlayWindows.Add(newOverlayWindow);
}

public void OnOverlayWindowClosing(object sender, CancelEventArgs e)
{
overlayWindow = null;
overlayWindows.Remove((Overlay)sender);
}
}

Expand Down
35 changes: 35 additions & 0 deletions SMT/MapConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ public class MapConfig : INotifyPropertyChanged
private bool m_overlayShowRoute = true;
private bool m_overlayShowJumpBridges = true;
private bool m_overlayShowSystemNames = false;
private bool m_overlayShowAllCharacterNames = false;
private bool m_overlayIndividualCharacterWindows = false;

public MapConfig()
{
Expand Down Expand Up @@ -1166,6 +1168,22 @@ public bool OverlayShowJumpBridges
OnPropertyChanged("OverlayShowJumpBridges");
}
}

[Category("Overlay")]
[DisplayName("Overlay Individual Character Windows")]
public bool OverlayIndividualCharacterWindows
{
get
{
return m_overlayIndividualCharacterWindows;
}
set
{
m_overlayIndividualCharacterWindows = value;

OnPropertyChanged("OverlayIndividualCharacterWindows");
}
}

[Category("Overlay")]
[DisplayName("Overlay Show System Names")]
Expand All @@ -1182,6 +1200,22 @@ public bool OverlayShowSystemNames
OnPropertyChanged("OverlayShowSystemNames");
}
}

[Category("Overlay")]
[DisplayName("Overlay Show All Character Names")]
public bool OverlayShowAllCharacterNames
{
get
{
return m_overlayShowAllCharacterNames;
}
set
{
m_overlayShowAllCharacterNames = value;

OnPropertyChanged("OverlayShowAllCharacterNames");
}
}

[Category("Overlay")]
[DisplayName("Overlay Intel Fresh Time")]
Expand Down Expand Up @@ -1360,6 +1394,7 @@ public void SetDefaults()
OverlayShowRoute = true;
OverlayShowJumpBridges = true;
OverlayShowSystemNames = false;
OverlayShowAllCharacterNames = false;

IntelFreshTime = 30;
IntelStaleTime = 120;
Expand Down
6 changes: 5 additions & 1 deletion SMT/Overlay.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
Visibility="Visible"
MinWidth="100"
MinHeight="100"
Title="Overlay" Height="600" Width="600" AllowsTransparency="True">
Title="Overlay"
Height="600"
Width="600"
AllowsTransparency="True"
>
<Window.Background>
<SolidColorBrush Opacity="0.2" Color="Black"></SolidColorBrush>
</Window.Background>
Expand Down
Loading
Loading