mirror of
https://github.com/Bluewhale1337/ElvUIModernized.git
synced 2026-07-27 08:24:44 +00:00
fix minimap zoom
fix non-default chat tab on login
This commit is contained in:
@@ -13,6 +13,8 @@ function B:Initialize()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function InitializeCallback()
|
local function InitializeCallback()
|
||||||
|
FCF_SelectDockFrame(DEFAULT_CHAT_FRAME)
|
||||||
|
|
||||||
B:Initialize()
|
B:Initialize()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -70,16 +70,17 @@ function M:Minimap_OnMouseUp(btn)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function M:Minimap_OnMouseWheel()
|
function M:Minimap_OnMouseWheel()
|
||||||
if arg1 > 0 then
|
local zoomLevel = Minimap:GetZoom()
|
||||||
_G.MinimapZoomIn:Click()
|
if arg1 > 0 and zoomLevel < 5 then
|
||||||
elseif arg1 < 0 then
|
Minimap:SetZoom(zoomLevel + 1)
|
||||||
_G.MinimapZoomOut:Click()
|
elseif arg1 < 0 and zoomLevel > 0 then
|
||||||
|
Minimap:SetZoom(zoomLevel - 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:Update_ZoneText()
|
function M:Update_ZoneText()
|
||||||
if E.db.general.minimap.locationText == "HIDE" or not E.private.general.minimap.enable then return end
|
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())
|
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)
|
E:FontTemplate(Minimap.location, E.LSM:Fetch("font", E.db.general.minimap.locationFont), E.db.general.minimap.locationFontSize, E.db.general.minimap.locationFontOutline)
|
||||||
end
|
end
|
||||||
@@ -96,14 +97,22 @@ local function ResetZoom()
|
|||||||
MinimapZoomOut:Disable()
|
MinimapZoomOut:Disable()
|
||||||
isResetting = false
|
isResetting = false
|
||||||
end
|
end
|
||||||
local function SetupZoomReset()
|
local function SetupZoomReset(_, zoomLevel)
|
||||||
if E.db.general.minimap.resetZoom.enable and not isResetting then
|
if E.db.general.minimap.resetZoom.enable and not isResetting then
|
||||||
isResetting = true
|
isResetting = true
|
||||||
E:Delay(E.db.general.minimap.resetZoom.time, ResetZoom)
|
E:Delay(E.db.general.minimap.resetZoom.time, ResetZoom)
|
||||||
|
else
|
||||||
|
E.private.general.minimap.zoomLevel = zoomLevel
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
hooksecurefunc(Minimap, "SetZoom", SetupZoomReset)
|
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()
|
function M:UpdateSettings()
|
||||||
E.MinimapSize = E.private.general.minimap.enable and E.db.general.minimap.size or Minimap:GetWidth() + 10
|
E.MinimapSize = E.private.general.minimap.enable and E.db.general.minimap.size or Minimap:GetWidth() + 10
|
||||||
E.MinimapWidth = E.MinimapSize
|
E.MinimapWidth = E.MinimapSize
|
||||||
@@ -315,6 +324,7 @@ function M:Initialize()
|
|||||||
self:RegisterEvent("ZONE_CHANGED", "Update_ZoneText")
|
self:RegisterEvent("ZONE_CHANGED", "Update_ZoneText")
|
||||||
self:RegisterEvent("ZONE_CHANGED_INDOORS", "Update_ZoneText")
|
self:RegisterEvent("ZONE_CHANGED_INDOORS", "Update_ZoneText")
|
||||||
self:RegisterEvent("PLAYER_ENTERING_WORLD", "Update_ZoneText")
|
self:RegisterEvent("PLAYER_ENTERING_WORLD", "Update_ZoneText")
|
||||||
|
self:RegisterEvent("MINIMAP_UPDATE_ZOOM")
|
||||||
|
|
||||||
local fm = CreateFrame("Minimap", "FarmModeMap", E.UIParent)
|
local fm = CreateFrame("Minimap", "FarmModeMap", E.UIParent)
|
||||||
E:Size(fm, E.db.farmSize)
|
E:Size(fm, E.db.farmSize)
|
||||||
|
|||||||
Reference in New Issue
Block a user