Compare commits

...

3 Commits

Author SHA1 Message Date
968d706e9b Don't allow engine to add the implicit "Proceed" button
(on lights anyway;
this change makes it possible to theme the formspec)
2021-02-25 02:13:21 -05:00
bc55cde65c Merge branch 'master' into 'master'
Fix digging of locked inventory nodes

Closes #34 and #33

See merge request VanessaE/homedecor_modpack!21
2021-01-30 13:45:35 +00:00
e049380408 fix digging of locked inventory nodes 2021-01-31 00:02:17 +11:00
2 changed files with 6 additions and 3 deletions

View File

@ -141,9 +141,9 @@ function homedecor.handle_inventory(name, def, original_def)
stack:get_count()
end
local can_dig = def.can_dig
local can_dig = def.can_dig or default_can_dig
def.can_dig = function(pos, player)
return default.can_interact_with_node(player, pos) and (can_dig and (can_dig(pos, player) or true))
return default.can_interact_with_node(player, pos) and (can_dig and can_dig(pos, player) == true)
end
def.on_key_use = function(pos, player)

View File

@ -162,7 +162,10 @@ if minetest.get_modpath("digilines") then
if puncher:get_player_control().sneak then
local name = puncher:get_player_name()
player_last_clicked[name] = pos
local form = "field[channel;Channel;]"
local form = "formspec_version[4]"..
"size[8,4]"..
"button_exit[3,2.5;2,0.5;proceed;Proceed]"..
"field[1.75,1.5;4.5,0.5;channel;Channel;]"
minetest.show_formspec(name, "homedecor:lamp_set_channel", form)
end
end