View Single Post
06-08-16, 10:41 AM   #4
sezz
A Chromatic Dragonspawn
AddOn Author - Click to view addons
Join Date: Apr 2008
Posts: 158
Originally Posted by elcius View Post
you can't just call GarrisonMissionButton_OnClick, if you want to hook the click handler, use button:HookScript('OnClick',function() .. end)
I don't want to hook it because Blizzard doesn't check for LeftButton and I don't want to show mission details when clicking a mission with the right mouse button.

But I did another test by adding a frame on top of the button that catches the clicks (so the mission button's OnClick handler doesn't get executed) and I still get the error, even if my OnClick handler is as simple as this (and basically does nothing, it only sets isZoneSupport, just like Blizzard does in OrderHallMission.OnClickMission):

Lua Code:
  1. local missionButton = self:GetParent();
  2. local missionFrame = missionButton:GetParent():GetParent():GetParent():GetParent():GetParent();
  3. local missionInfo = missionButton.info;
  4. missionFrame.MissionTab.isZoneSupport = missionInfo.isZoneSupport;

This is easily reproducable without any addons by clicking a mission, executing
Lua Code:
  1. /run OrderHallMissionFrame.MissionTab.isZoneSupport = OrderHallMissionFrame.MissionTab.isZoneSupport;
and pressing escape twice.