Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,637
edits
m (Hoping) |
m (Probs isn't enough of a change, since I just realized mod:id is the issue) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
modLink = '$1/$2', | modLink = '$1/$2', | ||
invAliases = [[Module:Inventory slot/Aliases]], | invAliases = [[Module:Inventory slot/Aliases]], | ||
gm4Atlas = [[Module:Gm4Sprite]], | |||
gm4Aliases = [[Module:Gm4Sprite/Aliases]], | gm4Aliases = [[Module:Gm4Sprite/Aliases]], | ||
-- is random really necessary? | -- is random really necessary? | ||
Line 20: | Line 21: | ||
p.i18n = i18n | p.i18n = i18n | ||
local random = require( i18n.moduleRandom ).random | --local random = require( i18n.moduleRandom ).random | ||
local aliases = mw.loadData( i18n.invAliases ) | local aliases = mw.loadData( i18n.invAliases ) | ||
local gm4atlas = mw.loadData( i18n.gm4Atlas ) | |||
local gm4aliases = mw.loadData( i18n.gm4Aliases ) | |||
local pageName = mw.title.getCurrentTitle().text | local pageName = mw.title.getCurrentTitle().text | ||
Line 105: | Line 108: | ||
local img | local img | ||
if mod then | if mod and module then | ||
if name:match( '%.gif$' ) or name:match( '%.png$' ) then | if module then | ||
if name:match( '%.gif$' ) or name:match( '%.png$' ) then | |||
img = i18n.gm4Filename:gsub( '%$1', name .. ' (' .. module .. ')' ) | |||
name = name:sub( 0, -5 ) | |||
else | |||
img = i18n.gm4Filename:gsub( '%$1', name .. ' (' .. module .. ').png' ) | |||
end | |||
else | else | ||
img = i18n.gm4Filename:gsub( '%$1', name . | if name:match( '%.gif$' ) or name:match( '%.png$' ) then | ||
img = i18n.gm4Filename:gsub( '%$1', name ) | |||
name = name:sub( 0, -5 ) | |||
else | |||
img = i18n.gm4Filename:gsub( '%$1', name .. '.png' ) | |||
end | |||
end | end | ||
elseif name:match( '%.gif$' ) or name:match( '%.png$' ) then | elseif name:match( '%.gif$' ) or name:match( '%.png$' ) then | ||
Line 125: | Line 137: | ||
if mod then | if mod then | ||
if module ~= nil then | if module ~= nil then | ||
link = module .. '/#' .. name | |||
end | end | ||
link = | link = name | ||
else | else | ||
--link = name:gsub( '^' .. i18n.prefixes.damaged .. ' ', '' ) | --link = name:gsub( '^' .. i18n.prefixes.damaged .. ' ', '' ) | ||
Line 229: | Line 241: | ||
if args.mod == 'gm4' then | if args.mod == 'gm4' then | ||
modData.mod = 'gm4' | modData.mod = 'gm4' | ||
modData.atlas = mw.loadData( | modData.atlas = mw.loadData( i18n.gm4Atlas ) | ||
modData.aliases = mw.loadData( | modData.aliases = mw.loadData( i18n.gm4Aliases ) | ||
elseif args.mod == '' then | elseif args.mod == '' then | ||
modData.default = nil | modData.default = nil | ||
Line 316: | Line 328: | ||
if aliases or modData.aliases then | if aliases or modData.aliases then | ||
local id = frame.name | local id = frame.name | ||
if frame.mod then | -- (maybe) temp hardcode | ||
id | if frame.mod and frame.mod == 'gm4' then | ||
local section = | -- the more important part being, do not use mod:id as the full name... wtf | ||
frame.module = | local section = gm4atlas.ids[id].section | ||
frame.module = gm4atlas.sections[section].name | |||
modData.atlas = gm4atlas | |||
modData.aliases = gm4aliases | |||
end | end | ||
edits