ARK: Survival Evolved Wiki
Nie podano opisu zmian
Will130Bot (dyskusja | edycje)
m (replaced: Zagłada → Wymarcie (3), Extinction → Wymarcie)
Linia 17: Linia 17:
 
elseif string.find(name," %(Aberracja%)") ~= nil then
 
elseif string.find(name," %(Aberracja%)") ~= nil then
 
return '[['..name..'|'..string.gsub(name,' %(Aberracja%)','')..']]'.. ((not noDlcIcon) and ' [[File:Aberration Icon.png|link=Aberracja]]' or '')
 
return '[['..name..'|'..string.gsub(name,' %(Aberracja%)','')..']]'.. ((not noDlcIcon) and ' [[File:Aberration Icon.png|link=Aberracja]]' or '')
elseif string.find(name," %(Zagłada%)") ~= nil then
+
elseif string.find(name," %(Wymarcie%)") ~= nil then
return '[['..name..'|'..string.gsub(name,' %(Zagłada%)','')..']]'.. ((not noDlcIcon) and ' [[File:Extinction Icon.png|link=Zagłada]]' or '')
+
return '[['..name..'|'..string.gsub(name,' %(Wymarcie%)','')..']]'.. ((not noDlcIcon) and ' [[File:Extinction Icon.png|link=Wymarcie]]' or '')
 
elseif string.find(name," %(Mobile%)") ~= nil then
 
elseif string.find(name," %(Mobile%)") ~= nil then
 
return '[['..name..'|'..string.gsub(name,' %(Mobile%)','')..']]'.. ((not noDlcIcon) and ' [[File:Logo Mobile.svg|link=ARK: Survival Evolved Mobile|16px]]' or '')
 
return '[['..name..'|'..string.gsub(name,' %(Mobile%)','')..']]'.. ((not noDlcIcon) and ' [[File:Logo Mobile.svg|link=ARK: Survival Evolved Mobile|16px]]' or '')

Wersja z 20:40, 2 lut 2021

Dokumentacja dla tego modułu może zostać utworzona pod nazwą Moduł:DLCLink/opis

-- checks if the name contains a DLC-suffix and changes it to the according DLC-icon. then returns a link to name.

local p = {}
function p.link(name, noDlcIcon)
  if string.find(name," %(Wyspa%)") ~= nil then
    return '[['..name..'|'..string.gsub(name,' %(Wyspa%)','')..']]'.. ((not noDlcIcon) and ' [[File:The Island Icon.png|link=Wyspa]]' or '')
  elseif string.find(name," %(Prymitywność Plus%)") ~= nil then
    return '[['..name..'|'..string.gsub(name,' %(Prymitywność Plus%)','')..']]'.. ((not noDlcIcon) and ' [[File:Primitive Plus Icon.png|link=Prymitywność Plus]]' or '')
  elseif string.find(name," %(Spalona Ziemia%)") ~= nil then
    return '[['..name..'|'..string.gsub(name,' %(Spalona Ziemia%)','')..']]'.. ((not noDlcIcon) and ' [[File:Scorched Earth Icon.png|link=Spalona Ziemia]]' or '')
  elseif string.find(name," %(The Center%)") ~= nil then
    return '[['..name..'|'..string.gsub(name,' %(The Center%)','')..']]'.. ((not noDlcIcon) and ' [[File:The Center Icon.png|link=The Center]]' or '')
  elseif string.find(name," %(Ragnarok%)") ~= nil then
    return '[['..name..'|'..string.gsub(name,' %(Ragnarok%)','')..']]'.. ((not noDlcIcon) and ' [[File:Ragnarok Icon.png|link=Ragnarok]]' or '')
  elseif string.find(name," %(Valguero%)") ~= nil then
    return '[['..name..'|'..string.gsub(name,' %(Valguero%)','')..']]'.. ((not noDlcIcon) and ' [[File:Valguero Icon.png|link=Valguero]]' or '')
  elseif string.find(name," %(Aberracja%)") ~= nil then
    return '[['..name..'|'..string.gsub(name,' %(Aberracja%)','')..']]'.. ((not noDlcIcon) and ' [[File:Aberration Icon.png|link=Aberracja]]' or '')
  elseif string.find(name," %(Wymarcie%)") ~= nil then
    return '[['..name..'|'..string.gsub(name,' %(Wymarcie%)','')..']]'.. ((not noDlcIcon) and ' [[File:Extinction Icon.png|link=Wymarcie]]' or '')
  elseif string.find(name," %(Mobile%)") ~= nil then
    return '[['..name..'|'..string.gsub(name,' %(Mobile%)','')..']]'.. ((not noDlcIcon) and ' [[File:Logo Mobile.svg|link=ARK: Survival Evolved Mobile|16px]]' or '')
  elseif string.find(name,"Mod:Primal Fear ") ~= nil then
    return '[['..name..'|'..string.gsub(name,'Mod:Primal Fear ','')..']]'.. ((not noDlcIcon) and ' [[File:PrimalFearIcon.png|link=Mod:Primal Fear]]' or '')
  elseif string.find(name,"Mod:Ebenus Astrum/") ~= nil then
    return '[['..name..'|'..string.gsub(name,'Mod:Ebenus Astrum/','')..']]'.. ((not noDlcIcon) and ' [[File:Ebenus Astrum Icon.png|link=Mod:Ebenus Astrum]]' or '')
  elseif string.find(name,"Mod:ARK Additions ") ~= nil then
    return '[['..name..'|'..string.gsub(name,'Mod:ARK Additions ','')..']]'.. ((not noDlcIcon) and ' [[File:ARK Additions Icon.png|link=Mod:ARK Additions]]' or '')
  elseif string.find(name,"Mod:Better MEKs! ") ~= nil then
    return '[['..name..'|'..string.gsub(name,'Mod:Better MEKs! ','')..']]'.. ((not noDlcIcon) and ' [[File:Mod Better MEKs! Icon.png|link=Mod:Better MEKs!]]' or '')
  elseif string.find(name,"Mod:Crystal Isles ") ~= nil then
    return '[['..name..'|'..string.gsub(name,'Mod:Crystal Isles ','')..']]'.. ((not noDlcIcon) and ' [[File:Mod Crystal Isles Icon.png|link=Mod:Crystal Isles]]' or '')
  elseif string.find(name,"Mod:S+") ~= nil then
    return '[['..name..'|'..string.gsub(name,'Mod:','')..']]'.. ((not noDlcIcon) and ' [[File:Structures Plus Icon.png|link=Mod:Structures Plus]]' or '')
  elseif string.find(name,"Mod:Platforms Plus ") ~= nil then
    return '[['..name..'|'..string.gsub(name,'Mod:Platforms Plus ','')..']]'.. ((not noDlcIcon) and ' [[File:Platforms Plus Icon.png|link=Mod:Platforms Plus]]' or '')
  elseif string.find(name,"Mod:Ark Eternal ") ~= nil then
    return '[['..name..'|'..string.gsub(name,'Mod:Ark Eternal ','')..']]'.. ((not noDlcIcon) and ' [[File:Mod Ark Eternal Icon.png|link=Mod:Ark Eternal]]' or '')
  elseif string.find(name,"Mod:Archaic Ascension ") ~= nil then
    return '[['..name..'|'..string.gsub(name,'Mod:Archaic Ascension ','')..']]'.. ((not noDlcIcon) and ' [[File:Mod Archaic Ascension Icon.png|link=Mod:Archaic Ascension]]' or '')
  elseif string.find(name,"Mod:The Chasm ") ~= nil then
    return '[['..name..'|'..string.gsub(name,'Mod:The Chasm ','')..']]'.. ((not noDlcIcon) and ' [[File:ChasmLogoSmall.jpg|link=Mod:The Chasm]]' or '')
  else
    local title = mw.title.new(name)
    if title == nil then
      return 'page not found: ' .. name
    end
    local link = (#title.nsText > 0) and (title.fullText .. '|' .. title.text) or title.text
    return '[['..link..']]'
  end
end
return p