show_fs: action_(npc_gives/npc_wants/text_input/evaluate)

This commit is contained in:
Sokomine 2024-02-09 20:02:22 +01:00
parent 20056cb1e9
commit 7408d8d286
2 changed files with 29 additions and 30 deletions

View File

@ -809,3 +809,32 @@ yl_speak_up.get_fs_action_evaluate = function(player, param)
-- actually call the function
return fun(player, n_id, a)
end
yl_speak_up.register_fs("action_npc_gives",
yl_speak_up.input_action_npc_gives,
yl_speak_up.get_fs_action_npc_gives,
-- force formspec version 1 for this:
1
)
yl_speak_up.register_fs("action_npc_wants",
yl_speak_up.input_action_npc_wants,
yl_speak_up.get_fs_action_npc_wants,
-- force formspec version 1 for this:
1
)
yl_speak_up.register_fs("action_text_input",
yl_speak_up.input_action_text_input,
yl_speak_up.get_fs_action_text_input,
-- no special formspec version required:
nil
)
yl_speak_up.register_fs("action_evaluate",
yl_speak_up.input_action_evaluate,
yl_speak_up.get_fs_action_evaluate,
-- no special formspec version required:
nil
)

View File

@ -98,19 +98,6 @@ yl_speak_up.input_handler = function(player, formname, fields)
elseif formname == "yl_speak_up:assign_quest_step" then
yl_speak_up.input_fs_assign_quest_step(player, formname, fields)
return true
-- handled in fs_edit_actions.lua
elseif formname == "yl_speak_up:action_npc_gives" then
yl_speak_up.input_fs_action_npc_gives(player, formname, fields)
return true
elseif formname == "yl_speak_up:action_npc_wants" then
yl_speak_up.input_fs_action_npc_wants(player, formname, fields)
return true
elseif formname == "yl_speak_up:action_text_input" then
yl_speak_up.input_fs_action_text_input(player, formname, fields)
return true
elseif formname == "yl_speak_up:action_evaluate" then
yl_speak_up.input_fs_action_evaluate(player, formname, fields)
return true
-- handled in fs_manage_variables.lua
elseif formname == "yl_speak_up:manage_variables" then
yl_speak_up.input_fs_manage_variables(player, formname, fields)
@ -394,23 +381,6 @@ yl_speak_up.show_fs = function(player, fs_name, param)
yl_speak_up.show_fs_ver(pname, "yl_speak_up:assign_quest_step",
yl_speak_up.get_fs_assign_quest_step(player, param))
-- action related
elseif(fs_name == "action_npc_gives") then
yl_speak_up.show_fs_ver(pname, "yl_speak_up:action_npc_gives",
yl_speak_up.get_fs_action_npc_gives(player, param), 1)
elseif(fs_name == "action_npc_wants") then
yl_speak_up.show_fs_ver(pname, "yl_speak_up:action_npc_wants",
yl_speak_up.get_fs_action_npc_wants(player, param), 1)
elseif(fs_name == "action_text_input") then
yl_speak_up.show_fs_ver(pname, "yl_speak_up:action_text_input",
yl_speak_up.get_fs_action_text_input(player, param))
elseif(fs_name == "action_evaluate") then
yl_speak_up.show_fs_ver(pname, "yl_speak_up:action_evaluate",
yl_speak_up.get_fs_action_evaluate(player, param))
elseif(fs_name == "manage_variables") then
yl_speak_up.show_fs_ver(pname, "yl_speak_up:manage_variables",
yl_speak_up.get_fs_manage_variables(player, param))