void LLFloaterScriptDebug::addScriptLine(const std::string &utf8mesg, const std::string &user_name, const LLColor4& color, const LLUUID& source_id)
{
	LLViewerObject* objectp = gObjectList.findObject(source_id);
	std::string floater_label;

	// Handle /me messages.
	std::string prefix = utf8mesg.substr(0, 4);
	std::string message = (prefix == "/me " || prefix == "/me'") ? user_name + utf8mesg.substr(3) : utf8mesg;

	if (objectp)
	{
		objectp->setIcon(LLViewerTextureManager::getFetchedTextureFromFile("script_error.j2c", FTT_LOCAL_FILE, TRUE, LLGLTexture::BOOST_UI));
		// <FS:Ansariel> Mark script error icons
		objectp->getIcon()->setScriptError();
		// </FS:Ansariel> Mark script error icons
		floater_label = llformat("%s (%.0f, %.0f, %.0f)",
						user_name.c_str(),
						objectp->getPositionRegion().mV[VX],
						objectp->getPositionRegion().mV[VY],
						objectp->getPositionRegion().mV[VZ]);
	}
	else
	{
		floater_label = user_name;
	}

	addOutputWindow(LLUUID::null);
	addOutputWindow(source_id);

	// add to "All" floater
	LLFloaterScriptDebugOutput* floaterp = 	LLFloaterReg::getTypedInstance<LLFloaterScriptDebugOutput>("script_debug_output", LLUUID::null);
	if (floaterp)
	{
		floaterp->addLine(message, user_name, color);
	}
	
	// add to specific script instance floater
	floaterp = LLFloaterReg::getTypedInstance<LLFloaterScriptDebugOutput>("script_debug_output", source_id);
	if (floaterp)
	{
		floaterp->addLine(message, floater_label, color);
	}
}