mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Use tree to list mods rather than textlist
This commit is contained in:
parent
7760948b7c
commit
bb4db84bdb
3 changed files with 59 additions and 112 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue