Module:Sprite: Difference between revisions

let's try this again... moving alias check to Sprite:setItem (double alias attempt #5)
(moving the aliasData to Sprite:setItem (double alias attempt #4))
(let's try this again... moving alias check to Sprite:setItem (double alias attempt #5))
Line 2: Line 2:


local Sprite = {}
local Sprite = {}
local aliasData = {
vanillaAliases = [[Module:InventorySlot/Aliases]],
gm4Aliases = [[Module:Gm4Sprite/Aliases]]
}
Sprite.aliasData = aliasData
local vanillaAliases = mw.loadData( aliasData.vanillaAliases )
local gm4Aliases = mw.loadData( aliasData.gm4Aliases )


local types = {
local types = {
Line 115: Line 124:


function Sprite:setItem(item, type)
function Sprite:setItem(item, type)
     -- load correct aliases
     -- set aliases
     local aliasData = {
     if type == "gm4" then
    minecraft = [[Module:InventorySlot/Aliases]],
        local aliases = gm4Aliases
    gm4 = [[Module:Gm4Sprite/Aliases]]
     else
     }
        local aliases = vanillaAliases
    local aliases = mw.LoadData( aliasData.type )
    end
-- js-less plaintext title
-- js-less plaintext title
self.__settings.name = item
self.__settings.name = item
Bureaucrats, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, translator
2,564

edits