diff --git a/ConfigManagerV2/ConfigManagerV2.sln b/ConfigManagerV2/ConfigManagerV2.sln
new file mode 100644
index 0000000..b2ffd47
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.1.32228.430
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfigManagerV2", "ConfigManagerV2\ConfigManagerV2.csproj", "{0C1DD2D0-F373-43A3-9B2D-F42BCA33D95A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {0C1DD2D0-F373-43A3-9B2D-F42BCA33D95A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0C1DD2D0-F373-43A3-9B2D-F42BCA33D95A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0C1DD2D0-F373-43A3-9B2D-F42BCA33D95A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0C1DD2D0-F373-43A3-9B2D-F42BCA33D95A}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {C01AB77A-47A7-4587-AA94-315531A5BAA0}
+ EndGlobalSection
+EndGlobal
diff --git a/ConfigManagerV2/ConfigManagerV2/App.xaml b/ConfigManagerV2/ConfigManagerV2/App.xaml
new file mode 100644
index 0000000..50a0ef0
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/App.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
diff --git a/ConfigManagerV2/ConfigManagerV2/App.xaml.cs b/ConfigManagerV2/ConfigManagerV2/App.xaml.cs
new file mode 100644
index 0000000..6fc7658
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace ConfigManagerV2
+{
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/ConfigManagerV2/ConfigManagerV2/AssemblyInfo.cs b/ConfigManagerV2/ConfigManagerV2/AssemblyInfo.cs
new file mode 100644
index 0000000..8b5504e
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/AssemblyInfo.cs
@@ -0,0 +1,10 @@
+using System.Windows;
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
diff --git a/ConfigManagerV2/ConfigManagerV2/ConfigManagerV2.csproj b/ConfigManagerV2/ConfigManagerV2/ConfigManagerV2.csproj
new file mode 100644
index 0000000..4106cb0
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/ConfigManagerV2.csproj
@@ -0,0 +1,10 @@
+
+
+
+ WinExe
+ net6.0-windows
+ enable
+ true
+
+
+
diff --git a/ConfigManagerV2/ConfigManagerV2/MainWindow.xaml b/ConfigManagerV2/ConfigManagerV2/MainWindow.xaml
new file mode 100644
index 0000000..51e1ec2
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/MainWindow.xaml
@@ -0,0 +1,20 @@
+
+
+
+
+
diff --git a/ConfigManagerV2/ConfigManagerV2/MainWindow.xaml.cs b/ConfigManagerV2/ConfigManagerV2/MainWindow.xaml.cs
new file mode 100644
index 0000000..182d39a
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/MainWindow.xaml.cs
@@ -0,0 +1,44 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace ConfigManagerV2
+{
+ ///
+ /// Interaction logic for MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ public MainWindow()
+ {
+ InitializeComponent();
+ }
+
+ #region events
+ private void changeTheme_Click(object sender, RoutedEventArgs e)
+ {
+ switch (int.Parse(((MenuItem)sender).Uid))
+ {
+ case 0:
+ REghZyFramework.Themes.ThemesController.SetTheme(REghZyFramework.Themes.ThemesController.ThemeTypes.Dark);
+ break;
+ case 1:
+ REghZyFramework.Themes.ThemesController.SetTheme(REghZyFramework.Themes.ThemesController.ThemeTypes.Light);
+ break;
+ }
+ e.Handled = true;
+ }
+ #endregion
+ }
+}
diff --git a/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulDarkTheme.xaml b/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulDarkTheme.xaml
new file mode 100644
index 0000000..7f2ecfd
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulDarkTheme.xaml
@@ -0,0 +1,4496 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulDarkTheme.xaml.cs b/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulDarkTheme.xaml.cs
new file mode 100644
index 0000000..9614159
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulDarkTheme.xaml.cs
@@ -0,0 +1,33 @@
+using System.Windows;
+
+namespace REghZyFramework.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;
+ }
+}
diff --git a/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulLightTheme.xaml b/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulLightTheme.xaml
new file mode 100644
index 0000000..6b0c050
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulLightTheme.xaml
@@ -0,0 +1,4546 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulLightTheme.xaml.cs b/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulLightTheme.xaml.cs
new file mode 100644
index 0000000..e89b903
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/Themes/ColourfulLightTheme.xaml.cs
@@ -0,0 +1,33 @@
+using System.Windows;
+
+namespace REghZyFramework.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;
+ }
+}
diff --git a/ConfigManagerV2/ConfigManagerV2/Themes/DarkTheme.xaml b/ConfigManagerV2/ConfigManagerV2/Themes/DarkTheme.xaml
new file mode 100644
index 0000000..8e989c6
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/Themes/DarkTheme.xaml
@@ -0,0 +1,4467 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ConfigManagerV2/ConfigManagerV2/Themes/DarkTheme.xaml.cs b/ConfigManagerV2/ConfigManagerV2/Themes/DarkTheme.xaml.cs
new file mode 100644
index 0000000..b3547ba
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/Themes/DarkTheme.xaml.cs
@@ -0,0 +1,33 @@
+using System.Windows;
+
+namespace REghZyFramework.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;
+ }
+}
diff --git a/ConfigManagerV2/ConfigManagerV2/Themes/LightTheme.xaml b/ConfigManagerV2/ConfigManagerV2/Themes/LightTheme.xaml
new file mode 100644
index 0000000..eb87521
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/Themes/LightTheme.xaml
@@ -0,0 +1,4452 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
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+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ConfigManagerV2/ConfigManagerV2/Themes/LightTheme.xaml.cs b/ConfigManagerV2/ConfigManagerV2/Themes/LightTheme.xaml.cs
new file mode 100644
index 0000000..e6ce7b4
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/Themes/LightTheme.xaml.cs
@@ -0,0 +1,33 @@
+using System.Windows;
+
+namespace REghZyFramework.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;
+ }
+}
diff --git a/ConfigManagerV2/ConfigManagerV2/Themes/ThemesController.cs b/ConfigManagerV2/ConfigManagerV2/Themes/ThemesController.cs
new file mode 100644
index 0000000..6c88af5
--- /dev/null
+++ b/ConfigManagerV2/ConfigManagerV2/Themes/ThemesController.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Windows;
+
+namespace REghZyFramework.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 { }
+ }
+ }
+}
diff --git a/DamageCalculator/DamageCalculator.sln b/DamageCalculator/DamageCalculator.sln
index fcfbaee..103c065 100644
--- a/DamageCalculator/DamageCalculator.sln
+++ b/DamageCalculator/DamageCalculator.sln
@@ -1,9 +1,11 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.31515.178
+# Visual Studio Version 17
+VisualStudioVersion = 17.1.32228.430
MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Damage Calculator", "DamageCalculator\DamageCalculator.csproj", "{7A7AE40F-8677-44E3-873A-4AB7C9FCFEB4}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DamageCalculator", "DamageCalculator\DamageCalculator.csproj", "{7A7AE40F-8677-44E3-873A-4AB7C9FCFEB4}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SteamHelpers", "..\Shared\SteamHelpers\SteamHelpers\SteamHelpers.csproj", "{3632D445-DC7D-43FC-AC66-8503F50FCA2A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -15,6 +17,10 @@ Global
{7A7AE40F-8677-44E3-873A-4AB7C9FCFEB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A7AE40F-8677-44E3-873A-4AB7C9FCFEB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A7AE40F-8677-44E3-873A-4AB7C9FCFEB4}.Release|Any CPU.Build.0 = Release|Any CPU
+ {3632D445-DC7D-43FC-AC66-8503F50FCA2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {3632D445-DC7D-43FC-AC66-8503F50FCA2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {3632D445-DC7D-43FC-AC66-8503F50FCA2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {3632D445-DC7D-43FC-AC66-8503F50FCA2A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/DamageCalculator/DamageCalculator/DamageCalculator - Backup.csproj b/DamageCalculator/DamageCalculator/DamageCalculator - Backup.csproj
new file mode 100644
index 0000000..5b51864
--- /dev/null
+++ b/DamageCalculator/DamageCalculator/DamageCalculator - Backup.csproj
@@ -0,0 +1,52 @@
+
+
+ net6.0-windows
+ WinExe
+ Damage_Calculator
+ CSGO Damage Calculator
+ true
+ true
+ true
+ true
+
+
+ 27.ico
+
+
+
+
+
+
+
+
+
+
+ C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ all
+
+
+
+
\ No newline at end of file
diff --git a/DamageCalculator/DamageCalculator/DamageCalculator.csproj b/DamageCalculator/DamageCalculator/DamageCalculator.csproj
index 1503310..1460ca4 100644
--- a/DamageCalculator/DamageCalculator/DamageCalculator.csproj
+++ b/DamageCalculator/DamageCalculator/DamageCalculator.csproj
@@ -1,168 +1,31 @@
-
-
-
+
- Debug
- AnyCPU
- {7A7AE40F-8677-44E3-873A-4AB7C9FCFEB4}
+ net6.0-windows
WinExe
Damage_Calculator
CSGO Damage Calculator
- v4.8
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
- true
- true
-
-
- AnyCPU
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
- true
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
+ true
+ true
+ true
true
27.ico
+ 1.2.0.0
+ 1.2.0.0
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
- 4.0
+
+ C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- About.xaml
-
-
-
- ctrlPlayerSpawn.xaml
-
-
-
-
- Help.xaml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
- MSBuild:Compile
- Designer
-
-
- App.xaml
- Code
-
-
- MainWindow.xaml
- Code
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
- MSBuild:Compile
- Designer
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
+
@@ -175,5 +38,17 @@
-
+
+
+
+
+
+
+
+
+
+ all
+
+
+
\ No newline at end of file
diff --git a/DamageCalculator/DamageCalculator/MainWindow.xaml.cs b/DamageCalculator/DamageCalculator/MainWindow.xaml.cs
index 4b3c726..d00318a 100644
--- a/DamageCalculator/DamageCalculator/MainWindow.xaml.cs
+++ b/DamageCalculator/DamageCalculator/MainWindow.xaml.cs
@@ -14,8 +14,8 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
-using Damage_Calculator.Models;
-using Damage_Calculator.ZatVdfParser;
+using Shared.Models;
+using Shared.ZatVdfParser;
using System.Xml.Serialization;
using System.Globalization;
@@ -67,8 +67,8 @@ namespace Damage_Calculator
{
InitializeComponent();
- Globals.Settings.CsgoHelper.CsgoPath = Globals.Settings.SteamHelper.GetGamePathFromExactName("Counter-Strike: Global Offensive");
- if (Globals.Settings.CsgoHelper.CsgoPath == null)
+ Shared.Globals.Settings.CsgoHelper.CsgoPath = Shared.Globals.Settings.SteamHelper.GetGamePathFromExactName("Counter-Strike: Global Offensive");
+ if (Shared.Globals.Settings.CsgoHelper.CsgoPath == null)
{
MessageBox.Show("Make sure you have installed CS:GO and Steam correctly.", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
this.Close();
@@ -83,6 +83,61 @@ namespace Damage_Calculator
bgWorker.RunWorkerAsync();
}
+ private static string calculateMD5(string filename)
+ {
+ using (var md5 = System.Security.Cryptography.MD5.Create())
+ {
+ using (var stream = File.OpenRead(filename))
+ {
+ var hash = md5.ComputeHash(stream);
+ return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
+ }
+ }
+ }
+
+ private void updateMapsWithCurrentFilter()
+ {
+ if (!this.IsInitialized)
+ return;
+
+ // Add maps
+ var newMaps = new List();
+
+ foreach (var mapItem in this.allMaps)
+ {
+ var newMap = new ComboBoxItem();
+ var map = (CsgoMap)mapItem.Tag;
+
+ string mapNameWithPrefix = System.IO.Path.GetFileNameWithoutExtension(map.MapImagePath).ToLower();
+
+ // Filter map type
+ if (mapNameWithPrefix.StartsWith("de") && mnuShowDefusalMaps.IsChecked == false)
+ continue;
+ if (mapNameWithPrefix.StartsWith("cs") && mnuShowHostageMaps.IsChecked == false)
+ continue;
+ if (mapNameWithPrefix.StartsWith("ar") && mnuShowArmsRaceMaps.IsChecked == false)
+ continue;
+ if (mapNameWithPrefix.StartsWith("dz") && mnuShowDangerZoneMaps.IsChecked == false)
+ continue;
+
+ // Filter file existence
+ if (map.BspFilePath == null && mnuShowMapsMissingBsp.IsChecked == false)
+ continue;
+ if (map.NavFilePath == null && mnuShowMapsMissingNav.IsChecked == false)
+ continue;
+ if (map.AinFilePath == null && mnuShowMapsMissingAin.IsChecked == false)
+ continue;
+
+ newMap.Tag = map;
+ newMap.Content = map.MapFileName;
+ newMaps.Add(newMap);
+ }
+
+ this.comboBoxMaps.ItemsSource = newMaps.OrderBy(m => m.Content);
+ if (newMaps.Count > 0)
+ this.comboBoxMaps.SelectedIndex = 0;
+ }
+
#region background worker
private void BgWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
{
@@ -127,61 +182,6 @@ namespace Damage_Calculator
}
}
- private static string calculateMD5(string filename)
- {
- using (var md5 = System.Security.Cryptography.MD5.Create())
- {
- using (var stream = File.OpenRead(filename))
- {
- var hash = md5.ComputeHash(stream);
- return BitConverter.ToString(hash).Replace("-", "").ToLowerInvariant();
- }
- }
- }
-
- private void updateMapsWithCurrentFilter()
- {
- if (!this.IsInitialized)
- return;
-
- // Add maps
- var newMaps = new List();
-
- foreach (var mapItem in this.allMaps)
- {
- var newMap = new ComboBoxItem();
- var map = (CsgoMap)mapItem.Tag;
-
- string mapNameWithPrefix = System.IO.Path.GetFileNameWithoutExtension(map.MapImagePath).ToLower();
-
- // Filter map type
- if (mapNameWithPrefix.StartsWith("de") && mnuShowDefusalMaps.IsChecked == false)
- continue;
- if (mapNameWithPrefix.StartsWith("cs") && mnuShowHostageMaps.IsChecked == false)
- continue;
- if (mapNameWithPrefix.StartsWith("ar") && mnuShowArmsRaceMaps.IsChecked == false)
- continue;
- if (mapNameWithPrefix.StartsWith("dz") && mnuShowDangerZoneMaps.IsChecked == false)
- continue;
-
- // Filter file existence
- if (map.BspFilePath == null && mnuShowMapsMissingBsp.IsChecked == false)
- continue;
- if (map.NavFilePath == null && mnuShowMapsMissingNav.IsChecked == false)
- continue;
- if (map.AinFilePath == null && mnuShowMapsMissingAin.IsChecked == false)
- continue;
-
- newMap.Tag = map;
- newMap.Content = map.MapFileName;
- newMaps.Add(newMap);
- }
-
- this.comboBoxMaps.ItemsSource = newMaps.OrderBy(m => m.Content);
- if (newMaps.Count > 0)
- this.comboBoxMaps.SelectedIndex = 0;
- }
-
private void BgWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
{
this.gridLoading.Visibility = Visibility.Collapsed;
@@ -189,13 +189,13 @@ namespace Damage_Calculator
private void BgWorker_DoWork(object sender, DoWorkEventArgs e)
{
- var maps = Globals.Settings.CsgoHelper.GetMaps();
+ var maps = Shared.Globals.Settings.CsgoHelper.GetMaps();
bgWorker.ReportProgress(0, maps);
var serializer = new XmlSerializer(typeof(List));
List weapons;
- string itemsFile = System.IO.Path.Combine(Globals.Settings.CsgoHelper.CsgoPath, "csgo\\scripts\\items\\items_game.txt");
+ string itemsFile = System.IO.Path.Combine(Shared.Globals.Settings.CsgoHelper.CsgoPath, "csgo\\scripts\\items\\items_game.txt");
string saveFileDir = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "CSGO Damage Calculator");
string currentHash = calculateMD5(itemsFile);
@@ -234,7 +234,7 @@ namespace Damage_Calculator
Directory.CreateDirectory(saveFileDir);
}
- weapons = Globals.Settings.CsgoHelper.GetWeapons();
+ weapons = Shared.Globals.Settings.CsgoHelper.GetWeapons();
serializer.Serialize(new FileStream(System.IO.Path.Combine(saveFileDir, currentHash), FileMode.Create), weapons);
bgWorker.ReportProgress(1, weapons);
}
@@ -302,7 +302,7 @@ namespace Damage_Calculator
private void parseBspData(CsgoMap map)
{
- map.EntityList = Globals.Settings.CsgoHelper.ReadEntityListFromBsp(map.BspFilePath);
+ map.EntityList = Shared.Globals.Settings.CsgoHelper.ReadEntityListFromBsp(map.BspFilePath);
// Current format for one entity is:
//
@@ -409,7 +409,7 @@ namespace Damage_Calculator
if (map.NavFilePath == null || map.AinFilePath == null)
{
// If either no NAV or no AIN file has been found, try to update them via the BSP pakfile
- var navFilesFound = Globals.Settings.CsgoHelper.ReadIfPackedNavFilesInBsp(map.BspFilePath);
+ var navFilesFound = Shared.Globals.Settings.CsgoHelper.ReadIfPackedNavFilesInBsp(map.BspFilePath);
if (navFilesFound.Item1)
{
map.NavFileBspPacked = true;
diff --git a/DamageCalculator/DamageCalculator/packages.config b/DamageCalculator/DamageCalculator/packages.config
deleted file mode 100644
index 98a8b3b..0000000
--- a/DamageCalculator/DamageCalculator/packages.config
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
\ No newline at end of file
diff --git a/Shared/SteamHelpers/SteamHelpers.sln b/Shared/SteamHelpers/SteamHelpers.sln
new file mode 100644
index 0000000..b81ee37
--- /dev/null
+++ b/Shared/SteamHelpers/SteamHelpers.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.1.32228.430
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SteamHelpers", "SteamHelpers\SteamHelpers.csproj", "{BC940FCA-87A6-41DB-A428-795B33268A22}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {BC940FCA-87A6-41DB-A428-795B33268A22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BC940FCA-87A6-41DB-A428-795B33268A22}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BC940FCA-87A6-41DB-A428-795B33268A22}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BC940FCA-87A6-41DB-A428-795B33268A22}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {01A0479A-7ED4-455D-B23C-C13589DC6D50}
+ EndGlobalSection
+EndGlobal
diff --git a/DamageCalculator/DamageCalculator/CsgoHelper.cs b/Shared/SteamHelpers/SteamHelpers/CsgoHelper.cs
similarity index 91%
rename from DamageCalculator/DamageCalculator/CsgoHelper.cs
rename to Shared/SteamHelpers/SteamHelpers/CsgoHelper.cs
index 2753ce4..efc1161 100644
--- a/DamageCalculator/DamageCalculator/CsgoHelper.cs
+++ b/Shared/SteamHelpers/SteamHelpers/CsgoHelper.cs
@@ -1,5 +1,5 @@
-using Damage_Calculator.Models;
-using Damage_Calculator.ZatVdfParser;
+using Shared.Models;
+using Shared.ZatVdfParser;
using System;
using System.Collections.Generic;
using System.Globalization;
@@ -9,11 +9,11 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace Damage_Calculator
+namespace Shared
{
public class CsgoHelper
{
- public string CsgoPath { get; set; }
+ public string? CsgoPath { get; set; }
///
/// Gets the prefixes allowed for maps when using .
@@ -58,7 +58,7 @@ namespace Damage_Calculator
/// whether the files and directories exist.
public bool Validate()
{
- return this.Validate(this.CsgoPath);
+ return this.Validate(this.CsgoPath!);
}
@@ -86,7 +86,7 @@ namespace Damage_Calculator
public List GetMaps()
{
- List mapTextFiles = Directory.GetFiles(System.IO.Path.Combine(this.CsgoPath, "csgo\\resource\\overviews")).ToList().Where(f => f.ToLower().EndsWith(".txt")).Where(f =>
+ List mapTextFiles = Directory.GetFiles(System.IO.Path.Combine(this.CsgoPath!, "csgo\\resource\\overviews")).ToList().Where(f => f.ToLower().EndsWith(".txt")).Where(f =>
this.mapFileNameValid(f)).ToList();
List maps = new List();
@@ -96,28 +96,28 @@ namespace Damage_Calculator
var map = new CsgoMap();
// Save path to radar file if available
- string potentialRadarFile = System.IO.Path.Combine(this.CsgoPath, "csgo\\resource\\overviews", System.IO.Path.GetFileNameWithoutExtension(file) + "_radar.dds");
+ string potentialRadarFile = System.IO.Path.Combine(this.CsgoPath!, "csgo\\resource\\overviews", System.IO.Path.GetFileNameWithoutExtension(file) + "_radar.dds");
if (File.Exists(potentialRadarFile))
{
map.MapImagePath = potentialRadarFile;
}
// Save path to BSP file if available
- string potentialBspFile = System.IO.Path.Combine(this.CsgoPath, "csgo\\maps", System.IO.Path.GetFileNameWithoutExtension(file) + ".bsp");
+ string potentialBspFile = System.IO.Path.Combine(this.CsgoPath!, "csgo\\maps", System.IO.Path.GetFileNameWithoutExtension(file) + ".bsp");
if (File.Exists(potentialBspFile))
{
map.BspFilePath = potentialBspFile;
}
// Save path to NAV file if available
- string potentialNavFile = System.IO.Path.Combine(this.CsgoPath, "csgo\\maps", System.IO.Path.GetFileNameWithoutExtension(file) + ".nav");
+ string potentialNavFile = System.IO.Path.Combine(this.CsgoPath!, "csgo\\maps", System.IO.Path.GetFileNameWithoutExtension(file) + ".nav");
if (File.Exists(potentialNavFile))
{
map.NavFilePath = potentialNavFile;
}
// Save path to AIN file if available
- string potentialAinFile = System.IO.Path.Combine(this.CsgoPath, "csgo\\maps\\graphs", System.IO.Path.GetFileNameWithoutExtension(file) + ".ain");
+ string potentialAinFile = System.IO.Path.Combine(this.CsgoPath!, "csgo\\maps\\graphs", System.IO.Path.GetFileNameWithoutExtension(file) + ".ain");
if (File.Exists(potentialAinFile))
{
map.AinFilePath = potentialAinFile;
@@ -201,7 +201,7 @@ namespace Damage_Calculator
try
{
// Read actual radar
- image = new DDSImage(System.IO.File.ReadAllBytes(map.MapImagePath));
+ image = new DDSImage(System.IO.File.ReadAllBytes(map.MapImagePath!));
}
catch
{
@@ -226,25 +226,25 @@ namespace Damage_Calculator
public List GetWeapons()
{
- string filePath = Path.Combine(this.CsgoPath, "csgo\\scripts\\items\\items_game.txt");
+ string filePath = Path.Combine(this.CsgoPath!, "csgo\\scripts\\items\\items_game.txt");
if (!File.Exists(filePath))
- return null;
+ return null!;
var vdfItems = new VDFFile(filePath);
- Element prefabs = vdfItems["items_game"]?["prefabs"];
- Element items = vdfItems["items_game"]?["items"];
+ Element prefabs = vdfItems["items_game"]?["prefabs"]!;
+ Element items = vdfItems["items_game"]?["items"]!;
if (prefabs == null || items == null)
- return null;
+ return null!;
var weapons = new List();
foreach(var item in items.Children)
{
- string itemPrefab = item["prefab"]?.Value;
- string itemName = item["name"].Value;
+ string? itemPrefab = item["prefab"]?.Value!;
+ string? itemName = item["name"].Value;
- if (itemPrefab == null || !itemName.StartsWith("weapon_"))
+ if (itemPrefab == null || !itemName!.StartsWith("weapon_"))
continue;
var weapon = new CsgoWeapon();
@@ -259,7 +259,7 @@ namespace Damage_Calculator
return weapons;
}
- private bool tryPopulateWeapon(CsgoWeapon weapon, Element prefabs, string prefabName, List prefabTrace = null)
+ private bool tryPopulateWeapon(CsgoWeapon weapon, Element prefabs, string prefabName, List? prefabTrace = null)
{
Element prefab = prefabs[prefabName];
@@ -267,7 +267,7 @@ namespace Damage_Calculator
// Prefab not existent (example was prefab named "valve csgo_tool")
return false;
- string nextPrefab = prefab["prefab"]?.Value;
+ string nextPrefab = prefab["prefab"]?.Value!;
if (prefab == null || (nextPrefab == null && prefabTrace?.FirstOrDefault(pr => pr == "primary" || pr == "secondary") == null))
// We've reached the end of abstraction but it wasn't found to be primary nor secondary
@@ -285,7 +285,7 @@ namespace Damage_Calculator
// Base damage
if (weapon.BaseDamage == -1)
{
- string damage = attributes["damage"]?.Value;
+ string damage = attributes["damage"]?.Value!;
if (damage != null)
{
// damage field exists
@@ -301,7 +301,7 @@ namespace Damage_Calculator
// Armor penetration
if (weapon.ArmorPenetration == -1)
{
- string penetration = attributes["armor ratio"]?.Value;
+ string penetration = attributes["armor ratio"]?.Value!;
if (penetration != null)
{
// Armor penetration field exists
@@ -317,7 +317,7 @@ namespace Damage_Calculator
// Damage dropoff
if (weapon.DamageDropoff == -1)
{
- string dropoff = attributes["range modifier"]?.Value;
+ string dropoff = attributes["range modifier"]?.Value!;
if (dropoff != null)
{
// Damage dropoff field exists
@@ -333,7 +333,7 @@ namespace Damage_Calculator
// Max range
if (weapon.MaxBulletRange == -1)
{
- string maxrange = attributes["range"]?.Value;
+ string maxrange = attributes["range"]?.Value!;
if (maxrange != null)
{
// Max range field exists
@@ -349,7 +349,7 @@ namespace Damage_Calculator
// Headshot modifier
if (weapon.HeadshotModifier == -1)
{
- string headshotModifier = attributes["headshot multiplier"]?.Value;
+ string headshotModifier = attributes["headshot multiplier"]?.Value!;
if (headshotModifier != null)
{
// Headshot modifier field exists
@@ -370,7 +370,7 @@ namespace Damage_Calculator
if (prefabTrace == null)
prefabTrace = new List();
- prefabTrace.Add(prefab.Name);
+ prefabTrace.Add(prefab.Name!);
return this.tryPopulateWeapon(weapon, prefabs, nextPrefab, prefabTrace);
}
@@ -414,7 +414,7 @@ namespace Damage_Calculator
}
}
}
- return null;
+ return null!;
}
///
@@ -426,7 +426,7 @@ namespace Damage_Calculator
{
bool navFound = false;
bool ainFound = false;
- byte[] readZipBytes = null;
+ byte[] readZipBytes = null!;
using (var bspFile = File.OpenRead(bspFilePath))
{
diff --git a/DamageCalculator/DamageCalculator/DDSImageParser.cs b/Shared/SteamHelpers/SteamHelpers/DDSImageParser.cs
similarity index 99%
rename from DamageCalculator/DamageCalculator/DDSImageParser.cs
rename to Shared/SteamHelpers/SteamHelpers/DDSImageParser.cs
index cc172f2..3e10087 100644
--- a/DamageCalculator/DamageCalculator/DDSImageParser.cs
+++ b/Shared/SteamHelpers/SteamHelpers/DDSImageParser.cs
@@ -5,14 +5,14 @@ using System.Drawing.Imaging;
using System.Runtime.InteropServices;
using System.IO;
-namespace Damage_Calculator
+namespace Shared
{
#region DDSImage Class
public class DDSImage : IDisposable
{
#region Variables
private bool m_isValid = false;
- private System.Drawing.Bitmap m_bitmap = null;
+ private System.Drawing.Bitmap? m_bitmap = null;
#endregion
#region Constructor/Destructor
@@ -58,7 +58,7 @@ namespace Damage_Calculator
{
DDSStruct header = new DDSStruct();
PixelFormat pixelFormat = PixelFormat.UNKNOWN;
- byte[] data = null;
+ byte[]? data = null;
if (this.ReadHeader(reader, ref header))
{
@@ -84,7 +84,7 @@ namespace Damage_Calculator
private byte[] ReadData(BinaryReader reader, DDSStruct header)
{
- byte[] compdata = null;
+ byte[]? compdata = null;
uint compsize = 0;
if ((header.flags & DDSD_LINEARSIZE) > 1)
@@ -620,7 +620,7 @@ namespace Damage_Calculator
{
System.Diagnostics.Debug.WriteLine(pixelFormat);
// allocate bitmap
- byte[] rawData = null;
+ byte[]? rawData = null;
switch (pixelFormat)
{
@@ -1767,7 +1767,7 @@ namespace Damage_Calculator
///
public System.Drawing.Bitmap BitmapImage
{
- get { return this.m_bitmap; }
+ get { return this.m_bitmap!; }
}
///
diff --git a/DamageCalculator/DamageCalculator/Globals.cs b/Shared/SteamHelpers/SteamHelpers/Globals.cs
similarity index 93%
rename from DamageCalculator/DamageCalculator/Globals.cs
rename to Shared/SteamHelpers/SteamHelpers/Globals.cs
index 6a32d3c..451a087 100644
--- a/DamageCalculator/DamageCalculator/Globals.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Globals.cs
@@ -7,9 +7,9 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
-namespace Damage_Calculator
+namespace Shared
{
- static class Globals
+ public static class Globals
{
public static Models.Settings Settings = new Models.Settings();
@@ -37,7 +37,7 @@ namespace Damage_Calculator
{
fixed (byte* p = &data[0]) // Fixed so GC doesn't move shit, point to the first element
{
- return (T)System.Runtime.InteropServices.Marshal.PtrToStructure(new IntPtr(p), typeof(T));
+ return (T)System.Runtime.InteropServices.Marshal.PtrToStructure(new IntPtr(p), typeof(T))!;
}
}
}
diff --git a/DamageCalculator/DamageCalculator/Models/BSPHeader.cs b/Shared/SteamHelpers/SteamHelpers/Models/BSPHeader.cs
similarity index 96%
rename from DamageCalculator/DamageCalculator/Models/BSPHeader.cs
rename to Shared/SteamHelpers/SteamHelpers/Models/BSPHeader.cs
index 5013e75..86a7d93 100644
--- a/DamageCalculator/DamageCalculator/Models/BSPHeader.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Models/BSPHeader.cs
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace Damage_Calculator.Models
+namespace Shared.Models
{
internal class BSPHeader
{
diff --git a/DamageCalculator/DamageCalculator/Models/BSPLump.cs b/Shared/SteamHelpers/SteamHelpers/Models/BSPLump.cs
similarity index 96%
rename from DamageCalculator/DamageCalculator/Models/BSPLump.cs
rename to Shared/SteamHelpers/SteamHelpers/Models/BSPLump.cs
index 15372c2..40fc2db 100644
--- a/DamageCalculator/DamageCalculator/Models/BSPLump.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Models/BSPLump.cs
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace Damage_Calculator.Models
+namespace Shared.Models
{
internal class BSPLump
{
diff --git a/DamageCalculator/DamageCalculator/Models/CsgoMap.cs b/Shared/SteamHelpers/SteamHelpers/Models/CsgoMap.cs
similarity index 94%
rename from DamageCalculator/DamageCalculator/Models/CsgoMap.cs
rename to Shared/SteamHelpers/SteamHelpers/Models/CsgoMap.cs
index 7bf41ed..0d4ae79 100644
--- a/DamageCalculator/DamageCalculator/Models/CsgoMap.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Models/CsgoMap.cs
@@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
-namespace Damage_Calculator.Models
+namespace Shared.Models
{
public class CsgoMap
{
@@ -18,7 +18,7 @@ namespace Damage_Calculator.Models
///
/// The actual radar image of the map.
///
- public BitmapSource MapImage { get; set; }
+ public BitmapSource? MapImage { get; set; }
///
/// The type of gamemode that's played on this map by default.
@@ -28,19 +28,19 @@ namespace Damage_Calculator.Models
///
/// The absolute path to the DDS map radar file.
///
- public string MapImagePath { get; set; }
+ public string? MapImagePath { get; set; }
///
/// The absolute path to the actual BSP map file.
///
- public string BspFilePath { get; set; }
+ public string? BspFilePath { get; set; }
///
/// The absolute path to the file that holds this map's navigation meshes and callouts.
/// This might not always be existent, because it is generated by the map builder, but can be packed inside the BSP. In that case its value is "PACKED".
/// It is always created with maps that are in the main game, because they need callouts and bot movements.
///
- public string NavFilePath { get; set; }
+ public string? NavFilePath { get; set; }
///
/// Indicates whether the NAV file was packed inside of the BSP PAKFILE lump.
@@ -52,7 +52,7 @@ namespace Damage_Calculator.Models
/// This might not always be existent, because it is generated by the map builder, but can be packed inside the BSP. In that case its value is "PACKED".
/// It *might* always be created with maps that are in the main game.
///
- public string AinFilePath { get; set; }
+ public string? AinFilePath { get; set; }
///
/// Indicates whether the AIN file was packed inside of the BSP PAKFILE lump.
@@ -62,7 +62,7 @@ namespace Damage_Calculator.Models
///
/// The map name as given in the file name, but without the prefix.
///
- public string MapFileName { get; set; }
+ public string? MapFileName { get; set; }
///
/// The multiplier that is stored in the text file with each map.
@@ -138,7 +138,7 @@ namespace Damage_Calculator.Models
///
/// Raw list of entities in this map, as stored in the BSP file.
///
- public string EntityList { get; set; }
+ public string? EntityList { get; set; }
public int AmountPrioritySpawnsCT { get; set; }
diff --git a/DamageCalculator/DamageCalculator/Models/CsgoWeapon.cs b/Shared/SteamHelpers/SteamHelpers/Models/CsgoWeapon.cs
similarity index 95%
rename from DamageCalculator/DamageCalculator/Models/CsgoWeapon.cs
rename to Shared/SteamHelpers/SteamHelpers/Models/CsgoWeapon.cs
index 51df07b..1bde349 100644
--- a/DamageCalculator/DamageCalculator/Models/CsgoWeapon.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Models/CsgoWeapon.cs
@@ -6,7 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;
-namespace Damage_Calculator.Models
+namespace Shared.Models
{
public class CsgoWeapon
{
@@ -14,7 +14,7 @@ namespace Damage_Calculator.Models
/// Gets or sets the class name of this weapon.
/// e.g. AK47 would be "weapon_ak47"
///
- public string ClassName { get; set; }
+ public string? ClassName { get; set; }
///
/// Gets or sets the base damage that the weapon deals, in health points.
diff --git a/DamageCalculator/DamageCalculator/Models/MapPoint.cs b/Shared/SteamHelpers/SteamHelpers/Models/MapPoint.cs
similarity index 70%
rename from DamageCalculator/DamageCalculator/Models/MapPoint.cs
rename to Shared/SteamHelpers/SteamHelpers/Models/MapPoint.cs
index e5f1a78..66ac4c0 100644
--- a/DamageCalculator/DamageCalculator/Models/MapPoint.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Models/MapPoint.cs
@@ -4,11 +4,11 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace Damage_Calculator.Models
+namespace Shared.Models
{
- class MapPoint
+ public class MapPoint
{
- public System.Windows.Shapes.Ellipse Circle { get; set; }
+ public System.Windows.Shapes.Ellipse? Circle { get; set; }
public double PercentageX { get; set; }
diff --git a/DamageCalculator/DamageCalculator/Models/PlayerSpawn.cs b/Shared/SteamHelpers/SteamHelpers/Models/PlayerSpawn.cs
similarity index 91%
rename from DamageCalculator/DamageCalculator/Models/PlayerSpawn.cs
rename to Shared/SteamHelpers/SteamHelpers/Models/PlayerSpawn.cs
index a052727..2604696 100644
--- a/DamageCalculator/DamageCalculator/Models/PlayerSpawn.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Models/PlayerSpawn.cs
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace Damage_Calculator.Models
+namespace Shared.Models
{
public class PlayerSpawn
{
@@ -21,13 +21,13 @@ namespace Damage_Calculator.Models
///
/// The world position of the player spawn.
///
- public Vector3 Origin { get; set; }
+ public Vector3? Origin { get; set; }
///
/// The rotation of the player spawn.
/// Y is used most here, 0 is East, goes to 360 clockwise.
///
- public Vector3 Angles { get; set; }
+ public Vector3? Angles { get; set; }
///
/// The type of spawn (standard, 2v2, hostage, ...)
diff --git a/DamageCalculator/DamageCalculator/Models/Settings.cs b/Shared/SteamHelpers/SteamHelpers/Models/Settings.cs
similarity index 88%
rename from DamageCalculator/DamageCalculator/Models/Settings.cs
rename to Shared/SteamHelpers/SteamHelpers/Models/Settings.cs
index bf4f887..518d32f 100644
--- a/DamageCalculator/DamageCalculator/Models/Settings.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Models/Settings.cs
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace Damage_Calculator.Models
+namespace Shared.Models
{
public class Settings
{
diff --git a/DamageCalculator/DamageCalculator/Models/SteamGame.cs b/Shared/SteamHelpers/SteamHelpers/Models/SteamGame.cs
similarity index 91%
rename from DamageCalculator/DamageCalculator/Models/SteamGame.cs
rename to Shared/SteamHelpers/SteamHelpers/Models/SteamGame.cs
index e22c640..3e59471 100644
--- a/DamageCalculator/DamageCalculator/Models/SteamGame.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Models/SteamGame.cs
@@ -4,13 +4,13 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace Damage_Calculator.Models
+namespace Shared.Models
{
public class SteamGame
{
- public string Name { get; set; }
+ public string? Name { get; set; }
- public string InstallFolderName { get; set; }
+ public string? InstallFolderName { get; set; }
public int AppId { get; set; }
diff --git a/DamageCalculator/DamageCalculator/Models/SteamLibrary.cs b/Shared/SteamHelpers/SteamHelpers/Models/SteamLibrary.cs
similarity index 88%
rename from DamageCalculator/DamageCalculator/Models/SteamLibrary.cs
rename to Shared/SteamHelpers/SteamHelpers/Models/SteamLibrary.cs
index 91d8733..fc69adb 100644
--- a/DamageCalculator/DamageCalculator/Models/SteamLibrary.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Models/SteamLibrary.cs
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace Damage_Calculator.Models
+namespace Shared.Models
{
public class SteamLibrary
{
@@ -25,7 +25,7 @@ namespace Damage_Calculator.Models
this.DoesExist = doesExist;
}
- public string Path { get; set; }
+ public string? Path { get; set; }
public bool DoesExist { get; set; }
}
diff --git a/DamageCalculator/DamageCalculator/Models/Vector3.cs b/Shared/SteamHelpers/SteamHelpers/Models/Vector3.cs
similarity index 90%
rename from DamageCalculator/DamageCalculator/Models/Vector3.cs
rename to Shared/SteamHelpers/SteamHelpers/Models/Vector3.cs
index d0599db..0473206 100644
--- a/DamageCalculator/DamageCalculator/Models/Vector3.cs
+++ b/Shared/SteamHelpers/SteamHelpers/Models/Vector3.cs
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
-namespace Damage_Calculator.Models
+namespace Shared.Models
{
public class Vector3
{
diff --git a/DamageCalculator/DamageCalculator/SteamHelper.cs b/Shared/SteamHelpers/SteamHelpers/SteamHelper.cs
similarity index 87%
rename from DamageCalculator/DamageCalculator/SteamHelper.cs
rename to Shared/SteamHelpers/SteamHelpers/SteamHelper.cs
index f1937e9..52a608f 100644
--- a/DamageCalculator/DamageCalculator/SteamHelper.cs
+++ b/Shared/SteamHelpers/SteamHelpers/SteamHelper.cs
@@ -4,22 +4,22 @@ using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
-using Damage_Calculator.ZatVdfParser;
+using Shared.ZatVdfParser;
using Microsoft.Win32;
-using Damage_Calculator.Models;
+using Shared.Models;
-namespace Damage_Calculator
+namespace Shared
{
public class SteamHelper
{
- private string steamPath;
- private List steamLibraries;
+ private string? steamPath;
+ private List? steamLibraries;
///
/// Gets the absolute path to the Steam install directory.
/// If it can't be fetched (i.e. Steam is not installed) null is returned.
///
- public string SteamPath
+ public string? SteamPath
{
get
{
@@ -35,7 +35,7 @@ namespace Damage_Calculator
/// Gets a list of all Steam libraries, and whether they're existent or not.
/// If it can't be fetched (i.e. Steam is not installed) null is returned.
///
- public List SteamLibraries
+ public List? SteamLibraries
{
get
{
@@ -59,7 +59,7 @@ namespace Damage_Calculator
/// Gets the path to the Steam install directory. (For external use is preferred.)
///
/// The absolute path to the Steam install directory, or null if it can't be fetched.
- public string GetSteamPath()
+ public string? GetSteamPath()
{
var steamKey = Registry.CurrentUser.OpenSubKey("software\\valve\\steam");
@@ -86,7 +86,7 @@ namespace Damage_Calculator
/// Fetches a list of Steam libraries, which are deposited in the Steam config, as well as whether the libraries exist on the drive.
///
/// A list of all deposited Steam libraries, and if they exist.
- public List GetSteamLibraries()
+ public List? GetSteamLibraries()
{
if (this.steamPath == null)
this.steamPath = this.GetSteamPath();
@@ -100,11 +100,11 @@ namespace Damage_Calculator
// Fetch additional libraries
var configFile = new VDFFile(configFilePath);
- IEnumerable additionalSteamLibraries = configFile["InstallConfigStore"]?["Software"]?["valve"]?["Steam"].Children.Where(c => c.Name.StartsWith("BaseInstallFolder_")).Select(c => c.Value);
+ IEnumerable? additionalSteamLibraries = configFile["InstallConfigStore"]?["Software"]?["valve"]?["Steam"].Children.Where(c => c.Name!.StartsWith("BaseInstallFolder_")).Select(c => c.Value)!;
// List libraries plus default Steam directory, because that's the default library
var allLibraries = new List { new SteamLibrary(this.steamPath) };
- foreach(string addLib in additionalSteamLibraries)
+ foreach(string addLib in additionalSteamLibraries!)
{
allLibraries.Add(new SteamLibrary(addLib.Replace("\\\\", "\\")));
}
@@ -112,7 +112,7 @@ namespace Damage_Calculator
return allLibraries;
}
- public List GetInstalledGames()
+ public List? GetInstalledGames()
{
var steamLibraries = this.GetSteamLibraries();
@@ -126,7 +126,7 @@ namespace Damage_Calculator
if (!library.DoesExist)
continue;
- List manifestFiles = Directory.GetFiles(Path.Combine(library.Path, "steamapps")).ToList().Where(f => this.isAppManifestFile(f)).ToList();
+ List manifestFiles = Directory.GetFiles(Path.Combine(library.Path!, "steamapps")).ToList().Where(f => this.isAppManifestFile(f)).ToList();
foreach (string manifestFile in manifestFiles)
{
@@ -140,7 +140,7 @@ namespace Damage_Calculator
var currGame = new SteamGame();
- this.populateGameInfo(currGame, root);
+ this.populateGameInfo(currGame, root!);
if((currGame.GameState & (int)GameState.StateFullyInstalled) != 0)
{
@@ -153,7 +153,7 @@ namespace Damage_Calculator
return allGames;
}
- public string GetGamePathFromExactName(string gameName)
+ public string? GetGamePathFromExactName(string gameName)
{
var steamLibraries = this.GetSteamLibraries();
@@ -167,7 +167,7 @@ namespace Damage_Calculator
if (!library.DoesExist)
continue;
- List manifestFiles = Directory.GetFiles(Path.Combine(library.Path, "steamapps")).ToList().Where(f => this.isAppManifestFile(f)).ToList();
+ List manifestFiles = Directory.GetFiles(Path.Combine(library.Path!, "steamapps")).ToList().Where(f => this.isAppManifestFile(f)).ToList();
foreach (string manifestFile in manifestFiles)
{
@@ -179,7 +179,7 @@ namespace Damage_Calculator
var root = manifestVDF["AppState"];
- if(root["name"].Value.Trim().ToLower() != gameName.Trim().ToLower())
+ if(root!["name"].Value!.Trim().ToLower() != gameName.Trim().ToLower())
{
// Not our wanted game, skip
continue;
@@ -192,7 +192,7 @@ namespace Damage_Calculator
if ((currGame.GameState & (int)GameState.StateFullyInstalled) != 0)
{
// Game was fully installed according to steam
- return Path.Combine(library.Path, "steamapps", "common", currGame.InstallFolderName);
+ return Path.Combine(library.Path!, "steamapps", "common", currGame.InstallFolderName!);
}
}
}
diff --git a/Shared/SteamHelpers/SteamHelpers/SteamHelpers.csproj b/Shared/SteamHelpers/SteamHelpers/SteamHelpers.csproj
new file mode 100644
index 0000000..3419fff
--- /dev/null
+++ b/Shared/SteamHelpers/SteamHelpers/SteamHelpers.csproj
@@ -0,0 +1,16 @@
+
+
+
+ net6.0-windows
+ enable
+ true
+ True
+
+
+
+
+
+
+
+
+
diff --git a/DamageCalculator/DamageCalculator/ZatVdfParser/BackupVdfReader.cs b/Shared/SteamHelpers/SteamHelpers/ZatVdfParser/BackupVdfReader.cs
similarity index 99%
rename from DamageCalculator/DamageCalculator/ZatVdfParser/BackupVdfReader.cs
rename to Shared/SteamHelpers/SteamHelpers/ZatVdfParser/BackupVdfReader.cs
index 37f04ea..5ce8e8e 100644
--- a/DamageCalculator/DamageCalculator/ZatVdfParser/BackupVdfReader.cs
+++ b/Shared/SteamHelpers/SteamHelpers/ZatVdfParser/BackupVdfReader.cs
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.IO;
-namespace Damage_Calculator.ZatVdfParser
+namespace Shared.ZatVdfParser
{
///
/// This class was copied from here as a backup, in case didn't work well enough.
diff --git a/DamageCalculator/DamageCalculator/ZatVdfParser/Element.cs b/Shared/SteamHelpers/SteamHelpers/ZatVdfParser/Element.cs
similarity index 93%
rename from DamageCalculator/DamageCalculator/ZatVdfParser/Element.cs
rename to Shared/SteamHelpers/SteamHelpers/ZatVdfParser/Element.cs
index 0bd9fc2..cf179cb 100644
--- a/DamageCalculator/DamageCalculator/ZatVdfParser/Element.cs
+++ b/Shared/SteamHelpers/SteamHelpers/ZatVdfParser/Element.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
-namespace Damage_Calculator.ZatVdfParser
+namespace Shared.ZatVdfParser
{
public class Element
{
@@ -13,9 +13,9 @@ namespace Damage_Calculator.ZatVdfParser
#region PROPERTIES
public List Children { get; set; }
- public Element Parent { get; set; }
- public string Value { get; set; }
- public string Name { get; set; }
+ public Element? Parent { get; set; }
+ public string? Value { get; set; }
+ public string? Name { get; set; }
#endregion
#region CONSTRUCTOR
@@ -38,7 +38,7 @@ namespace Damage_Calculator.ZatVdfParser
{
get
{
- return Children.FirstOrDefault(x => x.Name == key);
+ return Children.FirstOrDefault(x => x.Name == key)!;
}
}
#endregion
diff --git a/DamageCalculator/DamageCalculator/ZatVdfParser/VdfFile.cs b/Shared/SteamHelpers/SteamHelpers/ZatVdfParser/VdfFile.cs
similarity index 94%
rename from DamageCalculator/DamageCalculator/ZatVdfParser/VdfFile.cs
rename to Shared/SteamHelpers/SteamHelpers/ZatVdfParser/VdfFile.cs
index 04bda32..87e567b 100644
--- a/DamageCalculator/DamageCalculator/ZatVdfParser/VdfFile.cs
+++ b/Shared/SteamHelpers/SteamHelpers/ZatVdfParser/VdfFile.cs
@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
-namespace Damage_Calculator.ZatVdfParser
+namespace Shared.ZatVdfParser
{
public class VDFFile
{
@@ -41,7 +41,7 @@ namespace Damage_Calculator.ZatVdfParser
}
private void Parse(string filePathOrText, bool parseTextDirectly)
{
- Element currentLevel = null;
+ Element? currentLevel = null;
// Generate stream from string in case we want to read it directly, instead of using a file stream (boolean parameter)
var stream = new MemoryStream();
@@ -52,7 +52,7 @@ namespace Damage_Calculator.ZatVdfParser
using (StreamReader reader = parseTextDirectly ? new StreamReader(stream) : new StreamReader(filePathOrText))
{
- string line = null;
+ string? line = null;
while ((line = reader.ReadLine()) != null)
{
if (line.StartsWith("\0"))
@@ -93,7 +93,7 @@ namespace Damage_Calculator.ZatVdfParser
}
else if (line == "}")
{
- currentLevel = currentLevel.Parent;
+ currentLevel = currentLevel!.Parent;
}
/*else if (line == "{")
{
@@ -112,7 +112,7 @@ namespace Damage_Calculator.ZatVdfParser
return RootElements[key];
}
}
- public Element this[string key]
+ public Element? this[string key]
{
get
{