Module:Items: Difference between revisions

another attempt to fix formatting
(Change to formatting on drop sources to try to fix spacing issue)
(another attempt to fix formatting)
Line 229: Line 229:
             result = result..','..Icons.Icon({chest.name, type="item", notext="true"})
             result = result..','..Icons.Icon({chest.name, type="item", notext="true"})
           else
           else
             if string.len(result) > 0 then result = result..'\r\n' end
             if string.len(result) > 0 then result = result..'<br/>' end
             result = result..'Opening: '..Icons.Icon({chest.name, type="item", notext="true"})
             result = result..'Opening: '..Icons.Icon({chest.name, type="item", notext="true"})
             boxFound = true
             boxFound = true
Line 243: Line 243:
       for j, loot in pairs(npc.lootTable) do
       for j, loot in pairs(npc.lootTable) do
         if loot[1] == item.id then
         if loot[1] == item.id then
           if string.len(result) > 0 then result = result..'\r\n' end
           if string.len(result) > 0 then result = result..'<br/>' end
           result = result..'Pickpocketing: '..Icons.Icon({npc.name, type="thieving", notext="true"})
           result = result..'Pickpocketing: '..Icons.Icon({npc.name, type="thieving", notext="true"})
           boxFound = true
           boxFound = true
Line 254: Line 254:
   local upgradeFound = false
   local upgradeFound = false
   if item.itemsRequired ~= nil then
   if item.itemsRequired ~= nil then
     if string.len(result) > 0 then result = result..'\r\n' end
     if string.len(result) > 0 then result = result..'<br/>' end
     result = result..'Upgrading: '
     result = result..'Upgrading: '
     for i, req in pairs(item.itemsRequired) do
     for i, req in pairs(item.itemsRequired) do
Line 268: Line 268:
   --SmithCheck:
   --SmithCheck:
   if item.smithingLevel ~= nil then
   if item.smithingLevel ~= nil then
     if string.len(result) > 0 then result = result..'\r\n' end
     if string.len(result) > 0 then result = result..'<br/>' end
     result = result..Icons._SkillReq("Smithing", item.smithingLevel)
     result = result..Icons._SkillReq("Smithing", item.smithingLevel)
   end
   end
Line 274: Line 274:
   --CraftCheck:
   --CraftCheck:
   if item.craftingLevel ~= nil then
   if item.craftingLevel ~= nil then
     if string.len(result) > 0 then result = result..'\r\n' end
     if string.len(result) > 0 then result = result..'<br/>' end
     result = result..Icons._SkillReq("Crafting", item.craftingLevel)
     result = result..Icons._SkillReq("Crafting", item.craftingLevel)
   end
   end
Line 280: Line 280:
   --FletchCheck:
   --FletchCheck:
   if item.fletchingLevel ~= nil then
   if item.fletchingLevel ~= nil then
     if string.len(result) > 0 then result = result..'\r\n' end
     if string.len(result) > 0 then result = result..'<br/>' end
     result = result..Icons._SkillReq("Fletching", item.fletchingLevel)
     result = result..Icons._SkillReq("Fletching", item.fletchingLevel)
   end
   end
Line 286: Line 286:
   --RunecraftCheck:
   --RunecraftCheck:
   if item.runecraftingLevel ~= nil then
   if item.runecraftingLevel ~= nil then
     if string.len(result) > 0 then result = result..'\r\n' end
     if string.len(result) > 0 then result = result..'<br/>' end
     result = result..Icons._SkillReq("Runecrafting", item.runecraftingLevel)
     result = result..Icons._SkillReq("Runecrafting", item.runecraftingLevel)
   end
   end
Line 292: Line 292:
   --FishCheck:
   --FishCheck:
   if (item.category == "Fishing" and (item.type == "Junk" or item.type == "Special")) or item.category == "Gem" then
   if (item.category == "Fishing" and (item.type == "Junk" or item.type == "Special")) or item.category == "Gem" then
     if string.len(result) > 0 then result = result..'\r\n' end
     if string.len(result) > 0 then result = result..'<br/>' end
     result = result..Icons._SkillReq("Fishing", 1)
     result = result..Icons._SkillReq("Fishing", 1)
   elseif item.category == 'Fishing' then
   elseif item.category == 'Fishing' then
     if string.len(result) > 0 then result = result..'\r\n' end
     if string.len(result) > 0 then result = result..'<br/>' end
     result = result..Icons._SkillReq("Fishing", item.fishingLevel)
     result = result..Icons._SkillReq("Fishing", item.fishingLevel)
   end
   end
Line 302: Line 302:
   --Shop items
   --Shop items
   if item.slayerCost ~= nil or item.buysFor ~= nil then
   if item.slayerCost ~= nil or item.buysFor ~= nil then
     if string.len(result) > 0 then result = result..'\r\n' end
     if string.len(result) > 0 then result = result..'<br/>' end
     result = result..'[[Shop]]'
     result = result..'[[Shop]]'
   end
   end
Line 308: Line 308:
   --Special Shop Items (ie gloves, which don't technically exist in the shop)
   --Special Shop Items (ie gloves, which don't technically exist in the shop)
   if Shared.contains(OtherShopItems, item.name) then
   if Shared.contains(OtherShopItems, item.name) then
     if string.len(result) > 0 then result = result..'\r\n' end
     if string.len(result) > 0 then result = result..'<br/>' end
     result = result..'[[Shop]]'
     result = result..'[[Shop]]'
   end
   end
Line 314: Line 314:
   --Easter Eggs (manual list 'cause don't have a better way to do that)
   --Easter Eggs (manual list 'cause don't have a better way to do that)
   if Shared.contains(EasterEggs, item.name) then
   if Shared.contains(EasterEggs, item.name) then
     if string.len(result) > 0 then result = result..'\r\n' end
     if string.len(result) > 0 then result = result..'<br/>' end
     result = result..'[[Easter Eggs]]'
     result = result..'[[Easter Eggs]]'
   end
   end
Line 320: Line 320:
   return result
   return result
end
end


function p.getItemSources(frame)
function p.getItemSources(frame)