cleanup obsolete files, consitent syntax and forms, new keypad texture
parent
bca954d393
commit
4b87c9e114
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5
ball.lua
5
ball.lua
|
@ -46,7 +46,10 @@ local ball_spawner_update_form = function (pos)
|
|||
local scale = meta:get_int("scale");
|
||||
|
||||
local form =
|
||||
"size[4.25,4.75]" .. -- width, height
|
||||
"size[4.25,4.75]".. -- width, height
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"field[0.25,0.5;1,1;x0;target;"..x0.."] field[1.25,0.5;1,1;y0;;"..y0.."] field[2.25,0.5;1,1;z0;;"..z0.."]"..
|
||||
"field[3.25,0.5;1,1;speed;speed;"..speed.."]"..
|
||||
--speed, jump, gravity,sneak
|
||||
|
|
|
@ -105,6 +105,9 @@ local constructor_update_meta = function(pos)
|
|||
|
||||
local form =
|
||||
"size[8,10]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"textlist[0,0;3,1.5;craft;" .. textlist .. ";" .. selected .."]"..
|
||||
"button[3.5,1;1.25,0.75;CRAFT;CRAFT]"..
|
||||
"image[3.65,0;1,1;".. tex .. ".png]"..
|
||||
|
|
|
@ -37,6 +37,9 @@ local enviro_update_form = function (pos)
|
|||
|
||||
local form =
|
||||
"size[8,8.5]".. -- width, height
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"field[0.25,0.5;1,1;x0;target;"..x0.."] field[1.25,0.5;1,1;y0;;"..y0.."] field[2.25,0.5;1,1;z0;;"..z0.."]"..
|
||||
"field[3.25,0.5;1,1;r;radius;"..r.."]"..
|
||||
--speed, jump, gravity,sneak
|
||||
|
|
|
@ -131,6 +131,9 @@ local grinder_update_meta = function(pos)
|
|||
local form =
|
||||
"size[8,8]".. -- width, height
|
||||
--"size[6,10]".. -- width, height
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"label[0,0;IN] label[1,0;OUT] label[0,2;FUEL] "..
|
||||
"list["..list_name..";src;0.,0.5;1,1;]"..
|
||||
"list["..list_name..";dst;1.,0.5;3,3;]"..
|
||||
|
@ -230,7 +233,11 @@ minetest.register_node("basic_machines:grinder", {
|
|||
text = text .. "INPUT ".. key .. " " .. v[3] .. " OUTPUT " .. v[2] .. "\n"
|
||||
end
|
||||
|
||||
local form = "size [6,7] textarea[0,0;6.5,8.5;grinderhelp;GRINDER RECIPES;".. text.."]"
|
||||
local form = "size[6,7]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"textarea[0,0;6.5,8.5;grinderhelp;GRINDER RECIPES;".. text.."]"
|
||||
minetest.show_formspec(sender:get_player_name(), "grinderhelp", form)
|
||||
|
||||
end
|
||||
|
|
61
mover.lua
61
mover.lua
|
@ -265,6 +265,9 @@ local get_mover_form = function(pos,player)
|
|||
|
||||
form = "size[8,8.25]" .. -- width, height
|
||||
--"size[6,10]" .. -- width, height
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"tabheader[0,0;tabs;MODE OF OPERATION,WHERE TO MOVE;".. seltab .. ";true;true]"..
|
||||
"label[0.,0;MODE selection]".."button[3,0.25;1,1;help;help]"..
|
||||
"dropdown[0.,0.35;3,1;mode;normal,dig,drop,object,inventory,transport;".. mode .."]"..
|
||||
|
@ -294,6 +297,9 @@ local get_mover_form = function(pos,player)
|
|||
|
||||
form = "size[6,5.5]" .. -- width, height
|
||||
--"size[6,10]" .. -- width, height
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"tabheader[0,0;tabs;MODE OF OPERATION,WHERE TO MOVE;".. seltab .. ";true;true]"..
|
||||
|
||||
"label[0.,0;" .. minetest.colorize("lawngreen","INPUT AREA - mover will dig here").."]"..
|
||||
|
@ -1493,6 +1499,9 @@ local function check_keypad(pos,name,ttl) -- called only when manually activated
|
|||
if meta:get_string("text") == "@" then -- keypad works as a keyboard
|
||||
local form =
|
||||
"size[3,1]" .. -- width, height
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"field[0.25,0.25;3,1;pass;Enter text: ;".."".."] button_exit[0.,0.5;1,1;OK;OK]";
|
||||
minetest.show_formspec(name, "basic_machines:check_keypad_"..minetest.pos_to_string(pos), form)
|
||||
return
|
||||
|
@ -1501,11 +1510,12 @@ local function check_keypad(pos,name,ttl) -- called only when manually activated
|
|||
pass = ""
|
||||
local form =
|
||||
"size[3,1.25]" .. -- width, height
|
||||
"bgcolor[#FF8888BB; false]" ..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"field[0.25,0.25;3,1;pass;Enter Password: ;".."".."] button_exit[0.,0.75;1,1;OK;OK]";
|
||||
minetest.show_formspec(name, "basic_machines:check_keypad_"..minetest.pos_to_string(pos), form)
|
||||
return
|
||||
|
||||
end
|
||||
|
||||
minetest.register_node("basic_machines:keypad", {
|
||||
|
@ -1550,7 +1560,9 @@ minetest.register_node("basic_machines:keypad", {
|
|||
pass = meta:get_string("pass");
|
||||
local form =
|
||||
"size[4.25,3.75]" .. -- width, height
|
||||
"bgcolor[#888888BB; false]" ..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"field[2.25,0.25;2.25,1;pass;Password: ;"..pass.."]" ..
|
||||
"field[0.25,2.5;3.25,1;text;text;".. text .."]" ..
|
||||
"field[0.25,0.25;1,1;mode;mode;"..mode.."]".. "field[1.25,0.25;1,1;iter;repeat;".. iter .."]"..
|
||||
|
@ -1638,6 +1650,9 @@ minetest.register_node("basic_machines:detector", {
|
|||
local list_name = "nodemeta:"..pos.x..','..pos.y..','..pos.z
|
||||
local form =
|
||||
"size[4,6.25]" .. -- width, height
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"field[0.25,0.5;1,1;x0;source1;"..x0.."] field[1.25,0.5;1,1;y0;;"..y0.."] field[2.25,0.5;1,1;z0;;"..z0.."]"..
|
||||
"dropdown[3,0.25;1,1;op; ,AND,OR;".. op .."]"..
|
||||
"field[0.25,1.5;1,1;x1;source2;"..x1.."] field[1.25,1.5;1,1;y1;;"..y1.."] field[2.25,1.5;1,1;z1;;"..z1.."]"..
|
||||
|
@ -1949,6 +1964,9 @@ local get_distributor_form = function(pos,player)
|
|||
local list_name = "nodemeta:"..pos.x..','..pos.y..','..pos.z
|
||||
local form =
|
||||
"size[7,"..(0.75+(n)*0.75).."]" .. -- width, height
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"label[0,-0.25;" .. minetest.colorize("lawngreen","target: x y z, MODE -2=only OFF, -1=NOT input/0/1=input, 2 = only ON") .. "]";
|
||||
for i =1,n do
|
||||
form = form.."field[0.25,"..(0.5+(i-1)*0.75)..";1,1;x"..i..";;"..p[i].x.."] field[1.25,"..(0.5+(i-1)*0.75)..";1,1;y"..i..";;"..p[i].y.."] field[2.25,"..(0.5+(i-1)*0.75)..";1,1;z"..i..";;"..p[i].z.."] field [ 3.25,"..(0.5+(i-1)*0.75)..";1,1;active"..i..";;" .. active[i] .. "]"
|
||||
|
@ -1958,7 +1976,6 @@ local get_distributor_form = function(pos,player)
|
|||
form=form.."button_exit[4.25,"..(0.25+(n)*0.75)..";1,1;ADD;ADD]".."button_exit[3.,"..(0.25+(n)*0.75)..";1,1;OK;OK]".."field[0.25,"..(0.5+(n)*0.75)..";1,1;delay;delay;"..delay .. "]";
|
||||
form = form.."button[6.25,"..(0.25+(n)*0.75)..";1,1;help;help]";
|
||||
return form
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
@ -2164,7 +2181,11 @@ minetest.register_node("basic_machines:light_on", {
|
|||
local meta = minetest.get_meta(pos);
|
||||
local list_name = "nodemeta:"..pos.x..','..pos.y..','..pos.z
|
||||
local deactivate = meta:get_int("deactivate");
|
||||
local form = "size[2,2] field[0.25,0.5;2,1;deactivate;deactivate after ;"..deactivate.."]".."button_exit[0.,1;1,1;OK;OK]";
|
||||
local form = "size[2,2]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"field[0.25,0.5;2,1;deactivate;deactivate after ;"..deactivate.."]".."button_exit[0.,1;1,1;OK;OK]";
|
||||
meta:set_string("formspec", form);
|
||||
end,
|
||||
on_receive_fields = function(pos, formname, fields, player)
|
||||
|
@ -2179,7 +2200,11 @@ minetest.register_node("basic_machines:light_on", {
|
|||
local deactivate = basic_machines.tonumber(fields.deactivate) or 0;
|
||||
if deactivate <0 or deactivate > 600 then deactivate = 0 end
|
||||
meta:set_int("deactivate",deactivate);
|
||||
local form = "size[2,2] field[0.25,0.5;2,1;deactivate;deactivate after ;"..deactivate.."]".."button_exit[0.,1;1,1;OK;OK]";
|
||||
local form = "size[2,2]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"field[0.25,0.5;2,1;deactivate;deactivate after ;"..deactivate.."]".."button_exit[0.,1;1,1;OK;OK]";
|
||||
meta:set_string("formspec", form);
|
||||
end
|
||||
|
||||
|
@ -2535,7 +2560,11 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
|
|||
"\n\n FUEL CONSUMPTION depends on blocks to be moved and distance. For example, stone or tree is harder to move than dirt, harvesting wheat is very cheap and and moving lava is very hard."..
|
||||
"\n\n UPGRADE mover by moving mese blocks in upgrade inventory. Each mese block increases mover range by 10, fuel consumption is divided by (number of mese blocks)+1 in upgrade. Max 10 blocks are used for upgrade. Dont forget to click OK to refresh after upgrade. "..
|
||||
"\n\n Activate mover by keypad/detector signal or mese signal (if mesecons mod) .";
|
||||
local form = "size [6,7] textarea[0,0;6.5,8.5;help;MOVER HELP;".. text.."]"
|
||||
local form = "size [6,7]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"textarea[0,0;6.5,8.5;help;MOVER HELP;".. text.."]"
|
||||
minetest.show_formspec(name, "basic_machines:help_mover", form)
|
||||
return
|
||||
end
|
||||
|
@ -2700,7 +2729,11 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
|
|||
"\ntext replacement : Suppose keypad A is set with text \"@some @. text @!\" and there are blocks on top of keypad A with infotext '1' and '2'. Suppose we target B with A and activate A. Then text of keypad B will be set to \"some 1. text 2!\""..
|
||||
"\nword extraction: Suppose similiar setup but now keypad A is set with text \"%1\". Then upon activation text of keypad B will be set to 1.st word of infotext";
|
||||
|
||||
local form = "size [6,7] textarea[0,0;6.5,8.5;help;KEYPAD HELP;".. text.."]"
|
||||
local form = "size[6,7]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"textarea[0,0;6.5,8.5;help;KEYPAD HELP;".. text.."]"
|
||||
minetest.show_formspec(name, "basic_machines:help_keypad", form)
|
||||
return
|
||||
end
|
||||
|
@ -2805,7 +2838,11 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
|
|||
"If source position is chest it will look into it and check if there are items inside. If mode is inventory it will check for items in specified inventory of source node."..
|
||||
"\n\nADVANCED: you can select second source and then select AND/OR from the right top dropdown list to do logical operations. You can also filter output signal:\n -2=only OFF,-1=NOT/0/1=normal,2=only ON, 3 only if changed"..
|
||||
" 4 = if target keypad set its text to detected object name" ;
|
||||
local form = "size [5.5,5.5] textarea[0,0;6,7;help;DETECTOR HELP;".. text.."]"
|
||||
local form = "size[5.5,5.5]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"textarea[0,0;6,7;help;DETECTOR HELP;".. text.."]"
|
||||
minetest.show_formspec(name, "basic_machines:help_detector", form)
|
||||
end
|
||||
|
||||
|
@ -2954,7 +2991,11 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
|
|||
"delay option adds delay to activations, in seconds. With negative delay activation is randomized with probability -delay/1000.\n\n"..
|
||||
"ADVANCED: you can use distributor as an event handler. First you must deactivate first target by putting 0 at\n"..
|
||||
"last place in first line. Meanings of first 2 numbers are as follows: first number 0/1 controls if node/n".. "listens to failed interact attempts around it, second number -1/1 listens to chat and can mute it";
|
||||
local form = "size [5.5,5.5] textarea[0,0;6,7;help;DISTRIBUTOR HELP;".. text.."]"
|
||||
local form = "size[5.5,5.5]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"textarea[0,0;6,7;help;DISTRIBUTOR HELP;".. text.."]"
|
||||
minetest.show_formspec(name, "basic_machines:help_distributor", form)
|
||||
end
|
||||
|
||||
|
|
|
@ -146,6 +146,9 @@ local recycler_update_meta = function(pos)
|
|||
local form =
|
||||
"size[8,8]".. -- width, heightinv:get_stack
|
||||
--"size[6,10]".. -- width, height
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"label[0,0;IN] label[1,0;OUT] label[0,2;FUEL] "..
|
||||
"list["..list_name..";src;0.,0.5;1,1;]"..
|
||||
"list["..list_name..";dst;1.,0.5;3,3;]"..
|
||||
|
|
|
@ -12,7 +12,9 @@ local battery_update_meta = function(pos)
|
|||
|
||||
local form =
|
||||
"size[8,6.5]".. -- width, height
|
||||
"bgcolor[#333333;false]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"label[0,0;FUEL] ".."label[6,0;UPGRADE] "..
|
||||
"box[1.45,0.48;2.15,1.01;#222222]"..
|
||||
"list["..list_name..";fuel;0.,0.5;1,1;]"..
|
||||
|
@ -271,7 +273,11 @@ minetest.register_node("basic_machines:battery_0", {
|
|||
"UPGRADE with diamondblocks for more available power output or with "..
|
||||
"meseblocks for more power storage capacity"
|
||||
|
||||
local form = "size [6,7] textarea[0,0;6.5,8.5;help;BATTERY HELP;".. text.."]"
|
||||
local form = "size[6,7]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"textarea[0,0;6.5,8.5;help;BATTERY HELP;".. text.."]"
|
||||
minetest.show_formspec(name, "basic_machines:help_battery", form)
|
||||
end
|
||||
end,
|
||||
|
@ -347,6 +353,9 @@ local generator_update_meta = function(pos)
|
|||
|
||||
local form =
|
||||
"size[8,6.5]" .. -- width, height
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"label[0,0;POWER CRYSTALS] ".."label[6,0;UPGRADE] "..
|
||||
"label[1,1;UPGRADE LEVEL ".. meta:get_int("upgrade").." (generator)]"..
|
||||
"list["..list_name..";fuel;0.,0.5;1,1;]"..
|
||||
|
@ -410,7 +419,11 @@ minetest.register_node("basic_machines:generator", {
|
|||
if fields.quit then return end
|
||||
if fields.help then
|
||||
local text = "Generator slowly produces power crystals. Those can be used to recharge batteries and come in 3 flavors:\n\n low level (0-4), medium level (5-19) and high level (20+). Upgrading the generator (upgrade with generators) will increase the rate at which the crystals are produced.\n\nYou can automate the process of battery recharging by using mover in inventory mode, taking from inventory \"fuel\"";
|
||||
local form = "size [6,7] textarea[0,0;6.5,8.5;help;GENERATOR HELP;".. text.."]"
|
||||
local form = "size[6,7]"..
|
||||
default.gui_bg..
|
||||
default.gui_bg_img..
|
||||
default.gui_slots..
|
||||
"textarea[0,0;6.5,8.5;help;GENERATOR HELP;".. text.."]"
|
||||
minetest.show_formspec(sender:get_player_name(), "basic_machines:help_mover", form)
|
||||
return
|
||||
end
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
Before Width: | Height: | Size: 239 B |
Binary file not shown.
Before Width: | Height: | Size: 258 B |
Binary file not shown.
Before Width: | Height: | Size: 486 B After Width: | Height: | Size: 350 B |
Loading…
Reference in New Issue