diff --git a/ElvUI/Modules/Blizzard/Blizzard.lua b/ElvUI/Modules/Blizzard/Blizzard.lua index 7d90077..64153af 100644 --- a/ElvUI/Modules/Blizzard/Blizzard.lua +++ b/ElvUI/Modules/Blizzard/Blizzard.lua @@ -13,6 +13,8 @@ function B:Initialize() end local function InitializeCallback() + FCF_SelectDockFrame(DEFAULT_CHAT_FRAME) + B:Initialize() end diff --git a/ElvUI/Modules/Maps/Minimap.lua b/ElvUI/Modules/Maps/Minimap.lua index 12943ee..910b567 100644 --- a/ElvUI/Modules/Maps/Minimap.lua +++ b/ElvUI/Modules/Maps/Minimap.lua @@ -70,16 +70,17 @@ function M:Minimap_OnMouseUp(btn) end function M:Minimap_OnMouseWheel() - if arg1 > 0 then - _G.MinimapZoomIn:Click() - elseif arg1 < 0 then - _G.MinimapZoomOut:Click() + local zoomLevel = Minimap:GetZoom() + if arg1 > 0 and zoomLevel < 5 then + Minimap:SetZoom(zoomLevel + 1) + elseif arg1 < 0 and zoomLevel > 0 then + Minimap:SetZoom(zoomLevel - 1) end end function M:Update_ZoneText() if E.db.general.minimap.locationText == "HIDE" or not E.private.general.minimap.enable then return end - Minimap.location:SetText(strsub(GetMinimapZoneText(),1,46)) + Minimap.location:SetText(strsub(GetMinimapZoneText(), 1, 46)) Minimap.location:SetTextColor(self:GetLocTextColor()) E:FontTemplate(Minimap.location, E.LSM:Fetch("font", E.db.general.minimap.locationFont), E.db.general.minimap.locationFontSize, E.db.general.minimap.locationFontOutline) end @@ -96,14 +97,22 @@ local function ResetZoom() MinimapZoomOut:Disable() isResetting = false end -local function SetupZoomReset() +local function SetupZoomReset(_, zoomLevel) if E.db.general.minimap.resetZoom.enable and not isResetting then isResetting = true E:Delay(E.db.general.minimap.resetZoom.time, ResetZoom) + else + E.private.general.minimap.zoomLevel = zoomLevel end end hooksecurefunc(Minimap, "SetZoom", SetupZoomReset) +function M:MINIMAP_UPDATE_ZOOM() + if E.private.general.minimap.zoomLevel ~= Minimap:GetZoom() then + Minimap:SetZoom(E.private.general.minimap.zoomLevel) + end +end + function M:UpdateSettings() E.MinimapSize = E.private.general.minimap.enable and E.db.general.minimap.size or Minimap:GetWidth() + 10 E.MinimapWidth = E.MinimapSize @@ -315,6 +324,7 @@ function M:Initialize() self:RegisterEvent("ZONE_CHANGED", "Update_ZoneText") self:RegisterEvent("ZONE_CHANGED_INDOORS", "Update_ZoneText") self:RegisterEvent("PLAYER_ENTERING_WORLD", "Update_ZoneText") + self:RegisterEvent("MINIMAP_UPDATE_ZOOM") local fm = CreateFrame("Minimap", "FarmModeMap", E.UIParent) E:Size(fm, E.db.farmSize)