vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | --------------- |
2 | -- Variables -- |
||
3 | --------------- |
||
4 | Perl_Player_Pet_Config = {}; |
||
5 | |||
6 | -- Default Saved Variables (also set in Perl_Player_Pet_GetVars) |
||
7 | local locked = 0; -- unlocked by default |
||
8 | local showxp = 0; -- xp bar is hidden by default |
||
9 | local scale = 1; -- default scale |
||
10 | local numpetbuffsshown = 16; -- buff row is 16 long |
||
11 | local numpetdebuffsshown = 16; -- debuff row is 16 long |
||
12 | local transparency = 1; -- transparency for frames |
||
13 | local bufflocation = 1; -- default buff location |
||
14 | local debufflocation = 2; -- default debuff location |
||
15 | local buffsize = 12; -- default buff size is 12 |
||
16 | local debuffsize = 12; -- default debuff size is 12 |
||
17 | local showportrait = 0; -- portrait is hidden by default |
||
18 | local threedportrait = 0; -- 3d portraits are off by default |
||
19 | |||
20 | -- Default Local Variables |
||
21 | local Initialized = nil; -- waiting to be initialized |
||
22 | |||
23 | |||
24 | ---------------------- |
||
25 | -- Loading Function -- |
||
26 | ---------------------- |
||
27 | function Perl_Player_Pet_OnLoad() |
||
28 | -- Events |
||
29 | this:RegisterEvent("ADDON_LOADED"); |
||
30 | this:RegisterEvent("PLAYER_ENTERING_WORLD"); |
||
31 | this:RegisterEvent("PLAYER_PET_CHANGED"); |
||
32 | this:RegisterEvent("UNIT_AURA"); |
||
33 | this:RegisterEvent("UNIT_DISPLAYPOWER"); |
||
34 | this:RegisterEvent("UNIT_FOCUS"); |
||
35 | this:RegisterEvent("UNIT_HAPPINESS"); |
||
36 | this:RegisterEvent("UNIT_HEALTH"); |
||
37 | this:RegisterEvent("UNIT_LEVEL"); |
||
38 | this:RegisterEvent("UNIT_MANA"); |
||
39 | this:RegisterEvent("UNIT_MAXFOCUS"); |
||
40 | this:RegisterEvent("UNIT_MAXHEALTH"); |
||
41 | this:RegisterEvent("UNIT_MAXMANA"); |
||
42 | this:RegisterEvent("UNIT_MODEL_CHANGED"); |
||
43 | this:RegisterEvent("UNIT_NAME_UPDATE"); |
||
44 | this:RegisterEvent("UNIT_PET"); |
||
45 | this:RegisterEvent("UNIT_PET_EXPERIENCE"); |
||
46 | this:RegisterEvent("UNIT_PORTRAIT_UPDATE"); |
||
47 | this:RegisterEvent("VARIABLES_LOADED"); |
||
48 | |||
49 | -- Button Click Overlays (in order of occurrence in XML) |
||
50 | Perl_Player_Pet_NameFrame_CastClickOverlay:SetFrameLevel(Perl_Player_Pet_NameFrame:GetFrameLevel() + 1); |
||
51 | Perl_Player_Pet_LevelFrame_CastClickOverlay:SetFrameLevel(Perl_Player_Pet_LevelFrame:GetFrameLevel() + 2); |
||
52 | Perl_Player_Pet_StatsFrame_CastClickOverlay:SetFrameLevel(Perl_Player_Pet_StatsFrame:GetFrameLevel() + 2); |
||
53 | Perl_Player_Pet_PortraitFrame_CastClickOverlay:SetFrameLevel(Perl_Player_Pet_PortraitFrame:GetFrameLevel() + 2); |
||
54 | |||
55 | if (DEFAULT_CHAT_FRAME) then |
||
56 | DEFAULT_CHAT_FRAME:AddMessage("|cffffff00Perl Classic: Player_Pet loaded successfully."); |
||
57 | end |
||
58 | end |
||
59 | |||
60 | |||
61 | ------------------- |
||
62 | -- Event Handler -- |
||
63 | ------------------- |
||
64 | function Perl_Player_Pet_OnEvent(event) |
||
65 | if (event == "UNIT_HEALTH" or event == "UNIT_MAXHEALTH") then |
||
66 | if (arg1 == "pet") then |
||
67 | Perl_Player_Pet_Update_Health(); -- Update health values |
||
68 | end |
||
69 | return; |
||
70 | elseif (event == "UNIT_FOCUS" or event == "UNIT_MANA" or event == "UNIT_MAXFOCUS" or event == "UNIT_MAXMANA") then |
||
71 | if (arg1 == "pet") then |
||
72 | Perl_Player_Pet_Update_Mana(); -- Update energy/mana/rage values |
||
73 | end |
||
74 | return; |
||
75 | elseif (event == "UNIT_HAPPINESS") then |
||
76 | Perl_Player_PetFrame_SetHappiness(); |
||
77 | return; |
||
78 | elseif (event == "UNIT_NAME_UPDATE") then |
||
79 | if (arg1 == "pet") then |
||
80 | Perl_Player_Pet_NameBarText:SetText(UnitName("pet")); -- Set name |
||
81 | end |
||
82 | return; |
||
83 | elseif (event == "UNIT_AURA") then |
||
84 | if (arg1 == "pet") then |
||
85 | Perl_Player_Pet_Buff_UpdateAll(); -- Update the buff/debuff list |
||
86 | end |
||
87 | return; |
||
88 | elseif (event == "UNIT_PET_EXPERIENCE") then |
||
89 | if (showxp == 1) then |
||
90 | Perl_Player_Pet_Update_Experience(); -- Set the experience bar info |
||
91 | end |
||
92 | return; |
||
93 | elseif (event == "UNIT_LEVEL") then |
||
94 | if (arg1 == "pet") then |
||
95 | Perl_Player_Pet_LevelBarText:SetText(UnitLevel("pet")); -- Set Level |
||
96 | end |
||
97 | return; |
||
98 | elseif (event == "UNIT_DISPLAYPOWER") then |
||
99 | if (arg1 == "pet") then |
||
100 | Perl_Player_Pet_Update_Mana_Bar(); -- What type of energy are we using now? |
||
101 | Perl_Player_Pet_Update_Mana(); -- Update the energy info immediately |
||
102 | end |
||
103 | return; |
||
104 | elseif (event == "PLAYER_PET_CHANGED") then |
||
105 | Perl_Player_Pet_Update_Once(); |
||
106 | return; |
||
107 | elseif (event == "UNIT_PET") then |
||
108 | if (arg1 == "player") then |
||
109 | Perl_Player_Pet_Update_Once(); |
||
110 | end |
||
111 | return; |
||
112 | elseif (event == "UNIT_PORTRAIT_UPDATE" or event == "UNIT_MODEL_CHANGED") then |
||
113 | if (arg1 == "pet") then |
||
114 | Perl_Player_Pet_Update_Portrait(); |
||
115 | end |
||
116 | return; |
||
117 | elseif (event == "VARIABLES_LOADED") or (event == "PLAYER_ENTERING_WORLD") then |
||
118 | Perl_Player_Pet_Initialize(); |
||
119 | Perl_Player_Pet_Set_Window_Layout(); -- Warlocks don't need the happiness frame |
||
120 | Perl_Player_Pet_Update_Once(); |
||
121 | return; |
||
122 | elseif (event == "ADDON_LOADED") then |
||
123 | if (arg1 == "Perl_Player_Pet") then |
||
124 | Perl_Player_Pet_myAddOns_Support(); |
||
125 | end |
||
126 | return; |
||
127 | else |
||
128 | return; |
||
129 | end |
||
130 | end |
||
131 | |||
132 | |||
133 | ------------------------------- |
||
134 | -- Loading Settings Function -- |
||
135 | ------------------------------- |
||
136 | function Perl_Player_Pet_Initialize() |
||
137 | -- Check if we loaded the mod already. |
||
138 | if (Initialized) then |
||
139 | Perl_Player_Pet_Set_Scale(); |
||
140 | return; |
||
141 | end |
||
142 | |||
143 | -- Check if a previous exists, if not, enable by default. |
||
144 | if (type(Perl_Player_Pet_Config[UnitName("player")]) == "table") then |
||
145 | Perl_Player_Pet_GetVars(); |
||
146 | else |
||
147 | Perl_Player_Pet_UpdateVars(); |
||
148 | end |
||
149 | |||
150 | -- Major config options. |
||
151 | Perl_Player_Pet_Initialize_Frame_Color(); |
||
152 | Perl_Player_Pet_Reset_Buffs(); -- Set correct buff sizes |
||
153 | |||
154 | -- Unregister the Blizzard frames via the 1.8 function |
||
155 | PetFrame:UnregisterAllEvents(); |
||
156 | |||
157 | Initialized = 1; |
||
158 | end |
||
159 | |||
160 | function Perl_Player_Pet_Initialize_Frame_Color() |
||
161 | Perl_Player_Pet_StatsFrame:SetBackdropColor(0, 0, 0, 1); |
||
162 | Perl_Player_Pet_StatsFrame:SetBackdropBorderColor(0.5, 0.5, 0.5, 1); |
||
163 | Perl_Player_Pet_LevelFrame:SetBackdropColor(0, 0, 0, 1); |
||
164 | Perl_Player_Pet_LevelFrame:SetBackdropBorderColor(0.5, 0.5, 0.5, 1); |
||
165 | Perl_Player_Pet_NameFrame:SetBackdropColor(0, 0, 0, 1); |
||
166 | Perl_Player_Pet_NameFrame:SetBackdropBorderColor(0.5, 0.5, 0.5, 1); |
||
167 | Perl_Player_Pet_BuffFrame:SetBackdropColor(0, 0, 0, 1); |
||
168 | Perl_Player_Pet_BuffFrame:SetBackdropBorderColor(0.5, 0.5, 0.5, 1); |
||
169 | Perl_Player_Pet_DebuffFrame:SetBackdropColor(0, 0, 0, 1); |
||
170 | Perl_Player_Pet_DebuffFrame:SetBackdropBorderColor(0.5, 0.5, 0.5, 1); |
||
171 | Perl_Player_Pet_PortraitFrame:SetBackdropColor(0, 0, 0, 1); |
||
172 | Perl_Player_Pet_PortraitFrame:SetBackdropBorderColor(0.5, 0.5, 0.5, 1); |
||
173 | |||
174 | Perl_Player_Pet_HealthBarText:SetTextColor(1, 1, 1, 1); |
||
175 | Perl_Player_Pet_ManaBarText:SetTextColor(1, 1, 1, 1); |
||
176 | end |
||
177 | |||
178 | |||
179 | ------------------------- |
||
180 | -- The Update Function -- |
||
181 | ------------------------- |
||
182 | function Perl_Player_Pet_Update_Once() |
||
183 | if (UnitExists("pet")) then |
||
184 | Perl_Player_Pet_NameBarText:SetText(UnitName("pet")); -- Set name |
||
185 | Perl_Player_Pet_LevelBarText:SetText(UnitLevel("pet")); -- Set Level |
||
186 | Perl_Player_Pet_Update_Portrait(); -- Set the pet's portrait |
||
187 | Perl_Player_Pet_Set_Scale(); -- Set the scale |
||
188 | Perl_Player_Pet_Set_Transparency(); -- Set transparency |
||
189 | Perl_Player_Pet_Update_Health(); -- Set health |
||
190 | Perl_Player_Pet_Update_Mana(); -- Set mana values |
||
191 | Perl_Player_Pet_Update_Mana_Bar(); -- Set the type of mana |
||
192 | Perl_Player_PetFrame_SetHappiness(); -- Set Happiness |
||
193 | Perl_Player_Pet_Buff_UpdateAll(); -- Set buff frame |
||
194 | Perl_Player_Pet_Frame:Show(); -- Display the pet frame |
||
195 | Perl_Player_Pet_ShowXP(); -- Are we showing the xp bar? |
||
196 | else |
||
197 | Perl_Player_Pet_Frame:Hide(); |
||
198 | end |
||
199 | end |
||
200 | |||
201 | function Perl_Player_Pet_Update_Health() |
||
202 | local pethealth = UnitHealth("pet"); |
||
203 | local pethealthmax = UnitHealthMax("pet"); |
||
204 | |||
205 | if (UnitIsDead("pet") or UnitIsGhost("pet")) then -- This prevents negative health |
||
206 | pethealth = 0; |
||
207 | end |
||
208 | |||
209 | Perl_Player_Pet_HealthBar:SetMinMaxValues(0, pethealthmax); |
||
210 | Perl_Player_Pet_HealthBar:SetValue(pethealth); |
||
211 | |||
212 | if (PCUF_COLORHEALTH == 1) then |
||
213 | local playerpethealthpercent = floor(pethealth/pethealthmax*100+0.5); |
||
214 | if ((playerpethealthpercent <= 100) and (playerpethealthpercent > 75)) then |
||
215 | Perl_Player_Pet_HealthBar:SetStatusBarColor(0, 0.8, 0); |
||
216 | Perl_Player_Pet_HealthBarBG:SetStatusBarColor(0, 0.8, 0, 0.25); |
||
217 | elseif ((playerpethealthpercent <= 75) and (playerpethealthpercent > 50)) then |
||
218 | Perl_Player_Pet_HealthBar:SetStatusBarColor(1, 1, 0); |
||
219 | Perl_Player_Pet_HealthBarBG:SetStatusBarColor(1, 1, 0, 0.25); |
||
220 | elseif ((playerpethealthpercent <= 50) and (playerpethealthpercent > 25)) then |
||
221 | Perl_Player_Pet_HealthBar:SetStatusBarColor(1, 0.5, 0); |
||
222 | Perl_Player_Pet_HealthBarBG:SetStatusBarColor(1, 0.5, 0, 0.25); |
||
223 | else |
||
224 | Perl_Player_Pet_HealthBar:SetStatusBarColor(1, 0, 0); |
||
225 | Perl_Player_Pet_HealthBarBG:SetStatusBarColor(1, 0, 0, 0.25); |
||
226 | end |
||
227 | else |
||
228 | Perl_Player_Pet_HealthBar:SetStatusBarColor(0, 0.8, 0); |
||
229 | Perl_Player_Pet_HealthBarBG:SetStatusBarColor(0, 0.8, 0, 0.25); |
||
230 | end |
||
231 | |||
232 | if (pethealthmax == 100) then |
||
233 | Perl_Player_Pet_HealthBarText:SetText(pethealth.."%"); |
||
234 | else |
||
235 | Perl_Player_Pet_HealthBarText:SetText(pethealth.."/"..pethealthmax); |
||
236 | end |
||
237 | end |
||
238 | |||
239 | function Perl_Player_Pet_Update_Mana() |
||
240 | local petmana = UnitMana("pet"); |
||
241 | local petmanamax = UnitManaMax("pet"); |
||
242 | |||
243 | if (UnitIsDead("pet") or UnitIsGhost("pet")) then -- This prevents negative mana |
||
244 | petmana = 0; |
||
245 | end |
||
246 | |||
247 | Perl_Player_Pet_ManaBar:SetMinMaxValues(0, petmanamax); |
||
248 | Perl_Player_Pet_ManaBar:SetValue(petmana); |
||
249 | |||
250 | if (UnitClass("player") == PERL_LOCALIZED_WARLOCK) then |
||
251 | Perl_Player_Pet_ManaBarText:SetText(petmana.."/"..petmanamax); |
||
252 | else |
||
253 | Perl_Player_Pet_ManaBarText:SetText(petmana); |
||
254 | end |
||
255 | end |
||
256 | |||
257 | function Perl_Player_Pet_Update_Mana_Bar() |
||
258 | local petpower = UnitPowerType("pet"); |
||
259 | -- Set mana bar color |
||
260 | if (petpower == 0) then |
||
261 | Perl_Player_Pet_ManaBar:SetStatusBarColor(0, 0, 1, 1); |
||
262 | Perl_Player_Pet_ManaBarBG:SetStatusBarColor(0, 0, 1, 0.25); |
||
263 | elseif (petpower == 2) then |
||
264 | Perl_Player_Pet_ManaBar:SetStatusBarColor(1, 0.5, 0, 1); |
||
265 | Perl_Player_Pet_ManaBarBG:SetStatusBarColor(1, 0.5, 0, 0.25); |
||
266 | end |
||
267 | end |
||
268 | |||
269 | function Perl_Player_PetFrame_SetHappiness() |
||
270 | local happiness, damagePercentage, loyaltyRate = GetPetHappiness(); |
||
271 | |||
272 | if (happiness == 1) then |
||
273 | Perl_Player_PetHappinessTexture:SetTexCoord(0.375, 0.5625, 0, 0.359375); |
||
274 | elseif (happiness == 2) then |
||
275 | Perl_Player_PetHappinessTexture:SetTexCoord(0.1875, 0.375, 0, 0.359375); |
||
276 | elseif (happiness == 3) then |
||
277 | Perl_Player_PetHappinessTexture:SetTexCoord(0, 0.1875, 0, 0.359375); |
||
278 | end |
||
279 | |||
280 | if (happiness ~= nil) then |
||
281 | Perl_Player_PetHappiness.tooltip = getglobal("PET_HAPPINESS"..happiness); |
||
282 | Perl_Player_PetHappiness.tooltipDamage = format(PET_DAMAGE_PERCENTAGE, damagePercentage); |
||
283 | if (loyaltyRate < 0) then |
||
284 | Perl_Player_PetHappiness.tooltipLoyalty = getglobal("LOSING_LOYALTY"); |
||
285 | elseif (loyaltyRate > 0) then |
||
286 | Perl_Player_PetHappiness.tooltipLoyalty = getglobal("GAINING_LOYALTY"); |
||
287 | else |
||
288 | Perl_Player_PetHappiness.tooltipLoyalty = nil; |
||
289 | end |
||
290 | end |
||
291 | end |
||
292 | |||
293 | function Perl_Player_Pet_ShowXP() |
||
294 | if (showxp == 0) then |
||
295 | Perl_Player_Pet_XPBar:Hide(); |
||
296 | Perl_Player_Pet_XPBarBG:Hide(); |
||
297 | Perl_Player_Pet_XPBarText:SetText(); |
||
298 | Perl_Player_Pet_StatsFrame:SetHeight(34); |
||
299 | Perl_Player_Pet_StatsFrame_CastClickOverlay:SetHeight(34); |
||
300 | else |
||
301 | Perl_Player_Pet_XPBar:Show(); |
||
302 | Perl_Player_Pet_XPBarBG:Show(); |
||
303 | Perl_Player_Pet_StatsFrame:SetHeight(47); |
||
304 | Perl_Player_Pet_StatsFrame_CastClickOverlay:SetHeight(47); |
||
305 | if (UnitLevel("pet") == UnitLevel("player")) then |
||
306 | Perl_Player_Pet_XPBar:Hide(); |
||
307 | Perl_Player_Pet_XPBarBG:Hide(); |
||
308 | Perl_Player_Pet_XPBarText:SetText(); |
||
309 | Perl_Player_Pet_StatsFrame:SetHeight(34); |
||
310 | Perl_Player_Pet_StatsFrame_CastClickOverlay:SetHeight(34); |
||
311 | else |
||
312 | Perl_Player_Pet_Update_Experience(); |
||
313 | end |
||
314 | end |
||
315 | end |
||
316 | |||
317 | function Perl_Player_Pet_Update_Experience() |
||
318 | -- XP Bar stuff |
||
319 | local playerpetxp, playerpetxpmax; |
||
320 | playerpetxp, playerpetxpmax = GetPetExperience(); |
||
321 | |||
322 | Perl_Player_Pet_XPBar:SetMinMaxValues(0, playerpetxpmax); |
||
323 | Perl_Player_Pet_XPBar:SetValue(playerpetxp); |
||
324 | |||
325 | -- Set xp text |
||
326 | local xptext = playerpetxp.."/"..playerpetxpmax; |
||
327 | |||
328 | Perl_Player_Pet_XPBar:SetStatusBarColor(0, 0.6, 0.6, 1); |
||
329 | Perl_Player_Pet_XPBarBG:SetStatusBarColor(0, 0.6, 0.6, 0.25); |
||
330 | Perl_Player_Pet_XPBarText:SetText(xptext); |
||
331 | end |
||
332 | |||
333 | function Perl_Player_Pet_Update_Portrait() |
||
334 | if (showportrait == 1) then |
||
335 | local level = Perl_Player_Pet_PortraitFrame:GetFrameLevel(); -- Get the frame level of the main portrait frame |
||
336 | Perl_Player_Pet_PortraitFrame:Show(); -- Show the main portrait frame |
||
337 | |||
338 | if (threedportrait == 0) then |
||
339 | SetPortraitTexture(Perl_Player_Pet_Portrait, "pet"); -- Load the correct 2d graphic |
||
340 | Perl_Player_Pet_PortraitFrame_PetModel:Hide(); -- Hide the 3d graphic |
||
341 | Perl_Player_Pet_Portrait:Show(); -- Show the 2d graphic |
||
342 | else |
||
343 | if UnitIsVisible("pet") then |
||
344 | Perl_Player_Pet_PortraitFrame_PetModel:SetUnit("pet"); -- Load the correct 3d graphic |
||
345 | Perl_Player_Pet_Portrait:Hide(); -- Hide the 2d graphic |
||
346 | Perl_Player_Pet_PortraitFrame_PetModel:Show(); -- Show the 3d graphic |
||
347 | Perl_Player_Pet_PortraitFrame_PetModel:SetCamera(0); |
||
348 | else |
||
349 | SetPortraitTexture(Perl_Player_Pet_Portrait, "pet"); -- Load the correct 2d graphic |
||
350 | Perl_Player_Pet_PortraitFrame_PetModel:Hide(); -- Hide the 3d graphic |
||
351 | Perl_Player_Pet_Portrait:Show(); -- Show the 2d graphic |
||
352 | end |
||
353 | end |
||
354 | |||
355 | else |
||
356 | Perl_Player_Pet_PortraitFrame:Hide(); -- Hide the frame and 2d/3d portion |
||
357 | end |
||
358 | end |
||
359 | |||
360 | function Perl_Player_Pet_Set_Window_Layout() |
||
361 | if (UnitClass("player") == PERL_LOCALIZED_WARLOCK) then |
||
362 | Perl_Player_Pet_LevelFrame:Hide(); |
||
363 | Perl_Player_Pet_StatsFrame:SetPoint("TOPLEFT", "Perl_Player_Pet_NameFrame", "BOTTOMLEFT", 0, 5); |
||
364 | Perl_Player_Pet_StatsFrame:SetWidth(165); |
||
365 | Perl_Player_Pet_HealthBar:SetWidth(153); |
||
366 | Perl_Player_Pet_HealthBarBG:SetWidth(153); |
||
367 | Perl_Player_Pet_ManaBar:SetWidth(153); |
||
368 | Perl_Player_Pet_ManaBarBG:SetWidth(153); |
||
369 | Perl_Player_Pet_XPBar:SetWidth(153); |
||
370 | Perl_Player_Pet_XPBarBG:SetWidth(153); |
||
371 | else |
||
372 | Perl_Player_Pet_LevelFrame:Show(); |
||
373 | Perl_Player_Pet_StatsFrame:SetPoint("TOPLEFT", "Perl_Player_Pet_NameFrame", "BOTTOMLEFT", 25, 5); |
||
374 | Perl_Player_Pet_StatsFrame:SetWidth(140); |
||
375 | Perl_Player_Pet_HealthBar:SetWidth(128); |
||
376 | Perl_Player_Pet_HealthBarBG:SetWidth(128); |
||
377 | Perl_Player_Pet_ManaBar:SetWidth(128); |
||
378 | Perl_Player_Pet_ManaBarBG:SetWidth(128); |
||
379 | Perl_Player_Pet_XPBar:SetWidth(128); |
||
380 | Perl_Player_Pet_XPBarBG:SetWidth(128); |
||
381 | end |
||
382 | end |
||
383 | |||
384 | |||
385 | -------------------------- |
||
386 | -- GUI Config Functions -- |
||
387 | -------------------------- |
||
388 | function Perl_Player_Pet_Set_Buffs(newbuffnumber) |
||
389 | if (newbuffnumber == nil) then |
||
390 | newbuffnumber = 16; |
||
391 | end |
||
392 | numpetbuffsshown = newbuffnumber; |
||
393 | Perl_Player_Pet_UpdateVars(); |
||
394 | Perl_Player_Pet_Reset_Buffs(); -- Reset the buff icons and set the size |
||
395 | Perl_Player_Pet_Buff_UpdateAll(); -- Repopulate the buff icons |
||
396 | end |
||
397 | |||
398 | function Perl_Player_Pet_Set_Debuffs(newdebuffnumber) |
||
399 | if (newdebuffnumber == nil) then |
||
400 | newdebuffnumber = 16; |
||
401 | end |
||
402 | numpetdebuffsshown = newdebuffnumber; |
||
403 | Perl_Player_Pet_UpdateVars(); |
||
404 | Perl_Player_Pet_Reset_Buffs(); -- Reset the buff icons and set the size |
||
405 | Perl_Player_Pet_Buff_UpdateAll(); -- Repopulate the buff icons |
||
406 | end |
||
407 | |||
408 | function Perl_Player_Pet_Set_Buff_Location(newvalue) |
||
409 | if (newvalue ~= nil) then |
||
410 | bufflocation = newvalue; |
||
411 | end |
||
412 | Perl_Player_Pet_UpdateVars(); |
||
413 | Perl_Player_Pet_Reset_Buffs(); -- Reset the buff icons and set the size |
||
414 | Perl_Player_Pet_Buff_UpdateAll(); -- Repopulate the buff icons |
||
415 | end |
||
416 | |||
417 | function Perl_Player_Pet_Set_Debuff_Location(newvalue) |
||
418 | if (newvalue ~= nil) then |
||
419 | debufflocation = newvalue; |
||
420 | end |
||
421 | Perl_Player_Pet_UpdateVars(); |
||
422 | Perl_Player_Pet_Reset_Buffs(); -- Reset the buff icons and set the size |
||
423 | Perl_Player_Pet_Buff_UpdateAll(); -- Repopulate the buff icons |
||
424 | end |
||
425 | |||
426 | function Perl_Player_Pet_Set_Buff_Size(newvalue) |
||
427 | if (newvalue ~= nil) then |
||
428 | buffsize = newvalue; |
||
429 | end |
||
430 | Perl_Player_Pet_UpdateVars(); |
||
431 | Perl_Player_Pet_Reset_Buffs(); -- Reset the buff icons and set the size |
||
432 | Perl_Player_Pet_Buff_UpdateAll(); -- Repopulate the buff icons |
||
433 | end |
||
434 | |||
435 | function Perl_Player_Pet_Set_Debuff_Size(newvalue) |
||
436 | if (newvalue ~= nil) then |
||
437 | debuffsize = newvalue; |
||
438 | end |
||
439 | Perl_Player_Pet_UpdateVars(); |
||
440 | Perl_Player_Pet_Reset_Buffs(); -- Reset the buff icons and set the size |
||
441 | Perl_Player_Pet_Buff_UpdateAll(); -- Repopulate the buff icons |
||
442 | end |
||
443 | |||
444 | function Perl_Player_Pet_Set_ShowXP(newvalue) |
||
445 | showxp = newvalue; |
||
446 | Perl_Player_Pet_UpdateVars(); |
||
447 | Perl_Player_Pet_ShowXP(); |
||
448 | end |
||
449 | |||
450 | function Perl_Player_Pet_Set_Lock(newvalue) |
||
451 | locked = newvalue; |
||
452 | Perl_Player_Pet_UpdateVars(); |
||
453 | end |
||
454 | |||
455 | function Perl_Player_Pet_Set_Portrait(newvalue) |
||
456 | showportrait = newvalue; |
||
457 | Perl_Player_Pet_UpdateVars(); |
||
458 | Perl_Player_Pet_Update_Portrait(); |
||
459 | end |
||
460 | |||
461 | function Perl_Player_Pet_Set_3D_Portrait(newvalue) |
||
462 | threedportrait = newvalue; |
||
463 | Perl_Player_Pet_UpdateVars(); |
||
464 | Perl_Player_Pet_Update_Portrait(); |
||
465 | end |
||
466 | |||
467 | function Perl_Player_Pet_Set_Scale(number) |
||
468 | local unsavedscale; |
||
469 | if (number ~= nil) then |
||
470 | scale = (number / 100); -- convert the user input to a wow acceptable value |
||
471 | end |
||
472 | unsavedscale = 1 - UIParent:GetEffectiveScale() + scale; -- run it through the scaling formula introduced in 1.9 |
||
473 | Perl_Player_Pet_Frame:SetScale(unsavedscale); |
||
474 | Perl_Player_Pet_UpdateVars(); |
||
475 | end |
||
476 | |||
477 | function Perl_Player_Pet_Set_Transparency(number) |
||
478 | if (number ~= nil) then |
||
479 | transparency = (number / 100); -- convert the user input to a wow acceptable value |
||
480 | end |
||
481 | Perl_Player_Pet_Frame:SetAlpha(transparency); |
||
482 | Perl_Player_Pet_UpdateVars(); |
||
483 | end |
||
484 | |||
485 | |||
486 | ------------------------------ |
||
487 | -- Saved Variable Functions -- |
||
488 | ------------------------------ |
||
489 | function Perl_Player_Pet_GetVars() |
||
490 | locked = Perl_Player_Pet_Config[UnitName("player")]["Locked"]; |
||
491 | showxp = Perl_Player_Pet_Config[UnitName("player")]["ShowXP"]; |
||
492 | scale = Perl_Player_Pet_Config[UnitName("player")]["Scale"]; |
||
493 | numpetbuffsshown = Perl_Player_Pet_Config[UnitName("player")]["Buffs"]; |
||
494 | numpetdebuffsshown = Perl_Player_Pet_Config[UnitName("player")]["Debuffs"]; |
||
495 | transparency = Perl_Player_Pet_Config[UnitName("player")]["Transparency"]; |
||
496 | bufflocation = Perl_Player_Pet_Config[UnitName("player")]["BuffLocation"]; |
||
497 | debufflocation = Perl_Player_Pet_Config[UnitName("player")]["DebuffLocation"]; |
||
498 | buffsize = Perl_Player_Pet_Config[UnitName("player")]["BuffSize"]; |
||
499 | debuffsize = Perl_Player_Pet_Config[UnitName("player")]["DebuffSize"]; |
||
500 | showportrait = Perl_Player_Pet_Config[UnitName("player")]["ShowPortrait"]; |
||
501 | threedportrait = Perl_Player_Pet_Config[UnitName("player")]["ThreeDPortrait"]; |
||
502 | |||
503 | if (locked == nil) then |
||
504 | locked = 0; |
||
505 | end |
||
506 | if (showxp == nil) then |
||
507 | showxp = 0; |
||
508 | end |
||
509 | if (scale == nil) then |
||
510 | scale = 1; |
||
511 | end |
||
512 | if (numpetbuffsshown == nil) then |
||
513 | numpetbuffsshown = 16; |
||
514 | end |
||
515 | if (numpetdebuffsshown == nil) then |
||
516 | numpetdebuffsshown = 16; |
||
517 | end |
||
518 | if (transparency == nil) then |
||
519 | transparency = 1; |
||
520 | end |
||
521 | if (bufflocation == nil) then |
||
522 | bufflocation = 1; |
||
523 | end |
||
524 | if (debufflocation == nil) then |
||
525 | debufflocation = 2; |
||
526 | end |
||
527 | if (buffsize == nil) then |
||
528 | buffsize = 12; |
||
529 | end |
||
530 | if (debuffsize == nil) then |
||
531 | debuffsize = 12; |
||
532 | end |
||
533 | if (showportrait == nil) then |
||
534 | showportrait = 0; |
||
535 | end |
||
536 | if (threedportrait == nil) then |
||
537 | threedportrait = 0; |
||
538 | end |
||
539 | |||
540 | local vars = { |
||
541 | ["locked"] = locked, |
||
542 | ["showxp"] = showxp, |
||
543 | ["scale"] = scale, |
||
544 | ["numpetbuffsshown"] = numpetbuffsshown, |
||
545 | ["numpetdebuffsshown"] = numpetdebuffsshown, |
||
546 | ["transparency"] = transparency, |
||
547 | ["bufflocation"] = bufflocation, |
||
548 | ["debufflocation"] = debufflocation, |
||
549 | ["buffsize"] = buffsize, |
||
550 | ["debuffsize"] = debuffsize, |
||
551 | ["showportrait"] = showportrait, |
||
552 | ["threedportrait"] = threedportrait, |
||
553 | } |
||
554 | return vars; |
||
555 | end |
||
556 | |||
557 | function Perl_Player_Pet_UpdateVars(vartable) |
||
558 | if (vartable ~= nil) then |
||
559 | -- Sanity checks in case you use a load from an old version |
||
560 | if (vartable["Global Settings"] ~= nil) then |
||
561 | if (vartable["Global Settings"]["Locked"] ~= nil) then |
||
562 | locked = vartable["Global Settings"]["Locked"]; |
||
563 | else |
||
564 | locked = nil; |
||
565 | end |
||
566 | if (vartable["Global Settings"]["ShowXP"] ~= nil) then |
||
567 | showxp = vartable["Global Settings"]["ShowXP"]; |
||
568 | else |
||
569 | showxp = nil; |
||
570 | end |
||
571 | if (vartable["Global Settings"]["Scale"] ~= nil) then |
||
572 | scale = vartable["Global Settings"]["Scale"]; |
||
573 | else |
||
574 | scale = nil; |
||
575 | end |
||
576 | if (vartable["Global Settings"]["Buffs"] ~= nil) then |
||
577 | numpetbuffsshown = vartable["Global Settings"]["Buffs"]; |
||
578 | else |
||
579 | numpetbuffsshown = nil; |
||
580 | end |
||
581 | if (vartable["Global Settings"]["Debuffs"] ~= nil) then |
||
582 | numpetdebuffsshown = vartable["Global Settings"]["Debuffs"]; |
||
583 | else |
||
584 | numpetdebuffsshown = nil; |
||
585 | end |
||
586 | if (vartable["Global Settings"]["Transparency"] ~= nil) then |
||
587 | transparency = vartable["Global Settings"]["Transparency"]; |
||
588 | else |
||
589 | transparency = nil; |
||
590 | end |
||
591 | if (vartable["Global Settings"]["BuffLocation"] ~= nil) then |
||
592 | bufflocation = vartable["Global Settings"]["BuffLocation"]; |
||
593 | else |
||
594 | bufflocation = nil; |
||
595 | end |
||
596 | if (vartable["Global Settings"]["DebuffLocation"] ~= nil) then |
||
597 | debufflocation = vartable["Global Settings"]["DebuffLocation"]; |
||
598 | else |
||
599 | debufflocation = nil; |
||
600 | end |
||
601 | if (vartable["Global Settings"]["BuffSize"] ~= nil) then |
||
602 | buffsize = vartable["Global Settings"]["BuffSize"]; |
||
603 | else |
||
604 | buffsize = nil; |
||
605 | end |
||
606 | if (vartable["Global Settings"]["DebuffSize"] ~= nil) then |
||
607 | debuffsize = vartable["Global Settings"]["DebuffSize"]; |
||
608 | else |
||
609 | debuffsize = nil; |
||
610 | end |
||
611 | if (vartable["Global Settings"]["ShowPortrait"] ~= nil) then |
||
612 | showportrait = vartable["Global Settings"]["ShowPortrait"]; |
||
613 | else |
||
614 | showportrait = nil; |
||
615 | end |
||
616 | if (vartable["Global Settings"]["ThreeDPortrait"] ~= nil) then |
||
617 | threedportrait = vartable["Global Settings"]["ThreeDPortrait"]; |
||
618 | else |
||
619 | threedportrait = nil; |
||
620 | end |
||
621 | end |
||
622 | |||
623 | -- Set the new values if any new values were found, same defaults as above |
||
624 | if (locked == nil) then |
||
625 | locked = 0; |
||
626 | end |
||
627 | if (showxp == nil) then |
||
628 | showxp = 0; |
||
629 | end |
||
630 | if (scale == nil) then |
||
631 | scale = 1; |
||
632 | end |
||
633 | if (numpetbuffsshown == nil) then |
||
634 | numpetbuffsshown = 16; |
||
635 | end |
||
636 | if (numpetdebuffsshown == nil) then |
||
637 | numpetdebuffsshown = 16; |
||
638 | end |
||
639 | if (transparency == nil) then |
||
640 | transparency = 1; |
||
641 | end |
||
642 | if (bufflocation == nil) then |
||
643 | bufflocation = 1; |
||
644 | end |
||
645 | if (debufflocation == nil) then |
||
646 | debufflocation = 2; |
||
647 | end |
||
648 | if (buffsize == nil) then |
||
649 | buffsize = 12; |
||
650 | end |
||
651 | if (debuffsize == nil) then |
||
652 | debuffsize = 12; |
||
653 | end |
||
654 | if (showportrait == nil) then |
||
655 | showportrait = 0; |
||
656 | end |
||
657 | if (threedportrait == nil) then |
||
658 | threedportrait = 0; |
||
659 | end |
||
660 | |||
661 | -- Call any code we need to activate them |
||
662 | Perl_Player_Pet_Reset_Buffs(); -- Reset the buff icons |
||
663 | Perl_Player_Pet_Buff_UpdateAll(); -- Repopulate the buff icons |
||
664 | Perl_Player_Pet_Update_Health(); -- Update the health in case progrssive health color was set |
||
665 | Perl_Player_Pet_Update_Portrait(); |
||
666 | Perl_Player_Pet_Set_Scale(); -- Set the scale |
||
667 | Perl_Player_Pet_Set_Transparency(); -- Set the transparency |
||
668 | end |
||
669 | |||
670 | Perl_Player_Pet_Config[UnitName("player")] = { |
||
671 | ["Locked"] = locked, |
||
672 | ["ShowXP"] = showxp, |
||
673 | ["Scale"] = scale, |
||
674 | ["Buffs"] = numpetbuffsshown, |
||
675 | ["Debuffs"] = numpetdebuffsshown, |
||
676 | ["Transparency"] = transparency, |
||
677 | ["BuffLocation"] = bufflocation, |
||
678 | ["DebuffLocation"] = debufflocation, |
||
679 | ["BuffSize"] = buffsize, |
||
680 | ["DebuffSize"] = debuffsize, |
||
681 | ["ShowPortrait"] = showportrait, |
||
682 | ["ThreeDPortrait"] = threedportrait, |
||
683 | }; |
||
684 | end |
||
685 | |||
686 | |||
687 | -------------------- |
||
688 | -- Buff Functions -- |
||
689 | -------------------- |
||
690 | function Perl_Player_Pet_Buff_UpdateAll() |
||
691 | if (UnitName("pet")) then |
||
692 | local buffmax = 0; |
||
693 | for buffnum=1,numpetbuffsshown do |
||
694 | local button = getglobal("Perl_Player_Pet_Buff"..buffnum); |
||
695 | local icon = getglobal(button:GetName().."Icon"); |
||
696 | local debuff = getglobal(button:GetName().."DebuffBorder"); |
||
697 | |||
698 | if (UnitBuff("pet", buffnum)) then |
||
699 | icon:SetTexture(UnitBuff("pet", buffnum)); |
||
700 | button.isdebuff = 0; |
||
701 | debuff:Hide(); |
||
702 | button:Show(); |
||
703 | buffmax = buffnum; |
||
704 | else |
||
705 | button:Hide(); |
||
706 | end |
||
707 | end |
||
708 | |||
709 | local debuffmax = 0; |
||
710 | local debuffCount, debuffTexture, debuffApplications; |
||
711 | for debuffnum=1,numpetdebuffsshown do |
||
712 | debuffTexture, debuffApplications = UnitDebuff("pet", debuffnum); |
||
713 | local button = getglobal("Perl_Player_Pet_Debuff"..debuffnum); |
||
714 | local icon = getglobal(button:GetName().."Icon"); |
||
715 | local debuff = getglobal(button:GetName().."DebuffBorder"); |
||
716 | |||
717 | if (UnitDebuff("pet", debuffnum)) then |
||
718 | icon:SetTexture(UnitDebuff("pet", debuffnum)); |
||
719 | button.isdebuff = 1; |
||
720 | debuff:Show(); |
||
721 | button:Show(); |
||
722 | debuffCount = getglobal("Perl_Player_Pet_Debuff"..debuffnum.."Count"); |
||
723 | if (debuffApplications > 1) then |
||
724 | debuffCount:SetText(debuffApplications); |
||
725 | debuffCount:Show(); |
||
726 | else |
||
727 | debuffCount:Hide(); |
||
728 | end |
||
729 | debuffmax = debuffnum; |
||
730 | else |
||
731 | button:Hide(); |
||
732 | end |
||
733 | end |
||
734 | |||
735 | if (buffmax == 0) then |
||
736 | Perl_Player_Pet_BuffFrame:Hide(); |
||
737 | else |
||
738 | Perl_Player_Pet_BuffFrame:Show(); |
||
739 | Perl_Player_Pet_BuffFrame:SetWidth(5 + buffmax * 17); |
||
740 | end |
||
741 | |||
742 | if (debuffmax == 0) then |
||
743 | Perl_Player_Pet_DebuffFrame:Hide(); |
||
744 | else |
||
745 | Perl_Player_Pet_DebuffFrame:Show(); |
||
746 | Perl_Player_Pet_DebuffFrame:SetWidth(5 + debuffmax * 17); |
||
747 | end |
||
748 | |||
749 | if (bufflocation == 1) then |
||
750 | Perl_Player_Pet_Buff1:SetPoint("TOPLEFT", "Perl_Player_Pet_StatsFrame", "TOPRIGHT", 0, -5); |
||
751 | elseif (bufflocation == 2) then |
||
752 | Perl_Player_Pet_Buff1:SetPoint("TOPLEFT", "Perl_Player_Pet_StatsFrame", "TOPRIGHT", 0, -20); |
||
753 | elseif (bufflocation == 3) then |
||
754 | if (UnitClass("player") == PERL_LOCALIZED_HUNTER) then |
||
755 | Perl_Player_Pet_Buff1:SetPoint("TOPLEFT", "Perl_Player_Pet_StatsFrame", "BOTTOMLEFT", -20, 0); |
||
756 | else |
||
757 | Perl_Player_Pet_Buff1:SetPoint("TOPLEFT", "Perl_Player_Pet_LevelFrame", "BOTTOMLEFT", 5, 0); |
||
758 | end |
||
759 | else |
||
760 | if (UnitClass("player") == PERL_LOCALIZED_HUNTER) then |
||
761 | Perl_Player_Pet_Buff1:SetPoint("TOPLEFT", "Perl_Player_Pet_StatsFrame", "BOTTOMLEFT", -20, -15); |
||
762 | else |
||
763 | Perl_Player_Pet_Buff1:SetPoint("TOPLEFT", "Perl_Player_Pet_LevelFrame", "BOTTOMLEFT", 5, -15); |
||
764 | end |
||
765 | end |
||
766 | |||
767 | if (debufflocation == 1) then |
||
768 | Perl_Player_Pet_Debuff1:SetPoint("TOPLEFT", "Perl_Player_Pet_StatsFrame", "TOPRIGHT", 0, -5); |
||
769 | elseif (debufflocation == 2) then |
||
770 | Perl_Player_Pet_Debuff1:SetPoint("TOPLEFT", "Perl_Player_Pet_StatsFrame", "TOPRIGHT", 0, -20); |
||
771 | elseif (debufflocation == 3) then |
||
772 | if (UnitClass("player") == PERL_LOCALIZED_HUNTER) then |
||
773 | Perl_Player_Pet_Debuff1:SetPoint("TOPLEFT", "Perl_Player_Pet_StatsFrame", "BOTTOMLEFT", -20, 0); |
||
774 | else |
||
775 | Perl_Player_Pet_Debuff1:SetPoint("TOPLEFT", "Perl_Player_Pet_LevelFrame", "BOTTOMLEFT", 5, 0); |
||
776 | end |
||
777 | else |
||
778 | if (UnitClass("player") == PERL_LOCALIZED_HUNTER) then |
||
779 | Perl_Player_Pet_Debuff1:SetPoint("TOPLEFT", "Perl_Player_Pet_StatsFrame", "BOTTOMLEFT", -20, 15); |
||
780 | else |
||
781 | Perl_Player_Pet_Debuff1:SetPoint("TOPLEFT", "Perl_Player_Pet_LevelFrame", "BOTTOMLEFT", 5, -15); |
||
782 | end |
||
783 | end |
||
784 | end |
||
785 | end |
||
786 | |||
787 | function Perl_Player_Pet_Reset_Buffs() |
||
788 | local button, debuff, icon; |
||
789 | for buffnum=1,16 do |
||
790 | button = getglobal("Perl_Player_Pet_Buff"..buffnum); |
||
791 | icon = getglobal(button:GetName().."Icon"); |
||
792 | debuff = getglobal(button:GetName().."DebuffBorder"); |
||
793 | button:SetHeight(buffsize); |
||
794 | button:SetWidth(buffsize); |
||
795 | icon:SetHeight(buffsize); |
||
796 | icon:SetWidth(buffsize); |
||
797 | debuff:SetHeight(buffsize); |
||
798 | debuff:SetWidth(buffsize); |
||
799 | button:Hide(); |
||
800 | |||
801 | button = getglobal("Perl_Player_Pet_Debuff"..buffnum); |
||
802 | icon = getglobal(button:GetName().."Icon"); |
||
803 | debuff = getglobal(button:GetName().."DebuffBorder"); |
||
804 | button:SetHeight(debuffsize); |
||
805 | button:SetWidth(debuffsize); |
||
806 | icon:SetHeight(debuffsize); |
||
807 | icon:SetWidth(debuffsize); |
||
808 | debuff:SetHeight(debuffsize); |
||
809 | debuff:SetWidth(debuffsize); |
||
810 | button:Hide(); |
||
811 | end |
||
812 | end |
||
813 | |||
814 | function Perl_Player_Pet_SetBuffTooltip() |
||
815 | local buffmapping = 0; |
||
816 | GameTooltip:SetOwner(this, "ANCHOR_BOTTOMRIGHT"); |
||
817 | if (this.isdebuff == 1) then |
||
818 | GameTooltip:SetUnitDebuff("pet", this:GetID()-buffmapping); |
||
819 | else |
||
820 | GameTooltip:SetUnitBuff("pet", this:GetID()); |
||
821 | end |
||
822 | end |
||
823 | |||
824 | |||
825 | -------------------- |
||
826 | -- Click Handlers -- |
||
827 | -------------------- |
||
828 | function Perl_Player_Pet_DropDown_OnLoad() |
||
829 | UIDropDownMenu_Initialize(this, Perl_Player_Pet_DropDown_Initialize, "MENU"); |
||
830 | end |
||
831 | |||
832 | function Perl_Player_Pet_DropDown_Initialize() |
||
833 | UnitPopup_ShowMenu(Perl_Player_Pet_DropDown, "PET", "pet"); |
||
834 | end |
||
835 | |||
836 | function Perl_Player_Pet_MouseClick(button) |
||
837 | if (CastPartyConfig and PCUF_CASTPARTYSUPPORT == 1) then |
||
838 | if (not string.find(GetMouseFocus():GetName(), "Name")) then |
||
839 | CastParty_OnClickByUnit(button, "pet"); |
||
840 | end |
||
841 | elseif (Genesis_data and PCUF_CASTPARTYSUPPORT == 1) then |
||
842 | if (not string.find(GetMouseFocus():GetName(), "Name")) then |
||
843 | Genesis_MouseHeal("pet", button); |
||
844 | end |
||
845 | else |
||
846 | if (SpellIsTargeting() and button == "RightButton") then |
||
847 | SpellStopTargeting(); |
||
848 | return; |
||
849 | end |
||
850 | |||
851 | if (button == "LeftButton") then |
||
852 | if (SpellIsTargeting()) then |
||
853 | SpellTargetUnit("pet"); |
||
854 | elseif (CursorHasItem()) then |
||
855 | DropItemOnUnit("pet"); |
||
856 | else |
||
857 | TargetUnit("pet"); |
||
858 | end |
||
859 | end |
||
860 | end |
||
861 | end |
||
862 | |||
863 | function Perl_Player_Pet_MouseDown(button) |
||
864 | if (button == "LeftButton" and locked == 0) then |
||
865 | Perl_Player_Pet_Frame:StartMoving(); |
||
866 | end |
||
867 | end |
||
868 | |||
869 | function Perl_Player_Pet_MouseUp(button) |
||
870 | if (button == "RightButton") then |
||
871 | if ((CastPartyConfig or Genesis_data) and PCUF_CASTPARTYSUPPORT == 1) then |
||
872 | if (not (IsAltKeyDown() or IsControlKeyDown() or IsShiftKeyDown()) and string.find(GetMouseFocus():GetName(), "Name")) then -- if alt, ctrl, or shift ARE NOT held AND we are clicking the name frame, show the menu |
||
873 | ToggleDropDownMenu(1, nil, Perl_Player_Pet_DropDown, "Perl_Player_Pet_NameFrame", 40, 0); |
||
874 | end |
||
875 | else |
||
876 | if (not (IsAltKeyDown() or IsControlKeyDown() or IsShiftKeyDown())) then -- if alt, ctrl, or shift ARE NOT held, show the menu |
||
877 | ToggleDropDownMenu(1, nil, Perl_Player_Pet_DropDown, "Perl_Player_Pet_NameFrame", 40, 0); |
||
878 | end |
||
879 | end |
||
880 | end |
||
881 | |||
882 | Perl_Player_Pet_Frame:StopMovingOrSizing(); |
||
883 | end |
||
884 | |||
885 | |||
886 | ---------------------- |
||
887 | -- myAddOns Support -- |
||
888 | ---------------------- |
||
889 | function Perl_Player_Pet_myAddOns_Support() |
||
890 | -- Register the addon in myAddOns |
||
891 | if(myAddOnsFrame_Register) then |
||
892 | local Perl_Player_Pet_myAddOns_Details = { |
||
893 | name = "Perl_Player_Pet", |
||
894 | version = "Version 0.58", |
||
895 | releaseDate = "April 15, 2006", |
||
896 | author = "Perl; Maintained by Global", |
||
897 | email = "global@g-ball.com", |
||
898 | website = "http://www.curse-gaming.com/mod.php?addid=2257", |
||
899 | category = MYADDONS_CATEGORY_OTHERS |
||
900 | }; |
||
901 | Perl_Player_Pet_myAddOns_Help = {}; |
||
902 | Perl_Player_Pet_myAddOns_Help[1] = "/perl"; |
||
903 | myAddOnsFrame_Register(Perl_Player_Pet_myAddOns_Details, Perl_Player_Pet_myAddOns_Help); |
||
904 | end |
||
905 | end |