forked from mrkubax10/industrialtest
Compare commits
6 Commits
6a705dbb01
...
craftguide
| Author | SHA1 | Date | |
|---|---|---|---|
| c326ff5676 | |||
| 36c5b3c8ac | |||
| 029cbdf6c4 | |||
| af03d0e831 | |||
| a6bbc0d1d8 | |||
| e879f588b6 |
49
api.lua
49
api.lua
@@ -32,6 +32,15 @@ industrialtest.api.hvPowerFlow=10200
|
||||
industrialtest.api.evPowerFlow=40800
|
||||
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)
|
||||
return math.max(math.min(num,max),min)
|
||||
end
|
||||
@@ -750,6 +759,16 @@ industrialtest.api.registerMaceratorRecipe=function(config)
|
||||
recipe=config.recipe or "",
|
||||
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
|
||||
end
|
||||
-- \brief Returns macerator recipe result
|
||||
@@ -768,6 +787,16 @@ industrialtest.api.registerCompressorRecipe=function(config)
|
||||
time=config.time or 2,
|
||||
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
|
||||
end
|
||||
-- \brief Returns macerator recipe result
|
||||
@@ -782,6 +811,16 @@ industrialtest.api.registerExtractorRecipe=function(config)
|
||||
recipe=config.recipe or "",
|
||||
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
|
||||
end
|
||||
industrialtest.api.getExtractorRecipeResult=function(recipe)
|
||||
@@ -794,6 +833,16 @@ industrialtest.api.registerCableFormerRecipe=function(config)
|
||||
recipe=config.recipe or "",
|
||||
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
|
||||
end
|
||||
|
||||
|
||||
@@ -618,6 +618,32 @@ if industrialtest.mclAvailable then
|
||||
y_max=mcl_worlds.layer_to_y(16),
|
||||
y_min=mcl_vars.mg_overworld_min
|
||||
})
|
||||
|
||||
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)
|
||||
minetest.register_craftitem("industrialtest:"..name.."_lump",{
|
||||
|
||||
@@ -24,7 +24,7 @@ industrialtest.internal.registerSimpleElectricItemProcessor({
|
||||
capacity=1400,
|
||||
flow=industrialtest.api.lvPowerFlow,
|
||||
opPower=80,
|
||||
method="industrialtest.cable_forming",
|
||||
method=industrialtest.api.craftingMethods.cableForming,
|
||||
efficiency=1
|
||||
})
|
||||
minetest.register_craft({
|
||||
|
||||
@@ -40,9 +40,7 @@ canningMachine.getFormspec=function(pos)
|
||||
"list[context;upgrades;9,0.9;1,4]",
|
||||
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||
"listring[context;src]",
|
||||
"listring[context;powerStorage]",
|
||||
"listring[context;dst]",
|
||||
"listring[context;upgrades]"
|
||||
"listring[context;dst]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
@@ -73,15 +73,15 @@ chargepad.getFormspec=function(pos)
|
||||
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||
local formspec={
|
||||
"list[context;charged;1,2.5;1,1]",
|
||||
"listring[context;charged]",
|
||||
industrialtest.internal.getItemSlotBg(1,2.5,1,1),
|
||||
"label[0.9,3.9;"..S("Charge").."]",
|
||||
"list[context;discharged;3,2.5;1,1]",
|
||||
"listring[context;discharged]",
|
||||
industrialtest.internal.getItemSlotBg(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 "")
|
||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||
"listring[context;charged]",
|
||||
"listring[context;discharged]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
@@ -72,19 +72,21 @@ machine.getFormspec=function(pos,config)
|
||||
"formspec_version[4]",
|
||||
"size[10.8,12]",
|
||||
"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,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
|
||||
formspec={
|
||||
"size[10.04,12]",
|
||||
"label[0.25,0.25;"..config.displayName.."]",
|
||||
(config.getFormspec and config.getFormspec(pos) or ""),
|
||||
"list[current_player;main;0.5,7;9,3;9]",
|
||||
mcl_formspec.get_itemslot_bg(0.5,7,9,3),
|
||||
"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
|
||||
return table.concat(formspec,"")
|
||||
@@ -453,7 +455,7 @@ local function craftResultProxy(method,item)
|
||||
time=output.time,
|
||||
src=after.items[1]
|
||||
}
|
||||
elseif method=="industrialtest.macerating" then
|
||||
elseif method==industrialtest.api.craftingMethods.macerating then
|
||||
local output=industrialtest.api.getMaceratorRecipeResult(item:get_name())
|
||||
if not output then
|
||||
return {
|
||||
@@ -469,7 +471,7 @@ local function craftResultProxy(method,item)
|
||||
time=output.time,
|
||||
src=srcAfter
|
||||
}
|
||||
elseif method=="industrialtest.compressing" then
|
||||
elseif method==industrialtest.api.craftingMethods.compressing then
|
||||
local output=industrialtest.api.getCompressorRecipeResult(item:get_name())
|
||||
if not output or item:get_count()<output.count then
|
||||
return {
|
||||
@@ -485,7 +487,7 @@ local function craftResultProxy(method,item)
|
||||
time=output.time,
|
||||
src=srcAfter
|
||||
}
|
||||
elseif method=="industrialtest.extracting" then
|
||||
elseif method==industrialtest.api.craftingMethods.extracting then
|
||||
local output=industrialtest.api.getExtractorRecipeResult(item:get_name())
|
||||
if not output then
|
||||
return {
|
||||
@@ -501,7 +503,7 @@ local function craftResultProxy(method,item)
|
||||
time=output.time,
|
||||
src=srcAfter
|
||||
}
|
||||
elseif method=="industrialtest.recycling" then
|
||||
elseif method==industrialtest.api.craftingMethods.recycling then
|
||||
local srcAfter=ItemStack(item:get_name())
|
||||
srcAfter:set_count(item:get_count()-1)
|
||||
return {
|
||||
@@ -509,7 +511,7 @@ local function craftResultProxy(method,item)
|
||||
time=2,
|
||||
src=srcAfter
|
||||
}
|
||||
elseif method=="industrialtest.cable_forming" then
|
||||
elseif method==industrialtest.api.craftingMethods.cableForming then
|
||||
local output=industrialtest.api.getCableFormerRecipeResult(item:get_name())
|
||||
if not output then
|
||||
return {
|
||||
@@ -525,7 +527,7 @@ local function craftResultProxy(method,item)
|
||||
time=output.time,
|
||||
src=srcAfter
|
||||
}
|
||||
elseif method=="industrialtest.mass_fabricating" then
|
||||
elseif method==industrialtest.api.craftingMethods.massFabricating then
|
||||
if item:get_count()<34 then
|
||||
return {
|
||||
item=ItemStack(),
|
||||
@@ -551,20 +553,18 @@ simpleElectricItemProcessor.getFormspec=function(pos)
|
||||
local formspec={
|
||||
"list[context;src;3.4,1.8;1,1]",
|
||||
industrialtest.internal.getItemSlotBg(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]",
|
||||
industrialtest.internal.getItemSlotBg(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]",
|
||||
industrialtest.internal.getItemSlotBg(6.4,2.8,1,1),
|
||||
"listring[context;dst]",
|
||||
"list[context;upgrades;9,0.9;1,4]",
|
||||
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||
"listring[context;upgrades]"
|
||||
"listring[context;src]",
|
||||
"listring[context;dst]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
@@ -24,7 +24,7 @@ industrialtest.internal.registerSimpleElectricItemProcessor({
|
||||
capacity=1400,
|
||||
flow=industrialtest.api.lvPowerFlow,
|
||||
opPower=120,
|
||||
method="industrialtest.compressing",
|
||||
method=industrialtest.api.craftingMethods.compressing,
|
||||
efficiency=1
|
||||
})
|
||||
minetest.register_craft({
|
||||
|
||||
@@ -27,16 +27,15 @@ fluidGenerator.getFormspec=function(pos,config)
|
||||
local formspec={
|
||||
"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]"),
|
||||
"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]",
|
||||
industrialtest.internal.getItemSlotBg(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 "")
|
||||
(powerPercent>0 and "box[9,"..(1+4.8-(powerPercent*4.8))..";0.3,"..(powerPercent*4.8)..";#FF1010]" or ""),
|
||||
"listring[context;src]",
|
||||
"listring[context;dst]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
@@ -24,14 +24,13 @@ generator.getFormspec=function(pos)
|
||||
local formspec={
|
||||
"list[context;charged;4.7,1.8;1,1]",
|
||||
industrialtest.internal.getItemSlotBg(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]",
|
||||
industrialtest.internal.getItemSlotBg(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 "")
|
||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||
"listring[context;src]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
@@ -58,9 +58,7 @@ inductionFurnace.getFormspec=function(pos)
|
||||
industrialtest.internal.getItemSlotBg(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]"
|
||||
"listring[context;dst]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
@@ -25,17 +25,17 @@ ironFurnace.getFormspec=function(fuelPercent,srcPercent)
|
||||
"size[10.8,12]",
|
||||
"label[0.5,0.5;"..S("Iron Furnace").."]",
|
||||
"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]"
|
||||
or "image[3.4,2.8;1,1;default_furnace_fire_bg.png]"),
|
||||
"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]"
|
||||
or "image[4.9,2.8;1,1;gui_furnace_arrow_bg.png^[transformR270]"),
|
||||
"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,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
|
||||
formspec={
|
||||
@@ -43,21 +43,21 @@ ironFurnace.getFormspec=function(fuelPercent,srcPercent)
|
||||
"label[0.25,0.25;"..S("Iron Furnace").."]",
|
||||
"list[context;src;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]"
|
||||
or "image[3.4,2.8;1,1;default_furnace_fire_bg.png]"),
|
||||
"list[context;fuel;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]"
|
||||
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[current_player;main;0.5,7;9,3;9]",
|
||||
mcl_formspec.get_itemslot_bg(0.5,7,9,3),
|
||||
"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
|
||||
return table.concat(formspec,"")
|
||||
|
||||
@@ -24,7 +24,7 @@ industrialtest.internal.registerSimpleElectricItemProcessor({
|
||||
capacity=1200,
|
||||
flow=industrialtest.api.lvPowerFlow,
|
||||
opPower=100,
|
||||
method="industrialtest.macerating",
|
||||
method=industrialtest.api.craftingMethods.macerating,
|
||||
efficiency=1
|
||||
})
|
||||
minetest.register_craft({
|
||||
|
||||
@@ -26,13 +26,12 @@ reactor.getFormspec=function(pos)
|
||||
local formspec={
|
||||
"list[context;fuel;1,1;"..size..","..size.."]",
|
||||
industrialtest.internal.getItemSlotBg(1,1,size,size),
|
||||
"listring[context;fuel]",
|
||||
"list[context;charged;7,2.8;1,1]",
|
||||
industrialtest.internal.getItemSlotBg(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 "")
|
||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||
"listring[context;fuel]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
@@ -22,15 +22,15 @@ powerStorage.getFormspec=function(pos)
|
||||
local charged=meta:get_int("industrialtest.powerAmount")/meta:get_int("industrialtest.powerCapacity")
|
||||
local formspec={
|
||||
"list[context;charged;1,2.5;1,1]",
|
||||
"listring[context;charged]",
|
||||
industrialtest.internal.getItemSlotBg(1,2.5,1,1),
|
||||
"label[0.9,3.9;"..S("Charge").."]",
|
||||
"list[context;discharged;3,2.5;1,1]",
|
||||
"listring[context;discharged]",
|
||||
industrialtest.internal.getItemSlotBg(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 "")
|
||||
(charged>0 and "box[9,"..(1+4.8-(charged*4.8))..";0.3,"..(charged*4.8)..";#FF1010]" or ""),
|
||||
"listring[context;charged]",
|
||||
"listring[context;discharged]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
@@ -45,10 +45,7 @@ rotaryMacerator.getFormspec=function(pos)
|
||||
"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]"
|
||||
"listring[context;dst]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
@@ -23,9 +23,9 @@ solarPanel.getFormspec=function(pos)
|
||||
local formspec={
|
||||
"list[context;charged;4.7,1.8;1,1]",
|
||||
industrialtest.internal.getItemSlotBg(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]")
|
||||
or "image[4.7,2.8;1,1;industrialtest_gui_sun_bg.png]"),
|
||||
"listring[context;charged]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
@@ -23,15 +23,13 @@ toolWorkshop.getFormspec=function(pos)
|
||||
local formspec={
|
||||
"list[context;powerStorage;3.7,3.7;1,1;0]",
|
||||
industrialtest.internal.getItemSlotBg(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]",
|
||||
industrialtest.internal.getItemSlotBg(5.9,3.2,1,1),
|
||||
"listring[context;src]",
|
||||
"list[context;upgrades;9,0.9;1,4]",
|
||||
industrialtest.internal.getItemSlotBg(9,0.9,1,4),
|
||||
"listring[context;upgrades]"
|
||||
"listring[context;src]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
@@ -23,9 +23,9 @@ windMill.getFormspec=function(pos)
|
||||
local formspec={
|
||||
"list[context;charged;4.7,1.8;1,1]",
|
||||
industrialtest.internal.getItemSlotBg(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]")
|
||||
or "image[4.7,3;1,1;industrialtest_gui_wind_bg.png]"),
|
||||
"listring[context;charged]"
|
||||
}
|
||||
return table.concat(formspec,"")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user