參考資料 › 函式參考 › Conditions

Conditions.engraving.runeLabel

相依項目

呼叫方式

Conditions.engraving.runeLabel(value)

記錄相依項目 Conditions.engraving.runeLabel,然後以該名稱呼叫。含命名空間的呼叫不會傳入 self:請使用冒號呼叫,或自行傳入該物件。

作用

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". Returns nil when neither value.rune nor value.spell is set.

參數

名稱類型作用
valuetableCondition settings with a rune and/or spell field.

傳回值

1string | nilDisplay name for the rune, or nil when nothing is selected.

版本

內建輔助函式在每個版本上都會註冊。不同的是它們讀取的遊戲 API;某個 API 不存在時,輔助函式會改用備用方式,或傳回 nil 並附上原因。

它不會直接讀取任何遊戲 API。

插件如何呼叫它

相依項目

原始碼

Conditions/engraving.lua,第 53 行。在遊戲中為唯讀;「複製」會產生一份可編輯的複本。

Conditions.engraving.runeLabel(value)
    local known = platform.FindKnownRune and platform:FindKnownRune(value.rune, value.spell)
    if known and known.name then return known.name end
    if value.spell ~= nil then
        local info = platform.GetSpellInfo and platform:GetSpellInfo(value.spell)
        if info and info.name then return info.name end
        return string.format(L["rune spell %s"], tostring(value.spell))
    end
    if value.rune ~= nil then return string.format(L["rune %s"], tostring(value.rune)) end

返回函式參考