Originally Posted by F16Gaming
Shouldn't that be "not PlayerFrame:IsMouseEnabled()" in order to toggle it?
|
Quoted for truth.
A more fitting solution would be to enable the mouse based on modifier state (ctrl/shift/alt keys):
lua Code:
local f = CreateFrame("Frame")
function f:Event = function()
if InCombatLockdown() then return end
PlayerFrame:EnableMouse(IsModifierKeyDown())
end
function f:Load()
PlayerFrame:EnableMouse(false)
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
self:RegisterEvent("MODIFIER_STATE_CHANGED")
self:SetScript("OnEvent", f.Event)
self.Load = nil
end
if InCombatLockDown() then
f:RegisterEvent("PLAYER_REGEN_ENABLED")
f:SetScript("OnEvent", f.Load)
else
f:Load()
end
Untested, and probably has errors, but I think something like this would work