mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-02 00:46:57 +00:00
Show the target LoS indicator through ClassicAPI's UnitInLineOfSight
The indicator moves from the unitxp module to the target frame, so it no longer needs UnitXP_SP3. Its checkbox and the shared font size move to a Target Indicators header; unitxp_font_size becomes indicator_font_size. The unused pfUI.api.UnitInLineOfSight wrapper, which shadowed the ClassicAPI global inside the pfUI environment, is removed.
This commit is contained in:
@@ -10,4 +10,27 @@ pfUI:RegisterModule("target", function ()
|
||||
pfUI.uf.target:UpdateFrameSize()
|
||||
pfUI.uf.target:SetPoint("BOTTOMLEFT", UIParent, "BOTTOM", 75, 125)
|
||||
UpdateMovable(pfUI.uf.target)
|
||||
|
||||
-- "NO LOS" in the bottom third of the frame, below unitxp's behind indicator
|
||||
if C.unitframes.los_indicator == "1" then
|
||||
local los = CreateFrame("Frame", "pfLoSIndicator", pfUI.uf.target)
|
||||
los:SetAllPoints(pfUI.uf.target)
|
||||
los:SetFrameLevel(pfUI.uf.target:GetFrameLevel() + 10)
|
||||
|
||||
los.text = los:CreateFontString(nil, "OVERLAY")
|
||||
los.text:SetFont(pfUI.font_default, tonumber(C.unitframes.indicator_font_size) or (C.global.font_size + 2), "OUTLINE")
|
||||
los.text:SetPoint("RIGHT", los, "RIGHT", -1, -pfUI.uf.target:GetHeight() / 3)
|
||||
los.text:SetTextColor(1, 0.3, 0.3, 1)
|
||||
los.text:SetText(T["NO LOS"])
|
||||
los.text:Hide()
|
||||
|
||||
local lastCheck = 0
|
||||
los:SetScript("OnUpdate", function()
|
||||
if GetTime() - lastCheck < 0.2 then return end
|
||||
lastCheck = GetTime()
|
||||
|
||||
-- nil without a target
|
||||
this.text:SetShown(UnitInLineOfSight("target") == false)
|
||||
end)
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user