Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --get the addon namespace
- local addon, ns = ...
- --get the config values
- local cfg = ns.cfg
- -- get the library
- local lib = ns.lib
- movingframes ={
- "ColdBar1",
- "ColdBar2",
- "ColdBar3",
- "ColdBar4",
- "ColdBar5",
- "ColdPetbar",
- "ColdStance",
- "ColdPlayer",
- "ColdTarget",
- "ColdPet",
- "ColdToT",
- "ColdFocus",
- "ColdParty",
- "ColdRaid",
- }
- function moveframes()
- for _, v in pairs(movingframes) do
- f = _G[v]
- fn = f:GetName()
- f.draggable:SetAlpha(1)
- f:EnableMouse(true)
- f:RegisterForDrag("LeftButton")
- f.btn:Show()
- end
- end
- function lockframes()
- for _, v in pairs(movingframes) do
- f = _G[v]
- f.draggable:SetAlpha(0)
- f:RegisterForDrag(nil)
- f.btn:Hide()
- end
- end
- local initdrag = CreateFrame("Frame")
- initdrag:RegisterEvent("VARIABLES_LOADED")
- initdrag:SetScript("OnEvent", function(self, event)
- for _, v in pairs(movingframes) do
- f = _G[v]
- fn = f:GetName()
- if lib.getfield(fn) then f:Show()
- else f:Hide()
- end
- end
- end)
- SLASH_MOVEUI1 = "/coldmove"
- SLASH_MOVEUI2 = "/cm"
- SlashCmdList.MOVEUI = function() print("ColdUI: frames |c0000FF00unlocked|r") moveframes() end
- SLASH_LOCKUI1 = "/coldlock"
- SLASH_LOCKUI2 = "/cl"
- SlashCmdList.LOCKUI = function() print("ColdUI: frames |c00FF0000locked|r") lockframes() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement