Compare commits

...

No commits in common. "main" and "e29c0098a375316ca8e22baae7d4cec187890162" have entirely different histories.

4 changed files with 20 additions and 40 deletions

View File

@ -6,24 +6,26 @@ using System.Runtime.InteropServices;
using System.Text;
using Dalamud;
using Dalamud.Game;
using Dalamud.Game.Command;
using Dalamud.Hooking;
using Dalamud.IoC;
using Dalamud.Plugin;
using Dalamud.Plugin.Services;
using FFXIVClientStructs.FFXIV.Component.GUI;
namespace TheGreatSeparator {
// ReSharper disable once ClassNeverInstantiated.Global
public class TheGreatSeparator : IDalamudPlugin {
public string Name => "The Great Separator";
private static class Signatures {
internal const string ShowFlyText = "E8 ?? ?? ?? ?? FF C7 41 D1 C7";
internal const string SprintfNumber = "48 83 EC 28 44 8B C9";
internal const string FlyTextStringify = "45 33 C0 C6 44 24 ?? ?? 8B D3 E8 ?? ?? ?? ?? 41 8B CF E8";
internal const string HotbarManaStringify = "45 33 C0 44 88 64 24 ?? 44 88 64 24 ?? 8B 14 08 48 8B CE E8";
internal const string FlyTextStringify = "45 33 C0 C6 44 24 ?? ?? 41 8B D6 E8 ?? ?? ?? ??";
internal const string HotbarManaStringify = "45 33 C0 48 8B CE C6 44 24 ?? ?? 42 8B 14 38 E8 ?? ?? ?? ??";
internal const string PartyListStringify = "45 33 C0 C6 44 24 ?? ?? 8B D5 E8 ?? ?? ?? ?? EB";
internal const string Separator = "44 0F B6 05 ?? ?? ?? ?? 45 84 C0 74 36 F6 87";
internal const string Separator = "44 0F B6 05 ?? ?? ?? ?? 45 84 C0 74 36 F6 87 ?? ?? ?? ?? ??";
}
private static readonly byte[] ThirdArgOne = {
@ -42,13 +44,10 @@ namespace TheGreatSeparator {
internal DalamudPluginInterface Interface { get; init; } = null!;
[PluginService]
internal ICommandManager CommandManager { get; init; } = null!;
internal CommandManager CommandManager { get; init; } = null!;
[PluginService]
internal ISigScanner SigScanner { get; init; } = null!;
[PluginService]
internal IGameInteropProvider GameInteropProvider { get; init; } = null!;
internal SigScanner SigScanner { get; init; } = null!;
internal Configuration Config { get; }
internal PluginUi Ui { get; }
@ -67,12 +66,12 @@ namespace TheGreatSeparator {
this.Commands = new Commands(this);
if (this.SigScanner.TryScanText(Signatures.ShowFlyText, out var showFlyPtr)) {
this.ShowFlyTextHook = this.GameInteropProvider.HookFromAddress<ShowFlyTextDelegate>(showFlyPtr + 9, this.ShowFlyTextDetour);
this.ShowFlyTextHook = new Hook<ShowFlyTextDelegate>(showFlyPtr + 9, this.ShowFlyTextDetour);
this.ShowFlyTextHook.Enable();
}
if (this.SigScanner.TryScanText(Signatures.SprintfNumber, out var sprintfPtr)) {
this.SprintfNumberHook = this.GameInteropProvider.HookFromAddress<SprintfNumberDelegate>(sprintfPtr, this.SprintfNumberDetour);
this.SprintfNumberHook = new Hook<SprintfNumberDelegate>(sprintfPtr, this.SprintfNumberDetour);
this.SprintfNumberHook.Enable();
}

View File

@ -1,45 +1,40 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7-windows</TargetFramework>
<Version>1.2.8</Version>
<TargetFramework>net5-windows</TargetFramework>
<Version>1.2.1</Version>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
</PropertyGroup>
<PropertyGroup>
<DalamudLibPath>$(AppData)\XIVLauncher\addon\Hooks\dev</DalamudLibPath>
</PropertyGroup>
<PropertyGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">
<DalamudLibPath>$(DALAMUD_HOME)</DalamudLibPath>
<Dalamud>$(AppData)\XIVLauncher\addon\Hooks\dev</Dalamud>
</PropertyGroup>
<PropertyGroup Condition="'$(IsCI)' == 'true'">
<DalamudLibPath>$(HOME)/dalamud</DalamudLibPath>
<Dalamud>$(HOME)/dalamud</Dalamud>
</PropertyGroup>
<ItemGroup>
<Reference Include="Dalamud">
<HintPath>$(DalamudLibPath)\Dalamud.dll</HintPath>
<HintPath>$(Dalamud)\Dalamud.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="FFXIVClientStructs">
<HintPath>$(DalamudLibPath)\FFXIVClientStructs.dll</HintPath>
<HintPath>$(Dalamud)\FFXIVClientStructs.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ImGui.NET">
<HintPath>$(DalamudLibPath)\ImGui.NET.dll</HintPath>
<HintPath>$(Dalamud)\ImGui.NET.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="ImGuiScene">
<HintPath>$(DalamudLibPath)\ImGuiScene.dll</HintPath>
<HintPath>$(Dalamud)\ImGuiScene.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="DalamudPackager" Version="2.1.12" />
<PackageReference Include="DalamudPackager" Version="2.1.4"/>
</ItemGroup>
</Project>

View File

@ -1,5 +1,5 @@
name: The Great Separator
author: Anna
author: ascclemens
punchline: Add separators to various numbers.
description: |-
Add separators to various numbers.
@ -8,4 +8,3 @@ description: |-
- Party list HP
- Ability costs on hotbars
- Ability costs in tooltips
repo_url: https://git.anna.lgbt/anna/TheGreatSeparator

View File

@ -1,13 +0,0 @@
{
"version": 1,
"dependencies": {
"net7.0-windows7.0": {
"DalamudPackager": {
"type": "Direct",
"requested": "[2.1.12, )",
"resolved": "2.1.12",
"contentHash": "Sc0PVxvgg4NQjcI8n10/VfUQBAS4O+Fw2pZrAqBdRMbthYGeogzu5+xmIGCGmsEZ/ukMOBuAqiNiB5qA3MRalg=="
}
}
}
}