Module:InventorySlot: Difference between revisions

attempt at making alias titles work
m (Reverted edits by Epyon (talk) to last revision by Kroppeb)
Tag: Rollback
(attempt at making alias titles work)
Line 2: Line 2:


local UISlot = {}
local UISlot = {}
local aliasData = {
moduleAliases = [[Module:InventorySlot/Aliases]]
}
UISlot.aliasData = aliasData
local aliases = mw.loadData( aliasData.moduleAliases )


local sprite = require([[Module:Sprite]])
local sprite = require([[Module:Sprite]])
Line 49: Line 55:
local spr = Sprites[mw.text.trim(t[1])]
local spr = Sprites[mw.text.trim(t[1])]
if spr then
if spr then
return spr:Item(mw.text.trim(t[2]))
spr = spr:Item(mw.text.trim(t[2]))
                if aliases then
                    spr.__settings.name = aliases.title
                end
                return spr
else
else
error("Unknown namespace: " .. mw.text.trim(t[1]))
error("Unknown namespace: " .. mw.text.trim(t[1]))
Bureaucrats, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, translator
2,564

edits