/* $Id: help.src 616 2006-07-06 16:35:37Z austinheilman $
 *
 * Purpose:
 * Show help for a specific helpfile.
 *
 */
use uo;

include ":gumps:htmlgump";
include ":help:help";
include "include/arrays";

program helpfile_help(who, helpfile)
	if ( !helpfile )
		helpfile := "help";
	endif

	var file_path := GetHelpFilePath(helpfile);
	if ( !file_path )
		file_path := ":help:helpFiles/"+helpfile+".txt";
	endif
	var text_array := ReadFile(file_path);

	if ( text_array )
		var text := ImplodeArray("", text_array);
		SendHTMLGump(who, helpfile+" Help Text", text);
		return 1;
	else
		SendSysMessage(who, "No help available for that topic.");
		return 0;
	endif
endprogram
