mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-18 13:57:43 +01:00
Add call-on-services-ready attribute for service methods, and fix scene nullability (#900)
This commit is contained in:
parent
5809accf5d
commit
3369f569fb
52 changed files with 274 additions and 273 deletions
|
|
@ -9,7 +9,7 @@ namespace Dalamud.Game.Internal
|
|||
/// This class disables anti-debug functionality in the game client.
|
||||
/// </summary>
|
||||
[ServiceManager.EarlyLoadedService]
|
||||
internal sealed partial class AntiDebug
|
||||
internal sealed partial class AntiDebug : IServiceType
|
||||
{
|
||||
private readonly byte[] nop = new byte[] { 0x31, 0xC0, 0x90, 0x90, 0x90, 0x90 };
|
||||
private byte[] original;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Dalamud.Game.Internal
|
|||
/// This class implements in-game Dalamud options in the in-game System menu.
|
||||
/// </summary>
|
||||
[ServiceManager.EarlyLoadedService]
|
||||
internal sealed unsafe partial class DalamudAtkTweaks
|
||||
internal sealed unsafe partial class DalamudAtkTweaks : IServiceType
|
||||
{
|
||||
private readonly AtkValueChangeType atkValueChangeType;
|
||||
private readonly AtkValueSetString atkValueSetString;
|
||||
|
|
@ -39,7 +39,7 @@ namespace Dalamud.Game.Internal
|
|||
private readonly string locDalamudSettings;
|
||||
|
||||
[ServiceManager.ServiceConstructor]
|
||||
private DalamudAtkTweaks(SigScanner sigScanner)
|
||||
private DalamudAtkTweaks(SigScanner sigScanner, ContextMenu contextMenu)
|
||||
{
|
||||
var openSystemMenuAddress = sigScanner.ScanText("E8 ?? ?? ?? ?? 32 C0 4C 8B AC 24 ?? ?? ?? ?? 48 8B 8D ?? ?? ?? ??");
|
||||
|
||||
|
|
@ -60,10 +60,7 @@ namespace Dalamud.Game.Internal
|
|||
this.locDalamudPlugins = Loc.Localize("SystemMenuPlugins", "Dalamud Plugins");
|
||||
this.locDalamudSettings = Loc.Localize("SystemMenuSettings", "Dalamud Settings");
|
||||
|
||||
var contextMenu = Service<ContextMenu>.Get();
|
||||
contextMenu.ContextMenuOpened += this.ContextMenuOnContextMenuOpened;
|
||||
|
||||
this.Enable();
|
||||
}
|
||||
|
||||
private delegate void AgentHudOpenSystemMenuPrototype(void* thisPtr, AtkValue* atkValueArgs, uint menuSize);
|
||||
|
|
@ -76,10 +73,8 @@ namespace Dalamud.Game.Internal
|
|||
|
||||
private delegate IntPtr AtkUnitBaseReceiveGlobalEvent(AtkUnitBase* thisPtr, ushort cmd, uint a3, IntPtr a4, uint* a5);
|
||||
|
||||
/// <summary>
|
||||
/// Enables the <see cref="DalamudAtkTweaks"/>.
|
||||
/// </summary>
|
||||
public void Enable()
|
||||
[ServiceManager.CallWhenServicesReady]
|
||||
private void ContinueConstruction(DalamudInterface dalamudInterface)
|
||||
{
|
||||
this.hookAgentHudOpenSystemMenu.Enable();
|
||||
this.hookUiModuleRequestMainCommand.Enable();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue