public void Init(DalamudPluginInterface pluginInterface)
 {
     _address.Setup(pluginInterface.TargetModuleScanner);
     _placeholderResolver = Marshal.GetDelegateForFunctionPointer <ResolvePlaceholderActor>(_address.ResolvePlaceholderText);
     _magicStructInfo     = pluginInterface.TargetModuleScanner.GetStaticAddressFromSig("48 8B 0D ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 85 C9 74 0C");
     SetupPlaceholderResolver();
 }
예제 #2
0
        public MOAction(SigScanner scanner, ClientState clientState, MOActionConfiguration configuration, ref DalamudPluginInterface plugin, IEnumerable <Lumina.Excel.GeneratedSheets.Action> rawActions)
        {
            fieldMOLocation     = scanner.GetStaticAddressFromSig("E8 ?? ?? ?? ?? 83 BF ?? ?? ?? ?? ?? 0F 84 ?? ?? ?? ?? 48 8D 4C 24 ??", 0x283);
            focusTargLocation   = scanner.GetStaticAddressFromSig("48 8B 0D ?? ?? ?? ?? 48 89 5C 24 ?? BB ?? ?? ?? ?? 48 89 7C 24 ??", 0);
            regularTargLocation = scanner.GetStaticAddressFromSig("F3 0F 11 05 ?? ?? ?? ?? EB 27", 0) + 0x4;
            MagicStructInfo     = scanner.GetStaticAddressFromSig("48 8B 0D ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 85 C9 74 0C", 0);


            Configuration = configuration;

            Address = new MOActionAddressResolver();
            Address.Setup(scanner);

            pluginInterface = plugin;
            RawActions      = rawActions;

            Stacks = new Dictionary <uint, List <StackEntry> >();

            PluginLog.Log("===== M O A C T I O N =====");
            PluginLog.Log("RequestAction address {IsIconReplaceable}", Address.RequestAction);
            PluginLog.Log("SetUiMouseoverEntityId address {SetUiMouseoverEntityId}", Address.SetUiMouseoverEntityId);

            requestActionHook   = new Hook <OnRequestActionDetour>(Address.RequestAction, new OnRequestActionDetour(HandleRequestAction), this);
            uiMoEntityIdHook    = new Hook <OnSetUiMouseoverEntityId>(Address.SetUiMouseoverEntityId, new OnSetUiMouseoverEntityId(HandleUiMoEntityId), this);
            PlaceholderResolver = Marshal.GetDelegateForFunctionPointer <ResolvePlaceholderActor>(Address.ResolvePlaceholderText);
            MagicUiObject       = IntPtr.Zero;

            enabledActions     = new HashSet <ulong>();
            UnorthodoxFriendly = new HashSet <uint>();
            UnorthodoxHostile  = new HashSet <uint>();
            UnorthodoxHostile.Add(3575);
            UnorthodoxFriendly.Add(17055);
            UnorthodoxFriendly.Add(7443);
        }