Compare commits

...

2 Commits

Author SHA1 Message Date
Anna c489b88ac9
chore: bump to 1.0.1 2022-04-17 18:20:44 -04:00
Anna 18402c9f29
fix: request titles if necessary 2022-04-17 18:19:30 -04:00
3 changed files with 18 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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>