From 5a4f137b65c445b1173c33ae6b73f5260bc10f5c Mon Sep 17 00:00:00 2001 From: Sokomine Date: Thu, 15 Sep 2022 23:02:39 +0200 Subject: [PATCH] display earlier in edit mode if an option is an automaticly selected one --- fs_talkdialog.lua | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/fs_talkdialog.lua b/fs_talkdialog.lua index 7a95cb4..71baecc 100644 --- a/fs_talkdialog.lua +++ b/fs_talkdialog.lua @@ -521,14 +521,21 @@ yl_speak_up.get_fs_talkdialog_line_in_edit_mode = function( "trade of this option.", (actions and next(actions))) - -- show the actual text for the option - yl_speak_up.add_formspec_element_with_tooltip_if(formspec, - "field", tostring(9.9+offset)..","..h..";".. - tostring(field_length)..",0.9", - "text_option_" .. oid, - ";"..minetest.formspec_escape(sb_v.o_text_when_prerequisites_met), - "Edit the text that is displayed on button "..oid..".", - true) + if(sb_v.o_autoanswer) then + table.insert(formspec, + "label["..tostring(9.9+offset+0.2)..","..tostring(h+0.5)..";".. + minetest.formspec_escape("[Automaticly selected if preconditions are met]").. + "]") + else + -- show the actual text for the option + yl_speak_up.add_formspec_element_with_tooltip_if(formspec, + "field", tostring(9.9+offset)..","..h..";".. + tostring(field_length)..",0.9", + "text_option_" .. oid, + ";"..minetest.formspec_escape(sb_v.o_text_when_prerequisites_met), + "Edit the text that is displayed on button "..oid..".", + true) + end return {h = h, formspec = formspec} end