View Single Post
12-27-11, 05:28 AM   #11
zoktar
A Cliff Giant
AddOn Compiler - Click to view compilations
Join Date: Dec 2006
Posts: 72
local class, primary, anim, healthtexture, manatexture -- you can then use these anywhere in the file, think of them like "global variables" only for the file itself
local healthtexture = cfg.healthtexture
local manatexture = cfg.manatexture
local f = CreateFrame("Frame")
f:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", function(f, event, ...)
_, class = UnitClass("player")
primary = GetPrimaryTalentTree(false, false)
if class == "DEATHKNIGHT" then
if primary == 1 then -- blood
healthtexture = 15
manatexture = 15
anim = {enable = true, animhealth = 7, animmana = 9, classcolored = false, powertypecolored = false, healthmultiplier = 0.5, manamultiplier = 1, healthdecreasealpha = true, manadecreasealpha = true}
elseif primary == 2 then --frost
healthtexture = 16
manatexture = 14
anim = {enable = true, animhealth = 11, animmana = 9, classcolored = false, powertypecolored = false, healthmultiplier = 1, manamultiplier = 1, healthdecreasealpha = true, manadecreasealpha = true}
else -- unholy
healthtexture = 18
manatexture = 14
anim = {enable = true, animhealth = 2, animmana = 9, classcolored = false, powertypecolored = false, healthmultiplier = 0.4, manamultiplier = 0.8, healthdecreasealpha = true, manadecreasealpha = true}
end
end
end)


-----------------------
produces no errors, but also doesnt do anything, even after a reload.
----------------------------
also
----------
local class, primary, anim -- you can then use these anywhere in the file, think of them like "global variables" only for the file itself
local f = CreateFrame("Frame")
f:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", function(f, event, ...)
_, class = UnitClass("player")
primary = GetPrimaryTalentTree(false, false)
if class == "DEATHKNIGHT" then
if primary == 1 then -- blood
anim = {enable = true, animhealth = 7, animmana = 9, classcolored = false, powertypecolored = false, healthmultiplier = 0.5, manamultiplier = 1, healthdecreasealpha = true, manadecreasealpha = true}
elseif primary == 2 then --frost
healthtexture = 16
manatexture = 14
anim = {enable = true, animhealth = 11, animmana = 9, classcolored = false, powertypecolored = false, healthmultiplier = 1, manamultiplier = 1, healthdecreasealpha = true, manadecreasealpha = true}
else -- unholy
anim = {enable = true, animhealth = 2, animmana = 9, classcolored = false, powertypecolored = false, healthmultiplier = 0.4, manamultiplier = 0.8, healthdecreasealpha = true, manadecreasealpha = true}
end
end
end)
--------------
produces no erros but doesnt do anything.
--------------
could i not simply call whatever updates the orbs normally?.
------------------------
the more i look at it the more i get the feeling i have to go edit the original code in
player.lua, but yeah donno.

Last edited by zoktar : 12-27-11 at 08:13 AM.
  Reply With Quote