fixed broken tooltip

This commit is contained in:
Sokomine 2021-06-27 17:19:32 +02:00
parent 661caaff4e
commit 2544fdc0c9

View File

@ -890,17 +890,16 @@ yl_speak_up.get_fs_talkdialog = function(player, n_id, d_id)
-- build the list of available dialogs for the dropdown list(s)
dialog_list = dialog_list..","..minetest.formspec_escape(d)
if(d == c_d_id and sorted_list[ i-1 ]) then
table.insert(formspec, "button[8.5,4.0;2,0.9;prev_dialog_"..
minetest.formspec_escape(sorted_list[i-1])..";<]")
table.insert(formspec, "tooltip[prev_dialog;Go to previous dialog "..
minetest.formspec_escape(sorted_list[i-1])..".]")
local prev_dialog = minetest.formspec_escape(sorted_list[i-1])
table.insert(formspec, "button[8.5,4.0;2,0.9;prev_dialog_"..prev_dialog..";<]")
table.insert(formspec, "tooltip[prev_dialog_"..prev_dialog..
";Go to previous dialog "..prev_dialog..".]")
end
if(d == c_d_id and sorted_list[ i+1 ]) then
table.insert(formspec, "button[11,4.0;2,0.9;next_dialog_"..
minetest.formspec_escape(sorted_list[i+1])..";>]")
-- add a tooltip
table.insert(formspec, "tooltip[next_dialog;Go to next dialog "..
minetest.formspec_escape(sorted_list[i+1])..".]")
local next_dialog = minetest.formspec_escape(sorted_list[i+1])
table.insert(formspec, "button[11,4.0;2,0.9;next_dialog_"..next_dialog..";>]")
table.insert(formspec, "tooltip[next_dialog_"..next_dialog..
";Go to next dialog "..next_dialog..".]")
end
d_id_to_dropdown_index[d] = i + 1
end