From 9adeb9f9c9d826628d6f411cd1215b9031a0cbd4 Mon Sep 17 00:00:00 2001 From: Ahmil Jilani Date: Wed, 28 Jan 2009 00:55:00 -0500 Subject: [PATCH] 1.6.1 --- SuperDuperMacro/SuperDuperMacro.lua | 77 ++++++++++++++++++++--------------- SuperDuperMacro/SuperDuperMacro.toc | 2 +- SuperDuperMacro/sdm Readme.txt | 5 ++- 3 files changed, 50 insertions(+), 34 deletions(-) diff --git a/SuperDuperMacro/SuperDuperMacro.lua b/SuperDuperMacro/SuperDuperMacro.lua index 1e69cb3..cbab523 100644 --- a/SuperDuperMacro/SuperDuperMacro.lua +++ b/SuperDuperMacro/SuperDuperMacro.lua @@ -10,14 +10,13 @@ function sdm_SlashHandler(command) else print("SDM did not recognize the command \""..command.."\"") end end -function sdm_MakeMacroFrame(name, text) --returns the frame +function sdm_MakeMacroFrame(name, text) sdm_DoOrQueue("local temp = getglobal("..sdm_Stringer(name)..") or CreateFrame(\"Button\", "..sdm_Stringer(name)..", nil, \"SecureActionButtonTemplate\")\ temp:SetAttribute(\'type\', \'macro\')\ temp:SetAttribute(\'macrotext\', "..sdm_Stringer(text)..")") -- GetClickFrame(name) --This line is just to fix a taint issue from a Blizzard bug (fixed in 3.0) -- print("Creating frame \""..name.."\" with macrotext\n\""..text.."\"\n(length "..string.len(text)..")") if string.len(text)>1023 then print("The following line is "..(string.len(text)-1023).." characters too long:\n"..text) end - return temp end function sdm_MakeBlizzardMacro(ID, name, icon, text, perCharacter) -- print("Creating macro \""..name.."\" with text\n\""..text.."\"\n(length "..string.len(text)..")") @@ -637,6 +636,9 @@ function sdm_ChangeIconOkayed() mTab.name = nameInputted if MacroPopupFrame_buttonTextCheckBox:GetChecked()==1 then mTab.buttonName = MacroPopupEditBox:GetText() + if mTab.buttonName=="" then + mTab.buttonName=" " + end else mTab.buttonName=nil end @@ -658,7 +660,11 @@ end function sdm_buttonTextCheckBoxClicked(checked) if checked then MacroPopupEditBox:Show() - MacroPopupEditBox:SetText((sdm_macros[sdm_currentEdit].buttonName or "")) + if sdm_macros[sdm_currentEdit].buttonName and sdm_macros[sdm_currentEdit].buttonName~=" " then + MacroPopupEditBox:SetText(sdm_macros[sdm_currentEdit].buttonName) + else + MacroPopupEditBox:SetText("") + end else MacroPopupEditBox:Hide() end @@ -978,7 +984,7 @@ 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_validChars = {string.byte("0"),string.byte("1"),string.byte("2"),string.byte("3"),string.byte("4"),string.byte("5"),string.byte("6"),string.byte("7"),string.byte("8"),string.byte("9")} -sdm_nicTors = {115,100,109,95,113,105,97,110,61,40,49,48,50,51,45,49,53,41,47,54,51,48,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,40,49,48,50,51,45,49,53,41,47,54,51,48,41,46,46,34,46,49,34,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 @@ -995,39 +1001,46 @@ sdm_eventFrame:SetScript("OnEvent", function () sdm_eventFrame:UnregisterEvent("VARIABLES_LOADED") if sdm_macros==nil then sdm_macros={} - elseif sdm_CompareVersions(sdm_version,"1.6")==2 then - if sdm_CompareVersions(sdm_version,"1.3")==2 then - local oldMacros=sdm_macros - sdm_macros={} - local ID=1 - for i,v in ipairs(oldMacros) do - sdm_macros[i]={type=v[1], name=v[2], text=v[3]} - if v[4] then - sdm_macros[i].character={name=v[4], server=v[5]} + elseif sdm_CompareVersions(sdm_version,"1.6.1")==2 then + if sdm_CompareVersions(sdm_version,"1.6")==2 then + if sdm_CompareVersions(sdm_version,"1.3")==2 then + local oldMacros=sdm_macros + sdm_macros={} + local ID=1 + for i,v in ipairs(oldMacros) do + sdm_macros[i]={type=v[1], name=v[2], text=v[3]} + if v[4] then + sdm_macros[i].character={name=v[4], server=v[5]} + end + if v[1]=="b" then + sdm_macros[i].ID=ID + ID=ID+1 + end + end + end + for i,v in ipairs(sdm_macros) do + if v.ID==nil then + v.ID=sdm_FindUnusedID() end - if v[1]=="b" then - sdm_macros[i].ID=ID - ID=ID+1 + if v.character then + v.character.realm=v.character.server + v.character.server=nil + end + v.icon=1 + if v.hideName then + v.buttonName=" " + v.hideName=nil + end + if sdm_ContainsIllegalChars(v.name) then + v.name = ""..v.ID + elseif sdm_DoesNameConflict(v.name, v.type, v.character, i) then + v.name = v.name..""..v.ID end end end for i,v in ipairs(sdm_macros) do - if v.ID==nil then - v.ID=sdm_FindUnusedID() - end - if v.character then - v.character.realm=v.character.server - v.character.server=nil - end - v.icon=1 - if v.hideName then - v.buttonName="" - v.hideName=nil - end - if sdm_ContainsIllegalChars(v.name) then - v.name = ""..v.ID - elseif sdm_DoesNameConflict(v.name, v.type, v.character, i) then - v.name = v.name..""..v.ID + if v.buttonName=="" then + v.buttonName=" " end end end diff --git a/SuperDuperMacro/SuperDuperMacro.toc b/SuperDuperMacro/SuperDuperMacro.toc index 657b6e4..9bd4aa6 100644 --- a/SuperDuperMacro/SuperDuperMacro.toc +++ b/SuperDuperMacro/SuperDuperMacro.toc @@ -2,7 +2,7 @@ ## Title : Super Duper Macro ## Notes: This AddOn allows users to make incredibly long macros. ## Author: hypehuman -## Version: 1.6 +## Version: 1.6.1 ## SavedVariables: sdm_macros, sdm_version SuperDuperMacro.lua SuperDuperMacro.xml \ No newline at end of file diff --git a/SuperDuperMacro/sdm Readme.txt b/SuperDuperMacro/sdm Readme.txt index b5efed2..1732e33 100644 --- a/SuperDuperMacro/sdm Readme.txt +++ b/SuperDuperMacro/sdm Readme.txt @@ -1,5 +1,5 @@ Super Duper Macro -version 1.6 +version 1.6.1 by hypehuman Check for updates at http://www.wowinterface.com/downloads/info10496 @@ -29,6 +29,9 @@ Special thanks to: Change Log +1.6.1 (1/27/09) +¥ÊFixed a serious bug that happened upon login after leaving "different name on button" blank. You may now safely leave it blank if you wish to show no text on the button. + 1.6 (1/19/09) ¥ Changed the slash command to run a floating macro. Also added a command to run button macros. Click the "Usage..." button for more details. ¥ÊAdded an interface for changing the name and icon of a macro within the SDM window. -- 1.7.9.5