Mercurial > wow > mylilpony
changeset 60:81145a681a59
Fixed for legion xpack (patch 7.0) API changes
author | syzler |
---|---|
date | Sat, 13 Aug 2016 15:29:39 -0400 |
parents | 12b9c632919d |
children | 714db439090f |
files | libMyLilPony/libMyLilPony_miscFunctions.lua libMyLilPony/libMyLilPony_mountData.lua libMyLilPony/libMyLilPony_mountFunctions.lua |
diffstat | 3 files changed, 27 insertions(+), 26 deletions(-) [+] |
line wrap: on
line diff
--- a/libMyLilPony/libMyLilPony_miscFunctions.lua Wed Jun 24 21:00:39 2015 -0400 +++ b/libMyLilPony/libMyLilPony_miscFunctions.lua Sat Aug 13 15:29:39 2016 -0400 @@ -79,7 +79,7 @@ -- @returns True if a mount was summoned, or False otherwise. function MyLilPony.CallMount(slotID, condition) if condition == nil or condition then - C_MountJournal.Summon(slotID); + C_MountJournal.SummonByID(slotID); return true; end return false; @@ -100,7 +100,7 @@ local x = 1; return function() for i = x, countMounts do - local _, _, _, _, _, _, _, _, _, hidden, known = C_MountJournal.GetMountInfo(i); + local _, _, _, _, _, _, _, _, _, hidden, known = C_MountJournal.GetMountInfoByID(i); if known and not hidden then x = i + 1; return i;
--- a/libMyLilPony/libMyLilPony_mountData.lua Wed Jun 24 21:00:39 2015 -0400 +++ b/libMyLilPony/libMyLilPony_mountData.lua Sat Aug 13 15:29:39 2016 -0400 @@ -163,7 +163,7 @@ -- @param slotID The slot ID of the mount to be checked. -- @return A Boolean value indicating whether or not the specified mount is a ground mount. function MyLilPony.IsGroundMountSlot(slotID) - local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID); + local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtraByID(slotID); return mountType == 230 or mountType == 284; end @@ -171,7 +171,7 @@ -- @param slotID The slot ID of the mount to be checked. -- @return A Boolean value indicating whether or not the specified mount is a flying mount. function MyLilPony.IsFlyingMountSlot(slotID) - local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID); + local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtraByID(slotID); return mountType ==247 or mountType == 248; end @@ -179,7 +179,7 @@ -- @param slotID The slot ID of the mount to be checked. -- @return A Boolean value indicating whether or not the specified mount is an aquatic mount. function MyLilPony.IsAquaticMountSlot(slotID) - local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID); + local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtraByID(slotID); return mountType == 231 or mountType == 254; end @@ -187,7 +187,7 @@ -- @param slotID The slot ID of the mount to be checked. -- @return A Boolean value indicating whether or not the specified mount is a Temple of Ahn'Qiraj mount. function MyLilPony.IsAhnQirajMountSlot(slotID) - local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID); + local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtraByID(slotID); return mountType == 241; end @@ -195,6 +195,6 @@ -- @param slotID The slot ID of the mount to be checked. -- @return A Boolean value indicating whether or not the specified mount is a Vashj'ir mount. function MyLilPony.IsVashjirMountSlot(slotID) - local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtra(slotID); + local _, _, _, _, mountType = C_MountJournal.GetMountInfoExtraByID(slotID); return mountType == 232 or mountType == 231 or mountType == 254; end
--- a/libMyLilPony/libMyLilPony_mountFunctions.lua Wed Jun 24 21:00:39 2015 -0400 +++ b/libMyLilPony/libMyLilPony_mountFunctions.lua Sat Aug 13 15:29:39 2016 -0400 @@ -42,7 +42,7 @@ -- @return A Boolean value indicating whether or not a mount was successfully summoned. function MyLilPony.CallMount() local filter = function (i) - local _, _, _, summoned, usable = C_MountJournal.GetMountInfo(i); + local _, _, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); return not summoned and usable; end return MyLilPony.CallMountByFilter(filter); @@ -53,7 +53,7 @@ -- @return A Boolean value indicating whether or not a mount was successfully summoned. function MyLilPony.CallFlyingMount() local filter = function (i) - local _, id, _, summoned, usable = C_MountJournal.GetMountInfo(i); + local _, id, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); return not summoned and usable and MyLilPony.IsFlyingMountSlot(i); end return MyLilPony.CallMountByFilter(filter); @@ -64,7 +64,7 @@ -- @return A Boolean value indicating whether or not a mount was successfully summoned. function MyLilPony.CallGroundMount() local filter = function (i) - local _, id, _, summoned, usable = C_MountJournal.GetMountInfo(i); + local _, id, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); return not summoned and usable and MyLilPony.IsGroundMountSlot(i); end return MyLilPony.CallMountByFilter(filter); @@ -75,7 +75,7 @@ -- @return A Boolean value indicating whether or not a mount was successfully summoned. function MyLilPony.CallAquaticMount() local filter = function (i) - local _, id, _, summoned, usable = C_MountJournal.GetMountInfo(i); + local _, id, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); return not summoned and usable and MyLilPony.IsAquaticMountSlot(i); end return MyLilPony.CallMountByFilter(filter); @@ -88,7 +88,7 @@ function MyLilPony.CallMountBySlot(slotNumber) local countMounts = C_MountJournal.GetNumMounts(); if slotNumber > 0 and slotNumber < countMounts+1 then - local _, _, _, summoned, usable = C_MountJournal.GetMountInfo(i); + local _, _, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); MyLilPony.CallMount(slotNumber, not summoned and usable); return true; end @@ -102,7 +102,7 @@ function MyLilPony.CallMountByName(mountName) local result = false; for i in MyLilPony.EnumerateKnownMountSlotIDs() do - local name, _, _, summoned, usable = C_MountJournal.GetMountInfo(i); + local name, _, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); if name == mountName then MyLilPony.CallMount(i, not summoned and usable); result = true; @@ -119,7 +119,7 @@ -- @return A Boolean value indicating whether or not a mount was successfully summoned. function MyLilPony.CallMountByPattern(mountNamePattern) local filter = function (i) - local name, _, _, summoned, usable = C_MountJournal.GetMountInfo(i); + local name, _, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); return not summoned and usable and MyLilPony.StringMatchIgnoreCase(name, mountNamePattern); end return MyLilPony.CallMountByFilter(filter); @@ -132,8 +132,8 @@ function MyLilPony.CallMountById(id) local result = false; for i in MyLilPony.EnumerateKnownMountSlotIDs() do - local _, spellId, _, summoned, usable = C_MountJournal.GetMountInfo(i); - local creatureId = C_MountJournal.GetMountInfoExtra(i); + local _, spellId, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); + local creatureId = C_MountJournal.GetMountInfoExtraByID(i); if id == creatureId or id == spellId then MyLilPony.CallMount(i, not summoned and usable); result = true; @@ -150,7 +150,7 @@ function MyLilPony.CallMountBySpell(spellId) local result = false; for i in MyLilPony.EnumerateKnownMountSlotIDs() do - local _, id, _, summoned, usable = C_MountJournal.GetMountInfo(i); + local _, id, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); if id == spellId then MyLilPony.CallMount(i, not summoned and usable); result = true; @@ -167,8 +167,8 @@ function MyLilPony.CallMountByCreature(creatureId) local result = false; for i in MyLilPony.EnumerateKnownMountSlotIDs() do - local _, _, _, summoned, usable = C_MountJournal.GetMountInfo(i); - local id = C_MountJournal.GetMountInfoExtra(i); + local _, _, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); + local id = C_MountJournal.GetMountInfoExtraByID(i); if id == creatureId then MyLilPony.CallMount(i, not summoned and usable); result = true; @@ -189,7 +189,7 @@ local result = false; local unitBuffs = MyLilPony.GetUnitBuffs(unit); for i in MyLilPony.EnumerateKnownMountSlotIDs() do - local _, id, _, summoned, usable = C_MountJournal.GetMountInfo(i); + local _, id, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); if unitBuffs[id] ~= nil then MyLilPony.CallMount(i, not summoned and usable); result = true; @@ -204,7 +204,7 @@ -- @param filter A filter callback function which takes a single mount slot number and returns a Boolean value indicating whether or not the the indicated mount should be included. -- @return A Boolean value indicating whether or not a mount was successfully summoned. -- @usage local filter = function (i) --- local name = C_MountJournal.GetMountInfo(i); +-- local name = C_MountJournal.GetMountInfoByID(i); -- return string.match(name, pattern); -- end -- MyLilPony.CallMountByFilter(filter); @@ -220,7 +220,7 @@ if x > 0 then local i = mounts[random(1, x)]; - local _, _, _, summoned, usable = C_MountJournal.GetMountInfo(i); + local _, _, _, summoned, usable = C_MountJournal.GetMountInfoByID(i); MyLilPony.CallMount(i, not summoned and usable); return true; end @@ -233,7 +233,7 @@ local results = {}; local x = 1; for i in MyLilPony.EnumerateKnownMountSlotIDs() do - local name = C_MountJournal.GetMountInfo(i); + local name = C_MountJournal.GetMountInfoByID(i); results[i] = name; x = x + 1; end @@ -246,7 +246,7 @@ local results = {}; local x = 1; for i in MyLilPony.EnumerateKnownMountSlotIDs() do - local name, id = C_MountJournal.GetMountInfo(i); + local name, id = C_MountJournal.GetMountInfoByID(i); if MyLilPony.IsGroundMount(id) then results[x] = name; x = x + 1; @@ -261,7 +261,7 @@ local results = {}; local x = 1; for i in MyLilPony.EnumerateKnownMountSlotIDs() do - local name, id = C_MountJournal.GetMountInfo(i); + local name, id = C_MountJournal.GetMountInfoByID(i); if MyLilPony.IsFlyingMount(id) then results[x] = name; x = x + 1; @@ -276,7 +276,7 @@ local results = {}; local x = 1; for i in MyLilPony.EnumerateKnownMountSlotIDs() do - local name, id = C_MountJournal.GetMountInfo(i); + local name, id = C_MountJournal.GetMountInfoByID(i); if MyLilPony.IsAquaticMount(id) then results[x] = name; x = x + 1; @@ -292,7 +292,7 @@ local results = {}; local x = 1; for i in MyLilPony.EnumerateKnownMountSlotIDs() do - local name = C_MountJournal.GetMountInfo(i); + local name = C_MountJournal.GetMountInfoByID(i); if MyLilPony.StringMatchIgnoreCase(name, mountNamePattern) then results[x] = name; x = x + 1;