Module:Vehicle specifications: Difference between revisions
From Emergency Response: Liberty County Wiki
More actions
Content deleted Content added
No edit summary |
Removed error handling, no point in having it |
||
| Line 4: | Line 4: | ||
local getArgs = require('Module:Arguments').getArgs |
local getArgs = require('Module:Arguments').getArgs |
||
local args = getArgs(frame) |
local args = getArgs(frame) |
||
if args['form_factor'] == nil then |
|||
return '|-|Error=\n\n{{error|The [[Template:Vehicle_specifications|Vehicle_specifications]] template has not been configured correctly. Check the documentation for usage.}}' |
|||
end |
|||
local wikitext = '|-|General=\n\n{|class="wikitable vehicle-specifications-table' |
local wikitext = '|-|General=\n\n{|class="wikitable vehicle-specifications-table' |
||
Revision as of 14:51, 20 February 2026
This documentation is transcluded from Module:Vehicle specifications/doc. Changes can be proposed in the talk page.
This module is unused.
This module is neither invoked by a template nor required/loaded by another module. If this is in error, make sure to add
{{Documentation}}/{{No documentation}} to the calling template's or parent's module documentation.| Function list |
|---|
| L 3 — p.main |
local p = {}
function p.main(frame)
local getArgs = require('Module:Arguments').getArgs
local args = getArgs(frame)
local wikitext = '|-|General=\n\n{|class="wikitable vehicle-specifications-table'
if args['manufacturer'] then
wikitext = wikitext .. '\n\n|-\n\n|Manufacturer\n\n|' .. args['manufacturer']
end
if args['model'] then
wikitext = wikitext .. '\n\n|-\n\n|Model\n\n|' .. args['model']
end
if args['trim'] then
wikitext = wikitext .. '\n\n|-\n\n|Trim\n\n|' .. args['trim']
end
if args['model_year'] then
wikitext = wikitext .. '\n\n|-\n\n|Model year\n\n|' .. args['model_year']
end
if args['vehicle_id'] then
wikitext = wikitext .. '\n\n|-\n\n|Vehicle ID\n\n|' .. args['vehicle_id']
end
if args['team'] then
wikitext = wikitext .. '\n\n|-\n\n|Team\n\n|' .. args['team']
end
if args['form_factor'] then
wikitext = wikitext .. '\n\n|-\n\n|Form factor\n\n|' .. args['form_factor']
end
if args['type'] then
wikitext = wikitext .. '\n\n|-\n\n|Type\n\n|' .. args['type']
end
if args['Class'] then
wikitext = wikitext .. '\n\n|-\n\n|Class\n\n|' .. args['class']
end
if args['price'] then
wikitext = wikitext .. '\n\n|-\n\n|Price\n\n|' .. args['price']
end
if args['discounted_price'] then
wikitext = wikitext .. '\n\n|-\n\n|Discounted price\n\n|' .. args['discounted_price']
end
if args['rank'] then
wikitext = wikitext .. '\n\n|-\n\n|Rank\n\n|' .. args['rank']
end
if not (args['form_factor'] == 'Trailer') then
wikitext = wikitext .. '\n\n|}\n\n|-|Performance=\n\n{|class="wikitable vehicle-specifications-table'
end
if args['top_speed'] then
wikitext = wikitext .. '\n\n|-\n\n|Top speed\n\n|' .. args['top_speed'] .. ' <small>MPH</small>'
end
if args['top_reverse_speed'] then
wikitext = wikitext .. '\n\n|-\n\n|Top reverse speed\n\n|' .. args['top_reverse_speed'] .. ' <small>MPH</small>'
end
if args['acceleration'] then
wikitext = wikitext .. '\n\n|-\n\n|Acceleration <small>(0-60)</small>\n\n|' .. args['acceleration'] .. ' <small>seconds</small>'
end
if args['deceleration'] then
wikitext = wikitext .. '\n\n|-\n\n|Deceleration <small>(60-0)</small>\n\n|' .. args['deceleration'] .. ' <small>seconds</small>'
end
if not (args['form_factor'] == 'Trailer') then
wikitext = wikitext .. '\n\n|}\n\n|-|Structure=\n\n{|class="wikitable vehicle-specifications-table'
end
if args['transmission'] then
wikitext = wikitext .. '\n\n|-\n\n|Transmission\n\n|' .. args['transmission'] .. '<small>-speed automatic/sequential</small>'
end
if args['fuel_capacity'] then
wikitext = wikitext .. '\n\n|-\n\n|Fuel capacity\n\n|' .. args['fuel_capacity'] .. ' <small>gallons</small>'
end
if args['battery_size'] then
wikitext = wikitext .. '\n\n|-\n\n|Battery size\n\n|' .. args['battery_size'] .. ' <small>kWh</small>'
end
if args['drivetrain'] then
wikitext = wikitext .. '\n\n|-\n\n|Drivetrain\n\n|' .. args['drivetrain'] .. '<small>-wheel drive</small>'
end
if args['health'] then
wikitext = wikitext .. '\n\n|-\n\n|Health\n\n|' .. args['health'] .. ' <small>HP</small>'
end
wikitext = wikitext .. '\n\n|}\n\n|-|Frame=\n\n{|class="wikitable vehicle-specifications-table'
if args['seats'] then
wikitext = wikitext .. '\n\n|-\n\n|Seats\n\n|' .. args['seats']
end
if args['wheels'] then
wikitext = wikitext .. '\n\n|-\n\n|Wheels\n\n|' .. args['wheels']
end
if args['inspired_by'] then
wikitext = wikitext .. '\n\n|-\n\n|Inspired by\n\n|' .. args['inspired_by']
end
wikitext = wikitext .. '\n\n|}'
return wikitext
end
return p