Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).

## [Unreleased]

## [1.6.1] - 2026-09-18

### Added

- WoW: Forever beta support. The TOC now declares Interface 16001 alongside Retail 120100.

### Fixed

- The Edit Mode selection box now matches the square map exactly, so the map can be placed flush in a screen corner. Blizzard's minimap cluster is a resize-layout frame that re-sized itself to its hidden native children on every layout pass; ClassyMap now pins the cluster to the map's rendered footprint, follows the Edit Mode "Size" setting, and clamps the cluster to the screen without the old 60px overhang.

## [1.6.0] - 2026-09-06

### Added
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ This addon prioritizes a minimal footprint:

### Current Client Compatibility

The declared client target is Interface 120100 in [ClassyMap.toc](ClassyMap.toc). Record the actual client version/build used for live testing. When adding features:
The declared client targets are Interface 120100 (Retail) and 16001 (WoW: Forever beta) in [ClassyMap.toc](ClassyMap.toc). Forever runs the Retail UI and API, but `GetBuildInfo()` reports 16001, so never gate Retail code paths on a minimum build number. Record the actual client version/build used for live testing. When adding features:

- Ensure modifications are resilient to UI updates
- Follow the `OwnSet` ownership and conditional-restoration contract; preserve combat deferral and stale-callback cancellation
Expand Down
64 changes: 59 additions & 5 deletions ClassyMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ local getters = {
SetParent = "GetParent",
SetWidth = "GetWidth",
SetHeight = "GetHeight",
SetFixedSize = "GetFixedSize",
SetFrameStrata = "GetFrameStrata",
SetScale = "GetScale",
SetAlpha = "GetAlpha",
Expand Down Expand Up @@ -124,6 +125,7 @@ end
local restoreOrder = {
"SetParent",
"SetScale",
"SetFixedSize",
"SetWidth",
"SetHeight",
"points",
Expand Down Expand Up @@ -487,16 +489,48 @@ function ClassyMap:SatStyles(f)
self:OwnSet(f, "Show")
end

-- The map's rendered size expressed in MinimapCluster coordinates. Edit Mode's
-- "Size" setting scales MinimapContainer, which sits between the two, so the
-- map's own GetWidth() no longer describes the space it occupies in the cluster.
function ClassyMap:GetMinimapFootprint()
local scale = 1
local frame = Minimap
while frame and frame ~= MinimapCluster do
scale = scale * (frame.GetScale and frame:GetScale() or 1)
frame = frame.GetParent and frame:GetParent()
end
if not frame then
-- Another addon moved the map out of the cluster; compare effective scales.
scale = 1
if Minimap.GetEffectiveScale and MinimapCluster.GetEffectiveScale then
local clusterScale = MinimapCluster:GetEffectiveScale()
if clusterScale and clusterScale > 0 then
scale = Minimap:GetEffectiveScale() / clusterScale
end
end
end
return Minimap:GetWidth() * scale, Minimap:GetHeight() * scale
end

local function ApplyLayout(self)
local db = self.db.profile
local MARGIN = 4
local STACK_GAP = 2
local ICON_SIZE = 24 -- Size for standardized placement if needed

-- Cluster & Map
if MinimapCluster then
self:OwnSet(MinimapCluster, "SetWidth", Minimap:GetWidth())
self:OwnSet(MinimapCluster, "SetHeight", Minimap:GetHeight())
-- Cluster & Map. MinimapCluster is a Blizzard ResizeLayoutFrame: its Layout()
-- pass (Edit Mode, OnShow) resizes it to the bounding box of the native
-- children, which is larger than the square map and leaves the Edit Mode
-- selection box loose around it. A fixed size makes Layout() reproduce the
-- map's footprint instead, so the selection box and screen clamping match
-- the map exactly.
if MinimapCluster and Minimap then
local width, height = self:GetMinimapFootprint()
if MinimapCluster.SetFixedSize then
self:OwnSet(MinimapCluster, "SetFixedSize", width, height)
end
self:OwnSet(MinimapCluster, "SetWidth", width)
self:OwnSet(MinimapCluster, "SetHeight", height)
end
if Minimap then
self:OwnSet(Minimap, "ClearAllPoints")
Expand Down Expand Up @@ -680,7 +714,8 @@ function ClassyMap:ApplyMinimapChanges()
end
if MinimapCluster then
self:OwnSet(MinimapCluster, "SetClampedToScreen", true)
self:OwnSet(MinimapCluster, "SetClampRectInsets", 0, -60, 0, -60)
-- The cluster now matches the map, so it can sit flush against the screen edge.
self:OwnSet(MinimapCluster, "SetClampRectInsets", 0, 0, 0, 0)
end
self:OwnSet(Minimap, "SetClampedToScreen", false)
end)
Expand All @@ -696,6 +731,25 @@ function ClassyMap:ApplyMinimapChanges()
hooksecurefunc(MinimapCluster, "SetHeight", function()
self:RequestLayout()
end)
if MinimapCluster.SetEditModeScale then
-- Edit Mode "Size" scales MinimapContainer; the fixed cluster size must follow.
hooksecurefunc(MinimapCluster, "SetEditModeScale", function()
self:RequestLayout()
end)
end
if MinimapCluster.Layout then
-- Safety net: a native layout pass that lands on a different size (stale
-- fixed size, or another addon cleared it) gets one corrective pass.
hooksecurefunc(MinimapCluster, "Layout", function(cluster)
if not self.runtimeEnabled or self.resizing then
return
end
local width, height = self:GetMinimapFootprint()
if cluster:GetWidth() ~= width or cluster:GetHeight() ~= height then
self:RequestLayout()
end
end)
end
self.hookedLayout = true
end
end
Expand Down
4 changes: 2 additions & 2 deletions ClassyMap.toc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
## Interface: 120100
## Interface: 120100, 16001
## Title: ClassyMap
## Notes: A minimalist square minimap with a customizable border and clutter controls.
## Author: Jason Falk
## Version: 1.6.0
## Version: 1.6.1
## SavedVariables: ClassyMapDB
## IconTexture: Interface\Icons\INV_Misc_Map02
## X-License: GPL-3.0
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A minimalist square minimap addon for World of Warcraft. Transforms the default circular minimap into a clean, modern square shape.

![Interface](https://img.shields.io/badge/Interface-120100-green)
![Interface](https://img.shields.io/badge/Interface-120100%20%7C%2016001-green)
[![GitHub](https://img.shields.io/badge/GitHub-Falkicon%2FClassyMap-181717?logo=github)](https://github.com/Falkicon/ClassyMap)
[![Sponsor](https://img.shields.io/badge/Sponsor-pink?logo=githubsponsors)](https://github.com/sponsors/Falkicon)

Expand Down Expand Up @@ -65,7 +65,8 @@ Open settings via `/cm`, the ClassyMap entry in the addon compartment, or the in

## Requirements

- World of Warcraft Retail. The declared client target is Interface 120100 in [ClassyMap.toc](ClassyMap.toc).
- World of Warcraft Retail or the WoW: Forever beta. The declared client targets are Interface 120100 (Retail) and 16001 (Forever) in [ClassyMap.toc](ClassyMap.toc).
- On Forever, the client currently does not read saved variables back at launch, so ClassyMap settings reset to defaults each session.
- Required libraries are bundled; Mechanic is optional developer tooling.

## Localization
Expand Down
2 changes: 2 additions & 0 deletions docs/runtime-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Disable invalidates scheduled callbacks, clears pending requests and combat acti

Restoration determines eligibility before changing anything, then restores properties in a defined order: parents and geometry before styling and visibility. This avoids treating a restoration's own side effects as a new external change. Combat-delayed restoration uses a private frame because AceEvent removes the addon's event registrations after `OnDisable` returns.

`MinimapCluster` is a Blizzard `ResizeLayoutFrame`. Its `Layout()` pass (Edit Mode, show) sizes it to the bounding box of its native children rather than the square map. ClassyMap owns the cluster's fixed layout size (`SetFixedSize`) alongside its width/height, computed from the map's size and the scale of every frame between the map and the cluster (Edit Mode's "Size" setting scales `MinimapContainer`). Hooks on `SetEditModeScale` and `Layout` request a layout pass only when the cluster lands on a different size, so the Edit Mode selection box and screen clamping match the map.

Known native zone-color and expansion-button visibility updates have explicit policies that keep ClassyMap's enabled customization working. Ownership is based on observed values, not the identity of the addon making a call. It cannot distinguish another addon invoking the same native update path, or a change to an identical value. This is cooperative behavior, not a guarantee against all minimap-addon conflicts.

The original minimap mask/blob scalar state cannot be queried reliably through matching getters. Disabling therefore stops scheduling and restores eligible geometry/styles, but retains square mask behavior and matching square shape reporting until reload. Hybrid mask behavior follows the same policy. No settings control advertises complete runtime disable; remove/disable the addon and reload for full removal. Another addon replacing the shape function is respected by subsequent setup work.
Expand Down
28 changes: 28 additions & 0 deletions tests/runtime_regressions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,31 @@ Assert.equal(calls.ApplyFontStyles, 1, "startup did not apply fonts once")
Assert.equal(calls.FixLayout, 1, "startup did not apply layout once")
Assert.equal(#env.errors, 0, "startup reported an error")

-- The cluster is a Blizzard ResizeLayoutFrame. Its native Layout() pass (Edit
-- Mode, OnShow) must keep reproducing the map's rendered footprint, including
-- the Edit Mode size scale applied to MinimapContainer, without extra work.
resetCalls()
Assert.equal(MinimapCluster:GetWidth(), Minimap:GetWidth(), "cluster width does not match the map")
Assert.equal(MinimapCluster:GetHeight(), Minimap:GetHeight(), "cluster height does not match the map")
MinimapCluster:Layout()
Assert.equal(MinimapCluster:GetWidth(), Minimap:GetWidth(), "native layout pass resized the cluster away from the map")
Assert.equal(MinimapCluster:GetHeight(), Minimap:GetHeight(), "native layout pass changed the cluster height")
Assert.equal(#env.timers, 0, "a matching native layout pass scheduled work")
MinimapCluster:SetEditModeScale(0.5)
Assert.equal(#env.timers, 1, "Edit Mode scale change did not schedule one layout pass")
env:FlushTimers()
Assert.equal(calls.FixLayout, 1, "Edit Mode scale change did not run one layout pass")
Assert.equal(MinimapCluster:GetWidth(), Minimap:GetWidth() * 0.5, "cluster did not follow the scaled map footprint")
Assert.equal(MinimapCluster:GetHeight(), Minimap:GetHeight() * 0.5, "cluster height ignored the map scale")
Assert.point(Minimap, 1, { "CENTER", MinimapCluster, "CENTER", 0, 0 }, "scaled map is not centered in the cluster")
MinimapCluster:Layout()
Assert.equal(MinimapCluster:GetWidth(), Minimap:GetWidth() * 0.5, "layout pass after a scale change lost the footprint")
Assert.equal(#env.timers, 0, "a matching scaled layout pass scheduled work")
MinimapCluster:SetEditModeScale(1)
env:FlushTimers()
Assert.equal(MinimapCluster:GetWidth(), Minimap:GetWidth(), "cluster did not return to the unscaled footprint")
Assert.equal(#env.errors, 0, "cluster layout tracking reported an error")

-- Both Blizzard dimension hooks coalesce, and a layout error cannot strand the guard.
resetCalls()
MinimapCluster:SetWidth(200)
Expand Down Expand Up @@ -374,6 +399,9 @@ Assert.equal(GameTimeFrame:GetParent(), externalParent, "disable overwrote an ex
Assert.point(GameTimeFrame, 1, { "BOTTOM", externalParent, "BOTTOM", 9, 10 }, "disable overwrote external anchors")
Assert.equal(GameTimeFrame:IsShown(), false, "disable overwrote external visibility")
Assert.point(Minimap, 1, { "CENTER", MinimapCluster, "CENTER", 3, 4 }, "owned minimap anchor was not restored")
Assert.equal((MinimapCluster:GetFixedSize()), nil, "disable did not clear the cluster's fixed layout size")
MinimapCluster:Layout()
Assert.equal(MinimapCluster:GetWidth(), 256, "disabled addon still pinned the native cluster layout")
Assert.equal(MinimapCompassTexture:IsShown(), true, "owned compass visibility was not restored")
Assert.equal(MinimapCompassTexture:GetAlpha(), 1, "owned compass alpha was not restored")

Expand Down
33 changes: 32 additions & 1 deletion tests/support/wow_mock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -573,9 +573,40 @@ function Mock:Install(options)
protected = true,
points = { pack("TOPRIGHT", nativeParent, "TOPRIGHT", -20, -20) },
})
_G.Minimap = self:NewFrame("Minimap", {
-- Blizzard's cluster is a ResizeLayoutFrame: Layout() sizes it to its native
-- children unless a fixed size is set. Edit Mode's size setting scales the
-- container between the cluster and the map.
MinimapCluster.nativeLayoutSize = pack(256, 256)
function MinimapCluster:SetFixedSize(width, height)
mutate(self, "SetFixedSize", width, height)
self.fixedSize = pack(width, height)
end
function MinimapCluster:GetFixedSize()
local fixed = self.fixedSize or pack(nil, nil)
return unpackValues(fixed, 1, fixed.n)
end
function MinimapCluster:Layout()
record(self, "Layout")
local fixedWidth, fixedHeight = self:GetFixedSize()
if fixedWidth and fixedHeight then
self:SetSize(fixedWidth, fixedHeight)
else
self:SetSize(unpackValues(self.nativeLayoutSize, 1, 2))
end
end
function MinimapCluster:SetEditModeScale(scale)
record(self, "SetEditModeScale", scale)
self.MinimapContainer:SetScale(scale)
self:Layout()
end
MinimapCluster.MinimapContainer = self:NewFrame("MinimapContainer", {
parent = MinimapCluster,
protected = true,
points = { pack("TOP", MinimapCluster, "TOP", 10, -30) },
})
_G.Minimap = self:NewFrame("Minimap", {
parent = MinimapCluster.MinimapContainer,
protected = true,
points = { pack("CENTER", MinimapCluster, "CENTER", 3, 4) },
})
Minimap.ZoomIn = self:NewFrame("MinimapZoomIn", { parent = Minimap, protected = true })
Expand Down