1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Redesign/unify mainmenu settings interface

This commit is contained in:
rubenwardy 2022-06-25 17:33:20 +01:00
parent a421a1d764
commit d35672e78e
12 changed files with 1820 additions and 1535 deletions

View file

@ -40,7 +40,7 @@ dofile(menupath .. DIR_DELIM .. "serverlistmgr.lua")
dofile(menupath .. DIR_DELIM .. "game_theme.lua")
dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua")
dofile(menupath .. DIR_DELIM .. "dlg_settings_advanced.lua")
dofile(menupath .. DIR_DELIM .. "settings" .. DIR_DELIM .. "init.lua")
dofile(menupath .. DIR_DELIM .. "dlg_contentstore.lua")
dofile(menupath .. DIR_DELIM .. "dlg_create_world.lua")
dofile(menupath .. DIR_DELIM .. "dlg_delete_content.lua")
@ -51,7 +51,23 @@ dofile(menupath .. DIR_DELIM .. "dlg_version_info.lua")
local tabs = {}
tabs.settings = dofile(menupath .. DIR_DELIM .. "tab_settings.lua")
tabs.settings = {
name = "settings",
caption = fgettext("Settings"),
cbf_formspec = function()
return "button[0.1,0.1;3,0.8;open_settings;" .. fgettext("Open Settings") .. "]"
end,
cbf_button_handler = function(tabview, fields)
if fields.open_settings then
local dlg = create_settings_dlg()
dlg:set_parent(tabview)
tabview:hide()
dlg:show()
return true
end
end,
}
tabs.content = dofile(menupath .. DIR_DELIM .. "tab_content.lua")
tabs.about = dofile(menupath .. DIR_DELIM .. "tab_about.lua")
tabs.local_game = dofile(menupath .. DIR_DELIM .. "tab_local.lua")
@ -103,7 +119,6 @@ local function init_globals()
tv_main:set_autosave_tab(true)
tv_main:add(tabs.local_game)
tv_main:add(tabs.play_online)
tv_main:add(tabs.content)
tv_main:add(tabs.settings)
tv_main:add(tabs.about)