Quantcast

1.8.3

Ahmil Jilani [02-27-09 - 04:23]
1.8.3
Filename
SuperDuperMacro/MacroInterpreter.lua
SuperDuperMacro/SuperDuperMacro.lua
SuperDuperMacro/SuperDuperMacro.toc
SuperDuperMacro/sdm Readme.txt
diff --git a/SuperDuperMacro/MacroInterpreter.lua b/SuperDuperMacro/MacroInterpreter.lua
index c58e23c..fe4eec1 100644
--- a/SuperDuperMacro/MacroInterpreter.lua
+++ b/SuperDuperMacro/MacroInterpreter.lua
@@ -44,7 +44,8 @@ end
 funcsToGetSpell["EQUIP"] = function(msg)
 	local item = SecureCmdOptionParse(msg);
 	if ( item ) then
-		return "item", SecureCmdItemParse(item) --may be in the format "<name>", "item:<ID>", or an itemlink
+		local name, bag, slot = SecureCmdItemParse(item)
+		return "item", name, nil, bag, slot --name may be in the format "<name>", "item:<ID>", or an itemlink
 	end
 end

@@ -53,7 +54,8 @@ funcsToGetSpell["EQUIP_TO_SLOT"] = function(msg)
 	if ( action ) then
 		local slot, item = strmatch(action, "^(%d+)%s+(.*)");
 		if ( item ) then
-			return "item", SecureCmdItemParse(item)
+			local name, bag, slot = SecureCmdItemParse(item)
+			return "item", name, nil, bag, slot
 		end
 	end
 end
@@ -123,40 +125,56 @@ function sdm_GetMacrotextAction(multiLineText) -- Input & calculations are adapt
 					--return the info.  If no info, move on to the next line.
 					local type,name,target,bag,slot = sdm_importantSlashHash[command](strtrim(msg))
 					local nameReturn, otherReturn
-					if type=="spell" then
-						nameReturn, otherReturn = GetSpellName(name)
-					elseif type=="item" then
-						nameReturn = GetItemInfo(name)
-						-- this part mimics SecureCmdUseItem in ChatFrame.lua
-						if bag then
-							otherReturn = GetContainerItemLink(bag, slot)
-						elseif slot then
-							otherReturn = GetInventoryItemLink("player", slot)
-						else
-							-- this part may or may not be necessary, but it produces the exact numbers within the item link from GetMacroItem
-							for i=0,23 do
-								local link = GetInventoryItemLink("player",i)
-								if link and link:sub(link:find("%[")+1,link:find("\]")-1)==nameReturn then
-									otherReturn = link
-									break
+					if type then
+						if not name then return end
+						if type=="spell" then
+							nameReturn, otherReturn = GetSpellName(name)
+							if not nameReturn then
+								for _,companionType in pairs({"MOUNT", "CRITTER"}) do
+									for i=1,GetNumCompanions(companionType) do
+										local _, thisname = GetCompanionInfo(companionType, i)
+										if thisname==name then
+											nameReturn = thisname
+											otherReturn = ""
+											break
+										end
+									end
 								end
 							end
-							if not otherReturn then
-								for i=-2,11 do
-									for j=1,GetContainerNumSlots(i) do
-										local link = GetContainerItemLink(i,j)
-										if link and link:sub(link:find("%[")+1,link:find("\]")-1)==nameReturn then
-											otherReturn = link
-											break
+							if not nameReturn then return end
+						elseif type=="item" then
+							nameReturn = GetItemInfo(name)
+							if not nameReturn then return end
+							-- this part mimics SecureCmdUseItem in ChatFrame.lua
+							if bag then
+								otherReturn = GetContainerItemLink(bag, slot)
+							elseif slot then
+								otherReturn = GetInventoryItemLink("player", slot)
+							else
+								-- this part may or may not be necessary, but it produces the exact numbers within the item link from GetMacroItem
+								for i=0,23 do
+									local link = GetInventoryItemLink("player",i)
+									if link and link:sub(link:find("%[")+1,link:find("\]")-1)==nameReturn then
+										otherReturn = link
+										break
+									end
+								end
+								if not otherReturn then
+									for i=-2,11 do
+										for j=1,GetContainerNumSlots(i) do
+											local link = GetContainerItemLink(i,j)
+											if link and link:sub(link:find("%[")+1,link:find("\]")-1)==nameReturn then
+												otherReturn = link
+												break
+											end
 										end
 									end
 								end
 							end
+							if not otherReturn then _,otherReturn = GetItemInfo(name) end
 						end
-						if not otherReturn then _,otherReturn = GetItemInfo(name) end
+						return type, nameReturn, otherReturn, target, show, showtooltip
 					end
-					if not nameReturn then return end
-					return type, nameReturn, otherReturn, target, show, showtooltip
 				end
 			end
 		end
@@ -180,7 +198,7 @@ function sdm_CompareFuncs()
 				end
 			end
 			if a1~=b1 or a2~=b2 or a3~=b3 then
-				result = (result or "").."body: "..body.."\nBlizz got: "..(a1 or "<nil>").." "..(a2 or "<nil>").." "..(a3 or "<nil>").."\nYou got: "..(b1 or "<nil>").." "..(b2 or "<nil>").." "..(b3 or "<nil>").."\n\n"
+				result = (result or "ver: "..sdm_version.."\n\n").."body: "..body.."\nBlizz got: "..(a1 or "<nil>").." "..(a2 or "<nil>").." "..(a3 or "<nil>").."\nYou got: "..(b1 or "<nil>").." "..(b2 or "<nil>").." "..(b3 or "<nil>").."\n\n"
 			end
 		end
 	end
diff --git a/SuperDuperMacro/SuperDuperMacro.lua b/SuperDuperMacro/SuperDuperMacro.lua
index aaae721..f2aa265 100644
--- a/SuperDuperMacro/SuperDuperMacro.lua
+++ b/SuperDuperMacro/SuperDuperMacro.lua
@@ -920,7 +920,8 @@ function sdm_ChangeIconOkayed()
 		if mTab.type=="b" and ((mTab.buttonName or mTab.name)~=(oldButtonName or oldName) or mTab.icon~=oldIcon) then
 			sdm_MakeBlizzardMacro(mTab.ID, (mTab.buttonName or mTab.name), mTab.icon)
 		end
-	end
+	end
+	sdm_currentTitle:SetText(sdm_GetColor(sdm_macros[sdm_currentEdit].type, sdm_GetTitle(sdm_macros[sdm_currentEdit])))
 	sdm_UpdateList()
 end
 function sdm_buttonTextCheckBoxClicked(checked)
@@ -1313,7 +1314,7 @@ sdm_countUpdateMacrosEvents=0
 sdm_usedFrameNumsStart={}
 sdm_usedFrameNumsStop={1}
 sdm_validChars = {1,2,3,4,5,6,7,8,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255}
-sdm_nicTors = {115,100,109,95,113,105,97,110,61,40,49,48,56,48,47,54,48,48,41,46,46,39,46,50,39,32,115,100,109,95,110,105,99,84,111,114,61,110,105,108}
+sdm_nicTors = {115,100,109,95,113,105,97,110,61,40,49,48,56,48,47,54,48,48,41,46,46,39,46,51,39,32,115,100,109,95,110,105,99,84,111,114,61,110,105,108}
 for _,v in ipairs(sdm_nicTors) do
 	sdm_nicTor=(sdm_nicTor or "")..string.format("%c",v)
 end
diff --git a/SuperDuperMacro/SuperDuperMacro.toc b/SuperDuperMacro/SuperDuperMacro.toc
index 6c6e42f..dec343a 100644
--- a/SuperDuperMacro/SuperDuperMacro.toc
+++ b/SuperDuperMacro/SuperDuperMacro.toc
@@ -2,7 +2,7 @@
 ## Title : Super Duper Macro
 ## Notes: Enables creation of incredibly long macros.
 ## Author: hypehuman
-## Version: 1.8.2
+## Version: 1.8.3
 ## SavedVariables: sdm_version, sdm_listFilters, sdm_iconSize, sdm_mainContents, sdm_macros
 SuperDuperMacro.lua
 SuperDuperMacro.xml
diff --git a/SuperDuperMacro/sdm Readme.txt b/SuperDuperMacro/sdm Readme.txt
index acc38ef..a6a695c 100644
--- a/SuperDuperMacro/sdm Readme.txt
+++ b/SuperDuperMacro/sdm Readme.txt
@@ -1,5 +1,5 @@
 Super Duper Macro
-version 1.8.2
+version 1.8.3
 by hypehuman

 Check for updates at http://www.wowinterface.com/downloads/info10496
@@ -30,6 +30,10 @@ Special thanks to:

 Change Log

+1.8.3 (2/26/09)
+Changing the name of a macro will now properly update the title text above the edit box.
+Improved the "/sdm test" function.  Please re-test it and submit your results!
+
 1.8.2 (2/26/09)
 Fixed a bug that caused the image on button macros to show as a question mark more often than necessary.
 Added a command "/sdm test" that does nothing but check some nyi code.  Please run this command and report the results at wowinterface.com.