Module:Abilities/card: Difference between revisions

m Added remaining attributes to get_ability_card_test function
m added errors to let us know when number of supported alt boxes is exceeded
Line 126: Line 126:
end
end


-- Function for sandboxing workshopping potential update of entire ability card generation
-- Function for sandboxing potential update of entire ability card generation
-- Pulls data from Data:AbilityCards.json for a defined hero and ability index
-- Pulls data from Data:AbilityCards.json for a defined hero and ability index
function get_ability_card_test(hero_key, ability_num, add_link, notes, notes_source_page)
function get_ability_card_test(hero_key, ability_num, add_link, notes, notes_source_page)
Line 141: Line 141:
if notes_source_page ~= nil and notes ~= "" then
if notes_source_page ~= nil and notes ~= "" then
--Notes comes from a /Notes page, and the notes are not blank
-- Notes comes from a /Notes page, and the notes are not blank
-- Confirm the notes source page exists, otherwise, don't display any notes
-- Confirm the notes source page exists, otherwise, don't display any notes
local title = mw.title.new(notes_source_page)
local title = mw.title.new(notes_source_page)
Line 154: Line 154:
local info1_main_boxes = get_main_boxes(hero_key, ability_num, 1)
local info1_main_boxes = get_main_boxes(hero_key, ability_num, 1)
local info1_alt_boxes = get_alt_boxes(hero_key, ability_num, 1)
local info1_alt_boxes = get_alt_boxes(hero_key, ability_num, 1)
if #info1_alt_boxes > 6 then
error(#info1_alt_boxes .. ' alt boxes found, but only 6 are supported. Please update Module:Abilities/card and Template:Ability_card_v2')
end
local info2_desc = get_info_desc(hero_key, ability_num, 2)
local info2_desc = get_info_desc(hero_key, ability_num, 2)
Line 159: Line 163:
local info2_alt_boxes = get_alt_boxes(hero_key, ability_num, 2)
local info2_alt_boxes = get_alt_boxes(hero_key, ability_num, 2)
if #info2_alt_boxes > 6 then
error(#info2_alt_boxes .. ' alt boxes found, but only 6 are supported. Please update Module:Abilities/card and Template:Ability_card_v2')
end
local upgrades = get_upgrade_boxes(hero_key, ability_num)
local upgrades = get_upgrade_boxes(hero_key, ability_num)