changeset 19:2ae5f67e313a 1.1.0-b1

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).
author syzler
date Sat, 16 Apr 2011 15:23:40 +0000
parents b7966675a105
children d8a6f64b22a3
files MyLilPony.lua libMyLilPony/libMyLilPony_mountFunctions.lua
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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 [@<UNITID>] match - Summons same mount as specified unit");
         MyLilPony.Print("  /mylilpony list <NAME> - Lists mounts matching name");
         MyLilPony.Print("  /mylilpony exact <NAME> - Summons mount by exact name");
         MyLilPony.Print("  /mylilpony <ID> - Summons mount by spell or creature ID");
--- 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)