diff --git a/Interface/AddOns/ElvUI/Core/General/Cooldowns.lua b/Interface/AddOns/ElvUI/Core/General/Cooldowns.lua index 69bfa4ef3..6dded44b0 100644 --- a/Interface/AddOns/ElvUI/Core/General/Cooldowns.lua +++ b/Interface/AddOns/ElvUI/Core/General/Cooldowns.lua @@ -365,6 +365,7 @@ end do local function RGB(db) return E:CopyTable({r = 1, g = 1, b = 1}, db) end local function HEX(db) return E:RGBToHex(db.r, db.g, db.b) end + local dummy9th = '|cFFffffff' function E:GetCooldownColors(db) if not db then db = E.db.cooldown end -- just incase someone calls this without a first arg use the global @@ -382,7 +383,7 @@ do RGB(db.modRateColor), RGB(ab.targetAuraColor), RGB(ab.expiringAuraColor), - --> text colors (0 - 8) <-- + --> text colors (0 - 9) <-- HEX(db.daysIndicator), HEX(db.hoursIndicator), HEX(db.minutesIndicator), @@ -391,7 +392,8 @@ do HEX(db.mmssColorIndicator), HEX(db.hhmmColorIndicator), HEX(ab.targetAuraIndicator), - HEX(ab.expiringAuraIndicator) + HEX(ab.expiringAuraIndicator), + dummy9th -- this shouldn't happen but ya know :) end end @@ -402,9 +404,9 @@ function E:UpdateCooldownSettings(module) -- global is the main call from config, all is the core file calls local isModule = module and (module ~= 'global' and module ~= 'all') and E.db[module] and E.db[module].cooldown if isModule then - if not E.TimeColors[module] then E.TimeColors[module] = {} end - if not E.TimeIndicatorColors[module] then E.TimeIndicatorColors[module] = {} end - db, timeColors, textColors = E.db[module].cooldown, E.TimeColors[module], E.TimeIndicatorColors[module] + if not timeColors[module] then timeColors[module] = {} end + if not textColors[module] then textColors[module] = {} end + db, timeColors, textColors = E.db[module].cooldown, timeColors[module], textColors[module] end --> color for TIME that has X remaining <-- @@ -428,6 +430,7 @@ function E:UpdateCooldownSettings(module) textColors[6], -- hhmmColorIndicator textColors[7], -- targetAuraIndicator textColors[8], -- expiringAuraIndicator + textColors[9], -- dummy9th _ = E:GetCooldownColors(db) if module == 'actionbar' then -- special population for target aura as they only have 2 colors (expiring or not) diff --git a/Interface/AddOns/ElvUI/Core/Modules/ActionBars/ActionBars.lua b/Interface/AddOns/ElvUI/Core/Modules/ActionBars/ActionBars.lua index cb4395781..6181f0710 100644 --- a/Interface/AddOns/ElvUI/Core/Modules/ActionBars/ActionBars.lua +++ b/Interface/AddOns/ElvUI/Core/Modules/ActionBars/ActionBars.lua @@ -7,24 +7,23 @@ local format, gsub, strsplit, strfind, strsub, strupper = format, gsub, strsplit local ClearOnBarHighlightMarks = ClearOnBarHighlightMarks local ClearOverrideBindings = ClearOverrideBindings -local ClearPetActionHighlightMarks = ClearPetActionHighlightMarks or PetActionBar.ClearPetActionHighlightMarks local CreateFrame = CreateFrame local GetBindingKey = GetBindingKey local GetCVarBool = GetCVarBool +local GetOverrideBarIndex = GetOverrideBarIndex local GetSpellBookItemInfo = GetSpellBookItemInfo +local GetTempShapeshiftBarIndex = GetTempShapeshiftBarIndex +local GetVehicleBarIndex = GetVehicleBarIndex local HasOverrideActionBar = HasOverrideActionBar local hooksecurefunc = hooksecurefunc local InClickBindingMode = InClickBindingMode local InCombatLockdown = InCombatLockdown local IsPossessBarVisible = IsPossessBarVisible local PetDismiss = PetDismiss -local GetOverrideBarIndex = GetOverrideBarIndex -local GetTempShapeshiftBarIndex = GetTempShapeshiftBarIndex local RegisterStateDriver = RegisterStateDriver local SecureHandlerSetFrameRef = SecureHandlerSetFrameRef local SetClampedTextureRotation = SetClampedTextureRotation local SetCVar = SetCVar -local GetVehicleBarIndex = GetVehicleBarIndex local SetModifiedClick = SetModifiedClick local SetOverrideBindingClick = SetOverrideBindingClick local UnitAffectingCombat = UnitAffectingCombat @@ -45,7 +44,9 @@ local TOOLTIP_UPDATE_TIME = TOOLTIP_UPDATE_TIME local NUM_ACTIONBAR_BUTTONS = NUM_ACTIONBAR_BUTTONS local COOLDOWN_TYPE_LOSS_OF_CONTROL = COOLDOWN_TYPE_LOSS_OF_CONTROL local CLICK_BINDING_NOT_AVAILABLE = CLICK_BINDING_NOT_AVAILABLE + local C_PetBattles_IsInBattle = C_PetBattles and C_PetBattles.IsInBattle +local ClearPetActionHighlightMarks = ClearPetActionHighlightMarks or PetActionBar.ClearPetActionHighlightMarks local LAB = E.Libs.LAB local LSM = E.Libs.LSM @@ -580,6 +581,7 @@ function AB:UpdateButtonSettings(specific) if not specific or specific == barName then AB:UpdateButtonConfig(barName, bar.bindButtons) -- config them first AB:PositionAndSizeBar(barName) -- db is set here, button style also runs here + for _, button in ipairs(bar.buttons) do AB:StyleFlyout(button) end @@ -605,9 +607,13 @@ function AB:UpdateButtonSettings(specific) if E.Retail then AB:UpdateExtraBindings() - end + AB:UpdateFlyoutButtons() - AB:UpdateFlyoutButtons() + -- handle LAB custom flyout button sizes again + if LAB.FlyoutButtons then + AB:LAB_FlyoutSpells() + end + end end end @@ -835,6 +841,8 @@ do button:SetScript('OnEnter', AB.SpellButtonOnEnter) button:SetScript('OnLeave', AB.SpellButtonOnLeave) + AB:StyleFlyout(button) -- not a part of the taint fix, this just gets the arrows in line + button.OnEnter = AB.SpellButtonOnEnter button.OnLeave = AB.SpellButtonOnLeave end @@ -1355,10 +1363,21 @@ function AB:SpellFlyout_OnLeave() end function AB:UpdateFlyoutButtons() + if _G.SpellFlyout then _G.SpellFlyout.Background:Hide() end + if _G.LABFlyoutHandlerFrame then _G.LABFlyoutHandlerFrame.Background:Hide() end + + local isShown = _G.SpellFlyout:IsShown() local btn, i = _G['SpellFlyoutButton1'], 1 while btn do - AB:SetupFlyoutButton(btn) - btn.isFlyout = true + if isShown then + AB:SetupFlyoutButton(btn) + end + + AB:StyleFlyout(btn) + + if not btn.isFlyout then + btn.isFlyout = true -- so we can ignore it on binding + end i = i + 1 btn = _G['SpellFlyoutButton'..i] @@ -1380,59 +1399,53 @@ function AB:SetupFlyoutButton(button) MasqueGroup:RemoveButton(button) --Remove first to fix issue with backdrops appearing at the wrong flyout menu MasqueGroup:AddButton(button) end - - if E.Retail then - _G.SpellFlyout.Background:Hide() - end end -function AB:StyleFlyout(button) - if not (button.FlyoutBorder and button.FlyoutArrow and button.FlyoutArrow:IsShown() and LAB.buttonRegistry[button]) then return end - - button.FlyoutBorder:SetAlpha(0) - button.FlyoutBorderShadow:SetAlpha(0) - - _G.SpellFlyoutHorizontalBackground:SetAlpha(0) - _G.SpellFlyoutVerticalBackground:SetAlpha(0) - _G.SpellFlyoutBackgroundEnd:SetAlpha(0) - - local actionbar = button:GetParent() - local parent = actionbar and actionbar:GetParent() - local parentName = parent and parent:GetName() - if parentName == 'SpellBookSpellIconsFrame' then - return - elseif actionbar then - -- Change arrow direction depending on what bar the button is on - - local arrowDistance = 2 - if _G.SpellFlyout:IsShown() and _G.SpellFlyout:GetParent() == button then - arrowDistance = 5 - end +function AB:StyleFlyout(button, arrow) + if button.FlyoutBorder then button.FlyoutBorder:SetAlpha(0) end + if button.FlyoutBorderShadow then button.FlyoutBorderShadow:SetAlpha(0) end - local direction = (actionbar.db and actionbar.db.flyoutDirection) or 'AUTOMATIC' - local point = direction == 'AUTOMATIC' and E:GetScreenQuadrant(actionbar) + local bar = button:GetParent() + local barName = bar:GetName() + + local parent = bar:GetParent() + local owner = parent and parent:GetParent() + local ownerName = owner and owner:GetName() + + local btn = (ownerName == 'SpellBookSpellIconsFrame' and parent) or button + if not arrow then arrow = btn.FlyoutArrow or (btn.FlyoutArrowContainer and btn.FlyoutArrowContainer.FlyoutArrowNormal) end + if not arrow then return end + + if barName == 'SpellBookSpellIconsFrame' or ownerName == 'SpellBookSpellIconsFrame' then + local distance = (_G.SpellFlyout and _G.SpellFlyout:IsShown() and _G.SpellFlyout:GetParent() == parent) and 7 or 4 + arrow:ClearAllPoints() + arrow:Point('RIGHT', btn, 'RIGHT', distance, 0) + elseif bar and AB.handledbuttons[button] then -- Change arrow direction depending on what bar the button is on + local direction = (bar.db and bar.db.flyoutDirection) or 'AUTOMATIC' + local point = direction == 'AUTOMATIC' and E:GetScreenQuadrant(bar) if point == 'UNKNOWN' then return end local noCombat = not InCombatLockdown() + local distance = (_G.LABFlyoutHandlerFrame and _G.LABFlyoutHandlerFrame:IsShown() and _G.LABFlyoutHandlerFrame:GetParent() == button) and 5 or 2 if direction == 'DOWN' or (point and strfind(point, 'TOP')) then - button.FlyoutArrow:ClearAllPoints() - button.FlyoutArrow:Point('BOTTOM', button, 'BOTTOM', 0, -arrowDistance) - SetClampedTextureRotation(button.FlyoutArrow, 180) + arrow:ClearAllPoints() + arrow:Point('BOTTOM', button, 'BOTTOM', 0, -distance) + SetClampedTextureRotation(arrow, 180) if noCombat then button:SetAttribute('flyoutDirection', 'DOWN') end elseif direction == 'LEFT' or point == 'RIGHT' then - button.FlyoutArrow:ClearAllPoints() - button.FlyoutArrow:Point('LEFT', button, 'LEFT', -arrowDistance, 0) - SetClampedTextureRotation(button.FlyoutArrow, 270) + arrow:ClearAllPoints() + arrow:Point('LEFT', button, 'LEFT', -distance, 0) + SetClampedTextureRotation(arrow, 270) if noCombat then button:SetAttribute('flyoutDirection', 'LEFT') end elseif direction == 'RIGHT' or point == 'LEFT' then - button.FlyoutArrow:ClearAllPoints() - button.FlyoutArrow:Point('RIGHT', button, 'RIGHT', arrowDistance, 0) - SetClampedTextureRotation(button.FlyoutArrow, 90) + arrow:ClearAllPoints() + arrow:Point('RIGHT', button, 'RIGHT', distance, 0) + SetClampedTextureRotation(arrow, 90) if noCombat then button:SetAttribute('flyoutDirection', 'RIGHT') end elseif direction == 'UP' or point == 'CENTER' or (point and strfind(point, 'BOTTOM')) then - button.FlyoutArrow:ClearAllPoints() - button.FlyoutArrow:Point('TOP', button, 'TOP', 0, arrowDistance) - SetClampedTextureRotation(button.FlyoutArrow, 0) + arrow:ClearAllPoints() + arrow:Point('TOP', button, 'TOP', 0, distance) + SetClampedTextureRotation(arrow, 0) if noCombat then button:SetAttribute('flyoutDirection', 'UP') end end end @@ -1497,6 +1510,25 @@ function AB:SetButtonDesaturation(button, duration) end end +function AB:LAB_FlyoutUpdate(btn, arrow) + AB:StyleFlyout(btn, arrow) +end + +function AB:LAB_FlyoutSpells() + if LAB.FlyoutButtons then + for _, btn in next, LAB.FlyoutButtons do + AB:SetupFlyoutButton(btn) + end + end +end + +function AB:LAB_FlyoutCreated(btn) + AB:SetupFlyoutButton(btn) + + btn:SetScale(1) + btn.MasqueSkinned = true -- skip LAB styling +end + function AB:LAB_ChargeCreated(_, cd) E:RegisterCooldown(cd, 'actionbar') end @@ -1563,6 +1595,9 @@ function AB:Initialize() LAB.RegisterCallback(AB, 'OnButtonUpdate', AB.LAB_ButtonUpdate) LAB.RegisterCallback(AB, 'OnButtonCreated', AB.LAB_ButtonCreated) + LAB.RegisterCallback(AB, 'OnFlyoutCreated', AB.LAB_FlyoutCreated) + LAB.RegisterCallback(AB, 'OnFlyoutSpells', AB.LAB_FlyoutSpells) + LAB.RegisterCallback(AB, 'OnFlyoutUpdate', AB.LAB_FlyoutUpdate) LAB.RegisterCallback(AB, 'OnChargeCreated', AB.LAB_ChargeCreated) LAB.RegisterCallback(AB, 'OnCooldownUpdate', AB.LAB_CooldownUpdate) LAB.RegisterCallback(AB, 'OnCooldownDone', AB.LAB_CooldownDone) @@ -1652,6 +1687,8 @@ function AB:Initialize() if E.Retail then hooksecurefunc(_G.SpellFlyout, 'Show', AB.UpdateFlyoutButtons) + hooksecurefunc(_G.SpellFlyout, 'Hide', AB.UpdateFlyoutButtons) + _G.SpellFlyout:HookScript('OnEnter', AB.SpellFlyout_OnEnter) _G.SpellFlyout:HookScript('OnLeave', AB.SpellFlyout_OnLeave) end diff --git a/Interface/AddOns/ElvUI/Core/Modules/ActionBars/Bind.lua b/Interface/AddOns/ElvUI/Core/Modules/ActionBars/Bind.lua index 9d2dd3415..9ffeff42c 100644 --- a/Interface/AddOns/ElvUI/Core/Modules/ActionBars/Bind.lua +++ b/Interface/AddOns/ElvUI/Core/Modules/ActionBars/Bind.lua @@ -84,7 +84,8 @@ function AB:BindListener(key) end --Check if this button can open a flyout menu - local isFlyout = (bind.button.FlyoutArrow and bind.button.FlyoutArrow:IsShown()) + local hasArrow = bind.button.FlyoutArrow or (bind.button.FlyoutArrowContainer and bind.button.FlyoutArrowContainer.FlyoutArrowNormal) + local isFlyout = (hasArrow and hasArrow:IsShown()) if key == 'LSHIFT' or key == 'RSHIFT' or key == 'LCTRL' or key == 'RCTRL' or key == 'LALT' or key == 'RALT' or key == 'UNKNOWN' then return end @@ -174,12 +175,12 @@ function AB:BindUpdate(button, spellmacro) button.bindstring = nil -- keep this clean if spellmacro == 'FLYOUT' then - bind.name = button.spellName - button.bindstring = spellmacro..' '..bind.name + bind.name = button.spellName or button:GetAttribute('spellName') -- attribute is from the LAB custom flyout + if bind.name then button.bindstring = 'SPELL '..bind.name end elseif spellmacro == 'SPELL' then button.id = SpellBook_GetSpellBookSlot(button) - bind.name = GetSpellBookItemName(button.id, _G.SpellBookFrame.bookType) - button.bindstring = spellmacro..' '..bind.name + bind.name = button.id and GetSpellBookItemName(button.id, _G.SpellBookFrame.bookType) or nil + if bind.name then button.bindstring = 'SPELL '..bind.name end elseif spellmacro == 'MACRO' then button.id = button.selectionIndex or button:GetID() @@ -188,7 +189,7 @@ function AB:BindUpdate(button, spellmacro) end bind.name = GetMacroInfo(button.id) - button.bindstring = spellmacro..' '..bind.name + if bind.name then button.bindstring = 'MACRO '..bind.name end elseif spellmacro == 'MICRO' then bind.name = button.tooltipText button.bindstring = button.commandName diff --git a/Interface/AddOns/ElvUI/Core/Modules/Bags/Bags.lua b/Interface/AddOns/ElvUI/Core/Modules/Bags/Bags.lua index 5ce18557b..b36d50990 100644 --- a/Interface/AddOns/ElvUI/Core/Modules/Bags/Bags.lua +++ b/Interface/AddOns/ElvUI/Core/Modules/Bags/Bags.lua @@ -766,7 +766,7 @@ function B:Holder_OnEnter() GameTooltip:AddLine(' ') GameTooltip:AddLine(L["Shift + Left Click to Toggle Bag"], .8, .8, .8) - if E.Retail and (self.BagID ~= BACKPACK_CONTAINER and self.BagID ~= REAGENT_CONTAINER) then + if E.Retail then GameTooltip:AddLine(L["Right Click to Open Menu"], .8, .8, .8) end @@ -831,12 +831,9 @@ end function B:AssignBagFlagMenu() local holder = B.AssignBagDropdown.holder local bagID = holder and holder.BagID - if not bagID then return end - - local canAssign = bagID ~= BACKPACK_CONTAINER and bagID ~= BANK_CONTAINER and bagID ~= REAGENT_CONTAINER - if canAssign and not IsInventoryItemProfessionBag('player', holder:GetID()) then + if bagID and bagID ~= BANK_CONTAINER and not IsInventoryItemProfessionBag('player', holder:GetID()) then E:SetEasyMenuAnchor(E.EasyMenu, holder) - _G.EasyMenu(B.AssignMenu, E.EasyMenu, nil, nil, nil, 'MENU') + _G.EasyMenu((bagID == BACKPACK_CONTAINER or bagID == REAGENT_CONTAINER) and B.AssignMain or B.AssignMenu, E.EasyMenu, nil, nil, nil, 'MENU') end end @@ -2661,30 +2658,31 @@ function B:Initialize() } if E.Retail then - B.AssignMenu = { - { text = BAG_FILTER_ASSIGN_TO, isTitle = true, notCheckable = true }, - { text = BAG_FILTER_CLEANUP, isTitle = true, notCheckable = true }, - { text = BAG_FILTER_IGNORE, - checked = function() - return B:IsSortIgnored(B.AssignBagDropdown.holder.BagID) - end, - func = function(_, _, _, value) - local BagID = B.AssignBagDropdown.holder.BagID - if BagID == BANK_CONTAINER then - SetBankAutosortDisabled(not value) - elseif BagID == BACKPACK_CONTAINER then - SetBackpackAutosortDisabled(not value) - elseif BagID > NUM_BAG_SLOTS then - SetBankBagSlotFlag(BagID - NUM_BAG_SLOTS, FILTER_FLAG_IGNORE, not value) - else - SetBagSlotFlag(BagID, FILTER_FLAG_IGNORE, not value) - end - - B.AssignBagDropdown.holder = nil + local FILTER_ASSIGN = { text = BAG_FILTER_ASSIGN_TO, isTitle = true, notCheckable = true } + local FILTER_CLEANUP = { text = BAG_FILTER_CLEANUP, isTitle = true, notCheckable = true } + local FILTER_IGNORE = { text = BAG_FILTER_IGNORE, + checked = function() + return B:IsSortIgnored(B.AssignBagDropdown.holder.BagID) + end, + func = function(_, _, _, value) + local BagID = B.AssignBagDropdown.holder.BagID + if BagID == BANK_CONTAINER then + SetBankAutosortDisabled(not value) + elseif BagID == BACKPACK_CONTAINER then + SetBackpackAutosortDisabled(not value) + elseif BagID > NUM_BAG_SLOTS then + SetBankBagSlotFlag(BagID - NUM_BAG_SLOTS, FILTER_FLAG_IGNORE, not value) + else + SetBagSlotFlag(BagID, FILTER_FLAG_IGNORE, not value) end - } + + B.AssignBagDropdown.holder = nil + end } + B.AssignMain = { FILTER_CLEANUP, FILTER_IGNORE } + B.AssignMenu = { FILTER_ASSIGN, FILTER_CLEANUP, FILTER_IGNORE } + for i, flag in next, B.GearFilters do if i ~= FILTER_FLAG_IGNORE then tinsert(B.AssignMenu, i, { diff --git a/Interface/AddOns/ElvUI/Core/Modules/DataBars/Experience.lua b/Interface/AddOns/ElvUI/Core/Modules/DataBars/Experience.lua index a1b7ab725..a33154d62 100644 --- a/Interface/AddOns/ElvUI/Core/Modules/DataBars/Experience.lua +++ b/Interface/AddOns/ElvUI/Core/Modules/DataBars/Experience.lua @@ -2,7 +2,9 @@ local E, L, V, P, G = unpack(ElvUI) local DB = E:GetModule('DataBars') local LSM = E.Libs.LSM -local min, format = min, format +local min, type, format = min, type, format +local pairs, error = pairs, error + local CreateFrame = CreateFrame local GetXPExhaustion = GetXPExhaustion local GetQuestLogRewardXP = GetQuestLogRewardXP @@ -12,10 +14,10 @@ local GetQuestLogTitle = GetQuestLogTitle local UnitXP, UnitXPMax = UnitXP, UnitXPMax local GameTooltip = GameTooltip +local C_QuestLog_GetQuestWatchType = C_QuestLog.GetQuestWatchType local C_QuestLog_GetNumQuestLogEntries = C_QuestLog.GetNumQuestLogEntries local C_QuestLog_ReadyForTurnIn = C_QuestLog.ReadyForTurnIn local C_QuestLog_GetInfo = C_QuestLog.GetInfo -local C_QuestLog_GetQuestWatchType = C_QuestLog.GetQuestWatchType local CurrentXP, XPToLevel, PercentRested, PercentXP, RemainXP, RemainTotal, RemainBars local RestedXP, QuestLogXP = 0, 0 @@ -156,6 +158,25 @@ function DB:ExperienceBar_QuestXP() else bar.Quest:Hide() end + + if DB.CustomQuestXPWatchers then + for _, func in pairs(DB.CustomQuestXPWatchers) do + func(QuestLogXP) + end + end +end + +function DB:RegisterCustomQuestXPWatcher(name, func) + if not name or not func or type(name) ~= 'string' or type(func) ~= 'function' then + error('Usage: DB:RegisterCustomQuestXPWatcher(name [string], func [function])') + return + end + + if not DB.CustomQuestXPWatchers then + DB.CustomQuestXPWatchers = {} + end + + DB.CustomQuestXPWatchers[name] = func end function DB:ExperienceBar_OnEnter() diff --git a/Interface/AddOns/ElvUI/Core/Modules/DataTexts/DataTexts.lua b/Interface/AddOns/ElvUI/Core/Modules/DataTexts/DataTexts.lua index 38b64163c..18894bcc1 100644 --- a/Interface/AddOns/ElvUI/Core/Modules/DataTexts/DataTexts.lua +++ b/Interface/AddOns/ElvUI/Core/Modules/DataTexts/DataTexts.lua @@ -785,6 +785,14 @@ function DT:Initialize() if E.Retail then hooksecurefunc(_G.C_CurrencyInfo, 'SetCurrencyBackpack', function() DT:ForceUpdate_DataText('Currencies') end) + + hooksecurefunc(_G.C_ClassTalents, 'UpdateLastSelectedSavedConfigID', function(_, newConfigID) + if not newConfigID then return end + + DT.ClassTalentsID = newConfigID + + DT:ForceUpdate_DataText('Talent/Loot Specialization') + end) else hooksecurefunc('SetCurrencyBackpack', function() DT:ForceUpdate_DataText('Currencies') end) end diff --git a/Interface/AddOns/ElvUI/Core/Modules/Maps/Minimap.lua b/Interface/AddOns/ElvUI/Core/Modules/Maps/Minimap.lua index 0783a97b9..4bb4a42bf 100644 --- a/Interface/AddOns/ElvUI/Core/Modules/Maps/Minimap.lua +++ b/Interface/AddOns/ElvUI/Core/Modules/Maps/Minimap.lua @@ -199,10 +199,10 @@ end function M:SetupHybridMinimap() local MapCanvas = _G.HybridMinimap.MapCanvas - MapCanvas:SetMaskTexture(E.Media.Textures.White8x8) MapCanvas:SetScript('OnMouseWheel', M.Minimap_OnMouseWheel) MapCanvas:SetScript('OnMouseDown', M.MapCanvas_OnMouseDown) MapCanvas:SetScript('OnMouseUp', E.noop) + MapCanvas:SetMaskTexture() _G.HybridMinimap.CircleMask:StripTextures() end diff --git a/Interface/AddOns/ElvUI/Core/Modules/Misc/LootRoll.lua b/Interface/AddOns/ElvUI/Core/Modules/Misc/LootRoll.lua index c315dc36a..35a640aa1 100644 --- a/Interface/AddOns/ElvUI/Core/Modules/Misc/LootRoll.lua +++ b/Interface/AddOns/ElvUI/Core/Modules/Misc/LootRoll.lua @@ -260,9 +260,9 @@ function M:START_LOOT_ROLL(_, rollID, rollTime) if cancelled_rolls[rollID] then return end local db = E.db.general.lootRoll - local link = GetLootRollItemLink(rollID) + local itemLink = GetLootRollItemLink(rollID) local texture, name, count, quality, bop, canNeed, canGreed, canDisenchant = GetLootRollItemInfo(rollID) - local _, _, _, itemLevel, _, _, _, _, _, _, _, itemClassID, _, bindType = GetItemInfo(link) + local _, _, _, itemLevel, _, _, _, _, itemEquipLoc, _, _, itemClassID, itemSubClassID, bindType = GetItemInfo(itemLink) local color = ITEM_QUALITY_COLORS[quality] local f = M:LootFrame_GetFrame() @@ -271,14 +271,15 @@ function M:START_LOOT_ROLL(_, rollID, rollTime) f.rollID = rollID f.time = rollTime - f.button.link = link + f.button.link = itemLink f.button.rollID = rollID f.button:RegisterEvent('MODIFIER_STATE_CHANGED') f.button.icon:SetTexture(texture) f.button.stack:SetShown(count > 1) f.button.stack:SetText(count) + f.button.ilvl:SetShown(B:IsItemEligibleForItemLevelDisplay(itemClassID, itemSubClassID, itemEquipLoc, quality)) f.button.ilvl:SetText(itemLevel) - f.button.questIcon:SetShown(B:GetItemQuestInfo(link, bindType, itemClassID)) + f.button.questIcon:SetShown(B:GetItemQuestInfo(itemLink, bindType, itemClassID)) f.need:SetEnabled(canNeed) f.greed:SetEnabled(canGreed) diff --git a/Interface/AddOns/ElvUI/Core/Modules/Misc/TotemTracker.lua b/Interface/AddOns/ElvUI/Core/Modules/Misc/TotemTracker.lua index e56c732d8..93ce060fc 100644 --- a/Interface/AddOns/ElvUI/Core/Modules/Misc/TotemTracker.lua +++ b/Interface/AddOns/ElvUI/Core/Modules/Misc/TotemTracker.lua @@ -12,31 +12,33 @@ local MAX_TOTEMS = MAX_TOTEMS -- SHAMAN_TOTEM_PRIORITIES does not work here because we need to swap 3/4 instead of 1/2 local priority = E.myclass == 'SHAMAN' and { [1]=1, [2]=2, [3]=4, [4]=3 } or STANDARD_TOTEM_PRIORITIES -function T:UpdateButton(button, totem, show) - if show and totem then - local _, _, startTime, duration, icon = GetTotemInfo(totem.slot) +function T:UpdateButton(button, totem) + if not (button and totem) then return end + local haveTotem, _, startTime, duration, icon = GetTotemInfo(totem.slot) + + button:SetShown(haveTotem and duration > 0) + + if haveTotem then button.iconTexture:SetTexture(icon) button.cooldown:SetCooldown(startTime, duration) - totem:ClearAllPoints() - totem:SetParent(button.holder) - totem:SetAllPoints(button.holder) + if totem:GetParent() ~= button.holder then + totem:ClearAllPoints() + totem:SetParent(button.holder) + totem:SetAllPoints(button.holder) + end end - - button:SetShown(show) end function T:HideTotem() - local i = priority[self.layoutIndex] - T:UpdateButton(T.bar[i], self, false) + T:UpdateButton(T.bar[priority[self.layoutIndex]], self) end function T:Update() if E.Retail then for totem in next, _G.TotemFrame.totemPool.activeObjects do - local i = priority[totem.layoutIndex] - T:UpdateButton(T.bar[i], totem, true) + T:UpdateButton(T.bar[priority[totem.layoutIndex]], totem) if totem:GetScript('OnHide') ~= T.HideTotem then totem:SetScript('OnHide', T.HideTotem) @@ -44,8 +46,7 @@ function T:Update() end else for i = 1, MAX_TOTEMS do - local totem = _G['TotemFrameTotem'..i] - T:UpdateButton(T.bar[priority[i]], totem, totem and totem:IsShown()) + T:UpdateButton(T.bar[priority[i]], _G['TotemFrameTotem'..i]) end end end diff --git a/Interface/AddOns/ElvUI/Core/Modules/Nameplates/Nameplates.lua b/Interface/AddOns/ElvUI/Core/Modules/Nameplates/Nameplates.lua index 7c215aa59..b257183b7 100644 --- a/Interface/AddOns/ElvUI/Core/Modules/Nameplates/Nameplates.lua +++ b/Interface/AddOns/ElvUI/Core/Modules/Nameplates/Nameplates.lua @@ -450,7 +450,7 @@ function NP:GetClassAnchor() end function NP:SetupTarget(nameplate, removed) - if not NP.db.units then return end + if not (NP.db.units and NP.db.units.TARGET) then return end local TCP = _G.ElvNP_TargetClassPower local cp = NP.db.units.TARGET.classpower diff --git a/Interface/AddOns/ElvUI/Core/Modules/Tooltip/Tooltip.lua b/Interface/AddOns/ElvUI/Core/Modules/Tooltip/Tooltip.lua index 673a1f9d4..4fe393c33 100644 --- a/Interface/AddOns/ElvUI/Core/Modules/Tooltip/Tooltip.lua +++ b/Interface/AddOns/ElvUI/Core/Modules/Tooltip/Tooltip.lua @@ -129,19 +129,11 @@ function TT:GameTooltip_SetDefaultAnchor(tt, parent) statusBar:Point('TOPLEFT', tt, 'BOTTOMLEFT', E.Border, -spacing) statusBar:Point('TOPRIGHT', tt, 'BOTTOMRIGHT', -E.Border, -spacing) statusBar.anchoredToTop = nil - - if statusBar.text then - statusBar.text:Point('CENTER', statusBar, 0, 0) - end elseif position == 'TOP' and not statusBar.anchoredToTop then statusBar:ClearAllPoints() statusBar:Point('BOTTOMLEFT', tt, 'TOPLEFT', E.Border, spacing) statusBar:Point('BOTTOMRIGHT', tt, 'TOPRIGHT', -E.Border, spacing) statusBar.anchoredToTop = true - - if statusBar.text then - statusBar.text:Point('CENTER', statusBar, 0, 0) - end end end @@ -801,7 +793,11 @@ function TT:MODIFIER_STATE_CHANGED() if not GameTooltip:IsForbidden() and GameTooltip:IsShown() then local owner = GameTooltip:GetOwner() if owner == _G.UIParent and UnitExists('mouseover') then - GameTooltip:SetUnit('mouseover') + if E.Retail then + GameTooltip:RefreshData() + else + GameTooltip:SetUnit('mouseover') + end elseif owner and owner:GetParent() == _G.SpellBookSpellIconsFrame then AB.SpellButtonOnEnter(owner, nil, GameTooltip) end @@ -969,12 +965,21 @@ function TT:SetTooltipFonts() end end -function TT:WorldCursorTooltipUpdate(_, state) +function TT:GameTooltip_Hide() if GameTooltip:IsForbidden() then return end + local statusBar = GameTooltip.StatusBar + if statusBar and statusBar:IsShown() then + statusBar:Hide() + end +end + +function TT:WorldCursorTooltipUpdate(_, state) + if GameTooltip:IsForbidden() or TT.db.cursorAnchor then return end + -- recall this, something called Show and stopped it (now with refade option) -- cursor anchor is always hidden right away regardless - if state == 0 and not TT.db.cursorAnchor then + if state == 0 then if TT.db.fadeOut then GameTooltip:FadeOut() else @@ -989,12 +994,15 @@ function TT:Initialize() if not E.private.tooltip.enable then return end TT.Initialized = true - GameTooltip.StatusBar = GameTooltipStatusBar - GameTooltip.StatusBar:Height(TT.db.healthBar.height) - GameTooltip.StatusBar:SetScript('OnValueChanged', nil) -- Do we need to unset this? - GameTooltip.StatusBar.text = GameTooltip.StatusBar:CreateFontString(nil, 'OVERLAY') - GameTooltip.StatusBar.text:Point('CENTER', GameTooltip.StatusBar, 0, 0) - GameTooltip.StatusBar.text:FontTemplate(LSM:Fetch('font', TT.db.healthBar.font), TT.db.healthBar.fontSize, TT.db.healthBar.fontOutline) + local statusBar = GameTooltipStatusBar + statusBar:Height(TT.db.healthBar.height) + statusBar:SetScript('OnValueChanged', nil) -- Do we need to unset this? + GameTooltip.StatusBar = statusBar + + local statusText = statusBar:CreateFontString(nil, 'OVERLAY') + statusText:FontTemplate(LSM:Fetch('font', TT.db.healthBar.font), TT.db.healthBar.fontSize, TT.db.healthBar.fontOutline) + statusText:Point('CENTER', statusBar, 0, 0) + statusBar.text = statusText --Tooltip Fonts if not GameTooltip.hasMoney then @@ -1027,6 +1035,8 @@ function TT:Initialize() AddTooltipPostCall(TooltipDataType.Spell, TT.GameTooltip_OnTooltipSetSpell) AddTooltipPostCall(TooltipDataType.Item, TT.GameTooltip_OnTooltipSetItem) AddTooltipPostCall(TooltipDataType.Unit, TT.GameTooltip_OnTooltipSetUnit) + + TT:SecureHook(GameTooltip, 'Hide', 'GameTooltip_Hide') -- dont use OnHide use Hide directly else TT:SecureHookScript(GameTooltip, 'OnTooltipSetSpell', TT.GameTooltip_OnTooltipSetSpell) TT:SecureHookScript(GameTooltip, 'OnTooltipSetItem', TT.GameTooltip_OnTooltipSetItem) diff --git a/Interface/AddOns/ElvUI/Core/Modules/UnitFrames/UnitFrames.lua b/Interface/AddOns/ElvUI/Core/Modules/UnitFrames/UnitFrames.lua index b9da0a8cd..c6a698c11 100644 --- a/Interface/AddOns/ElvUI/Core/Modules/UnitFrames/UnitFrames.lua +++ b/Interface/AddOns/ElvUI/Core/Modules/UnitFrames/UnitFrames.lua @@ -1121,6 +1121,11 @@ function UF:DisableBlizzard() _G.UIParent:UnregisterEvent('GROUP_ROSTER_UPDATE') end + -- shutdown monk stagger bar background updates + if disable.player and _G.MonkStaggerBar then + _G.MonkStaggerBar:UnregisterAllEvents() + end + -- shutdown some background updates on party unitframes if disable.party and _G.CompactPartyFrame then _G.CompactPartyFrame:UnregisterAllEvents() diff --git a/Interface/AddOns/ElvUI/ElvUI_Classic.toc b/Interface/AddOns/ElvUI/ElvUI_Classic.toc index 89c5bbc2b..3ae8fa6df 100644 --- a/Interface/AddOns/ElvUI/ElvUI_Classic.toc +++ b/Interface/AddOns/ElvUI/ElvUI_Classic.toc @@ -1,7 +1,7 @@ ## Title: |cff1784d1ElvUI|r |cfd9b9b9bClassic|r ## Notes: User Interface Replacement ## Author: Elv, Simpy -## Version: 13.04 +## Version: 13.06 ## SavedVariables: ElvDB, ElvPrivateDB ## SavedVariablesPerCharacter: ElvCharacterDB ## OptionalDeps: SharedMedia, Tukui, Masque diff --git a/Interface/AddOns/ElvUI/ElvUI_Mainline.toc b/Interface/AddOns/ElvUI/ElvUI_Mainline.toc index e63f6b168..93d2811ad 100644 --- a/Interface/AddOns/ElvUI/ElvUI_Mainline.toc +++ b/Interface/AddOns/ElvUI/ElvUI_Mainline.toc @@ -1,7 +1,7 @@ ## Title: |cff1784d1ElvUI|r ## Notes: User Interface Replacement ## Author: Elv, Simpy -## Version: 13.04 +## Version: 13.06 ## SavedVariables: ElvDB, ElvPrivateDB ## SavedVariablesPerCharacter: ElvCharacterDB ## OptionalDeps: SharedMedia, Tukui, Masque, Blizzard_PetJournal diff --git a/Interface/AddOns/ElvUI/ElvUI_Wrath.toc b/Interface/AddOns/ElvUI/ElvUI_Wrath.toc index 5094ebaba..0f4d5a9b2 100644 --- a/Interface/AddOns/ElvUI/ElvUI_Wrath.toc +++ b/Interface/AddOns/ElvUI/ElvUI_Wrath.toc @@ -1,7 +1,7 @@ ## Title: |cff1784d1ElvUI|r |cfd9b9b9bWrath|r ## Notes: User Interface Replacement ## Author: Elv, Simpy -## Version: 13.04 +## Version: 13.06 ## SavedVariables: ElvDB, ElvPrivateDB ## SavedVariablesPerCharacter: ElvCharacterDB ## OptionalDeps: SharedMedia, Tukui, Masque diff --git a/Interface/AddOns/ElvUI/Mainline/Modules/DataTexts/SpecSwitch.lua b/Interface/AddOns/ElvUI/Mainline/Modules/DataTexts/SpecSwitch.lua index dcdf94072..f1f495260 100644 --- a/Interface/AddOns/ElvUI/Mainline/Modules/DataTexts/SpecSwitch.lua +++ b/Interface/AddOns/ElvUI/Mainline/Modules/DataTexts/SpecSwitch.lua @@ -2,7 +2,7 @@ local E, L, V, P, G = unpack(ElvUI) local DT = E:GetModule('DataTexts') local _G = _G -local ipairs, tinsert = ipairs, tinsert +local ipairs, tinsert, tremove = ipairs, tinsert, tremove local format, next, strjoin = format, next, strjoin local GetLootSpecialization = GetLootSpecialization @@ -21,13 +21,11 @@ local ShowUIPanel = ShowUIPanel local C_SpecializationInfo_GetAllSelectedPvpTalentIDs = C_SpecializationInfo.GetAllSelectedPvpTalentIDs local C_Traits_GetConfigInfo = C_Traits.GetConfigInfo -local LoadConfig = C_ClassTalents.LoadConfig local GetHasStarterBuild = C_ClassTalents.GetHasStarterBuild local GetStarterBuildActive = C_ClassTalents.GetStarterBuildActive -local SetStarterBuildActive = C_ClassTalents.SetStarterBuildActive local GetConfigIDsBySpecID = C_ClassTalents.GetConfigIDsBySpecID local GetLastSelectedSavedConfigID = C_ClassTalents.GetLastSelectedSavedConfigID -local UpdateLastSelectedSavedConfigID = C_ClassTalents.UpdateLastSelectedSavedConfigID +local CanUseClassTalents = PlayerUtil.CanUseClassTalents local LOOT = LOOT local UNKNOWN = UNKNOWN @@ -59,22 +57,27 @@ local specText = '|T%s:14:14:0:0:64:64:4:60:4:60|t %s' local function starter_checked() return GetStarterBuildActive() end -local function starter_func(_, arg1) - SetStarterBuildActive(true) - UpdateLastSelectedSavedConfigID(arg1, STARTER_ID) -end local function loadout_checked(data) - return data and data.arg1 and data.arg2 == GetLastSelectedSavedConfigID(data.arg1) + return data and data.arg1 == DT.ClassTalentsID end -local function loadout_func(_, arg1, arg2) - LoadConfig(arg2, true) - if GetLastSelectedSavedConfigID(arg1) ~= STARTER_ID then - SetStarterBuildActive(false) +local loadout_func +do + local loadoutID + local function loadout_callback(_, configID) + return configID == loadoutID end - UpdateLastSelectedSavedConfigID(arg1, arg2) + loadout_func = function(_, arg1) + if not _G.ClassTalentFrame then + _G.ClassTalentFrame_LoadUI() + end + + loadoutID = arg1 + + _G.ClassTalentFrame.TalentsTab:LoadConfigByPredicate(loadout_callback) + end end local function menu_checked(data) return data and data.arg1 == GetLootSpecialization() end @@ -83,7 +86,7 @@ local function menu_func(_, arg1) SetLootSpecialization(arg1) end local function spec_checked(data) return data and data.arg1 == GetSpecialization() end local function spec_func(_, arg1) SetSpecialization(arg1) end -local function OnEvent(self, event) +local function OnEvent(self, event, loadoutID) lastPanel = self if #menuList == 2 then @@ -106,25 +109,38 @@ local function OnEvent(self, event) return end - if E.mylevel >= 10 and ( event == 'CONFIG_COMMIT_FAILED' or event == 'ELVUI_FORCE_UPDATE' or event == 'TRAIT_CONFIG_UPDATED' or event == 'TRAIT_CONFIG_DELETED' ) then + if (event == 'CONFIG_COMMIT_FAILED' or event == 'ELVUI_FORCE_UPDATE' or event == 'TRAIT_CONFIG_DELETED') and CanUseClassTalents() then + if not DT.ClassTalentsID then + DT.ClassTalentsID = (GetHasStarterBuild() and GetStarterBuildActive() and STARTER_ID) or GetLastSelectedSavedConfigID(ID) + end + local builds = GetConfigIDsBySpecID(ID) - if builds and not builds[STARTER_ID] and GetHasStarterBuild() then + if builds and GetHasStarterBuild() then tinsert(builds, STARTER_ID) end + if event == 'TRAIT_CONFIG_DELETED' then + for index = #loadoutList, 2, -1 do -- reverse loop to remove the deleted config from the loadout list + local loadout = loadoutList[index] + if loadout and loadout.arg1 == loadoutID then + tremove(loadoutList, index) + end + end + end + for index, configID in next, builds do if configID == STARTER_ID then - loadoutList[index + 1] = { text = STARTER_TEXT, checked = starter_checked, func = starter_func, arg1 = ID } + loadoutList[index + 1] = { text = STARTER_TEXT, checked = starter_checked, func = loadout_func, arg1 = STARTER_ID } else local configInfo = C_Traits_GetConfigInfo(configID) - loadoutList[index + 1] = { text = configInfo and configInfo.name or UNKNOWN, checked = loadout_checked, func = loadout_func, arg1 = ID, arg2 = configID } + loadoutList[index + 1] = { text = configInfo and configInfo.name or UNKNOWN, checked = loadout_checked, func = loadout_func, arg1 = configID } end end end local activeLoadout = DEFAULT_TEXT for index, loadout in next, loadoutList do - if index > 1 and loadout:checked(loadout.arg1, loadout.arg2) then + if index > 1 and loadout.arg1 == DT.ClassTalentsID then activeLoadout = loadout.text break end @@ -183,7 +199,7 @@ local function OnEnter() for index, loadout in next, loadoutList do if index > 1 then - local text = loadout:checked(loadout.arg1, loadout.arg2) and activeString or inactiveString + local text = loadout:checked() and activeString or inactiveString DT.tooltip:AddLine(strjoin(' - ', loadout.text, text), 1, 1, 1) end end @@ -254,4 +270,4 @@ local function ValueColorUpdate() end E.valueColorUpdateFuncs[ValueColorUpdate] = true -DT:RegisterDatatext('Talent/Loot Specialization', nil, { 'PLAYER_TALENT_UPDATE', 'ACTIVE_TALENT_GROUP_CHANGED', 'PLAYER_LOOT_SPEC_UPDATED', 'CONFIG_COMMIT_FAILED', 'TRAIT_CONFIG_UPDATED', 'TRAIT_CONFIG_DELETED' }, OnEvent, nil, OnClick, OnEnter, nil, L["Talent/Loot Specialization"]) +DT:RegisterDatatext('Talent/Loot Specialization', nil, { 'PLAYER_TALENT_UPDATE', 'ACTIVE_TALENT_GROUP_CHANGED', 'PLAYER_LOOT_SPEC_UPDATED', 'TRAIT_CONFIG_DELETED' }, OnEvent, nil, OnClick, OnEnter, nil, L["Talent/Loot Specialization"]) diff --git a/Interface/AddOns/ElvUI/Mainline/Modules/Skins/Character.lua b/Interface/AddOns/ElvUI/Mainline/Modules/Skins/Character.lua index 97af3affa..345600efa 100644 --- a/Interface/AddOns/ElvUI/Mainline/Modules/Skins/Character.lua +++ b/Interface/AddOns/ElvUI/Mainline/Modules/Skins/Character.lua @@ -102,6 +102,18 @@ local function EquipmentUpdateItems() end end +local function EquipmentUpdateNavigation() + local navi = _G.EquipmentFlyoutFrame.NavigationFrame + if not navi then return end + + navi:ClearAllPoints() + navi:Point('TOPLEFT', _G.EquipmentFlyoutFrameButtons, 'BOTTOMLEFT', 0, -E.Border - E.Spacing) + navi:Point('TOPRIGHT', _G.EquipmentFlyoutFrameButtons, 'BOTTOMRIGHT', 0, -E.Border - E.Spacing) + + navi:StripTextures() + navi:SetTemplate('Transparent') +end + local function TabTextureCoords(tex, x1) if x1 ~= 0.16001 then tex:SetTexCoord(0.16001, 0.86, 0.16, 0.86) @@ -260,15 +272,12 @@ function S:CharacterFrame() _G.EquipmentFlyoutFrameHighlight:StripTextures() _G.EquipmentFlyoutFrameButtons.bg1:SetAlpha(0) _G.EquipmentFlyoutFrameButtons:DisableDrawLayer('ARTWORK') - _G.EquipmentFlyoutFrame.NavigationFrame:StripTextures() - _G.EquipmentFlyoutFrame.NavigationFrame:SetTemplate('Transparent') - _G.EquipmentFlyoutFrame.NavigationFrame:Point('TOPLEFT', _G.EquipmentFlyoutFrameButtons, 'BOTTOMLEFT', 0, -E.Border - E.Spacing) - _G.EquipmentFlyoutFrame.NavigationFrame:Point('TOPRIGHT', _G.EquipmentFlyoutFrameButtons, 'BOTTOMRIGHT', 0, -E.Border - E.Spacing) + S:HandleNextPrevButton(_G.EquipmentFlyoutFrame.NavigationFrame.PrevButton) S:HandleNextPrevButton(_G.EquipmentFlyoutFrame.NavigationFrame.NextButton) - -- Swap item flyout frame (shown when holding alt over a slot) - hooksecurefunc('EquipmentFlyout_UpdateItems', EquipmentUpdateItems) + hooksecurefunc('EquipmentFlyout_SetBackgroundTexture', EquipmentUpdateNavigation) + hooksecurefunc('EquipmentFlyout_UpdateItems', EquipmentUpdateItems) -- Swap item flyout frame (shown when holding alt over a slot) -- Icon in upper right corner of character frame _G.CharacterFramePortrait:Kill() diff --git a/Interface/AddOns/ElvUI_Libraries/Core/LibActionButton-1.0/LibActionButton-1.0.lua b/Interface/AddOns/ElvUI_Libraries/Core/LibActionButton-1.0/LibActionButton-1.0.lua index 7b2bfb2b2..87b09fcf2 100644 --- a/Interface/AddOns/ElvUI_Libraries/Core/LibActionButton-1.0/LibActionButton-1.0.lua +++ b/Interface/AddOns/ElvUI_Libraries/Core/LibActionButton-1.0/LibActionButton-1.0.lua @@ -1,7 +1,7 @@ -- License: LICENSE.txt local MAJOR_VERSION = "LibActionButton-1.0-ElvUI" -local MINOR_VERSION = 35 -- the real minor version is 100 +local MINOR_VERSION = 37 -- the real minor version is 102 local LibStub = LibStub if not LibStub then error(MAJOR_VERSION .. " requires LibStub.") end @@ -18,6 +18,9 @@ local WoWClassic = (WOW_PROJECT_ID == WOW_PROJECT_CLASSIC) local WoWBCC = (WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC) local WoWWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC) +-- Enable custom flyouts for WoW Retail +local UseCustomFlyout = WoWRetail + local KeyBound = LibStub("LibKeyBound-1.0", true) local CBH = LibStub("CallbackHandler-1.0") local LCG = LibStub("LibButtonGlow-1.0", true) @@ -54,6 +57,9 @@ lib.AuraButtons = AuraButtons lib.ChargeCooldowns = lib.ChargeCooldowns or {} lib.NumChargeCooldowns = lib.NumChargeCooldowns or 0 +lib.FlyoutInfo = lib.FlyoutInfo or {} +lib.FlyoutButtons = lib.FlyoutButtons or {} + lib.ACTION_HIGHLIGHT_MARKS = lib.ACTION_HIGHLIGHT_MARKS or setmetatable({}, { __index = ACTION_HIGHLIGHT_MARKS }) lib.callbacks = lib.callbacks or CBH:New(lib) @@ -106,6 +112,8 @@ local UpdateAuraCooldowns -- Simpy local AURA_COOLDOWNS_ENABLED = true local AURA_COOLDOWNS_DURATION = 0 +local GetFlyoutHandler + local InitializeEventHandler, OnEvent, ForAllButtons, OnUpdate local RangeFont @@ -270,18 +278,26 @@ function lib:CreateButton(id, name, header, config) SetupSecureSnippets(button) WrapOnClick(button) + -- if there is no button yet, initialize events later + local InitializeEvents = not next(ButtonRegistry) + -- Store the button in the registry, needed for event and OnUpdate handling - if not next(ButtonRegistry) then - InitializeEventHandler() - end ButtonRegistry[button] = true + -- setup button configuration button:UpdateConfig(config) -- run an initial update button:UpdateAction() UpdateHotkeys(button) + button:SetAttribute("LABUseCustomFlyout", UseCustomFlyout) + + -- initialize events + if InitializeEvents then + InitializeEventHandler() + end + -- somewhat of a hack for the Flyout buttons to not error. button.action = 0 @@ -290,6 +306,10 @@ function lib:CreateButton(id, name, header, config) return button end +function lib:GetSpellFlyoutFrame() + return lib.flyoutHandler +end + function SetupSecureSnippets(button) button:SetAttribute("_custom", Custom.RunCustom) -- secure UpdateState(self, state) @@ -428,6 +448,10 @@ function SetupSecureSnippets(button) ]], [[ self:RunAttribute("UpdateState", self:GetAttribute("state")) ]]) + + if UseCustomFlyout then + button.header:SetFrameRef("flyoutHandler", GetFlyoutHandler()) + end end function WrapOnClick(button) @@ -436,6 +460,17 @@ function WrapOnClick(button) if self:GetAttribute("type") == "action" then local type, action = GetActionInfo(self:GetAttribute("action")) + if type == "flyout" and self:GetAttribute("LABUseCustomFlyout") then + local flyoutHandler = owner:GetFrameRef("flyoutHandler") + if not down and flyoutHandler then + flyoutHandler:SetAttribute("flyoutParentHandle", self) + flyoutHandler:RunAttribute("HandleFlyout", action) + end + + self:CallMethod("UpdateFlyout") + return false + end + return (button == "Keybind") and "LeftButton" or nil, format("%s|%s", tostring(type), tostring(action)) end @@ -452,7 +487,10 @@ end -- Dynamically handle release casting ~Simpy local function UpdateReleaseCasting(self, down) - if down then -- being locked, prevents mod key clicks on up because of SecureActionButton_OnClick in retail + if self.isFlyout then -- the flyout spell + self:RegisterForClicks('AnyDown', 'AnyUp') + elseif self.isFlyoutButton -- the bar button + or down then -- being locked, prevents mod key clicks on up because of SecureActionButton_OnClick in retail self:RegisterForClicks('AnyUp') elseif not self.pressReleaseAction then self:RegisterForClicks(self.config.clickOnDown and 'AnyDown' or 'AnyUp') @@ -465,21 +503,25 @@ end -- prevent pickup calling spells ~Simpy function Generic:OnButtonEvent(event, key, down) - if not GetCVarBool('lockActionBars') then return end -- not locked + if event == "GLOBAL_MOUSE_UP" then + self:UnregisterEvent(event) - local clickDown = self.config.clickOnDown or self.pressReleaseAction - if not clickDown then return end -- not key downing + UpdateFlyout(self) + elseif GetCVarBool('lockActionBars') then + local clickDown = self.config.clickOnDown or self.pressReleaseAction + if not clickDown then return end -- not key downing - if event == 'MODIFIER_STATE_CHANGED' then - if GetModifiedClick('PICKUPACTION') == strsub(key, 2) then - UpdateReleaseCasting(self, down == 1) + if event == 'MODIFIER_STATE_CHANGED' then + if GetModifiedClick('PICKUPACTION') == strsub(key, 2) then + UpdateReleaseCasting(self, down == 1) + end + elseif event == 'OnEnter' then + local action = GetModifiedClick('PICKUPACTION') + local dragDown = action == 'SHIFT' and IsShiftKeyDown() or action == 'ALT' and IsAltKeyDown() or action == 'CTRL' and IsControlKeyDown() + UpdateReleaseCasting(self, dragDown) + elseif event == 'OnLeave' then + UpdateReleaseCasting(self, not clickDown) end - elseif event == 'OnEnter' then - local action = GetModifiedClick('PICKUPACTION') - local dragDown = action == 'SHIFT' and IsShiftKeyDown() or action == 'ALT' and IsAltKeyDown() or action == 'CTRL' and IsControlKeyDown() - UpdateReleaseCasting(self, dragDown) - elseif event == 'OnLeave' then - UpdateReleaseCasting(self, not self.config.clickOnDown) end end @@ -518,8 +560,7 @@ function Generic:ClearStates() wipe(self.state_actions) end -function Generic:SetState(state, kind, action) - if not state then state = self:GetAttribute("state") end +function Generic:SetStateFromHandlerInsecure(state, kind, action) state = tostring(state) -- we allow a nil kind for setting a empty state if not kind then kind = "empty" end @@ -546,6 +587,13 @@ function Generic:SetState(state, kind, action) self.state_types[state] = kind self.state_actions[state] = action +end + +function Generic:SetState(state, kind, action) + if not state then state = self:GetAttribute("state") end + state = tostring(state) + + self:SetStateFromHandlerInsecure(state, kind, action) self:UpdateState(state) end @@ -618,6 +666,357 @@ function Generic:UpdateAlpha() UpdateCooldown(self) end +----------------------------------------------------------- +--- flyouts + +local DiscoverFlyoutSpells, UpdateFlyoutSpells, UpdateFlyoutHandlerScripts, FlyoutUpdateQueued + +if UseCustomFlyout then + -- params: self, flyoutID + local FlyoutHandleFunc = [[ + local SPELLFLYOUT_DEFAULT_SPACING = 4 + local SPELLFLYOUT_INITIAL_SPACING = 7 + local SPELLFLYOUT_FINAL_SPACING = 9 + + local parent = self:GetAttribute("flyoutParentHandle") + if not parent then return end + + if self:IsShown() and self:GetParent() == parent then + self:Hide() + return + end + + local flyoutID = ... + local info = LAB_FlyoutInfo[flyoutID] + if not info then print("LAB: Flyout missing with ID " .. flyoutID) return end + + local oldParent = self:GetParent() + self:SetParent(parent) + + local direction = parent:GetAttribute("flyoutDirection") or "UP" + + local usedSlots = 0 + local prevButton + for slotID, slotInfo in ipairs(info.slots) do + if slotInfo.isKnown then + usedSlots = usedSlots + 1 + local slotButton = self:GetFrameRef("flyoutButton" .. usedSlots) + + -- set secure action attributes + slotButton:SetAttribute("type", "spell") + slotButton:SetAttribute("spell", slotInfo.spellID) + + -- custom ones for elvui + slotButton:SetAttribute("spellName", slotInfo.spellName) + + -- set LAB attributes + slotButton:SetAttribute("labtype-0", "spell") + slotButton:SetAttribute("labaction-0", slotInfo.spellID) + + -- run LAB updates + slotButton:CallMethod("SetStateFromHandlerInsecure", 0, "spell", slotInfo.overrideSpellID or slotInfo.spellID) + slotButton:CallMethod("UpdateAction") + + slotButton:ClearAllPoints() + + if direction == "UP" then + if prevButton then + slotButton:SetPoint("BOTTOM", prevButton, "TOP", 0, SPELLFLYOUT_DEFAULT_SPACING) + else + slotButton:SetPoint("BOTTOM", self, "BOTTOM", 0, SPELLFLYOUT_INITIAL_SPACING) + end + elseif direction == "DOWN" then + if prevButton then + slotButton:SetPoint("TOP", prevButton, "BOTTOM", 0, -SPELLFLYOUT_DEFAULT_SPACING) + else + slotButton:SetPoint("TOP", self, "TOP", 0, -SPELLFLYOUT_INITIAL_SPACING) + end + elseif direction == "LEFT" then + if prevButton then + slotButton:SetPoint("RIGHT", prevButton, "LEFT", -SPELLFLYOUT_DEFAULT_SPACING, 0) + else + slotButton:SetPoint("RIGHT", self, "RIGHT", -SPELLFLYOUT_INITIAL_SPACING, 0) + end + elseif direction == "RIGHT" then + if prevButton then + slotButton:SetPoint("LEFT", prevButton, "RIGHT", SPELLFLYOUT_DEFAULT_SPACING, 0) + else + slotButton:SetPoint("LEFT", self, "LEFT", SPELLFLYOUT_INITIAL_SPACING, 0) + end + end + + slotButton:Show() + prevButton = slotButton + end + end + + -- hide excess buttons + for i = usedSlots + 1, self:GetAttribute("numFlyoutButtons") do + local slotButton = self:GetFrameRef("flyoutButton" .. i) + if slotButton then + slotButton:Hide() + end + end + + if usedSlots == 0 then + self:Hide() + return + end + + -- calculate extent for the long dimension + -- 3 pixel extra initial padding, button size + padding, and everything at 0.8 scale + local extent = (3 + (45 + 4) * usedSlots) * 0.8 + + self:ClearAllPoints() + + if direction == "UP" then + self:SetPoint("BOTTOM", parent, "TOP") + self:SetWidth(45) + self:SetHeight(extent) + elseif direction == "DOWN" then + self:SetPoint("TOP", parent, "BOTTOM") + self:SetWidth(45) + self:SetHeight(extent) + elseif direction == "LEFT" then + self:SetPoint("RIGHT", parent, "LEFT") + self:SetWidth(extent) + self:SetHeight(45) + elseif direction == "RIGHT" then + self:SetPoint("LEFT", parent, "RIGHT") + self:SetWidth(extent) + self:SetHeight(45) + end + + self:SetFrameStrata("DIALOG") + self:Show() + + self:CallMethod("ShowFlyoutInsecure", direction) + + if oldParent and oldParent:GetAttribute("LABUseCustomFlyout") then + oldParent:CallMethod("UpdateFlyout") + end + ]] + + local SPELLFLYOUT_INITIAL_SPACING = 7 + local function ShowFlyoutInsecure(self, direction) + self.Background.End:ClearAllPoints() + self.Background.Start:ClearAllPoints() + if direction == "UP" then + self.Background.End:SetPoint("TOP", 0, SPELLFLYOUT_INITIAL_SPACING) + SetClampedTextureRotation(self.Background.End, 0) + SetClampedTextureRotation(self.Background.VerticalMiddle, 0) + self.Background.Start:SetPoint("TOP", self.Background.VerticalMiddle, "BOTTOM") + SetClampedTextureRotation(self.Background.Start, 0) + self.Background.HorizontalMiddle:Hide() + self.Background.VerticalMiddle:Show() + self.Background.VerticalMiddle:ClearAllPoints() + self.Background.VerticalMiddle:SetPoint("TOP", self.Background.End, "BOTTOM") + self.Background.VerticalMiddle:SetPoint("BOTTOM", 0, 0) + elseif direction == "DOWN" then + self.Background.End:SetPoint("BOTTOM", 0, -SPELLFLYOUT_INITIAL_SPACING) + SetClampedTextureRotation(self.Background.End, 180) + SetClampedTextureRotation(self.Background.VerticalMiddle, 180) + self.Background.Start:SetPoint("BOTTOM", self.Background.VerticalMiddle, "TOP") + SetClampedTextureRotation(self.Background.Start, 180) + self.Background.HorizontalMiddle:Hide() + self.Background.VerticalMiddle:Show() + self.Background.VerticalMiddle:ClearAllPoints() + self.Background.VerticalMiddle:SetPoint("BOTTOM", self.Background.End, "TOP") + self.Background.VerticalMiddle:SetPoint("TOP", 0, -0) + elseif direction == "LEFT" then + self.Background.End:SetPoint("LEFT", -SPELLFLYOUT_INITIAL_SPACING, 0) + SetClampedTextureRotation(self.Background.End, 270) + SetClampedTextureRotation(self.Background.HorizontalMiddle, 180) + self.Background.Start:SetPoint("LEFT", self.Background.HorizontalMiddle, "RIGHT") + SetClampedTextureRotation(self.Background.Start, 270) + self.Background.VerticalMiddle:Hide() + self.Background.HorizontalMiddle:Show() + self.Background.HorizontalMiddle:ClearAllPoints() + self.Background.HorizontalMiddle:SetPoint("LEFT", self.Background.End, "RIGHT") + self.Background.HorizontalMiddle:SetPoint("RIGHT", -0, 0) + elseif direction == "RIGHT" then + self.Background.End:SetPoint("RIGHT", SPELLFLYOUT_INITIAL_SPACING, 0) + SetClampedTextureRotation(self.Background.End, 90) + SetClampedTextureRotation(self.Background.HorizontalMiddle, 0) + self.Background.Start:SetPoint("RIGHT", self.Background.HorizontalMiddle, "LEFT") + SetClampedTextureRotation(self.Background.Start, 90) + self.Background.VerticalMiddle:Hide() + self.Background.HorizontalMiddle:Show() + self.Background.HorizontalMiddle:ClearAllPoints() + self.Background.HorizontalMiddle:SetPoint("RIGHT", self.Background.End, "LEFT") + self.Background.HorizontalMiddle:SetPoint("LEFT", 0, 0) + end + + if direction == "UP" or direction == "DOWN" then + self.Background.Start:SetWidth(47) + self.Background.HorizontalMiddle:SetWidth(47) + self.Background.VerticalMiddle:SetWidth(47) + self.Background.End:SetWidth(47) + else + self.Background.Start:SetHeight(47) + self.Background.HorizontalMiddle:SetHeight(47) + self.Background.VerticalMiddle:SetHeight(47) + self.Background.End:SetHeight(47) + end + end + + function UpdateFlyoutHandlerScripts() + lib.flyoutHandler:SetAttribute("HandleFlyout", FlyoutHandleFunc) + lib.flyoutHandler.ShowFlyoutInsecure = ShowFlyoutInsecure + end + + local function FlyoutOnShowHide(self) + local parent = self:GetParent() + if parent and parent.UpdateFlyout then + parent:UpdateFlyout() + end + end + + function GetFlyoutHandler() + if not lib.flyoutHandler then + lib.flyoutHandler = CreateFrame("Frame", "LABFlyoutHandlerFrame", UIParent, "SecureHandlerBaseTemplate") + lib.flyoutHandler.Background = CreateFrame("Frame", nil, lib.flyoutHandler) + lib.flyoutHandler.Background:SetAllPoints() + lib.flyoutHandler.Background.End = lib.flyoutHandler.Background:CreateTexture(nil, "BACKGROUND") + lib.flyoutHandler.Background.End:SetAtlas("UI-HUD-ActionBar-IconFrame-FlyoutButton", true) + lib.flyoutHandler.Background.HorizontalMiddle = lib.flyoutHandler.Background:CreateTexture(nil, "BACKGROUND") + lib.flyoutHandler.Background.HorizontalMiddle:SetAtlas("_UI-HUD-ActionBar-IconFrame-FlyoutMidLeft", true) + lib.flyoutHandler.Background.HorizontalMiddle:SetHorizTile(true) + lib.flyoutHandler.Background.VerticalMiddle = lib.flyoutHandler.Background:CreateTexture(nil, "BACKGROUND") + lib.flyoutHandler.Background.VerticalMiddle:SetAtlas("!UI-HUD-ActionBar-IconFrame-FlyoutMid", true) + lib.flyoutHandler.Background.VerticalMiddle:SetVertTile(true) + lib.flyoutHandler.Background.Start = lib.flyoutHandler.Background:CreateTexture(nil, "BACKGROUND") + lib.flyoutHandler.Background.Start:SetAtlas("UI-HUD-ActionBar-IconFrame-FlyoutBottom", true) + + lib.flyoutHandler.Background.Start:SetVertexColor(0.7, 0.7, 0.7) + lib.flyoutHandler.Background.HorizontalMiddle:SetVertexColor(0.7, 0.7, 0.7) + lib.flyoutHandler.Background.VerticalMiddle:SetVertexColor(0.7, 0.7, 0.7) + lib.flyoutHandler.Background.End:SetVertexColor(0.7, 0.7, 0.7) + + lib.flyoutHandler:Hide() + + lib.flyoutHandler:SetScript("OnShow", FlyoutOnShowHide) + lib.flyoutHandler:SetScript("OnHide", FlyoutOnShowHide) + + lib.flyoutHandler:SetAttribute("numFlyoutButtons", 0) + UpdateFlyoutHandlerScripts() + end + + return lib.flyoutHandler + end + + -- sync flyout information to the restricted environment + local InSync = false + local function SyncFlyoutInfoToHandler() + if InCombatLockdown() or InSync then return end + InSync = true + + local maxNumSlots = 0 + + local data = "LAB_FlyoutInfo = newtable();\n" + for flyoutID, info in pairs(lib.FlyoutInfo) do + if info.isKnown then + local numSlots = 0 + data = data .. ("local info = newtable();LAB_FlyoutInfo[%d] = info;info.slots = newtable();\n"):format(flyoutID) + for slotID, slotInfo in ipairs(info.slots) do + data = data .. ("local info = newtable();LAB_FlyoutInfo[%d].slots[%d] = info;info.spellID = %d;info.overrideSpellID = %d;info.isKnown = %s;info.spellName = %s;\n"):format(flyoutID, slotID, slotInfo.spellID, slotInfo.overrideSpellID, slotInfo.isKnown and "true" or "nil", slotInfo.spellName and format('"%s"', slotInfo.spellName) or nil) + numSlots = numSlots + 1 + end + + if numSlots > maxNumSlots then + maxNumSlots = numSlots + end + end + end + + -- load generated data into the restricted environment + GetFlyoutHandler():Execute(data) + + if maxNumSlots > #lib.FlyoutButtons then + for i = #lib.FlyoutButtons + 1, maxNumSlots do + local button = lib:CreateButton(i, "LABFlyoutButton" .. i, lib.flyoutHandler, nil) + button:SetScale(0.8) + button:Hide() + + button.isFlyout = true + + -- wrap the onclick to hide the flyout after casting the spell + lib.flyoutHandler:WrapScript(button, "OnClick", [[ return nil, true ]], [[ if not down then owner:Hide() end ]]) + + -- disable drag and drop + button:SetAttribute("LABdisableDragNDrop", true) + + -- link the button to the header + lib.flyoutHandler:SetFrameRef("flyoutButton" .. i, button) + table.insert(lib.FlyoutButtons, button) + + lib.callbacks:Fire("OnFlyoutCreated", button) + end + + lib.flyoutHandler:SetAttribute("numFlyoutButtons", #lib.FlyoutButtons) + end + + InSync = false + end + + -- discover all possible flyouts + function DiscoverFlyoutSpells() + -- 300 is a safe upper limit in 10.0.2, the highest known spell is 229 + for flyoutID = 1, 300 do + local success, _, _, numSlots, isKnown = pcall(GetFlyoutInfo, flyoutID) + if success then + lib.FlyoutInfo[flyoutID] = { numSlots = numSlots, isKnown = isKnown, slots = {} } + for slotID = 1, numSlots do + local spellID, overrideSpellID, isKnownSlot, spellName = GetFlyoutSlotInfo(flyoutID, slotID) + + -- hide empty pet slots from the flyout + local petIndex, petName = GetCallPetSpellInfo(spellID) + if petIndex and (not petName or petName == "") then + isKnownSlot = false + end + + lib.FlyoutInfo[flyoutID].slots[slotID] = { spellID = spellID, spellName = spellName, overrideSpellID = overrideSpellID, isKnown = isKnownSlot } + end + end + end + + SyncFlyoutInfoToHandler() + end + + -- update flyout information (mostly the isKnown flag) + function UpdateFlyoutSpells() + if InCombatLockdown() then + FlyoutUpdateQueued = true + return + end + + for flyoutID, data in pairs(lib.FlyoutInfo) do + local success, _, _, numSlots, isKnown = pcall(GetFlyoutInfo, flyoutID) + if success then + data.isKnown = isKnown + for slotID = 1, numSlots do + local spellID, overrideSpellID, isKnownSlot, spellName = GetFlyoutSlotInfo(flyoutID, slotID) + + -- hide empty pet slots from the flyout + local petIndex, petName = GetCallPetSpellInfo(spellID) + if petIndex and (not petName or petName == "") then + isKnownSlot = false + end + + data.slots[slotID].spellID = spellID + data.slots[slotID].spellName = spellName + data.slots[slotID].overrideSpellID = overrideSpellID + data.slots[slotID].isKnown = isKnownSlot + end + end + end + + lib.callbacks:Fire("OnFlyoutSpells") + + SyncFlyoutInfoToHandler() + end +end + ----------------------------------------------------------- --- frame scripts @@ -663,6 +1062,8 @@ function Generic:OnEnter() end function Generic:OnLeave() + UpdateFlyout(self) + if not GameTooltip:IsForbidden() then GameTooltip:Hide() end @@ -701,6 +1102,8 @@ end function Generic:PostClick(button, down) UpdateButtonState(self) + UpdateFlyout(self, down) + if self._receiving_drag and not InCombatLockdown() then if self._old_type then self:SetAttribute("type", self._old_type) @@ -721,6 +1124,10 @@ function Generic:PostClick(button, down) if self._state_type == "action" and lib.ACTION_HIGHLIGHT_MARKS[self._state_action] then ClearNewActionHighlight(self._state_action, false, false) end + + if down and button ~= "Keybind" then + self:RegisterEvent("GLOBAL_MOUSE_UP") + end end ----------------------------------------------------------- @@ -862,13 +1269,31 @@ function InitializeEventHandler() lib.eventFrame:RegisterEvent("LOSS_OF_CONTROL_ADDED") lib.eventFrame:RegisterEvent("LOSS_OF_CONTROL_UPDATE") + if UseCustomFlyout then + lib.eventFrame:RegisterEvent("PLAYER_LOGIN") + lib.eventFrame:RegisterEvent("SPELLS_CHANGED") + lib.eventFrame:RegisterEvent("SPELL_FLYOUT_UPDATE") + end + lib.eventFrame:Show() lib.eventFrame:SetScript("OnUpdate", OnUpdate) + + if UseCustomFlyout and IsLoggedIn() then + DiscoverFlyoutSpells() + end end local _lastFormUpdate = GetTime() function OnEvent(frame, event, arg1, ...) - if event == "UNIT_INVENTORY_CHANGED" or event == "LEARNED_SPELL_IN_TAB" then + if event == "PLAYER_LOGIN" then + if UseCustomFlyout then + DiscoverFlyoutSpells() + end + elseif event == "SPELLS_CHANGED" or event == "SPELL_FLYOUT_UPDATE" then + if UseCustomFlyout then + UpdateFlyoutSpells() + end + elseif event == "UNIT_INVENTORY_CHANGED" or event == "LEARNED_SPELL_IN_TAB" then local tooltipOwner = GameTooltip_GetOwnerForbidden() if tooltipOwner and ButtonRegistry[tooltipOwner] then tooltipOwner:SetTooltip() @@ -970,6 +1395,11 @@ function OnEvent(frame, event, arg1, ...) StopFlash(button) end end + + if UseCustomFlyout and FlyoutUpdateQueued then + UpdateFlyoutSpells() + FlyoutUpdateQueued = nil + end elseif event == "START_AUTOREPEAT_SPELL" then for button in next, ActiveButtons do if button:IsAutoRepeat() then @@ -984,6 +1414,10 @@ function OnEvent(frame, event, arg1, ...) end elseif event == "PET_STABLE_UPDATE" or event == "PET_STABLE_SHOW" then ForAllButtons(Update) + + if event == "PET_STABLE_UPDATE" and UseCustomFlyout then + UpdateFlyoutSpells() + end elseif event == "SPELL_ACTIVATION_OVERLAY_GLOW_SHOW" then for button in next, ActiveButtons do local spellId = button:GetSpellId() @@ -1318,7 +1752,7 @@ function Update(self, fromUpdateConfig) local updatePressRelease = IsPressHoldReleaseSpell and notInCombat if isTypeAction then local actionType, actionID = GetActionInfo(self._state_action) - local actionSpell, actionMacro = actionType == 'spell', actionType == 'macro' + local actionSpell, actionMacro, actionFlyout = actionType == 'spell', actionType == 'macro', actionType == 'flyout' local macroSpell = actionMacro and GetMacroSpell(actionID) or nil local spellID = (actionSpell and actionID) or macroSpell local spellName = spellID and GetSpellInfo(spellID) or nil @@ -1330,6 +1764,7 @@ function Update(self, fromUpdateConfig) self:SetAttribute('typerelease', 'actionrelease') end + self.isFlyoutButton = actionFlyout self.abilityName = spellName AuraButtons.buttons[self] = spellName @@ -1341,6 +1776,7 @@ function Update(self, fromUpdateConfig) tinsert(AuraButtons.auras[spellName], self) end else + self.isFlyoutButton = nil self.abilityName = nil if updatePressRelease then @@ -1821,7 +2257,6 @@ if ActionButton_UpdateFlyout then -- based on ActionButton_UpdateFlyout in ActionButton.lua local actionType = GetActionInfo(self._state_action) if actionType == "flyout" then - local isFlyoutShown = SpellFlyout and SpellFlyout:IsShown() and SpellFlyout:GetParent() == self local arrowDistance = isFlyoutShown and 1 or 4 @@ -1856,7 +2291,7 @@ else -- based on ActionButton_UpdateFlyout in ActionButton.lua local actionType = GetActionInfo(self._state_action) if actionType == "flyout" then - local isMouseOverButton = GetMouseFocus() == self; + local isMouseOverButton = GetMouseFocus() == self; local isButtonDown if (isButtonDownOverride ~= nil) then @@ -1882,7 +2317,7 @@ else self.FlyoutArrowContainer.FlyoutArrowPushed:Hide() end - local isFlyoutShown = SpellFlyout and SpellFlyout:IsShown() and SpellFlyout:GetParent() == self + local isFlyoutShown = (SpellFlyout and SpellFlyout:IsShown() and SpellFlyout:GetParent() == self) or (lib.flyoutHandler and lib.flyoutHandler:IsShown() and lib.flyoutHandler:GetParent() == self) local arrowDistance = isFlyoutShown and 1 or 4 -- Update arrow @@ -1905,10 +2340,13 @@ else flyoutArrowTexture:SetPoint("TOP", self, "TOP", 0, arrowDistance) end + lib.callbacks:Fire("OnFlyoutUpdate", self, flyoutArrowTexture) + -- return here, otherwise flyout is hidden return end end + self.FlyoutArrowContainer:Hide() end end @@ -2138,3 +2576,7 @@ if oldversion and next(lib.buttonRegistry) then end end end + +if oldversion and lib.flyoutHandler then + UpdateFlyoutHandlerScripts() +end diff --git a/Interface/AddOns/ElvUI_Libraries/Core/oUF/elements/stagger.lua b/Interface/AddOns/ElvUI_Libraries/Core/oUF/elements/stagger.lua index da1d89263..e44b4a04f 100644 --- a/Interface/AddOns/ElvUI_Libraries/Core/oUF/elements/stagger.lua +++ b/Interface/AddOns/ElvUI_Libraries/Core/oUF/elements/stagger.lua @@ -40,7 +40,6 @@ local UnitHasVehiclePlayerFrameUI = UnitHasVehiclePlayerFrameUI local UnitHealthMax = UnitHealthMax local UnitIsUnit = UnitIsUnit local UnitStagger = UnitStagger --- GLOBALS: MonkStaggerBar -- end block -- sourced from FrameXML/Constants.lua @@ -217,12 +216,6 @@ local function Enable(self, unit) element:SetStatusBarTexture([[Interface\TargetingFrame\UI-StatusBar]]) end - MonkStaggerBar:UnregisterEvent('PLAYER_ENTERING_WORLD') - MonkStaggerBar:UnregisterEvent('PLAYER_SPECIALIZATION_CHANGED') - MonkStaggerBar:UnregisterEvent('UNIT_DISPLAYPOWER') - MonkStaggerBar:UnregisterEvent('UNIT_EXITED_VEHICLE') - MonkStaggerBar:UnregisterEvent('UPDATE_VEHICLE_ACTIONBAR') - -- do not change this without taking Visibility into account element:Hide() @@ -238,12 +231,6 @@ local function Disable(self) self:UnregisterEvent('UNIT_AURA', Path) self:UnregisterEvent('UNIT_DISPLAYPOWER', VisibilityPath) self:UnregisterEvent('PLAYER_TALENT_UPDATE', VisibilityPath) - - MonkStaggerBar:RegisterEvent('PLAYER_ENTERING_WORLD') - MonkStaggerBar:RegisterEvent('PLAYER_SPECIALIZATION_CHANGED') - MonkStaggerBar:RegisterEvent('UNIT_DISPLAYPOWER') - MonkStaggerBar:RegisterEvent('UNIT_EXITED_VEHICLE') - MonkStaggerBar:RegisterEvent('UPDATE_VEHICLE_ACTIONBAR') end end diff --git a/Interface/AddOns/ElvUI_Options/Core/Tooltip.lua b/Interface/AddOns/ElvUI_Options/Core/Tooltip.lua index ff2aec908..aef85eebd 100644 --- a/Interface/AddOns/ElvUI_Options/Core/Tooltip.lua +++ b/Interface/AddOns/ElvUI_Options/Core/Tooltip.lua @@ -29,7 +29,7 @@ General.gender = ACH:Toggle(L["Gender"], L["Displays the gender of players."], 7 General.showElvUIUsers = ACH:Toggle(L["Show ElvUI Users"], L["Show ElvUI users and their version of ElvUI."], 8) General.itemQuality = ACH:Toggle(L["Item Quality"], L["Color tooltip border based on Item Quality."], 9) General.inspectDataEnable = ACH:Toggle(L["Inspect Data"], L["Display the item level and current specialization of the unit on modifier press."], 10, nil, nil, nil, nil, nil, nil, not E.Retail) -General.fadeOut = ACH:Toggle(E.NewSign..L["Fade Out"], L["Fade out the tooltip when it disappers, instant otherwise. Cursor anchored tooltips are unaffected."], 11) +General.fadeOut = ACH:Toggle(E.NewSign..L["Fade Out"], L["Fade out the tooltip when it disappers, instant otherwise. Cursor anchored tooltips are unaffected."], 11, nil, nil, nil, nil, nil, nil, not E.Retail) General.colorAlpha = ACH:Range(L["OPACITY"], nil, 12, { isPercent = true, min = 0, max = 1, step = 0.01 }, nil, nil, function(info, value) E.db.tooltip[info[#info]] = value; Skins:StyleTooltips() end) General.modifierGroup = ACH:Group(L["Spell/Item IDs"], nil, -2) diff --git a/Interface/AddOns/ElvUI_Options/Locales/deDE.lua b/Interface/AddOns/ElvUI_Options/Locales/deDE.lua index 41ae1b9e7..e6f1f2e56 100644 --- a/Interface/AddOns/ElvUI_Options/Locales/deDE.lua +++ b/Interface/AddOns/ElvUI_Options/Locales/deDE.lua @@ -1145,8 +1145,6 @@ L["Panel Snapping"] = "Fenster andocken" L["Panel Texture (Left)"] = "Fenstertextur (Links)" L["Panel Texture (Right)"] = "Fenstertextur (Rechts)" L["Panel Transparency"] = "Leisten Transparenz" -L["Panel Width (Bags)"] = "Leistenbreite (Taschen)" -L["Panel Width (Bank)"] = "Leistenbreite (Bank)" L["Panel Width"] = "Leistenbreite" L["Panels"] = "Leisten" L["Parchment Remover"] = "Pergament entfernen" diff --git a/Interface/AddOns/ElvUI_Options/Locales/enUS.lua b/Interface/AddOns/ElvUI_Options/Locales/enUS.lua index 1164d57f1..5c20d0324 100644 --- a/Interface/AddOns/ElvUI_Options/Locales/enUS.lua +++ b/Interface/AddOns/ElvUI_Options/Locales/enUS.lua @@ -1139,8 +1139,6 @@ L["Panel Snapping"] = true L["Panel Texture (Left)"] = true L["Panel Texture (Right)"] = true L["Panel Transparency"] = true -L["Panel Width (Bags)"] = true -L["Panel Width (Bank)"] = true L["Panel Width"] = true L["Panels"] = true L["Parchment Remover"] = true diff --git a/Interface/AddOns/ElvUI_Options/Locales/esMX.lua b/Interface/AddOns/ElvUI_Options/Locales/esMX.lua index ae0e70145..fa209e270 100644 --- a/Interface/AddOns/ElvUI_Options/Locales/esMX.lua +++ b/Interface/AddOns/ElvUI_Options/Locales/esMX.lua @@ -1139,8 +1139,6 @@ L["Panel Snapping"] = true L["Panel Texture (Left)"] = "Textura del Panel Izquierdo" L["Panel Texture (Right)"] = "Textura del Panel Derecho" L["Panel Transparency"] = "Transparencia del Panel" -L["Panel Width (Bags)"] = "Ancho del Panel (Bolsas)" -L["Panel Width (Bank)"] = "Ancho del Panel (Banco)" L["Panel Width"] = "Anchura del Panel" L["Panels"] = "Paneles" L["Parchment Remover"] = true diff --git a/Interface/AddOns/ElvUI_Options/Locales/frFR.lua b/Interface/AddOns/ElvUI_Options/Locales/frFR.lua index 834830b87..9c79cf178 100644 --- a/Interface/AddOns/ElvUI_Options/Locales/frFR.lua +++ b/Interface/AddOns/ElvUI_Options/Locales/frFR.lua @@ -1139,8 +1139,6 @@ L["Panel Snapping"] = true L["Panel Texture (Left)"] = "Texture de la fenêtre de discussion (Gauche)" L["Panel Texture (Right)"] = "Texture de la fenêtre de discussion (Droite)" L["Panel Transparency"] = "Transparence du panneau" -L["Panel Width (Bags)"] = "Largeur du panneau (Sac)" -L["Panel Width (Bank)"] = "Largeur du panneau (Banque)" L["Panel Width"] = "Largeur de la fenêtre de discussion" L["Panels"] = "Panneaux" L["Parchment Remover"] = "Suppression de la texture Parchemin" diff --git a/Interface/AddOns/ElvUI_Options/Locales/itIT.lua b/Interface/AddOns/ElvUI_Options/Locales/itIT.lua index ee9d30907..a456d6c60 100644 --- a/Interface/AddOns/ElvUI_Options/Locales/itIT.lua +++ b/Interface/AddOns/ElvUI_Options/Locales/itIT.lua @@ -1139,8 +1139,6 @@ L["Panel Snapping"] = true L["Panel Texture (Left)"] = true L["Panel Texture (Right)"] = true L["Panel Transparency"] = true -L["Panel Width (Bags)"] = true -L["Panel Width (Bank)"] = true L["Panel Width"] = true L["Panels"] = true L["Parchment Remover"] = true diff --git a/Interface/AddOns/ElvUI_Options/Locales/koKR.lua b/Interface/AddOns/ElvUI_Options/Locales/koKR.lua index 4e606e924..32355dd25 100644 --- a/Interface/AddOns/ElvUI_Options/Locales/koKR.lua +++ b/Interface/AddOns/ElvUI_Options/Locales/koKR.lua @@ -1139,8 +1139,6 @@ L["Panel Snapping"] = true L["Panel Texture (Left)"] = "패널 텍스쳐 (왼쪽)" L["Panel Texture (Right)"] = "패널 텍스쳐 (오른쪽)" L["Panel Transparency"] = "탭을 반투명하게" -L["Panel Width (Bags)"] = "통합가방 프레임 가로길이" -L["Panel Width (Bank)"] = "통합은행 프레임 가로길이" L["Panel Width"] = "패널 가로길이" L["Panels"] = "패널" L["Parchment Remover"] = true diff --git a/Interface/AddOns/ElvUI_Options/Locales/ptBR.lua b/Interface/AddOns/ElvUI_Options/Locales/ptBR.lua index cb6a07f65..53414e10b 100644 --- a/Interface/AddOns/ElvUI_Options/Locales/ptBR.lua +++ b/Interface/AddOns/ElvUI_Options/Locales/ptBR.lua @@ -1139,8 +1139,6 @@ L["Panel Snapping"] = true L["Panel Texture (Left)"] = "Textura do Painel (Esquerdo)" L["Panel Texture (Right)"] = "Textura do Painel (Direito)" L["Panel Transparency"] = "Transparência do Painel" -L["Panel Width (Bags)"] = "Largura do Painel (Bolsas)" -L["Panel Width (Bank)"] = "Largura do Painel (Banco)" L["Panel Width"] = "Comprimento do Painel" L["Panels"] = "Painéis" L["Parchment Remover"] = "Removedor de Pergaminho" diff --git a/Interface/AddOns/ElvUI_Options/Locales/ruRU.lua b/Interface/AddOns/ElvUI_Options/Locales/ruRU.lua index 63600aa7d..b1cd6f63c 100644 --- a/Interface/AddOns/ElvUI_Options/Locales/ruRU.lua +++ b/Interface/AddOns/ElvUI_Options/Locales/ruRU.lua @@ -1139,8 +1139,6 @@ L["Panel Snapping"] = "Привязка панели" L["Panel Texture (Left)"] = "Текстура левой панели" L["Panel Texture (Right)"] = "Текстура правой панели" L["Panel Transparency"] = "Прозрачность панели" -L["Panel Width (Bags)"] = "Ширина сумок" -L["Panel Width (Bank)"] = "Ширина банка" L["Panel Width"] = "Ширина панели" L["Panels"] = "Панели" L["Parchment Remover"] = "Удалить пергамент" diff --git a/Interface/AddOns/ElvUI_Options/Locales/trTR.lua b/Interface/AddOns/ElvUI_Options/Locales/trTR.lua index 102330964..d735221d4 100644 --- a/Interface/AddOns/ElvUI_Options/Locales/trTR.lua +++ b/Interface/AddOns/ElvUI_Options/Locales/trTR.lua @@ -1139,8 +1139,6 @@ L["Panel Snapping"] = "Panel Yapistirma" L["Panel Texture (Left)"] = "Panel Dokusu (Sol)" L["Panel Texture (Right)"] = "Panel Dokusu (Sag)" L["Panel Transparency"] = "Panel Seffafligi" -L["Panel Width (Bags)"] = "Panel Genisligi (canta)" -L["Panel Width (Bank)"] = "Panel Genisligi (Banka)" L["Panel Width"] = "Panel Genisligi" L["Panels"] = "Panel" L["Parchment Remover"] = "Parsomenleri Kaldir" diff --git a/Interface/AddOns/ElvUI_Options/Locales/zhCN.lua b/Interface/AddOns/ElvUI_Options/Locales/zhCN.lua index e0f497636..c02b36978 100644 --- a/Interface/AddOns/ElvUI_Options/Locales/zhCN.lua +++ b/Interface/AddOns/ElvUI_Options/Locales/zhCN.lua @@ -1139,9 +1139,7 @@ L["Panel Snapping"] = "面板吸附" L["Panel Texture (Left)"] = "聊天框材质(左)" L["Panel Texture (Right)"] = "聊天框材质(右)" L["Panel Transparency"] = "面板透明" -L["Panel Width (Bags)"] = "背包面板宽度" -L["Panel Width (Bank)"] = "银行面板宽度" -L["Panel Width"] = "聊天框宽度" +L["Panel Width"] = "框架面板宽度" L["Panels"] = "面板" L["Parchment Remover"] = "移除羊皮纸" L["Parent"] = "跟随框架" diff --git a/Interface/AddOns/ElvUI_Options/Locales/zhTW.lua b/Interface/AddOns/ElvUI_Options/Locales/zhTW.lua index a4990f108..197f0633c 100644 --- a/Interface/AddOns/ElvUI_Options/Locales/zhTW.lua +++ b/Interface/AddOns/ElvUI_Options/Locales/zhTW.lua @@ -1139,8 +1139,6 @@ L["Panel Snapping"] = "面板吸附" L["Panel Texture (Left)"] = "面板材質(左)" L["Panel Texture (Right)"] = "面板材質(右)" L["Panel Transparency"] = "面板透明" -L["Panel Width (Bags)"] = "框架寬度 (背包)" -L["Panel Width (Bank)"] = "框架寬度 (銀行)" L["Panel Width"] = "面板寛度" L["Panels"] = "面板" L["Parchment Remover"] = "移除羊皮紙" diff --git a/Interface/AddOns/ElvUI_SLE/CHANGELOG.txt b/Interface/AddOns/ElvUI_SLE/CHANGELOG.txt index 6b0136ca7..c3528a659 100644 --- a/Interface/AddOns/ElvUI_SLE/CHANGELOG.txt +++ b/Interface/AddOns/ElvUI_SLE/CHANGELOG.txt @@ -1,3 +1,6 @@ -v4.50 11/16/22 +v4.51 11/22/22 -• fixed most prepatch 2 issues +• fixed friends datatext error +• fixed currency datatext error +• fixed anima count error +• fixed minimap instance indicator diff --git a/Interface/AddOns/ElvUI_SLE/ElvUI_SLE.toc b/Interface/AddOns/ElvUI_SLE/ElvUI_SLE.toc index 1175b8228..69bee503d 100644 --- a/Interface/AddOns/ElvUI_SLE/ElvUI_SLE.toc +++ b/Interface/AddOns/ElvUI_SLE/ElvUI_SLE.toc @@ -1,14 +1,14 @@ ## Interface: 100002 ## Title: |cff1784d1ElvUI|r |cff9482c9Shadow & Light|r ## Author: Darth Predator, Repooc -## Version: 4.50 +## Version: 4.51 ## Notes: Plugin-edit for |cff1784d1ElvUI|r adding additional features. ## Notes-ruRU: Плагин-редакция для |cff1784d1ElvUI|r, добавляющий новые функции. ## URL: http://tukui.org/ ## RequiredDeps: ElvUI ## OptionalDeps: AddonSkins, BigWigs, Clique, Hermes, xCT+ ## DefaultState: Enabled -## X-ElvVersion: 13.02 +## X-ElvVersion: 13.06 ## X-Curse-Project-ID: 39618 ## X-Wago-ID: 7x61q261 ## SavedVariables: SLE_ArmoryDB diff --git a/Interface/AddOns/ElvUI_SLE/locales/english.lua b/Interface/AddOns/ElvUI_SLE/locales/english.lua index 956d7fb1d..0ae1f5e56 100644 --- a/Interface/AddOns/ElvUI_SLE/locales/english.lua +++ b/Interface/AddOns/ElvUI_SLE/locales/english.lua @@ -697,12 +697,15 @@ L["SLE_EM_TAGS_HELP"] = [[Following tags and parameters are eligible for setting |cff3cbf27party|r - when you are in a group of any description. Can be of specified size, e.g. [party:4] - if in a group of total size 4; |cff3cbf27raid|r - when you are in a raid group. Can be of specified size like party option; |cff3cbf27spec|r - specified spec. Usage [spec:] number is the index of desired spec as seen in spec tab; -|cff3cbf27talent|r - specified talent. Usage [talent:/] tier is the row going from 1 on lvl 15 to 7 and lvl 100, column is the column in said row from 1 to 3; +|cff3cbf27talent|r - specified talent. Usage [talent:(|)] checks if a given talent is known by spell id or name; |cff3cbf27instance|r - if in instance. Can be of specified instance type - [instance:]. Types are party, raid and scenario. If not specified will be true for any instance; |cff3cbf27pvp|r - if on BG, arena or world pvp area. Available arguments: pvp, arena; |cff3cbf27difficulty|r - defines the difficulty of the instance. Arguments are: normal, heroic, lfr, challenge, mythic; |cff3cbf27effectivelevel|r - effective level refers to your level when you are scaled, e.g. timewalking |cff3cbf27warmode|r - checks if you have warmode enabled +|cff3cbf27event|r - checks if any event in a /-separated list of ids is active + +You can also prepend no to any available tag to negate the result. Example: [solo] Set1; [party:4, spec:3] Set2; [instance:raid, difficulty:heroic] Set3 ]] diff --git a/Interface/AddOns/ElvUI_SLE/modules/blizzard.lua b/Interface/AddOns/ElvUI_SLE/modules/blizzard.lua index 3a9b51111..436b92b3e 100644 --- a/Interface/AddOns/ElvUI_SLE/modules/blizzard.lua +++ b/Interface/AddOns/ElvUI_SLE/modules/blizzard.lua @@ -22,7 +22,7 @@ B.Frames = { LFGDungeonReadyDialog = true, LFGDungeonReadyStatus = true, LootFrame = true, - MailFrame = true, + -- MailFrame = true, MerchantFrame = true, PVEFrame = true, PetStableFrame = true, @@ -378,8 +378,6 @@ function B:Initialize() self:Hide() end end) - - end SLE:RegisterModule(B:GetName()) diff --git a/Interface/AddOns/ElvUI_SLE/modules/datatexts/currency.lua b/Interface/AddOns/ElvUI_SLE/modules/datatexts/currency.lua index a33b4c103..1c0196cfe 100644 --- a/Interface/AddOns/ElvUI_SLE/modules/datatexts/currency.lua +++ b/Interface/AddOns/ElvUI_SLE/modules/datatexts/currency.lua @@ -3,61 +3,37 @@ local DT = E.DataTexts local B = E.Bags local _G = _G -local type, wipe, pairs, ipairs, sort = type, wipe, pairs, ipairs, sort -local format, strjoin, tinsert = format, strjoin, tinsert -local tonumber, unpack = tonumber, unpack +local type, tonumber, wipe, pairs, ipairs, sort = type, tonumber, wipe, pairs, ipairs, sort +local format, strjoin, tostring, tinsert = format, strjoin, tostring, tinsert local GetMoney = GetMoney -local IsControlKeyDown = IsControlKeyDown +local IsControlKeyDown, IsShiftKeyDown = IsControlKeyDown, IsShiftKeyDown local IsLoggedIn = IsLoggedIn -local IsShiftKeyDown = IsShiftKeyDown local BreakUpLargeNumbers = BreakUpLargeNumbers - -local Ticker --- local CURRENCY = CURRENCY --Needed if I decide to add watched currency from backpack --- local MAX_WATCHED_TOKENS = MAX_WATCHED_TOKENS --Needed if I decide to add watched currency from backpack -local Profit, Spent = 0, 0 -local resetCountersFormatter = strjoin('', '|cffaaaaaa', L["Reset Session Data: Hold Ctrl + Right Click"], '|r') -local resetInfoFormatter = strjoin('', '|cffaaaaaa', L["Reset Character Data: Hold Shift + Right Click"], '|r') -local PRIEST_COLOR = RAID_CLASS_COLORS.PRIEST - -local BONUS_ROLL_REWARD_MONEY = BONUS_ROLL_REWARD_MONEY -local iconString = '|T%s:16:16:0:0:64:64:4:60:4:60|t' -local GetItemSpell = GetItemSpell - +local C_WowTokenPublic_UpdateMarketPrice = C_WowTokenPublic.UpdateMarketPrice +local C_WowTokenPublic_GetCurrentMarketPrice = C_WowTokenPublic.GetCurrentMarketPrice +local C_Timer_NewTicker = C_Timer.NewTicker local C_Container_GetContainerItemLink = C_Container.GetContainerItemLink local C_Container_GetContainerNumSlots = C_Container.GetContainerNumSlots local C_Container_GetContainerItemInfo = C_Container.GetContainerItemInfo local C_Container_GetBagName = C_Container.GetBagName - -local C_CurrencyInfo_GetBackpackCurrencyInfo = C_CurrencyInfo.GetBackpackCurrencyInfo -local C_CurrencyInfo_GetCurrencyInfo = C_CurrencyInfo.GetCurrencyInfo - local C_Item_IsAnimaItemByID = C_Item.IsAnimaItemByID +local GetItemSpell = GetItemSpell -local C_WowTokenPublic_UpdateMarketPrice = C_WowTokenPublic.UpdateMarketPrice -local C_WowTokenPublic_GetCurrentMarketPrice = C_WowTokenPublic.GetCurrentMarketPrice - -local C_Timer_NewTicker = C_Timer.NewTicker +local BONUS_ROLL_REWARD_MONEY = BONUS_ROLL_REWARD_MONEY +local MAX_WATCHED_TOKENS = MAX_WATCHED_TOKENS or 3 +local CURRENCY = CURRENCY +local PRIEST_COLOR = RAID_CLASS_COLORS.PRIEST -local menuList = {} +local Profit, Spent, Ticker, goldText = 0, 0 +local resetCountersFormatter = strjoin('', '|cffaaaaaa', L["Reset Session Data: Hold Ctrl + Right Click"], '|r') +local resetInfoFormatter = strjoin('', '|cffaaaaaa', L["Reset Character Data: Hold Shift + Right Click"], '|r') -DT.CurrencyList = { GOLD = BONUS_ROLL_REWARD_MONEY, BACKPACK = 'Backpack' } +local menuList, myGold = {}, {} local animaSpellID = { [347555] = 3, [345706] = 5, [336327] = 35, [336456] = 250 } - -local function sortFunction(a, b) - return a.amount > b.amount -end - -local function deleteCharacter(self, realm, name) - ElvDB.gold[realm][name] = nil - ElvDB.class[realm][name] = nil - ElvDB.faction[realm][name] = nil - - if name == E.myname and realm == E.myrealm then - OnEvent(self) - end -end +local totalGold, totalHorde, totalAlliance = 0, 0, 0 +local iconString = '|T%s:16:16:0:0:64:64:4:60:4:60|t' +DT.CurrencyList = { GOLD = BONUS_ROLL_REWARD_MONEY, BACKPACK = 'Backpack' } local function OnClick(self, btn) if btn == 'RightButton' then @@ -76,8 +52,8 @@ local function OnClick(self, btn) end end - DT:SetEasyMenuAnchor(DT.EasyMenu, self) - _G.EasyMenu(menuList, DT.EasyMenu, nil, nil, nil, 'MENU') + E:SetEasyMenuAnchor(E.EasyMenu, self) + _G.EasyMenu(menuList, E.EasyMenu, nil, nil, nil, 'MENU') elseif IsControlKeyDown() then Profit = 0 Spent = 0 @@ -87,25 +63,18 @@ local function OnClick(self, btn) end end -local function GetInfo(id) - local info = C_CurrencyInfo_GetCurrencyInfo(id) - if info then - return info.name, info.quantity, info.maxQuantity, (info.iconFileID and format(iconString, info.iconFileID)) or '136012' - end -end - local function AddInfo(id) - local name, num, max, icon = GetInfo(id) + local info, name, icon = DT:CurrencyInfo(id) if name then local textRight = '%s' - if E.global.datatexts.settings.Currencies.maxCurrency and max and max > 0 then - textRight = '%s / '..BreakUpLargeNumbers(max) + if E.global.datatexts.settings.Currencies.maxCurrency and info.maxQuantity and info.maxQuantity > 0 then + textRight = '%s / '..BreakUpLargeNumbers(info.maxQuantity) end - DT.tooltip:AddDoubleLine(format('%s %s', icon, name), format(textRight, BreakUpLargeNumbers(num)), 1, 1, 1, 1, 1, 1) + + DT.tooltip:AddDoubleLine(format('%s %s', icon, name), format(textRight, BreakUpLargeNumbers(info.quantity)), 1, 1, 1, 1, 1, 1) end end --- ElvUI Currencies Function local shownHeaders = {} local function AddHeader(id, addLine) if (not E.global.datatexts.settings.Currencies.headers) or shownHeaders[id] then return end @@ -118,31 +87,117 @@ local function AddHeader(id, addLine) shownHeaders[id] = true end -local goldText -local function OnEvent(self) +local function sortFunction(a, b) + return a.amount > b.amount +end + +local function deleteCharacter(_, realm, name) + ElvDB.gold[realm][name] = nil + ElvDB.class[realm][name] = nil + ElvDB.faction[realm][name] = nil + + DT:ForceUpdate_DataText('S&L Currencies') +end + +local function updateTotal(faction, change) + if faction == 'Alliance' then + totalAlliance = totalAlliance + change + elseif faction == 'Horde' then + totalHorde = totalHorde + change + end + + totalGold = totalGold + change +end + +local function updateGold(self, updateAll, goldChange) + local textOnly = not E.global.datatexts.settings.Gold.goldCoins and true or false + local style = E.global.datatexts.settings.Gold.goldFormat or 'BLIZZARD' + + if updateAll then + wipe(myGold) + wipe(menuList) + + totalGold, totalHorde, totalAlliance = 0, 0, 0 + + tinsert(menuList, { text = '', isTitle = true, notCheckable = true }) + tinsert(menuList, { text = 'Delete Character', isTitle = true, notCheckable = true }) + + local realmN = 1 + for realm in pairs(ElvDB.serverID[E.serverID]) do + tinsert(menuList, realmN, { text = 'Delete All - '..realm, notCheckable = true, func = function() ElvDB.gold[realm] = {} DT:ForceUpdate_DataText('Gold') end }) + realmN = realmN + 1 + for name in pairs(ElvDB.gold[realm]) do + local faction = ElvDB.faction[realm][name] + local gold = ElvDB.gold[realm][name] + + if gold then + local color = E:ClassColor(ElvDB.class[realm][name]) or PRIEST_COLOR + + tinsert(myGold, { + name = name, + realm = realm, + amount = gold, + amountText = E:FormatMoney(gold, style, textOnly), + faction = faction or '', + r = color.r, g = color.g, b = color.b, + }) + + tinsert(menuList, { + text = format('%s - %s', name, realm), + notCheckable = true, + func = function() deleteCharacter(self, realm, name) end + }) + + updateTotal(faction, gold) + end + end + end + else + for _, info in ipairs(myGold) do + if info.name == E.myname and info.realm == E.myrealm then + info.amount = ElvDB.gold[E.myrealm][E.myname] + info.amountText = E:FormatMoney(ElvDB.gold[E.myrealm][E.myname], style, textOnly) + + break + end + end + + if goldChange then + updateTotal(E.myfaction, goldChange) + end + end +end + +local function UpdateMarketPrice() + return C_WowTokenPublic_UpdateMarketPrice() +end + +local function OnEvent(self, event) if not IsLoggedIn() then return end if E.Retail and not Ticker then C_WowTokenPublic_UpdateMarketPrice() - Ticker = C_Timer_NewTicker(60, function() C_WowTokenPublic_UpdateMarketPrice() end) + Ticker = C_Timer_NewTicker(60, UpdateMarketPrice) end - ElvDB = ElvDB or {} + if event == 'ELVUI_FORCE_UPDATE' then + ElvDB = ElvDB or {} - ElvDB.gold = ElvDB.gold or {} - ElvDB.gold[E.myrealm] = ElvDB.gold[E.myrealm] or {} + ElvDB.gold = ElvDB.gold or {} + ElvDB.gold[E.myrealm] = ElvDB.gold[E.myrealm] or {} - ElvDB.class = ElvDB.class or {} - ElvDB.class[E.myrealm] = ElvDB.class[E.myrealm] or {} - ElvDB.class[E.myrealm][E.myname] = E.myclass + ElvDB.class = ElvDB.class or {} + ElvDB.class[E.myrealm] = ElvDB.class[E.myrealm] or {} + ElvDB.class[E.myrealm][E.myname] = E.myclass - ElvDB.faction = ElvDB.faction or {} - ElvDB.faction[E.myrealm] = ElvDB.faction[E.myrealm] or {} - ElvDB.faction[E.myrealm][E.myname] = E.myfaction + ElvDB.faction = ElvDB.faction or {} + ElvDB.faction[E.myrealm] = ElvDB.faction[E.myrealm] or {} + ElvDB.faction[E.myrealm][E.myname] = E.myfaction - ElvDB.serverID = ElvDB.serverID or {} - ElvDB.serverID[E.serverID] = ElvDB.serverID[E.serverID] or {} - ElvDB.serverID[E.serverID][E.myrealm] = true + ElvDB.serverID = ElvDB.serverID or {} + ElvDB.serverID[E.serverID] = ElvDB.serverID[E.serverID] or {} + ElvDB.serverID[E.serverID][E.myrealm] = true + end --prevent an error possibly from really old profiles local oldMoney = ElvDB.gold[E.myrealm][E.myname] @@ -162,13 +217,15 @@ local function OnEvent(self) Profit = Profit + Change end + updateGold(self, event == 'ELVUI_FORCE_UPDATE', Change) + goldText = E:FormatMoney(GetMoney(), E.global.datatexts.settings.Currencies.goldFormat or 'BLIZZARD', not E.global.datatexts.settings.Currencies.goldCoins) local displayed = E.global.datatexts.settings.Currencies.displayedCurrency if displayed == 'BACKPACK' then local displayString for i = 1, 3 do - local info = C_CurrencyInfo_GetBackpackCurrencyInfo(i) + local info = DT:BackpackCurrencyInfo(i) if info and info.quantity then displayString = (i > 1 and displayString..' ' or '')..format('%s %s', format(iconString, info.iconFileID), E:ShortValue(info.quantity)) end @@ -181,16 +238,16 @@ local function OnEvent(self) local id = tonumber(displayed) if not id then return end - local name, num, _, icon = GetInfo(id) + local info, name, icon = DT:CurrencyInfo(id) if not name then return end local style = E.global.datatexts.settings.Currencies.displayStyle if style == 'ICON' then - self.text:SetFormattedText('%s %s', icon, E:ShortValue(num)) + self.text:SetFormattedText('%s %s', icon, E:ShortValue(info.quantity)) elseif style == 'ICON_TEXT' then - self.text:SetFormattedText('%s %s %s', icon, name, E:ShortValue(num)) + self.text:SetFormattedText('%s %s %s', icon, name, E:ShortValue(info.quantity)) else --ICON_TEXT_ABBR - self.text:SetFormattedText('%s %s %s', icon, E:AbbreviateString(name), E:ShortValue(num)) + self.text:SetFormattedText('%s %s %s', icon, E:AbbreviateString(name), E:ShortValue(info.quantity)) end end end @@ -199,15 +256,15 @@ local function getTotalAnima() local total = 0 for i = 0, NUM_BAG_SLOTS do - local bagName = C_Container.GetBagName(i) + local bagName = C_Container_GetBagName(i) if bagName then for slotID = 1, C_Container_GetContainerNumSlots(i) do local link = C_Container_GetContainerItemLink(i, slotID) - local count = select(2, C_Container_GetContainerItemInfo(i, slotID)) if link and C_Item_IsAnimaItemByID(link) then + local itemInfo = C_Container_GetContainerItemInfo(i, slotID) local _, spellID = GetItemSpell(link) - total = total + animaSpellID[spellID] * count + total = total + animaSpellID[spellID] * itemInfo.stackCount end end end @@ -216,7 +273,6 @@ local function getTotalAnima() return total end -local myGold = {} local function OnEnter() DT.tooltip:ClearLines() @@ -224,6 +280,7 @@ local function OnEnter() local style = E.global.datatexts.settings.Gold.goldFormat or 'BLIZZARD' DT.tooltip:AddLine(L["Session:"]) + DT.tooltip:AddDoubleLine(L["Earned:"], E:FormatMoney(Profit, style, textOnly), 1, 1, 1, 1, 1, 1) DT.tooltip:AddDoubleLine(L["Spent:"], E:FormatMoney(Spent, style, textOnly), 1, 1, 1, 1, 1, 1) if Profit < Spent then @@ -231,38 +288,10 @@ local function OnEnter() elseif (Profit-Spent)>0 then DT.tooltip:AddDoubleLine(L["Profit:"], E:FormatMoney(Profit-Spent, style, textOnly), 0, 1, 0, 1, 1, 1) end - DT.tooltip:AddLine(' ') - local totalGold, totalHorde, totalAlliance = 0, 0, 0 + DT.tooltip:AddLine(' ') DT.tooltip:AddLine(L["Character: "]) - wipe(myGold) - for realm in pairs(ElvDB.serverID[E.serverID]) do - for k, _ in pairs(ElvDB.gold[realm]) do - if ElvDB.gold[realm][k] then - local color = E:ClassColor(ElvDB.class[realm][k]) or PRIEST_COLOR - tinsert(myGold, - { - name = k, - realm = realm, - amount = ElvDB.gold[realm][k], - amountText = E:FormatMoney(ElvDB.gold[realm][k], style, textOnly), - faction = ElvDB.faction[realm][k] or '', - r = color.r, g = color.g, b = color.b, - } - ) - end - - if ElvDB.faction[realm][k] == 'Alliance' then - totalAlliance = totalAlliance+ElvDB.gold[realm][k] - elseif ElvDB.faction[realm][k] == 'Horde' then - totalHorde = totalHorde+ElvDB.gold[realm][k] - end - - totalGold = totalGold+ElvDB.gold[realm][k] - end - end - sort(myGold, sortFunction) for _, g in ipairs(myGold) do @@ -283,6 +312,7 @@ local function OnEnter() DT.tooltip:AddLine(' ') end DT.tooltip:AddDoubleLine(L["Total: "], E:FormatMoney(totalGold, style, textOnly), 1, 1, 1, 1, 1, 1) + DT.tooltip:AddLine(' ') wipe(shownHeaders) @@ -311,34 +341,41 @@ local function OnEnter() DT.tooltip:AddLine(' ') end - local anima = getTotalAnima() - if anima > 0 then - DT.tooltip:AddDoubleLine(L["Anima:"], anima, 0, .8, 1, 1, 1, 1) + if E.Retail then + local anima = getTotalAnima() + if anima > 0 then + DT.tooltip:AddDoubleLine(L["Anima:"], anima, 0, .8, 1, 1, 1, 1) + DT.tooltip:AddLine(' ') + end DT.tooltip:AddLine(' ') + DT.tooltip:AddDoubleLine(L["WoW Token:"], E:FormatMoney(C_WowTokenPublic_GetCurrentMarketPrice() or 0, style, textOnly), 0, .8, 1, 1, 1, 1) + end + + if E.Retail or E.Wrath then + for i = 1, MAX_WATCHED_TOKENS do + local info, name = DT:BackpackCurrencyInfo(i) + if not name then break end + + if i == 1 then + DT.tooltip:AddLine(' ') + DT.tooltip:AddLine(CURRENCY) + end + + if info.quantity then + DT.tooltip:AddDoubleLine(format(iconString, info.iconFileID, name), info.quantity, 1, 1, 1, 1, 1, 1) + end + end end - DT.tooltip:AddDoubleLine(L["WoW Token:"], E:FormatMoney(C_WowTokenPublic_GetCurrentMarketPrice() or 0, style, textOnly), 0, .8, 1, 1, 1, 1) - - -- ElvUI Gold DT -> Watched Backpack Currencies - -- for i = 1, MAX_WATCHED_TOKENS do - -- local info = C_CurrencyInfo_GetBackpackCurrencyInfo(i) - -- if info then - -- if i == 1 then - -- DT.tooltip:AddLine(' ') - -- DT.tooltip:AddLine(CURRENCY) - -- end - -- if info.quantity then - -- DT.tooltip:AddDoubleLine(format('%s %s', format(iconString, info.iconFileID), info.name), BreakUpLargeNumbers(info.quantity), 1, 1, 1, 1, 1, 1) - -- end - -- end - -- end local grayValue = B:GetGraysValue() if grayValue > 0 then DT.tooltip:AddLine(' ') DT.tooltip:AddDoubleLine(L["Grays"], E:FormatMoney(grayValue, style, textOnly), nil, nil, nil, 1, 1, 1) end + DT.tooltip:AddLine(' ') + DT.tooltip:AddDoubleLine(L["Gold"]..':', goldText, nil, nil, nil, 1, 1, 1) DT.tooltip:AddLine(' ') DT.tooltip:AddLine(resetCountersFormatter) DT.tooltip:AddLine(resetInfoFormatter) diff --git a/Interface/AddOns/ElvUI_SLE/modules/datatexts/friends.lua b/Interface/AddOns/ElvUI_SLE/modules/datatexts/friends.lua index 0203e45e0..17f30e2a6 100644 --- a/Interface/AddOns/ElvUI_SLE/modules/datatexts/friends.lua +++ b/Interface/AddOns/ElvUI_SLE/modules/datatexts/friends.lua @@ -575,7 +575,6 @@ function OnEnter(self) tooltip:SmartAnchorTo(self) tooltip:SetAutoHideDelay(E.db.sle.dt.friends.tooltipAutohide, self) - tooltip:SetScript("OnShow", function(ttskinself) ttskinself:SetTemplate('Transparent') end) end line = tooltip:AddLine() @@ -760,4 +759,4 @@ local function ValueColorUpdate(hex) end E.valueColorUpdateFuncs[ValueColorUpdate] = true -DT:RegisterDatatext('S&L Friends', 'S&L', {"BN_FRIEND_ACCOUNT_ONLINE", "BN_FRIEND_ACCOUNT_OFFLINE", "BN_FRIEND_INFO_CHANGED", "FRIENDLIST_UPDATE", "CHAT_MSG_SYSTEM", "MODIFIER_STATE_CHANGED"}, OnEvent, nil, OnClick, OnEnter, nil, 'S&L Friends') \ No newline at end of file +DT:RegisterDatatext('S&L Friends', 'S&L', {"BN_FRIEND_ACCOUNT_ONLINE", "BN_FRIEND_ACCOUNT_OFFLINE", "BN_FRIEND_INFO_CHANGED", "FRIENDLIST_UPDATE", "CHAT_MSG_SYSTEM", "MODIFIER_STATE_CHANGED"}, OnEvent, nil, OnClick, OnEnter, nil, 'S&L Friends') diff --git a/Interface/AddOns/ElvUI_SLE/modules/equipmanager.lua b/Interface/AddOns/ElvUI_SLE/modules/equipmanager.lua index 2485f6c93..fe6028e33 100644 --- a/Interface/AddOns/ElvUI_SLE/modules/equipmanager.lua +++ b/Interface/AddOns/ElvUI_SLE/modules/equipmanager.lua @@ -100,26 +100,25 @@ EM.TagsTable = { return false end end, - --Talent selected. [talent:tier/column] - ['talent'] = function(tier, column) - tier, column = tonumber(tier), tonumber(column) - if not (tier or column) then - return false - end - if tier < 0 or tier > 7 then - SLE:Print(format(L["SLE_EM_TAG_INVALID_TALENT_TIER"], tier), 'error') - return false - end - if column < 0 or column > 3 then - SLE:Print(format(L["SLE_EM_TAG_INVALID_TALENT_COLUMN"], column), 'error') - return false - end - local _, _, _, selected = GetTalentInfo(tier, column, 1) - if selected then - return true - else - return false + --Talent selected. [talent:spell id|name] + ['talent'] = function(idOrName) + local activeConfigID = C_ClassTalents.GetActiveConfigID() + local configInfo = C_Traits.GetConfigInfo(activeConfigID) + local treeID = configInfo.treeIDs[1] + local nodeIDs = C_Traits.GetTreeNodes(treeID) + local passed = false + for _, nodeID in next, nodeIDs do + local nodeInfo = C_Traits.GetNodeInfo(activeConfigID, nodeID) + for _, entryID in next, nodeInfo.entryIDs do + local entryInfo = C_Traits.GetEntryInfo(activeConfigID, entryID) + local definitionInfo = C_Traits.GetDefinitionInfo(entryInfo.definitionID) + local purchased = nodeInfo.ranksPurchased > 0 + passed = purchased and (definitionInfo.spellID == tonumber(idOrName) or GetSpellInfo(definitionInfo.spellID) == idOrName) + if passed then break end + end + if passed then break end end + return passed end, --If in instanse. Optional arg [instance:type] - party, raid, scenario ['instance'] = function(dungeonType) diff --git a/Interface/AddOns/ElvUI_SLE/modules/minimap/instance.lua b/Interface/AddOns/ElvUI_SLE/modules/minimap/instance.lua index 7f5e39f5d..71d786fa0 100644 --- a/Interface/AddOns/ElvUI_SLE/modules/minimap/instance.lua +++ b/Interface/AddOns/ElvUI_SLE/modules/minimap/instance.lua @@ -5,12 +5,12 @@ local I = SLE.InstDif local _G = _G local format = format local sub = string.utf8sub -local IsAddOnLoaded = IsAddOnLoaded local GetDifficultyInfo = GetDifficultyInfo -I.BlizzDif = _G["MiniMapInstanceDifficulty"] -I.BlizzGDif = _G["GuildInstanceDifficulty"] -I.BlizzCM = _G["MiniMapChallengeMode"] +local InstanceDifficulty = _G.MinimapCluster.InstanceDifficulty +local Instance = InstanceDifficulty.Instance +local ChallengeMode = InstanceDifficulty.ChallengeMode +local Guild = InstanceDifficulty.Guild local Difficulties = { [1] = 'normal', --5ppl normal @@ -33,12 +33,12 @@ local Difficulties = { } function I:CreateText() - I.frame = CreateFrame("Frame", "MiniMapDifFrame", _G["Minimap"]) + I.frame = CreateFrame('Frame', 'SL_MinimapDifficultyFrame', _G.Minimap) I.frame:Size(50, 20) I.frame.text = I.frame:CreateFontString(nil, 'OVERLAY') - I.frame.text:SetPoint("CENTER", I.frame, "CENTER") + I.frame.text:SetPoint('CENTER', I.frame, 'CENTER') I.frame.icon = I.frame:CreateFontString(nil, 'OVERLAY') - I.frame.icon:SetPoint("LEFT", I.frame.text, "RIGHT", 4, 0) + I.frame.icon:SetPoint('LEFT', I.frame.text, 'RIGHT', 4, 0) self:SetFonts() end @@ -52,7 +52,7 @@ end function I:InstanceCheck() local isInstance, InstanseType = IsInInstance() local show = false - if isInstance and InstanseType ~= "pvp" and InstanseType ~= "arena" then show = true end + if isInstance and InstanseType ~= 'pvp' and InstanseType ~= 'arena' then show = true end return show end @@ -60,22 +60,22 @@ function I:GuildEmblem() -- table local char = {} -- check if Blizzard_GuildUI is loaded - if not IsAddOnLoaded("Blizzard_GuildUI") then LoadAddOn("Blizzard_GuildUI") end - if _G["GuildFrameTabardEmblem"] then - char.guildTexCoord = {_G["GuildFrameTabardEmblem"]:GetTexCoord()} + -- if not IsAddOnLoaded("Blizzard_GuildUI") then LoadAddOn("Blizzard_GuildUI") end + if Guild then + char.guildTexCoord = {Guild.Emblem:GetTexCoord()} else char.guildTexCoord = false end - if IsInGuild() and char.guildTexCoord then - return "|TInterface\\GuildFrame\\GuildEmblemsLG_01:24:24:-4:1:32:32:"..(char.guildTexCoord[1]*32)..":"..(char.guildTexCoord[7]*32)..":"..(char.guildTexCoord[2]*32)..":"..(char.guildTexCoord[8]*32).."|t" + if char.guildTexCoord and IsInGuild() then + return '|TInterface\\GuildFrame\\GuildEmblemsLG_01:24:24:-4:1:32:32:'..(char.guildTexCoord[1]*32)..':'..(char.guildTexCoord[7]*32)..':'..(char.guildTexCoord[2]*32)..':'..(char.guildTexCoord[8]*32)..'|t' else - return "" + return '' end end function I:UpdateFrame() local db = I.db - I.frame:Point("TOPLEFT", _G["Minimap"], "TOPLEFT", db.xoffset, db.yoffset) + I.frame:Point('TOPLEFT', _G.Minimap, 'TOPLEFT', db.xoffset, db.yoffset) I:SetFonts() if db.enable then I.frame.text:Show() @@ -95,11 +95,11 @@ function I:GetColor(dif) end end -function I:GenerateText(event, guild, force) - I.frame.icon:SetText("") +function I:GenerateText(_, guild) + I.frame.icon:SetText('') if not I:InstanceCheck() then - I.frame.text:SetText("") + I.frame.text:SetText('') else local text, isHeroic, isChallengeMode local groupType, difficulty, difficultyName, _, _, _, _, instanceGroupSize = select(2, GetInstanceInfo()) @@ -107,10 +107,10 @@ function I:GenerateText(event, guild, force) local r, g, b = I:GetColor(difficulty) if (difficulty >= 3 and difficulty <= 7) or difficulty == 9 or E.db.sle.minimap.instance.onlyNumber then - text = format("|cff%02x%02x%02x%s|r", r, g, b, instanceGroupSize) + text = format('|cff%02x%02x%02x%s|r', r, g, b, instanceGroupSize) else difficultyName = sub(difficultyName, 1 , 1) - text = format(instanceGroupSize.." |cff%02x%02x%02x%s|r", r, g, b, difficultyName) + text = format(instanceGroupSize..' |cff%02x%02x%02x%s|r', r, g, b, difficultyName) end I.frame.text:SetText(text) @@ -119,23 +119,23 @@ function I:GenerateText(event, guild, force) local logo = I:GuildEmblem() I.frame.icon:SetText(logo) end - I.BlizzDif:Hide() - I.BlizzCM:Hide() - I.BlizzGDif:Hide() + Instance:Hide() + ChallengeMode:Hide() + Guild:Hide() if not I.db.enable then - if not I.BlizzDif:IsShown() and (groupType == "raid" or isHeroic) and not guild then - I.BlizzDif:Show() - I.BlizzCM:Hide() - I.BlizzGDif:Hide() - elseif not I.BlizzCM:IsShown() and isChallengeMode and not guild then - I.BlizzDif:Hide() - I.BlizzCM:Show() - I.BlizzGDif:Hide() + if not Instance:IsShown() and (groupType == 'raid' or isHeroic) and not guild then + Instance:Show() + ChallengeMode:Hide() + Guild:Hide() + elseif not ChallengeMode:IsShown() and isChallengeMode and not guild then + Instance:Hide() + ChallengeMode:Show() + Guild:Hide() elseif guild then - I.BlizzDif:Hide() - I.BlizzCM:Hide() - I.BlizzGDif:Show() + Instance:Hide() + ChallengeMode:Hide() + Guild:Show() end end end @@ -146,19 +146,18 @@ function I:Initialize() if not SLE.initialized or not E.private.general.minimap.enable then return end I.db = E.db.sle.minimap.instance - self:CreateText() + I:CreateText() - I.BlizzDif:HookScript("OnShow", function(self) if I.db.enable then self:Hide() end end) - I.BlizzGDif:HookScript("OnShow", function(self) if I.db.enable then self:Hide() end end) - I.BlizzCM:HookScript("OnShow", function(self) if I.db.enable then self:Hide() end end) + Instance:HookScript('OnShow', function(frame) if I.db.enable then frame:Hide() end end) + Guild:HookScript('OnShow', function(frame) if I.db.enable then frame:Hide() end end) + ChallengeMode:HookScript('OnShow', function(frame) if I.db.enable then frame:Hide() end end) - self:RegisterEvent("LOADING_SCREEN_DISABLED", "GenerateText") - self:RegisterEvent("GROUP_ROSTER_UPDATE", "GenerateText") - -- self:RegisterEvent("ZONE_CHANGED_NEW_AREA", "GenerateText") - self:RegisterEvent("GUILD_PARTY_STATE_UPDATED", "GenerateText") - self:UpdateFrame() + I:RegisterEvent('LOADING_SCREEN_DISABLED', 'GenerateText') + I:RegisterEvent('GROUP_ROSTER_UPDATE', 'GenerateText') + I:RegisterEvent('GUILD_PARTY_STATE_UPDATED', 'GenerateText') + I:UpdateFrame() - hooksecurefunc("MiniMapInstanceDifficulty_Update", I.GenerateText) + hooksecurefunc(MinimapCluster.InstanceDifficulty, 'Update', I.GenerateText) function I:ForUpdateAll() I.db = E.db.sle.minimap.instance @@ -166,4 +165,4 @@ function I:Initialize() end end -SLE:RegisterModule(I:GetName()) \ No newline at end of file +SLE:RegisterModule(I:GetName()) diff --git a/Interface/AddOns/ElvUI_SLE/modules/professions/deconstruct.lua b/Interface/AddOns/ElvUI_SLE/modules/professions/deconstruct.lua index d195f99d3..d2b55091c 100644 --- a/Interface/AddOns/ElvUI_SLE/modules/professions/deconstruct.lua +++ b/Interface/AddOns/ElvUI_SLE/modules/professions/deconstruct.lua @@ -6,7 +6,7 @@ local LCG = E.Libs.ButtonGlow --GLOBALS: unpack, select, CreateFrame, VIDEO_OPTIONS_ENABLED, VIDEO_OPTIONS_DISABLED local _G = _G -local format, strfind, strmatch, strsplit, gsub = format, strfind, strmatch, strsplit, gsub +local format, strfind, strsplit, gsub = format, strfind, strsplit, gsub local GetItemInfo, GetTradeTargetItemLink = GetItemInfo, GetTradeTargetItemLink local InCombatLockdown = InCombatLockdown local LOCKED = LOCKED @@ -139,7 +139,7 @@ function Pr:ApplyDeconstruct(itemLink, itemId, spell, spellType, r, g, b) Pr.DeconstructionReal:SetAttribute('target-slot', slot:GetID()) Pr.DeconstructionReal:SetAllPoints(slot) Pr.DeconstructionReal:Show() - + if E.private.sle.professions.deconButton.style == "BIG" then ActionButton_ShowOverlayGlow(Pr.DeconstructionReal) elseif E.private.sle.professions.deconButton.style == "SMALL" then @@ -169,7 +169,7 @@ end function Pr:IsUnlockable(itemLink) local workLink - if _G["TradeFrame"]:IsShown() then + if _G.TradeFrame:IsShown() then workLink = GetTradeTargetItemLink(7) else local slot = GetMouseFocus() @@ -194,8 +194,8 @@ function Pr:DeconstructParser(tt, data) local ownerName = owner and owner.GetName and owner:GetName() if ownerName and (strfind(ownerName, 'ElvUI_Container') or strfind(ownerName, 'ElvUI_BankContainer')) then local itemId = data.id - if not itemId or itemId == "" then return end - + if not itemId or itemId == '' then return end + local hyperlink if data.guid then hyperlink = C_Item.GetItemLinkByGUID(data.guid); @@ -205,21 +205,21 @@ function Pr:DeconstructParser(tt, data) if not hyperlink then return end - if(itemId and not InCombatLockdown()) and (Pr.DeconstructMode == true or (E.global.sle.LOCK.TradeOpen and self:GetOwner():GetName() == "TradeRecipientItem7ItemButton")) then + if(itemId and not InCombatLockdown()) and (Pr.DeconstructMode == true or (E.global.sle.LOCK.TradeOpen and self:GetOwner():GetName() == 'TradeRecipientItem7ItemButton')) then local r, g, b if lib:IsOpenable(itemId) and Pr:IsUnlockable(hyperlink) then r, g, b = 0, 1, 1 - Pr:ApplyDeconstruct(hyperlink, itemId, Pr.LOCKname, "spell", r, g, b) + Pr:ApplyDeconstruct(hyperlink, itemId, Pr.LOCKname, 'spell', r, g, b) elseif lib:IsOpenableProfession(itemId) and Pr:IsUnlockable(hyperlink) then r, g, b = 0, 1, 1 local hasKey = HaveKey() - Pr:ApplyDeconstruct(hyperlink, itemId, hasKey, "item", r, g, b) + Pr:ApplyDeconstruct(hyperlink, itemId, hasKey, 'item', r, g, b) elseif lib:IsProspectable(itemId) then r, g, b = 1, 0, 0 - Pr:ApplyDeconstruct(hyperlink, itemId, Pr.PROSPECTname, "spell", r, g, b) + Pr:ApplyDeconstruct(hyperlink, itemId, Pr.PROSPECTname, 'spell', r, g, b) elseif lib:IsMillable(itemId) then r, g, b = 1, 0, 0 - Pr:ApplyDeconstruct(hyperlink, itemId, Pr.MILLname, "spell", r, g, b) + Pr:ApplyDeconstruct(hyperlink, itemId, Pr.MILLname, 'spell', r, g, b) elseif Pr.DEname then local isArtRelic local itemName, _, itemQuality, _, _, itemClass, itemSubclass, _, equipSlot = GetItemInfo(itemId) @@ -229,7 +229,7 @@ function Pr:DeconstructParser(tt, data) end if normalItem or isArtRelic then r, g, b = 1, 0, 0 - Pr:ApplyDeconstruct(hyperlink, itemId, Pr.DEname, "spell", r, g, b) + Pr:ApplyDeconstruct(hyperlink, itemId, Pr.DEname, 'spell', r, g, b) end end end @@ -239,48 +239,48 @@ end function Pr:GetDeconMode() local text if Pr.DeconstructMode then - text = "|cff00FF00 "..VIDEO_OPTIONS_ENABLED.."|r" + text = '|cff00FF00 '..VIDEO_OPTIONS_ENABLED..'|r' else - text = "|cffFF0000 "..VIDEO_OPTIONS_DISABLED.."|r" + text = '|cffFF0000 '..VIDEO_OPTIONS_DISABLED..'|r' end return text end function Pr:Construct_BagButton() - Pr.DeconstructButton = CreateFrame("Button", "SLE_DeconButton", _G["ElvUI_ContainerFrame"], "BackdropTemplate") + Pr.DeconstructButton = CreateFrame('Button', 'SLE_DeconButton', _G.ElvUI_ContainerFrame, 'BackdropTemplate') Pr.DeconstructButton:SetSize(16 + E.Border, 16 + E.Border) Pr.DeconstructButton:SetTemplate() Pr.DeconstructButton.ttText = L["Deconstruct Mode"] Pr.DeconstructButton.ttText2 = format(L["Allow you to disenchant/mill/prospect/unlock items.\nClick to toggle.\nCurrent state: %s."], Pr:GetDeconMode()) - Pr.DeconstructButton:SetScript("OnEnter", B.Tooltip_Show) - Pr.DeconstructButton:SetScript("OnLeave", GameTooltip_Hide) - Pr.DeconstructButton:SetPoint("RIGHT", _G["ElvUI_ContainerFrame"].bagsButton, "LEFT", -5, 0) - Pr.DeconstructButton:SetNormalTexture("Interface\\ICONS\\INV_Rod_Cobalt") + Pr.DeconstructButton:SetScript('OnEnter', B.Tooltip_Show) + Pr.DeconstructButton:SetScript('OnLeave', GameTooltip_Hide) + Pr.DeconstructButton:SetPoint('RIGHT', _G.ElvUI_ContainerFrame.bagsButton, 'LEFT', -5, 0) + Pr.DeconstructButton:SetNormalTexture([[Interface\ICONS\INV_Rod_Cobalt]]) Pr.DeconstructButton:GetNormalTexture():SetTexCoord(unpack(E.TexCoords)) Pr.DeconstructButton:GetNormalTexture():SetInside() Pr.DeconstructButton:StyleButton(nil, true) - Pr.DeconstructButton:SetScript("OnClick", function(frame) + Pr.DeconstructButton:SetScript('OnClick', function(frame) Pr.DeconstructMode = not Pr.DeconstructMode if Pr.DeconstructMode then - Pr.DeconstructButton:SetNormalTexture("Interface\\ICONS\\INV_Rod_EnchantedCobalt") + Pr.DeconstructButton:SetNormalTexture([[Interface\ICONS\INV_Rod_EnchantedCobalt]]) if E.private.sle.professions.deconButton.buttonGlow then ActionButton_ShowOverlayGlow(Pr.DeconstructButton) end else - Pr.DeconstructButton:SetNormalTexture("Interface\\ICONS\\INV_Rod_Cobalt") + Pr.DeconstructButton:SetNormalTexture([[Interface\ICONS\INV_Rod_Cobalt]]) ActionButton_HideOverlayGlow(Pr.DeconstructButton) end Pr.DeconstructButton.ttText2 = format(L["Allow you to disenchant/mill/prospect/unlock items.\nClick to toggle.\nCurrent state: %s."], Pr:GetDeconMode()) B.Tooltip_Show(frame) end) --Moving Elv's stuff - _G["ElvUI_ContainerFrame"].vendorGraysButton:SetPoint("RIGHT", Pr.DeconstructButton, "LEFT", -5, 0) + _G.ElvUI_ContainerFrame.vendorGraysButton:SetPoint('RIGHT', Pr.DeconstructButton, 'LEFT', -5, 0) end function Pr:ConstructRealDecButton() - Pr.DeconstructionReal = CreateFrame('Button', "SLE_DeconReal", E.UIParent, 'SecureActionButtonTemplate, AutoCastShineTemplate') - Pr.DeconstructionReal:SetScript('OnEvent', function(self, event, ...) self[event](self, ...) end) + Pr.DeconstructionReal = CreateFrame('Button', 'SLE_DeconReal', E.UIParent, 'SecureActionButtonTemplate, AutoCastShineTemplate') + Pr.DeconstructionReal:SetScript('OnEvent', function(obj, event, ...) obj[event](obj, ...) end) Pr.DeconstructionReal:RegisterForClicks('AnyUp', 'AnyDown') - Pr.DeconstructionReal:SetFrameStrata("TOOLTIP") + Pr.DeconstructionReal:SetFrameStrata('TOOLTIP') Pr.DeconstructionReal.TipLines = {} Pr.DeconstructionReal.OnLeave = function(frame) @@ -290,23 +290,23 @@ function Pr:ConstructRealDecButton() else frame:ClearAllPoints() frame:SetAlpha(1) - if _G["GameTooltip"] then _G["GameTooltip"]:Hide() end + if _G.GameTooltip then _G.GameTooltip:Hide() end frame:Hide() - -- LCG.AutoCastGlow_Stop(frame) + -- LCG.AutoCastGlow_Stop(frame) --! Leave here in in case of lib swap back LCG.HideOverlayGlow(frame) - -- LCG.ButtonGlow_Stop(frame) + -- LCG.ButtonGlow_Stop(frame) --! Leave here in in case of lib swap back ActionButton_HideOverlayGlow(frame) end end Pr.DeconstructionReal.SetTip = function(f) - _G["GameTooltip"]:SetOwner(f,"ANCHOR_LEFT",0,4) - _G["GameTooltip"]:ClearLines() - _G["GameTooltip"]:SetBagItem(f.Bag, f.Slot) + _G.GameTooltip:SetOwner(f,'ANCHOR_LEFT',0,4) + _G.GameTooltip:ClearLines() + _G.GameTooltip:SetBagItem(f.Bag, f.Slot) end - Pr.DeconstructionReal:SetScript("OnEnter", Pr.DeconstructionReal.SetTip) - Pr.DeconstructionReal:SetScript("OnLeave", function() Pr.DeconstructionReal:OnLeave() end) + Pr.DeconstructionReal:SetScript('OnEnter', Pr.DeconstructionReal.SetTip) + Pr.DeconstructionReal:SetScript('OnLeave', function() Pr.DeconstructionReal:OnLeave() end) Pr.DeconstructionReal:Hide() function Pr.DeconstructionReal:PLAYER_REGEN_ENABLED() @@ -332,16 +332,16 @@ function Pr:InitializeDeconstruct() local function Hiding() Pr.DeconstructMode = false - Pr.DeconstructButton:SetNormalTexture("Interface\\ICONS\\INV_Rod_Cobalt") + Pr.DeconstructButton:SetNormalTexture([[Interface\ICONS\INV_Rod_Cobalt]]) ActionButton_HideOverlayGlow(Pr.DeconstructButton) Pr.DeconstructionReal:OnLeave() end - _G["ElvUI_ContainerFrame"]:HookScript("OnHide", Hiding) + _G.ElvUI_ContainerFrame:HookScript('OnHide', Hiding) TooltipDataProcessor.AddTooltipPostCall(Enum.TooltipDataType.Item, function(tt, data) Pr:DeconstructParser(tt, data) end) - Pr:Blacklisting("DE") - Pr:Blacklisting("LOCK") + Pr:Blacklisting('DE') + Pr:Blacklisting('LOCK') Get_ArtRelic() end diff --git a/Interface/AddOns/ElvUI_SLE/modules/tooltips/tooltip.lua b/Interface/AddOns/ElvUI_SLE/modules/tooltips/tooltip.lua index befd71078..c0f1d6ec1 100644 --- a/Interface/AddOns/ElvUI_SLE/modules/tooltips/tooltip.lua +++ b/Interface/AddOns/ElvUI_SLE/modules/tooltips/tooltip.lua @@ -1,25 +1,24 @@ local SLE, T, E, L, V, P, G = unpack(select(2, ...)) local TT = E.Tooltip ---GLOBALS: unpack, select, hooksecurefunc local _G = _G local TooltipDataType = Enum.TooltipDataType --- local iconPath = [[Interface\AddOns\ElvUI_SLE\media\textures\]] local iconPath = [[Interface\AddOns\ElvUI_SLE\media\textures\afk\factionlogo\blizzard\]] -local function OnTooltipSetUnit(tt, data) +local function OnTooltipSetUnit(tt) if not SLE.initialized then return end if not E.db.sle.tooltip.showFaction then return end local unit = select(2, tt:GetUnit()) - if (UnitIsPlayer(unit)) then - local text = _G["GameTooltipTextLeft1"]:GetText() - local faction = UnitFactionGroup(unit) + if UnitIsPlayer(unit) then + local text = _G.GameTooltipTextLeft1:GetText() + local faction = UnitFactionGroup(unit) or 'Neutral' - if not faction then faction = "Neutral" end - -- |TTexturePath:size1:size2:xoffset:yoffset:dimx:dimy:coordx1:coordx2:coordy1:coordy2|t - -- _G["GameTooltipTextLeft1"]:SetText("|T"..iconPath..faction..".tga:15:15:0:0:64:64:2:56:2:56|t "..text) - _G["GameTooltipTextLeft1"]:SetText("|T"..iconPath..faction..".tga:0:0:0:0:128:128:28:100:28:100|t "..text) + if text and faction then + -- |TTexturePath:size1:size2:xoffset:yoffset:dimx:dimy:coordx1:coordx2:coordy1:coordy2|t + -- _G["GameTooltipTextLeft1"]:SetText("|T"..iconPath..faction..".tga:15:15:0:0:64:64:2:56:2:56|t "..text) + _G.GameTooltipTextLeft1:SetText('|T'..iconPath..faction..'.tga:0:0:0:0:128:128:28:100:28:100|t '..text) + end end end diff --git a/Interface/AddOns/ElvUI_SLE/options/minimap/instance_c.lua b/Interface/AddOns/ElvUI_SLE/options/minimap/instance_c.lua index 929070d0d..224cb1d4f 100644 --- a/Interface/AddOns/ElvUI_SLE/options/minimap/instance_c.lua +++ b/Interface/AddOns/ElvUI_SLE/options/minimap/instance_c.lua @@ -22,7 +22,7 @@ local function configTable() name = L["Enable"], desc = L["Show instance difficulty info as text."], disabled = function() return not E.private.general.minimap.enable end, - set = function(info, value) E.db.sle.minimap.instance[ info[#info] ] = value; I:GenerateText(nil, nil, true) end, + set = function(info, value) E.db.sle.minimap.instance[ info[#info] ] = value; I:GenerateText() end, }, xoffset = { order = 3, type = 'range', name = L["X-Offset"], min = -300, max = 300, step = 1, @@ -37,7 +37,7 @@ local function configTable() type = 'toggle', name = L["Only Number"], disabled = function() return not E.private.general.minimap.enable or not E.db.sle.minimap.instance.enable end, - set = function(info, value) E.db.sle.minimap.instance[ info[#info] ] = value; I:GenerateText(nil, nil, true) end, + set = function(info, value) E.db.sle.minimap.instance[ info[#info] ] = value; I:GenerateText() end, }, fontGroup = { order = 6, @@ -107,4 +107,4 @@ local function configTable() } end -tinsert(SLE.Configs, configTable) \ No newline at end of file +tinsert(SLE.Configs, configTable) diff --git a/Interface/AddOns/Rematch/Main.lua b/Interface/AddOns/Rematch/Main.lua index 00d9cc669..8886a7f50 100644 --- a/Interface/AddOns/Rematch/Main.lua +++ b/Interface/AddOns/Rematch/Main.lua @@ -241,6 +241,7 @@ function rematch:InitSavedVars() end end end + settings.SelectedTab = settings.SelectedTab or 1 settings.MiniMinimized = nil -- disabling this setting rematch:ValidateTeams() -- make sure teams are okay @@ -743,6 +744,36 @@ function rematch.SlashHandler(msg) msg = SecureCmdOptionParse(msg) if msg:lower()=="debug" then rematch:ShowDebugDialog() + elseif msg:lower()=="queuedebug" then -- watch for pets being removed from the queue + setmetatable(RematchSettings,{ + __newIndex = function(self,key,value) + if key=="LevelingQueue" and not rematch.Level25PetLeavingQueue then + local text = GetAddOnMetadata("Rematch","Version").." LevelingQueue reassigned from "..Rematch:CallerID() + Rematch:ShowMultiLineDialog("Leveling Queue Pet Deleted!",text) + end + end + }) + setmetatable(RematchSettings.LevelingQueue,{ + __newIndex = function(self,key,value) + if not value and not rematch.Level25PetLeavingQueue then + local text = GetAddOnMetadata("Rematch","Version").." Setting "..(key or "nil").." to "..(value or "nil").." from "..Rematch:CallerID() + Rematch:ShowMultiLineDialog("Leveling Queue Pet Deleted!",text) + end + end + }) + hooksecurefunc("tremove",function(self,index) + if self==RematchSettings.LevelingQueue and not rematch.Level25PetLeavingQueue then + local text = GetAddOnMetadata("Rematch","Version").." Removing index "..(index or "nil").." from "..Rematch:CallerID() + Rematch:ShowMultiLineDialog("Leveling Queue Pet Deleted!",text) + end + end) + hooksecurefunc(table,"remove",function(self,index) + if self==RematchSettings.LevelingQueue and not rematch.Level25PetLeavingQueue then + local text = GetAddOnMetadata("Rematch","Version").." Removing index "..(index or "nil").." from "..Rematch:CallerID() + Rematch:ShowMultiLineDialog("Leveling Queue Pet Deleted!",text) + end + end) + rematch:print("Now watching for anything trying to remove pets from the leveling queue. If you get a popup that says Leveling Queue Pet Deleted! at the top, please copy and paste the contents in a comment on Rematch or PM Gello at wowinterface or curse, thanks! (This monitoring only lasts until you logout/reload.)") elseif msg:trim():len()>0 then -- going to desensitize the passed name so "aki the chosen" works for "Aki the Chosen" local name = format("^%s$",rematch:DesensitizeText(msg)) @@ -791,6 +822,24 @@ function rematch:ShutdownAddon() Rematch.ToggleNotes = function() end end +function rematch:ShowMultiLineDialog(title,text) + -- data collected, now show dialog + local dialog = rematch:ShowDialog("MultiLineDialog",300,300,title,nil,nil,nil,OKAY) + dialog.MultiLine:SetPoint("TOP",0,-38) + dialog.MultiLine:SetSize(262,224) + dialog.MultiLine:Show() + dialog:SetContext("settings",text) + dialog.MultiLine.EditBox:SetScript("OnTextChanged",function(self) + if self:GetText()~=dialog:GetContext("settings") then + self:SetText(dialog:GetContext("settings")) + self:SetCursorPosition(0) + self:HighlightText(0) + self:SetFocus(true) + end + end) + dialog.MultiLine.EditBox:SetText("") +end + -- /rematch debug displays a dialog containing enabled options and various settings the user can copy to a post/comment to help debug function rematch:ShowDebugDialog() local data = {} @@ -981,3 +1030,4 @@ function rematch:SetFootnoteIcon(button,icon) end end end + diff --git a/Interface/AddOns/Rematch/Process/QueueProcess.lua b/Interface/AddOns/Rematch/Process/QueueProcess.lua index dfbdeed1a..4e9c8f215 100644 --- a/Interface/AddOns/Rematch/Process/QueueProcess.lua +++ b/Interface/AddOns/Rematch/Process/QueueProcess.lua @@ -122,7 +122,9 @@ function rematch:ProcessQueue() else local petInfo = rematch.petInfo:Fetch(petID) if petInfo.valid then -- only remove valid pets that can't level + rematch.Level25PetLeavingQueue = true tremove(queue,i) -- remove pets that can't level (or that are already in queue) + rematch.Level25PetLeavingQueue = nil end end end @@ -266,6 +268,7 @@ end -- to add/move a pet to the top of the queue: index=1 -- to add/move a pet to the end of the queue: index=#queue+1 function rematch:InsertPetToQueue(index,petID) + rematch.Level25PetLeavingQueue = true local isNew = true -- assume pet is new local oldQueueSize = #queue -- before we add something, note size of queue -- check if pet already exists in queue; if so replace it with a placeholder 0 @@ -289,9 +292,11 @@ function rematch:InsertPetToQueue(index,petID) rematch:MaybeSlotNewLevelingPet(petID) end rematch:UpdateQueue() + rematch.Level25PetLeavingQueue = nil end function rematch:RemovePetFromQueue(petID) + rematch.Level25PetLeavingQueue = true for i=#queue,1,-1 do if queue[i]==petID then tremove(queue,i) @@ -299,6 +304,7 @@ function rematch:RemovePetFromQueue(petID) end rematch.outgoingQueuedPetID = petID -- note this pet for ProcessQueue within the UpdateUI rematch:UpdateQueue() + rematch.Level25PetLeavingQueue = nil end -- this should be the only place to add many pets to the end of the queue @@ -507,6 +513,7 @@ end -- a time (initial login?), so for a workaround invalid pets are allowed to remain in the queue and the user can remove them; 99% of -- time this is when a pet in the queue is caged or released) function rematch:RemoveInvalidPetsFromQueue() + rematch.Level25PetLeavingQueue = true for i=#queue,1,-1 do local petInfo = rematch.petInfo:Fetch(queue[i]) if not petInfo.valid then @@ -514,4 +521,5 @@ function rematch:RemoveInvalidPetsFromQueue() end end rematch:UpdateQueue() + rematch.Level25PetLeavingQueue = nil end \ No newline at end of file diff --git a/Interface/AddOns/Rematch/Process/Roster.lua b/Interface/AddOns/Rematch/Process/Roster.lua index f49087863..6003348ef 100644 --- a/Interface/AddOns/Rematch/Process/Roster.lua +++ b/Interface/AddOns/Rematch/Process/Roster.lua @@ -31,7 +31,7 @@ roster.ownedNeedsUpdated = true -- becomes true when we need to expand filters t rematch:InitModule(function() settings = RematchSettings - roster:RegisterEvent("PET_JOURNAL_LIST_UPDATE") + roster:RegisterEvent("UPDATE_SUMMONPETS_ACTION") roster:SetScript("OnEvent",function(self,event,...) roster[event](self,...) end) roster.isStrongCache = rematch:CreateODTable() -- used by IsStrong() function end) @@ -47,6 +47,17 @@ function rematch:UpdateRoster() rematch:StartTimer("RosterUpdate",0,rematch.UpdateUI) end +--[[ As of 10.0.2, using UPDATE_SUMMONPETS_ACTION to test whether pets are loaded on login ]] + +-- using this to know when pets are loaded +function roster:UPDATE_SUMMONPETS_ACTION() + roster:UnregisterEvent("UPDATE_SUMMONPETS_ACTION") + roster:RegisterEvent("PET_JOURNAL_LIST_UPDATE") + roster:RegisterEvent("NEW_PET_ADDED") + roster:RegisterEvent("PET_JOURNAL_PET_DELETED") + roster:PET_JOURNAL_LIST_UPDATE() -- start first check +end + --[[ PET_JOURNAL_LIST_UPDATE Just about everything that changes pets (added/removed, renamed, stoned for level/rarity, etc) @@ -99,6 +110,9 @@ function roster:PET_JOURNAL_LIST_UPDATE() rematch:UpdateUI() end +roster.NEW_PET_ADDED = roster.PET_JOURNAL_LIST_UPDATE +roster.PET_JOURNAL_PET_DELETED = roster.PET_JOURNAL_LIST_UPDATE + -- this is only registered while "Other","CurrentZone" filter enabled function roster:ZONE_CHANGED_NEW_AREA() if roster:GetFilter("Other","CurrentZone") then diff --git a/Interface/AddOns/Rematch/Rematch.toc b/Interface/AddOns/Rematch/Rematch.toc index 3a5a1090b..57de64257 100644 --- a/Interface/AddOns/Rematch/Rematch.toc +++ b/Interface/AddOns/Rematch/Rematch.toc @@ -2,7 +2,7 @@ ## Title: Rematch ## Notes: A pet journal alternative for managing pets and teams. ## Author: Gello -## Version: 4.14.6 +## Version: 4.14.7 ## X-WoWI-ID: 22190 ## X-Wago-ID: e56nOpK9 ## X-Curse-Project-ID: 66047 diff --git a/Interface/AddOns/Rematch/Utils.lua b/Interface/AddOns/Rematch/Utils.lua index 8dbbb5430..63f6c5602 100644 --- a/Interface/AddOns/Rematch/Utils.lua +++ b/Interface/AddOns/Rematch/Utils.lua @@ -672,6 +672,15 @@ function rematch:DebugStack() return "\124cffc0c0c0"..table.concat(callers,", ") end +-- returns where the calling function was called from +function rematch:CallerID() + local where = (debugstack():match(".-\n.-\n.-\n.-\\AddOns\\.-\\(.-:%d+.-)\n") or ""):gsub("\"]","") + if where:len()==0 then + where = (debugstack():match(".-\n.-\n.-\\AddOns\\.-\\(.-:%d+.-)\n") or ""):gsub("\"]","") + end + return where:len()>0 and where or debugstack() +end + -- Summoning/dismissing all pets are on GCD, but not all petIDs think so! -- For the toolbar cooldown display and Keep Companion option, we need to be aware -- of the GCD. If a GCD petID isn't already discovered, it will go through the diff --git a/Interface/AddOns/Rematch/changelog.txt b/Interface/AddOns/Rematch/changelog.txt index d46c42b80..b64370931 100644 --- a/Interface/AddOns/Rematch/changelog.txt +++ b/Interface/AddOns/Rematch/changelog.txt @@ -1,3 +1,7 @@ +11/21/2022 version 4.14.7 +- Changed event to trigger on pets loading from PET_JOURNAL_LIST_UPDATE to UPDATE_SUMMONPETS_ACTION. +- Added '/rematch queuedebug' slash command to monitor pets being deleted from the queue. Anyone who is experiencing their queue emptying: Run this command anytime after you log in and go about your business. If you get a popup that says Leveling Queue Pet Deleted! at the top, copy and paste its contents in a comment or PM to Gello at wowinterface or curse. The monitoring from this command ends on a logout/reload. + 11/20/2022 version 4.14.6 - Pets are no longer automatically removed from the leveling queue when they are found missing or invalid - this includes when they are caged or released. - When a leveling queue pet is missing or invalid (likely due to being caged or released), a "Missing or Invalid Pet" will be in the queue in its place.