forked from Macblack131/Mac_RogueComboPointBar
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMac_RogueComboPoint.lua
More file actions
66 lines (52 loc) · 1.98 KB
/
Mac_RogueComboPoint.lua
File metadata and controls
66 lines (52 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Mac_RogueComboPointMixin = {}
function Mac_RogueComboPointMixin:OnLoad()
self:UpdateSize()
self:UpdateBorder()
end
function Mac_RogueComboPointMixin:UpdateSize()
self:SetSize(Mac_RogueComboPointBarDB.width, Mac_RogueComboPointBarDB.height)
end
function Mac_RogueComboPointMixin:UpdateBorderSize()
local borderSize = Mac_RogueComboPointBarDB.borderSize
self.BorderLeft:SetWidth(borderSize)
self.BorderRight:SetWidth(borderSize)
self.BorderTop:SetHeight(borderSize)
self.BorderBottom:SetHeight(borderSize)
self.BorderTop:SetPoint("TOPLEFT", 0, borderSize)
self.BorderTop:SetPoint("TOPRIGHT", borderSize, 0)
self.BorderRight:SetPoint("TOPRIGHT", borderSize, 0)
self.BorderRight:SetPoint("BOTTOMRIGHT", 0, -borderSize)
self.BorderBottom:SetPoint("BOTTOMLEFT", -borderSize, -borderSize)
self.BorderBottom:SetPoint("BOTTOMRIGHT", 0, 0)
self.BorderLeft:SetPoint("TOPLEFT", -borderSize, borderSize)
self.BorderLeft:SetPoint("BOTTOMLEFT", 0, 0)
end
function Mac_RogueComboPointMixin:UpdateBordeColor()
local colorData = Mac_RogueComboPointBarDB.borderColor
local r, g, b, a = colorData.r, colorData.g, colorData.b, colorData.a
self.BorderTop:SetColorTexture(r, g, b, a)
self.BorderRight:SetColorTexture(r, g, b, a)
self.BorderBottom:SetColorTexture(r, g, b, a)
self.BorderLeft:SetColorTexture(r, g, b, a)
end
function Mac_RogueComboPointMixin:ShowBorder()
self.BorderTop:Show()
self.BorderRight:Show()
self.BorderBottom:Show()
self.BorderLeft:Show()
end
function Mac_RogueComboPointMixin:HideBorder()
self.BorderTop:Hide()
self.BorderRight:Hide()
self.BorderBottom:Hide()
self.BorderLeft:Hide()
end
function Mac_RogueComboPointMixin:UpdateBorder()
if Mac_RogueComboPointBarDB.showBorder == false then
self:HideBorder()
return
end
self:ShowBorder()
self:UpdateBorderSize()
self:UpdateBordeColor()
end