moved a function from _dialogs to _talk

This commit is contained in:
Sokomine 2025-01-01 22:41:09 +01:00
parent c0fcbecd63
commit e5183813d7
2 changed files with 14 additions and 12 deletions

View File

@ -624,18 +624,6 @@ yl_speak_up.d_id_to_d_name = function(dialog, d_id)
end
yl_speak_up.get_sorted_dialog_name_list = function(dialog)
local liste = {}
if(dialog and dialog.n_dialogs) then
for k, v in pairs(dialog.n_dialogs) do
-- this will be used for dropdown lists - so we use formspec_escape
table.insert(liste, minetest.formspec_escape(v.d_name or k or "?"))
end
-- sort alphabethicly
table.sort(liste)
end
return liste
end
-- how many own (not special, not generic) dialogs does the NPC have?

View File

@ -36,6 +36,20 @@ yl_speak_up.get_error_message = function()
return table.concat(formspec, "")
end
yl_speak_up.get_sorted_dialog_name_list = function(dialog)
local liste = {}
if(dialog and dialog.n_dialogs) then
for k, v in pairs(dialog.n_dialogs) do
-- this will be used for dropdown lists - so we use formspec_escape
table.insert(liste, minetest.formspec_escape(v.d_name or k or "?"))
end
-- sort alphabethicly
table.sort(liste)
end
return liste
end
---###
-- player related
---###