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 |
|
WoWInterface » Developer Discussions » Lua/XML Help » Use section of LUA when setting larg Nameplates |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Switch to Linear Mode |
Switch to Hybrid Mode |
Threaded Mode |
|
|