From 581efea60e8fad18b9a2fc9d544f014e2ac693f8 Mon Sep 17 00:00:00 2001 From: Kahrl Date: Sun, 7 Dec 2014 22:09:21 +0100 Subject: [PATCH] Remove vertlabels from main menu and relayout a bit --- builtin/mainmenu/tab_credits.lua | 5 ++-- builtin/mainmenu/tab_mods.lua | 9 +++--- builtin/mainmenu/tab_multiplayer.lua | 30 +++++++++---------- builtin/mainmenu/tab_server.lua | 42 +++++++++++++-------------- builtin/mainmenu/tab_settings.lua | 33 ++++++++++----------- builtin/mainmenu/tab_singleplayer.lua | 5 ++-- builtin/mainmenu/tab_texturepacks.lua | 5 ++-- 7 files changed, 61 insertions(+), 68 deletions(-) diff --git a/builtin/mainmenu/tab_credits.lua b/builtin/mainmenu/tab_credits.lua index 7c378dc0b..2a7aa26a5 100644 --- a/builtin/mainmenu/tab_credits.lua +++ b/builtin/mainmenu/tab_credits.lua @@ -22,9 +22,8 @@ tab_credits = { caption = fgettext("Credits"), cbf_formspec = function (tabview, name, tabdata) local logofile = defaulttexturedir .. "logo.png" - return "vertlabel[0,-0.25;CREDITS]" .. - "label[0.5,3;Minetest " .. core.get_version() .. "]" .. - "label[0.5,3.3;http://minetest.net]" .. + return "label[0.5,3.2;Minetest " .. core.get_version() .. "]" .. + "label[0.5,3.5;http://minetest.net]" .. "image[0.5,1;" .. core.formspec_escape(logofile) .. "]" .. "textlist[3.5,-0.25;8.5,5.8;list_credits;" .. "#FFFF00" .. fgettext("Core Developers") .."," .. diff --git a/builtin/mainmenu/tab_mods.lua b/builtin/mainmenu/tab_mods.lua index b258ce6c5..d16ecca8c 100644 --- a/builtin/mainmenu/tab_mods.lua +++ b/builtin/mainmenu/tab_mods.lua @@ -27,17 +27,16 @@ local function get_formspec(tabview, name, tabdata) end local retval = - "vertlabel[0,-0.25;".. fgettext("MODS") .. "]" .. - "label[0.8,-0.25;".. fgettext("Installed Mods:") .. "]" .. - "textlist[0.75,0.25;4.5,4;modlist;" .. + "label[0.05,-0.25;".. fgettext("Installed Mods:") .. "]" .. + "textlist[0,0.25;5.1,4.35;modlist;" .. modmgr.render_modlist(modmgr.global_mods) .. ";" .. tabdata.selected_mod .. "]" retval = retval .. - "label[0.8,4.2;" .. fgettext("Add 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[2.45,4.85;3.05,0.5;btn_modstore;".. fgettext("Online mod repository") .. "]" + "button[0,4.85;5.25,0.5;btn_modstore;".. fgettext("Online mod repository") .. "]" local selected_mod = nil diff --git a/builtin/mainmenu/tab_multiplayer.lua b/builtin/mainmenu/tab_multiplayer.lua index 887568fae..1e41f68b1 100644 --- a/builtin/mainmenu/tab_multiplayer.lua +++ b/builtin/mainmenu/tab_multiplayer.lua @@ -20,28 +20,26 @@ local function get_formspec(tabview, name, tabdata) local render_details = core.is_yes(core.setting_getbool("public_serverlist")) local retval = - "vertlabel[0,-0.25;".. fgettext("CLIENT") .. "]" .. - "label[1,-0.25;".. fgettext("Favorites:") .. "]".. - "label[1,4.25;".. fgettext("Address/Port") .. "]".. - "label[9,2.75;".. fgettext("Name/Password") .. "]" .. - "field[1.25,5.25;5.5,0.5;te_address;;" .. - core.formspec_escape(core.setting_get("address")) .."]" .. - "field[6.75,5.25;2.25,0.5;te_port;;" .. - core.formspec_escape(core.setting_get("remote_port")) .."]" .. - "checkbox[1,3.6;cb_public_serverlist;".. fgettext("Public Serverlist") .. ";" .. + "label[0,4.25;" .. fgettext("Address/Port") .. "]" .. + "label[9,2.75;" .. fgettext("Name/Password") .. "]" .. + "field[0.25,5.25;5.5,0.5;te_address;;" .. + core.formspec_escape(core.setting_get("address")) .. "]" .. + "field[5.75,5.25;2.25,0.5;te_port;;" .. + core.formspec_escape(core.setting_get("remote_port")) .. "]" .. + "checkbox[0,3.6;cb_public_serverlist;" .. fgettext("Public Serverlist") .. ";" .. dump(core.setting_getbool("public_serverlist")) .. "]" if not core.setting_getbool("public_serverlist") then retval = retval .. - "button[6.45,3.95;2.25,0.5;btn_delete_favorite;".. fgettext("Delete") .. "]" + "button[6.45,3.95;2.25,0.5;btn_delete_favorite;" .. fgettext("Delete") .. "]" end retval = retval .. - "button[9,4.95;2.5,0.5;btn_mp_connect;".. fgettext("Connect") .. "]" .. + "button[9,4.95;2.5,0.5;btn_mp_connect;" .. fgettext("Connect") .. "]" .. "field[9.3,3.75;2.5,0.5;te_name;;" .. - core.formspec_escape(core.setting_get("name")) .."]" .. + core.formspec_escape(core.setting_get("name")) .. "]" .. "pwdfield[9.3,4.5;2.5,0.5;te_pwd;]" .. - "textarea[9.3,0.25;2.5,2.75;;" + "textarea[9.3,0;2.5,3.1;;" if tabdata.fav_selected ~= nil and menudata.favorites[tabdata.fav_selected] ~= nil and @@ -66,15 +64,15 @@ local function get_formspec(tabview, name, tabdata) "text,align=right;" .. -- clients "text,align=center,padding=0.25;" .. -- "/" "text,align=right,padding=0.25;" .. -- clients_max - image_column("Creative mode", "creative") .. ";" .. + image_column("Creative mode", "creative") .. ",padding=1;" .. image_column("Damage enabled", "damage") .. ",padding=0.25;" .. image_column("PvP enabled", "pvp") .. ",padding=0.25;" .. - "text]" -- name + "text,padding=1]" -- name else retval = retval .. "tablecolumns[text]" end retval = retval .. - "table[1,0.35;7.5,3.35;favourites;" + "table[0,0;8.5,3.7;favourites;" if #menudata.favorites > 0 then retval = retval .. render_favorite(menudata.favorites[1],render_details) diff --git a/builtin/mainmenu/tab_server.lua b/builtin/mainmenu/tab_server.lua index 34706efbe..1ae2a0656 100644 --- a/builtin/mainmenu/tab_server.lua +++ b/builtin/mainmenu/tab_server.lua @@ -23,33 +23,33 @@ local function get_formspec(tabview, name, tabdata) ) local retval = - "button[4,4.15;2.6,0.5;world_delete;".. fgettext("Delete") .. "]" .. - "button[6.5,4.15;2.8,0.5;world_create;".. fgettext("New") .. "]" .. - "button[9.2,4.15;2.55,0.5;world_configure;".. fgettext("Configure") .. "]" .. - "button[8.5,4.9;3.25,0.5;start_server;".. fgettext("Start Game") .. "]" .. - "label[4,-0.25;".. fgettext("Select World:") .. "]".. - "vertlabel[0,-0.25;".. fgettext("START SERVER") .. "]" .. - "checkbox[0.5,0.25;cb_creative_mode;".. fgettext("Creative Mode") .. ";" .. - dump(core.setting_getbool("creative_mode")) .. "]".. - "checkbox[0.5,0.7;cb_enable_damage;".. fgettext("Enable Damage") .. ";" .. - dump(core.setting_getbool("enable_damage")) .. "]".. - "checkbox[0.5,1.15;cb_server_announce;".. fgettext("Public") .. ";" .. - dump(core.setting_getbool("server_announce")) .. "]".. - "field[0.8,3.2;3.5,0.5;te_playername;".. fgettext("Name") .. ";" .. + "button[4,4.15;2.6,0.5;world_delete;" .. fgettext("Delete") .. "]" .. + "button[6.5,4.15;2.8,0.5;world_create;" .. fgettext("New") .. "]" .. + "button[9.2,4.15;2.55,0.5;world_configure;" .. fgettext("Configure") .. "]" .. + "button[8.5,4.95;3.25,0.5;start_server;" .. fgettext("Start Game") .. "]" .. + "label[4,-0.25;" .. fgettext("Select World:") .. "]" .. + "checkbox[0.25,0.25;cb_creative_mode;" .. fgettext("Creative Mode") .. ";" .. + dump(core.setting_getbool("creative_mode")) .. "]" .. + "checkbox[0.25,0.7;cb_enable_damage;" .. fgettext("Enable Damage") .. ";" .. + dump(core.setting_getbool("enable_damage")) .. "]" .. + "checkbox[0.25,1.15;cb_server_announce;" .. fgettext("Public") .. ";" .. + dump(core.setting_getbool("server_announce")) .. "]" .. + "label[0.25,2.2;" .. fgettext("Name/Password") .. "]" .. + "field[0.55,3.2;3.5,0.5;te_playername;;" .. core.formspec_escape(core.setting_get("name")) .. "]" .. - "pwdfield[0.8,4.2;3.5,0.5;te_passwd;".. fgettext("Password") .. "]" - + "pwdfield[0.55,4;3.5,0.5;te_passwd;]" + local bind_addr = core.setting_get("bind_address") if bind_addr ~= nil and bind_addr ~= "" then retval = retval .. - "field[0.8,5.2;2.25,0.5;te_serveraddr;".. fgettext("Bind Address") .. ";" .. - core.formspec_escape(core.setting_get("bind_address")) .."]" .. - "field[3.05,5.2;1.25,0.5;te_serverport;".. fgettext("Port") .. ";" .. - core.formspec_escape(core.setting_get("port")) .."]" + "field[0.55,5.2;2.25,0.5;te_serveraddr;" .. fgettext("Bind Address") .. ";" .. + core.formspec_escape(core.setting_get("bind_address")) .. "]" .. + "field[2.8,5.2;1.25,0.5;te_serverport;" .. fgettext("Port") .. ";" .. + core.formspec_escape(core.setting_get("port")) .. "]" else retval = retval .. - "field[0.8,5.2;3.5,0.5;te_serverport;".. fgettext("Server Port") .. ";" .. - core.formspec_escape(core.setting_get("port")) .."]" + "field[0.55,5.2;3.5,0.5;te_serverport;" .. fgettext("Server Port") .. ";" .. + core.formspec_escape(core.setting_get("port")) .. "]" end retval = retval .. diff --git a/builtin/mainmenu/tab_settings.lua b/builtin/mainmenu/tab_settings.lua index 1f8743140..f46fd17d6 100644 --- a/builtin/mainmenu/tab_settings.lua +++ b/builtin/mainmenu/tab_settings.lua @@ -130,32 +130,31 @@ local function formspec(tabview, name, tabdata) local tab_string = - "vertlabel[0,-0.25;" .. fgettext("SETTINGS") .. "]" .. - "box[0.75,0;3.25,4;#999999]" .. - "checkbox[1,0;cb_smooth_lighting;".. fgettext("Smooth Lighting") + "box[0,0;3.5,4;#999999]" .. + "checkbox[0.25,0;cb_smooth_lighting;".. fgettext("Smooth Lighting") .. ";".. dump(core.setting_getbool("smooth_lighting")) .. "]".. - "checkbox[1,0.5;cb_particles;".. fgettext("Enable Particles") .. ";" + "checkbox[0.25,0.5;cb_particles;".. fgettext("Enable Particles") .. ";" .. dump(core.setting_getbool("enable_particles")) .. "]".. - "checkbox[1,1;cb_3d_clouds;".. fgettext("3D Clouds") .. ";" + "checkbox[0.25,1;cb_3d_clouds;".. fgettext("3D Clouds") .. ";" .. dump(core.setting_getbool("enable_3d_clouds")) .. "]".. - "checkbox[1,1.5;cb_fancy_trees;".. fgettext("Fancy Trees") .. ";" + "checkbox[0.25,1.5;cb_fancy_trees;".. fgettext("Fancy Trees") .. ";" .. dump(core.setting_getbool("new_style_leaves")) .. "]".. - "checkbox[1,2.0;cb_opaque_water;".. fgettext("Opaque Water") .. ";" + "checkbox[0.25,2.0;cb_opaque_water;".. fgettext("Opaque Water") .. ";" .. dump(core.setting_getbool("opaque_water")) .. "]".. - "checkbox[1,2.5;cb_connected_glass;".. fgettext("Connected Glass") .. ";" + "checkbox[0.25,2.5;cb_connected_glass;".. fgettext("Connected Glass") .. ";" .. dump(core.setting_getbool("connected_glass")) .. "]".. - "dropdown[1,3.25;3;dd_video_driver;" + "dropdown[0.25,3.25;3.25;dd_video_driver;" .. video_driver_string .. ";" .. current_video_driver_idx .. "]" .. "tooltip[dd_video_driver;" .. fgettext("Restart minetest for driver change to take effect") .. "]" .. - "box[4.25,0;3.25,2.5;#999999]" .. - "checkbox[4.5,0;cb_mipmapping;".. fgettext("Mip-Mapping") .. ";" + "box[3.75,0;3.75,2.5;#999999]" .. + "checkbox[4,0;cb_mipmapping;".. fgettext("Mip-Mapping") .. ";" .. dump(core.setting_getbool("mip_map")) .. "]".. - "checkbox[4.5,0.5;cb_anisotrophic;".. fgettext("Anisotropic Filtering") .. ";" + "checkbox[4,0.5;cb_anisotrophic;".. fgettext("Anisotropic Filtering") .. ";" .. dump(core.setting_getbool("anisotropic_filter")) .. "]".. - "checkbox[4.5,1.0;cb_bilinear;".. fgettext("Bi-Linear Filtering") .. ";" + "checkbox[4,1.0;cb_bilinear;".. fgettext("Bi-Linear Filtering") .. ";" .. dump(core.setting_getbool("bilinear_filter")) .. "]".. - "checkbox[4.5,1.5;cb_trilinear;".. fgettext("Tri-Linear Filtering") .. ";" + "checkbox[4,1.5;cb_trilinear;".. fgettext("Tri-Linear Filtering") .. ";" .. dump(core.setting_getbool("trilinear_filter")) .. "]".. "box[7.75,0;4,4;#999999]" .. "checkbox[8,0;cb_shaders;".. fgettext("Shaders") .. ";" @@ -168,9 +167,9 @@ local function formspec(tabview, name, tabdata) "button[8,4.75;3.75,0.5;btn_reset_singleplayer;".. fgettext("Reset singleplayer world") .. "]" end tab_string = tab_string .. - "box[0.75,4.25;3.25,1.25;#999999]" .. - "label[1,4.25;" .. fgettext("GUI scale factor") .. "]" .. - "scrollbar[1,4.75;2.75,0.4;sb_gui_scaling;horizontal;" .. + "box[0,4.25;3.5,1.25;#999999]" .. + "label[0.25,4.25;" .. fgettext("GUI scale factor") .. "]" .. + "scrollbar[0.25,4.75;3,0.4;sb_gui_scaling;horizontal;" .. gui_scale_to_scrollbar() .. "]" .. "tooltip[sb_gui_scaling;" .. fgettext("Scaling factor applied to menu elements: ") .. diff --git a/builtin/mainmenu/tab_singleplayer.lua b/builtin/mainmenu/tab_singleplayer.lua index 1f96a85db..9dc377a8f 100644 --- a/builtin/mainmenu/tab_singleplayer.lua +++ b/builtin/mainmenu/tab_singleplayer.lua @@ -87,10 +87,9 @@ local function get_formspec(tabview, name, tabdata) "button[9.2,4.15;2.55,0.5;world_configure;".. fgettext("Configure") .. "]" .. "button[8.5,4.95;3.25,0.5;play;".. fgettext("Play") .. "]" .. "label[4,-0.25;".. fgettext("Select World:") .. "]".. - "vertlabel[0,-0.25;".. fgettext("SINGLE PLAYER") .. "]" .. - "checkbox[0.5,0.25;cb_creative_mode;".. fgettext("Creative Mode") .. ";" .. + "checkbox[0.25,0.25;cb_creative_mode;".. fgettext("Creative Mode") .. ";" .. dump(core.setting_getbool("creative_mode")) .. "]".. - "checkbox[0.5,0.7;cb_enable_damage;".. fgettext("Enable Damage") .. ";" .. + "checkbox[0.25,0.7;cb_enable_damage;".. fgettext("Enable Damage") .. ";" .. dump(core.setting_getbool("enable_damage")) .. "]".. "textlist[4,0.25;7.5,3.7;sp_worlds;" .. menu_render_worldlist() .. diff --git a/builtin/mainmenu/tab_texturepacks.lua b/builtin/mainmenu/tab_texturepacks.lua index db5ac3465..d32c073ab 100644 --- a/builtin/mainmenu/tab_texturepacks.lua +++ b/builtin/mainmenu/tab_texturepacks.lua @@ -47,7 +47,6 @@ end local function get_formspec(tabview, name, tabdata) local retval = "label[4,-0.25;".. fgettext("Select texture pack:") .. "]".. - "vertlabel[0,-0.25;".. fgettext("TEXTURE PACKS") .. "]" .. "textlist[4,0.25;7.5,5.0;TPs;" local current_texture_path = core.setting_get("texture_path") @@ -83,8 +82,8 @@ local function get_formspec(tabview, name, tabdata) return retval .. render_texture_pack_list(list) .. ";" .. index .. "]" .. - "image[0.65,0.25;4.0,3.7;"..core.formspec_escape(screenfile or no_screenshot).."]".. - "textarea[1.0,3.25;3.7,1.5;;"..core.formspec_escape(infotext or "")..";]" + "image[0.25,0.25;4.0,3.7;"..core.formspec_escape(screenfile or no_screenshot).."]".. + "textarea[0.6,3.25;3.7,1.5;;"..core.formspec_escape(infotext or "")..";]" end -------------------------------------------------------------------------------- -- 2.25.1