参考

函数参考

自定义条件回调

自定义条件由一组 Lua 函数体组成。每个函数体都会收到以下参数;addon 和 L 在所有函数体中均可使用。

evaluate(value, cache, evalStart)

判断此条件当前是否匹配。

valuetable此条件已保存的值。
cachetable本次评估周期的共享数据。
evalStartnumber评估开始时间,单位为秒,取自 GetTime()。
返回值boolean | niltrue 表示匹配;false 或 nil 表示不匹配。

valid(spec, value)

检查已保存的条件值是否完整且有效。

specnumber循环的专精范围。
valuetable此条件已保存的值。
返回值boolean条件可以被评估时为 true。

print(spec, value)

用易读的文字描述该条件。

specnumber循环的专精范围。
valuetable此条件已保存的值。
返回值string | RMConditionPhrase一个可读字符串,或来自 Functions.presentation.phrase 的临时具名短语。具名值保持原样;带类型的判断会选择肯定或否定措辞。旧版字符串格式仍受支持。

widget(parent, spec, value)

构建用于编辑此条件的控件。

parentRMConditionGroup由界面适配器提供的条件字段容器。
specnumber循环的专精范围。
valuetable此条件已保存的值。
返回值nil向提供的容器中添加控件。

help(frame)

构建此条件的帮助内容。

frameRMConditionGroup由界面适配器提供的帮助容器。
返回值nil向提供的容器中添加帮助内容。

on_register(tag)

在注册条件时初始化资源。

tagstring条件标识符。
返回值nil不使用返回值。

on_unregister(tag)

在条件被移除或替换时释放资源。

tagstring条件标识符。
返回值nil不使用返回值。

你的代码可以使用的值

addonRMAddonRotation Master 插件实例。公共辅助函数的文档见 Functions。
Ltable本地化的 Rotation Master 文本,以其英文键为索引。
addon.unitstable<string, string>受支持的单位标识到本地化单位名称的查找表。以 value.unit 作为键;例如 addon.units[value.unit]。可用的标识因客户端而异。
addon.unitsPossessivetable<string, string>受支持的单位标识到本地化所有格单位名称(例如“你的目标的”)的查找表。
addon.PlatformRMPlatformRotation Master 客户端兼容性适配器。其方法返回普通的可读结果;当观测不可用时返回 nil 及原因。请使用冒号调用,或在点号引用时显式将 addon.Platform 作为 self 传入。
addon.SpellCatalogRMSpellCatalogRotation Master 法术目录,用于解析因客户端而异的法术 ID、等级、名称、图标和链接。
functionstable<string, function>显式绑定到此条件或函数的工具函数。在插入其引用前,选择一个补全项以绑定可用的自定义函数。

自定义代码可用的 WoW API

内置辅助函数

游戏内“函数”标签页中列为内置的辅助函数。公共辅助函数直接按名称调用;其他辅助函数需绑定为依赖项(选择自动补全项,或在“依赖项”中添加),再按其完整限定名调用。

240 个辅助函数中的 240 个。

Conditions.bossmod.encounterNote 依赖项Builds the status line the boss-mod condition editors show about the current encounter.
Conditions.bossmod.idEditor 依赖项Builds a full-width edit box for an optional boss-mod ID (such as the encounter ID) and adds it to parent.
Conditions.bossmod.note 依赖项Adds a full-width text label to a boss-mod condition editor; used for the encounter and timer status lines.
Conditions.bossmod.timerNote 依赖项Builds the status line the boss-mod condition editors show about running boss-mod timers.
Conditions.bossmod.validCompare 依赖项Validation check for a boss-mod condition's comparison: true when value.operator is one of addon.operators and value.value is a finite number of zero or more.
Conditions.bossmod.validID 依赖项True when value is a positive whole number below 2^31, the accepted shape of a saved boss-mod encounter or spell ID.
Conditions.build.imbueObservation 依赖项Reads the temporary enchant ID on the main hand, or the off hand when value.offhand is set, for the WEAPON_IMBUE condition.
Conditions.build.setLabel 依赖项Formats an item set ID for the SET_PIECES description: the set name with its ID when addon:GetItemSetName knows it, otherwise "item set N".
Conditions.build.wholeNumber 依赖项True when value is a positive, finite whole number; SET_PIECES uses it to validate the saved item set ID.
Conditions.common.Widget_GetSpellId 公共解析条件中存储的法术标识符。启用精确等级时会保留所提供的 ID;否则在有等级的经典版客户端上,会通过法术目录解析当前已知的等级。无法完成解析时返回 nil 和可用性原因。
Conditions.common.Widget_SpellWidget 公共为自定义条件控件创建一个带有建议、验证和法术链接支持的法术输入框。更新回调负责保存所选的值;将返回的控件添加到回调的父级。
Conditions.common.Widget_UnitWidget 公共创建一个绑定到条件值记录的已配置单位选择器。返回该控件,由调用方将其添加到条件回调的父级。
Conditions.edition_state.eclipseMeasures 依赖项Lists the two measures of the Eclipse condition with their editor labels.
Conditions.edition_state.validCompare 依赖项Checks that a condition value carries a known comparison operator and a finite, non-negative number to compare against.
Conditions.encounter_state.validCompare 依赖项Checks that a condition value carries a known comparison operator and a finite, non-negative number to compare against.
Conditions.encounter_state.validNumber 依赖项Checks that a value is a finite number of zero or more (not NaN, not infinite).
Conditions.engraving.identifier 依赖项True when value is a positive whole number below 2^31; RUNE_ENGRAVED uses it to validate a saved rune ID.
Conditions.engraving.runeLabel 依赖项Names the rune selected in a RUNE_ENGRAVED condition: the known rune's name when the platform finds it, else the rune spell's name, else "rune spell N" or "rune N".
Conditions.equipment.matches 依赖项Tests one equipment slot record against a WEAPON_TYPE condition: empty slot, shield, any weapon, holdable, one-hand, two-hand, ranged, or a specific weapon subclass.
Conditions.equipment.subclassID 依赖项True when value is a whole number from 0 to 31, the range of weapon subclass IDs WEAPON_TYPE accepts.
Conditions.equipment.subclassName 依赖项Names a weapon subclass for WEAPON_TYPE descriptions, using the client's GetItemSubClassInfo when it returns a readable name, else the addon's built-in name, else "weapon type N".
Conditions.group_state.measureNames 依赖项Lists what the Group Count condition can count, with the editor label of each.
Conditions.group_state.validCompare 依赖项Checks that a Group Count value carries a known operator and a finite, non-negative number, which is at most 100 when the count is a percent of the group.
Conditions.hero_talent.listedSpec 依赖项Returns the specialization ID when it is one of the player's own class's specializations, which are the only ones whose hero talent trees the game can list.
Conditions.hero_talent.treeName 依赖项Names a hero talent tree: the game's own name for it when Platform:GetHeroTreeName can read one, else "hero talent tree" followed by the ID.
Conditions.hero_talent.validTree 依赖项Checks that a value can be a hero talent tree ID: a positive whole number below 2^31.
Conditions.item.get_item_desc 依赖项Describes an item reference for the item condition descriptions: an item set name (white for a profile set, cyan for a global one), or the first item's link or name followed by how many others are listed.
Conditions.item.itemHelp 依赖项Adds the item condition editors' help text to frame: the shared item widget help, a gap, and a note on how item sets, bag counts and restricted observations are evaluated.
Conditions.known_spell.validID 依赖项True when value is a positive, finite whole number; SPELL_KNOWN uses it to validate the saved spell ID.
Conditions.misc.difficultyKind 依赖项Names the kind of group a difficulty is for, from the group GetDifficultyInfo reports.
Conditions.misc.difficultyName 依赖项The display name of an instance difficulty ID: the game's name for it (GetDifficultyInfo) with the kind of group in parentheses when the game gives one.
Conditions.misc.validWhole 依赖项Checks that a value can be a difficulty or instance ID: a whole number from 0 up to 2^31.
Conditions.player_state.stateNames 依赖项Lists the states the Player State condition offers, with the editor label of each.
Conditions.player_state.statePhrase 依赖项The readable sentence for one Player State, such as "you are mounted", worded so a Not flips it to "you are not mounted".
Conditions.raid_marks.markListText 依赖项Formats a valid list of markers in priority order.
Conditions.raid_marks.markName 依赖项Returns the game's localized name for a raid marker, falling back to its English name.
Conditions.raid_marks.modeNames 依赖项Returns the localized labels for the any, none and selected-mark modes.
Conditions.raid_marks.validMark 依赖项Checks a saved marker mode or a comma-separated list of distinct marker names.
Conditions.spatial_stats.aggregate 依赖项Reduces the per-unit readings a PROXIMITY_* condition collected to one statistic: their average, minimum or maximum.
Conditions.spatial_stats.observation 依赖项Reads one health or mana number for a PROXIMITY_* condition through the evaluation cache, protected against errors.
Conditions.spatial_stats.statistic 依赖项Reads one unit's health or mana for the PROXIMITY_* conditions as an absolute value, a percentage of the maximum, or the deficit below the maximum.
Conditions.spatial.booleanRead 依赖项Calls a yes/no game API through the evaluation cache, protected against errors, for the distance conditions.
Conditions.spatial.combatFilter 依赖项Applies the In Combat option of Distance Count to one unit: with the option off every unit passes, with it on the unit must be in combat (UnitAffectingCombat).
Conditions.spatial.finite 依赖项True when value is a number that is neither NaN nor infinite.
Conditions.spatial.nameplateDistanceCount 依赖项Counts units for DISTANCE_COUNT from a nameplate unit snapshot: units that exist, whose hostility matches value.enemy, and that are definitely within value.distance yards.
Conditions.spatial.protectedRead 依赖项来自 Conditions/spatial.lua 的内置辅助函数。
Conditions.spatial.rangeMember 依赖项Decides whether unit is within distance yards from the platform's cached range-check bounds: true when the maximum bound is at or inside distance, false when the minimum bound is beyond it (or equals a nonzero distance), otherwise unavailable.
Conditions.spatial.rcf 依赖项Returns the LibRangeCheck-3.0 range estimate for a unit as minimum and maximum yards.
Conditions.specialization.classChoices 依赖项Builds the specialization choices for one class in the SPECIALIZATION editor.
Conditions.specialization.playerClass 依赖项Returns the player's class file token (such as "MAGE") from UnitClass, or nil when the call fails or the value is restricted.
Conditions.specialization.specClass 依赖项Looks up which class a specialization ID belongs to, from the built-in specialization table or else the platform's specialization display data.
Conditions.specialization.specID 依赖项True when value is a positive, finite whole number, the accepted shape of a saved specialization ID.
Conditions.specialization.specName 依赖项Names a specialization for SPECIALIZATION descriptions: the platform's display name and icon, else the built-in localized name, else "specialization N".
Conditions.talent.block 依赖项Adds a full-width group laid out as icon rows (the icon on the left, the picker rows beside it) to a condition widget.
Conditions.talent.classSpecs 依赖项Lists the specializations of the player's class for the Talent condition's Specialization picker, so a rotation can pick the talents of a specialization other than the one being played.
Conditions.talent.dropdown 依赖项Creates a full-width condition dropdown labeled title for the talent condition editors, forwards each selection to changed, and adds it to parent.
Conditions.talent.gridWidget 依赖项Builds the TALENT editor controls for the tier-and-column grid talent layout: a talent icon and a dropdown of the client's grid talents (up to 18).
Conditions.talent.group 依赖项Returns the talent group to query for spec: spec itself on progression clients when it is a whole number from 1 to 4, otherwise nil so the platform uses its default group.
Conditions.talent.groupLabel 依赖项The heading above one group of talents in the Retail and Forever talent list: class talents, specialization talents, both, one hero tree, or a plain name.
Conditions.talent.icon 依赖项Creates the 44-pixel talent icon for the TALENT editors, showing the referenced talent's icon and, on hover, its spell tooltip (or its name), and adds it to parent.
Conditions.talent.info 依赖项Looks up the talent a TALENT condition refers to, according to its layout: a trait node and entry, a grid index, or a tree and talent index.
Conditions.talent.integer 依赖项True when value is a whole number between minimum and maximum, inclusive.
Conditions.talent.legacySlot 依赖项True when a TALENT condition still uses the historical single-number layout: no layout, tree or talent field, and value.value a whole number from 1 to 21.
Conditions.talent.ownTrees 依赖项Whether the talent trees shown are the player's own class's, so the game can name them, rather than another class's trees from the addon's shipped list.
Conditions.talent.text 依赖项Adds a full-width explanatory label to a talent condition editor.
Conditions.talent.traitFamily 依赖项True when the client uses trait talents, that is the retail or forever client families.
Conditions.talent.traitShape 依赖项True when value.layout is "traits", meaning the TALENT condition names a trait node.
Conditions.talent.traitsWidget 依赖项Builds the TALENT editor controls for trait talents: a talent tree dropdown when there are several, a talent dropdown, Talent Node ID and Choice Entry ID edit boxes, and a Rank comparison.
Conditions.talent.treeExists 依赖项Checks that a talent condition's tree index exists on this client, using the cached platform talent tree count.
Conditions.talent.treeName 依赖项Names the talent tree in a talent tree condition's description: the client's tree name, else "Talent tree N", else "<talent tree>" when no tree is set.
Conditions.talent.treePicker 依赖项Builds the Talent tree dropdown for the TALENT_TREE_POINTS and PRIMARY_TALENT_TREE editors, listing the client's talent trees, storing the selection in value.tree and calling update.
Conditions.talent.treeShape 依赖项True when a TALENT condition uses the tree layout (layout nil or "tree") with both tree and talent set.
Conditions.talent.treeWidget 依赖项Builds the TALENT editor controls for Classic talent trees: a tree dropdown, a talent icon, a talent dropdown for the chosen tree, and a Points comparison.
Conditions.totem.amount 依赖项True when a totem condition's comparison is usable: value.value is a nonnegative finite number and value.operator is one of addon.operators.
Conditions.totem.element 依赖项True when value.spell is a valid spell ID of 4 or less, meaning the condition names a totem element slot rather than a totem spell.
Conditions.totem.findSpecific 依赖项Searches the totem slots for an active totem matching value.spell, by spell ID or name (only the exact spell ID when value.ranked is set).
Conditions.totem.observe 依赖项Calls a totem platform method through the evaluation cache, passing the platform as its self argument.
Conditions.totem.remaining 依赖项Seconds left on a totem slot record at time start (or now): zero when the totem is inactive, and never negative.
Conditions.totem.specific 依赖项True when a totem spell condition names a valid spell ID and value.ranked is nil or a boolean.
Conditions.weapon.enchantObservation 依赖项Reads whether the main hand, or the off hand when value.offhand is set, has a temporary weapon enchant for the weapon conditions, with its expiration and charges.
Conditions.weapon.numericObservation 依赖项Accepts a readable, nonnegative, finite number from a weapon observation and returns it unchanged; anything else becomes nil with a reason.
Conditions.weapon.swingSpeed 依赖项Reads the player's main-hand, or off-hand when value.offhand is set, attack speed from the cached UnitAttackSpeed for the swing timer conditions.
Core.class_group_conditions.GetClassGroupCount 公共统计当前固定名单中匹配的职业标识。先读取队伍成员身份;在要求时,团队成员身份会选择 raid1 到 raid40,而不单独读取玩家信息。单人和小队路径会先读取 player,组队时再读取 party1 到 party4。完整且已知的名单会返回计数(包括零);任何所需信息不可用时返回 nil 及原因。完整的观测共享评估轮次缓存;玩家职业不会跨轮次保留。已归档的原始回调会单独保留其原有的加载时职业。
Core.creature_conditions.configuredID 依赖项Maps a stored CREATURE condition key to its numeric creature type, from BEAST (1) to GAS_CLUUD (13).
Core.creature_conditions.GetConditionCreatureTypeMatch 公共将所选单位的生物 ID 与一个现有的已保存生物类型键进行比较。在一个私有的可执行映射器中解析固定的键到 ID 的对应;游戏中的匹配不依赖可变的本地化界面标题映射。在所提供的评估轮次缓存中,按实际的观测者、接收者和单位共享完整的原生观测,包括不存在和不可用的原因。已知不存在或已知 ID 不同时返回 false;所需观测不可用时返回 nil 及原因。不会添加长期状态或修改标题。
Core.health_forecast_conditions.finite 依赖项Checks that a health-forecast number is readable and finite.
Core.health_forecast_conditions.GetConditionHealthForecast 公共估算距离达到所选生命值的时间。每个评估轮次缓存完整的原生身份和惰性标量观测,而提供者、历史、窗口、时钟和预测保持实时。目标完全相等时,会在处理历史之前返回零。对于零速率或反向速率,保留刻意设计的“无估算”false 结果和初始化的零结果;所需信息无效、溢出或 4096 单位工作量耗尽时为不可用。绝不修改历史或编造部分估算。
Core.health_forecast_conditions.nativeValue 依赖项Reads a unit's current or maximum health through the platform's health-forecast observer and the evaluation cache, rejecting restricted, missing, nonfinite or negative values.
Core.health_forecast_conditions.readField 依赖项Reads object[key] for the health-forecast conditions without letting a restricted value, a non-table object or an index error escape.
Core.level_conditions.GetConditionUnitLevel 公共为条件评估解析可读的原始单位等级。已知不存在时返回 false;观测不可用时返回 nil 及原因。在所提供的评估轮次内缓存观测。只有有效的玩家等级会在轮次之间保留,直到技能、配置文件或等级刷新。
Core.point_conditions.editionPointResource 依赖项Selects the point resource for era and progression clients from the addon's per-edition map (combo points, Holy Power, Soul Shards, Chi, Shadow Orbs and similar).
Core.point_conditions.GetConditionPointResource 公共使用实时的职业到资源映射和 ComboPoints 后备,解析所选单位的点数资源选择器。已知不存在时返回 false;所需的身份或选择器数据不可用时返回 nil 及原因。在评估轮次内共享完整的身份观测。只有成功的玩家职业观测会保留在当前的长期缓存中,并与原生 UnitClass 身份绑定;存在性在每个轮次都会刷新。这只选择资源,不读取其当前值或最大值。
Core.point_conditions.GetConditionPointResourceV2 公共使用原有的实时职业映射和身份缓存解析点数资源,并采用显式的 TBC 玩家 ComboPoints 后备传输策略。若玩家后备与模块加载时捕获的可读原始 Enum.PowerType 表和 ComboPoints 值相符,则选择 target-combo;显式的职业映射条目、其他角色和其他客户端系列保留 power。被替换、继承或无法证明来源的后备保留 power。此带版本的策略并不声称原生 UnitPower 有问题或与之等效。已知单位不存在时返回 false;所需观测不可用时返回 nil 及原因。此处不查询当前值或最大值。
Core.point_conditions.pointIdentity 依赖项Observes whether unit exists and, if so, its class, for the point-resource selectors.
Core.threat_count_conditions.finite 依赖项Checks that a threat-count number is readable and finite.
Core.threat_count_conditions.GetConditionThreatCount 公共只统计已在观测成员快照中、以 GUID 为键的单位。在使用已发布的仇恨观测器之前,会先验证当前标识的身份;已知不存在或被重复使用的标识会被排除,且不会添加替代者。完整的身份和仇恨观测只共享所提供的评估缓存,而成员身份会重新遍历。已知的非敌人或可选的 nil 仇恨不计入;所需信息无法读取、格式错误或失败时,整个结果为不可用。这不会枚举完整的名单、应用距离筛选或修改被追踪的记录。
Core.threat_count_conditions.readField 依赖项Reads object[key] for the threat-count conditions without letting a restricted value, a non-table object or an index error escape.
Functions.cache.getCached 公共对每个缓存和完全相同的参数元组只调用一次观测,包括 nil 结果。传入评估缓存可在一个推荐周期内共享观测;缓存为 nil 时直接调用。
Functions.cache.getRetryCached 公共在观测返回非 nil 值后将其缓存;对整个返回元组都为 nil 的观测会重试。使用与 getCached 完全相同的参数键。
Functions.collections.cleanArray 公共原地移除条目,默认只保留 except 值中列出的键。invert 为 true 时,移除列出的键并保留未列出的键。没有例外列表时,默认会移除所有条目,而 invert 为 true 时会保留所有条目。输入为 nil 时不执行任何操作。
Functions.collections.compareArray 公共遍历两个表中的条目,并使用 Lua 相等比较将每个值与另一个表中相应索引的值进行比较。普通的索引和相等元方法都会生效;嵌套内容不会被递归比较。
Functions.collections.deepcopy 公共尽管历史上名为 deepcopy,它创建的是一个经过筛选的浅拷贝。嵌套的值保留其原始身份,且不会复制源表的元表。默认排除 except 值中列出的键;invert 为 true 时只包含列出的键。输入为 nil 时返回 nil。
Functions.collections.index 公共在 pairs 遍历过程中返回第一个值等于所提供值的键。输入表为 nil 或 false 以及值不存在时返回 nil。有多个匹配的键时,选择顺序不确定。
Functions.collections.keys 公共收集表的键,并使用 Lua 的小于比较按其对应的值排序。这是按值排序而不是按键名排序;值相等时键的顺序不确定。
Functions.collections.multiinsert 公共将 ipairs 遍历到的每个值插入到目标数组中对应的开头索引处。现有条目会移到插入的前缀之后;遍历在第一个缺失的源索引处停止。
Functions.collections.spairs 公共创建一个遍历表键排序快照的迭代器。默认按键排序;自定义排序回调会收到原始表和两个键。每次产出一个键时,值从原始表中读取。当下一个捕获的键为 nil 或 false 时,旧版迭代器结束。
Functions.collections.tablelength 公共统计 pairs 遍历到的所有条目,包括 false 值以及稀疏的数字键或非数字键。nil 表的长度为零。
Functions.collections.tomap 公共复制一个表,以每个原始键的 tostring 结果作为目标键。值保留其原始身份。字符串化后相互冲突的键会按未指定的 pairs 遍历顺序相互覆盖。
Functions.forecast.calculate 公共使用显式的有限时间窗口和时钟,计算经过检查的生命值历史速率。保留有序加权、逐行实时规范舍入、被跳过的数据流、数组空洞、小数键以及最终访问时的时长。固定的 4096 单位预算涵盖两个数据流中被访问的行和累加区间;超出预算或无效的已消耗运算会返回不可用,绝不返回部分估算或截断值。这个新 API 有其自己的源码身份;历史趋势函数保持不变。
Functions.forecast.finite 依赖项Checks that a number used by Functions.forecast.calculate is readable and finite.
Functions.forecast.readField 依赖项Reads object[key] for Functions.forecast.calculate without letting a restricted value, a non-table object or an index error escape.
Functions.presentation.compareString 公共当运算符有否定形式时,使用命名布尔备选项格式化比较措辞。primary 标记会将肯定形式标为主要措辞。肯定运算符标签使用捕获的运算符映射;否定标签和可空分派保留其实时的插件 API。
Functions.presentation.nullable 公共原样返回存在的值;为 nil 时返回红色的显示占位符。用于可读的条件标签,而不是作为布尔值的后备。
Functions.presentation.nullable_value 公共查找表中的键用于显示,保留非 nil 的结果;无效的表、缺失的键和 nil 键会使用可空占位文本。
Functions.presentation.phrase 公共创建一个临时的具名条件摘要。标量值使用 {name},判断的正反两种措辞使用 {{positive|negative}};在主要措辞前加上 !
Functions.presentation.playerize 公共仅当单位标识为字面上的 player 时才选择所提供的玩家值;其他所有单位都会选择非玩家值。选中的 false 和 nil 值会被保留。
Functions.presentation.predicate 公共为具名条件短语创建一个带类型的比较判断。肯定措辞使用原先捕获的运算符映射,否定措辞使用当前取反后的运算符映射。主要判断优先于限定词;只有第一个符合条件的判断会被取反。未知运算符使用现有的运算符占位符。这只格式化措辞,不比较值也不评估条件。
Functions.text.ends_with 公共使用 Lua 字符串切片测试字面的字节后缀。空后缀视为匹配;模式字符没有特殊含义,并区分大小写。
Functions.text.split 公共将字符串拆分为分隔字符之间的非空片段。分隔符会被插入到 Lua 模式的字符类中;它不是字面意义上的多字符分隔符。空字段会被省略。
Functions.text.starts_with 公共使用 Lua 字符串切片测试字面的字节前缀。空前缀视为匹配;模式字符没有特殊含义,并区分大小写。
Functions.text.trim 公共移除字符串开头和结尾符合 Lua 模式的空白字符。
Functions.text.wrap 公共在接近目标列数的空白边界处对文本换行。长单词会保持完整。
Functions.trends.calculate 公共根据加权的伤害和治疗历史估算带符号的生命值变化。伤害贡献负速率,治疗贡献正速率。未提供窗口时读取实时配置文件中的窗口,使用实时时钟和旧版舍入服务,并保留现有的加权和舍入后时长计算。此辅助函数不会验证或清理历史,不会截断时间戳,也不保证结果有限。
Functions.trends.calculateOld 公共使用实时配置文件的历史窗口、时钟和旧版舍入服务,运行历史生命值快照的趋势公式。保留其最大生命值的过渡、在满血或零血时提前停止、加权、错误和返回值数量。空数组或未记录任何加权变化的快照只返回零,而不是 0/0 的结果;这是旧版算法,而不是经过验证的预测。
Functions.values.compare 公共使用 RM 运算符标识符比较两个值:LESSTHAN、LESSTHANOREQUALS、GREATERTHAN、GREATERTHANOREQUALS、EQUALS、NOTEQUALS 或 DIVISIBLE。无效的运算符会发出警告并返回 nil;操作数必须支持所选的 Lua 运算。
Functions.values.isin 公共检查表中某个键是否有非 nil 的值。存储的 false 值仍算作存在;这不会扫描表中的值。
Functions.values.isint 公共执行旧版的整数或规范数字字符串拼写测试。数字使用向下取整后的相等比较;字符串必须等于经数字转换并向下取整后得到的拼写。其他类型返回 false。这不是有限数字的验证器。
Functions.values.round 公共使用现有的 floor(num * 10^places + 0.5) / 10^places 公式进行舍入。places 默认为零,可以为负。处于一半的负值会向正无穷方向舍入;不会添加有限数字验证或其他舍入策略。
Platform.actions.call 依赖项Calls a native API function in protected mode and returns its first result only when Rotation Master can read it.
Platform.actions.findSlot 依赖项Finds the spell-book slot of a spell with FindSpellBookSlotBySpellID.
Platform.actions.GetSpellRangeState 公共使用适当的客户端 API 或法术书栏位,读取某个单位针对特定法术的距离。没有距离限制的法术返回 applicable=false;否则 applicable=true,inRange 记录该单位是否在距离内。未知或无法访问的观测会返回 nil 及原因。
Platform.actions.spellID 依赖项Validates a spell ID argument.
Platform.announcement_recipient.GetAnnouncementRecipientGroupMembership 公共将确切的施法对象名称与当前有限的小队或团队名单进行匹配,然后通过单位标识观测其成员身份。名单数据缺失、含义不明确或正在变化时保持为不可用;绝不读取所选目标,也不在施法之间保留状态。
Platform.casting.durationSeconds 依赖项Computes the total length of a cast or channel in seconds from the millisecond start and end times in a UnitCastingInfo or UnitChannelInfo result.
Platform.casting.finite 依赖项Returns true when value is a number that is neither NaN nor infinite, and false for anything else.
Platform.casting.GetUnitCastObservation 公共在探测或受限策略客户端上观测单位的施法或引导。已知不存在的单位或可读的非活动结果返回 active=false。活动记录包含 name,或在名称为机密时包含 nameReason(单位仍在施法),以及可独立获取的 remainingSeconds、durationSeconds、interruptible 和 spellID 字段;可选字段不可用时附带 remainingReason、durationReason、interruptibleReason 或 spellReason。存在性观测缺失、失败或受限时返回 nil 及原因。
Platform.casting.interruptibility 依赖项Converts the native notInterruptible flag of a cast or channel into an interruptible Boolean (its inverse).
Platform.casting.remainingSeconds 依赖项Converts the millisecond end time of a cast or channel into the seconds left, measured against a fresh GetTime() and clamped at zero.
Platform.casting.spellIdentity 依赖项Validates the spell ID field of a cast or channel result.
Platform.creature_type.GetUnitCreatureTypeID 公共在探测或受限策略客户端上,从原生 UnitCreatureType 的第二个返回值观测生物身份。先检查确切的 UnitExists(unit);可读的 false 会直接返回 false,不需要也不调用生物元数据。存在的单位要求可读的有限数字 ID;未使用的本地化名称不影响可用性。带符号、小数、零以及未来的有限 ID 都会作为已知值保留。所需信息缺失、失败、为 nil、受限或格式错误时返回 nil 及原因。不会添加生物枚举、翻译标题比较或长期缓存。
Platform.form.GetPlayerFormObservation 公共使用一次受保护的无参数 GetShapeshiftForm 调用观测玩家当前的形态。保留每个可读的有限数字结果,包括零、带符号和小数值;不会推断更严格的原生索引范围。缺失、失败、为 nil、受限或非有限的数据保持为不可用。不会添加形态数量、职业、法术 ID、单位或可选参数。
Platform.glyphs.GetGlyphItemInfo 公共使用受保护的原生物品元数据,将一个数字物品归类为所请求职业的雕文。职业是可选的,默认为可读取的玩家职业。这只确定物品分类,不确定装备状态,也不提供物品到雕文法术 ID 的映射。
Platform.glyphs.GetGlyphSocketSnapshot 公共在已验证的巫妖王之怒、大地的裂变和熊猫人之谜客户端布局上观测雕文插槽。返回 slots 和 complete 标记。每个插槽在已知锁定或为空时为 active=false,被占用时为 active=true 并附带 spellID,不可用时 active 为 nil 并附带原因。未知布局和失败的数量查询会返回 nil 及原因。这不会比较物品名称,也不能证明物品与法术身份的确切对应。
Platform.glyphs.integer 依赖项Returns true when value is a finite whole number no smaller than minimum, and false for anything else (including NaN and infinity).
Platform.glyphs.layout 依赖项Maps client information to the position in the GetGlyphSocketInfo result that holds the glyph spell ID.
Platform.glyphs.socket 依赖项Reads one glyph socket by calling fn(index) in protected mode and always returns a slot record with slot=index.
Platform.groups.GetGroupMembership 公共在已识别的客户端系列上读取公开的队伍成员身份。未知客户端不受支持。raidOnly 为 true 时检查 IsInRaid;为 false 或 nil 时使用原生默认的队伍类别检查 IsInGroup。可读的 false 结果保持为 false。缺失、失败、格式错误或受限的观测会返回 nil 及原因。
Platform.groups.GetUnitGroupMembership 公共读取指定单位是否属于玩家的小队或团队。raidOnly 为 true 时只查询 UnitInRaid;否则 UnitInParty 结果为 true 时直接返回,为 false 时继续查询 UnitInRaid,未知时保持为不可用。可读的 nil 团队索引表示 false;整数团队索引 1..40 表示 true。名称会原样传给原生 API;原生 API 是否接受名称查询需视客户端而定。
Platform.health_forecast.finite 依赖项Returns true when value is a number that is neither NaN nor infinite, and false for anything else.
Platform.health_forecast.GetHealthForecastIdentityObservation 公共在探测或受限策略客户端上观测确切的 UnitExists(unit),然后仅对存在的单位观测 UnitGUID(unit)。已知不存在时为 false。存在的身份要求可读的非空 GUID;所需信息缺失、失败、格式错误或受限时为不可用。不会添加生命值、提供者或额外单位的观测。
Platform.health_forecast.GetHealthForecastProviderObservation 公共使用确切的单参数点号调用读取可选的 RealMobHealth。命名空间不存在(nil/false)时返回空记录。分别规范化当前值和最大值:nil/false 字段允许回退到原生值,数字零仍视为存在。所使用的提供者信息格式错误、失败、受限、为负或非有限时为不可用。不使用提供者或过期的后备缓存。
Platform.health_forecast.GetHealthForecastTimeObservation 公共为所需的生命值预测重新观测一次受保护的无参数 GetTime。要求结果可读且为有限数字;保留带符号和小数值,不额外加入单调、整数或非负的限制。不使用时钟缓存或额外的原生查询。
Platform.health_forecast.GetHealthForecastValueObservation 公共在单独的身份检查之后读取惰性的生命值标量。current 种类使用确切的 UnitHealth(unit);maximum 使用确切的 UnitHealthMax(unit)。探测或受限策略客户端接受可读的有限非负数字(包括零)。不会重复调用存在性/GUID 查询,也不会回退到其他元组。
Platform.health_forecast.providerValue 依赖项Normalizes one health figure returned by the RealMobHealth provider.
Platform.health_forecast.readField 依赖项Reads object[key] in protected mode.
Platform.instance.GetInstanceObservation 公共观测一个受保护的无参数 IsInInstance 元组。所需的可读布尔成员值与类型字段无关:已知在副本外时直接返回,不解释未使用的类型;在副本内时返回可读的字符串类型,或在该次要字段不可用时返回 instanceTypeReason。检测是否在副本外的调用方只需要成员值;在副本内比较类型时必须检查次要原因。不会添加户外、区域或单位推断。
Platform.items.finite 依赖项Returns true when value is a finite, nonnegative number (not NaN or infinity), and false for anything else.
Platform.items.GetItemInfoInstant 公共读取规范化的原生物品分类元数据。记录包含规范的 itemID、classID 和 subClassID,以及在可读且非空时的 equipLoc(未本地化的 INVTYPE_* 装备位置标记);不要求物品显示文本已加载。元数据缺失、失败、格式错误或受限时返回 nil 及原因。
Platform.items.identifier 依赖项Validates an item argument.
Platform.loss_of_control.GetLossOfControlCount 公共使用受保护的无参数点号调用,读取有文档的活跃失控数量。要求结果可读且为有限的非负整数。零表示一次完整的空扫描,不需要行 API。RM 将扫描限制为 256 行,超出该资源预算时返回不可用;这并不是原生声明的最大值。所需观测缺失、失败、受限或格式错误时保持为不可用。
Platform.loss_of_control.GetLossOfControlEvent 公共按原生索引和所请求的主题种类,读取一条有文档的活跃失控记录行。type 查询只需要可读的控制类型字符串;school 查询只需要可读的有限非负整数法术类型掩码。可选的计时以有限的 timeRemaining 或逐字段的显式原因返回,因此不相关的主题不需要可用的计时器。缺失的行是不可用的快照观测。不会使用显示字段、推断的截止时间、持续时间总和、最大值或原生别名回退。
Platform.mobinfo2.finite 依赖项Checks that a value is a readable finite number.
Platform.mobinfo2.GetMobInfo2Observation 公共在探测或受限策略客户端上读取可选的 MobInfo2 历史观测。只缓存确切的所选单位存在性;UnitName 的第一个结果、UnitLevel 的第一个结果以及三参数的 MI2_GetMobData(name,level,unit) 点号调用每次都会重新获取。已知不存在的单位,以及成功返回的未记录的 nil 或省略的历史,与不可用的原生/提供者信息保持区分。保留可读的 runner 标量真值、法术类型符号以及缺少 Hits 时默认为一。正的抗性比例必须有限;完全免疫会使用有限的 Hits,而部分免疫只需要其负值的法术类型观测。绝不推断原生抗性或借用旧记录。
Platform.mobinfo2.hitCount 依赖项Reads the hit count for a spell school from a MobInfo2 resists table (the field named school.."Hits").
Platform.mobinfo2.presence 依赖项Checks whether a unit exists with one protected UnitExists call.
Platform.mobinfo2.readField 依赖项Reads object[key] in protected mode for MobInfo2 data.
Platform.pet.GetPetObservation 公共观测宠物是否确切存在,并可选地观测其经 GetUnitName 格式化的显示名称。仅查询存在性时从不需要名称数据。已知不存在时会跳过名称查询。仅在请求时,存在的宠物才需要可读的非空名称;所需观测缺失、失败、为 nil、受限或格式错误时返回 nil 及原因。显示辅助函数只以原有的单个宠物参数调用,不回退到 UnitName,也不推断动作条、生命值或技能状态。
Platform.player_flags.GetPlayerFlagObservation 公共观测一个独立的无参数玩家标记:stealthed 使用 IsStealthed,control 使用 HasFullControl,outdoors 使用 IsOutdoors。可读的 true 和 false 保留其含义。所需数据缺失、失败、为 nil、受限或格式错误时返回 nil 及原因。不会添加存在性、副本或技能可用性的推断。
Platform.player_movement.GetPlayerMovementObservation 公共在受支持且可读的客户端上观测玩家当前的移动速度。这只针对 player 查询 GetUnitSpeed,不检测其他单位,也不重定向载具所有权。零表示静止;正的有限小数速度仍然有效。缺失、失败、受限或格式错误的观测会返回 nil 及原因。
Platform.points.GetPlayerComboPointObservation 公共观测显式选择的 TBC 玩家连击点传输方式。current 只使用 GetComboPoints(player,target);maximum 使用带原始选择器的 UnitPowerMax(player,powerType)。其他客户端系列在此不可用,必须使用其现有的点数能量观测器。保留可读的有限带符号、小数和零值。缺失、失败、受限或格式错误的数据保持为不可用;所选的连击点查询失败时绝不会回退到 UnitPower。这不会观测其他角色,也不会添加缓存。
Platform.points.GetUnitPointFragmentObservation 公共观测客户端以碎片形式报告的点数资源(熊猫人之谜的爆燃灰烬)。current 严格使用 UnitPower(unit,powerType,true),maximum 严格使用 UnitPowerMax(unit,powerType,true);结果除以暴雪的 MAX_POWER_PER_EMBER(10),因此 35 个碎片即为 3.5。仅限探测策略。缺失、失败、受限或格式错误的数据保持不可用;绝不回退到整单位查询。不会添加缓存。
Platform.points.GetUnitPointIdentityObservation 公共为点数资源条件观测确切的所选单位是否存在,并可选地观测其职业文件名。已知不存在时返回 exists=false,不读取职业。存在的单位只在请求时需要 UnitClass 的第二个返回值;未使用的本地化名称和 ID 不影响可用性。所需观测缺失、失败、受限或格式错误时保持为不可用。这不会选择资源或缓存身份。
Platform.points.GetUnitPointPowerObservation 公共使用确切的双参数 UnitPower 或 UnitPowerMax 查询,读取一个显式选择的点数资源数量。选择器为必需;不会推断主要资源或重新映射角色。保留有限的带符号、小数和零数量,不进行截断。缺失、失败、受限或非有限的数据保持为不可用。当前值和最大值是分开的观测,因此调用方可以共享当前值快照,同时按需延迟请求最大值。
Platform.range.GetNameplateMaxDistance 公共使用受支持的 CVar API 读取当前正的姓名板可见距离。这会限制“距离内计数”查询;它不能证明所有附近的单位都已被观测到。缺失、格式错误、受限或失败的观测会返回 nil 及原因。
Platform.range.GetRangeCheckBounds 公共读取某个单位的公开 LibRangeCheck 距离区间。成功的上限是包含的;正的失败下限是严格的。零下限是合成的。两个边界都不是精确距离,缺少上限也不能证明该单位在所有半径之外。不可用、格式错误、受限或失败的观测会返回 nil 及原因。
Platform.role.GetInspectRoleObservation 公共在探测或受限策略客户端上观测所选单位的职责,不发出观察请求。已知单位不存在时返回 false。优先使用可调用的现代观察 API,仅当它不可调用时才回退到旧版;所选 API 失败时绝不会回退。要求专精 ID 为正的有限整数,并且只使用确切的单参数 GetSpecializationInfoByID 调用的第五个返回值(职责)。所需信息缺失、失败、受限或格式错误时为不可用;可读的非空未来职责字符串保持原样。
Platform.role.GetTalentGroupRoleObservation 公共在探测或受限策略客户端上,观测确切的旧版 GetTalentGroupRole(group) 点号调用的第一个职责结果。将可读的所选天赋组原样转发,包括将 nil 作为一个参数;不推断天赋组范围、不替换为其他 API,也不查询玩家单位。完整的旧版主要声明并未成立。职责数据缺失、失败、受限、为空或格式错误时为不可用;可读的非空未来字符串保持原样。
Platform.role.readField 依赖项Reads object[key] in protected mode, used to look up optional APIs.
Platform.role.roleValue 依赖项Validates a role returned by a native API.
Platform.roster_class.GetRosterClassObservation 公共在已识别的客户端系列上读取公开的名单身份。输入路由仅限 player、party1 到 party4,以及 raid1 到 raid40。先以该确切的单参数标识调用 UnitExists;已知为 false 时直接返回 false,不查询职业。对于存在的单位,只使用 UnitClass 的第二个返回值作为可读的非空职业文件名字符串,不限制职业枚举。所需信息缺失、失败、格式错误或受限时返回 nil 及原因。
Platform.roster_class.rosterUnit 依赖项Returns true when unit is exactly player, party1 through party4, or raid1 through raid40 (no leading zeros), and false for any other string.
Platform.rotation_owner.GetPlayerOwnerClassObservation 公共为循环所有权读取一次全新的受保护 UnitClass 玩家观测。只使用第二个返回值中可读的非空职业文件名。不会添加存在性、等级、载具、客户端系列或战斗策略的读取,结果也不会跨调用保留。核心所有权仍会分别验证职业标识和角色键;被覆盖的上下文提供者保留其完整的原有路径。
Platform.runes.finite 依赖项Returns true when value is a number that is neither NaN nor infinite, and false for anything else.
Platform.runes.GetRuneCooldownObservation 公共为一个确切的原生栏位读取一次受保护的 GetRuneCooldown 元组。分别规范化 ready、start 和 duration:ready 需要可读的布尔值,而每个时间值需要可读的有限数字,并保留带符号、小数和零值。每个不可用的字段都附带其自己的原因。成功返回空元组时会产生部分记录;缺少能力、策略或原生调用失败时返回 nil。绝不从计时推断 ready,也不从 ready 推断计时。请在调用方缓存这份完整记录,以便在符文计数和冷却判断之间共享一次观测。
Platform.runes.GetRuneEvaluationTime 公共为符文冷却运算读取一次全新的受保护无参数 GetTime。要求结果可读且为有限数字。此观测刻意不缓存;调用方保留原有的“先读时钟再扫描”顺序,并且只在有匹配的符文需要计时时才要求其值。不会以评估开始时间替代或推断时间。
Platform.runes.GetRuneTypeObservation 公共使用只带单个索引参数的 GetRuneType 观测一个确切的原生符文栏位。要求类型可读且为正的有限整数;已知的未来数字类型与所选类型保持区分,死亡符文是一个确切的类型而不是通配符。缺失、失败、受限或格式错误的观测保持为不可用。不会添加职业、单位、数量或推断基础符文的查询。
Platform.runes.numberField 依赖项Normalizes one numeric field of a native result.
Platform.runes.validIndex 依赖项Validates a rune slot index.
Platform.spells.cooldownFlags 依赖项Extracts the never-secret isEnabled, isActive and isOnGCD flags from a C_Spell.GetSpellCooldown record whose times are secret.
Platform.spells.cooldownValues 依赖项Reads a spell cooldown as separate values for the readiness checks.
Platform.spells.copy 依赖项Copies the expected fields of a native result table into a new table, checking each type.
Platform.spells.finiteNonNegative 依赖项Returns true when value is a nonnegative number that is not NaN or infinity, and false for anything else.
Platform.spells.flagReadiness 依赖项Decides cooldown readiness from the never-secret flags when the cooldown times are hidden.
Platform.spells.gcdRunning 依赖项Reports whether the global cooldown is running at time now.
Platform.spells.GetSpellCharges 公共读取规范化的充能记录:currentCharges、maxCharges、cooldownStartTime、cooldownDuration、chargeModRate 和 isActive。不受支持的法术或受限的客户端数据会返回 nil 及原因。
Platform.spells.GetSpellCooldown 公共读取各受支持客户端的法术冷却并将其规范化。返回的记录包含 startTime、duration、isEnabled 和 modRate。时间戳和持续时间已经以 GetTime() 秒数描述到期时间;不要再除以 modRate。当客户端隐藏时间时(正式服和永久服的战斗中),记录为 nil,原因为 restricted-value,在可以读取时其后会附上永不为机密的 isEnabled、isActive 和 isOnGCD 标志。
Platform.spells.identifier 依赖项Validates a spell argument.
Platform.spells.IsAutoRepeatActive 公共读取玩家某个法术(例如射击或自动射击)的自动重复状态。这与当前或排队中的施法不同。现代客户端会收到确切的法术 ID;旧版查询会先解析玩家的法术书栏位。受限的客户端策略、无法读取的结果以及不可用的法术书栏位会返回 nil 及原因。这只观测状态,从不开始或停止法术。
Platform.spells.IsSpellReady 公共检查某个法术现在能否被推荐,允许剩余冷却时间随当前公共冷却一同结束的法术。在正式服和永久服中,战斗中的冷却时间是机密值,因此改为根据永不为机密的 isEnabled、isActive 和 isOnGCD 标志判断是否就绪。此函数只检查冷却是否就绪;不检查是否已学会、距离或资源是否足够。请传入来自 evalStart 或 GetTime() 的评估时间。
Platform.spells.own 依赖项Returns a record holding only the expected fields, each checked by type.
Platform.threat.GetUnitThreatObservation 公共依次观测所选单位是否存在、是否与玩家敌对,然后观测玩家在该单位上的仇恨状态。已知不存在、非敌人以及成功读取到的 nil 仇恨状态返回 false,以保留“无仇恨”判断。包括零在内的有限状态数值保留其原有的比较含义。所需信息缺失、失败、为 nil、受限或格式错误时返回 nil 及原因。不会添加可攻击、死亡、战斗或载具的推断。
Platform.unit_attackability.GetUnitAttackabilityObservation 公共使用确切的 UnitExists、UnitCanAttack 和 UnitIsDead 判断,观测玩家是否可以攻击一个未死亡的所选单位。已知不存在或可读的不可攻击结果会返回 false,不查询死亡状态。所需观测缺失、失败、受限或格式错误时返回 nil 及原因。这不检测灵魂状态、距离、敌对状态或技能可用性,也不重定向单位所有权。
Platform.unit_flags.GetUnitFlagObservation 公共观测一个当前的单位标记:combat 使用 UnitAffectingCombat,enemy 使用以 player 为第一个单位的 UnitIsEnemy,pvp 使用 UnitIsPVP。可读且不存在的单位返回 false,不查询该标记。所需观测缺失、失败、受限或格式错误时返回 nil 及原因。这会保留确切的所选单位,不推断友好、可攻击或其他单位状态。
Platform.unit_health.finite 依赖项Returns true when value is a number that is neither NaN nor infinite, and false for anything else.
Platform.unit_health.GetUnitHealthObservation 公共在受支持的客户端上观测可读的当前生命值,并可选地观测最大生命值。可读且不存在的单位返回 exists=false。缺失、失败、受限或格式错误的观测会返回 nil 及原因;它们不能证明单位不存在或得出生命值。
Platform.unit_identity.GetUnitIdentityObservation 公共只用 UnitExists 检查第一个单位标识后,使用 UnitIsUnit 比较两个确切的单位标识。若第一个单位可读且不存在,则不进行比较直接返回 false。所需的观测缺失、失败、受限或格式错误时返回 nil 及原因。不会额外进行第二次存在性查询、GUID 查找或推断身份。
Platform.unit_level.finite 依赖项Returns true when value is a number that is neither NaN nor infinite, and false for anything else.
Platform.unit_level.GetUnitLevelObservation 公共在已知的客户端上观测可读的原始单位等级。可读且不存在的单位返回 exists=false;存在的单位要求 UnitLevel 为正的有限整数。未知的首领等级,以及缺失、失败、受限或格式错误的观测会返回 nil 及原因。这不使用有效等级或缩放后的等级。
Platform.unit_metadata.GetUnitMetadataObservation 公共在检查 UnitExists 后观测一个所使用的原生单位元数据字段:class 使用 UnitClass 的第二个返回值,creature 使用本地化的 UnitCreatureType 名称,classification 使用 UnitClassification。可读且不存在的单位返回 false,不查询元数据。未使用的元组字段不影响可用性;所需的值缺失、失败、为 nil、受限或格式错误时返回 nil 及原因。不会添加玩家职业、GUID、枚举或翻译推断。
Platform.unit_power.finite 依赖项Returns true when value is a number that is neither NaN nor infinite, and false for anything else.
Platform.unit_power.GetUnitPowerObservation 公共在受支持且可读的客户端上观测显式的法力值或当前的原始能量资源。资源身份从实时的 PowerType 枚举中选择;显式法力值绝不会回退到当前能量条。已知不存在时返回 exists=false;缺失、失败、受限或格式错误的观测会返回 nil 及原因。current 模式下的数量保留带符号的原生资源;显式法力值为非负。仅在需要时请求最大值;百分比的使用者必须要求最大值为正。
Platform.unit_presence.GetUnitPresenceObservation 公共在已识别的客户端系列上观测单位的存在性。将所选单位原样传给一次受保护的 UnitExists 调用。保留可读的 true 和 false;所需观测缺失、失败、受限、为 nil 或格式错误时返回 nil 及原因。不会添加身份、可见性、距离或战斗状态的查询。
Platform.unit_stat.finite 依赖项Returns true when value is a number that is neither NaN nor infinite, and false for anything else.
Platform.unit_stat.GetUnitStatObservation 公共只从原生的第二个返回值观测有效属性。在探测或受限策略客户端上,先查询确切的 UnitExists(unit),然后对选择器 1..5 查询 UnitStat(unit,stat),或对选择器 6 查询 UnitArmor(unit)。已知不存在时返回 exists=false;所需信息缺失、失败、受限或非有限时返回 nil。保留有限的带符号、小数和零值;忽略所有未使用的元组字段。1..6 的路由是 RM 的选择器策略,而非原生值域的限制。
Platform.unit_states.GetUnitStateObservation 公共在探测或受限策略客户端上,观测确切的所选单位是否死亡或处于灵魂状态,或是否对玩家友好。所需观测缺失、失败、受限或格式错误时为不可用。单位不存在时为不可用,而不是否定匹配,在 NOT 下同样如此。不会保留跨轮询的状态。
Platform.zone_pvp.GetZonePVPObservation 公共使用一次受保护的无参数点号调用,观测区域 PvP 分类的第一个结果。优先使用可调用的 C_PvP.GetZonePVPInfo,仅当现代 API 不可调用时才使用全局辅助函数。成功返回 nil 或没有返回值时,会产生一个已知的空记录;缺失、失败、受限或格式错误的观测保持为不可用。可读的空字符串和未来字符串保留其确切含义,未使用的返回字段不决定可用性。在现代 API 返回结果或失败后,绝不切换后端。
UI.checkbox.constructor 依赖项Constructs a new RM-CheckBox condition widget: a 180 by 24 frame holding a workbench check box, with SetLabel, SetValue, GetValue and SetDisabled, firing OnValueChanged when clicked.
UI.checkbox.CreateConditionCheckBox 公共创建一个原生的布尔条件控件。配置 SetLabel、SetValue、SetDisabled 和 OnValueChanged;使用 parent:AddChild(widget) 添加它。
UI.condition_display.buttonConstructor 依赖项Constructs a new RM-ConditionButton widget around a 200-pixel workbench button, with SetText, SetAutoWidth and SetDisabled, firing OnClick (with the mouse button), OnEnter and OnLeave only while its lease is live.
UI.condition_display.CreateConditionButton 公共使用共享的条件控件生命周期和工作台主题创建一个原生按钮。SetText、SetDisabled 和 SetCallback 用于配置其标签和交互;OnClick 会收到所按的鼠标按键。将其使用 parent:AddChild(widget) 添加到回调的父级。
UI.condition_display.CreateConditionLabel 公共创建原生的自动换行文本,根据其宽度和字体测量高度。SetText、SetFont 或 SetFontObject 用于配置其内容。将其使用 parent:AddChild(widget) 添加到回调的父级,以便布局能够跟踪其测得的高度。
UI.condition_display.CreateConditionLink 公共创建原生的自动换行文本,可选择带有前置图像和指针回调。SetImage 和 SetImageSize 用于配置图像;OnEnter、OnLeave 和 OnClick 使用条件回调约定。将其使用 parent:AddChild(widget) 添加到回调的父级;其租用被释放时回调会失效。
UI.condition_display.defaultFont 依赖项Returns the default font for condition labels and buttons: the GameFontHighlightSmall font object, or its name when the object is not defined.
UI.condition_display.labelConstructor 依赖项Constructs a new condition text widget: a plain wrapping RM-ConditionLabel, or with interactive set an RM-ConditionLink button that adds a leading image and OnEnter, OnLeave and OnClick callbacks.
UI.condition_icon.constructor 依赖项Constructs a new RM-ConditionIcon widget: a clickable image with an optional caption below it, with SetImage, SetImageByAtlas, SetImageSize, SetLabel and SetDisabled, firing OnClick, OnEnter and OnLeave while its lease is live.
UI.condition_icon.CreateConditionIcon 公共使用条件控件生命周期创建一个原生图像控件。SetImage 和 SetImageSize 用于选择材质;SetText 可选地添加说明文字。OnClick、OnEnter 和 OnLeave 使用共享的回调约定。将该控件使用 parent:AddChild(widget) 添加到回调的父级。
UI.condition_inputs.constructor 依赖项Constructs a new condition input widget: an RM-ConditionEditBox text box, or with numeric set an RM-ConditionSlider pairing a slider with a numeric box (with range, step and percent display).
UI.condition_inputs.CreateConditionEditBox 公共使用条件控件约定创建一个原生文本输入框。SetLabel、SetText、SetDisabled 和 SetCallback 用于配置它;OnEnterPressed 提交文本。使用 parent:AddChild(widget) 将其添加到回调的父级。
UI.condition_inputs.CreateConditionSlider 公共创建一个带有滑块和数字输入框的原生数值条件输入控件。配置 SetSliderValues、SetValue、SetIsPercent 和 SetCallback;OnValueChanged 报告已提交的值。使用 parent:AddChild(widget) 添加它。
UI.condition_inputs.finite 依赖项True when value is a number that is neither NaN nor infinite; the condition inputs use it to validate entered and slider values.
UI.condition_layout.constructor 依赖项Constructs a new RM-ConditionGroup container that stacks condition widgets in List, Table or RM-SpellField layout, resizing itself to its contents and relaying out its parent.
UI.condition_layout.CreateConditionGroup 公共创建一个条件字段容器,使用 RM 自有的 List、Table 和自适应法术字段布局。它接受已注册的原生条件控件;使用 AddChild 添加子项,并将该组附加到回调的父级。
UI.condition_layout.layoutIconRows 依赖项Lays out the "RM-IconRows" container: an icon on the left, vertically centered beside the rows of fields, and an optional side widget (marked with the side user data) that sits beside the last row when there is room and below the rows when there is not.
UI.condition_layout.verticalAlignment 依赖项Converts a table cell's alignV setting to a vertical offset fraction for the condition group's Table layout: 0 for nil, start or top, 0.5 for middle or center, and 1 for end or bottom (case-insensitive prefixes).
UI.condition_position.constructor 依赖项Constructs a new RM-ConditionPositionPad widget around the shared workbench directional pad, with SetDisabled, firing OnOffsetChanged (horizontal and vertical direction, whether Center was pressed, and the step) only while its lease is live and it is enabled.
UI.condition_position.CreateConditionPositionPad 公共使用共享的方向控件创建一个原生位置面板。OnOffsetChanged 报告水平和垂直方向、是否按下了“居中”,以及增量(一,或按住 Shift 时为十)。SetDisabled 控制交互;将该面板使用 parent:AddChild(widget) 添加到回调的父级。
UI.selector.CreateConditionDropdown 公共创建一个原生的条件选择器。SetList 接受键到标签或键到条目的映射;SetValue 选择一个键,OnValueChanged 报告变化。使用 parent:AddChild(widget) 添加它。
UI.selector.selectorWidget 依赖项Constructs a new RM-Selector dropdown widget: an optional caption over a button that opens the workbench selector popup.
utils.getCachedInternal 依赖项来自 utils.lua 的内置辅助函数。
utils.packResults 依赖项来自 utils.lua 的内置辅助函数。