Модуль:TableOfChemicals: различия между версиями

Нет описания правки
м Серная кислота не существует в раздатчике химикатов. Это миф
Метки: с мобильного устройства из мобильной версии
 
(не показано 6 промежуточных версий 1 участника)
Строка 1: Строка 1:
p = {}
p = {}
p.chem = mw.text.jsonDecode(mw.title.new("User:KrasnoshchekovPavel/chem_prototypes.json"):getContent()) -- Заменить на яна после обновы
p.chem = mw.text.jsonDecode(mw.title.new("User:IanComradeBot/chem_prototypes.json"):getContent())
p.react = mw.text.jsonDecode(mw.title.new("User:KrasnoshchekovPavel/react_prototypes.json"):getContent()) -- Заменить на яна после обновы
p.react = mw.text.jsonDecode(mw.title.new("User:IanComradeBot/react_prototypes.json"):getContent())


p.fillReactTable = function(frame)
p.fillReactTable = function(frame)
Строка 80: Строка 80:
return out
return out
end
end
p.fillContentOfDispencer = function(frame)
local dispencer = frame.args.dispencer
local out = ""
for _, chemId in pairs(dispencersContent()[dispencer]) do
out = out .. frame:expandTemplate{ title = "Кнопка_реагента", args = {chemId, "y"}}
end
return out
end
function dispencersContent()
local content = {
["Химикатов"]={
"Aluminium","Carbon","Chlorine","Copper","Ethanol","Fluorine","Hydrogen","Iodine",
"Iron","Lithium","Mercury","Nitrogen","Oxygen","Phosphorus","Potassium","Radium",
"Silicon","Sodium","Sugar","Sulfur"
},
["Соды"]={
"Water","Ice","Coffee","Cream","Tea","GreenTea","IcedTea","IcedGreenTea",
"Cola","SpaceMountainWind","DrGibb","SpaceUp","TonicWater","SodaWater","LemonLime","Sugar",
"JuiceOrange","JuiceLime","JuiceWatermelon"
},
["Алкоголя"]={
"LemonLime","Sugar","JuiceOrange","JuiceLime","SodaWater","TonicWater","Beer","CoffeeLiqueur",
"Whiskey","Wine","Vodka","Gin","Rum","Tequila","Vermouth","Cognac",
"Ale","Mead"
}
}
return content
end
p.readArg = function(frame)
return mw.text.nowiki(p.chem[frame.args[1]][frame.args[2]])
end


function contains(list, x)
function contains(list, x)
Строка 184: Строка 220:
local image = getMixingImage(mixingCategory.id)
local image = getMixingImage(mixingCategory.id)
if image ~= nil then
if image ~= nil then
table.insert(actions, string.format("[[File:%s|32px]]", image)) -- Картинка
table.insert(actions, string.format("[[File:%s|32px|link=]]", image)) -- Картинка
end
end