diff --git a/Osmo/Core/Configuration/AppConfiguration.cs b/Osmo/Core/Configuration/AppConfiguration.cs index a1e59d3..428f05b 100644 --- a/Osmo/Core/Configuration/AppConfiguration.cs +++ b/Osmo/Core/Configuration/AppConfiguration.cs @@ -154,6 +154,7 @@ public void Save() public void Load() { Content = base.LoadFile(this); + LoadDefaults(); if (Content != null) { @@ -197,10 +198,6 @@ public void Load() } } } - else - { - LoadDefaults(); - } UnsavedChanges = false; OnSettingsLoaded(EventArgs.Empty); diff --git a/Osmo/Core/Configuration/RecallConfiguration.cs b/Osmo/Core/Configuration/RecallConfiguration.cs index 6c7206f..47bc984 100644 --- a/Osmo/Core/Configuration/RecallConfiguration.cs +++ b/Osmo/Core/Configuration/RecallConfiguration.cs @@ -66,6 +66,7 @@ public void Save() public void Load() { Content = base.LoadFile(this); + LoadDefaults(); if (Content != null) { @@ -96,10 +97,6 @@ public void Load() } } } - else - { - LoadDefaults(); - } } private void LoadDefaults() diff --git a/Osmo/Core/Objects/SkinElement.cs b/Osmo/Core/Objects/SkinElement.cs index 1de6a0e..fb9f9f7 100644 --- a/Osmo/Core/Objects/SkinElement.cs +++ b/Osmo/Core/Objects/SkinElement.cs @@ -19,12 +19,14 @@ public class SkinElement : ViewModelBase private bool mIsResizeSelected; private FontStyle fontStyle = FontStyles.Normal; private FontWeight fontWeight = FontWeights.Normal; - string backupPath = Directory.GetParent(AppConfiguration.Instance.BackupDirectory).FullName + - "\\Edited\\"; + string backupPath; public string Path { - get => !string.IsNullOrWhiteSpace(TempPath) ? TempPath : mPath; + get + { + return !string.IsNullOrWhiteSpace(TempPath) ? TempPath : mPath; + } set => mPath = value; } @@ -85,7 +87,8 @@ internal SkinElement(FileInfo fi, string skinName) Path = fi.FullName; Name = fi.Name; Extension = fi.Extension; - backupPath += skinName + "\\"; + backupPath = string.Format("{0}\\Edited\\{1}\\", + Directory.GetParent(AppConfiguration.Instance.BackupDirectory).FullName, skinName); fileType = GetFileType(fi.Extension); @@ -121,6 +124,10 @@ internal SkinElement(FileInfo fi, string skinName) TempPath = backupPath + Name; FontStyle = FontStyles.Italic; } + else + { + TempPath = ""; + } } internal SkinElement(SkinElement copyFrom) diff --git a/Osmo/Core/SkinManager.cs b/Osmo/Core/SkinManager.cs index 7f05fb6..8b5b97f 100644 --- a/Osmo/Core/SkinManager.cs +++ b/Osmo/Core/SkinManager.cs @@ -251,6 +251,7 @@ private void LoadSkins() Skins.Clear(); } + Skins.Add(new Skin()); RecallConfiguration recall = RecallConfiguration.Instance; bool reopenLastSkin = AppConfiguration.Instance.ReopenLastSkin; new Thread(() => diff --git a/Osmo/Properties/AssemblyInfo.cs b/Osmo/Properties/AssemblyInfo.cs index 5d07870..27532fc 100644 --- a/Osmo/Properties/AssemblyInfo.cs +++ b/Osmo/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.0.3.85")] -[assembly: AssemblyFileVersion("0.0.3.85")] +[assembly: AssemblyVersion("0.0.3.94")] +[assembly: AssemblyFileVersion("0.0.3.94")] diff --git a/Osmo/UI/SkinMixerSelect.xaml b/Osmo/UI/SkinMixerSelect.xaml index 1df45f0..2c47db0 100644 --- a/Osmo/UI/SkinMixerSelect.xaml +++ b/Osmo/UI/SkinMixerSelect.xaml @@ -25,7 +25,7 @@ - diff --git a/Osmo/UI/SkinSelect.xaml b/Osmo/UI/SkinSelect.xaml index 5501d61..89c8263 100644 --- a/Osmo/UI/SkinSelect.xaml +++ b/Osmo/UI/SkinSelect.xaml @@ -37,7 +37,7 @@ - diff --git a/Osmo/UI/SkinSelect.xaml.cs b/Osmo/UI/SkinSelect.xaml.cs index 0d2a1ad..b5eed34 100644 --- a/Osmo/UI/SkinSelect.xaml.cs +++ b/Osmo/UI/SkinSelect.xaml.cs @@ -187,5 +187,41 @@ private async void Grid_PreviewKeyUp(object sender, KeyEventArgs e) { await ForwardKeyboardInput(e); } + + private void MenuItem_NewSkin_Click(object sender, RoutedEventArgs e) + { + if (DialogHost.OpenDialogCommand.CanExecute(btn_newSkin.CommandParameter, btn_newSkin)) + DialogHost.OpenDialogCommand.Execute(btn_newSkin.CommandParameter, btn_newSkin); + } + + private void MenuItem_OpenInExplorer_Click(object sender, RoutedEventArgs e) + { + + } + + private void MenuItem_OpenInMixer_Click(object sender, RoutedEventArgs e) + { + + } + + private void MenuItem_OpenInEditor_Click(object sender, RoutedEventArgs e) + { + + } + + private void MenuItem_ResizeTool_Click(object sender, RoutedEventArgs e) + { + + } + + private void MenuItem_Export_Click(object sender, RoutedEventArgs e) + { + + } + + private void MenuItem_Delete_Click(object sender, RoutedEventArgs e) + { + + } } } diff --git a/Osmo/ViewModel/SkinSelectViewModel.cs b/Osmo/ViewModel/SkinSelectViewModel.cs index 01f74bc..6245330 100644 --- a/Osmo/ViewModel/SkinSelectViewModel.cs +++ b/Osmo/ViewModel/SkinSelectViewModel.cs @@ -12,6 +12,7 @@ namespace Osmo.ViewModel class SkinSelectViewModel : ViewModelBase { private SkinManager mSkinManager; + private int mSelectedIndex; public SkinSelectViewModel() { @@ -22,6 +23,7 @@ public SkinSelectViewModel() private void SkinManager_SkinDirectoryChanged(object sender, EventArgs e) { InvokePropertyChanged("Skins"); + InvokePropertyChanged("SkinsMixer"); } public SkinManager SkinManager @@ -29,6 +31,24 @@ public SkinManager SkinManager get => mSkinManager; } - public List Skins { get => SkinManager != null ? SkinManager.Skins.SkipWhile(x => x.IsEmpty).ToList() : null; } + public int SelectedIndex + { + get => mSelectedIndex; + set + { + mSelectedIndex = value; + InvokePropertyChanged("SelectedIndex"); + InvokePropertyChanged("SkinOptionsEnabled"); + } + } + + public bool SkinOptionsEnabled + { + get => SelectedIndex > 0; + } + + public List Skins { get => SkinManager != null ? SkinManager.Skins.ToList() : null; } + + public List SkinsMixer { get => SkinManager != null ? SkinManager.Skins.SkipWhile(x => x.IsEmpty).ToList() : null; } } }