public GameGui(IntPtr baseAddress, SigScanner scanner, Dalamud dalamud) { this.dalamud = dalamud; Address = new GameGuiAddressResolver(baseAddress); Address.Setup(scanner); Log.Verbose("===== G A M E G U I ====="); Log.Verbose("GameGuiManager address {Address}", Address.BaseAddress); Log.Verbose("SetGlobalBgm address {Address}", Address.SetGlobalBgm); Log.Verbose("HandleItemHover address {Address}", Address.HandleItemHover); Log.Verbose("HandleItemOut address {Address}", Address.HandleItemOut); Log.Verbose("GetUIObject address {Address}", Address.GetUIObject); Log.Verbose("GetAgentModule address {Address}", Address.GetAgentModule); Chat = new ChatGui(Address.ChatManager, scanner, dalamud); PartyFinder = new PartyFinderGui(scanner, dalamud); Toast = new ToastGui(scanner, dalamud); this.setGlobalBgmHook = new Hook <SetGlobalBgmDelegate>(Address.SetGlobalBgm, new SetGlobalBgmDelegate(HandleSetGlobalBgmDetour), this); this.handleItemHoverHook = new Hook <HandleItemHoverDelegate>(Address.HandleItemHover, new HandleItemHoverDelegate(HandleItemHoverDetour), this); this.handleItemOutHook = new Hook <HandleItemOutDelegate>(Address.HandleItemOut, new HandleItemOutDelegate(HandleItemOutDetour), this); this.handleActionHoverHook = new Hook <HandleActionHoverDelegate>(Address.HandleActionHover, new HandleActionHoverDelegate(HandleActionHoverDetour), this); this.handleActionOutHook = new Hook <HandleActionOutDelegate>(Address.HandleActionOut, new HandleActionOutDelegate(HandleActionOutDetour), this); this.getUIObject = Marshal.GetDelegateForFunctionPointer <GetUIObjectDelegate>(Address.GetUIObject); this.getMatrixSingleton = Marshal.GetDelegateForFunctionPointer <GetMatrixSingletonDelegate>(Address.GetMatrixSingleton); this.screenToWorldNative = Marshal.GetDelegateForFunctionPointer <ScreenToWorldNativeDelegate>(Address.ScreenToWorld); this.toggleUiHideHook = new Hook <ToggleUiHideDelegate>(Address.ToggleUiHide, new ToggleUiHideDelegate(ToggleUiHideDetour), this); this.GetBaseUIObject = Marshal.GetDelegateForFunctionPointer <GetBaseUIObjectDelegate>(Address.GetBaseUIObject); this.getUIObjectByName = Marshal.GetDelegateForFunctionPointer <GetUIObjectByNameDelegate>(Address.GetUIObjectByName); this.getUiModule = Marshal.GetDelegateForFunctionPointer <GetUiModuleDelegate>(Address.GetUIModule); this.getAgentModule = Marshal.GetDelegateForFunctionPointer <GetAgentModuleDelegate>(Address.GetAgentModule); }
/// <summary> /// Initializes a new instance of the <see cref="GameGui"/> class. /// This class is responsible for many aspects of interacting with the native game UI. /// </summary> /// <param name="baseAddress">The base address of the native GuiManager class.</param> /// <param name="scanner">The SigScanner instance.</param> /// <param name="dalamud">The Dalamud instance.</param> internal GameGui(IntPtr baseAddress, SigScanner scanner, Dalamud dalamud) { this.dalamud = dalamud; this.address = new GameGuiAddressResolver(baseAddress); this.address.Setup(scanner); Log.Verbose("===== G A M E G U I ====="); Log.Verbose($"GameGuiManager address 0x{this.address.BaseAddress.ToInt64():X}"); Log.Verbose($"SetGlobalBgm address 0x{this.address.SetGlobalBgm.ToInt64():X}"); Log.Verbose($"HandleItemHover address 0x{this.address.HandleItemHover.ToInt64():X}"); Log.Verbose($"HandleItemOut address 0x{this.address.HandleItemOut.ToInt64():X}"); Log.Verbose($"HandleImm address 0x{this.address.HandleImm.ToInt64():X}"); Log.Verbose($"GetUIObject address 0x{this.address.GetUIObject.ToInt64():X}"); Log.Verbose($"GetAgentModule address 0x{this.address.GetAgentModule.ToInt64():X}"); this.Chat = new ChatGui(this.address.ChatManager, scanner, dalamud); this.PartyFinder = new PartyFinderGui(scanner, dalamud); this.Toast = new ToastGui(scanner, dalamud); this.FlyText = new FlyTextGui(scanner, dalamud); this.setGlobalBgmHook = new Hook <SetGlobalBgmDelegate>(this.address.SetGlobalBgm, this.HandleSetGlobalBgmDetour); this.handleItemHoverHook = new Hook <HandleItemHoverDelegate>(this.address.HandleItemHover, this.HandleItemHoverDetour); this.handleItemOutHook = new Hook <HandleItemOutDelegate>(this.address.HandleItemOut, this.HandleItemOutDetour); this.handleActionHoverHook = new Hook <HandleActionHoverDelegate>(this.address.HandleActionHover, this.HandleActionHoverDetour); this.handleActionOutHook = new Hook <HandleActionOutDelegate>(this.address.HandleActionOut, this.HandleActionOutDetour); this.handleImmHook = new Hook <HandleImmDelegate>(this.address.HandleImm, this.HandleImmDetour); this.getUIObject = Marshal.GetDelegateForFunctionPointer <GetUIObjectDelegate>(this.address.GetUIObject); this.getMatrixSingleton = Marshal.GetDelegateForFunctionPointer <GetMatrixSingletonDelegate>(this.address.GetMatrixSingleton); this.screenToWorldNative = Marshal.GetDelegateForFunctionPointer <ScreenToWorldNativeDelegate>(this.address.ScreenToWorld); this.toggleUiHideHook = new Hook <ToggleUiHideDelegate>(this.address.ToggleUiHide, this.ToggleUiHideDetour); this.GetBaseUIObject = Marshal.GetDelegateForFunctionPointer <GetBaseUIObjectDelegate>(this.address.GetBaseUIObject); this.getUIObjectByName = Marshal.GetDelegateForFunctionPointer <GetUIObjectByNameDelegate>(this.address.GetUIObjectByName); this.getUiModule = Marshal.GetDelegateForFunctionPointer <GetUiModuleDelegate>(this.address.GetUIModule); this.getAgentModule = Marshal.GetDelegateForFunctionPointer <GetAgentModuleDelegate>(this.address.GetAgentModule); }