mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-07 22:20:00 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd722b0f0f | ||
|
|
e5c51fff48 | ||
|
|
6570afb70a | ||
|
|
0f97e8b0bd | ||
|
|
64c62a2a25 | ||
|
|
4d316ed43a | ||
|
|
db0195f0f7 | ||
|
|
3d2d5f9254 | ||
|
|
dfbeeb454a | ||
|
|
439d5a397a | ||
|
|
5524ad3b91 | ||
|
|
0f59a3a9b5 | ||
|
|
ffdf376ac4 | ||
|
|
9bdde06150 | ||
|
|
8bf6672114 | ||
|
|
29b948e6fa |
+12
-12
@@ -28,12 +28,8 @@ function pfUI.api.HasNampower()
|
|||||||
return GetNampowerVersion and true or false
|
return GetNampowerVersion and true or false
|
||||||
end
|
end
|
||||||
|
|
||||||
local isTurtleWoW
|
|
||||||
function pfUI.api.IsTurtleWoW()
|
function pfUI.api.IsTurtleWoW()
|
||||||
if isTurtleWoW == nil then
|
return C_Spell.GetSpellTexture(46050) == "Interface\\Icons\\Trade_Survival"
|
||||||
isTurtleWoW = C_Spell.GetSpellTexture(46050) == "Interface\\Icons\\Trade_Survival"
|
|
||||||
end
|
|
||||||
return isTurtleWoW
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- [ GetUnitDistance ]
|
-- [ GetUnitDistance ]
|
||||||
@@ -434,13 +430,17 @@ function pfUI.api.GetBagFamily(bag)
|
|||||||
|
|
||||||
local id = GetInventoryItemID("player", ContainerIDToInventoryID(bag))
|
local id = GetInventoryItemID("player", ContainerIDToInventoryID(bag))
|
||||||
if id then
|
if id then
|
||||||
local _, _, _, _, _, itemType, subType = GetItemInfo(id)
|
-- classID 1 = Container (bags), 11 = Quiver
|
||||||
local bagsubtype = L["bagtypes"][subType]
|
-- Container subclasses: 0 = Bag (default), 1 = Soul Bag, 2+ = specialty (herb/enchanting/etc.)
|
||||||
|
-- Quiver subclasses: 2 = Quiver (arrows), 3 = Ammo Pouch (bullets)
|
||||||
if bagsubtype == "DEFAULT" then return "BAG" end
|
local _, _, _, _, _, classID, subClassID = C_Item.GetItemInfoInstant(id)
|
||||||
if bagsubtype == "SOULBAG" then return "SOULBAG" end
|
if classID == 1 then
|
||||||
if bagsubtype == "QUIVER" then return "QUIVER" end
|
if subClassID == 0 then return "BAG" end
|
||||||
if bagsubtype == nil then return "SPECIAL" end
|
if subClassID == 1 then return "SOULBAG" end
|
||||||
|
return "SPECIAL"
|
||||||
|
elseif classID == 11 then
|
||||||
|
return "QUIVER"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -1372,7 +1372,6 @@ function pfUI:MigrateConfig()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Remove "Show only own debuffs" from unitframes and nameplates
|
-- Remove "Show only own debuffs" from unitframes and nameplates
|
||||||
-- (feature was removed; only Target Debuff Bar in buffwatch keeps it)
|
-- (feature was removed; only Target Debuff Bar in buffwatch keeps it)
|
||||||
if pfUI_config.nameplates then
|
if pfUI_config.nameplates then
|
||||||
|
|||||||
+2
-3
@@ -1172,10 +1172,9 @@ function pfUI.api.CreateQuestionDialog(text, yes, no, editbox, onclose)
|
|||||||
local width = 200
|
local width = 200
|
||||||
|
|
||||||
-- delay the auto sizing, to make sure the font rendering happened
|
-- delay the auto sizing, to make sure the font rendering happened
|
||||||
question:SetScript("OnUpdate", function()
|
RunNextFrame(function()
|
||||||
if question.text:GetStringWidth() > width then width = question.text:GetStringWidth() end
|
if question.text:GetStringWidth() > width then width = question.text:GetStringWidth() end
|
||||||
question:SetWidth( width + 2*padding)
|
question:SetWidth(width + 2*padding)
|
||||||
this:SetScript("OnUpdate", nil)
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+12
-4
@@ -73,8 +73,8 @@ end
|
|||||||
|
|
||||||
local function BuffOnClick()
|
local function BuffOnClick()
|
||||||
if this:GetParent().label == "player" then
|
if this:GetParent().label == "player" then
|
||||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, "HELPFUL")
|
local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, "HELPFUL")
|
||||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -114,8 +114,8 @@ end
|
|||||||
|
|
||||||
local function DebuffOnClick()
|
local function DebuffOnClick()
|
||||||
if this:GetParent().label == "player" then
|
if this:GetParent().label == "player" then
|
||||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, "HARMFUL")
|
local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, "HARMFUL")
|
||||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1902,6 +1902,8 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
end
|
end
|
||||||
if duration > 0 then
|
if duration > 0 then
|
||||||
CooldownFrame_SetTimer(unit.buffs[i].cd, start, duration, 1)
|
CooldownFrame_SetTimer(unit.buffs[i].cd, start, duration, 1)
|
||||||
|
else
|
||||||
|
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
|
||||||
end
|
end
|
||||||
elseif aura.duration > 0 then
|
elseif aura.duration > 0 then
|
||||||
local guid = UnitGUID(unitstr)
|
local guid = UnitGUID(unitstr)
|
||||||
@@ -1912,6 +1914,8 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
else
|
else
|
||||||
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
|
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
CooldownFrame_SetTimer(unit.buffs[i].cd, 0, 0, 0)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
unit.buffs[i]:Hide()
|
unit.buffs[i]:Hide()
|
||||||
@@ -2005,7 +2009,11 @@ function pfUI.uf:RefreshUnit(unit, component)
|
|||||||
end
|
end
|
||||||
if duration > 0 then
|
if duration > 0 then
|
||||||
CooldownFrame_SetTimer(unit.debuffs[i].cd, start, duration, 1)
|
CooldownFrame_SetTimer(unit.debuffs[i].cd, start, duration, 1)
|
||||||
|
else
|
||||||
|
CooldownFrame_SetTimer(unit.debuffs[i].cd, 0, 0, 0)
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
CooldownFrame_SetTimer(unit.debuffs[i].cd, 0, 0, 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
if stacks > 1 then
|
if stacks > 1 then
|
||||||
|
|||||||
Vendored
-2620
File diff suppressed because it is too large
Load Diff
Vendored
-2634
File diff suppressed because it is too large
Load Diff
Vendored
-2628
File diff suppressed because it is too large
Load Diff
Vendored
-2625
File diff suppressed because it is too large
Load Diff
Vendored
-2591
File diff suppressed because it is too large
Load Diff
Vendored
-2628
File diff suppressed because it is too large
Load Diff
Vendored
-2612
File diff suppressed because it is too large
Load Diff
+5
-7
@@ -44,15 +44,13 @@ if GetNampowerVersion then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Nampower startup check: show version info and ensure CVars are set.
|
-- Nampower startup check: show version info and ensure CVars are set.
|
||||||
-- Runs on first OnUpdate after PLAYER_ENTERING_WORLD to give Nampower time to initialize.
|
-- Runs the frame after PLAYER_ENTERING_WORLD so Nampower has finished initializing.
|
||||||
local nampowerCheckFrame = CreateFrame("Frame")
|
local nampowerCheckFrame = CreateFrame("Frame")
|
||||||
nampowerCheckFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
nampowerCheckFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||||
nampowerCheckFrame:SetScript("OnEvent", function()
|
nampowerCheckFrame:SetScript("OnEvent", function()
|
||||||
-- Defer to next frame so Nampower is fully initialized
|
this:UnregisterAllEvents()
|
||||||
this:SetScript("OnUpdate", function()
|
this:SetScript("OnEvent", nil)
|
||||||
this:SetScript("OnUpdate", nil)
|
RunNextFrame(function()
|
||||||
this:UnregisterAllEvents()
|
|
||||||
this:SetScript("OnEvent", nil)
|
|
||||||
|
|
||||||
if GetNampowerVersion then
|
if GetNampowerVersion then
|
||||||
local major, minor, patch = GetNampowerVersion()
|
local major, minor, patch = GetNampowerVersion()
|
||||||
@@ -967,7 +965,7 @@ if hasNampower then
|
|||||||
-- Channel interrupted by player - clear ownDebuffs for the channeled spell
|
-- Channel interrupted by player - clear ownDebuffs for the channeled spell
|
||||||
-- via C_Spell.ChannelInfo. DEBUFF_REMOVED fires later (0.5-1s server lag),
|
-- via C_Spell.ChannelInfo. DEBUFF_REMOVED fires later (0.5-1s server lag),
|
||||||
-- causing phantom debuff display without this pre-clear.
|
-- causing phantom debuff display without this pre-clear.
|
||||||
local spellName = select(1, C_Spell.ChannelInfo())
|
local spellName = C_Spell.ChannelInfo()
|
||||||
if spellName then
|
if spellName then
|
||||||
local targetGuid = UnitGUID and UnitGUID("target")
|
local targetGuid = UnitGUID and UnitGUID("target")
|
||||||
if targetGuid and ownDebuffs[targetGuid] and ownDebuffs[targetGuid][spellName] then
|
if targetGuid and ownDebuffs[targetGuid] and ownDebuffs[targetGuid][spellName] then
|
||||||
|
|||||||
+4
-14
@@ -134,19 +134,9 @@ pfUI:RegisterModule("addoncompat", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- run the addonconflict queue when firstrun is ready
|
-- run the addonconflict queue when firstrun is ready
|
||||||
local delay = CreateFrame("Frame")
|
if pfUI.firstrun and pfUI.firstrun.completed then
|
||||||
delay:SetScript("OnUpdate", function()
|
|
||||||
-- throttle to to one query per .1 second
|
|
||||||
if ( this.tick or 1) > GetTime() then return else this.tick = GetTime() + .1 end
|
|
||||||
|
|
||||||
-- make sure the firstrun dialog has finished
|
|
||||||
if pfUI.firstrun and pfUI.firstrun.steps then
|
|
||||||
for _, step in pairs(pfUI.firstrun.steps) do
|
|
||||||
if not pfUI_init[step.name] then return end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
RunQueue()
|
RunQueue()
|
||||||
this:SetScript("OnUpdate", nil)
|
else
|
||||||
end)
|
pfUI.events:RegisterCallback("firstrun:complete", RunQueue, "addoncompat")
|
||||||
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -19,12 +19,7 @@ pfUI:RegisterModule("autovendor", function ()
|
|||||||
local startGold = GetMoney()
|
local startGold = GetMoney()
|
||||||
C_MerchantFrame.SellAllJunkItems()
|
C_MerchantFrame.SellAllJunkItems()
|
||||||
|
|
||||||
local reporter = CreateFrame("Frame")
|
C_Timer.After(0.3, function()
|
||||||
reporter.deadline = GetTime() + 0.3
|
|
||||||
reporter:SetScript("OnUpdate", function()
|
|
||||||
if GetTime() < this.deadline then return end
|
|
||||||
this:SetScript("OnUpdate", nil)
|
|
||||||
this:Hide()
|
|
||||||
local income = GetMoney() - startGold
|
local income = GetMoney() - startGold
|
||||||
if income > 0 then
|
if income > 0 then
|
||||||
DEFAULT_CHAT_FRAME:AddMessage(T["Your vendor trash has been sold and you earned"] .. " " .. CreateGoldString(income))
|
DEFAULT_CHAT_FRAME:AddMessage(T["Your vendor trash has been sold and you earned"] .. " " .. CreateGoldString(income))
|
||||||
|
|||||||
+3
-3
@@ -12,7 +12,9 @@ pfUI:RegisterModule("bubbles", function ()
|
|||||||
pfUI.bubbles:RegisterEvent("CHAT_MSG_MONSTER_PARTY")
|
pfUI.bubbles:RegisterEvent("CHAT_MSG_MONSTER_PARTY")
|
||||||
|
|
||||||
pfUI.bubbles:SetScript("OnEvent", function()
|
pfUI.bubbles:SetScript("OnEvent", function()
|
||||||
pfUI.bubbles:SetScript("OnUpdate", pfUI.bubbles.ScanBubbles)
|
-- Bubble frames are attached to WorldFrame after the chat event fires,
|
||||||
|
-- so wait one tick before scanning.
|
||||||
|
RunNextFrame(function() pfUI.bubbles:ScanBubbles() end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
function pfUI.bubbles:IsBubble(f)
|
function pfUI.bubbles:IsBubble(f)
|
||||||
@@ -66,7 +68,5 @@ pfUI:RegisterModule("bubbles", function ()
|
|||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pfUI.bubbles:SetScript("OnUpdate", nil)
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|||||||
+3
-3
@@ -60,6 +60,7 @@ pfUI:RegisterModule("buff", function ()
|
|||||||
buff.mode = buff.btype
|
buff.mode = buff.btype
|
||||||
buff.expirationTime = aura.expirationTime
|
buff.expirationTime = aura.expirationTime
|
||||||
buff.stackCount = aura.applications
|
buff.stackCount = aura.applications
|
||||||
|
buff.spellId = aura.spellId
|
||||||
buff.texture:SetTexture(aura.icon)
|
buff.texture:SetTexture(aura.icon)
|
||||||
|
|
||||||
if buff.btype == "HARMFUL" then
|
if buff.btype == "HARMFUL" then
|
||||||
@@ -146,9 +147,8 @@ pfUI:RegisterModule("buff", function ()
|
|||||||
CancelItemTempEnchantment(1)
|
CancelItemTempEnchantment(1)
|
||||||
elseif CancelItemTempEnchantment and this.mode and this.mode == "OFFHAND" then
|
elseif CancelItemTempEnchantment and this.mode and this.mode == "OFFHAND" then
|
||||||
CancelItemTempEnchantment(2)
|
CancelItemTempEnchantment(2)
|
||||||
else
|
elseif this.spellId then
|
||||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, this.btype)
|
C_Spell.CancelSpellByID(this.spellId)
|
||||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ pfUI:RegisterModule("buffwatch", function ()
|
|||||||
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc" .. skill .. "|r" .. T["is now blacklisted."])
|
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc" .. skill .. "|r" .. T["is now blacklisted."])
|
||||||
end
|
end
|
||||||
elseif this.parent.unit == "player" then
|
elseif this.parent.unit == "player" then
|
||||||
local bid = GetPlayerBuff(PLAYER_BUFF_START_ID + this.id, this.type)
|
local aura = C_UnitAuras.GetAuraDataByIndex("player", this.id, this.type)
|
||||||
if bid >= 0 then CancelPlayerBuff(bid) end
|
if aura and aura.spellId then C_Spell.CancelSpellByID(aura.spellId) end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
+125
-219
@@ -1,243 +1,149 @@
|
|||||||
pfUI:RegisterModule("eqcompare", function ()
|
pfUI:RegisterModule("eqcompare", function ()
|
||||||
local sides = { "Left", "Right" }
|
pfUI.eqcompare = {}
|
||||||
local loc = pfUI.cache["locale"]
|
|
||||||
for key, value in pairs(L["itemtypes"]) do setglobal(key, value) end
|
|
||||||
INVTYPE_WEAPON_OTHER = INVTYPE_WEAPON.."_other"
|
|
||||||
INVTYPE_FINGER_OTHER = INVTYPE_FINGER.."_other"
|
|
||||||
INVTYPE_TRINKET_OTHER = INVTYPE_TRINKET.."_other"
|
|
||||||
|
|
||||||
local function AddHeader(tooltip)
|
local function ShowCompareItem(self, link, shift)
|
||||||
local name = tooltip:GetName()
|
self = self or GameTooltip
|
||||||
|
|
||||||
-- shift all entries one line down
|
if not link or (not IsShiftKeyDown() and (C.tooltip.compare.showalways ~= "1" or C_Item.IsEquippedItem(link))) then
|
||||||
for i=tooltip:NumLines(), 1, -1 do
|
return
|
||||||
for _, side in pairs(sides) do
|
end
|
||||||
local current = _G[name.."Text"..side..i]
|
|
||||||
local below = _G[name.."Text"..side..i+1]
|
|
||||||
|
|
||||||
if current and current:IsShown() then
|
local shoppingTooltip1, shoppingTooltip2 = unpack(self.shoppingTooltips or { ShoppingTooltip1, ShoppingTooltip2 });
|
||||||
local text = current:GetText()
|
|
||||||
local r, g, b = current:GetTextColor()
|
|
||||||
|
|
||||||
if text and text ~= "" then
|
local SEPARATION = 6;
|
||||||
if tooltip:NumLines() < i+1 then
|
local backdrop = shoppingTooltip1.GetBackdrop and shoppingTooltip1:GetBackdrop();
|
||||||
-- add new line if required
|
local GAP = SEPARATION + ((type(backdrop) == "table" and backdrop.edgeSize) or 0);
|
||||||
tooltip:AddLine(text, r, g, b, true)
|
|
||||||
else
|
|
||||||
-- update existing lines
|
|
||||||
below:SetText(text)
|
|
||||||
below:SetTextColor(r, g, b)
|
|
||||||
below:Show()
|
|
||||||
|
|
||||||
-- hide processed line
|
local item1 = nil;
|
||||||
current:Hide()
|
local item2 = nil;
|
||||||
end
|
local side = "left";
|
||||||
end
|
if ( shoppingTooltip1:SetHyperlinkCompareItem(link, 1, shift, self) ) then
|
||||||
end
|
item1 = true;
|
||||||
|
end
|
||||||
|
if ( shoppingTooltip2:SetHyperlinkCompareItem(link, 2, shift, self) ) then
|
||||||
|
item2 = true;
|
||||||
|
end
|
||||||
|
|
||||||
|
-- find correct side
|
||||||
|
local rightDist = 0;
|
||||||
|
local leftPos = self:GetLeft();
|
||||||
|
local rightPos = self:GetRight();
|
||||||
|
if ( not rightPos ) then
|
||||||
|
rightPos = 0;
|
||||||
|
end
|
||||||
|
if ( not leftPos ) then
|
||||||
|
leftPos = 0;
|
||||||
|
end
|
||||||
|
|
||||||
|
rightDist = GetScreenWidth() - rightPos;
|
||||||
|
|
||||||
|
if (leftPos and (rightDist < leftPos)) then
|
||||||
|
side = "left";
|
||||||
|
else
|
||||||
|
side = "right";
|
||||||
|
end
|
||||||
|
|
||||||
|
-- see if we should slide the tooltip
|
||||||
|
if ( self:GetAnchorType() and self:GetAnchorType() ~= "ANCHOR_PRESERVE" ) then
|
||||||
|
local totalWidth = 0;
|
||||||
|
if ( item1 ) then
|
||||||
|
totalWidth = totalWidth + shoppingTooltip1:GetWidth();
|
||||||
|
end
|
||||||
|
if ( item2 ) then
|
||||||
|
totalWidth = totalWidth + shoppingTooltip2:GetWidth();
|
||||||
|
end
|
||||||
|
|
||||||
|
if ( (side == "left") and (totalWidth > leftPos) ) then
|
||||||
|
self:SetAnchorType(self:GetAnchorType(), (totalWidth - leftPos), 0);
|
||||||
|
elseif ( (side == "right") and (rightPos + totalWidth) > GetScreenWidth() ) then
|
||||||
|
self:SetAnchorType(self:GetAnchorType(), -((rightPos + totalWidth) - GetScreenWidth()), 0);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- add label to first line
|
if ( item1 ) then
|
||||||
_G[name.."TextLeft1"]:SetTextColor(.5, .5, .5, 1)
|
shoppingTooltip1:SetOwner(self, "ANCHOR_NONE");
|
||||||
_G[name.."TextLeft1"]:SetText(CURRENTLY_EQUIPPED)
|
shoppingTooltip1:ClearAllPoints();
|
||||||
_G[name.."TextLeft1"]:Show()
|
if ( side and side == "left" ) then
|
||||||
|
shoppingTooltip1:SetPoint("TOPRIGHT", self, "TOPLEFT", -GAP, -10);
|
||||||
|
else
|
||||||
|
shoppingTooltip1:SetPoint("TOPLEFT", self, "TOPRIGHT", GAP, -10);
|
||||||
|
end
|
||||||
|
shoppingTooltip1:SetHyperlinkCompareItem(link, 1, shift, self);
|
||||||
|
shoppingTooltip1:Show();
|
||||||
|
|
||||||
-- update tooltip sizes
|
if ( item2 ) then
|
||||||
tooltip:Show()
|
shoppingTooltip2:SetOwner(shoppingTooltip1, "ANCHOR_NONE");
|
||||||
|
shoppingTooltip2:ClearAllPoints();
|
||||||
|
if ( side and side == "left" ) then
|
||||||
|
shoppingTooltip2:SetPoint("TOPRIGHT", shoppingTooltip1, "TOPLEFT", -GAP, 0);
|
||||||
|
else
|
||||||
|
shoppingTooltip2:SetPoint("TOPLEFT", shoppingTooltip1, "TOPRIGHT", GAP, 0);
|
||||||
|
end
|
||||||
|
shoppingTooltip2:SetHyperlinkCompareItem(link, 2, shift, self);
|
||||||
|
shoppingTooltip2:Show();
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local slotTable = {
|
local prevMerchant = ShoppingTooltip1.SetMerchantCompareItem
|
||||||
[INVTYPE_2HWEAPON] = "MainHandSlot",
|
local function SetMerchantCompareItem(self, index, compareItem)
|
||||||
[INVTYPE_BODY] = "ShirtSlot",
|
if C.tooltip.compare.basestats == "1" and compareItem == 1 then
|
||||||
[INVTYPE_CHEST] = "ChestSlot",
|
ShowCompareItem(nil, GetMerchantItemLink(index))
|
||||||
[INVTYPE_CLOAK] = "BackSlot",
|
return false
|
||||||
[INVTYPE_FEET] = "FeetSlot",
|
end
|
||||||
[INVTYPE_FINGER] = "Finger0Slot",
|
return prevMerchant and prevMerchant(self, index, compareItem)
|
||||||
[INVTYPE_FINGER_OTHER] = "Finger1Slot",
|
end
|
||||||
[INVTYPE_HAND] = "HandsSlot",
|
|
||||||
[INVTYPE_HEAD] = "HeadSlot",
|
|
||||||
[INVTYPE_HOLDABLE] = "SecondaryHandSlot",
|
|
||||||
[INVTYPE_LEGS] = "LegsSlot",
|
|
||||||
[INVTYPE_NECK] = "NeckSlot",
|
|
||||||
[INVTYPE_RANGED] = "RangedSlot",
|
|
||||||
[INVTYPE_RELIC] = "RangedSlot",
|
|
||||||
[INVTYPE_ROBE] = "ChestSlot",
|
|
||||||
[INVTYPE_SHIELD] = "SecondaryHandSlot",
|
|
||||||
[INVTYPE_SHOULDER] = "ShoulderSlot",
|
|
||||||
[INVTYPE_TABARD] = "TabardSlot",
|
|
||||||
[INVTYPE_TRINKET] = "Trinket0Slot",
|
|
||||||
[INVTYPE_TRINKET_OTHER] = "Trinket1Slot",
|
|
||||||
[INVTYPE_WAIST] = "WaistSlot",
|
|
||||||
[INVTYPE_WEAPON] = "MainHandSlot",
|
|
||||||
[INVTYPE_WEAPON_OTHER] = "SecondaryHandSlot",
|
|
||||||
[INVTYPE_WEAPONMAINHAND] = "MainHandSlot",
|
|
||||||
[INVTYPE_WEAPONOFFHAND] = "SecondaryHandSlot",
|
|
||||||
[INVTYPE_WRIST] = "WristSlot",
|
|
||||||
|
|
||||||
[INVTYPE_WAND] = "RangedSlot",
|
local prevAuction = ShoppingTooltip1.SetAuctionCompareItem
|
||||||
[INVTYPE_GUN] = "RangedSlot",
|
local function SetAuctionCompareItem(self, type, index, compareItem)
|
||||||
[INVTYPE_PROJECTILE] = "AmmoSlot",
|
if C.tooltip.compare.basestats == "1" and compareItem == 1 then
|
||||||
[INVTYPE_CROSSBOW] = "RangedSlot",
|
ShowCompareItem(nil, GetAuctionItemLink(type, index))
|
||||||
[INVTYPE_THROWN] = "RangedSlot",
|
return false
|
||||||
|
end
|
||||||
|
return prevAuction and prevAuction(self, type, index, compareItem)
|
||||||
|
end
|
||||||
|
|
||||||
|
ShoppingTooltip1.SetMerchantCompareItem = SetMerchantCompareItem
|
||||||
|
ShoppingTooltip2.SetMerchantCompareItem = SetMerchantCompareItem
|
||||||
|
ShoppingTooltip1.SetAuctionCompareItem = SetAuctionCompareItem
|
||||||
|
ShoppingTooltip2.SetAuctionCompareItem = SetAuctionCompareItem
|
||||||
|
|
||||||
|
local TooltipHooks = {
|
||||||
|
SetLootRollItem = GetLootRollItemLink,
|
||||||
|
SetLootItem = GetLootSlotItemLink,
|
||||||
|
SetQuestLogItem = GetQuestLogItemLink,
|
||||||
|
SetQuestItem = GetQuestItemLink,
|
||||||
|
SetHyperlink = function(link) return link end,
|
||||||
|
SetBagItem = GetContainerItemLink,
|
||||||
|
SetInboxItem = GetInboxItemLink,
|
||||||
|
SetInventoryItem = GetInventoryItemLink,
|
||||||
|
SetTradeSkillItem = function(skillIndex, reagentIndex)
|
||||||
|
if reagentIndex then
|
||||||
|
return GetTradeSkillReagentItemLink(skillIndex, reagentIndex)
|
||||||
|
else
|
||||||
|
return GetTradeSkillItemLink(skillIndex)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
SetAuctionSellItem = GetAuctionSellItemLink,
|
||||||
|
SetTradePlayerItem = GetTradePlayerItemLink,
|
||||||
|
SetTradeTargetItem = GetTradeTargetItemLink
|
||||||
}
|
}
|
||||||
|
|
||||||
local function startsWith(str, start)
|
local function makeHook(getter)
|
||||||
return string.sub(str, 1, string.len(start)) == start
|
return function(tooltip, arg1, arg2, arg3)
|
||||||
end
|
if C.tooltip.compare.basestats == "1" then
|
||||||
|
ShowCompareItem(tooltip, getter(arg1, arg2, arg3))
|
||||||
local function ExtractAttributes(tooltip)
|
|
||||||
local name = tooltip:GetName()
|
|
||||||
|
|
||||||
-- get the name/header of the last set comparison tooltip
|
|
||||||
local comparetooltip = pfUI.eqcompare.tooltip:GetName()
|
|
||||||
local iname = _G[comparetooltip .. "TextLeft1"] and _G[comparetooltip .. "TextLeft1"]:GetText()
|
|
||||||
|
|
||||||
-- only run once per item
|
|
||||||
if tooltip.pfCompLastName == iname then return end
|
|
||||||
|
|
||||||
tooltip.pfCompData = {}
|
|
||||||
tooltip.pfCompLastName = iname
|
|
||||||
|
|
||||||
for i=1,30 do
|
|
||||||
local widget = _G[name.."TextLeft"..i]
|
|
||||||
if widget and widget:GetObjectType() == "FontString" then
|
|
||||||
local text = widget:GetText()
|
|
||||||
if text and not string.find(text, "-", 1, true) then
|
|
||||||
local start = 1
|
|
||||||
if startsWith(text, "\+") or startsWith(text, "\(") then start = 2 end
|
|
||||||
|
|
||||||
local space = string.find(text, " ", 1, true)
|
|
||||||
if space then
|
|
||||||
local value = tonumber(string.sub(text, start, space-1))
|
|
||||||
if value and text then
|
|
||||||
-- we've found an attr
|
|
||||||
local attr = string.sub(text, space, string.len(text))
|
|
||||||
tooltip.pfCompData[attr] = { value = tonumber(value), widget = widget }
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function CompareAttributes(data, targetData)
|
local function HookTooltip(tooltip)
|
||||||
if not data then return end
|
for setter, getter in pairs(TooltipHooks) do
|
||||||
|
_G['hooksecurefunc'](tooltip, setter, makeHook(getter))
|
||||||
for attr,v in pairs(data) do
|
|
||||||
if targetData then
|
|
||||||
local target = targetData[attr]
|
|
||||||
if target then
|
|
||||||
if v.value ~= target.value and v.widget:GetText() then
|
|
||||||
if v.value > target.value then
|
|
||||||
if not strfind(v.widget:GetText(), "|cff88ff88") and not strfind(v.widget:GetText(), "|cffff8888") then
|
|
||||||
v.widget:SetText(v.widget:GetText() .. "|cff88ff88 (+" .. round(v.value - target.value, 1) .. ")")
|
|
||||||
end
|
|
||||||
elseif not v.widget.compSet then
|
|
||||||
if not strfind(v.widget:GetText(), "|cff88ff88") and not strfind(v.widget:GetText(), "|cffff8888") then
|
|
||||||
v.widget:SetText(v.widget:GetText() .. "|cffff8888 (-" .. round(target.value - v.value, 1) .. ")")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
target.processed = true
|
|
||||||
else
|
|
||||||
target.processed = true
|
|
||||||
end
|
|
||||||
else
|
|
||||||
-- this attribute doesnt exist in target
|
|
||||||
if v.widget and v.widget:GetText() then
|
|
||||||
if not strfind(v.widget:GetText(), "|cff88ff88") and not strfind(v.widget:GetText(), "|cffff8888") then
|
|
||||||
v.widget:SetText(v.widget:GetText() .. "|cff88ff88 (+" .. v.value .. ")")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for _,target in pairs(targetData) do
|
|
||||||
if target and not target.processed then
|
|
||||||
-- we are an extra value
|
|
||||||
local text = target.widget:GetText()
|
|
||||||
if text and not strfind(text, "|cff88ff88") and not strfind(text, "|cffff8888") then
|
|
||||||
target.widget:SetText(text .. "|cff88ff88 (+" .. target.value .. ")")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
pfUI.eqcompare = {}
|
HookTooltip(GameTooltip)
|
||||||
pfUI.eqcompare.GameTooltipShow = function()
|
|
||||||
-- use this tooltip for the next comparison
|
|
||||||
pfUI.eqcompare.tooltip = this
|
|
||||||
|
|
||||||
if not IsShiftKeyDown() and C.tooltip.compare.showalways ~= "1" then return end
|
pfUI.eqcompare.HookTooltip = HookTooltip
|
||||||
local rawborder, border = GetBorderSize()
|
|
||||||
|
|
||||||
for i=1,this:NumLines() do
|
|
||||||
local tmpText = _G[this:GetName() .. "TextLeft"..i]
|
|
||||||
for slotType, slotName in pairs(slotTable) do
|
|
||||||
if tmpText:GetText() == slotType then
|
|
||||||
local slotID = GetInventorySlotInfo(slotTable[slotType])
|
|
||||||
|
|
||||||
-- determine screen part
|
|
||||||
local ltrigger = GetScreenWidth() / 2
|
|
||||||
local x = GetCursorPosition()
|
|
||||||
x = x / UIParent:GetEffectiveScale()
|
|
||||||
if x > ltrigger then ltrigger = nil end
|
|
||||||
|
|
||||||
-- first tooltip
|
|
||||||
ShoppingTooltip1:SetOwner(this, "ANCHOR_NONE")
|
|
||||||
ShoppingTooltip1:ClearAllPoints()
|
|
||||||
|
|
||||||
if ltrigger then
|
|
||||||
ShoppingTooltip1:SetPoint("BOTTOMLEFT", this, "BOTTOMRIGHT", 0, 0)
|
|
||||||
else
|
|
||||||
ShoppingTooltip1:SetPoint("BOTTOMRIGHT", this, "BOTTOMLEFT", -border*2-1, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
ShoppingTooltip1:SetInventoryItem("player", slotID)
|
|
||||||
ShoppingTooltip1:Show()
|
|
||||||
AddHeader(ShoppingTooltip1)
|
|
||||||
|
|
||||||
-- second tooltip
|
|
||||||
if slotTable[slotType .. "_other"] then
|
|
||||||
local slotID_other = GetInventorySlotInfo(slotTable[slotType .. "_other"])
|
|
||||||
|
|
||||||
ShoppingTooltip2:SetOwner(this, "ANCHOR_NONE")
|
|
||||||
ShoppingTooltip2:ClearAllPoints()
|
|
||||||
|
|
||||||
if ltrigger then
|
|
||||||
ShoppingTooltip2:SetPoint("BOTTOMLEFT", ShoppingTooltip1, "BOTTOMRIGHT", 0, 0)
|
|
||||||
else
|
|
||||||
ShoppingTooltip2:SetPoint("BOTTOMRIGHT", ShoppingTooltip1, "BOTTOMLEFT", -border*2-1, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
ShoppingTooltip2:SetInventoryItem("player", slotID_other)
|
|
||||||
ShoppingTooltip2:Show()
|
|
||||||
AddHeader(ShoppingTooltip2)
|
|
||||||
end
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- add HookScript method if not already existing
|
|
||||||
GameTooltip.HookScript = GameTooltip.HookScript or HookScript
|
|
||||||
ShoppingTooltip1.HookScript = ShoppingTooltip1.HookScript or HookScript
|
|
||||||
ShoppingTooltip2.HookScript = ShoppingTooltip2.HookScript or HookScript
|
|
||||||
|
|
||||||
pfUI.eqcompare.ShoppingTooltipShow = function()
|
|
||||||
-- abort if no comparison tooltip has been set
|
|
||||||
if not pfUI.eqcompare.tooltip then return end
|
|
||||||
|
|
||||||
ExtractAttributes(this)
|
|
||||||
ExtractAttributes(pfUI.eqcompare.tooltip)
|
|
||||||
CompareAttributes(pfUI.eqcompare.tooltip.pfCompData, this.pfCompData)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- Add Gametooltip Hooks
|
|
||||||
GameTooltip:HookScript("OnShow", pfUI.eqcompare.GameTooltipShow)
|
|
||||||
if C.tooltip.compare.basestats == "1" then
|
|
||||||
ShoppingTooltip1:HookScript("OnShow", pfUI.eqcompare.ShoppingTooltipShow)
|
|
||||||
ShoppingTooltip2:HookScript("OnShow", pfUI.eqcompare.ShoppingTooltipShow)
|
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ pfUI:RegisterModule("firstrun", function ()
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if not self.completed then
|
||||||
|
self.completed = true
|
||||||
|
pfUI.events:TriggerEvent("firstrun:complete")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- main function to create wizard windows
|
-- main function to create wizard windows
|
||||||
|
|||||||
+1
-3
@@ -50,10 +50,8 @@ function SlashCmdList.PFFOCUSNAME(msg)
|
|||||||
FocusUnit("target")
|
FocusUnit("target")
|
||||||
end
|
end
|
||||||
|
|
||||||
local restore = CreateFrame("Frame")
|
RunNextFrame(function()
|
||||||
restore:SetScript("OnUpdate", function()
|
|
||||||
UIErrorsFrame:RegisterEvent("UI_ERROR_MESSAGE")
|
UIErrorsFrame:RegisterEvent("UI_ERROR_MESSAGE")
|
||||||
restore:SetScript("OnUpdate", nil)
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if prevGUID and prevGUID ~= "0x0000000000000000" then
|
if prevGUID and prevGUID ~= "0x0000000000000000" then
|
||||||
|
|||||||
+21
-1
@@ -212,6 +212,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
if not this:GetParent():IsShown() then
|
if not this:GetParent():IsShown() then
|
||||||
category[config] = r .. "," .. g .. "," .. b .. "," .. a
|
category[config] = r .. "," .. g .. "," .. b .. "," .. a
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -278,6 +279,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
if this:GetText() ~= this:GetParent().category[this:GetParent().config] then
|
if this:GetText() ~= this:GetParent().category[this:GetParent().config] then
|
||||||
this:GetParent().category[this:GetParent().config] = this:GetText()
|
this:GetParent().category[this:GetParent().config] = this:GetText()
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
end
|
end
|
||||||
this:SetTextColor(.2,1,.8,1)
|
this:SetTextColor(.2,1,.8,1)
|
||||||
else
|
else
|
||||||
@@ -328,6 +330,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
end
|
end
|
||||||
|
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
if category[config] == "1" then frame.input:SetChecked() end
|
if category[config] == "1" then frame.input:SetChecked() end
|
||||||
@@ -360,6 +363,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
if category and category[config] ~= value then
|
if category and category[config] ~= value then
|
||||||
category[config] = value
|
category[config] = value
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -394,6 +398,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
end
|
end
|
||||||
category[config] = newconf
|
category[config] = newconf
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
frame.input:UpdateMenu()
|
frame.input:UpdateMenu()
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -409,6 +414,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
CreateQuestionDialog(T["New entry:"], function()
|
CreateQuestionDialog(T["New entry:"], function()
|
||||||
category[config] = category[config] .. "#" .. this:GetParent().input:GetText()
|
category[config] = category[config] .. "#" .. this:GetParent().input:GetText()
|
||||||
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
if ufunc then ufunc() else pfUI.gui.settingChanged = true end
|
||||||
|
pfUI.events:TriggerEvent("config:changed", category, config)
|
||||||
frame.input:UpdateMenu()
|
frame.input:UpdateMenu()
|
||||||
end, false, true)
|
end, false, true)
|
||||||
end)
|
end)
|
||||||
@@ -2749,7 +2755,21 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
CreateConfig(nil, T["Custom Transparency"], C.tooltip, "alpha")
|
CreateConfig(nil, T["Custom Transparency"], C.tooltip, "alpha")
|
||||||
CreateConfig(nil, T["Status Bar Texture"], C.tooltip.statusbar, "texture", "dropdown", pfUI.gui.dropdowns.uf_bartexture)
|
CreateConfig(nil, T["Status Bar Texture"], C.tooltip.statusbar, "texture", "dropdown", pfUI.gui.dropdowns.uf_bartexture)
|
||||||
CreateConfig(nil, T["Compare Item Base Stats"], C.tooltip.compare, "basestats", "checkbox")
|
CreateConfig(nil, T["Compare Item Base Stats"], C.tooltip.compare, "basestats", "checkbox")
|
||||||
CreateConfig(nil, T["Always Show Item Comparison"], C.tooltip.compare, "showalways", "checkbox")
|
local showAlways = CreateConfig(nil, T["Always Show Item Comparison"], C.tooltip.compare, "showalways", "checkbox")
|
||||||
|
local function gate()
|
||||||
|
local on = C.tooltip.compare.basestats == "1"
|
||||||
|
if on then
|
||||||
|
showAlways.input:Enable()
|
||||||
|
showAlways.caption:SetTextColor(1, 1, 1)
|
||||||
|
else
|
||||||
|
showAlways.input:Disable()
|
||||||
|
showAlways.caption:SetTextColor(0.5, 0.5, 0.5)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
gate()
|
||||||
|
pfUI.events:RegisterCallback("config:changed", function(_, cat, key)
|
||||||
|
if cat == C.tooltip.compare and key == "basestats" then gate() end
|
||||||
|
end, "eqcompare-showalways-gate")
|
||||||
CreateConfig(nil, T["Always Show Extended Vendor Values"], C.tooltip.vendor, "showalways", "checkbox")
|
CreateConfig(nil, T["Always Show Extended Vendor Values"], C.tooltip.vendor, "showalways", "checkbox")
|
||||||
CreateConfig(U["questitem"], T["Show Related Quest On Questitems"], C.tooltip.questitem, "showquest", "checkbox")
|
CreateConfig(U["questitem"], T["Show Related Quest On Questitems"], C.tooltip.questitem, "showquest", "checkbox")
|
||||||
CreateConfig(U["questitem"], T["Show Required Questitem Count"], C.tooltip.questitem, "showcount", "checkbox")
|
CreateConfig(U["questitem"], T["Show Required Questitem Count"], C.tooltip.questitem, "showcount", "checkbox")
|
||||||
|
|||||||
@@ -96,14 +96,10 @@ pfUI:RegisterModule("innervatecall", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local readyAt = GetTime() + cdRemaining
|
C_Timer.After(cdRemaining, function()
|
||||||
frame:SetScript("OnUpdate", function()
|
local ch = GetAnnounceChannel()
|
||||||
if GetTime() >= readyAt then
|
if ch then
|
||||||
frame:SetScript("OnUpdate", nil)
|
SendChatMessage(">> Innervate is ready <<", ch)
|
||||||
local ch = GetAnnounceChannel()
|
|
||||||
if ch then
|
|
||||||
SendChatMessage(">> Innervate is ready <<", ch)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
|||||||
@@ -66,9 +66,5 @@ pfUI:RegisterModule("macrotweak", function ()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
-- Check conflicts after one tick so all addons have finished loading
|
-- Check conflicts after one tick so all addons have finished loading
|
||||||
local watcher = CreateFrame("Frame")
|
RunNextFrame(CheckConflicts)
|
||||||
watcher:SetScript("OnUpdate", function()
|
|
||||||
this:SetScript("OnUpdate", nil)
|
|
||||||
CheckConflicts()
|
|
||||||
end)
|
|
||||||
end)
|
end)
|
||||||
@@ -943,7 +943,7 @@ pfUI:RegisterModule("thirdparty-vanilla", function()
|
|||||||
CreateBackdropShadow(AtlasLootTooltip)
|
CreateBackdropShadow(AtlasLootTooltip)
|
||||||
|
|
||||||
if pfUI.eqcompare then
|
if pfUI.eqcompare then
|
||||||
HookScript(AtlasLootTooltip, "OnShow", pfUI.eqcompare.GameTooltipShow)
|
pfUI.eqcompare.HookTooltip(AtlasLootTooltip)
|
||||||
HookScript(AtlasLootTooltip, "OnHide", function()
|
HookScript(AtlasLootTooltip, "OnHide", function()
|
||||||
ShoppingTooltip1:Hide()
|
ShoppingTooltip1:Hide()
|
||||||
ShoppingTooltip2:Hide()
|
ShoppingTooltip2:Hide()
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ do
|
|||||||
-- ClassicAPI dependency check.
|
-- ClassicAPI dependency check.
|
||||||
-- pfUI relies pervasively on the modern C_* / SuperWoW / nameplate / focus
|
-- pfUI relies pervasively on the modern C_* / SuperWoW / nameplate / focus
|
||||||
-- API surface that ClassicAPI polyfills, so presence is required.
|
-- API surface that ClassicAPI polyfills, so presence is required.
|
||||||
local PFUI_CLASSIC_API_MIN = 10503 -- (X*10000 + Y*100 + Z)
|
local PFUI_CLASSIC_API_MIN = 10507 -- (X*10000 + Y*100 + Z)
|
||||||
local PFUI_CLASSIC_API_LATEST = PFUI_CLASSIC_API_MIN
|
local PFUI_CLASSIC_API_LATEST = PFUI_CLASSIC_API_MIN
|
||||||
local PFUI_CLASSIC_API_WEBSITE = "https://github.com/brues-code/ClassicAPI"
|
local PFUI_CLASSIC_API_WEBSITE = "https://github.com/brues-code/ClassicAPI"
|
||||||
local PFUI_CLASSIC_API_LATEST_URL = PFUI_CLASSIC_API_WEBSITE .. "/releases/latest"
|
local PFUI_CLASSIC_API_LATEST_URL = PFUI_CLASSIC_API_WEBSITE .. "/releases/latest"
|
||||||
@@ -102,6 +102,10 @@ pfUI.version = {}
|
|||||||
pfUI.hooks = {}
|
pfUI.hooks = {}
|
||||||
pfUI.env = {}
|
pfUI.env = {}
|
||||||
|
|
||||||
|
pfUI.events = Mixin({}, CallbackRegistryMixin)
|
||||||
|
pfUI.events:OnLoad()
|
||||||
|
pfUI.events:SetUndefinedEventsAllowed(true)
|
||||||
|
|
||||||
-- check if macro addons are loaded (disables macrotweak/macroscan)
|
-- check if macro addons are loaded (disables macrotweak/macroscan)
|
||||||
function pfUI:MacroAddonsLoaded()
|
function pfUI:MacroAddonsLoaded()
|
||||||
return IsAddOnLoaded("Supermacro") or IsAddOnLoaded("SuperCleveRoidMacros") or IsAddOnLoaded("UltimaMacros")
|
return IsAddOnLoaded("Supermacro") or IsAddOnLoaded("SuperCleveRoidMacros") or IsAddOnLoaded("UltimaMacros")
|
||||||
|
|||||||
@@ -136,22 +136,19 @@ pfUI:RegisterSkin("Character", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
HookScript(CharacterFrame, "OnShow", function()
|
hooksecurefunc("CharacterFrame_OnShow", function()
|
||||||
RefreshCharacterSlots()
|
RefreshCharacterSlots()
|
||||||
RefreshPetPosition()
|
RefreshPetPosition()
|
||||||
|
end)
|
||||||
|
|
||||||
if not this.hooked then
|
hooksecurefunc("PaperDollItemSlotButton_Update", function()
|
||||||
hooksecurefunc("PaperDollItemSlotButton_Update", function()
|
if this:GetParent() == PaperDollFrame then
|
||||||
-- update only character slots!
|
RefreshCharacterSlot(this)
|
||||||
if string.find(this:GetName(), "^Character.-Slot$") then
|
|
||||||
RefreshCharacterSlot(this)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
hooksecurefunc("PetTab_Update", RefreshPetPosition)
|
|
||||||
this.hooked = true
|
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
hooksecurefunc("PetTab_Update", RefreshPetPosition)
|
||||||
|
|
||||||
StripTextures(PaperDollFrame)
|
StripTextures(PaperDollFrame)
|
||||||
StripTextures(CharacterAttributesFrame)
|
StripTextures(CharacterAttributesFrame)
|
||||||
StripTextures(CharacterResistanceFrame)
|
StripTextures(CharacterResistanceFrame)
|
||||||
|
|||||||
Reference in New Issue
Block a user