Skip to content
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

first iteration of locking enemy data / readonly mode #94

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
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 readOnlyMode = MDT:GetReadOnlyMode()

if button == "LeftButton" then
if button == "LeftButton" and readOnlyMode == 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 readOnlyMode == 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
27 changes: 27 additions & 0 deletions DungeonTools.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ local SetPortraitTextureFromCreatureDisplayID,MouseIsOver = SetPortraitTextureFr
local sizex = 840
local sizey = 555

local readOnlyMode = false

local mythicColor = "|cFFFFFFFF"
MDT.BackdropColor = { 0.058823399245739, 0.058823399245739, 0.058823399245739, 0.9}

Expand Down Expand Up @@ -800,6 +802,20 @@ function MDT:CreateMenu()
highlight:SetPoint("TOPRIGHT", resizer, -6, 0)
resizer:SetHighlightTexture(highlight)

-- ReadOnly Mode Button
self.main_frame.readOnlyButton = CreateFrame("Button", "DungeonToolsLockEnemyButton", self.main_frame, "UIPanelCloseButton")
local readOnlyButton = self.main_frame.readOnlyButton
local lockTexture = (readOnlyMode and "Interface\\Buttons\\LockButton-Locked-Up" or "Interface\\Buttons\\LockButton-Unlocked-Up")

readOnlyButton:ClearAllPoints()
readOnlyButton:SetPoint("TOPRIGHT", self.main_frame, "TOPRIGHT", -5, -5)
readOnlyButton.Icon = readOnlyButton:CreateTexture(nil, "OVERLAY")
readOnlyButton.Icon:SetTexture(lockTexture)
readOnlyButton.Icon:SetSize(40,40)
readOnlyButton.Icon:SetPoint("CENTER",readOnlyButton,"CENTER")
readOnlyButton:SetScript("OnClick", function() self:ToggleReadOnlyMode() end)
readOnlyButton:SetFrameLevel(4)
readOnlyButton.tooltip = "Daa fuck"
end

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

function DungeonTools:GetReadOnlyMode()
return readOnlyMode
end

function DungeonTools:ToggleReadOnlyMode()
readOnlyMode = not readOnlyMode

local lockTexture = (readOnlyMode and "Interface\\Buttons\\LockButton-Locked-Up" or "Interface\\Buttons\\LockButton-Unlocked-Up")
self.main_frame.readOnlyButton.Icon:SetTexture(lockTexture)
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"