public unsafe void Initialize(DalamudPluginInterface pluginInterface) { setNamePlatePtr = pluginInterface.TargetModuleScanner.ScanText("48 89 5C 24 ?? 48 89 6C 24 ?? 56 57 41 54 41 56 41 57 48 83 EC 40 44 0F B6 E2"); setNamePlate = new SetNamePlate(setNamePlateFunc); try { setNamePlateHook = new Hook <SetNamePlate>(setNamePlatePtr, setNamePlate, this); setNamePlateHook.Enable(); } catch (Exception e) { PluginLog.Log("BAD 1\n" + e.ToString()); } scaleIconPtr = pluginInterface.TargetModuleScanner.ScanText("8B 81 ?? ?? ?? ?? A8 01 75 ?? F3 0F 10 41 ?? 0F 2E C1 7A ?? 75 ?? F3 0F 10 41 ?? 0F 2E C2 7A ?? 74 ?? 83 C8 01 89 81 ?? ?? ?? ?? F3 0F 10 05 ?? ?? ?? ??"); scaleIcon = Marshal.GetDelegateForFunctionPointer <scaleIconFunc>(scaleIconPtr); var GetBaseUIObject = pluginInterface.TargetModuleScanner.ScanText("E8 ?? ?? ?? ?? 41 b8 01 00 00 00 48 8d 15 ?? ?? ?? ?? 48 8b 48 20 e8 ?? ?? ?? ?? 48 8b cf"); var GetUI2ObjByName = pluginInterface.TargetModuleScanner.ScanText("e8 ?? ?? ?? ?? 48 8b cf 48 89 87 ?? ?? 00 00 e8 ?? ?? ?? ?? 41 b8 01 00 00 00"); getBaseUIObj = Marshal.GetDelegateForFunctionPointer <GetBaseUIObjDelegate>(GetBaseUIObject); getUI2ObjByName = Marshal.GetDelegateForFunctionPointer <GetUI2ObjByNameDelegate>(GetUI2ObjByName); this.pluginInterface = pluginInterface; Configuration = pluginInterface.GetPluginConfig() as Config ?? new Config(); role = Configuration.Role; enabled = Configuration.Enabled; scaler = Configuration.Scale; xAdjust = Configuration.XAdjust; yAdjust = Configuration.YAdjust; this.pluginInterface.CommandManager.AddHandler("/jicons", new CommandInfo(Command) { HelpMessage = "Opens Job Icons config." }); baseUIObject = getBaseUIObj(); baseUiProperties = Marshal.ReadIntPtr(baseUIObject, 0x20); UIModulePtr = Marshal.ReadIntPtr(pluginInterface.Framework.Address.BaseAddress, 0x29F8); UI3DModule = Marshal.ReadIntPtr(UIModulePtr, 0xA62C0); RaptureAtkModule = (RaptureAtkModule *)(Marshal.ReadIntPtr(pluginInterface.Framework.Address.BaseAddress, 0x29F8) + 0xB3780).ToPointer(); nameplateUIPtr = getUI2ObjByName(baseUiProperties, "NamePlate", 1); if (nameplateUIPtr != IntPtr.Zero) { npObjArray = ((AddonNamePlate *)nameplateUIPtr)->NamePlateObjectArray; } this.pluginInterface.UiBuilder.OnOpenConfigUi += ConfigWindow; this.pluginInterface.UiBuilder.OnBuildUi += DrawWindow; }
private void *MoveAddonDetour(RaptureAtkModule *atkModule, AtkUnitBase *addon, void *idk) { var name = Marshal.PtrToStringUTF8(new IntPtr(addon->Name)); return(Config.LockedWindows.Contains(name) ? null : moveAddonHook.Original(atkModule, addon, idk)); }