PageRenderTime 28ms CodeModel.GetById 24ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Tukui/modules/blizzard/quests.lua

http://github.com/Asphyxia/Tukui
Lua | 25 lines | 21 code | 3 blank | 1 comment | 4 complexity | 3b6876371d31592509e2b2b9543408c9 MD5 | raw file
 1local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2
 3-- add quest level into Quest list frame.
 4if (IsAddOnLoaded("QuestGuru")) then return end
 5
 6local function questlevel()
 7	local buttons = QuestLogScrollFrame.buttons
 8	local numButtons = #buttons
 9	local scrollOffset = HybridScrollFrame_GetOffset(QuestLogScrollFrame)
10	local numEntries, numQuests = GetNumQuestLogEntries()
11	
12	for i = 1, numButtons do
13		local questIndex = i + scrollOffset
14		local questLogTitle = buttons[i]
15		if questIndex <= numEntries then
16			local title, level, questTag, suggestedGroup, isHeader, isCollapsed, isComplete, isDaily = GetQuestLogTitle(questIndex)
17			if not isHeader then
18				questLogTitle:SetText("[" .. level .. "] " .. title)
19				QuestLogTitleButton_Resize(questLogTitle)
20			end
21		end
22	end
23end
24hooksecurefunc("QuestLog_Update", questlevel)
25QuestLogScrollFrameScrollBar:HookScript("OnValueChanged", questlevel)