nPlates 2.0

nPlates 2.0

147k Downloads

buff spacing

rakkarage opened this issue ยท 3 comments

commented

2017-04-11

EDIT: actually I guess this does cause same error sorry argh

but now that friendly not being modified the self buffs are wonky again... spaced so far away from bar
that part is changeable, i made a small addon to remove that space
it just changes baseYOffset and does not taint
perhaps you could add something similar?
edit: and maybe adjust or add option for z/layer/strata of player bar too if possible? i guess not
thanks!

-- http://www.mmo-champion.com/threads/2003404-Question-about-the-Legion-center-screen-HP-resource-bar

-- small name font
local frame = CreateFrame("FRAME", "RagePlateFrame");
frame:RegisterEvent("PLAYER_ENTERING_WORLD");
local function eventHandler(self, event, ...)
 DefaultCompactNamePlateFrameSetUpOptions.useLargeNameFont = false;
end
frame:SetScript("OnEvent", eventHandler);

-- position buffs & debuffs
local function fn(...)
	for _,v in pairs(C_NamePlate.GetNamePlates()) do
		local bf = v.UnitFrame.BuffFrame;
		bf.baseYOffset = 0;
		bf:UpdateAnchor();
	end
	-- for _,v in pairs(C_NamePlate.GetNamePlateForUnit("target")) do
	-- 	local df = v.TargetFrame.BuffFrame;
	-- 	df.baseYOffset = 0;
	-- 	df:UpdateAnchor();
	-- end
end
NamePlateDriverFrame:HookScript("OnEvent", fn);

-- show debuffs
-- local gn = UnitAura;
-- local function fn(...)
-- 	local a = {gn(...)};
-- 	a[15] = a[6] ~= nil and abs(a[6] - 31) < 31;
-- 	return unpack(a);
-- end
-- UnitAura=fn;

--/run local b={196608,126896};local gn=UnitAura;local function fn(...)local a={gn(...)};a[15]=a[6]~=nil and not tContains(b,a[11])and abs(a[6]-31)<31;return unpack(a);end UnitAura=fn;


commented

When was it causing an error for you? I added

    -- Buff Frame Offsets

local function UpdateBuffFrame(...)
	for _,v in pairs(C_NamePlate.GetNamePlates()) do
		local bf = v.UnitFrame.BuffFrame;

        if ( v.UnitFrame.displayedUnit and UnitShouldDisplayName(v.UnitFrame.displayedUnit) ) then
            bf.baseYOffset = v.UnitFrame.name:GetHeight()+1;
        elseif ( v.UnitFrame.displayedUnit ) then
            bf.baseYOffset = 0;
        end

        bf:UpdateAnchor();
    end
end
NamePlateDriverFrame:HookScript("OnEvent", UpdateBuffFrame);

To the end my core.lua. And it seems to be working well so far but I haven't done any real group content with it like that.

commented

seems to work in new version but how did you do it without taint? idk. thanks
edit: works in garrison but sometimes seems to taint in raid will try to replicate without other addons eventually

commented

the taint comes from friendly plate in instance
the easiest way to test this is to go to your garrison because it counts as instance in this case
target a friendly npc in garrison and get a taint error dialog?
as far as I can tell... but I hope it does work :) it should
thanks