Home
Random
Log in
Settings
About The Remnant 2 Wiki
Disclaimers
The Remnant 2 Wiki
Search
Editing
Module:Update navigation
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local m_args = require('Module:ArgsLib') local patch = require('Module:Patch/data') -- loadData has problems here local u = {} function u.getUpdateLink(version) local data = patch.map[version] return string.format('[[Update: %s|%s]]', data.date, data.title) end function u.getOfficialNotes(version) local data = patch.map[version] return string.format('[%s Official Patch Notes]', data.link) end local p = {} function p.main(frame) local args = m_args.merge() return p._main(args) end function p._main(args) local _version = args[1] local _previousCount = 3 local _nextCount = 3 for i, v in ipairs(patch.ordered_list) do if v == _version then local _first = math.max(1, i - _previousCount) local _last = math.min(#patch.ordered_list, i + _nextCount) local navBox = mw.html.create('table'):addClass('wikitable navbox'):attr('style','text-align:center') :tag('caption') :wikitext(string.format('Update Navigation (%s, %s)', u.getOfficialNotes(_version), _version)) :done() local navRow = navBox:tag('tr') for j = _last, _first, -1 do local _current = patch.ordered_list[j] local _link = u.getUpdateLink(_current) navRow:tag('td'):wikitext(_link):done() end return navBox end end end return p
Summary:
Please note that all contributions to The Remnant 2 Wiki are considered to be released under the Creative Commons Attribution-NonCommercial-ShareAlike (see
RW:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Preview page with this template
Template used on this page:
Module:Update navigation/doc
(
edit
)