Anonymous

Module:Shop: Difference between revisions

From Melvor Idle
_getShopTable: Minor amends to disable links on certain Golbin raid purchases; enforce minimum width on image column to prevent image disappearing completely on some mobile resolutions
(Added links to purchase names in the shop table)
(_getShopTable: Minor amends to disable links on certain Golbin raid purchases; enforce minimum width on image column to prevent image disappearing completely on some mobile resolutions)
Line 95: Line 95:
   local result = '{| class="wikitable sortable stickyHeader"'
   local result = '{| class="wikitable sortable stickyHeader"'
   result = result..'\r\n|- class="headerRow-0"'
   result = result..'\r\n|- class="headerRow-0"'
   result = result..'\r\n!colspan="2"|Purchase!!Type!!Description!!style="min-width:110px"|Cost!!Requirements'
   result = result..'\r\n!colspan="2"|Purchase!!Type!!Description!!style="min-width:90px"|Cost!!Requirements'


   local costCurrencies = {'gp', 'slayerCoins', 'raidCoins'}
   local costCurrencies = {'gp', 'slayerCoins', 'raidCoins'}
Line 113: Line 113:
     local iconOverrides = {
     local iconOverrides = {
       ["assets/media/main/logo.svg"] = { icon = 'Melvor Logo', type = nil, noLink = true },
       ["assets/media/main/logo.svg"] = { icon = 'Melvor Logo', type = nil, noLink = true },
       ["assets/media/skills/prayer/prayer.svg"] = { icon = 'Prayer', type = 'skill' }
       ["assets/media/skills/prayer/prayer.svg"] = { icon = 'Prayer', type = 'skill', noLink = true }
     }
     }
     local iconName, iconType, iconNoLink = purchase.name, (purchType == 'Item Bundle' and 'item' or string.lower(purchType)), nil
     local iconName, iconType, iconNoLink = purchase.name, (purchType == 'Item Bundle' and 'item' or string.lower(purchType)), nil
     if iconOverrides[purchase.media] ~= nil then
     if iconOverrides[purchase.media] ~= nil then
       iconName, iconType,iconNoLink = iconOverrides[purchase.media].icon, iconOverrides[purchase.media].type, iconOverrides[purchase.media].noLink
       iconName, iconType, iconNoLink = iconOverrides[purchase.media].icon, iconOverrides[purchase.media].type, iconOverrides[purchase.media].noLink
     end
     end
     result = result..Icons.Icon({iconName, type=iconType, notext=true, nolink=iconNoLink, size='50'})
 
     result = result..'||[['..purchase.name..']]||'..purchType
    local purchName = purchase.name
    if iconNoLink == nil or iconNoLink ~= true then purchName = '[[' .. purchName .. ']]' end
     result = result..'style="min-width:25px"|'..Icons.Icon({iconName, type=iconType, notext=true, nolink=iconNoLink, size='50'})
     result = result..'||'..purchName..'||'..purchType
     result = result..'||'..purchase.description..'||style="text-align:right;"'
     result = result..'||'..purchase.description..'||style="text-align:right;"'