diff --git a/src/CactusPie.MapLocation.Minimap/App.xaml b/src/CactusPie.MapLocation.Minimap/App.xaml
index c5ac112..6ba1e03 100644
--- a/src/CactusPie.MapLocation.Minimap/App.xaml
+++ b/src/CactusPie.MapLocation.Minimap/App.xaml
@@ -3,6 +3,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Startup="ApplicationStartup">
-
+
+
+
+
+
diff --git a/src/CactusPie.MapLocation.Minimap/App.xaml.cs b/src/CactusPie.MapLocation.Minimap/App.xaml.cs
index e2e235d..4c9e9e6 100644
--- a/src/CactusPie.MapLocation.Minimap/App.xaml.cs
+++ b/src/CactusPie.MapLocation.Minimap/App.xaml.cs
@@ -51,8 +51,10 @@ private IComponentContext CreateContainer()
containerBuilder.RegisterType().AsSelf().InstancePerDependency();
containerBuilder.RegisterType().AsSelf().InstancePerDependency();
containerBuilder.RegisterType().AsSelf().InstancePerDependency();
+ containerBuilder.RegisterType().AsSelf().InstancePerDependency();
containerBuilder.RegisterType().As().InstancePerDependency();
containerBuilder.RegisterType().As().SingleInstance();
+ containerBuilder.RegisterInstance(mapConfiguration).AsSelf();
containerBuilder.Register(_ =>
{
diff --git a/src/CactusPie.MapLocation.Minimap/CactusPie.MapLocation.Minimap.csproj b/src/CactusPie.MapLocation.Minimap/CactusPie.MapLocation.Minimap.csproj
index 49e1082..1f17d8d 100644
--- a/src/CactusPie.MapLocation.Minimap/CactusPie.MapLocation.Minimap.csproj
+++ b/src/CactusPie.MapLocation.Minimap/CactusPie.MapLocation.Minimap.csproj
@@ -182,6 +182,7 @@
PreserveNewest
+
@@ -191,6 +192,7 @@
+
diff --git a/src/CactusPie.MapLocation.Minimap/Data/MapConfiguration.cs b/src/CactusPie.MapLocation.Minimap/Data/MapConfiguration.cs
index f55edcf..dfa21b3 100644
--- a/src/CactusPie.MapLocation.Minimap/Data/MapConfiguration.cs
+++ b/src/CactusPie.MapLocation.Minimap/Data/MapConfiguration.cs
@@ -4,4 +4,5 @@ public class MapConfiguration
{
public int ListenPort { get; init; }
public string? ListenIpAddress { get; init; }
+ public string? Theme { get; init; }
}
\ No newline at end of file
diff --git a/src/CactusPie.MapLocation.Minimap/MainWindow.xaml b/src/CactusPie.MapLocation.Minimap/MainWindow.xaml
index 56888b9..9605e8e 100644
--- a/src/CactusPie.MapLocation.Minimap/MainWindow.xaml
+++ b/src/CactusPie.MapLocation.Minimap/MainWindow.xaml
@@ -6,16 +6,17 @@
xmlns:local="clr-namespace:CactusPie.MapLocation.Minimap"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
+ Style="{DynamicResource CustomWindowStyle}"
KeyDown="MainWindow_OnKeyDown"
- Title="EFT Map" Height="450" Width="900">
+ Title="EFT Map" Height="450" Width="1000">
-
-
+
+
@@ -40,16 +41,16 @@
Your position data will appear below [
- game_x_position
+ game_x_position
map_x_position
- game_z_position
+ game_z_position
map_z_position
]
-
+
@@ -71,7 +72,7 @@
-
+
@@ -105,7 +106,7 @@
Width="5"
/>
-
+
diff --git a/src/CactusPie.MapLocation.Minimap/MainWindow.xaml.cs b/src/CactusPie.MapLocation.Minimap/MainWindow.xaml.cs
index 639053c..40e3165 100644
--- a/src/CactusPie.MapLocation.Minimap/MainWindow.xaml.cs
+++ b/src/CactusPie.MapLocation.Minimap/MainWindow.xaml.cs
@@ -19,6 +19,7 @@ public partial class MainWindow : Window
private readonly IMapCreationDataManager _mapCreationDataManager;
private readonly Func _addNewMapDialogFactory;
private readonly Func _plotWindowFactory;
+ private readonly Func _themeSelectorFactory;
private readonly IMapDataReceiver _mapDataReceiver;
public MainWindow
@@ -26,12 +27,14 @@ public MainWindow
Func mapDataReceiverFactory,
IMapCreationDataManager mapCreationDataManager,
Func addNewMapDialogFactory,
- Func plotWindowFactory
+ Func plotWindowFactory,
+ Func themeSelectorFactory
)
{
_mapCreationDataManager = mapCreationDataManager;
_addNewMapDialogFactory = addNewMapDialogFactory;
_plotWindowFactory = plotWindowFactory;
+ _themeSelectorFactory = themeSelectorFactory;
_mapDataReceiver = mapDataReceiverFactory();
InitializeComponent();
}
@@ -40,6 +43,7 @@ protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
ReloadMapCreationPositionData();
+ ControlsStackPanel.Children.Add(_themeSelectorFactory());
_mapDataReceiver.MapPositionDataReceived += MapDataReceiverOnMapPositionDataReceived;
_mapDataReceiver.StartReceivingData();
diff --git a/src/CactusPie.MapLocation.Minimap/ThemeSelector.xaml b/src/CactusPie.MapLocation.Minimap/ThemeSelector.xaml
new file mode 100644
index 0000000..606cfee
--- /dev/null
+++ b/src/CactusPie.MapLocation.Minimap/ThemeSelector.xaml
@@ -0,0 +1,15 @@
+
+
+ Light Theme
+ Dark Theme
+ Colorful Light Theme
+ Colorful Dark Theme
+
+
diff --git a/src/CactusPie.MapLocation.Minimap/ThemeSelector.xaml.cs b/src/CactusPie.MapLocation.Minimap/ThemeSelector.xaml.cs
new file mode 100644
index 0000000..e772941
--- /dev/null
+++ b/src/CactusPie.MapLocation.Minimap/ThemeSelector.xaml.cs
@@ -0,0 +1,52 @@
+using System;
+using System.Linq;
+using System.Windows;
+using System.Windows.Controls;
+using CactusPie.MapLocation.Minimap.Data;
+using CactusPie.MapLocation.Minimap.Themes;
+
+namespace CactusPie.MapLocation.Minimap;
+
+public partial class ThemeSelector : UserControl
+{
+ private readonly MapConfiguration _mapConfiguration;
+
+ public ThemeSelector(MapConfiguration mapConfiguration)
+ {
+ _mapConfiguration = mapConfiguration;
+ InitializeComponent();
+ }
+
+ protected override void OnInitialized(EventArgs e)
+ {
+ base.OnInitialized(e);
+
+ if (_mapConfiguration.Theme != null)
+ {
+ ThemeComboBox.SelectedItem = ThemeComboBox.Items
+ .Cast()
+ .FirstOrDefault(x => x.Content as string == _mapConfiguration.Theme);
+ }
+ }
+
+ private void ThemeComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
+ {
+ string? selectedThemeName = (e.AddedItems[0] as ComboBoxItem)?.Content as string;
+
+ if (selectedThemeName == null)
+ {
+ throw new InvalidOperationException("Invalid theme name");
+ }
+
+ ThemesController.ThemeTypes themeType = selectedThemeName switch
+ {
+ "Light Theme" => ThemesController.ThemeTypes.Light,
+ "Dark Theme" => ThemesController.ThemeTypes.Dark,
+ "Colorful Light Theme" => ThemesController.ThemeTypes.ColourfulLight,
+ "Colorful Dark Theme" => ThemesController.ThemeTypes.ColourfulDark,
+ _ => throw new ArgumentOutOfRangeException($"Invalid theme name: {selectedThemeName}")
+ };
+
+ ThemesController.SetTheme(themeType);
+ }
+}
\ No newline at end of file
diff --git a/src/CactusPie.MapLocation.Minimap/Themes/ColourfulDarkTheme.xaml b/src/CactusPie.MapLocation.Minimap/Themes/ColourfulDarkTheme.xaml
new file mode 100644
index 0000000..1223dd1
--- /dev/null
+++ b/src/CactusPie.MapLocation.Minimap/Themes/ColourfulDarkTheme.xaml
@@ -0,0 +1,4505 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/CactusPie.MapLocation.Minimap/Themes/ColourfulDarkTheme.xaml.cs b/src/CactusPie.MapLocation.Minimap/Themes/ColourfulDarkTheme.xaml.cs
new file mode 100644
index 0000000..023f6e8
--- /dev/null
+++ b/src/CactusPie.MapLocation.Minimap/Themes/ColourfulDarkTheme.xaml.cs
@@ -0,0 +1,43 @@
+using System.Windows;
+
+namespace CactusPie.MapLocation.Minimap.Themes {
+ public partial class ColourfulDarkTheme {
+ private void CloseWindow_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ CloseWind(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ private void AutoMinimize_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ MaximizeRestore(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ private void Minimize_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ MinimizeWind(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ public void CloseWind(Window window) => window.Close();
+
+ public void MaximizeRestore(Window window) {
+ if (window.WindowState == WindowState.Maximized)
+ window.WindowState = WindowState.Normal;
+ else if (window.WindowState == WindowState.Normal)
+ window.WindowState = WindowState.Maximized;
+ }
+
+ public void MinimizeWind(Window window) => window.WindowState = WindowState.Minimized;
+ }
+}
\ No newline at end of file
diff --git a/src/CactusPie.MapLocation.Minimap/Themes/ColourfulLightTheme.xaml b/src/CactusPie.MapLocation.Minimap/Themes/ColourfulLightTheme.xaml
new file mode 100644
index 0000000..1f0adc0
--- /dev/null
+++ b/src/CactusPie.MapLocation.Minimap/Themes/ColourfulLightTheme.xaml
@@ -0,0 +1,4555 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/CactusPie.MapLocation.Minimap/Themes/ColourfulLightTheme.xaml.cs b/src/CactusPie.MapLocation.Minimap/Themes/ColourfulLightTheme.xaml.cs
new file mode 100644
index 0000000..04ba61f
--- /dev/null
+++ b/src/CactusPie.MapLocation.Minimap/Themes/ColourfulLightTheme.xaml.cs
@@ -0,0 +1,43 @@
+using System.Windows;
+
+namespace CactusPie.MapLocation.Minimap.Themes {
+ public partial class ColourfulLightTheme {
+ private void CloseWindow_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ CloseWind(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ private void AutoMinimize_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ MaximizeRestore(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ private void Minimize_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ MinimizeWind(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ public void CloseWind(Window window) => window.Close();
+
+ public void MaximizeRestore(Window window) {
+ if (window.WindowState == WindowState.Maximized)
+ window.WindowState = WindowState.Normal;
+ else if (window.WindowState == WindowState.Normal)
+ window.WindowState = WindowState.Maximized;
+ }
+
+ public void MinimizeWind(Window window) => window.WindowState = WindowState.Minimized;
+ }
+}
\ No newline at end of file
diff --git a/src/CactusPie.MapLocation.Minimap/Themes/DarkTheme.xaml b/src/CactusPie.MapLocation.Minimap/Themes/DarkTheme.xaml
new file mode 100644
index 0000000..524730d
--- /dev/null
+++ b/src/CactusPie.MapLocation.Minimap/Themes/DarkTheme.xaml
@@ -0,0 +1,4644 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/CactusPie.MapLocation.Minimap/Themes/DarkTheme.xaml.cs b/src/CactusPie.MapLocation.Minimap/Themes/DarkTheme.xaml.cs
new file mode 100644
index 0000000..d943d39
--- /dev/null
+++ b/src/CactusPie.MapLocation.Minimap/Themes/DarkTheme.xaml.cs
@@ -0,0 +1,43 @@
+using System.Windows;
+
+namespace CactusPie.MapLocation.Minimap.Themes {
+ public partial class DarkTheme {
+ private void CloseWindow_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ CloseWind(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ private void AutoMinimize_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ MaximizeRestore(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ private void Minimize_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ MinimizeWind(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ public void CloseWind(Window window) => window.Close();
+
+ public void MaximizeRestore(Window window) {
+ if (window.WindowState == WindowState.Maximized)
+ window.WindowState = WindowState.Normal;
+ else if (window.WindowState == WindowState.Normal)
+ window.WindowState = WindowState.Maximized;
+ }
+
+ public void MinimizeWind(Window window) => window.WindowState = WindowState.Minimized;
+ }
+}
\ No newline at end of file
diff --git a/src/CactusPie.MapLocation.Minimap/Themes/LightTheme.xaml b/src/CactusPie.MapLocation.Minimap/Themes/LightTheme.xaml
new file mode 100644
index 0000000..46fe8a6
--- /dev/null
+++ b/src/CactusPie.MapLocation.Minimap/Themes/LightTheme.xaml
@@ -0,0 +1,4461 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/CactusPie.MapLocation.Minimap/Themes/LightTheme.xaml.cs b/src/CactusPie.MapLocation.Minimap/Themes/LightTheme.xaml.cs
new file mode 100644
index 0000000..b392d92
--- /dev/null
+++ b/src/CactusPie.MapLocation.Minimap/Themes/LightTheme.xaml.cs
@@ -0,0 +1,43 @@
+using System.Windows;
+
+namespace CactusPie.MapLocation.Minimap.Themes {
+ public partial class LightTheme {
+ private void CloseWindow_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ CloseWind(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ private void AutoMinimize_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ MaximizeRestore(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ private void Minimize_Event(object sender, RoutedEventArgs e) {
+ if (e.Source != null)
+ try {
+ MinimizeWind(Window.GetWindow((FrameworkElement) e.Source));
+ }
+ catch {
+ }
+ }
+
+ public void CloseWind(Window window) => window.Close();
+
+ public void MaximizeRestore(Window window) {
+ if (window.WindowState == WindowState.Maximized)
+ window.WindowState = WindowState.Normal;
+ else if (window.WindowState == WindowState.Normal)
+ window.WindowState = WindowState.Maximized;
+ }
+
+ public void MinimizeWind(Window window) => window.WindowState = WindowState.Minimized;
+ }
+}
\ No newline at end of file
diff --git a/src/CactusPie.MapLocation.Minimap/Themes/ThemesController.cs b/src/CactusPie.MapLocation.Minimap/Themes/ThemesController.cs
new file mode 100644
index 0000000..b51e002
--- /dev/null
+++ b/src/CactusPie.MapLocation.Minimap/Themes/ThemesController.cs
@@ -0,0 +1,61 @@
+using System;
+using System.Windows;
+
+namespace CactusPie.MapLocation.Minimap.Themes
+{
+ public static class ThemesController
+ {
+ public enum ThemeTypes
+ {
+ Light,
+ ColourfulLight,
+ Dark,
+ ColourfulDark
+ }
+
+ public static ThemeTypes CurrentTheme { get; set; }
+
+ private static ResourceDictionary ThemeDictionary
+ {
+ get { return Application.Current.Resources.MergedDictionaries[0]; }
+ set { Application.Current.Resources.MergedDictionaries[0] = value; }
+ }
+
+ private static void ChangeTheme(Uri uri)
+ {
+ ThemeDictionary = new ResourceDictionary() { Source = uri };
+ }
+
+ public static void SetTheme(ThemeTypes theme)
+ {
+ string themeName = null;
+ CurrentTheme = theme;
+ switch (theme)
+ {
+ case ThemeTypes.Dark:
+ themeName = "DarkTheme";
+ break;
+ case ThemeTypes.Light:
+ themeName = "LightTheme";
+ break;
+ case ThemeTypes.ColourfulDark:
+ themeName = "ColourfulDarkTheme";
+ break;
+ case ThemeTypes.ColourfulLight:
+ themeName = "ColourfulLightTheme";
+ break;
+ }
+
+ try
+ {
+ if (!string.IsNullOrEmpty(themeName))
+ {
+ ChangeTheme(new Uri($"Themes/{themeName}.xaml", UriKind.Relative));
+ }
+ }
+ catch
+ {
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/CactusPie.MapLocation.Minimap/appsettings.json b/src/CactusPie.MapLocation.Minimap/appsettings.json
index 71f5b8f..ab10704 100644
--- a/src/CactusPie.MapLocation.Minimap/appsettings.json
+++ b/src/CactusPie.MapLocation.Minimap/appsettings.json
@@ -1,4 +1,6 @@
{
"ListenPort": 44365,
- "ListenIpAddress": "127.0.0.1"
+ "ListenIpAddress": "127.0.0.1",
+ // Supported themes: Dark Theme, Light Theme, Colourful Dark Theme, Colourful Light Theme
+ "Theme": "Dark Theme"
}
\ No newline at end of file