diff --git a/CTA/CustomTeamAssigner/CustomTeamAssigner.csproj b/CTA/CustomTeamAssigner/CustomTeamAssigner.csproj
index 99376bb13..83c1116f8 100644
--- a/CTA/CustomTeamAssigner/CustomTeamAssigner.csproj
+++ b/CTA/CustomTeamAssigner/CustomTeamAssigner.csproj
@@ -17,6 +17,63 @@
Always
+
+
+ Always
+
+
+
+ Always
+
+
+
+ Always
+
+
+
+ Always
+
+
+
+ Always
+
+
+
+ Always
+
+
+
+ Always
+
+
+
+ Always
+
+
+
+ Always
+
+
+
+ Always
+
+
+
+ Always
+
+
+
+ Always
+
+
+
+ Always
+
+
+
+
+
+
diff --git a/CTA/CustomTeamAssigner/CustomTeamAssigner.sln.DotSettings b/CTA/CustomTeamAssigner/CustomTeamAssigner.sln.DotSettings
index 87a03912c..11c1f92f5 100644
--- a/CTA/CustomTeamAssigner/CustomTeamAssigner.sln.DotSettings
+++ b/CTA/CustomTeamAssigner/CustomTeamAssigner.sln.DotSettings
@@ -1,2 +1,4 @@
+ QM
+ SV
OnDebug
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/MainWindow.xaml b/CTA/CustomTeamAssigner/MainWindow.xaml
index ec9b416a0..9347f34ea 100644
--- a/CTA/CustomTeamAssigner/MainWindow.xaml
+++ b/CTA/CustomTeamAssigner/MainWindow.xaml
@@ -54,6 +54,39 @@ README file in the root directory of this source tree.
+
+
@@ -85,35 +118,57 @@ README file in the root directory of this source tree.
-
-
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
+
+
+
diff --git a/CTA/CustomTeamAssigner/MainWindow.xaml.cs b/CTA/CustomTeamAssigner/MainWindow.xaml.cs
index 2a638cdf2..df6b21511 100644
--- a/CTA/CustomTeamAssigner/MainWindow.xaml.cs
+++ b/CTA/CustomTeamAssigner/MainWindow.xaml.cs
@@ -1,6 +1,11 @@
-using Microsoft.Win32;
+using System.Diagnostics.CodeAnalysis;
+using Microsoft.Win32;
using System.IO;
using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+using SharpVectors.Converters;
+using SharpVectors.Renderers.Wpf;
/*
* Copyright (c) 2024, Gurge44
@@ -16,10 +21,100 @@ namespace CustomTeamAssigner
{
public static MainWindow Instance { get; private set; } = null!;
+ private static readonly List<(string FileName, DrawingImage Image)> SVGs = [];
+
public MainWindow()
{
InitializeComponent();
Instance = this;
+ LoadSvgImages();
+ }
+
+ void LoadSvgImages()
+ {
+ int doneIndex = 0;
+ var fileReader = new FileSvgReader(new());
+ var files = Directory.GetFiles("Resources", "*.svg");
+ files.Do(LoadImage);
+ LoadingLabel.Visibility = Visibility.Collapsed;
+ return;
+
+ void LoadImage(string file)
+ {
+ var drawing = fileReader.Read(file);
+ var image = new DrawingImage(drawing);
+ var fileName = Path.GetFileNameWithoutExtension(file);
+ SVGs.Add((fileName, image));
+
+ ApplyImage(fileName, image);
+
+ doneIndex++;
+ LoadingLabel.Content = $"Loading images.... ({doneIndex}/{files.Length})";
+ }
+ }
+
+ public static void ApplyAllImages()
+ {
+ foreach (var tuple in SVGs)
+ {
+ var fileName = tuple.FileName;
+ var image = tuple.Image;
+
+ ApplyImage(fileName, image);
+ }
+ }
+
+ [SuppressMessage("ReSharper", "ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract")]
+ private static void ApplyImage(string fileName, DrawingImage image)
+ {
+ switch (fileName)
+ {
+ case "add":
+ Instance.AddButtonImage.Source = image;
+ if (PlaySetListerPage.Instance != null) PlaySetListerPage.Instance.AddButtonImage.Source = image;
+ break;
+ case "back":
+ if (PlaySetListerPage.Instance != null) PlaySetListerPage.Instance.BackButtonImage.Source = image;
+ if (QMQuestions.Instance != null) QMQuestions.Instance.BackButtonImage.Source = image;
+ if (RichTextEditor.Instance != null) RichTextEditor.Instance.BackButtonImage.Source = image;
+ if (RoleDescFinder.Instance != null) RoleDescFinder.Instance.BackButtonImage.Source = image;
+ break;
+ case "copy":
+ if (QMQuestions.Instance != null) QMQuestions.Instance.CopyButtonImage.Source = image;
+ break;
+ case "delete":
+ if (PlaySetListerPage.Instance != null) PlaySetListerPage.Instance.DeleteButtonImage.Source = image;
+ if (TeamEditorPage.Instance != null) TeamEditorPage.Instance.DeleteButtonImage.Source = image;
+ break;
+ case "discard":
+ if (TeamEditorPage.Instance != null) TeamEditorPage.Instance.DiscardButtonImage.Source = image;
+ break;
+ case "edit":
+ if (PlaySetListerPage.Instance != null) PlaySetListerPage.Instance.EditButtonImage.Source = image;
+ break;
+ case "import":
+ Instance.ImportButtonImage.Source = image;
+ break;
+ case "new-file":
+ if (QMQuestions.Instance != null) QMQuestions.Instance.NewFileButtonImage.Source = image;
+ break;
+ case "question":
+ Instance.QuestionButtonImage.Source = image;
+ break;
+ case "save":
+ if (TeamEditorPage.Instance != null) TeamEditorPage.Instance.SaveButtonImage.Source = image;
+ break;
+ case "save-as":
+ if (PlaySetListerPage.Instance != null) PlaySetListerPage.Instance.SaveAsButtonImage.Source = image;
+ if (QMQuestions.Instance != null) QMQuestions.Instance.SaveAsButtonImage.Source = image;
+ break;
+ case "search":
+ Instance.SearchButtonImage.Source = image;
+ break;
+ case "template":
+ Instance.TemplateButtonImage.Source = image;
+ break;
+ }
}
void ImportPlaySet(object sender, RoutedEventArgs e)
@@ -37,6 +132,7 @@ namespace CustomTeamAssigner
Navigator.NavigationService.Navigate(new PlaySetListerPage());
Utils.SetMainWindowContents(Visibility.Collapsed);
+ ApplyAllImages();
}
}
@@ -45,24 +141,28 @@ namespace CustomTeamAssigner
Utils.Teams.Clear();
Navigator.NavigationService.Navigate(new PlaySetListerPage());
Utils.SetMainWindowContents(Visibility.Collapsed);
+ ApplyAllImages();
}
- void Exit(object sender, RoutedEventArgs e) => Close();
-
- private void SettingsClick(object sender, RoutedEventArgs e)
+ private void QMQuestionsClick(object sender, RoutedEventArgs e)
{
+ Utils.SetMainWindowContents(Visibility.Collapsed);
+ Navigator.NavigationService.Navigate(new QMQuestions());
+ ApplyAllImages();
}
private void OpenRoleDescFinder(object sender, RoutedEventArgs e)
{
Utils.SetMainWindowContents(Visibility.Collapsed);
Navigator.NavigationService.Navigate(new RoleDescFinder());
+ ApplyAllImages();
}
private void OpenTemplateCreator(object sender, RoutedEventArgs e)
{
Utils.SetMainWindowContents(Visibility.Collapsed);
Navigator.NavigationService.Navigate(new RichTextEditor());
+ ApplyAllImages();
}
}
}
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/PlaySetListerPage.xaml b/CTA/CustomTeamAssigner/PlaySetListerPage.xaml
index e7123f398..14376cf4b 100644
--- a/CTA/CustomTeamAssigner/PlaySetListerPage.xaml
+++ b/CTA/CustomTeamAssigner/PlaySetListerPage.xaml
@@ -11,6 +11,7 @@ README file in the root directory of this source tree.
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
mc:Ignorable="d"
d:DesignHeight="720" d:DesignWidth="1280"
Title="Play-Set Lister">
@@ -179,30 +180,50 @@ README file in the root directory of this source tree.
-
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
+
-
+
+
+
+
+
diff --git a/CTA/CustomTeamAssigner/PlaySetListerPage.xaml.cs b/CTA/CustomTeamAssigner/PlaySetListerPage.xaml.cs
index 945c314dd..237904f59 100644
--- a/CTA/CustomTeamAssigner/PlaySetListerPage.xaml.cs
+++ b/CTA/CustomTeamAssigner/PlaySetListerPage.xaml.cs
@@ -14,9 +14,12 @@ namespace CustomTeamAssigner
{
public partial class PlaySetListerPage : Page
{
+ public static PlaySetListerPage Instance { get; private set; } = null!;
+
public PlaySetListerPage()
{
InitializeComponent();
+ Instance = this;
TeamListBox.ItemsSource = Utils.Teams.Select(x => x.TeamName);
MainGrid.Visibility = Visibility.Visible;
}
@@ -31,6 +34,7 @@ namespace CustomTeamAssigner
MainWindow.Instance.Navigator.NavigationService.Navigate(new TeamEditorPage(Utils.Teams.ElementAt(TeamListBox.SelectedIndex)));
Utils.SetMainWindowContents(Visibility.Collapsed);
+ MainWindow.ApplyAllImages();
}
void DeleteTeam(object sender, RoutedEventArgs e)
@@ -52,6 +56,7 @@ namespace CustomTeamAssigner
Utils.Teams.Add(team);
MainWindow.Instance.Navigator.NavigationService.Navigate(new TeamEditorPage(team));
Utils.SetMainWindowContents(Visibility.Collapsed);
+ MainWindow.ApplyAllImages();
}
void SavePlaySet(object sender, RoutedEventArgs e)
diff --git a/CTA/CustomTeamAssigner/QMQuestions.xaml b/CTA/CustomTeamAssigner/QMQuestions.xaml
new file mode 100644
index 000000000..489d2332d
--- /dev/null
+++ b/CTA/CustomTeamAssigner/QMQuestions.xaml
@@ -0,0 +1,342 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CTA/CustomTeamAssigner/QMQuestions.xaml.cs b/CTA/CustomTeamAssigner/QMQuestions.xaml.cs
new file mode 100644
index 000000000..8bffa3330
--- /dev/null
+++ b/CTA/CustomTeamAssigner/QMQuestions.xaml.cs
@@ -0,0 +1,39 @@
+using System.Windows;
+using System.Windows.Controls;
+
+namespace CustomTeamAssigner
+{
+ public partial class QMQuestions : Page
+ {
+ public static QMQuestions Instance { get; private set; } = null!;
+
+ public QMQuestions()
+ {
+ InitializeComponent();
+ }
+
+ private void SaveToNewFile(object sender, RoutedEventArgs e)
+ {
+ var sfd = new Microsoft.Win32.SaveFileDialog
+ {
+ Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*",
+ FilterIndex = 1,
+ RestoreDirectory = true
+ };
+
+ if (sfd.ShowDialog() == true)
+ {
+ System.IO.File.WriteAllText(sfd.FileName, OutputTextBox.Text);
+ }
+ }
+
+ private void TextBoxTextChanged(object sender, TextChangedEventArgs e) => UpdateOutput();
+ private void ComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e) => UpdateOutput();
+
+ void UpdateOutput()
+ {
+ if (QuestionTextBox == null || Answer1TextBox == null || Answer2TextBox == null || Answer3TextBox == null || CorrectAnswerComboBox == null) return;
+ OutputTextBox.Text = string.Join(';', QuestionTextBox.Text, Answer1TextBox.Text, Answer2TextBox.Text, Answer3TextBox.Text, CorrectAnswerComboBox.SelectedIndex.ToString());
+ }
+ }
+}
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/add.svg b/CTA/CustomTeamAssigner/Resources/add.svg
new file mode 100644
index 000000000..c7dea01fb
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/add.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/back.svg b/CTA/CustomTeamAssigner/Resources/back.svg
new file mode 100644
index 000000000..d84b2de89
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/back.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/copy.svg b/CTA/CustomTeamAssigner/Resources/copy.svg
new file mode 100644
index 000000000..c18627fa1
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/copy.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/delete.svg b/CTA/CustomTeamAssigner/Resources/delete.svg
new file mode 100644
index 000000000..05f7ed3ca
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/delete.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/discard.svg b/CTA/CustomTeamAssigner/Resources/discard.svg
new file mode 100644
index 000000000..a124e24fc
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/discard.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/edit.svg b/CTA/CustomTeamAssigner/Resources/edit.svg
new file mode 100644
index 000000000..be4cbddcf
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/edit.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/import.svg b/CTA/CustomTeamAssigner/Resources/import.svg
new file mode 100644
index 000000000..788bb3289
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/import.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/new-file.svg b/CTA/CustomTeamAssigner/Resources/new-file.svg
new file mode 100644
index 000000000..3e19512d4
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/new-file.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/question.svg b/CTA/CustomTeamAssigner/Resources/question.svg
new file mode 100644
index 000000000..92ec0bcea
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/question.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/save-as.svg b/CTA/CustomTeamAssigner/Resources/save-as.svg
new file mode 100644
index 000000000..a6a91c92a
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/save-as.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/save.svg b/CTA/CustomTeamAssigner/Resources/save.svg
new file mode 100644
index 000000000..b75f1a7da
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/save.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/search.svg b/CTA/CustomTeamAssigner/Resources/search.svg
new file mode 100644
index 000000000..d6e765a48
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/search.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/Resources/template.svg b/CTA/CustomTeamAssigner/Resources/template.svg
new file mode 100644
index 000000000..7748f2f65
--- /dev/null
+++ b/CTA/CustomTeamAssigner/Resources/template.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/RichTextEditor.xaml b/CTA/CustomTeamAssigner/RichTextEditor.xaml
index 98c40c1ed..95fa8ae27 100644
--- a/CTA/CustomTeamAssigner/RichTextEditor.xaml
+++ b/CTA/CustomTeamAssigner/RichTextEditor.xaml
@@ -116,6 +116,14 @@
-
+
+
+
+
+
+
+
+
+
diff --git a/CTA/CustomTeamAssigner/RichTextEditor.xaml.cs b/CTA/CustomTeamAssigner/RichTextEditor.xaml.cs
index 2794fc712..050fc5408 100644
--- a/CTA/CustomTeamAssigner/RichTextEditor.xaml.cs
+++ b/CTA/CustomTeamAssigner/RichTextEditor.xaml.cs
@@ -11,6 +11,8 @@ namespace CustomTeamAssigner
{
public partial class RichTextEditor : Page
{
+ public static RichTextEditor Instance { get; private set; } = null!;
+
public RichTextEditor()
{
InitializeComponent();
diff --git a/CTA/CustomTeamAssigner/RoleDescFinder.xaml b/CTA/CustomTeamAssigner/RoleDescFinder.xaml
index a97512cca..df868684b 100644
--- a/CTA/CustomTeamAssigner/RoleDescFinder.xaml
+++ b/CTA/CustomTeamAssigner/RoleDescFinder.xaml
@@ -116,11 +116,27 @@
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CTA/CustomTeamAssigner/RoleDescFinder.xaml.cs b/CTA/CustomTeamAssigner/RoleDescFinder.xaml.cs
index 3307f847a..c388c1b6e 100644
--- a/CTA/CustomTeamAssigner/RoleDescFinder.xaml.cs
+++ b/CTA/CustomTeamAssigner/RoleDescFinder.xaml.cs
@@ -8,6 +8,8 @@ namespace CustomTeamAssigner
{
public partial class RoleDescFinder : Page
{
+ public static RoleDescFinder Instance { get; private set; } = null!;
+
public RoleDescFinder()
{
InitializeComponent();
diff --git a/CTA/CustomTeamAssigner/TeamEditorPage.xaml b/CTA/CustomTeamAssigner/TeamEditorPage.xaml
index 8fb9c55af..4ab987043 100644
--- a/CTA/CustomTeamAssigner/TeamEditorPage.xaml
+++ b/CTA/CustomTeamAssigner/TeamEditorPage.xaml
@@ -299,8 +299,32 @@ README file in the root directory of this source tree.
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CTA/CustomTeamAssigner/TeamEditorPage.xaml.cs b/CTA/CustomTeamAssigner/TeamEditorPage.xaml.cs
index e5389100b..d2cbc4a43 100644
--- a/CTA/CustomTeamAssigner/TeamEditorPage.xaml.cs
+++ b/CTA/CustomTeamAssigner/TeamEditorPage.xaml.cs
@@ -15,6 +15,8 @@ namespace CustomTeamAssigner
{
public partial class TeamEditorPage : Page
{
+ public static TeamEditorPage Instance { get; private set; } = null!;
+
private readonly Team EditingTeam;
private readonly List EditingTeamMembers;
@@ -26,6 +28,7 @@ namespace CustomTeamAssigner
InitializeMembersGrid();
InitializeComboBox();
InitializeEditorFields();
+ MainWindow.ApplyAllImages();
}
void InitializeEditorFields()
@@ -86,12 +89,14 @@ namespace CustomTeamAssigner
MainWindow.Instance.Navigator.NavigationService.Navigate(new PlaySetListerPage());
Utils.SetMainWindowContents(Visibility.Collapsed);
+ MainWindow.ApplyAllImages();
}
void Cancel(object sender, RoutedEventArgs e)
{
MainWindow.Instance.Navigator.NavigationService.Navigate(new PlaySetListerPage());
Utils.SetMainWindowContents(Visibility.Collapsed);
+ MainWindow.ApplyAllImages();
}
void Delete(object sender, RoutedEventArgs e)
@@ -99,6 +104,7 @@ namespace CustomTeamAssigner
Utils.Teams.Remove(EditingTeam);
MainWindow.Instance.Navigator.NavigationService.Navigate(new PlaySetListerPage());
Utils.SetMainWindowContents(Visibility.Collapsed);
+ MainWindow.ApplyAllImages();
}
void AddMember(object sender, RoutedEventArgs e)