Module:InventorySlot: Difference between revisions

Jump to navigation Jump to search
m
Reverted edits by Epyon (talk) to last revision by Kroppeb
m (One step closer.)
m (Reverted edits by Epyon (talk) to last revision by Kroppeb)
Tag: Rollback
Line 9: Line 9:
effect = sprite:new("effect")
effect = sprite:new("effect")
}
}
local aliases = mw.loadData([[Module:InventorySlot/Aliases]])


function UISlot:new(item, large)
function UISlot:new(item, large)
Line 116: Line 114:
self.__sprite:GenerateHTML(slot)
self.__sprite:GenerateHTML(slot)
end
end
local plainTitle = self.__html
local formattedTitle
if aliases then
local id = plainTitle
local alias = aliases[id]
if alias then
formattedTitle = alias.name
end
else
formattedTitle = plainTitle
end
slot:attr("title", formattedTitle)
return slot
return slot
end
end


return UISlot
return UISlot
Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,659

edits

Navigation menu