From cdd0eed116345b3233fe0a065d7c1246f65fd5c1 Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sat, 27 Feb 2021 19:25:25 +0100 Subject: [PATCH] Always show cancel button --- init.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/init.lua b/init.lua index c13e011..fa0403f 100644 --- a/init.lua +++ b/init.lua @@ -2348,15 +2348,11 @@ local function get_inventory_fs(player, data, fs) end local function get_items_fs(_, data, fs) - local filtered = data.filter ~= "" - fs("box[0.2,0.2;4.55,0.6;#bababa25]", "set_focus[filter]") - fs(fmt("field[0.3,0.2;%f,0.6;filter;;%s]", filtered and 3.45 or 3.9, ESC(data.filter))) + fs(fmt("field[0.3,0.2;3.45,0.6;filter;;%s]", ESC(data.filter))) fs("field_close_on_enter[filter;false]") - if filtered then - fs(fmt("image_button", 3.75, 0.35, 0.3, 0.3, "", "cancel", "")) - end + fs(fmt("image_button", 3.75, 0.35, 0.3, 0.3, "", "cancel", "")) fs(fmt("image_button", 4.25, 0.32, 0.35, 0.35, "", "search", ""))