# HG changeset patch # User syzler # Date 1302967420 0 # Node ID 2ae5f67e313a98f5107812f55ab17d26a9c0c486 # Parent b7966675a105394798ef4ecb0da5f6713195f792 Added support for matching any unit's mount via macro options (e.g. /pony [@mouseover] match). The "target" command is now deprecated in favour of the slightly more general "match" (although "target" will continue to work). diff -r b7966675a105 -r 2ae5f67e313a MyLilPony.lua --- a/MyLilPony.lua Sat Apr 16 14:47:47 2011 +0000 +++ b/MyLilPony.lua Sat Apr 16 15:23:40 2011 +0000 @@ -125,7 +125,7 @@ end function MyLilPony.SlashHandler(args) - local arg = SecureCmdOptionParse(args); + local arg, unit = SecureCmdOptionParse(args); if MyLilPony.StringMatchIgnoreCase(arg, "^auto$") then MyLilPony.AutoMount(); elseif MyLilPony.StringMatchIgnoreCase(arg, "^random$") @@ -146,10 +146,13 @@ or MyLilPony.StringMatchIgnoreCase(arg, "^swim$") or MyLilPony.StringMatchIgnoreCase(arg, "^s$") then MyLilPony.CallAquaticMount(); - elseif MyLilPony.StringMatchIgnoreCase(arg, "^target$") + elseif MyLilPony.StringMatchIgnoreCase(arg, "^match$") + or MyLilPony.StringMatchIgnoreCase(arg, "^m$") + or MyLilPony.StringMatchIgnoreCase(arg, "^target$") or MyLilPony.StringMatchIgnoreCase(arg, "^tgt$") or MyLilPony.StringMatchIgnoreCase(arg, "^t$") then - local result = MyLilPony.CallMountByMatch("target"); + if unit == "" or unit == nil then unit = "target" end + local result = MyLilPony.CallMountByMatch(unit); if not result then MyLilPony.Log("No matching mounts were found"); end @@ -190,7 +193,8 @@ MyLilPony.Print(" /mylilpony ground - Summons random ground mount"); MyLilPony.Print(" /mylilpony flying - Summons random flying mount"); MyLilPony.Print(" /mylilpony aquatic - Summons random aquatic mount"); - MyLilPony.Print(" /mylilpony target - Summons same mount as targeted unit"); + MyLilPony.Print(" /mylilpony match - Summons same mount as targeted unit"); + MyLilPony.Print(" /mylilpony [@] match - Summons same mount as specified unit"); MyLilPony.Print(" /mylilpony list - Lists mounts matching name"); MyLilPony.Print(" /mylilpony exact - Summons mount by exact name"); MyLilPony.Print(" /mylilpony - Summons mount by spell or creature ID"); diff -r b7966675a105 -r 2ae5f67e313a libMyLilPony/libMyLilPony_mountFunctions.lua --- a/libMyLilPony/libMyLilPony_mountFunctions.lua Sat Apr 16 14:47:47 2011 +0000 +++ b/libMyLilPony/libMyLilPony_mountFunctions.lua Sat Apr 16 15:23:40 2011 +0000 @@ -184,7 +184,7 @@ -- The function checks the buffs of the specified unit against the mount spellbook for matches. -- As a result, the function will only likely work against player characters. -- Does nothing if the specified unit's mount is already summoned. --- @param unit The unit frame name (e.g. "target", "player", "focus") of the unit whose mount is desired. +-- @param unit The UnitId (e.g. "target", "player", "focus", "party1", etc.) of the unit whose mount is desired. -- @return A Boolean value indicating whether or not a mount was successfully summoned. -- @usage MyLilPony.CallMountByMatch("target"); function MyLilPony.CallMountByMatch(unit)