ncClassPlates помогите найти на русский клиент такой аддон, ибо сделан он для АТ и на русском клиенте не показывает тотемы
ncClassPlates помогите найти на русский клиент такой аддон, ибо сделан он для АТ и на русском клиенте не показывает тотемы
Удали 3-105 строки, и вставь это
Скрытый текст
PHP код:
local totems = {
--Air Totems
8177, -- Grounding Totem
10595, -- Nature Resistance Totem I
10600, -- Nature Resistance Totem II
10601, -- Nature Resistance Totem III
25574, -- Nature Resistance Totem IV
58746, -- Nature Resistance Totem V
58749, -- Nature Resistance Totem VI
6495, -- Sentry Totem
8512, -- Windfury Totem
3738, -- Wrath of Air Totem
--Earth Totems
2062, -- Earth Elemental Totem
2484, -- Earthbind Totem
5730, -- Stoneclaw Totem I
6390, -- Stoneclaw Totem II
6391, -- Stoneclaw Totem III
6392, -- Stoneclaw Totem IV
10427, -- Stoneclaw Totem V
10428, -- Stoneclaw Totem VI
25525, -- Stoneclaw Totem VII
58580, -- Stoneclaw Totem VIII
58581, -- Stoneclaw Totem IX
58582, -- Stoneclaw Totem X
8071, -- Stoneskin Totem I -- Faction Champs
8154, -- Stoneskin Totem II
8155, -- Stoneskin Totem III
10406, -- Stoneskin Totem IV
10407, -- Stoneskin Totem V
10408, -- Stoneskin Totem VI
25508, -- Stoneskin Totem VII
25509, -- Stoneskin Totem VIII
58751, -- Stoneskin Totem IX
58753, -- Stoneskin Totem X
8075, -- Strength of Earth Totem I -- Faction Champs
8160, -- Strength of Earth Totem II
8161, -- Strength of Earth Totem III
10442, -- Strength of Earth Totem IV
25361, -- Strength of Earth Totem V
25528, -- Strength of Earth Totem VI
57622, -- Strength of Earth Totem VII
58643, -- Strength of Earth Totem VIII
8143, -- Tremor Totem
--Fire Totems
2894, -- Fire Elemental Totem
8227, -- Flametongue Totem I -- Faction Champs
8249, -- Flametongue Totem II
10526, -- Flametongue Totem III
16387, -- Flametongue Totem IV
25557, -- Flametongue Totem V
58649, -- Flametongue Totem VI
58652, -- Flametongue Totem VII
58656, -- Flametongue Totem VIII
8181, -- Frost Resistance Totem I
10478, -- Frost Resistance Totem II
10479, -- Frost Resistance Totem III
25560, -- Frost Resistance Totem IV
58741, -- Frost Resistance Totem V
58745, -- Frost Resistance Totem VI
8190, -- Magma Totem I
10585, -- Magma Totem II
10586, -- Magma Totem III
10587, -- Magma Totem IV
25552, -- Magma Totem V
58731, -- Magma Totem VI
58734, -- Magma Totem VII
3599, -- Searing Totem I -- Faction Champs
6363, -- Searing Totem II
6364, -- Searing Totem III
6365, -- Searing Totem IV
10437, -- Searing Totem V
10438, -- Searing Totem VI
25533, -- Searing Totem VII
58699, -- Searing Totem VIII
58703, -- Searing Totem IX
58704, -- Searing Totem X
30706, -- Totem of Wrath I
57720, -- Totem of Wrath II
57721, -- Totem of Wrath III
57722, -- Totem of Wrath IV
--Water Totems
8170, -- Cleansing Totem
8184, -- Fire Resistance Totem I
10537, -- Fire Resistance Totem II
10538, -- Fire Resistance Totem III
25563, -- Fire Resistance Totem IV
58737, -- Fire Resistance Totem V
58739, -- Fire Resistance Totem VI
5394, -- Healing Stream Totem I -- Faction Champs
6375, -- Healing Stream Totem II
6377, -- Healing Stream Totem III
10462, -- Healing Stream Totem IV
10463, -- Healing Stream Totem V
25567, -- Healing Stream Totem VI
58755, -- Healing Stream Totem VII
58756, -- Healing Stream Totem VIII
58757, -- Healing Stream Totem IX
5675, -- Mana Spring Totem I
10495, -- Mana Spring Totem II
10496, -- Mana Spring Totem III
10497, -- Mana Spring Totem IV
25570, -- Mana Spring Totem V
58771, -- Mana Spring Totem VI
58773, -- Mana Spring Totem VII
58774, -- Mana Spring Totem VIII
16190 -- Mana Tide Totem
}
do
local GetSpellInfo,tonumber = GetSpellInfo,tonumber
local tbl = {"", " II", " III", " IV", " V", " VI", " VII", " VIII", " IX", " X"}
for i = 1,#totems do
local name,rank,texture = GetSpellInfo(totems[i])
rank = tbl[tonumber(rank:match("%d+"))]
if rank then
totems[("%s%s"):format(name,rank)] = texture
else
totems[name] = texture
end
totems[i] = nil
end
end
[свернуть]
Не работает все равно братец
А ты чакру за гаражами с саньком трубочистом открывал?
- - - Updated - - -
Скрытый текст
PHP код:
local size, sizeupdate = 50
local totems = {
--Air Totems
8177, -- Grounding Totem
10595, -- Nature Resistance Totem I
10600, -- Nature Resistance Totem II
10601, -- Nature Resistance Totem III
25574, -- Nature Resistance Totem IV
58746, -- Nature Resistance Totem V
58749, -- Nature Resistance Totem VI
6495, -- Sentry Totem
8512, -- Windfury Totem
3738, -- Wrath of Air Totem
--Earth Totems
2062, -- Earth Elemental Totem
2484, -- Earthbind Totem
5730, -- Stoneclaw Totem I
6390, -- Stoneclaw Totem II
6391, -- Stoneclaw Totem III
6392, -- Stoneclaw Totem IV
10427, -- Stoneclaw Totem V
10428, -- Stoneclaw Totem VI
25525, -- Stoneclaw Totem VII
58580, -- Stoneclaw Totem VIII
58581, -- Stoneclaw Totem IX
58582, -- Stoneclaw Totem X
8071, -- Stoneskin Totem I -- Faction Champs
8154, -- Stoneskin Totem II
8155, -- Stoneskin Totem III
10406, -- Stoneskin Totem IV
10407, -- Stoneskin Totem V
10408, -- Stoneskin Totem VI
25508, -- Stoneskin Totem VII
25509, -- Stoneskin Totem VIII
58751, -- Stoneskin Totem IX
58753, -- Stoneskin Totem X
8075, -- Strength of Earth Totem I -- Faction Champs
8160, -- Strength of Earth Totem II
8161, -- Strength of Earth Totem III
10442, -- Strength of Earth Totem IV
25361, -- Strength of Earth Totem V
25528, -- Strength of Earth Totem VI
57622, -- Strength of Earth Totem VII
58643, -- Strength of Earth Totem VIII
8143, -- Tremor Totem
--Fire Totems
2894, -- Fire Elemental Totem
8227, -- Flametongue Totem I -- Faction Champs
8249, -- Flametongue Totem II
10526, -- Flametongue Totem III
16387, -- Flametongue Totem IV
25557, -- Flametongue Totem V
58649, -- Flametongue Totem VI
58652, -- Flametongue Totem VII
58656, -- Flametongue Totem VIII
8181, -- Frost Resistance Totem I
10478, -- Frost Resistance Totem II
10479, -- Frost Resistance Totem III
25560, -- Frost Resistance Totem IV
58741, -- Frost Resistance Totem V
58745, -- Frost Resistance Totem VI
8190, -- Magma Totem I
10585, -- Magma Totem II
10586, -- Magma Totem III
10587, -- Magma Totem IV
25552, -- Magma Totem V
58731, -- Magma Totem VI
58734, -- Magma Totem VII
3599, -- Searing Totem I -- Faction Champs
6363, -- Searing Totem II
6364, -- Searing Totem III
6365, -- Searing Totem IV
10437, -- Searing Totem V
10438, -- Searing Totem VI
25533, -- Searing Totem VII
58699, -- Searing Totem VIII
58703, -- Searing Totem IX
58704, -- Searing Totem X
30706, -- Totem of Wrath I
57720, -- Totem of Wrath II
57721, -- Totem of Wrath III
57722, -- Totem of Wrath IV
--Water Totems
8170, -- Cleansing Totem
8184, -- Fire Resistance Totem I
10537, -- Fire Resistance Totem II
10538, -- Fire Resistance Totem III
25563, -- Fire Resistance Totem IV
58737, -- Fire Resistance Totem V
58739, -- Fire Resistance Totem VI
5394, -- Healing Stream Totem I -- Faction Champs
6375, -- Healing Stream Totem II
6377, -- Healing Stream Totem III
10462, -- Healing Stream Totem IV
10463, -- Healing Stream Totem V
25567, -- Healing Stream Totem VI
58755, -- Healing Stream Totem VII
58756, -- Healing Stream Totem VIII
58757, -- Healing Stream Totem IX
5675, -- Mana Spring Totem I
10495, -- Mana Spring Totem II
10496, -- Mana Spring Totem III
10497, -- Mana Spring Totem IV
25570, -- Mana Spring Totem V
58771, -- Mana Spring Totem VI
58773, -- Mana Spring Totem VII
58774, -- Mana Spring Totem VIII
16190 -- Mana Tide Totem
}
do
local GetSpellInfo,tonumber = GetSpellInfo,tonumber
local tbl = {"", " II", " III", " IV", " V", " VI", " VII", " VIII", " IX", " X"}
for i = 1,#totems do
local name,rank,texture = GetSpellInfo(totems[i])
rank = tbl[tonumber(rank:match("%d+"))]
if rank then
totems[("%s%s"):format(name,rank)] = texture
else
totems[name] = texture
end
totems[i] = nil
end
end
local function getclass(r, g, b)
local r, g, b = floor(r*100+.5)/100, floor(g*100+.5)/100, floor(b*100+.5)/100
for class, color in pairs(RAID_CLASS_COLORS) do
if RAID_CLASS_COLORS[class].r == r and RAID_CLASS_COLORS[class].g == g and RAID_CLASS_COLORS[class].b == b then
print(class)
return class
end
end
end
local function classicontexcoord(class)
if class then
local texcoord = CLASS_BUTTONS[class]
if texcoord then
return unpack(texcoord)
end
end
return 0.5, 0.75, 0.5, 0.75
end
local function isvalid(frame)
if frame:GetName() then
return false
end
local overlayregion = select(2, frame:GetRegions())
return overlayregion and overlayregion:GetObjectType() == "Texture" and overlayregion:GetTexture() == "Interface\\Tooltips\\Nameplate-Border"
end
local function minmax(frame, _, maxval)
frame:GetParent().max = maxval
end
local function update(frame)
local name = frame.nametext:GetText()
if totems[name] then
if not frame.totem then
frame.icon:SetSize(size/2, size/2)
frame.icon:SetTexCoord(0, 1, 0, 1)
frame.dmgicon:Hide()
frame.totem = true
end
if frame.name ~= name then
frame.icon:SetTexture(totems[name])
frame.name = name
end
else
if frame.totem then
frame.icon:SetSize(size, size)
frame.icon:SetTexture([[Interface\WorldStateFrame\ICONS-CLASSES]])
frame.dmgicon:Show()
frame.totem = nil
end
local r, g, b = frame.healthbar:GetStatusBarColor()
if not (frame.r == r and frame.g == g and frame.b == b) then
frame.tl, frame.tr, frame.tt, frame.tb = classicontexcoord(getclass(r, g, b))
end
local perc = frame.healthbar:GetValue() / frame.max
frame.icon:SetHeight(perc * size)
frame.dmgicon:SetHeight((1 - perc) * size)
frame.icon:SetTexCoord(frame.tl, frame.tr, frame.tt + .25 * (1 - perc), frame.tb)
frame.dmgicon:SetTexCoord(frame.tl, frame.tr, frame.tt, frame.tb - .25 * perc)
frame.name = name
end
frame.leveltext:Hide()
frame.mobicon:Hide()
frame.bossicon:Hide()
frame:SetAlpha(1)
end
local function setupplate(frame)
local healthbar, castbar = frame:GetChildren()
local threatglow, healthborder, castborder, castuninterruptible, spellicon, highlighttexture, nametext, leveltext, bossicon, raidicon, mobicon = frame:GetRegions()
local icon = frame:CreateTexture(nil, "OVERLAY")
icon:SetPoint("BOTTOM", healthbar, "TOP", 10, 15)
icon:SetWidth(size)
icon:SetHeight(size)
icon:SetTexture([[Interface\WorldStateFrame\ICONS-CLASSES]])
local dmgicon = frame:CreateTexture(nil, "ARTWORK")
dmgicon:SetPoint("BOTTOM", icon, "TOP")
dmgicon:SetWidth(size)
dmgicon:SetHeight(size)
dmgicon:SetTexture([[Interface\AddOns\ncClassPlates\ICONS-CLASSES-GREY]])
dmgicon:SetVertexColor(.75, 0, 0)
healthbar:Hide()
castbar:Hide()
threatglow:Hide()
healthborder:Hide()
castborder:Hide()
castuninterruptible:Hide()
spellicon:Hide()
nametext:Hide()
bossicon:Hide()
raidicon:Hide()
mobicon:Hide()
threatglow:SetTexture(nil)
castuninterruptible:SetTexture(nil)
castborder:SetTexture(nil)
mobicon:SetTexture(nil)
bossicon:SetTexture(nil)
highlighttexture:SetTexture(nil)
frame.r, frame.g, frame.b, frame.tl, frame.tr, frame.tt, frame.tb = 0, 0, 0, 0, 0, 0, 0
frame.healthbar = healthbar
frame.leveltext = leveltext
frame.mobicon = mobicon
frame.bossicon = bossicon
frame.nametext = nametext
frame.icon = icon
frame.dmgicon = dmgicon
frame.name = ""
frame.max = select(2, frame.healthbar:GetMinMaxValues())
frame.done = true
frame.healthbar:SetScript("OnMinMaxChanged", minmax)
frame:SetScript("OnShow", update)
frame:SetScript("OnUpdate", update)
end
local holder = CreateFrame("Frame")
local nextupdate = .1
local function updatesize()
for i = 1, select("#", WorldFrame:GetChildren()) do
local frame = select(i, WorldFrame:GetChildren())
if isvalid(frame) and frame.icon then
if frame.totem then
frame.icon:SetSize(size/2, size/2)
else
frame.icon:SetSize(size, size)
frame.dmgicon:SetWidth(size)
end
end
end
end
holder:SetScript("OnUpdate", function(self, elapsed)
nextupdate = nextupdate + elapsed
if nextupdate > .1 then
for i = 1, select("#", WorldFrame:GetChildren()) do
local frame = select(i, WorldFrame:GetChildren())
if not frame.done and isvalid(frame) then
setupplate(frame)
update(frame)
end
end
end
end)
holder:SetScript("OnEvent", function(holder, event, addon)
if addon == "ncClassPlates" and event=="ADDON_LOADED" then
size = ncClassPlatesSize or 50
updatesize()
elseif event=="PLAYER_ENTERING_WORLD" then
SetCVar("ShowVKeyCastbar", 0)
SetCVar("nameplateAllowOverlap", 1)
SetCVar("ShowClassColorInNameplate", 1)
SetCVar("nameplateShowEnemies", 1)
SetCVar("nameplateShowEnemyGuardians", 0)
SetCVar("nameplateShowEnemyPets", 0)
SetCVar("nameplateShowEnemyTotems", 1)
SetCVar("nameplateShowFriendlyGuardians", 0)
SetCVar("nameplateShowFriendlyPets", 0)
SetCVar("nameplateShowFriendlyTotems", 0)
SetCVar("nameplateShowFriends", 0)
end
end)
holder:RegisterEvent("ADDON_LOADED")
holder:RegisterEvent("PLAYER_ENTERING_WORLD")
SLASH_NCCLASSPLATES1 = "/nccp"
SlashCmdList["NCCLASSPLATES"] = function(px)
px = tonumber(px)
if not px then return end
ncClassPlatesSize = px
size = px
updatesize()
end
[свернуть]
все работает , только когdа ты виdишь уже вражеску цель, аddон начинает спамить бесконечно кого он нашел, например в dуэли с рогой он спамил его класс в чат
Это я для дебага добавил, забыл потереть, 132 строчка- - - Updated - - -PHP код:
print(class)
Скрытый текст
PHP код:
local size, sizeupdate = 50
local totems = {
--Air Totems
8177, -- Grounding Totem
10595, -- Nature Resistance Totem I
10600, -- Nature Resistance Totem II
10601, -- Nature Resistance Totem III
25574, -- Nature Resistance Totem IV
58746, -- Nature Resistance Totem V
58749, -- Nature Resistance Totem VI
6495, -- Sentry Totem
8512, -- Windfury Totem
3738, -- Wrath of Air Totem
--Earth Totems
2062, -- Earth Elemental Totem
2484, -- Earthbind Totem
5730, -- Stoneclaw Totem I
6390, -- Stoneclaw Totem II
6391, -- Stoneclaw Totem III
6392, -- Stoneclaw Totem IV
10427, -- Stoneclaw Totem V
10428, -- Stoneclaw Totem VI
25525, -- Stoneclaw Totem VII
58580, -- Stoneclaw Totem VIII
58581, -- Stoneclaw Totem IX
58582, -- Stoneclaw Totem X
8071, -- Stoneskin Totem I -- Faction Champs
8154, -- Stoneskin Totem II
8155, -- Stoneskin Totem III
10406, -- Stoneskin Totem IV
10407, -- Stoneskin Totem V
10408, -- Stoneskin Totem VI
25508, -- Stoneskin Totem VII
25509, -- Stoneskin Totem VIII
58751, -- Stoneskin Totem IX
58753, -- Stoneskin Totem X
8075, -- Strength of Earth Totem I -- Faction Champs
8160, -- Strength of Earth Totem II
8161, -- Strength of Earth Totem III
10442, -- Strength of Earth Totem IV
25361, -- Strength of Earth Totem V
25528, -- Strength of Earth Totem VI
57622, -- Strength of Earth Totem VII
58643, -- Strength of Earth Totem VIII
8143, -- Tremor Totem
--Fire Totems
2894, -- Fire Elemental Totem
8227, -- Flametongue Totem I -- Faction Champs
8249, -- Flametongue Totem II
10526, -- Flametongue Totem III
16387, -- Flametongue Totem IV
25557, -- Flametongue Totem V
58649, -- Flametongue Totem VI
58652, -- Flametongue Totem VII
58656, -- Flametongue Totem VIII
8181, -- Frost Resistance Totem I
10478, -- Frost Resistance Totem II
10479, -- Frost Resistance Totem III
25560, -- Frost Resistance Totem IV
58741, -- Frost Resistance Totem V
58745, -- Frost Resistance Totem VI
8190, -- Magma Totem I
10585, -- Magma Totem II
10586, -- Magma Totem III
10587, -- Magma Totem IV
25552, -- Magma Totem V
58731, -- Magma Totem VI
58734, -- Magma Totem VII
3599, -- Searing Totem I -- Faction Champs
6363, -- Searing Totem II
6364, -- Searing Totem III
6365, -- Searing Totem IV
10437, -- Searing Totem V
10438, -- Searing Totem VI
25533, -- Searing Totem VII
58699, -- Searing Totem VIII
58703, -- Searing Totem IX
58704, -- Searing Totem X
30706, -- Totem of Wrath I
57720, -- Totem of Wrath II
57721, -- Totem of Wrath III
57722, -- Totem of Wrath IV
--Water Totems
8170, -- Cleansing Totem
8184, -- Fire Resistance Totem I
10537, -- Fire Resistance Totem II
10538, -- Fire Resistance Totem III
25563, -- Fire Resistance Totem IV
58737, -- Fire Resistance Totem V
58739, -- Fire Resistance Totem VI
5394, -- Healing Stream Totem I -- Faction Champs
6375, -- Healing Stream Totem II
6377, -- Healing Stream Totem III
10462, -- Healing Stream Totem IV
10463, -- Healing Stream Totem V
25567, -- Healing Stream Totem VI
58755, -- Healing Stream Totem VII
58756, -- Healing Stream Totem VIII
58757, -- Healing Stream Totem IX
5675, -- Mana Spring Totem I
10495, -- Mana Spring Totem II
10496, -- Mana Spring Totem III
10497, -- Mana Spring Totem IV
25570, -- Mana Spring Totem V
58771, -- Mana Spring Totem VI
58773, -- Mana Spring Totem VII
58774, -- Mana Spring Totem VIII
16190 -- Mana Tide Totem
}
do
local GetSpellInfo,tonumber = GetSpellInfo,tonumber
local tbl = {"", " II", " III", " IV", " V", " VI", " VII", " VIII", " IX", " X"}
for i = 1,#totems do
local name,rank,texture = GetSpellInfo(totems[i])
rank = tbl[tonumber(rank:match("%d+"))]
if rank then
totems[("%s%s"):format(name,rank)] = texture
else
totems[name] = texture
end
totems[i] = nil
end
end
local function getclass(r, g, b)
local r, g, b = floor(r*100+.5)/100, floor(g*100+.5)/100, floor(b*100+.5)/100
for class, color in pairs(RAID_CLASS_COLORS) do
if RAID_CLASS_COLORS[class].r == r and RAID_CLASS_COLORS[class].g == g and RAID_CLASS_COLORS[class].b == b then
return class
end
end
end
local function classicontexcoord(class)
if class then
local texcoord = CLASS_BUTTONS[class]
if texcoord then
return unpack(texcoord)
end
end
return 0.5, 0.75, 0.5, 0.75
end
local function isvalid(frame)
if frame:GetName() then
return false
end
local overlayregion = select(2, frame:GetRegions())
return overlayregion and overlayregion:GetObjectType() == "Texture" and overlayregion:GetTexture() == "Interface\\Tooltips\\Nameplate-Border"
end
local function minmax(frame, _, maxval)
frame:GetParent().max = maxval
end
local function update(frame)
local name = frame.nametext:GetText()
if totems[name] then
if not frame.totem then
frame.icon:SetSize(size/2, size/2)
frame.icon:SetTexCoord(0, 1, 0, 1)
frame.dmgicon:Hide()
frame.totem = true
end
if frame.name ~= name then
frame.icon:SetTexture(totems[name])
frame.name = name
end
else
if frame.totem then
frame.icon:SetSize(size, size)
frame.icon:SetTexture([[Interface\WorldStateFrame\ICONS-CLASSES]])
frame.dmgicon:Show()
frame.totem = nil
end
local r, g, b = frame.healthbar:GetStatusBarColor()
if not (frame.r == r and frame.g == g and frame.b == b) then
frame.tl, frame.tr, frame.tt, frame.tb = classicontexcoord(getclass(r, g, b))
end
local perc = frame.healthbar:GetValue() / frame.max
frame.icon:SetHeight(perc * size)
frame.dmgicon:SetHeight((1 - perc) * size)
frame.icon:SetTexCoord(frame.tl, frame.tr, frame.tt + .25 * (1 - perc), frame.tb)
frame.dmgicon:SetTexCoord(frame.tl, frame.tr, frame.tt, frame.tb - .25 * perc)
frame.name = name
end
frame.leveltext:Hide()
frame.mobicon:Hide()
frame.bossicon:Hide()
frame:SetAlpha(1)
end
local function setupplate(frame)
local healthbar, castbar = frame:GetChildren()
local threatglow, healthborder, castborder, castuninterruptible, spellicon, highlighttexture, nametext, leveltext, bossicon, raidicon, mobicon = frame:GetRegions()
local icon = frame:CreateTexture(nil, "OVERLAY")
icon:SetPoint("BOTTOM", healthbar, "TOP", 10, 15)
icon:SetWidth(size)
icon:SetHeight(size)
icon:SetTexture([[Interface\WorldStateFrame\ICONS-CLASSES]])
local dmgicon = frame:CreateTexture(nil, "ARTWORK")
dmgicon:SetPoint("BOTTOM", icon, "TOP")
dmgicon:SetWidth(size)
dmgicon:SetHeight(size)
dmgicon:SetTexture([[Interface\AddOns\ncClassPlates\ICONS-CLASSES-GREY]])
dmgicon:SetVertexColor(.75, 0, 0)
healthbar:Hide()
castbar:Hide()
threatglow:Hide()
healthborder:Hide()
castborder:Hide()
castuninterruptible:Hide()
spellicon:Hide()
nametext:Hide()
bossicon:Hide()
raidicon:Hide()
mobicon:Hide()
threatglow:SetTexture(nil)
castuninterruptible:SetTexture(nil)
castborder:SetTexture(nil)
mobicon:SetTexture(nil)
bossicon:SetTexture(nil)
highlighttexture:SetTexture(nil)
frame.r, frame.g, frame.b, frame.tl, frame.tr, frame.tt, frame.tb = 0, 0, 0, 0, 0, 0, 0
frame.healthbar = healthbar
frame.leveltext = leveltext
frame.mobicon = mobicon
frame.bossicon = bossicon
frame.nametext = nametext
frame.icon = icon
frame.dmgicon = dmgicon
frame.name = ""
frame.max = select(2, frame.healthbar:GetMinMaxValues())
frame.done = true
frame.healthbar:SetScript("OnMinMaxChanged", minmax)
frame:SetScript("OnShow", update)
frame:SetScript("OnUpdate", update)
end
local holder = CreateFrame("Frame")
local nextupdate = .1
local function updatesize()
for i = 1, select("#", WorldFrame:GetChildren()) do
local frame = select(i, WorldFrame:GetChildren())
if isvalid(frame) and frame.icon then
if frame.totem then
frame.icon:SetSize(size/2, size/2)
else
frame.icon:SetSize(size, size)
frame.dmgicon:SetWidth(size)
end
end
end
end
holder:SetScript("OnUpdate", function(self, elapsed)
nextupdate = nextupdate + elapsed
if nextupdate > .1 then
for i = 1, select("#", WorldFrame:GetChildren()) do
local frame = select(i, WorldFrame:GetChildren())
if not frame.done and isvalid(frame) then
setupplate(frame)
update(frame)
end
end
end
end)
holder:SetScript("OnEvent", function(holder, event, addon)
if addon == "ncClassPlates" and event=="ADDON_LOADED" then
size = ncClassPlatesSize or 50
updatesize()
elseif event=="PLAYER_ENTERING_WORLD" then
SetCVar("ShowVKeyCastbar", 0)
SetCVar("nameplateAllowOverlap", 1)
SetCVar("ShowClassColorInNameplate", 1)
SetCVar("nameplateShowEnemies", 1)
SetCVar("nameplateShowEnemyGuardians", 0)
SetCVar("nameplateShowEnemyPets", 0)
SetCVar("nameplateShowEnemyTotems", 1)
SetCVar("nameplateShowFriendlyGuardians", 0)
SetCVar("nameplateShowFriendlyPets", 0)
SetCVar("nameplateShowFriendlyTotems", 0)
SetCVar("nameplateShowFriends", 0)
end
end)
holder:RegisterEvent("ADDON_LOADED")
[свернуть]