diff --git a/block_league/src/GUI/gui_profile.lua b/block_league/src/GUI/gui_profile.lua index 968ed48..5e395c6 100644 --- a/block_league/src/GUI/gui_profile.lua +++ b/block_league/src/GUI/gui_profile.lua @@ -5,6 +5,7 @@ local function get_formspec() end function block_league.show_profile(p_name) + minetest.get_player_by_name(p_name):get_meta():set_string("bl_profile_elem_active", "") minetest.show_formspec(p_name, "block_league:profile", get_formspec(p_name)) end @@ -187,6 +188,7 @@ function get_formspec(p_name) -- parte destra "container[13.88,0]", + "image_button[5.2,0;0.8,0.8;bl_gui_profile_close.png;close;;true;false;]", right_elem, "container_end[]" } @@ -205,12 +207,14 @@ end minetest.register_on_player_receive_fields(function(player, formname, fields) if formname ~= "block_league:profile" then return end - if fields.quit then - player:get_meta():set_string("bl_profile_elem_active", "") - return end + if fields.quit then return end local p_name = player:get_player_name() + if fields.close then + minetest.close_formspec(p_name, "block_league:profile") + return end + if fields.weap then player:get_meta():set_string("bl_profile_elem_active", string.sub(block_league.get_player_weapons(p_name)[tonumber(fields.weap)], 14, -1)) elseif fields.skill then diff --git a/block_league/textures/bl_gui_profile_close.png b/block_league/textures/bl_gui_profile_close.png new file mode 100644 index 0000000..269178f Binary files /dev/null and b/block_league/textures/bl_gui_profile_close.png differ