local retval =
"label[0.05,-0.25;".. fgettext("Installed Mods:") .. "]" ..
- "textlist[0,0.25;5.1,4.35;modlist;" ..
+ "tablecolumns[color;tree;text]" ..
+ "table[0,0.25;5.1,5;modlist;" ..
modmgr.render_modlist(modmgr.global_mods) ..
";" .. tabdata.selected_mod .. "]"
-- "label[0.8,4.2;" .. fgettext("Add mod:") .. "]" ..
-- TODO Disabled due to upcoming release 0.4.8 and irrlicht messing up localization
-- "button[0.75,4.85;1.8,0.5;btn_mod_mgr_install_local;".. fgettext("Local install") .. "]" ..
- "button[0,4.85;5.25,0.5;btn_modstore;".. fgettext("Online mod repository") .. "]"
+
+-- TODO Disabled due to service being offline, and not likely to come online again, in this form
+-- "button[0,4.85;5.25,0.5;btn_modstore;".. fgettext("Online mod repository") .. "]"
+ ""
local selected_mod = nil
descriptionfile:close()
else
descriptionlines = {}
- table.insert(descriptionlines,fgettext("No mod description available"))
+ descriptionlines[#descriptionlines + 1] = fgettext("No mod description available")
end
retval = retval ..
.. fgettext("Uninstall selected modpack") .. "]"
else
--show dependencies
-
- retval = retval .. ",Depends:,"
-
- local toadd = modmgr.get_dependencies(selected_mod.path)
-
- retval = retval .. toadd .. ";0]"
+ local toadd_hard, toadd_soft = modmgr.get_dependencies(selected_mod.path)
+ if toadd_hard == "" and toadd_soft == "" then
+ retval = retval .. "," .. fgettext("No dependencies.")
+ else
+ if toadd_hard ~= "" then
+ retval = retval .. "," .. fgettext("Dependencies:") .. ","
+ retval = retval .. toadd_hard
+ end
+ if toadd_soft ~= "" then
+ if toadd_hard ~= "" then
+ retval = retval .. ","
+ end
+ retval = retval .. "," .. fgettext("Optional dependencies:") .. ","
+ retval = retval .. toadd_soft
+ end
+ end
+
+ retval = retval .. ";0]"
retval = retval .. "button[5.5,4.85;4.5,0.5;btn_mod_mgr_delete_mod;"
.. fgettext("Uninstall selected mod") .. "]"
--------------------------------------------------------------------------------
local function handle_buttons(tabview, fields, tabname, tabdata)
if fields["modlist"] ~= nil then
- local event = core.explode_textlist_event(fields["modlist"])
- tabdata.selected_mod = event.index
+ local event = core.explode_table_event(fields["modlist"])
+ tabdata.selected_mod = event.row
return true
end
end
--------------------------------------------------------------------------------
-tab_mods = {
+return {
name = "mods",
caption = fgettext("Mods"),
cbf_formspec = get_formspec,