From 32594e7552137d5a761737e80eac5144672a3a6d Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Sat, 24 Sep 2022 14:29:42 +0200 Subject: [PATCH] Small fix --- src/fields.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/fields.lua b/src/fields.lua index 9de2213..1a2a7e4 100644 --- a/src/fields.lua +++ b/src/fields.lua @@ -19,6 +19,12 @@ local function inv_fields(player, data, fields) return end + if fields.dd_sorting_method then + data.sort = tonumber(fields.dd_sorting_method) + elseif fields.sb_font_size then + data.font_size = tonumber(fields.sb_font_size:match"-?%d+$") + end + for field in pairs(fields) do if sub(field, 1, 4) == "btn_" then data.subcat = indexof(i3.categories, sub(field, 5)) @@ -128,9 +134,6 @@ local function inv_fields(player, data, fields) elseif fields.sort then sort_inventory(player, data) - elseif fields.dd_sorting_method then - data.sort = tonumber(fields.dd_sorting_method) - elseif fields.home then if not data.home then return msg(name, "No home set") @@ -147,9 +150,6 @@ local function inv_fields(player, data, fields) elseif fields.bag_rename then data.bag_rename = true - elseif fields.sb_font_size then - data.font_size = tonumber(fields.sb_font_size:match"-?%d+$") - elseif fields.confirm_rename then local bag = get_detached_inv("bag", name) local bagstack = bag:get_stack("main", 1) @@ -428,7 +428,7 @@ core.register_on_player_receive_fields(function(player, formname, fields) if formname == "i3_outdated" then return false, core.kick_player(name, - S"Come back when your Minetest client is up-to-date (www.minetest.net).") + S"Your Minetest client needs updating (www.minetest.net)") elseif formname ~= "" then return false end