adjusted initial config of formspec dialog to newer versions

This commit is contained in:
Sokomine 2022-04-10 20:23:24 +02:00
parent 28106daa7b
commit 430a1eae71
2 changed files with 14 additions and 14 deletions

View File

@ -26,7 +26,7 @@ yl_speak_up.create_dropdown_playerlist = function(player, pname,
text = text..";"..tostring(index_selected)..";]"
if(index_selected == 1) then
-- first index "Add player" selected? Then offer a field for entering the name
text = text.."field["..tostring(start_x + 4.0 + stretch_x)..","..tostring(start_y + 0.3)..
text = text.."field["..tostring(start_x + 4.0 + stretch_x)..","..tostring(start_y)..
";"..tostring(3.5 + stretch_x)..",0.9;"..
tostring(field_name_for_adding_player)..";;]"..
"tooltip["..tostring(field_name_for_adding_player)..";"..

View File

@ -233,11 +233,11 @@ yl_speak_up.get_fs_initial_config = function(player, n_id, d_id, is_initial_conf
table_of_names = dialog.n_may_edit
may_be_edited_by =
-- who can edit this NPC?
"label[0.2,4.05;May be edited by:]"..
"label[0.2,4.75;May be edited by:]"..
-- offer a dropdown list and a text input field for player names for adding
yl_speak_up.create_dropdown_playerlist(player, pname,
table_of_names, yl_speak_up.speak_to[pname].tmp_index,
2.5, 3.9, 0.0, "list_may_edit", "player", "Remove player from list",
3.0, 4.3, 0.0, "list_may_edit", "player", "Remove player from list",
"add_may_edit",
"Enter the name of the player whom you\n"..
"want to grant the right to edit your NPC.\n"..
@ -248,26 +248,26 @@ yl_speak_up.get_fs_initial_config = function(player, n_id, d_id, is_initial_conf
"longer be able to edit your NPC."
)
end
local formspec = "size[10,6]"..
"label[0.2,0.2;"..tmp_text.."]"..
local formspec = "size[11,6.5]"..
"label[0.2,0.5;"..tmp_text.."]"..
-- name of the npc
"label[0.2,1.05;Name:]"..
"field[2.0,1.2;4,0.9;n_npc;;"..minetest.formspec_escape(tmp_name).."]"..
"label[7.0,1.05;NPC ID: "..minetest.colorize("#FFFF00",tostring(n_id)).."]"..
"label[0.2,1.65;Name:]"..
"field[2.2,1.2;4,0.9;n_npc;;"..minetest.formspec_escape(tmp_name).."]"..
"label[7.0,1.65;NPC ID: "..minetest.colorize("#FFFF00",tostring(n_id)).."]"..
"tooltip[n_npc;n_npc: The name of the NPC;#FFFFFF;#000000]"..
-- description of the npc
"label[0.2,2.05;Description:]"..
"field[2.0,2.2;8,0.9;n_description;;"..minetest.formspec_escape(tmp_descr).."]"..
"label[0.2,2.65;Description:]"..
"field[2.2,2.2;8,0.9;n_description;;"..minetest.formspec_escape(tmp_descr).."]"..
"tooltip[n_description;n_description: A description for the NPC;#FFFFFF;#000000]"..
-- the owner of the NPC
"label[0.2,3.05;Owner:]"..
"field[2.0,3.2;8,0.9;n_owner;;"..minetest.formspec_escape(tmp_owner).."]"..
"label[0.2,3.65;Owner:]"..
"field[2.2,3.2;8,0.9;n_owner;;"..minetest.formspec_escape(tmp_owner).."]"..
"tooltip[n_owner;The owner of the NPC. This can only be changed\n"..
"if you have the npc_talk_master priv.;#FFFFFF;#000000]"..
may_be_edited_by..
-- save and exit buttons
"button_exit[3.2,5.2;2,0.9;save_initial_config;Save]"..
"button_exit[5.4,5.2;2,0.9;exit;Exit]"
"button_exit[3.2,5.5;2,0.9;save_initial_config;Save]"..
"button_exit[5.4,5.5;2,0.9;exit;Exit]"
-- show the formspec to the player
return formspec
end