diff options
author | HybridDog <ovvv@web.de> | 2018-08-17 20:34:08 +0200 |
---|---|---|
committer | SmallJoker <SmallJoker@users.noreply.github.com> | 2018-08-17 20:34:08 +0200 |
commit | 4937c5007fcb4bf210f6104919b744d1baa46d93 (patch) | |
tree | 1a3b84dc08d88c9a06287d2ab43b38d082009a22 /builtin/mainmenu | |
parent | 4dff0021b8c0ad19db97a6160a338fcac09f7c4c (diff) | |
download | minetest-4937c5007fcb4bf210f6104919b744d1baa46d93.tar.gz minetest-4937c5007fcb4bf210f6104919b744d1baa46d93.tar.bz2 minetest-4937c5007fcb4bf210f6104919b744d1baa46d93.zip |
World config: Add modpack descriptions and remove dependencies there (#7397)
* Allow adding descriptions to modpacks using description.txt
* Use a proper multiline formspec element: textarea
Diffstat (limited to 'builtin/mainmenu')
-rw-r--r-- | builtin/mainmenu/dlg_config_world.lua | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/builtin/mainmenu/dlg_config_world.lua b/builtin/mainmenu/dlg_config_world.lua index 2a7be8d34..140eb60d9 100644 --- a/builtin/mainmenu/dlg_config_world.lua +++ b/builtin/mainmenu/dlg_config_world.lua @@ -33,14 +33,26 @@ local function get_formspec(data) local hard_deps, soft_deps = pkgmgr.get_dependencies(mod.path) + if mod.is_modpack then + local info = minetest.formspec_escape( + core.get_content_info(mod.path).description) + if info == "" then + info = fgettext("No modpack description provided.") + end + retval = retval .. + "textarea[0.25,0.7;5.75,7.2;;" .. info .. ";]" + else + retval = retval .. + "label[0,0.7;" .. fgettext("Mod:") .. "]" .. + "label[0.75,0.7;" .. mod.name .. "]" .. + "label[0,1.25;" .. fgettext("Dependencies:") .. "]" .. + "textlist[0,1.75;5,2.125;world_config_depends;" .. hard_deps .. + ";0]" .. + "label[0,3.875;" .. fgettext("Optional dependencies:") .. "]" .. + "textlist[0,4.375;5,1.8;world_config_optdepends;" .. + soft_deps .. ";0]" + end retval = retval .. - "label[0,0.7;" .. fgettext("Mod:") .. "]" .. - "label[0.75,0.7;" .. mod.name .. "]" .. - "label[0,1.25;" .. fgettext("Dependencies:") .. "]" .. - "textlist[0,1.75;5,2.125;world_config_depends;" .. hard_deps .. ";0]" .. - "label[0,3.875;" .. fgettext("Optional dependencies:") .. "]" .. - "textlist[0,4.375;5,1.8;world_config_optdepends;" .. - soft_deps .. ";0]" .. "button[3.25,7;2.5,0.5;btn_config_world_save;" .. fgettext("Save") .. "]" .. "button[5.75,7;2.5,0.5;btn_config_world_cancel;" .. |