PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 4ms RepoModel.GetById 36ms app.codeStats 1ms

/Tukui/modules/misc/commands.lua

http://github.com/Asphyxia/Tukui
Lua | 55 lines | 42 code | 7 blank | 6 comment | 9 complexity | 3c163549504a3eac0a4ea020ae23ec80 MD5 | raw file
 1local T, C, L = unpack(select(2, ...)) -- Import: T - functions, constants, variables; C - config; L - locales
 2
 3-- enable or disable an addon via command
 4SlashCmdList.DISABLE_ADDON = function(addon) local _, _, _, _, _, reason, _ = GetAddOnInfo(addon) if reason ~= "MISSING" then DisableAddOn(addon) ReloadUI() else print("|cffff0000Error, Addon not found.|r") end end
 5SLASH_DISABLE_ADDON1 = "/disable"
 6SlashCmdList.ENABLE_ADDON = function(addon) local _, _, _, _, _, reason, _ = GetAddOnInfo(addon) if reason ~= "MISSING" then EnableAddOn(addon) LoadAddOn(addon) ReloadUI() else print("|cffff0000Error, Addon not found.|r") end end
 7SLASH_ENABLE_ADDON1 = "/enable"
 8
 9-- switch to heal layout via a command
10SLASH_TUKUIHEAL1 = "/heal"
11SlashCmdList.TUKUIHEAL = function()
12	DisableAddOn("Tukui_Raid")
13	EnableAddOn("Tukui_Raid_Healing")
14	ReloadUI()
15end
16
17-- switch to dps layout via a command
18SLASH_TUKUIDPS1 = "/dps"
19SlashCmdList.TUKUIDPS = function()
20	DisableAddOn("Tukui_Raid_Healing")
21	EnableAddOn("Tukui_Raid")
22	ReloadUI()
23end
24
25-- fix combatlog manually when it broke
26SLASH_CLFIX1 = "/clfix"
27SlashCmdList.CLFIX = CombatLogClearEntries
28
29-- ready check shortcut
30SlashCmdList.RCSLASH = DoReadyCheck
31SLASH_RCSLASH1 = "/rc"
32
33SLASH_RAIDDISBAND1 = "/rd"
34SlashCmdList["RAIDDISBAND"] = function()
35		SendChatMessage(L.disband, "RAID" or "PARTY")
36		if UnitInRaid("player") then
37			for i=1, GetNumRaidMembers() do
38				local name, _, _, _, _, _, _, online = GetRaidRosterInfo(i)
39				if online and name ~= T.myname then
40					UninviteUnit(name)
41				end
42			end
43		else
44			for i=MAX_PARTY_MEMBERS, 1, -1 do
45				if GetPartyMember(i) then
46					UninviteUnit(UnitName("party"..i))
47				end
48			end
49		end
50		LeaveParty()
51end
52
53-- Leave party command
54SlashCmdList["LEAVEPARTY"] = function() LeaveParty() end
55SLASH_LEAVEPARTY1 = '/leaveparty'