Module:ItemData/nav: Difference between revisions

Refactored for performance optimization
LVL (talk | contribs)
Made active items table use the same item category background colors as the item navbox does
Line 255: Line 255:
      
      
     for _, item in ipairs(active_items) do
     for _, item in ipairs(active_items) do
         local bg_color, item_type
         local bg_color = util_module.get_slot_color(item.slot)
        if item.slot == "Armor" then
 
            bg_color = "#86C921"
local item_type
            item_type = "Armor"
if item.slot == "Armor" then
        elseif item.slot == "Tech" then
    item_type = "Armor"
            bg_color = "#DE9CFF"
elseif item.slot == "Tech" then
            item_type = "Tech"
    item_type = "Tech"
        else
else
            bg_color = "#FCAC4D"
    item_type = "Weapon"
            item_type = "Weapon"
end
        end
          
          
         local row = string.format([=[
         local row = string.format([=[