Module:Abilities/card: Difference between revisionsGive feedback
Jump to navigation
Jump to search
m added errors to let us know when number of supported alt boxes is exceeded |
Changed p.get_ability_card to use the new ability card template |
||
| Line 36: | Line 36: | ||
end | end | ||
--{{#invoke: | --{{#invoke:Abilities/card|get_ability_card|HERO_NAME|ABILITY_NUM|ADD_LINK|NOTES}}-- | ||
-- | -- Args: | ||
-- | -- HERO_NAME (required) - Name of the hero that is found in Data:HeroData.json under "Name" | ||
-- | -- ABILITY_NUM (required) - Selects ability at index 1 to 4 | ||
-- | -- ADD_LINK - Add a hyperlink to the title to the associated page | ||
-- | -- NOTES - User note data to include in the footer of the ability card | ||
p.get_ability_card = function(frame) | p.get_ability_card = function(frame) | ||
local hero_name = frame.args[1] | local hero_name = frame.args[1] | ||
| Line 51: | Line 49: | ||
local hero_key = get_hero_key(hero_name) | local hero_key = get_hero_key(hero_name) | ||
if (hero_key == nil) then return 'Hero with name' .. hero_name .. 'not found' end | |||
return | return build_ability_card(hero_key, ability_num, add_link, notes) | ||
end | end | ||
| Line 114: | Line 113: | ||
end | end | ||
-- Pulls data from Data:AbilityCards.json to populate Template:Ability card v2 | |||
function build_ability_card(hero_key, ability_num, add_link, notes, notes_source_page) | |||
-- Pulls data from Data:AbilityCards.json | |||
function | |||
local ability = utils.get_ability_card_data(hero_key, ability_num) | local ability = utils.get_ability_card_data(hero_key, ability_num) | ||
if(ability == nil) then | if(ability == nil) then | ||