mirror of
https://github.com/LorisYounger/VPet.ModMaker.git
synced 2024-08-30 18:22:21 +00:00
# 更新
- 工作,移动,动画页面设置默认选中的宠物 - 忽略`Food.Name`为空的内容 - 忽略`ClickText.Text`为空的内容 - 忽略`LowText.Text`为空的内容 - 忽略`SelectText.Text`为空的内容
This commit is contained in:
parent
eadbb20f9b
commit
d7b8f23a63
@ -48,13 +48,23 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
|||||||
var imagePath = Path.Combine(loader.ModPath.FullName, "icon.png");
|
var imagePath = Path.Combine(loader.ModPath.FullName, "icon.png");
|
||||||
if (File.Exists(imagePath))
|
if (File.Exists(imagePath))
|
||||||
Image = NativeUtils.LoadImageToMemoryStream(imagePath);
|
Image = NativeUtils.LoadImageToMemoryStream(imagePath);
|
||||||
foreach (var food in loader.Foods)
|
foreach (var food in loader.Foods.Where(m => string.IsNullOrWhiteSpace(m.Name) is false))
|
||||||
Foods.Add(new(food));
|
Foods.Add(new(food));
|
||||||
foreach (var clickText in loader.ClickTexts)
|
foreach (
|
||||||
|
var clickText in loader.ClickTexts.Where(m =>
|
||||||
|
string.IsNullOrWhiteSpace(m.Text) is false
|
||||||
|
)
|
||||||
|
)
|
||||||
ClickTexts.Add(new(clickText));
|
ClickTexts.Add(new(clickText));
|
||||||
foreach (var lowText in loader.LowTexts)
|
foreach (
|
||||||
|
var lowText in loader.LowTexts.Where(m => string.IsNullOrWhiteSpace(m.Text) is false)
|
||||||
|
)
|
||||||
LowTexts.Add(new(lowText));
|
LowTexts.Add(new(lowText));
|
||||||
foreach (var selectText in loader.SelectTexts)
|
foreach (
|
||||||
|
var selectText in loader.SelectTexts.Where(m =>
|
||||||
|
string.IsNullOrWhiteSpace(m.Text) is false
|
||||||
|
)
|
||||||
|
)
|
||||||
SelectTexts.Add(new(selectText));
|
SelectTexts.Add(new(selectText));
|
||||||
|
|
||||||
// 载入模组宠物
|
// 载入模组宠物
|
||||||
|
@ -57,7 +57,11 @@ public static class ModUpdataHelper
|
|||||||
{
|
{
|
||||||
MessageBox.Show(
|
MessageBox.Show(
|
||||||
ModEditWindow.Current,
|
ModEditWindow.Current,
|
||||||
"模组更新失败\n当前版本: {0}\n目标版本: {1}\n{2}".Translate(mod.ModVersion, action.Key, ex)
|
"模组更新失败\n当前支持的游戏版本: {0}\n目标支持的游戏版本: {1}\n{2}".Translate(
|
||||||
|
mod.ModVersion,
|
||||||
|
action.Key,
|
||||||
|
ex
|
||||||
|
)
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -68,11 +72,11 @@ public static class ModUpdataHelper
|
|||||||
public static SortedDictionary<int, Action<ModInfoModel>> UpdataAction { get; } =
|
public static SortedDictionary<int, Action<ModInfoModel>> UpdataAction { get; } =
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
[11000] = (ModInfoModel m) =>
|
[11000] = (m) =>
|
||||||
{
|
{
|
||||||
// 修改宠物默认ID
|
|
||||||
foreach (var pet in m.Pets)
|
foreach (var pet in m.Pets)
|
||||||
{
|
{
|
||||||
|
// 修改宠物默认ID
|
||||||
if (pet.ID == "默认虚拟桌宠")
|
if (pet.ID == "默认虚拟桌宠")
|
||||||
pet.ID = "vup";
|
pet.ID = "vup";
|
||||||
foreach (var work in pet.Works)
|
foreach (var work in pet.Works)
|
||||||
|
@ -7,6 +7,7 @@ using System.Linq;
|
|||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using HKW.HKWUtils.Extensions;
|
||||||
using HKW.HKWUtils.Observable;
|
using HKW.HKWUtils.Observable;
|
||||||
using LinePutScript.Localization.WPF;
|
using LinePutScript.Localization.WPF;
|
||||||
using Panuon.WPF.UI;
|
using Panuon.WPF.UI;
|
||||||
@ -37,8 +38,12 @@ public class AnimePageVM : ObservableObjectX<AnimePageVM>
|
|||||||
},
|
},
|
||||||
FilteredList = new()
|
FilteredList = new()
|
||||||
};
|
};
|
||||||
CurrentPet = Pets.First();
|
|
||||||
PropertyChangedX += AnimePageVM_PropertyChangedX;
|
PropertyChangedX += AnimePageVM_PropertyChangedX;
|
||||||
|
if (Pets.HasValue())
|
||||||
|
CurrentPet = Pets.FirstOrDefault(
|
||||||
|
m => m.FromMain is false && m.AnimeCount > 0,
|
||||||
|
Pets.First()
|
||||||
|
);
|
||||||
|
|
||||||
AddCommand.ExecuteCommand += AddCommand_ExecuteCommand;
|
AddCommand.ExecuteCommand += AddCommand_ExecuteCommand;
|
||||||
EditCommand.ExecuteCommand += EditCommand_ExecuteCommand;
|
EditCommand.ExecuteCommand += EditCommand_ExecuteCommand;
|
||||||
|
@ -24,8 +24,12 @@ public class MovePageVM : ObservableObjectX<MovePageVM>
|
|||||||
Filter = f => f.Graph.Contains(Search, StringComparison.OrdinalIgnoreCase),
|
Filter = f => f.Graph.Contains(Search, StringComparison.OrdinalIgnoreCase),
|
||||||
FilteredList = new()
|
FilteredList = new()
|
||||||
};
|
};
|
||||||
CurrentPet = Pets.First();
|
|
||||||
PropertyChanged += MovePageVM_PropertyChanged;
|
PropertyChanged += MovePageVM_PropertyChanged;
|
||||||
|
if (Pets.HasValue())
|
||||||
|
CurrentPet = Pets.FirstOrDefault(
|
||||||
|
m => m.FromMain is false && m.Moves.HasValue(),
|
||||||
|
Pets.First()
|
||||||
|
);
|
||||||
AddCommand.ExecuteCommand += AddCommand_ExecuteCommand;
|
AddCommand.ExecuteCommand += AddCommand_ExecuteCommand;
|
||||||
EditCommand.ExecuteCommand += EditCommand_ExecuteCommand;
|
EditCommand.ExecuteCommand += EditCommand_ExecuteCommand;
|
||||||
RemoveCommand.ExecuteCommand += RemoveCommand_ExecuteCommand;
|
RemoveCommand.ExecuteCommand += RemoveCommand_ExecuteCommand;
|
||||||
|
@ -24,8 +24,12 @@ public class WorkPageVM : ObservableObjectX<WorkPageVM>
|
|||||||
Filter = f => f.ID.Contains(Search, StringComparison.OrdinalIgnoreCase),
|
Filter = f => f.ID.Contains(Search, StringComparison.OrdinalIgnoreCase),
|
||||||
FilteredList = new()
|
FilteredList = new()
|
||||||
};
|
};
|
||||||
CurrentPet = Pets.First();
|
|
||||||
PropertyChanged += WorkPageVM_PropertyChanged;
|
PropertyChanged += WorkPageVM_PropertyChanged;
|
||||||
|
if (Pets.HasValue())
|
||||||
|
CurrentPet = Pets.FirstOrDefault(
|
||||||
|
m => m.FromMain is false && m.Works.HasValue(),
|
||||||
|
Pets.First()
|
||||||
|
);
|
||||||
AddCommand.ExecuteCommand += AddCommand_ExecuteCommand;
|
AddCommand.ExecuteCommand += AddCommand_ExecuteCommand;
|
||||||
EditCommand.ExecuteCommand += EditCommand_ExecuteCommand;
|
EditCommand.ExecuteCommand += EditCommand_ExecuteCommand;
|
||||||
RemoveCommand.ExecuteCommand += RemoveCommand_ExecuteCommand;
|
RemoveCommand.ExecuteCommand += RemoveCommand_ExecuteCommand;
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="ComboBox_Pet"
|
x:Name="ComboBox_Pet"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
|
MinWidth="100"
|
||||||
pu:ComboBoxHelper.Watermark="{ll:Str 选择宠物}"
|
pu:ComboBoxHelper.Watermark="{ll:Str 选择宠物}"
|
||||||
ItemsSource="{Binding Pets}"
|
ItemsSource="{Binding Pets}"
|
||||||
SelectedItem="{Binding CurrentPet}"
|
SelectedItem="{Binding CurrentPet}"
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="ComboBox_Pet"
|
x:Name="ComboBox_Pet"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
|
MinWidth="100"
|
||||||
pu:ComboBoxHelper.Watermark="{ll:Str 选择宠物}"
|
pu:ComboBoxHelper.Watermark="{ll:Str 选择宠物}"
|
||||||
ItemsSource="{Binding Pets}"
|
ItemsSource="{Binding Pets}"
|
||||||
SelectedItem="{Binding CurrentPet}"
|
SelectedItem="{Binding CurrentPet}"
|
||||||
|
@ -41,7 +41,7 @@
|
|||||||
<ComboBox
|
<ComboBox
|
||||||
x:Name="ComboBox_Pet"
|
x:Name="ComboBox_Pet"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
MinWidth="150"
|
MinWidth="100"
|
||||||
pu:ComboBoxHelper.Watermark="{ll:Str 选择宠物}"
|
pu:ComboBoxHelper.Watermark="{ll:Str 选择宠物}"
|
||||||
ItemsSource="{Binding Pets}"
|
ItemsSource="{Binding Pets}"
|
||||||
SelectedItem="{Binding CurrentPet}"
|
SelectedItem="{Binding CurrentPet}"
|
||||||
|
Loading…
Reference in New Issue
Block a user