View Single Post
11-21-20, 03:57 AM   #3
Draugor
A Murloc Raider
Join Date: Nov 2020
Posts: 5
thanks for the fast reply

i tried this, but
Lua Code:
  1. hooksecurefunc("MountOptionsMenu_Init", function(self, level)
  2.     print("are we hooked yet?", self, level)
  3.     local info = UIDropDownMenu_CreateInfo();
  4.     info.text = "Extra Option"
  5.     info.func = function()
  6.         print("clicked")
  7.     end
  8.     UIDropDownMenu_AddButton(info, level)
  9. end)

that doesn't seem to get called, and i believe the problem here is that this function only gets called in the Loading-Phase of Blizzard_Collections so if i hook into it after it's loaded my hook never gets called, but also hooking before Blizzard_Collections is loaded doesn't work because then it isn't defined yet ... i think any ideas ? maybe i need to call it again after i hooked into it ...

aaaaand that worked just tested it with this line just below the hook call:
Lua Code:
  1. UIDropDownMenu_Initialize(MountJournal.mountOptionsMenu, MountOptionsMenu_Init, "MENU");

big thanks for your help !



edit: after some more testing and writing i came across an other problem,
using either
Lua Code:
  1. hooksecurefunc(C_MountJournal, "SummonByID", function(mountID)
  2.      print("hooked on a feeling ...", mountID)
  3. end)
or
Lua Code:
  1. local orgMountUP = C_MountJournal.SummonByID;
  2. C_MountJournal.SummonByID = function(...)
  3.     print("Mount Up !")
  4.     orgMountUP(...);
  5. end

only works if i click the Button in the MountJournal-Panel, but not if i track it in my hotbars and click it there :/
also regardless if hooksecurefunc(...) works it is probably not what i want in this case, because i want to replace some functionality of SummonByID(0) and not just do stuff afterwards, which means i need to replace the call (at least when its called with 0 )

Last edited by Draugor : 11-21-20 at 07:57 AM.
  Reply With Quote