mirror of
				https://gitea.your-land.de/Sokomine/yl_speak_up.git
				synced 2025-11-04 06:13:08 +01:00 
			
		
		
		
	added yl_speak_up.get_dialog_list_for_export
This commit is contained in:
		
							parent
							
								
									7343366d2f
								
							
						
					
					
						commit
						cfb673993f
					
				@ -400,7 +400,7 @@ yl_speak_up.export_to_ink_language = function(dialog, n_id)
 | 
			
		||||
 | 
			
		||||
	local vars_used = ink_export.print_variables_used(tmp, dialog, n_id, pname)
 | 
			
		||||
 | 
			
		||||
	local sorted_d_list = yl_speak_up.sort_keys(dialog.n_dialogs or {}, true)
 | 
			
		||||
	local sorted_d_list = yl_speak_up.get_dialog_list_for_export(dialog)
 | 
			
		||||
 | 
			
		||||
	-- make use of dialog names if wanted
 | 
			
		||||
	local dialog_names = {}
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,24 @@
 | 
			
		||||
-- helper function that is also used by export_to_ink.lua
 | 
			
		||||
-- returns a sorted dialog list without special or generic dialogs
 | 
			
		||||
yl_speak_up.get_dialog_list_for_export = function(dialog)
 | 
			
		||||
	local liste = {}
 | 
			
		||||
	if(not(dialog) or not(dialog.n_dialogs)) then
 | 
			
		||||
		return liste
 | 
			
		||||
	end
 | 
			
		||||
	-- sort the list of dialogs by d_id
 | 
			
		||||
	local liste_sorted = yl_speak_up.sort_keys(dialog.n_dialogs or {}, true)
 | 
			
		||||
	for _, d_id in ipairs(liste_sorted) do
 | 
			
		||||
		-- only normal dialogs - no d_trade, d_got_item, d_dynamic etc;
 | 
			
		||||
		if(not(yl_speak_up.is_special_dialog(d_id))
 | 
			
		||||
		-- also no generic dialogs (they do not come from this NPC)
 | 
			
		||||
		   and not(dialog.n_dialogs[d_id].is_generic)) then
 | 
			
		||||
			table.insert(liste, d_id)
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
	return liste
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
yl_speak_up.input_export = function(player, formname, fields)
 | 
			
		||||
	if(fields and fields.back) then
 | 
			
		||||
		return yl_speak_up.show_fs(player, "talk")
 | 
			
		||||
@ -181,19 +202,10 @@ yl_speak_up.get_fs_export = function(player, param)
 | 
			
		||||
			"this mod here. It only covers the raw dialogs. If a dialog line starts with "..
 | 
			
		||||
			"\":\", \">\" or \"=\", a \" \" is added before that letter because such a "..
 | 
			
		||||
			"line start would not be allowed in \"simple_dialogs\"."
 | 
			
		||||
 | 
			
		||||
		local d_liste = yl_speak_up.get_dialog_list_for_export(dialog)
 | 
			
		||||
 | 
			
		||||
		local tmp = {}
 | 
			
		||||
		local d_liste = {}
 | 
			
		||||
		if(dialog.n_dialogs) then
 | 
			
		||||
			for d_id, v in pairs(dialog.n_dialogs) do
 | 
			
		||||
				-- only normal dialogs - no d_trade, d_got_item, d_dynamic etc;
 | 
			
		||||
				if(not(yl_speak_up.is_special_dialog(d_id))
 | 
			
		||||
				-- also no generic dialogs (they do not come from this NPC)
 | 
			
		||||
				   and not(v.is_generic)) then
 | 
			
		||||
					table.insert(d_liste, d_id)
 | 
			
		||||
				end
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
		table.sort(d_liste)
 | 
			
		||||
		for i, d_id in ipairs(d_liste) do
 | 
			
		||||
			table.insert(tmp, "===")
 | 
			
		||||
			-- TODO: use labels here when available
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user