mNo edit summary |
(Replacing Tooltips.getIcon() with Tooltips.getFullTooltip()) |
||
(18 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
-- <nowiki> |
-- <nowiki> |
||
local Math = require([[Module:Math]]) |
local Math = require([[Module:Math]]) |
||
+ | local Polarity = require([[Module:Polarity]]) |
||
− | |||
+ | local Tooltip = require([[Module:Tooltips]]) |
||
− | local function polarity(pol) |
||
− | return string.format('[[File:%s|20px|link=Polarity]]', ({ |
||
− | Zenurik = "Zenurik_Pol.svg", |
||
− | Naramon = "Naramon_Pol.svg", |
||
− | Vazarin = "Vazarin_Pol.svg", |
||
− | Penjaga = "Penjaga_Pol.svg", |
||
− | Exilus = "Exilus.svg", |
||
− | Madurai = "Madurai_Pol.svg", |
||
− | Koneksi = "Koneksi_Pol.svg", |
||
− | Umbra = "Umbra_Pol.png", |
||
− | Unairu = "Unairu_Pol.svg", |
||
− | Aura = "Aura_Pol.svg", |
||
− | None = "Spacer.png", |
||
− | })[({ |
||
− | Ability = 'Zenurik', |
||
− | Bar = 'Naramon', |
||
− | D = 'Vazarin', |
||
− | Y = 'Penjaga', |
||
− | Sila = 'Penjaga', |
||
− | Sentinel = 'Penjaga', |
||
− | Precept = 'Penjaga', |
||
− | V = 'Madurai', |
||
− | O = 'Koneksi', |
||
− | Core = 'Koneksi', |
||
− | Fusion = 'Koneksi', |
||
− | Pengetikan = 'Koneksi', |
||
− | U = 'Umbra', |
||
− | Q = 'Umbra', |
||
− | Ward = 'Unairu', |
||
− | R = 'Unairu' |
||
− | })[pol] or pol] |
||
− | ) |
||
− | end |
||
− | |||
− | local function pols(ps) |
||
− | if not (ps and ps[1]) then return 'None' end |
||
− | local p = {} |
||
− | for i, v in ipairs(ps or {'None'}) do |
||
− | p[i] = polarity(v) |
||
− | end |
||
− | return table.concat(p) |
||
− | end |
||
local function override(arg) |
local function override(arg) |
||
Line 64: | Line 23: | ||
:tag('title') |
:tag('title') |
||
:tag('default') |
:tag('default') |
||
− | :tag('b'):wikitext(name):done() |
+ | :tag('b'):wikitext(name..'[[Category:'..name..']][[Category:Warframes]]'):done() |
:done() |
:done() |
||
:done() |
:done() |
||
:tag('image'):attr('source', 'Image') |
:tag('image'):attr('source', 'Image') |
||
:tag('default'):wikitext(warframe.Image or 'Panel.png'):done() |
:tag('default'):wikitext(warframe.Image or 'Panel.png'):done() |
||
+ | :done() |
||
+ | :tag('data'):attr('source', 'Sex') |
||
+ | :tag('label'):wikitext('Sex'):done() |
||
+ | :tag('default'):wikitext(warframe.Sex and (name ~= 'Xaku' and warframe.Sex..'[[Category:'..warframe.Sex..'s]]' or warframe.Sex..'[[Category:'..warframe.Sex..']]')):done() |
||
:done() |
:done() |
||
:tag('data'):attr('source', 'Mastery') |
:tag('data'):attr('source', 'Mastery') |
||
Line 100: | Line 63: | ||
:tag('data'):attr('source', 'AuraPolarity') |
:tag('data'):attr('source', 'AuraPolarity') |
||
:tag('label'):wikitext('[[Aura|Aura Polarity]]'):done() |
:tag('label'):wikitext('[[Aura|Aura Polarity]]'):done() |
||
− | :tag('default'):wikitext(warframe.AuraPolarity and |
+ | :tag('default'):wikitext(warframe.AuraPolarity and Polarity._polarity(warframe.AuraPolarity) or 'None'):done() |
:done() |
:done() |
||
:tag('data'):attr('source', 'ExilusPolarity') |
:tag('data'):attr('source', 'ExilusPolarity') |
||
:tag('label'):wikitext('[[Exilus Adapter|Exilus Polarity]]'):done() |
:tag('label'):wikitext('[[Exilus Adapter|Exilus Polarity]]'):done() |
||
− | :tag('default'):wikitext(warframe.ExilusPolarity and |
+ | :tag('default'):wikitext(warframe.ExilusPolarity and Polarity._polarity(warframe.ExilusPolarity) or 'None'):done() |
:done() |
:done() |
||
:tag('data'):attr('source', 'Polarities') |
:tag('data'):attr('source', 'Polarities') |
||
:tag('label'):wikitext('[[Mods#Polarity|Polarities]]'):done() |
:tag('label'):wikitext('[[Mods#Polarity|Polarities]]'):done() |
||
− | :tag('default'):wikitext( |
+ | :tag('default'):wikitext(Polarity._pols(warframe.Polarities)):done() |
:done() |
:done() |
||
:tag('data'):attr('source', 'Introduced') |
:tag('data'):attr('source', 'Introduced') |
||
Line 119: | Line 82: | ||
:done() |
:done() |
||
:tag('data'):attr('source', 'Progenitor') |
:tag('data'):attr('source', 'Progenitor') |
||
− | :tag('label'):wikitext('[[ |
+ | :tag('label'):wikitext('[[Lich System#Progenitor Warframe|Progenitor]] Element'):done() |
− | :tag('default'):wikitext(warframe.Progenitor):done() |
+ | :tag('default'):wikitext(warframe.Progenitor and Tooltip.getFullTooltip(warframe.Progenitor, 'DamageTypes')):done() |
:done() |
:done() |
||
:tag('data'):attr('source', 'Subsumed') |
:tag('data'):attr('source', 'Subsumed') |
||
:tag('label'):wikitext('[[Helminth#Ability Replacement|Subsumed Ability]]'):done() |
:tag('label'):wikitext('[[Helminth#Ability Replacement|Subsumed Ability]]'):done() |
||
− | :tag('default'):wikitext(warframe.Subsumed and |
+ | :tag('default'):wikitext(warframe.Subsumed and Tooltip.getFullTooltip(warframe.Subsumed, 'Ability')):done() |
+ | :done() |
||
+ | :tag('data'):attr('source', 'Internal Name') |
||
+ | :tag('label'):wikitext('Internal Name'):done() |
||
+ | :tag('default'):wikitext(warframe.InternalName and '<code>'..warframe.InternalName..'</code>' or nil):done() |
||
:done() |
:done() |
||
Revision as of 19:35, 15 September 2021
Documentation for this module may be created at Module:Warframes/infobox/doc
-- <nowiki>
local Math = require([[Module:Math]])
local Polarity = require([[Module:Polarity]])
local Tooltip = require([[Module:Tooltips]])
local function override(arg)
return arg and arg..'[[Category:InfoboxOverride]]'
end
return {
buildInfobox = function(frame)
local args = frame.args;
local name = args['Name'];
local warframe = {}
if args['Conclave'] == 'false' then
warframe = mw.loadData([[Module:Warframes/data]]).Warframes[name];
else
warframe = mw.loadData([[Module:Warframes/Conclave/data]]).Warframes[name];
end
local infobox = mw.html.create('infobox')
:tag('title')
:tag('default')
:tag('b'):wikitext(name..'[[Category:'..name..']][[Category:Warframes]]'):done()
:done()
:done()
:tag('image'):attr('source', 'Image')
:tag('default'):wikitext(warframe.Image or 'Panel.png'):done()
:done()
:tag('data'):attr('source', 'Sex')
:tag('label'):wikitext('Sex'):done()
:tag('default'):wikitext(warframe.Sex and (name ~= 'Xaku' and warframe.Sex..'[[Category:'..warframe.Sex..'s]]' or warframe.Sex..'[[Category:'..warframe.Sex..']]')):done()
:done()
:tag('data'):attr('source', 'Mastery')
:tag('label'):wikitext('[[Mastery Rank]]'):done()
:tag('default'):wikitext(warframe.Mastery or '0'):done()
:done()
:tag('data'):attr('source', 'Health')
:tag('label'):wikitext('[[Health]]'):done()
:tag('default'):wikitext(warframe.Health and warframe.Health..' ('..(warframe.HealthRank30 or warframe.Health*3)..' at R30)'):done()
:done()
:tag('data'):attr('source', 'Shield')
:tag('label'):wikitext('[[Shield]]'):done()
:tag('default'):wikitext(warframe.Shield and warframe.Shield..' ('..(warframe.ShieldRank30 or warframe.Shield*3)..' at R30)'):done()
:done()
:tag('data'):attr('source', 'Armor')
:tag('label'):wikitext('[[Armor]]'):done()
:tag('default'):wikitext(warframe.ArmorRank30 and warframe.Armor..' ('..warframe.ArmorRank30..' at R30)' or warframe.Armor):done()
:done()
:tag('data'):attr('source', 'Energy')
:tag('label'):wikitext('[[Energy Capacity|Energy]]'):done()
:tag('default'):wikitext(warframe.Energy and warframe.Energy..' ('..(warframe.EnergyRank30 or Math.round(warframe.Energy*1.5, 0.1))..' at R30)'):done()
:done()
:tag('data'):attr('source', 'Sprint')
:tag('label'):wikitext('[[Sprint Speed]]'):done()
:tag('default'):wikitext(warframe.Sprint):done()
:done()
:tag('data'):attr('source', 'Mobility')
:tag('label'):wikitext('Mobility'):done()
:tag('default'):wikitext(warframe.Mobility):done()
:done()
:tag('data'):attr('source', 'AuraPolarity')
:tag('label'):wikitext('[[Aura|Aura Polarity]]'):done()
:tag('default'):wikitext(warframe.AuraPolarity and Polarity._polarity(warframe.AuraPolarity) or 'None'):done()
:done()
:tag('data'):attr('source', 'ExilusPolarity')
:tag('label'):wikitext('[[Exilus Adapter|Exilus Polarity]]'):done()
:tag('default'):wikitext(warframe.ExilusPolarity and Polarity._polarity(warframe.ExilusPolarity) or 'None'):done()
:done()
:tag('data'):attr('source', 'Polarities')
:tag('label'):wikitext('[[Mods#Polarity|Polarities]]'):done()
:tag('default'):wikitext(Polarity._pols(warframe.Polarities)):done()
:done()
:tag('data'):attr('source', 'Introduced')
:tag('label'):wikitext('Introduced'):done()
:tag('default'):wikitext(warframe.Introduced and '{{ver|'..warframe.Introduced..'}}'):done()
:done()
:tag('data'):attr('source', 'Themes')
:tag('label'):wikitext('Themes'):done()
:tag('default'):wikitext(warframe.Themes):done()
:done()
:tag('data'):attr('source', 'Progenitor')
:tag('label'):wikitext('[[Lich System#Progenitor Warframe|Progenitor]] Element'):done()
:tag('default'):wikitext(warframe.Progenitor and Tooltip.getFullTooltip(warframe.Progenitor, 'DamageTypes')):done()
:done()
:tag('data'):attr('source', 'Subsumed')
:tag('label'):wikitext('[[Helminth#Ability Replacement|Subsumed Ability]]'):done()
:tag('default'):wikitext(warframe.Subsumed and Tooltip.getFullTooltip(warframe.Subsumed, 'Ability')):done()
:done()
:tag('data'):attr('source', 'Internal Name')
:tag('label'):wikitext('Internal Name'):done()
:tag('default'):wikitext(warframe.InternalName and '<code>'..warframe.InternalName..'</code>' or nil):done()
:done()
return frame:preprocess(tostring(infobox))
end
}