支持最新ClickText数据

This commit is contained in:
Hakoyu 2023-09-05 17:48:04 +08:00
parent 45a9c5bed5
commit e9198a2c8d
29 changed files with 761 additions and 174 deletions

View File

@ -6,8 +6,10 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Panuon.WPF.UI;component/Control.xaml" />
<ResourceDictionary Source="/VPet-Simulator.Windows.Interface;component/ResourceStyle.xaml" />
<ResourceDictionary Source="Converters.xaml" />
<ResourceDictionary Source="Templates.xaml" />
<ResourceDictionary Source="Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@ -2,6 +2,7 @@
using LinePutScript.Converter;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -11,15 +12,31 @@ namespace VPet.ModMaker.Models;
public class ClickTextModel : I18nModel<I18nClickTextModel>
{
public ObservableValue<string> Name { get; } = new();
public ObservableValue<ClickText.ModeType> Mode { get; } = new();
public static ObservableCollection<ClickText.ModeType> ModeTypes { get; } =
new(Enum.GetValues(typeof(ClickText.ModeType)).Cast<ClickText.ModeType>());
public static ObservableCollection<ClickText.DayTime> DayTimes { get; } =
new(Enum.GetValues(typeof(ClickText.DayTime)).Cast<ClickText.DayTime>());
public static ObservableCollection<VPet_Simulator.Core.Main.WorkingState> WorkingStates { get; } =
new(
Enum.GetValues(typeof(VPet_Simulator.Core.Main.WorkingState))
.Cast<VPet_Simulator.Core.Main.WorkingState>()
);
public ObservableValue<string> Name { get; } = new();
public ObservableValue<string> Working { get; } = new();
public ObservableValue<double> LikeMin { get; } = new();
public ObservableValue<double> LikeMax { get; } = new();
public ObservableValue<ClickText.ModeType> Mode { get; } = new();
public ObservableValue<VPet_Simulator.Core.Main.WorkingState> WorkingState { get; } = new();
public ObservableValue<ClickText.DayTime> DayTime { get; } = new();
public ObservableRange<double> Like { get; } = new(0, int.MaxValue);
public ObservableRange<double> Health { get; } = new(0, int.MaxValue);
public ObservableRange<double> Level { get; } = new(0, int.MaxValue);
public ObservableRange<double> Money { get; } = new(int.MinValue, int.MaxValue);
public ObservableRange<double> Food { get; } = new(0, int.MaxValue);
public ObservableRange<double> Drink { get; } = new(0, int.MaxValue);
public ObservableRange<double> Feel { get; } = new(0, int.MaxValue);
public ObservableRange<double> Strength { get; } = new(0, int.MaxValue);
public ClickTextModel() { }
public ClickTextModel(ClickTextModel clickText)
@ -29,9 +46,15 @@ public class ClickTextModel : I18nModel<I18nClickTextModel>
Mode.Value = clickText.Mode.Value;
Working.Value = clickText.Working.Value;
WorkingState.Value = clickText.WorkingState.Value;
LikeMax.Value = clickText.LikeMax.Value;
LikeMin.Value = clickText.LikeMin.Value;
DayTime.Value = clickText.DayTime.Value;
Like = clickText.Like.Copy();
Health = clickText.Health.Copy();
Level = clickText.Level.Copy();
Money = clickText.Money.Copy();
Food = clickText.Food.Copy();
Drink = clickText.Drink.Copy();
Feel = clickText.Feel.Copy();
Strength = clickText.Strength.Copy();
foreach (var item in clickText.I18nDatas)
{
I18nDatas[item.Key] = new();
@ -48,8 +71,14 @@ public class ClickTextModel : I18nModel<I18nClickTextModel>
Working.Value = clickText.Working;
WorkingState.Value = clickText.State;
DayTime.Value = clickText.DaiTime;
LikeMax.Value = clickText.LikeMax;
LikeMin.Value = clickText.LikeMin;
Like.SetValue(clickText.LikeMin, clickText.LikeMax);
Health.SetValue(clickText.HealthMin, clickText.HealthMax);
Level.SetValue(clickText.LevelMin, clickText.LevelMax);
Money.SetValue(clickText.MoneyMin, clickText.MoneyMax);
Food.SetValue(clickText.FoodMin, clickText.FoodMax);
Drink.SetValue(clickText.DrinkMin, clickText.DrinkMax);
Feel.SetValue(clickText.FeelMin, clickText.FeelMax);
Strength.SetValue(clickText.StrengthMin, clickText.StrengthMax);
}
public ClickText ToClickText()
@ -60,9 +89,23 @@ public class ClickTextModel : I18nModel<I18nClickTextModel>
Mode = Mode.Value,
Working = Working.Value,
State = WorkingState.Value,
LikeMax = LikeMax.Value,
LikeMin = LikeMin.Value,
DaiTime = DayTime.Value,
LikeMax = Like.Max.Value,
LikeMin = Like.Min.Value,
HealthMin = Health.Min.Value,
HealthMax = Health.Max.Value,
LevelMin = Level.Min.Value,
LevelMax = Level.Max.Value,
MoneyMin = Money.Min.Value,
MoneyMax = Money.Max.Value,
FoodMin = Food.Min.Value,
FoodMax = Food.Max.Value,
DrinkMin = Drink.Min.Value,
DrinkMax = Drink.Max.Value,
FeelMin = Feel.Min.Value,
FeelMax = Feel.Max.Value,
StrengthMin = Strength.Min.Value,
StrengthMax = Strength.Max.Value,
};
}
}

View File

@ -1,6 +1,7 @@
using HKW.HKWViewModels.SimpleObservable;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Text;
@ -12,6 +13,9 @@ namespace VPet.ModMaker.Models;
public class FoodModel : I18nModel<I18nFoodModel>
{
public static ObservableCollection<Food.FoodType> FoodTypes { get; } =
new(Enum.GetValues(typeof(Food.FoodType)).Cast<Food.FoodType>());
public ObservableValue<string> Name { get; } = new();
public ObservableValue<string> Description { get; } = new();
public ObservableValue<Food.FoodType> Type { get; } = new();

View File

@ -1,6 +1,7 @@
using HKW.HKWViewModels.SimpleObservable;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@ -11,6 +12,13 @@ namespace VPet.ModMaker.Models;
public class LowTextModel : I18nModel<I18nLowTextModel>
{
public static ObservableCollection<LowText.ModeType> ModeTypes { get; } =
new(Enum.GetValues(typeof(LowText.ModeType)).Cast<LowText.ModeType>());
public static ObservableCollection<LowText.LikeType> LikeTypes { get; } =
new(Enum.GetValues(typeof(LowText.LikeType)).Cast<LowText.LikeType>());
public static ObservableCollection<LowText.StrengthType> StrengthTypes { get; } =
new(Enum.GetValues(typeof(LowText.StrengthType)).Cast<LowText.StrengthType>());
public ObservableValue<string> Name { get; } = new();
public ObservableValue<LowText.ModeType> Mode { get; } = new();
public ObservableValue<LowText.StrengthType> Strength { get; } = new();

View File

@ -29,6 +29,7 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
public ObservableCollection<FoodModel> Foods { get; } = new();
public ObservableCollection<ClickTextModel> ClickTexts { get; } = new();
public ObservableCollection<LowTextModel> LowTexts { get; } = new();
public ObservableCollection<SelectTextModel> SelectTexts { get; } = new();
public ObservableValue<string> SourcePath { get; } = new();
public Dictionary<string, Dictionary<string, string>> OtherI18nDatas { get; } = new();

View File

@ -33,6 +33,8 @@ public class ModMakerHistory
public string LastTimeString => LastTime.ToString("yyyy/MM/dd HH:mm:ss");
public string InfoFile => Path.Combine(SourcePath, "info.lps");
[Line(ignoreCase: true)]
public DateTime LastTime { get; set; }
}

View File

@ -0,0 +1,39 @@
using HKW.HKWViewModels.SimpleObservable;
namespace VPet.ModMaker.Models;
public class ObservableRange<T>
{
public ObservableValue<T> Min { get; } = new();
public ObservableValue<T> Max { get; } = new();
public ObservableValue<string> Info { get; } = new();
public ObservableRange()
{
Min.ValueChanged += ValueChanged;
Max.ValueChanged += ValueChanged;
}
private void ValueChanged(T value)
{
Info.Value = $"({Min.Value}, {Max.Value})";
}
public ObservableRange(T min, T max)
: this()
{
SetValue(min, max);
}
public void SetValue(T min, T max)
{
Min.Value = min;
Max.Value = max;
}
public ObservableRange<T> Copy()
{
return new(Min.Value, Max.Value);
}
}

View File

@ -16,9 +16,6 @@ public class PetModel : I18nModel<I18nPetInfoModel>
public ObservableValue<ObservableInt32Rect> TouchHeadRect { get; } = new(new());
public ObservableValue<MultiStateRect> TouchRaisedRect { get; } = new(new());
public ObservableValue<MultiStatePoint> RaisePoint { get; } = new(new());
public ObservableValue<I18nPetInfoModel> CurrentI18nData { get; } = new();
public Dictionary<string, I18nPetInfoModel> I18nDatas { get; } = new();
}
public class I18nPetInfoModel

View File

@ -0,0 +1,26 @@
using HKW.HKWViewModels.SimpleObservable;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VPet.ModMaker.Models;
namespace VPet.ModMaker.Models;
public class SelectTextModel : ClickTextModel
{
public ObservableValue<int> Exp { get; } = new();
public ObservableValue<double> Money { get; } = new();
public ObservableValue<double> Strength { get; } = new();
public ObservableValue<double> StrengthFood { get; } = new();
public ObservableValue<double> StrengthDrink { get; } = new();
public ObservableValue<double> Feeling { get; } = new();
public ObservableValue<double> Health { get; } = new();
public ObservableValue<double> Likability { get; } = new();
public ObservableValue<string> Tags { get; } = new();
public ObservableValue<string> ToTags { get; } = new();
public SelectTextModel() { }
}

View File

@ -1,24 +1,25 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本: 4.0.30319.42000
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// 对此文件的更改可能导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VPet.ModMaker.Properties {
using System;
/// <summary>
/// 强类型资源类,用于查找本地化字符串等。
/// 一个强类型资源类,用于查找本地化字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@ -32,12 +33,12 @@ namespace VPet.ModMaker.Properties {
}
/// <summary>
/// 返回此类使用的缓存 ResourceManager 实例。
/// 返回此类使用的缓存 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VPet.ModMaker.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}

View File

@ -1,28 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace VPet.ModMaker.Properties
{
namespace VPet.ModMaker.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.7.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}

View File

@ -0,0 +1,46 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
xmlns:pu="https://opensource.panuon.com/wpf-ui">
<ContextMenu x:Key="ContextMenu_DataGridRow" x:Shared="false">
<MenuItem
Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource AncestorType=Page, Mode=FindAncestor}}"
CommandParameter="{Binding DataContext, RelativeSource={RelativeSource AncestorType=DataGridRow, Mode=FindAncestor}}"
Header="{ll:Str 修改}" />
<MenuItem
Command="{Binding DataContext.RemoveCommand, RelativeSource={RelativeSource AncestorType=Page, Mode=FindAncestor}}"
CommandParameter="{Binding DataContext, RelativeSource={RelativeSource AncestorType=DataGridRow, Mode=FindAncestor}}"
Header="{ll:Str 删除}" />
</ContextMenu>
<ControlTemplate x:Key="ListBoxItem_RangeData" TargetType="ListBoxItem">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Label HorizontalContentAlignment="Center" Content="{Binding Tag, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" />
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="{ll:Str 最小值}" />
<pu:NumberInput
Grid.Column="1"
ToolTip="{Binding Value, RelativeSource={RelativeSource Mode=Self}}"
Value="{Binding DataContext.Min.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" />
<Label Grid.Row="1" Content="{ll:Str 最大值}" />
<pu:NumberInput
Grid.Row="1"
Grid.Column="1"
ToolTip="{Binding Value, RelativeSource={RelativeSource Mode=Self}}"
Value="{Binding DataContext.Max.Value, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" />
</Grid>
</Grid>
</ControlTemplate>
</ResourceDictionary>

View File

@ -6,8 +6,8 @@
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{8F804A27-A57E-4799-801C-4DE96BA153BC}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>VPet.Plugin.ModMaker</RootNamespace>
<AssemblyName>VPet.Plugin.ModMaker</AssemblyName>
<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>
@ -99,7 +99,9 @@
<Compile Include="Models\ModLoader.cs" />
<Compile Include="Models\ModMakerHistory.cs" />
<Compile Include="Models\ModMakerInfo.cs" />
<Compile Include="Models\ObservableRange.cs" />
<Compile Include="Models\PetModel.cs" />
<Compile Include="Models\SelectTextModel.cs" />
<Compile Include="ViewModels\ModEdit\ClickTextEdit\ClickTextEditWindowVM.cs" />
<Compile Include="ViewModels\ModEdit\ClickTextEdit\ClickTextPageVM.cs" />
<Compile Include="ViewModels\ModEdit\FoodEdit\FoodPageVM.cs" />
@ -159,6 +161,12 @@
<Compile Include="Views\ModEdit\PetEdit\PetPage.xaml.cs">
<DependentUpon>PetPage.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\ModMakerWindow.xaml.cs">
<DependentUpon>ModMakerWindow.xaml</DependentUpon>
</Compile>
@ -181,6 +189,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Templates.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\ModEdit\ClickTextEdit\ClickTextPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -221,6 +233,14 @@
<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\ModMakerWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -242,6 +262,8 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="ViewModels\ModEdit\SelectTextEdit\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -16,22 +16,6 @@ public class ClickTextEditWindowVM
public ClickTextModel OldClickText { get; set; }
public ObservableValue<ClickTextModel> ClickText { get; } = new(new());
public ObservableCollection<ClickText.ModeType> ModeTypes { get; } = new();
public ObservableCollection<ClickText.DayTime> DayTimes { get; } = new();
public ObservableCollection<VPet_Simulator.Core.Main.WorkingState> WorkingStates { get; } =
new();
#endregion
public ClickTextEditWindowVM()
{
foreach (ClickText.ModeType item in Enum.GetValues(typeof(ClickText.ModeType)))
ModeTypes.Add(item);
foreach (ClickText.DayTime item in Enum.GetValues(typeof(ClickText.DayTime)))
DayTimes.Add(item);
foreach (
VPet_Simulator.Core.Main.WorkingState item in Enum.GetValues(
typeof(VPet_Simulator.Core.Main.WorkingState)
)
)
WorkingStates.Add(item);
}
public ClickTextEditWindowVM() { }
}

View File

@ -19,7 +19,6 @@ public class FoodEditWindowVM
#region Value
public FoodModel OldFood { get; set; }
public ObservableValue<FoodModel> Food { get; } = new(new());
public ObservableCollection<Food.FoodType> FoodTypes { get; } = new();
#endregion
#region Command
@ -36,13 +35,7 @@ public class FoodEditWindowVM
public void Close() { }
private void InitializeFoodTypes()
{
foreach (Food.FoodType foodType in Enum.GetValues(typeof(Food.FoodType)))
{
FoodTypes.Add(foodType);
}
}
private void InitializeFoodTypes() { }
private void AddImage()
{

View File

@ -16,18 +16,7 @@ public class LowTextEditWindowVM
public LowTextModel OldLowText { get; set; }
public ObservableValue<LowTextModel> LowText { get; } = new(new());
public ObservableCollection<LowText.ModeType> ModeTypes { get; } = new();
public ObservableCollection<LowText.LikeType> LikeTypes { get; } = new();
public ObservableCollection<LowText.StrengthType> StrengthTypes { get; } = new();
#endregion
public LowTextEditWindowVM()
{
foreach (LowText.ModeType mode in Enum.GetValues(typeof(LowText.ModeType)))
ModeTypes.Add(mode);
foreach (LowText.LikeType mode in Enum.GetValues(typeof(LowText.LikeType)))
LikeTypes.Add(mode);
foreach (LowText.StrengthType mode in Enum.GetValues(typeof(LowText.StrengthType)))
StrengthTypes.Add(mode);
}
public LowTextEditWindowVM() { }
}

View File

@ -77,10 +77,6 @@ public class ModEditWindowVM
}
ModEditWindow = window;
I18nHelper.Current.AddLang += I18nData_AddLang;
I18nHelper.Current.RemoveLang += I18nData_RemoveLang;
I18nHelper.Current.ReplaceLang += I18nData_ReplaceLang;
CurrentLang.ValueChanged += CurrentLang_ValueChanged;
AddImageCommand.ExecuteAction += AddImage;
@ -92,23 +88,6 @@ public class ModEditWindowVM
SaveToCommand.ExecuteAction += SaveTo;
}
private void I18nData_AddLang(string lang)
{
ModInfo.Value.I18nDatas.Add(lang, new());
}
private void I18nData_RemoveLang(string lang)
{
ModInfo.Value.I18nDatas.Remove(lang);
}
private void I18nData_ReplaceLang(string oldLang, string newLang)
{
var info = ModInfo.Value.I18nDatas[oldLang];
ModInfo.Value.I18nDatas.Remove(oldLang);
ModInfo.Value.I18nDatas.Add(newLang, info);
}
private void CurrentLang_ValueChanged(string value)
{
if (value is null)

View File

@ -24,16 +24,16 @@ public class ModMakerWindowVM
public ModEditWindow ModEditWindow { get; private set; }
public ObservableValue<string> ModFilterText { get; } = new();
public ObservableValue<string> HistoriesFilterText { get; } = new();
public ObservableCollection<ModInfoModel> ShowMods { get; set; }
public ObservableCollection<ModInfoModel> Mods { get; } = new();
public ObservableValue<ObservableCollection<ModMakerHistory>> ShowHistories { get; } = new();
public ObservableCollection<ModMakerHistory> Histories { get; } = new();
#endregion
#region Command
public ObservableCommand CreateNewModCommand { get; } = new();
public ObservableCommand LoadModFromFileCommand { get; } = new();
public ObservableCommand ClearHistoriesCommand { get; } = new();
#endregion
public ModMakerWindowVM() { }
@ -41,10 +41,11 @@ public class ModMakerWindowVM
{
LoadHistories();
ModMakerWindow = window;
ShowMods = Mods;
ShowHistories.Value = Histories;
CreateNewModCommand.ExecuteAction = CreateNewMod;
LoadModFromFileCommand.ExecuteAction = LoadModFromFile;
ModFilterText.ValueChanged += ModFilterText_ValueChanged;
ClearHistoriesCommand.ExecuteAction = ClearHistories;
HistoriesFilterText.ValueChanged += ModFilterText_ValueChanged;
}
private void LoadHistories()
@ -96,9 +97,9 @@ public class ModMakerWindowVM
private void ModFilterText_ValueChanged(string value)
{
if (string.IsNullOrEmpty(value))
ShowMods = Mods;
ShowHistories.Value = Histories;
else
ShowMods = new(Mods.Where(i => i.Name.Value.Contains(value)));
ShowHistories.Value = new(Histories.Where(i => i.Name.Contains(value)));
}
public void CreateNewMod()
@ -117,6 +118,12 @@ public class ModMakerWindowVM
};
}
private void ClearHistories()
{
ShowHistories.Value.Clear();
Histories.Clear();
}
public void LoadModFromFile()
{
OpenFileDialog openFileDialog =

View File

@ -21,8 +21,26 @@
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="Id" />
<TextBox
Grid.Column="1"
pu:TextBoxHelper.Watermark="Id"
Style="{StaticResource TextBox_Wrap}"
Text="{Binding ClickText.Value.Name.Value, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap" />
</Grid>
<TextBox
x:Name="TextBox_Text"
Grid.Row="1"
d:Text="这是一个测试文本,这是一个测试文本,这是一个测试文本,这是一个测试文本,这是一个测试文本,这是一个测试文本,这是一个测试文本,"
pu:TextBoxHelper.Watermark="文本"
Style="{StaticResource TextBox_Wrap}"
@ -39,53 +57,68 @@
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Label Content="Id" />
<TextBox
Grid.Column="1"
Style="{StaticResource TextBox_Wrap}"
Text="{Binding ClickText.Value.Name.Value, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap" />
<Label Grid.Row="1" Content="{ll:Str 指定工作}" />
<TextBox
Grid.Row="1"
Grid.Column="1"
Text="{Binding ClickText.Value.Working.Value, UpdateSourceTrigger=PropertyChanged}" />
<Label Grid.Row="2" Content="{ll:Str 最小好感度}" />
<pu:NumberInput
Grid.Row="2"
Grid.Column="1"
Value="{Binding ClickText.Value.LikeMin.Value}" />
<Label Grid.Row="3" Content="{ll:Str 最大好感度}" />
<pu:NumberInput
<Label Content="{ll:Str 指定工作}" />
<TextBox Grid.Column="1" Text="{Binding ClickText.Value.Working.Value, UpdateSourceTrigger=PropertyChanged}" />
<Label Grid.Row="3" Content="{ll:Str 模式}" />
<ComboBox
Grid.Row="3"
Grid.Column="1"
Value="{Binding ClickText.Value.LikeMax.Value}" />
<Label Grid.Row="4" Content="{ll:Str 模式}" />
ItemsSource="{Binding ClickText.Value.ModeTypes}"
SelectedItem="{Binding ClickText.Value.Mode.Value}" />
<Label Grid.Row="4" Content="{ll:Str 工作状态}" />
<ComboBox
Grid.Row="4"
Grid.Column="1"
ItemsSource="{Binding ModeTypes}"
SelectedItem="{Binding ClickText.Value.Mode.Value}" />
<Label Grid.Row="5" Content="{ll:Str 工作状态}" />
ItemsSource="{Binding ClickText.Value.WorkingStates}"
SelectedItem="{Binding ClickText.Value.WorkingState.Value}" />
<Label Grid.Row="5" Content="{ll:Str 日期区间}" />
<ComboBox
Grid.Row="5"
Grid.Column="1"
ItemsSource="{Binding WorkingStates}"
SelectedItem="{Binding ClickText.Value.WorkingState.Value}" />
<Label Grid.Row="6" Content="{ll:Str 日期区间}" />
<ComboBox
Grid.Row="6"
Grid.Column="1"
ItemsSource="{Binding DayTimes}"
ItemsSource="{Binding ClickText.Value.DayTimes}"
SelectedItem="{Binding ClickText.Value.DayTime.Value}" />
<ListBox Grid.Row="6" Grid.ColumnSpan="2">
<ListBoxItem
DataContext="{Binding ClickText.Value.Like}"
Tag="{ll:Str 好感度范围}"
Template="{StaticResource ListBoxItem_RangeData}" />
<ListBoxItem
DataContext="{Binding ClickText.Value.Health}"
Tag="{ll:Str 健康度范围}"
Template="{StaticResource ListBoxItem_RangeData}" />
<ListBoxItem
DataContext="{Binding ClickText.Value.Level}"
Tag="{ll:Str 等级范围}"
Template="{StaticResource ListBoxItem_RangeData}" />
<ListBoxItem
DataContext="{Binding ClickText.Value.Money}"
Tag="{ll:Str 金钱范围}"
Template="{StaticResource ListBoxItem_RangeData}" />
<ListBoxItem
DataContext="{Binding ClickText.Value.Food}"
Tag="{ll:Str 食物范围}"
Template="{StaticResource ListBoxItem_RangeData}" />
<ListBoxItem
DataContext="{Binding ClickText.Value.Drink}"
Tag="{ll:Str 口渴范围}"
Template="{StaticResource ListBoxItem_RangeData}" />
<ListBoxItem
DataContext="{Binding ClickText.Value.Feel}"
Tag="{ll:Str 心情范围}"
Template="{StaticResource ListBoxItem_RangeData}" />
<ListBoxItem
DataContext="{Binding ClickText.Value.Strength}"
Tag="{ll:Str 体力范围}"
Template="{StaticResource ListBoxItem_RangeData}" />
</ListBox>
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>

View File

@ -109,31 +109,85 @@
<Label Content="{ll:Str 工作状态}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding LikeMin.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="LikeMin.Value">
<DataGridTextColumn.Header>
<Label Content="{ll:Str 最小好感}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding LikeMax.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="LikeMax.Value">
<DataGridTextColumn.Header>
<Label Content="{ll:Str 最大好感}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding DayTime.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="DayTime.Value">
<DataGridTextColumn.Header>
<Label Content="{ll:Str 时间}" />
<TextBlock Text="{ll:Str 时间}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Like.Info.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Like.Info.Value">
<DataGridTextColumn.Header>
<TextBlock Text="{ll:Str 好感度范围}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Health.Info.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Health.Info.Value">
<DataGridTextColumn.Header>
<TextBlock Text="{ll:Str 健康度范围}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Level.Info.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Level.Info.Value">
<DataGridTextColumn.Header>
<TextBlock Text="{ll:Str 等级范围}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Money.Info.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Money.Info.Value">
<DataGridTextColumn.Header>
<TextBlock Text="{ll:Str 金钱范围}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Food.Info.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Food.Info.Value">
<DataGridTextColumn.Header>
<TextBlock Text="{ll:Str 食物范围}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Drink.Info.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Drink.Info.Value">
<DataGridTextColumn.Header>
<TextBlock Text="{ll:Str 口渴范围}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Feel.Info.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Feel.Info.Value">
<DataGridTextColumn.Header>
<TextBlock Text="{ll:Str 心情范围}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Strength.Info.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Strength.Info.Value">
<DataGridTextColumn.Header>
<TextBlock Text="{ll:Str 体力范围}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Columns>

View File

@ -75,7 +75,7 @@
x:Name="ComboBox_FoodType"
Grid.Row="1"
Grid.Column="1"
ItemsSource="{Binding FoodTypes}"
ItemsSource="{Binding Food.Value.FoodTypes}"
SelectedItem="{Binding Food.Value.Type.Value}" />
<Label Grid.Row="2" Content="{ll:Str 食物名称}" />
<TextBox

View File

@ -53,19 +53,19 @@
<ComboBox
Grid.Row="1"
Grid.Column="1"
ItemsSource="{Binding ModeTypes}"
ItemsSource="{Binding LowText.Value.ModeTypes}"
SelectedItem="{Binding LowText.Value.Mode.Value}" />
<Label Grid.Row="2" Content="{ll:Str 饥渴状态}" />
<ComboBox
Grid.Row="2"
Grid.Column="1"
ItemsSource="{Binding StrengthTypes}"
ItemsSource="{Binding LowText.Value.StrengthTypes}"
SelectedItem="{Binding LowText.Value.Strength.Value}" />
<Label Grid.Row="3" Content="{ll:Str 好感度需求}" />
<ComboBox
Grid.Row="3"
Grid.Column="1"
ItemsSource="{Binding LikeTypes}"
ItemsSource="{Binding LowText.Value.LikeTypes}"
SelectedItem="{Binding LowText.Value.Like.Value}" />
</Grid>
<Grid Grid.Row="1">

View File

@ -148,7 +148,25 @@
Tag="{ll:Str 食物}">
<Frame Content="{Binding ModEditWindow.FoodPage}" />
</TabItem>
<TabItem Header="物品 (0)" Tag="{ll:Str 物品}">
<TabItem
x:Name="TabItem_ClickText"
Header="点击文本 (0)"
Tag="{ll:Str 点击文本}">
<Frame Content="{Binding ModEditWindow.ClickTextPage}" />
</TabItem>
<TabItem
x:Name="TabItem_LowText"
Header="低状态文本 (0)"
Tag="{ll:Str 低状态文本}">
<Frame Content="{Binding ModEditWindow.LowTextPage}" />
</TabItem>
<!--<TabItem
x:Name="TabItem_SelectText"
Header="选择文本 (0)"
Tag="{ll:Str 选择文本}">
<Frame Content="{Binding ModEditWindow.LowTextPage}" />
</TabItem>-->
<!--<TabItem Header="物品 (0)" Tag="{ll:Str 物品}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -165,8 +183,8 @@
Content=""
Style="{StaticResource AddButton}" />
</Grid>
</TabItem>
<TabItem Header="动画 (0)">
</TabItem>-->
<!--<TabItem Header="动画 (0)">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@ -201,19 +219,7 @@
Content=""
Style="{StaticResource AddButton}" />
</Grid>
</TabItem>
<TabItem
x:Name="TabItem_ClickText"
Header="点击文本 (0)"
Tag="{ll:Str 点击文本}">
<Frame Content="{Binding ModEditWindow.ClickTextPage}" />
</TabItem>
<TabItem
x:Name="TabItem_LowText"
Header="低状态文本 (0)"
Tag="{ll:Str 低状态文本}">
<Frame Content="{Binding ModEditWindow.LowTextPage}" />
</TabItem>
</TabItem>-->
</TabControl>
</Grid>
</Grid>

View File

@ -0,0 +1,115 @@
<Window
x:Class="VPet.ModMaker.Views.ModEdit.SelectTextEdit.SelectTextEditWindow"
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:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
xmlns:local="clr-namespace:VPet.ModMaker.Views.ModEdit.SelectTextEdit"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="https://opensource.panuon.com/wpf-ui"
Title="SelectTextWindow"
Width="800"
Height="450"
mc:Ignorable="d">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Content="Id" />
<TextBox
Grid.Column="1"
pu:TextBoxHelper.Watermark="Id"
Style="{StaticResource TextBox_Wrap}"
Text="{Binding ClickText.Value.Name.Value, UpdateSourceTrigger=PropertyChanged}"
TextWrapping="Wrap" />
</Grid>
<TextBox
x:Name="TextBox_Text"
Grid.Row="1"
d:Text="这是一个测试文本,这是一个测试文本,这是一个测试文本,这是一个测试文本,这是一个测试文本,这是一个测试文本,这是一个测试文本,"
pu:TextBoxHelper.Watermark="文本"
Style="{StaticResource TextBox_Wrap}"
Text="{Binding ClickText.Value.CurrentI18nData.Value.Text.Value, UpdateSourceTrigger=PropertyChanged}" />
</Grid>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Label Content="{ll:Str 指定工作}" />
<TextBox Grid.Column="1" Text="{Binding ClickText.Value.Working.Value, UpdateSourceTrigger=PropertyChanged}" />
<Label Grid.Row="1" Content="{ll:Str 最小好感度}" />
<pu:NumberInput
Grid.Row="1"
Grid.Column="1"
Margin="0"
Value="{Binding ClickText.Value.LikeMin.Value}" />
<Label Grid.Row="2" Content="{ll:Str 最大好感度}" />
<pu:NumberInput
Grid.Row="2"
Grid.Column="1"
Value="{Binding ClickText.Value.LikeMax.Value}" />
<Label Grid.Row="3" Content="{ll:Str 模式}" />
<ComboBox
Grid.Row="3"
Grid.Column="1"
ItemsSource="{Binding ModeTypes}"
SelectedItem="{Binding ClickText.Value.Mode.Value}" />
<Label Grid.Row="4" Content="{ll:Str 工作状态}" />
<ComboBox
Grid.Row="4"
Grid.Column="1"
ItemsSource="{Binding WorkingStates}"
SelectedItem="{Binding ClickText.Value.WorkingState.Value}" />
<Label Grid.Row="5" Content="{ll:Str 日期区间}" />
<ComboBox
Grid.Row="5"
Grid.Column="1"
ItemsSource="{Binding DayTimes}"
SelectedItem="{Binding ClickText.Value.DayTime.Value}" />
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Button
x:Name="Button_Cancel"
Margin="10"
Click="Button_Cancel_Click"
Content="{ll:Str 取消}" />
<Button
x:Name="Button_Yes"
Grid.Column="1"
Margin="10"
Click="Button_Yes_Click"
Content="{ll:Str 确定}" />
</Grid>
</Grid>
</Grid>
</Window>

View File

@ -0,0 +1,57 @@
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.SelectTextEdit;
/// <summary>
/// SelectTextWindow.xaml 的交互逻辑
/// </summary>
public partial class SelectTextEditWindow : Window
{
public SelectTextEditWindow()
{
InitializeComponent();
}
private void Button_Cancel_Click(object sender, RoutedEventArgs e)
{
Close();
}
private void Button_Yes_Click(object sender, RoutedEventArgs e)
{
//if (string.IsNullOrEmpty(ViewModel.ClickText.Value.Name.Value))
//{
// MessageBox.Show("Id不可为空".Translate(), "", MessageBoxButton.OK, MessageBoxImage.Warning);
// return;
//}
//if (
// ViewModel.OldClickText?.Name.Value != ViewModel.ClickText.Value.Name.Value
// && ModInfoModel.Current.ClickTexts.Any(
// i => i.Name.Value == ViewModel.ClickText.Value.Name.Value
// )
//)
//{
// MessageBox.Show("此Id已存在".Translate(), "", MessageBoxButton.OK, MessageBoxImage.Warning);
// return;
//}
//if (string.IsNullOrEmpty(ViewModel.ClickText.Value.CurrentI18nData.Value.Text.Value))
//{
// MessageBox.Show("文本不可为空".Translate(), "", MessageBoxButton.OK, MessageBoxImage.Warning);
// return;
//}
//IsCancel = false;
Close();
}
}

View File

@ -0,0 +1,122 @@
<Page
x:Class="VPet.ModMaker.Views.ModEdit.SelectTextEdit.SelectTextPage"
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:ll="clr-namespace:LinePutScript.Localization.WPF;assembly=LinePutScript.Localization.WPF"
xmlns:local="clr-namespace:VPet.ModMaker.Views.ModEdit.SelectTextEdit"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="https://opensource.panuon.com/wpf-ui"
Title="SelectTextPage"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<TextBox />
<DataGrid
x:Name="DataGrid_ClickText"
Grid.Row="1"
d:ItemsSource="{d:SampleData ItemCount=5}"
pu:DataGridHelper.ColumnHeaderHorizontalContentAlignment="Center"
AutoGenerateColumns="False"
CanUserAddRows="False"
GridLinesVisibility="Horizontal"
ItemsSource="{Binding ShowClickTexts.Value}"
MouseDoubleClick="DataGrid_ClickText_MouseDoubleClick"
RowDetailsVisibilityMode="Visible"
RowHeight="64"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling">
<DataGrid.RowStyle>
<Style BasedOn="{StaticResource {x:Type DataGridRow}}" TargetType="DataGridRow">
<Setter Property="Height" Value="64" />
<Setter Property="Tag" Value="{Binding}" />
<Setter Property="ContextMenu" Value="{StaticResource ContextMenu_DataGridRow}" />
</Style>
</DataGrid.RowStyle>
<DataGrid.Columns>
<DataGridTextColumn
MaxWidth="200"
Binding="{Binding Name.Value}"
CanUserSort="True"
ElementStyle="{StaticResource TextBlock_Wrap}"
IsReadOnly="True"
SortMemberPath="Name.Value">
<DataGridTextColumn.Header>
<Label Content="Id" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
MaxWidth="300"
Binding="{Binding CurrentI18nData.Value.Text.Value}"
CanUserSort="True"
ElementStyle="{StaticResource TextBlock_Wrap}"
IsReadOnly="True"
SortMemberPath="CurrentI18nData.Value.Text.Value">
<DataGridTextColumn.Header>
<Label Content="{ll:Str 文本}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Mode.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Mode.Value">
<DataGridTextColumn.Header>
<Label Content="{ll:Str 状态}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding Working.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="Working.Value">
<DataGridTextColumn.Header>
<Label Content="{ll:Str 指定工作}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding WorkingState.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="WorkingState.Value">
<DataGridTextColumn.Header>
<Label Content="{ll:Str 工作状态}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding LikeMin.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="LikeMin.Value">
<DataGridTextColumn.Header>
<Label Content="{ll:Str 最小好感}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding LikeMax.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="LikeMax.Value">
<DataGridTextColumn.Header>
<Label Content="{ll:Str 最大好感}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
<DataGridTextColumn
Binding="{Binding DayTime.Value}"
CanUserSort="True"
IsReadOnly="True"
SortMemberPath="DayTime.Value">
<DataGridTextColumn.Header>
<Label Content="{ll:Str 时间}" />
</DataGridTextColumn.Header>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
</Grid>
</Page>

View File

@ -0,0 +1,36 @@
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;
namespace VPet.ModMaker.Views.ModEdit.SelectTextEdit;
/// <summary>
/// SelectTextPage.xaml 的交互逻辑
/// </summary>
public partial class SelectTextPage : Page
{
public SelectTextPage()
{
InitializeComponent();
}
private void DataGrid_ClickText_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
//if (
// sender is not DataGrid dataGrid || dataGrid.SelectedItem is not ClickTextModel clickText
//)
// return;
//ViewModel.EditClickText(clickText);
}
}

View File

@ -28,11 +28,21 @@
<RowDefinition />
</Grid.RowDefinitions>
<Label Background="{x:Null}" Content="{ll:Str 打开最近的内容}" />
<TextBox Grid.Row="1" pu:TextBoxHelper.Watermark="{ll:Str 最近的内容}" />
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox pu:TextBoxHelper.Watermark="{ll:Str 最近的内容}" Text="{Binding HistoriesFilterText.Value}" />
<Button
Grid.Column="1"
Command="{Binding ClearHistoriesCommand}"
Content="清空历史" />
</Grid>
<ListBox
Grid.Row="2"
d:ItemsSource="{d:SampleData ItemCount=5}"
ItemsSource="{Binding Histories}"
ItemsSource="{Binding ShowHistories.Value}"
Style="{StaticResource SideMenuListBoxStyle}">
<ListBox.ItemContainerStyle>
<Style BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="ListBoxItem">
@ -41,7 +51,10 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid Background="White">
<Grid
Margin="5"
Background="{DynamicResource PrimaryDark}"
ToolTip="{Binding InfoFile}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />

View File

@ -2,6 +2,7 @@
using LinePutScript.Localization.WPF;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
@ -42,6 +43,17 @@ public partial class ModMakerWindow : Window
return;
if (item.DataContext is not ModMakerHistory history)
return;
if (Directory.Exists(history.SourcePath) is false)
{
if (
MessageBox.Show($"路径不存在, 是否删除?".Translate(), "", MessageBoxButton.YesNo)
is MessageBoxResult.Yes
)
{
ViewModel.Histories.Remove(history);
ViewModel.ShowHistories.Value.Remove(history);
}
}
var loader = new ModLoader(new(history.SourcePath));
if (loader.SuccessLoad)
{