Skip to content

Commit

Permalink
Fixed some formatting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesClarke7283 committed Oct 15, 2023
1 parent 687efb3 commit 93c28b1
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 81 deletions.
132 changes: 66 additions & 66 deletions src/items/motherboards/items.lua
Original file line number Diff line number Diff line change
@@ -1,76 +1,76 @@
modular_computers.register_motherboard("tier_1", "Tier 1", nil, {
{
{"default", "basic_materials"}, {
{
"default:steel_ingot", "basic_materials:copper_wire",
"default:steel_ingot"
}, {
"basic_materials:copper_wire", "basic_materials:ic",
"basic_materials:copper_wire"
},
{
"default:steel_ingot", "basic_materials:copper_wire",
"default:steel_ingot"
}
{ "default", "basic_materials" }, {
{
"default:steel_ingot", "basic_materials:copper_wire",
"default:steel_ingot"
}, {
"basic_materials:copper_wire", "basic_materials:ic",
"basic_materials:copper_wire"
},
{
"default:steel_ingot", "basic_materials:copper_wire",
"default:steel_ingot"
}
}
}, {
{"default", "mesecons"}, {
{
"default:steel_ingot", "default:copper_ingot",
"default:steel_ingot"
}, {
"default:copper_ingot",
"mesecons_luacontroller:luacontroller0000",
"default:copper_ingot"
},
{
"default:steel_ingot", "default:copper_ingot",
"default:steel_ingot"
}
}
{ "default", "mesecons" }, {
{
"default:steel_ingot", "default:copper_ingot",
"default:steel_ingot"
}, {
{"default"}, {
{
"default:steel_ingot", "default:steel_ingot",
"default:steel_ingot"
},
{
"default:steel_ingot", "default:mese_crystal",
"default:steel_ingot"
},
{
"default:steel_ingot", "default:steel_ingot",
"default:steel_ingot"
}
}
"default:copper_ingot",
"mesecons_luacontroller:luacontroller0000",
"default:copper_ingot"
},
{
"default:steel_ingot", "default:copper_ingot",
"default:steel_ingot"
}
}
}, {
{ "default" }, {
{
"default:steel_ingot", "default:steel_ingot",
"default:steel_ingot"
},
{
"default:steel_ingot", "default:mese_crystal",
"default:steel_ingot"
},
{
"default:steel_ingot", "default:steel_ingot",
"default:steel_ingot"
}
}
}, {
{ "mcl_core" }, {
{
"mcl_core:iron_ingot", "mcl_copper:copper_ingot",
"mcl_core:iron_ingot"
}, {
{"mcl_core"}, {
{
"mcl_core:iron_ingot", "mcl_copper:copper_ingot",
"mcl_core:iron_ingot"
}, {
"mcl_copper:copper_ingot", "mesecons_torch:redstoneblock",
"mcl_copper:copper_ingot"
},
{
"mcl_core:iron_ingot", "mcl_copper:copper_ingot",
"mcl_core:iron_ingot"
}
}
"mcl_copper:copper_ingot", "mesecons_torch:redstoneblock",
"mcl_copper:copper_ingot"
},
{
"mcl_core:iron_ingot", "mcl_copper:copper_ingot",
"mcl_core:iron_ingot"
}
}
}
}, function(id)
return
"size[9,10]" .. "label[3.5,0;" .. modular_computers.S("Motherboard") ..
"]" .. "label[0,1;" .. modular_computers.S("CPU") .. "]" ..
"list[detached:modular_computers:motherboard_inventory_" .. id ..
";cpu;3,1;1,1;]" .. "label[0,2;" .. modular_computers.S("GPU") ..
"]" .. "list[detached:modular_computers:motherboard_inventory_" ..
id .. ";gpu;3,2;1,1;]" .. "label[0,3;" ..
modular_computers.S("Hard Drive") .. "]" ..
"list[detached:modular_computers:motherboard_inventory_" .. id ..
";hdd;3,3;1,1;]" .. "label[0,4;" .. modular_computers.S("USB") ..
"]" .. "list[detached:modular_computers:motherboard_inventory_" ..
id .. ";usb;3,4;1,1;]" .. "list[current_player;main;0,5;9,1;]" ..
"list[current_player;main;0,6.2;9,3;9]" .. "listring[]"

"size[9,10]" ..
"label[3.5,0;" .. modular_computers.S("Motherboard") .. "]" ..
"label[0,1;" .. modular_computers.S("CPU") .. "]" ..
"list[detached:modular_computers:motherboard_inventory_" .. id .. ";cpu;3,1;1,1;]" ..
"label[0,2;" .. modular_computers.S("GPU") .. "]" ..
"list[detached:modular_computers:motherboard_inventory_" .. id .. ";gpu;3,2;1,1;]" ..
"label[0,3;" .. modular_computers.S("Hard Drive") .. "]" ..
"list[detached:modular_computers:motherboard_inventory_" .. id .. ";hdd;3,3;1,1;]" ..
"label[0,4;" .. modular_computers.S("USB") .. "]" ..
"list[detached:modular_computers:motherboard_inventory_" .. id .. ";usb;3,4;1,1;]" ..
"list[current_player;main;0,5;9,1;]" ..
"list[current_player;main;0,6.2;9,3;9]" ..
"listring[]"
end, 1)
28 changes: 13 additions & 15 deletions src/nodes/computer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
local terminal_text = ""

local function formspec(terminal_text)
return "size[16,10]" .. "textarea[0.5,0.5;15,8;terminal_out;" ..
modular_computers.S("Terminal") .. ":;" ..
minetest.formspec_escape(terminal_text) .. "]" ..
"button[6,9.5;4,1;execute;" .. modular_computers.S("Execute") ..
"]" .. "field_close_on_enter[terminal_out;false]" ..
"field_close_on_enter[terminal_in;false]" ..
"set_focus[terminal_in;true]" .. "field[0.5,9;15,1;terminal_in;" ..
modular_computers.S("Input Command") .. ":;]"
return "size[16,10]" ..
"textarea[0.5,0.5;15,8;terminal_out;" .. modular_computers.S("Terminal") .. ":;" .. minetest.formspec_escape(terminal_text) .. "]" ..
"button[6,9.5;4,1;execute;" .. modular_computers.S("Execute") .. "]" ..
"field_close_on_enter[terminal_out;false]" ..
"field_close_on_enter[terminal_in;false]" ..
"set_focus[terminal_in;true]" ..
"field[0.5,9;15,1;terminal_in;" .. modular_computers.S("Input Command") .. ":;]"
end

-- register the computer node
Expand Down Expand Up @@ -65,11 +64,7 @@ minetest.register_on_player_receive_fields(
local args = string.split(command, "%s+", false, -1, true)
local def = modular_computers.registered_commands[args[1]]
if def ~= nil then
local stdin, stdout, stderr, exit_code = def.func(player,
#args - 1,
unpack(
args,
2))
local stdin, stdout, stderr, exit_code = def.func(player,#args - 1,unpack(args,2))
if stderr ~= "" then
terminal_text = terminal_text .. stderr
elseif stdout ~= "" then
Expand Down Expand Up @@ -113,9 +108,12 @@ if not stone or not core or not glass then
modular_computers:err("could not find a crafting recipe")
else
minetest.register_craft({
output = "computertest_redo:computer",
output = "modular_computers:computer",
recipe = {
{stone, glass, stone}, {stone, core, stone}, {stone, stone, stone}
{stone, glass, stone},
{stone, core, stone},
{stone, stone, stone}
}
})
modular_computers:act("registered crafting recipe")
end

0 comments on commit 93c28b1

Please sign in to comment.