Go to Page... |
Thread Tools | Display Modes |
01-17-22, 01:09 PM | #1 |
Use section of LUA when setting larg Nameplates
Hey all.
I am using a LUA code i had made ages ago. The thing is when i do m+ i use small nameplates with things setup in one way. in PvP I use a different code and set the Use large nameplates in Interface - Names. i think this is tied to NamePlateVerticalScale so what i want is when i use the small nameplates i wish to use this code. Code:
-- Nameplate rezice local Frame = CreateFrame("Frame") Frame:RegisterEvent("PLAYER_LOGIN") Frame:SetScript("OnEvent", function(...) SetCVar("nameplateMaxDistance", 45) SetCVar("nameplateMaxScale", 1.0) SetCVar("nameplateMinScale", 0.9) SetCVar("nameplateLargerScale", 1.1) SetCVar("nameplateGlobalScale", 1.3) SetCVar("nameplateSelectedScale", 1.15) SetCVar("nameplateSelfTopInset",0.62) SetCVar("nameplateSelfBottomInset",0.32) SetCVar("nameplateOtherTopInset", 0.1) SetCVar("nameplateLargeTopInset", 0.1) SetCVar('UnitNameGuildTitle', 0) SetCVar('UnitNamePlayerPVPTitle', 0) SetCVar("nameplateOverlapV", 0.9) SetCVar("nameplateOverlapH", 1.4) SetCVar("NameplatePersonalShowAlways", 1) SetCVar("nameplateSelfScale", 1.2) end) -- Move nametag hooksecurefunc("DefaultCompactNamePlateFrameAnchorInternal",function(frame) frame.name:ClearAllPoints();-- Clear nametag anchors PixelUtil.SetPoint(frame.name,"BOTTOM",frame.healthBar,"TOP",0,2);-- Set new anchor end); -- Nametag font size local function SetFont(obj,optSize) local fontName=obj:GetFont(); obj:SetFont(fontName,optSize,"THINOUTLINE"); end SetFont(SystemFont_LargeNamePlate, 8) SetFont(SystemFont_NamePlate, 8) SetFont(SystemFont_LargeNamePlateFixed, 8) SetFont(SystemFont_NamePlateFixed, 8) -- move nameplates debuffs hooksecurefunc(NameplateBuffContainerMixin,"UpdateAnchor",function(self) local parent=self:GetParent(); local unit=parent.unit; if unit and ShouldShowName(parent) then -- Replicate the calculation of the original function local offset=self:GetBaseYOffset()+((unit and UnitIsUnit(unit,"target")) and self:GetTargetYOffset() or 0); self:SetPoint("BOTTOM",parent,"TOP",0,-20);-- Apply offset here end-- We'll leave the false side of this alone to preserve the original anchor in that case end); -- nameplate buff size hooksecurefunc(NameplateBuffContainerMixin,"OnLoad",function(self) self:SetScale(0.8);-- 1 is default size. end); -- Disable nametag colors DefaultCompactNamePlateFriendlyFrameOptions.colorNameBySelection = false DefaultCompactNamePlateEnemyFrameOptions.colorNameBySelection = false DefaultCompactNamePlatePlayerFrameOptions.colorNameBySelection = false -- no Realmname on nameplates hooksecurefunc("CompactUnitFrame_UpdateName", function(frame) if ShouldShowName(frame) then if frame.optionTable.colorNameBySelection then frame.name:SetText(GetUnitName(frame.unit)) end end end) Code:
-- Nameplate rezice local Frame = CreateFrame("Frame") Frame:RegisterEvent("PLAYER_LOGIN") Frame:SetScript("OnEvent", function(...) SetCVar("nameplateMaxDistance", 45) SetCVar("nameplateMaxScale", 1.0) SetCVar("nameplateMinScale", 0.9) SetCVar("nameplateLargerScale", 1.1) SetCVar("nameplateGlobalScale", 0.9) SetCVar("nameplateSelectedScale", 1.15) SetCVar("nameplateSelfTopInset",0.62) SetCVar("nameplateSelfBottomInset",0.32) SetCVar("nameplateOtherTopInset", 0.1) SetCVar("nameplateLargeTopInset", 0.1) SetCVar('UnitNameGuildTitle', 0) SetCVar('UnitNamePlayerPVPTitle', 0) SetCVar("nameplateOverlapV", 0.9) SetCVar("nameplateOverlapH", 1.4) SetCVar("NameplatePersonalShowAlways", 1) SetCVar("nameplateSelfScale", 1.2) end) -- Move nametag hooksecurefunc("DefaultCompactNamePlateFrameAnchorInternal",function(frame) frame.name:ClearAllPoints();-- Clear nametag anchors PixelUtil.SetPoint(frame.name,"BOTTOM",frame.healthBar,"TOP",0,2);-- Set new anchor end); -- Nametag font size local function SetFont(obj,optSize) local fontName=obj:GetFont(); obj:SetFont(fontName,optSize,"THINOUTLINE"); end SetFont(SystemFont_LargeNamePlate, 8) SetFont(SystemFont_NamePlate, 8) SetFont(SystemFont_LargeNamePlateFixed, 8) SetFont(SystemFont_NamePlateFixed, 8) -- move nameplates debuffs hooksecurefunc(NameplateBuffContainerMixin,"UpdateAnchor",function(self) local parent=self:GetParent(); local unit=parent.unit; if unit and ShouldShowName(parent) then -- Replicate the calculation of the original function local offset=self:GetBaseYOffset()+((unit and UnitIsUnit(unit,"target")) and self:GetTargetYOffset() or 0); self:SetPoint("BOTTOM",parent,"TOP",0,-11);-- Apply offset here end-- We'll leave the false side of this alone to preserve the original anchor in that case end); -- nameplate buff size hooksecurefunc(NameplateBuffContainerMixin,"OnLoad",function(self) self:SetScale(1.2);-- 1 is default size. end); -- Disable nametag colors DefaultCompactNamePlateFriendlyFrameOptions.colorNameBySelection = false DefaultCompactNamePlateEnemyFrameOptions.colorNameBySelection = false DefaultCompactNamePlatePlayerFrameOptions.colorNameBySelection = false -- no Realmname on nameplates hooksecurefunc("CompactUnitFrame_UpdateName", function(frame) if ShouldShowName(frame) then if frame.optionTable.colorNameBySelection then frame.name:SetText(GetUnitName(frame.unit)) end end end) /M |
|
02-13-22, 07:56 PM | #2 |
I'm curious about this as well. I have been using the script you posted here to move the nameplate auras, and I have issues in dungeon and raid instances. Friendly nameplates are not allowed to be modified in those instances, so I get too many addon errors when I do them.
Is there any way to modify the script to never touch friendly nameplates while in those protected instances? The first line is creating errors every time it tries to run. Lua Code:
|
|
02-13-22, 08:45 PM | #3 | |
Something like Lua Code:
|
||
02-13-22, 11:48 PM | #4 |
That does work for completely disabling the script in all instances, but I want something more specific. I'm trying to only disable it on friendly nameplates and only when friendly nameplates are inaccessible by addons (dungeons and raids, I think).
|
|
WoWInterface » Developer Discussions » Lua/XML Help » Use section of LUA when setting larg Nameplates |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|