Module:Item Navbox: Difference between revisions

Jump to navigation Jump to search
No edit summary
No edit summary
Line 29: Line 29:
end
end


-- Directly fetches and formats ItemIcons for the navbox
-- Directly fetches and formats Item text for the navbox (Icons removed)
local function get_item_icons(slot, min_souls, max_souls, filter_mode)
local function get_item_text(slot, min_souls, max_souls, filter_mode)
     if slot ~= 'Weapon' and slot ~= 'Armor' and slot ~= 'Tech' then return '' end
     if slot ~= 'Weapon' and slot ~= 'Armor' and slot ~= 'Tech' then return '' end
      
      
Line 57: Line 57:
                  
                  
                 local item_template
                 local item_template
                -- Output as a standard wikilink instead of an icon template
                 if lang_code == "en" then
                 if lang_code == "en" then
                     item_template = "{{ItemIcon|" .. item_name_english .. "|size=26px}}"
                     item_template = "[[" .. item_name_english .. "]]"
                 else
                 else
                     item_template = "{{ItemIcon|" .. item_name_english .. "|lang=" .. lang_code .. "|l1=" .. item_name_local .. "|size=26px}}"
                     item_template = "[[" .. item_name_english .. "|" .. item_name_local .. "]]"
                 end
                 end
                  
                  
Line 130: Line 131:
             table.insert(wikitext, '  | group' .. j .. ' = ' .. tier.label)
             table.insert(wikitext, '  | group' .. j .. ' = ' .. tier.label)
              
              
             local items_string = get_item_icons(cat.slot, tier.min, tier.max, nil)
             local items_string = get_item_text(cat.slot, tier.min, tier.max, nil)
             -- Wrap the items in our flex container for layout
             -- Wrap the items in our flex container for layout
             table.insert(wikitext, '  | list' .. j .. '  = <div class="itemnav-cost-type-container">' .. items_string .. '</div>')
             table.insert(wikitext, '  | list' .. j .. '  = <div class="itemnav-cost-type-container">' .. items_string .. '</div>')