mirror of
https://github.com/minetest/minetest.git
synced 2024-12-03 13:03:45 +01:00
Mainmenu: Standardize the menu button order and sizes
This commit is contained in:
parent
6278da296b
commit
30083d1e00
@ -25,20 +25,20 @@ local function get_formspec(data)
|
|||||||
local mod = data.list:get_list()[data.selected_mod]
|
local mod = data.list:get_list()[data.selected_mod]
|
||||||
|
|
||||||
local retval =
|
local retval =
|
||||||
"size[11,6.5,true]" ..
|
"size[11.5,7.5,true]" ..
|
||||||
"label[0.5,-0.25;" .. fgettext("World:") .. "]" ..
|
"label[0.5,0;" .. fgettext("World:") .. "]" ..
|
||||||
"label[1.75,-0.25;" .. data.worldspec.name .. "]"
|
"label[1.75,0;" .. data.worldspec.name .. "]"
|
||||||
|
|
||||||
if data.hide_gamemods then
|
if data.hide_gamemods then
|
||||||
retval = retval .. "checkbox[0,5.75;cb_hide_gamemods;" .. fgettext("Hide Game") .. ";true]"
|
retval = retval .. "checkbox[1,6;cb_hide_gamemods;" .. fgettext("Hide Game") .. ";true]"
|
||||||
else
|
else
|
||||||
retval = retval .. "checkbox[0,5.75;cb_hide_gamemods;" .. fgettext("Hide Game") .. ";false]"
|
retval = retval .. "checkbox[1,6;cb_hide_gamemods;" .. fgettext("Hide Game") .. ";false]"
|
||||||
end
|
end
|
||||||
|
|
||||||
if data.hide_modpackcontents then
|
if data.hide_modpackcontents then
|
||||||
retval = retval .. "checkbox[2,5.75;cb_hide_mpcontent;" .. fgettext("Hide mp content") .. ";true]"
|
retval = retval .. "checkbox[6,6;cb_hide_mpcontent;" .. fgettext("Hide mp content") .. ";true]"
|
||||||
else
|
else
|
||||||
retval = retval .. "checkbox[2,5.75;cb_hide_mpcontent;" .. fgettext("Hide mp content") .. ";false]"
|
retval = retval .. "checkbox[6,6;cb_hide_mpcontent;" .. fgettext("Hide mp content") .. ";false]"
|
||||||
end
|
end
|
||||||
|
|
||||||
if mod == nil then
|
if mod == nil then
|
||||||
@ -46,13 +46,13 @@ local function get_formspec(data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
retval = retval ..
|
retval = retval ..
|
||||||
"label[0,0.45;" .. fgettext("Mod:") .. "]" ..
|
"label[0,0.7;" .. fgettext("Mod:") .. "]" ..
|
||||||
"label[0.75,0.45;" .. mod.name .. "]" ..
|
"label[0.75,0.7;" .. mod.name .. "]" ..
|
||||||
"label[0,1;" .. fgettext("Depends:") .. "]" ..
|
"label[0,1.25;" .. fgettext("Depends:") .. "]" ..
|
||||||
"textlist[0,1.5;5,4.25;world_config_depends;" ..
|
"textlist[0,1.75;5,4.25;world_config_depends;" ..
|
||||||
modmgr.get_dependencies(mod.path) .. ";0]" ..
|
modmgr.get_dependencies(mod.path) .. ";0]" ..
|
||||||
"button[9.25,6.35;2,0.5;btn_config_world_save;" .. fgettext("Save") .. "]" ..
|
"button[3.25,7;2.5,0.5;btn_config_world_save;" .. fgettext("Save") .. "]" ..
|
||||||
"button[7.4,6.35;2,0.5;btn_config_world_cancel;" .. fgettext("Cancel") .. "]"
|
"button[5.75,7;2.5,0.5;btn_config_world_cancel;" .. fgettext("Cancel") .. "]"
|
||||||
|
|
||||||
if mod ~= nil and mod.name ~= "" and mod.typ ~= "game_mod" then
|
if mod ~= nil and mod.name ~= "" and mod.typ ~= "game_mod" then
|
||||||
if mod.is_modpack then
|
if mod.is_modpack then
|
||||||
@ -68,22 +68,22 @@ local function get_formspec(data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if all_enabled == false then
|
if all_enabled == false then
|
||||||
retval = retval .. "button[5.5,-0.125;2,0.5;btn_mp_enable;" .. fgettext("Enable MP") .. "]"
|
retval = retval .. "button[5.5,0.125;2.5,0.5;btn_mp_enable;" .. fgettext("Enable MP") .. "]"
|
||||||
else
|
else
|
||||||
retval = retval .. "button[5.5,-0.125;2,0.5;btn_mp_disable;" .. fgettext("Disable MP") .. "]"
|
retval = retval .. "button[5.5,0.125;2.5,0.5;btn_mp_disable;" .. fgettext("Disable MP") .. "]"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if mod.enabled then
|
if mod.enabled then
|
||||||
retval = retval .. "checkbox[5.5,-0.375;cb_mod_enable;" .. fgettext("enabled") .. ";true]"
|
retval = retval .. "checkbox[5.5,-0.125;cb_mod_enable;" .. fgettext("enabled") .. ";true]"
|
||||||
else
|
else
|
||||||
retval = retval .. "checkbox[5.5,-0.375;cb_mod_enable;" .. fgettext("enabled") .. ";false]"
|
retval = retval .. "checkbox[5.5,-0.125;cb_mod_enable;" .. fgettext("enabled") .. ";false]"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
retval = retval ..
|
retval = retval ..
|
||||||
"button[8.5,-0.125;2.5,0.5;btn_all_mods;" .. fgettext("Enable all") .. "]" ..
|
"button[8.75,0.125;2.5,0.5;btn_all_mods;" .. fgettext("Enable all") .. "]" ..
|
||||||
"textlist[5.5,0.5;5.5,5.75;world_config_modlist;"
|
"textlist[5.5,0.75;5.75,5.25;world_config_modlist;"
|
||||||
|
|
||||||
retval = retval .. modmgr.render_modlist(data.list)
|
retval = retval .. modmgr.render_modlist(data.list)
|
||||||
retval = retval .. ";" .. data.selected_mod .."]"
|
retval = retval .. ";" .. data.selected_mod .."]"
|
||||||
|
@ -46,7 +46,7 @@ local function create_world_formspec(dialogdata)
|
|||||||
|
|
||||||
current_seed = core.formspec_escape(current_seed)
|
current_seed = core.formspec_escape(current_seed)
|
||||||
local retval =
|
local retval =
|
||||||
"size[12,6,true]" ..
|
"size[11.5,6.5,true]" ..
|
||||||
"label[2,0;" .. fgettext("World name") .. "]"..
|
"label[2,0;" .. fgettext("World name") .. "]"..
|
||||||
"field[4.5,0.4;6,0.5;te_world_name;;]" ..
|
"field[4.5,0.4;6,0.5;te_world_name;;]" ..
|
||||||
|
|
||||||
@ -60,8 +60,8 @@ local function create_world_formspec(dialogdata)
|
|||||||
"textlist[4.2,3;5.8,2.3;games;" .. gamemgr.gamelist() ..
|
"textlist[4.2,3;5.8,2.3;games;" .. gamemgr.gamelist() ..
|
||||||
";" .. gameidx .. ";true]" ..
|
";" .. gameidx .. ";true]" ..
|
||||||
|
|
||||||
"button[5,5.5;2.6,0.5;world_create_confirm;" .. fgettext("Create") .. "]" ..
|
"button[3.25,6;2.5,0.5;world_create_confirm;" .. fgettext("Create") .. "]" ..
|
||||||
"button[7.5,5.5;2.8,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]"
|
"button[5.75,6;2.5,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]"
|
||||||
|
|
||||||
if #gamemgr.games == 0 then
|
if #gamemgr.games == 0 then
|
||||||
retval = retval .. "box[2,4;8,1;#ff8800]label[2.25,4;" ..
|
retval = retval .. "box[2,4;8,1;#ff8800]label[2.25,4;" ..
|
||||||
|
@ -22,10 +22,11 @@ local function delete_mod_formspec(dialogdata)
|
|||||||
dialogdata.mod = modmgr.global_mods:get_list()[dialogdata.selected]
|
dialogdata.mod = modmgr.global_mods:get_list()[dialogdata.selected]
|
||||||
|
|
||||||
local retval =
|
local retval =
|
||||||
"size[12.4,5,true]" ..
|
"size[11.5,4.5,true]" ..
|
||||||
"field[1.75,1;10,3;;" .. fgettext("Are you sure you want to delete \"$1\"?", dialogdata.mod.name) .. ";]"..
|
"label[2,2;" ..
|
||||||
"button[4,4.2;1,0.5;dlg_delete_mod_confirm;" .. fgettext("Yes") .. "]" ..
|
fgettext("Are you sure you want to delete \"$1\"?", dialogdata.mod.name) .. "]"..
|
||||||
"button[6.5,4.2;3,0.5;dlg_delete_mod_cancel;" .. fgettext("No of course not!") .. "]"
|
"button[3.25,3.5;2.5,0.5;dlg_delete_mod_confirm;" .. fgettext("Delete") .. "]" ..
|
||||||
|
"button[5.75,3.5;2.5,0.5;dlg_delete_mod_cancel;" .. fgettext("Cancel") .. "]"
|
||||||
|
|
||||||
return retval
|
return retval
|
||||||
end
|
end
|
||||||
|
@ -19,11 +19,11 @@
|
|||||||
local function delete_world_formspec(dialogdata)
|
local function delete_world_formspec(dialogdata)
|
||||||
|
|
||||||
local retval =
|
local retval =
|
||||||
"size[12,6,true]" ..
|
"size[11.5,4.5,true]" ..
|
||||||
"label[2,2;" ..
|
"label[2,2;" ..
|
||||||
fgettext("Delete World \"$1\"?", dialogdata.delete_name) .. "]"..
|
fgettext("Delete World \"$1\"?", dialogdata.delete_name) .. "]" ..
|
||||||
"button[3.5,4.2;2.6,0.5;world_delete_confirm;" .. fgettext("Yes").. "]" ..
|
"button[3.25,3.5;2.5,0.5;world_delete_confirm;" .. fgettext("Delete") .. "]" ..
|
||||||
"button[6,4.2;2.8,0.5;world_delete_cancel;" .. fgettext("No") .. "]"
|
"button[5.75,3.5;2.5,0.5;world_delete_cancel;" .. fgettext("Cancel") .. "]"
|
||||||
return retval
|
return retval
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -22,14 +22,12 @@ local function rename_modpack_formspec(dialogdata)
|
|||||||
dialogdata.mod = modmgr.global_mods:get_list()[dialogdata.selected]
|
dialogdata.mod = modmgr.global_mods:get_list()[dialogdata.selected]
|
||||||
|
|
||||||
local retval =
|
local retval =
|
||||||
"size[12.4,5,true]" ..
|
"size[11.5,4.5,true]" ..
|
||||||
"label[1.75,1;".. fgettext("Rename Modpack:") .. "]"..
|
"field[2.5,2;7,0.5;te_modpack_name;".. fgettext("Rename Modpack:") .. ";" ..
|
||||||
"field[4.5,1.4;6,0.5;te_modpack_name;;" ..
|
dialogdata.mod.name .. "]" ..
|
||||||
dialogdata.mod.name ..
|
"button[3.25,3.5;2.5,0.5;dlg_rename_modpack_confirm;"..
|
||||||
"]" ..
|
|
||||||
"button[5,4.2;2.6,0.5;dlg_rename_modpack_confirm;"..
|
|
||||||
fgettext("Accept") .. "]" ..
|
fgettext("Accept") .. "]" ..
|
||||||
"button[7.5,4.2;2.8,0.5;dlg_rename_modpack_cancel;"..
|
"button[5.75,3.5;2.5,0.5;dlg_rename_modpack_cancel;"..
|
||||||
fgettext("Cancel") .. "]"
|
fgettext("Cancel") .. "]"
|
||||||
|
|
||||||
return retval
|
return retval
|
||||||
|
@ -187,7 +187,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
|
|||||||
|
|
||||||
{
|
{
|
||||||
core::rect < s32 > rect(0, 0, 100, 30);
|
core::rect < s32 > rect(0, 0, 100, 30);
|
||||||
rect += topleft + v2s32(size.X - 100 - 20, size.Y - 40);
|
rect += topleft + v2s32(size.X / 2 - 105, size.Y - 40);
|
||||||
const wchar_t *text = wgettext("Save");
|
const wchar_t *text = wgettext("Save");
|
||||||
Environment->addButton(rect, this, GUI_ID_BACK_BUTTON,
|
Environment->addButton(rect, this, GUI_ID_BACK_BUTTON,
|
||||||
text);
|
text);
|
||||||
@ -195,7 +195,7 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
core::rect < s32 > rect(0, 0, 100, 30);
|
core::rect < s32 > rect(0, 0, 100, 30);
|
||||||
rect += topleft + v2s32(size.X - 100 - 20 - 100 - 20, size.Y - 40);
|
rect += topleft + v2s32(size.X / 2 + 5, size.Y - 40);
|
||||||
const wchar_t *text = wgettext("Cancel");
|
const wchar_t *text = wgettext("Cancel");
|
||||||
Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON,
|
Environment->addButton(rect, this, GUI_ID_ABORT_BUTTON,
|
||||||
text);
|
text);
|
||||||
|
Loading…
Reference in New Issue
Block a user