From 608935277f53e7f1c56c2a4ecd935acecc9bb2a9 Mon Sep 17 00:00:00 2001 From: Sokomine Date: Thu, 15 Sep 2022 23:21:10 +0200 Subject: [PATCH] hide autoanswer options if their preconditions are not fulfilled --- fs_edit_options_dialog.lua | 4 ++-- fs_talkdialog.lua | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/fs_edit_options_dialog.lua b/fs_edit_options_dialog.lua index b9da1f4..3b4ab06 100644 --- a/fs_edit_options_dialog.lua +++ b/fs_edit_options_dialog.lua @@ -230,8 +230,8 @@ yl_speak_up.get_fs_edit_option_dialog = function(player, n_id, d_id, o_id, calle "container_end[]" else answer_text = answer_text.. - "label[1.2,0.8;This option will be selected automaticly if all prerequirements are ".. - "fullfilled.]".. + "label[1.2,0.8;This option will not be shown but will be selected automaticly if all ".. + "prerequirements are fullfilled.]".. "label[1.2,1.4;The remaining options of this dialog will in this case not be evaluated.]".. "label[1.2,2.0;The NPC will proceed as if this dialog was choosen manually.]".. "label[1.2,2.6;This is useful for offering a diffrent start dialog depending on the ".. diff --git a/fs_talkdialog.lua b/fs_talkdialog.lua index 71baecc..3c20b18 100644 --- a/fs_talkdialog.lua +++ b/fs_talkdialog.lua @@ -411,6 +411,10 @@ yl_speak_up.get_fs_talkdialog_line_in_normal_mode = function( elseif(sb_v.o_hide_when_prerequisites_not_met == "true") then -- show nothing; t_alt remains nil t = nil + -- precondition not fulfilled, and autoanswer active? Then hide this option. + elseif(sb_v.o_autoanswer) then + -- show nothing; t_alt remains nil + t = nil -- precondition not fulfilled? the option shall be greyed out -- default to greyed out (this option cannot be selected) elseif(sb_v.o_grey_when_prerequisites_not_met == "true") then