Skip to content

Commit

Permalink
add MamaFollow button/macro that does both assist and follow
Browse files Browse the repository at this point in the history
  • Loading branch information
mooreatv committed Sep 2, 2022
1 parent 6afb336 commit ccfe9eb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ Coming next:
- Your input/suggestions welcome !
- See open issues for ideas https://github.com/mooreatv/Mama/issues)

v1.9.5 Sept 1st 2022
- Deal with the hardware event protection of "FollowUnit()" by Blizzard
by adding a new `/click MamaFollow` (will also assist) and keybindings

v1.9.4 July 24th 2022
- Fixed train (`/mama follow train` or keybind) to be in exact order, ie follow person ahead in team order

Expand Down
2 changes: 2 additions & 0 deletions Mama/Bindings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,6 @@
</Binding>
<Binding name="CLICK MamaAssist:LeftButton" category="MAMA">
</Binding>
<Binding name="CLICK MamaFollow:LeftButton" category="MAMA">
</Binding>
</Bindings>
2 changes: 1 addition & 1 deletion Mama/Mama-Mainline.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 90205
## Interface: 90207
## Title: M.A.M.A.
## Notes: |cFF99E5FFM|rooreaTv's/minimal yet |cFF99E5FFA|rwesome |cFF99E5FFM|rultiboxing |cFF99E5FFA|rssistant (|cFF99E5FF/mama|r)
## Notes: Shadowlands Eternity's End edition
Expand Down
16 changes: 12 additions & 4 deletions Mama/Mama.lua
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,8 @@ end

function MM:MakeMeLead()
MM:SetLead("player")
-- always (try to) set MAMA master
MM:SendSecureCommand(MM:LeadCommand(DB.fullName), false)
-- first check if we aren't already lead
if UnitIsGroupLeader("Player") then
MM:Debug("Already leader, skipping...")
Expand All @@ -311,7 +313,7 @@ function MM:MakeMeLead()
return
end
MM:PrintDefault("Mama: Requesting to be made lead")
MM:SendSecureCommand(MM:LeadCommand(DB.fullName), true) -- party only
-- MM:SendSecureCommand(MM:LeadCommand(DB.fullName), true) -- party only
MM:SetEMAMaster(DB.fullName)
end

Expand Down Expand Up @@ -578,25 +580,30 @@ local additionalEventHandlers = {
end
}

function MM:AssistButton()
function MM:MacroButtons()
local b = CreateFrame("Button", "MamaAssist", UIParent, "SecureActionButtonTemplate")
b:SetAttribute("type", "macro")
b:SetAttribute("macrotext", "/assist " .. MM:GetLead())
b = CreateFrame("Button", "MamaFollow", UIParent, "SecureActionButtonTemplate")
b:SetAttribute("type", "macro")
b:SetAttribute("macrotext", "/follow " .. MM:GetLead())
end

MM:AssistButton()
MM:MacroButtons()

function MM:UpdateAssist()
local l = MM:GetLead()
MM:Debug("Updating assist to %", l)
MM:Debug("Updating assist and follow to %", l)
if InCombatLockdown() then
MM:Debug("Can't update in combat")
return
end
if l == "player" then
_G["MamaAssist"]:SetAttribute("macrotext", "")
_G["MamaFollow"]:SetAttribute("macrotext", "")
else
_G["MamaAssist"]:SetAttribute("macrotext", "/assist " .. l)
_G["MamaFollow"]:SetAttribute("macrotext", "/assist " .. l.."\n/follow " .. l)
end
end

Expand Down Expand Up @@ -936,6 +943,7 @@ _G.BINDING_NAME_MM_FL_COMBO = L["Combo make me lead and follow me"] ..
_G.BINDING_NAME_MM_MOUNT_UP = L["Mount up"] .. " |cFF99E5FF/mama mount up|r (or |cFF99E5FF/mama m|r for short)"
_G.BINDING_NAME_MM_DISMOUNT = L["Dismount"] .. " |cFF99E5FF/mama mount dismount|r (or |cFF99E5FF/mama m d|r for short)"
_G["BINDING_NAME_CLICK MamaAssist:LeftButton"] = L["Assist"] .. " |cFF99E5FF/click MamaAssist|r " .. L["in macros"]
_G["BINDING_NAME_CLICK MamaFollow:LeftButton"] = L["Follow"] .. " |cFF99E5FF/click MamaFollow|r " .. L["in macros"]

-- MM.debug = 2
MM:Debug("mama main file loaded")

0 comments on commit ccfe9eb

Please sign in to comment.