3.0.0 API更新日志
Contents
重大更新
- Blizzard UI正在转向更多的使用self和其他的局部参数而不是this和argN。旧的参数方式将被废弃,所以插件代码也需要更新。这可能意味着Blizzard UI函数的签名会产生变化——请更新那些hook或替换了Blizzard UI的代码!
快捷命令句柄SlashCommand现在也在信息前添加了一个self参数,这个self指的是该命令来自的文本输入框,这意味着所有的快捷命令句柄都必须更新以包含该参数的,否则会无法工作!
SecureStateHeader已经被新的安全模板取代,新的安全模板使用的是更基本和原始的lua判定原则而不是复杂的状态表。更多的细节即将放出!
设置和偏好选项
下面的函数已经被服务器端储存变量所取代:SetAutoLootDefault(), GetAutoLootDefault(), ShowNameplates(), HideNameplates(), ShowFriendNameplates(), HideFriendNameplates()
在服务器端保存选项的设置可以通过将"synchronizeSettings"变量设置为0来关闭。你也可以使用新的UploadSettings()和DownloadSettings()来手动管理同步设置。
宏
你现在可以使用下列函数来随时维护和还原你的宏的备份:BackupMacros(), RestoreMacros()。这些函数不能在战斗中被插件调用。
- 现在每个账户可以使用36个通用宏。
法术效果信息
之前各种各样的GetPlayerBuff函数已经被移除并合并到对应的单位函数中,新增了UnitAura函数,并对其他的部分做了升级:
name, rank, texture, count, debuffType, duration, timeLeft, untilCanceled = UnitAura("unit", [index] or ["name", "rank"][, "filter"]);
name, rank, texture, count, debuffType, duration, timeLeft, untilCanceled = UnitBuff("unit", [index] or ["name", "rank"][, "filter"]);
name, rank, texture, count, debuffType, duration, timeLeft, untilCanceled = UnitDebuff("unit", [index] or ["name", "rank"][, "filter"]);
CancelPlayerBuff([index] or ["name", "rank"][, "filter"]);
GameTooltip:SetUnitAura("unit", [index] or ["name", "rank"][, "filter"]);
GameTooltip:SetUnitBuff("unit", [index] or ["name", "rank"][, "filter"]);
GameTooltip:SetUnitDebuff("unit", [index] or ["name", "rank"][, "filter"]);
"filter"部分可以是"HELPFUL", "HARMFUL", "RAID", "CANCELABLE", "NOT_CANCELABLE"中的任意一个,你还可以通过 | 来区分以合并若干个过滤条件(例如"HELPFUL|RAID" == 你可以对团队成员施放的增益效果)。UnitAura默认带有"HELPFUL"作为限制过滤——你不能同时返回helpful和harmful类型的值。"HELPFUL"和"HARMFUL"都不意味着UnitBuff/UnitDebuff,并且都会被忽略。
- untilCanceled会在buff没有自身持续时间(例如潜行)的情况下返回true。


