Editing Module:AbilityTableGive feedback
Jump to navigation
Jump to search
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 8: | Line 8: | ||
local p = {} | local p = {} | ||
local extra_columns = { | local extra_columns = { | ||
["barrier"] = { | ["barrier"] = { | ||
| Line 31: | Line 30: | ||
}, | }, | ||
["scalingspirit"] = { | ["scalingspirit"] = { | ||
headers = { "Spirit Scaling", " | headers = { "Spirit Scaling", "Notes" }, | ||
get_cells = Renderers.RenderSpiritScaling, | get_cells = Renderers.RenderSpiritScaling, | ||
}, | }, | ||
| Line 89: | Line 88: | ||
-- "Ability View" is a main-record + any relevant sub-ability records. | -- "Ability View" is a main-record + any relevant sub-ability records. | ||
-- ============================================================ | -- ============================================================ | ||
local _views = nil -- card key -> { view = record, heroName = ..., abilityNum = ... } | |||
local _views = nil -- card key -> { view = record, heroName = ..., abilityNum | |||
local _order = nil -- array of card keys, sorted by hero then slot | local _order = nil -- array of card keys, sorted by hero then slot | ||
| Line 206: | Line 121: | ||
local key = type(ability) == "table" and ability["Key"] or nil | local key = type(ability) == "table" and ability["Key"] or nil | ||
if slot_num and key and ability_data[key] then | if slot_num and key and ability_data[key] then | ||
card_of[key] = { heroName = hero_name, abilityNum = slot_num | card_of[key] = { heroName = hero_name, abilityNum = slot_num } | ||
end | end | ||
end | end | ||
| Line 236: | Line 151: | ||
for k, v in pairs(ability_data[key]) do view[k] = v end | for k, v in pairs(ability_data[key]) do view[k] = v end | ||
view["_subabilities"] = subs[key] | view["_subabilities"] = subs[key] | ||
_views[key] = { | _views[key] = { view = view, heroName = info.heroName, abilityNum = info.abilityNum } | ||
table.insert(_order, key) | table.insert(_order, key) | ||
end | end | ||
| Line 362: | Line 272: | ||
hero_abilities[hero] = {} | hero_abilities[hero] = {} | ||
end | end | ||
table.insert(hero_abilities[hero], views[key]) | table.insert(hero_abilities[hero], views[key].view) | ||
end | end | ||
| Line 369: | Line 279: | ||
local hero_cell = frame:expandTemplate{ title = "HeroIcon", args = { hero } } | local hero_cell = frame:expandTemplate{ title = "HeroIcon", args = { hero } } | ||
local ability_parts = {} | local ability_parts = {} | ||
for _, | for _, ability in ipairs(hero_abilities[hero]) do | ||
local name = ability["Name"] | local name = ability["Name"] | ||
local ability_cell = frame:expandTemplate{ title = "AbilityIcon", args = { name } } | local ability_cell = frame:expandTemplate{ title = "AbilityIcon", args = { name } } | ||
local extra = get_cells(ability | local extra = get_cells(ability) | ||
enrich_notes_compact(extra, stat_notes and stat_notes[name]) | enrich_notes_compact(extra, stat_notes and stat_notes[name]) | ||
| Line 440: | Line 349: | ||
} | } | ||
local extra = get_cells(ability | local extra = get_cells(ability) | ||
enrich_notes_full(extra, stat_notes and stat_notes[ability["Name"]]) | enrich_notes_full(extra, stat_notes and stat_notes[ability["Name"]]) | ||