diff core.lua @ 94:db1d5d09e5f5

Do not register '/loot' as a synonym any longer, as it becomes a builtin command in MoP.
author Farmbuyer of US-Kilrogg <farmbuyer@gmail.com>
date Tue, 24 Jul 2012 23:04:51 +0000
parents ea20a28327b5
children 3546c7b55986
line wrap: on
line diff
--- a/core.lua	Wed Jul 18 07:42:16 2012 +0000
+++ b/core.lua	Tue Jul 24 23:04:51 2012 +0000
@@ -115,7 +115,8 @@
 local option_defaults = {
 	['datarev'] = 20,    -- cheating, this isn't actually an option
 	['popup_on_join'] = true,
-	['register_slashloot'] = true,
+	['register_slash_synonyms'] = false,
+	['slash_synonyms'] = '/ol,/oloot',
 	['scroll_to_bottom'] = true,
 	['gui_noob'] = true,
 	['chatty_on_kill'] = false,
@@ -744,6 +745,10 @@
 			opts['forum_current'] = '[url] Wowhead'
 		end
 	end
+	if opts['register_slashloot'] then
+		self:Print[[The "/loot" command is no longer available, because it is used by Blizzard in MoP.  You can toggle on other synonyms for "/ouroloot" in the Options tab.]]
+	end
+	opts['register_slashloot'] = nil
 	option_defaults = nil
 	if OuroLootSV then  -- may not be the same as testing g_restore_p soon
 		if OuroLootSV.saved then
@@ -768,10 +773,13 @@
 	self.default_itemvault = nil
 
 	self:RegisterChatCommand("ouroloot", "OnSlash")
-	if opts.register_slashloot then
-		-- NOTA BENE:  do not use /loot in the LoadOn list, ChatTypeInfo gets confused
-		-- maybe try to detect if this command is already in use...
-		_G.SLASH_ACECONSOLE_OUROLOOT2 = "/loot"
+	if opts.register_slash_synonyms then
+		-- Maybe use %w here for non-English locales?
+		local n = 2
+		for s in opts.slash_synonyms:gmatch("/%a+") do
+			_G['SLASH_ACECONSOLE_OUROLOOT'..n] = s
+			n = n + 1
+		end
 	end
 
 	self.history_all = self.history_all or _G.OuroLootSV_hist or {}