Skip to content

Commit c4bb753

Browse files
committed
Disable battlefield map support by default
Enable it under interface options
1 parent d154288 commit c4bb753

2 files changed

Lines changed: 53 additions & 1 deletion

File tree

Source/FrameHandlers/BattlefieldMapFrame.lua

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,56 @@ function addon:initBattlefieldMap()
88
addon:registerFrame(BattlefieldMapFrame, BATTLEFIELD_MINIMAP, db.BattlefieldMapFrame)
99
lib:RegisterResizable(BattlefieldMapFrame)
1010
lib:HideByDefault(BattlefieldMapFrame)
11+
12+
-- Unsure if taint or secret issues can spread, only change these if they're not their default
13+
if BattlefieldMapOptions.locked ~= true then BattlefieldMapOptions.locked = true end
14+
if BattlefieldMapOptions.position ~= nil then BattlefieldMapOptions.position = nil end
15+
16+
-- BattlefieldMapTab needs to be changed, base UI uses an old system to drag the battlefield map by dragging the tab while unlocked
17+
BattlefieldMapTab:SetParent(BattlefieldMapFrame)
18+
BattlefieldMapTab:ClearAllPoints()
19+
BattlefieldMapTab:SetUserPlaced(false)
20+
BattlefieldMapTab:SetPoint("BOTTOMLEFT", BattlefieldMapFrame, "TOPLEFT", 30, 5)
21+
BattlefieldMapTab:RegisterForDrag()
22+
BattlefieldMapTab:HookScript("OnClick", function(self, button)
23+
if button ~= "RightButton" then return end
24+
-- Watch Blizzard_BattlefieldMap.lua for changes
25+
MenuUtil.CreateContextMenu(self, function(owner, rootDescription)
26+
rootDescription:SetTag("MENU_BATTLEFIELD_MAP");
27+
28+
do
29+
-- Show battlefield players
30+
local function IsSelected()
31+
return BattlefieldMapOptions.showPlayers;
32+
end
33+
34+
local function SetSelected()
35+
BattlefieldMapOptions.showPlayers = not BattlefieldMapOptions.showPlayers;
36+
BattlefieldMapFrame:UpdateUnitsVisibility();
37+
end
38+
rootDescription:CreateCheckbox(SHOW_BATTLEFIELDMINIMAP_PLAYERS, IsSelected, SetSelected);
39+
end
40+
41+
-- EME change here: disable the lock/unlock frame (in addition to disabile its dragability)
42+
do
43+
-- Battlefield minimap lock
44+
local function IsSelected()
45+
--return BattlefieldMapOptions.locked;
46+
return false
47+
end
48+
49+
--local function SetSelected()
50+
--BattlefieldMapOptions.locked = not BattlefieldMapOptions.locked;
51+
--end
52+
rootDescription:CreateCheckbox("EditModeExpanded: use Edit Mode to move this!", IsSelected, nop)
53+
end
54+
55+
do
56+
-- Opacity
57+
rootDescription:CreateButton(BATTLEFIELDMINIMAP_OPACITY_LABEL, function()
58+
self:ShowOpacity();
59+
end);
60+
end
61+
end);
62+
end)
1163
end

Source/Options.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ local defaults = {
7979
personalResourceDisplay = false,
8080
targetFrameResize = false,
8181
chatFrame = false,
82-
battlefieldMap = true,
82+
battlefieldMap = false,
8383
},
8484
QueueStatusButton = {},
8585
TotemFrame = {},

0 commit comments

Comments
 (0)