-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpriest_helpers.lua
138 lines (118 loc) · 4.04 KB
/
priest_helpers.lua
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
local ConRO_Priest, ids = ...;
local defaults = {
["Raid_Atonement_Threshold"] = 8,
}
ConROPriest = ConROPriest or defaults;
function ConRO_ShowAtonement()
ConROButtonFrame:Show();
ConRO_AutoButton:Hide();
ConRO_SingleButton:Hide();
ConRO_AoEButton:Hide();
ConRO_AtonementButton:Show();
ConRO_RaidAtonementButton:Show();
end
function ConRO:CreateAtonementButton()
local tbutton = CreateFrame("Button", 'ConRO_AtonementButton', ConROButtonFrame)
tbutton:SetFrameStrata('MEDIUM');
tbutton:SetFrameLevel('74')
tbutton:SetPoint("TOPRIGHT", "ConROButtonFrame", "TOPRIGHT", -7, 0)
tbutton:SetSize(40, 15)
tbutton:Hide()
tbutton:SetAlpha(1)
tbutton:SetText("At: " .. ConRO:GroupBuffCount(ids.Disc_Buff.Atonement))
tbutton:SetNormalFontObject("GameFontHighlightSmall")
tbutton:SetScript("OnEnter", ConROTTOnEnter)
tbutton:SetScript("OnLeave", ConROTTOnLeave)
local ntex = tbutton:CreateTexture()
ntex:SetTexture("Interface\\AddOns\\ConRO\\images\\buttonUp")
ntex:SetTexCoord(0, 0.625, 0, 0.6875)
ntex:SetVertexColor(0, 0, 0, 1)
ntex:SetAllPoints()
tbutton:SetNormalTexture(ntex)
tbutton:SetScript("OnMouseDown", function (self, tbutton, up)
if ConRO.db.profile.unlockWindow then
ConROButtonFrame:StartMoving();
self.isMoving = true;
end
end)
tbutton:SetScript("OnMouseUp", function (self, tbutton, up)
if ConRO.db.profile.unlockWindow then
ConROButtonFrame:StopMovingOrSizing();
self.isMoving = false;
end
end)
end
function ConRO:CreateRaidAtonementButton()
local tbutton = CreateFrame("Button", 'ConRO_RaidAtonementButton', ConROButtonFrame);
tbutton:SetFrameStrata('MEDIUM');
tbutton:SetFrameLevel('74');
tbutton:SetPoint("BOTTOMRIGHT", "ConROButtonFrame", "BOTTOMRIGHT", -7, 0);
tbutton:SetSize(40, 15);
tbutton:Hide();
tbutton:SetAlpha(1);
tbutton:SetText("Solo");
tbutton:SetNormalFontObject("GameFontHighlightSmall");
tbutton:SetScript("OnEnter", ConROTTOnEnter);
tbutton:SetScript("OnLeave", ConROTTOnLeave);
local box1 = CreateFrame("EditBox", 'ConRO_AtonementBox', tbutton);
box1:SetPoint("BOTTOMRIGHT", "ConROButtonFrame", "BOTTOMRIGHT", -1, 2);
box1:SetMultiLine(false);
box1:SetFontObject(GameFontNormalSmall);
box1:SetNumeric(true);
box1:SetAutoFocus(false);
box1:SetMaxLetters("2");
box1:SetWidth(20);
box1:SetHeight(15);
box1:SetTextInsets(3, 0, 0, 0);
box1:SetNumber(ConROPriest.Raid_Atonement_Threshold);
box1:SetScript("OnEditFocusLost",
function()
ConROPriest.Raid_Atonement_Threshold = ConRO_AtonementBox:GetNumber();
box1:ClearFocus()
end);
box1:SetScript("OnEnterPressed",
function()
ConROPriest.Raid_Atonement_Threshold = ConRO_AtonementBox:GetNumber();
box1:ClearFocus()
end);
box1:SetScript("OnEscapePressed",
function()
ConROPriest.Raid_Atonement_Threshold = ConRO_AtonementBox:GetNumber();
box1:ClearFocus()
end);
local ntex = tbutton:CreateTexture()
ntex:SetTexture("Interface\\AddOns\\ConRO\\images\\buttonUp")
ntex:SetTexCoord(0, 0.625, 0, 0.6875)
ntex:SetVertexColor(0, 0, 0, 1)
ntex:SetAllPoints()
tbutton:SetNormalTexture(ntex)
tbutton:SetScript("OnMouseDown", function (self, tbutton, up)
if ConRO.db.profile.unlockWindow then
ConROButtonFrame:StartMoving();
self.isMoving = true;
end
end)
tbutton:SetScript("OnMouseUp", function (self, tbutton, up)
if ConRO.db.profile.unlockWindow then
ConROButtonFrame:StopMovingOrSizing();
self.isMoving = false;
end
end)
end
function ConRO:Atonements(_Atonement_COUNT)
ConRO_AtonementButton:SetText("At: " .. _Atonement_COUNT);
if ConRO:InRaid() then
ConRO_RaidAtonementButton:SetText("Raid: ");
ConRO_AtonementBox:SetNumber(ConROPriest.Raid_Atonement_Threshold);
ConRO_AtonementBox:Show();
elseif ConRO:InParty() then
ConRO_RaidAtonementButton:SetText("Party: ");
ConRO_AtonementBox:SetNumber(GetNumGroupMembers());
ConRO_AtonementBox:Show();
elseif ConRO:IsSolo() then
ConRO_RaidAtonementButton:SetText("Solo");
ConRO_AtonementBox:Hide();
end
end
ConRO:CreateAtonementButton();
ConRO:CreateRaidAtonementButton();