Add initial Damage Printer GUI project

This commit is contained in:
MathiasL 2022-05-24 23:41:18 +02:00
parent ab8625cb9c
commit 4a15f59298
16 changed files with 18258 additions and 0 deletions

View file

@ -9,6 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SteamShared", "..\SteamShar
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoreSoft.MathExpressions", "..\SteamShared\LoreSoft.MathExpressions\LoreSoft.MathExpressions.csproj", "{B6813448-FCE2-429C-81B5-9722FEA839B8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DamagePrinterGUI", "DamagePrinterGUI\DamagePrinterGUI.csproj", "{657571D7-CFCC-4773-BA52-191A46687DD0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -55,6 +57,18 @@ Global
{B6813448-FCE2-429C-81B5-9722FEA839B8}.Release|x64.Build.0 = Release|x64
{B6813448-FCE2-429C-81B5-9722FEA839B8}.Release|x86.ActiveCfg = Release|x86
{B6813448-FCE2-429C-81B5-9722FEA839B8}.Release|x86.Build.0 = Release|x86
{657571D7-CFCC-4773-BA52-191A46687DD0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{657571D7-CFCC-4773-BA52-191A46687DD0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{657571D7-CFCC-4773-BA52-191A46687DD0}.Debug|x64.ActiveCfg = Debug|Any CPU
{657571D7-CFCC-4773-BA52-191A46687DD0}.Debug|x64.Build.0 = Debug|Any CPU
{657571D7-CFCC-4773-BA52-191A46687DD0}.Debug|x86.ActiveCfg = Debug|Any CPU
{657571D7-CFCC-4773-BA52-191A46687DD0}.Debug|x86.Build.0 = Debug|Any CPU
{657571D7-CFCC-4773-BA52-191A46687DD0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{657571D7-CFCC-4773-BA52-191A46687DD0}.Release|Any CPU.Build.0 = Release|Any CPU
{657571D7-CFCC-4773-BA52-191A46687DD0}.Release|x64.ActiveCfg = Release|Any CPU
{657571D7-CFCC-4773-BA52-191A46687DD0}.Release|x64.Build.0 = Release|Any CPU
{657571D7-CFCC-4773-BA52-191A46687DD0}.Release|x86.ActiveCfg = Release|Any CPU
{657571D7-CFCC-4773-BA52-191A46687DD0}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -0,0 +1,13 @@
<Application x:Class="DamagePrinterGUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:DamagePrinterGUI"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Themes/DarkTheme.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>

View file

@ -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 DamagePrinterGUI
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

View file

@ -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)
)]

View file

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Version>0.1.0</Version>
<Authors>Mathias Lui</Authors>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<SignAssembly>False</SignAssembly>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,24 @@
<Window x:Class="DamagePrinterGUI.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DamagePrinterGUI"
mc:Ignorable="d"
Title="CS:GO Damage Printer" Height="355" Width="247"
ResizeMode="NoResize"
Style="{DynamicResource CustomWindowStyle}">
<Grid Margin="10">
<StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="CS:GO window found: " />
<TextBlock x:Name="lblCsgoWindowFound" Text="No" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Console log found: " />
<TextBlock x:Name="lblConsoleLogFound" Text="No" />
</StackPanel>
<TextBlock />
</StackPanel>
</Grid>
</Window>

View file

@ -0,0 +1,28 @@
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 DamagePrinterGUI
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -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;
}
}

File diff suppressed because it is too large Load diff

View file

@ -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;
}
}

File diff suppressed because it is too large Load diff

View file

@ -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;
}
}

File diff suppressed because it is too large Load diff

View file

@ -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;
}
}

View file

@ -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 { }
}
}
}