Jump to content
Toggle menu
  • 20 articles
  • 87 files
  • 13 users
  • 460 edits
Incursion Red River Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:WeaponNav

From Incursion Red River Wiki
Revision as of 06:32, 25 October 2026 by AkshayNDeodhar (talk | contribs) (Created page with " local p = {} local categories = { { param = "pistol", label = "Pistols", path = "/Pistols" }, { param = "smg", label = "SMGs", path = "/SMGs" }, { param = "shotgun", label = "Shotguns", path = "/Shotguns" }, { param = "assault_rifle", label = "Assault Rifles", path = "/Assault_Rifles" }, { param = "dmr", label = "DMRs", path = "/DMRs" }, { param = "sniper_rifle", label = "Sn...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

local p = {}

local categories = {

   { param = "pistol",        label = "Pistols",        path = "/Pistols" },
   { param = "smg",           label = "SMGs",            path = "/SMGs" },
   { param = "shotgun",       label = "Shotguns",        path = "/Shotguns" },
   { param = "assault_rifle", label = "Assault Rifles",  path = "/Assault_Rifles" },
   { param = "dmr",           label = "DMRs",             path = "/DMRs" },
   { param = "sniper_rifle",  label = "Sniper Rifles",   path = "/Sniper_Rifles" },
   { param = "lmg",           label = "LMGs",             path = "/LMGs" },
   { param = "melee",         label = "Melee",            path = "/Melee" },

}

function p.main(frame)

   local args = frame:getParent().args
   local title = mw.title.getCurrentTitle().text
   local nav = mw.html.create("table")
       :addClass("wikitable")
       :css("width", "100%")
       :css("white-space", "nowrap")
       :css("border-collapse", "collapse")
       :css("line-height", "1.0")
   local row = nav:tag("tr")
   row:tag("th")
       :wikitext("Overview")
   for _, category in ipairs(categories) do
       local value = args[category.param]
       if value and value ~= "" then
           row:tag("td")
               :wikitext(
                   "[[" .. title .. category.path ..
                   "|" .. "" .. category.label .. "" .. "]]"
               )
       end
   end
   return tostring(nav)

end

return p