Editing Module:Item Navbox

Warning: You are not logged in. Once you make an edit, a temporary account will be created for you. Learn more. Log in or create an account to continue receiving notifications after this account expires, and to access other features.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision Your text
Line 76: Line 76:
      
      
     table.sort(items)
     table.sort(items)
   
end  
    -- Append closing tags and bullets
    local total_items = #items
    for i = 1, total_items do
        if i == total_items then
            items[i] = items[i] .. '</span>'
        else
            items[i] = items[i] .. '<span class="item-nav-search-sep"> &bull; </span></span>'
        end
    end
   
    return table.concat(items, '')
end
      
      
-- Gets list of item codenames
-- Gets list of item codenames
local function get_item_codenames(slot, min_souls, max_souls, filter_mode, frame)
local function get_item_codenames(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
      
      
     local lang_code = lang_module.get_lang_code()  
     local lang_code = lang_module.get_lang_code()
     local items = {}
     local items = {}
     local slot_items = get_items_by_slot(slot)  
     local slot_items = get_items_by_slot(slot)  
Line 116: Line 104:
                 local item_name_english = lang_module.get_string(item_key, "en")
                 local item_name_english = lang_module.get_string(item_key, "en")
                 local item_name_local = lang_module.get_string(item_key, lang_code)
                 local item_name_local = lang_module.get_string(item_key, lang_code)
               
                 local item_codename = items_module.get_codename(item_key, item_name_english)
                local codename_frame = {
                    args = { item_name_english }
                }
 
                 local item_codename = items_module.get_codename(codename_frame)
                  
                  
                 local item_template
                 local item_template
                 if lang_code == "en" then
                 if lang_code == "en" then
                     item_template = "{{ItemIcon|" .. item_name_english .. "|l1=" .. item_codename .. "|size=26px}}"
                     item_template = "{{ItemIcon|" .. item_codename .. "|size=26px}}"
                 else
                 else
                     item_template = "{{ItemIcon|" .. item_name_english .. "|lang=" .. lang_code .. "|l1=" .. item_name_local .. "|size=26px}}"
                     item_template = "{{ItemIcon|" .. item_name_english .. "|lang=" .. lang_code .. "|l1=" .. item_name_local .. "|size=26px}}"
Please note that all contributions to The Deadlock Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see Deadlock:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)
Preview page with this template

Page included on this page: