呼叫方式
Conditions.bossmod.encounterNote()
記錄相依項目 Conditions.bossmod.encounterNote,然後以該名稱呼叫。含命名空間的呼叫不會傳入 self:請使用冒號呼叫,或自行傳入該物件。
作用
Builds the status line the boss-mod condition editors show about the current encounter. Reads addon:GetBossModEncounter and reports the encounter name, ID and stage, that no encounter is in progress, or why boss-mod data is unavailable (adapter-unavailable when the adapter API is missing).
參數
無。
傳回值
| 1 | string | Localized one-line status text; never nil. |
|---|
版本
內建輔助函式在每個版本上都會註冊。不同的是它們讀取的遊戲 API;某個 API 不存在時,輔助函式會改用備用方式,或傳回 nil 並附上原因。
它不會直接讀取任何遊戲 API。
插件如何呼叫它
原始碼
Conditions/bossmod.lua,第 97 行。在遊戲中為唯讀;「複製」會產生一份可編輯的複本。
Conditions.bossmod.encounterNote()
if type(addon.GetBossModEncounter) ~= "function" then return string.format(L["Boss mod data unavailable: %s"], "adapter-unavailable") end
local active, id, stage, detail = addon:GetBossModEncounter()
if active == nil then return string.format(L["Boss mod data unavailable: %s"], tostring(detail or "unknown")) end
if not active then return L["No boss-mod encounter is in progress."] end
return string.format(L["Current encounter: %s (ID %s), stage %s"], detail or L["Unknown"], id and tostring(id) or L["none"], tostring(stage))