diff --git a/VPet.Plugin.ModMaker/App.xaml b/VPet.Plugin.ModMaker/App.xaml
index 6a9cf93..b9b850d 100644
--- a/VPet.Plugin.ModMaker/App.xaml
+++ b/VPet.Plugin.ModMaker/App.xaml
@@ -7,6 +7,7 @@
+
diff --git a/VPet.Plugin.ModMaker/Converters.xaml b/VPet.Plugin.ModMaker/Converters.xaml
new file mode 100644
index 0000000..674f77d
--- /dev/null
+++ b/VPet.Plugin.ModMaker/Converters.xaml
@@ -0,0 +1,7 @@
+
+
+
+
\ No newline at end of file
diff --git a/VPet.Plugin.ModMaker/Converters/MarginConverter.cs b/VPet.Plugin.ModMaker/Converters/MarginConverter.cs
new file mode 100644
index 0000000..a9cc1d8
--- /dev/null
+++ b/VPet.Plugin.ModMaker/Converters/MarginConverter.cs
@@ -0,0 +1,75 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace VPet.Plugin.ModMaker.Converters;
+
+public class MarginConverter : IMultiValueConverter
+{
+ public object Convert(
+ object[] values,
+ Type targetType,
+ object parameter,
+ System.Globalization.CultureInfo culture
+ )
+ {
+ if (values.Length == 0)
+ {
+ return new Thickness();
+ }
+ else if (values.Length == 1)
+ {
+ return new Thickness()
+ {
+ Left = System.Convert.ToDouble(values[0]),
+ Top = default,
+ Right = default,
+ Bottom = default
+ };
+ }
+ else if (values.Length == 2)
+ {
+ return new Thickness()
+ {
+ Left = System.Convert.ToDouble(values[0]),
+ Top = System.Convert.ToDouble(values[1]),
+ Right = default,
+ Bottom = default
+ };
+ }
+ else if (values.Length == 3)
+ {
+ return new Thickness()
+ {
+ Left = System.Convert.ToDouble(values[0]),
+ Top = System.Convert.ToDouble(values[1]),
+ Right = System.Convert.ToDouble(values[2]),
+ Bottom = default
+ };
+ }
+ else
+ {
+ return new Thickness()
+ {
+ Left = System.Convert.ToDouble(values[0]),
+ Top = System.Convert.ToDouble(values[1]),
+ Right = System.Convert.ToDouble(values[2]),
+ Bottom = System.Convert.ToDouble(values[3])
+ };
+ }
+ }
+
+ public object[] ConvertBack(
+ object value,
+ Type[] targetTypes,
+ object parameter,
+ System.Globalization.CultureInfo culture
+ )
+ {
+ throw new NotImplementedException();
+ }
+}
diff --git a/VPet.Plugin.ModMaker/Converters/MaxConverter.cs b/VPet.Plugin.ModMaker/Converters/MaxConverter.cs
new file mode 100644
index 0000000..273c047
--- /dev/null
+++ b/VPet.Plugin.ModMaker/Converters/MaxConverter.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace VPet.Plugin.ModMaker.Converters;
+
+public class MaxConverter : IMultiValueConverter
+{
+ public object Convert(
+ object[] values,
+ Type targetType,
+ object parameter,
+ System.Globalization.CultureInfo culture
+ )
+ {
+ return values.Max(i => (double)i);
+ }
+
+ public object[] ConvertBack(
+ object value,
+ Type[] targetTypes,
+ object parameter,
+ System.Globalization.CultureInfo culture
+ )
+ {
+ throw new NotImplementedException();
+ }
+}
diff --git a/VPet.Plugin.ModMaker/Models/PetModel.cs b/VPet.Plugin.ModMaker/Models/PetModel.cs
new file mode 100644
index 0000000..722acc1
--- /dev/null
+++ b/VPet.Plugin.ModMaker/Models/PetModel.cs
@@ -0,0 +1,48 @@
+using HKW.HKWViewModels.SimpleObservable;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Media.Imaging;
+
+namespace VPet.Plugin.ModMaker.Models;
+
+public class PetModel
+{
+ public ObservableValue Image { get; } = new();
+ public ObservableValue TouchHeadRect { get; } = new(new());
+ public ObservableValue TouchRaisedRect { get; } = new(new());
+ public ObservableValue RaisePoint { get; } = new(new());
+}
+
+public class MultiStateRect
+{
+ public ObservableValue Happy { get; } = new(new());
+ public ObservableValue Nomal { get; } = new(new());
+ public ObservableValue PoorCondition { get; } = new(new());
+ public ObservableValue Ill { get; } = new(new());
+}
+
+public class MultiStatePoint
+{
+ public ObservableValue Happy { get; } = new(new());
+ public ObservableValue Nomal { get; } = new(new());
+ public ObservableValue PoorCondition { get; } = new(new());
+ public ObservableValue Ill { get; } = new(new());
+}
+
+public class ObservableInt32Rect
+{
+ public ObservableValue X { get; } = new();
+ public ObservableValue Y { get; } = new();
+ public ObservableValue Width { get; } = new();
+ public ObservableValue Height { get; } = new();
+}
+
+public class ObservablePoint
+{
+ public ObservableValue X { get; } = new();
+ public ObservableValue Y { get; } = new();
+}
diff --git a/VPet.Plugin.ModMaker/Utils.cs b/VPet.Plugin.ModMaker/Utils.cs
index 1815ac1..6e7d245 100644
--- a/VPet.Plugin.ModMaker/Utils.cs
+++ b/VPet.Plugin.ModMaker/Utils.cs
@@ -30,9 +30,8 @@ internal static class Utils
BitmapImage bitmapImage = new();
bitmapImage.BeginInit();
var ms = new MemoryStream();
- var sr = new StreamReader(imagePath);
+ using var sr = new StreamReader(imagePath);
sr.BaseStream.CopyTo(ms);
- sr.Close();
bitmapImage.StreamSource = ms;
bitmapImage.EndInit();
return bitmapImage;
diff --git a/VPet.Plugin.ModMaker/VPet.Plugin.ModMaker.csproj b/VPet.Plugin.ModMaker/VPet.Plugin.ModMaker.csproj
index 06924c5..0fb65bf 100644
--- a/VPet.Plugin.ModMaker/VPet.Plugin.ModMaker.csproj
+++ b/VPet.Plugin.ModMaker/VPet.Plugin.ModMaker.csproj
@@ -89,11 +89,14 @@
App.xaml
+
+
+
@@ -101,6 +104,8 @@
+
+
ClickTextPage.xaml
@@ -145,6 +150,12 @@
ModEditWindow.xaml
+
+ PetEditWindow.xaml
+
+
+ PetPage.xaml
+
ModMakerWindow.xaml
@@ -163,6 +174,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -195,6 +210,14 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/VPet.Plugin.ModMaker/ViewModels/ModEdit/PetEdit/PetEditWindowVM.cs b/VPet.Plugin.ModMaker/ViewModels/ModEdit/PetEdit/PetEditWindowVM.cs
new file mode 100644
index 0000000..35b37e9
--- /dev/null
+++ b/VPet.Plugin.ModMaker/ViewModels/ModEdit/PetEdit/PetEditWindowVM.cs
@@ -0,0 +1,17 @@
+using HKW.HKWViewModels.SimpleObservable;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using VPet.Plugin.ModMaker.Models;
+
+namespace VPet.Plugin.ModMaker.ViewModels.ModEdit.PetEdit;
+
+public class PetEditWindowVM
+{
+ public ObservableValue Pet { get; } = new(new());
+
+ public PetEditWindowVM() { }
+}
diff --git a/VPet.Plugin.ModMaker/ViewModels/ModEdit/PetEdit/PetPageVM.cs b/VPet.Plugin.ModMaker/ViewModels/ModEdit/PetEdit/PetPageVM.cs
new file mode 100644
index 0000000..4899d65
--- /dev/null
+++ b/VPet.Plugin.ModMaker/ViewModels/ModEdit/PetEdit/PetPageVM.cs
@@ -0,0 +1,9 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace VPet.Plugin.ModMaker.ViewModels.ModEdit.PetEdit;
+
+public class PetPageVM { }
diff --git a/VPet.Plugin.ModMaker/Views/ModEdit/FoodEdit/FoodEditWindow.xaml b/VPet.Plugin.ModMaker/Views/ModEdit/FoodEdit/FoodEditWindow.xaml
index b6ea206..49a8834 100644
--- a/VPet.Plugin.ModMaker/Views/ModEdit/FoodEdit/FoodEditWindow.xaml
+++ b/VPet.Plugin.ModMaker/Views/ModEdit/FoodEdit/FoodEditWindow.xaml
@@ -119,43 +119,43 @@
+ Value="{Binding Food.Value.StrengthFood.Value, Mode=TwoWay}" />
+ Value="{Binding Food.Value.StrengthDrink.Value, Mode=TwoWay}" />
+ Value="{Binding Food.Value.Health.Value, Mode=TwoWay}" />
+ Value="{Binding Food.Value.Strength.Value, Mode=TwoWay}" />
+ Value="{Binding Food.Value.Feeling.Value, Mode=TwoWay}" />
+ Value="{Binding Food.Value.Likability.Value, Mode=TwoWay}" />
+ Value="{Binding Food.Value.Exp.Value, Mode=TwoWay}" />
+ Value="{Binding Food.Value.Price.Value, Mode=TwoWay}" />
diff --git a/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetEditWindow.xaml b/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetEditWindow.xaml
new file mode 100644
index 0000000..2ddb943
--- /dev/null
+++ b/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetEditWindow.xaml
@@ -0,0 +1,720 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetEditWindow.xaml.cs b/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetEditWindow.xaml.cs
new file mode 100644
index 0000000..8e218d6
--- /dev/null
+++ b/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetEditWindow.xaml.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+using VPet.Plugin.ModMaker.ViewModels.ModEdit.PetEdit;
+
+namespace VPet.Plugin.ModMaker.Views.ModEdit.PetEdit;
+
+///
+/// PetEditWindow.xaml 的交互逻辑
+///
+public partial class PetEditWindow : Window
+{
+ public PetEditWindowVM ViewModel => (PetEditWindowVM)DataContext;
+
+ public PetEditWindow()
+ {
+ DataContext = new PetEditWindowVM();
+ InitializeComponent();
+ }
+}
diff --git a/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetPage.xaml b/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetPage.xaml
new file mode 100644
index 0000000..0b6d280
--- /dev/null
+++ b/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetPage.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
diff --git a/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetPage.xaml.cs b/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetPage.xaml.cs
new file mode 100644
index 0000000..906b7f5
--- /dev/null
+++ b/VPet.Plugin.ModMaker/Views/ModEdit/PetEdit/PetPage.xaml.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using VPet.Plugin.ModMaker.ViewModels.ModEdit.PetEdit;
+
+namespace VPet.Plugin.ModMaker.Views.ModEdit.PetEdit;
+
+///
+/// PetPage.xaml 的交互逻辑
+///
+public partial class PetPage : Page
+{
+ public PetPageVM ViewModel => (PetPageVM)DataContext;
+
+ public PetPage()
+ {
+ InitializeComponent();
+ DataContext = new PetPageVM();
+ }
+}
diff --git a/VPet.Plugin.ModMaker/Views/ModMakerWindow.xaml.cs b/VPet.Plugin.ModMaker/Views/ModMakerWindow.xaml.cs
index 03c13ba..f04c9c5 100644
--- a/VPet.Plugin.ModMaker/Views/ModMakerWindow.xaml.cs
+++ b/VPet.Plugin.ModMaker/Views/ModMakerWindow.xaml.cs
@@ -15,6 +15,7 @@ using System.Windows.Shapes;
using VPet.Plugin.ModMaker.Models;
using VPet.Plugin.ModMaker.ViewModels;
using VPet.Plugin.ModMaker.Views.ModEdit;
+using VPet.Plugin.ModMaker.Views.ModEdit.PetEdit;
namespace VPet.Plugin.ModMaker.Views;
@@ -23,7 +24,7 @@ namespace VPet.Plugin.ModMaker.Views;
///
public partial class ModMakerWindow : Window
{
- public WindowVM_ModMaker ViewModel => (WindowVM_ModMaker)this.DataContext;
+ public WindowVM_ModMaker ViewModel => (WindowVM_ModMaker)DataContext;
public Models.ModMaker ModMaker { get; set; }
public ModEditWindow ModEditWindow { get; set; }
@@ -31,5 +32,6 @@ public partial class ModMakerWindow : Window
{
InitializeComponent();
DataContext = new WindowVM_ModMaker(this);
+ new PetEditWindow().Show();
}
}