diff --git a/BallanceTasEditor/App.ico b/BallanceTasEditor/App.ico deleted file mode 100644 index 07673cf..0000000 Binary files a/BallanceTasEditor/App.ico and /dev/null differ diff --git a/BallanceTasEditor/BallanceTasEditor.csproj b/BallanceTasEditor/BallanceTasEditor.csproj index d3e4e8d..b30a942 100644 --- a/BallanceTasEditor/BallanceTasEditor.csproj +++ b/BallanceTasEditor/BallanceTasEditor.csproj @@ -1,6 +1,10 @@ + + 8.0 + + Debug AnyCPU @@ -37,7 +41,10 @@ 4 - App.ico + Assets\App.ico + + + app.manifest @@ -62,7 +69,9 @@ MSBuild:Compile Designer + + AboutDialog.xaml @@ -159,6 +168,7 @@ ResXFileCodeGenerator Resources.Designer.cs + SettingsSingleFileGenerator Settings.Designer.cs @@ -169,14 +179,10 @@ - - - - diff --git a/BallanceTasEditor/Converters/GenericConverter.cs b/BallanceTasEditor/Converters/GenericConverter.cs new file mode 100644 index 0000000..3d2a3d7 --- /dev/null +++ b/BallanceTasEditor/Converters/GenericConverter.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Data; + +namespace BallanceTasEditor.Converters { + public class GenericConverter : IValueConverter { + + private readonly Func converter; + + public GenericConverter(Func converter) { this.converter = converter; } + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { + if (value is TIn t) { + return converter(t); + } else { + return Binding.DoNothing; + } + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { + return Binding.DoNothing; + } + } + + public static class ConverterWarehouse { + public static readonly GenericConverter FpsConverter = + new GenericConverter((v) => Utils.FpsConverter.ToDelta(v).ToString()); + } +} diff --git a/BallanceTasEditor/Properties/Resources.Designer.cs b/BallanceTasEditor/Properties/Resources.Designer.cs index a4d2b22..a30edbd 100644 --- a/BallanceTasEditor/Properties/Resources.Designer.cs +++ b/BallanceTasEditor/Properties/Resources.Designer.cs @@ -9,8 +9,9 @@ //------------------------------------------------------------------------------ namespace BallanceTasEditor.Properties { - - + using System; + + /// /// A strongly-typed resource class, for looking up localized strings, etc. /// @@ -18,33 +19,33 @@ namespace BallanceTasEditor.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { - + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Resources() { } - + /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { - if ((resourceMan == null)) { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("BallanceTasEditor.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. diff --git a/BallanceTasEditor/Properties/Settings.Designer.cs b/BallanceTasEditor/Properties/Settings.Designer.cs index 33a702d..5914dcf 100644 --- a/BallanceTasEditor/Properties/Settings.Designer.cs +++ b/BallanceTasEditor/Properties/Settings.Designer.cs @@ -9,14 +9,14 @@ //------------------------------------------------------------------------------ namespace BallanceTasEditor.Properties { - - + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - + public static Settings Default { get { return defaultInstance; diff --git a/BallanceTasEditor/ViewModels/NewFileDialog.cs b/BallanceTasEditor/ViewModels/NewFileDialog.cs new file mode 100644 index 0000000..b7eef6f --- /dev/null +++ b/BallanceTasEditor/ViewModels/NewFileDialog.cs @@ -0,0 +1,23 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BallanceTasEditor.ViewModels { + public partial class NewFileDialog : ObservableObject { + [ObservableProperty] + private int count; + + [ObservableProperty] + private int fps; + + public NewFileDialog() { + Count = 10000; + // 132 or 264 + Fps = 264; + } + + } +} diff --git a/BallanceTasEditor/Views/NewFileDialog.xaml b/BallanceTasEditor/Views/NewFileDialog.xaml index 1fa7dde..dbba90f 100644 --- a/BallanceTasEditor/Views/NewFileDialog.xaml +++ b/BallanceTasEditor/Views/NewFileDialog.xaml @@ -4,6 +4,9 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:BallanceTasEditor.Views" + xmlns:vm="clr-namespace:BallanceTasEditor.ViewModels" + xmlns:conveter="clr-namespace:BallanceTasEditor.Converters" + d:DataContext="{d:DesignInstance vm:NewFileDialog}" mc:Ignorable="d" WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow" Title="New File" Height="250" Width="400" Icon="/Assets/NewFile.ico"> @@ -43,9 +46,12 @@ - - - + + + diff --git a/BallanceTasEditor/Views/NewFileDialog.xaml.cs b/BallanceTasEditor/Views/NewFileDialog.xaml.cs index 56b9992..845369b 100644 --- a/BallanceTasEditor/Views/NewFileDialog.xaml.cs +++ b/BallanceTasEditor/Views/NewFileDialog.xaml.cs @@ -19,6 +19,7 @@ namespace BallanceTasEditor.Views { public partial class NewFileDialog : Window { public NewFileDialog() { InitializeComponent(); + this.DataContext = new ViewModels.NewFileDialog(); } } } diff --git a/BallanceTasEditor/app.config b/BallanceTasEditor/app.config index 7c4b745..91e7a15 100644 --- a/BallanceTasEditor/app.config +++ b/BallanceTasEditor/app.config @@ -1,22 +1,22 @@ - + - + - - + + - - + + - - + + - \ No newline at end of file + diff --git a/BallanceTasEditor/app.manifest b/BallanceTasEditor/app.manifest new file mode 100644 index 0000000..9ce67d2 --- /dev/null +++ b/BallanceTasEditor/app.manifest @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BallanceTasEditorTests/BallanceTasEditorTests.csproj b/BallanceTasEditorTests/BallanceTasEditorTests.csproj index 7e96714..997c850 100644 --- a/BallanceTasEditorTests/BallanceTasEditorTests.csproj +++ b/BallanceTasEditorTests/BallanceTasEditorTests.csproj @@ -1,6 +1,10 @@  + + 8.0 + + Debug AnyCPU