mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-20 03:20:49 +00:00
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:
+2
-2
@@ -34,7 +34,7 @@ do -- statusbars
|
|||||||
|
|
||||||
if self.mode == "vertical" then
|
if self.mode == "vertical" then
|
||||||
height = self:GetHeight()
|
height = self:GetHeight()
|
||||||
if pfUI.expansion == "vanilla" then height = height / self:GetEffectiveScale() end
|
height = height / self:GetEffectiveScale()
|
||||||
point = height / (self.max - self.min) * (val - self.min)
|
point = height / (self.max - self.min) * (val - self.min)
|
||||||
|
|
||||||
-- keep values in limits
|
-- keep values in limits
|
||||||
@@ -53,7 +53,7 @@ do -- statusbars
|
|||||||
self.bg:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, point)
|
self.bg:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", 0, point)
|
||||||
else
|
else
|
||||||
width = self:GetWidth()
|
width = self:GetWidth()
|
||||||
if pfUI.expansion == "vanilla" then width = width / self:GetEffectiveScale() end
|
width = width / self:GetEffectiveScale()
|
||||||
point = width / (self.max - self.min) * (val - self.min)
|
point = width / (self.max - self.min) * (val - self.min)
|
||||||
|
|
||||||
-- keep values in limits
|
-- keep values in limits
|
||||||
|
|||||||
+4
-65
@@ -47,15 +47,6 @@ local function DoNothing()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local function TargetBuffOnUpdate()
|
|
||||||
local name, rank, icon, count, duration, timeleft = _G.UnitBuff("target", this.id)
|
|
||||||
if duration and timeleft then
|
|
||||||
CooldownFrame_SetTimer(this.cd, GetTime() + timeleft - duration, duration, 1)
|
|
||||||
else
|
|
||||||
CooldownFrame_SetTimer(this.cd, 0, 0, 0)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local function BuffOnEnter()
|
local function BuffOnEnter()
|
||||||
local parent = this:GetParent()
|
local parent = this:GetParent()
|
||||||
if not parent.label then return end
|
if not parent.label then return end
|
||||||
@@ -364,20 +355,6 @@ function pfUI.uf:UpdateVisibility()
|
|||||||
self.visible = nil
|
self.visible = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- tbc visibility
|
|
||||||
if pfUI.client > 11200 then
|
|
||||||
self:SetAttribute("unit", unitstr)
|
|
||||||
|
|
||||||
-- update visibility condition on change
|
|
||||||
if self.visibilitycondition ~= visibility then
|
|
||||||
RegisterStateDriver(self, 'visibility', visibility)
|
|
||||||
self.visibilitycondition = visibility
|
|
||||||
self.visible = true
|
|
||||||
end
|
|
||||||
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
-- vanilla visibility
|
-- vanilla visibility
|
||||||
if self.unitname and self.unitname ~= "focus" and self.unitname ~= "focustarget" then
|
if self.unitname and self.unitname ~= "focus" and self.unitname ~= "focustarget" then
|
||||||
self:Show()
|
self:Show()
|
||||||
@@ -839,10 +816,6 @@ function pfUI.uf:UpdateConfig()
|
|||||||
|
|
||||||
CreateBackdrop(f.buffs[i], default_border)
|
CreateBackdrop(f.buffs[i], default_border)
|
||||||
|
|
||||||
if f:GetName() == "pfTarget" and pfUI.expansion == "tbc" then
|
|
||||||
f.buffs[i]:SetScript("OnUpdate", TargetBuffOnUpdate)
|
|
||||||
end
|
|
||||||
|
|
||||||
f.buffs[i]:SetScript("OnEnter", BuffOnEnter)
|
f.buffs[i]:SetScript("OnEnter", BuffOnEnter)
|
||||||
f.buffs[i]:SetScript("OnLeave", BuffOnLeave)
|
f.buffs[i]:SetScript("OnLeave", BuffOnLeave)
|
||||||
f.buffs[i]:SetScript("OnClick", BuffOnClick)
|
f.buffs[i]:SetScript("OnClick", BuffOnClick)
|
||||||
@@ -1638,14 +1611,7 @@ end
|
|||||||
function pfUI.uf:EnableScripts()
|
function pfUI.uf:EnableScripts()
|
||||||
local f = self
|
local f = self
|
||||||
|
|
||||||
-- handle secure unit button templates (> vanilla)
|
f:SetScript("OnClick", pfUI.uf.OnClick)
|
||||||
if pfUI.client > 11200 then
|
|
||||||
f.showmenu = pfUI.uf.RightClickAction
|
|
||||||
f:SetAttribute("*type1", "target")
|
|
||||||
f:SetAttribute("*type2", "showmenu")
|
|
||||||
else
|
|
||||||
f:SetScript("OnClick", pfUI.uf.OnClick)
|
|
||||||
end
|
|
||||||
|
|
||||||
f:SetScript("OnShow", pfUI.uf.OnShow)
|
f:SetScript("OnShow", pfUI.uf.OnShow)
|
||||||
f:SetScript("OnEvent", pfUI.uf.OnEvent)
|
f:SetScript("OnEvent", pfUI.uf.OnEvent)
|
||||||
@@ -2508,36 +2474,9 @@ function pfUI.uf:EnableClickCast()
|
|||||||
for modifier, mconf in pairs(modifiers) do
|
for modifier, mconf in pairs(modifiers) do
|
||||||
local bconf = bid == 1 and "" or bid
|
local bconf = bid == 1 and "" or bid
|
||||||
if pfUI_config.unitframes["clickcast"..bconf..mconf] ~= "" then
|
if pfUI_config.unitframes["clickcast"..bconf..mconf] ~= "" then
|
||||||
-- prepare click casting
|
-- fill clickaction table
|
||||||
if pfUI.client > 11200 then
|
self.clickactions = self.clickactions or {}
|
||||||
-- set attributes for tbc+
|
self.clickactions[modifier..button] = pfUI_config.unitframes["clickcast"..bconf..mconf]
|
||||||
local prefix = modifier == "" and "" or modifier .. "-"
|
|
||||||
|
|
||||||
-- check for "/" in the beginning of the string, to detect macros
|
|
||||||
local ccval = pfUI_config.unitframes["clickcast"..bconf..mconf]
|
|
||||||
local ccval_lower = string.lower(ccval)
|
|
||||||
if string.find(ccval, "^%/(.+)") then
|
|
||||||
self:SetAttribute(prefix.."type"..bid, "macro")
|
|
||||||
self:SetAttribute(prefix.."macrotext"..bid, ccval)
|
|
||||||
self:SetAttribute(prefix.."spell"..bid, nil)
|
|
||||||
elseif string.find(ccval_lower, "^target") then
|
|
||||||
self:SetAttribute(prefix.."type"..bid, "target")
|
|
||||||
self:SetAttribute(prefix.."macrotext"..bid, nil)
|
|
||||||
self:SetAttribute(prefix.."spell"..bid, nil)
|
|
||||||
elseif string.find(ccval_lower, "^menu") then
|
|
||||||
self:SetAttribute(prefix.."type"..bid, "showmenu")
|
|
||||||
self:SetAttribute(prefix.."macrotext"..bid, nil)
|
|
||||||
self:SetAttribute(prefix.."spell"..bid, nil)
|
|
||||||
else
|
|
||||||
self:SetAttribute(prefix.."type"..bid, "spell")
|
|
||||||
self:SetAttribute(prefix.."spell"..bid, pfUI_config.unitframes["clickcast"..bconf..mconf])
|
|
||||||
self:SetAttribute(prefix.."macro"..bid, nil)
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- fill clickaction table for vanillla
|
|
||||||
self.clickactions = self.clickactions or {}
|
|
||||||
self.clickactions[modifier..button] = pfUI_config.unitframes["clickcast"..bconf..mconf]
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
-- load pfUI environment
|
-- load pfUI environment
|
||||||
setfenv(1, pfUI:GetEnvironment())
|
setfenv(1, pfUI:GetEnvironment())
|
||||||
if pfUI.expansion ~= "vanilla" then return end
|
|
||||||
|
|
||||||
-- [[ Constants ]]--
|
-- [[ Constants ]]--
|
||||||
CASTBAR_EVENT_CAST_DELAY = "SPELLCAST_DELAYED"
|
CASTBAR_EVENT_CAST_DELAY = "SPELLCAST_DELAYED"
|
||||||
|
|||||||
Vendored
-3
@@ -57,9 +57,6 @@ pfValidUnits["playertarget"] = true
|
|||||||
pfValidUnits["targettarget"] = true
|
pfValidUnits["targettarget"] = true
|
||||||
pfValidUnits["mouseovertarget"] = true
|
pfValidUnits["mouseovertarget"] = true
|
||||||
pfValidUnits["targettargettarget"] = true
|
pfValidUnits["targettargettarget"] = true
|
||||||
pfValidUnits["focus"] = pfUI.client > 11200 or nil
|
|
||||||
pfValidUnits["focustarget"] = pfUI.client > 11200 or nil
|
|
||||||
|
|
||||||
for i=1,4 do pfValidUnits["party" .. i] = true end
|
for i=1,4 do pfValidUnits["party" .. i] = true end
|
||||||
for i=1,4 do pfValidUnits["partypet" .. i] = true end
|
for i=1,4 do pfValidUnits["partypet" .. i] = true end
|
||||||
for i=1,40 do pfValidUnits["raid" .. i] = true end
|
for i=1,40 do pfValidUnits["raid" .. i] = true end
|
||||||
|
|||||||
@@ -41,9 +41,6 @@ setfenv(1, pfUI:GetEnvironment())
|
|||||||
-- spell can be set to "INTERRUPT" to force remove an action.
|
-- spell can be set to "INTERRUPT" to force remove an action.
|
||||||
--
|
--
|
||||||
|
|
||||||
-- return instantly if we're not on a vanilla client
|
|
||||||
if pfUI.client > 11200 then return end
|
|
||||||
|
|
||||||
-- return instantly when another libcast is already active
|
-- return instantly when another libcast is already active
|
||||||
if pfUI.api.libcast then return end
|
if pfUI.api.libcast then return end
|
||||||
|
|
||||||
|
|||||||
@@ -15,9 +15,6 @@ setfenv(1, pfUI:GetEnvironment())
|
|||||||
-- Returns debuff informations on the given effect of the specified unit.
|
-- Returns debuff informations on the given effect of the specified unit.
|
||||||
-- name, rank, texture, stacks, dtype, duration, timeleft, caster
|
-- name, rank, texture, stacks, dtype, duration, timeleft, caster
|
||||||
|
|
||||||
-- return instantly if we're not on a vanilla client
|
|
||||||
if pfUI.client > 11200 then return end
|
|
||||||
|
|
||||||
-- return instantly when another libdebuff is already active
|
-- return instantly when another libdebuff is already active
|
||||||
if pfUI.api.libdebuff then return end
|
if pfUI.api.libdebuff then return end
|
||||||
|
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ setfenv(1, pfUI:GetEnvironment())
|
|||||||
-- Returns totem informations on the givent totem slot
|
-- Returns totem informations on the givent totem slot
|
||||||
-- active, name, start, duration, icon
|
-- active, name, start, duration, icon
|
||||||
|
|
||||||
-- return instantly if we're not on a vanilla client
|
|
||||||
if pfUI.client > 11200 then return end
|
|
||||||
|
|
||||||
-- return instantly when another libtotem is already active
|
-- return instantly when another libtotem is already active
|
||||||
if pfUI.api.libtotem then return end
|
if pfUI.api.libtotem then return end
|
||||||
|
|
||||||
|
|||||||
+19
-23
@@ -165,34 +165,30 @@ libunitscan:SetScript("OnEvent", function()
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- since TargetByName can only be triggered within vanilla,
|
-- setup sound function switches
|
||||||
-- we can't auto-scan targets on further expansions.
|
local SoundOn = PlaySound
|
||||||
if pfUI.client <= 11200 then
|
local SoundOff = function() return end
|
||||||
-- setup sound function switches
|
|
||||||
local SoundOn = PlaySound
|
|
||||||
local SoundOff = function() return end
|
|
||||||
|
|
||||||
libunitscan:SetScript("OnUpdate", function()
|
libunitscan:SetScript("OnUpdate", function()
|
||||||
-- don't scan when another unit is in target
|
-- don't scan when another unit is in target
|
||||||
if UnitExists("target") or UnitName("target") then return end
|
if UnitExists("target") or UnitName("target") then return end
|
||||||
|
|
||||||
local name = next(queue)
|
local name = next(queue)
|
||||||
if name then
|
if name then
|
||||||
-- disable sound
|
-- disable sound
|
||||||
_G.PlaySound = SoundOff
|
_G.PlaySound = SoundOff
|
||||||
|
|
||||||
-- try to target the unknown unit
|
-- try to target the unknown unit
|
||||||
TargetByName(name, true)
|
TargetByName(name, true)
|
||||||
ClearTarget()
|
ClearTarget()
|
||||||
|
|
||||||
-- enable sound again
|
-- enable sound again
|
||||||
_G.PlaySound = SoundOn
|
_G.PlaySound = SoundOn
|
||||||
|
|
||||||
queue[name] = nil
|
queue[name] = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
this:Hide()
|
this:Hide()
|
||||||
end)
|
end)
|
||||||
end
|
|
||||||
|
|
||||||
pfUI.api.libunitscan = libunitscan
|
pfUI.api.libunitscan = libunitscan
|
||||||
|
|||||||
+45
-152
@@ -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 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 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
|
-- 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
|
-- 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.
|
-- 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
|
castable, autocast, token = nil, nil, nil
|
||||||
|
|
||||||
-- set the own ID for compatibility to some vanilla addons
|
-- 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
|
grid = self.bar == 12 and showgrid_pet or showgrid
|
||||||
|
|
||||||
@@ -817,78 +815,25 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
|||||||
bars:SetScript("OnUpdate", BarsUpdate)
|
bars:SetScript("OnUpdate", BarsUpdate)
|
||||||
|
|
||||||
-- enable bar paging via secure functions
|
-- 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)
|
local function EnablePaging(bar)
|
||||||
if pfUI.client <= 11200 then
|
if not bar.pager then
|
||||||
if not bar.pager then
|
bar.pager = CreateFrame("Frame")
|
||||||
bar.pager = CreateFrame("Frame")
|
bar.pager:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
bar.pager:RegisterEvent("PLAYER_ENTERING_WORLD")
|
bar.pager:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
|
||||||
bar.pager:RegisterEvent("UPDATE_BONUS_ACTIONBAR")
|
bar.pager:RegisterEvent("ACTIONBAR_PAGE_CHANGED")
|
||||||
bar.pager:RegisterEvent("ACTIONBAR_PAGE_CHANGED")
|
bar.pager:SetScript("OnEvent", function()
|
||||||
bar.pager:SetScript("OnEvent", function()
|
for i=1, 10 do -- reload pageable bars
|
||||||
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
|
||||||
local pageable = C.bars["bar"..i] and C.bars["bar"..i].pageable == "1" and true or nil
|
_G.VIEWABLE_ACTION_BAR_PAGES[i] = pageable
|
||||||
_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
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
bar:SetAttribute("statemap-page", "$input")
|
local active = GetActiveBar()
|
||||||
bar:SetAttribute("state", (bar:GetAttribute("state-page") or 1))
|
for i=1,12 do
|
||||||
|
local id = i + (active-1)*12
|
||||||
-- prio posses bar
|
bar[i].id = id
|
||||||
bar.filter = "[bonusbar: 5] 11;"
|
updatecache[i] = true
|
||||||
|
|
||||||
-- 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)
|
|
||||||
end
|
end
|
||||||
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
|
end
|
||||||
|
|
||||||
@@ -917,7 +862,7 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- pagemaster / meta page switch
|
-- pagemaster / meta page switch
|
||||||
if pfUI.expansion == "vanilla" then
|
do
|
||||||
local prowl, shift, ctrl, alt, default = 8, 6, 5, 3, 1
|
local prowl, shift, ctrl, alt, default = 8, 6, 5, 3, 1
|
||||||
|
|
||||||
-- set temporary pagemaster bindings keybinds
|
-- set temporary pagemaster bindings keybinds
|
||||||
@@ -1287,40 +1232,26 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
|||||||
if enable == "1" then
|
if enable == "1" then
|
||||||
-- handle pet bar
|
-- handle pet bar
|
||||||
if i == 12 then
|
if i == 12 then
|
||||||
if pfUI.client > 11200 then
|
-- only show when pet actions exists
|
||||||
if InCombatLockdown and InCombatLockdown() then
|
if PetHasActionBar() or pfUI.unlock and pfUI.unlock:IsShown() then
|
||||||
-- don't process those events during combat
|
bars[i]:Show()
|
||||||
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
|
|
||||||
else
|
else
|
||||||
-- only show when pet actions exists
|
bars[i]:Hide()
|
||||||
if PetHasActionBar() or pfUI.unlock and pfUI.unlock:IsShown() then
|
end
|
||||||
bars[i]:Show()
|
|
||||||
else
|
|
||||||
bars[i]:Hide()
|
|
||||||
end
|
|
||||||
|
|
||||||
-- show/hide petbar on petbar updates
|
-- show/hide petbar on petbar updates
|
||||||
if init then
|
if init then
|
||||||
bars[i]:RegisterEvent("PET_BAR_UPDATE")
|
bars[i]:RegisterEvent("PET_BAR_UPDATE")
|
||||||
bars[i]:SetScript("OnEvent", function()
|
bars[i]:SetScript("OnEvent", function()
|
||||||
-- hide obsolete buttons
|
-- hide obsolete buttons
|
||||||
for i=1, NUM_PET_ACTION_SLOTS do
|
for i=1, NUM_PET_ACTION_SLOTS do
|
||||||
if not PetHasActionBar() and bars[12][i] then
|
if not PetHasActionBar() and bars[12][i] then
|
||||||
bars[12][i]:Hide()
|
bars[12][i]:Hide()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- refresh layout
|
-- refresh layout
|
||||||
CreateActionBar(12)
|
CreateActionBar(12)
|
||||||
end)
|
end)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- handle shapeshift bar
|
-- handle shapeshift bar
|
||||||
@@ -1390,12 +1321,6 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
|||||||
end
|
end
|
||||||
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
|
-- enable paging for the first actionbar
|
||||||
if i == 1 then
|
if i == 1 then
|
||||||
EnablePaging(bars[i])
|
EnablePaging(bars[i])
|
||||||
@@ -1565,48 +1490,16 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Set keybinds to all actionbuttons
|
-- Set keybinds to all actionbuttons
|
||||||
if pfUI.client <= 11200 then
|
-- In order to be able to reuse already defined keybinds, we need to remap
|
||||||
-- 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
|
||||||
-- 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
|
||||||
-- to avoid having them call texture changes and errors due to missing buttons
|
_G.ActionButtonDown = pfActionButton
|
||||||
_G.ActionButtonDown = pfActionButton
|
_G.ActionButtonUp = pfActionButton
|
||||||
_G.ActionButtonUp = pfActionButton
|
_G.BonusActionButtonDown = function(slot) pfActionButton(slot, nil, "BonusActionBar") end
|
||||||
_G.BonusActionButtonDown = function(slot) pfActionButton(slot, nil, "BonusActionBar") end
|
_G.BonusActionButtonUp = 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.MultiActionButtonDown = function(bar, slot, slf) pfActionButton(slot, slf, bar) end
|
_G.MultiActionButtonUp = 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
|
||||||
_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
|
|
||||||
|
|
||||||
-- handle drag-drop grid
|
-- handle drag-drop grid
|
||||||
local grid = CreateFrame("Frame")
|
local grid = CreateFrame("Frame")
|
||||||
|
|||||||
+3
-5
@@ -306,8 +306,8 @@ pfUI:RegisterModule("castbar", "vanilla", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
elseif event == CASTBAR_EVENT_CAST_START or event == CASTBAR_EVENT_CHANNEL_START then
|
elseif event == CASTBAR_EVENT_CAST_START or event == CASTBAR_EVENT_CHANNEL_START then
|
||||||
playerarg = pfUI.client <= 11200 or arg1 == "player" and true or nil
|
playerarg = true
|
||||||
if playerarg then this.delay = 0 end
|
this.delay = 0
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -391,9 +391,7 @@ pfUI:RegisterModule("castbar", "vanilla", function ()
|
|||||||
pfUI.castbar.focus.spacing = default_border * 2 + tonumber(C.unitframes.focus.pspace) * GetPerfectPixel()
|
pfUI.castbar.focus.spacing = default_border * 2 + tonumber(C.unitframes.focus.pspace) * GetPerfectPixel()
|
||||||
|
|
||||||
-- reset unitstr for vanilla focus frame emulation
|
-- reset unitstr for vanilla focus frame emulation
|
||||||
if pfUI.client <= 11200 then
|
pfUI.castbar.focus.unitstr = nil
|
||||||
pfUI.castbar.focus.unitstr = nil
|
|
||||||
end
|
|
||||||
|
|
||||||
local anchor = pfUI.uf.focus.portrait:GetHeight() > pfUI.uf.focus:GetHeight() and pfUI.uf.focus.power or pfUI.uf.focus
|
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()
|
local width = C.castbar.focus.width ~= "-1" and C.castbar.focus.width or anchor:GetWidth()
|
||||||
|
|||||||
+8
-10
@@ -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 panelfont_size = C.panel.use_unitfonts == "1" and C.global.font_unit_size or C.global.font_size
|
||||||
local rawborder, default_border = GetBorderSize("chat")
|
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).
|
||||||
-- 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,
|
||||||
-- 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
|
||||||
-- 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.
|
||||||
-- 'FloatingChatFrame_Update' function from being called during that time.
|
|
||||||
|
|
||||||
local HookFloatingChatFrame_Update = _G.FloatingChatFrame_Update
|
local HookFloatingChatFrame_Update = _G.FloatingChatFrame_Update
|
||||||
_G.FloatingChatFrame_Update = function(id, onUpdateEvent)
|
_G.FloatingChatFrame_Update = function(id, onUpdateEvent)
|
||||||
if not UIParent:IsShown() then return end
|
if not UIParent:IsShown() then return end
|
||||||
HookFloatingChatFrame_Update(id, onUpdateEvent)
|
HookFloatingChatFrame_Update(id, onUpdateEvent)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
_G.CHAT_FONT_HEIGHTS = { 8, 10, 12, 14, 16, 18, 20 }
|
_G.CHAT_FONT_HEIGHTS = { 8, 10, 12, 14, 16, 18, 20 }
|
||||||
|
|||||||
+3
-10
@@ -134,14 +134,7 @@ pfUI:RegisterModule("cooldown", "vanilla:tbc", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if pfUI.expansion == "vanilla" then
|
-- vanilla does not have a cooldown frame type, so we hook the
|
||||||
-- vanilla does not have a cooldown frame type, so we hook the
|
-- regular SetTimer function that each one is calling.
|
||||||
-- regular SetTimer function that each one is calling.
|
hooksecurefunc("CooldownFrame_SetTimer", SetCooldown)
|
||||||
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
|
|
||||||
end)
|
end)
|
||||||
@@ -15,9 +15,6 @@ pfUI:RegisterModule("focus", "vanilla:tbc", function ()
|
|||||||
pfUI.uf.focustarget:Hide()
|
pfUI.uf.focustarget:Hide()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- register focus emulation commands for vanilla
|
|
||||||
if pfUI.client > 11200 then return end
|
|
||||||
|
|
||||||
-- Helper: set focus frame to a GUID
|
-- Helper: set focus frame to a GUID
|
||||||
local function SetFocusByGUID(guid)
|
local function SetFocusByGUID(guid)
|
||||||
pfUI.uf.focus.unitname = nil
|
pfUI.uf.focus.unitname = nil
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
pfUI:RegisterSkin("Friends", "vanilla:tbc", function ()
|
pfUI:RegisterSkin("Friends", "vanilla:tbc", function ()
|
||||||
local rawborder, border = GetBorderSize()
|
local rawborder, border = GetBorderSize()
|
||||||
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
|
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
|
||||||
local maxtab = pfUI.expansion == "vanilla" and 4 or 5
|
local maxtab = 4
|
||||||
|
|
||||||
StripTextures(FriendsFrame, true)
|
StripTextures(FriendsFrame, true)
|
||||||
CreateBackdrop(FriendsFrame, nil, nil, .75)
|
CreateBackdrop(FriendsFrame, nil, nil, .75)
|
||||||
|
|||||||
+2
-6
@@ -714,14 +714,10 @@ pfUI:RegisterModule("loot", "vanilla:tbc", function ()
|
|||||||
if event == "LOOT_BIND_CONFIRM" then
|
if event == "LOOT_BIND_CONFIRM" then
|
||||||
local slot = arg1
|
local slot = arg1
|
||||||
QueueFunction(function()
|
QueueFunction(function()
|
||||||
if pfUI.client <= 12000 then
|
LootSlot(slot)
|
||||||
LootSlot(slot)
|
|
||||||
elseif pfUI.client <= 20400 then
|
|
||||||
ConfirmLootSlot(slot)
|
|
||||||
end
|
|
||||||
StaticPopup_Hide("LOOT_BIND")
|
StaticPopup_Hide("LOOT_BIND")
|
||||||
end)
|
end)
|
||||||
elseif event == "LOOT_OPENED" and pfUI.client <= 11200 then
|
elseif event == "LOOT_OPENED" then
|
||||||
for i=1,GetNumLootItems() do
|
for i=1,GetNumLootItems() do
|
||||||
LootSlot(i)
|
LootSlot(i)
|
||||||
end
|
end
|
||||||
|
|||||||
+92
-103
@@ -480,7 +480,7 @@ pfUI:RegisterModule("nameplates", "vanilla", function ()
|
|||||||
|
|
||||||
-- PERF: Use lightweight fake cooldown frame when animation disabled
|
-- PERF: Use lightweight fake cooldown frame when animation disabled
|
||||||
-- The Model-based CooldownFrameTemplate causes major lag with many nameplates
|
-- 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 = CreateFrame("Frame", plate.platename.."Debuff"..index.."Cooldown", plate.debuffs[index])
|
||||||
plate.debuffs[index].cd:SetAllPoints(plate.debuffs[index])
|
plate.debuffs[index].cd:SetAllPoints(plate.debuffs[index])
|
||||||
plate.debuffs[index].cd:SetFrameLevel(6)
|
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.SetSequence = DoNothing
|
||||||
plate.debuffs[index].cd.SetSequenceTime = DoNothing
|
plate.debuffs[index].cd.SetSequenceTime = DoNothing
|
||||||
else
|
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 = 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:SetAllPoints(plate.debuffs[index])
|
||||||
plate.debuffs[index].cd:SetFrameLevel(6)
|
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.pfCooldownStyleText = cooldown_text
|
||||||
nameplate.debuffs[i].cd.pfCooldownStyleAnimation = cooldown_anim
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1519,40 +1513,38 @@ end
|
|||||||
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 useOverlap = C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0"
|
local clickable = C.nameplates["clickthrough"] ~= "1"
|
||||||
local clickable = C.nameplates["clickthrough"] ~= "1"
|
|
||||||
|
|
||||||
if not clickable then
|
if not clickable then
|
||||||
frame:EnableMouse(false)
|
frame:EnableMouse(false)
|
||||||
nameplate:EnableMouse(false)
|
nameplate:EnableMouse(false)
|
||||||
else
|
else
|
||||||
local plate = useOverlap and nameplate or frame
|
local plate = useOverlap and nameplate or frame
|
||||||
plate:EnableMouse(clickable)
|
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
|
end
|
||||||
|
|
||||||
if C.nameplates["overlap"] == "1" then
|
if floor(frame:GetWidth()) ~= nameplate.dwidth then
|
||||||
if frame:GetWidth() > 1 then
|
frame:SetWidth(nameplate:GetWidth() * UIParent:GetScale())
|
||||||
frame:SetWidth(1)
|
frame:SetHeight(nameplate:GetHeight() * UIParent:GetScale())
|
||||||
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
|
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
local mouseEnabled = nameplate:IsMouseEnabled()
|
local mouseEnabled = nameplate:IsMouseEnabled()
|
||||||
if C.nameplates["clickthrough"] == "0" and C.nameplates["overlap"] == "1" and SpellIsTargeting() == mouseEnabled then
|
if C.nameplates["clickthrough"] == "0" and C.nameplates["overlap"] == "1" and SpellIsTargeting() == mouseEnabled then
|
||||||
nameplate:EnableMouse(not mouseEnabled)
|
nameplate:EnableMouse(not mouseEnabled)
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Cache strata changes
|
-- Cache strata changes
|
||||||
@@ -1951,85 +1943,82 @@ end
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if pfUI.client <= 11200 then
|
local hookOnConfigChange = nameplates.OnConfigChange
|
||||||
-- handle vanilla only settings
|
nameplates.OnConfigChange = function(self)
|
||||||
local hookOnConfigChange = nameplates.OnConfigChange
|
hookOnConfigChange(self)
|
||||||
nameplates.OnConfigChange = function(self)
|
|
||||||
hookOnConfigChange(self)
|
|
||||||
|
|
||||||
local parent = self
|
local parent = self
|
||||||
local nameplate = self.nameplate
|
local nameplate = self.nameplate
|
||||||
local plate = (C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0") and nameplate or parent
|
local plate = (C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0") and nameplate or parent
|
||||||
|
|
||||||
-- disable all clicks for now
|
-- disable all clicks for now
|
||||||
parent:EnableMouse(false)
|
parent:EnableMouse(false)
|
||||||
nameplate:EnableMouse(false)
|
nameplate:EnableMouse(false)
|
||||||
|
|
||||||
-- adjust vertical offset
|
-- adjust vertical offset
|
||||||
if C.nameplates["vertical_offset"] ~= "0" then
|
if C.nameplates["vertical_offset"] ~= "0" then
|
||||||
nameplate:SetPoint("TOP", parent, "TOP", 0, tonumber(C.nameplates["vertical_offset"]))
|
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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local hookOnDataChanged = nameplates.OnDataChanged
|
-- replace clickhandler
|
||||||
nameplates.OnDataChanged = function(self, nameplate)
|
if C.nameplates["overlap"] == "1" or C.nameplates["vertical_offset"] ~= "0" then
|
||||||
hookOnDataChanged(self, nameplate)
|
plate:SetScript("OnClick", function() parent:Click() end)
|
||||||
|
|
||||||
-- 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
|
end
|
||||||
|
|
||||||
-- enable mouselook on rightbutton down
|
-- enable mouselook on rightbutton down
|
||||||
nameplates.mouselook = CreateFrame("Frame", nil, UIParent)
|
if C.nameplates["rightclick"] == "1" then
|
||||||
nameplates.mouselook.time = nil
|
plate:SetScript("OnMouseDown", nameplates.mouselook.OnMouseDown)
|
||||||
nameplates.mouselook.frame = nil
|
else
|
||||||
nameplates.mouselook.OnMouseDown = function()
|
plate:SetScript("OnMouseDown", nil)
|
||||||
if arg1 and arg1 == "RightButton" then
|
end
|
||||||
MouselookStart()
|
end
|
||||||
|
|
||||||
-- start detection of the rightclick emulation
|
local hookOnDataChanged = nameplates.OnDataChanged
|
||||||
nameplates.mouselook.time = GetTime()
|
nameplates.OnDataChanged = function(self, nameplate)
|
||||||
nameplates.mouselook.frame = this
|
hookOnDataChanged(self, nameplate)
|
||||||
nameplates.mouselook:Show()
|
|
||||||
end
|
-- 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
|
end
|
||||||
|
|
||||||
nameplates.mouselook:SetScript("OnUpdate", function()
|
-- if threshold is reached (0.5 second) no click action will follow
|
||||||
-- break here if nothing to do
|
if not IsMouselooking() and this.time + tonumber(C.nameplates["clickthreshold"]) < GetTime() then
|
||||||
if not this.time or not this.frame then
|
this:Hide()
|
||||||
this:Hide()
|
return
|
||||||
return
|
end
|
||||||
end
|
|
||||||
|
|
||||||
-- if threshold is reached (0.5 second) no click action will follow
|
-- run a usual nameplate rightclick action
|
||||||
if not IsMouselooking() and this.time + tonumber(C.nameplates["clickthreshold"]) < GetTime() then
|
if not IsMouselooking() then
|
||||||
this:Hide()
|
this.frame:Click("LeftButton")
|
||||||
return
|
if UnitCanAttack("player", "target") and not nameplates.combat.inCombat then AttackTarget() end
|
||||||
end
|
this:Hide()
|
||||||
|
return
|
||||||
-- run a usual nameplate rightclick action
|
end
|
||||||
if not IsMouselooking() then
|
end)
|
||||||
this.frame:Click("LeftButton")
|
|
||||||
if UnitCanAttack("player", "target") and not nameplates.combat.inCombat then AttackTarget() end
|
|
||||||
this:Hide()
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
pfUI.nameplates = nameplates
|
pfUI.nameplates = nameplates
|
||||||
end)
|
end)
|
||||||
@@ -97,11 +97,7 @@ pfUI:RegisterModule("questitem", function ()
|
|||||||
SelectQuestLogEntry(quest)
|
SelectQuestLogEntry(quest)
|
||||||
|
|
||||||
-- detect and ignore quest headers
|
-- detect and ignore quest headers
|
||||||
if pfUI.client <= 11200 then -- vanilla
|
_, _, _, header = GetQuestLogTitle(quest)
|
||||||
_, _, _, header = GetQuestLogTitle(quest)
|
|
||||||
elseif pfUI.client > 11200 then -- tbc
|
|
||||||
_, _, _, _, header = GetQuestLogTitle(quest)
|
|
||||||
end
|
|
||||||
|
|
||||||
if not header then
|
if not header then
|
||||||
text, objective = GetQuestLogQuestText()
|
text, objective = GetQuestLogQuestText()
|
||||||
|
|||||||
+3
-6
@@ -15,7 +15,7 @@ pfUI:RegisterModule("totems", "vanilla:tbc", function ()
|
|||||||
totems:RefreshList()
|
totems:RefreshList()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if pfUI.client <= 11200 and class == "SHAMAN" then
|
if class == "SHAMAN" then
|
||||||
-- there's no totem event in vanilla using ticks instead
|
-- there's no totem event in vanilla using ticks instead
|
||||||
local eventemu = CreateFrame("Frame")
|
local eventemu = CreateFrame("Frame")
|
||||||
eventemu:SetScript("OnUpdate", function()
|
eventemu:SetScript("OnUpdate", function()
|
||||||
@@ -39,13 +39,10 @@ end
|
|||||||
end
|
end
|
||||||
|
|
||||||
totems.OnClick = function(self)
|
totems.OnClick = function(self)
|
||||||
if pfUI.client <= 11200 and this.id and arg1 and arg1 == "LeftButton" then
|
if this.id and arg1 and arg1 == "LeftButton" then
|
||||||
-- Try to recast totem on left click in vanilla
|
-- Try to recast totem on left click
|
||||||
local active, name, start, duration, icon = GetTotemInfo(this.id)
|
local active, name, start, duration, icon = GetTotemInfo(this.id)
|
||||||
if name then CastSpellByName(name) end
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -83,40 +83,29 @@ end})
|
|||||||
local _, _, _, client = GetBuildInfo()
|
local _, _, _, client = GetBuildInfo()
|
||||||
client = client or 11200
|
client = client or 11200
|
||||||
|
|
||||||
-- detect client expansion
|
pfUI.expansion = "vanilla"
|
||||||
if client >= 20000 and client <= 20400 then
|
pfUI.client = client
|
||||||
pfUI.expansion = "tbc"
|
|
||||||
pfUI.client = client
|
|
||||||
elseif client >= 30000 and client <= 30300 then
|
|
||||||
pfUI.expansion = "wotlk"
|
|
||||||
pfUI.client = client
|
|
||||||
else
|
|
||||||
pfUI.expansion = "vanilla"
|
|
||||||
pfUI.client = client
|
|
||||||
end
|
|
||||||
|
|
||||||
-- setup pfUI namespace
|
-- setup pfUI namespace
|
||||||
setmetatable(pfUI.env, {__index = getfenv(0)})
|
setmetatable(pfUI.env, {__index = getfenv(0)})
|
||||||
|
|
||||||
function pfUI:UpdateColors()
|
function pfUI:UpdateColors()
|
||||||
if pfUI.expansion == "vanilla" then
|
-- update table to get unknown colors and blue shamans for vanilla
|
||||||
-- update table to get unknown colors and blue shamans for vanilla
|
RAID_CLASS_COLORS = {
|
||||||
RAID_CLASS_COLORS = {
|
["WARRIOR"] = { r = 0.78, g = 0.61, b = 0.43, colorStr = "ffc79c6e" },
|
||||||
["WARRIOR"] = { r = 0.78, g = 0.61, b = 0.43, colorStr = "ffc79c6e" },
|
["MAGE"] = { r = 0.41, g = 0.8, b = 0.94, colorStr = "ff69ccf0" },
|
||||||
["MAGE"] = { r = 0.41, g = 0.8, b = 0.94, colorStr = "ff69ccf0" },
|
["ROGUE"] = { r = 1, g = 0.96, b = 0.41, colorStr = "fffff569" },
|
||||||
["ROGUE"] = { r = 1, g = 0.96, b = 0.41, colorStr = "fffff569" },
|
["DRUID"] = { r = 1, g = 0.49, b = 0.04, colorStr = "ffff7d0a" },
|
||||||
["DRUID"] = { r = 1, g = 0.49, b = 0.04, colorStr = "ffff7d0a" },
|
["HUNTER"] = { r = 0.67, g = 0.83, b = 0.45, colorStr = "ffabd473" },
|
||||||
["HUNTER"] = { r = 0.67, g = 0.83, b = 0.45, colorStr = "ffabd473" },
|
["SHAMAN"] = { r = 0.14, g = 0.35, b = 1.0, colorStr = "ff0070de" },
|
||||||
["SHAMAN"] = { r = 0.14, g = 0.35, b = 1.0, colorStr = "ff0070de" },
|
["PRIEST"] = { r = 1, g = 1, b = 1, colorStr = "ffffffff" },
|
||||||
["PRIEST"] = { r = 1, g = 1, b = 1, colorStr = "ffffffff" },
|
["WARLOCK"] = { r = 0.58, g = 0.51, b = 0.79, colorStr = "ff9482c9" },
|
||||||
["WARLOCK"] = { r = 0.58, g = 0.51, b = 0.79, colorStr = "ff9482c9" },
|
["PALADIN"] = { r = 0.96, g = 0.55, b = 0.73, colorStr = "fff58cba" },
|
||||||
["PALADIN"] = { r = 0.96, g = 0.55, b = 0.73, colorStr = "fff58cba" },
|
}
|
||||||
}
|
|
||||||
|
|
||||||
RAID_CLASS_COLORS = setmetatable(RAID_CLASS_COLORS, { __index = function(tab,key)
|
RAID_CLASS_COLORS = setmetatable(RAID_CLASS_COLORS, { __index = function(tab,key)
|
||||||
return { r = 0.6, g = 0.6, b = 0.6, colorStr = "ff999999" }
|
return { r = 0.6, g = 0.6, b = 0.6, colorStr = "ff999999" }
|
||||||
end})
|
end})
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function pfUI:UpdateFonts()
|
function pfUI:UpdateFonts()
|
||||||
@@ -125,34 +114,20 @@ function pfUI:UpdateFonts()
|
|||||||
|
|
||||||
-- load font configuration
|
-- load font configuration
|
||||||
local default, tooltip, unit, unit_name, combat
|
local default, tooltip, unit, unit_name, combat
|
||||||
if pfUI_config.global.force_region == "1" and GetLocale() == "zhCN" and pfUI.expansion == "vanilla" then
|
if pfUI_config.global.force_region == "1" and GetLocale() == "zhCN" then
|
||||||
-- force locale compatible fonts (zhCN 1.12)
|
-- force locale compatible fonts (zhCN 1.12)
|
||||||
default = "Fonts\\FZXHLJW.TTF"
|
default = "Fonts\\FZXHLJW.TTF"
|
||||||
tooltip = "Fonts\\FZXHLJW.TTF"
|
tooltip = "Fonts\\FZXHLJW.TTF"
|
||||||
combat = "Fonts\\FZXHLJW.TTF"
|
combat = "Fonts\\FZXHLJW.TTF"
|
||||||
unit = "Fonts\\FZXHLJW.TTF"
|
unit = "Fonts\\FZXHLJW.TTF"
|
||||||
unit_name = "Fonts\\FZXHLJW.TTF"
|
unit_name = "Fonts\\FZXHLJW.TTF"
|
||||||
elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhCN" and pfUI.expansion == "tbc" then
|
elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhTW" then
|
||||||
-- force locale compatible fonts (zhCN 2.4.3)
|
|
||||||
default = "Fonts\\ZYHei.ttf"
|
|
||||||
tooltip = "Fonts\\ZYHei.ttf"
|
|
||||||
combat = "Fonts\\ZYKai_C.ttf"
|
|
||||||
unit = "Fonts\\ZYKai_T.ttf"
|
|
||||||
unit_name = "Fonts\\ZYHei.ttf"
|
|
||||||
elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhTW" and pfUI.expansion == "vanilla" then
|
|
||||||
-- force locale compatible fonts (zhTW 1.12)
|
-- force locale compatible fonts (zhTW 1.12)
|
||||||
default = "Fonts\\FZXHLJW.ttf"
|
default = "Fonts\\FZXHLJW.ttf"
|
||||||
tooltip = "Fonts\\FZXHLJW.ttf"
|
tooltip = "Fonts\\FZXHLJW.ttf"
|
||||||
combat = "Fonts\\FZXHLJW.ttf"
|
combat = "Fonts\\FZXHLJW.ttf"
|
||||||
unit = "Fonts\\FZXHLJW.ttf"
|
unit = "Fonts\\FZXHLJW.ttf"
|
||||||
unit_name = "Fonts\\FZXHLJW.ttf"
|
unit_name = "Fonts\\FZXHLJW.ttf"
|
||||||
elseif pfUI_config.global.force_region == "1" and GetLocale() == "zhTW" and pfUI.expansion == "tbc" then
|
|
||||||
-- force locale compatible fonts (zhTW 2.4.3)
|
|
||||||
default = "Fonts\\bHEI01B.ttf"
|
|
||||||
tooltip = "Fonts\\bHEI01B.ttf"
|
|
||||||
combat = "Fonts\\bHEI01B.ttf"
|
|
||||||
unit = "Fonts\\bHEI01B.ttf"
|
|
||||||
unit_name = "Fonts\\bHEI01B.ttf"
|
|
||||||
elseif pfUI_config.global.force_region == "1" and GetLocale() == "koKR" then
|
elseif pfUI_config.global.force_region == "1" and GetLocale() == "koKR" then
|
||||||
-- force locale compatible fonts (koKR)
|
-- force locale compatible fonts (koKR)
|
||||||
default = "Fonts\\2002.TTF"
|
default = "Fonts\\2002.TTF"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
pfUI:RegisterSkin("Friends", "vanilla:tbc", function ()
|
pfUI:RegisterSkin("Friends", "vanilla:tbc", function ()
|
||||||
local rawborder, border = GetBorderSize()
|
local rawborder, border = GetBorderSize()
|
||||||
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
|
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
|
||||||
local maxtab = pfUI.expansion == "vanilla" and 4 or 5
|
local maxtab = 4
|
||||||
|
|
||||||
StripTextures(FriendsFrame, true)
|
StripTextures(FriendsFrame, true)
|
||||||
CreateBackdrop(FriendsFrame, nil, nil, .75)
|
CreateBackdrop(FriendsFrame, nil, nil, .75)
|
||||||
|
|||||||
@@ -4,11 +4,7 @@ pfUI:RegisterSkin("Game Menu", "vanilla:tbc", function ()
|
|||||||
CreateBackdropShadow(GameMenuFrame)
|
CreateBackdropShadow(GameMenuFrame)
|
||||||
|
|
||||||
GameMenuFrame:SetWidth(GameMenuFrame:GetWidth() - 30)
|
GameMenuFrame:SetWidth(GameMenuFrame:GetWidth() - 30)
|
||||||
if pfUI.expansion == 'tbc' then
|
GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 6)
|
||||||
GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 10)
|
|
||||||
elseif pfUI.expansion == 'vanilla' then
|
|
||||||
GameMenuFrame:SetHeight(GameMenuFrame:GetHeight() + 6)
|
|
||||||
end
|
|
||||||
|
|
||||||
local title = GetNoNameObject(GameMenuFrame, "FontString", "ARTWORK", MAIN_MENU)
|
local title = GetNoNameObject(GameMenuFrame, "FontString", "ARTWORK", MAIN_MENU)
|
||||||
title:SetTextColor(1,1,1,1)
|
title:SetTextColor(1,1,1,1)
|
||||||
|
|||||||
@@ -2,18 +2,6 @@ pfUI:RegisterSkin("Help", "vanilla:tbc", function ()
|
|||||||
local rawborder, border = GetBorderSize()
|
local rawborder, border = GetBorderSize()
|
||||||
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
|
local bpad = rawborder > 1 and border - GetPerfectPixel() or GetPerfectPixel()
|
||||||
|
|
||||||
-- not much here for tbc yet
|
|
||||||
if pfUI.client > 11200 then
|
|
||||||
local ticket, background = TicketStatusFrame:GetChildren()
|
|
||||||
CreateBackdrop(background, nil, true, .75)
|
|
||||||
TicketStatusFrame:SetHeight(40)
|
|
||||||
TicketStatusFrame:ClearAllPoints()
|
|
||||||
TicketStatusFrame:SetPoint("TOP", 0, -5)
|
|
||||||
|
|
||||||
UpdateMovable(TicketStatusFrame)
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
StripTextures(HelpFrame)
|
StripTextures(HelpFrame)
|
||||||
CreateBackdrop(HelpFrame, nil, nil, .75)
|
CreateBackdrop(HelpFrame, nil, nil, .75)
|
||||||
CreateBackdropShadow(HelpFrame)
|
CreateBackdropShadow(HelpFrame)
|
||||||
|
|||||||
@@ -180,11 +180,7 @@ pfUI:RegisterSkin("Quest Log", "vanilla:tbc", function ()
|
|||||||
if C.questlog.showQuestLevels == "1" then
|
if C.questlog.showQuestLevels == "1" then
|
||||||
questIndex = i + FauxScrollFrame_GetOffset(QuestLogListScrollFrame)
|
questIndex = i + FauxScrollFrame_GetOffset(QuestLogListScrollFrame)
|
||||||
if questIndex <= numEntries then
|
if questIndex <= numEntries then
|
||||||
if pfUI.expansion == 'vanilla' then
|
text, level, questTag, isHeader = GetQuestLogTitle(questIndex)
|
||||||
text, level, questTag, isHeader = GetQuestLogTitle(questIndex)
|
|
||||||
else
|
|
||||||
text, level, questTag, _, isHeader = GetQuestLogTitle(questIndex)
|
|
||||||
end
|
|
||||||
if not isHeader then
|
if not isHeader then
|
||||||
_G["QuestLogTitle"..i]:SetText(" ".."["..(questTag and level.."+" or level).."] "..text)
|
_G["QuestLogTitle"..i]:SetText(" ".."["..(questTag and level.."+" or level).."] "..text)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user