Skip to content

Commit

Permalink
tracker: add slash command to lock tracker
Browse files Browse the repository at this point in the history
  • Loading branch information
shagu committed Oct 23, 2024
1 parent b9317d6 commit a78a884
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions slashcmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ SlashCmdList["PFDB"] = function(input, editbox)

if (input == "" or input == nil) then
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpf|cffffffffQuest (v" .. pfQuestConfig.version .. "):")
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc/db|cffffffff lock |cffcccccc - " .. pfQuest_Loc["Lock map tracker"])
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc/db|cffffffff tracker |cffcccccc - " .. pfQuest_Loc["Show map tracker"])
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc/db|cffffffff journal |cffcccccc - " .. pfQuest_Loc["Show quest journal"])
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffcc/db|cffffffff arrow |cffcccccc - " .. pfQuest_Loc["Show quest arrow"])
Expand Down Expand Up @@ -180,6 +181,13 @@ SlashCmdList["PFDB"] = function(input, editbox)
return
end

-- argument: lock
if (arg1 == "lock") then
pfQuest_config.lock = not pfQuest_config.lock
DEFAULT_CHAT_FRAME:AddMessage("|cff33ffccpf|cffffffffQuest Tracker: " .. ( pfQuest_config.lock and "Locked" or "Unlocked" ))
return
end

-- argument: journal
if (arg1 == "journal") then
if pfJournal then pfJournal:Show() end
Expand Down
7 changes: 6 additions & 1 deletion tracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@ tracker:SetScript("OnEvent", function()
end
end)

tracker:SetScript("OnMouseDown",function() this:StartMoving() end)
tracker:SetScript("OnMouseDown",function()
if not pfQuest_config.lock then
this:StartMoving()
end
end)

tracker:SetScript("OnMouseUp",function()
this:StopMovingOrSizing()
local anchor, x, y = pfUI.api.ConvertFrameAnchor(this, pfUI.api.GetBestAnchor(this))
Expand Down

0 comments on commit a78a884

Please sign in to comment.