Compare commits
2 Commits
89a4a39ea1
...
c489b88ac9
Author | SHA1 | Date |
---|---|---|
Anna | c489b88ac9 | |
Anna | 18402c9f29 |
|
@ -12,6 +12,9 @@ internal unsafe class GameFunctions {
|
|||
[Signature("E8 ?? ?? ?? ?? 83 7B 44 02")]
|
||||
private readonly delegate* unmanaged<AgentInterface*, uint*, byte> _setTitle;
|
||||
|
||||
[Signature("E8 ?? ?? ?? ?? 89 6E 58")]
|
||||
private readonly delegate* unmanaged<IntPtr, void> _requestTitles;
|
||||
|
||||
[Signature("48 8D 0D ?? ?? ?? ?? BD ?? ?? ?? ?? E8 ?? ?? ?? ?? 84 C0 75", ScanType = ScanType.StaticAddress)]
|
||||
private readonly IntPtr _titleList;
|
||||
|
||||
|
@ -19,6 +22,14 @@ internal unsafe class GameFunctions {
|
|||
SignatureHelper.Initialise(this);
|
||||
}
|
||||
|
||||
internal void RequestTitles() {
|
||||
if (*(byte*) (this._titleList + 0x61) == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._requestTitles(this._titleList);
|
||||
}
|
||||
|
||||
internal bool IsTitleUnlocked(uint titleId) {
|
||||
if (titleId > ushort.MaxValue) {
|
||||
return false;
|
||||
|
@ -32,7 +43,7 @@ internal unsafe class GameFunctions {
|
|||
if (agent == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return this._setTitle(agent, &titleId) != 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -47,6 +47,10 @@ internal class PluginUi : IDisposable {
|
|||
return;
|
||||
}
|
||||
|
||||
if (ImGui.IsWindowAppearing()) {
|
||||
this.Plugin.Functions.RequestTitles();
|
||||
}
|
||||
|
||||
var anyChanged = false;
|
||||
|
||||
anyChanged |= ImGui.Checkbox("Only show unlocked titles", ref this.Plugin.Config.OnlyUnlocked);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<Version>1.0.1</Version>
|
||||
<TargetFramework>net5-windows</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
@ -46,7 +47,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="DalamudPackager" Version="2.1.7" />
|
||||
<PackageReference Include="DalamudPackager" Version="2.1.7"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
Loading…
Reference in New Issue