diff --git a/Anamnesis/Actor/Converters/NpcFaceWarningConverter.cs b/Anamnesis/Actor/Converters/NpcFaceWarningConverter.cs new file mode 100644 index 000000000..318f42ed1 --- /dev/null +++ b/Anamnesis/Actor/Converters/NpcFaceWarningConverter.cs @@ -0,0 +1,39 @@ +// © Anamnesis. +// Licensed under the MIT license. + +namespace Anamnesis.Converters; + +using System; +using System.Globalization; +using System.Windows; +using System.Windows.Data; +using Anamnesis.Memory; + +public class NpcFaceWarningConverter : IMultiValueConverter +{ + public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) + { + if (values.Length != 2) + throw new ArgumentException(); + + if (values[0] is ActorTypes type && values[1] is byte head) + { + if (type == ActorTypes.BattleNpc || type == ActorTypes.EventNpc) + return Visibility.Collapsed; + + if (head > 5) + return Visibility.Visible; + + return Visibility.Collapsed; + } + else + { + return Visibility.Collapsed; + } + } + + public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) + { + throw new NotSupportedException("NpcFaceWarningConverter is a OneWay converter."); + } +} diff --git a/Anamnesis/Actor/Pages/CharacterPage.xaml b/Anamnesis/Actor/Pages/CharacterPage.xaml index a0e86fa39..d48f483b7 100644 --- a/Anamnesis/Actor/Pages/CharacterPage.xaml +++ b/Anamnesis/Actor/Pages/CharacterPage.xaml @@ -1,112 +1,128 @@ - + - + - + - + - + - + - + - + - + - - - - + - + @@ -121,9 +137,10 @@ - + @@ -140,49 +157,67 @@ + - - - - - - - - - + + + + + + + + + + + + + Padding="10,5" + HorizontalAlignment="Left" + FontSize="13" + FontStyle="Italic" + FontWeight="Bold" + Style="{StaticResource Label}" + Text="{Binding Name}" /> @@ -190,21 +225,38 @@ - + - - - - - - + + + + + + @@ -212,133 +264,210 @@ - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + Player Characters are not NPC-face compatible. + + + + + See More + + + + + - + - + - - + + - - - - - - - - - - - - + + + + + + + + + + + + - - + - - - + + + + + + + + + + + + + + - - + - + - + - + - + - - - - - - - - - - - + diff --git a/Anamnesis/Actor/Pages/CharacterPage.xaml.cs b/Anamnesis/Actor/Pages/CharacterPage.xaml.cs index 16db3233b..a322737c5 100644 --- a/Anamnesis/Actor/Pages/CharacterPage.xaml.cs +++ b/Anamnesis/Actor/Pages/CharacterPage.xaml.cs @@ -10,6 +10,7 @@ namespace Anamnesis.Actor.Pages; using System.Windows; using System.Windows.Controls; using System.Windows.Data; +using System.Windows.Navigation; using Anamnesis.Actor.Utilities; using Anamnesis.Actor.Views; using Anamnesis.Files; @@ -404,6 +405,11 @@ private void OnActorChanged(ActorMemory? actor) }); } + private void OnNavigate(object sender, RequestNavigateEventArgs e) + { + UrlUtility.Open(e.Uri.AbsoluteUri); + } + public class VoiceEntry { public byte VoiceId { get; set; } diff --git a/Anamnesis/Anamnesis.csproj b/Anamnesis/Anamnesis.csproj index 95ff0cef5..e25a0e3be 100644 --- a/Anamnesis/Anamnesis.csproj +++ b/Anamnesis/Anamnesis.csproj @@ -97,6 +97,8 @@ + + diff --git a/Anamnesis/Data/NpcNames.json b/Anamnesis/Data/NpcNames.json index 2f5f4bb27..fcc7bcce7 100644 --- a/Anamnesis/Data/NpcNames.json +++ b/Anamnesis/Data/NpcNames.json @@ -2868,5 +2868,6 @@ "E:1036501": "N:0010037", "E:1036508": "Trinity Seeker Clone", "E:1036616": "Much-coveted Mora", - "E:1036671": "N:0003485" + "E:1036671": "N:0003485", + "B:0013132": "N:0010184" } \ No newline at end of file diff --git a/Anamnesis/Languages/cn.json b/Anamnesis/Languages/cn.json index 0b794c4f0..292193d37 100644 --- a/Anamnesis/Languages/cn.json +++ b/Anamnesis/Languages/cn.json @@ -27,10 +27,7 @@ "Error_WrongVersion": "Anamnesis 尚未对此游戏版本进行验证,这可能会导致问题。\n\n如果最近发布了游戏补丁,请检查 Anamnesis 更新。如果没有更新,或没有关于 Anamnesis 无法运行的报告,那么可以点击“确定”继续。", "Warning_MinionGposeTitle": "宠物不兼容集体动作模式", - "Warning_MinionGposeFace": "选定的角色是一个宠物。\n进入集体动作模式时会重置为有效的宠物选项。", - - "Warning_MinionGposeTitle": "宠物与GPose不兼容。", - "Warning_MinionGposeFace": "选择的演员是一个宠物。\n进入GPose时,外观将重置为有效的宠物选项。", + "Warning_MinionGposeFace": "选定的角色是一个宠物。\n进入集体动作模式时,外观会重置为有效的宠物选项。", "FileBrowser_GoUp": "返回上一级", "FileBrowser_Flatten": "平铺文件", diff --git a/Anamnesis/Memory/ActorModelMemory.cs b/Anamnesis/Memory/ActorModelMemory.cs index efdad9c91..6609975d9 100644 --- a/Anamnesis/Memory/ActorModelMemory.cs +++ b/Anamnesis/Memory/ActorModelMemory.cs @@ -46,6 +46,7 @@ public enum DataPaths : short [Bind(0x0A0, BindFlags.Pointer | BindFlags.OnlyInGPose)] public SkeletonMemory? Skeleton { get; set; } [Bind(0x148, BindFlags.Pointer)] public BustMemory? Bust { get; set; } [Bind(0x248, 0x040, 0x020, BindFlags.Pointer)] public ExtendedAppearanceMemory? ExtendedAppearance { get; set; } + [Bind(0x260)] public Color Tint { get; set; } [Bind(0x274)] public float Height { get; set; } [Bind(0x2B0)] public float Wetness { get; set; } [Bind(0x2BC)] public float Drenched { get; set; } @@ -102,8 +103,10 @@ protected override bool CanRead(BindInfo bind) protected override void OnSelfPropertyChanged(object? sender, PropertyChangedEventArgs e) { - if (this.Height <= 0) + if(e.PropertyName == nameof(this.Height) && this.Height <= 0) + { this.Height = 0.1f; + } base.OnSelfPropertyChanged(sender, e); } diff --git a/Anamnesis/Services/PinnedActor.cs b/Anamnesis/Services/PinnedActor.cs index 1bbd828e2..03a1343aa 100644 --- a/Anamnesis/Services/PinnedActor.cs +++ b/Anamnesis/Services/PinnedActor.cs @@ -20,7 +20,7 @@ namespace Anamnesis; [AddINotifyPropertyChangedInterface] public class PinnedActor : INotifyPropertyChanged, IDisposable { - private bool wasPlayer = false; + ////private bool wasPlayer = false; private bool isRestoringBackup = false; public PinnedActor(ActorMemory memory) @@ -420,14 +420,14 @@ private void UpdateInitials(string? name) private void OnRetargetedActor(IntPtr? oldPointer, IntPtr? newPointer) { - if (GposeService.GetIsGPose() && + /*if (GposeService.GetIsGPose() && this.wasPlayer && this.Memory != null && this.Memory.ObjectKind != ActorTypes.Player) { IntPtr objectKindAddress = this.Memory.GetAddressOfProperty(nameof(ActorBasicMemory.ObjectKind)); MemoryService.Write(objectKindAddress, ActorTypes.Player, "NPC face hack - entered gpose - gpose actor"); - } + }*/ // If we need to apply the appearance thanks to a GPose boundary changes? if (SettingsService.Current.ReapplyAppearance || GposeService.GetIsGPose()) @@ -450,7 +450,7 @@ private void OnGposeStateChanged(bool newState) { this.CreateCharacterBackup(BackupModes.Gpose); - Task.Run(async () => + /*Task.Run(async () => { if (this.Memory != null && this.Memory.ObjectKind == ActorTypes.Player) { @@ -461,7 +461,7 @@ private void OnGposeStateChanged(bool newState) await Task.Delay(1000); MemoryService.Write(objectKindAddress, ActorTypes.Player, "NPC face hack - entered gpose - overworld actor"); } - }); + });*/ } } } \ No newline at end of file