Как вызывать
UI.condition_layout.verticalAlignment(value)
Запишите зависимость UI.condition_layout.verticalAlignment и вызывайте её по этому имени. Вызов через пространство имён не передаёт self: используйте вызов через двоеточие или передайте объект сами.
Что делает
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).
Аргументы
| Имя | Тип | Что делает |
|---|---|---|
value | string | nil | Alignment name, such as "TOP", "middle" or "bottom". |
Возвращает
| 1 | number | nil | 0, 0.5 or 1, or nil for a non-string or unrecognized value. |
|---|
Издания
Встроенные помощники регистрируются во всех изданиях. Различается игровой API, который они читают; если нужного API нет, помощник использует запасной вариант или возвращает nil с причиной.
Не читает игровой API напрямую.
Как его вызывает аддон
UI.condition_layout.constructorrow[#row+1]={control=control,x=x,height=height,align=widths and cell and verticalAlignment(cell.alignV) or 0}
Исходный код
UI/condition_layout.lua, строка 30. В игре только для чтения; «Дублировать» создаёт редактируемую копию.
UI.condition_layout.verticalAlignment(value)
if value==nil then return 0 end
if type(value)~='string' then return nil end
value=value:lower()
if value=='start' or value:sub(1,3)=='top' then return 0 end
if value=='end' or value:sub(1,6)=='bottom' then return 1 end
if value=='middle' or value:sub(1,6)=='center' then return .5 end