Compare commits

..

No commits in common. "6a705dbb0169b41bd43a729e5760787b9c271d52" and "a844b4f982e490bb023d8b3c1553a6517f81b560" have entirely different histories.

28 changed files with 346 additions and 191 deletions

View File

@ -19,6 +19,5 @@ 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]

View File

@ -689,16 +689,13 @@ end
-- \param displayName Display name of cell -- \param displayName Display name of cell
-- \param node Node which can be picked up with this cell -- \param node Node which can be picked up with this cell
-- \returns nil -- \returns nil
industrialtest.api.registerStorageCell=function(name,displayName,node,modname,color) industrialtest.api.registerStorageCell=function(name,displayName,node,modname)
color = color or "#ffffffff"
if not modname then if not modname then
modname="industrialtest" modname="industrialtest"
end end
minetest.register_craftitem("industrialtest:"..name.."_cell",{ minetest.register_craftitem("industrialtest:"..name.."_cell",{
description=S(displayName.." Cell"), description=S(displayName.." Cell"),
inventory_image="industrialtest_cell_fluid.png", inventory_image=modname.."_"..name.."_cell.png",
inventory_overlay="industrialtest_cell_casing.png",
color=color,
on_place=function(itemstack,user,pointed) on_place=function(itemstack,user,pointed)
if pointed.type~="node" or not user or not user:is_player() then if pointed.type~="node" or not user or not user:is_player() then
return nil return nil

View File

@ -33,6 +33,12 @@ 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")
@ -47,11 +53,10 @@ 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
@ -80,22 +85,9 @@ 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
@ -619,6 +611,10 @@ if industrialtest.mclAvailable then
y_min=mcl_vars.mg_overworld_min y_min=mcl_vars.mg_overworld_min
}) })
elseif industrialtest.mtgAvailable then elseif industrialtest.mtgAvailable then
industrialtest.internal.explode=function(pos,radius)
tnt.boom(pos,{radius=radius})
end
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"),

View File

@ -31,14 +31,6 @@ local colors={
sulfur="#b88805ff", sulfur="#b88805ff",
tin="#ebd182ff", tin="#ebd182ff",
uranium="#3b8c09ff", uranium="#3b8c09ff",
-- fluid colors
lava="#ff5712ff",
water="#277bbcff",
river_water="#0ebfc2ff",
biomass="#2a8626ff",
biofuel="#4eba49ff",
coalfuel="#462228ff",
coolant="#188676ff"
} }
-- Power storage items -- Power storage items
@ -634,12 +626,12 @@ minetest.register_craft({
{"",industrialtest.elementKeys.tinIngot,""} {"",industrialtest.elementKeys.tinIngot,""}
} }
}) })
industrialtest.api.registerStorageCell("water","Water",industrialtest.elementKeys.waterSource,nil,colors.water) industrialtest.api.registerStorageCell("water","Water",industrialtest.elementKeys.waterSource)
if industrialtest.mtgAvailable then if industrialtest.mtgAvailable then
industrialtest.api.registerStorageCell("river_water","River Water","default:river_water_source",nil,colors.river_water) industrialtest.api.registerStorageCell("river_water","River Water","default:river_water_source")
end end
industrialtest.api.registerStorageCell("lava","Lava",industrialtest.elementKeys.lavaSource,nil,colors.lava) industrialtest.api.registerStorageCell("lava","Lava",industrialtest.elementKeys.lavaSource)
minetest.register_tool("industrialtest:uranium_cell",{ minetest.register_tool("industrialtest:uranium_cell",{
description=S("Uranium Cell"), description=S("Uranium Cell"),
@ -647,9 +639,7 @@ minetest.register_tool("industrialtest:uranium_cell",{
_industrialtest_placedInNuclearReactor=1, _industrialtest_placedInNuclearReactor=1,
_industrialtest_nuclearReactorFuel=1 _industrialtest_nuclearReactorFuel=1
}, },
inventory_image="industrialtest_cell_fluid.png", inventory_image="industrialtest_uranium_cell.png",
inventory_overlay="industrialtest_cell_casing.png",
color=colors.uranium,
}) })
minetest.register_craft({ minetest.register_craft({
type="shapeless", type="shapeless",
@ -666,9 +656,7 @@ minetest.register_tool("industrialtest:coolant_cell",{
_industrialtest_placedInNuclearReactor=1, _industrialtest_placedInNuclearReactor=1,
_industrialtest_nuclearReactorCoolant=1 _industrialtest_nuclearReactorCoolant=1
}, },
inventory_image="industrialtest_cell_fluid.png", inventory_image="industrialtest_coolant_cell.png",
inventory_overlay="industrialtest_cell_casing.png",
color=colors.coolant,
}) })
minetest.register_craft({ minetest.register_craft({
type="shaped", type="shaped",
@ -693,9 +681,7 @@ end
minetest.register_craftitem("industrialtest:bio_cell",{ minetest.register_craftitem("industrialtest:bio_cell",{
description=S("Bio Cell"), description=S("Bio Cell"),
inventory_image="industrialtest_cell_fluid.png", inventory_image="industrialtest_bio_cell.png"
inventory_overlay="industrialtest_cell_casing.png",
color=colors.biomass,
}) })
minetest.register_craft({ minetest.register_craft({
type="shapeless", type="shapeless",
@ -708,9 +694,7 @@ minetest.register_craft({
minetest.register_craftitem("industrialtest:biofuel_cell",{ minetest.register_craftitem("industrialtest:biofuel_cell",{
description=S("Biofuel Cell"), description=S("Biofuel Cell"),
inventory_image="industrialtest_cell_fluid.png", inventory_image="industrialtest_bio_cell.png",
inventory_overlay="industrialtest_cell_casing.png",
color=colors.biofuel,
groups={ groups={
_industrialtest_fuel=1 _industrialtest_fuel=1
}, },
@ -725,9 +709,7 @@ industrialtest.api.registerExtractorRecipe({
minetest.register_craftitem("industrialtest:hydrated_coal_cell",{ minetest.register_craftitem("industrialtest:hydrated_coal_cell",{
description=S("Hydrated Coal Cell"), description=S("Hydrated Coal Cell"),
inventory_image="industrialtest_cell_fluid.png", inventory_image="industrialtest_hydrated_coal_cell.png"
inventory_overlay="industrialtest_cell_casing.png",
color=colors.coal,
}) })
minetest.register_craft({ minetest.register_craft({
type="shapeless", type="shapeless",
@ -740,9 +722,7 @@ minetest.register_craft({
minetest.register_craftitem("industrialtest:coalfuel_cell",{ minetest.register_craftitem("industrialtest:coalfuel_cell",{
description=S("Coalfuel Cell"), description=S("Coalfuel Cell"),
inventory_image="industrialtest_cell_fluid.png", inventory_image="industrialtest_coalfuel_cell.png",
inventory_overlay="industrialtest_cell_casing.png",
color=colors.coalfuel,
groups={ groups={
_industrialtest_fuel=1 _industrialtest_fuel=1
}, },

View File

@ -24,26 +24,46 @@ 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]",
industrialtest.internal.getItemSlotBg(3.4,1.8,1,1), mcl_formspec.get_itemslot_bg(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]",
industrialtest.internal.getItemSlotBg(3.4,3.9,1,1), mcl_formspec.get_itemslot_bg(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]",
industrialtest.internal.getItemSlotBg(6.4,1.8,1,1), mcl_formspec.get_itemslot_bg(6.4,1.8,1,1),
"list[context;leftover;6.4,2.8;1,1]", "list[context;leftover;6.4,2.8;1,1]",
industrialtest.internal.getItemSlotBg(6.4,2.8,1,1), mcl_formspec.get_itemslot_bg(6.4,2.8,1,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), mcl_formspec.get_itemslot_bg(9,0.9,1,4),
"listring[context;src]", "listring[context;src]",
"listring[context;powerStorage]", "listring[context;powerStorage]",
"listring[context;dst]", "listring[context;dst]",
"listring[context;upgrades]" "listring[context;upgrades]"
} }
end
return table.concat(formspec,"") return table.concat(formspec,"")
end end

View File

@ -71,18 +71,32 @@ 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
"list[context;charged;1,2.5;1,1]", if industrialtest.mtgAvailable then
"listring[context;charged]", 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").."]",
"listring[context;discharged]", "list[context;discharged;3,2.5;1,1]",
industrialtest.internal.getItemSlotBg(3,2.5,1,1), "listring[context;discharged]",
"label[2.7,3.9;"..S("Discharge").."]", "label[2.7,3.9;"..S("Discharge").."]",
"box[9,1;0.3,4.8;#202020]", "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 "") (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;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

View File

@ -548,24 +548,42 @@ 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
"list[context;src;3.4,1.8;1,1]", if industrialtest.mtgAvailable then
industrialtest.internal.getItemSlotBg(3.4,1.8,1,1), formspec={
"listring[context;src]", "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]",
"listring[context;powerStorage]", "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]" (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]",
industrialtest.internal.getItemSlotBg(6.4,2.8,1,1), "listring[context;dst]",
"listring[context;dst]", "list[context;upgrades;9,0.9;1,4]",
"list[context;upgrades;9,0.9;1,4]", "listring[context;upgrades]"
industrialtest.internal.getItemSlotBg(9,0.9,1,4), }
"listring[context;upgrades]" 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

View File

@ -22,22 +22,37 @@ 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")
local formspec={ if industrialtest.mtgAvailable then
"list[context;src;2,1.8;1,1]", formspec={
industrialtest.internal.getItemSlotBg(2,1.8,1,1), "list[context;src;2,1.8;1,1]",
"listring[context;src]", "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]",
"listring[context;dst]", "list[context;charged;6,3;1,1]",
"list[context;charged;6,3;1,1]", "listring[context;charged]",
industrialtest.internal.getItemSlotBg(6,3,1,1), "box[9,1;0.3,4.8;#202020]",
"listring[context;charged]", (powerPercent>0 and "box[9,"..(1+4.8-(powerPercent*4.8))..";0.3,"..(powerPercent*4.8)..";#FF1010]" or "")
"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 "") 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

View File

@ -21,18 +21,32 @@ 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
"list[context;charged;4.7,1.8;1,1]", if industrialtest.mtgAvailable then
industrialtest.internal.getItemSlotBg(4.7,1.8,1,1), formspec={
"listring[context;charged]", "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]",
"listring[context;src]", "listring[context;src]",
"box[9,1;0.3,4.8;#202020]", "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 "") (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

View File

@ -43,25 +43,44 @@ 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;powerStorage]",
"listring[context;dst]", "listring[context;dst]",
"listring[context;upgrades]" "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

View File

@ -23,17 +23,30 @@ 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
"list[context;fuel;1,1;"..size..","..size.."]", if industrialtest.mtgAvailable then
industrialtest.internal.getItemSlotBg(1,1,size,size), formspec={
"listring[context;fuel]", "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]",
"listring[context;charged]", "listring[context;charged]",
"button[7.7,1;1,0.8;toggle;"..minetest.formspec_escape(switchText).."]", "button[7.7,1;1,0.8;toggle;"..minetest.formspec_escape(switchText).."]",
"box[9,1;0.3,4.8;#202020]", "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 "") (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

View File

@ -20,18 +20,32 @@ 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
"list[context;charged;1,2.5;1,1]", if industrialtest.mtgAvailable then
"listring[context;charged]", 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").."]",
"listring[context;discharged]", "list[context;discharged;3,2.5;1,1]",
industrialtest.internal.getItemSlotBg(3,2.5,1,1), "listring[context;discharged]",
"label[2.7,3.9;"..S("Discharge").."]", "label[2.7,3.9;"..S("Discharge").."]",
"box[9,1;0.3,4.8;#202020]", "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 "") (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;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

View File

@ -27,29 +27,51 @@ 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
"list[context;src;3.8,1.8;1,1]", if industrialtest.mtgAvailable then
industrialtest.internal.getItemSlotBg(3.8,1.8,1,1), formspec={
"list[context;modifier;4.9,1.8;1,1]", "list[context;src;3.8,1.8;1,1]",
industrialtest.internal.getItemSlotBg(4.9,1.8,1,1), "list[context;modifier;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]",
industrialtest.internal.getItemSlotBg(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]"
(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;1,1;]",
"list[context;dst;6,2.8;1,1;]", "list[context;upgrades;9,0.9;1,4]",
industrialtest.internal.getItemSlotBg(6,2.8,1,1), "label[0.5,2.8;"..minetest.formspec_escape(S("Speed: @1",rpm)).."]",
"list[context;upgrades;9,0.9;1,4]", "button[0.5,3.4;3,0.8;maintainSpeed;"..minetest.formspec_escape(buttonMaintainSpeedText).."]",
industrialtest.internal.getItemSlotBg(9,0.9,1,4), "listring[context;src]",
"label[0.5,2.8;"..minetest.formspec_escape(S("Speed: @1",rpm)).."]", "listring[context;modifier]",
"button[0.5,3.4;3,0.8;maintainSpeed;"..minetest.formspec_escape(buttonMaintainSpeedText).."]", "listring[context;powerStorage]",
"listring[context;src]", "listring[context;dst]",
"listring[context;modifier]", "listring[context;upgrades]"
"listring[context;powerStorage]", }
"listring[context;dst]", elseif industrialtest.mclAvailable then
"listring[context;upgrades]" 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

View File

@ -20,13 +20,23 @@ 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
"list[context;charged;4.7,1.8;1,1]", if industrialtest.mtgAvailable then
industrialtest.internal.getItemSlotBg(4.7,1.8,1,1), formspec={
"listring[context;charged]", "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]"
} 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

View File

@ -20,19 +20,33 @@ 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
"list[context;powerStorage;3.7,3.7;1,1;0]", if industrialtest.mtgAvailable then
industrialtest.internal.getItemSlotBg(3.7,3.7,1,1), formspec={
"listring[context;powerStorage]", "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]",
"listring[context;src]", "listring[context;src]",
"list[context;upgrades;9,0.9;1,4]", "list[context;upgrades;9,0.9;1,4]",
industrialtest.internal.getItemSlotBg(9,0.9,1,4), "listring[context;upgrades]"
"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

View File

@ -20,13 +20,23 @@ 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
"list[context;charged;4.7,1.8;1,1]", if industrialtest.mtgAvailable then
industrialtest.internal.getItemSlotBg(4.7,1.8,1,1), formspec={
"listring[context;charged]", "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]"
} 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.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 863 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 815 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 878 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 862 B