/Tukui/developer/commands.lua
Lua | 73 lines | 70 code | 2 blank | 1 comment | 6 complexity | 346205a0185ad1b9f360205419fcadd1 MD5 | raw file
1-- a command to show frame you currently have mouseovered 2SLASH_FRAME1 = "/frame" 3SlashCmdList["FRAME"] = function(arg) 4 if arg ~= "" then 5 arg = _G[arg] 6 else 7 arg = GetMouseFocus() 8 end 9 if arg ~= nil and arg:GetName() ~= nil then 10 local point, relativeTo, relativePoint, xOfs, yOfs = arg:GetPoint() 11 ChatFrame1:AddMessage("|cffCC0000~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") 12 ChatFrame1:AddMessage("Name: |cffFFD100"..arg:GetName()) 13 if arg:GetParent() then 14 ChatFrame1:AddMessage("Parent: |cffFFD100"..arg:GetParent():GetName()) 15 end 16 17 ChatFrame1:AddMessage("Width: |cffFFD100"..format("%.2f",arg:GetWidth())) 18 ChatFrame1:AddMessage("Height: |cffFFD100"..format("%.2f",arg:GetHeight())) 19 ChatFrame1:AddMessage("Strata: |cffFFD100"..arg:GetFrameStrata()) 20 ChatFrame1:AddMessage("Level: |cffFFD100"..arg:GetFrameLevel()) 21 22 if xOfs then 23 ChatFrame1:AddMessage("X: |cffFFD100"..format("%.2f",xOfs)) 24 end 25 if yOfs then 26 ChatFrame1:AddMessage("Y: |cffFFD100"..format("%.2f",yOfs)) 27 end 28 if relativeTo then 29 ChatFrame1:AddMessage("Point: |cffFFD100"..point.."|r anchored to "..relativeTo:GetName().."'s |cffFFD100"..relativePoint) 30 end 31 ChatFrame1:AddMessage("|cffCC0000~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~") 32 elseif arg == nil then 33 ChatFrame1:AddMessage("Invalid frame name") 34 else 35 ChatFrame1:AddMessage("Could not find frame info") 36 end 37end 38 39-- enable lua error by command 40function SlashCmdList.LUAERROR(msg, editbox) 41 if (msg == 'on') then 42 SetCVar("scriptErrors", 1) 43 -- because sometime we need to /rl to show an error on login. 44 ReloadUI() 45 elseif (msg == 'off') then 46 SetCVar("scriptErrors", 0) 47 else 48 print("/luaerror on - /luaerror off") 49 end 50end 51SLASH_LUAERROR1 = '/luaerror' 52 53SLASH_TEST1 = "/test" 54SlashCmdList["TEST"] = function() 55 for _, frames in pairs({"TukuiPet", "TukuiFocus", "TukuiFocusTarget", "TukuiBoss1", "TukuiBoss2", "TukuiBoss3", "TukuiBoss4"}) do 56 _G[frames].Hide = function() end 57 _G[frames]:Show() 58 _G[frames].unit = "player" 59 end 60end 61 62SLASH_TESTARENA1 = "/testarena" 63SlashCmdList["TESTARENA"] = function() 64 for _, frames in pairs({"TukuiArena1", "TukuiArena2", "TukuiArena3", "TukuiArena4"}) do 65 _G[frames].Hide = function() end 66 _G[frames]:Show() 67 _G[frames].unit = "player" 68 end 69end 70 71local mes = function(msg) 72 print("|cffFF6347-|r", tostring(msg)) 73end