Now outputs a message when a new filled soul gem is added to the inventory. Also wrapped log statements in a debug check.

Chris O'Dell [04-20-14 - 23:52]
Now outputs a message when a new filled soul gem is added to the inventory.  Also wrapped log statements in a debug check.
Filename
SoulGemNotifier.lua
diff --git a/SoulGemNotifier.lua b/SoulGemNotifier.lua
index 9326d37..2dd4f91 100644
--- a/SoulGemNotifier.lua
+++ b/SoulGemNotifier.lua
@@ -8,6 +8,7 @@
 SoulGemNotifier = {}
 SoulGemNotifier.name = "SoulGemNotifier"
 SoulGemNotifier.version = "0.1.0"
+SoulGemNotifier.debug = false

 function SoulGemNotifier.Initialise(eventCode, addOnName)
 	if (addOnName ~= SoulGemNotifier.name) then return end
@@ -17,8 +18,15 @@ function SoulGemNotifier.Initialise(eventCode, addOnName)
 end

 function SoulGemNotifier.OnSingleSlotUpdate(eventId, bagId, slotId, isNewItem)
-	d("[eventId:"..eventId.."][bagId:"..bagId.."][slotId:"..slotId.."]" .. string.format("[isNewItem: %s]", isNewItem and "true" or "false"))
-	d(string.format("IsFilledSoulGem: %s", IsItemSoulGem(1, bagId, slotId) and "true" or "false"))
+
+	if (SoulGemNotifier.debug) then
+		d("[eventId:"..eventId.."][bagId:"..bagId.."][slotId:"..slotId.."]" .. string.format("[isNewItem: %s]", isNewItem and "true" or "false"))
+		d(string.format("IsFilledSoulGem: %s", IsItemSoulGem(1, bagId, slotId) and "true" or "false"))
+	end
+
+	if (IsItemSoulGem(1, bagId, slotId) and isNewItem) then
+		d("Filled a Soul Gem")
+	end
 end

 EVENT_MANAGER:RegisterForEvent(SoulGemNotifier.name, EVENT_ADD_ON_LOADED, SoulGemNotifier.Initialise)
\ No newline at end of file