diff WowObjects.lua @ 15:80192bc4a108

Replaced the global msg function with CyborgMMO_DPrint: - avoids conflicts with other addons ('msg' is too generic) - has 'print' semantics (several values accepted, calls tostring) - use AddMessage with a colored prefix, instead of plain SendChatMessage
author madcatzinc@35b17cf1-18cd-47ff-9ca3-31d6b526ef09
date Thu, 25 Apr 2013 01:29:55 +0000
parents 9f2d838d4f8e
children a6f4c8f86130
line wrap: on
line diff
--- a/WowObjects.lua	Thu Apr 25 01:29:50 2013 +0000
+++ b/WowObjects.lua	Thu Apr 25 01:29:55 2013 +0000
@@ -29,11 +29,11 @@
 
 		-- Methods --
 		self.DoAction = function()
-			msg("Nothing To Do")
+			CyborgMMO_DPrint("Nothing To Do")
 		end
 
 		self.Pickup = function()
-			msg("Pick up Item")
+			CyborgMMO_DPrint("Pick up Item")
 		end
 
 		self.SetBinding = function(key)
@@ -50,7 +50,7 @@
 		local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory.Instance().AddCallback(CyborgMMO_WowObject.DoNothing)
 		local result = SetOverrideBindingClick(parentFrame, true, key, name, "LeftButton")
 		if result ~= 1 then
-			msg("Failed to bind companion to button click")
+			CyborgMMO_DPrint("Failed to bind companion to button click")
 		end
 	end,
 
@@ -155,7 +155,7 @@
 		self.Texture = "Interface\\AddOns\\CyborgMMO7\\Graphics\\"..self.CallbackName.."Unselected.tga"
 
 		self.SetTextures = function(buttonFrame)
-			msg("TextureName = "..self.CallbackName)
+			CyborgMMO_DPrint("TextureName = "..self.CallbackName)
 			buttonFrame:SetNormalTexture("Interface\\AddOns\\CyborgMMO7\\Graphics\\"..self.CallbackName.."Unselected.tga")
 			buttonFrame:SetPushedTexture("Interface\\AddOns\\CyborgMMO7\\Graphics\\"..self.CallbackName.."Down.tga")
 			buttonFrame:SetHighlightTexture("Interface\\AddOns\\CyborgMMO7\\Graphics\\"..self.CallbackName.."Over.tga")
@@ -163,7 +163,7 @@
 
 		self.DoAction = function()
 			local action = CyborgMMO_CallbackFactory.Instance().GetCallback(self.CallbackName)
-			msg("calling callback:- "..self.CallbackName)
+			CyborgMMO_DPrint("calling callback:- "..self.CallbackName)
 			action()
 		end
 
@@ -180,7 +180,7 @@
 		end
 
 		self.ClickHandler = function(self, button, down)
-			msg("click handler")
+			CyborgMMO_DPrint("click handler")
 			CallbackCursor:StopMoving()
 			CallbackCursor:Hide()
 		end
@@ -195,7 +195,7 @@
 			local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory.Instance().AddCallback(self.DoAction)
 			local result = SetOverrideBindingClick(CyborgMMO_CallbackFactory.Instance().Frame, true, key, name, "LeftButton")
 			if result ~= 1 then
-				msg("Failed to Bind modeChange")
+				CyborgMMO_DPrint("Failed to Bind modeChange")
 			end
 		end
 
@@ -222,7 +222,7 @@
 
 		-- override method --
 		self.DoAction = function()
-			msg("Use Item")
+			CyborgMMO_DPrint("Use Item")
 		end
 
 		-- override method --
@@ -254,7 +254,7 @@
 
 		-- override method --
 		self.DoAction = function()
-			msg("Cast Spell")
+			CyborgMMO_DPrint("Cast Spell")
 		end
 
 		-- override method --
@@ -266,7 +266,7 @@
 		end
 
 		self.SetBinding = function(key)
-			msg("Binding to key "..key)
+			CyborgMMO_DPrint("Binding to key "..key)
 			self.Key = key
 			SetOverrideBinding(CyborgMMO_CallbackFactory.Instance().Frame, true, self.Key, self.Type.." "..self.Name)
 		end
@@ -295,7 +295,7 @@
 
 		-- override method --
 		self.DoAction = function()
-			msg("Use Item")
+			CyborgMMO_DPrint("Use Item")
 		end
 
 		-- override method --
@@ -347,7 +347,7 @@
 			local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory.Instance().AddCallback(self.DoAction)
 			local result = SetOverrideBindingClick(parentFrame, true, key, name, "LeftButton")
 			if result ~= 1 then
-				msg("Failed to bind companion to button click")
+				CyborgMMO_DPrint("Failed to bind companion to button click")
 			end
 		--	SetOverrideBinding(hiddenModeChanger, true, key, "MACRO "..self.Index)
 		end
@@ -377,7 +377,7 @@
 
 		-- override method --
 		self.DoAction = function()
-			msg("Use Item")
+			CyborgMMO_DPrint("Use Item")
 		end
 
 		-- override method --
@@ -425,7 +425,7 @@
 			local buttonFrame,parentFrame,name = CyborgMMO_CallbackFactory.Instance().AddCallback(self.DoAction);
 			local result = SetOverrideBindingClick(parentFrame, true, key, name, "LeftButton")
 			if result ~= 1 then
-				msg("Failed to bind companion to button click")
+				CyborgMMO_DPrint("Failed to bind companion to button click")
 			end
 		end