Module:InventorySlot: Difference between revisions

m
Reverted edits by BluePsychoRanger (talk) to last revision by Epyon
(aliases attempt #4)
m (Reverted edits by BluePsychoRanger (talk) to last revision by Epyon)
Tag: Rollback
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 51: Line 45:
end
end
if #t == 1 then
if #t == 1 then
spr = Sprites.minecraft:Item(item)
return Sprites.minecraft:Item(item)
            if aliases[item] then
                spr.__settings.name = aliases[item].title
            end
            return spr
elseif #t == 2 then
elseif #t == 2 then
local spr = Sprites[mw.text.trim(t[1])]
local spr = Sprites[mw.text.trim(t[1])]
if spr then
if spr then
spr = spr:Item(mw.text.trim(t[2]))
return spr:Item(mw.text.trim(t[2]))
                if aliases[item] then
                    spr.__settings.name = aliases[item].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