made edit option menu slightly nicer

This commit is contained in:
Sokomine 2021-06-29 20:26:25 +02:00
parent 86eaaae3ea
commit 61bd16f3f2
2 changed files with 21 additions and 21 deletions

View File

@ -293,8 +293,8 @@ yl_speak_up.get_fs_edit_option_dialog = function(player, n_id, d_id, o_id)
-- the text the NPC says -- the text the NPC says
"label[0.2,0.6;NPC says ".. "label[0.2,0.6;NPC says "..
minetest.formspec_escape("[dialog \""..tostring(d_id).."\"]:").."]".. minetest.formspec_escape("[dialog \""..tostring(d_id).."\"]:").."]"..
"hypertext[1.2,1.2;19.6,2.5;d_text;<normal>".. "hypertext[1.2,1.2;19.6,2.5;d_text;<global background=#777766><normal><normal>"..
minetest.formspec_escape(n_dialog.d_text) .. "\n</normal>".."]".. minetest.formspec_escape(n_dialog.d_text) .. "\n</normal></global>]"..
"tooltip[1.2,1.2;19.6,3.0;This is what the NPC says to the player.]".. "tooltip[1.2,1.2;19.6,3.0;This is what the NPC says to the player.]"..
-- list the preconditions -- list the preconditions
"label[0.2,4.2;If all of the following pre(C)onditions are fulfilled:]".. "label[0.2,4.2;If all of the following pre(C)onditions are fulfilled:]"..
@ -307,23 +307,23 @@ yl_speak_up.get_fs_edit_option_dialog = function(player, n_id, d_id, o_id)
"Please click on a pre(C)ondition in order\n".. "Please click on a pre(C)ondition in order\n"..
"to edit or delete it!]".. "to edit or delete it!]"..
-- answer of the player (the actual option) -- answer of the player (the actual option)
"label[0.2,6.8;..the player may answer with this text".. "label[0.2,6.9;..the player may answer with this text"..
minetest.formspec_escape(" [dialog option \""..tostring(o_id).."\"]:").."]".. minetest.formspec_escape(" [dialog option \""..tostring(o_id).."\"]:").."]"..
"label[1.2,7.6;A:]".. "label[1.2,7.7;A:]"..
"field[1.7,7.1;19.1,0.9;text_option_"..minetest.formspec_escape(o_id)..";;".. "field[1.7,7.2;19.1,0.9;text_option_"..minetest.formspec_escape(o_id)..";;"..
minetest.formspec_escape(d_option.o_text_when_prerequisites_met).."]".. minetest.formspec_escape(d_option.o_text_when_prerequisites_met).."]"..
"tooltip[option_text_met;This is the answer the player may choose if the ".. "tooltip[option_text_met;This is the answer the player may choose if the "..
"preconditions are all fulfilled.]".. "preconditions are all fulfilled.]"..
-- dropdown for selecting weather to show the alternate answer or not -- dropdown for selecting weather to show the alternate answer or not
"label[0.2,8.6;..but if at least one pre(C)ondition is not fulfilled, then...]".. "label[0.2,8.6;..but if at least one pre(C)ondition is not fulfilled, then...]"..
"dropdown[12.0,8.2;8.6,0.9;hide_or_grey_or_alternate_answer;".. "dropdown[12.0,8.2;8.6,0.7;hide_or_grey_or_alternate_answer;"..
"..hide this answer.,".. "..hide this answer.,"..
"..grey out this answer.,".. "..grey out the following answer:,"..
"..display the following alternate answer:;".. "..display the following alternate answer:;"..
alternate_answer_option..";]".. alternate_answer_option..";]"..
-- alternate answer -- alternate answer
"label[1.2,9.6;A:]".. "label[1.2,9.4;A:]"..
"field[1.7,9.1;19.1,0.9;option_text_not_met;;".. "field[1.7,8.9;19.1,0.9;option_text_not_met;;"..
minetest.formspec_escape(d_option.o_text_when_prerequisites_not_met).."]".. minetest.formspec_escape(d_option.o_text_when_prerequisites_not_met).."]"..
"tooltip[option_text_not_met;This is the answer the player may choose if the ".. "tooltip[option_text_not_met;This is the answer the player may choose if the "..
"preconditions are NOT all fulfilled.]".. "preconditions are NOT all fulfilled.]"..
@ -333,30 +333,30 @@ yl_speak_up.get_fs_edit_option_dialog = function(player, n_id, d_id, o_id)
"table[1.2,10.9;19.6,0.7;table_of_actions;".. "table[1.2,10.9;19.6,0.7;table_of_actions;"..
list_of_actions..";0]".. list_of_actions..";0]"..
-- list of effects -- list of effects
"label[0.2,12.0;If the player completed the above action successfully, ".. "label[0.2,12.1;If the player completed the above action successfully, "..
"apply the following (Ef)fects:]".. "apply the following (Ef)fects:]"..
"tablecolumns[text;color,span=1;text;text]".. "tablecolumns[text;color,span=1;text;text]"..
"table[1.2,12.3;19.6,2.0;table_of_effects;".. "table[1.2,12.4;19.6,2.0;table_of_effects;"..
list_of_effects..";0]".. list_of_effects..";0]"..
"tooltip[1.2,12.3;19.6,2.0;".. "tooltip[1.2,12.4;19.6,2.0;"..
"*All* (Ef)fects are executed after the action (if there is\n".. "*All* (Ef)fects are executed after the action (if there is\n"..
"one defined in this option) has been completed successfully\n".. "one defined in this option) has been completed successfully\n"..
"by the player. If there is no action defined, then the\n".. "by the player. If there is no action defined, then the\n"..
"(Ef)fects will always be executed when this option here is\n".. "(Ef)fects will always be executed when this option here is\n"..
"selected.\n".. "selected.\n"..
"Please click on an (Ef)fect in order to edit or delete it!]".. "Please click on an (Ef)fect in order to edit or delete it!]"..
-- ..and what the NPC will reply to that answer
"label[0.2,15.1;The NPC will react to this answer with the following dialog:]"..
"hypertext[1.2,15.7;19.6,2.5;d_text_next;<normal>"..
minetest.formspec_escape(next_text) .. "\n</normal>".."]"..
"tooltip[1.2,16.8;21.0,2.5;This is what the NPC will say next when the player has "..
"selected this answer here.]"..
-- allow to change the target dialog via a dropdown menu -- allow to change the target dialog via a dropdown menu
"dropdown[14.8,14.7;5,0.9;d_id_"..minetest.formspec_escape(o_id)..";".. "dropdown[13.3,14.7;7.5,0.7;d_id_"..minetest.formspec_escape(o_id)..";"..
dialog_list..";"..dialog_selected..",]".. dialog_list..";"..dialog_selected..",]"..
"tooltip[14.8,14.7;5,0.9;Select the target dialog with which the NPC shall react ".. "tooltip[13.3,14.7;7.5,0.7;Select the target dialog with which the NPC shall react "..
"to this answer. Currently, dialog "..minetest.formspec_escape(target_dialog).. "to this answer. Currently, dialog "..minetest.formspec_escape(target_dialog)..
" is beeing displayed.;#FFFFFF;#000000]".. " is beeing displayed.;#FFFFFF;#000000]"..
-- ..and what the NPC will reply to that answer
"label[0.2,15.1;The NPC will react to this answer with the following dialog:]"..
"hypertext[1.2,15.5;19.6,2.5;d_text_next;<global background=#777766><normal>"..
minetest.formspec_escape(next_text) .. "\n</normal></global>]"..
"tooltip[1.2,16.8;21.0,2.5;This is what the NPC will say next when the player has "..
"selected this answer here.]"..
-- button: delete -- button: delete
"button[0.2,18.7;2.0,0.9;del_option;Delete]".. "button[0.2,18.7;2.0,0.9;del_option;Delete]"..
"tooltip[del_option;Delete this option/answer.]".. "tooltip[del_option;Delete this option/answer.]"..

View File

@ -2106,7 +2106,7 @@ yl_speak_up.edit_mode_apply_changes = function(pname, fields)
" is not met, hide option/answer.") " is not met, hide option/answer.")
-- make sure we show this options update next -- make sure we show this options update next
result["show_next_option"] = o_id result["show_next_option"] = o_id
elseif(fields.hide_or_grey_or_alternate_answer == "..grey out this answer." elseif(fields.hide_or_grey_or_alternate_answer == "..grey out the following answer:"
and d_option.o_grey_when_prerequisites_not_met ~= "true") then and d_option.o_grey_when_prerequisites_not_met ~= "true") then
d_option.o_hide_when_prerequisites_not_met = "false" d_option.o_hide_when_prerequisites_not_met = "false"
d_option.o_grey_when_prerequisites_not_met = "true" d_option.o_grey_when_prerequisites_not_met = "true"