Module:Inventory slot: Difference between revisions

m
Probs isn't enough of a change, since I just realized mod:id is the issue
mNo edit summary
m (Probs isn't enough of a change, since I just realized mod:id is the issue)
 
(2 intermediate revisions by the same user not shown)
Line 21: 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 106: 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
img = i18n.gm4Filename:gsub( '%$1', name .. ' (' .. module .. ')' )
if name:match( '%.gif$' ) or name:match( '%.png$' ) then
name = name:sub( 0, -5 )
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 .. ' (' .. module .. ').png' )
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 126: Line 137:
if mod then
if mod then
if module ~= nil then
if module ~= nil then
link = module .. '/#' .. name
end
end
link = i18n.modLink:gsub( '%$1', module ):gsub( '#%$2', name )
link = name
else
else
--link = name:gsub( '^' .. i18n.prefixes.damaged .. ' ', '' )
--link = name:gsub( '^' .. i18n.prefixes.damaged .. ' ', '' )
Line 317: 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 = frame.mod .. ':' .. id
if frame.mod and frame.mod == 'gm4' then
local section = modData.atlas.ids[id].section
-- the more important part being, do not use mod:id as the full name... wtf
frame.module = modData.atlas.sections[section].name
local section = gm4atlas.ids[id].section
frame.module = gm4atlas.sections[section].name
modData.atlas = gm4atlas
modData.aliases = gm4aliases
end
end
Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,637

edits