From a23b16ec637bfc6b8590d7564480a06824c9492d Mon Sep 17 00:00:00 2001 From: Ahmil Jilani Date: Fri, 20 Feb 2009 13:38:00 -0500 Subject: [PATCH] 1.8 --- SuperDuperMacro/SuperDuperMacro.lua | 686 ++++++++++++++++++++++------------- SuperDuperMacro/SuperDuperMacro.toc | 4 +- SuperDuperMacro/SuperDuperMacro.xml | 276 +++++++++++--- SuperDuperMacro/sdm Readme.txt | 6 +- 4 files changed, 658 insertions(+), 314 deletions(-) diff --git a/SuperDuperMacro/SuperDuperMacro.lua b/SuperDuperMacro/SuperDuperMacro.lua index 222a45d..261083e 100644 --- a/SuperDuperMacro/SuperDuperMacro.lua +++ b/SuperDuperMacro/SuperDuperMacro.lua @@ -167,6 +167,22 @@ function sdm_OnUpdate(self, elapsed) --used for sending macros self.TimeSinceLastUpdate = 0 end end +function sdm_EndSending(text) + sdm_updateFrame:Hide() + sdm_sendReceiveFrame_sendBar_statusBar_text:SetText(text) + sdm_sending=nil + sdm_sendReceiveFrame_cancelSendButton:Disable() + if sdm_currentEdit then + sdm_sendReceiveFrame_sendButton:Enable() + end + sdm_sendReceiveFrame_sendPartyRadio:Enable() + sdm_sendReceiveFrame_sendRaidRadio:Enable() + sdm_sendReceiveFrame_sendBattlegroundRadio:Enable() + sdm_sendReceiveFrame_sendGuildRadio:Enable() + sdm_sendReceiveFrame_sendTargetRadio:Enable() + sdm_sendReceiveFrame_sendArbitraryRadio:Enable() + sdm_sendReceiveFrame_sendInput:EnableMouse(1) +end function sdm_WaitForMacro(name) if sdm_receiving then print("SDM: You are already receiving or waiting.") @@ -180,6 +196,7 @@ function sdm_WaitForMacro(name) sdm_sendReceiveFrame_receiveTargetRadio:Disable() sdm_sendReceiveFrame_receiveArbitraryRadio:Disable() sdm_sendReceiveFrame_receiveInput:EnableMouse(nil) + sdm_SelectItem(nil) sdm_newFrame:Show() sdm_newFrame_input:ClearFocus() sdm_newFrame_input:SetText("Receiving macro...") @@ -190,7 +207,6 @@ function sdm_WaitForMacro(name) sdm_newFrame_globalRadio:Disable() sdm_newFrame_charspecRadio:Disable() sdm_newFrame_createButton:Disable() - sdm_newFrame_cancelButton:Disable() end function sdm_ReceiveLine(line, send1) if sdm_receiving.first and send1 then --this is the first line @@ -232,7 +248,6 @@ function sdm_ReceiveLine(line, send1) sdm_newFrame_globalRadio:Enable() sdm_newFrame_charspecRadio:Enable() sdm_newFrame_createButton:Enable() - sdm_newFrame_cancelButton:Enable() if sdm_receiving.type=="b" then sdm_newFrame_buttonRadio:Click() elseif sdm_receiving.type=="f" then @@ -250,22 +265,6 @@ function sdm_ReceiveLine(line, send1) sdm_receiving.text=sdm_receiving.nameAndText:sub(sdm_receiving.playerNameLen+1,sdm_receiving.playerNameLen+sdm_receiving.textLen) end end -function sdm_EndSending(text) - sdm_updateFrame:Hide() - sdm_sendReceiveFrame_sendBar_statusBar_text:SetText(text) - sdm_sending=nil - sdm_sendReceiveFrame_cancelSendButton:Disable() - if sdm_currentEdit then - sdm_sendReceiveFrame_sendButton:Enable() - end - sdm_sendReceiveFrame_sendPartyRadio:Enable() - sdm_sendReceiveFrame_sendRaidRadio:Enable() - sdm_sendReceiveFrame_sendBattlegroundRadio:Enable() - sdm_sendReceiveFrame_sendGuildRadio:Enable() - sdm_sendReceiveFrame_sendTargetRadio:Enable() - sdm_sendReceiveFrame_sendArbitraryRadio:Enable() - sdm_sendReceiveFrame_sendInput:EnableMouse(1) -end function sdm_EndReceiving(text) sdm_sendReceiveFrame_receiveBar_statusBar_text:SetText(text) sdm_sendReceiveFrame_cancelReceiveButton:Disable() @@ -282,7 +281,6 @@ function sdm_EndReceiving(text) sdm_newFrame_globalRadio:Enable() sdm_newFrame_charspecRadio:Enable() sdm_newFrame_createButton:Enable() - sdm_newFrame_cancelButton:Enable() sdm_receiving=nil end function sdm_CancelSend() @@ -312,9 +310,9 @@ function sdm_SplitString(s, pattern, limit, ...) --iterates through "s", splitti end function sdm_VersionReceived(ver) if not sdm_versionWarning and sdm_CompareVersions(sdm_version,ver)==2 then - sdm_versionWarning="|cff00ff00A new version of Super Duper Macro is available! Search for it on www.wowinterface.com|r" - print(sdm_versionWarning) - sdm_mainFrameVersionWarning:SetText(sdm_versionWarning) + sdm_versionWarning="|cff00ff00New version available! Check on www.wowinterface.com|r" + print("Super Duper Macro: "..sdm_versionWarning) + sdm_mainFrameTitle:SetText(sdm_versionWarning) end end function sdm_DoOrQueue(luaText) --If player is not in combat, runs the command. Otherwise, queues it up to be executed when combat is dropped. @@ -362,29 +360,13 @@ function sdm_About() print("Super Duper Macro by hypehuman. Version "..sdm_version..". Check for updates at www.wowinterface.com") end function sdm_TypeDropdownLoaded(self) - if not sdm_listFilters then - self:RegisterEvent("VARIABLES_LOADED") - self:SetScript("OnEvent", function() - sdm_TypeDropdownLoaded(self) - self:UnregisterAllEvents() - self:SetScript("OnEvent", nil) - end) - return - end + self:SetScript("OnShow", nil) UIDropDownMenu_Initialize(self, sdm_InitializeTypeDropdown); UIDropDownMenu_SetText(self, "Type"); UIDropDownMenu_SetWidth(self, 52); end function sdm_CharDropdownLoaded(self) - if not sdm_listFilters then - self:RegisterEvent("VARIABLES_LOADED") - self:SetScript("OnEvent", function() - sdm_CharDropdownLoaded(self) - self:UnregisterAllEvents() - self:SetScript("OnEvent", nil) - end) - return - end + self:SetScript("OnShow", nil) UIDropDownMenu_Initialize(self, sdm_InitializeCharDropdown); UIDropDownMenu_SetText(self, "Character"); UIDropDownMenu_SetWidth(self, 75); @@ -396,7 +378,6 @@ function sdm_InitializeTypeDropdown() {val="f", txt="Floating Macros"}, {val="s", txt="Scripts"} } - for _,v in ipairs(buttons) do info.value = v.val; info.text = sdm_GetColor(v.val, v.txt); @@ -425,7 +406,7 @@ function sdm_InitializeCharDropdown() end function sdm_FilterButtonClicked(self, _, _, on) sdm_listFilters[self.value] = on - sdm_UpdateMacroList(sdm_currentEdit) + sdm_UpdateList() end function sdm_SendButtonClicked() local channel @@ -476,15 +457,33 @@ function sdm_NewButtonClicked() sdm_SaveConfirmationBox("sdm_SelectItem(nil) sdm_newFrame:Show() sdm_newFrame_input:SetFocus()") end function sdm_DeleteButtonClicked() - sdm_DeleteMacro(sdm_macros[sdm_currentEdit]) + sdm_ChangeContainer(sdm_macros[sdm_currentEdit], false) sdm_SelectItem(nil) end -function sdm_ListItemClicked(self) - if not sdm_listLocked then +function sdm_ListItemClicked(self, button) + local mTab = sdm_macros[self.index] + if button=="RightButton" then + sdm_currentlyPlacing = self.index + sdm_UpdateList() + elseif sdm_currentlyPlacing then + local container + if mTab.type=="c" then --If we clicked on a container, place the item in this container + container = mTab.ID + else --If we clicked on a non-container, place the item in the container that contains this macro + container = mTab.container + end + sdm_ChangeContainer(sdm_macros[sdm_currentlyPlacing], container) + sdm_currentlyPlacing=nil + sdm_UpdateList() + elseif mTab.type=="c" and not IsAltKeyDown() then + mTab.open = not mTab.open + sdm_UpdateList() + else sdm_SaveConfirmationBox("sdm_SelectItem("..self.index..")") end end function sdm_SelectItem(newCurrentEdit) + if sdm_listLocked then return end if sdm_macros[newCurrentEdit] then sdm_currentEdit = newCurrentEdit else @@ -497,109 +496,260 @@ function sdm_SelectItem(newCurrentEdit) sdm_mainFrame_editScrollFrame:Hide() sdm_mainFrame_saveButton:Disable() sdm_sendReceiveFrame_sendButton:Disable() + sdm_containerInstructions:Hide() + sdm_currentTitle:Hide() else sdm_mainFrame_editScrollFrame_text:ClearFocus() sdm_mainFrame_deleteButton:Enable() - sdm_mainFrame_getLinkButton:Enable() sdm_mainFrame_changeIconButton:Enable() - sdm_mainFrame_editScrollFrame:Show() + if sdm_macros[sdm_currentEdit].type=="c" then + sdm_mainFrame_editScrollFrame:Hide() + sdm_containerInstructions:Show() + sdm_mainFrame_getLinkButton:Disable() + else + sdm_mainFrame_editScrollFrame:Show() + sdm_containerInstructions:Hide() + sdm_mainFrame_getLinkButton:Enable() + end sdm_mainFrame_editScrollFrame_text:SetText(sdm_macros[sdm_currentEdit].text or "") sdm_mainFrame_saveButton:Disable() if not sdm_sending then sdm_sendReceiveFrame_sendButton:Enable() end + sdm_currentTitle:SetText(sdm_GetColor(sdm_macros[sdm_currentEdit].type, sdm_GetTitle(sdm_macros[sdm_currentEdit]))) + sdm_currentTitle:Show() + end + sdm_UpdateList() +end +function sdm_ResetContainers() --Deletes all folders and places all items into the main list + sdm_mainContents={} + for i,v in pairs(sdm_macros) do + if v.type=="c" then + sdm_macros[i]=nil + else + sdm_SortedInsert(sdm_mainContents, v) + v.container=nil + end + end +end +function sdm_ChangeContainer(mTab, newContainer) --removes the mTab from its current container and places it in the container with ID newContainer. If newContainer is nil, it's placed in the main folder. If newContainer is false, the item is deleted. + local parent = newContainer + while parent do --check to see if we're trying to put a folder inside itself + if parent==mTab.ID then return end + parent = sdm_macros[parent].container + end + --remove the mTab from its current container. + local prevContents--the .contents table of the container that currently holds this mTab + if mTab.container==nil then + prevContents = sdm_mainContents + else + prevContents = sdm_macros[mTab.container].contents + end + for i,ID in ipairs(prevContents) do + if ID==mTab.ID then + table.remove(prevContents, i) + break + end + end + --now we're done removing from old container + if newContainer==false then --delete the mTab + local type = mTab.type + if type=="c" then --if we're deleting a container, move its contents into its parent. + for _,ID in pairs(mTab.contents) do + sdm_macros[ID].container=mTab.container + sdm_SortedInsert(prevContents, sdm_macros[ID]) + end + elseif sdm_UsedByThisChar(mTab) then + if type=="b" or type=="f" then + sdm_DoOrQueue("getglobal("..sdm_Stringer("sd"..type.."_"..mTab.name).."):SetAttribute(\"type\", nil)") + if type=="b" then + sdm_DoOrQueue("DeleteMacro(sdm_GetMacroIndex("..sdm_Stringer(mTab.ID).."))") + end + end + end + sdm_macros[mTab.ID]=nil + else --move mTab into newContainer + local contents --the new container's contents + if newContainer then + contents=sdm_macros[newContainer].contents + else + contents = sdm_mainContents + end + sdm_SortedInsert(contents, mTab) + mTab.container = newContainer + end +end +function sdm_SortedInsert(contents, mTab) --inserts mTab's ID into t (a table of IDs) at an appropriate location. Returns the location. + local lLim = 1 + local uLim = getn(contents)+1 + local test + --perform a binary search to see where we should insert the mTab (to maintain alphabetical order) + while lLim < uLim do + test=math.floor((lLim+uLim)/2) + if sdm_IsAtLeast(mTab, sdm_macros[contents[test]]) then + lLim=test+1 + else + uLim=test + end end - sdm_UpdateMacroList() + table.insert(contents, lLim, mTab.ID) + return lLim end function sdm_IsAtLeast(one, two, i) --sees if the first mTab is greater than or equal to the second i=i or 1 local var if i==1 then - var="name" + var=function(mTab) return mTab.name:upper() end elseif i==2 then - var="type" + var=function(mTab) return mTab.name end elseif i==3 then - var="character.name or string.format('%c', 1)" + var=function(mTab) return mTab.type end elseif i==4 then - var="character.realm or string.format('%c', 1)" + var=function(mTab) if mTab.character then return mTab.character.name end return string.format('%c', 1) end + elseif i==5 then + var=function(mTab) if mTab.character then return mTab.character.realm end return string.format('%c', 1) end else return true end - return assert(loadstring([[ - local one, two = ... - if (one.]]..var..[[) > (two.]]..var..[[) then - return true - elseif (one.]]..var..[[) < (two.]]..var..[[) then - return false - else - return sdm_IsAtLeast(one, two, ]]..(i+1)..[[) + if var(one) > var(two) then + return true + elseif var(one) < var(two) then + return false + else + return sdm_IsAtLeast(one, two, i+1) + end +end +function sdm_UpdateList() + if not sdm_mainFrame:IsShown() then return end + local f + for i=getn(sdm_listItems),1,-1 do + f=sdm_listItems[i] + f:Hide() + table.remove(sdm_listItems, i) + table.insert(sdm_unusedListItems[f.isContainerFrame], f) + end + local sorted, offsets = {}, {} + sdm_AddFolderContents(sorted, offsets, sdm_mainContents, 0) + sdm_currentListItem = nil + local listItem, isContainer + for i,mTab in ipairs(sorted) do + isContainer = mTab.type=="c" + listItem = table.remove(sdm_unusedListItems[isContainer],1) + if not listItem then + --create the listItem + listItem = CreateFrame("Button", nil, sdm_mainFrame_macrosScroll_macroList) + listItem.icon = listItem:CreateTexture(nil, "OVERLAY") + listItem.text = listItem:CreateFontString(nil,"ARTWORK","GameFontNormal") + listItem.text:SetJustifyH("LEFT") + listItem.text:SetPoint("TOP") + listItem.text:SetPoint("BOTTOMRIGHT") + listItem.text:SetNonSpaceWrap(true) + listItem.isContainerFrame=isContainer + listItem:SetPoint("RIGHT") + listItem:SetPoint("LEFT") + listItem.highlight = listItem:CreateTexture(nil, "BACKGROUND") + listItem.highlight:SetAllPoints(listItem) + listItem.highlight:SetTexture("Interface\\QuestFrame\\UI-QuestLogTitleHighlight") + listItem.highlight:SetBlendMode("ADD") + listItem.highlight:Hide() + listItem:SetScript("OnEnter", sdm_ListItemEntered) + listItem:SetScript("OnLeave", sdm_ListItemLeft) + listItem:SetScript("OnMouseUp", sdm_ListItemClicked) + listItem.buttonHighlight = listItem:CreateTexture(nil, "HIGHLIGHT") + listItem.buttonHighlight:SetBlendMode("ADD") + listItem.buttonHighlight:SetAllPoints(listItem.icon) + listItem:RegisterForDrag("LeftButton") + if isContainer then + listItem.icon:SetHeight(16) + listItem.icon:SetWidth(16) + listItem.buttonHighlight:SetTexture("Interface\\Buttons\\UI-PlusButton-Hilight") + else + listItem.slotIcon = listItem:CreateTexture(nil, "ARTWORK") + listItem.slotIcon:SetTexture("Interface\\Buttons\\UI-EmptySlot-Disabled") + listItem.slotIcon:SetPoint("CENTER", listItem.icon) + listItem.buttonHighlight:SetTexture("Interface\\Buttons\\ButtonHilight-Square") + listItem.buttonHighlight:SetPoint("CENTER", listItem.icon, "CENTER") + end end - ]]))(one, two) -end -function sdm_UpdateMacroList() - local sorted = {} - local lLim,uLim,test - for _,v in pairs(sdm_macros) do - if sdm_IncludeInList(v) then - lLim = 1 - uLim = getn(sorted)+1 - --binary search for insertion location - while lLim < uLim do - test=math.floor((lLim+uLim)/2) - if sdm_IsAtLeast(v, sorted[test]) then - lLim=test+1 + table.insert(sdm_listItems, listItem) --this should insert it at i + --now, update the item's graphical elements + if isContainer then + if mTab.open then + listItem.icon:SetTexture("Interface\\Buttons\\UI-MinusButton-UP") + else + listItem.icon:SetTexture("Interface\\Buttons\\UI-PlusButton-UP") + end + else + if mTab.icon==1 then + if mTab.type=="b" and sdm_UsedByThisChar(mTab) then + _,texture = GetMacroInfo(sdm_GetMacroIndex(mTab.ID)) else - uLim=test + texture = nil end + else + texture = GetMacroIconInfo(mTab.icon) + end + listItem.icon:SetTexture(texture) + listItem.icon:SetWidth(sdm_iconSize) + listItem.icon:SetHeight(sdm_iconSize) + listItem.slotIcon:SetWidth(sdm_iconSize*64/36) + listItem.slotIcon:SetHeight(sdm_iconSize*64/36) + if mTab.type=="b" and sdm_UsedByThisChar(mTab) then + listItem:SetScript("OnDragStart", function() PickupMacro(sdm_GetMacroIndex(sdm_macros[this.index].ID)) end) + else + listItem:SetScript("OnDragStart", nil) end - table.insert(sorted, lLim, v) - end - end - sdm_currentListItem = nil - local listi=1 - local listItem = getglobal(sdm_listItemPrefix..listi) - for _,v in ipairs(sorted) do - if (not listItem) then - listItem = CreateFrame("Button", "$parent_listItem"..listi, sdm_mainFrame_macrosScroll_macroList, "sdm_listItemTemplate") - listItem.icon = getglobal(listItem:GetName().."_icon") - listItem.highlight = getglobal(listItem:GetName().."_highlight") - listItem.text = getglobal(listItem:GetName().."Name") end - listItem.index=v.ID + listItem.text:SetText(sdm_GetTitle(mTab)) + listItem:SetHeight(sdm_iconSize*(1+sdm_iconSpacing*2)) + listItem.icon:SetPoint("LEFT", sdm_iconSize*(sdm_iconSpacing + offsets[i]*(sdm_iconSpacing+1)) + (sdm_iconSize-listItem.icon:GetWidth())/2, 0) + listItem.text:SetPoint("LEFT", sdm_iconSize*(sdm_iconSpacing + (offsets[i]+1)*(sdm_iconSpacing+1)), 0) + listItem.index=mTab.ID if listItem.index==sdm_currentEdit then sdm_currentListItem = listItem + listItem.highlight:SetVertexColor(sdm_GetColor(mTab.type)) + listItem.highlight:Show() + listItem.text:SetTextColor(sdm_GetColor(nil)) + else + listItem.highlight:Hide() + listItem.text:SetTextColor(sdm_GetColor(mTab.type)) end - listItem:SetHeight(sdm_iconSize*(1+sdm_iconSpacing*2)) - sdm_UpdateListItem(listItem) - if listi==1 then - listItem:SetPoint("TOPLEFT") + if listItem.index==sdm_currentlyPlacing then + listItem:SetAlpha(0.3) else - listItem:SetPoint("TOPLEFT", sdm_listItemPrefix..(listi-1), "BOTTOMLEFT") + listItem:SetAlpha(1) end - listItem:SetPoint("RIGHT") - listItem.icon:SetWidth(sdm_iconSize) - listItem.icon:SetHeight(sdm_iconSize) - listItem.icon:ClearAllPoints() - local offset = 0 - listItem.icon:SetPoint("LEFT", sdm_iconSize*sdm_iconSpacing+offset*15, 0) - listItem.text:SetPoint("LEFT", listItem.icon, "RIGHT", sdm_iconSize*sdm_iconSpacing, 0) - if v.type=="b" and sdm_UsedByThisChar(v) then - listItem:RegisterForDrag("LeftButton") - listItem:SetScript("OnDragStart", function() PickupMacro(sdm_GetMacroIndex(sdm_macros[this.index].ID)) end) + if i==1 then + listItem:SetPoint("TOP") else - listItem:RegisterForDrag(nil) + listItem:SetPoint("TOP", sdm_listItems[i-1], "BOTTOM") end listItem:Show() - listi=listi+1 - listItem = getglobal(sdm_listItemPrefix..listi) end - while listItem do - listItem:Hide() - listi=listi+1 - listItem = getglobal(sdm_listItemPrefix..listi) +end +function sdm_GetTitle(mTab) + local result = mTab.name + if mTab.character then + result=result..sdm_GetColor(tostring(mTab.character.name..mTab.character.realm==sdm_thisChar.name..sdm_thisChar.realm), " ("..mTab.character.name.." of "..mTab.character.realm..")") + end + return result +end +function sdm_AddFolderContents(mTabs, offsets, contents, offset) --Populates mTabs with the elements of contents and all its subfolders. Populates offsets with the amount of indentation for each item. + for i,ID in ipairs(contents) do + local mTab = sdm_macros[ID] + if sdm_IncludeInList(mTab) then + table.insert(mTabs, mTab) + table.insert(offsets, offset) + if mTab.type=="c" and mTab.open then -- If it's an open container, add its contents too. + sdm_AddFolderContents(mTabs, offsets, mTab.contents, offset+1) + end + end end end function sdm_IncludeInList(mTab) --checks the filters to see if the item should be in the scrolling list + if mTab.type=="c" then + return true + end if not sdm_listFilters[mTab.type] then return false end @@ -608,45 +758,20 @@ function sdm_IncludeInList(mTab) --checks the filters to see if the item should end return sdm_listFilters[tostring(mTab.character.name..mTab.character.realm==sdm_thisChar.name..sdm_thisChar.realm)] end -function sdm_UpdateListItem(listItem) - local mTab=sdm_macros[listItem.index] - if (not mTab) then return end - local infoLine = mTab.name - if mTab.character then - infoLine=infoLine..sdm_GetColor(tostring(mTab.character.name..mTab.character.realm==sdm_thisChar.name..sdm_thisChar.realm), " ("..mTab.character.name.." of "..mTab.character.realm..")") - end - listItem:SetText(infoLine) - if mTab.icon==1 then - if mTab.type=="b" and sdm_UsedByThisChar(mTab) then - _,texture = GetMacroInfo(sdm_GetMacroIndex(mTab.ID)) - else - texture = "Interface\\MacroFrame\\MacroFrame-Icon" - end - else - texture = GetMacroIconInfo(mTab.icon) - end - listItem.icon:SetTexture(texture) - if listItem.index==sdm_currentEdit then - listItem.highlight:SetVertexColor(sdm_GetColor(mTab.type)) - listItem.highlight:Show() - listItem.text:SetTextColor(sdm_GetColor(nil)) - else - listItem.highlight:Hide() - listItem.text:SetTextColor(sdm_GetColor(mTab.type)) - end -end function sdm_MakeTextWhite(listItem) - local t = listItem:GetText() - listItem:SetText("|cffffffff"..t.."|r") + local t = listItem.text:GetText() + listItem.text:SetText("|cffffffff"..t.."|r") end function sdm_MakeTextNotWhite(listItem) - local t = listItem:GetText() + local t = listItem.text:GetText() if t:sub(1,2)=="|c" then - listItem:SetText(t:sub(11, t:len()-2)) + listItem.text:SetText(t:sub(11, t:len()-2)) end end function sdm_ListItemEntered(f) - sdm_MakeTextWhite(f) + if sdm_macros[f.index].type=="c" then + sdm_MakeTextWhite(f) + end end function sdm_ListItemLeft(f) sdm_MakeTextNotWhite(f) @@ -665,8 +790,8 @@ function sdm_GetColor(type, plainString)--if inputString is passed, it will retu r,g,b= .7,.7,.7 --this character elseif type=="false" then r,g,b= .3,.3,.3 --other characters - elseif type=="global" then - r,g,b= NORMAL_FONT_COLOR.r,NORMAL_FONT_COLOR.g,NORMAL_FONT_COLOR.b --global + elseif type=="c" or type=="global" then + r,g,b= NORMAL_FONT_COLOR.r,NORMAL_FONT_COLOR.g,NORMAL_FONT_COLOR.b --global or containers end if (not plainString) or r==nil then return r,g,b @@ -699,7 +824,10 @@ function sdm_OnShow_changeIconFrame(f) MacroFrame:Hide() f.prevmode=MacroPopupFrame.mode MacroPopupFrame.mode="sdm" - f.prevpoint={MacroPopupFrame:GetPoint(MacroPopupFrame:GetNumPoints())} + f.prevpoints={} + for i=1,MacroPopupFrame:GetNumPoints() do + f.prevpoints[i]={MacroPopupFrame:GetPoint(i)} + end MacroPopupFrame:ClearAllPoints() MacroPopupFrame:SetParent(f) MacroPopupFrame:SetPoint("BOTTOM") @@ -725,7 +853,6 @@ function sdm_OnShow_changeIconFrame(f) end MacroPopupFrame_buttonTextCheckBox:GetScript("OnClick")(MacroPopupFrame_buttonTextCheckBox) sdm_changeIconFrame_input:SetText(mTab.name or "") - sdm_listLocked=true end function sdm_OnHide_changeIconFrame(f) MacroPopupFrame:SetScript("OnShow", f.prevonshow) @@ -735,7 +862,9 @@ function sdm_OnHide_changeIconFrame(f) MacroPopupFrame.mode=f.prevmode MacroPopupFrame:ClearAllPoints() MacroPopupFrame:SetParent(UIParent) - MacroPopupFrame:SetPoint(f.prevpoint[1], f.prevpoint[2], f.prevpoint[3], f.prevpoint[4], f.prevpoint[5]) + for _,point in ipairs(f.prevpoints) do + MacroPopupFrame:SetPoint(point[1], point[2], point[3], point[4], point[5]) + end f.fontstring:SetText(MACRO_POPUP_TEXT) f.fontstring:Show() MacroPopupEditBox:Show() @@ -745,28 +874,23 @@ function sdm_OnHide_changeIconFrame(f) MacroPopupFrame_sdmCancelButton:Hide() MacroPopupFrame:Hide() MacroPopupFrame_buttonTextCheckBox:Hide() - sdm_listLocked=false end function sdm_ChangeIconOkayed() + local mTab = sdm_macros[sdm_currentEdit] local nameInputted = sdm_changeIconFrame_input:GetText() local iconInputted = MacroPopupFrame.selectedIcon - if (not nameInputted) or nameInputted=="" or (not iconInputted) then + if (not nameInputted) or nameInputted=="" or (mTab.type~="c" and not iconInputted) then return end - local illeg = sdm_ContainsIllegalChars(nameInputted) - if illeg then - print("You may not use the character \""..illeg.."\" in the name. If this is a button macro, you might be able to use that character in the name displayed on the button (click \"Change Name/Icon\").") - return - end - local mTab = sdm_macros[sdm_currentEdit] - if sdm_DoesNameConflict(nameInputted, mTab.type, mTab.character, sdm_currentEdit) then - print("SDM: You may not have more than one of the same type with the same name (unless they are specific to different characters).") + if (mTab.type=="b" or mTab.type=="f") and sdm_ContainsIllegalChars(nameInputted, true) then return end + if sdm_DoesNameConflict(nameInputted, mTab.type, mTab.character, sdm_currentEdit, true) then return end local oldName = mTab.name local oldButtonName = mTab.buttonName local oldIcon = mTab.icon mTab.name = nameInputted + sdm_ChangeContainer(mTab, mTab.container) --place the item in itself. This is so that it gets re-sorted. if MacroPopupFrame_buttonTextCheckBox:GetChecked()==1 then mTab.buttonName = MacroPopupEditBox:GetText() if mTab.buttonName=="" then @@ -775,8 +899,9 @@ function sdm_ChangeIconOkayed() else mTab.buttonName=nil end - mTab.icon = iconInputted - sdm_UpdateListItem(sdm_currentListItem) + if mTab.type~="c" then + mTab.icon = iconInputted + end sdm_changeIconFrame:Hide() if sdm_UsedByThisChar(mTab) and (mTab.type=="b" or mTab.type=="f") then if mTab.name~=oldName then @@ -789,6 +914,7 @@ function sdm_ChangeIconOkayed() sdm_MakeBlizzardMacro(mTab.ID, (mTab.buttonName or mTab.name), mTab.icon) end end + sdm_UpdateList() end function sdm_buttonTextCheckBoxClicked(checked) if checked then @@ -802,6 +928,15 @@ function sdm_buttonTextCheckBoxClicked(checked) MacroPopupEditBox:Hide() end end +function sdm_CollapseAllButtonClicked(self) + local allOpenOrClosed = self:GetChecked()==nil + for _,v in ipairs(sdm_macros) do + if v.type=="c" then + v.open = allOpenOrClosed + end + end + sdm_UpdateList() +end function sdm_freezeEditFrame() sdm_descendants = {sdm_mainFrame:GetChildren()} sdm_mouseStates = {} @@ -821,12 +956,12 @@ function sdm_thawEditFrame() end end function sdm_SaveConfirmationBox(postponed) - if (not sdm_currentEdit) or sdm_macros[sdm_currentEdit].text==sdm_mainFrame_editScrollFrame_text:GetText() then + if (not sdm_currentEdit) or sdm_macros[sdm_currentEdit].type=="c" or sdm_macros[sdm_currentEdit].text==sdm_mainFrame_editScrollFrame_text:GetText() then RunScript(postponed) else sdm_mainFrame_editScrollFrame_text:ClearFocus() StaticPopupDialogs["SDM_CONFIRM"] = { - text = "Do you want to save your changes to \""..sdm_macros[sdm_currentEdit].name.."\"?", + text = "Do you want to save your changes to "..sdm_currentTitle:GetText().."?", button1 = "Save", --left button button3 = "Don't Save", --middle button button2 = "Cancel", -- right button @@ -841,28 +976,14 @@ function sdm_SaveConfirmationBox(postponed) StaticPopup_Show("SDM_CONFIRM"):SetPoint("CENTER", "sdm_mainFrame", "CENTER") end end -function sdm_DeleteMacro(mTab) - local ID = mTab.ID - if sdm_UsedByThisChar(mTab) then - local type = mTab.type - if type=="b" or stype=="f" then - sdm_DoOrQueue("getglobal("..sdm_Stringer("sd"..type.."_"..mTab.name).."):SetAttribute(\"type\", nil)") - if type=="b" then - sdm_DoOrQueue("DeleteMacro(sdm_GetMacroIndex("..sdm_Stringer(mTab.ID).."))") - end - end - end - sdm_macros[ID]=nil - sdm_UpdateMacroList() -end function sdm_GetLink(mTab) if sdm_UsedByThisChar(mTab) then if mTab.type=="b" then - print("To run this macro, drag the button from the list and place it on your action bar, or use \"/click sdb_"..mTab.name.."\" (case-sensitive).") + print("To run this macro, drag the button from the list and place it on your action bar, or use "..string.format("%q", "/click sdb_"..mTab.name).." (case-sensitive).") elseif mTab.type=="f" then - print("To run this macro, use \"/click sdf_"..mTab.name.."\" (case-sensitive).") + print("To run this macro, use "..string.format("%q", "/click sdf_"..mTab.name).." (case-sensitive).") elseif mTab.type=="s" then - print("To run this script, use \"/sdm run ".. mTab.name.."\" or use the function \"sdm_RunScript('".. mTab.name.."')\" (case-sensitive).") + print("To run this script, use "..string.format("%q", "/sdm run "..mTab.name).." or use the function sdm_RunScript("..string.format("%q", mTab.name)..") (case-sensitive).") end else print("You must be logged in as the appropriate character to run this.") @@ -874,7 +995,7 @@ function sdm_PickupMacro(ID) end end function sdm_Quit(append) - local scriptOnQuit = "sdm_mainFrame:Hide()" + local scriptOnQuit = "sdm_mainFrame:Hide() sdm_changeIconFrame:Hide() sdm_newFolderFrame:Hide()" if (not sdm_receiving) then scriptOnQuit = scriptOnQuit.." sdm_newFrame:Hide()" if (not sdm_sending) then @@ -896,11 +1017,6 @@ function sdm_CreateButtonClicked() if name=="" then return end - local illeg = sdm_ContainsIllegalChars(name) - if illeg then - print("You may not use the character \""..illeg.."\" in the name. If this is a button macro, you might be able to use that character in the name displayed on the button (click \"Change Name/Icon\").") - return - end local type = nil if sdm_newFrame_buttonRadio:GetChecked() then type="b" @@ -909,6 +1025,7 @@ function sdm_CreateButtonClicked() elseif sdm_newFrame_scriptRadio:GetChecked() then type="s" end + if (type=="b" or type=="f") and sdm_ContainsIllegalChars(name, true) then return end local character if sdm_newFrame_charspecRadio:GetChecked() then character=sdm_thisChar @@ -920,14 +1037,22 @@ function sdm_CreateButtonClicked() print("SDM: You already have 18 character-specific macros.") return end - local conflict = sdm_DoesNameConflict(name, type, character) + local conflict = sdm_DoesNameConflict(name, type, character, nil, true) if conflict then - print("SDM: You may not have more than one of the same type with the same name (unless they are specific to different characters).") return end sdm_newFrame:Hide() sdm_SelectItem(sdm_CreateNew(type, name, character).ID) end +function sdm_CreateFolderButtonClicked() + local name = sdm_newFolderFrame_input:GetText() + if name=="" then + return + end + sdm_newFolderFrame:Hide() + sdm_CreateNew("c", name) + sdm_UpdateList() +end function sdm_CreateNew(type, name, character) --returns the mTab of the new macro local mTab = {} mTab.ID=0 @@ -936,24 +1061,30 @@ function sdm_CreateNew(type, name, character) --returns the mTab of the new macr end sdm_macros[mTab.ID]=mTab mTab.type=type - mTab.icon=1 - mTab.name=sdm_newFrame_input:GetText() - if sdm_receiving and sdm_receiving.text then - mTab.text=sdm_receiving.text - mTab.icon=sdm_receiving.icon - SendAddonMessage("Super Duper Macro recDone", "", "WHISPER", sdm_receiving.playerName) - sdm_EndReceiving("|cff44ff00Saved|r") + mTab.name=name + if type=="c" then + mTab.open = true + mTab.contents = {} else - if type=="s" then - mTab.text="-- Enter lua commands here." - elseif type=="b" or type=="f" then - mTab.text="# Enter macro text here." - else --this shouldn't happen - mTab.text="" + mTab.icon=1 + if sdm_receiving and sdm_receiving.text then + mTab.text=sdm_receiving.text + mTab.icon=sdm_receiving.icon + SendAddonMessage("Super Duper Macro recDone", "", "WHISPER", sdm_receiving.playerName) + sdm_EndReceiving("|cff44ff00Saved|r") + else + if type=="s" then + mTab.text="-- Enter lua commands here." + elseif type=="b" or type=="f" then + mTab.text="# Enter macro text here." + else --this shouldn't happen + mTab.text="" + end end + mTab.character=character + sdm_SetUpMacro(mTab) end - mTab.character=character - sdm_SetUpMacro(mTab) + sdm_ChangeContainer(mTab, nil) return mTab end function sdm_RunScript(name) @@ -970,17 +1101,18 @@ function sdm_RunScript(name) print("SDM could not find a script named \""..name.."\".") end end -function sdm_DoesNameConflict(name, type, char, ignoring) --returns a conflict if we find a macro of the same type and name that can be seen for a given character. If no character is passed, we it's assumed to be global. If we are passed , we will skip that particular macro index while checking. +function sdm_DoesNameConflict(name, type, char, ignoring, printWarning) --returns a conflict if we find a macro of the same type and name that can be seen for a given character. If no character is passed, we it's assumed to be global. If we are passed , we will skip that particular macro index while checking. for i,v in pairs(sdm_macros) do - if i~=ignoring and v.type==type and v.name==name and ((not char) or (not sdm_macros[i].character) or (char.name==sdm_macros[i].character.name and char.realm==sdm_macros[i].character.realm)) then --If they're the same name and type, we can only return false if they're both specific to different characters. + if v.type~="c" and i~=ignoring and v.type==type and v.name==name and ((not char) or (not sdm_macros[i].character) or (char.name==sdm_macros[i].character.name and char.realm==sdm_macros[i].character.realm)) then --If they're the same name and type, we can only return false if they're both specific to different characters. + if printWarning then + print("SDM: You may not have more than one of the same type with the same name (unless they are specific to different characters).") + end return i end end - return nil end -function sdm_ContainsIllegalChars(s) - local b - local found +function sdm_ContainsIllegalChars(s, printWarning) --s is the string to evaluate, printWarning is a boolean + local b, found for i=1,s:len() do b = s:byte(i) found = false @@ -990,9 +1122,14 @@ function sdm_ContainsIllegalChars(s) break end end - if not found then return s:sub(i,i) end + if not found then + local badChar = s:sub(i,i) + if printWarning then + print("You may not use the character \""..badChar.."\" in the name. If this is a button macro, you might be able to use that character in the name displayed on the button (click \"Change Name/Icon\").") + end + return badChar + end end - return nil end function sdm_UsedByThisChar(mTab) --returns true if the macro is global or specific to this character. Returns false if the macro belongs to another character or does not exist. if not mTab then @@ -1025,36 +1162,6 @@ function sdm_OnMembersChanged() sdm_inBG = false end end -function sdm_MacroFrame_Update_Supplement() --This is hooked onto the end of MacroFrame_Update in order to prevent the user from messing with macros created by SDM. - local selectedIsSDM = nil - local globalTab = (MacroFrame.macroBase==0) --Is this the global tab or the character-specific tab? - for i,v in pairs(sdm_macros) do - if v.type=="b" and sdm_UsedByThisChar(v) and ((globalTab and (not v.character)) or ((not globalTab) and v.character and v.character.name==sdm_thisChar.name and v.character.realm==sdm_thisChar.realm)) then - local index = sdm_GetMacroIndex(v.ID) - local prefix = "MacroButton"..index-MacroFrame.macroBase - if index == MacroFrame.selectedMacro then --The currently selected macro is a SDM macro. Deselect it for now, then later select another one. - selectedIsSDM = index-MacroFrame.macroBase - _G[prefix]:SetChecked(nil) - MacroFrame.selectedMacro = nil - MacroFrame_HideDetails() - end - _G[prefix]:Disable() - _G[prefix.."Icon"]:SetTexture("Interface\\MacroFrame\\MacroFrame-Icon") - _G[prefix.."Name"]:SetText("SDM") - end - end - if selectedIsSDM then - local index=selectedIsSDM+1 - while index<=MacroFrame.macroMax do --if index exceeds this value, we know should stop because we've exceeded the number of slots on this pane. - local buttonToCheck = _G["MacroButton"..index] - if buttonToCheck:IsEnabled()==1 then - buttonToCheck:Click() - break - end - index=index+1 - end - end -end function sdm_numToChars(num) --converts a number into a string (with maximum compression) local base = getn(sdm_validChars) --the counting system we're working in. sdm_validChars[1] is the digit for 0, [2] is the digit for 1, and so on. local place=0 --the power on the base that you multiply by the digit to get the value (0 is the ones place) @@ -1098,13 +1205,48 @@ function sdm_charsToNum(chars) --converts characters back into a number end return num end +function sdm_AddToExclusiveGroup(f, group, isButton) --f is the frame, group is a key, button is a boolean that tells if it's a button or a window + sdm_exclusiveGroups = sdm_exclusiveGroups or {} --contains groups of mutually exclusive frames + if not sdm_exclusiveGroups[group] then + sdm_exclusiveGroups[group] = {buttons={}, windows={}} + end + if isButton then + table.insert(sdm_exclusiveGroups[group].buttons, f) + else + table.insert(sdm_exclusiveGroups[group].windows, f) + f.exclusiveGroupKey = group + f:HookScript("OnShow", sdm_ExclusiveWindowShown) + f:HookScript("OnHide", sdm_ExclusiveWindowHidden) + end +end +function sdm_ExclusiveWindowShown(f) --when a window in the group is shown, disable all buttons in the group. + local t = sdm_exclusiveGroups[f.exclusiveGroupKey] + t.isEnabled={} + for _,button in pairs(t.buttons) do + if button:IsEnabled()==1 then + t.isEnabled[button]=true + button:Disable() + end + end + sdm_listLocked=true --this should only apply to the "centerwindows" group, but right now that's all there is. +end +function sdm_ExclusiveWindowHidden(f) --reenable the buttons. + local t = sdm_exclusiveGroups[f.exclusiveGroupKey] + for _,button in pairs(t.buttons) do + if t.isEnabled[button] then + button:Enable() + end + end + t.isEnabled=nil + sdm_listLocked=false --this should only apply to the "centerwindows" group, but right now that's all there is. +end SlashCmdList["SUPERDUPERMACRO"] = sdm_SlashHandler; SLASH_SUPERDUPERMACRO1 = "/sdm"; 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,50,48,41,47,54,48,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,49,48,56,48,41,47,54,48,48,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 @@ -1122,7 +1264,7 @@ sdm_eventFrame:SetScript("OnEvent", function () sdm_version=GetAddOnMetadata("SuperDuperMacro", "Version") --the version of this addon sdm_eventFrame:UnregisterEvent("VARIABLES_LOADED") if (not sdm_macros) then - sdm_macros={} + sdm_macros={} --type tokens: "b": button macro. "f": floating macro. "s": scripts. "c": containers (folders) elseif sdm_CompareVersions(oldVersion,"1.6.1")==2 then if sdm_CompareVersions(oldVersion,"1.6")==2 then if sdm_CompareVersions(oldVersion,"1.3")==2 then @@ -1190,14 +1332,17 @@ sdm_eventFrame:SetScript("OnEvent", function () for _,v in pairs(savedMacros) do sdm_macros[v.ID]=v end + if sdm_mainContents==nil then + sdm_ResetContainers() + end sdm_iconSize=sdm_iconSize or 36 if not sdm_listFilters then - sdm_listFilters={b=true, f=true, s=true, global=true} - sdm_listFilters["true"]=true + sdm_listFilters={b=true, f=true, s=true, global=true} + sdm_listFilters["true"]=true sdm_listFilters["false"]=true end sdm_mainFrame_iconSizeSlider:SetValue(sdm_iconSize) - sdm_mainFrame_iconSizeSlider:SetScript("OnValueChanged", function(self) sdm_iconSize = self:GetValue() sdm_UpdateMacroList() end) + sdm_mainFrame_iconSizeSlider:SetScript("OnValueChanged", function(self) sdm_iconSize = self:GetValue() sdm_UpdateList() end) sdm_SelectItem(nil) --We want to start with no macro selected elseif event=="UPDATE_MACROS" then sdm_countUpdateMacrosEvents=sdm_countUpdateMacrosEvents+1 @@ -1234,7 +1379,6 @@ sdm_eventFrame:SetScript("OnEvent", function () end end end - sdm_UpdateMacroList() elseif event=="ADDON_LOADED" then if arg1=="Blizzard_MacroUI" then sdm_eventFrame:UnregisterEvent("ADDON_LOADED") @@ -1265,12 +1409,36 @@ sdm_eventFrame:SetScript("OnEvent", function () f:SetPoint("RIGHT", MacroPopupCancelButton, "LEFT", -2, 0) f:SetText(OKAY) f:SetScript("OnClick", sdm_ChangeIconOkayed) - --hook the function that updates macros in the default macro window so that we can disable the SDM macros - local orig = MacroFrame_Update - MacroFrame_Update = function() - orig() - sdm_MacroFrame_Update_Supplement() - end + hooksecurefunc("MacroFrame_Update", function() --This function prevents the user from messing with macros created by SDM. + local selectedIsSDM = nil + local globalTab = (MacroFrame.macroBase==0) --Is this the global tab or the character-specific tab? + for i,v in pairs(sdm_macros) do + if v.type=="b" and sdm_UsedByThisChar(v) and ((globalTab and (not v.character)) or ((not globalTab) and v.character and v.character.name==sdm_thisChar.name and v.character.realm==sdm_thisChar.realm)) then + local index = sdm_GetMacroIndex(v.ID) + local prefix = "MacroButton"..index-MacroFrame.macroBase + if index == MacroFrame.selectedMacro then --The currently selected macro is a SDM macro. Deselect it for now, then later select another one. + selectedIsSDM = index-MacroFrame.macroBase + _G[prefix]:SetChecked(nil) + MacroFrame.selectedMacro = nil + MacroFrame_HideDetails() + end + _G[prefix]:Disable() + _G[prefix.."Icon"]:SetTexture("Interface\\MacroFrame\\MacroFrame-Icon") + _G[prefix.."Name"]:SetText("SDM") + end + end + if selectedIsSDM then + local index=selectedIsSDM+1 + while index<=MacroFrame.macroMax do --if index exceeds this value, we know should stop because we've exceeded the number of slots on this pane. + local buttonToCheck = _G["MacroButton"..index] + if buttonToCheck:IsEnabled()==1 then + buttonToCheck:Click() + break + end + index=index+1 + end + end + end) end elseif event=="PLAYER_REGEN_ENABLED" then sdm_eventFrame:UnregisterEvent("PLAYER_REGEN_ENABLED") @@ -1316,10 +1484,22 @@ sdm_eventFrame:SetScript("OnEvent", function () end end end) -sdm_iconSpacing=1/20 +sdm_containerInstructionsString = [[ +Left-click on a folder to open or close it. + +To place an item into a folder, right-click on the item and then left-click on or in the folder. + +To change the name of a folder, click the "Change Name/Icon" button (folders do not have icons). + +Deleting a folder will move all of its contents into its parent folder. + +To bring up these instructions and folder options, alt-click on a folder in the list. +]] +sdm_iconSpacing=5/36 sdm_listLocked=false --if this is true, clicking on a macro in the SDM list will do nothing. sdm_macroUILoaded=false --the default macro UI, which normally loads when you type /macro -sdm_listItems={} +sdm_unusedListItems={} +sdm_listItems,sdm_unusedListItems[true],sdm_unusedListItems[false]={},{},{} sdm_thisChar = {name=UnitName("player"), realm=GetRealmName()} sdm_listItemPrefix = "sdm_mainFrame_macrosScroll_macroList_listItem" sdm_grouped=false --assume they're in a party, because we're going to send the tell right off the bat anyway diff --git a/SuperDuperMacro/SuperDuperMacro.toc b/SuperDuperMacro/SuperDuperMacro.toc index 2a86688..0b8321d 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.7 -## SavedVariables: sdm_version, sdm_listFilters, sdm_iconSize, sdm_macros +## Version: 1.8 +## SavedVariables: sdm_version, sdm_listFilters, sdm_iconSize, sdm_mainContents, sdm_macros SuperDuperMacro.lua SuperDuperMacro.xml \ No newline at end of file diff --git a/SuperDuperMacro/SuperDuperMacro.xml b/SuperDuperMacro/SuperDuperMacro.xml index b2d1aad..9f76c9f 100644 --- a/SuperDuperMacro/SuperDuperMacro.xml +++ b/SuperDuperMacro/SuperDuperMacro.xml @@ -1,36 +1,4 @@ - @@ -108,16 +76,7 @@ - - - - - - - - - - + @@ -131,7 +90,10 @@ - sdm_NewButtonClicked() + sdm_NewButtonClicked() + + sdm_AddToExclusiveGroup(self, "centerwindows", true) + @@ -272,15 +277,35 @@ sdm_changeIconFrame:Show() + + sdm_AddToExclusiveGroup(self, "centerwindows", true) + - + + - + @@ -386,6 +411,29 @@ self:SetBackdropColor(TOOLTIP_DEFAULT_BACKGROUND_COLOR.r, TOOLTIP_DEFAULT_BACKGROUND_COLOR.g, TOOLTIP_DEFAULT_BACKGROUND_COLOR.b) + + + + + + + + + + + + + + + + + + + + + + + @@ -394,7 +442,9 @@ self:StopMovingOrSizing(); PlaySound "igCharacterInfoOpen" - self:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", 0, -104) + self:SetPoint("TOPLEFT", "UIParent", "TOPLEFT", 0, -104) + sdm_currentlyPlacing=nil + sdm_UpdateList() PlaySound "igCharacterInfoClose" @@ -643,15 +693,119 @@ sdm_mainFrame:StartMoving(); sdm_mainFrame:StopMovingOrSizing(); sdm_mainFrame:StopMovingOrSizing(); - - sdm_listLocked = true - + + sdm_AddToExclusiveGroup(self, "centerwindows") + - sdm_listLocked = false UIFrameFlashStop(sdm_newFrame_createButton_flash) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + self:ClearFocus() + + + sdm_newFolderFrame_createButton:Click() + + + + + + + + sdm_mainFrame:StartMoving(); + sdm_mainFrame:StopMovingOrSizing(); + sdm_mainFrame:StopMovingOrSizing(); + + sdm_AddToExclusiveGroup(self, "centerwindows") + + + @@ -706,6 +860,9 @@ + + sdm_AddToExclusiveGroup(self, "centerwindows") + sdm_OnShow_changeIconFrame(self, sdm_macros[sdm_currentEdit]) @@ -1099,7 +1256,10 @@ - sdm_ReceiveButtonClicked() + sdm_ReceiveButtonClicked() + + sdm_AddToExclusiveGroup(self, "centerwindows", true) + diff --git a/SuperDuperMacro/sdm Readme.txt b/SuperDuperMacro/sdm Readme.txt index 351e135..e79afd4 100644 --- a/SuperDuperMacro/sdm Readme.txt +++ b/SuperDuperMacro/sdm Readme.txt @@ -1,5 +1,5 @@ Super Duper Macro -version 1.7 +version 1.8 by hypehuman Check for updates at http://www.wowinterface.com/downloads/info10496 @@ -30,6 +30,10 @@ Special thanks to: Change Log +1.8 (2/19/08) +¥ÊAdded the option of creating folders to organize your macros +¥ÊNumerous minor UI improvements + 1.7 (2/8/09) ¥ÊMade the macro list better - Color-coded the different macro types -- 1.7.9.5