PageRenderTime 197ms CodeModel.GetById 1ms app.highlight 12ms RepoModel.GetById 178ms app.codeStats 1ms

/Tukui/modules/panels/panels.lua

http://github.com/Asphyxia/Tukui
Lua | 91 lines | 70 code | 16 blank | 5 comment | 7 complexity | cc39a4d0a210badcaa8dbef694131d51 MD5 | raw file
 1local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2
 3-- CHAT FRAMES
 4local TukuiChatBackgroundLeft = CreateFrame("Frame", "TukuiChatBackgroundLeft", UIParent)
 5TukuiChatBackgroundLeft:CreatePanel("Transparent", C["chat"].width, C["chat"].height, "BOTTOMLEFT", UIParent, "BOTTOMLEFT", 2, 2) 
 6
 7local TukuiChatBackgroundRight = CreateFrame("Frame", "TukuiChatBackgroundRight", UIParent)
 8TukuiChatBackgroundRight:CreatePanel("Transparent", C["chat"].width, C["chat"].height, "BOTTOMRIGHT", UIParent, "BOTTOMRIGHT", -2, 2) 
 9
10-- CHAT TABS
11local TukuiTabsLeftBackground = CreateFrame("Frame", "TukuiTabsLeftBackground", UIParent)
12TukuiTabsLeftBackground:CreatePanel("Default", 1, 23, "TOPLEFT", TukuiChatBackgroundLeft, "TOPLEFT", 5, -5)
13TukuiTabsLeftBackground:Point("TOPRIGHT", TukuiChatBackgroundLeft, "TOPRIGHT", -5, -5)
14TukuiTabsLeftBackground:SetFrameLevel(TukuiChatBackgroundLeft:GetFrameLevel() + 1)
15TukuiTabsLeftBackground:CreateOverlay(TukuiTabsLeftBackground)
16
17local TukuiTabsRightBackground = CreateFrame("Frame", "TukuiTabsRightBackground", UIParent)
18TukuiTabsRightBackground:CreatePanel("Default", 1, 23, "TOPLEFT", TukuiChatBackgroundRight, "TOPLEFT", 5, -5)
19TukuiTabsRightBackground:Point("TOPRIGHT", TukuiChatBackgroundRight, "TOPRIGHT", -5, -5)
20TukuiTabsRightBackground:SetFrameLevel(TukuiChatBackgroundRight:GetFrameLevel() + 1)
21TukuiTabsRightBackground:CreateOverlay(TukuiTabsRightBackground)
22
23if not C["chat"].background then
24	TukuiChatBackgroundLeft:SetAlpha(0)
25	TukuiChatBackgroundRight:SetAlpha(0)
26	TukuiTabsLeftBackground:SetAlpha(0)
27	TukuiTabsRightBackground:SetAlpha(0)
28end
29
30-- DATA FRAMES
31local TukuiInfoLeft = CreateFrame("Frame", "TukuiInfoLeft", UIParent)
32TukuiInfoLeft:CreatePanel("Default", 1, 23, "BOTTOMLEFT", TukuiChatBackgroundLeft, "BOTTOMLEFT", 5, 5)
33TukuiInfoLeft:Point("BOTTOMRIGHT", TukuiChatBackgroundLeft, "BOTTOMRIGHT", -5, 5)
34TukuiInfoLeft:SetFrameLevel(TukuiChatBackgroundLeft:GetFrameLevel() + 1)
35TukuiInfoLeft:CreateOverlay(TukuiInforLeft)
36
37local TukuiInfoRight = CreateFrame("Frame", "TukuiInfoRight", UIParent)
38TukuiInfoRight:CreatePanel("Default", 1, 23, "BOTTOMLEFT", TukuiChatBackgroundRight, "BOTTOMLEFT", 5, 5)
39TukuiInfoRight:Point("BOTTOMRIGHT", TukuiChatBackgroundRight, "BOTTOMRIGHT", -5, 5)
40TukuiInfoRight:SetFrameLevel(TukuiChatBackgroundRight:GetFrameLevel() + 1)
41TukuiInfoRight:CreateOverlay(TukuiInfoRight)
42
43--BATTLEGROUND STATS FRAME
44if C["datatext"].battleground == true then
45	local bgframe = CreateFrame("Frame", "TukuiInfoLeftBattleGround", UIParent)
46	bgframe:CreatePanel("Default", 1, 1, "TOPLEFT", UIParent, "BOTTOMLEFT", 0, 0)
47	bgframe:SetAllPoints(TukuiInfoLeft)
48	bgframe:SetFrameStrata("HIGH")
49	bgframe:SetFrameLevel(0)
50	bgframe:CreateOverlay(bgframe)
51	bgframe:EnableMouse(true)
52	bgframe:SetTemplate("Default", true)
53end
54
55	-- ACTIONBAR PANELS
56if C["actionbar"].enable then
57	local TukuiBar1 = CreateFrame("Frame", "TukuiBar1", UIParent, "SecureHandlerStateTemplate")
58	TukuiBar1:CreatePanel("Transparent", (T.buttonsize * 12) + (T.buttonspacing * 13) + 2, (T.buttonsize * 2) + (T.buttonspacing * 3) + 2, "BOTTOM", UIParent, "BOTTOM", 0, 48)
59
60	local TukuiBar2 = CreateFrame("Frame", "TukuiBar2", UIParent)
61	TukuiBar2:SetAllPoints(TukuiBar1)--("BOTTOM")
62	
63	local TukuiBar3 = CreateFrame("Frame", "TukuiBar3", UIParent)
64	TukuiBar3:SetAllPoints(TukuiBar1)--Point("BOTTOM")
65
66	local TukuiBar4 = CreateFrame("Frame", "TukuiBar4", UIParent)
67	TukuiBar2:SetAllPoints(TukuiBar1)--Point("BOTTOM")
68
69	local TukuiSplitBarLeft = CreateFrame("Frame", "TukuiSplitBarLeft", UIParent)
70	TukuiSplitBarLeft:CreatePanel("Transparent", (T.buttonsize * 3) + (T.buttonspacing * 4) + 2, TukuiBar1:GetHeight(), "BOTTOMRIGHT", TukuiBar1, "BOTTOMLEFT", -3, 0)
71
72	local TukuiSplitBarRight = CreateFrame("Frame", "TukuiSplitBarRight", UIParent)
73	TukuiSplitBarRight:CreatePanel("Transparent", (T.buttonsize * 3) + (T.buttonspacing * 4) + 2, TukuiBar1:GetHeight(), "BOTTOMLEFT", TukuiBar1, "BOTTOMRIGHT", 3, 0)
74
75	local TukuiRightBar = CreateFrame("Frame", "TukuiRightBar", UIParent)
76	TukuiRightBar:CreatePanel("Transparent", (T.buttonsize * 12 + T.buttonspacing * 13) + 2,  (T.buttonsize * 12 + T.buttonspacing * 13) + 2, "BOTTOMRIGHT", TukuiChatBackgroundRight, "TOPRIGHT", 0, 3)
77	if not C["chat"].background then
78		TukuiRightBar:ClearAllPoints()
79		TukuiRightBar:Point("RIGHT", UIParent, "RIGHT", -8, 0)
80	end
81	
82	local TukuiPetBar = CreateFrame("Frame", "TukuiPetBar", UIParent)
83	TukuiPetBar:CreatePanel("Transparent", 1, 1, "BOTTOM", TukuiRightBar, "TOP", 0, 3)
84	if C["actionbar"].vertical_rightbars == true then
85		TukuiPetBar:Width((T.petbuttonsize + T.buttonspacing * 2) + 2)
86		TukuiPetBar:Height((T.petbuttonsize * NUM_PET_ACTION_SLOTS + T.buttonspacing * 11) + 2)
87	else
88		TukuiPetBar:Width((T.petbuttonsize * NUM_PET_ACTION_SLOTS + T.buttonspacing * 11) + 2)
89		TukuiPetBar:Height((T.petbuttonsize + T.buttonspacing * 2) + 2)
90	end
91end