Module:Sprite: Difference between revisions

m
Gotta have a nil check in fallbacks
m (Fallbacks)
m (Gotta have a nil check in fallbacks)
Line 120: Line 120:
function Sprite:setItem(item)
function Sprite:setItem(item)
     if aliases[item] then
     if aliases[item] then
if #aliases[item].title == 2 then
if aliases[item].title then
        self.__settings.name = aliases[item].title .. aliases[item].name
if #aliases[item].title == 2 then
else
        self.__settings.name = aliases[item].title .. aliases[item].name
if aliases[item].title then
else  
self.__settings.name = aliases[item].title
self.__settings.name = aliases[item].title
elseif aliases[item].name then
self.__settings.name = aliases[item].name
else
self.__settings.name = item
end
end
elseif aliases[item].name then
self.__settings.name = aliases[item].name
end
end
self.__settings.text = aliases[item].text
     else
     else
         self.__settings.name = item;
         self.__settings.name = item;
    end
end
 
if aliases[item].text then
self.__settings.text = aliases[item].text
end
 
if self.__source.ids[item] then
if self.__source.ids[item] then
self:setPosition(self.__source.ids[item].pos)
self:setPosition(self.__source.ids[item].pos)
Bureaucrats, Check users, emailconfirmed, Interface administrators, staff, Administrators, translation-admin, Widget editors
1,659

edits