Module:Abilities/card: Difference between revisions

Removed exclude plus logic as it should no longer be needed in format_value_with_prepost function
Ignore Vindicta Assassinate's upgrade 3 description in localization files
Line 381: Line 381:
for k, upgrade in pairs(upgrades) do
for k, upgrade in pairs(upgrades) do
local description = lang.get_string(upgrade.DescKey)
local description = lang.get_string(upgrade.DescKey)
-- bypass some keys if they are mistakenly left in game files
local IGNORE_DESC_KEYS = {'citadel_ability_hornet_snipe_t3_desc'}
-- Generate a description if there is no localized string
-- Generate a description if there is no localized string
if (description == nil or description == '') then
if (description == nil or description == '' or commonutils.contains(IGNORE_DESC_KEYS, upgrade.DescKey)) then
description = create_description(upgrade, frame)
description = create_description(upgrade, frame)
end
end
Line 429: Line 432:
         local attr_name = lang.get_string(k..'_label')
         local attr_name = lang.get_string(k..'_label')
         local key = formatted_value .. '|' .. attr_name  -- Unique identifier
         local key = formatted_value .. '|' .. attr_name  -- Unique identifier
 
        -- Skip if this combination has already been added
-- skip DescKey for the edge case where we are generating description instead of using localization files
        if not seen[key] then
if k ~= 'DescKey' then
        -- Add line break if this is not the first item
        -- Skip if this combination has already been added
            if not first then
        if not seen[key] then
              description = description .. '<br>'
        -- Add line break if this is not the first item
            end
            if not first then
              description = description .. '<br>'
            end
        end
        description = description .. string.format('%s %s', formatted_value, attr_name)
        first = false
        seen[key] = true  -- Mark this combination as added
         end
         end
        description = description .. string.format('%s %s', formatted_value, attr_name)
        first = false
        seen[key] = true  -- Mark this combination as added
     end
     end