Skip to content

first iteration of locking enemy data / readonly mode #94

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 5 additions & 1 deletion DungeonEnemies.lua
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,9 @@ local function setUpMouseHandlersAwakened(self,clone,scale,riftOffsets)
end

function DungeonToolsEnemyMixin:OnClick(button, down)
local mapEnemiesLocked = db.mapEnemiesLocked

if button == "LeftButton" then
if button == "LeftButton" and mapEnemiesLocked == false then
if IsShiftKeyDown() then
local newPullIdx = MDT:GetCurrentPull() + 1
MDT:PresetsAddPull(newPullIdx)
Expand Down Expand Up @@ -360,6 +361,9 @@ function DungeonToolsEnemyMixin:OnClick(button, down)
MDT:LiveSession_SendCorruptedPositions(preset.value.riftOffsets)
end
end
elseif button == "LeftButton" and mapEnemiesLocked == true then
-- TODO: once enemy/route data is cleaned up we can hopefully add a reference to which pull this enemy belongs to
return
elseif button == "RightButton" then
if db.devMode then
if IsAltKeyDown() then
Expand Down
23 changes: 23 additions & 0 deletions DungeonTools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,21 @@ function MDT:CreateMenu()
highlight:SetPoint("TOPRIGHT", resizer, -6, 0)
resizer:SetHighlightTexture(highlight)

-- Lock Enemy data on map
self.main_frame.lockButton = CreateFrame("Button", "DungeonToolsLockEnemyButton", self.main_frame, "UIPanelCloseButton")
db.mapEnemiesLocked = db.mapEnemiesLocked or false
local lockToolsButton = self.main_frame.lockButton
local lockButtonTexture = (db.mapEnemiesLocked and "Interface\\Buttons\\LockButton-Locked-Up" or "Interface\\Buttons\\LockButton-Unlocked-Up")

lockToolsButton:ClearAllPoints()
lockToolsButton:SetPoint("TOPRIGHT", self.main_frame, "TOPRIGHT", -5, -5)
lockToolsButton.Icon = lockToolsButton:CreateTexture(nil, "OVERLAY")
lockToolsButton.Icon:SetTexture(lockButtonTexture)
lockToolsButton.Icon:SetSize(50,50)
lockToolsButton.Icon:SetPoint("CENTER",lockToolsButton,"CENTER")
lockToolsButton:SetScript("OnClick", function() self:LockEnemyPullData() end)
lockToolsButton:SetFrameLevel(4)
lockToolsButton.tooltip = L["Lock enemy data"]
end

function MDT:SkinMenuButtons()
Expand Down Expand Up @@ -991,6 +1006,14 @@ function MDT:Minimize()
db.maximized = false
end

function DungeonTools:LockEnemyPullData()
db.mapEnemiesLocked = not db.mapEnemiesLocked

local lockToolsButton = self.main_frame.lockButton
local lockButtonTexture = (db.mapEnemiesLocked and "Interface\\Buttons\\LockButton-Locked-Up" or "Interface\\Buttons\\LockButton-Unlocked-Up")
lockToolsButton.Icon:SetTexture(lockButtonTexture)
end

function MDT:SkinProgressBar(progressBar)
local bar = progressBar and progressBar.Bar
if not bar then return end
Expand Down
1 change: 1 addition & 0 deletions Locales/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1030,3 +1030,4 @@ L["ConnectedTip"] = "Group connections in MDT do not reflect if NPCs are linked
L["theaterOfPain_miniBossNote"] = "Only one duelist will be alive."
L["DataImportButtonTooltip"] = "Import external NPC Data."
L["Import Data"] = "Import Data"
L["Lock enemy data"] = "Lock enemies placed on map"