diff options
author | rubenwardy <rw@rubenwardy.com> | 2019-03-05 07:12:58 +0000 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2019-03-05 08:12:58 +0100 |
commit | 5d2624ab8271b490ed5c5eda8ca1e3ea677eadcc (patch) | |
tree | 09436ff01196bfe767a798dcdf5b59c335667b4e /builtin/mainmenu/tab_content.lua | |
parent | b5defcffba12dbbcd70676ed4626929761e25620 (diff) | |
download | minetest-5d2624ab8271b490ed5c5eda8ca1e3ea677eadcc.tar.gz minetest-5d2624ab8271b490ed5c5eda8ca1e3ea677eadcc.tar.bz2 minetest-5d2624ab8271b490ed5c5eda8ca1e3ea677eadcc.zip |
Hide uninstall package button on unmodifiable paths (#8255)
Diffstat (limited to 'builtin/mainmenu/tab_content.lua')
-rw-r--r-- | builtin/mainmenu/tab_content.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/builtin/mainmenu/tab_content.lua b/builtin/mainmenu/tab_content.lua index d8e2c9753..362fcd8d3 100644 --- a/builtin/mainmenu/tab_content.lua +++ b/builtin/mainmenu/tab_content.lua @@ -134,9 +134,13 @@ local function get_formspec(tabview, name, tabdata) end retval = retval .. "textarea[5.85,2.2;6.35,2.9;;" .. - fgettext("Information:") .. ";" .. desc .. "]" .. - "button[5.5,4.65;3.25,1;btn_mod_mgr_delete_mod;" .. - fgettext("Uninstall Package") .. "]" + fgettext("Information:") .. ";" .. desc .. "]" + + if core.may_modify_path(selected_pkg.path) then + retval = retval .. + "button[5.5,4.65;3.25,1;btn_mod_mgr_delete_mod;" .. + fgettext("Uninstall Package") .. "]" + end end return retval end |