devtest: Improve tool and formspec usability
authorsfan5 <sfan5@live.de>
Mon, 8 Jun 2020 15:15:02 +0000 (17:15 +0200)
committersfan5 <sfan5@live.de>
Mon, 8 Jun 2020 19:17:40 +0000 (21:17 +0200)
also fix the yawsprite test entity

games/devtest/mods/basetools/init.lua
games/devtest/mods/testentities/visuals.lua
games/devtest/mods/testtools/init.lua

index d9d9afb07ac39fe068f02cc04f6fb411bd7d36e0..c5b4cd76c11c3eb78336e495cf44f5e2acf86252 100644 (file)
@@ -54,6 +54,7 @@ minetest.register_tool("basetools:pick_mese", {
                        choppy={times={[1]=0.0, [2]=0.0, [3]=0.0}, maxlevel=255},
                        dig_immediate={times={[1]=0.0, [2]=0.0, [3]=0.0}, maxlevel=255},
                },
+               damage_groups = {fleshy=100},
        },
 })
 
index de346fd6846019b4bdb474d52178d3a8e83e5d9b..314f51657ec465cc5ab2867cd34a6822dc8eec72 100644 (file)
@@ -66,9 +66,9 @@ minetest.register_entity("testentities:yawsprite", {
                textures = {"testentities_dungeon_master.png^[makealpha:128,0,0^[makealpha:128,128,0"},
                spritediv = {x=6, y=5},
                initial_sprite_basepos = {x=0, y=0},
-               on_activate = function(self, staticdata)
-                       self.object:set_sprite({x=0, y=0}, 1, 0, true)
-               end,
        },
+       on_activate = function(self, staticdata)
+               self.object:set_sprite({x=0, y=0}, 1, 0, true)
+       end,
 })
 
index a63c98377e95000d20c7347f716edfe03b860821..d68a086b99713e572fc778ec391b23c25457cd5b 100644 (file)
@@ -429,6 +429,7 @@ local editor_formspec = function(playername, obj, value, sel)
                "label[0,0;"..F(title).."]"..
                "textlist[0,0.5;9,7.5;object_props;"..list..";"..sel..";false]"..
                "field[0.2,8.75;8,1;value;"..F(S("Value"))..";"..F(value).."]"..
+               "field_close_on_enter[value;false]"..
                "button[8,8.5;1,1;submit;"..F(S("Submit")).."]"
        )
 end
@@ -665,7 +666,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
                                return
                        end
                end
-               if fields.submit then
+               if fields.key_enter_field == "value" or fields.submit then
                        local props = selected_objects[name]:get_properties()
                        local keys = property_formspec_data[name]
                        if (not property_formspec_index[name]) or (not props) then