4)
Код:
local z
do
local f = {PartyMemberFrame1,PartyMemberFrame2,PartyMemberFrame3,PartyMemberFrame4}
local function u(s)
local x,y = IsInInstance()
if x and y == "arena" then
for i = 1,GetNumPartyMembers() do
f[i]:Show()
end
else
for i = 1,GetNumPartyMembers() do
f[i]:Hide()
end
end
end
z = function(s)
if UnitInParty('player') then
if s.c == 1 then
s.x = 1
return
end
u()
s.x = nil
end
end
end
local f = CreateFrame'frame'
f:RegisterEvent'PARTY_MEMBERS_CHANGED'
f:RegisterEvent'PLAYER_ENTERING_WORLD'
f:RegisterEvent'PLAYER_REGEN_ENABLED'
f:RegisterEvent'PLAYER_REGEN_DISABLED'
f:SetScript('OnEvent',function(s,e)
if e == 'PLAYER_REGEN_DISABLED' then
s.c = 1
return
elseif e == 'PLAYER_REGEN_ENABLED' then
s.c = 0
if s.x then
z(s)
s.x = nil
end
return
end
z(s)
end)
Особо не тестил
- - - Updated - - -

Сообщение от
Сарыч
1) Решил сам . Кому надо такие индикаторы (30 000 (100%) :
Вложение 659848
Вот код :
Код:
GF=CreateFrame("Frame")GFHB=PlayerFrameHealthBar.TextString;TTSB=TextStatusBar_CapDisplayOfNumericValue
TF=CreateFrame("Frame")TFHB=TargetFrameHealthBar.TextString;TTSB=TextStatusBar_CapDisplayOfNumericValue
LF=CreateFrame("Frame")LFHB=FocusFrameHealthBar.TextString;TTSB=TextStatusBar_CapDisplayOfNumericValue
GF:SetScript("OnUpdate",function(player)GFHB:SetText(TTSB(UnitHealth("player")).." ") end)
LF:SetScript("OnUpdate",function(Focus)LFHB:SetText(TTSB(UnitHealth("Focus")).." ") end)
TF:SetScript("OnUpdate",function(target)TFHB:SetText(TTSB(UnitHealth("target")).." ("..format("%.0f",((UnitHealth("target")/UnitHealthMax("target"))*100)).."%)") end)
local CurrentValues = CreateFrame("Frame")
CurrentValues:SetScript("OnUpdate", function(self, e)
local PlayerMana = UnitMana("player")
local TargetMana = UnitMana("target")
local FocusMana = UnitMana("focus")
PlayerFrameManaBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(PlayerMana))
TargetFrameManaBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(TargetMana))
FocusFrameManaBar.TextString:SetText(TextStatusBar_CapDisplayOfNumericValue(FocusMana))
end)
И для тех кто не шарит в кодах, просто ссылка на аддон : http://rgho.st/7pwRBgqjY
Я б сделал так
Код:
hooksecurefunc("TextStatusBar_UpdateTextString",function(s)
local n = s:GetName()
if n == "TargetFrameHealthBar" or n == "PlayerFrameManaBar" or n == "TargetFrameManaBar" or n == "FocusFrameManaBar" then
local t,v = s.TextString,s:GetValue()
if v and v > 0 and t then
t:SetFormattedText("%u (%u%%)",v,v/select(2,s:GetMinMaxValues())*100)
end
end
end)