更新配置相关显示等
This commit is contained in:
@@ -8,6 +8,31 @@ local UPDATE_INTERVAL = 0.2
|
||||
local BASE_X = -209
|
||||
local BASE_Y = -26
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
-- Buff Blacklist: Turtle WoW internal/proc buffs that should not appear
|
||||
--------------------------------------------------------------------------------
|
||||
local HIDDEN_BUFF_NAMES = {
|
||||
["防御状态"] = true,
|
||||
}
|
||||
|
||||
function SFrames:GetBuffName(buffIndex)
|
||||
if not SFrames.Tooltip then return nil end
|
||||
SFrames.Tooltip:ClearLines()
|
||||
SFrames.Tooltip:SetPlayerBuff(buffIndex)
|
||||
local nameObj = SFramesScanTooltipTextLeft1
|
||||
return nameObj and nameObj:GetText()
|
||||
end
|
||||
|
||||
function SFrames:IsBuffHidden(buffIndex)
|
||||
local name = self:GetBuffName(buffIndex)
|
||||
if not name or name == "" then return false end
|
||||
if HIDDEN_BUFF_NAMES[name] then return true end
|
||||
if SFramesDB and type(SFramesDB.hiddenBuffs) == "table" and SFramesDB.hiddenBuffs[name] then
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local ROUND_BACKDROP = {
|
||||
bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
|
||||
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
|
||||
@@ -298,37 +323,39 @@ function MB:UpdateBuffs()
|
||||
for i = 0, 31 do
|
||||
local buffIndex, untilCancelled = GetPlayerBuff(i, "HELPFUL")
|
||||
if buffIndex and buffIndex >= 0 then
|
||||
slotIdx = slotIdx + 1
|
||||
if slotIdx > MAX_BUFFS then break end
|
||||
if not SFrames:IsBuffHidden(buffIndex) then
|
||||
slotIdx = slotIdx + 1
|
||||
if slotIdx > MAX_BUFFS then break end
|
||||
|
||||
local btn = self.buffSlots[slotIdx]
|
||||
local texture = GetPlayerBuffTexture(buffIndex)
|
||||
if texture then
|
||||
btn.icon:SetTexture(texture)
|
||||
btn.buffIndex = buffIndex
|
||||
btn._sfSimulated = false
|
||||
btn._isWeaponEnchant = false
|
||||
btn._weaponSlotID = nil
|
||||
local btn = self.buffSlots[slotIdx]
|
||||
local texture = GetPlayerBuffTexture(buffIndex)
|
||||
if texture then
|
||||
btn.icon:SetTexture(texture)
|
||||
btn.buffIndex = buffIndex
|
||||
btn._sfSimulated = false
|
||||
btn._isWeaponEnchant = false
|
||||
btn._weaponSlotID = nil
|
||||
|
||||
local apps = GetPlayerBuffApplications(buffIndex)
|
||||
if apps and apps > 1 then
|
||||
btn.count:SetText(apps)
|
||||
btn.count:Show()
|
||||
local apps = GetPlayerBuffApplications(buffIndex)
|
||||
if apps and apps > 1 then
|
||||
btn.count:SetText(apps)
|
||||
btn.count:Show()
|
||||
else
|
||||
btn.count:SetText("")
|
||||
btn.count:Hide()
|
||||
end
|
||||
|
||||
local timeLeft = GetPlayerBuffTimeLeft(buffIndex)
|
||||
SetTimerFromSeconds(btn, timeLeft, untilCancelled, showTimer)
|
||||
|
||||
btn:SetBackdropBorderColor(0.25, 0.25, 0.30, 1)
|
||||
btn:Show()
|
||||
else
|
||||
btn.count:SetText("")
|
||||
btn.count:Hide()
|
||||
btn:Hide()
|
||||
btn.buffIndex = -1
|
||||
btn._isWeaponEnchant = false
|
||||
btn._weaponSlotID = nil
|
||||
end
|
||||
|
||||
local timeLeft = GetPlayerBuffTimeLeft(buffIndex)
|
||||
SetTimerFromSeconds(btn, timeLeft, untilCancelled, showTimer)
|
||||
|
||||
btn:SetBackdropBorderColor(0.25, 0.25, 0.30, 1)
|
||||
btn:Show()
|
||||
else
|
||||
btn:Hide()
|
||||
btn.buffIndex = -1
|
||||
btn._isWeaponEnchant = false
|
||||
btn._weaponSlotID = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user