Details | Compare with Previous | View Log
Line No. | Rev | Author | Line |
---|---|---|---|
1 | 2 | Hoern-42580 | addon, ns = ... |
2 | Hoern-42580 | local util = ns.util |
|
3 | Hoern-42580 | ||
4 | Hoern-42580 | local pinfo = { |
|
5 | Hoern-42580 | class = string.upper(select(2, UnitClass('player'))), |
|
6 | Hoern-42580 | level = UnitLevel("player") |
|
7 | Hoern-42580 | } |
|
8 | Hoern-42580 | ||
9 | Hoern-42580 | local __, _, _, tocversion = GetBuildInfo() |
|
10 | Hoern-42580 | ||
11 | Hoern-42580 | -- color definitions |
|
12 | Hoern-42580 | local defaults = { |
|
13 | Hoern-42580 | ["SHAMAN"] = { |
|
14 | Hoern-42580 | colors = { 0, 0, 1 }, |
|
15 | Hoern-42580 | blips = 5, |
|
16 | Hoern-42580 | }, |
|
17 | Hoern-42580 | ["PALADIN"] = { |
|
18 | Hoern-42580 | colors = { 0.81, 0.04, 0.97 }, |
|
19 | Hoern-42580 | blips = 3, |
|
20 | Hoern-42580 | }, |
|
21 | Hoern-42580 | ["DRUID"] = { |
|
22 | Hoern-42580 | colors = { 1, 1, 0 }, |
|
23 | Hoern-42580 | blips = 5, |
|
24 | Hoern-42580 | }, |
|
25 | Hoern-42580 | ["ROGUE"] = { |
|
26 | Hoern-42580 | colors = { 1, 1, 0 }, |
|
27 | Hoern-42580 | blips = 5, |
|
28 | Hoern-42580 | }, |
|
29 | Hoern-42580 | ["WARLOCK"] = { |
|
30 | Hoern-42580 | colors = { 0.81, 0.04, 0.97 }, |
|
31 | Hoern-42580 | blips = 3, |
|
32 | Hoern-42580 | }, |
|
33 | Hoern-42580 | ["PRIEST"] = { |
|
34 | Hoern-42580 | colors = { 0.8, 0.4, 0.8 }, |
|
35 | Hoern-42580 | blips = 3, |
|
36 | Hoern-42580 | }, |
|
37 | Hoern-42580 | } |
|
38 | Hoern-42580 | ||
39 | Hoern-42580 | -- if we don't have a color definition we don't need to carry on |
|
40 | Hoern-42580 | if util.tmisses(defaults, pinfo.class) then return end |
|
41 | Hoern-42580 | ||
42 | Hoern-42580 | local backdrop = { |
|
43 | Hoern-42580 | bgFile = [[Interface\ChatFrame\ChatFrameBackground]], |
|
44 | Hoern-42580 | edgeFile = [[Interface/Tooltips/UI-Tooltip-Border]], |
|
45 | Hoern-42580 | tile = true, tileSize = 4, edgeSize = 4, |
|
46 | Hoern-42580 | insets = { left = 1, right = 1, top = 1, bottom = 1 } |
|
47 | Hoern-42580 | } |
|
48 | Hoern-42580 | ||
49 | Hoern-42580 | if rPwrConf == nil then |
|
50 | Hoern-42580 | rPwrConf = { |
|
51 | Hoern-42580 | ato = "CENTER", |
|
52 | Hoern-42580 | x = 0, |
|
53 | Hoern-42580 | y = 0, |
|
54 | Hoern-42580 | scale = 1, |
|
55 | Hoern-42580 | enabled = true, |
|
56 | Hoern-42580 | mycolors = nil, |
|
57 | Hoern-42580 | } |
|
58 | Hoern-42580 | end |
|
59 | Hoern-42580 | ||
60 | Hoern-42580 | local max_blip, red, green, blue, catStance |
|
61 | Hoern-42580 | local cfg_size = 19 |
|
62 | Hoern-42580 | ||
63 | Hoern-42580 | rCPFrame = CreateFrame("Frame", "rCPFrame") |
|
64 | Hoern-42580 | rCPFrame:RegisterEvent("VARIABLES_LOADED") |
|
65 | Hoern-42580 | ||
66 | Hoern-42580 | rCPFrame:SetScript("OnEvent", function(self, event, ...) |
|
67 | Hoern-42580 | if event == "VARIABLES_LOADED" then |
|
68 | Hoern-42580 | self:UnregisterEvent("VARIABLES_LOADED") |
|
69 | Hoern-42580 | self:Init() |
|
70 | Hoern-42580 | end |
|
71 | Hoern-42580 | end) |
|
72 | Hoern-42580 | ||
73 | Hoern-42580 | function rCPFrame:Init() |
|
74 | Hoern-42580 | max_blip, red, green, blue = initClass() |
|
75 | Hoern-42580 | ||
76 | Hoern-42580 | if pinfo.class == "DRUID" or pinfo.class == "ROGUE" then |
|
77 | Hoern-42580 | makeFrames(max_blip, red, green, blue, false) |
|
78 | Hoern-42580 | util.updateVisuals(max_blip, util.currCP(), red, green, blue) |
|
79 | Hoern-42580 | ||
80 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_COMBO_POINTS") |
|
81 | Hoern-42580 | rCPFrame:RegisterEvent("PLAYER_TARGET_CHANGED") |
|
82 | Hoern-42580 | ||
83 | Hoern-42580 | if pinfo.class == "DRUID" then -- turn display off when not in kitty |
|
84 | Hoern-42580 | druidShowHide() |
|
85 | Hoern-42580 | rCPFrame:RegisterEvent("UPDATE_SHAPESHIFT_FORM") |
|
86 | Hoern-42580 | end |
|
87 | Hoern-42580 | ||
88 | Hoern-42580 | if pinfo.class == "ROGUE" then |
|
89 | Hoern-42580 | if rPwrConf.dpstack == true then -- envenom counter |
|
90 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_AURA") |
|
91 | Hoern-42580 | end |
|
92 | Hoern-42580 | end |
|
93 | Hoern-42580 | ||
94 | Hoern-42580 | rCPFrame:SetScript("OnEvent", function(self, event, unit) |
|
95 | Hoern-42580 | ||
96 | Hoern-42580 | if pinfo.class == "DRUID" and event == "UPDATE_SHAPESHIFT_FORM" then |
|
97 | Hoern-42580 | druidShowHide() |
|
98 | Hoern-42580 | end |
|
99 | Hoern-42580 | ||
100 | Hoern-42580 | if pinfo.class == "ROGUE" and event == "UNIT_AURA" then |
|
101 | Hoern-42580 | if rPwrConf.dpstack == true and unit == "target" then |
|
102 | Hoern-42580 | local count = util.currDP() |
|
103 | Hoern-42580 | util.updateBorder(5, count, 0, 0, 0, 0, 1, 0) |
|
104 | Hoern-42580 | end |
|
105 | Hoern-42580 | end |
|
106 | Hoern-42580 | ||
107 | Hoern-42580 | util.updateVisuals(max_blip, util.currCP(), red, green, blue) |
|
108 | Hoern-42580 | ||
109 | Hoern-42580 | if pinfo.class == "ROGUE" then |
|
110 | Hoern-42580 | local count = util.currDP() |
|
111 | Hoern-42580 | util.updateBorder(5, count, 0, 0, 0, 0, 1, 0) |
|
112 | Hoern-42580 | end |
|
113 | Hoern-42580 | ||
114 | Hoern-42580 | if pinfo.class == "DRUID" then |
|
115 | Hoern-42580 | druidShowHide() |
|
116 | Hoern-42580 | end |
|
117 | Hoern-42580 | end) |
|
118 | Hoern-42580 | end |
|
119 | Hoern-42580 | ||
120 | Hoern-42580 | if pinfo.class == "PALADIN" then |
|
121 | Hoern-42580 | max_blip, red, green, blue = initClass() |
|
122 | Hoern-42580 | ||
123 | Hoern-42580 | makeFrames(max_blip, red, green, blue, false) |
|
124 | Hoern-42580 | util.updateVisuals(max_blip, util.currHolyPower(), red, green, blue) |
|
125 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_POWER") |
|
126 | Hoern-42580 | rCPFrame:SetScript("OnEvent", function(self, event, unit, power) |
|
127 | Hoern-42580 | if unit ~= "player" or power ~= "HOLY_POWER" then return end |
|
128 | Hoern-42580 | util.updateVisuals(max_blip, util.currHolyPower(), red, green, blue) |
|
129 | Hoern-42580 | end) |
|
130 | Hoern-42580 | end |
|
131 | Hoern-42580 | ||
132 | Hoern-42580 | if pinfo.class == "WARLOCK" then |
|
133 | Hoern-42580 | max_blip, red, green, blue = initClass() |
|
134 | Hoern-42580 | ||
135 | Hoern-42580 | makeFrames(max_blip, red, green, blue, false) |
|
136 | Hoern-42580 | util.updateVisuals(max_blip, util.currShards(), red, green, blue) |
|
137 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_POWER") |
|
138 | Hoern-42580 | rCPFrame:RegisterEvent("PLAYER_ALIVE") |
|
139 | Hoern-42580 | rCPFrame:SetScript("OnEvent", function(self, event, unit, power) |
|
140 | Hoern-42580 | if event == "PLAYER_ALIVE" then |
|
141 | Hoern-42580 | util.updateVisuals(max_blip, util.currShards(), red, green, blue) |
|
142 | Hoern-42580 | end |
|
143 | Hoern-42580 | if unit ~= "player" or power ~= "SOUL_SHARDS" then return end |
|
144 | Hoern-42580 | util.updateVisuals(max_blip, util.currShards(), red, green, blue) |
|
145 | Hoern-42580 | end) |
|
146 | Hoern-42580 | end |
|
147 | Hoern-42580 | ||
148 | Hoern-42580 | if pinfo.class == "SHAMAN" then |
|
149 | Hoern-42580 | rCPFrame.spec = GetPrimaryTalentTree() |
|
150 | Hoern-42580 | max_blip, red, green, blue = initClass() |
|
151 | Hoern-42580 | ||
152 | Hoern-42580 | if rCPFrame.spec == 2 then |
|
153 | Hoern-42580 | cFunc = util.currMaelstrom |
|
154 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_AURA") |
|
155 | Hoern-42580 | elseif rCPFrame.spec == 1 then |
|
156 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_AURA") |
|
157 | Hoern-42580 | cFunc = util.currLB |
|
158 | Hoern-42580 | max_blip = 6 |
|
159 | Hoern-42580 | end |
|
160 | Hoern-42580 | ||
161 | Hoern-42580 | rCPFrame:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |
|
162 | Hoern-42580 | ||
163 | Hoern-42580 | shamanShowHide(rCPFrame.spec) |
|
164 | Hoern-42580 | if rCPFrame.spec ~= 3 then |
|
165 | Hoern-42580 | util.updateVisuals(max_blip, cFunc(), red, green, blue) |
|
166 | Hoern-42580 | end |
|
167 | Hoern-42580 | ||
168 | Hoern-42580 | rCPFrame:SetScript("OnEvent", function(self, event, unit) |
|
169 | Hoern-42580 | if event == "ACTIVE_TALENT_GROUP_CHANGED" then |
|
170 | Hoern-42580 | rCPFrame.spec = GetPrimaryTalentTree() |
|
171 | Hoern-42580 | if rCPFrame.spec == 2 then |
|
172 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_AURA") |
|
173 | Hoern-42580 | cFunc = util.currMaelstrom |
|
174 | Hoern-42580 | max_blip = 5 |
|
175 | Hoern-42580 | shamanShowHide(rCPFrame.spec) |
|
176 | Hoern-42580 | util.updateVisuals(max_blip, cFunc(), red, green, blue) |
|
177 | Hoern-42580 | elseif rCPFrame.spec == 1 then |
|
178 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_AURA") |
|
179 | Hoern-42580 | cFunc = util.currLB |
|
180 | Hoern-42580 | max_blip = 6 |
|
181 | Hoern-42580 | shamanShowHide(rCPFrame.spec) |
|
182 | Hoern-42580 | util.updateVisuals(max_blip, cFunc(), red, green, blue) |
|
183 | Hoern-42580 | else |
|
184 | Hoern-42580 | rCPFrame:UnregisterEvent("UNIT_AURA") |
|
185 | Hoern-42580 | for i = 1, max_blip do |
|
186 | Hoern-42580 | _G['powerframe'..i]:Hide() |
|
187 | Hoern-42580 | end |
|
188 | Hoern-42580 | end |
|
189 | Hoern-42580 | else |
|
190 | Hoern-42580 | if unit ~= "player" then return end |
|
191 | Hoern-42580 | util.updateVisuals(max_blip, cFunc(), red, green, blue) |
|
192 | Hoern-42580 | end |
|
193 | Hoern-42580 | end) |
|
194 | Hoern-42580 | end |
|
195 | Hoern-42580 | ||
196 | Hoern-42580 | if pinfo.class == "PRIEST" and GetPrimaryTalentTree() == 3 then |
|
197 | Hoern-42580 | if pinfo.level < 80 then |
|
198 | Hoern-42580 | print("Priest in Shadow spec detected but not 80, yet. Disabling to preserve pristine power in perpetuum. Reload UI after hitting 80.") |
|
199 | Hoern-42580 | return false |
|
200 | Hoern-42580 | end |
|
201 | Hoern-42580 | max_blip, red, green, blue = initClass() |
|
202 | Hoern-42580 | ||
203 | Hoern-42580 | makeFrames(max_blip, red, green, blue, false) |
|
204 | Hoern-42580 | util.updateVisuals(max_blip, util.currOrbs(), red, green, blue) |
|
205 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_AURA") |
|
206 | Hoern-42580 | rCPFrame:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED") |
|
207 | Hoern-42580 | rCPFrame:SetScript("OnEvent", function(self, event, unit) |
|
208 | Hoern-42580 | if event == "UNIT_AURA" then |
|
209 | Hoern-42580 | if unit ~= "player" then return end |
|
210 | Hoern-42580 | util.updateVisuals(max_blip, util.currOrbs(), red, green, blue) |
|
211 | Hoern-42580 | elseif event == "ACTIVE_TALENT_GROUP_CHANGED" then |
|
212 | Hoern-42580 | if GetPrimaryTalentTree() == 3 then |
|
213 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_AURA") |
|
214 | Hoern-42580 | priestShowHide(true) |
|
215 | Hoern-42580 | util.updateVisuals(max_blip, util.currOrbs(), red, gree, blue) |
|
216 | Hoern-42580 | else |
|
217 | Hoern-42580 | rCPFrame:UnregisterEvent("UNIT_AURA") |
|
218 | Hoern-42580 | priestShowHide(false) |
|
219 | Hoern-42580 | end |
|
220 | Hoern-42580 | end |
|
221 | Hoern-42580 | end) |
|
222 | Hoern-42580 | end |
|
223 | Hoern-42580 | end |
|
224 | Hoern-42580 | ||
225 | Hoern-42580 | genFrame = function(red, green, blue, height, width) |
|
226 | Hoern-42580 | local f = CreateFrame("Frame") |
|
227 | Hoern-42580 | f:SetWidth(width * (rPwrConf.ratio or 1)) |
|
228 | Hoern-42580 | f:SetHeight(height) |
|
229 | Hoern-42580 | f:SetBackdrop(backdrop) |
|
230 | Hoern-42580 | f:SetBackdropColor(red,green,blue,0.5) |
|
231 | Hoern-42580 | f:SetBackdropBorderColor(0,0,0,1) |
|
232 | Hoern-42580 | f:Show() |
|
233 | Hoern-42580 | return f |
|
234 | Hoern-42580 | end |
|
235 | Hoern-42580 | ||
236 | Hoern-42580 | function makeFrames(num, red, green, blue, stretch) |
|
237 | Hoern-42580 | local mult = 1 |
|
238 | Hoern-42580 | if stretch then |
|
239 | Hoern-42580 | mult = 5 / num |
|
240 | Hoern-42580 | end |
|
241 | Hoern-42580 | for i = 1, num do |
|
242 | Hoern-42580 | _G['powerframe'..i] = genFrame(red, green, blue, cfg_size, cfg_size * mult) |
|
243 | Hoern-42580 | if i == 1 then |
|
244 | Hoern-42580 | local gb = _G['powerframe1'] |
|
245 | Hoern-42580 | gb:SetPoint(rPwrConf.ato, UIParent, rPwrConf.ato, rPwrConf.x, rPwrConf.y) |
|
246 | Hoern-42580 | gb:SetMovable(true) |
|
247 | Hoern-42580 | gb:EnableMouse(true) |
|
248 | Hoern-42580 | gb:RegisterForDrag("LeftButton") |
|
249 | Hoern-42580 | gb:SetScript("OnDragStart", function(self) |
|
250 | Hoern-42580 | if IsAltKeyDown() and IsShiftKeyDown() then |
|
251 | Hoern-42580 | self:StartMoving() |
|
252 | Hoern-42580 | end |
|
253 | Hoern-42580 | end) |
|
254 | Hoern-42580 | gb:SetScript("OnDragStop", function(self) |
|
255 | Hoern-42580 | self:StopMovingOrSizing() |
|
256 | Hoern-42580 | _,_, rPwrConf.ato, rPwrConf.x, rPwrConf.y = self:GetPoint(1) |
|
257 | Hoern-42580 | end) |
|
258 | Hoern-42580 | gb:SetScale(rPwrConf.scale) |
|
259 | Hoern-42580 | else |
|
260 | Hoern-42580 | _G['powerframe'..i]:SetPoint("TOPLEFT", _G['powerframe'..i-1], "TOPRIGHT", 1, 0) |
|
261 | Hoern-42580 | _G['powerframe'..i]:SetScale(rPwrConf.scale) |
|
262 | Hoern-42580 | end |
|
263 | Hoern-42580 | end |
|
264 | Hoern-42580 | end |
|
265 | Hoern-42580 | ||
266 | Hoern-42580 | function initClass() |
|
267 | Hoern-42580 | local red, green, blue |
|
268 | Hoern-42580 | if rPwrConf.mycolors then |
|
269 | Hoern-42580 | red, green, blue = unpack(rPwrConf.mycolors) |
|
270 | Hoern-42580 | else |
|
271 | Hoern-42580 | red, green, blue = unpack(defaults[pinfo.class]["colors"]) |
|
272 | Hoern-42580 | end |
|
273 | Hoern-42580 | local blips = defaults[pinfo.class]["blips"] |
|
274 | Hoern-42580 | return blips, red, green, blue |
|
275 | Hoern-42580 | end |
|
276 | Hoern-42580 | ||
277 | Hoern-42580 | local function kittyStance() |
|
278 | Hoern-42580 | local sid = 0 |
|
279 | Hoern-42580 | local cat = GetSpellInfo(768) |
|
280 | Hoern-42580 | for i=1, GetNumShapeshiftForms() do |
|
281 | Hoern-42580 | local _, name, _, _ = GetShapeshiftFormInfo(i) |
|
282 | Hoern-42580 | if name == cat then sid = i end |
|
283 | Hoern-42580 | end |
|
284 | Hoern-42580 | return sid |
|
285 | Hoern-42580 | end |
|
286 | Hoern-42580 | ||
287 | Hoern-42580 | function druidShowHide() |
|
288 | Hoern-42580 | if GetShapeshiftForm() ~= kittyStance() and util.currCP() == 0 then |
|
289 | Hoern-42580 | for i = 1, 5 do |
|
290 | Hoern-42580 | rCPFrame:UnregisterEvent("UNIT_AURA") |
|
291 | Hoern-42580 | _G['powerframe'..i]:Hide() |
|
292 | Hoern-42580 | end |
|
293 | Hoern-42580 | else |
|
294 | Hoern-42580 | for i = 1, 5 do |
|
295 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_AURA") |
|
296 | Hoern-42580 | _G['powerframe'..i]:Show() |
|
297 | Hoern-42580 | end |
|
298 | Hoern-42580 | end |
|
299 | Hoern-42580 | end |
|
300 | Hoern-42580 | ||
301 | Hoern-42580 | function priestShowHide(show) |
|
302 | Hoern-42580 | if show then |
|
303 | Hoern-42580 | for i = 1, 3 do |
|
304 | Hoern-42580 | _G['powerframe'..i]:Show() |
|
305 | Hoern-42580 | end |
|
306 | Hoern-42580 | else |
|
307 | Hoern-42580 | for i = 1, 3 do |
|
308 | Hoern-42580 | _G['powerframe'..i]:Hide() |
|
309 | Hoern-42580 | end |
|
310 | Hoern-42580 | end |
|
311 | Hoern-42580 | end |
|
312 | Hoern-42580 | ||
313 | Hoern-42580 | function shamanShowHide(spec) |
|
314 | Hoern-42580 | if spec == 1 then |
|
315 | Hoern-42580 | for i = 1,6 do |
|
316 | Hoern-42580 | _G['powerframe'..i]:SetWidth(cfg_size * (5/6)) |
|
317 | Hoern-42580 | end |
|
318 | Hoern-42580 | _G['powerframe6']:Show() |
|
319 | Hoern-42580 | else |
|
320 | Hoern-42580 | for i = 1,5 do |
|
321 | Hoern-42580 | _G['powerframe'..i]:SetWidth(cfg_size) |
|
322 | Hoern-42580 | end |
|
323 | Hoern-42580 | _G['powerframe6']:Hide() |
|
324 | Hoern-42580 | end |
|
325 | Hoern-42580 | end |
|
326 | Hoern-42580 | ||
327 | Hoern-42580 | ||
328 | Hoern-42580 | function ShowColorPicker(r, g, b, cback) |
|
329 | Hoern-42580 | ColorPickerFrame:SetColorRGB(r,g,b); |
|
330 | Hoern-42580 | ColorPickerFrame.previousValues = {r,g,b}; |
|
331 | Hoern-42580 | ColorPickerFrame.func, ColorPickerFrame.opacityFunc, ColorPickerFrame.cancelFunc = cback, cback, cback; |
|
332 | Hoern-42580 | ColorPickerFrame:Hide(); |
|
333 | Hoern-42580 | ColorPickerFrame:Show(); |
|
334 | Hoern-42580 | end |
|
335 | Hoern-42580 | ||
336 | Hoern-42580 | function colorCallback(bail) |
|
337 | Hoern-42580 | local nr, ng, nb |
|
338 | Hoern-42580 | if bail then |
|
339 | Hoern-42580 | red, green, blue = unpack(bail) |
|
340 | Hoern-42580 | else |
|
341 | Hoern-42580 | red, green, blue = ColorPickerFrame:GetColorRGB(); |
|
342 | Hoern-42580 | end |
|
343 | Hoern-42580 | util.updateVisuals(max_blip, max_blip, red, green, blue) |
|
344 | Hoern-42580 | rPwrConf.mycolors = { red, green, blue } |
|
345 | Hoern-42580 | end |
|
346 | Hoern-42580 | ||
347 | Hoern-42580 | SLASH_RP1 = "/rp" |
|
348 | Hoern-42580 | SlashCmdList["RP"] = function(str) |
|
349 | Hoern-42580 | local switch, message = str:match("^(%S*)%s*(.-)$"); |
|
350 | Hoern-42580 | local cmd = string.lower(switch) |
|
351 | Hoern-42580 | local msg = string.lower(message) |
|
352 | Hoern-42580 | ||
353 | Hoern-42580 | if cmd == "scale" then |
|
354 | Hoern-42580 | msg = tonumber(msg) or 1 |
|
355 | Hoern-42580 | if not(msg <= 5) then msg = 1 end |
|
356 | Hoern-42580 | for i=1, max_blip do |
|
357 | Hoern-42580 | rPwrConf.scale = msg |
|
358 | Hoern-42580 | _G['powerframe'..i]:SetScale(msg) |
|
359 | Hoern-42580 | end |
|
360 | Hoern-42580 | elseif cmd == "dpstack" then |
|
361 | Hoern-42580 | if rPwrConf.dpstack == nil or rPwrConf.dpstack == false then |
|
362 | Hoern-42580 | rPwrConf.dpstack = true |
|
363 | Hoern-42580 | rCPFrame:RegisterEvent("UNIT_AURA") |
|
364 | Hoern-42580 | else |
|
365 | Hoern-42580 | rPwrConf.dpstack = false |
|
366 | Hoern-42580 | for i = 1, 5 do |
|
367 | Hoern-42580 | _G["powerframe"..i]:SetBackdropBorderColor(0,0,0,1) -- black |
|
368 | Hoern-42580 | end |
|
369 | Hoern-42580 | rCPFrame:UnregisterEvent("UNIT_AURA") |
|
370 | Hoern-42580 | end |
|
371 | Hoern-42580 | elseif cmd == "color" then |
|
372 | Hoern-42580 | if msg == "set" then |
|
373 | Hoern-42580 | ShowColorPicker(red, green, blue, colorCallback) |
|
374 | Hoern-42580 | elseif msg == "reset" then |
|
375 | Hoern-42580 | red, green, blue = unpack(defaults[pinfo.class]["colors"]) |
|
376 | Hoern-42580 | ShowColorPicker(red, green, blue, colorCallback) |
|
377 | Hoern-42580 | end |
|
378 | Hoern-42580 | elseif cmd == "ratio" then |
|
379 | Hoern-42580 | ra = tonumber(msg) |
|
380 | Hoern-42580 | if ra < 0.2 or ra > 10 then ra = 1 end |
|
381 | Hoern-42580 | rPwrConf.ratio = ra |
|
382 | Hoern-42580 | for i = 1,max_blip do |
|
383 | Hoern-42580 | local p = _G['powerframe'..i] |
|
384 | Hoern-42580 | p:SetWidth(rPwrConf.ratio * floor(p:GetHeight())) |
|
385 | Hoern-42580 | end |
|
386 | Hoern-42580 | else |
|
387 | Hoern-42580 | print("|cFF006699ristretto|r Power") |
|
388 | Hoern-42580 | print("by Hoern, Nesingwary <hoern@d8c.us>") |
|
389 | Hoern-42580 | print("Usage:") |
|
390 | Hoern-42580 | print("/rp scale x||dpstack||color (set||reset)") |
|
391 | Hoern-42580 | print("dpstack: turn deadly poison stacks on/off") |
|
392 | Hoern-42580 | print("scale 0-5: grow/shrink blips") |
|
393 | Hoern-42580 | print("color set: pick a color, any color") |
|
394 | Hoern-42580 | print("color reset: ugh, that pink is hideous") |
|
395 | Hoern-42580 | end |
|
396 | Hoern-42580 | end |