diff options
author | sfan5 <sfan5@live.de> | 2020-06-02 13:09:52 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2020-06-02 13:09:52 +0200 |
commit | d2cda4f73a3a5372b70ffa63e2a16bf39d734e40 (patch) | |
tree | 0ab2c68ff028ddb52608cbedd6a7c246312afc45 /gui.lua | |
parent | 37cdbf014e7ae37a5ef5266deeafc560f700cacf (diff) | |
download | xban2-d2cda4f73a3a5372b70ffa63e2a16bf39d734e40.tar.gz xban2-d2cda4f73a3a5372b70ffa63e2a16bf39d734e40.tar.bz2 xban2-d2cda4f73a3a5372b70ffa63e2a16bf39d734e40.zip |
Improve behavior of GUI search field
Diffstat (limited to 'gui.lua')
-rw-r--r-- | gui.lua | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -61,7 +61,8 @@ local function make_fs(name) "size[16,12]", "label[0,-.1;Filter]", "field[1.5,0;12.8,1;filter;;"..ESC(filter).."]", - "button[14,-.3;2,1;search;Search]", + "field_close_on_enter[filter;false]", + "button[14,-.3;2,1;search_submit;Search]", } local fsn = #fs fsn=fsn+1 fs[fsn] = format("textlist[0,.8;4,9.3;player;%s;%d;0]", @@ -122,7 +123,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) end return end - if fields.search then + if fields.search_submit or fields.filter then local filter = fields.filter or "" state.filter = filter state.list = make_list(filter) |