WoWInterface - View Single Post - Hook mixin or override template
View Single Post
08-09-18, 04:15 AM   #1
A Cyclonian
Join Date: Feb 2012
Posts: 49
Hook mixin or override template


I'm trying to do something... I think simple, which is to add a new option to the DropDownMenu that appears on the world map.

That button uses the Template "WorldMapTrackingOptionsButtonTemplate", which uses the mixin "WorldMapTrackingOptionsButtonMixin".
This mixin has the method:
where they initialize the dropDownMenu, and the method:
function WorldMapTrackingOptionsButtonMixin:OnSelection(value, checked)
where they do whatever they have to do after toggling the options.

I was trying to do...
hooksecurefunc(WorldMapTrackingOptionsButtonMixin, "InitializeDropDown", function(self) here_add_my_new_option end)
but this doesn't work, because this method is invoked on the event "WorldMapTrackingOptionsButtonMixin:OnLoad()", which, if I'm not wrong, is invoked before my addon is even loaded (right?).

I know that with the last Map API I can add a new overlay to the map and insert my own button, but having this one I didn't want to overload the map with more stuff.

Ideas of how to achieve this?

  Reply With Quote