update digistuff and homedecor

This commit is contained in:
Vanessa Dannenberg 2019-06-03 03:48:05 -04:00
parent 1ae88c7f27
commit 866c0eca9e
20 changed files with 1248 additions and 29 deletions

View File

@ -5,7 +5,8 @@ digistuff.remove_receiver = function(pos,node)
if rnode.name == "digistuff:receiver" then
rnode.name = "digilines:wire_std_00000000"
minetest.remove_node(rpos)
minetest.place_node(rpos,rnode)
minetest.set_node(rpos,rnode)
digilines.update_autoconnect(rpos)
end
end
@ -125,6 +126,7 @@ minetest.register_node("digistuff:receiver", {
is_ground_content = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -135,6 +137,13 @@ minetest.register_node("digistuff:receiver", {
{-0.0625,-0.5,-0.4,0.0625,-0.4375,0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.2,-0.5,-0.5,0.2,0.2,0.5},
{-0.075,-0.075,-1.49,0.075,0.075,-0.5},
},
},
digiline = {
receptor = {},
wire = {
@ -189,6 +198,12 @@ minetest.register_node("digistuff:vertical_bottom", {
{-0.05,-0.4375,-0.05,0.05,0.5,0.05},
},
},
collision_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,-0.4375,0.5},
},
},
after_place_node = digistuff.vertical_autoconnect,
after_destruct = digistuff.vertical_remove,
digiline = {
@ -214,6 +229,7 @@ minetest.register_node("digistuff:vertical_middle", {
drop = "digistuff:vertical_bottom",
is_ground_content = false,
paramtype = "light",
walkable = false,
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -277,6 +293,7 @@ minetest.register_node("digistuff:insulated_straight", {
},
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple,
groups = {dig_immediate = 3,},
is_ground_content = false,
@ -288,6 +305,12 @@ minetest.register_node("digistuff:insulated_straight", {
{-0.5,-0.5,-0.1,0.5,-0.4,0.1},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.15,0.5,-0.35,0.15},
},
},
after_place_node = digilines.update_autoconnect,
after_destruct = digilines.update_autoconnect,
digiline = {
@ -316,6 +339,7 @@ minetest.register_node("digistuff:insulated_tjunction", {
},
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple,
groups = {dig_immediate = 3,},
is_ground_content = false,
@ -328,6 +352,12 @@ minetest.register_node("digistuff:insulated_tjunction", {
{-0.1,-0.5,-0.5,0.1,-0.4,-0.1},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,-0.35,0.15},
},
},
after_place_node = digilines.update_autoconnect,
after_destruct = digilines.update_autoconnect,
digiline = {
@ -357,6 +387,7 @@ minetest.register_node("digistuff:insulated_corner", {
},
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple,
groups = {dig_immediate = 3,},
is_ground_content = false,
@ -369,6 +400,12 @@ minetest.register_node("digistuff:insulated_corner", {
{-0.5,-0.5,-0.1,0.1,-0.4,0.1},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.15,-0.35,0.15},
},
},
after_place_node = digilines.update_autoconnect,
after_destruct = digilines.update_autoconnect,
digiline = {
@ -396,6 +433,7 @@ minetest.register_node("digistuff:insulated_fourway", {
"digistuff_insulated_edge.png",
},
paramtype = "light",
walkable = false,
groups = {dig_immediate = 3,},
is_ground_content = false,
paramtype = "light",
@ -408,6 +446,12 @@ minetest.register_node("digistuff:insulated_fourway", {
{-0.1,-0.5,0.1,0.1,-0.4,0.5},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5,-0.5,-0.5,0.5,-0.35,0.5},
},
},
after_place_node = digilines.update_autoconnect,
after_destruct = digilines.update_autoconnect,
digiline = {

View File

@ -7,7 +7,7 @@ local components = {
"light",
"noteblock",
"camera",
"button",
"switches",
"panel",
"piezo",
"detector",

File diff suppressed because it is too large Load Diff

View File

@ -13,6 +13,8 @@ digistuff.button_get_rules = function(node)
{x = 0,y = 0,z = 1},
{x = 0,y = 0,z = -1},
{x = 0,y = 0,z = 2},
{x = 0,y = 1,z = 1},
{x = 0,y = -1,z = 1},
}
local dir = minetest.facedir_to_dir(node.param2)
rules = digistuff.rotate_rules(rules,dir)
@ -177,3 +179,110 @@ minetest.register_craft({
{"digilines:wire_std_00000000"}
}
})
minetest.register_node("digistuff:wall_knob", {
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
sunlight_propagates = true,
digiline =
{
receptor = {},
wire = {
rules = digistuff.button_get_rules,
},
},
drawtype = "mesh",
mesh = "digistuff_wall_knob.obj",
tiles = {
"digistuff_digibutton_sides.png",
"digistuff_digiline_full.png",
},
selection_box = {
type = "fixed",
fixed = {
{-0.4,-0.4,0,0.4,0.4,0.5},
},
},
groups = {dig_immediate = 2,digiline_receiver = 1,},
description = "Digilines Wall Knob",
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_int("min",0)
meta:set_int("max",14)
meta:set_string("formspec","size[8,4;]field[1,1;6,2;channel;Channel;${channel}]field[1,2;3,2;min;Minimum;${min}]field[4,2;3,2;max;Maximum;${max}]button_exit[2.25,3;3,1;submit;Save]")
end,
after_place_node = digistuff.place_receiver,
after_destruct = digistuff.remove_receiver,
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
if fields.channel and fields.channel ~= "" then
if tonumber(fields.min) and tonumber(fields.max) and math.floor(fields.min) < math.floor(fields.max) then
meta:set_string("channel",fields.channel)
meta:set_int("min",math.floor(tonumber(fields.min)))
meta:set_int("max",math.floor(tonumber(fields.max)))
meta:set_int("value",math.floor(tonumber(fields.min)))
meta:set_string("infotext",string.format("Current setting: %d\nLeft-click to turn up or right-click to turn down",math.floor(tonumber(fields.min))))
meta:set_string("formspec","")
minetest.swap_node(pos, {name = "digistuff:wall_knob_configured", param2=minetest.get_node(pos).param2})
else
minetest.chat_send_player(sender:get_player_name(),"Minimum and maximum must both be numbers, and maximum must be greater than minimum")
end
else
minetest.chat_send_player(sender:get_player_name(),"Please set a channel!")
end
end,
sounds = default and default.node_sound_stone_defaults(),
})
minetest.register_node("digistuff:wall_knob_configured", {
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
sunlight_propagates = true,
digiline =
{
receptor = {},
wire = {
rules = digistuff.button_get_rules,
},
},
drawtype = "mesh",
mesh = "digistuff_wall_knob.obj",
tiles = {
"digistuff_digibutton_sides.png",
"digistuff_digiline_full.png",
},
selection_box = {
type = "fixed",
fixed = {
{-0.4,-0.4,0,0.4,0.4,0.5},
},
},
groups = {dig_immediate = 2,digiline_receiver = 1,not_in_creative_inventory = 1,},
description = "Digilines Wall Knob (configured state - you hacker you!)",
drop = "digistuff:wall_knob",
after_place_node = digistuff.place_receiver,
after_destruct = digistuff.remove_receiver,
on_punch = function(pos,node,player)
local meta = minetest.get_meta(pos)
local max = meta:get_int("max")
local value = meta:get_int("value")
local full = player:get_player_control().aux1
value = full and max or math.min(max,value+1)
meta:set_int("value",value)
meta:set_string("infotext",string.format("Current setting: %d\nLeft-click to turn up or right-click to turn down",math.floor(tonumber(value))))
digiline:receptor_send(pos,digistuff.button_get_rules(node),meta:get_string("channel"),value)
end,
on_rightclick = function(pos,node,player)
local meta = minetest.get_meta(pos)
local min = meta:get_int("min")
local value = meta:get_int("value")
local full = player:get_player_control().aux1
value = full and min or math.max(min,value-1)
meta:set_int("value",value)
meta:set_string("infotext",string.format("Current setting: %d\nLeft-click to turn up or right-click to turn down",math.floor(tonumber(value))))
digiline:receptor_send(pos,digistuff.button_get_rules(node),meta:get_string("channel"),value)
end,
sounds = default and default.node_sound_stone_defaults(),
})

View File

@ -40,41 +40,41 @@ local door_list = {
custom_model = "homedecor_door_fancy"
},
{ name = "wood_glass_oak",
description = "Glass and Wood, Oak-colored",
{ name = "french_oak",
description = "French door, Oak-colored",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_glass_defaults(),
},
backface = true,
alpha = true,
custom_model = "homedecor_door_wood_glass"
custom_model = "homedecor_door_french"
},
{ name = "wood_glass_mahogany",
description = "Glass and Wood, Mahogany-colored",
{ name = "french_mahogany",
description = "French door, Mahogany-colored",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_glass_defaults(),
},
backface = true,
alpha = true,
custom_model = "homedecor_door_wood_glass"
custom_model = "homedecor_door_french"
},
{ name = "wood_glass_white",
description = "Glass and Wood, White",
{ name = "french_white",
description = "French door, White",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_glass_defaults(),
},
backface = true,
alpha = true,
custom_model = "homedecor_door_wood_glass"
custom_model = "homedecor_door_french"
},
{ name = "bedroom",
description = "White Bedroom Door",
{ name = "basic_panel",
description = "Basic white panel Door",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_wood_defaults(),
@ -95,8 +95,8 @@ local door_list = {
custom_model = "homedecor_door_wrought_iron"
},
{ name = "woodglass2",
description = "Wooden door with glass insert, type 2",
{ name = "carolina",
description = "Wooden Carolina door",
groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2},
sounds = {
main = default.node_sound_wood_defaults(),
@ -166,7 +166,7 @@ end
local hd_3d = minetest.get_modpath("homedecor_3d_extras")
for _, door in ipairs(door_list) do
doors.register(door.name, {
doors.register("homedecor_"..door.name, {
tiles = {{ name = "homedecor_door_"..door.name..".png", backface_culling = door.backface }},
description = door.description,
inventory_image = "homedecor_door_"..door.name.."_inv.png",
@ -177,9 +177,8 @@ for _, door in ipairs(door_list) do
mesecons = mesecons
})
local nn_a = "doors:"..door.name.."_a"
local nn_b = "doors:"..door.name.."_b"
local nn_a = "doors:homedecor_"..door.name.."_a"
local nn_b = "doors:homedecor_"..door.name.."_b"
if door.alpha then
local def = hd_doors_clone_node(nn_a)
@ -204,6 +203,9 @@ for _, door in ipairs(door_list) do
old_doors[#old_doors + 1] = "homedecor:door_"..door.name.."_left"
old_doors[#old_doors + 1] = "homedecor:door_"..door.name.."_right"
minetest.register_alias("doors:"..door.name.."_a", "doors:homedecor_"..door.name.."_a")
minetest.register_alias("doors:"..door.name.."_b", "doors:homedecor_"..door.name.."_b")
end
-- Gates
@ -697,14 +699,35 @@ minetest.register_craft({
-- aliases
minetest.register_alias("homedecor:jpn_door_top", "air")
minetest.register_alias("homedecor:jpn_door_bottom", "homedecor:door_japanese_closed")
minetest.register_alias("homedecor:jpn_door_top_open", "air")
minetest.register_alias("homedecor:jpn_door_bottom", "homedecor:door_japanese_closed")
minetest.register_alias("homedecor:jpn_door_bottom_open", "homedecor:door_japanese_open")
minetest.register_alias("homedecor:door_glass_right", "doors:door_glass_b")
minetest.register_alias("homedecor:door_glass_left", "doors:door_glass_a")
minetest.register_alias("doors:wood_glass_oak_a", "doors:homedecor_french_oak_a")
minetest.register_alias("doors:wood_glass_oak_b", "doors:homedecor_french_oak_b")
minetest.register_alias("doors:wood_glass_white_a", "doors:homedecor_french_white_a")
minetest.register_alias("doors:wood_glass_white_b", "doors:homedecor_french_white_b")
minetest.register_alias("doors:wood_glass_mahogany_a", "doors:homedecor_french_mahogany_a")
minetest.register_alias("doors:wood_glass_mahogany_b", "doors:homedecor_french_mahogany_b")
minetest.register_alias("doors:homedecor_woodglass2_a", "doors:homedecor_carolina_a")
minetest.register_alias("doors:homedecor_woodglass2_b", "doors:homedecor_carolina_b")
minetest.register_alias("doors:woodglass2_a", "doors:homedecor_carolina_a")
minetest.register_alias("doors:woodglass2_b", "doors:homedecor_carolina_b")
minetest.register_alias("doors:homedecor_bedroom_a", "doors:homedecor_basic_panel_a")
minetest.register_alias("doors:homedecor_bedroom_b", "doors:homedecor_basic_panel_b")
minetest.register_alias("doors:bedroom_a", "doors:homedecor_basic_panel_a")
minetest.register_alias("doors:bedroom_b", "doors:homedecor_basic_panel_b")
-- flip old homedecor doors around, since they use minetest_game doors API now
minetest.register_lbm({

View File

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

View File

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB