mirror of
https://github.com/knah/VRCMelonAssistant.git
synced 2024-06-28 19:10:45 +12:00
Fix crash when .xaml file doesn't exist with loose themes
This commit is contained in:
parent
79e434f508
commit
0b12e6a90a
|
@ -104,11 +104,14 @@ namespace ModAssistant
|
||||||
if (loadedThemes.TryGetValue(theme, out Theme newTheme))
|
if (loadedThemes.TryGetValue(theme, out Theme newTheme))
|
||||||
{
|
{
|
||||||
//First, pause our video and hide it.
|
//First, pause our video and hide it.
|
||||||
|
LoadedTheme = theme;
|
||||||
MainWindow.Instance.BackgroundVideo.Pause();
|
MainWindow.Instance.BackgroundVideo.Pause();
|
||||||
MainWindow.Instance.BackgroundVideo.Visibility = Visibility.Hidden;
|
MainWindow.Instance.BackgroundVideo.Visibility = Visibility.Hidden;
|
||||||
Application.Current.Resources.MergedDictionaries.RemoveAt(2); //We might want to change this to a static integer or search by name.
|
if (newTheme.ThemeDictionary != null)
|
||||||
LoadedTheme = theme;
|
{
|
||||||
Application.Current.Resources.MergedDictionaries.Insert(2, newTheme.ThemeDictionary); //Insert our new theme into the same spot as last time.
|
Application.Current.Resources.MergedDictionaries.RemoveAt(2); //We might want to change this to a static integer or search by name.
|
||||||
|
Application.Current.Resources.MergedDictionaries.Insert(2, newTheme.ThemeDictionary); //Insert our new theme into the same spot as last time.
|
||||||
|
}
|
||||||
Properties.Settings.Default.SelectedTheme = theme;
|
Properties.Settings.Default.SelectedTheme = theme;
|
||||||
Properties.Settings.Default.Save();
|
Properties.Settings.Default.Save();
|
||||||
if (sendMessage)
|
if (sendMessage)
|
||||||
|
|
Loading…
Reference in a new issue