mirror of
https://github.com/LorisYounger/VPet.ModMaker.git
synced 2024-08-30 18:22:21 +00:00
升级至.NET8
This commit is contained in:
parent
22ec7b67c0
commit
fe6256729f
@ -2,3 +2,5 @@
|
||||
|
||||
# RCS1049: Simplify boolean comparison.
|
||||
dotnet_diagnostic.RCS1049.severity = none
|
||||
|
||||
dotnet_diagnostic.CA1416.severity = none
|
@ -1,9 +1,9 @@
|
||||
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.4.33213.308
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VPet.ModMaker", "VPet.ModMaker\VPet.ModMaker.csproj", "{8F804A27-A57E-4799-801C-4DE96BA153BC}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VPet.ModMaker", "VPet.ModMaker\VPet.ModMaker.csproj", "{8F804A27-A57E-4799-801C-4DE96BA153BC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
|
@ -2,11 +2,12 @@
|
||||
x:Class="VPet.ModMaker.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
StartupUri="Views/ModMakerWindow.xaml">
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Panuon.WPF.UI;component/Control.xaml" />
|
||||
<pu:StyleDictionary Includes="All" />
|
||||
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
|
||||
<ResourceDictionary Source="Converters.xaml" />
|
||||
<ResourceDictionary Source="Templates.xaml" />
|
||||
|
@ -1,13 +1,13 @@
|
||||
using LinePutScript;
|
||||
using LinePutScript.Converter;
|
||||
using LinePutScript.Dictionary;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using LinePutScript;
|
||||
using LinePutScript.Converter;
|
||||
using LinePutScript.Dictionary;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using VPet_Simulator.Core;
|
||||
using VPet_Simulator.Windows.Interface;
|
||||
|
||||
@ -106,7 +106,7 @@ public class ModLoader
|
||||
public ModLoader(DirectoryInfo path)
|
||||
{
|
||||
ModPath = path;
|
||||
LpsDocument modlps = new LpsDocument(File.ReadAllText(path.FullName + @"\info.lps"));
|
||||
var modlps = new LPS(File.ReadAllText(path.FullName + @"\info.lps"));
|
||||
Name = modlps.FindLine("vupmod").Info;
|
||||
Intro = modlps.FindLine("intro").Info;
|
||||
GameVer = modlps.FindSub("gamever").InfoToInt;
|
||||
|
@ -1,11 +1,11 @@
|
||||
using LinePutScript.Converter;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
using LinePutScript.Converter;
|
||||
|
||||
namespace VPet.ModMaker.Models;
|
||||
|
||||
@ -42,7 +42,7 @@ public class ModMakeHistory
|
||||
_path = value;
|
||||
var imagePath = Path.Combine(_path, "icon.png");
|
||||
if (File.Exists(imagePath))
|
||||
Image = Utils.LoadImageToMemoryStream(imagePath);
|
||||
Image = NativeUtils.LoadImageToMemoryStream(imagePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
using LinePutScript;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows;
|
||||
using VPet_Simulator.Windows.Interface;
|
||||
using System.Windows.Controls;
|
||||
using LinePutScript;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using VPet.ModMaker.Views;
|
||||
using VPet_Simulator.Windows.Interface;
|
||||
|
||||
namespace VPet.ModMaker.Models;
|
||||
|
||||
public class ModMaker : MainPlugin
|
||||
{
|
||||
public ILine Set;
|
||||
//public ILine Set;
|
||||
public override string PluginName => "ModMaker";
|
||||
|
||||
public ModMakerWindow Maker;
|
||||
@ -24,7 +24,7 @@ public class ModMaker : MainPlugin
|
||||
|
||||
public override void LoadPlugin()
|
||||
{
|
||||
Set = MW.Set.FindLine("ModMaker");
|
||||
//Set = MW.Set.FindLine("ModMaker");
|
||||
MenuItem modset = MW.Main.ToolBar.MenuMODConfig;
|
||||
modset.Visibility = Visibility.Visible;
|
||||
var menuset = new MenuItem()
|
||||
|
@ -1,8 +1,7 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using VPet_Simulator.Core;
|
||||
|
||||
namespace VPet.ModMaker.Models.ModModel;
|
||||
@ -34,11 +33,11 @@ public class AnimeModel
|
||||
{
|
||||
foreach (var file in Directory.EnumerateFiles(imagesPath))
|
||||
{
|
||||
var info = Path.GetFileNameWithoutExtension(file).Split(Utils.Separator);
|
||||
var info = Path.GetFileNameWithoutExtension(file).Split(NativeUtils.Separator);
|
||||
Id.Value = info[0];
|
||||
var duration = info.Last();
|
||||
var imageModel = new ImageModel(
|
||||
Utils.LoadImageToMemoryStream(file),
|
||||
NativeUtils.LoadImageToMemoryStream(file),
|
||||
int.Parse(duration)
|
||||
);
|
||||
Images.Add(imageModel);
|
||||
|
@ -1,6 +1,4 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
@ -8,8 +6,10 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using VPet_Simulator.Core;
|
||||
using static VPet_Simulator.Core.GraphInfo;
|
||||
using static VPet_Simulator.Core.IGameSave;
|
||||
|
||||
namespace VPet.ModMaker.Models.ModModel;
|
||||
|
||||
@ -19,7 +19,7 @@ public class AnimeTypeModel
|
||||
/// 动作类型
|
||||
/// </summary>
|
||||
public static ObservableCollection<GraphInfo.GraphType> GraphTypes { get; } =
|
||||
new(Enum.GetValues(typeof(GraphInfo.GraphType)).Cast<GraphInfo.GraphType>());
|
||||
new(Enum.GetValues<GraphInfo.GraphType>());
|
||||
|
||||
/// <summary>
|
||||
/// 动画类型
|
||||
@ -30,8 +30,8 @@ public class AnimeTypeModel
|
||||
/// <summary>
|
||||
/// 模式类型
|
||||
/// </summary>
|
||||
public static ObservableCollection<GameSave.ModeType> ModeTypes { get; } =
|
||||
new(Enum.GetValues(typeof(GameSave.ModeType)).Cast<GameSave.ModeType>());
|
||||
public static ObservableCollection<ModeType> ModeTypes { get; } =
|
||||
new(Enum.GetValues(typeof(ModeType)).Cast<ModeType>());
|
||||
|
||||
/// <summary>
|
||||
/// 含有名称的动作列表
|
||||
@ -212,7 +212,7 @@ public class AnimeTypeModel
|
||||
var dirName = Path.GetFileName(dir);
|
||||
if (
|
||||
dirName.Contains(
|
||||
nameof(GameSave.ModeType.Happy),
|
||||
nameof(ModeType.Happy),
|
||||
StringComparison.InvariantCultureIgnoreCase
|
||||
)
|
||||
)
|
||||
@ -221,7 +221,7 @@ public class AnimeTypeModel
|
||||
}
|
||||
else if (
|
||||
dirName.Contains(
|
||||
nameof(GameSave.ModeType.Nomal),
|
||||
nameof(ModeType.Nomal),
|
||||
StringComparison.InvariantCultureIgnoreCase
|
||||
)
|
||||
)
|
||||
@ -230,7 +230,7 @@ public class AnimeTypeModel
|
||||
}
|
||||
else if (
|
||||
dirName.Contains(
|
||||
nameof(GameSave.ModeType.PoorCondition),
|
||||
nameof(ModeType.PoorCondition),
|
||||
StringComparison.InvariantCultureIgnoreCase
|
||||
)
|
||||
)
|
||||
@ -238,10 +238,7 @@ public class AnimeTypeModel
|
||||
AddAnime(PoorConditionAnimes, dir);
|
||||
}
|
||||
else if (
|
||||
dirName.Contains(
|
||||
nameof(GameSave.ModeType.Ill),
|
||||
StringComparison.InvariantCultureIgnoreCase
|
||||
)
|
||||
dirName.Contains(nameof(ModeType.Ill), StringComparison.InvariantCultureIgnoreCase)
|
||||
)
|
||||
{
|
||||
AddAnime(IllAnimes, dir);
|
||||
@ -262,15 +259,17 @@ public class AnimeTypeModel
|
||||
foreach (var dir in Directory.EnumerateDirectories(path))
|
||||
{
|
||||
var dirName = Path.GetFileName(dir);
|
||||
var dirInfo = dirName.Split(Utils.Separator, StringSplitOptions.RemoveEmptyEntries);
|
||||
var dirInfo = dirName.Split(
|
||||
NativeUtils.Separator,
|
||||
StringSplitOptions.RemoveEmptyEntries
|
||||
);
|
||||
if (dirInfo.Length == 3)
|
||||
{
|
||||
// 判断 A_1_Happy 类型文件夹
|
||||
var typeName = dirInfo[0];
|
||||
var modeName = dirInfo[2];
|
||||
var type = GetAnimatType(typeName[0]);
|
||||
var mode = (GameSave.ModeType)
|
||||
Enum.Parse(typeof(GameSave.ModeType), Path.GetFileName(modeName), true);
|
||||
var mode = (ModeType)Enum.Parse(typeof(ModeType), Path.GetFileName(modeName), true);
|
||||
AddAnimeForModeType(dir, mode, type);
|
||||
}
|
||||
else if (dirInfo.Length == 2)
|
||||
@ -279,17 +278,16 @@ public class AnimeTypeModel
|
||||
var typeName = dirInfo[0];
|
||||
var modeName = dirInfo[1];
|
||||
var type = GetAnimatType(typeName[0]);
|
||||
var mode = (GameSave.ModeType)
|
||||
Enum.Parse(typeof(GameSave.ModeType), Path.GetFileName(modeName), true);
|
||||
var mode = (ModeType)Enum.Parse(typeof(ModeType), Path.GetFileName(modeName), true);
|
||||
AddAnimeForModeType(dir, mode, type);
|
||||
}
|
||||
else if (Enum.TryParse<GameSave.ModeType>(dirName, true, out var mode))
|
||||
else if (Enum.TryParse<ModeType>(dirName, true, out var mode))
|
||||
{
|
||||
// 判断 Happy/A 型文件夹
|
||||
foreach (var typePath in Directory.EnumerateDirectories(dir))
|
||||
{
|
||||
var type = GetAnimatType(
|
||||
Path.GetFileName(typePath).Split(Utils.Separator).First()[0]
|
||||
Path.GetFileName(typePath).Split(NativeUtils.Separator).First()[0]
|
||||
);
|
||||
AddAnimeForModeType(typePath, mode, type);
|
||||
}
|
||||
@ -302,10 +300,10 @@ public class AnimeTypeModel
|
||||
{
|
||||
foreach (var modePath in Directory.EnumerateDirectories(dir))
|
||||
{
|
||||
mode = (GameSave.ModeType)
|
||||
mode = (ModeType)
|
||||
Enum.Parse(
|
||||
typeof(GameSave.ModeType),
|
||||
Path.GetFileName(modePath).Split(Utils.Separator).First(),
|
||||
typeof(ModeType),
|
||||
Path.GetFileName(modePath).Split(NativeUtils.Separator).First(),
|
||||
true
|
||||
);
|
||||
AddAnimeForModeType(modePath, mode, type);
|
||||
@ -313,7 +311,7 @@ public class AnimeTypeModel
|
||||
}
|
||||
else
|
||||
{
|
||||
AddAnimeForModeType(dir, GameSave.ModeType.Nomal, type);
|
||||
AddAnimeForModeType(dir, ModeType.Nomal, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -325,25 +323,21 @@ public class AnimeTypeModel
|
||||
/// <param name="path">路径</param>
|
||||
/// <param name="modeType">模式类型</param>
|
||||
/// <param name="animeType">动画类型</param>
|
||||
private void AddAnimeForModeType(
|
||||
string path,
|
||||
GameSave.ModeType modeType,
|
||||
GraphInfo.AnimatType animeType
|
||||
)
|
||||
private void AddAnimeForModeType(string path, ModeType modeType, GraphInfo.AnimatType animeType)
|
||||
{
|
||||
if (modeType is GameSave.ModeType.Happy)
|
||||
if (modeType is ModeType.Happy)
|
||||
{
|
||||
AddAnime(HappyAnimes, path, animeType);
|
||||
}
|
||||
else if (modeType is GameSave.ModeType.Nomal)
|
||||
else if (modeType is ModeType.Nomal)
|
||||
{
|
||||
AddAnime(NomalAnimes, path, animeType);
|
||||
}
|
||||
else if (modeType is GameSave.ModeType.PoorCondition)
|
||||
else if (modeType is ModeType.PoorCondition)
|
||||
{
|
||||
AddAnime(PoorConditionAnimes, path, animeType);
|
||||
}
|
||||
else if (modeType is GameSave.ModeType.Ill)
|
||||
else if (modeType is ModeType.Ill)
|
||||
{
|
||||
AddAnime(IllAnimes, path, animeType);
|
||||
}
|
||||
@ -496,7 +490,7 @@ public class AnimeTypeModel
|
||||
{
|
||||
var animePath = Path.Combine(path, "Switch");
|
||||
Directory.CreateDirectory(animePath);
|
||||
var switchName = animeTypeModel.GraphType.ToString().Split(Utils.Separator).Last();
|
||||
var switchName = animeTypeModel.GraphType.ToString().Split(NativeUtils.Separator).Last();
|
||||
SaveWithAnimeType(Path.Combine(animePath, switchName), animeTypeModel);
|
||||
}
|
||||
|
||||
@ -533,22 +527,22 @@ public class AnimeTypeModel
|
||||
{
|
||||
if (animeTypeModel.HappyAnimes.Count > 0)
|
||||
{
|
||||
var modePath = Path.Combine(path, nameof(GameSave.ModeType.Happy));
|
||||
var modePath = Path.Combine(path, nameof(ModeType.Happy));
|
||||
SaveAnimes(modePath, animeTypeModel.HappyAnimes);
|
||||
}
|
||||
if (animeTypeModel.NomalAnimes.Count > 0)
|
||||
{
|
||||
var modePath = Path.Combine(path, nameof(GameSave.ModeType.Nomal));
|
||||
var modePath = Path.Combine(path, nameof(ModeType.Nomal));
|
||||
SaveAnimes(modePath, animeTypeModel.NomalAnimes);
|
||||
}
|
||||
if (animeTypeModel.PoorConditionAnimes.Count > 0)
|
||||
{
|
||||
var modePath = Path.Combine(path, nameof(GameSave.ModeType.PoorCondition));
|
||||
var modePath = Path.Combine(path, nameof(ModeType.PoorCondition));
|
||||
SaveAnimes(modePath, animeTypeModel.PoorConditionAnimes);
|
||||
}
|
||||
if (animeTypeModel.IllAnimes.Count > 0)
|
||||
{
|
||||
var modePath = Path.Combine(path, nameof(GameSave.ModeType.Ill));
|
||||
var modePath = Path.Combine(path, nameof(ModeType.Ill));
|
||||
SaveAnimes(modePath, animeTypeModel.IllAnimes);
|
||||
}
|
||||
|
||||
@ -594,22 +588,22 @@ public class AnimeTypeModel
|
||||
{
|
||||
if (animeType.HappyAnimes.Count > 0)
|
||||
{
|
||||
var modePath = Path.Combine(animePath, nameof(GameSave.ModeType.Happy));
|
||||
var modePath = Path.Combine(animePath, nameof(ModeType.Happy));
|
||||
SaveAnimes(modePath, animeType.HappyAnimes);
|
||||
}
|
||||
if (animeType.NomalAnimes.Count > 0)
|
||||
{
|
||||
var modePath = Path.Combine(animePath, nameof(GameSave.ModeType.Nomal));
|
||||
var modePath = Path.Combine(animePath, nameof(ModeType.Nomal));
|
||||
SaveAnimes(modePath, animeType.NomalAnimes);
|
||||
}
|
||||
if (animeType.PoorConditionAnimes.Count > 0)
|
||||
{
|
||||
var modePath = Path.Combine(animePath, nameof(GameSave.ModeType.PoorCondition));
|
||||
var modePath = Path.Combine(animePath, nameof(ModeType.PoorCondition));
|
||||
SaveAnimes(modePath, animeType.PoorConditionAnimes);
|
||||
}
|
||||
if (animeType.IllAnimes.Count > 0)
|
||||
{
|
||||
var modePath = Path.Combine(animePath, nameof(GameSave.ModeType.Ill));
|
||||
var modePath = Path.Combine(animePath, nameof(ModeType.Ill));
|
||||
SaveAnimes(modePath, animeType.IllAnimes);
|
||||
}
|
||||
static void SaveAnimes(string animePath, ObservableCollection<AnimeModel> animes)
|
||||
|
@ -1,13 +1,14 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript;
|
||||
using VPet_Simulator.Core;
|
||||
using static VPet_Simulator.Core.IGameSave;
|
||||
|
||||
namespace VPet.ModMaker.Models.ModModel;
|
||||
|
||||
@ -18,7 +19,7 @@ public class FoodAnimeModel
|
||||
/// </summary>
|
||||
public ObservableValue<string> Id { get; } = new();
|
||||
|
||||
public ObservableValue<GameSave.ModeType> Mode { get; }
|
||||
public ObservableValue<ModeType> Mode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 后图像列表
|
||||
@ -94,7 +95,7 @@ public class FoodAnimeModel
|
||||
|
||||
public class FoodImagesPath
|
||||
{
|
||||
public ObservableValue<GameSave.ModeType> Mode { get; } = new();
|
||||
public ObservableValue<ModeType> Mode { get; } = new();
|
||||
|
||||
public ObservableValue<int> Index { get; } = new();
|
||||
}
|
||||
|
@ -1,8 +1,4 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using LinePutScript;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
@ -10,7 +6,11 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using VPet_Simulator.Core;
|
||||
using static VPet_Simulator.Core.IGameSave;
|
||||
|
||||
namespace VPet.ModMaker.Models.ModModel;
|
||||
|
||||
@ -159,15 +159,11 @@ public class FoodAnimeTypeModel
|
||||
if (foodAnimeInfos.Any() is false)
|
||||
throw new Exception("信息文件\n{0}\n未包含食物动画信息".Translate(infoPath));
|
||||
var pngAnimeInfos = lps.FindAllLine(nameof(PNGAnimation))
|
||||
.Select(
|
||||
i =>
|
||||
new PNGAnimeInfo(
|
||||
i.Info,
|
||||
i.Find("path").Info,
|
||||
(GameSave.ModeType)
|
||||
Enum.Parse(typeof(GameSave.ModeType), i.Find("mode").Info, true)
|
||||
)
|
||||
)
|
||||
.Select(i => new PNGAnimeInfo(
|
||||
i.Info,
|
||||
i.Find("path").Info,
|
||||
(ModeType)Enum.Parse(typeof(ModeType), i.Find("mode").Info, true)
|
||||
))
|
||||
.ToList();
|
||||
foreach (var foodAnimation in foodAnimeInfos)
|
||||
{
|
||||
@ -183,22 +179,15 @@ public class FoodAnimeTypeModel
|
||||
/// <param name="pngAnimeInfos">PNG动画信息</param>
|
||||
public void ParseFoodAnimeInfo(string path, ILine line, List<PNGAnimeInfo> pngAnimeInfos)
|
||||
{
|
||||
var mode = (GameSave.ModeType)
|
||||
Enum.Parse(typeof(GameSave.ModeType), line.Find("mode").Info, true);
|
||||
if (mode is GameSave.ModeType.Happy)
|
||||
AddModeAnime(path, GameSave.ModeType.Happy, HappyAnimes, line, pngAnimeInfos);
|
||||
else if (mode is GameSave.ModeType.Nomal)
|
||||
AddModeAnime(path, GameSave.ModeType.Nomal, NomalAnimes, line, pngAnimeInfos);
|
||||
else if (mode is GameSave.ModeType.PoorCondition)
|
||||
AddModeAnime(
|
||||
path,
|
||||
GameSave.ModeType.PoorCondition,
|
||||
PoorConditionAnimes,
|
||||
line,
|
||||
pngAnimeInfos
|
||||
);
|
||||
else if (mode is GameSave.ModeType.Ill)
|
||||
AddModeAnime(path, GameSave.ModeType.Ill, IllAnimes, line, pngAnimeInfos);
|
||||
var mode = (ModeType)Enum.Parse(typeof(ModeType), line.Find("mode").Info, true);
|
||||
if (mode is ModeType.Happy)
|
||||
AddModeAnime(path, ModeType.Happy, HappyAnimes, line, pngAnimeInfos);
|
||||
else if (mode is ModeType.Nomal)
|
||||
AddModeAnime(path, ModeType.Nomal, NomalAnimes, line, pngAnimeInfos);
|
||||
else if (mode is ModeType.PoorCondition)
|
||||
AddModeAnime(path, ModeType.PoorCondition, PoorConditionAnimes, line, pngAnimeInfos);
|
||||
else if (mode is ModeType.Ill)
|
||||
AddModeAnime(path, ModeType.Ill, IllAnimes, line, pngAnimeInfos);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -211,7 +200,7 @@ public class FoodAnimeTypeModel
|
||||
/// <param name="pngAnimeInfos">PNG动画信息</param>
|
||||
public void AddModeAnime(
|
||||
string path,
|
||||
GameSave.ModeType mode,
|
||||
ModeType mode,
|
||||
ObservableCollection<FoodAnimeModel> foodAnimes,
|
||||
ILine line,
|
||||
List<PNGAnimeInfo> pngAnimeInfos
|
||||
@ -232,7 +221,7 @@ public class FoodAnimeTypeModel
|
||||
// 若没有则获取通用动画
|
||||
anime.FrontImages = GetImages(
|
||||
path,
|
||||
frontLayAnimes.First(i => i.Mode == GameSave.ModeType.Nomal)
|
||||
frontLayAnimes.First(i => i.Mode == ModeType.Nomal)
|
||||
);
|
||||
}
|
||||
if (backLayAnimes.FirstOrDefault(i => i.Mode == mode) is PNGAnimeInfo backAnimeInfo)
|
||||
@ -241,10 +230,7 @@ public class FoodAnimeTypeModel
|
||||
}
|
||||
else
|
||||
{
|
||||
anime.BackImages = GetImages(
|
||||
path,
|
||||
backLayAnimes.First(i => i.Mode == GameSave.ModeType.Nomal)
|
||||
);
|
||||
anime.BackImages = GetImages(path, backLayAnimes.First(i => i.Mode == ModeType.Nomal));
|
||||
}
|
||||
foodAnimes.Add(anime);
|
||||
|
||||
@ -253,13 +239,10 @@ public class FoodAnimeTypeModel
|
||||
return new(
|
||||
Directory
|
||||
.EnumerateFiles(Path.Combine(path, pngAnimeInfo.Path))
|
||||
.Select(
|
||||
i =>
|
||||
new ImageModel(
|
||||
Utils.LoadImageToMemoryStream(i),
|
||||
int.Parse(Path.GetFileNameWithoutExtension(i).Split('_')[2])
|
||||
)
|
||||
)
|
||||
.Select(i => new ImageModel(
|
||||
NativeUtils.LoadImageToMemoryStream(i),
|
||||
int.Parse(Path.GetFileNameWithoutExtension(i).Split('_')[2])
|
||||
))
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -283,13 +266,13 @@ public class FoodAnimeTypeModel
|
||||
return;
|
||||
}
|
||||
if (HappyAnimes.Count > 0)
|
||||
SaveAnimeInfo(animePath, HappyAnimes, GameSave.ModeType.Happy);
|
||||
SaveAnimeInfo(animePath, HappyAnimes, ModeType.Happy);
|
||||
if (NomalAnimes.Count > 0)
|
||||
SaveAnimeInfo(animePath, NomalAnimes, GameSave.ModeType.Nomal);
|
||||
SaveAnimeInfo(animePath, NomalAnimes, ModeType.Nomal);
|
||||
if (PoorConditionAnimes.Count > 0)
|
||||
SaveAnimeInfo(animePath, PoorConditionAnimes, GameSave.ModeType.PoorCondition);
|
||||
SaveAnimeInfo(animePath, PoorConditionAnimes, ModeType.PoorCondition);
|
||||
if (IllAnimes.Count > 0)
|
||||
SaveAnimeInfo(animePath, IllAnimes, GameSave.ModeType.Ill);
|
||||
SaveAnimeInfo(animePath, IllAnimes, ModeType.Ill);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -301,7 +284,7 @@ public class FoodAnimeTypeModel
|
||||
private void SaveAnimeInfo(
|
||||
string animePath,
|
||||
ObservableCollection<FoodAnimeModel> animes,
|
||||
GameSave.ModeType mode
|
||||
ModeType mode
|
||||
)
|
||||
{
|
||||
var modeAnimePath = Path.Combine(animePath, mode.ToString());
|
||||
@ -355,7 +338,7 @@ public class FoodAnimeTypeModel
|
||||
string frontLayName,
|
||||
string backLayName,
|
||||
FoodAnimeModel anime,
|
||||
GameSave.ModeType mode
|
||||
ModeType mode
|
||||
)
|
||||
{
|
||||
var lps = new LPS()
|
||||
@ -395,9 +378,9 @@ public class PNGAnimeInfo
|
||||
{
|
||||
public string Name { get; }
|
||||
public string Path { get; }
|
||||
public GameSave.ModeType Mode { get; }
|
||||
public ModeType Mode { get; }
|
||||
|
||||
public PNGAnimeInfo(string name, string path, GameSave.ModeType mode)
|
||||
public PNGAnimeInfo(string name, string path, ModeType mode)
|
||||
{
|
||||
Name = name;
|
||||
Path = path;
|
||||
|
@ -1,8 +1,4 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using LinePutScript;
|
||||
using LinePutScript.Converter;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
@ -10,6 +6,9 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript;
|
||||
using LinePutScript.Converter;
|
||||
using VPet_Simulator.Windows.Interface;
|
||||
|
||||
namespace VPet.ModMaker.Models;
|
||||
@ -153,7 +152,7 @@ public class FoodModel : I18nModel<I18nFoodModel>
|
||||
Price.Value = food.Price;
|
||||
Exp.Value = food.Exp;
|
||||
if (File.Exists(food.Image))
|
||||
Image.Value = Utils.LoadImageToMemoryStream(food.Image);
|
||||
Image.Value = NativeUtils.LoadImageToMemoryStream(food.Image);
|
||||
}
|
||||
|
||||
public Food ToFood()
|
||||
|
@ -1,10 +1,4 @@
|
||||
using HKW.HKWUtils;
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using LinePutScript;
|
||||
using LinePutScript.Converter;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
@ -14,6 +8,11 @@ using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript;
|
||||
using LinePutScript.Converter;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using VPet.ModMaker.Models.ModModel;
|
||||
using VPet.ModMaker.Views.ModEdit.I18nEdit;
|
||||
using VPet_Simulator.Core;
|
||||
@ -170,7 +169,7 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
AuthorID = loader.AuthorID;
|
||||
var imagePath = Path.Combine(loader.ModPath.FullName, "icon.png");
|
||||
if (File.Exists(imagePath))
|
||||
Image.Value = Utils.LoadImageToMemoryStream(imagePath);
|
||||
Image.Value = NativeUtils.LoadImageToMemoryStream(imagePath);
|
||||
foreach (var food in loader.Foods)
|
||||
Foods.Add(new(food));
|
||||
foreach (var clickText in loader.ClickTexts)
|
||||
@ -544,14 +543,13 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
lps.Add(LPSConvert.SerializeObjectToLine<Line>(food.ToFood(), "food"));
|
||||
foreach (var cultureName in I18nHelper.Current.CultureNames)
|
||||
{
|
||||
SaveI18nDatas[cultureName].TryAdd(
|
||||
food.Id.Value,
|
||||
food.I18nDatas[cultureName].Name.Value
|
||||
);
|
||||
SaveI18nDatas[cultureName].TryAdd(
|
||||
food.DescriptionId.Value,
|
||||
food.I18nDatas[cultureName].Description.Value
|
||||
);
|
||||
SaveI18nDatas[cultureName]
|
||||
.TryAdd(food.Id.Value, food.I18nDatas[cultureName].Name.Value);
|
||||
SaveI18nDatas[cultureName]
|
||||
.TryAdd(
|
||||
food.DescriptionId.Value,
|
||||
food.I18nDatas[cultureName].Description.Value
|
||||
);
|
||||
}
|
||||
}
|
||||
File.WriteAllText(foodFile, lps.ToString());
|
||||
@ -593,14 +591,10 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
lps.Add(LPSConvert.SerializeObjectToLine<Line>(text.ToSelectText(), "SelectText"));
|
||||
foreach (var cultureName in I18nHelper.Current.CultureNames)
|
||||
{
|
||||
SaveI18nDatas[cultureName].TryAdd(
|
||||
text.Id.Value,
|
||||
text.I18nDatas[cultureName].Text.Value
|
||||
);
|
||||
SaveI18nDatas[cultureName].TryAdd(
|
||||
text.ChooseId.Value,
|
||||
text.I18nDatas[cultureName].Choose.Value
|
||||
);
|
||||
SaveI18nDatas[cultureName]
|
||||
.TryAdd(text.Id.Value, text.I18nDatas[cultureName].Text.Value);
|
||||
SaveI18nDatas[cultureName]
|
||||
.TryAdd(text.ChooseId.Value, text.I18nDatas[cultureName].Choose.Value);
|
||||
}
|
||||
}
|
||||
File.WriteAllText(textFile, lps.ToString());
|
||||
@ -622,10 +616,8 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
lps.Add(LPSConvert.SerializeObjectToLine<Line>(text.ToLowText(), "lowfoodtext"));
|
||||
foreach (var cultureName in I18nHelper.Current.CultureNames)
|
||||
{
|
||||
SaveI18nDatas[cultureName].TryAdd(
|
||||
text.Id.Value,
|
||||
text.I18nDatas[cultureName].Text.Value
|
||||
);
|
||||
SaveI18nDatas[cultureName]
|
||||
.TryAdd(text.Id.Value, text.I18nDatas[cultureName].Text.Value);
|
||||
}
|
||||
}
|
||||
File.WriteAllText(textFile, lps.ToString());
|
||||
@ -647,10 +639,8 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
lps.Add(LPSConvert.SerializeObjectToLine<Line>(text.ToClickText(), "clicktext"));
|
||||
foreach (var cultureName in I18nHelper.Current.CultureNames)
|
||||
{
|
||||
SaveI18nDatas[cultureName].TryAdd(
|
||||
text.Id.Value,
|
||||
text.I18nDatas[cultureName].Text.Value
|
||||
);
|
||||
SaveI18nDatas[cultureName]
|
||||
.TryAdd(text.Id.Value, text.I18nDatas[cultureName].Text.Value);
|
||||
}
|
||||
}
|
||||
File.WriteAllText(textFile, lps.ToString());
|
||||
|
@ -1,9 +1,4 @@
|
||||
using HKW.HKWUtils;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript;
|
||||
using LinePutScript.Converter;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.IO;
|
||||
@ -12,6 +7,11 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript;
|
||||
using LinePutScript.Converter;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using VPet.ModMaker.Models.ModModel;
|
||||
using VPet_Simulator.Core;
|
||||
|
||||
@ -235,18 +235,15 @@ public class PetModel : I18nModel<I18nPetInfoModel>
|
||||
{
|
||||
foreach (var cultureName in I18nHelper.Current.CultureNames)
|
||||
{
|
||||
ModInfoModel.SaveI18nDatas[cultureName].TryAdd(
|
||||
Id.Value,
|
||||
I18nDatas[cultureName].Name.Value
|
||||
);
|
||||
ModInfoModel.SaveI18nDatas[cultureName].TryAdd(
|
||||
PetNameId.Value,
|
||||
I18nDatas[cultureName].PetName.Value
|
||||
);
|
||||
ModInfoModel.SaveI18nDatas[cultureName].TryAdd(
|
||||
DescriptionId.Value,
|
||||
I18nDatas[cultureName].Description.Value
|
||||
);
|
||||
ModInfoModel
|
||||
.SaveI18nDatas[cultureName]
|
||||
.TryAdd(Id.Value, I18nDatas[cultureName].Name.Value);
|
||||
ModInfoModel
|
||||
.SaveI18nDatas[cultureName]
|
||||
.TryAdd(PetNameId.Value, I18nDatas[cultureName].PetName.Value);
|
||||
ModInfoModel
|
||||
.SaveI18nDatas[cultureName]
|
||||
.TryAdd(DescriptionId.Value, I18nDatas[cultureName].Description.Value);
|
||||
}
|
||||
var petFile = Path.Combine(path, $"{Id.Value}.lps");
|
||||
if (File.Exists(petFile) is false)
|
||||
@ -299,10 +296,9 @@ public class PetModel : I18nModel<I18nPetInfoModel>
|
||||
lps.Add(LPSConvert.SerializeObjectToLine<Line>(work.ToWork(), "work"));
|
||||
foreach (var cultureName in I18nHelper.Current.CultureNames)
|
||||
{
|
||||
ModInfoModel.SaveI18nDatas[cultureName].TryAdd(
|
||||
work.Id.Value,
|
||||
work.I18nDatas[cultureName].Name.Value
|
||||
);
|
||||
ModInfoModel
|
||||
.SaveI18nDatas[cultureName]
|
||||
.TryAdd(work.Id.Value, work.I18nDatas[cultureName].Name.Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -338,7 +334,8 @@ public class PetModel : I18nModel<I18nPetInfoModel>
|
||||
if (TouchBodyRect != Default.TouchBodyRect && TouchBodyRect != mainPet.TouchBodyRect)
|
||||
SavePetTouchBodyInfo(lps);
|
||||
if (
|
||||
TouchRaisedRect != Default.TouchRaisedRect && TouchRaisedRect != mainPet.TouchRaisedRect
|
||||
TouchRaisedRect != Default.TouchRaisedRect
|
||||
&& TouchRaisedRect != mainPet.TouchRaisedRect
|
||||
)
|
||||
SavePetTouchRaisedInfo(lps);
|
||||
if (RaisePoint != Default.RaisePoint && RaisePoint != mainPet.RaisePoint)
|
||||
|
@ -1,11 +1,12 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
namespace VPet.ModMaker.Models;
|
||||
|
||||
@ -36,7 +37,7 @@ public class WorkModel : I18nModel<I18nWorkModel>
|
||||
/// <summary>
|
||||
/// 收获倍率
|
||||
/// </summary>
|
||||
public ObservableValue<double> MoneyLevel { get; } = new();
|
||||
//public ObservableValue<double> MoneyLevel { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 收获基础
|
||||
@ -78,6 +79,11 @@ public class WorkModel : I18nModel<I18nWorkModel>
|
||||
/// </summary>
|
||||
public ObservableValue<bool> IsOverLoad { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 图片
|
||||
/// </summary>
|
||||
public ObservableValue<BitmapImage> Image { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 类型
|
||||
/// </summary>
|
||||
@ -134,7 +140,7 @@ public class WorkModel : I18nModel<I18nWorkModel>
|
||||
IsOverLoad.AddNotifySender(
|
||||
WorkType,
|
||||
MoneyBase,
|
||||
MoneyLevel,
|
||||
//MoneyLevel,
|
||||
StrengthFood,
|
||||
StrengthDrink,
|
||||
Feeling,
|
||||
@ -153,7 +159,7 @@ public class WorkModel : I18nModel<I18nWorkModel>
|
||||
WorkType.Value = model.WorkType.Value;
|
||||
Id.Value = model.Id.Value;
|
||||
Graph.Value = model.Graph.Value;
|
||||
MoneyLevel.Value = model.MoneyLevel.Value;
|
||||
//MoneyLevel.Value = model.MoneyLevel.Value;
|
||||
MoneyBase.Value = model.MoneyBase.Value;
|
||||
StrengthFood.Value = model.StrengthFood.Value;
|
||||
StrengthDrink.Value = model.StrengthDrink.Value;
|
||||
@ -183,7 +189,7 @@ public class WorkModel : I18nModel<I18nWorkModel>
|
||||
WorkType.Value = work.Type;
|
||||
Id.Value = work.Name;
|
||||
Graph.Value = work.Graph;
|
||||
MoneyLevel.Value = work.MoneyLevel;
|
||||
//MoneyLevel.Value = work.MoneyLevel;
|
||||
MoneyBase.Value = work.MoneyBase;
|
||||
StrengthFood.Value = work.StrengthFood;
|
||||
StrengthDrink.Value = work.StrengthDrink;
|
||||
@ -214,7 +220,7 @@ public class WorkModel : I18nModel<I18nWorkModel>
|
||||
Type = WorkType.Value,
|
||||
Name = Id.Value,
|
||||
Graph = Graph.Value,
|
||||
MoneyLevel = MoneyLevel.Value,
|
||||
//MoneyLevel = MoneyLevel.Value,
|
||||
MoneyBase = MoneyBase.Value,
|
||||
StrengthFood = StrengthFood.Value,
|
||||
StrengthDrink = StrengthDrink.Value,
|
||||
@ -223,17 +229,22 @@ public class WorkModel : I18nModel<I18nWorkModel>
|
||||
Time = Time.Value,
|
||||
FinishBonus = FinishBonus.Value,
|
||||
//
|
||||
BorderBrush = BorderBrush.Value.ToString().Substring(3),
|
||||
Background = Background.Value.ToString().Substring(3),
|
||||
ButtonBackground = ButtonBackground.Value.ToString().Substring(3),
|
||||
ButtonForeground = ButtonForeground.Value.ToString().Substring(3),
|
||||
Foreground = Foreground.Value.ToString().Substring(3),
|
||||
BorderBrush = BorderBrush.Value.ToString()[3..],
|
||||
Background = Background.Value.ToString()[3..],
|
||||
ButtonBackground = ButtonBackground.Value.ToString()[3..],
|
||||
ButtonForeground = ButtonForeground.Value.ToString()[3..],
|
||||
Foreground = Foreground.Value.ToString()[3..],
|
||||
//
|
||||
Left = Left.Value,
|
||||
Top = Top.Value,
|
||||
Width = Width.Value,
|
||||
};
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Image.Value.CloseStream();
|
||||
}
|
||||
}
|
||||
|
||||
public class I18nWorkModel
|
||||
|
@ -1,9 +1,10 @@
|
||||
<ResourceDictionary
|
||||
x:Class="VPet.ModMaker.NativeStyles"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/Panuon.WPF.UI;component/Control.xaml" />
|
||||
<pu:StyleDictionary Includes="All" />
|
||||
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
|
||||
<ResourceDictionary Source="Converters.xaml" />
|
||||
<ResourceDictionary Source="Templates.xaml" />
|
||||
|
@ -1,54 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// 有关程序集的一般信息由以下
|
||||
// 控制。更改这些特性值可修改
|
||||
// 与程序集关联的信息。
|
||||
[assembly: AssemblyTitle("VPet.ModMaker")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("VPet.ModMaker")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2023")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
//将 ComVisible 设置为 false 将使此程序集中的类型
|
||||
//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型,
|
||||
//请将此类型的 ComVisible 特性设置为 true。
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//若要开始生成可本地化的应用程序,请设置
|
||||
//.csproj 文件中的 <UICulture>CultureYouAreCodingWith</UICulture>
|
||||
//例如,如果您在源文件中使用的是美国英语,
|
||||
//使用的是美国英语,请将 <UICulture> 设置为 en-US。 然后取消
|
||||
//对以下 NeutralResourceLanguage 特性的注释。 更新
|
||||
//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //主题特定资源词典所处位置
|
||||
//(未在页面中找到资源时使用,
|
||||
//或应用程序资源字典中找到时使用)
|
||||
ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
|
||||
//(未在页面中找到资源时使用,
|
||||
//、应用程序或任何主题专用资源字典中找到时使用)
|
||||
)]
|
||||
|
||||
// 程序集的版本信息由下列四个值组成:
|
||||
//
|
||||
// 主版本
|
||||
// 次版本
|
||||
// 生成号
|
||||
// 修订号
|
||||
//
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
|
||||
//通过使用 "*",如下所示:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
@ -117,8 +117,8 @@ public class ObservableValueGroup<T> : IEnumerable<ObservableValue<T>?>
|
||||
/// <inheritdoc/>
|
||||
public IEnumerator<ObservableValue<T>?> GetEnumerator()
|
||||
{
|
||||
return _bindingValues.Values
|
||||
.Select(v => v.TryGetTarget(out var t) ? t : null)
|
||||
return _bindingValues
|
||||
.Values.Select(v => v.TryGetTarget(out var t) ? t : null)
|
||||
.GetEnumerator();
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ namespace HKW.HKWUtils;
|
||||
/// <summary>
|
||||
/// 拓展
|
||||
/// </summary>
|
||||
public static class Extensions
|
||||
public static class NativeExtensions
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
|
@ -1,72 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace HKW.HKWUtils;
|
||||
|
||||
/// <summary>
|
||||
/// 哈希值
|
||||
/// </summary>
|
||||
public class HashCode
|
||||
{
|
||||
/// <summary>
|
||||
/// 默认种子
|
||||
/// </summary>
|
||||
public const int DefaultSeed = 114514;
|
||||
|
||||
/// <summary>
|
||||
/// 默认系数
|
||||
/// </summary>
|
||||
public const int DefaultFactor = 1919810;
|
||||
|
||||
/// <summary>
|
||||
/// 组合哈希值
|
||||
/// </summary>
|
||||
/// <param name="values">值</param>
|
||||
/// <returns>组合的哈希值</returns>
|
||||
public static int Combine(params object[] values)
|
||||
{
|
||||
return CustomHash(DefaultSeed, DefaultFactor, values.Select(v => v.GetHashCode()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 组合哈希值
|
||||
/// </summary>
|
||||
/// <param name="seed">种子</param>
|
||||
/// <param name="factor">系数</param>
|
||||
/// <param name="values">值</param>
|
||||
/// <returns>组合的哈希值</returns>
|
||||
public static int Combine(int seed, int factor, params object[] values)
|
||||
{
|
||||
return CustomHash(seed, factor, values.Select(v => v.GetHashCode()));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义组合哈希
|
||||
/// </summary>
|
||||
/// <param name="seed">种子</param>
|
||||
/// <param name="factor">系数</param>
|
||||
/// <param name="collection">哈希集合</param>
|
||||
/// <returns>组合的哈希</returns>
|
||||
public static int CustomHash(int seed, int factor, IEnumerable<int> collection)
|
||||
{
|
||||
int hash = seed;
|
||||
foreach (int i in collection)
|
||||
hash = unchecked((hash * factor) + i);
|
||||
return hash;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 自定义组合哈希
|
||||
/// </summary>
|
||||
/// <param name="seed">种子</param>
|
||||
/// <param name="factor">系数</param>
|
||||
/// <param name="values">哈希集合</param>
|
||||
/// <returns>组合的哈希</returns>
|
||||
public static int CustomHash(int seed, int factor, params int[] values)
|
||||
{
|
||||
return CustomHash(seed, factor, collection: values);
|
||||
}
|
||||
}
|
@ -11,7 +11,7 @@ namespace HKW.HKWUtils;
|
||||
/// <summary>
|
||||
/// 工具
|
||||
/// </summary>
|
||||
public static class Utils
|
||||
public static class NativeUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// 解码像素宽度
|
@ -1,417 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{8F804A27-A57E-4799-801C-4DE96BA153BC}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>VPet.ModMaker</RootNamespace>
|
||||
<AssemblyName>VPet.ModMaker</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Deterministic>true</Deterministic>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<Nullable>enable</Nullable>
|
||||
<PublishUrl>publish\</PublishUrl>
|
||||
<Install>true</Install>
|
||||
<InstallFrom>Disk</InstallFrom>
|
||||
<UpdateEnabled>false</UpdateEnabled>
|
||||
<UpdateMode>Foreground</UpdateMode>
|
||||
<UpdateInterval>7</UpdateInterval>
|
||||
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
|
||||
<UpdatePeriodically>false</UpdatePeriodically>
|
||||
<UpdateRequired>false</UpdateRequired>
|
||||
<MapFileExtensions>true</MapFileExtensions>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>preview</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<LangVersion>preview</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="LinePutScript, Version=1.5.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\LinePutScript.1.9.2\lib\net462\LinePutScript.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="LinePutScript.Localization.WPF, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\LinePutScript.Localization.WPF.1.0.6\lib\net462\LinePutScript.Localization.WPF.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Ookii.Dialogs.Wpf, Version=5.0.0.0, Culture=neutral, PublicKeyToken=66aa232afad40158, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Ookii.Dialogs.Wpf.5.0.1\lib\net462\Ookii.Dialogs.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Panuon.WPF, Version=1.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Panuon.WPF.1.0.3\lib\net462\Panuon.WPF.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Panuon.WPF.UI, Version=1.1.16.3, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Panuon.WPF.UI.1.1.16.3\lib\net462\Panuon.WPF.UI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Design" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Security" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="VPet-Simulator.Core, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\VPet-Simulator.Core.1.0.9\lib\net462\VPet-Simulator.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="VPet-Simulator.Windows.Interface, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\VPet-Simulator.Windows.Interface.1.0.9\lib\net462\VPet-Simulator.Windows.Interface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Converters\AllTrueToCollapsedConverter.cs" />
|
||||
<Compile Include="Converters\AnyFalseToVisibleConverter.cs" />
|
||||
<Compile Include="Converters\BoolInverter.cs" />
|
||||
<Compile Include="Models\I18nModelBase.cs" />
|
||||
<Compile Include="Usings.cs" />
|
||||
<Compile Include="Converters\BrushToMediaColorConverter.cs" />
|
||||
<Compile Include="Converters\CalculatorConverter.cs" />
|
||||
<Compile Include="Converters\EqualsConverter.cs" />
|
||||
<Compile Include="Converters\FalseToCollapsedConverter.cs" />
|
||||
<Compile Include="Converters\FalseToHiddenConverter.cs" />
|
||||
<Compile Include="Converters\MediaColorToBrushConverter.cs" />
|
||||
<Compile Include="Converters\NotEqualsConverter.cs" />
|
||||
<Compile Include="Converters\NullToFalseConverter.cs" />
|
||||
<Compile Include="Converters\StringFormatConverter.cs" />
|
||||
<Compile Include="Converters\RatioMarginConverter.cs" />
|
||||
<Compile Include="Converters\MaxConverter.cs" />
|
||||
<Compile Include="Converters\MarginConverter.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableClass\INotifyPropertyChangedX.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableClass\INotifyPropertyChangingX.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableClass\ObservableClass.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableClass\PropertyChangedXEventArgs.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableClass\PropertyChangedXEventHandler.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableClass\PropertyChangingXEventArgs.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableClass\PropertyChangingXEventHandler.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableCommand\ExecuteAsyncEventHandler.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableCommand\ExecuteEventHandler.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableCommand\NotifyReceivedEventHandler.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableCommand\ObservableCommand.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableCommand\ObservableCommandT.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableValue\NotifySenderPropertyChangedHandler.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableValue\ObservableValue.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableValue\ObservableValueGroup.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableValue\ValueChangedEventArgs.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableValue\ValueChangedEventHandler.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableValue\ValueChangingEventArgs.cs" />
|
||||
<Compile Include="SimpleObservable\ObservableValue\ValueChangingEventHandler.cs" />
|
||||
<Compile Include="Utils\ObservableEnumFlags.cs" />
|
||||
<Compile Include="Utils\Expansions.cs" />
|
||||
<Compile Include="Utils\HashCode.cs" />
|
||||
<Compile Include="Utils\ObservableRange.cs" />
|
||||
<Compile Include="Utils\ObservablePoint.cs" />
|
||||
<Compile Include="Utils\ObservableRect.cs" />
|
||||
<Compile Include="Utils\Utils.cs" />
|
||||
<Compile Include="Models\EnumFlagsVM.cs" />
|
||||
<Compile Include="Models\I18nData.cs" />
|
||||
<Compile Include="Models\ModModel\AnimeModel.cs" />
|
||||
<Compile Include="Models\ModModel\AnimeTypeModel.cs" />
|
||||
<Compile Include="Models\ModModel\ClickTextModel.cs" />
|
||||
<Compile Include="Models\ModModel\FoodAnimeModel.cs" />
|
||||
<Compile Include="Models\ModModel\FoodAnimeTypeModel.cs" />
|
||||
<Compile Include="Models\ModModel\FoodLocationModel.cs" />
|
||||
<Compile Include="Models\ModModel\FoodModel.cs" />
|
||||
<Compile Include="Models\I18nHelper.cs" />
|
||||
<Compile Include="Models\I18nModel.cs" />
|
||||
<Compile Include="Models\ModModel\ImageModel.cs" />
|
||||
<Compile Include="Models\ModModel\LowTextModel.cs" />
|
||||
<Compile Include="Models\ModLoader.cs" />
|
||||
<Compile Include="Models\ModMakeHistory.cs" />
|
||||
<Compile Include="Models\ModMakerInfo.cs" />
|
||||
<Compile Include="Models\ModModel\MoveModel.cs" />
|
||||
<Compile Include="Models\ObservablePoint.cs" />
|
||||
<Compile Include="Models\ObservableRect.cs" />
|
||||
<Compile Include="Models\ObservableRange.cs" />
|
||||
<Compile Include="Models\ModModel\PetModel.cs" />
|
||||
<Compile Include="Models\ModModel\SelectTextModel.cs" />
|
||||
<Compile Include="Models\ModModel\WorkModel.cs" />
|
||||
<Compile Include="Resources\NativeResources.cs" />
|
||||
<Compile Include="NativeStyles.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\AddCultureWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\AnimeEdit\FoodAnimeEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\AnimeEdit\AnimeEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\AnimeEdit\AnimePageVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\ClickTextEdit\ClickTextEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\ClickTextEdit\ClickTextPageVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\FoodEdit\FoodPageVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\FoodEdit\FoodEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\I18nEdit\I18nEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\LowTextEdit\LowTextEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\LowTextEdit\LowTextPageVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\ModEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\MoveEdit\MoveEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\MoveEdit\MovePageVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\PetEdit\PetEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\PetEdit\PetPageVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\SaveTranslationModWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\SelectTextEdit\SelectTextEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\SelectTextEdit\SelectTextPageVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\WorkEdit\WorkEditWindowVM.cs" />
|
||||
<Compile Include="ViewModels\ModEdit\WorkEdit\WorkPageVM.cs" />
|
||||
<Compile Include="Views\ModEdit\AnimeEdit\FoodAnimeEditWindow.xaml.cs">
|
||||
<DependentUpon>FoodAnimeEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\AnimeEdit\AnimeEditWindow.xaml.cs">
|
||||
<DependentUpon>AnimeEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\AnimeEdit\AnimePage.xaml.cs">
|
||||
<DependentUpon>AnimePage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\AnimeEdit\SelectGraphTypeWindow.xaml.cs">
|
||||
<DependentUpon>SelectGraphTypeWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\ClickTextEdit\ClickTextPage.xaml.cs">
|
||||
<DependentUpon>ClickTextPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\ClickTextEdit\ClickTextEditWindow.xaml.cs">
|
||||
<DependentUpon>ClickTextEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\FoodEdit\FoodPage.xaml.cs">
|
||||
<DependentUpon>FoodPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\I18nEdit\I18nEditWindow.xaml.cs">
|
||||
<DependentUpon>I18nEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\LowTextEdit\LowTextPage.xaml.cs">
|
||||
<DependentUpon>LowTextPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\LowTextEdit\LowTextEditWindow.xaml.cs">
|
||||
<DependentUpon>LowTextEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\AddCultureWindow.xaml.cs">
|
||||
<DependentUpon>AddCultureWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\ModModel\ModInfoModel.cs" />
|
||||
<Compile Include="Models\ModMaker.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\FoodEdit\FoodEditWindow.xaml.cs">
|
||||
<DependentUpon>FoodEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\ModEditWindow.xaml.cs">
|
||||
<DependentUpon>ModEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ViewModels\ModMakerWindowVM.cs" />
|
||||
<Compile Include="Views\ModEdit\MoveEdit\MoveEditWindow.xaml.cs">
|
||||
<DependentUpon>MoveEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\MoveEdit\MovePage.xaml.cs">
|
||||
<DependentUpon>MovePage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\PetEdit\PetEditWindow.xaml.cs">
|
||||
<DependentUpon>PetEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\PetEdit\PetPage.xaml.cs">
|
||||
<DependentUpon>PetPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\SaveTranslationModWindow.xaml.cs">
|
||||
<DependentUpon>SaveTranslationModWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\SelectTextEdit\SelectTextPage.xaml.cs">
|
||||
<DependentUpon>SelectTextPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\SelectTextEdit\SelectTextEditWindow.xaml.cs">
|
||||
<DependentUpon>SelectTextEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\WorkEdit\WorkEditWindow.xaml.cs">
|
||||
<DependentUpon>WorkEditWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModEdit\WorkEdit\WorkPage.xaml.cs">
|
||||
<DependentUpon>WorkPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Views\ModMakerWindow.xaml.cs">
|
||||
<DependentUpon>ModMakerWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Include="App.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</ApplicationDefinition>
|
||||
<Page Include="NativeStyles.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<ContainsDesignTimeResources>true</ContainsDesignTimeResources>
|
||||
</Page>
|
||||
<Page Include="Converters.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Templates.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\AnimeEdit\FoodAnimeEditWindow.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\AnimeEdit\AnimeEditWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\AnimeEdit\AnimePage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\AnimeEdit\SelectGraphTypeWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\ClickTextEdit\ClickTextPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\ClickTextEdit\ClickTextEditWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\FoodEdit\FoodPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\FoodEdit\FoodEditWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\I18nEdit\I18nEditWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\LowTextEdit\LowTextPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\LowTextEdit\LowTextEditWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\AddCultureWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\ModEditWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\MoveEdit\MoveEditWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\MoveEdit\MovePage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\PetEdit\PetEditWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\PetEdit\PetPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\SaveTranslationModWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\SelectTextEdit\SelectTextPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\SelectTextEdit\SelectTextEditWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\WorkEdit\WorkEditWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModEdit\WorkEdit\WorkPage.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Views\ModMakerWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Styles.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BootstrapperPackage Include=".NETFramework,Version=v4.6.2">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>Microsoft .NET Framework 4.6.2 %28x86 和 x64%29</ProductName>
|
||||
<Install>true</Install>
|
||||
</BootstrapperPackage>
|
||||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
|
||||
<Visible>False</Visible>
|
||||
<ProductName>.NET Framework 3.5 SP1</ProductName>
|
||||
<Install>false</Install>
|
||||
</BootstrapperPackage>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\food.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0-windows</TargetFramework>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<IsWebBootstrapper>false</IsWebBootstrapper>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<BootstrapperEnabled>true</BootstrapperEnabled>
|
||||
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
|
||||
<UseWPF>true</UseWPF>
|
||||
<LangVersion>preview</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\food.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="VPet-Simulator.Core" Version="1.1.0" />
|
||||
<PackageReference Include="VPet-Simulator.Windows.Interface" Version="1.1.0" />
|
||||
<PackageReference Include="LinePutScript" Version="1.11.6" />
|
||||
<PackageReference Include="LinePutScript.Localization.WPF" Version="1.0.6" />
|
||||
<PackageReference Include="Ookii.Dialogs.Wpf" Version="5.0.1" />
|
||||
<PackageReference Include="Panuon.WPF" Version="1.1.0" />
|
||||
<PackageReference Include="Panuon.WPF.UI" Version="1.2.1" />
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -1,8 +1,4 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
@ -12,9 +8,13 @@ using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using VPet.ModMaker.Models;
|
||||
using VPet.ModMaker.Models.ModModel;
|
||||
using VPet_Simulator.Core;
|
||||
using static VPet_Simulator.Core.IGameSave;
|
||||
|
||||
namespace VPet.ModMaker.ViewModels.ModEdit.AnimeEdit;
|
||||
|
||||
@ -48,7 +48,7 @@ public class AnimeEditWindowVM
|
||||
/// <summary>
|
||||
/// 当前模式
|
||||
/// </summary>
|
||||
public GameSave.ModeType CurrentMode { get; set; }
|
||||
public ModeType CurrentMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 循环
|
||||
@ -161,13 +161,13 @@ public class AnimeEditWindowVM
|
||||
/// <param name="value">动画模型</param>
|
||||
private void AddAnimeCommand_ExecuteEvent()
|
||||
{
|
||||
if (CurrentMode is GameSave.ModeType.Happy)
|
||||
if (CurrentMode is ModeType.Happy)
|
||||
Anime.Value.HappyAnimes.Add(new());
|
||||
else if (CurrentMode is GameSave.ModeType.Nomal)
|
||||
else if (CurrentMode is ModeType.Nomal)
|
||||
Anime.Value.NomalAnimes.Add(new());
|
||||
else if (CurrentMode is GameSave.ModeType.PoorCondition)
|
||||
else if (CurrentMode is ModeType.PoorCondition)
|
||||
Anime.Value.PoorConditionAnimes.Add(new());
|
||||
else if (CurrentMode is GameSave.ModeType.Ill)
|
||||
else if (CurrentMode is ModeType.Ill)
|
||||
Anime.Value.IllAnimes.Add(new());
|
||||
}
|
||||
|
||||
@ -182,13 +182,13 @@ public class AnimeEditWindowVM
|
||||
MessageBox.Show("确定删除吗".Translate(), "", MessageBoxButton.YesNo) is MessageBoxResult.Yes
|
||||
)
|
||||
{
|
||||
if (CurrentMode is GameSave.ModeType.Happy)
|
||||
if (CurrentMode is ModeType.Happy)
|
||||
Anime.Value.HappyAnimes.Remove(value);
|
||||
else if (CurrentMode is GameSave.ModeType.Nomal)
|
||||
else if (CurrentMode is ModeType.Nomal)
|
||||
Anime.Value.NomalAnimes.Remove(value);
|
||||
else if (CurrentMode is GameSave.ModeType.PoorCondition)
|
||||
else if (CurrentMode is ModeType.PoorCondition)
|
||||
Anime.Value.PoorConditionAnimes.Remove(value);
|
||||
else if (CurrentMode is GameSave.ModeType.Ill)
|
||||
else if (CurrentMode is ModeType.Ill)
|
||||
Anime.Value.IllAnimes.Remove(value);
|
||||
value.Close();
|
||||
}
|
||||
@ -239,7 +239,7 @@ public class AnimeEditWindowVM
|
||||
BitmapImage newImage;
|
||||
try
|
||||
{
|
||||
newImage = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
newImage = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -281,13 +281,13 @@ public class AnimeEditWindowVM
|
||||
{
|
||||
if (File.Exists(path))
|
||||
{
|
||||
newImages.Add(new(Utils.LoadImageToMemoryStream(path)));
|
||||
newImages.Add(new(NativeUtils.LoadImageToMemoryStream(path)));
|
||||
}
|
||||
else if (Directory.Exists(path))
|
||||
{
|
||||
foreach (var file in Directory.EnumerateFiles(path, "*.png"))
|
||||
{
|
||||
newImages.Add(new(Utils.LoadImageToMemoryStream(path)));
|
||||
newImages.Add(new(NativeUtils.LoadImageToMemoryStream(path)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,4 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
@ -10,10 +6,14 @@ using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using VPet.ModMaker.Models;
|
||||
using VPet.ModMaker.Models.ModModel;
|
||||
using VPet.ModMaker.Resources;
|
||||
using VPet_Simulator.Core;
|
||||
using static VPet_Simulator.Core.IGameSave;
|
||||
|
||||
namespace VPet.ModMaker.ViewModels.ModEdit.AnimeEdit;
|
||||
|
||||
@ -28,7 +28,7 @@ public class FoodAnimeEditWindowVM
|
||||
/// 默认食物图片
|
||||
/// </summary>
|
||||
public static BitmapImage DefaultFoodImage { get; } =
|
||||
Utils.LoadImageToMemoryStream(NativeResources.GetStream(NativeResources.FoodImage));
|
||||
NativeUtils.LoadImageToMemoryStream(NativeResources.GetStream(NativeResources.FoodImage));
|
||||
|
||||
/// <summary>
|
||||
/// 食物图片
|
||||
@ -73,7 +73,7 @@ public class FoodAnimeEditWindowVM
|
||||
/// <summary>
|
||||
/// 当前模式
|
||||
/// </summary>
|
||||
public GameSave.ModeType CurrentMode { get; set; }
|
||||
public ModeType CurrentMode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 循环
|
||||
@ -248,7 +248,7 @@ public class FoodAnimeEditWindowVM
|
||||
{
|
||||
if (FoodImage.Value != DefaultFoodImage)
|
||||
FoodImage.Value.CloseStream();
|
||||
FoodImage.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
FoodImage.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,13 +270,13 @@ public class FoodAnimeEditWindowVM
|
||||
#region AnimeCommand
|
||||
private void AddAnimeCommand_ExecuteEvent()
|
||||
{
|
||||
if (CurrentMode is GameSave.ModeType.Happy)
|
||||
if (CurrentMode is ModeType.Happy)
|
||||
Anime.Value.HappyAnimes.Add(new());
|
||||
else if (CurrentMode is GameSave.ModeType.Nomal)
|
||||
else if (CurrentMode is ModeType.Nomal)
|
||||
Anime.Value.NomalAnimes.Add(new());
|
||||
else if (CurrentMode is GameSave.ModeType.PoorCondition)
|
||||
else if (CurrentMode is ModeType.PoorCondition)
|
||||
Anime.Value.PoorConditionAnimes.Add(new());
|
||||
else if (CurrentMode is GameSave.ModeType.Ill)
|
||||
else if (CurrentMode is ModeType.Ill)
|
||||
Anime.Value.IllAnimes.Add(new());
|
||||
}
|
||||
|
||||
@ -291,13 +291,13 @@ public class FoodAnimeEditWindowVM
|
||||
MessageBox.Show("确定删除吗".Translate(), "", MessageBoxButton.YesNo) is MessageBoxResult.Yes
|
||||
)
|
||||
{
|
||||
if (CurrentMode is GameSave.ModeType.Happy)
|
||||
if (CurrentMode is ModeType.Happy)
|
||||
Anime.Value.HappyAnimes.Remove(value);
|
||||
else if (CurrentMode is GameSave.ModeType.Nomal)
|
||||
else if (CurrentMode is ModeType.Nomal)
|
||||
Anime.Value.NomalAnimes.Remove(value);
|
||||
else if (CurrentMode is GameSave.ModeType.PoorCondition)
|
||||
else if (CurrentMode is ModeType.PoorCondition)
|
||||
Anime.Value.PoorConditionAnimes.Remove(value);
|
||||
else if (CurrentMode is GameSave.ModeType.Ill)
|
||||
else if (CurrentMode is ModeType.Ill)
|
||||
Anime.Value.IllAnimes.Remove(value);
|
||||
value.Close();
|
||||
}
|
||||
@ -365,7 +365,7 @@ public class FoodAnimeEditWindowVM
|
||||
BitmapImage newImage;
|
||||
try
|
||||
{
|
||||
newImage = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
newImage = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -439,7 +439,7 @@ public class FoodAnimeEditWindowVM
|
||||
BitmapImage newImage;
|
||||
try
|
||||
{
|
||||
newImage = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
newImage = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@ -467,13 +467,13 @@ public class FoodAnimeEditWindowVM
|
||||
{
|
||||
if (File.Exists(path))
|
||||
{
|
||||
newImages.Add(new(Utils.LoadImageToMemoryStream(path)));
|
||||
newImages.Add(new(NativeUtils.LoadImageToMemoryStream(path)));
|
||||
}
|
||||
else if (Directory.Exists(path))
|
||||
{
|
||||
foreach (var file in Directory.EnumerateFiles(path, "*.png"))
|
||||
{
|
||||
newImages.Add(new(Utils.LoadImageToMemoryStream(path)));
|
||||
newImages.Add(new(NativeUtils.LoadImageToMemoryStream(path)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,4 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
@ -10,6 +6,9 @@ using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using VPet.ModMaker.Models;
|
||||
using VPet_Simulator.Windows.Interface;
|
||||
|
||||
@ -69,7 +68,7 @@ public class FoodEditWindowVM
|
||||
};
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
Food.Value.Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
Food.Value.Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +83,7 @@ public class FoodEditWindowVM
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
Food.Value.Image.Value?.StreamSource?.Close();
|
||||
Food.Value.Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
Food.Value.Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,23 +1,23 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
using VPet.ModMaker.Models;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel;
|
||||
using VPet.ModMaker.Views.ModEdit;
|
||||
using System.Windows;
|
||||
using System.IO;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Panuon.WPF.UI;
|
||||
using VPet.ModMaker.Views.ModEdit.I18nEdit;
|
||||
using System.Globalization;
|
||||
using Microsoft.Win32;
|
||||
using Ookii.Dialogs.Wpf;
|
||||
using Panuon.WPF.UI;
|
||||
using VPet.ModMaker.Models;
|
||||
using VPet.ModMaker.Views.ModEdit;
|
||||
using VPet.ModMaker.Views.ModEdit.I18nEdit;
|
||||
|
||||
namespace VPet.ModMaker.ViewModels.ModEdit;
|
||||
|
||||
@ -138,7 +138,9 @@ public class ModEditWindowVM
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
ModInfo.Value.Image.Value?.StreamSource?.Close();
|
||||
ModInfo.Value.Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
ModInfo.Value.Image.Value = NativeUtils.LoadImageToMemoryStream(
|
||||
openFileDialog.FileName
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using VPet.ModMaker.Models;
|
||||
|
||||
namespace VPet.ModMaker.ViewModels.ModEdit.MoveEdit;
|
||||
@ -56,7 +55,7 @@ public class MoveEditWindowVM
|
||||
};
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,7 +70,7 @@ public class MoveEditWindowVM
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
Image.Value?.StreamSource?.Close();
|
||||
Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,13 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using VPet.ModMaker.Models;
|
||||
|
||||
namespace VPet.ModMaker.ViewModels.ModEdit.PetEdit;
|
||||
@ -56,7 +55,7 @@ public class PetEditWindowVM
|
||||
};
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -71,7 +70,7 @@ public class PetEditWindowVM
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
Image.Value?.StreamSource?.Close();
|
||||
Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,14 +1,14 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using VPet.ModMaker.Models;
|
||||
using VPet_Simulator.Windows.Interface;
|
||||
|
||||
namespace VPet.ModMaker.ViewModels.ModEdit.WorkEdit;
|
||||
|
||||
@ -23,29 +23,24 @@ public class WorkEditWindowVM
|
||||
#endregion
|
||||
public ObservableValue<double> BorderLength { get; } = new(250);
|
||||
public ObservableValue<double> LengthRatio { get; } = new(250.0 / 500.0);
|
||||
public ObservableValue<BitmapImage> Image { get; } = new();
|
||||
#region Command
|
||||
public ObservableCommand AddImageCommand { get; } = new();
|
||||
public ObservableCommand ChangeImageCommand { get; } = new();
|
||||
|
||||
public ObservableCommand FixOverLoadCommand { get; } = new();
|
||||
#endregion
|
||||
public WorkEditWindowVM()
|
||||
{
|
||||
AddImageCommand.ExecuteCommand += AddImage;
|
||||
ChangeImageCommand.ExecuteCommand += ChangeImage;
|
||||
Image.ValueChanged += Image_ValueChanged;
|
||||
FixOverLoadCommand.ExecuteCommand += FixOverLoadCommand_ExecuteCommand;
|
||||
}
|
||||
|
||||
private void Image_ValueChanged(
|
||||
ObservableValue<BitmapImage> sender,
|
||||
ValueChangedEventArgs<BitmapImage> e
|
||||
)
|
||||
private void FixOverLoadCommand_ExecuteCommand()
|
||||
{
|
||||
//LengthRatio.EnumValue = BorderLength.EnumValue / value.PixelWidth;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Image.Value?.CloseStream();
|
||||
var work = Work.Value.ToWork();
|
||||
work.FixOverLoad();
|
||||
Work.Value = new(work);
|
||||
}
|
||||
|
||||
private void AddImage()
|
||||
@ -58,7 +53,7 @@ public class WorkEditWindowVM
|
||||
};
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
Work.Value.Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,8 +67,8 @@ public class WorkEditWindowVM
|
||||
};
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
Image.Value?.StreamSource?.Close();
|
||||
Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
Work.Value.Image.Value?.CloseStream();
|
||||
Work.Value.Image.Value = NativeUtils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,13 +1,12 @@
|
||||
using HKW.HKWUtils.Observable;
|
||||
|
||||
using LinePutScript.Localization.WPF;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using HKW.HKWUtils.Observable;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using VPet.ModMaker.Models;
|
||||
using VPet.ModMaker.Views.ModEdit.WorkEdit;
|
||||
|
||||
@ -60,15 +59,13 @@ public class WorkPageVM
|
||||
else
|
||||
{
|
||||
ShowWorks.Value = new(
|
||||
Works.Where(
|
||||
m => m.Id.Value.Contains(e.NewValue, StringComparison.OrdinalIgnoreCase)
|
||||
Works.Where(m =>
|
||||
m.Id.Value.Contains(e.NewValue, StringComparison.OrdinalIgnoreCase)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public void Close() { }
|
||||
|
||||
private void Add()
|
||||
{
|
||||
var window = new WorkEditWindow();
|
||||
|
@ -1,5 +1,4 @@
|
||||
using LinePutScript.Localization.WPF;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@ -12,10 +11,12 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using VPet.ModMaker.Models;
|
||||
using VPet.ModMaker.Models.ModModel;
|
||||
using VPet.ModMaker.ViewModels.ModEdit.AnimeEdit;
|
||||
using VPet_Simulator.Core;
|
||||
using static VPet_Simulator.Core.IGameSave;
|
||||
|
||||
namespace VPet.ModMaker.Views.ModEdit.AnimeEdit;
|
||||
|
||||
@ -61,7 +62,7 @@ public partial class AnimeEditWindow : Window
|
||||
|| item.Tag is not string str
|
||||
)
|
||||
return;
|
||||
if (Enum.TryParse<GameSave.ModeType>(str, true, out var mode))
|
||||
if (Enum.TryParse<ModeType>(str, true, out var mode))
|
||||
{
|
||||
ViewModel.CurrentMode = mode;
|
||||
ViewModel.CurrentImageModel.Value = null;
|
||||
|
@ -1,5 +1,4 @@
|
||||
using LinePutScript.Localization.WPF;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -13,10 +12,12 @@ using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using VPet.ModMaker.Models;
|
||||
using VPet.ModMaker.Models.ModModel;
|
||||
using VPet.ModMaker.ViewModels.ModEdit.AnimeEdit;
|
||||
using VPet_Simulator.Core;
|
||||
using static VPet_Simulator.Core.IGameSave;
|
||||
|
||||
namespace VPet.ModMaker.Views.ModEdit.AnimeEdit;
|
||||
|
||||
@ -64,7 +65,7 @@ public partial class FoodAnimeEditWindow : Window
|
||||
|| item.Tag is not string str
|
||||
)
|
||||
return;
|
||||
if (Enum.TryParse<GameSave.ModeType>(str, true, out var mode))
|
||||
if (Enum.TryParse<ModeType>(str, true, out var mode))
|
||||
{
|
||||
ViewModel.CurrentMode = mode;
|
||||
ViewModel.CurrentFrontImageModel.Value = null;
|
||||
|
@ -145,10 +145,17 @@
|
||||
Grid.Column="1"
|
||||
Text="{Binding Work.Value.Graph.Value}" />
|
||||
<Label Grid.Row="4" Content="{ll:Str 是否超模}" />
|
||||
<TextBlock
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Text="{Binding Work.Value.IsOverLoad.Value}" />
|
||||
<Grid Grid.Row="4" Grid.Column="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBlock
|
||||
d:Text="True"
|
||||
Style="{DynamicResource TextBlock_LeftCenter}"
|
||||
Text="{Binding Work.Value.IsOverLoad.Value}" />
|
||||
<Button Grid.Column="1" Content="{ll:Str 修复超模}" />
|
||||
</Grid>
|
||||
<!--<Label Grid.Row="3" Content="{ll:Str 宠物描述}" />
|
||||
<TextBox
|
||||
Grid.Row="3"
|
||||
@ -185,11 +192,11 @@
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="{ll:Str 基础倍率}" />
|
||||
<pu:NumberInput Grid.Column="1" Value="{Binding Work.Value.MoneyBase.Value}" />
|
||||
<Label Grid.Row="1" Content="{ll:Str 等级倍率}" />
|
||||
<!--<Label Grid.Row="1" Content="{ll:Str 等级倍率}" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Work.Value.MoneyLevel.Value}" />
|
||||
Value="{Binding Work.Value.MoneyLevel.Value}" />-->
|
||||
<Label Grid.Row="2" Content="{ll:Str 饱食度消耗倍率}" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="2"
|
||||
|
@ -145,13 +145,13 @@
|
||||
Header="{ll:Str 基本倍率}"
|
||||
IsReadOnly="True"
|
||||
SortMemberPath="MoneyBase.Value" />
|
||||
<DataGridTextColumn
|
||||
<!--<DataGridTextColumn
|
||||
Binding="{Binding MoneyLevel.Value}"
|
||||
CanUserSort="True"
|
||||
ElementStyle="{DynamicResource TextBlock_LeftCenter}"
|
||||
Header="{ll:Str 等级倍率}"
|
||||
IsReadOnly="True"
|
||||
SortMemberPath="MoneyLevel.Value" />
|
||||
SortMemberPath="MoneyLevel.Value" />-->
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding StrengthFood.Value}"
|
||||
CanUserSort="True"
|
||||
|
@ -1,10 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="LinePutScript" version="1.9.2" targetFramework="net462" />
|
||||
<package id="LinePutScript.Localization.WPF" version="1.0.6" targetFramework="net462" />
|
||||
<package id="Ookii.Dialogs.Wpf" version="5.0.1" targetFramework="net462" />
|
||||
<package id="Panuon.WPF" version="1.0.3" targetFramework="net462" />
|
||||
<package id="Panuon.WPF.UI" version="1.1.16.3" targetFramework="net462" />
|
||||
<package id="VPet-Simulator.Core" version="1.0.9" targetFramework="net462" />
|
||||
<package id="VPet-Simulator.Windows.Interface" version="1.0.9" targetFramework="net462" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user