mirror of
https://gitea.your-land.de/Sokomine/yl_speak_up.git
synced 2025-06-19 21:58:03 +02:00
show_fs: talk
This commit is contained in:
parent
7ddf97d49d
commit
db2f401322
@ -566,3 +566,19 @@ yl_speak_up.get_fs_talkdialog = function(player, n_id, d_id, alternate_text, rec
|
||||
left_window_fs, bottom_window_fs,
|
||||
active_dialog, h)
|
||||
end
|
||||
|
||||
|
||||
yl_speak_up.get_fs_talk_wrapper = function(player, param)
|
||||
if(not(param)) then
|
||||
param = {}
|
||||
end
|
||||
-- recursion depth from autoanswer: 0 (the player selected manually)
|
||||
return yl_speak_up.get_fs_talkdialog(player, param.n_id, param.d_id, param.alternate_text,0)
|
||||
end
|
||||
|
||||
yl_speak_up.register_fs("talk",
|
||||
yl_speak_up.input_talk,
|
||||
yl_speak_up.get_fs_talk_wrapper,
|
||||
-- no special formspec required:
|
||||
nil
|
||||
)
|
||||
|
21
show_fs.lua
21
show_fs.lua
@ -37,9 +37,6 @@ yl_speak_up.input_handler = function(player, formname, fields)
|
||||
elseif formname == "yl_speak_up:setdialog" then
|
||||
yl_speak_up.input_setdialog(player, formname, fields)
|
||||
return true
|
||||
elseif formname == "yl_speak_up:talk" then
|
||||
yl_speak_up.input_talk(player, formname, fields)
|
||||
return true
|
||||
-- handled in fs_initial_config.lua
|
||||
elseif formname == "yl_speak_up:initial_config" then
|
||||
yl_speak_up.input_fs_initial_config(player, formname, fields)
|
||||
@ -157,6 +154,12 @@ yl_speak_up.show_fs = function(player, fs_name, param)
|
||||
yl_speak_up.speak_to[pname].last_fs_param = param
|
||||
end
|
||||
|
||||
-- abort talk if we hit d_end
|
||||
if(fs_name == "talk" and param and param.d_id and param.d_id == "d_end") then
|
||||
yl_speak_up.stop_talking(pname)
|
||||
return
|
||||
end
|
||||
|
||||
local fun = yl_speak_up.registered_forms_get_fs[fs_name]
|
||||
if(fun) then
|
||||
yl_speak_up.show_fs_ver(pname, "yl_speak_up:"..fs_name,
|
||||
@ -192,18 +195,6 @@ yl_speak_up.show_fs = function(player, fs_name, param)
|
||||
yl_speak_up.show_fs_ver(pname, "yl_speak_up:setdialog",
|
||||
yl_speak_up.get_fs_setdialog(player, param.n_id, param.d_id))
|
||||
|
||||
elseif(fs_name == "talk") then
|
||||
if(not(param)) then
|
||||
param = {}
|
||||
end
|
||||
if(param.d_id and param.d_id == "d_end") then
|
||||
yl_speak_up.stop_talking(pname)
|
||||
return
|
||||
end
|
||||
yl_speak_up.show_fs_ver(pname, "yl_speak_up:talk",
|
||||
-- recursion depth from autoanswer: 0 (the player selected manually)
|
||||
yl_speak_up.get_fs_talkdialog(player, param.n_id, param.d_id, param.alternate_text,0))
|
||||
|
||||
elseif(fs_name == "initial_config") then
|
||||
if(not(param)) then
|
||||
param = {}
|
||||
|
Loading…
Reference in New Issue
Block a user