Quantcast
Unable to click quest button - WoWInterface
Thread Tools Display Modes
12-04-14, 02:03 PM   #1
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 114
Unable to click quest button

I found it unable to use the quest button on objectivetrackframe,
And I have no idea about how this happened.
Could be due to the bag addons?
Anyone here would show me a clue?
  Reply With Quote
12-04-14, 03:28 PM   #2
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,463
Do you have an addon that does anything to the objective frame even as simple as moving it ?

I've noticed that the moment the main frame is re-parented in an addon the quest button becomes unsecure and kicks off a fuss with an error or just refuse to work. Could be coincidental.
__________________
  Reply With Quote
12-04-14, 08:12 PM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
There are also tons of other ways you can taint the objective tracker that don't even require touching the objective tracker itself. Personally I just gave up trying to get working quest item buttons on the objective tracker, and am using p3lim's ExtraQuestButton addon to (basically) put quest items on the extra action button; it doesn't let you pick which item to use, but automatically selects the item based on your current location, and so far I've never needed to use a different item. Another option would be to use the quest item ring in OPie, or another addon that creates a separate menu/bar for quest items.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
12-04-14, 10:00 PM   #4
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 114
Originally Posted by Xrystal View Post
Do you have an addon that does anything to the objective frame even as simple as moving it ?

I've noticed that the moment the main frame is re-parented in an addon the quest button becomes unsecure and kicks off a fuss with an error or just refuse to work. Could be coincidental.
Code:
local wf = ObjectiveTrackerFrame
wf:SetClampedToScreen(true)
wf:SetMovable(true)
wf:SetUserPlaced(true)
wf:ClearAllPoints()
wf.ClearAllPoints = function() end
wf:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -100, -250)
wf.SetPoint = function() end
wf:SetHeight(450)
local function Moveit(f)
	f:EnableMouse(true)
	f:RegisterForDrag("LeftButton")
	f:SetHitRectInsets(-15, -15, -5, -5)
	f:SetScript("OnDragStart", function(s)
		wf:StartMoving()
	end)
	f:SetScript("OnDragStop", function(s)
		wf:StopMovingOrSizing()
	end)
end
Moveit(ObjectiveTrackerBlocksFrame.QuestHeader)
Moveit(ObjectiveTrackerBlocksFrame.ScenarioHeader)
Moveit(ObjectiveTrackerBlocksFrame.AchievementHeader)
These are the codes I use for move the frame.
  Reply With Quote
12-04-14, 10:03 PM   #5
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 114
Originally Posted by Phanx View Post
There are also tons of other ways you can taint the objective tracker that don't even require touching the objective tracker itself. Personally I just gave up trying to get working quest item buttons on..
I used the ExtraQuestButton as well, which helps a lot.
  Reply With Quote
12-04-14, 11:20 PM   #6
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Originally Posted by siweia View Post
Code:
wf.ClearAllPoints = function() end
wf.SetPoint = function() end
Both of those lines will break any secure frame if applied to the frame itself or any of its ancestors.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
12-06-14, 07:11 PM   #7
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 114
Originally Posted by Phanx View Post
Both of those lines will break any secure frame if applied to the frame itself or any of its ancestors.
Thanks! I will delete those lines.
  Reply With Quote
12-13-14, 10:34 PM   #8
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 114
Originally Posted by Phanx View Post
Both of those lines will break any secure frame if applied to the frame itself or any of its ancestors.
Unfortunately, the problem is still there. Would you mind to look at my other codes that relate to objectiveframe? Sorry for bothering.

Code:
-- Autocollapse the watchframe when in Dungeons
local wfclps = CreateFrame("Frame")
wfclps:RegisterEvent("ZONE_CHANGED_NEW_AREA")
wfclps:RegisterEvent("PLAYER_ENTERING_WORLD")
wfclps:SetScript("OnEvent", function()
	if IsInInstance() and not ScenarioBlocksFrame:IsVisible() then
		ObjectiveTrackerFrame.collapsed = true
		ObjectiveTracker_Collapse()
	else
		ObjectiveTrackerFrame.collapsed = nil
		ObjectiveTracker_Expand()
	end
end)

-- Questblock click enhant
hooksecurefunc(QUEST_TRACKER_MODULE, "OnBlockHeaderClick", function(self)
	if(IsControlKeyDown()) then
		AbandonQuest()
	elseif(IsAltKeyDown() and GetQuestLogPushable()) then
		QuestLogPushQuest()
	end
end)

-- Show quest color and level
local function Showlevel()
	if ENABLE_COLORBLIND_MODE == "1" then return end
	local numEntries = GetNumQuestLogEntries()
	local titleIndex = 1
	for i = 1, numEntries do
		local title, level, _, isHeader, _, isComplete, frequency, questID = GetQuestLogTitle(i)
		local titleButton = QuestLogQuests_GetTitleButton(titleIndex)
		if title and (not isHeader) and titleButton.questID == questID then
			titleButton.Check:SetPoint("LEFT", titleButton.Text, titleButton.Text:GetWrappedWidth() + 2, 0)
			titleIndex = titleIndex + 1
			local text = "["..level.."] "..title
			if isComplete then
				text = "|cffff78ff"..text
			elseif frequency == 2 then
				text = "|cff3399ff"..text
			end
			titleButton.Text:SetText(text)
		end
	end
end
hooksecurefunc("QuestLogQuests_Update", Showlevel)
  Reply With Quote
12-14-14, 04:26 AM   #9
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
Any time you replace a key/value on a secure frame, you're liable to break it, so these lines are potentially problems:
Code:
		ObjectiveTrackerFrame.collapsed = true
		ObjectiveTrackerFrame.collapsed = nil
They may seem innocuous, but since reading/writing them may happen in a code path that can't handle taint, they may in fact break the buttons.

There are also other ways to taint the objective frame, apparently involving the world map (probably because the world map shows quest stuff now) but I haven't looked into it in great detail. For example, right now I'm not using any addons which touch the objective frame at all, and the buttons still don't work, with a random "action blocked" error if I try to click on them. I'm still using ExtraQuestButton, which I linked before, and have enabled the quest item ring in OPie for the occasional case where ExtraQuestButton picked the "wrong" item (eg. when the relevant areas for two items overlap).

At some point I plan to write a full replacement for the objectives tracker, since as far as I'm concerned the current objectives tracker is an unsalvagable disaster, but I have no ETA, and it likely won't support item buttons at all.

It's also worth pointing out that Blizzard could solve the problem very easily, by making the UseQuestLogSpecialItem only require a hardware event (eg. a click). I understand they don't want addons automatically using the items for you to complete quests, but I really don't see any serious potential for abuse if it just requires a click/keypress. It's a quest, not raid progression or tournament PvP.
__________________
Author/maintainer of Grid, PhanxChat, oUF_Phanx, and many more.
Troubleshoot an addonTurn any code into an addonMore addon resources
Need help with your code? Post all of your actual code! Attach or paste your files.
Please don’t PM me about addon bugs or code questions. Post a comment or forum thread instead!
  Reply With Quote
12-14-14, 09:13 AM   #10
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,463
I was contemplating the same thing Phanx for my scrolling watch frame update but looks to be a bit of a task despite them making it more modular and template based. I am hoping that creating a secure action button will help things a bit.

However, this is assuming
local link, item, charges, showItemWhenComplete = GetQuestLogSpecialItemInfo(questLogIndex);
has the link include the itemID of the button so it can be used in a secure way.

For now I did a simpler update and suggest users use another addon for the quest item button.
__________________
  Reply With Quote
12-14-14, 09:46 AM   #11
Rilgamon
Premium Member
 
Rilgamon's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Sep 2009
Posts: 768
Originally Posted by Xrystal View Post
I am hoping that creating a secure action button will help things a bit.
And hiding the questframe in combat would break it I'd guess
__________________
The cataclysm broke the world ... and the pandas could not fix it!
  Reply With Quote
12-14-14, 11:19 AM   #12
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,463
Originally Posted by Rilgamon View Post
And hiding the questframe in combat would break it I'd guess
Well, seeing as some of the quest items are supposed to be used while in combat, theoretically it shouldn't be hidden.
__________________
  Reply With Quote
12-14-14, 12:16 PM   #13
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,289
Don't get the hassle about this, i can freely move/scale/parent/show/hide/setwidth/setheight the frame even in combat, without getting any taints. The key object here is the SetUserPlaced(true)

Lua Code:
  1. local moving
  2. hooksecurefunc(ObjectiveTrackerFrame, "SetPoint", function(self)
  3.     if moving then
  4.         return
  5.     end
  6.     moving = true
  7.     self:SetMovable(true)
  8.     self:SetUserPlaced(true)
  9.     self:ClearAllPoints()
  10.     self:SetPoint("CENTER", UIParent, "CENTER", 0, 0)
  11.     self:SetScale(1.1)
  12.     self:SetWidth(300)
  13.     self:SetHeight(400)
  14.     self:SetParent(TargetFrame) -- Only for default Blizzard unitframes.
  15.     self:SetMovable(false)
  16.     moving = nil
  17. end)

Of course i did'nt tested with all of the quest items, but i guess if one is working properly then all should.

Two things could cause this taint issues, if you have an addon which abuses this frame badly, or if you have ANY ADDON which calls ObjectiveTracker_Update() at any point. If you call ObjectiveTracker_Update() at any point by an addon then you are fucked.

Last edited by Resike : 12-14-14 at 12:30 PM.
  Reply With Quote
12-14-14, 12:21 PM   #14
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,463
Hmm thanks Resike. That may very well be what has caused things to go wrong on my rewrite. On the old version I am sure I used the setuserplaced function but don't seem to have done that this time.

Will see if that little change resolves the problem at my end.

Although I haven't done the securehooking this time either so maybe the two combined is the problem.
__________________
  Reply With Quote
12-14-14, 12:33 PM   #15
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,289
The real issue if this taint is 90% of the authors just renamed the old WatchFrame_Update() to ObjectiveTracker_Update() so there is a pretty damn good chance you have at least one addon which calls this and taints it.
  Reply With Quote
12-14-14, 02:28 PM   #16
Xrystal
nUI Maintainer
 
Xrystal's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 5,463
Well, rigged up a mini addon, to create a scrolling frame to hold the tracker frame in and all seems fine except ...

Lua Code:
  1. local addonName,addonData = ...
  2.  
  3. local myScrollFrame
  4.  
  5. addonData.Options = {
  6.     FrameWidth = 500,
  7.     FrameHeight = 150,
  8.     IsMovable = true,
  9.     HasBorder = true,
  10. }
  11.  
  12. addonData.SetMovable = function(self,frame)
  13.     if not frame then return end
  14.     frame:EnableMouse(true)
  15.     frame:SetMovable(true)
  16.     frame:RegisterForDrag("LeftButton")
  17.     frame:SetScript("OnDragStart",function(self)
  18.         self:StartMoving()
  19.     end)
  20.  
  21.     frame:SetScript("OnDragStop",function(self)
  22.         self:StopMovingOrSizing()
  23.         self:SetUserPlaced(true)
  24.         self:SetClampedToScreen(true)
  25.     end)
  26.  
  27.     frame:SetScript("OnHide",function(self)
  28.         self:StopMovingOrSizing()
  29.         self:SetUserPlaced(true)
  30.         self:SetClampedToScreen(true)
  31.     end)
  32. end
  33.  
  34. addonData.AddBorder = function(self,frame)
  35.     local border = CreateFrame("Frame",_G[frame:GetName().."Border"],frame)
  36.     border:SetFrameLevel(frame:GetFrameLevel()-1)
  37.     border:SetFrameStrata(frame:GetFrameStrata())
  38.     border:ClearAllPoints()
  39.     border:SetPoint("TOPLEFT",-10,10)
  40.     border:SetPoint("BOTTOMRIGHT",35,-10)
  41.  
  42.     local backDrop = {      
  43.         bgFile = "Interface/Tooltips/UI-Tooltip-Background",
  44.         edgeFile = "Interface/Tooltips/UI-Tooltip-Border",
  45.         tile = true,
  46.         tileSize = 16,
  47.         edgeSize = 16,
  48.         insets =
  49.         {
  50.             left = 4,
  51.             right = 4,
  52.             top = 4,
  53.             bottom = 4
  54.         },
  55.     }                      
  56.     border:SetBackdrop(backDrop)
  57.     border:SetBackdropBorderColor( 1, 1, 0, 1 )
  58.     border:SetBackdropColor( 0, 0, 0, 1 )
  59.  
  60.     frame.border = border
  61. end
  62.  
  63. addonData.BuildScrollFrame = function(self,name,parent,options)
  64.     parent = parent or UIParent
  65.     local frame = CreateFrame("ScrollFrame",name,parent,"UIPanelScrollFrameTemplate")
  66.     frame.ScrollBar = _G[frame:GetName() .. "ScrollBar"];
  67.     frame.ScrollBar:SetPoint("LEFT",frame,"RIGHT",5,0)
  68.     frame:SetWidth(options.FrameWidth - 55)
  69.     frame:SetHeight(options.FrameHeight - 20)
  70.     if options.HasBorder then
  71.         self:AddBorder(frame)
  72.     end
  73.     if options.IsMovable then
  74.         self:SetMovable(frame)
  75.         if not frame:SetUserPlaced() then
  76.             frame:SetPoint("CENTER",parent,"CENTER",10,-10)
  77.         end
  78.     else
  79.         frame:SetPoint("CENTER",parent,"CENTER",10,-10)
  80.     end
  81.     ScrollFrame_OnLoad(frame)
  82.     frame:UpdateScrollChildRect()
  83.  
  84.     frame:SetScript("OnScrollRangeChanged",function(self,xrange,yrange)
  85.         ScrollFrame_OnScrollRangeChanged(self, xrange, yrange)
  86.         self:UpdateScrollChildRect()
  87.     end)
  88.  
  89.     frame:SetScript("OnVerticalScroll",function(self,offset)
  90.         addonData:OnVerticalScroll(frame,offset)
  91.         self:UpdateScrollChildRect()
  92.     end)
  93.  
  94.     frame:SetScript("OnMouseWheel",function(self,delta)
  95.         ScrollFrameTemplate_OnMouseWheel(self, delta)
  96.         self:UpdateScrollChildRect()
  97.     end)
  98.  
  99.     return frame
  100. end
  101.  
  102. addonData.OnVerticalScroll = function(self,frame,offset)
  103.     if offset == 0 then return end
  104.     local scrollbar = _G[frame:GetName().."ScrollBar"];
  105.     scrollbar:SetValue(offset);
  106.     local min;
  107.     local max;
  108.     min, max = scrollbar:GetMinMaxValues();
  109.     if ( offset == 0 ) then
  110.         _G[scrollbar:GetName().."ScrollUpButton"]:Disable();
  111.     else
  112.         _G[scrollbar:GetName().."ScrollUpButton"]:Enable();
  113.     end
  114.     if ((scrollbar:GetValue() - max) == 0) then
  115.         _G[scrollbar:GetName().."ScrollDownButton"]:Disable();
  116.     else
  117.         _G[scrollbar:GetName().."ScrollDownButton"]:Enable();
  118.     end
  119. end
  120.  
  121. local function CreateScrollFrame()
  122.     myScrollFrame = addonData:BuildScrollFrame("XrystalScrollFrame_ObjectivesTracker",UIParent,addonData.Options)
  123. end
  124.  
  125. local OTFMoving
  126. hooksecurefunc(ObjectiveTrackerFrame, "SetPoint", function(self)
  127.     if not myScrollFrame then return end
  128.     if OTFMoving then return end
  129.     OTFMoving = true
  130.     self:SetMovable(true)
  131.     self:SetUserPlaced(true)
  132.     self:ClearAllPoints()
  133.     self:SetPoint("TOPLEFT", myScrollFrame, "TOPLEFT", 30, 0)
  134.     self:SetScale(1.1)
  135.     self:SetWidth(addonData.Options.FrameWidth - 30)
  136.     self:SetHeight(1000)
  137.     myScrollFrame:SetScrollChild(self)
  138.     self:SetMovable(false)
  139.     OTFMoving = nil
  140. end)
  141.  
  142. --DEFAULT_OBJECTIVE_TRACKER_MODULE.blockOffsetX = 30
  143. CreateScrollFrame()

I need that line that is commented out to keep the offset correct for my frame as otherwise the POI Icons and half of the check marks are too far left and are invisible. However, the moment I use that line it causes the taint message. This is a very basic version to my addon but visually it is useless without that offset being able to be used.
__________________
  Reply With Quote
12-18-14, 01:57 AM   #17
siweia
A Flamescale Wyrmkin
 
siweia's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2011
Posts: 114
I tried a bit work on this, and it breaks exactly as same as what Resike said.
You can just type "/script ObjectiveTracker_Update()" to have a go.

And I also found a thing that, I use HandyNotes and its plugin "DraenorTreasures" in game, if I untracked a quest from the objectivetracker frame by holding SHIFT key and click, it would taint the button as well.
Even I disable all the addons but these two.
  Reply With Quote
12-20-14, 04:19 PM   #18
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,289
Update: Seems like moving the "MinimapCluster" aka the (Minimap), will also cause this taint.
  Reply With Quote
12-21-14, 02:46 PM   #19
Vrul
An Onyxian Warder
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 353
I can get ObjectiveTrackerFrame to do what I want for the most part except for one problem. No matter what I've tried I cannot get UseQuestLogSpecialItem to work if you untrack an objective from the quest log.

Last edited by Vrul : 12-21-14 at 02:50 PM. Reason: Rephrased
  Reply With Quote
12-21-14, 04:12 PM   #20
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,289
Originally Posted by Vrul View Post
I can get ObjectiveTrackerFrame to do what I want for the most part except for one problem. No matter what I've tried I cannot get UseQuestLogSpecialItem to work if you untrack an objective from the quest log.
I have no issues with that, so it's probably caused by another addon, mostly map addons could cause this.
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » Unable to click quest button

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off