Skip to content

Commit a21f9bb

Browse files
committedJun 8, 2020
devtest: Improve tool and formspec usability
also fix the yawsprite test entity
1 parent 0ab5808 commit a21f9bb

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed
 

‎games/devtest/mods/basetools/init.lua

+1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ minetest.register_tool("basetools:pick_mese", {
5454
choppy={times={[1]=0.0, [2]=0.0, [3]=0.0}, maxlevel=255},
5555
dig_immediate={times={[1]=0.0, [2]=0.0, [3]=0.0}, maxlevel=255},
5656
},
57+
damage_groups = {fleshy=100},
5758
},
5859
})
5960

‎games/devtest/mods/testentities/visuals.lua

+3-3
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ minetest.register_entity("testentities:yawsprite", {
6666
textures = {"testentities_dungeon_master.png^[makealpha:128,0,0^[makealpha:128,128,0"},
6767
spritediv = {x=6, y=5},
6868
initial_sprite_basepos = {x=0, y=0},
69-
on_activate = function(self, staticdata)
70-
self.object:set_sprite({x=0, y=0}, 1, 0, true)
71-
end,
7269
},
70+
on_activate = function(self, staticdata)
71+
self.object:set_sprite({x=0, y=0}, 1, 0, true)
72+
end,
7373
})
7474

‎games/devtest/mods/testtools/init.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ local editor_formspec = function(playername, obj, value, sel)
429429
"label[0,0;"..F(title).."]"..
430430
"textlist[0,0.5;9,7.5;object_props;"..list..";"..sel..";false]"..
431431
"field[0.2,8.75;8,1;value;"..F(S("Value"))..";"..F(value).."]"..
432+
"field_close_on_enter[value;false]"..
432433
"button[8,8.5;1,1;submit;"..F(S("Submit")).."]"
433434
)
434435
end
@@ -665,7 +666,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
665666
return
666667
end
667668
end
668-
if fields.submit then
669+
if fields.key_enter_field == "value" or fields.submit then
669670
local props = selected_objects[name]:get_properties()
670671
local keys = property_formspec_data[name]
671672
if (not property_formspec_index[name]) or (not props) then

0 commit comments

Comments
 (0)
Please sign in to comment.