Module:AbilitySection: Difference between revisions

Vergir (talk | contribs)
m support creating ability hints from interactions tab
Detect interaction state (disabled/partial) and pass it to the hint rail (with help from vergir-bot LLM)
Line 38: Line 38:
idx = idx + 1
idx = idx + 1
local box_id = 'ai-int-' .. ability_num .. '-' .. idx
local box_id = 'ai-int-' .. ability_num .. '-' .. idx
local state = 'normal'
if attrs:find('ai%-disabled') then
state = 'disabled'
elseif attrs:find('ai%-partial') then
state = 'partial'
end
table.insert(manual, {
table.insert(manual, {
file     = file,
file   = file,
title   = attrs:match('data%-ai%-title="([^"]*)"') or '',
title = attrs:match('data%-ai%-title="([^"]*)"') or '',
disabled = attrs:find('ai%-disabled') ~= nil,
state  = state,
anchor   = box_id,
anchor = box_id,
})
})
return pre .. attrs .. ' id="' .. box_id .. '"' .. post
return pre .. attrs .. ' id="' .. box_id .. '"' .. post