Skip to content

Commit

Permalink
2.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
hypehuman committed Dec 1, 2011
1 parent c91f98a commit 2a12672
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 42 deletions.
2 changes: 1 addition & 1 deletion SuperDuperMacro/SuperDuperMacro.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title : Super Duper Macro
## Notes: Enables creation of incredibly long macros.
## Author: hypehuman
## Version: 2.4.1
## Version: 2.4.2
## SavedVariables: sdm_version, sdm_listFilters, sdm_iconSize, sdm_mainContents, sdm_macros
SuperDuperMacro_Core.lua
SuperDuperMacro_Interface.lua
Expand Down
79 changes: 41 additions & 38 deletions SuperDuperMacro/SuperDuperMacro_Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ sdm_eventFrame:SetScript("OnEvent", function (self, event, ...)
sdm_eventFrame:UnregisterEvent(event)
if (not sdm_macros) then
sdm_macros={} --type tokens: "b": button macro. "f": floating macro. "s": scripts. "c": containers (folders)
end
-- when updating versions, make sure that the saved data are appropriately updated.
if sdm_CompareVersions(oldVersion, sdm_version) == 2 then
elseif sdm_CompareVersions(oldVersion, sdm_version) == 2 then
if sdm_CompareVersions(oldVersion,"1.6")==2 then -- Hopefully nobody is upgrading from a version this old. If they are, they should download 2.1 and run that once before upgrading to 2.2.
sdm_macros={}
end
Expand All @@ -53,7 +52,7 @@ sdm_eventFrame:SetScript("OnEvent", function (self, event, ...)
end
end
end
if sdm_CompareVersions(oldVersion,"2.4.1")==2 then
if sdm_CompareVersions(oldVersion,"2.4.2")==2 then
for _,v in pairs(sdm_macros) do
if v.icon then
v.icon = sdm_defaultIcon
Expand All @@ -70,7 +69,7 @@ sdm_eventFrame:SetScript("OnEvent", function (self, event, ...)
if sdm_mainContents==nil then
sdm_ResetContainers()
end
sdm_iconSize=sdm_iconSize or 36
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
Expand All @@ -79,44 +78,48 @@ sdm_eventFrame:SetScript("OnEvent", function (self, event, ...)
sdm_iconSizeSlider:SetValue(sdm_iconSize)
sdm_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
if sdm_countUpdateMacrosEvents < 2 then
sdm_countUpdateMacrosEvents=sdm_countUpdateMacrosEvents+1
if sdm_countUpdateMacrosEvents==2 then
local killOnSight = {}
local macrosToDelete = {}
local iIsPerCharacter=false
local thisID, mTab
for i=1,54 do --Check each macro to see if it's been orphaned by a previous installation of SDM.
if i==37 then iIsPerCharacter=true end
thisID = sdm_GetSdmID(i)
mTab = sdm_macros[thisID]
if thisID then --if the macro was created by SDM...
if killOnSight[thisID] then --if this ID is marked as kill-on-sight, kill it.
table.insert(macrosToDelete, i)
elseif (not mTab) or mTab.type~="b" or (not sdm_UsedByThisChar(mTab)) then --if this ID is not in use by this character as a button macro, kill it and mark this ID as KoS
table.insert(macrosToDelete, i)
killOnSight[thisID]=1
elseif (mTab.characters~=nil)~=iIsPerCharacter then --if the macro is in the wrong spot based on perCharacter, kill it, but give it a chance to find one in the right spot.
table.insert(macrosToDelete, i)
else --This macro is good and should be here. Kill any duplicates.
killOnSight[thisID]=1
end
end
end
for i=getn(macrosToDelete),1,-1 do -- we delete in descending order so that the indices don't get messed up while we're deleting, which would cause us to delete the wrong macros
print(sdm_printPrefix.."Deleting extraneous macro "..macrosToDelete[i]..": "..GetMacroInfo(macrosToDelete[i]))
DeleteMacro(macrosToDelete[i])
end
for i,v in pairs(sdm_macros) do
if sdm_UsedByThisChar(sdm_macros[i]) then
sdm_SetUpMacro(sdm_macros[i])
elseif event=="UPDATE_MACROS" then
-- SDM uses this event for two things. Whenever you log into the game, UPDATE_MACROS is fired twice. After the second firing, the macros are loaded. This is when SDM deletes extraneous macros that it has created before. This generally happens if you use different computers or if you don't use SDM for a while. Whenever you log in, SDM makes sure that your macro list jives with the info in SavedVariables.
if sdm_countUpdateMacrosEvents == 0 then
sdm_countUpdateMacrosEvents = 1
elseif sdm_countUpdateMacrosEvents==1 then
sdm_countUpdateMacrosEvents = 2
local killOnSight = {}
local macrosToDelete = {}
local iIsPerCharacter=false
local thisID, mTab
for i=1,54 do --Check each macro to see if it's been orphaned by a previous installation of SDM.
if i==37 then iIsPerCharacter=true end
thisID = sdm_GetSdmID(i)
mTab = sdm_macros[thisID]
if thisID then --if the macro was created by SDM...
if killOnSight[thisID] then --if this ID is marked as kill-on-sight, kill it.
table.insert(macrosToDelete, i)
elseif (not mTab) or mTab.type~="b" or (not sdm_UsedByThisChar(mTab)) then --if this ID is not in use by this character as a button macro, kill it and mark this ID as KoS
table.insert(macrosToDelete, i)
killOnSight[thisID]=1
elseif (mTab.characters~=nil)~=iIsPerCharacter then --if the macro is in the wrong spot based on perCharacter, kill it, but give it a chance to find one in the right spot.
table.insert(macrosToDelete, i)
else --This macro is good and should be here. Kill any duplicates.
killOnSight[thisID]=1
end
end
end
for i=getn(macrosToDelete),1,-1 do -- we delete in descending order so that the indices don't get messed up while we're deleting, which would cause us to delete the wrong macros
print(sdm_printPrefix.."Deleting extraneous macro "..macrosToDelete[i]..": "..GetMacroInfo(macrosToDelete[i]))
DeleteMacro(macrosToDelete[i])
end
for i,v in pairs(sdm_macros) do
if sdm_UsedByThisChar(sdm_macros[i]) then
sdm_SetUpMacro(sdm_macros[i])
end
end
end
if sdm_countUpdateMacroEvents==2 then
-- If the macros are loaded, update the number of button macros on the SDM frame
local numAccountMacros, numCharacterMacros = GetNumMacros()
sdm_macroLimitText:SetText("Global macros: "..numAccountMacros.."/36\nCharacter-specific macros: "..numCharacterMacros.."/18")
end
local numAccountMacros, numCharacterMacros = GetNumMacros()
sdm_macroLimitText:SetText("Global macros: "..numAccountMacros.."/36\nCharacter-specific macros: "..numCharacterMacros.."/18")
elseif event=="ADDON_LOADED" then
local addonName = ...;
if addonName=="Blizzard_MacroUI" then
Expand Down
8 changes: 6 additions & 2 deletions SuperDuperMacro/SuperDuperMacro_Interface.lua
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,12 @@ function sdm_UpdateList()
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(self, event, ...)
PickupMacro(sdm_GetMacroIndex(sdm_macros[self.index].ID))
listItem:SetScript("OnDragStart", function(self, event, ...)
if not InCombatLockdown() then
PickupMacro(sdm_GetMacroIndex(sdm_macros[self.index].ID))
else
print(sdm_printPrefix.."You cannot pick up macros during combat.")
end
end)
else
listItem:SetScript("OnDragStart", nil)
Expand Down
6 changes: 5 additions & 1 deletion SuperDuperMacro/sdm Readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Super Duper Macro
version 2.4.1
version 2.4.2
by hypehuman

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

Change Log

2.4.2 (11/30/11)
��Fixed a minor error that occurs when running SDM for the first time
��When attempting to pick up a macro during combat, you will get an error message created by SDM instead of Blizzard's "Interface action failed due to an addon".

2.4.1 (11/30/11)
��Updated for version 4.0 - you will lose any custom icons for your macros. Sorry!

Expand Down

0 comments on commit 2a12672

Please sign in to comment.