mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-21 23:37:44 +01:00
Switch to CS in UnlockState
Some checks are pending
Some checks are pending
This commit is contained in:
parent
4651397808
commit
1779d2681a
1 changed files with 6 additions and 13 deletions
|
|
@ -33,9 +33,6 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
||||||
{
|
{
|
||||||
private static readonly ModuleLog Log = new(nameof(UnlockState));
|
private static readonly ModuleLog Log = new(nameof(UnlockState));
|
||||||
|
|
||||||
[ServiceManager.ServiceDependency]
|
|
||||||
private readonly TargetSigScanner sigScanner = Service<TargetSigScanner>.Get();
|
|
||||||
|
|
||||||
[ServiceManager.ServiceDependency]
|
[ServiceManager.ServiceDependency]
|
||||||
private readonly DataManager dataManager = Service<DataManager>.Get();
|
private readonly DataManager dataManager = Service<DataManager>.Get();
|
||||||
|
|
||||||
|
|
@ -49,8 +46,8 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
||||||
private readonly RecipeData recipeData = Service<RecipeData>.Get();
|
private readonly RecipeData recipeData = Service<RecipeData>.Get();
|
||||||
|
|
||||||
private readonly ConcurrentDictionary<Type, HashSet<uint>> cachedUnlockedRowIds = [];
|
private readonly ConcurrentDictionary<Type, HashSet<uint>> cachedUnlockedRowIds = [];
|
||||||
private readonly Hook<SetAchievementCompletedDelegate> setAchievementCompletedHook;
|
private readonly Hook<CSAchievement.Delegates.SetAchievementCompleted> setAchievementCompletedHook;
|
||||||
private readonly Hook<SetTitleUnlockedDelegate> setTitleUnlockedHook;
|
private readonly Hook<TitleList.Delegates.SetTitleUnlocked> setTitleUnlockedHook;
|
||||||
|
|
||||||
[ServiceManager.ServiceConstructor]
|
[ServiceManager.ServiceConstructor]
|
||||||
private UnlockState()
|
private UnlockState()
|
||||||
|
|
@ -59,22 +56,18 @@ internal unsafe class UnlockState : IInternalDisposableService, IUnlockState
|
||||||
this.clientState.Logout += this.OnLogout;
|
this.clientState.Logout += this.OnLogout;
|
||||||
this.gameGui.AgentUpdate += this.OnAgentUpdate;
|
this.gameGui.AgentUpdate += this.OnAgentUpdate;
|
||||||
|
|
||||||
this.setAchievementCompletedHook = Hook<SetAchievementCompletedDelegate>.FromAddress(
|
this.setAchievementCompletedHook = Hook<CSAchievement.Delegates.SetAchievementCompleted>.FromAddress(
|
||||||
this.sigScanner.ScanText("81 FA ?? ?? ?? ?? 0F 87 ?? ?? ?? ?? 53"),
|
(nint)CSAchievement.MemberFunctionPointers.SetAchievementCompleted,
|
||||||
this.SetAchievementCompletedDetour);
|
this.SetAchievementCompletedDetour);
|
||||||
|
|
||||||
this.setTitleUnlockedHook = Hook<SetTitleUnlockedDelegate>.FromAddress(
|
this.setTitleUnlockedHook = Hook<TitleList.Delegates.SetTitleUnlocked>.FromAddress(
|
||||||
this.sigScanner.ScanText("B8 ?? ?? ?? ?? 66 3B D0 73 ?? 44 0F B7 C2 49 C1 E8 ?? 4C 03 C1 0F B7 C2 83 E0 ?? 41 0F B6 48 ?? 0F AB C1"),
|
(nint)TitleList.MemberFunctionPointers.SetTitleUnlocked,
|
||||||
this.SetTitleUnlockedDetour);
|
this.SetTitleUnlockedDetour);
|
||||||
|
|
||||||
this.setAchievementCompletedHook.Enable();
|
this.setAchievementCompletedHook.Enable();
|
||||||
this.setTitleUnlockedHook.Enable();
|
this.setTitleUnlockedHook.Enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
private delegate void SetAchievementCompletedDelegate(CSAchievement* thisPtr, uint id);
|
|
||||||
|
|
||||||
private delegate void SetTitleUnlockedDelegate(TitleList* thisPtr, ushort id);
|
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public event IUnlockState.UnlockDelegate Unlock;
|
public event IUnlockState.UnlockDelegate Unlock;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue