Module:AbilityHints: Difference between revisions

Keep overriding manual hints in their automatic hint's CONFIG-order slot (with help from vergir-bot LLM)
Wire partial state into hint icons: split grayscale overlay and per-state tooltips (with help from vergir-bot LLM)
Line 21: Line 21:
}
}


local function icon_img(file, link)
-- partial: split the icon so the top-left half is grayscale (mirrors the ai-partial box icon).
local function icon_img(file, link, partial)
    if partial then
        return '<span class="ability-hint-icon"><span class="ability-hint-split">'
            .. '[[File:' .. file .. '|24px|link=' .. link .. ']]'
            .. '<span class="ability-hint-split-gray">[[File:' .. file .. '|24px|link=]]</span>'
            .. '</span></span>'
    end
     return '<span class="ability-hint-icon">[[File:' .. file .. '|24px|link=' .. link .. ']]</span>'
     return '<span class="ability-hint-icon">[[File:' .. file .. '|24px|link=' .. link .. ']]</span>'
end
end
Line 32: Line 39:
local function manual_icon(m)
local function manual_icon(m)
     local cls = 'ability-hint'
     local cls = 'ability-hint'
     if m.disabled then cls = cls .. ' ability-hint--disabled' end
    local verb = 'Interacts with'
     return '<span class="' .. cls .. '">' .. icon_img(m.file, '#' .. m.anchor)
    local partial = false
         .. '<span class="ability-hint-tip">' .. m.title .. ' Interaction. Click to reveal more info</span></span>'
     if m.state == 'disabled' then
        cls = cls .. ' ability-hint--disabled'
        verb = 'Does not interact with'
    elseif m.state == 'partial' then
        verb = 'Interacts partially with'
        partial = true
    end
     return '<span class="' .. cls .. '">' .. icon_img(m.file, '#' .. m.anchor, partial)
         .. '<span class="ability-hint-tip">' .. verb .. ' ' .. m.title .. '. Click to reveal more info.</span></span>'
end
end