Skip to content

Commit

Permalink
Disable map scale changes in WoW 10.0 due to bad breakages
Browse files Browse the repository at this point in the history
  • Loading branch information
Nevcairiel committed Nov 7, 2022
1 parent 74d53d4 commit 948c876
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
8 changes: 8 additions & 0 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ All rights reserved.
local Mapster = LibStub("AceAddon-3.0"):GetAddon("Mapster")
local L = LibStub("AceLocale-3.0"):GetLocale("Mapster")

local WoWRetail = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE)
local WoWClassic = (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE)

local optGetter, optSetter
Expand Down Expand Up @@ -77,13 +78,20 @@ local function getOptions()
type = "description",
name = L["Change the scale of the world map if you do not want the whole screen filled while the map is open."],
},
scaledesc_wow10 = {
order = 5.5,
type = "description",
name = L["NOTE: Currently unavailable in WoW 10.x since it can break the map."],
hidden = not WoWRetail,
},
scale = {
order = 6,
name = L["Scale"],
desc = L["Scale of the big map."],
type = "range",
min = 0.1, max = 2, bigStep = 0.01,
isPercent = true,
disabled = WoWRetail,
},
arrowScale = {
order = 7,
Expand Down
17 changes: 12 additions & 5 deletions Mapster.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ local LibWindow = LibStub("LibWindow-1.1")
local L = LibStub("AceLocale-3.0"):GetLocale("Mapster")

local WoWClassic = (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE)
local WoWRetail = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE)

local defaults = {
profile = {
Expand Down Expand Up @@ -92,12 +93,15 @@ function Mapster:OnEnable()
self:SecureHookScript(WorldMapFrame, "OnShow", "WorldMapFrame_OnShow")

-- hooks for scale
if HelpPlate_Show then
self:SecureHook("HelpPlate_Show")
self:SecureHook("HelpPlate_Hide")
self:SecureHook("HelpPlate_Button_AnimGroup_Show_OnFinished")
-- XXX: disabled on retail due to taint
if not WoWRetail then
if HelpPlate_Show then
self:SecureHook("HelpPlate_Show")
self:SecureHook("HelpPlate_Hide")
self:SecureHook("HelpPlate_Button_AnimGroup_Show_OnFinished")
end
self:RawHook(WorldMapFrame.ScrollContainer, "GetCursorPosition", "WorldMapFrame_ScrollContainer_GetCursorPosition", true)
end
self:RawHook(WorldMapFrame.ScrollContainer, "GetCursorPosition", "WorldMapFrame_ScrollContainer_GetCursorPosition", true)

-- hook into EJ icons
self:SecureHook(EncounterJournalPinMixin, "OnAcquired", "EncounterJournalPin_OnAcquired")
Expand Down Expand Up @@ -226,6 +230,9 @@ function Mapster:WorldMapFrame_OnShow()
end

function Mapster:SetScale(force)
-- disabled on retail due to map taint
if WoWRetail then return end

if WorldMapFrame:IsMaximized() and WorldMapFrame:GetScale() ~= 1 then
WorldMapFrame:SetScale(1)
elseif not WorldMapFrame:IsMaximized() and (WorldMapFrame:GetScale() ~= db.scale or force) then
Expand Down
3 changes: 3 additions & 0 deletions Scaling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Initial implementation provided by yssaril

local Mapster = LibStub("AceAddon-3.0"):GetAddon("Mapster")

local WoWRetail = (WOW_PROJECT_ID == WOW_PROJECT_MAINLINE)
if WoWRetail then return end

local MODNAME= "Scale"
local Scale = Mapster:NewModule(MODNAME)

Expand Down

0 comments on commit 948c876

Please sign in to comment.