тут уже встроены иконки тотемов. но не очень тестировалось. и тотемы вроде не все, сами добавите нужные, у меня клиент ruRU.
PHP код:
do
local Highlight = 20 -- если подсветка при наведении курсора на неймплейтах не в размерe.
local w,num,select,y,u = WorldFrame,0,select
local totems = {
--'false' - неймплейт отображается как обычный.
--'true' - полностью скрывается.
--если указан путь к текстуре, то показывает только её.
["Earthbind Totem"] = false,--'Interface\\Icons\\spell_nature_strengthofearthtotem02',
["Elemental Resistance Totem"] = true, --'Interface\\Icons\\spell_fireresistancetotem_01'
["Nature Resistance Totem"] = true, --'Interface\\Icons\\spell_nature_saturesesistancetotem'
["Tremor Totem"] = 'Interface\\Icons\\spell_nature_tremortotem',
["Mana Tide Totem"] = 'Interface\\Icons\\spell_frost_summonwaterelemental',
["Grounding Totem"] = 'Interface\\Icons\\spell_nature_groundingtotem',
["Stoneskin Totem"] = 'Interface\\Icons\\spell_nature_stoneskintotem',
["Stoneclaw Totem"] = 'Interface\\Icons\\spell_nature_stoneclawtotem',
["Strength of Earth Totem"] = 'Interface\\Icons\\spell_nature_earthbindtotem',
["Earth Elemental Totem"] = 'Interface\\Icons\\spell_nature_earthelemental_totem',
["Fire Elemental Totem"] = 'Interface\\Icons\\spell_fire_elemental_totem',
["Totem of Tranquil Mind"] = 'Interface\\Icons\\spell_nature_brilliance',
["Spirit Link Totem"] = 'Interface\\Icons\\spell_shaman_spiritlink',
["Searing Totem"] = 'Interface\\Icons\\spell_fire_searingtotem',
["Magma Totem"] = 'Interface\\Icons\\spell_fire_selfdestruct',
["Flametongue Totem"] = 'Interface\\Icons\\spell_nature_guardianward',
["Totem of Wrath"] = 'Interface\\Icons\\spell_fire_totemofwrath',
["Healing Stream Totem"] = 'Interface\\Icons\\inv_spear_04',
["Mana Spring Totem"] = 'Interface\\Icons\\spell_nature_manaregentotem',
["Cleansing Totem"] = 'Interface\\Icons\\spell nature diseasecleansingtotem',
["Windfury Totem"] = 'Interface\\Icons\\spell_nature_windfury',
["Sentry Totem"] = 'Interface\\Icons\\spell_nature_removecurse',
["Wrath of Air Totem"] = 'Interface\\Icons\\spell_nature_slowingtotem',
}
local function show(f,g,k,l,n,o,s,h,i,t,a,b)
g:SetPoint("BOTTOMRIGHT",Highlight,0)
k:Hide() l:Hide() n:Hide() i:Hide()
s:SetMinMaxValues(o:GetMinMaxValues())
s:SetStatusBarColor(o:GetStatusBarColor())
s:SetValue(o:GetValue())
local name = h:GetText()
if name:lower():find('totem') then
name = name:gsub(" I",""):gsub(" V",""):gsub(" X",""):gsub("I",""):gsub("V",""):gsub("X","")
local q = totems[name]
if q then
if q ~= true then i:SetTexture(q) i:Show() end
g:SetAlpha(0)
for _,v in ipairs{s,h,t,a,b} do v:Hide() end
return
end
end
g:SetAlpha(1)
for _,v in ipairs{s,h,t,a,b} do v:Show() end
end
CreateFrame("frame"):SetScript("OnUpdate",function()
local n = w:GetNumChildren()
if num == n then return end
for i = num + 1, n do
local f = select(i, w:GetChildren())
if not f:GetName() then
local a,b,c,d,e,g,h,k,l,m,n = f:GetRegions()
if a and a.GetTexture and a:GetTexture() == "Interface\\TargetingFrame\\UI-TargetingFrame-Flash" then
local o,w = f:GetChildren()
o:Hide()
local x = CreateFrame("frame")
local x = CreateFrame("frame",nil,f)
x:SetPoint("TOP")
x:SetSize(f:GetSize())
if not y then _,_,_,y,u = o:GetPoint() end
local s = CreateFrame("StatusBar",nil,f)
s:SetPoint("BOTTOMLEFT",f,y,u)
s:SetPoint("TOPRIGHT",f,-y,-(f:GetHeight()-o:GetHeight()-u))
s:SetStatusBarTexture("Interface\\TargetingFrame\\UI-StatusBar")
o:SetScript("OnValueChanged",function(o,v) s:SetValue(v) end)
b:SetTexCoord(0,.5,0,1)
b:SetPoint("BOTTOMRIGHT",f,"BOTTOM")
local t = f:CreateTexture(nil,"ARTWORK")
t:SetPoint("TOPLEFT",f,"TOP")
t:SetPoint("BOTTOMRIGHT")
t:SetTexture("Interface\\Tooltips\\Nameplate-Border")
t:SetTexCoord(.5,0,0,1)
s:SetFrameLevel(f:GetFrameLevel()-1)
local i = f:CreateTexture(nil, "ARTWORK")
i:SetPoint("CENTER")
i:SetSize(20,20)
f:SetScript("OnShow",function(f) show(f,g,k,l,n,o,s,h,i,t,a,b) end)
show(f,g,k,l,n,o,s,h,i,t,a,b)
end
end
num = n
end
end)
end