Skip to content

Commit

Permalink
use the cvar api
Browse files Browse the repository at this point in the history
  • Loading branch information
kodewdle committed Dec 27, 2024
1 parent 40f62c9 commit e67dbf1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
13 changes: 8 additions & 5 deletions ElvUI/Core/General/API.lua
Original file line number Diff line number Diff line change
Expand Up @@ -800,18 +800,21 @@ function E:PLAYER_ENTERING_WORLD(_, initLogin, isReload)

if initLogin or isReload then
E:CheckIncompatible()

if E.Retail then
if E.private.general.minimap.enable then
E:SetCVar('rotateMinimap', 0) -- Impossible to turn off in ElvUI if its on
end
elseif E.db.general.lockCameraDistanceMax then
E:SetCVar('cameraDistanceMaxZoomFactor', E.db.general.cameraDistanceMax) -- Blizzard will set this value to int(60/CVar cameraDistanceMax)+1 at logout if it is manually set higher than that
end
end

if not E.MediaUpdated then
E:UpdateMedia()
E.MediaUpdated = true
end

-- Blizzard will set this value to int(60/CVar cameraDistanceMax)+1 at logout if it is manually set higher than that
if not E.Retail and E.db.general.lockCameraDistanceMax then
E:SetCVar('cameraDistanceMaxZoomFactor', E.db.general.cameraDistanceMax)
end

local _, instanceType = GetInstanceInfo()
if instanceType == 'pvp' then
E.BGTimer = E:ScheduleRepeatingTimer('RequestBGInfo', 5)
Expand Down
15 changes: 13 additions & 2 deletions ElvUI/Core/Modules/Maps/Minimap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,12 @@ function M:ClusterPoint(_, anchor)
end
end

function M:ContainerScale(scale)
if scale ~= 1 then
self:SetScale(1)
end
end

function M:PLAYER_ENTERING_WORLD(_, initLogin, isReload)
if initLogin or isReload then
local LFGIconBorder = _G.MiniMapLFGFrameBorder or _G.MiniMapLFGBorder or _G.LFGMinimapFrameBorder
Expand All @@ -625,8 +631,13 @@ end
function M:Initialize()
if E.private.general.minimap.enable then
Minimap:SetMaskTexture(E.Retail and 130937 or [[interface\chatframe\chatframebackground]])
SetCVar("rotateMinimap", 0) --Impossible to turn off in ElvUI if its on.
Minimap:GetParent():SetScale(1) --Another setting that could get set in Blizzard Edit Mode

local container = MinimapCluster.MinimapContainer
if container then
container:SetScale(1) -- Setting that could get set in Blizzard Edit Mode

hooksecurefunc(container, 'SetScale', M.ContainerScale)
end
else
Minimap:SetMaskTexture(E.Retail and 186178 or [[textures\minimapmask]])

Expand Down

0 comments on commit e67dbf1

Please sign in to comment.