local p = {}
function p.calcenergy()
local energy = args["Энергия"] or ""
verste = args["Версия"] or ""
if energy == "" then
unitlnk = ""
unit = ""
elseif verste >= "3" or verste == "" then
unitlnk = "[[Redstone Flux|RF]]"
unit = "RF"
else
unitlnk = "[[Minecraft Joules|MJ]]"
unit = "MJ"
end
energyText = "<span title=\"Требуемая энергия, " .. energy .. " " .. unit .. ".\" " ..
"style=\"font-family: Minecraft-ru; cursor: help\">" .. energy .. " " .. unitlnk .. "</span>"
return verste, energyText
end
function p.sawmill(f)
args = require("Модуль:ProcessArgs").norm()
p.calcenergy()
local mod = args["Мод"] or ""
local cellIn1 = args["Вход"]
local cellOut1 = args["Выход"]
local cellOut2 = args["Выход2"]
local chance = args["Шанс"] or ""
local progressImage = "[[Файл:layout Furnace Progress.gif|link=]]"
local descStyle = "font-family: Minecraft-ru; text-align: center; width:228px; color: black"
local chanceText = "<span title=\"Шанс получения побочного продукта, " .. chance ..
".\" " .. "style=\"font-family: Minecraft-ru; cursor: help\">" .. chance .. "</span>"
if verste == "5" or verste == "" then
backgroundImageVar = "Элементы интерфейса лесопилки 2 (Thermal Expansion).png"
else
backgroundImageVar = "Элементы интерфейса лесопилки 1 (Thermal Expansion).png"
end
if verste == "" then
descText = "[[Thermal Expansion/Лесопилка|Лесопилка]]"
else
descText = "[[Thermal Expansion " .. verste .. "/Лесопилка|Лесопилка]]"
end
local cg = require("Модуль:Cg")
local cgSlot = cg.slot
local cgText = cg.text
local output = {}
-- указание размеров подложки
table.insert(output, cg.begin({228, 154}))
table.insert(output, cg.backgroundImage({backgroundImageVar}))
table.insert(output, cgSlot({
cellIn1,
14,
50,
mod = mod
}))
table.insert(output, cgSlot({
cellOut1,
134,
50,
class2 = "invslot-plain",
mod = mod
}))
table.insert(output, cgSlot({
cellOut2,
134,
104,
mod = mod
}))
table.insert(output, cg.image({progressImage, 64, 68}))
table.insert(output, cgText({
descText,
0,
8,
style = descStyle
}))
table.insert(output, cgText({
chanceText,
168,
108,
style = "width: 52px; text-align: center; color: black"
}))
table.insert(output, cgText({
energyText,
44,
108,
style = "width: 90px; text-align: center; color: black"
}))
table.insert(output, cg.footer())
return table.concat(output)
end
return p
Advertisement
Модуль:Участник:KnottyManatee55
Advertisement