mirror of
https://github.com/LorisYounger/VPet.ModMaker.git
synced 2024-08-30 18:22:21 +00:00
实装 WorkEdit
This commit is contained in:
parent
2a259377de
commit
f6f6efe3f7
@ -5,5 +5,7 @@
|
||||
<c:MarginConverter x:Key="MarginConverter" />
|
||||
<c:RatioMarginConverter x:Key="RatioMarginConverter" />
|
||||
<c:CalculatorConverter x:Key="CalculatorConverter" />
|
||||
<c:StringFormatConverter x:Key="StringFormatConverter" />
|
||||
<c:BrushToMediaColorConverter x:Key="BrushToMediaColorConverter" />
|
||||
<c:MaxConverter x:Key="MaxConverter" />
|
||||
</ResourceDictionary>
|
27
VPet.ModMaker/Converters/BrushToMediaColorConverter.cs
Normal file
27
VPet.ModMaker/Converters/BrushToMediaColorConverter.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace VPet.ModMaker.Converters;
|
||||
|
||||
public class BrushToMediaColorConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is not SolidColorBrush brush)
|
||||
throw new ArgumentException("Not SolidColorBrush", nameof(value));
|
||||
return brush.Color;
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is not Color color)
|
||||
throw new ArgumentException("Not media color", nameof(value));
|
||||
return new SolidColorBrush(color);
|
||||
}
|
||||
}
|
27
VPet.ModMaker/Converters/MediaColorToBrushConverter.cs
Normal file
27
VPet.ModMaker/Converters/MediaColorToBrushConverter.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace VPet.ModMaker.Converters;
|
||||
|
||||
public class MediaColorToBrushConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is not Color color)
|
||||
throw new ArgumentException("Not media color", nameof(value));
|
||||
return new SolidColorBrush(color);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
if (value is not SolidColorBrush brush)
|
||||
throw new ArgumentException("Not SolidColorBrush", nameof(value));
|
||||
return brush.Color;
|
||||
}
|
||||
}
|
57
VPet.ModMaker/Converters/StringFormatConverter.cs
Normal file
57
VPet.ModMaker/Converters/StringFormatConverter.cs
Normal 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.Data;
|
||||
|
||||
namespace VPet.ModMaker.Converters;
|
||||
|
||||
/// <summary>
|
||||
/// 边距转换器
|
||||
/// <para>示例:
|
||||
/// <code><![CDATA[
|
||||
/// <MultiBinding Converter="{StaticResource MarginConverter}">
|
||||
/// <Binding Path="String" />
|
||||
/// <Binding Path="Value1" />
|
||||
/// <Binding Path="Value2" />
|
||||
/// </MultiBinding>
|
||||
/// OR
|
||||
/// <MultiBinding Converter="{StaticResource MarginConverter}" ConverterParameter="{}{0}{1}">
|
||||
/// <Binding Path="Value1" />
|
||||
/// <Binding Path="Value2" />
|
||||
/// </MultiBinding>
|
||||
/// ]]></code></para>
|
||||
/// </summary>
|
||||
public class StringFormatConverter : IMultiValueConverter
|
||||
{
|
||||
public object Convert(
|
||||
object[] values,
|
||||
Type targetType,
|
||||
object parameter,
|
||||
System.Globalization.CultureInfo culture
|
||||
)
|
||||
{
|
||||
var formatStr = (string)parameter;
|
||||
if (string.IsNullOrWhiteSpace(formatStr))
|
||||
{
|
||||
formatStr = (string)values[0];
|
||||
return string.Format(formatStr, values.Skip(1).ToArray());
|
||||
}
|
||||
else
|
||||
{
|
||||
return string.Format(formatStr, values);
|
||||
}
|
||||
}
|
||||
|
||||
public object[] ConvertBack(
|
||||
object value,
|
||||
Type[] targetTypes,
|
||||
object parameter,
|
||||
System.Globalization.CultureInfo culture
|
||||
)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
@ -22,7 +22,7 @@ public class ClickTextModel : I18nModel<I18nClickTextModel>
|
||||
.Cast<VPet_Simulator.Core.Main.WorkingState>()
|
||||
);
|
||||
|
||||
public ObservableValue<string> Name { get; } = new();
|
||||
public ObservableValue<string> Id { get; } = new();
|
||||
public ObservableValue<string> Working { get; } = new();
|
||||
public ObservableValue<ClickText.ModeType> Mode { get; } = new();
|
||||
public ObservableValue<VPet_Simulator.Core.Main.WorkingState> WorkingState { get; } = new();
|
||||
@ -42,7 +42,7 @@ public class ClickTextModel : I18nModel<I18nClickTextModel>
|
||||
public ClickTextModel(ClickTextModel clickText)
|
||||
: this()
|
||||
{
|
||||
Name.Value = clickText.Name.Value;
|
||||
Id.Value = clickText.Id.Value;
|
||||
Mode.Value = clickText.Mode.Value;
|
||||
Working.Value = clickText.Working.Value;
|
||||
WorkingState.Value = clickText.WorkingState.Value;
|
||||
@ -63,7 +63,7 @@ public class ClickTextModel : I18nModel<I18nClickTextModel>
|
||||
public ClickTextModel(ClickText clickText)
|
||||
: this()
|
||||
{
|
||||
Name.Value = clickText.Text;
|
||||
Id.Value = clickText.Text;
|
||||
Mode.Value = clickText.Mode;
|
||||
Working.Value = clickText.Working;
|
||||
WorkingState.Value = clickText.State;
|
||||
@ -82,7 +82,7 @@ public class ClickTextModel : I18nModel<I18nClickTextModel>
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Text = Name.Value,
|
||||
Text = Id.Value,
|
||||
Mode = Mode.Value,
|
||||
Working = Working.Value,
|
||||
State = WorkingState.Value,
|
||||
|
@ -16,8 +16,8 @@ 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<string> Id { get; } = new();
|
||||
public ObservableValue<string> DescriptionId { get; } = new();
|
||||
public ObservableValue<string> Graph { get; } = new();
|
||||
public ObservableValue<Food.FoodType> Type { get; } = new();
|
||||
public ObservableValue<double> Strength { get; } = new();
|
||||
@ -32,18 +32,18 @@ public class FoodModel : I18nModel<I18nFoodModel>
|
||||
|
||||
public FoodModel()
|
||||
{
|
||||
Description.Value = $"{Name.Value}_{nameof(Description)}";
|
||||
Name.ValueChanged += (v) =>
|
||||
DescriptionId.Value = $"{Id.Value}_{nameof(DescriptionId)}";
|
||||
Id.ValueChanged += (v) =>
|
||||
{
|
||||
Description.Value = $"{v}_{nameof(Description)}";
|
||||
DescriptionId.Value = $"{v}_{nameof(DescriptionId)}";
|
||||
};
|
||||
}
|
||||
|
||||
public FoodModel(FoodModel model)
|
||||
: this()
|
||||
{
|
||||
Name.Value = model.Name.Value;
|
||||
Description.Value = model.Description.Value;
|
||||
Id.Value = model.Id.Value;
|
||||
DescriptionId.Value = model.DescriptionId.Value;
|
||||
Graph.Value = model.Graph.Value;
|
||||
Type.Value = model.Type.Value;
|
||||
Strength.Value = model.Strength.Value;
|
||||
@ -63,8 +63,8 @@ public class FoodModel : I18nModel<I18nFoodModel>
|
||||
public FoodModel(Food food)
|
||||
: this()
|
||||
{
|
||||
Name.Value = food.Name;
|
||||
Description.Value = food.Desc;
|
||||
Id.Value = food.Name;
|
||||
DescriptionId.Value = food.Desc;
|
||||
Graph.Value = food.Graph;
|
||||
Type.Value = food.Type;
|
||||
Strength.Value = food.Strength;
|
||||
@ -83,8 +83,8 @@ public class FoodModel : I18nModel<I18nFoodModel>
|
||||
{
|
||||
return new Food()
|
||||
{
|
||||
Name = Name.Value,
|
||||
Desc = Description.Value,
|
||||
Name = Id.Value,
|
||||
Desc = DescriptionId.Value,
|
||||
Graph = Graph.Value,
|
||||
Type = Type.Value,
|
||||
Strength = Strength.Value,
|
||||
|
@ -19,7 +19,7 @@ public class LowTextModel : I18nModel<I18nLowTextModel>
|
||||
public static ObservableCollection<LowText.StrengthType> StrengthTypes { get; } =
|
||||
new(Enum.GetValues(typeof(LowText.StrengthType)).Cast<LowText.StrengthType>());
|
||||
|
||||
public ObservableValue<string> Name { get; } = new();
|
||||
public ObservableValue<string> Id { get; } = new();
|
||||
public ObservableValue<LowText.ModeType> Mode { get; } = new();
|
||||
public ObservableValue<LowText.StrengthType> Strength { get; } = new();
|
||||
public ObservableValue<LowText.LikeType> Like { get; } = new();
|
||||
@ -29,7 +29,7 @@ public class LowTextModel : I18nModel<I18nLowTextModel>
|
||||
public LowTextModel(LowTextModel lowText)
|
||||
: this()
|
||||
{
|
||||
Name.Value = lowText.Name.Value;
|
||||
Id.Value = lowText.Id.Value;
|
||||
Mode.Value = lowText.Mode.Value;
|
||||
Strength.Value = lowText.Strength.Value;
|
||||
Like.Value = lowText.Like.Value;
|
||||
@ -42,7 +42,7 @@ public class LowTextModel : I18nModel<I18nLowTextModel>
|
||||
public LowTextModel(LowText lowText)
|
||||
: this()
|
||||
{
|
||||
Name.Value = lowText.Text;
|
||||
Id.Value = lowText.Text;
|
||||
Mode.Value = lowText.Mode;
|
||||
Strength.Value = lowText.Strength;
|
||||
Like.Value = lowText.Like;
|
||||
@ -54,7 +54,7 @@ public class LowTextModel : I18nModel<I18nLowTextModel>
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Text = Name.Value,
|
||||
Text = Id.Value,
|
||||
Mode = Mode.Value,
|
||||
Strength = Strength.Value,
|
||||
Like = Like.Value,
|
||||
|
@ -20,9 +20,8 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
public const string ModInfoFile = "info.lps";
|
||||
public static ModInfoModel Current { get; set; } = new();
|
||||
|
||||
public ObservableValue<string> Name { get; } = new();
|
||||
public ObservableValue<string> Description { get; } = new();
|
||||
public ObservableValue<string> Summary { get; } = new();
|
||||
public ObservableValue<string> Id { get; } = new();
|
||||
public ObservableValue<string> DescriptionId { get; } = new();
|
||||
public ObservableValue<string> Author { get; } = new();
|
||||
public ObservableValue<string> GameVersion { get; } = new();
|
||||
public ObservableValue<string> ModVersion { get; } = new();
|
||||
@ -39,10 +38,10 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
|
||||
public ModInfoModel()
|
||||
{
|
||||
Description.Value = $"{Name.Value}_{nameof(Description)}";
|
||||
Name.ValueChanged += (v) =>
|
||||
DescriptionId.Value = $"{Id.Value}_{nameof(DescriptionId)}";
|
||||
Id.ValueChanged += (v) =>
|
||||
{
|
||||
Description.Value = $"{v}_{nameof(Description)}";
|
||||
DescriptionId.Value = $"{v}_{nameof(DescriptionId)}";
|
||||
};
|
||||
}
|
||||
|
||||
@ -50,8 +49,8 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
: this()
|
||||
{
|
||||
SourcePath.Value = loader.Path.FullName;
|
||||
Name.Value = loader.Name;
|
||||
Description.Value = loader.Intro;
|
||||
Id.Value = loader.Name;
|
||||
DescriptionId.Value = loader.Intro;
|
||||
Author.Value = loader.Author;
|
||||
GameVersion.Value = loader.GameVer.ToString();
|
||||
ModVersion.Value = loader.Ver.ToString();
|
||||
@ -91,39 +90,39 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
foreach (var food in Foods)
|
||||
{
|
||||
var foodI18n = food.I18nDatas[i18nData.Key];
|
||||
if (i18nData.Value.TryGetValue(food.Name.Value, out var name))
|
||||
if (i18nData.Value.TryGetValue(food.Id.Value, out var name))
|
||||
foodI18n.Name.Value = name;
|
||||
if (i18nData.Value.TryGetValue(food.Description.Value, out var description))
|
||||
if (i18nData.Value.TryGetValue(food.DescriptionId.Value, out var description))
|
||||
foodI18n.Description.Value = description;
|
||||
}
|
||||
foreach (var lowText in LowTexts)
|
||||
{
|
||||
var lowTextI18n = lowText.I18nDatas[i18nData.Key];
|
||||
if (i18nData.Value.TryGetValue(lowText.Name.Value, out var text))
|
||||
if (i18nData.Value.TryGetValue(lowText.Id.Value, out var text))
|
||||
lowTextI18n.Text.Value = text;
|
||||
}
|
||||
foreach (var clickText in ClickTexts)
|
||||
{
|
||||
var clickTextI18n = clickText.I18nDatas[i18nData.Key];
|
||||
if (i18nData.Value.TryGetValue(clickText.Name.Value, out var text))
|
||||
if (i18nData.Value.TryGetValue(clickText.Id.Value, out var text))
|
||||
clickTextI18n.Text.Value = text;
|
||||
}
|
||||
foreach (var selectText in SelectTexts)
|
||||
{
|
||||
var selectTextI18n = selectText.I18nDatas[i18nData.Key];
|
||||
if (i18nData.Value.TryGetValue(selectText.Name.Value, out var text))
|
||||
if (i18nData.Value.TryGetValue(selectText.Id.Value, out var text))
|
||||
selectTextI18n.Text.Value = text;
|
||||
if (i18nData.Value.TryGetValue(selectText.Choose.Value, out var choose))
|
||||
if (i18nData.Value.TryGetValue(selectText.ChooseId.Value, out var choose))
|
||||
selectTextI18n.Choose.Value = choose;
|
||||
}
|
||||
foreach (var pet in Pets)
|
||||
{
|
||||
var petI18n = pet.I18nDatas[i18nData.Key];
|
||||
if (i18nData.Value.TryGetValue(pet.Name.Value, out var name))
|
||||
if (i18nData.Value.TryGetValue(pet.Id.Value, out var name))
|
||||
petI18n.Name.Value = name;
|
||||
if (i18nData.Value.TryGetValue(pet.PetName.Value, out var petName))
|
||||
if (i18nData.Value.TryGetValue(pet.PetNameId.Value, out var petName))
|
||||
petI18n.PetName.Value = petName;
|
||||
if (i18nData.Value.TryGetValue(pet.Description.Value, out var description))
|
||||
if (i18nData.Value.TryGetValue(pet.DescriptionId.Value, out var description))
|
||||
petI18n.Description.Value = description;
|
||||
foreach (var work in pet.Works)
|
||||
{
|
||||
@ -149,13 +148,13 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
//var lps = new LpsDocument(File.ReadAllText(modInfoFile));
|
||||
var lps = new LPS()
|
||||
{
|
||||
new Line("vupmod", Name.Value)
|
||||
new Line("vupmod", Id.Value)
|
||||
{
|
||||
new Sub("author", Author.Value),
|
||||
new Sub("gamever", GameVersion.Value),
|
||||
new Sub("ver", ModVersion.Value)
|
||||
},
|
||||
new Line("intro", Description.Value),
|
||||
new Line("intro", DescriptionId.Value),
|
||||
new Line("authorid", "0"),
|
||||
new Line("itemid", "0"),
|
||||
new Line("cachedate", DateTime.Now.Date.ToString())
|
||||
@ -165,8 +164,8 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
lps.Add(
|
||||
new Line("lang", cultureName)
|
||||
{
|
||||
new Sub(Name.Value, I18nDatas[cultureName].Name.Value),
|
||||
new Sub(Description.Value, I18nDatas[cultureName].Description.Value),
|
||||
new Sub(Id.Value, I18nDatas[cultureName].Name.Value),
|
||||
new Sub(DescriptionId.Value, I18nDatas[cultureName].Description.Value),
|
||||
}
|
||||
);
|
||||
}
|
||||
@ -175,7 +174,7 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
if (imagePath != targetImagePath)
|
||||
File.Copy(imagePath, targetImagePath, true);
|
||||
//lps.FindLine("vupmod").Info = Id.Value;
|
||||
//lps.FindLine("intro").Info = Description.Value;
|
||||
//lps.FindLine("intro").Info = DescriptionId.Value;
|
||||
//lps.FindSub("gamever").Info = GameVersion.Value;
|
||||
//lps.FindSub("ver").Info = ModVersion.Value;
|
||||
//lps.FindSub("author").Info = Author.Value;
|
||||
@ -277,23 +276,26 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
var lps = new LPS();
|
||||
foreach (var food in Foods)
|
||||
{
|
||||
lps.Add(new Line(food.Name.Value, food.I18nDatas[cultureName].Name.Value));
|
||||
lps.Add(new Line(food.Id.Value, food.I18nDatas[cultureName].Name.Value));
|
||||
lps.Add(
|
||||
new Line(food.Description.Value, food.I18nDatas[cultureName].Description.Value)
|
||||
new Line(
|
||||
food.DescriptionId.Value,
|
||||
food.I18nDatas[cultureName].Description.Value
|
||||
)
|
||||
);
|
||||
}
|
||||
foreach (var text in LowTexts)
|
||||
{
|
||||
lps.Add(new Line(text.Name.Value, text.I18nDatas[cultureName].Text.Value));
|
||||
lps.Add(new Line(text.Id.Value, text.I18nDatas[cultureName].Text.Value));
|
||||
}
|
||||
foreach (var text in ClickTexts)
|
||||
{
|
||||
lps.Add(new Line(text.Name.Value, text.I18nDatas[cultureName].Text.Value));
|
||||
lps.Add(new Line(text.Id.Value, text.I18nDatas[cultureName].Text.Value));
|
||||
}
|
||||
foreach (var text in SelectTexts)
|
||||
{
|
||||
lps.Add(new Line(text.Name.Value, text.I18nDatas[cultureName].Text.Value));
|
||||
lps.Add(new Line(text.Choose.Value, text.I18nDatas[cultureName].Choose.Value));
|
||||
lps.Add(new Line(text.Id.Value, text.I18nDatas[cultureName].Text.Value));
|
||||
lps.Add(new Line(text.ChooseId.Value, text.I18nDatas[cultureName].Choose.Value));
|
||||
}
|
||||
File.WriteAllText(cultureFile, lps.ToString());
|
||||
}
|
||||
@ -312,7 +314,7 @@ public class ModInfoModel : I18nModel<I18nModInfoModel>
|
||||
var foodImagePath = Utils.GetImageSourceFile(food.Image.Value);
|
||||
var targetImagePath = Path.Combine(
|
||||
foodPath,
|
||||
$"{food.Name.Value}{Path.GetExtension(foodImagePath)}"
|
||||
$"{food.Id.Value}{Path.GetExtension(foodImagePath)}"
|
||||
);
|
||||
if (foodImagePath != targetImagePath)
|
||||
File.Copy(foodImagePath, targetImagePath, true);
|
||||
|
@ -14,7 +14,7 @@ public class ModMakerHistory
|
||||
public BitmapImage Image { get; set; }
|
||||
|
||||
[Line(ignoreCase: true)]
|
||||
public string Name { get; set; }
|
||||
public string Id { get; set; }
|
||||
|
||||
private string _path;
|
||||
|
||||
|
@ -13,9 +13,9 @@ namespace VPet.ModMaker.Models;
|
||||
|
||||
public class PetModel : I18nModel<I18nPetInfoModel>
|
||||
{
|
||||
public ObservableValue<string> Name { get; } = new();
|
||||
public ObservableValue<string> PetName { get; } = new();
|
||||
public ObservableValue<string> Description { get; } = new();
|
||||
public ObservableValue<string> Id { get; } = new();
|
||||
public ObservableValue<string> PetNameId { get; } = new();
|
||||
public ObservableValue<string> DescriptionId { get; } = new();
|
||||
public ObservableValue<ObservableRect<double>> TouchHeadRect { get; } = new(new());
|
||||
public ObservableValue<ObservableMultiStateRect> TouchRaisedRect { get; } = new(new());
|
||||
public ObservableValue<ObservableMultiStatePoint> RaisePoint { get; } = new(new());
|
||||
@ -24,19 +24,19 @@ public class PetModel : I18nModel<I18nPetInfoModel>
|
||||
|
||||
public PetModel()
|
||||
{
|
||||
PetName.Value = $"{Name.Value}_{nameof(PetName)}";
|
||||
Description.Value = $"{Name.Value}_{nameof(Description)}";
|
||||
Name.ValueChanged += (v) =>
|
||||
PetNameId.Value = $"{Id.Value}_{nameof(PetNameId)}";
|
||||
DescriptionId.Value = $"{Id.Value}_{nameof(DescriptionId)}";
|
||||
Id.ValueChanged += (v) =>
|
||||
{
|
||||
PetName.Value = $"{v}_{nameof(PetName)}";
|
||||
Description.Value = $"{v}_{nameof(Description)}";
|
||||
PetNameId.Value = $"{v}_{nameof(PetNameId)}";
|
||||
DescriptionId.Value = $"{v}_{nameof(DescriptionId)}";
|
||||
};
|
||||
}
|
||||
|
||||
public PetModel(PetModel model)
|
||||
: this()
|
||||
{
|
||||
Name.Value = model.Name.Value;
|
||||
Id.Value = model.Id.Value;
|
||||
TouchHeadRect.Value = model.TouchHeadRect.Value.Copy();
|
||||
TouchRaisedRect.Value = model.TouchRaisedRect.Value.Copy();
|
||||
RaisePoint.Value = model.RaisePoint.Value.Copy();
|
||||
@ -51,9 +51,9 @@ public class PetModel : I18nModel<I18nPetInfoModel>
|
||||
public PetModel(PetLoader loader)
|
||||
: this()
|
||||
{
|
||||
Name.Value = loader.Name;
|
||||
PetName.Value = loader.PetName;
|
||||
Description.Value = loader.Intor;
|
||||
Id.Value = loader.Name;
|
||||
PetNameId.Value = loader.PetName;
|
||||
DescriptionId.Value = loader.Intor;
|
||||
|
||||
TouchHeadRect.Value.SetValue(
|
||||
loader.Config.TouchHeadLocate.X,
|
||||
|
@ -26,8 +26,8 @@ public class SelectTextModel : I18nModel<I18nSelectTextModel>
|
||||
public ObservableValue<string> Tags { get; } = new();
|
||||
public ObservableValue<string> ToTags { get; } = new();
|
||||
|
||||
public ObservableValue<string> Name { get; } = new();
|
||||
public ObservableValue<string> Choose { get; } = new();
|
||||
public ObservableValue<string> Id { get; } = new();
|
||||
public ObservableValue<string> ChooseId { get; } = new();
|
||||
public ObservableValue<ClickText.ModeType> Mode { get; } = new();
|
||||
|
||||
//public ObservableValue<string> Working { get; } = new();
|
||||
@ -45,17 +45,17 @@ public class SelectTextModel : I18nModel<I18nSelectTextModel>
|
||||
|
||||
public SelectTextModel()
|
||||
{
|
||||
Choose.Value = $"{Name.Value}_{nameof(Choose)}";
|
||||
Name.ValueChanged += (v) =>
|
||||
ChooseId.Value = $"{Id.Value}_{nameof(ChooseId)}";
|
||||
Id.ValueChanged += (v) =>
|
||||
{
|
||||
Choose.Value = $"{v}_{nameof(Choose)}";
|
||||
ChooseId.Value = $"{v}_{nameof(ChooseId)}";
|
||||
};
|
||||
}
|
||||
|
||||
public SelectTextModel(SelectTextModel model)
|
||||
: this()
|
||||
{
|
||||
Name.Value = model.Name.Value;
|
||||
Id.Value = model.Id.Value;
|
||||
Mode.Value = model.Mode.Value;
|
||||
Tags.Value = model.Tags.Value;
|
||||
ToTags.Value = model.ToTags.Value;
|
||||
@ -79,8 +79,8 @@ public class SelectTextModel : I18nModel<I18nSelectTextModel>
|
||||
public SelectTextModel(SelectText text)
|
||||
: this()
|
||||
{
|
||||
Name.Value = text.Text;
|
||||
Choose.Value = text.Choose ?? string.Empty;
|
||||
Id.Value = text.Text;
|
||||
ChooseId.Value = text.Choose ?? string.Empty;
|
||||
Mode.Value = text.Mode;
|
||||
Tags.Value = text.Tags is null ? string.Empty : string.Join(", ", text.Tags);
|
||||
ToTags.Value = text.ToTags is null ? string.Empty : string.Join(", ", text.ToTags);
|
||||
@ -103,8 +103,8 @@ public class SelectTextModel : I18nModel<I18nSelectTextModel>
|
||||
{
|
||||
return new()
|
||||
{
|
||||
Text = Name.Value,
|
||||
Choose = Choose.Value,
|
||||
Text = Id.Value,
|
||||
Choose = ChooseId.Value,
|
||||
Mode = Mode.Value,
|
||||
Tags = new(Tags.Value.Split(rs_splitChar, StringSplitOptions.RemoveEmptyEntries)),
|
||||
ToTags = new(ToTags.Value.Split(rs_splitChar, StringSplitOptions.RemoveEmptyEntries)),
|
||||
|
@ -5,6 +5,7 @@ using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace VPet.ModMaker.Models;
|
||||
|
||||
@ -32,11 +33,16 @@ public class WorkModel : I18nModel<I18nWorkModel>
|
||||
public ObservableValue<int> Time { get; } = new();
|
||||
public ObservableValue<double> FinishBonus { get; } = new();
|
||||
|
||||
public ObservableValue<string> BorderBrush { get; } = new("0290D5");
|
||||
public ObservableValue<string> Background { get; } = new("81d4fa");
|
||||
public ObservableValue<string> ButtonBackground { get; } = new("0286C6");
|
||||
public ObservableValue<string> ButtonForeground { get; } = new("ffffff");
|
||||
public ObservableValue<string> Foreground { get; } = new("0286C6");
|
||||
public ObservableValue<SolidColorBrush> BorderBrush { get; } =
|
||||
new(new((Color)ColorConverter.ConvertFromString("#FF0290D5")));
|
||||
public ObservableValue<SolidColorBrush> Background { get; } =
|
||||
new(new((Color)ColorConverter.ConvertFromString("#FF81d4fa")));
|
||||
public ObservableValue<SolidColorBrush> Foreground { get; } =
|
||||
new(new((Color)ColorConverter.ConvertFromString("#FF0286C6")));
|
||||
public ObservableValue<SolidColorBrush> ButtonBackground { get; } =
|
||||
new(new((Color)ColorConverter.ConvertFromString("#AA0286C6")));
|
||||
public ObservableValue<SolidColorBrush> ButtonForeground { get; } =
|
||||
new(new((Color)ColorConverter.ConvertFromString("#FFffffff")));
|
||||
|
||||
public ObservableValue<double> Left { get; } = new(100);
|
||||
public ObservableValue<double> Top { get; } = new(160);
|
||||
@ -89,11 +95,15 @@ public class WorkModel : I18nModel<I18nWorkModel>
|
||||
Time.Value = work.Time;
|
||||
FinishBonus.Value = work.FinishBonus;
|
||||
|
||||
BorderBrush.Value = work.BorderBrush;
|
||||
Background.Value = work.Background;
|
||||
ButtonBackground.Value = work.ButtonBackground;
|
||||
ButtonForeground.Value = work.ButtonForeground;
|
||||
Foreground.Value = work.Foreground;
|
||||
BorderBrush.Value = new((Color)ColorConverter.ConvertFromString("#FF" + work.BorderBrush));
|
||||
Background.Value = new((Color)ColorConverter.ConvertFromString("#FF" + work.Background));
|
||||
Foreground.Value = new((Color)ColorConverter.ConvertFromString("#FF" + work.Foreground));
|
||||
ButtonBackground.Value = new(
|
||||
(Color)ColorConverter.ConvertFromString("#AA" + work.ButtonBackground)
|
||||
);
|
||||
ButtonForeground.Value = new(
|
||||
(Color)ColorConverter.ConvertFromString("#FF" + work.ButtonForeground)
|
||||
);
|
||||
|
||||
Left.Value = work.Left;
|
||||
Top.Value = work.Top;
|
||||
@ -116,11 +126,11 @@ public class WorkModel : I18nModel<I18nWorkModel>
|
||||
Time = Time.Value,
|
||||
FinishBonus = FinishBonus.Value,
|
||||
//
|
||||
BorderBrush = BorderBrush.Value,
|
||||
Background = Background.Value,
|
||||
ButtonBackground = ButtonBackground.Value,
|
||||
ButtonForeground = ButtonForeground.Value,
|
||||
Foreground = Foreground.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),
|
||||
//
|
||||
Left = Left.Value,
|
||||
Top = Top.Value,
|
||||
|
@ -27,5 +27,4 @@
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
</Style>
|
||||
<Style x:Key="Grid_Style" TargetType="Grid" />
|
||||
</ResourceDictionary>
|
@ -90,7 +90,10 @@
|
||||
<Compile Include="App.xaml.cs">
|
||||
<DependentUpon>App.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Converters\BrushToMediaColorConverter.cs" />
|
||||
<Compile Include="Converters\CalculatorConverter.cs" />
|
||||
<Compile Include="Converters\MediaColorToBrushConverter.cs" />
|
||||
<Compile Include="Converters\StringFormatConverter.cs" />
|
||||
<Compile Include="Converters\RatioMarginConverter.cs" />
|
||||
<Compile Include="Converters\MaxConverter.cs" />
|
||||
<Compile Include="Converters\MarginConverter.cs" />
|
||||
|
@ -44,7 +44,7 @@ public class ClickTextPageVM
|
||||
{
|
||||
ShowClickTexts.Value = new(
|
||||
ClickTexts.Where(
|
||||
m => m.Name.Value.Contains(value, StringComparison.OrdinalIgnoreCase)
|
||||
m => m.Id.Value.Contains(value, StringComparison.OrdinalIgnoreCase)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -45,7 +45,7 @@ public class FoodPageVM
|
||||
else
|
||||
{
|
||||
ShowFoods.Value = new(
|
||||
Foods.Where(m => m.Name.Value.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
Foods.Where(m => m.Id.Value.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -46,9 +46,7 @@ public class LowTextPageVM
|
||||
else
|
||||
{
|
||||
ShowLowTexts.Value = new(
|
||||
LowTexts.Where(
|
||||
m => m.Name.Value.Contains(value, StringComparison.OrdinalIgnoreCase)
|
||||
)
|
||||
LowTexts.Where(m => m.Id.Value.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ public class PetEditWindowVM
|
||||
|
||||
private void Image_ValueChanged(BitmapImage value)
|
||||
{
|
||||
LengthRatio.Value = BorderLength.Value / value.PixelWidth;
|
||||
//LengthRatio.Value = BorderLength.Value / value.PixelWidth;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
|
@ -43,7 +43,7 @@ public class PetPageVM
|
||||
else
|
||||
{
|
||||
ShowPets.Value = new(
|
||||
Pets.Where(m => m.Name.Value.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
Pets.Where(m => m.Id.Value.Contains(value, StringComparison.OrdinalIgnoreCase))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ public class SelectTextPageVM
|
||||
{
|
||||
ShowSelectTexts.Value = new(
|
||||
SelectTexts.Where(
|
||||
m => m.Name.Value.Contains(value, StringComparison.OrdinalIgnoreCase)
|
||||
m => m.Id.Value.Contains(value, StringComparison.OrdinalIgnoreCase)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -1,9 +1,12 @@
|
||||
using HKW.HKWViewModels.SimpleObservable;
|
||||
using LinePutScript.Localization.WPF;
|
||||
using Microsoft.Win32;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Imaging;
|
||||
using VPet.ModMaker.Models;
|
||||
|
||||
namespace VPet.ModMaker.ViewModels.ModEdit.WorkEdit;
|
||||
@ -15,4 +18,56 @@ public class WorkEditWindowVM
|
||||
public WorkModel OldWork { get; set; }
|
||||
public ObservableValue<WorkModel> Work { get; } = new(new());
|
||||
#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();
|
||||
#endregion
|
||||
public WorkEditWindowVM()
|
||||
{
|
||||
AddImageCommand.ExecuteEvent += AddImage;
|
||||
ChangeImageCommand.ExecuteEvent += ChangeImage;
|
||||
Image.ValueChanged += Image_ValueChanged;
|
||||
}
|
||||
|
||||
private void Image_ValueChanged(BitmapImage value)
|
||||
{
|
||||
//LengthRatio.Value = BorderLength.Value / value.PixelWidth;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Image.Value?.StreamSource?.Close();
|
||||
}
|
||||
|
||||
private void AddImage()
|
||||
{
|
||||
OpenFileDialog openFileDialog =
|
||||
new()
|
||||
{
|
||||
Title = "选择图片".Translate(),
|
||||
Filter = $"图片|*.jpg;*.jpeg;*.png;*.bmp".Translate()
|
||||
};
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
Image.Value = Utils.LoadImageToStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
|
||||
private void ChangeImage()
|
||||
{
|
||||
OpenFileDialog openFileDialog =
|
||||
new()
|
||||
{
|
||||
Title = "选择图片".Translate(),
|
||||
Filter = $"图片|*.jpg;*.jpeg;*.png;*.bmp".Translate()
|
||||
};
|
||||
if (openFileDialog.ShowDialog() is true)
|
||||
{
|
||||
Image.Value?.StreamSource?.Close();
|
||||
Image.Value = Utils.LoadImageToStream(openFileDialog.FileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,7 +54,11 @@ public class ModMakerWindowVM
|
||||
return;
|
||||
var lps = new LPS(File.ReadAllText(ModMakerInfo.HistoryFile));
|
||||
foreach (var line in lps)
|
||||
Histories.Add(LPSConvert.DeserializeObject<ModMakerHistory>(line));
|
||||
{
|
||||
var history = LPSConvert.DeserializeObject<ModMakerHistory>(line);
|
||||
if (Histories.All(h => h.InfoFile != history.InfoFile))
|
||||
Histories.Add(history);
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveHistories()
|
||||
@ -67,7 +71,7 @@ public class ModMakerWindowVM
|
||||
lps.Add(
|
||||
new Line(nameof(history))
|
||||
{
|
||||
new Sub("Id", history.Name),
|
||||
new Sub("Id", history.Id),
|
||||
new Sub("SourcePath", history.SourcePath),
|
||||
new Sub("LastTime", history.LastTimeString)
|
||||
}
|
||||
@ -77,7 +81,7 @@ public class ModMakerWindowVM
|
||||
|
||||
private void AddHistories(ModInfoModel modInfo)
|
||||
{
|
||||
if (Histories.FirstOrDefault(h => h.Name == modInfo.Name.Value) is ModMakerHistory history)
|
||||
if (Histories.FirstOrDefault(h => h.Id == modInfo.Id.Value) is ModMakerHistory history)
|
||||
{
|
||||
history.SourcePath = modInfo.SourcePath.Value;
|
||||
history.LastTime = DateTime.Now;
|
||||
@ -87,7 +91,7 @@ public class ModMakerWindowVM
|
||||
Histories.Add(
|
||||
new()
|
||||
{
|
||||
Name = modInfo.Name.Value,
|
||||
Id = modInfo.Id.Value,
|
||||
SourcePath = modInfo.SourcePath.Value,
|
||||
LastTime = DateTime.Now,
|
||||
}
|
||||
@ -100,7 +104,7 @@ public class ModMakerWindowVM
|
||||
if (string.IsNullOrEmpty(value))
|
||||
ShowHistories.Value = Histories;
|
||||
else
|
||||
ShowHistories.Value = new(Histories.Where(i => i.Name.Contains(value)));
|
||||
ShowHistories.Value = new(Histories.Where(i => i.Id.Contains(value)));
|
||||
}
|
||||
|
||||
public void CreateNewMod()
|
||||
|
@ -35,7 +35,7 @@
|
||||
Grid.Column="1"
|
||||
pu:TextBoxHelper.Watermark="Id"
|
||||
Style="{StaticResource TextBox_Wrap}"
|
||||
Text="{Binding ClickText.Value.Name.Value, UpdateSourceTrigger=PropertyChanged}"
|
||||
Text="{Binding ClickText.Value.Id.Value, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap" />
|
||||
</Grid>
|
||||
<TextBox
|
||||
|
@ -38,15 +38,15 @@ public partial class ClickTextEditWindow : Window
|
||||
|
||||
private void Button_Yes_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ViewModel.ClickText.Value.Name.Value))
|
||||
if (string.IsNullOrEmpty(ViewModel.ClickText.Value.Id.Value))
|
||||
{
|
||||
MessageBox.Show("Id不可为空".Translate(), "", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
if (
|
||||
ViewModel.OldClickText?.Name.Value != ViewModel.ClickText.Value.Name.Value
|
||||
ViewModel.OldClickText?.Id.Value != ViewModel.ClickText.Value.Id.Value
|
||||
&& ModInfoModel.Current.ClickTexts.Any(
|
||||
i => i.Name.Value == ViewModel.ClickText.Value.Name.Value
|
||||
i => i.Id.Value == ViewModel.ClickText.Value.Id.Value
|
||||
)
|
||||
)
|
||||
{
|
||||
|
@ -44,11 +44,11 @@
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
MaxWidth="200"
|
||||
Binding="{Binding Name.Value}"
|
||||
Binding="{Binding Id.Value}"
|
||||
CanUserSort="True"
|
||||
ElementStyle="{StaticResource TextBlock_Wrap}"
|
||||
IsReadOnly="True"
|
||||
SortMemberPath="Name.Value">
|
||||
SortMemberPath="Id.Value">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="Id" />
|
||||
</DataGridTextColumn.Header>
|
||||
|
@ -72,7 +72,7 @@
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
pu:TextBoxHelper.Watermark="Id"
|
||||
Text="{Binding Food.Value.Name.Value, UpdateSourceTrigger=PropertyChanged}" />
|
||||
Text="{Binding Food.Value.Id.Value, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Label Grid.Row="1" Content="{ll:Str 食物类型}" />
|
||||
<ComboBox
|
||||
x:Name="ComboBox_FoodType"
|
||||
|
@ -46,7 +46,7 @@ public partial class FoodEditWindow : Window
|
||||
|
||||
private void Button_Yes_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ViewModel.Food.Value.Name.Value))
|
||||
if (string.IsNullOrWhiteSpace(ViewModel.Food.Value.Id.Value))
|
||||
{
|
||||
MessageBox.Show("Id不可为空".Translate(), "", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
@ -62,8 +62,8 @@ public partial class FoodEditWindow : Window
|
||||
return;
|
||||
}
|
||||
if (
|
||||
ViewModel.OldFood?.Name.Value != ViewModel.Food.Value.Name.Value
|
||||
&& ModInfoModel.Current.Foods.Any(i => i.Name == ViewModel.Food.Value.Name)
|
||||
ViewModel.OldFood?.Id.Value != ViewModel.Food.Value.Id.Value
|
||||
&& ModInfoModel.Current.Foods.Any(i => i.Id == ViewModel.Food.Value.Id)
|
||||
)
|
||||
{
|
||||
MessageBox.Show("此Id已存在", "", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
|
@ -43,10 +43,10 @@
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding Name.Value}"
|
||||
Binding="{Binding Id.Value}"
|
||||
CanUserSort="True"
|
||||
IsReadOnly="True"
|
||||
SortMemberPath="Name.Value">
|
||||
SortMemberPath="Id.Value">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="Id" />
|
||||
</DataGridTextColumn.Header>
|
||||
|
@ -34,7 +34,7 @@
|
||||
<TextBox
|
||||
Grid.Column="1"
|
||||
Style="{StaticResource TextBox_Wrap}"
|
||||
Text="{Binding LowText.Value.Name.Value, UpdateSourceTrigger=PropertyChanged}" />
|
||||
Text="{Binding LowText.Value.Id.Value, UpdateSourceTrigger=PropertyChanged}" />
|
||||
</Grid>
|
||||
<TextBox
|
||||
x:Name="TextBox_Text"
|
||||
|
@ -39,15 +39,15 @@ public partial class LowTextEditWindow : Window
|
||||
|
||||
private void Button_Yes_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(ViewModel.LowText.Value.Name.Value))
|
||||
if (string.IsNullOrEmpty(ViewModel.LowText.Value.Id.Value))
|
||||
{
|
||||
MessageBox.Show("Id不可为空".Translate(), "", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
if (
|
||||
ViewModel.OldLowText?.Name.Value != ViewModel.LowText.Value.Name.Value
|
||||
ViewModel.OldLowText?.Id.Value != ViewModel.LowText.Value.Id.Value
|
||||
&& ModInfoModel.Current.LowTexts.Any(
|
||||
i => i.Name.Value == ViewModel.LowText.Value.Name.Value
|
||||
i => i.Id.Value == ViewModel.LowText.Value.Id.Value
|
||||
)
|
||||
)
|
||||
{
|
||||
|
@ -45,11 +45,11 @@
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
MaxWidth="200"
|
||||
Binding="{Binding Name.Value}"
|
||||
Binding="{Binding Id.Value}"
|
||||
CanUserSort="True"
|
||||
ElementStyle="{StaticResource TextBlock_Wrap}"
|
||||
IsReadOnly="True"
|
||||
SortMemberPath="Name.Value">
|
||||
SortMemberPath="Id.Value">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="Id" />
|
||||
</DataGridTextColumn.Header>
|
||||
|
@ -143,40 +143,58 @@
|
||||
</Grid>
|
||||
<Grid Grid.Column="1">
|
||||
<TabControl>
|
||||
<TabItem
|
||||
x:Name="TabItem_Food"
|
||||
Header="食物 (0)"
|
||||
Tag="{ll:Str 食物}">
|
||||
<TabItem Tag="{ll:Str 食物}">
|
||||
<TabItem.Header>
|
||||
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}{0} ({1})">
|
||||
<Binding Path="Tag" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding Path="ModInfo.Value.Foods.Count" />
|
||||
</MultiBinding>
|
||||
</TabItem.Header>
|
||||
<Frame Content="{Binding ModEditWindow.FoodPage}" />
|
||||
</TabItem>
|
||||
<TabItem
|
||||
x:Name="TabItem_ClickText"
|
||||
Header="点击文本 (0)"
|
||||
Tag="{ll:Str 点击文本}">
|
||||
<TabItem Tag="{ll:Str 点击文本}">
|
||||
<TabItem.Header>
|
||||
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}{0} ({1})">
|
||||
<Binding Path="Tag" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding Path="ModInfo.Value.ClickTexts.Count" />
|
||||
</MultiBinding>
|
||||
</TabItem.Header>
|
||||
<Frame Content="{Binding ModEditWindow.ClickTextPage}" />
|
||||
</TabItem>
|
||||
<TabItem
|
||||
x:Name="TabItem_LowText"
|
||||
Header="低状态文本 (0)"
|
||||
Tag="{ll:Str 低状态文本}">
|
||||
<TabItem Tag="{ll:Str 低状态文本}">
|
||||
<TabItem.Header>
|
||||
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}{0} ({1})">
|
||||
<Binding Path="Tag" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding Path="ModInfo.Value.LowTexts.Count" />
|
||||
</MultiBinding>
|
||||
</TabItem.Header>
|
||||
<Frame Content="{Binding ModEditWindow.LowTextPage}" />
|
||||
</TabItem>
|
||||
<TabItem
|
||||
x:Name="TabItem_SelectText"
|
||||
Header="选择文本 (0)"
|
||||
Tag="{ll:Str 选择文本}">
|
||||
<TabItem Tag="{ll:Str 选择文本}">
|
||||
<TabItem.Header>
|
||||
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}{0} ({1})">
|
||||
<Binding Path="Tag" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding Path="ModInfo.Value.SelectTexts.Count" />
|
||||
</MultiBinding>
|
||||
</TabItem.Header>
|
||||
<Frame Content="{Binding ModEditWindow.SelectTextPage}" />
|
||||
</TabItem>
|
||||
<TabItem
|
||||
x:Name="TabItem_Pet"
|
||||
Header="宠物 (0)"
|
||||
Tag="{ll:Str 宠物}">
|
||||
<TabItem Tag="{ll:Str 宠物}">
|
||||
<TabItem.Header>
|
||||
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}{0} ({1})">
|
||||
<Binding Path="Tag" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding Path="ModInfo.Value.Pets.Count" />
|
||||
</MultiBinding>
|
||||
</TabItem.Header>
|
||||
<Frame Content="{Binding ModEditWindow.PetPage}" />
|
||||
</TabItem>
|
||||
<TabItem
|
||||
x:Name="TabItem_Work"
|
||||
Header="工作 (0)"
|
||||
Tag="{ll:Str 工作}">
|
||||
<TabItem Tag="{ll:Str 工作}">
|
||||
<TabItem.Header>
|
||||
<MultiBinding Converter="{StaticResource StringFormatConverter}" ConverterParameter="{}{0} ({1})">
|
||||
<Binding Path="Tag" RelativeSource="{RelativeSource Mode=Self}" />
|
||||
<Binding Path="ModEditWindow.WorkPage.ViewModel.CurrentPet.Value.Works.Count" />
|
||||
</MultiBinding>
|
||||
</TabItem.Header>
|
||||
<Frame Content="{Binding ModEditWindow.WorkPage}" />
|
||||
</TabItem>
|
||||
<!--<TabItem Header="物品 (0)" Tag="{ll:Str 物品}">
|
||||
|
@ -38,61 +38,13 @@ public partial class ModEditWindow : Window
|
||||
public ClickTextPage ClickTextPage { get; } = new();
|
||||
public SelectTextPage SelectTextPage { get; } = new();
|
||||
public PetPage PetPage { get; } = new();
|
||||
|
||||
public WorkPage WorkPage { get; } = new();
|
||||
|
||||
public ModEditWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
Closed += Window_ModEdit_Closed;
|
||||
DataContext = new ModEditWindowVM(this);
|
||||
|
||||
FoodPage.ViewModel.Foods.CollectionChanged += Foods_CollectionChanged;
|
||||
LowTextPage.ViewModel.LowTexts.CollectionChanged += LowTexts_CollectionChanged;
|
||||
ClickTextPage.ViewModel.ClickTexts.CollectionChanged += ClickTexts_CollectionChanged;
|
||||
SelectTextPage.ViewModel.SelectTexts.CollectionChanged += SelectTexts_CollectionChanged;
|
||||
PetPage.ViewModel.Pets.CollectionChanged += Pets_CollectionChanged;
|
||||
//WorkPage.ViewModel.Works.CollectionChanged += Works_CollectionChanged;
|
||||
|
||||
TabItem_ClickText.Header =
|
||||
$"{TabItem_ClickText.Tag} ({ClickTextPage.ViewModel.ClickTexts.Count})";
|
||||
TabItem_LowText.Header = $"{TabItem_LowText.Tag} ({LowTextPage.ViewModel.LowTexts.Count})";
|
||||
TabItem_Food.Header = $"{TabItem_Food.Tag} ({FoodPage.ViewModel.Foods.Count})";
|
||||
TabItem_SelectText.Header =
|
||||
$"{TabItem_SelectText.Tag} ({SelectTextPage.ViewModel.SelectTexts.Count})";
|
||||
TabItem_Pet.Header = $"{TabItem_Pet.Tag} ({PetPage.ViewModel.Pets.Count})";
|
||||
}
|
||||
|
||||
private void Works_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
TabItem_Work.Header = $"{TabItem_Work.Tag} ({WorkPage.ViewModel.Works.Count})";
|
||||
}
|
||||
|
||||
private void Pets_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
TabItem_Pet.Header = $"{TabItem_Pet.Tag} ({PetPage.ViewModel.Pets.Count})";
|
||||
}
|
||||
|
||||
private void SelectTexts_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
TabItem_SelectText.Header =
|
||||
$"{TabItem_SelectText.Tag} ({SelectTextPage.ViewModel.SelectTexts.Count})";
|
||||
}
|
||||
|
||||
private void ClickTexts_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
TabItem_ClickText.Header =
|
||||
$"{TabItem_ClickText.Tag} ({ClickTextPage.ViewModel.ClickTexts.Count})";
|
||||
}
|
||||
|
||||
private void LowTexts_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
TabItem_LowText.Header = $"{TabItem_LowText.Tag} ({LowTextPage.ViewModel.LowTexts.Count})";
|
||||
}
|
||||
|
||||
private void Foods_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
TabItem_Food.Header = $"{TabItem_Food.Tag} ({FoodPage.ViewModel.Foods.Count})";
|
||||
Closed += Window_ModEdit_Closed;
|
||||
}
|
||||
|
||||
private void Window_ModEdit_Closed(object sender, EventArgs e)
|
||||
|
@ -335,7 +335,7 @@
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Id" />
|
||||
<TextBox Grid.Column="1" Text="{Binding Pet.Value.Name.Value}" />
|
||||
<TextBox Grid.Column="1" Text="{Binding Pet.Value.Id.Value}" />
|
||||
<Label Grid.Row="1" Content="{ll:Str 名称}" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
|
@ -31,8 +31,7 @@ public partial class PetEditWindow : Window
|
||||
InitializeComponent();
|
||||
Closed += (s, e) =>
|
||||
{
|
||||
if (IsCancel)
|
||||
ViewModel.Close();
|
||||
ViewModel.Close();
|
||||
};
|
||||
}
|
||||
|
||||
@ -43,7 +42,7 @@ public partial class PetEditWindow : Window
|
||||
|
||||
private void Button_Yes_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ViewModel.Pet.Value.Name.Value))
|
||||
if (string.IsNullOrWhiteSpace(ViewModel.Pet.Value.Id.Value))
|
||||
{
|
||||
MessageBox.Show("Id不可为空".Translate(), "", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
@ -64,8 +63,8 @@ public partial class PetEditWindow : Window
|
||||
return;
|
||||
}
|
||||
if (
|
||||
ViewModel.OldPet?.Name.Value != ViewModel.Pet.Value.Name.Value
|
||||
&& ModInfoModel.Current.Pets.Any(i => i.Name == ViewModel.Pet.Value.Name)
|
||||
ViewModel.OldPet?.Id.Value != ViewModel.Pet.Value.Id.Value
|
||||
&& ModInfoModel.Current.Pets.Any(i => i.Id == ViewModel.Pet.Value.Id)
|
||||
)
|
||||
{
|
||||
MessageBox.Show("此Id已存在", "", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
|
@ -43,10 +43,10 @@
|
||||
</DataGrid.RowStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Binding="{Binding Name.Value}"
|
||||
Binding="{Binding Id.Value}"
|
||||
CanUserSort="True"
|
||||
IsReadOnly="True"
|
||||
SortMemberPath="Name.Value">
|
||||
SortMemberPath="Id.Value">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="Id" />
|
||||
</DataGridTextColumn.Header>
|
||||
|
@ -39,7 +39,7 @@
|
||||
Grid.Column="1"
|
||||
pu:TextBoxHelper.Watermark="Id"
|
||||
Style="{StaticResource TextBox_Wrap}"
|
||||
Text="{Binding SelectText.Value.Name.Value, UpdateSourceTrigger=PropertyChanged}"
|
||||
Text="{Binding SelectText.Value.Id.Value, UpdateSourceTrigger=PropertyChanged}"
|
||||
TextWrapping="Wrap" />
|
||||
<Label Grid.Row="1" Content="{ll:Str 选项名}" />
|
||||
<TextBox
|
||||
|
@ -38,15 +38,15 @@ public partial class SelectTextEditWindow : Window
|
||||
|
||||
private void Button_Yes_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(ViewModel.SelectText.Value.Name.Value))
|
||||
if (string.IsNullOrWhiteSpace(ViewModel.SelectText.Value.Id.Value))
|
||||
{
|
||||
MessageBox.Show("Id不可为空".Translate(), "", MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
return;
|
||||
}
|
||||
if (
|
||||
ViewModel.OldSelectText?.Name.Value != ViewModel.SelectText.Value.Name.Value
|
||||
ViewModel.OldSelectText?.Id.Value != ViewModel.SelectText.Value.Id.Value
|
||||
&& ModInfoModel.Current.SelectTexts.Any(
|
||||
i => i.Name.Value == ViewModel.SelectText.Value.Name.Value
|
||||
i => i.Id.Value == ViewModel.SelectText.Value.Id.Value
|
||||
)
|
||||
)
|
||||
{
|
||||
|
@ -44,11 +44,11 @@
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
MaxWidth="200"
|
||||
Binding="{Binding Name.Value}"
|
||||
Binding="{Binding Id.Value}"
|
||||
CanUserSort="True"
|
||||
ElementStyle="{StaticResource TextBlock_Wrap}"
|
||||
IsReadOnly="True"
|
||||
SortMemberPath="Name.Value">
|
||||
SortMemberPath="Id.Value">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock Text="Id" />
|
||||
</DataGridTextColumn.Header>
|
||||
|
@ -12,7 +12,285 @@
|
||||
Width="800"
|
||||
Height="450"
|
||||
mc:Ignorable="d">
|
||||
<Grid >
|
||||
|
||||
<d:Window.DataContext>
|
||||
<vm:WorkEditWindowVM />
|
||||
</d:Window.DataContext>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid>
|
||||
<Image
|
||||
Width="250"
|
||||
Height="250"
|
||||
Source="{Binding Image.Value}"
|
||||
Stretch="Uniform">
|
||||
<Image.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Command="{Binding ChangeImageCommand}" Header="{ll:Str 修改测试图片}" />
|
||||
</ContextMenu>
|
||||
</Image.ContextMenu>
|
||||
</Image>
|
||||
<Label
|
||||
Padding="0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top"
|
||||
HorizontalContentAlignment="Stretch"
|
||||
VerticalContentAlignment="Stretch"
|
||||
pu:LabelHelper.CornerRadius="5"
|
||||
Background="{Binding Work.Value.Background.Value}"
|
||||
BorderBrush="{Binding Work.Value.BorderBrush.Value}"
|
||||
BorderThickness="3"
|
||||
Tag="{Binding IsChecked, ElementName=ToggleButton_TouchHead}">
|
||||
<Label.Style>
|
||||
<Style BasedOn="{StaticResource {x:Type Label}}" TargetType="Label">
|
||||
<Setter Property="Width">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource CalculatorConverter}">
|
||||
<Binding Path="Work.Value.Width.Value" />
|
||||
<Binding Source="*" />
|
||||
<Binding Path="LengthRatio.Value" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Height">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource CalculatorConverter}">
|
||||
<Binding Path="Work.Value.Width.Value" />
|
||||
<Binding Source="*" />
|
||||
<Binding Path="LengthRatio.Value" />
|
||||
<Binding Source="/" />
|
||||
<Binding Source="300" />
|
||||
<Binding Source="*" />
|
||||
<Binding Source="180" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Margin">
|
||||
<Setter.Value>
|
||||
<MultiBinding Converter="{StaticResource RatioMarginConverter}">
|
||||
<Binding Path="LengthRatio.Value" />
|
||||
<Binding Path="Work.Value.Left.Value" />
|
||||
<Binding Path="Work.Value.Top.Value" />
|
||||
</MultiBinding>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Label.Style>
|
||||
<Label.Content>
|
||||
<Grid>
|
||||
<Label
|
||||
HorizontalContentAlignment="Center"
|
||||
VerticalContentAlignment="Center"
|
||||
Background="{Binding Work.Value.Background.Value}"
|
||||
Content="{ll:Str 工作中}"
|
||||
Foreground="{Binding Work.Value.Foreground.Value}" />
|
||||
<Button
|
||||
VerticalAlignment="Bottom"
|
||||
Background="{Binding Work.Value.ButtonBackground.Value}"
|
||||
Content="{ll:Str 停止工作}"
|
||||
Foreground="{Binding Work.Value.ButtonForeground.Value}" />
|
||||
</Grid>
|
||||
</Label.Content>
|
||||
</Label>
|
||||
<Button
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding AddImageCommand}"
|
||||
Content="{ll:Str 添加测试图片}">
|
||||
<Button.Style>
|
||||
<Style BasedOn="{StaticResource {x:Type Button}}" TargetType="Button">
|
||||
<Setter Property="Visibility" Value="Hidden" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding Image.Value}" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Visible" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</Grid>
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="Id" />
|
||||
<TextBox Grid.Column="1" Text="{Binding Work.Value.Id.Value}" />
|
||||
<Label Grid.Row="1" Content="{ll:Str 名称}" />
|
||||
<TextBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Text="{Binding Work.Value.CurrentI18nData.Value.Name.Value}" />
|
||||
<Label Grid.Row="2" Content="{ll:Str 类型}" />
|
||||
<ComboBox
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
ItemsSource="{Binding Work.Value.WorkTypes}"
|
||||
SelectedItem="{Binding Work.Value.WorkType.Value}" />
|
||||
<Label Grid.Row="3" Content="{ll:Str 指定动画}" />
|
||||
<TextBox
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Text="{Binding Work.Value.Graph.Value}" />
|
||||
<!--<Label Grid.Row="3" Content="{ll:Str 宠物描述}" />
|
||||
<TextBox
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Text="{Binding Pet.Value.CurrentI18nData.Value.Description.Value}" />-->
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid Grid.Column="1">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<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" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="{ll:Str 基础倍率}" />
|
||||
<pu:NumberInput Grid.Column="1" Value="{Binding Work.Value.MoneyBase.Value}" />
|
||||
<Label Grid.Row="1" Content="{ll:Str 等级倍率}" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Work.Value.MoneyLevel.Value}" />
|
||||
<Label Grid.Row="2" Content="{ll:Str 饱食度消耗倍率}" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Work.Value.StrengthFood.Value}" />
|
||||
<Label Grid.Row="3" Content="{ll:Str 口渴度消耗倍率}" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Work.Value.StrengthDrink.Value}" />
|
||||
<Label Grid.Row="4" Content="{ll:Str 心情消耗倍率}" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Work.Value.Feeling.Value}" />
|
||||
<Label Grid.Row="5" Content="{ll:Str 奖励倍率}" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Work.Value.FinishBonus.Value}" />
|
||||
<Label Grid.Row="6" Content="{ll:Str 等级限制}" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Work.Value.FinishBonus.Value}" />
|
||||
<Label Grid.Row="7" Content="{ll:Str 花费时间(分钟)}" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Work.Value.FinishBonus.Value}" />
|
||||
</Grid>
|
||||
<Expander Grid.Row="1" Header="{ll:Str 界面样式}">
|
||||
<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" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label Content="{ll:Str 边框颜色}" />
|
||||
<pu:ColorPicker Grid.Column="1" SelectedColor="{Binding Work.Value.BorderBrush.Value, Converter={StaticResource BrushToMediaColorConverter}}" />
|
||||
<Label Grid.Row="1" Content="{ll:Str 背景颜色}" />
|
||||
<pu:ColorPicker
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
SelectedColor="{Binding Work.Value.Background.Value, Converter={StaticResource BrushToMediaColorConverter}}" />
|
||||
<Label Grid.Row="2" Content="{ll:Str 字体颜色}" />
|
||||
<pu:ColorPicker
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
SelectedColor="{Binding Work.Value.Foreground.Value, Converter={StaticResource BrushToMediaColorConverter}}" />
|
||||
<Label Grid.Row="3" Content="{ll:Str 按钮背景颜色}" />
|
||||
<pu:ColorPicker
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
SelectedColor="{Binding Work.Value.ButtonBackground.Value, Converter={StaticResource BrushToMediaColorConverter}}" />
|
||||
<Label Grid.Row="4" Content="{ll:Str 按钮字体颜色}" />
|
||||
<pu:ColorPicker
|
||||
Grid.Row="4"
|
||||
Grid.Column="1"
|
||||
SelectedColor="{Binding Work.Value.ButtonForeground.Value, Converter={StaticResource BrushToMediaColorConverter}}" />
|
||||
<Label Grid.Row="5" Content="X" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="5"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Work.Value.Left.Value}" />
|
||||
<Label Grid.Row="6" Content="Y" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="6"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Work.Value.Top.Value}" />
|
||||
<Label Grid.Row="7" Content="{ll:Str 宽}" />
|
||||
<pu:NumberInput
|
||||
Grid.Row="7"
|
||||
Grid.Column="1"
|
||||
Value="{Binding Work.Value.Width.Value}" />
|
||||
</Grid>
|
||||
</Expander>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
<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>
|
||||
|
@ -29,6 +29,10 @@ public partial class WorkEditWindow : Window
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new WorkEditWindowVM();
|
||||
Closed += (s, e) =>
|
||||
{
|
||||
ViewModel.Close();
|
||||
};
|
||||
}
|
||||
|
||||
private void Button_Cancel_Click(object sender, RoutedEventArgs e)
|
||||
|
@ -41,7 +41,7 @@
|
||||
x:Name="ComboBox_Pet"
|
||||
Grid.Column="1"
|
||||
pu:ComboBoxHelper.Watermark="{ll:Str 选择宠物}"
|
||||
DisplayMemberPath="Name.Value"
|
||||
DisplayMemberPath="Id.Value"
|
||||
ItemsSource="{Binding Pets}"
|
||||
SelectedItem="{Binding CurrentPet.Value}">
|
||||
<ComboBox.ItemContainerStyle>
|
||||
|
@ -68,7 +68,7 @@
|
||||
<TextBlock
|
||||
d:Text="{ll:Str Mod名称}"
|
||||
FontWeight="Bold"
|
||||
Text="{Binding Name}"
|
||||
Text="{Binding Id}"
|
||||
TextWrapping="Wrap" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
|
Loading…
Reference in New Issue
Block a user