Module:AbilityHints: Difference between revisionsGive feedback
Jump to navigation
Jump to search
Wire partial state into hint icons: split grayscale overlay and per-state tooltips (with help from vergir-bot LLM) |
Unlink automatic hint icons; wikilink game terms inside tooltips (with help from vergir-bot LLM) |
||
| Line 7: | Line 7: | ||
local p = {} | local p = {} | ||
-- Display order. Each entry: { list, file | -- Display order. Each entry: { list, file, tip } | ||
local CONFIG = { | local CONFIG = { | ||
{ list = "melee", file = "Melee Charge.png | { list = "melee", file = "Melee Charge.png", tip = "Benefits from melee items ([[Melee Charge]])" }, | ||
{ list = "movementbased", file = "Slowing Hex.png | { list = "movementbased", file = "Slowing Hex.png", tip = "Disabled by [[Slowing Hex]]" }, | ||
{ list = "debuffresist", file = "Debuff Reducer.png | { list = "debuffresist", file = "Debuff Reducer.png", tip = "Debuff duration reduced by [[Debuff Resist]]" }, | ||
{ list = "heal", file = "Healing Booster.png | { list = "heal", file = "Healing Booster.png", tip = "[[Healing]] amplified by [[Healing Booster]] and affected by healing reduction" }, | ||
{ list = "reactivebarrier", file = "Reactive Barrier.png | { list = "reactivebarrier", file = "Reactive Barrier.png", tip = "Triggers [[Reactive Barrier]]" }, | ||
{ list = "dispelmagic", file = "Dispel Magic.png | { list = "dispelmagic", file = "Dispel Magic.png", tip = "Effect can be [[Dispel Magic|dispelled]]" }, | ||
{ list = "indomitable", file = "Indomitable.png | { list = "indomitable", file = "Indomitable.png", tip = "Disable prevented by [[Indomitable]]" }, | ||
{ list = "unstoppable", file = "Unstoppable.png | { list = "unstoppable", file = "Unstoppable.png", tip = "Disable prevented by [[Unstoppable]]" }, | ||
{ list = "platedarmor", file = "Plated Armor.png | { list = "platedarmor", file = "Plated Armor.png", tip = "On-shot effect prevented by [[Plated Armor]]" }, | ||
{ list = "summons", file = "Monster Rounds.png | { list = "summons", file = "Monster Rounds.png", tip = "Summons affected by [[Monster Rounds]] and [[Heroic Aura]]" }, | ||
} | } | ||
-- partial: split the icon so the top-left half is grayscale (mirrors the ai-partial box icon). | -- partial: split the icon so the top-left half is grayscale (mirrors the ai-partial box icon). | ||
-- An empty link makes the icon non-clickable; automatic hints link from their tooltip text instead. | |||
local function icon_img(file, link, partial) | local function icon_img(file, link, partial) | ||
link = link or '' | |||
if partial then | if partial then | ||
return '<span class="ability-hint-icon"><span class="ability-hint-split">' | return '<span class="ability-hint-icon"><span class="ability-hint-split">' | ||
| Line 33: | Line 35: | ||
local function hint_icon(def) | local function hint_icon(def) | ||
return '<span class="ability-hint">' .. icon_img(def.file | return '<span class="ability-hint">' .. icon_img(def.file) | ||
.. '<span class="ability-hint-tip">' .. def.tip .. | .. '<span class="ability-hint-tip">' .. def.tip .. '</span></span>' | ||
end | end | ||