更新 身体触碰范围

This commit is contained in:
Hakoyu 2023-10-25 22:27:36 +08:00
parent 4d4a16222d
commit 3d70fa4b56
4 changed files with 105 additions and 4 deletions

View File

@ -36,6 +36,12 @@ public class PetModel : I18nModel<I18nPetInfoModel>
public ObservableValue<ObservableRect<double>> TouchHeadRect { get; } =
new(new(159, 16, 189, 178));
/// <summary>
/// 身体区域
/// </summary>
public ObservableValue<ObservableRect<double>> TouchBodyRect { get; } =
new(new(166, 206, 163, 136));
/// <summary>
/// 提起区域
/// </summary>
@ -99,6 +105,7 @@ public class PetModel : I18nModel<I18nPetInfoModel>
{
Id.Value = model.Id.Value;
TouchHeadRect.Value = model.TouchHeadRect.Value.Copy();
TouchBodyRect.Value = model.TouchBodyRect.Value.Copy();
TouchRaisedRect.Value = model.TouchRaisedRect.Value.Copy();
RaisePoint.Value = model.RaisePoint.Value.Copy();
foreach (var work in model.Works)
@ -122,6 +129,13 @@ public class PetModel : I18nModel<I18nPetInfoModel>
loader.Config.TouchHeadSize.Height
);
TouchBodyRect.Value.SetValue(
loader.Config.TouchBodyLocate.X,
loader.Config.TouchBodyLocate.Y,
loader.Config.TouchBodySize.Width,
loader.Config.TouchBodySize.Height
);
TouchRaisedRect.Value.Happy.Value.SetValue(
loader.Config.TouchRaisedLocate[0].X,
loader.Config.TouchRaisedLocate[0].Y,
@ -289,6 +303,15 @@ public class PetModel : I18nModel<I18nPetInfoModel>
new Sub("sh", TouchHeadRect.Value.Height.Value),
}
);
lps.Add(
new Line("touchbody")
{
new Sub("px", TouchBodyRect.Value.X.Value),
new Sub("py", TouchBodyRect.Value.Y.Value),
new Sub("sw", TouchBodyRect.Value.Width.Value),
new Sub("sh", TouchBodyRect.Value.Height.Value),
}
);
lps.Add(
new Line("touchraised")
{

View File

@ -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.8\lib\net462\VPet-Simulator.Core.dll</HintPath>
<HintPath>..\packages\VPet-Simulator.Core.1.0.9\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.8\lib\net462\VPet-Simulator.Windows.Interface.dll</HintPath>
<HintPath>..\packages\VPet-Simulator.Windows.Interface.1.0.9\lib\net462\VPet-Simulator.Windows.Interface.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />

View File

@ -89,6 +89,37 @@
</Style>
</Label.Style>
</Label>
<Label Content="{ll:Str 身体触碰范围}" Tag="{Binding IsChecked, ElementName=ToggleButton_TouchBody}">
<Label.Style>
<Style BasedOn="{StaticResource Label_ThouchRect}" TargetType="Label">
<Setter Property="Width">
<Setter.Value>
<MultiBinding Converter="{StaticResource CalculatorConverter}" ConverterParameter="*">
<Binding Path="Pet.Value.TouchBodyRect.Value.Width.Value" />
<Binding Path="LengthRatio.Value" />
</MultiBinding>
</Setter.Value>
</Setter>
<Setter Property="Height">
<Setter.Value>
<MultiBinding Converter="{StaticResource CalculatorConverter}" ConverterParameter="*">
<Binding Path="Pet.Value.TouchBodyRect.Value.Height.Value" />
<Binding Path="LengthRatio.Value" />
</MultiBinding>
</Setter.Value>
</Setter>
<Setter Property="Margin">
<Setter.Value>
<MultiBinding Converter="{StaticResource RatioMarginConverter}">
<Binding Path="LengthRatio.Value" />
<Binding Path="Pet.Value.TouchBodyRect.Value.X.Value" />
<Binding Path="Pet.Value.TouchBodyRect.Value.Y.Value" />
</MultiBinding>
</Setter.Value>
</Setter>
</Style>
</Label.Style>
</Label>
<Label Content="{ll:Str 开心状态提起范围}" Tag="{Binding IsChecked, ElementName=ToggleButton_TouchRaisedRect_HappyState}">
<Label.Style>
<Style BasedOn="{StaticResource Label_ThouchRect}" TargetType="Label">
@ -402,6 +433,53 @@
Value="{Binding Pet.Value.TouchHeadRect.Value.Height.Value, Mode=TwoWay}" />
</Grid>
</Grid>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<ToggleButton
x:Name="ToggleButton_TouchBody"
Padding="5"
HorizontalContentAlignment="Stretch"
Content="{ll:Str 身体触碰范围}" />
<Grid Grid.Column="1" Margin="5">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Background="{x:Null}" Content="x:" />
<pu:NumberInput Grid.Column="1" Value="{Binding Pet.Value.TouchBodyRect.Value.X.Value}" />
<Label
Grid.Column="2"
Background="{x:Null}"
Content="y:" />
<pu:NumberInput Grid.Column="3" Value="{Binding Pet.Value.TouchBodyRect.Value.Y.Value, Mode=TwoWay}" />
<Label
Grid.Row="1"
Background="{x:Null}"
Content="w:" />
<pu:NumberInput
Grid.Row="1"
Grid.Column="1"
Value="{Binding Pet.Value.TouchBodyRect.Value.Width.Value, Mode=TwoWay}" />
<Label
Grid.Row="1"
Grid.Column="2"
Background="{x:Null}"
Content="h:" />
<pu:NumberInput
Grid.Row="1"
Grid.Column="3"
Value="{Binding Pet.Value.TouchBodyRect.Value.Height.Value, Mode=TwoWay}" />
</Grid>
</Grid>
<Expander Header="{ll:Str 提起范围}">
<Grid>
<Grid.ColumnDefinitions>

View File

@ -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.8" targetFramework="net462" />
<package id="VPet-Simulator.Windows.Interface" version="1.0.8" targetFramework="net462" />
<package id="VPet-Simulator.Core" version="1.0.9" targetFramework="net462" />
<package id="VPet-Simulator.Windows.Interface" version="1.0.9" targetFramework="net462" />
</packages>