show actions correctly when editing dialogs

This commit is contained in:
Sokomine 2021-06-15 19:14:40 +02:00
parent 634631a8e9
commit dc69b71a33

View File

@ -987,7 +987,7 @@ yl_speak_up.get_fs_talkdialog = function(player, n_id, d_id)
-- are there any prerequirements?
local prereq = active_dialog.d_options[sb_v.o_id].o_prerequisites
if(prereq) then
if(prereq and next(prereq)) then
table.insert(formspec, "button[0.5," .. h .. ";0.5,0.9;conditions_"..oid..";C]")
-- label: "There are pre(C)onditions required for showing this option. Display them."
table.insert(formspec, "tooltip[conditions_" .. oid .. ";There are pre(C)onditions required for showing this option. Display them.]")
@ -1000,10 +1000,9 @@ yl_speak_up.get_fs_talkdialog = function(player, n_id, d_id)
"There are further (Ef)fects (apart from switching\n"..
"to a new dialog) set for this option. Display them.]")
end
-- if there are only trade effects: show that as well
-- TODO: show this for other types of actions as well
if(dialog and dialog.trades
and dialog.trades[ tostring(c_d_id).." "..tostring(oid) ]) then
local actions = active_dialog.d_options[sb_v.o_id].actions
-- are there any actions defined?
if(actions and next(actions)) then
table.insert(formspec, "button[1.1," .. h .. ";0.5,0.9;effects_"..oid..";A]")
table.insert(formspec, "tooltip[effects_" .. oid .. ";"..
"There is an (A)ction (i.e. a trade) that will happen\n"..