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

/Tukui/modules/blizzard/capturebar.lua

http://github.com/Asphyxia/Tukui
Lua | 22 lines | 18 code | 3 blank | 1 comment | 5 complexity | 413569142a129037a8c1bc4e70ec6ad6 MD5 | raw file
 1local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2-- reposition capture bar to top/center of the screen
 3
 4local function CaptureUpdate()
 5	if NUM_EXTENDED_UI_FRAMES then
 6		local captureBar
 7		for i=1, NUM_EXTENDED_UI_FRAMES do
 8			captureBar = getglobal("WorldStateCaptureBar" .. i)
 9
10			if captureBar and captureBar:IsVisible() then
11				captureBar:ClearAllPoints()
12				
13				if( i == 1 ) then
14					captureBar:Point("TOP", UIParent, "TOP", 0, -120)
15				else
16					captureBar:Point("TOPLEFT", getglobal("WorldStateCaptureBar" .. i - 1 ), "TOPLEFT", 0, -25)
17				end
18			end	
19		end	
20	end
21end
22hooksecurefunc("UIParent_ManageFramePositions", CaptureUpdate)