Compare commits
11 Commits
master
...
craftguide
Author | SHA1 | Date | |
---|---|---|---|
c326ff5676 | |||
36c5b3c8ac | |||
961e08647f | |||
8801ef515b | |||
029cbdf6c4 | |||
af03d0e831 | |||
a6bbc0d1d8 | |||
a844b4f982 | |||
e879f588b6 | |||
1f048d5226 | |||
82071bf480 |
@ -19,5 +19,6 @@ Currently IndustrialTest supports following games:
|
|||||||
|
|
||||||
## Contributors
|
## Contributors
|
||||||
- mrkubax10 <mrkubax10@onet.pl or mrkubax10 at irc.libera.chat> [programming, some graphics]
|
- mrkubax10 <mrkubax10@onet.pl or mrkubax10 at irc.libera.chat> [programming, some graphics]
|
||||||
|
- HandfulOfFrogs <<handfuloffrogs@gmail.com>> [some programming, graphics]
|
||||||
- LuanHawk <Discord: LuanHawk#8733> [lead graphics]
|
- LuanHawk <Discord: LuanHawk#8733> [lead graphics]
|
||||||
- Migdyn <<temp1@cubesoftware.xyz>> [graphics]
|
- Migdyn <<temp1@cubesoftware.xyz>> [graphics]
|
||||||
|
50
api.lua
50
api.lua
@ -32,6 +32,15 @@ industrialtest.api.hvPowerFlow=10200
|
|||||||
industrialtest.api.evPowerFlow=40800
|
industrialtest.api.evPowerFlow=40800
|
||||||
industrialtest.api.ivPowerFlow=163800
|
industrialtest.api.ivPowerFlow=163800
|
||||||
|
|
||||||
|
industrialtest.api.craftingMethods={
|
||||||
|
macerating="industrialtest.macerating",
|
||||||
|
compressing="industrialtest.compressing",
|
||||||
|
extracting="industrialtest.extracting",
|
||||||
|
recycling="industrialtest.recycling",
|
||||||
|
cableForming="industrialtest.cable_forming",
|
||||||
|
massFabricating="industrialtest.mass_fabricating",
|
||||||
|
}
|
||||||
|
|
||||||
industrialtest.internal.clamp=function(num,min,max)
|
industrialtest.internal.clamp=function(num,min,max)
|
||||||
return math.max(math.min(num,max),min)
|
return math.max(math.min(num,max),min)
|
||||||
end
|
end
|
||||||
@ -672,6 +681,7 @@ industrialtest.api.registerPlate=function(name,displayName,resources,color,regis
|
|||||||
minetest.register_craftitem("industrialtest:"..name,{
|
minetest.register_craftitem("industrialtest:"..name,{
|
||||||
description=displayName,
|
description=displayName,
|
||||||
inventory_image="industrialtest_plate.png",
|
inventory_image="industrialtest_plate.png",
|
||||||
|
inventory_overlay="industrialtest_plate_overlay.png",
|
||||||
color=color
|
color=color
|
||||||
})
|
})
|
||||||
if registerCompressorRecipe then
|
if registerCompressorRecipe then
|
||||||
@ -749,6 +759,16 @@ industrialtest.api.registerMaceratorRecipe=function(config)
|
|||||||
recipe=config.recipe or "",
|
recipe=config.recipe or "",
|
||||||
time=config.time or 2
|
time=config.time or 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if mcl_craftguide ~= nil then
|
||||||
|
mcl_craftguide.register_craft({
|
||||||
|
type = industrialtest.api.craftingMethods.macerating,
|
||||||
|
width = 1,
|
||||||
|
output = definition.output,
|
||||||
|
items = {definition.recipe}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
industrialtest.api.maceratorRecipes[definition.recipe]=definition
|
industrialtest.api.maceratorRecipes[definition.recipe]=definition
|
||||||
end
|
end
|
||||||
-- \brief Returns macerator recipe result
|
-- \brief Returns macerator recipe result
|
||||||
@ -767,6 +787,16 @@ industrialtest.api.registerCompressorRecipe=function(config)
|
|||||||
time=config.time or 2,
|
time=config.time or 2,
|
||||||
count=config.count or 1
|
count=config.count or 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if mcl_craftguide ~= nil then
|
||||||
|
mcl_craftguide.register_craft({
|
||||||
|
type = industrialtest.api.craftingMethods.compressing,
|
||||||
|
width = 1,
|
||||||
|
output = definition.output,
|
||||||
|
items = {definition.recipe}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
industrialtest.api.compressorRecipes[definition.recipe]=definition
|
industrialtest.api.compressorRecipes[definition.recipe]=definition
|
||||||
end
|
end
|
||||||
-- \brief Returns macerator recipe result
|
-- \brief Returns macerator recipe result
|
||||||
@ -781,6 +811,16 @@ industrialtest.api.registerExtractorRecipe=function(config)
|
|||||||
recipe=config.recipe or "",
|
recipe=config.recipe or "",
|
||||||
time=config.time or 2
|
time=config.time or 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if mcl_craftguide ~= nil then
|
||||||
|
mcl_craftguide.register_craft({
|
||||||
|
type = industrialtest.api.craftingMethods.extracting,
|
||||||
|
width = 1,
|
||||||
|
output = definition.output,
|
||||||
|
items = {definition.recipe}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
industrialtest.api.extractorRecipes[definition.recipe]=definition
|
industrialtest.api.extractorRecipes[definition.recipe]=definition
|
||||||
end
|
end
|
||||||
industrialtest.api.getExtractorRecipeResult=function(recipe)
|
industrialtest.api.getExtractorRecipeResult=function(recipe)
|
||||||
@ -793,6 +833,16 @@ industrialtest.api.registerCableFormerRecipe=function(config)
|
|||||||
recipe=config.recipe or "",
|
recipe=config.recipe or "",
|
||||||
time=config.time or 2
|
time=config.time or 2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if mcl_craftguide ~= nil then
|
||||||
|
mcl_craftguide.register_craft({
|
||||||
|
type = industrialtest.api.craftingMethods.cableForming,
|
||||||
|
width = 1,
|
||||||
|
output = definition.output,
|
||||||
|
items = {definition.recipe}
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
industrialtest.api.cableFormerRecipes[definition.recipe]=definition
|
industrialtest.api.cableFormerRecipes[definition.recipe]=definition
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -33,12 +33,6 @@ for _,mod in ipairs(requiredMclModules) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
industrialtest.stackMax=99
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
industrialtest.stackMax=64
|
|
||||||
end
|
|
||||||
|
|
||||||
industrialtest.mods={}
|
industrialtest.mods={}
|
||||||
if industrialtest.mtgAvailable then
|
if industrialtest.mtgAvailable then
|
||||||
industrialtest.mods._3dArmor=minetest.get_modpath("3d_armor")
|
industrialtest.mods._3dArmor=minetest.get_modpath("3d_armor")
|
||||||
@ -53,10 +47,11 @@ if industrialtest.mtgAvailable and not industrialtest.mods._3dArmor then
|
|||||||
end
|
end
|
||||||
|
|
||||||
industrialtest.elementKeys={}
|
industrialtest.elementKeys={}
|
||||||
|
|
||||||
industrialtest.internal={}
|
industrialtest.internal={}
|
||||||
|
|
||||||
if industrialtest.mclAvailable then
|
if industrialtest.mclAvailable then
|
||||||
|
industrialtest.stackMax=64
|
||||||
|
|
||||||
industrialtest.internal.mclMakeStrippedTrunk=function(itemstack,placer,pointedThing,electricTool)
|
industrialtest.internal.mclMakeStrippedTrunk=function(itemstack,placer,pointedThing,electricTool)
|
||||||
-- Taken from https://git.minetest.land/MineClone2/MineClone2/src/branch/master/mods/ITEMS/mcl_tools/init.lua#L360
|
-- Taken from https://git.minetest.land/MineClone2/MineClone2/src/branch/master/mods/ITEMS/mcl_tools/init.lua#L360
|
||||||
if pointedThing.type ~= "node" then return end
|
if pointedThing.type ~= "node" then return end
|
||||||
@ -85,9 +80,22 @@ if industrialtest.mclAvailable then
|
|||||||
end
|
end
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
|
|
||||||
industrialtest.internal.explode=function(pos,radius,dropChance)
|
industrialtest.internal.explode=function(pos,radius,dropChance)
|
||||||
mcl_explosions.explode(pos,radius,{drop_chance=dropChance})
|
mcl_explosions.explode(pos,radius,{drop_chance=dropChance})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
industrialtest.internal.getItemSlotBg=mcl_formspec.get_itemslot_bg
|
||||||
|
elseif industrialtest.mtgAvailable then
|
||||||
|
industrialtest.stackMax=99
|
||||||
|
|
||||||
|
industrialtest.internal.explode=function(pos,radius)
|
||||||
|
tnt.boom(pos,{radius=radius})
|
||||||
|
end
|
||||||
|
|
||||||
|
industrialtest.internal.getItemSlotBg=function()
|
||||||
|
return ""
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- compatibilty that adds not existing elements
|
-- compatibilty that adds not existing elements
|
||||||
@ -610,11 +618,33 @@ if industrialtest.mclAvailable then
|
|||||||
y_max=mcl_worlds.layer_to_y(16),
|
y_max=mcl_worlds.layer_to_y(16),
|
||||||
y_min=mcl_vars.mg_overworld_min
|
y_min=mcl_vars.mg_overworld_min
|
||||||
})
|
})
|
||||||
elseif industrialtest.mtgAvailable then
|
|
||||||
industrialtest.internal.explode=function(pos,radius)
|
|
||||||
tnt.boom(pos,{radius=radius})
|
|
||||||
end
|
|
||||||
|
|
||||||
|
mcl_craftguide.register_craft_type("industrialtest.macerating", {
|
||||||
|
description = S("Macerating"),
|
||||||
|
icon = "industrialtest_machine_block.png^industrialtest_macerator_front_active.png"
|
||||||
|
})
|
||||||
|
mcl_craftguide.register_craft_type("industrialtest.compressing", {
|
||||||
|
description = S("Compressing"),
|
||||||
|
icon = "industrialtest_machine_block.png^industrialtest_compressor_front_active.png"
|
||||||
|
})
|
||||||
|
mcl_craftguide.register_craft_type("industrialtest.extracting", {
|
||||||
|
description = S("Extracting"),
|
||||||
|
icon = "industrialtest_machine_block.png^industrialtest_extractor_front_active.png"
|
||||||
|
})
|
||||||
|
mcl_craftguide.register_craft_type("industrialtest.recycling", {
|
||||||
|
description = S("Recycling"),
|
||||||
|
icon = "industrialtest_machine_block.png^industrialtest_recycler_top_active.png"
|
||||||
|
})
|
||||||
|
mcl_craftguide.register_craft_type("industrialtest.cable_forming", {
|
||||||
|
description = S("Cable Forming"),
|
||||||
|
icon = "industrialtest_machine_block.png^industrialtest_cable_former_front_active.png"
|
||||||
|
})
|
||||||
|
mcl_craftguide.register_craft_type("industrialtest.mass_fabricating", {
|
||||||
|
description = S("Mass Fabricating"),
|
||||||
|
icon = "industrialtest_machine_block.png^industrialtest_mass_fabricator_front_active.png"
|
||||||
|
})
|
||||||
|
|
||||||
|
elseif industrialtest.mtgAvailable then
|
||||||
industrialtest.internal.registerMetal=function(name,displayName,hardness)
|
industrialtest.internal.registerMetal=function(name,displayName,hardness)
|
||||||
minetest.register_craftitem("industrialtest:"..name.."_lump",{
|
minetest.register_craftitem("industrialtest:"..name.."_lump",{
|
||||||
description=S(displayName.." Lump"),
|
description=S(displayName.." Lump"),
|
||||||
|
@ -15,6 +15,23 @@
|
|||||||
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
local S=minetest.get_translator("industrialtest")
|
local S=minetest.get_translator("industrialtest")
|
||||||
|
local colors={
|
||||||
|
bronze="#be4325ff",
|
||||||
|
clay="#707070ff",
|
||||||
|
coal="#262523ff",
|
||||||
|
copper="#bf644aff",
|
||||||
|
diamond="#77cefbff",
|
||||||
|
gold="#eac162ff",
|
||||||
|
iron="#afaca5ff",
|
||||||
|
lapis_lazuli="#3a4cceff",
|
||||||
|
lead="#6d6393ff",
|
||||||
|
mese="#909000ff",
|
||||||
|
obsidian="#292843ff",
|
||||||
|
refined_iron="#94bab9ff",
|
||||||
|
sulfur="#b88805ff",
|
||||||
|
tin="#ebd182ff",
|
||||||
|
uranium="#3b8c09ff",
|
||||||
|
}
|
||||||
|
|
||||||
-- Power storage items
|
-- Power storage items
|
||||||
minetest.register_tool("industrialtest:re_battery",{
|
minetest.register_tool("industrialtest:re_battery",{
|
||||||
@ -197,13 +214,13 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("coal","Coal",resources,"#262523ff",true)
|
industrialtest.api.registerResourceDust("coal","Coal",resources,colors.coal,true)
|
||||||
industrialtest.api.registerResourceDust("clay","Clay",{
|
industrialtest.api.registerResourceDust("clay","Clay",{
|
||||||
{
|
{
|
||||||
resource=industrialtest.elementKeys.clayBlock,
|
resource=industrialtest.elementKeys.clayBlock,
|
||||||
count=2
|
count=2
|
||||||
}
|
}
|
||||||
},"#707070ff",true)
|
},colors.clay,true)
|
||||||
resources={
|
resources={
|
||||||
{
|
{
|
||||||
resource=industrialtest.elementKeys.diamondBlock,
|
resource=industrialtest.elementKeys.diamondBlock,
|
||||||
@ -221,7 +238,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("diamond","Diamond",resources,"#77cefbff",true)
|
industrialtest.api.registerResourceDust("diamond","Diamond",resources,colors.diamond,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output=industrialtest.elementKeys.diamond,
|
output=industrialtest.elementKeys.diamond,
|
||||||
@ -248,7 +265,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("iron","Iron",resources,"#afaca5ff",true)
|
industrialtest.api.registerResourceDust("iron","Iron",resources,colors.iron,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output=industrialtest.elementKeys.ironIngot,
|
output=industrialtest.elementKeys.ironIngot,
|
||||||
@ -269,9 +286,9 @@ if industrialtest.mclAvailable then
|
|||||||
count=9
|
count=9
|
||||||
},
|
},
|
||||||
{resource="mcl_core:lapis_lazuli"}
|
{resource="mcl_core:lapis_lazuli"}
|
||||||
},"#3a4cceff",true)
|
},colors.lapis_lazuli,true)
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("obsidian","Obsidian",{{resource=industrialtest.elementKeys.obsidian}},"#292843ff",true)
|
industrialtest.api.registerResourceDust("obsidian","Obsidian",{{resource=industrialtest.elementKeys.obsidian}},colors.obsidian,true)
|
||||||
resources={
|
resources={
|
||||||
{
|
{
|
||||||
resource=industrialtest.elementKeys.goldBlock,
|
resource=industrialtest.elementKeys.goldBlock,
|
||||||
@ -293,7 +310,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("gold","Gold",resources,"#eac162ff",true)
|
industrialtest.api.registerResourceDust("gold","Gold",resources,colors.gold,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output=industrialtest.elementKeys.goldIngot,
|
output=industrialtest.elementKeys.goldIngot,
|
||||||
@ -320,7 +337,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("copper","Copper",resources,"#bf644aff",true)
|
industrialtest.api.registerResourceDust("copper","Copper",resources,colors.copper,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output=industrialtest.elementKeys.copperIngot,
|
output=industrialtest.elementKeys.copperIngot,
|
||||||
@ -347,7 +364,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("tin","Tin",resources,"#ebd182ff",true)
|
industrialtest.api.registerResourceDust("tin","Tin",resources,colors.tin,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output=industrialtest.elementKeys.tinIngot,
|
output=industrialtest.elementKeys.tinIngot,
|
||||||
@ -374,7 +391,7 @@ if industrialtest.mclAvailable then
|
|||||||
count=2
|
count=2
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
industrialtest.api.registerResourceDust("uranium","Uranium",resources,"#3b8c09ff",true)
|
industrialtest.api.registerResourceDust("uranium","Uranium",resources,colors.uranium,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output="industrialtest:uranium_ingot",
|
output="industrialtest:uranium_ingot",
|
||||||
@ -391,7 +408,7 @@ if industrialtest.mtgAvailable then
|
|||||||
count=2
|
count=2
|
||||||
},
|
},
|
||||||
{resource="default:mese_crystal"}
|
{resource="default:mese_crystal"}
|
||||||
},"#909000ff",true)
|
},colors.mese,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output="default:mese_crystal",
|
output="default:mese_crystal",
|
||||||
@ -404,7 +421,7 @@ industrialtest.api.registerResourceDust("bronze","Bronze",{
|
|||||||
count=9
|
count=9
|
||||||
},
|
},
|
||||||
{resource=industrialtest.elementKeys.bronzeIngot}
|
{resource=industrialtest.elementKeys.bronzeIngot}
|
||||||
},"#be4325ff",true)
|
},colors.bronze,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="shaped",
|
type="shaped",
|
||||||
output="industrialtest:bronze_dust 9",
|
output="industrialtest:bronze_dust 9",
|
||||||
@ -431,7 +448,7 @@ industrialtest.api.registerRotaryMaceratorModifier({
|
|||||||
output="industrialtest:bronze_dust",
|
output="industrialtest:bronze_dust",
|
||||||
uses=4
|
uses=4
|
||||||
})
|
})
|
||||||
industrialtest.api.registerResourceDust("sulfur","Sulfur",{},"#b88805ff",false)
|
industrialtest.api.registerResourceDust("sulfur","Sulfur",{},colors.sulfur,false)
|
||||||
industrialtest.api.registerExtractorRecipe({
|
industrialtest.api.registerExtractorRecipe({
|
||||||
output="industrialtest:sulfur_dust",
|
output="industrialtest:sulfur_dust",
|
||||||
recipe=industrialtest.elementKeys.gunpowder
|
recipe=industrialtest.elementKeys.gunpowder
|
||||||
@ -450,7 +467,7 @@ industrialtest.api.registerResourceDust("lead","Lead",{
|
|||||||
count=2
|
count=2
|
||||||
},
|
},
|
||||||
{resource="industrialtest:lead_ingot"}
|
{resource="industrialtest:lead_ingot"}
|
||||||
},"#6d6393ff",true)
|
},colors.lead,true)
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type="cooking",
|
type="cooking",
|
||||||
output="industrialtest:lead_ingot",
|
output="industrialtest:lead_ingot",
|
||||||
@ -461,7 +478,7 @@ industrialtest.api.registerResourceDust("refined_iron","Refined Iron",{
|
|||||||
resource="industrialtest:refined_iron_ingot",
|
resource="industrialtest:refined_iron_ingot",
|
||||||
count=1
|
count=1
|
||||||
}
|
}
|
||||||
},"#94bab9ff",true)
|
},colors.refined_iron,true)
|
||||||
industrialtest.api.registerRotaryMaceratorModifier({
|
industrialtest.api.registerRotaryMaceratorModifier({
|
||||||
name=industrialtest.elementKeys.ironLump,
|
name=industrialtest.elementKeys.ironLump,
|
||||||
modifier=industrialtest.elementKeys.coal,
|
modifier=industrialtest.elementKeys.coal,
|
||||||
@ -524,14 +541,14 @@ industrialtest.api.registerPlate("bronze_plate",S("Bronze Plate"),{
|
|||||||
resource=industrialtest.elementKeys.bronzeIngot,
|
resource=industrialtest.elementKeys.bronzeIngot,
|
||||||
count=1
|
count=1
|
||||||
}
|
}
|
||||||
},"#e48e88ff",true)
|
},colors.bronze,true)
|
||||||
|
|
||||||
industrialtest.api.registerPlate("copper_plate",S("Copper Plate"),{
|
industrialtest.api.registerPlate("copper_plate",S("Copper Plate"),{
|
||||||
{
|
{
|
||||||
resource=industrialtest.elementKeys.copperIngot,
|
resource=industrialtest.elementKeys.copperIngot,
|
||||||
count=1
|
count=1
|
||||||
}
|
}
|
||||||
},"#f48e44ff",true)
|
},colors.copper,true)
|
||||||
|
|
||||||
industrialtest.api.registerPlate("advanced_alloy",S("Advanced Alloy"),{
|
industrialtest.api.registerPlate("advanced_alloy",S("Advanced Alloy"),{
|
||||||
{
|
{
|
||||||
@ -552,14 +569,14 @@ industrialtest.api.registerPlate("tin_plate",S("Tin Plate"),{
|
|||||||
resource=industrialtest.elementKeys.tinIngot,
|
resource=industrialtest.elementKeys.tinIngot,
|
||||||
count=1
|
count=1
|
||||||
}
|
}
|
||||||
},"#e0e0e0ff",true)
|
},colors.tin,true)
|
||||||
|
|
||||||
industrialtest.api.registerPlate("lead_plate",S("Lead Plate"),{
|
industrialtest.api.registerPlate("lead_plate",S("Lead Plate"),{
|
||||||
{
|
{
|
||||||
resource="industrialtest:lead_ingot",
|
resource="industrialtest:lead_ingot",
|
||||||
count=1
|
count=1
|
||||||
}
|
}
|
||||||
},"#eafef8ff",true)
|
},colors.lead,true)
|
||||||
|
|
||||||
industrialtest.api.registerPlate("iridium_plate",S("Iridium Plate"),{},false,"#ffffffff")
|
industrialtest.api.registerPlate("iridium_plate",S("Iridium Plate"),{},false,"#ffffffff")
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -24,7 +24,7 @@ industrialtest.internal.registerSimpleElectricItemProcessor({
|
|||||||
capacity=1400,
|
capacity=1400,
|
||||||
flow=industrialtest.api.lvPowerFlow,
|
flow=industrialtest.api.lvPowerFlow,
|
||||||
opPower=80,
|
opPower=80,
|
||||||
method="industrialtest.cable_forming",
|
method=industrialtest.api.craftingMethods.cableForming,
|
||||||
efficiency=1
|
efficiency=1
|
||||||
})
|
})
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -24,46 +24,24 @@ canningMachine.getFormspec=function(pos)
|
|||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
||||||
local srcPercent=meta:get_float("srcTime")/canningMachine.canningTime*100
|
local srcPercent=meta:get_float("srcTime")/canningMachine.canningTime*100
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.4,1.8;1,1]",
|
|
||||||
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
|
||||||
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
|
||||||
"list[context;powerStorage;3.4,3.9;1,1]",
|
|
||||||
(srcPercent>0 and "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
|
||||||
or "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
|
||||||
"list[context;dst;6.4,1.8;1,1]",
|
|
||||||
"list[context;leftover;6.4,2.8;1,1]",
|
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
|
||||||
"listring[context;src]",
|
|
||||||
"listring[context;powerStorage]",
|
|
||||||
"listring[context;dst]",
|
|
||||||
"listring[context;leftover]",
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.4,1.8;1,1]",
|
"list[context;src;3.4,1.8;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(3.4,1.8,1,1),
|
industrialtest.internal.getItemSlotBg(3.4,1.8,1,1),
|
||||||
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
||||||
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
||||||
"list[context;powerStorage;3.4,3.9;1,1]",
|
"list[context;powerStorage;3.4,3.9;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(3.4,3.9,1,1),
|
industrialtest.internal.getItemSlotBg(3.4,3.9,1,1),
|
||||||
(srcPercent>0 and "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
(srcPercent>0 and "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
or "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
or "image[4.9,1.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
"list[context;dst;6.4,1.8;1,1]",
|
"list[context;dst;6.4,1.8;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(6.4,1.8,1,1),
|
industrialtest.internal.getItemSlotBg(6.4,1.8,1,1),
|
||||||
"list[context;leftover;6.4,2.8;1,1]",
|
"list[context;leftover;6.4,2.8;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(6.4,2.8,1,1),
|
industrialtest.internal.getItemSlotBg(6.4,2.8,1,1),
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
"list[context;upgrades;9,0.9;1,4]",
|
||||||
mcl_formspec.get_itemslot_bg(9,0.9,1,4),
|
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||||
"listring[context;src]",
|
"listring[context;src]",
|
||||||
"listring[context;powerStorage]",
|
"listring[context;dst]"
|
||||||
"listring[context;dst]",
|
}
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -71,32 +71,18 @@ end
|
|||||||
chargepad.getFormspec=function(pos)
|
chargepad.getFormspec=function(pos)
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
"list[context;charged;1,2.5;1,1]",
|
||||||
formspec={
|
industrialtest.internal.getItemSlotBg(1,2.5,1,1),
|
||||||
"list[context;charged;1,2.5;1,1]",
|
"label[0.9,3.9;"..S("Charge").."]",
|
||||||
"listring[context;charged]",
|
"list[context;discharged;3,2.5;1,1]",
|
||||||
"label[0.9,3.9;"..S("Charge").."]",
|
industrialtest.internal.getItemSlotBg(3,2.5,1,1),
|
||||||
"list[context;discharged;3,2.5;1,1]",
|
"label[2.7,3.9;"..S("Discharge").."]",
|
||||||
"listring[context;discharged]",
|
"box[9,1;0.3,4.8;#202020]",
|
||||||
"label[2.7,3.9;"..S("Discharge").."]",
|
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
"listring[context;charged]",
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
"listring[context;discharged]"
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;1,2.5;1,1]",
|
|
||||||
"listring[context;charged]",
|
|
||||||
mcl_formspec.get_itemslot_bg(1,2.5,1,1),
|
|
||||||
"label[0.9,3.9;"..S("Charge").."]",
|
|
||||||
"list[context;discharged;3,2.5;1,1]",
|
|
||||||
"listring[context;discharged]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3,2.5,1,1),
|
|
||||||
"label[2.7,3.9;"..S("Discharge").."]",
|
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -72,19 +72,21 @@ machine.getFormspec=function(pos,config)
|
|||||||
"formspec_version[4]",
|
"formspec_version[4]",
|
||||||
"size[10.8,12]",
|
"size[10.8,12]",
|
||||||
"label[0.5,0.5;"..config.displayName.."]",
|
"label[0.5,0.5;"..config.displayName.."]",
|
||||||
(config.getFormspec and config.getFormspec(pos) or ""),
|
|
||||||
"list[current_player;main;0.5,6.25;8,1]",
|
"list[current_player;main;0.5,6.25;8,1]",
|
||||||
"list[current_player;main;0.5,7.5;8,3;8]"
|
"list[current_player;main;0.5,7.5;8,3;8]",
|
||||||
|
"listring[current_player;main]",
|
||||||
|
(config.getFormspec and config.getFormspec(pos) or "")
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
elseif industrialtest.mclAvailable then
|
||||||
formspec={
|
formspec={
|
||||||
"size[10.04,12]",
|
"size[10.04,12]",
|
||||||
"label[0.25,0.25;"..config.displayName.."]",
|
"label[0.25,0.25;"..config.displayName.."]",
|
||||||
(config.getFormspec and config.getFormspec(pos) or ""),
|
|
||||||
"list[current_player;main;0.5,7;9,3;9]",
|
"list[current_player;main;0.5,7;9,3;9]",
|
||||||
mcl_formspec.get_itemslot_bg(0.5,7,9,3),
|
mcl_formspec.get_itemslot_bg(0.5,7,9,3),
|
||||||
"list[current_player;main;0.5,10.24;9,1]",
|
"list[current_player;main;0.5,10.24;9,1]",
|
||||||
mcl_formspec.get_itemslot_bg(0.5,10.24,9,1)
|
mcl_formspec.get_itemslot_bg(0.5,10.24,9,1),
|
||||||
|
"listring[current_player;main]",
|
||||||
|
(config.getFormspec and config.getFormspec(pos) or "")
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
@ -453,7 +455,7 @@ local function craftResultProxy(method,item)
|
|||||||
time=output.time,
|
time=output.time,
|
||||||
src=after.items[1]
|
src=after.items[1]
|
||||||
}
|
}
|
||||||
elseif method=="industrialtest.macerating" then
|
elseif method==industrialtest.api.craftingMethods.macerating then
|
||||||
local output=industrialtest.api.getMaceratorRecipeResult(item:get_name())
|
local output=industrialtest.api.getMaceratorRecipeResult(item:get_name())
|
||||||
if not output then
|
if not output then
|
||||||
return {
|
return {
|
||||||
@ -469,7 +471,7 @@ local function craftResultProxy(method,item)
|
|||||||
time=output.time,
|
time=output.time,
|
||||||
src=srcAfter
|
src=srcAfter
|
||||||
}
|
}
|
||||||
elseif method=="industrialtest.compressing" then
|
elseif method==industrialtest.api.craftingMethods.compressing then
|
||||||
local output=industrialtest.api.getCompressorRecipeResult(item:get_name())
|
local output=industrialtest.api.getCompressorRecipeResult(item:get_name())
|
||||||
if not output or item:get_count()<output.count then
|
if not output or item:get_count()<output.count then
|
||||||
return {
|
return {
|
||||||
@ -485,7 +487,7 @@ local function craftResultProxy(method,item)
|
|||||||
time=output.time,
|
time=output.time,
|
||||||
src=srcAfter
|
src=srcAfter
|
||||||
}
|
}
|
||||||
elseif method=="industrialtest.extracting" then
|
elseif method==industrialtest.api.craftingMethods.extracting then
|
||||||
local output=industrialtest.api.getExtractorRecipeResult(item:get_name())
|
local output=industrialtest.api.getExtractorRecipeResult(item:get_name())
|
||||||
if not output then
|
if not output then
|
||||||
return {
|
return {
|
||||||
@ -501,7 +503,7 @@ local function craftResultProxy(method,item)
|
|||||||
time=output.time,
|
time=output.time,
|
||||||
src=srcAfter
|
src=srcAfter
|
||||||
}
|
}
|
||||||
elseif method=="industrialtest.recycling" then
|
elseif method==industrialtest.api.craftingMethods.recycling then
|
||||||
local srcAfter=ItemStack(item:get_name())
|
local srcAfter=ItemStack(item:get_name())
|
||||||
srcAfter:set_count(item:get_count()-1)
|
srcAfter:set_count(item:get_count()-1)
|
||||||
return {
|
return {
|
||||||
@ -509,7 +511,7 @@ local function craftResultProxy(method,item)
|
|||||||
time=2,
|
time=2,
|
||||||
src=srcAfter
|
src=srcAfter
|
||||||
}
|
}
|
||||||
elseif method=="industrialtest.cable_forming" then
|
elseif method==industrialtest.api.craftingMethods.cableForming then
|
||||||
local output=industrialtest.api.getCableFormerRecipeResult(item:get_name())
|
local output=industrialtest.api.getCableFormerRecipeResult(item:get_name())
|
||||||
if not output then
|
if not output then
|
||||||
return {
|
return {
|
||||||
@ -525,7 +527,7 @@ local function craftResultProxy(method,item)
|
|||||||
time=output.time,
|
time=output.time,
|
||||||
src=srcAfter
|
src=srcAfter
|
||||||
}
|
}
|
||||||
elseif method=="industrialtest.mass_fabricating" then
|
elseif method==industrialtest.api.craftingMethods.massFabricating then
|
||||||
if item:get_count()<34 then
|
if item:get_count()<34 then
|
||||||
return {
|
return {
|
||||||
item=ItemStack(),
|
item=ItemStack(),
|
||||||
@ -548,42 +550,22 @@ simpleElectricItemProcessor.getFormspec=function(pos)
|
|||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
||||||
local srcPercent=meta:get_float("srcTime")/meta:get_float("maxSrcTime")*100
|
local srcPercent=meta:get_float("srcTime")/meta:get_float("maxSrcTime")*100
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
"list[context;src;3.4,1.8;1,1]",
|
||||||
formspec={
|
industrialtest.internal.getItemSlotBg(3.4,1.8,1,1),
|
||||||
"list[context;src;3.4,1.8;1,1]",
|
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
||||||
"listring[context;src]",
|
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
||||||
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
"list[context;powerStorage;3.4,3.9;1,1]",
|
||||||
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
industrialtest.internal.getItemSlotBg(3.4,3.9,1,1),
|
||||||
"list[context;powerStorage;3.4,3.9;1,1]",
|
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
"listring[context;powerStorage]",
|
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
"list[context;dst;6.4,2.8;1,1]",
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
industrialtest.internal.getItemSlotBg(6.4,2.8,1,1),
|
||||||
"list[context;dst;6.4,2.8;1,1]",
|
"list[context;upgrades;9,0.9;1,4]",
|
||||||
"listring[context;dst]",
|
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
"listring[context;src]",
|
||||||
"listring[context;upgrades]"
|
"listring[context;dst]"
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.4,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.4,1.8,1,1),
|
|
||||||
"listring[context;src]",
|
|
||||||
(powerPercent>0 and "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
|
||||||
or "image[3.4,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
|
||||||
"list[context;powerStorage;3.4,3.9;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.4,3.9,1,1),
|
|
||||||
"listring[context;powerStorage]",
|
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
|
||||||
"list[context;dst;6.4,2.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(6.4,2.8,1,1),
|
|
||||||
"listring[context;dst]",
|
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
|
||||||
mcl_formspec.get_itemslot_bg(9,0.9,1,4),
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ industrialtest.internal.registerSimpleElectricItemProcessor({
|
|||||||
capacity=1400,
|
capacity=1400,
|
||||||
flow=industrialtest.api.lvPowerFlow,
|
flow=industrialtest.api.lvPowerFlow,
|
||||||
opPower=120,
|
opPower=120,
|
||||||
method="industrialtest.compressing",
|
method=industrialtest.api.craftingMethods.compressing,
|
||||||
efficiency=1
|
efficiency=1
|
||||||
})
|
})
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -22,37 +22,21 @@ fluidGenerator.getFormspec=function(pos,config)
|
|||||||
local fluidPercent=meta:get_float("fluidAmount")/100
|
local fluidPercent=meta:get_float("fluidAmount")/100
|
||||||
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||||
local fluid=meta:get_string("fluid")
|
local fluid=meta:get_string("fluid")
|
||||||
local formspec
|
|
||||||
local fuel=config.getFuel(fluid)
|
local fuel=config.getFuel(fluid)
|
||||||
local tile=(fuel and fuel.texture or "industrialtest_gui_fluid_bg.png")
|
local tile=(fuel and fuel.texture or "industrialtest_gui_fluid_bg.png")
|
||||||
if industrialtest.mtgAvailable then
|
local formspec={
|
||||||
formspec={
|
"list[context;src;2,1.8;1,1]",
|
||||||
"list[context;src;2,1.8;1,1]",
|
industrialtest.internal.getItemSlotBg(2,1.8,1,1),
|
||||||
"listring[context;src]",
|
(fluidPercent>0 and "image[2,3;1,1;industrialtest_gui_fluid_bg.png^[lowpart:"..fluidPercent..":"..tile.."]" or "image[2,3;1,1;industrialtest_gui_fluid_bg.png]"),
|
||||||
(fluidPercent>0 and "image[2,3;1,1;industrialtest_gui_fluid_bg.png^[lowpart:"..fluidPercent..":"..tile.."]" or "image[2,3;1,1;industrialtest_gui_fluid_bg.png]"),
|
"list[context;dst;2,4.2;1,1]",
|
||||||
"list[context;dst;2,4.2;1,1]",
|
industrialtest.internal.getItemSlotBg(2,4.2,1,1),
|
||||||
"listring[context;dst]",
|
"list[context;charged;6,3;1,1]",
|
||||||
"list[context;charged;6,3;1,1]",
|
industrialtest.internal.getItemSlotBg(6,3,1,1),
|
||||||
"listring[context;charged]",
|
"box[9,1;0.3,4.8;#202020]",
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
(powerPercent>0 and "box[9,"..(1+4.8-(powerPercent*4.8))..";0.3,"..(powerPercent*4.8)..";#FF1010]" or ""),
|
||||||
(powerPercent>0 and "box[9,"..(1+4.8-(powerPercent*4.8))..";0.3,"..(powerPercent*4.8)..";#FF1010]" or "")
|
"listring[context;src]",
|
||||||
}
|
"listring[context;dst]"
|
||||||
elseif industrialtest.mclAvailable then
|
}
|
||||||
formspec={
|
|
||||||
"list[context;src;2,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(2,1.8,1,1),
|
|
||||||
"listring[context;src]",
|
|
||||||
(fluidPercent>0 and "image[2,3;1,1;industrialtest_gui_fluid_bg.png^[lowpart:"..fluidPercent..":"..tile.."]" or "image[2,3;1,1;industrialtest_gui_fluid_bg.png]"),
|
|
||||||
"list[context;dst;2,4.2;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(2,4.2,1,1),
|
|
||||||
"listring[context;dst]",
|
|
||||||
"list[context;charged;6,3;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(6,3,1,1),
|
|
||||||
"listring[context;charged]",
|
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
|
||||||
(powerPercent>0 and "box[9,"..(1+4.8-(powerPercent*4.8))..";0.3,"..(powerPercent*4.8)..";#FF1010]" or "")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -21,32 +21,17 @@ generator.getFormspec=function(pos)
|
|||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local fuelPercent=meta:get_int("fuelTime")/meta:get_int("maxFuelTime")*100
|
local fuelPercent=meta:get_int("fuelTime")/meta:get_int("maxFuelTime")*100
|
||||||
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
"list[context;charged;4.7,1.8;1,1]",
|
||||||
formspec={
|
industrialtest.internal.getItemSlotBg(4.7,1.8,1,1),
|
||||||
"list[context;charged;4.9,1.8;1,1]",
|
(fuelPercent>0 and "image[4.7,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
||||||
"listring[context;charged]",
|
or "image[4.7,2.8;1,1;default_furnace_fire_bg.png]"),
|
||||||
(fuelPercent>0 and "image[4.9,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
"list[context;src;4.7,3.9;1,1]",
|
||||||
or "image[4.9,2.8;1,1;default_furnace_fire_bg.png]"),
|
industrialtest.internal.getItemSlotBg(4.7,3.9,1,1),
|
||||||
"list[context;src;4.9,3.9;1,1]",
|
"box[9,1;0.3,4.8;#202020]",
|
||||||
"listring[context;src]",
|
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
"listring[context;src]"
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
}
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;4.7,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(4.7,1.8,1,1),
|
|
||||||
"listring[context;charged]",
|
|
||||||
(fuelPercent>0 and "image[4.7,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
|
||||||
or "image[4.7,2.8;1,1;default_furnace_fire_bg.png]"),
|
|
||||||
"list[context;src;4.7,3.9;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(4.7,3.9,1,1),
|
|
||||||
"listring[context;src]",
|
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -43,44 +43,23 @@ inductionFurnace.getFormspec=function(pos)
|
|||||||
local maxSrcTime=meta:get_float("maxSrcTime")
|
local maxSrcTime=meta:get_float("maxSrcTime")
|
||||||
local srcPercent=maxSrcTime>0 and meta:get_float("srcTime")/maxSrcTime*100 or 0
|
local srcPercent=maxSrcTime>0 and meta:get_float("srcTime")/maxSrcTime*100 or 0
|
||||||
local heat=meta:get_int("heat")
|
local heat=meta:get_int("heat")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.7,1.8;2,1]",
|
"list[context;src;3.7,1.8;2,1]",
|
||||||
|
industrialtest.internal.getItemSlotBg(3.7,1.8,2,1),
|
||||||
(powerPercent>0 and "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
(powerPercent>0 and "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
||||||
or "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
or "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
||||||
"list[context;powerStorage;3.7,3.9;1,1]",
|
"list[context;powerStorage;3.7,3.9;1,1]",
|
||||||
|
industrialtest.internal.getItemSlotBg(3.7,3.9,1,1),
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
"list[context;dst;6,2.8;2,1;]",
|
"list[context;dst;6,2.8;2,1;]",
|
||||||
|
industrialtest.internal.getItemSlotBg(6,2.8,2,1),
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
"list[context;upgrades;9,0.9;1,4]",
|
||||||
|
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||||
"label[0.5,2.8;"..minetest.formspec_escape(S("Heat: @1 %",heat)).."]",
|
"label[0.5,2.8;"..minetest.formspec_escape(S("Heat: @1 %",heat)).."]",
|
||||||
"listring[context;src]",
|
"listring[context;src]",
|
||||||
"listring[context;powerStorage]",
|
"listring[context;dst]"
|
||||||
"listring[context;dst]",
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.7,1.8;2,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.7,1.8,2,1),
|
|
||||||
(powerPercent>0 and "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
|
||||||
or "image[3.7,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
|
||||||
"list[context;powerStorage;3.7,3.9;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.7,3.9,1,1),
|
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
|
||||||
"list[context;dst;6,2.8;2,1;]",
|
|
||||||
mcl_formspec.get_itemslot_bg(6,2.8,2,1),
|
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
|
||||||
mcl_formspec.get_itemslot_bg(9,0.9,1,4),
|
|
||||||
"label[0.5,2.8;"..minetest.formspec_escape(S("Heat: @1 %",heat)).."]",
|
|
||||||
"listring[context;src]",
|
|
||||||
"listring[context;powerStorage]",
|
|
||||||
"listring[context;dst]",
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -25,17 +25,17 @@ ironFurnace.getFormspec=function(fuelPercent,srcPercent)
|
|||||||
"size[10.8,12]",
|
"size[10.8,12]",
|
||||||
"label[0.5,0.5;"..S("Iron Furnace").."]",
|
"label[0.5,0.5;"..S("Iron Furnace").."]",
|
||||||
"list[context;src;3.4,1.8;1,1]",
|
"list[context;src;3.4,1.8;1,1]",
|
||||||
"listring[context;src]",
|
|
||||||
(fuelPercent>0 and "image[3.4,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
(fuelPercent>0 and "image[3.4,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
||||||
or "image[3.4,2.8;1,1;default_furnace_fire_bg.png]"),
|
or "image[3.4,2.8;1,1;default_furnace_fire_bg.png]"),
|
||||||
"list[context;fuel;3.4,3.9;1,1]",
|
"list[context;fuel;3.4,3.9;1,1]",
|
||||||
"listring[context;fuel]",
|
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
"list[context;dst;6.4,2.8;1,1]",
|
"list[context;dst;6.4,2.8;1,1]",
|
||||||
"listring[context;dst]",
|
|
||||||
"list[current_player;main;0.5,6.25;8,1]",
|
"list[current_player;main;0.5,6.25;8,1]",
|
||||||
"list[current_player;main;0.5,7.5;8,3;8]"
|
"list[current_player;main;0.5,7.5;8,3;8]",
|
||||||
|
"listring[current_player;main]",
|
||||||
|
"listring[context;src]",
|
||||||
|
"listring[context;dst]"
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
elseif industrialtest.mclAvailable then
|
||||||
formspec={
|
formspec={
|
||||||
@ -43,21 +43,21 @@ ironFurnace.getFormspec=function(fuelPercent,srcPercent)
|
|||||||
"label[0.25,0.25;"..S("Iron Furnace").."]",
|
"label[0.25,0.25;"..S("Iron Furnace").."]",
|
||||||
"list[context;src;3.4,1.8;1,1]",
|
"list[context;src;3.4,1.8;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(3.4,1.8,1,1),
|
mcl_formspec.get_itemslot_bg(3.4,1.8,1,1),
|
||||||
"listring[context;src]",
|
|
||||||
(fuelPercent>0 and "image[3.4,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
(fuelPercent>0 and "image[3.4,2.8;1,1;default_furnace_fire_bg.png^[lowpart:"..fuelPercent..":default_furnace_fire_fg.png]"
|
||||||
or "image[3.4,2.8;1,1;default_furnace_fire_bg.png]"),
|
or "image[3.4,2.8;1,1;default_furnace_fire_bg.png]"),
|
||||||
"list[context;fuel;3.4,3.9;1,1]",
|
"list[context;fuel;3.4,3.9;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(3.4,3.9,1,1),
|
mcl_formspec.get_itemslot_bg(3.4,3.9,1,1),
|
||||||
"listring[context;fuel]",
|
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
"list[context;dst;6.4,2.8;1,1]",
|
"list[context;dst;6.4,2.8;1,1]",
|
||||||
mcl_formspec.get_itemslot_bg(6.4,2.8,1,1),
|
mcl_formspec.get_itemslot_bg(6.4,2.8,1,1),
|
||||||
"listring[context;dst]",
|
|
||||||
"list[current_player;main;0.5,7;9,3;9]",
|
"list[current_player;main;0.5,7;9,3;9]",
|
||||||
mcl_formspec.get_itemslot_bg(0.5,7,9,3),
|
mcl_formspec.get_itemslot_bg(0.5,7,9,3),
|
||||||
"list[current_player;main;0.5,10.24;9,1]",
|
"list[current_player;main;0.5,10.24;9,1]",
|
||||||
mcl_formspec.get_itemslot_bg(0.5,10.24,9,1)
|
mcl_formspec.get_itemslot_bg(0.5,10.24,9,1),
|
||||||
|
"listring[current_player;main]",
|
||||||
|
"listring[context;src]",
|
||||||
|
"listring[context;dst]"
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
|
@ -24,7 +24,7 @@ industrialtest.internal.registerSimpleElectricItemProcessor({
|
|||||||
capacity=1200,
|
capacity=1200,
|
||||||
flow=industrialtest.api.lvPowerFlow,
|
flow=industrialtest.api.lvPowerFlow,
|
||||||
opPower=100,
|
opPower=100,
|
||||||
method="industrialtest.macerating",
|
method=industrialtest.api.craftingMethods.macerating,
|
||||||
efficiency=1
|
efficiency=1
|
||||||
})
|
})
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
|
@ -23,30 +23,16 @@ reactor.getFormspec=function(pos)
|
|||||||
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||||
local size=math.floor(meta:get_int("size")/3)
|
local size=math.floor(meta:get_int("size")/3)
|
||||||
local switchText=(meta:get_int("enabled")==0 and S("Start") or S("Stop"))
|
local switchText=(meta:get_int("enabled")==0 and S("Start") or S("Stop"))
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
"list[context;fuel;1,1;"..size..","..size.."]",
|
||||||
formspec={
|
industrialtest.internal.getItemSlotBg(1,1,size,size),
|
||||||
"list[context;fuel;1,1;"..size..","..size.."]",
|
"list[context;charged;7,2.8;1,1]",
|
||||||
"listring[context;fuel]",
|
industrialtest.internal.getItemSlotBg(7.7,2.8,1,1),
|
||||||
"list[context;charged;7.7,2.8;1,1]",
|
"button[7.7,1;1,0.8;toggle;"..minetest.formspec_escape(switchText).."]",
|
||||||
"listring[context;charged]",
|
"box[9,1;0.3,4.8;#202020]",
|
||||||
"button[7.7,1;1,0.8;toggle;"..minetest.formspec_escape(switchText).."]",
|
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
"listring[context;fuel]"
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
}
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;fuel;1,1;"..size..","..size.."]",
|
|
||||||
mcl_formspec.get_itemslot_bg(1,1,size,size),
|
|
||||||
"listring[context;fuel]",
|
|
||||||
"list[context;charged;7,2.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(7.7,2.8,1,1),
|
|
||||||
"listring[context;charged]",
|
|
||||||
"button[7.7,1;1,0.8;toggle;"..minetest.formspec_escape(switchText).."]",
|
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -20,32 +20,18 @@ local powerStorage={}
|
|||||||
powerStorage.getFormspec=function(pos)
|
powerStorage.getFormspec=function(pos)
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
"list[context;charged;1,2.5;1,1]",
|
||||||
formspec={
|
industrialtest.internal.getItemSlotBg(1,2.5,1,1),
|
||||||
"list[context;charged;1,2.5;1,1]",
|
"label[0.9,3.9;"..S("Charge").."]",
|
||||||
"listring[context;charged]",
|
"list[context;discharged;3,2.5;1,1]",
|
||||||
"label[0.9,3.9;"..S("Charge").."]",
|
industrialtest.internal.getItemSlotBg(3,2.5,1,1),
|
||||||
"list[context;discharged;3,2.5;1,1]",
|
"label[2.7,3.9;"..S("Discharge").."]",
|
||||||
"listring[context;discharged]",
|
"box[9,1;0.3,4.8;#202020]",
|
||||||
"label[2.7,3.9;"..S("Discharge").."]",
|
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
"listring[context;charged]",
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
"listring[context;discharged]"
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;1,2.5;1,1]",
|
|
||||||
"listring[context;charged]",
|
|
||||||
mcl_formspec.get_itemslot_bg(1,2.5,1,1),
|
|
||||||
"label[0.9,3.9;"..S("Charge").."]",
|
|
||||||
"list[context;discharged;3,2.5;1,1]",
|
|
||||||
"listring[context;discharged]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3,2.5,1,1),
|
|
||||||
"label[2.7,3.9;"..S("Discharge").."]",
|
|
||||||
"box[9,1;0.3,4.8;#202020]",
|
|
||||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or "")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -27,51 +27,26 @@ rotaryMacerator.getFormspec=function(pos)
|
|||||||
local srcPercent=maxSrcTime>0 and meta:get_float("srcTime")/maxSrcTime*100 or 0
|
local srcPercent=maxSrcTime>0 and meta:get_float("srcTime")/maxSrcTime*100 or 0
|
||||||
local rpm=meta:get_int("rpm")
|
local rpm=meta:get_int("rpm")
|
||||||
local buttonMaintainSpeedText=meta:get_int("maintainSpeed")==1 and S("Don't maintain speed") or S("Maintain speed")
|
local buttonMaintainSpeedText=meta:get_int("maintainSpeed")==1 and S("Don't maintain speed") or S("Maintain speed")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
"list[context;src;3.8,1.8;1,1]",
|
||||||
formspec={
|
industrialtest.internal.getItemSlotBg(3.8,1.8,1,1),
|
||||||
"list[context;src;3.8,1.8;1,1]",
|
"list[context;modifier;4.9,1.8;1,1]",
|
||||||
"list[context;modifier;4.9,1.8;1,1]",
|
industrialtest.internal.getItemSlotBg(4.9,1.8,1,1),
|
||||||
(powerPercent>0 and "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
(powerPercent>0 and "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
||||||
or "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
or "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
||||||
"list[context;powerStorage;3.8,3.9;1,1]",
|
"list[context;powerStorage;3.8,3.9;1,1]",
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
industrialtest.internal.getItemSlotBg(3.8,3.9,1,1),
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
||||||
"list[context;dst;6,2.8;1,1;]",
|
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
"list[context;dst;6,2.8;1,1;]",
|
||||||
"label[0.5,2.8;"..minetest.formspec_escape(S("Speed: @1",rpm)).."]",
|
industrialtest.internal.getItemSlotBg(6,2.8,1,1),
|
||||||
"button[0.5,3.4;3,0.8;maintainSpeed;"..minetest.formspec_escape(buttonMaintainSpeedText).."]",
|
"list[context;upgrades;9,0.9;1,4]",
|
||||||
"listring[context;src]",
|
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||||
"listring[context;modifier]",
|
"label[0.5,2.8;"..minetest.formspec_escape(S("Speed: @1",rpm)).."]",
|
||||||
"listring[context;powerStorage]",
|
"button[0.5,3.4;3,0.8;maintainSpeed;"..minetest.formspec_escape(buttonMaintainSpeedText).."]",
|
||||||
"listring[context;dst]",
|
"listring[context;src]",
|
||||||
"listring[context;upgrades]"
|
"listring[context;dst]"
|
||||||
}
|
}
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;src;3.8,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.8,1.8,1,1),
|
|
||||||
"list[context;modifier;4.9,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(4.9,1.8,1,1),
|
|
||||||
(powerPercent>0 and "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
|
||||||
or "image[3.8,2.8;1,1;industrialtest_gui_electricity_bg.png]"),
|
|
||||||
"list[context;powerStorage;3.8,3.9;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.8,3.9,1,1),
|
|
||||||
(srcPercent>0 and "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[lowpart:"..srcPercent..":gui_furnace_arrow_fg.png^[transformR270]"
|
|
||||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
|
||||||
"list[context;dst;6,2.8;1,1;]",
|
|
||||||
mcl_formspec.get_itemslot_bg(6,2.8,1,1),
|
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
|
||||||
mcl_formspec.get_itemslot_bg(9,0.9,1,4),
|
|
||||||
"label[0.5,2.8;"..minetest.formspec_escape(S("Speed: @1",rpm)).."]",
|
|
||||||
"button[0.5,3.4;3,0.8;maintainSpeed;"..minetest.formspec_escape(buttonMaintainSpeedText).."]",
|
|
||||||
"listring[context;src]",
|
|
||||||
"listring[context;modifier]",
|
|
||||||
"listring[context;powerStorage]",
|
|
||||||
"listring[context;dst]",
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -20,23 +20,13 @@ local solarPanel={}
|
|||||||
solarPanel.getFormspec=function(pos)
|
solarPanel.getFormspec=function(pos)
|
||||||
local amount=minetest.get_natural_light(vector.offset(pos,0,1,0))/15.0
|
local amount=minetest.get_natural_light(vector.offset(pos,0,1,0))/15.0
|
||||||
local charging=amount>0.5
|
local charging=amount>0.5
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
"list[context;charged;4.7,1.8;1,1]",
|
||||||
formspec={
|
industrialtest.internal.getItemSlotBg(4.7,1.8,1,1),
|
||||||
"list[context;charged;4.9,1.8;1,1]",
|
(charging and "image[4.7,2.8;1,1;industrialtest_gui_sun_fg.png]"
|
||||||
"listring[context;charged]",
|
or "image[4.7,2.8;1,1;industrialtest_gui_sun_bg.png]"),
|
||||||
(charging and "image[4.9,2.8;1,1;industrialtest_gui_sun_fg.png]"
|
"listring[context;charged]"
|
||||||
or "image[4.9,2.8;1,1;industrialtest_gui_sun_bg.png]")
|
}
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;4.7,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(4.7,1.8,1,1),
|
|
||||||
"listring[context;charged]",
|
|
||||||
(charging and "image[4.7,2.8;1,1;industrialtest_gui_sun_fg.png]"
|
|
||||||
or "image[4.7,2.8;1,1;industrialtest_gui_sun_bg.png]")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -20,33 +20,17 @@ local toolWorkshop={}
|
|||||||
toolWorkshop.getFormspec=function(pos)
|
toolWorkshop.getFormspec=function(pos)
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
local powerPercent=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")*100
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
"list[context;powerStorage;3.7,3.7;1,1;0]",
|
||||||
formspec={
|
industrialtest.internal.getItemSlotBg(3.7,3.7,1,1),
|
||||||
"list[context;powerStorage;3.7,3.7;1,1;0]",
|
(powerPercent>0 and "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
||||||
"listring[context;powerStorage]",
|
or "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png]"),
|
||||||
(powerPercent>0 and "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
"list[context;src;5.9,3.2;1,1;0]",
|
||||||
or "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png]"),
|
industrialtest.internal.getItemSlotBg(5.9,3.2,1,1),
|
||||||
"list[context;src;5.9,3.2;1,1;0]",
|
"list[context;upgrades;9,0.9;1,4]",
|
||||||
"listring[context;src]",
|
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
"listring[context;src]"
|
||||||
"listring[context;upgrades]"
|
}
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;powerStorage;3.7,3.7;1,1;0]",
|
|
||||||
mcl_formspec.get_itemslot_bg(3.7,3.7,1,1),
|
|
||||||
"listring[context;powerStorage]",
|
|
||||||
(powerPercent>0 and "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png^[lowpart:"..powerPercent..":industrialtest_gui_electricity_fg.png]"
|
|
||||||
or "image[3.7,2.5;1,1;industrialtest_gui_electricity_bg.png]"),
|
|
||||||
"list[context;src;5.9,3.2;1,1;0]",
|
|
||||||
mcl_formspec.get_itemslot_bg(5.9,3.2,1,1),
|
|
||||||
"listring[context;src]",
|
|
||||||
"list[context;upgrades;9,0.9;1,4]",
|
|
||||||
mcl_formspec.get_itemslot_bg(9,0.9,1,4),
|
|
||||||
"listring[context;upgrades]"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -20,23 +20,13 @@ local windMill={}
|
|||||||
windMill.getFormspec=function(pos)
|
windMill.getFormspec=function(pos)
|
||||||
local meta=minetest.get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local charging=meta:get_int("charging")
|
local charging=meta:get_int("charging")
|
||||||
local formspec
|
local formspec={
|
||||||
if industrialtest.mtgAvailable then
|
"list[context;charged;4.7,1.8;1,1]",
|
||||||
formspec={
|
industrialtest.internal.getItemSlotBg(4.7,1.8,1,1),
|
||||||
"list[context;charged;4.9,1.8;1,1]",
|
(charging>0 and "image[4.7,3;1,1;industrialtest_gui_wind_bg.png^[lowpart:"..charging..":industrialtest_gui_wind_fg.png]"
|
||||||
"listring[context;charged]",
|
or "image[4.7,3;1,1;industrialtest_gui_wind_bg.png]"),
|
||||||
(charging>0 and "image[4.9,3;1,1;industrialtest_gui_wind_bg.png^[lowpart:"..charging..":industrialtest_gui_wind_fg.png]"
|
"listring[context;charged]"
|
||||||
or "image[4.9,3;1,1;industrialtest_gui_wind_bg.png]")
|
}
|
||||||
}
|
|
||||||
elseif industrialtest.mclAvailable then
|
|
||||||
formspec={
|
|
||||||
"list[context;charged;4.7,1.8;1,1]",
|
|
||||||
mcl_formspec.get_itemslot_bg(4.7,1.8,1,1),
|
|
||||||
"listring[context;charged]",
|
|
||||||
(charging>0 and "image[4.7,3;1,1;industrialtest_gui_wind_bg.png^[lowpart:"..charging..":industrialtest_gui_wind_fg.png]"
|
|
||||||
or "image[4.7,3;1,1;industrialtest_gui_wind_bg.png]")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
return table.concat(formspec,"")
|
return table.concat(formspec,"")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 851 B After Width: | Height: | Size: 229 B |
BIN
textures/industrialtest_plate_overlay.png
Normal file
BIN
textures/industrialtest_plate_overlay.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 144 B |
Loading…
x
Reference in New Issue
Block a user