phase 2 removing tbc

Strip dead pfUI.client > 11200 and pfUI.expansion == "tbc" branches now
that vanilla is the only supported client.

- pfUI.lua: hardcode expansion = "vanilla"; collapse force_region matrix
- compat/vanilla.lua, libs/{libcast,libdebuff,libtotem,libunitscan,
  focus}: drop always-false early-returns
- api/unitframes.lua: delete TargetBuffOnUpdate poller + tbc visibility
  and secure-template branches; click-cast keeps only vanilla path
- api/ui-widgets.lua: unconditional EffectiveScale divide
- env/tables.lua: drop unused focus/focustarget pfValidUnits entries
- modules/actionbar.lua: simplify EnablePaging, drop ButtonSwitch/
  petvisibility, unwrap prowl block, single keybind-remap path
- modules/{castbar,chat,cooldown,loot,questitem,totems}: unwrap
  always-true conditionals
- modules/nameplates.lua: cfg-only fake-cooldown gate, unwrap overlap/
  clickthrough + mouselook blocks
- modules/friends.lua + skins/blizzard/friends.lua: maxtab = 4
- skins/blizzard/{help,game_menu,questlog}: drop tbc-only branches
This commit is contained in:
Brues
2026-05-25 18:40:17 -05:00
parent 58609b8c5c
commit ba566cdd53
23 changed files with 205 additions and 471 deletions
+45 -152
View File
@@ -13,8 +13,6 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
local updatecache = { } -- contains a list of buttons slots that shall be refreshed later -> [slot] = true
local buttoncache = { } -- contains a list of all buttons ever created -> [slot] = frame
local petvisibility = "[pet] show; hide"
-- try to assume based on the current mouse positions if a button drag
-- should happen even if action-on-key-down is used. By that replace the
-- cast events by reverting the active buttons to the old mouse-up state.
@@ -471,7 +469,7 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
castable, autocast, token = nil, nil, nil
-- set the own ID for compatibility to some vanilla addons
if pfUI.client <= 11200 then self:SetID(self.id) end
self:SetID(self.id)
grid = self.bar == 12 and showgrid_pet or showgrid
@@ -817,78 +815,25 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
bars:SetScript("OnUpdate", BarsUpdate)
-- enable bar paging via secure functions
local function ButtonSwitch(self, att, value)
if att == "state-parent" then
local action = SecureButton_GetModifiedAttribute(self, "action", SecureStateChild_GetEffectiveButton(self)) or self.id
if self.id == action then return end
updatecache[self.slot] = true
self.id = action
end
end
local function EnablePaging(bar)
if pfUI.client <= 11200 then
if not bar.pager then
bar.pager = CreateFrame("Frame")
bar.pager:RegisterEvent("PLAYER_ENTERING_WORLD")
bar.pager:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
bar.pager:RegisterEvent("ACTIONBAR_PAGE_CHANGED")
bar.pager:SetScript("OnEvent", function()
for i=1, 10 do -- reload pageable bars
local pageable = C.bars["bar"..i] and C.bars["bar"..i].pageable == "1" and true or nil
_G.VIEWABLE_ACTION_BAR_PAGES[i] = pageable
end
local active = GetActiveBar()
for i=1,12 do
local id = i + (active-1)*12
bar[i].id = id
updatecache[i] = true
end
end)
end
else
-- append paging enabled bars to the filter list
for i=1,12 do bar[i]:SetScript("OnAttributeChanged", ButtonSwitch) end
-- fill all possible page states
local page, pages = nil, {}
while not pages[6] do
for i=1, 6 do
page = i == 1 and 1 or C.bars["bar"..i] and C.bars["bar"..i].pageable == "1" and i
if page then table.insert(pages, page) end
if not bar.pager then
bar.pager = CreateFrame("Frame")
bar.pager:RegisterEvent("PLAYER_ENTERING_WORLD")
bar.pager:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
bar.pager:RegisterEvent("ACTIONBAR_PAGE_CHANGED")
bar.pager:SetScript("OnEvent", function()
for i=1, 10 do -- reload pageable bars
local pageable = C.bars["bar"..i] and C.bars["bar"..i].pageable == "1" and true or nil
_G.VIEWABLE_ACTION_BAR_PAGES[i] = pageable
end
end
bar:SetAttribute("statemap-page", "$input")
bar:SetAttribute("state", (bar:GetAttribute("state-page") or 1))
-- prio posses bar
bar.filter = "[bonusbar: 5] 11;"
-- set bar 8 for druid stealth if enabled
local prowl = class == "DRUID" and C.bars["druidstealth"] == "1" and "8" or "7"
-- write default pages
for state, page in pairs(pages) do
if page ~= 1 then -- skip page 1 as it is supposed to stay dynamic for stances
bar.filter = string.format("%s[actionbar: %s] %s; ", bar.filter, state, page)
local active = GetActiveBar()
for i=1,12 do
local id = i + (active-1)*12
bar[i].id = id
updatecache[i] = true
end
end
-- write page driver conditions
bar.filter = string.format("%s[bonusbar:1,nostealth] 7; [bonusbar:1,stealth] %s; [bonusbar:2] 10; [bonusbar:3] 9; [bonusbar:4] 10; 1", bar.filter, prowl)
-- prepend pagemaster states if enabled
if C.bars.pagemaster == "1" then
for mod, page in pairs({ ["shift"] = "6", ["ctrl"] = "5", ["alt"] = "3" }) do
bar.filter = string.format("[modifier:%s] %s;", mod, page) .. bar.filter
end
end
-- enable page driver conditions
RegisterStateDriver(bar, "page", bar.filter)
SecureStateHeader_Refresh(bar)
end)
end
end
@@ -917,7 +862,7 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
end
-- pagemaster / meta page switch
if pfUI.expansion == "vanilla" then
do
local prowl, shift, ctrl, alt, default = 8, 6, 5, 3, 1
-- set temporary pagemaster bindings keybinds
@@ -1287,40 +1232,26 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
if enable == "1" then
-- handle pet bar
if i == 12 then
if pfUI.client > 11200 then
if InCombatLockdown and InCombatLockdown() then
-- don't process those events during combat
else
-- set state driver for pet bars
bars[i]:SetAttribute("unit", "pet")
local visibility = pfUI.unlock and pfUI.unlock:IsShown() and "show" or petvisibility
if bars[i].visibility ~= visibility then
RegisterStateDriver(bars[i], 'visibility', visibility)
bars[i].visibility = visibility
end
end
-- only show when pet actions exists
if PetHasActionBar() or pfUI.unlock and pfUI.unlock:IsShown() then
bars[i]:Show()
else
-- only show when pet actions exists
if PetHasActionBar() or pfUI.unlock and pfUI.unlock:IsShown() then
bars[i]:Show()
else
bars[i]:Hide()
end
bars[i]:Hide()
end
-- show/hide petbar on petbar updates
if init then
bars[i]:RegisterEvent("PET_BAR_UPDATE")
bars[i]:SetScript("OnEvent", function()
-- hide obsolete buttons
for i=1, NUM_PET_ACTION_SLOTS do
if not PetHasActionBar() and bars[12][i] then
bars[12][i]:Hide()
end
end
-- refresh layout
CreateActionBar(12)
end)
end
-- show/hide petbar on petbar updates
if init then
bars[i]:RegisterEvent("PET_BAR_UPDATE")
bars[i]:SetScript("OnEvent", function()
-- hide obsolete buttons
for i=1, NUM_PET_ACTION_SLOTS do
if not PetHasActionBar() and bars[12][i] then
bars[12][i]:Hide()
end
end
-- refresh layout
CreateActionBar(12)
end)
end
-- handle shapeshift bar
@@ -1390,12 +1321,6 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
end
end
-- add up to 0-11 button parent states to each bar
if i <= 10 and pfUI.client > 11200 then
bars[i]:SetAttribute("statebutton", "0:S0;1:S1;2:S2;3:S3;4:S4;5:S5;6:S6;7:S7;8:S8;9:S9;10:S10;11:S11;")
bars[i]:SetAttribute("statebutton2", "0:S0Right;1:S1Right;2:S2Right;3:S3Right;4:S4Right;5:S5Right;6:S6Right;7:S7Right;8:S8Right;9:S9Right;10:S10Right;11:S11Right;")
end
-- enable paging for the first actionbar
if i == 1 then
EnablePaging(bars[i])
@@ -1565,48 +1490,16 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
end
-- Set keybinds to all actionbuttons
if pfUI.client <= 11200 then
-- In order to be able to reuse already defined keybinds, we need to remap
-- existing button functions to pfUI. We need to get rid of the blizzard calls
-- to avoid having them call texture changes and errors due to missing buttons
_G.ActionButtonDown = pfActionButton
_G.ActionButtonUp = pfActionButton
_G.BonusActionButtonDown = function(slot) pfActionButton(slot, nil, "BonusActionBar") end
_G.BonusActionButtonUp = function(slot) pfActionButton(slot, nil, "BonusActionBar") end
_G.MultiActionButtonDown = function(bar, slot, slf) pfActionButton(slot, slf, bar) end
_G.MultiActionButtonUp = function(bar, slot, slf) pfActionButton(slot, slf, bar) end
_G.ShapeshiftBar_ChangeForm = function(slot) pfActionButton(slot, nil, "ShapeShiftBar") end
else
local bindwraps = {
["ACTIONBUTTON%d"] = 1,
["SHAPESHIFTBUTTON%d"] = 11, -- ShapeShiftBar
["BONUSACTIONBUTTON%d"] = 12, -- BonusActionBar
["MULTIACTIONBAR1BUTTON%d"] = 6, -- MultiBarBottomLeft
["MULTIACTIONBAR2BUTTON%d"] = 5, -- MultiBarBottomRight
["MULTIACTIONBAR3BUTTON%d"] = 3, -- MultiBarRight
["MULTIACTIONBAR4BUTTON%d"] = 4, -- MultiBarLeft
["PFPAGING%d"] = 2,
["PFSTANCEONE%d"] = 7,
["PFSTANCETWO%d"] = 8,
["PFSTANCETHREE%d"] = 9,
["PFSTANCEFOUR%d"] = 10,
}
-- rebind all existing bindings to our own buttons
local keybinder = CreateFrame("Frame")
keybinder:RegisterEvent("UPDATE_BINDINGS")
keybinder:SetScript("OnEvent", function()
for name, bar in pairs(bindwraps) do
for i=1,12 do
local key = GetBindingKey(format(name, i))
local button = bars[bar][i]
if key and button then
SetOverrideBindingClick(button, false, key, button:GetName(), 'LeftButton')
end
end
end
end)
end
-- In order to be able to reuse already defined keybinds, we need to remap
-- existing button functions to pfUI. We need to get rid of the blizzard calls
-- to avoid having them call texture changes and errors due to missing buttons
_G.ActionButtonDown = pfActionButton
_G.ActionButtonUp = pfActionButton
_G.BonusActionButtonDown = function(slot) pfActionButton(slot, nil, "BonusActionBar") end
_G.BonusActionButtonUp = function(slot) pfActionButton(slot, nil, "BonusActionBar") end
_G.MultiActionButtonDown = function(bar, slot, slf) pfActionButton(slot, slf, bar) end
_G.MultiActionButtonUp = function(bar, slot, slf) pfActionButton(slot, slf, bar) end
_G.ShapeshiftBar_ChangeForm = function(slot) pfActionButton(slot, nil, "ShapeShiftBar") end
-- handle drag-drop grid
local grid = CreateFrame("Frame")
+3 -5
View File
@@ -306,8 +306,8 @@ pfUI:RegisterModule("castbar", "vanilla", function ()
end
elseif event == CASTBAR_EVENT_CAST_START or event == CASTBAR_EVENT_CHANNEL_START then
playerarg = pfUI.client <= 11200 or arg1 == "player" and true or nil
if playerarg then this.delay = 0 end
playerarg = true
this.delay = 0
end
end)
@@ -391,9 +391,7 @@ pfUI:RegisterModule("castbar", "vanilla", function ()
pfUI.castbar.focus.spacing = default_border * 2 + tonumber(C.unitframes.focus.pspace) * GetPerfectPixel()
-- reset unitstr for vanilla focus frame emulation
if pfUI.client <= 11200 then
pfUI.castbar.focus.unitstr = nil
end
pfUI.castbar.focus.unitstr = nil
local anchor = pfUI.uf.focus.portrait:GetHeight() > pfUI.uf.focus:GetHeight() and pfUI.uf.focus.power or pfUI.uf.focus
local width = C.castbar.focus.width ~= "-1" and C.castbar.focus.width or anchor:GetWidth()
+8 -10
View File
@@ -3,17 +3,15 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
local panelfont_size = C.panel.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
local rawborder, default_border = GetBorderSize("chat")
if pfUI.client <= 11200 then
-- The 'GetChatWindowInfo' function returns shown as 'false' while the UIParent is hidden (Alt+Z).
-- Based on that return value, the 'FloatingChatFrame_Update' would remove every chat frame,
-- that isn't tabbed while the interface is hidden. With this hook we prevent the original
-- 'FloatingChatFrame_Update' function from being called during that time.
-- The 'GetChatWindowInfo' function returns shown as 'false' while the UIParent is hidden (Alt+Z).
-- Based on that return value, the 'FloatingChatFrame_Update' would remove every chat frame,
-- that isn't tabbed while the interface is hidden. With this hook we prevent the original
-- 'FloatingChatFrame_Update' function from being called during that time.
local HookFloatingChatFrame_Update = _G.FloatingChatFrame_Update
_G.FloatingChatFrame_Update = function(id, onUpdateEvent)
if not UIParent:IsShown() then return end
HookFloatingChatFrame_Update(id, onUpdateEvent)
end
local HookFloatingChatFrame_Update = _G.FloatingChatFrame_Update
_G.FloatingChatFrame_Update = function(id, onUpdateEvent)
if not UIParent:IsShown() then return end
HookFloatingChatFrame_Update(id, onUpdateEvent)
end
_G.CHAT_FONT_HEIGHTS = { 8, 10, 12, 14, 16, 18, 20 }
+3 -10
View File
@@ -134,14 +134,7 @@ pfUI:RegisterModule("cooldown", "vanilla:tbc", function ()
end
end
if pfUI.expansion == "vanilla" then
-- vanilla does not have a cooldown frame type, so we hook the
-- regular SetTimer function that each one is calling.
hooksecurefunc("CooldownFrame_SetTimer", SetCooldown)
else
-- tbc and later expansion have a cooldown frametype, so we can
-- hook directly into the frame creation and add our function there.
local methods = getmetatable(CreateFrame('Cooldown', nil, nil, 'CooldownFrameTemplate')).__index
hooksecurefunc(methods, 'SetCooldown', SetCooldown)
end
-- vanilla does not have a cooldown frame type, so we hook the
-- regular SetTimer function that each one is calling.
hooksecurefunc("CooldownFrame_SetTimer", SetCooldown)
end)
-3
View File
@@ -15,9 +15,6 @@ pfUI:RegisterModule("focus", "vanilla:tbc", function ()
pfUI.uf.focustarget:Hide()
end)
-- register focus emulation commands for vanilla
if pfUI.client > 11200 then return end
-- Helper: set focus frame to a GUID
local function SetFocusByGUID(guid)
pfUI.uf.focus.unitname = nil
+1 -1
View File
@@ -1,7 +1,7 @@
pfUI:RegisterSkin("Friends", "vanilla:tbc", function ()
local rawborder, border = GetBorderSize()
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
local maxtab = pfUI.expansion == "vanilla" and 4 or 5
local maxtab = 4
StripTextures(FriendsFrame, true)
CreateBackdrop(FriendsFrame, nil, nil, .75)
+2 -6
View File
@@ -714,14 +714,10 @@ pfUI:RegisterModule("loot", "vanilla:tbc", function ()
if event == "LOOT_BIND_CONFIRM" then
local slot = arg1
QueueFunction(function()
if pfUI.client <= 12000 then
LootSlot(slot)
elseif pfUI.client <= 20400 then
ConfirmLootSlot(slot)
end
LootSlot(slot)
StaticPopup_Hide("LOOT_BIND")
end)
elseif event == "LOOT_OPENED" and pfUI.client <= 11200 then
elseif event == "LOOT_OPENED" then
for i=1,GetNumLootItems() do
LootSlot(i)
end
+92 -103
View File
@@ -480,7 +480,7 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
-- PERF: Use lightweight fake cooldown frame when animation disabled
-- The Model-based CooldownFrameTemplate causes major lag with many nameplates
if pfUI.client <= 11200 and cfg.debuffanim ~= 1 then
if cfg.debuffanim ~= 1 then
plate.debuffs[index].cd = CreateFrame("Frame", plate.platename.."Debuff"..index.."Cooldown", plate.debuffs[index])
plate.debuffs[index].cd:SetAllPoints(plate.debuffs[index])
plate.debuffs[index].cd:SetFrameLevel(6)
@@ -489,7 +489,7 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
plate.debuffs[index].cd.SetSequence = DoNothing
plate.debuffs[index].cd.SetSequenceTime = DoNothing
else
-- Use CooldownFrameTemplate for animation or TBC+
-- Use CooldownFrameTemplate for animation
plate.debuffs[index].cd = CreateFrame(COOLDOWN_FRAME_TYPE, plate.platename.."Debuff"..index.."Cooldown", plate.debuffs[index], "CooldownFrameTemplate")
plate.debuffs[index].cd:SetAllPoints(plate.debuffs[index])
plate.debuffs[index].cd:SetFrameLevel(6)
@@ -540,12 +540,6 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
nameplate.debuffs[i].cd.pfCooldownStyleText = cooldown_text
nameplate.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim
-- Update scale for TBC+
if pfUI.client > 11200 then
local debuffsize = tonumber(C.nameplates.debuffsize)
local cdScale = debuffsize / 32
nameplate.debuffs[i].cd:SetScale(cdScale)
end
end
end
@@ -1519,40 +1513,38 @@ end
end
-- =========================================================================
-- VANILLA OVERLAP/CLICKTHROUGH HANDLING
-- OVERLAP/CLICKTHROUGH HANDLING
-- =========================================================================
if pfUI.client <= 11200 then
local useOverlap = C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0"
local clickable = C.nameplates["clickthrough"] ~= "1"
local useOverlap = C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0"
local clickable = C.nameplates["clickthrough"] ~= "1"
if not clickable then
frame:EnableMouse(false)
nameplate:EnableMouse(false)
else
local plate = useOverlap and nameplate or frame
plate:EnableMouse(clickable)
if not clickable then
frame:EnableMouse(false)
nameplate:EnableMouse(false)
else
local plate = useOverlap and nameplate or frame
plate:EnableMouse(clickable)
end
if C.nameplates["overlap"] == "1" then
if frame:GetWidth() > 1 then
frame:SetWidth(1)
frame:SetHeight(1)
end
else
if not nameplate.dwidth then
nameplate.dwidth = floor(nameplate:GetWidth() * UIParent:GetScale())
end
if C.nameplates["overlap"] == "1" then
if frame:GetWidth() > 1 then
frame:SetWidth(1)
frame:SetHeight(1)
end
else
if not nameplate.dwidth then
nameplate.dwidth = floor(nameplate:GetWidth() * UIParent:GetScale())
end
if floor(frame:GetWidth()) ~= nameplate.dwidth then
frame:SetWidth(nameplate:GetWidth() * UIParent:GetScale())
frame:SetHeight(nameplate:GetHeight() * UIParent:GetScale())
end
if floor(frame:GetWidth()) ~= nameplate.dwidth then
frame:SetWidth(nameplate:GetWidth() * UIParent:GetScale())
frame:SetHeight(nameplate:GetHeight() * UIParent:GetScale())
end
end
local mouseEnabled = nameplate:IsMouseEnabled()
if C.nameplates["clickthrough"] == "0" and C.nameplates["overlap"] == "1" and SpellIsTargeting() == mouseEnabled then
nameplate:EnableMouse(not mouseEnabled)
end
local mouseEnabled = nameplate:IsMouseEnabled()
if C.nameplates["clickthrough"] == "0" and C.nameplates["overlap"] == "1" and SpellIsTargeting() == mouseEnabled then
nameplate:EnableMouse(not mouseEnabled)
end
-- Cache strata changes
@@ -1951,85 +1943,82 @@ end
end
end
if pfUI.client <= 11200 then
-- handle vanilla only settings
local hookOnConfigChange = nameplates.OnConfigChange
nameplates.OnConfigChange = function(self)
hookOnConfigChange(self)
local hookOnConfigChange = nameplates.OnConfigChange
nameplates.OnConfigChange = function(self)
hookOnConfigChange(self)
local parent = self
local nameplate = self.nameplate
local plate = (C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0") and nameplate or parent
local parent = self
local nameplate = self.nameplate
local plate = (C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0") and nameplate or parent
-- disable all clicks for now
parent:EnableMouse(false)
nameplate:EnableMouse(false)
-- disable all clicks for now
parent:EnableMouse(false)
nameplate:EnableMouse(false)
-- adjust vertical offset
if C.nameplates["vertical_offset"] ~= "0" then
nameplate:SetPoint("TOP", parent, "TOP", 0, tonumber(C.nameplates["vertical_offset"]))
end
-- replace clickhandler
if C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0" then
plate:SetScript("OnClick", function() parent:Click() end)
end
-- enable mouselook on rightbutton down
if C.nameplates["rightclick"] == "1" then
plate:SetScript("OnMouseDown", nameplates.mouselook.OnMouseDown)
else
plate:SetScript("OnMouseDown", nil)
end
-- adjust vertical offset
if C.nameplates["vertical_offset"] ~= "0" then
nameplate:SetPoint("TOP", parent, "TOP", 0, tonumber(C.nameplates["vertical_offset"]))
end
local hookOnDataChanged = nameplates.OnDataChanged
nameplates.OnDataChanged = function(self, nameplate)
hookOnDataChanged(self, nameplate)
-- make sure to keep mouse events disabled on parent nameplate
if (C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0") then
nameplate.parent:EnableMouse(false)
end
-- replace clickhandler
if C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0" then
plate:SetScript("OnClick", function() parent:Click() end)
end
-- enable mouselook on rightbutton down
nameplates.mouselook = CreateFrame("Frame", nil, UIParent)
nameplates.mouselook.time = nil
nameplates.mouselook.frame = nil
nameplates.mouselook.OnMouseDown = function()
if arg1 and arg1 == "RightButton" then
MouselookStart()
if C.nameplates["rightclick"] == "1" then
plate:SetScript("OnMouseDown", nameplates.mouselook.OnMouseDown)
else
plate:SetScript("OnMouseDown", nil)
end
end
-- start detection of the rightclick emulation
nameplates.mouselook.time = GetTime()
nameplates.mouselook.frame = this
nameplates.mouselook:Show()
end
local hookOnDataChanged = nameplates.OnDataChanged
nameplates.OnDataChanged = function(self, nameplate)
hookOnDataChanged(self, nameplate)
-- make sure to keep mouse events disabled on parent nameplate
if (C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0") then
nameplate.parent:EnableMouse(false)
end
end
-- enable mouselook on rightbutton down
nameplates.mouselook = CreateFrame("Frame", nil, UIParent)
nameplates.mouselook.time = nil
nameplates.mouselook.frame = nil
nameplates.mouselook.OnMouseDown = function()
if arg1 and arg1 == "RightButton" then
MouselookStart()
-- start detection of the rightclick emulation
nameplates.mouselook.time = GetTime()
nameplates.mouselook.frame = this
nameplates.mouselook:Show()
end
end
nameplates.mouselook:SetScript("OnUpdate", function()
-- break here if nothing to do
if not this.time or not this.frame then
this:Hide()
return
end
nameplates.mouselook:SetScript("OnUpdate", function()
-- break here if nothing to do
if not this.time or not this.frame then
this:Hide()
return
end
-- if threshold is reached (0.5 second) no click action will follow
if not IsMouselooking() and this.time + tonumber(C.nameplates["clickthreshold"]) < GetTime() then
this:Hide()
return
end
-- if threshold is reached (0.5 second) no click action will follow
if not IsMouselooking() and this.time + tonumber(C.nameplates["clickthreshold"]) < GetTime() then
this:Hide()
return
end
-- run a usual nameplate rightclick action
if not IsMouselooking() then
this.frame:Click("LeftButton")
if UnitCanAttack("player", "target") and not nameplates.combat.inCombat then AttackTarget() end
this:Hide()
return
end
end)
end
-- run a usual nameplate rightclick action
if not IsMouselooking() then
this.frame:Click("LeftButton")
if UnitCanAttack("player", "target") and not nameplates.combat.inCombat then AttackTarget() end
this:Hide()
return
end
end)
pfUI.nameplates = nameplates
end)
+1 -5
View File
@@ -97,11 +97,7 @@ pfUI:RegisterModule("questitem", function ()
SelectQuestLogEntry(quest)
-- detect and ignore quest headers
if pfUI.client <= 11200 then -- vanilla
_, _, _, header = GetQuestLogTitle(quest)
elseif pfUI.client > 11200 then -- tbc
_, _, _, _, header = GetQuestLogTitle(quest)
end
_, _, _, header = GetQuestLogTitle(quest)
if not header then
text, objective = GetQuestLogQuestText()
+3 -6
View File
@@ -15,7 +15,7 @@ pfUI:RegisterModule("totems", "vanilla:tbc", function ()
totems:RefreshList()
end)
if pfUI.client <= 11200 and class == "SHAMAN" then
if class == "SHAMAN" then
-- there's no totem event in vanilla using ticks instead
local eventemu = CreateFrame("Frame")
eventemu:SetScript("OnUpdate", function()
@@ -39,13 +39,10 @@ end
end
totems.OnClick = function(self)
if pfUI.client <= 11200 and this.id and arg1 and arg1 == "LeftButton" then
-- Try to recast totem on left click in vanilla
if this.id and arg1 and arg1 == "LeftButton" then
-- Try to recast totem on left click
local active, name, start, duration, icon = GetTotemInfo(this.id)
if name then CastSpellByName(name) end
elseif pfUI.client > 11200 and this.id and arg1 and arg1 == "RightButton" then
-- Try to cancel totem on right click in tbc+
DestroyTotem(this.id)
end
end