mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-12 16:15:20 +02:00
Use tree to list mods rather than textlist
This commit is contained in:
@@ -28,7 +28,8 @@ local function get_formspec(tabview, name, tabdata)
|
||||
|
||||
local retval =
|
||||
"label[0.05,-0.25;".. fgettext("Installed Mods:") .. "]" ..
|
||||
"textlist[0,0.25;5.1,5;modlist;" ..
|
||||
"tablecolumns[color;tree;text]" ..
|
||||
"table[0,0.25;5.1,5;modlist;" ..
|
||||
modmgr.render_modlist(modmgr.global_mods) ..
|
||||
";" .. tabdata.selected_mod .. "]"
|
||||
|
||||
@@ -127,8 +128,8 @@ end
|
||||
--------------------------------------------------------------------------------
|
||||
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
|
||||
|
||||
|
Reference in New Issue
Block a user