mirror of
https://github.com/LorisYounger/VPet.ModMaker.git
synced 2024-08-30 18:22:21 +00:00
更新
This commit is contained in:
parent
80319778f2
commit
ba74693de0
@ -78,10 +78,10 @@
|
||||
<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.7\lib\net462\VPet-Simulator.Core.dll</HintPath>
|
||||
<HintPath>..\packages\VPet-Simulator.Core.1.0.8\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.7\lib\net462\VPet-Simulator.Windows.Interface.dll</HintPath>
|
||||
<HintPath>..\packages\VPet-Simulator.Windows.Interface.1.0.8\lib\net462\VPet-Simulator.Windows.Interface.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
|
@ -11,11 +11,25 @@ namespace VPet.ModMaker.ViewModels.ModEdit;
|
||||
|
||||
public class AddCultureWindowVM
|
||||
{
|
||||
/// <summary>
|
||||
/// 显示的文化
|
||||
/// </summary>
|
||||
public ObservableValue<ObservableCollection<string>> ShowCultures { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 全部文化
|
||||
/// </summary>
|
||||
public static ObservableCollection<string> AllCultures { get; set; } =
|
||||
new(LinePutScript.Localization.WPF.LocalizeCore.AvailableCultures);
|
||||
|
||||
/// <summary>
|
||||
/// 当前文化
|
||||
/// </summary>
|
||||
public ObservableValue<string> Culture { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 搜索文化
|
||||
/// </summary>
|
||||
public ObservableValue<string> Search { get; } = new();
|
||||
|
||||
public AddCultureWindowVM()
|
||||
|
@ -23,65 +23,74 @@ public class ModEditWindowVM
|
||||
public ModEditWindow ModEditWindow { get; }
|
||||
|
||||
#region Value
|
||||
/// <summary>
|
||||
/// 当前模组信息
|
||||
/// </summary>
|
||||
public ObservableValue<ModInfoModel> ModInfo { get; } = new(ModInfoModel.Current);
|
||||
public ObservableValue<string> CurrentLang { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// I18n数据
|
||||
/// </summary>
|
||||
public I18nHelper I18nData => I18nHelper.Current;
|
||||
#endregion
|
||||
|
||||
#region Command
|
||||
public ObservableCommand AddImageCommand { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 改变图片命令
|
||||
/// </summary>
|
||||
public ObservableCommand ChangeImageCommand { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 添加文化命令
|
||||
/// </summary>
|
||||
public ObservableCommand AddCultureCommand { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 编辑文化命令
|
||||
/// </summary>
|
||||
public ObservableCommand<string> EditCultureCommand { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 删除文化命令
|
||||
/// </summary>
|
||||
public ObservableCommand<string> RemoveCultureCommand { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 保存命令
|
||||
/// </summary>
|
||||
public ObservableCommand SaveCommand { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 保存至命令
|
||||
/// </summary>
|
||||
public ObservableCommand SaveToCommand { get; } = new();
|
||||
#endregion
|
||||
|
||||
public ModEditWindowVM() { }
|
||||
|
||||
public ModEditWindowVM(ModEditWindow window)
|
||||
{
|
||||
ModEditWindow = window;
|
||||
CurrentLang.ValueChanged += CurrentLang_ValueChanged;
|
||||
|
||||
AddImageCommand.ExecuteEvent += AddImage;
|
||||
ChangeImageCommand.ExecuteEvent += ChangeImage;
|
||||
AddCultureCommand.ExecuteEvent += AddCulture;
|
||||
EditCultureCommand.ExecuteEvent += EditCulture;
|
||||
RemoveCultureCommand.ExecuteEvent += RemoveLang;
|
||||
RemoveCultureCommand.ExecuteEvent += RemoveCulture;
|
||||
|
||||
SaveCommand.ExecuteEvent += Save;
|
||||
SaveToCommand.ExecuteEvent += SaveTo;
|
||||
}
|
||||
|
||||
private void CurrentLang_ValueChanged(string oldValue, string newValue)
|
||||
{
|
||||
if (newValue is null)
|
||||
return;
|
||||
ModInfo.Value.CurrentI18nData.Value = ModInfo.Value.I18nDatas[newValue];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
ModInfo.Value.Image.Value?.StreamSource?.Close();
|
||||
}
|
||||
|
||||
private void AddImage()
|
||||
{
|
||||
OpenFileDialog openFileDialog =
|
||||
new()
|
||||
{
|
||||
Title = "选择图片".Translate(),
|
||||
Filter = $"图片|*.jpg;*.jpeg;*.png;*.bmp".Translate()
|
||||
};
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
ModInfo.Value.Image.Value = Utils.LoadImageToMemoryStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 改变图片
|
||||
/// </summary>
|
||||
private void ChangeImage()
|
||||
{
|
||||
OpenFileDialog openFileDialog =
|
||||
@ -97,6 +106,10 @@ public class ModEditWindowVM
|
||||
}
|
||||
}
|
||||
|
||||
#region Culture
|
||||
/// <summary>
|
||||
/// 添加文化
|
||||
/// </summary>
|
||||
public void AddCulture()
|
||||
{
|
||||
var window = new AddCultureWindow();
|
||||
@ -108,32 +121,48 @@ public class ModEditWindowVM
|
||||
I18nHelper.Current.CultureName.Value = window.ViewModel.Culture.Value;
|
||||
}
|
||||
|
||||
private void EditCulture(string oldLang)
|
||||
/// <summary>
|
||||
/// 编辑文化
|
||||
/// </summary>
|
||||
/// <param name="oldCulture">旧文化</param>
|
||||
private void EditCulture(string oldCulture)
|
||||
{
|
||||
var window = new AddCultureWindow();
|
||||
window.ViewModel.Culture.Value = oldLang.Translate();
|
||||
window.ViewModel.Culture.Value = oldCulture.Translate();
|
||||
window.ShowDialog();
|
||||
if (window.IsCancel)
|
||||
return;
|
||||
I18nHelper.Current.CultureNames[I18nHelper.Current.CultureNames.IndexOf(oldLang)] = window
|
||||
.ViewModel
|
||||
.Culture
|
||||
.Value;
|
||||
CurrentLang.Value = window.ViewModel.Culture.Value;
|
||||
I18nHelper.Current.CultureNames[I18nHelper.Current.CultureNames.IndexOf(oldCulture)] =
|
||||
window.ViewModel.Culture.Value;
|
||||
}
|
||||
|
||||
private void RemoveLang(string oldLang)
|
||||
/// <summary>
|
||||
/// 删除文化
|
||||
/// </summary>
|
||||
/// <param name="oldCulture">旧文化</param>
|
||||
private void RemoveCulture(string oldCulture)
|
||||
{
|
||||
if (
|
||||
MessageBox.Show("确定删除吗".Translate(), "".Translate(), MessageBoxButton.YesNo)
|
||||
is MessageBoxResult.No
|
||||
MessageBox.Show(
|
||||
"确定删除文化 {0} 吗".Translate(oldCulture),
|
||||
"".Translate(),
|
||||
MessageBoxButton.YesNo
|
||||
) is MessageBoxResult.No
|
||||
)
|
||||
return;
|
||||
I18nHelper.Current.CultureNames.Remove(oldLang);
|
||||
I18nHelper.Current.CultureNames.Remove(oldCulture);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Save
|
||||
/// <summary>
|
||||
/// 保存
|
||||
/// </summary>
|
||||
private void Save()
|
||||
{
|
||||
if (MessageBox.Show("确定保存吗".Translate()) is not MessageBoxResult.Yes)
|
||||
return;
|
||||
|
||||
if (string.IsNullOrEmpty(ModInfo.Value.SourcePath.Value))
|
||||
{
|
||||
MessageBox.Show("源路径为空, 请使用 保存至".Translate());
|
||||
@ -151,6 +180,9 @@ public class ModEditWindowVM
|
||||
MessageBox.Show("保存成功".Translate());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存至
|
||||
/// </summary>
|
||||
private void SaveTo()
|
||||
{
|
||||
if (ValidationData(ModInfo.Value) is false)
|
||||
@ -183,6 +215,11 @@ public class ModEditWindowVM
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 验证数据
|
||||
/// </summary>
|
||||
/// <param name="model">模型</param>
|
||||
/// <returns>成功为 <see langword="true"/> 失败为 <see langword="false"/></returns>
|
||||
private bool ValidationData(ModInfoModel model)
|
||||
{
|
||||
if (I18nHelper.Current.CultureNames.Count == 0)
|
||||
@ -207,4 +244,5 @@ public class ModEditWindowVM
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -25,19 +25,42 @@ public class ModMakerWindowVM
|
||||
|
||||
public ModEditWindow ModEditWindow { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// 历史搜索文本
|
||||
/// </summary>
|
||||
public ObservableValue<string> HistoriesSearchText { get; } = new();
|
||||
|
||||
public ObservableCollection<ModInfoModel> Mods { get; } = new();
|
||||
/// <summary>
|
||||
/// 显示的历史
|
||||
/// </summary>
|
||||
public ObservableValue<ObservableCollection<ModMakerHistory>> ShowHistories { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 历史
|
||||
/// </summary>
|
||||
public ObservableCollection<ModMakerHistory> Histories { get; } = new();
|
||||
#endregion
|
||||
#region Command
|
||||
/// <summary>
|
||||
/// 创建新模组命令
|
||||
/// </summary>
|
||||
public ObservableCommand CreateNewModCommand { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 从文件载入模组命令
|
||||
/// </summary>
|
||||
public ObservableCommand LoadModFromFileCommand { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 清除历史命令
|
||||
/// </summary>
|
||||
public ObservableCommand ClearHistoriesCommand { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 删除历史命令
|
||||
/// </summary>
|
||||
public ObservableCommand<ModMakerHistory> RemoveHistoryCommand { get; } = new();
|
||||
#endregion
|
||||
public ModMakerWindowVM() { }
|
||||
|
||||
public ModMakerWindowVM(ModMakerWindow window)
|
||||
{
|
||||
@ -48,15 +71,27 @@ public class ModMakerWindowVM
|
||||
LoadModFromFileCommand.ExecuteEvent += LoadModFromFile;
|
||||
ClearHistoriesCommand.ExecuteEvent += ClearHistories;
|
||||
RemoveHistoryCommand.ExecuteEvent += RemoveHistory;
|
||||
HistoriesSearchText.ValueChanged += ModSearchText_ValueChanged;
|
||||
HistoriesSearchText.ValueChanged += HistoriesSearchText_ValueChanged;
|
||||
}
|
||||
|
||||
private void HistoriesSearchText_ValueChanged(string oldValue, string newValue)
|
||||
{
|
||||
if (string.IsNullOrEmpty(newValue))
|
||||
ShowHistories.Value = Histories;
|
||||
else
|
||||
ShowHistories.Value = new(Histories.Where(i => i.Id.Contains(newValue)));
|
||||
}
|
||||
|
||||
#region History
|
||||
private void RemoveHistory(ModMakerHistory value)
|
||||
{
|
||||
Histories.Remove(value);
|
||||
SaveHistories();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 载入历史
|
||||
/// </summary>
|
||||
private void LoadHistories()
|
||||
{
|
||||
if (File.Exists(ModMakerInfo.HistoryFile) is false)
|
||||
@ -70,6 +105,9 @@ public class ModMakerWindowVM
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存历史
|
||||
/// </summary>
|
||||
private void SaveHistories()
|
||||
{
|
||||
Directory.CreateDirectory(nameof(ModMaker));
|
||||
@ -77,6 +115,7 @@ public class ModMakerWindowVM
|
||||
File.Create(ModMakerInfo.HistoryFile).Close();
|
||||
var lps = new LPS();
|
||||
foreach (var history in Histories)
|
||||
{
|
||||
lps.Add(
|
||||
new Line(nameof(history))
|
||||
{
|
||||
@ -85,9 +124,14 @@ public class ModMakerWindowVM
|
||||
new Sub("LastTime", history.LastTime.ToString("yyyy/MM/dd HH:mm"))
|
||||
}
|
||||
);
|
||||
}
|
||||
File.WriteAllText(ModMakerInfo.HistoryFile, lps.ToString());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加历史
|
||||
/// </summary>
|
||||
/// <param name="modInfo">模组信息</param>
|
||||
private void AddHistories(ModInfoModel modInfo)
|
||||
{
|
||||
if (
|
||||
@ -112,47 +156,6 @@ public class ModMakerWindowVM
|
||||
}
|
||||
}
|
||||
|
||||
private void ModSearchText_ValueChanged(string oldValue, string newValue)
|
||||
{
|
||||
if (string.IsNullOrEmpty(newValue))
|
||||
ShowHistories.Value = Histories;
|
||||
else
|
||||
ShowHistories.Value = new(Histories.Where(i => i.Id.Contains(newValue)));
|
||||
}
|
||||
|
||||
public void CreateNewMod()
|
||||
{
|
||||
ModInfoModel.Current = new();
|
||||
ShowEditWindow();
|
||||
}
|
||||
|
||||
public void EditMod(ModInfoModel modInfo)
|
||||
{
|
||||
ModInfoModel.Current = modInfo;
|
||||
ShowEditWindow();
|
||||
}
|
||||
|
||||
private void ShowEditWindow()
|
||||
{
|
||||
if (string.IsNullOrEmpty(ModInfoModel.Current.SourcePath.Value) is false)
|
||||
AddHistories(ModInfoModel.Current);
|
||||
SaveHistories();
|
||||
ModEditWindow = new();
|
||||
ModEditWindow.Show();
|
||||
ModMakerWindow.Hide();
|
||||
ModEditWindow.Closed += (s, e) =>
|
||||
{
|
||||
var modInfo = ModInfoModel.Current;
|
||||
if (string.IsNullOrEmpty(modInfo.SourcePath.Value) is false)
|
||||
AddHistories(modInfo);
|
||||
SaveHistories();
|
||||
ModInfoModel.Current.Close();
|
||||
ModInfoModel.Current = null;
|
||||
I18nHelper.Current = new();
|
||||
ModMakerWindow.Show();
|
||||
};
|
||||
}
|
||||
|
||||
private void ClearHistories()
|
||||
{
|
||||
if (
|
||||
@ -164,7 +167,58 @@ public class ModMakerWindowVM
|
||||
Histories.Clear();
|
||||
File.WriteAllText(ModMakerInfo.HistoryFile, string.Empty);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Mod
|
||||
/// <summary>
|
||||
/// 创建新模组
|
||||
/// </summary>
|
||||
public void CreateNewMod()
|
||||
{
|
||||
ModInfoModel.Current = new();
|
||||
ShowEditWindow();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 编辑模组
|
||||
/// </summary>
|
||||
/// <param name="modInfo">模组信息</param>
|
||||
public void EditMod(ModInfoModel modInfo)
|
||||
{
|
||||
ModInfoModel.Current = modInfo;
|
||||
ShowEditWindow();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显示模组编辑窗口
|
||||
/// </summary>
|
||||
private void ShowEditWindow()
|
||||
{
|
||||
ModMakerWindow.Hide();
|
||||
// 将当前模组添加到历史
|
||||
if (string.IsNullOrEmpty(ModInfoModel.Current.SourcePath.Value) is false)
|
||||
AddHistories(ModInfoModel.Current);
|
||||
SaveHistories();
|
||||
ModEditWindow = new();
|
||||
ModEditWindow.Show();
|
||||
ModEditWindow.Closed += (s, e) =>
|
||||
{
|
||||
var modInfo = ModInfoModel.Current;
|
||||
if (string.IsNullOrEmpty(modInfo.SourcePath.Value) is false)
|
||||
{
|
||||
AddHistories(modInfo);
|
||||
SaveHistories();
|
||||
}
|
||||
ModInfoModel.Current.Close();
|
||||
ModInfoModel.Current = null;
|
||||
I18nHelper.Current = new();
|
||||
ModMakerWindow.Show();
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 从文件载入模组
|
||||
/// </summary>
|
||||
public void LoadModFromFile()
|
||||
{
|
||||
OpenFileDialog openFileDialog =
|
||||
@ -180,6 +234,10 @@ public class ModMakerWindowVM
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 载入模组
|
||||
/// </summary>
|
||||
/// <param name="path">位置</param>
|
||||
public void LoadMod(string path)
|
||||
{
|
||||
try
|
||||
@ -200,4 +258,5 @@ public class ModMakerWindowVM
|
||||
MessageBox.Show("模组载入失败:\n{0}".Translate(ex));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
<Window
|
||||
<pu:WindowX
|
||||
x:Class="VPet.ModMaker.Views.ModEdit.AddCultureWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@ -49,13 +49,15 @@
|
||||
x:Name="Button_Cancel"
|
||||
Margin="10"
|
||||
Click="Button_Cancel_Click"
|
||||
Content="{ll:Str 取消}" />
|
||||
Content="{ll:Str 取消}"
|
||||
IsCancel="True" />
|
||||
<Button
|
||||
x:Name="Button_Yes"
|
||||
Grid.Column="1"
|
||||
Margin="10"
|
||||
Click="Button_Yes_Click"
|
||||
Content="{ll:Str 确定}" />
|
||||
Content="{ll:Str 确定}"
|
||||
IsDefault="True" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1">
|
||||
@ -70,4 +72,4 @@
|
||||
SelectedItem="{Binding Culture.Value}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Window>
|
||||
</pu:WindowX>
|
||||
|
@ -1,4 +1,6 @@
|
||||
using HKW.HKWViewModels.SimpleObservable;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Panuon.WPF.UI;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
@ -23,7 +25,7 @@ namespace VPet.ModMaker.Views.ModEdit;
|
||||
/// <summary>
|
||||
/// Window_AddLang.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class AddCultureWindow : Window
|
||||
public partial class AddCultureWindow : WindowX
|
||||
{
|
||||
public bool IsCancel { get; private set; } = true;
|
||||
|
||||
@ -34,6 +36,7 @@ public partial class AddCultureWindow : Window
|
||||
InitializeComponent();
|
||||
DataContext = new AddCultureWindowVM();
|
||||
TextBox_Lang.Focus();
|
||||
TextBox_Lang.Dispatcher.InvokeAsync(TextBox_Lang.SelectAll);
|
||||
}
|
||||
|
||||
private void Button_Cancel_Click(object sender, RoutedEventArgs e)
|
||||
@ -43,14 +46,14 @@ public partial class AddCultureWindow : Window
|
||||
|
||||
private void Button_Yes_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ViewModel.Culture.Value))
|
||||
if (string.IsNullOrWhiteSpace(ViewModel.Culture.Value))
|
||||
{
|
||||
MessageBox.Show("文化不可为空", "", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
MessageBox.Show("文化不可为空".Translate(), "", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
if (I18nHelper.Current.CultureNames.Contains(ViewModel.Culture.Value))
|
||||
{
|
||||
MessageBox.Show("此文化已存在", "", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
MessageBox.Show("此文化已存在".Translate(), "", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
IsCancel = false;
|
||||
|
@ -11,10 +11,8 @@
|
||||
Title="AnimeEditWindow"
|
||||
Width="1000"
|
||||
Height="600"
|
||||
d:DataContext="{d:DesignInstance Type=vm:AnimeEditWindowVM}"
|
||||
mc:Ignorable="d">
|
||||
<d:Window.DataContext>
|
||||
<vm:AnimeEditWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Window.Resources>
|
||||
<Style
|
||||
x:Key="ListBoxItem_Style"
|
||||
|
@ -9,12 +9,10 @@
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.AnimeEdit"
|
||||
Title="AnimePage"
|
||||
d:DataContext="{d:DesignInstance Type=vm:AnimePageVM}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<d:Page.DataContext>
|
||||
<vm:AnimePageVM />
|
||||
</d:Page.DataContext>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -11,11 +11,9 @@
|
||||
Title="ClickTextWindow"
|
||||
Width="800"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance Type=vm:ClickTextEditWindowVM}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<d:Window.DataContext>
|
||||
<vm:ClickTextEditWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MinWidth="300" />
|
||||
|
@ -9,12 +9,10 @@
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.ClickTextEdit"
|
||||
Title="ClickTextPage"
|
||||
d:DataContext="{d:DesignInstance Type=vm:ClickTextPageVM}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<d:Page.DataContext>
|
||||
<vm:ClickTextPageVM />
|
||||
</d:Page.DataContext>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -8,14 +8,12 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.FoodEdit"
|
||||
Title="Window_FoodEdit"
|
||||
Title="FoodEditWindow"
|
||||
Width="800"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance Type=vm:FoodEditWindowVM}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<d:Window.DataContext>
|
||||
<vm:FoodEditWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="250" />
|
||||
|
@ -8,13 +8,11 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.FoodEdit"
|
||||
Title="Page_Food"
|
||||
Title="FoodPage"
|
||||
d:DataContext="{d:DesignInstance Type=vm:FoodPageVM}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<d:Page.DataContext>
|
||||
<vm:FoodPageVM />
|
||||
</d:Page.DataContext>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -8,14 +8,12 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.LowTextEdit"
|
||||
Title="Page_LowText"
|
||||
Title="LowTextEditWindow"
|
||||
Width="800"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance Type=vm:LowTextEditWindowVM}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<d:Window.DataContext>
|
||||
<vm:LowTextEditWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MinWidth="300" />
|
||||
|
@ -8,13 +8,11 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.LowTextEdit"
|
||||
Title="Page_LowText"
|
||||
Title="LowTextPage"
|
||||
d:DataContext="{d:DesignInstance Type=vm:LowTextPageVM}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<d:Page.DataContext>
|
||||
<vm:LowTextPageVM />
|
||||
</d:Page.DataContext>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -8,28 +8,12 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit"
|
||||
Title="ModEditWindow"
|
||||
Title="{ll:Str 模组编辑器}"
|
||||
Width="1000"
|
||||
Height="500"
|
||||
d:DataContext="{d:DesignInstance Type=vm:ModEditWindowVM}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<d:Window.DataContext>
|
||||
<vm:ModEditWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Window.Resources>
|
||||
<ResourceDictionary>
|
||||
<ContextMenu x:Key="ContextMenu_Culture" x:Shared="false">
|
||||
<MenuItem
|
||||
Command="{Binding DataContext.ChangeCultureCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
|
||||
CommandParameter="{Binding Content, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}}"
|
||||
Header="{ll:Str 修改语言}" />
|
||||
<MenuItem
|
||||
Command="{Binding DataContext.RemoveCultureCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
|
||||
CommandParameter="{Binding Content, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBoxItem}}"
|
||||
Header="{ll:Str 删除语言}" />
|
||||
</ContextMenu>
|
||||
</ResourceDictionary>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
@ -74,7 +58,7 @@
|
||||
x:Name="Button_AddModImage"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding AddImageCommand}"
|
||||
Command="{Binding ChangeImageCommand}"
|
||||
Content="{ll:Str 添加图片}">
|
||||
<Button.Style>
|
||||
<Style BasedOn="{StaticResource {x:Type Button}}" TargetType="Button">
|
||||
@ -294,8 +278,22 @@
|
||||
SelectedItem="{Binding I18nData.CultureName.Value}">
|
||||
<ListBox.ItemContainerStyle>
|
||||
<Style BasedOn="{StaticResource {x:Type ListBoxItem}}" TargetType="ListBoxItem">
|
||||
<Setter Property="Tag" Value="{Binding DataContext, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}" />
|
||||
<Setter Property="Content" Value="{Binding}" />
|
||||
<Setter Property="ContextMenu" Value="{StaticResource ContextMenu_Culture}" />
|
||||
<Setter Property="ContextMenu">
|
||||
<Setter.Value>
|
||||
<ContextMenu>
|
||||
<MenuItem
|
||||
Command="{Binding PlacementTarget.Tag.EditCultureCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"
|
||||
CommandParameter="{Binding}"
|
||||
Header="{ll:Str 修改语言}" />
|
||||
<MenuItem
|
||||
Command="{Binding PlacementTarget.Tag.RemoveCultureCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}}"
|
||||
CommandParameter="{Binding}"
|
||||
Header="{ll:Str 删除语言}" />
|
||||
</ContextMenu>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ListBox.ItemContainerStyle>
|
||||
</ListBox>
|
||||
|
@ -11,11 +11,9 @@
|
||||
Title="MoveEditWindow"
|
||||
Width="800"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance Type=vm:MoveEditWindowVM}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<d:Window.DataContext>
|
||||
<vm:MoveEditWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
@ -9,13 +9,10 @@
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.MoveEdit"
|
||||
Title="MovePage"
|
||||
d:DataContext="{d:DesignInstance Type=vm:MovePageVM}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<d:Page.DataContext>
|
||||
<vm:MovePageVM />
|
||||
</d:Page.DataContext>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -11,11 +11,9 @@
|
||||
Title="PetEditWindow"
|
||||
Width="800"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance Type=vm:PetEditWindowVM}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<d:Window.DataContext>
|
||||
<vm:PetEditWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Window.Resources>
|
||||
<Style
|
||||
x:Key="Label_ThouchRect"
|
||||
|
@ -9,12 +9,10 @@
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.PetEdit"
|
||||
Title="PetPage"
|
||||
d:DataContext="{d:DesignInstance Type=vm:PetPageVM}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<d:Page.DataContext>
|
||||
<vm:PetPageVM />
|
||||
</d:Page.DataContext>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -8,14 +8,12 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.SelectTextEdit"
|
||||
Title="SelectTextWindow"
|
||||
Title="SelectTextEditWindow"
|
||||
Width="800"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance Type=vm:SelectTextEditWindowVM}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<d:Window.DataContext>
|
||||
<vm:SelectTextEditWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition MinWidth="300" />
|
||||
|
@ -9,12 +9,10 @@
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.SelectTextEdit"
|
||||
Title="SelectTextPage"
|
||||
d:DataContext="{d:DesignInstance Type=vm:SelectTextPageVM}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<d:Page.DataContext>
|
||||
<vm:SelectTextPageVM />
|
||||
</d:Page.DataContext>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -11,11 +11,9 @@
|
||||
Title="WorkEditWindow"
|
||||
Width="800"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance Type=vm:WorkEditWindowVM}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<d:Window.DataContext>
|
||||
<vm:WorkEditWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
|
@ -9,12 +9,10 @@
|
||||
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
||||
xmlns:vm="clr-namespace:VPet.ModMaker.ViewModels.ModEdit.WorkEdit"
|
||||
Title="WorkPage"
|
||||
d:DataContext="{d:DesignInstance Type=vm:WorkPageVM}"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<d:Page.DataContext>
|
||||
<vm:WorkPageVM />
|
||||
</d:Page.DataContext>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -11,12 +11,10 @@
|
||||
Title="{ll:Str Mod制作器}"
|
||||
Width="600"
|
||||
Height="450"
|
||||
d:DataContext="{d:DesignInstance Type=vm:ModMakerWindowVM}"
|
||||
FontSize="16"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<d:Window.DataContext>
|
||||
<vm:ModMakerWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
|
@ -4,6 +4,6 @@
|
||||
<package id="LinePutScript.Localization.WPF" version="1.0.6" targetFramework="net462" />
|
||||
<package id="Panuon.WPF" version="1.0.3" targetFramework="net462" />
|
||||
<package id="Panuon.WPF.UI" version="1.1.16.2" targetFramework="net462" />
|
||||
<package id="VPet-Simulator.Core" version="1.0.7" targetFramework="net462" />
|
||||
<package id="VPet-Simulator.Windows.Interface" version="1.0.7" targetFramework="net462" />
|
||||
<package id="VPet-Simulator.Core" version="1.0.8" targetFramework="net462" />
|
||||
<package id="VPet-Simulator.Windows.Interface" version="1.0.8" targetFramework="net462" />
|
||||
</packages>
|
Loading…
Reference in New Issue
Block a user