Skip to content

Commit

Permalink
1.2.18-Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Lars Norberg committed May 20, 2021
1 parent 1b8315a commit ad47f1e
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. All notable
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [1.2.18-Release] 2021-05-20
### Added
- Added an option in the top left corner to toggle the movement fading.

### Fixed
- Fixed a Blizzard bug that would cause a bug when hovering above the zone map menu when no keybind for the zone map has been set.

## [1.2.17-Release] 2021-05-17
- Extra push needed because the bigwigs packager changed its API from using "bc" to calling it "bcc".

Expand Down
1 change: 1 addition & 0 deletions ClassicWorldMapEnhanced/data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -982,5 +982,6 @@ if (Version >= 2) then

end

ns.Version = Version
ns.zoneData = zoneData
ns.zoneReveal = zoneReveal
49 changes: 47 additions & 2 deletions ClassicWorldMapEnhanced/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ local GetNumAddOns = GetNumAddOns
local GetPlayerMapPosition = C_Map.GetPlayerMapPosition
local GetQuestGreenRange = GetQuestGreenRange
local IsAddOnLoaded = IsAddOnLoaded
local IsPlayerMoving = IsPlayerMoving
local Saturate = Saturate
local TexturePool_HideAndClearAnchors = TexturePool_HideAndClearAnchors
local UnitLevel = UnitLevel
Expand Down Expand Up @@ -71,14 +72,16 @@ end)({
-- Any other localed will use this one
-- as a fallback in cases where entries are missing.
enUS = {
["Fog of War"] = true
["Fog of War"] = true,
["Fade when moving"] = true
}
})

-- Default settings
-- These will be overwritten by saved settings,
-- so don't edit anything here.
ClassicWorldMapEnhanced_DB = {
fadeWhenMoving = true,
revealUnexploredAreas = true
}

Expand Down Expand Up @@ -485,6 +488,31 @@ Private.SetUpFading = function(self)
self.FadeTimer.throttle = .02
self.FadeTimer.Canvas = self.Canvas

local button = CreateFrame("CheckButton", nil, WorldMapFrame.BorderFrame, "OptionsCheckButtonTemplate")
button:SetPoint("TOPLEFT", 6, 0)
button:SetSize(24, 24)

button.msg = button:CreateFontString(nil, "OVERLAY", "GameFontNormal")
button.msg:SetPoint("LEFT", 24, 0)
button.msg:SetText(L["Fade when moving"])

button:SetHitRectInsets(0, 0 - button.msg:GetWidth(), 0, 0)
button:SetChecked(ClassicWorldMapEnhanced_DB.fadeWhenMoving)
button:SetScript("OnClick", function()
ClassicWorldMapEnhanced_DB.fadeWhenMoving = button:GetChecked()
if (ClassicWorldMapEnhanced_DB.fadeWhenMoving) then
if (IsPlayerMoving()) then
self:OnEvent("PLAYER_STARTED_MOVING")
else
self:OnEvent("PLAYER_STOPPED_MOVING")
end
else
self:OnEvent("PLAYER_STOPPED_MOVING")
end
end)

button:Show()

self:RegisterEvent("PLAYER_ENTERING_WORLD")
self:RegisterEvent("PLAYER_STARTED_MOVING")
self:RegisterEvent("PLAYER_STOPPED_MOVING")
Expand Down Expand Up @@ -548,6 +576,22 @@ Private.SetUpMapReveal = function(self)
end
end

-- Fix BC Bugs
----------------------------------------------------
Private.FixBlizzardBugs = function(self)
if (ns.Version == 2) then
if (_G.WorldMapZoneMinimapDropDown) then
_G.WorldMapZoneMinimapDropDown:SetScript("OnEnter", function(self)
-- Blizzard don't check for a key (yet), so this bugs out with no bind.
local key = GetBindingKey("TOGGLEBATTLEFIELDMINIMAP")
if (key) then
_G.WorldMapZoneMinimapDropDown_OnEnter(self)
end
end)
end
end
end

-- Addon Init & Events
----------------------------------------------------
-- Our addon's event handler. Handles all events.
Expand All @@ -563,7 +607,7 @@ Private.OnEvent = function(self, event, ...)
end
elseif (event == "PLAYER_STARTED_MOVING") then
self.FadeTimer.alpha = self.Canvas:GetAlpha()
self.FadeTimer.fadeDirection = "OUT"
self.FadeTimer.fadeDirection = ClassicWorldMapEnhanced_DB.fadeWhenMoving and "OUT" or "IN"
self.FadeTimer.isFading = true
self.FadeTimer:SetScript("OnUpdate", OnUpdate_MapMovementFader)

Expand Down Expand Up @@ -605,6 +649,7 @@ Private.OnEnable = function(self)
self:SetUpCoordinates()
self:SetUpZoneLevels()
self:SetUpMapReveal()
self:FixBlizzardBugs()
end

-- Retrieve addon info the way we prefer it.
Expand Down

0 comments on commit ad47f1e

Please sign in to comment.