Skip to content

Commit 4937c50

Browse files
HybridDogSmallJoker
authored andcommittedAug 17, 2018
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
1 parent 4dff002 commit 4937c50

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed
 

‎builtin/mainmenu/dlg_config_world.lua

+19-7
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,26 @@ local function get_formspec(data)
3333

3434
local hard_deps, soft_deps = pkgmgr.get_dependencies(mod.path)
3535

36+
if mod.is_modpack then
37+
local info = minetest.formspec_escape(
38+
core.get_content_info(mod.path).description)
39+
if info == "" then
40+
info = fgettext("No modpack description provided.")
41+
end
42+
retval = retval ..
43+
"textarea[0.25,0.7;5.75,7.2;;" .. info .. ";]"
44+
else
45+
retval = retval ..
46+
"label[0,0.7;" .. fgettext("Mod:") .. "]" ..
47+
"label[0.75,0.7;" .. mod.name .. "]" ..
48+
"label[0,1.25;" .. fgettext("Dependencies:") .. "]" ..
49+
"textlist[0,1.75;5,2.125;world_config_depends;" .. hard_deps ..
50+
";0]" ..
51+
"label[0,3.875;" .. fgettext("Optional dependencies:") .. "]" ..
52+
"textlist[0,4.375;5,1.8;world_config_optdepends;" ..
53+
soft_deps .. ";0]"
54+
end
3655
retval = retval ..
37-
"label[0,0.7;" .. fgettext("Mod:") .. "]" ..
38-
"label[0.75,0.7;" .. mod.name .. "]" ..
39-
"label[0,1.25;" .. fgettext("Dependencies:") .. "]" ..
40-
"textlist[0,1.75;5,2.125;world_config_depends;" .. hard_deps .. ";0]" ..
41-
"label[0,3.875;" .. fgettext("Optional dependencies:") .. "]" ..
42-
"textlist[0,4.375;5,1.8;world_config_optdepends;" ..
43-
soft_deps .. ";0]" ..
4456
"button[3.25,7;2.5,0.5;btn_config_world_save;" ..
4557
fgettext("Save") .. "]" ..
4658
"button[5.75,7;2.5,0.5;btn_config_world_cancel;" ..

0 commit comments

Comments
 (0)
Please sign in to comment.