From e90554addb4dc59f2ee0ac52275d485a8d10b21e Mon Sep 17 00:00:00 2001 From: Simpy Date: Tue, 19 Mar 2024 22:40:07 -0400 Subject: [PATCH 01/15] handle ticket button on microbar --- ElvUI/Core/Modules/ActionBars/MicroBar.lua | 42 +++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/ElvUI/Core/Modules/ActionBars/MicroBar.lua b/ElvUI/Core/Modules/ActionBars/MicroBar.lua index 9ff74c6889..def14d0159 100644 --- a/ElvUI/Core/Modules/ActionBars/MicroBar.lua +++ b/ElvUI/Core/Modules/ActionBars/MicroBar.lua @@ -8,6 +8,7 @@ local gsub = gsub local assert = assert local unpack = unpack local tinsert = tinsert +local strfind = strfind local CreateFrame = CreateFrame local UpdateMicroButtonsParent = UpdateMicroButtonsParent local RegisterStateDriver = RegisterStateDriver @@ -335,6 +336,7 @@ function AB:UpdateMicroButtons() AB:HandleBackdropMultiplier(microBar, backdropSpacing, db.buttonSpacing, db.widthMult, db.heightMult, anchorUp, anchorLeft, horizontal, lastButton, anchorRowButton) AB:HandleBackdropMover(microBar, backdropSpacing) + AB:HandleTicketButton() if microBar.mover then if db.enabled then @@ -365,6 +367,39 @@ function AB:HandleCharacterPortrait() self.Portrait:SetInside() end +function AB:HasTicketButton() + local microMenu = _G.MicroMenu + if microMenu and microMenu.UpdateHelpTicketButtonAnchor then + return microMenu + end +end + +function AB:HandleTicketButton() + if AB:HasTicketButton() then + AB:UpdateHelpTicketButtonAnchor() + end +end + +function AB:UpdateHelpTicketButtonAnchor() + local ticket = _G.HelpOpenWebTicketButton + if not ticket then return end + + local first = _G[AB.MICRO_BUTTONS[1]] + if first then + local db = AB.db.microbar + local point = E:GetScreenQuadrant(first) + local size = ((db.keepSizeRatio and db.buttonSize) or db.buttonHeight) or 20 + local height = (size / 2) + 7 + + ticket:ClearAllPoints() + ticket:SetPoint('CENTER', first, 0, (point and strfind(point, 'BOTTOM')) and -height or height) + end +end + +function AB:MicroBar_PostDrag() + AB:HandleTicketButton() +end + function AB:SetupMicroBar() microBar:CreateBackdrop(AB.db.transparent and 'Transparent', nil, nil, nil, nil, nil, nil, nil, 0) microBar:Point('TOPLEFT', E.UIParent, 'TOPLEFT', 4, -48) @@ -399,6 +434,11 @@ function AB:SetupMicroBar() AB:SecureHook('UpdateMicroButtons') + local microMenu = AB:HasTicketButton() + if microMenu then + hooksecurefunc(microMenu, 'UpdateHelpTicketButtonAnchor', AB.UpdateHelpTicketButtonAnchor) + end + if _G.ResetMicroMenuPosition then _G.ResetMicroMenuPosition() else @@ -418,5 +458,5 @@ function AB:SetupMicroBar() _G.PVPMicroButtonTexture:SetAlpha(0) end - E:CreateMover(microBar, 'MicrobarMover', L["Micro Bar"], nil, nil, nil, 'ALL,ACTIONBARS', nil, 'actionbar,microbar') + E:CreateMover(microBar, 'MicrobarMover', L["Micro Bar"], nil, nil, AB.MicroBar_PostDrag, 'ALL,ACTIONBARS', nil, 'actionbar,microbar') end From d2d58c49c40b768c8c0e67c6190b50b6f1df1121 Mon Sep 17 00:00:00 2001 From: Simpy Date: Tue, 19 Mar 2024 23:02:35 -0400 Subject: [PATCH 02/15] handle icons when using the minimap toggle keybind --- ElvUI/Core/Modules/Maps/Minimap.lua | 282 ++++++++++++++++++---------- 1 file changed, 180 insertions(+), 102 deletions(-) diff --git a/ElvUI/Core/Modules/Maps/Minimap.lua b/ElvUI/Core/Modules/Maps/Minimap.lua index a0a91e0ffc..8503ec4b9f 100644 --- a/ElvUI/Core/Modules/Maps/Minimap.lua +++ b/ElvUI/Core/Modules/Maps/Minimap.lua @@ -123,34 +123,45 @@ function M:HandleExpansionButton() local garrison = _G.ExpansionLandingPageMinimapButton or _G.GarrisonLandingPageMinimapButton if not garrison then return end - local scale, position, xOffset, yOffset = M:GetIconSettings('classHall') - garrison:ClearAllPoints() - garrison:Point(position, Minimap, xOffset, yOffset) - M:SetScale(garrison, scale) + local hidden = not Minimap:IsShown() + if hidden then + garrison:Hide() + else + local scale, position, xOffset, yOffset = M:GetIconSettings('classHall') + garrison:ClearAllPoints() + garrison:Point(position, Minimap, xOffset, yOffset) + garrison:Show() + + M:SetScale(garrison, scale) - local box = _G.GarrisonLandingPageTutorialBox - if box then - box:SetScale(1 / scale) - box:SetClampedToScreen(true) + local box = _G.GarrisonLandingPageTutorialBox + if box then + box:SetScale(1 / scale) + box:SetClampedToScreen(true) + end end end function M:HandleTrackingButton() - local tracking = (MinimapCluster.TrackingFrame and MinimapCluster.TrackingFrame.Button) or _G.MiniMapTrackingFrame or _G.MiniMapTracking + local tracking = MinimapCluster.TrackingFrame or _G.MiniMapTrackingFrame or _G.MiniMapTracking if not tracking then return end tracking:ClearAllPoints() - if E.private.general.minimap.hideTracking then - tracking:Point('CENTER', E.HiddenFrame) + local hidden = not Minimap:IsShown() + if hidden or E.private.general.minimap.hideTracking then + tracking:Hide() else local scale, position, xOffset, yOffset = M:GetIconSettings('tracking') tracking:Point(position, Minimap, xOffset, yOffset) + tracking:Show() + M:SetScale(tracking, scale) - if E.Retail and (tracking:GetScript('OnMouseDown') ~= M.TrackingButton_OnMouseDown) then - tracking:SetScript('OnMouseDown', M.TrackingButton_OnMouseDown) + local button = E.Retail and tracking.Button + if button and (button:GetScript('OnMouseDown') ~= M.TrackingButton_OnMouseDown) then + button:SetScript('OnMouseDown', M.TrackingButton_OnMouseDown) end if _G.MiniMapTrackingButtonBorder then @@ -218,6 +229,14 @@ function M:MinimapTracking_UpdateTracking() end end +function M:Minimap_OnShow() + M:UpdateIcons() +end + +function M:Minimap_OnHide() + M:UpdateIcons() +end + function M:Minimap_OnMouseDown(btn) menuFrame:Hide() @@ -331,6 +350,146 @@ function M:GetIconSettings(button) return profile.scale or defaults.scale, profile.position or defaults.position, profile.xOffset or defaults.xOffset, profile.yOffset or defaults.yOffset end +function M:CraftingIconShow(icon) + local count = icon.countInfos and #icon.countInfos + icon:SetShown(count and count > 0) +end + +function M:UpdateIcons() + local gameTime = _G.GameTimeFrame + local indicator = MinimapCluster.IndicatorFrame + local craftingFrame = indicator and indicator.CraftingOrderFrame + local mailFrame = (indicator and indicator.MailFrame) or _G.MiniMapMailFrame + local battlefieldFrame = _G.MiniMapBattlefieldFrame + local difficulty = E.Retail and MinimapCluster.InstanceDifficulty + + if difficulty then + local r, g, b = unpack(E.media.backdropcolor) + local r2, g2, b2, a2 = unpack(E.media.backdropfadecolor) + for _, name in next, DifficultyIcons do + local frame = difficulty[name] + if frame then + if frame.Border then + frame.Border:SetVertexColor(r, g, b) + end + if frame.Background then + frame.Background:SetVertexColor(r2, g2, b2, a2) + end + end + end + end + + local noCluster = not E.Retail or E.db.general.minimap.clusterDisable + if not noCluster then + if M.ClusterHolder then + E:EnableMover(M.ClusterHolder.mover.name) + end + + if difficulty then + difficulty:ClearAllPoints() + difficulty:SetPoint('TOPRIGHT', MinimapCluster, 0, -25) + difficulty:Show() + + M:SetScale(difficulty, 1) + end + + if gameTime then + gameTime:Show() + end + + if craftingFrame then + M:CraftingIconShow(craftingFrame) + end + + if mailFrame then + mailFrame:Show() + end + + if battlefieldFrame then + battlefieldFrame:Show() + end + else + if M.ClusterHolder then + E:DisableMover(M.ClusterHolder.mover.name) + end + + M.HandleTrackingButton() + M.HandleExpansionButton() + + local hidden = not Minimap:IsShown() + if gameTime then + if hidden or E.private.general.minimap.hideCalendar then + gameTime:Hide() + else + local scale, position, xOffset, yOffset = M:GetIconSettings('calendar') + gameTime:ClearAllPoints() + gameTime:Point(position, Minimap, xOffset, yOffset) + gameTime:SetParent(Minimap) + gameTime:SetFrameLevel(_G.MinimapBackdrop:GetFrameLevel() + 2) + gameTime:Show() + + M:SetScale(gameTime, scale) + end + end + + if craftingFrame then + if hidden then + craftingFrame:Hide() + else + local scale, position, xOffset, yOffset = M:GetIconSettings('crafting') + craftingFrame:ClearAllPoints() + craftingFrame:Point(position, Minimap, xOffset, yOffset) + M:CraftingIconShow(craftingFrame) + + M:SetScale(craftingFrame, scale) + end + end + + if mailFrame then + if hidden then + mailFrame:Hide() + else + local scale, position, xOffset, yOffset = M:GetIconSettings('mail') + mailFrame:ClearAllPoints() + mailFrame:Point(position, Minimap, xOffset, yOffset) + mailFrame:Show() + + M:SetScale(mailFrame, scale) + end + end + + if battlefieldFrame then + if hidden then + battlefieldFrame:Hide() + else + local scale, position, xOffset, yOffset = M:GetIconSettings('battlefield') + battlefieldFrame:ClearAllPoints() + battlefieldFrame:Point(position, Minimap, xOffset, yOffset) + battlefieldFrame:Show() + + M:SetScale(battlefieldFrame, scale) + end + + if _G.BattlegroundShine then _G.BattlegroundShine:Hide() end + if _G.MiniMapBattlefieldBorder then _G.MiniMapBattlefieldBorder:Hide() end + if _G.MiniMapBattlefieldIcon then _G.MiniMapBattlefieldIcon:SetTexCoord(unpack(E.TexCoords)) end + end + + if difficulty then + if hidden then + difficulty:Hide() + else + local scale, position, xOffset, yOffset = M:GetIconSettings('difficulty') + difficulty:ClearAllPoints() + difficulty:Point(position, Minimap, xOffset, yOffset) + difficulty:Show() + + M:SetScale(difficulty, scale) + end + end + end +end + function M:UpdateSettings() if not M.Initialized then return end @@ -356,6 +515,9 @@ function M:UpdateSettings() end end + -- handle the icons placed around the minimap (also the cluster) + M:UpdateIcons() + -- silly little hack to get the canvas to update if E.MinimapSize ~= M.NeedsCanvasUpdate then local zoom = Minimap:GetZoom() @@ -418,96 +580,9 @@ function M:UpdateSettings() _G.TimeManagerClockButton:Show() end end - - local difficulty = E.Retail and MinimapCluster.InstanceDifficulty - if difficulty then - local r, g, b = unpack(E.media.backdropcolor) - local r2, g2, b2, a2 = unpack(E.media.backdropfadecolor) - for _, name in next, DifficultyIcons do - local frame = difficulty[name] - if frame then - if frame.Border then - frame.Border:SetVertexColor(r, g, b) - end - if frame.Background then - frame.Background:SetVertexColor(r2, g2, b2, a2) - end - end - end - end - - if not noCluster then - if M.ClusterHolder then - E:EnableMover(M.ClusterHolder.mover.name) - end - - if difficulty then - difficulty:ClearAllPoints() - difficulty:SetPoint('TOPRIGHT', MinimapCluster, 0, -25) - M:SetScale(difficulty, 1) - end - else - if M.ClusterHolder then - E:DisableMover(M.ClusterHolder.mover.name) - end - - M.HandleTrackingButton() - M.HandleExpansionButton() - - local gameTime = _G.GameTimeFrame - if gameTime then - if E.private.general.minimap.hideCalendar then - gameTime:Hide() - else - local scale, position, xOffset, yOffset = M:GetIconSettings('calendar') - gameTime:ClearAllPoints() - gameTime:Point(position, Minimap, xOffset, yOffset) - gameTime:SetParent(Minimap) - gameTime:SetFrameLevel(_G.MinimapBackdrop:GetFrameLevel() + 2) - gameTime:Show() - - M:SetScale(gameTime, scale) - end - end - - local craftingFrame = indicator and indicator.CraftingOrderFrame - if craftingFrame then - local scale, position, xOffset, yOffset = M:GetIconSettings('crafting') - craftingFrame:ClearAllPoints() - craftingFrame:Point(position, Minimap, xOffset, yOffset) - M:SetScale(craftingFrame, scale) - end - - local mailFrame = (indicator and indicator.MailFrame) or _G.MiniMapMailFrame - if mailFrame then - local scale, position, xOffset, yOffset = M:GetIconSettings('mail') - mailFrame:ClearAllPoints() - mailFrame:Point(position, Minimap, xOffset, yOffset) - M:SetScale(mailFrame, scale) - end - - local battlefieldFrame = _G.MiniMapBattlefieldFrame - if battlefieldFrame then - local scale, position, xOffset, yOffset = M:GetIconSettings('battlefield') - battlefieldFrame:ClearAllPoints() - battlefieldFrame:Point(position, Minimap, xOffset, yOffset) - M:SetScale(battlefieldFrame, scale) - - if _G.BattlegroundShine then _G.BattlegroundShine:Hide() end - if _G.MiniMapBattlefieldBorder then _G.MiniMapBattlefieldBorder:Hide() end - if _G.MiniMapBattlefieldIcon then _G.MiniMapBattlefieldIcon:SetTexCoord(unpack(E.TexCoords)) end - end - - if difficulty then - local scale, position, xOffset, yOffset = M:GetIconSettings('difficulty') - difficulty:ClearAllPoints() - difficulty:Point(position, Minimap, xOffset, yOffset) - M:SetScale(difficulty, scale) - end - end end -local function MinimapPostDrag() +function M:Minimap_PostDrag() _G.MinimapBackdrop:ClearAllPoints() _G.MinimapBackdrop:SetAllPoints(Minimap) end @@ -573,7 +648,7 @@ function M:Initialize() local mapHolder = CreateFrame('Frame', 'ElvUI_MinimapHolder', Minimap) mapHolder:Point('TOPRIGHT', E.UIParent, -3, -3) mapHolder:Size(Minimap:GetSize()) - E:CreateMover(mapHolder, 'MinimapMover', L["Minimap"], nil, nil, MinimapPostDrag, nil, nil, 'maps,minimap') + E:CreateMover(mapHolder, 'MinimapMover', L["Minimap"], nil, nil, M.Minimap_PostDrag, nil, nil, 'maps,minimap') M.MapHolder = mapHolder M:SetScale(mapHolder, 1) @@ -622,6 +697,9 @@ function M:Initialize() Minimap:SetScript('OnMouseDown', M.Minimap_OnMouseDown) Minimap:SetScript('OnMouseUp', E.noop) + Minimap:HookScript('OnShow', M.Minimap_OnShow) + Minimap:HookScript('OnHide', M.Minimap_OnHide) + Minimap:HookScript('OnEnter', function(mm) if E.db.general.minimap.locationText == 'MOUSEOVER' and (not E.Retail or E.db.general.minimap.clusterDisable) then mm.location:Show() end end) Minimap:HookScript('OnLeave', function(mm) if E.db.general.minimap.locationText == 'MOUSEOVER' and (not E.Retail or E.db.general.minimap.clusterDisable) then mm.location:Hide() end end) From ab88b803cde02a730152d1bdf9e46bd35f36bb7b Mon Sep 17 00:00:00 2001 From: Simpy Date: Tue, 19 Mar 2024 23:23:22 -0400 Subject: [PATCH 03/15] expose these enter/leave scripts on minimap --- ElvUI/Core/Modules/Maps/Minimap.lua | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ElvUI/Core/Modules/Maps/Minimap.lua b/ElvUI/Core/Modules/Maps/Minimap.lua index 8503ec4b9f..1c6ffa4d45 100644 --- a/ElvUI/Core/Modules/Maps/Minimap.lua +++ b/ElvUI/Core/Modules/Maps/Minimap.lua @@ -237,6 +237,20 @@ function M:Minimap_OnHide() M:UpdateIcons() end +function M:Minimap_OnEnter() + M:Minimap_EnterLeave(self, true) +end + +function M:Minimap_OnLeave() + M:Minimap_EnterLeave(self) +end + +function M:Minimap_EnterLeave(minimap, show) + if E.db.general.minimap.locationText == 'MOUSEOVER' and (not E.Retail or E.db.general.minimap.clusterDisable) then + minimap.location:SetShown(show) + end +end + function M:Minimap_OnMouseDown(btn) menuFrame:Hide() @@ -700,8 +714,8 @@ function M:Initialize() Minimap:HookScript('OnShow', M.Minimap_OnShow) Minimap:HookScript('OnHide', M.Minimap_OnHide) - Minimap:HookScript('OnEnter', function(mm) if E.db.general.minimap.locationText == 'MOUSEOVER' and (not E.Retail or E.db.general.minimap.clusterDisable) then mm.location:Show() end end) - Minimap:HookScript('OnLeave', function(mm) if E.db.general.minimap.locationText == 'MOUSEOVER' and (not E.Retail or E.db.general.minimap.clusterDisable) then mm.location:Hide() end end) + Minimap:HookScript('OnEnter', M.Minimap_OnEnter) + Minimap:HookScript('OnLeave', M.Minimap_OnLeave) Minimap.location = Minimap:CreateFontString(nil, 'OVERLAY') Minimap.location:Point('TOP', Minimap, 0, -2) From 7fc75890c26d092c326e4ac85006c294ad352dd1 Mon Sep 17 00:00:00 2001 From: Simpy Date: Tue, 19 Mar 2024 23:24:09 -0400 Subject: [PATCH 04/15] move these down --- ElvUI/Core/Modules/Maps/Minimap.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ElvUI/Core/Modules/Maps/Minimap.lua b/ElvUI/Core/Modules/Maps/Minimap.lua index 1c6ffa4d45..a2ce2cdfab 100644 --- a/ElvUI/Core/Modules/Maps/Minimap.lua +++ b/ElvUI/Core/Modules/Maps/Minimap.lua @@ -707,16 +707,6 @@ function M:Initialize() M:SetScale(Minimap.backdrop, 1) end - Minimap:SetScript('OnMouseWheel', M.Minimap_OnMouseWheel) - Minimap:SetScript('OnMouseDown', M.Minimap_OnMouseDown) - Minimap:SetScript('OnMouseUp', E.noop) - - Minimap:HookScript('OnShow', M.Minimap_OnShow) - Minimap:HookScript('OnHide', M.Minimap_OnHide) - - Minimap:HookScript('OnEnter', M.Minimap_OnEnter) - Minimap:HookScript('OnLeave', M.Minimap_OnLeave) - Minimap.location = Minimap:CreateFontString(nil, 'OVERLAY') Minimap.location:Point('TOP', Minimap, 0, -2) Minimap.location:SetJustifyH('CENTER') @@ -729,6 +719,16 @@ function M:Initialize() M:RegisterEvent('ZONE_CHANGED_INDOORS', 'Update_ZoneText') M:RegisterEvent('ZONE_CHANGED', 'Update_ZoneText') + Minimap:SetScript('OnMouseWheel', M.Minimap_OnMouseWheel) + Minimap:SetScript('OnMouseDown', M.Minimap_OnMouseDown) + Minimap:SetScript('OnMouseUp', E.noop) + + Minimap:HookScript('OnShow', M.Minimap_OnShow) + Minimap:HookScript('OnHide', M.Minimap_OnHide) + + Minimap:HookScript('OnEnter', M.Minimap_OnEnter) + Minimap:HookScript('OnLeave', M.Minimap_OnLeave) + local killFrames = { _G.MinimapBorder, _G.MinimapBorderTop, From 312370abb7e1b646f6c39846e4ce849528872b1b Mon Sep 17 00:00:00 2001 From: Simpy Date: Wed, 20 Mar 2024 16:11:37 -0400 Subject: [PATCH 05/15] another method to handle icons during ToggleMinimap --- ElvUI/Core/Modules/Maps/Minimap.lua | 85 +++++++++++++++-------------- 1 file changed, 44 insertions(+), 41 deletions(-) diff --git a/ElvUI/Core/Modules/Maps/Minimap.lua b/ElvUI/Core/Modules/Maps/Minimap.lua index a2ce2cdfab..757917cbdf 100644 --- a/ElvUI/Core/Modules/Maps/Minimap.lua +++ b/ElvUI/Core/Modules/Maps/Minimap.lua @@ -42,6 +42,7 @@ local IndicatorLayout -- GLOBALS: GetMinimapShape local DifficultyIcons = { 'ChallengeMode', 'Guild', 'Instance' } +local IconParents = {} --Create the minimap micro menu local menuFrame = CreateFrame('Frame', 'MinimapRightClickMenu', E.UIParent, 'UIDropDownMenuTemplate') @@ -123,15 +124,16 @@ function M:HandleExpansionButton() local garrison = _G.ExpansionLandingPageMinimapButton or _G.GarrisonLandingPageMinimapButton if not garrison then return end + M:SaveIconParent(garrison) + local hidden = not Minimap:IsShown() if hidden then - garrison:Hide() + garrison:SetParent(E.HiddenFrame) else local scale, position, xOffset, yOffset = M:GetIconSettings('classHall') garrison:ClearAllPoints() garrison:Point(position, Minimap, xOffset, yOffset) - garrison:Show() - + M:SetIconParent(garrison) M:SetScale(garrison, scale) local box = _G.GarrisonLandingPageTutorialBox @@ -146,17 +148,18 @@ function M:HandleTrackingButton() local tracking = MinimapCluster.TrackingFrame or _G.MiniMapTrackingFrame or _G.MiniMapTracking if not tracking then return end + M:SaveIconParent(tracking) + tracking:ClearAllPoints() local hidden = not Minimap:IsShown() if hidden or E.private.general.minimap.hideTracking then - tracking:Hide() + tracking:SetParent(E.HiddenFrame) else local scale, position, xOffset, yOffset = M:GetIconSettings('tracking') tracking:Point(position, Minimap, xOffset, yOffset) - tracking:Show() - + M:SetIconParent(tracking) M:SetScale(tracking, scale) local button = E.Retail and tracking.Button @@ -364,9 +367,17 @@ function M:GetIconSettings(button) return profile.scale or defaults.scale, profile.position or defaults.position, profile.xOffset or defaults.xOffset, profile.yOffset or defaults.yOffset end -function M:CraftingIconShow(icon) - local count = icon.countInfos and #icon.countInfos - icon:SetShown(count and count > 0) +function M:SaveIconParent(frame) + if not IconParents[frame] then -- only want the first one + IconParents[frame] = frame:GetParent() + end +end + +function M:SetIconParent(frame) + local parent = IconParents[frame] + if parent then -- this is unlikely + frame:SetParent(parent) + end end function M:UpdateIcons() @@ -377,6 +388,15 @@ function M:UpdateIcons() local battlefieldFrame = _G.MiniMapBattlefieldFrame local difficulty = E.Retail and MinimapCluster.InstanceDifficulty + if not next(IconParents) then + if gameTime then M:SaveIconParent(gameTime) end + if indicator then M:SaveIconParent(indicator) end + if craftingFrame then M:SaveIconParent(craftingFrame) end + if mailFrame then M:SaveIconParent(mailFrame) end + if battlefieldFrame then M:SaveIconParent(battlefieldFrame) end + if difficulty then M:SaveIconParent(difficulty) end + end + if difficulty then local r, g, b = unpack(E.media.backdropcolor) local r2, g2, b2, a2 = unpack(E.media.backdropfadecolor) @@ -402,26 +422,14 @@ function M:UpdateIcons() if difficulty then difficulty:ClearAllPoints() difficulty:SetPoint('TOPRIGHT', MinimapCluster, 0, -25) - difficulty:Show() - + M:SetIconParent(difficulty) M:SetScale(difficulty, 1) end - if gameTime then - gameTime:Show() - end - - if craftingFrame then - M:CraftingIconShow(craftingFrame) - end - - if mailFrame then - mailFrame:Show() - end - - if battlefieldFrame then - battlefieldFrame:Show() - end + if gameTime then M:SetIconParent(gameTime) end + if craftingFrame then M:SetIconParent(craftingFrame) end + if mailFrame then M:SetIconParent(mailFrame) end + if battlefieldFrame then M:SetIconParent(battlefieldFrame) end else if M.ClusterHolder then E:DisableMover(M.ClusterHolder.mover.name) @@ -433,54 +441,50 @@ function M:UpdateIcons() local hidden = not Minimap:IsShown() if gameTime then if hidden or E.private.general.minimap.hideCalendar then - gameTime:Hide() + gameTime:SetParent(E.HiddenFrame) else local scale, position, xOffset, yOffset = M:GetIconSettings('calendar') gameTime:ClearAllPoints() gameTime:Point(position, Minimap, xOffset, yOffset) gameTime:SetParent(Minimap) gameTime:SetFrameLevel(_G.MinimapBackdrop:GetFrameLevel() + 2) - gameTime:Show() - + M:SetIconParent(gameTime) M:SetScale(gameTime, scale) end end if craftingFrame then if hidden then - craftingFrame:Hide() + craftingFrame:SetParent(E.HiddenFrame) else local scale, position, xOffset, yOffset = M:GetIconSettings('crafting') craftingFrame:ClearAllPoints() craftingFrame:Point(position, Minimap, xOffset, yOffset) - M:CraftingIconShow(craftingFrame) - + M:SetIconParent(craftingFrame) M:SetScale(craftingFrame, scale) end end if mailFrame then if hidden then - mailFrame:Hide() + mailFrame:SetParent(E.HiddenFrame) else local scale, position, xOffset, yOffset = M:GetIconSettings('mail') mailFrame:ClearAllPoints() mailFrame:Point(position, Minimap, xOffset, yOffset) - mailFrame:Show() - + M:SetIconParent(mailFrame) M:SetScale(mailFrame, scale) end end if battlefieldFrame then if hidden then - battlefieldFrame:Hide() + battlefieldFrame:SetParent(E.HiddenFrame) else local scale, position, xOffset, yOffset = M:GetIconSettings('battlefield') battlefieldFrame:ClearAllPoints() battlefieldFrame:Point(position, Minimap, xOffset, yOffset) - battlefieldFrame:Show() - + M:SetIconParent(battlefieldFrame) M:SetScale(battlefieldFrame, scale) end @@ -491,13 +495,12 @@ function M:UpdateIcons() if difficulty then if hidden then - difficulty:Hide() + difficulty:SetParent(E.HiddenFrame) else local scale, position, xOffset, yOffset = M:GetIconSettings('difficulty') difficulty:ClearAllPoints() difficulty:Point(position, Minimap, xOffset, yOffset) - difficulty:Show() - + M:SetIconParent(difficulty) M:SetScale(difficulty, scale) end end From aead6d8ffe531bf583debbd56f3666599d839176 Mon Sep 17 00:00:00 2001 From: Repooc Date: Thu, 21 Mar 2024 10:34:09 -0400 Subject: [PATCH 06/15] add customization to leech datatext --- ElvUI/Core/Defaults/Global.lua | 1 + ElvUI/Mainline/Modules/DataTexts/Leech.lua | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/ElvUI/Core/Defaults/Global.lua b/ElvUI/Core/Defaults/Global.lua index 1f1731be6d..4fa0ba15df 100644 --- a/ElvUI/Core/Defaults/Global.lua +++ b/ElvUI/Core/Defaults/Global.lua @@ -77,6 +77,7 @@ G.datatexts = { Hit = { Label = '', NoLabel = false, decimalLength = 1 }, Intellect = { Label = '', NoLabel = false}, ['Item Level'] = { onlyEquipped = false, rarityColor = true }, + Leech = { Label = '', NoLabel = false, decimalLength = 1 }, Location = { showZone = true, showSubZone = true, showContinent = false, color = 'REACTION', customColor = {r = 1, g = 1, b = 1} }, Mastery = { Label = '', NoLabel = false, decimalLength = 1 }, MovementSpeed = { Label = '', NoLabel = false, decimalLength = 1 }, diff --git a/ElvUI/Mainline/Modules/DataTexts/Leech.lua b/ElvUI/Mainline/Modules/DataTexts/Leech.lua index 92761fad24..9695f1f239 100644 --- a/ElvUI/Mainline/Modules/DataTexts/Leech.lua +++ b/ElvUI/Mainline/Modules/DataTexts/Leech.lua @@ -16,7 +16,7 @@ local PAPERDOLLFRAME_TOOLTIP_FORMAT = PAPERDOLLFRAME_TOOLTIP_FORMAT local STAT_CATEGORY_ENHANCEMENTS = STAT_CATEGORY_ENHANCEMENTS local STAT_LIFESTEAL = STAT_LIFESTEAL -local displayString = '' +local displayString, db = '' local function OnEnter() DT.tooltip:ClearLines() @@ -31,11 +31,19 @@ end local function OnEvent(self) local lifesteal = GetLifesteal() - self.text:SetFormattedText(displayString, STAT_LIFESTEAL, lifesteal) + if db.NoLabel then + self.text:SetFormattedText(displayString, lifesteal) + else + self.text:SetFormattedText(displayString, db.Label ~= '' and db.Label or STAT_LIFESTEAL..': ', lifesteal) + end end -local function ApplySettings(_, hex) - displayString = strjoin('', '%s: ', hex, '%.2f%%|r') +local function ApplySettings(self, hex) + if not db then + db = E.global.datatexts.settings[self.name] + end + + displayString = strjoin('', db.NoLabel and '' or '%s', hex, '%.'..db.decimalLength..'f%%|r') end DT:RegisterDatatext('Leech', STAT_CATEGORY_ENHANCEMENTS, {'UNIT_STATS', 'UNIT_AURA', 'PLAYER_DAMAGE_DONE_MODS'}, OnEvent, nil, nil, OnEnter, nil, STAT_LIFESTEAL, nil, ApplySettings) From a878e7ef9e25e7964d3cb72ae105f17ec03a2b00 Mon Sep 17 00:00:00 2001 From: Simpy Date: Sun, 24 Mar 2024 16:38:05 -0400 Subject: [PATCH 07/15] support ticket bottom to shift at middle (height) of screen --- ElvUI/Core/Modules/ActionBars/MicroBar.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ElvUI/Core/Modules/ActionBars/MicroBar.lua b/ElvUI/Core/Modules/ActionBars/MicroBar.lua index def14d0159..b138632eb9 100644 --- a/ElvUI/Core/Modules/ActionBars/MicroBar.lua +++ b/ElvUI/Core/Modules/ActionBars/MicroBar.lua @@ -387,12 +387,13 @@ function AB:UpdateHelpTicketButtonAnchor() local first = _G[AB.MICRO_BUTTONS[1]] if first then local db = AB.db.microbar - local point = E:GetScreenQuadrant(first) local size = ((db.keepSizeRatio and db.buttonSize) or db.buttonHeight) or 20 local height = (size / 2) + 7 + local _, y = first:GetCenter() + local middle = E.screenHeight * 0.5 ticket:ClearAllPoints() - ticket:SetPoint('CENTER', first, 0, (point and strfind(point, 'BOTTOM')) and -height or height) + ticket:SetPoint('CENTER', first, 0, (y and y >= middle) and -height or height) end end From 831e6c466f16c53f279a6f653cd8493b75cac9c4 Mon Sep 17 00:00:00 2001 From: Luckyone Date: Mon, 25 Mar 2024 00:40:52 +0100 Subject: [PATCH 08/15] Wrath difficulty icon fix --- ElvUI/Core/Modules/Maps/Minimap.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ElvUI/Core/Modules/Maps/Minimap.lua b/ElvUI/Core/Modules/Maps/Minimap.lua index 757917cbdf..20cc59cf82 100644 --- a/ElvUI/Core/Modules/Maps/Minimap.lua +++ b/ElvUI/Core/Modules/Maps/Minimap.lua @@ -386,7 +386,7 @@ function M:UpdateIcons() local craftingFrame = indicator and indicator.CraftingOrderFrame local mailFrame = (indicator and indicator.MailFrame) or _G.MiniMapMailFrame local battlefieldFrame = _G.MiniMapBattlefieldFrame - local difficulty = E.Retail and MinimapCluster.InstanceDifficulty + local difficulty = E.Retail and MinimapCluster.InstanceDifficulty or E.Wrath and _G.MiniMapInstanceDifficulty if not next(IconParents) then if gameTime then M:SaveIconParent(gameTime) end From ecc38f5c51e8eca0b0b75aa032974526cfdecd09 Mon Sep 17 00:00:00 2001 From: Simpy Date: Sun, 24 Mar 2024 19:41:07 -0400 Subject: [PATCH 09/15] instance minimap icon on wrath --- ElvUI/Core/Modules/Maps/Minimap.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ElvUI/Core/Modules/Maps/Minimap.lua b/ElvUI/Core/Modules/Maps/Minimap.lua index 20cc59cf82..35fa9e2b93 100644 --- a/ElvUI/Core/Modules/Maps/Minimap.lua +++ b/ElvUI/Core/Modules/Maps/Minimap.lua @@ -385,8 +385,8 @@ function M:UpdateIcons() local indicator = MinimapCluster.IndicatorFrame local craftingFrame = indicator and indicator.CraftingOrderFrame local mailFrame = (indicator and indicator.MailFrame) or _G.MiniMapMailFrame + local difficulty = MinimapCluster.InstanceDifficulty or _G.MiniMapInstanceDifficulty local battlefieldFrame = _G.MiniMapBattlefieldFrame - local difficulty = E.Retail and MinimapCluster.InstanceDifficulty or E.Wrath and _G.MiniMapInstanceDifficulty if not next(IconParents) then if gameTime then M:SaveIconParent(gameTime) end @@ -397,7 +397,7 @@ function M:UpdateIcons() if difficulty then M:SaveIconParent(difficulty) end end - if difficulty then + if difficulty and E.Retail then local r, g, b = unpack(E.media.backdropcolor) local r2, g2, b2, a2 = unpack(E.media.backdropfadecolor) for _, name in next, DifficultyIcons do From 1ec99daf849e9e40f361685dd505ce12b3686868 Mon Sep 17 00:00:00 2001 From: Simpy Date: Sun, 24 Mar 2024 20:11:05 -0400 Subject: [PATCH 10/15] fix party and raid pet not spawning during combat --- ElvUI/Core/Defaults/Profile.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ElvUI/Core/Defaults/Profile.lua b/ElvUI/Core/Defaults/Profile.lua index 6d93b325d4..cfe30f89cc 100644 --- a/ElvUI/Core/Defaults/Profile.lua +++ b/ElvUI/Core/Defaults/Profile.lua @@ -2095,7 +2095,7 @@ P.unitframe = { enable = true, threatStyle = 'GLOW', orientation = 'LEFT', - visibility = '[@raid6,exists][nogroup] hide;show', + visibility = '[@raid6,exists][@party1,noexists] hide;show', growthDirection = 'UP_RIGHT', horizontalSpacing = 0, verticalSpacing = 3, @@ -2476,7 +2476,7 @@ P.unitframe.units.raidpet.debuffs.priority = 'Blacklist,Personal,Boss,Whitelist, P.unitframe.units.raidpet.growthDirection = 'DOWN_RIGHT' P.unitframe.units.raidpet.height = 30 P.unitframe.units.raidpet.numGroups = 8 -P.unitframe.units.raidpet.visibility = '[group:raid] show; hide' +P.unitframe.units.raidpet.visibility = '[@raid1,exists] show; hide' P.unitframe.units.tank.buffs.numrows = 1 P.unitframe.units.tank.buffs.perrow = 6 From 97a0193b9b2f6eae85324335794953b69f3f6dc5 Mon Sep 17 00:00:00 2001 From: Simpy Date: Tue, 26 Mar 2024 16:33:58 -0400 Subject: [PATCH 11/15] this fixes when spells have the same name in spell book returning the wrong index and breaking range (troll mage passive + regen rune) --- .../LibRangeCheck-3.0/LibRangeCheck-3.0.lua | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/ElvUI_Libraries/Core/LibRangeCheck-3.0/LibRangeCheck-3.0.lua b/ElvUI_Libraries/Core/LibRangeCheck-3.0/LibRangeCheck-3.0.lua index b32ed8f82f..30cd51146b 100644 --- a/ElvUI_Libraries/Core/LibRangeCheck-3.0/LibRangeCheck-3.0.lua +++ b/ElvUI_Libraries/Core/LibRangeCheck-3.0/LibRangeCheck-3.0.lua @@ -40,7 +40,7 @@ License: MIT -- @class file -- @name LibRangeCheck-3.0 local MAJOR_VERSION = "LibRangeCheck-3.0-ElvUI" -local MINOR_VERSION = 14 -- real minor version: 13 +local MINOR_VERSION = 15 -- real minor version: 13 -- GLOBALS: LibStub, CreateFrame @@ -67,7 +67,7 @@ local CheckInteractDistance = CheckInteractDistance local GetInventoryItemLink = GetInventoryItemLink local GetItemInfo = GetItemInfo local GetNumSpellTabs = GetNumSpellTabs -local GetSpellBookItemName = GetSpellBookItemName +local GetSpellBookItemInfo = GetSpellBookItemInfo local GetSpellInfo = GetSpellInfo local GetSpellTabInfo = GetSpellTabInfo local GetTime = GetTime @@ -653,16 +653,19 @@ local function getNumSpells() end -- return the spellIndex of the given spell by scanning the spellbook -local function findSpellIdx(spellName) +local allowSpellType = { SPELL = true, FUTURESPELL = true } +local function findSpellIdx(spellName, sid) if not spellName or spellName == "" then return nil end + for i = 1, getNumSpells() do - local spell = GetSpellBookItemName(i, BOOKTYPE_SPELL) - if spell == spellName then + local spellType, id = GetSpellBookItemInfo(i, BOOKTYPE_SPELL) + if sid == id and allowSpellType[spellType] then return i end end + return nil end @@ -674,7 +677,7 @@ end local function getSpellData(sid) local name, _, _, _, minRange, range = GetSpellInfo(sid) - return name, fixRange(minRange), fixRange(range), findSpellIdx(name) + return name, fixRange(minRange), fixRange(range), findSpellIdx(name, sid) end -- minRange should be nil if there's no minRange, not 0 @@ -989,10 +992,8 @@ lib.CHECKERS_CHANGED = "CHECKERS_CHANGED" lib.MeleeRange = MeleeRange function lib:findSpellIndex(spell) - if type(spell) == "number" then - spell = GetSpellInfo(spell) - end - return findSpellIdx(spell) + local name, _, _, _, _, _, sid = GetSpellInfo(spell) + return findSpellIdx(name, sid) end -- returns the range estimate as a string From 01da28f28d2841e0fcd011a3e2a6183fa6e6ff0a Mon Sep 17 00:00:00 2001 From: Simpy Date: Thu, 28 Mar 2024 14:36:45 -0400 Subject: [PATCH 12/15] hunter wrath taint when using Shadowmeld --- ElvUI/Core/Modules/ActionBars/ActionBars.lua | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/ElvUI/Core/Modules/ActionBars/ActionBars.lua b/ElvUI/Core/Modules/ActionBars/ActionBars.lua index c24d518334..6c8ac6f2c3 100644 --- a/ElvUI/Core/Modules/ActionBars/ActionBars.lua +++ b/ElvUI/Core/Modules/ActionBars/ActionBars.lua @@ -1086,6 +1086,11 @@ do [E.Retail and 'PossessActionBar' or 'PossessBarFrame'] = true } + local untaintButtons = { + MultiCastActionButton = (E.Wrath and E.myclass ~= 'SHAMAN') or nil, + OverrideActionBarButton = E.Wrath or nil + } + if E.Wrath then -- Wrath TotemBar needs to be handled by us _G.UIPARENT_MANAGED_FRAME_POSITIONS.MultiCastActionBarFrame = nil end @@ -1201,12 +1206,16 @@ do AB:SecureHook('BlizzardOptionsPanel_OnEvent') end - if E.Wrath and E.myclass ~= 'SHAMAN' then - for i = 1, 12 do - local button = _G['MultiCastActionButton'..i] + for name in next, untaintButtons do + local index = 1 + local button = _G[name..index] + while button do button:Hide() button:UnregisterAllEvents() button:SetAttribute('statehidden', true) + + index = index + 1 + button = _G[name..index] end end From 14156d2c32e7d5dfb9b135cfdee1629f0fcc159d Mon Sep 17 00:00:00 2001 From: Simpy Date: Fri, 29 Mar 2024 12:36:48 -0400 Subject: [PATCH 13/15] swap ace widget dropdown to elvui variant (since it supports sort by value) --- ElvUI/Core/Modules/Skins/Ace3.lua | 2 +- .../AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua | 2 +- ElvUI_Libraries/Core/Ace3/AceGUI-3.0/AceGUI-3.0.xml | 2 +- ...ceGUIWidget-DropDown.lua => AceGUIWidget-DropDown-ElvUI.lua} | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename ElvUI_Libraries/Core/Ace3/AceGUI-3.0/widgets/{AceGUIWidget-DropDown.lua => AceGUIWidget-DropDown-ElvUI.lua} (99%) diff --git a/ElvUI/Core/Modules/Skins/Ace3.lua b/ElvUI/Core/Modules/Skins/Ace3.lua index 4d28072b14..4922f0ae0a 100644 --- a/ElvUI/Core/Modules/Skins/Ace3.lua +++ b/ElvUI/Core/Modules/Skins/Ace3.lua @@ -202,7 +202,7 @@ function S:Ace3_RegisterAsWidget(widget) widget.scrollFrame:Point('BOTTOMRIGHT', widget.scrollBG, 'BOTTOMRIGHT', -4, 8) elseif TYPE == 'CheckBox' then S:Ace3_SkinCheckBox(widget, widget.check, widget.checkbg, widget.highlight) - elseif TYPE == 'Dropdown' or TYPE == 'LQDropdown' then + elseif TYPE == 'Dropdown' or TYPE == 'Dropdown-ElvUI' or TYPE == 'LQDropdown' then local frame = widget.dropdown local button = widget.button local text = widget.text diff --git a/ElvUI_Libraries/Core/Ace3/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua b/ElvUI_Libraries/Core/Ace3/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua index 1a23c8d4e7..a2536339f2 100644 --- a/ElvUI_Libraries/Core/Ace3/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua +++ b/ElvUI_Libraries/Core/Ace3/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua @@ -1332,7 +1332,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin control:ResumeLayout() control:DoLayout() else - control = CreateControl(v.dialogControl or v.control, "Dropdown") + control = CreateControl(v.dialogControl or v.control, "Dropdown-ElvUI") local sortByValue = GetOptionsMemberValue("sortByValue",v,options,path,appName) local itemType = v.itemControl diff --git a/ElvUI_Libraries/Core/Ace3/AceGUI-3.0/AceGUI-3.0.xml b/ElvUI_Libraries/Core/Ace3/AceGUI-3.0/AceGUI-3.0.xml index c2da26030e..920bf89cc3 100644 --- a/ElvUI_Libraries/Core/Ace3/AceGUI-3.0/AceGUI-3.0.xml +++ b/ElvUI_Libraries/Core/Ace3/AceGUI-3.0/AceGUI-3.0.xml @@ -15,7 +15,7 @@