Skip to content

Commit

Permalink
Merge branch 'imchillin:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Squall-Leonhart authored Apr 5, 2023
2 parents 9e1cb3b + 33a0ba0 commit 669d8bc
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Anamnesis/Actor/Pages/CharacterPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
Margin="6,3"
HorizontalAlignment="Left"
TextWrapping="Wrap">
Player Characters are not NPC-face compatible.
Player Characters are not NPC-face or child race compatible.
</TextBlock>

<TextBlock
Expand Down
2 changes: 1 addition & 1 deletion Anamnesis/Actor/Refresh/BrioActorRefresher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public async Task RefreshActor(ActorMemory actor)
redrawType |= RedrawType.ForceRedrawWeaponsOnOptimized;
}

if (actor.IsWeaponDirty && isPosing)
if (actor.IsOverworldActor || (actor.IsWeaponDirty && isPosing))
{
redrawType &= ~RedrawType.AllowOptimized;
}
Expand Down
6 changes: 0 additions & 6 deletions Anamnesis/Core/Memory/AddressService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ public class AddressService : ServiceBase<AddressService>
public static IntPtr Framework { get; set; }
public static IntPtr PlayerTargetSystem { get; set; }
public static IntPtr AnimationSpeedPatch { get; set; }
public static IntPtr CameraAngleXFreeze { get; set; }
public static IntPtr CameraAngleYFreeze { get; set; }
public static IntPtr GPoseCameraPositionFreeze { get; set; }

public static IntPtr Camera
{
Expand Down Expand Up @@ -146,9 +143,6 @@ private async Task Scan()
tasks.Add(this.GetAddressFromSignature("GPose", "48 39 0D ?? ?? ?? ?? 75 28", 0, (p) => { GPose = p + 0x20; }));
tasks.Add(this.GetAddressFromSignature("Camera", "48 8D 35 ?? ?? ?? ?? 48 8B 09", 0, (p) => { cameraManager = p; })); // CameraAddress
tasks.Add(this.GetAddressFromSignature("PlayerTargetSystem", "48 8B 05 ?? ?? ?? ?? 48 8D 0D ?? ?? ?? ?? FF 50 ?? 48 85 DB", 0, (p) => { PlayerTargetSystem = p; }));
tasks.Add(this.GetAddressFromTextSignature("CameraAngleXFreeze", "F3 0F 11 83 30 01 00 00 48 83 C4 20 5B C3", (p) => { CameraAngleXFreeze = p; }));
tasks.Add(this.GetAddressFromTextSignature("CameraAngleYFreeze", "89 83 34 01 00 00 F3 0F 10 83 40 01 00 00", (p) => { CameraAngleYFreeze = p; }));
tasks.Add(this.GetAddressFromTextSignature("GPoseCameraPositionFreeze", "F3 0F 10 5E 08 49 8B CF F3 0F 10 56 04 F3 0F 10 0E E8", (p) => { GPoseCameraPositionFreeze = p + 0x11; }));

tasks.Add(this.GetAddressFromTextSignature("TimeAsm", "48 89 87 ?? ?? ?? ?? 48 69 C0", (p) => TimeAsm = p));

Expand Down
23 changes: 1 addition & 22 deletions Anamnesis/Services/CameraService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ namespace Anamnesis;

public class CameraService : ServiceBase<CameraService>
{
private NopHookViewModel? freezeCameraAngleX;
private NopHookViewModel? freezeCameraAngleY;

private bool delimitCamera;

public CameraMemory Camera { get; set; } = new CameraMemory();
Expand All @@ -39,28 +36,10 @@ public bool DelimitCamera
}
}

public bool FreezeAngle
{
get
{
return this.Camera.FreezeAngle;
}
set
{
this.Camera.FreezeAngle = value;

this.freezeCameraAngleX?.SetEnabled(value);
this.freezeCameraAngleY?.SetEnabled(value);
}
}

public override async Task Start()
{
await base.Start();

this.freezeCameraAngleX = new NopHookViewModel(AddressService.CameraAngleXFreeze, 8);
this.freezeCameraAngleY = new NopHookViewModel(AddressService.CameraAngleYFreeze, 6);

_ = Task.Run(this.Tick);
}

Expand Down Expand Up @@ -93,7 +72,7 @@ private async Task Tick()
if (!GposeService.Instance.IsGpose)
{
this.DelimitCamera = false;
this.FreezeAngle = false;
this.Camera.FreezeAngle = false;
}
else
{
Expand Down
6 changes: 0 additions & 6 deletions Anamnesis/Services/GposeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ namespace Anamnesis.Services;
[AddINotifyPropertyChangedInterface]
public class GposeService : ServiceBase<GposeService>
{
private NopHookViewModel? freezePosition;

private bool initialized = false;

public static event GposeEvent? GposeStateChanged;
Expand All @@ -42,8 +40,6 @@ public static bool GetIsGPose()

public override Task Start()
{
this.freezePosition = new NopHookViewModel(AddressService.GPoseCameraPositionFreeze, 5);

Task.Run(this.CheckThread);
return base.Start();
}
Expand All @@ -58,14 +54,12 @@ private async Task CheckThread()
{
this.initialized = true;
this.IsGpose = newGpose;
this.freezePosition?.SetEnabled(newGpose);
continue;
}

if (newGpose != this.IsGpose)
{
this.IsGpose = newGpose;
this.freezePosition?.SetEnabled(newGpose);
GposeStateChanged?.Invoke(newGpose);
}

Expand Down
2 changes: 1 addition & 1 deletion Anamnesis/VersionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ public static class VersionInfo
/// <summary>
/// The latest game version that the tool has been validated for.
/// </summary>
public static readonly string ValidatedGameVersion = "2023.02.28.0000.0000";
public static readonly string ValidatedGameVersion = "2023.03.24.0000.0000";
}
2 changes: 1 addition & 1 deletion Anamnesis/Views/CameraEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
Width="22"
Padding="0"
Margin="0"
IsChecked="{Binding CameraService.FreezeAngle}">
IsChecked="{Binding CameraService.Camera.FreezeAngle}">

<ToggleButton.Content>
<fa:IconBlock Icon="LockOpen"
Expand Down

0 comments on commit 669d8bc

Please sign in to comment.