mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-09-28 15:21:24 +12:00
You can now export Light Pink to disk
This commit is contained in:
parent
f25fe2ade2
commit
dd68fa16c1
2 changed files with 25 additions and 1 deletions
|
@ -5,6 +5,8 @@ using System.Windows;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using ModAssistant.Pages;
|
using ModAssistant.Pages;
|
||||||
|
using System.Xml;
|
||||||
|
using System.Windows.Markup;
|
||||||
|
|
||||||
namespace ModAssistant
|
namespace ModAssistant
|
||||||
{
|
{
|
||||||
|
@ -90,5 +92,26 @@ namespace ModAssistant
|
||||||
element.Resources[ResourceColorName] = loadedThemes[LoadedTheme][ResourceColorName];
|
element.Resources[ResourceColorName] = loadedThemes[LoadedTheme][ResourceColorName];
|
||||||
((GeometryDrawing)((DrawingGroup)icons[DrawingGroupName]).Children[0]).Brush = (Brush)element.Resources[ResourceColorName];
|
((GeometryDrawing)((DrawingGroup)icons[DrawingGroupName]).Children[0]).Brush = (Brush)element.Resources[ResourceColorName];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void WriteThemeToDisk(string themeName)
|
||||||
|
{
|
||||||
|
if (!Directory.Exists(ThemeDirectory))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(ThemeDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!File.Exists($@"{ThemeDirectory}\\{themeName}.xaml"))
|
||||||
|
{
|
||||||
|
|
||||||
|
ResourceDictionary dictionary = LoadTheme(themeName, true);
|
||||||
|
|
||||||
|
XmlWriterSettings settings = new XmlWriterSettings();
|
||||||
|
settings.Indent = true;
|
||||||
|
XmlWriter writer = XmlWriter.Create($@"{ThemeDirectory}\\{themeName}.xaml", settings);
|
||||||
|
XamlWriter.Save(dictionary, writer);
|
||||||
|
MainWindow.Instance.MainText = $"Template theme \"{themeName}\" saved to Themes folder.";
|
||||||
|
}
|
||||||
|
else MessageBox.Show("Template theme already exists!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -254,7 +254,8 @@ namespace ModAssistant.Pages
|
||||||
|
|
||||||
private void ApplicationThemeExportTemplate_Click(object sender, RoutedEventArgs e)
|
private void ApplicationThemeExportTemplate_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
MessageBox.Show("nice going laughShorts this is coming soon");
|
Themes.WriteThemeToDisk("Light Pink");
|
||||||
|
Themes.LoadThemes();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ApplicationThemeOpenThemesFolder_Click(object sender, RoutedEventArgs e)
|
private void ApplicationThemeOpenThemesFolder_Click(object sender, RoutedEventArgs e)
|
||||||
|
|
Loading…
Reference in a new issue