View Single Post
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: 126
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