Terraria Wiki
Edit Page
Figyelem: Nem vagy bejelentkezve. Ha szerkesztesz, az IP-címed nyilvánosan látható lesz a laptörténetben. Ha bejelentkezel vagy regisztrálsz, a szerkesztéseid a felhasználónevedhez lesznek társítva, egyéb hasznos dolgok mellett.

A szerkesztés visszavonható. Ellenőrizd alább a változásokat, hogy valóban ezt szeretnéd-e tenni, majd tedd közzé a változtatásaidat a visszavonás véglegesítéséhez.

Aktuális változat A te változatod
37. sor: 37. sor:
 
-- for each divider found
 
-- for each divider found
 
for st,sp in function() return string.find(str,div,pos,true) end do
 
for st,sp in function() return string.find(str,div,pos,true) end do
arr[#arr + 1] = trim(string.sub(str,pos,st-1)) -- Attach chars left of current divider
+
table.insert(arr,trim(string.sub(str,pos,st-1))) -- Attach chars left of current divider
 
pos = sp + 1 -- Jump past current divider
 
pos = sp + 1 -- Jump past current divider
 
end
 
end
arr[#arr + 1] = trim(string.sub(str,pos)) -- Attach chars right of last divider
+
table.insert(arr, trim(string.sub(str,pos))) -- Attach chars right of last divider
 
return arr
 
return arr
 
end
 
end
222. sor: 222. sor:
 
local _arg1 = getArg(1) or ''
 
local _arg1 = getArg(1) or ''
 
local _nolink = getArg('nolink')
 
local _nolink = getArg('nolink')
local _link = _nolink and '' or getArg('link') or frame:expandTemplate{ title = 'tr', args = {_arg1, link='y'} } -- now: _link == '' means nolink.
 
   
  +
-- link target and eicons target
local text = getArg(2) or ''
 
  +
local _link, _eicons_link = getArg('link'), nil
 
  +
if _link then -- override _nolink = y
local hovertext
 
  +
_eicons_link = _link -- _eicontr does not affect _link
if _arg1 ~= '' then
 
hovertext = frame:expandTemplate{ title = 'tr', args = {_arg1} }
 
elseif text ~= '' then
 
hovertext = text
 
 
else
 
else
  +
if _nolink then
hovertext = _link
 
  +
_link = ''
  +
if getArg('eicontr') then
 
_eicons_link = getArg('trname') or frame:expandTemplate{ title = 'tr', args = {_arg1, link = 'y', lang=lang} }
 
else
  +
_eicons_link = _arg1
 
end
  +
else
  +
-- no link=<link> input, use _arg1 with auto link translation.
 
_link = getArg('trname') or frame:expandTemplate{ title = 'tr', args = {_arg1, link = 'y', lang=lang} }
  +
if getArg('eicontr') then
  +
_eicons_link = _link -- reuse
  +
else
  +
_eicons_link = _arg1
  +
end
  +
end
 
end
 
end
  +
-- now _link == '' means nolink.
   
local class = 'i'
+
local text = getArg(2) or ''
  +
  +
local class = 'item-link'
   
 
local output_image, output_text, output_table = true, true, false
 
local output_image, output_text, output_table = true, true, false
251. sor: 265. sor:
 
local image_output, text_output
 
local image_output, text_output
 
if output_image then
 
if output_image then
 
image_output = images(getArg('image') or (string.gsub(_arg1, ":%s*", " ") .. '.' .. (getArg('ext') or 'png')), _link, text, getArg('size'), getArg('scale'), getArg('maxsize'))
local image_arg = string.gsub(_arg1, ":%s*", " ")
 
if _arg1 == '1/2 Second Timer' then
 
image_arg = '1 2 Second Timer'
 
elseif _arg1 == '1/4 Second Timer' then
 
image_arg = '1 4 Second Timer'
 
end
 
image_arg = getArg('image') or image_arg .. '.' .. (getArg('ext') or 'png')
 
image_output = images(image_arg, _link, hovertext, getArg('size'), getArg('scale'), getArg('maxsize'))
 
 
else
 
else
 
image_output = ''
 
image_output = ''
281. sor: 288. sor:
 
if _link ~= '' then
 
if _link ~= '' then
 
if text == _link then
 
if text == _link then
text = '<span>[['..text..']]</span>'
+
text = '[['..text..']]'
 
else
 
else
text = '<span>[['.._link..'|'..text..']]</span>'
+
text = '[['.._link..'|'..text..']]'
 
end
 
end
else
 
text = '<span title="'..hovertext..'">'..text..'</span>'
 
 
end
 
end
   
293. sor: 298. sor:
 
icon = ''
 
icon = ''
 
else
 
else
icon = eicons(getArg('epage') or _arg1, lang, (_showid or _note2 or _wrap or getArg('small')) and 'y')
+
icon = eicons(_eicons_link, lang, (_showid or _note2 or _wrap or getArg('small')) and 'y')
 
end
 
end
   
local content = text -- item name link text first.
+
local content = '<span>' .. text .. '</span>' -- item name link text first.
 
-- '-w' class means 'wrapmode', optimized for multiple lines of text. But it should be disabled for single line text.
 
-- '-w' class means 'wrapmode', optimized for multiple lines of text. But it should be disabled for single line text.
 
if _wrap then
 
if _wrap then
349. sor: 354. sor:
 
end
 
end
 
if output_table then
 
if output_table then
attr.class = class
+
attr.class = class .. ' block aligncenter'
local rowspan = getArg('rowspan')
+
local result = mw.text.tag('span', attr, image_output) .. '||'
  +
attr.class = class .. ' block alignleft'
return (rowspan and (' rowspan='..rowspan..' class="il1c" | ') or ' class="il1c" | ') .. mw.text.tag('span', attr, image_output) .. ' || class="il2c"'.. (rowspan and (' rowspan='..rowspan) or '')..' | ' .. mw.text.tag('span', attr, text_output)
 
  +
return result .. mw.text.tag('span', attr, text_output)
 
else
 
else
 
return mw.text.tag('span', attr, image_output .. text_output)
 
return mw.text.tag('span', attr, image_output .. text_output)
Please note that all contributions to the Terraria Wiki are considered to be released under the CC BY-NC-SA
Mégse Szerkesztési segítség (új ablakban nyílik meg)

A lapon használt sablon: