This commit is contained in:
Hakoyu 2023-11-02 23:13:59 +08:00
parent ea3a8f0cac
commit e7fcbb0050
6 changed files with 60 additions and 9 deletions

View File

@ -139,25 +139,21 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
LowTexts.Add(new(lowText));
foreach (var selectText in loader.SelectTexts)
SelectTexts.Add(new(selectText));
// 缓存pets
var pets = new List<PetModel>();
foreach (var pet in loader.Pets)
{
var petModel = new PetModel(pet);
pets.Add(petModel);
Pets.Add(petModel);
foreach (var p in pet.path)
LoadAnime(petModel, p);
}
// 先载入本体宠物
// 入本体宠物
foreach (var pet in ModMakerInfo.Pets)
{
// 确保Id不重复
if (pets.All(i => i.Id.Value != pet.SourceId))
Pets.Add(pet);
if (Pets.All(i => i.Id.Value != pet.SourceId))
Pets.Insert(0, pet);
}
// 再载入模组宠物
foreach (var pet in pets)
Pets.Add(pet);
foreach (var lang in loader.I18nDatas)
I18nDatas.Add(lang.Key, lang.Value);

View File

@ -55,6 +55,7 @@ public static class Utils
{
var bytes = File.ReadAllBytes(imagePath);
bitmapImage.StreamSource = new MemoryStream(bytes);
bitmapImage.DecodePixelWidth = DecodePixelWidth;
}
finally
{

View File

@ -133,6 +133,7 @@
<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" />
@ -165,6 +166,9 @@
<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>
@ -286,6 +290,10 @@
<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>

View File

@ -0,0 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace VPet.ModMaker.ViewModels.ModEdit.I18nEdit;
public class I18nEditWindowVM { }

View File

@ -0,0 +1,12 @@
<Window x:Class="VPet.ModMaker.Views.ModEdit.I18nEdit.I18nEditWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:VPet.ModMaker.Views.ModEdit.I18nEdit"
mc:Ignorable="d"
Title="I18nEditWindow" Height="450" Width="800">
<Grid>
</Grid>
</Window>

View File

@ -0,0 +1,25 @@
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;
namespace VPet.ModMaker.Views.ModEdit.I18nEdit;
/// <summary>
/// I18nEditWindow.xaml 的交互逻辑
/// </summary>
public partial class I18nEditWindow : Window
{
public I18nEditWindow()
{
InitializeComponent();
}
}