444 lines
		
	
	
		
			16 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			444 lines
		
	
	
		
			16 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
| 
 | |
| -- route player input to the right functions;
 | |
| -- return true when the right function has been found
 | |
| -- called in minetest.register_on_player_receive_fields
 | |
| yl_speak_up.input_handler = function(player, formname, fields)
 | |
| 	if     formname == "yl_speak_up:optiondialog" then
 | |
| 		yl_speak_up.input_optiondialog(player, formname, fields)
 | |
| 		return true
 | |
| 	elseif formname == "yl_speak_up:setdialog" then
 | |
| 		yl_speak_up.input_setdialog(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in fs_save_or_discard_or_back.lua
 | |
| 	elseif formname == "yl_speak_up:save_or_discard_changes" then
 | |
| 		yl_speak_up.input_save_or_discard_changes(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in fs_edit_options_dialog.lua
 | |
| 	elseif formname == "yl_speak_up:edit_option_dialog" then
 | |
| 		yl_speak_up.input_edit_option_dialog(player, formname, fields)
 | |
| 		return true
 | |
| 	elseif formname == "yl_speak_up:talk" then
 | |
| 		yl_speak_up.input_talk(player, formname, fields)
 | |
| 		return true
 | |
| 	elseif formname == "yl_speak_up:fashion" then
 | |
| 		yl_speak_up.input_fashion(player, formname, fields)
 | |
| 		return true
 | |
| 	elseif formname == "yl_speak_up:fashion_extended" then
 | |
| 		yl_speak_up.input_fashion_extended(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in fs_properties.lua
 | |
| 	elseif formname == "yl_speak_up:properties" then
 | |
| 		yl_speak_up.input_properties(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in inventory.lua
 | |
| 	elseif formname == "yl_speak_up:inventory" then
 | |
| 		yl_speak_up.input_inventory(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in fs_trade_list.lua
 | |
| 	elseif formname == "yl_speak_up:trade_list" then
 | |
| 		yl_speak_up.input_trade_list(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in fs_player_offers_item.lua
 | |
| 	elseif formname == "yl_speak_up:player_offers_item" then
 | |
| 		yl_speak_up.input_player_offers_item(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in trade_simple.lua
 | |
| 	elseif formname == "yl_speak_up:do_trade_simple" then
 | |
| 		yl_speak_up.input_do_trade_simple(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in fs_trade_via_buy_button.lua
 | |
| 	elseif formname == "yl_speak_up:trade_via_buy_button" then
 | |
| 		yl_speak_up.input_trade_via_buy_button(player, formname, fields)
 | |
| 		return true
 | |
| 	-- (as above - also handled in trade_simple.lua)
 | |
| 	elseif formname == "yl_speak_up:add_trade_simple" then
 | |
| 		yl_speak_up.input_add_trade_simple(player, formname, fields)
 | |
| 		return true
 | |
| 	elseif formname == "yl_speak_up:trade_limit" then
 | |
| 		yl_speak_up.input_trade_limit(player, formname, fields)
 | |
| 		return true
 | |
| 	elseif formname == "yl_speak_up:show_log" then
 | |
| 		yl_speak_up.input_show_log(player, formname, fields)
 | |
| 		return true
 | |
| 	elseif formname == "yl_speak_up:show_npc_list" then
 | |
| 		yl_speak_up.input_show_npc_list(player, formname, fields)
 | |
| 		return true
 | |
| 	elseif formname == "yl_speak_up:edit_trade_limit" then
 | |
| 		yl_speak_up.input_edit_trade_limit(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)
 | |
| 		return true
 | |
| 	-- handled in fs_assign_quest_step.lua
 | |
| 	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_preconditions.lua
 | |
| 	elseif formname == "yl_speak_up:edit_preconditions" then
 | |
| 		yl_speak_up.input_fs_edit_preconditions(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in fs_edit_actions.lua
 | |
| 	elseif formname == "yl_speak_up:edit_actions" then
 | |
| 		yl_speak_up.input_fs_edit_actions(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_edit_effects.lua
 | |
| 	elseif formname == "yl_speak_up:edit_effects" then
 | |
| 		yl_speak_up.input_fs_edit_effects(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)
 | |
| 		return true
 | |
| 	-- handled in fs_manage_quests.lua
 | |
| 	elseif formname == "yl_speak_up:manage_quests" then
 | |
| 		yl_speak_up.input_fs_manage_quests(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in fs_manage_quest_steps.lua
 | |
| 	elseif formname == "yl_speak_up:manage_quest_steps" then
 | |
| 		yl_speak_up.input_fs_manage_quest_steps(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in fs_add_quest_steps.lua
 | |
| 	elseif formname == "yl_speak_up:add_quest_steps" then
 | |
| 		yl_speak_up.input_fs_add_quest_steps(player, formname, fields)
 | |
| 		return true
 | |
| 	-- handled in fs_alternate_text.lua
 | |
| 	elseif formname == "yl_speak_up:show_what_points_to_this_dialog" then
 | |
| 		yl_speak_up.input_fs_show_what_points_to_this_dialog(player, formname, fields)
 | |
| 		return true
 | |
| 	-- create and manage quests
 | |
| 	elseif formname == "yl_speak_up:quest_gui" then
 | |
| 		yl_speak_up.input_quest_gui(player, formname, fields)
 | |
| 		return true
 | |
| 	end
 | |
| end
 | |
| 
 | |
| 
 | |
| -- show formspec with highest possible version information for the player
 | |
| -- force_version: optional parameter
 | |
| yl_speak_up.show_fs_ver = function(pname, formname, formspec, force_version)
 | |
| 	-- if the formspec already calls for a specific formspec version: use that one
 | |
| 	if(string.sub(formspec, 1, 17) == "formspec_version[") then
 | |
| 		minetest.show_formspec(pname, formname, formspec)
 | |
| 		return
 | |
| 	end
 | |
| 	local fs_ver = (yl_speak_up.fs_version[pname] or "2")
 | |
| 	if(force_version) then
 | |
| 		fs_ver = force_version
 | |
| 	end
 | |
| 	minetest.show_formspec(pname, formname,
 | |
| 		"formspec_version["..tostring(fs_ver).."]"..
 | |
| 		formspec)
 | |
| end
 | |
| 
 | |
| 
 | |
| -- call show_formspec with the right input_* function for the right formspec
 | |
| -- (handles all show_formspec-calls)
 | |
| yl_speak_up.show_fs = function(player, fs_name, param)
 | |
| 	if(not(player)) then
 | |
| 		return
 | |
| 	end
 | |
| 	local pname = player:get_player_name()
 | |
| 	if(not(yl_speak_up.speak_to[pname])) then
 | |
| 		return
 | |
| 	end
 | |
| 
 | |
| 	local last_fs = yl_speak_up.speak_to[pname].last_fs
 | |
| 	-- show the save or discard changes dialog
 | |
| 	if(fs_name and fs_name == "save_or_discard_changes") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:save_or_discard_changes",
 | |
| 			yl_speak_up.get_fs_save_or_discard_changes(player, param))
 | |
| 		return
 | |
| 
 | |
| 	-- the player either saved or discarded; we may proceed now
 | |
| 	elseif(fs_name and fs_name == "proceed_after_save") then
 | |
| 		fs_name = yl_speak_up.speak_to[pname].next_fs
 | |
| 		param = yl_speak_up.speak_to[pname].next_fs_param
 | |
| 		yl_speak_up.speak_to[pname].next_fs = nil
 | |
| 		yl_speak_up.speak_to[pname].next_fs_param = nil
 | |
| 		yl_speak_up.speak_to[pname].last_fs = fs_name
 | |
| 		yl_speak_up.speak_to[pname].last_fs_param = param
 | |
| 		if(not(fs_name) or fs_name == "quit") then
 | |
| 			yl_speak_up.reset_vars_for_player(pname, false)
 | |
| 			return
 | |
| 		end
 | |
| 
 | |
| 	-- the player clicked on "back" in the above dialog
 | |
| 	elseif(fs_name and fs_name == "show_last_fs") then
 | |
| 		-- call the last formspec again - and with the same parameters
 | |
| 		fs_name = yl_speak_up.speak_to[pname].last_fs
 | |
| 		param = yl_speak_up.speak_to[pname].last_fs_param
 | |
| 
 | |
| 	-- do we need to check if there is something that needs saving?
 | |
| 	elseif(fs_name
 | |
| 	  -- msg is just a loop for displaying (mostly error) messages
 | |
| 	  and fs_name ~= "msg"
 | |
| 	  and fs_name ~= "player_offers_item"
 | |
| 	  -- is the player editing the NPC? that is: might there be any changes?
 | |
| 	  and (yl_speak_up.edit_mode[pname] == yl_speak_up.speak_to[pname].n_id)) then
 | |
| 		local last_fs = yl_speak_up.speak_to[pname].last_fs
 | |
| 		local d_id = yl_speak_up.speak_to[pname].d_id
 | |
| 		local o_id = yl_speak_up.speak_to[pname].o_id
 | |
| 		-- only these two formspecs need to ask specificly if the data ought to be saved
 | |
| 		if(last_fs == "talk" or last_fs == "edit_option_dialog" or fs_name == "quit") then
 | |
| 			local last_param = yl_speak_up.speak_to[pname].last_fs_param
 | |
| 			local show_save_fs = false
 | |
| 			if(not(param)) then
 | |
| 				param = {}
 | |
| 			end
 | |
| 			-- set the target dialog
 | |
| 			yl_speak_up.speak_to[pname].target_dialog = param.d_id
 | |
| 			-- if we are switching from one dialog to another: is it the same?
 | |
| 			if(last_fs == "talk" and fs_name == last_fs
 | |
| 			  and param and param.d_id and param.d_id ~= d_id) then
 | |
| 				-- diffrent parameters: save (if needed)
 | |
| 				show_save_fs = true
 | |
| 			elseif(fs_name == "talk" and param and param.do_save) then
 | |
| 				-- player clicked on save button
 | |
| 				show_save_fs = true
 | |
| 			-- leaving a dialog: save!
 | |
| 			elseif(last_fs == "talk" and fs_name ~= last_fs) then
 | |
| 				show_save_fs = true
 | |
| 			-- clicking on "save" in an edit option dialog: save!
 | |
| 			elseif(last_fs == "edit_option_dialog" and fs_name == last_fs
 | |
| 			  and param and param.caller and param.caller == "save_option") then
 | |
| 				show_save_fs = true
 | |
| 			-- leaving editing an option: save!
 | |
| 			elseif(last_fs == "edit_option_dialog" and fs_name ~= last_fs) then
 | |
| 				show_save_fs = true
 | |
| 			-- quitting: save!
 | |
| 			elseif(fs_name == "quit") then
 | |
| 				yl_speak_up.speak_to[pname].target_dialog = nil
 | |
| 				show_save_fs = true
 | |
| 			end
 | |
| 			-- show the save or discard dialog
 | |
| 			if(show_save_fs) then
 | |
| 				yl_speak_up.speak_to[pname].next_fs = fs_name
 | |
| 				yl_speak_up.speak_to[pname].next_fs_param = param
 | |
| 				-- check first if it's necessary to ask for save or discard
 | |
| 				yl_speak_up.input_save_or_discard_changes(player, "", {})
 | |
| 				return
 | |
| 			end
 | |
| 		end
 | |
| 		-- store the new formspec
 | |
| 		yl_speak_up.speak_to[pname].last_fs = fs_name
 | |
| 		-- and its parameter
 | |
| 		yl_speak_up.speak_to[pname].last_fs_param = param
 | |
| 	end
 | |
| 
 | |
| 	-- this is here mostly to fascilitate debugging - so that really all calls to
 | |
| 	-- minetest.show_formspec are routed through here
 | |
| 	if(fs_name == "msg") then
 | |
| 		if(not(param)) then
 | |
| 			param = {}
 | |
| 		end
 | |
| 		yl_speak_up.show_fs_ver(pname, param.input_to, param.formspec, 1)
 | |
| 
 | |
| 
 | |
| 	elseif(fs_name == "quit") then
 | |
| 		return
 | |
| 
 | |
| 	-- staff-based editing
 | |
| 	elseif(fs_name == "optiondialog") then
 | |
| 		if(not(param)) then
 | |
| 			param = {}
 | |
| 		end
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:optiondialog",
 | |
| 			yl_speak_up.get_fs_optiondialog(player, param.n_id, param.d_id, param.o_id, param.p_id, param.r_id))
 | |
| 
 | |
| 	elseif(fs_name == "setdialog") then
 | |
| 		if(not(param)) then
 | |
| 			param = {}
 | |
| 		end
 | |
| 		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 == "edit_option_dialog") then
 | |
| 		-- the optional "caller" parameter can be used for debugging
 | |
| 		if(not(param)) then
 | |
| 			param = {}
 | |
| 		end
 | |
| 		yl_speak_up.speak_to[pname].o_id = param.o_id
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:edit_option_dialog",
 | |
| 			yl_speak_up.get_fs_edit_option_dialog(player, param.n_id, param.d_id, param.o_id,
 | |
| 				param.caller))
 | |
| 
 | |
| 	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 == "fashion") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:fashion",
 | |
| 			yl_speak_up.get_fs_fashion(pname))
 | |
| 
 | |
| 	elseif(fs_name == "fashion_extended") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:fashion_extended",
 | |
| 			yl_speak_up.get_fs_fashion_extended(pname))
 | |
| 
 | |
| 	elseif(fs_name == "properties") then
 | |
| 		if(not(param)) then
 | |
| 			param = {}
 | |
| 		end
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:properties",
 | |
| 			yl_speak_up.get_fs_properties(pname, param.selected),
 | |
| 			1)
 | |
| 
 | |
| 	elseif(fs_name == "inventory") then
 | |
| 		-- this is a very classical formspec; it works far better with OLD fs;
 | |
| 		-- force formspec version 1
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:inventory",
 | |
| 			yl_speak_up.get_fs_inventory(player),
 | |
| 			1)
 | |
| 
 | |
| 	elseif(fs_name == "trade_list") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:trade_list",
 | |
| 			yl_speak_up.get_fs_trade_list(player, param))
 | |
| 
 | |
| 	elseif(fs_name == "player_offers_item") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:player_offers_item",
 | |
| 			yl_speak_up.get_fs_player_offers_item(player, param), 1)
 | |
| 
 | |
| 	elseif(fs_name == "trade_simple") then
 | |
| 		-- the optional parameter param is the trade_id
 | |
| 		if(not(param) and yl_speak_up.speak_to[pname]) then
 | |
| 			param = yl_speak_up.speak_to[pname].trade_id
 | |
| 		end
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:do_trade_simple",
 | |
| 			yl_speak_up.get_fs_trade_simple(player, param), 1)
 | |
| 
 | |
| 	elseif(fs_name == "trade_via_buy_button") then
 | |
| 		-- the optional parameter param is the trade_id
 | |
| 		if(not(param) and yl_speak_up.speak_to[pname]) then
 | |
| 			param = yl_speak_up.speak_to[pname].trade_id
 | |
| 		end
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:trade_via_buy_button",
 | |
| 			yl_speak_up.get_fs_trade_via_buy_button(player, param), 1)
 | |
| 
 | |
| 	elseif(fs_name == "add_trade_simple") then
 | |
| 		-- the optional parameter param is the trade_id
 | |
| 		if(not(param) and yl_speak_up.speak_to[pname]) then
 | |
| 			param = yl_speak_up.speak_to[pname].trade_id
 | |
| 		end
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:add_trade_simple",
 | |
| 			yl_speak_up.get_fs_add_trade_simple(player, param), 1)
 | |
| 
 | |
| 	elseif(fs_name == "trade_limit") then
 | |
| 		if(not(param)) then
 | |
| 			param = {}
 | |
| 		end
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:trade_limit",
 | |
| 			yl_speak_up.get_fs_trade_limit(player, param.selected))
 | |
| 
 | |
| 	elseif(fs_name == "show_log") then
 | |
| 		if(not(param)) then
 | |
| 			param = {}
 | |
| 		end
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:show_log",
 | |
| 			yl_speak_up.get_fs_show_log(player, param.log_type))
 | |
| 
 | |
| 	elseif(fs_name == "show_npc_list") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:show_npc_list",
 | |
| 			yl_speak_up.get_fs_show_npc_list(player, nil))
 | |
| 
 | |
| 
 | |
| 	elseif(fs_name == "edit_trade_limit") then
 | |
| 		if(not(param)) then
 | |
| 			param = {}
 | |
| 		end
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:edit_trade_limit",
 | |
| 			yl_speak_up.get_fs_edit_trade_limit(player, param.selected_row), 1)
 | |
| 
 | |
| 	elseif(fs_name == "initial_config") then
 | |
| 		if(not(param)) then
 | |
| 			param = {}
 | |
| 		end
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:initial_config",
 | |
| 			yl_speak_up.get_fs_initial_config(player, param.n_id, param.d_id,
 | |
| 				param.is_initial_config))
 | |
| 
 | |
| 	elseif(fs_name == "assign_quest_step") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:assign_quest_step",
 | |
| 			yl_speak_up.get_fs_assign_quest_step(player, param))
 | |
| 
 | |
| 	elseif(fs_name == "edit_preconditions") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:edit_preconditions",
 | |
| 			yl_speak_up.get_fs_edit_preconditions(player, param))
 | |
| 
 | |
| 	elseif(fs_name == "edit_actions") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:edit_actions",
 | |
| 			yl_speak_up.get_fs_edit_actions(player, param))
 | |
| 
 | |
| 	elseif(fs_name == "edit_effects") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:edit_effects",
 | |
| 			yl_speak_up.get_fs_edit_effects(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))
 | |
| 
 | |
| 	elseif(fs_name == "manage_quests") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:manage_quests",
 | |
| 			yl_speak_up.get_fs_manage_quests(player, param))
 | |
| 
 | |
| 	elseif(fs_name == "manage_quest_steps") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:manage_quest_steps",
 | |
| 			yl_speak_up.get_fs_manage_quest_steps(player, param))
 | |
| 
 | |
| 	elseif(fs_name == "add_quest_steps") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:add_quest_steps",
 | |
| 			yl_speak_up.get_fs_add_quest_steps(player, param))
 | |
| 
 | |
| 	elseif(fs_name == "show_what_points_to_this_dialog") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:show_what_points_to_this_dialog",
 | |
| 			yl_speak_up.show_what_points_to_this_dialog(player, param))
 | |
| 
 | |
| 	elseif(fs_name == "quest_gui") then
 | |
| 		yl_speak_up.show_fs_ver(pname, "yl_speak_up:quest_gui",
 | |
| 			yl_speak_up.get_fs_quest_gui(player, param))
 | |
| 
 | |
| 	-- fallback in case of wrong call
 | |
| 	else
 | |
| 		minetest.chat_send_player(pname, "Error: Trying to show wrong "..
 | |
| 			"formspec: \""..tostring(fs_name).."\". Please notify "..
 | |
| 			"an admin.")
 | |
| 	end
 | |
| end
 |