Module:Infobox item: Difference between revisions

Jump to navigation Jump to search
No edit summary
Added list for prop keys that need to be ignored
Line 19: Line 19:
local STATUS_FMT = "[[{{#invoke:Lang|get_string|Citadel_%s}}]]"
local STATUS_FMT = "[[{{#invoke:Lang|get_string|Citadel_%s}}]]"
     .. " [[{{#invoke:Lang|get_string|Citadel_StatusEffect}}]]"
     .. " [[{{#invoke:Lang|get_string|Citadel_StatusEffect}}]]"
-- Property keys to completely ignore during processing
local IGNORED_PROP_KEYS = {
    BuildUpPerShot = true,
}


-- Label key remapping table (replaces if/elseif chain)
-- Label key remapping table (replaces if/elseif chain)
local LABEL_KEY_REMAP = {
local LABEL_KEY_REMAP = {
    BuildUpPerShot = "BuildupPerShot",
     DotDuration    = "DOTDuration",
     DotDuration    = "DOTDuration",
}
}
Line 403: Line 407:
     for _, prop_obj in ipairs(prop_list or {}) do
     for _, prop_obj in ipairs(prop_list or {}) do
         local key = prop_obj.Key
         local key = prop_obj.Key
         if not seen[key] and (
         if not seen[key] and not IGNORED_PROP_KEYS[key] and (
             key:match("^StatusEffect")
             key:match("^StatusEffect")
             or is_property_in_lang_data(key, prop_obj.LocTokenOverride)
             or is_property_in_lang_data(key, prop_obj.LocTokenOverride)
Line 449: Line 453:
         if section.Type == "Innate" then
         if section.Type == "Innate" then
             for _, obj in ipairs(section.Main or {}) do
             for _, obj in ipairs(section.Main or {}) do
                 if is_property_in_lang_data(obj.Key, obj.LocTokenOverride) then
                 if not IGNORED_PROP_KEYS[obj.Key] and is_property_in_lang_data(obj.Key, obj.LocTokenOverride) then
                     local val
                     local val
                     if enhanced then
                     if enhanced then
Line 471: Line 475:
             end
             end
             for _, obj in ipairs(section.Alt or {}) do
             for _, obj in ipairs(section.Alt or {}) do
                 if is_property_in_lang_data(obj.Key, obj.LocTokenOverride) then
                 if not IGNORED_PROP_KEYS[obj.Key] and is_property_in_lang_data(obj.Key, obj.LocTokenOverride) then
                     local val
                     local val
                     if enhanced then
                     if enhanced then
Line 566: Line 570:
             for _, prop_obj in ipairs(section.Main or {}) do
             for _, prop_obj in ipairs(section.Main or {}) do
                 local key = prop_obj.Key
                 local key = prop_obj.Key
                 if not main_seen[key] and (
                 if not main_seen[key] and not IGNORED_PROP_KEYS[key] and (
                     key:match("^StatusEffect")
                     key:match("^StatusEffect")
                     or is_property_in_lang_data(key, prop_obj.LocTokenOverride)
                     or is_property_in_lang_data(key, prop_obj.LocTokenOverride)
Line 586: Line 590:
                 local key = prop_obj.Key
                 local key = prop_obj.Key
                 -- Skip keys already emitted as main stats
                 -- Skip keys already emitted as main stats
                 if not main_seen[key] and not alt_seen[key] and (
                 if not main_seen[key] and not alt_seen[key] and not IGNORED_PROP_KEYS[key] and (
                     key:match("^StatusEffect")
                     key:match("^StatusEffect")
                     or is_property_in_lang_data(key, prop_obj.LocTokenOverride)
                     or is_property_in_lang_data(key, prop_obj.LocTokenOverride)