呼叫方式
Functions.presentation.predicate(operator, primary)
將它記錄為名為 Functions.presentation.predicate 的相依項目(接受自動完成即可完成此步驟),然後以該名稱呼叫。
作用
為具名條件短語建立一個具型別的比較判斷。肯定措辭使用原先擷取的運算子對應,否定措辭使用目前反轉後的運算子對應。主要判斷優先於限定詞;只有第一個符合條件的判斷會被反轉。未知運算子使用現有的運算子預留位置。這只格式化措辭,不比較值也不評估條件。
參數
| 名稱 | 類型 | 作用 |
|---|---|---|
operator | string | 比較運算子鍵,例如 EQUALS 或 LESSTHAN。 |
primary | boolean | nil | 為 true 時標記要反轉的主要比較;為 false 或 nil 時,僅當不存在主要判斷時它才有資格被反轉。 |
傳回值
| 1 | RMConditionPredicate | 用作具名短語值的暫時具型別判斷;不要將其作為條件資料儲存。 |
|---|
版本
內建輔助函式在每個版本上都會註冊。不同的是它們讀取的遊戲 API;某個 API 不存在時,輔助函式會改用備用方式,或傳回 nil 並附上原因。
它不會直接讀取任何遊戲 API。
插件如何呼叫它
- 增益效果剩餘時間 (print)
comparison = AuraSummary.predicate(value.operator), - 增益效果層數 (print)
comparison = AuraSummary.predicate(value.operator, true), - 背包中有物品 (print)
comparison = Summary.predicate(value.operator, true), - 減益效果剩餘時間 (print)
comparison = AuraSummary.predicate(value.operator), - 減益效果層數 (print)
comparison = AuraSummary.predicate(value.operator, true), - 擴充角色屬性 (print)
comparison = ECSLabels.predicate(value.operator, true), - 擴充角色屬性百分比 (print)
comparison = ECSLabels.predicate(value.operator, true), - 物品冷卻 (print)
comparison = Summary.predicate(value.operator, true),
以及另外 9 處: 範圍內的生命力 (print), 範圍內的生命力百分比 (print), 範圍內的生命力百分比計數 (print), 範圍內的生命力計數 (print), 範圍內的法力 (print), 範圍內的法力百分比 (print), 範圍內的法力百分比計數 (print), 範圍內的法力計數 (print), 已裝備的套裝件數 (print)
相依項目
operators(builtin:Functions/presentation.lua:operators)
原始碼
Functions/presentation.lua,第 94 行。在遊戲中為唯讀;「複製」會產生一份可編輯的複本。
Functions.presentation.predicate(operator, primary)
local positive=addon.nullable(operators[operator], L["<operator>"])
return addon:CreateConditionSummaryPredicate(positive, (addon.negatedOperators or {})[operator], primary)