//=============================================================================
// VocalTranslatorEvent.
//=============================================================================
class VocalTranslatorEvent expands TranslatorEvent;

var() sound VocalMessageSound;

function Touch( actor Other )
{
	local inventory Inv;
	
	if (PlayerPawn(Other)==None || bHitDelay) Return;
	
	if (Hint=="" && Message=="") Return;

	if ( ReTriggerDelay > 0 )
	{
		if ( Level.TimeSeconds - TriggerTime < ReTriggerDelay )
			return;
		TriggerTime = Level.TimeSeconds;
	}

	for( Inv=Other.Inventory; Inv!=None; Inv=Inv.Inventory ) 	
		if (Translator(Inv)!=None) 
		{
			Translator(Inv).Hint = Hint;
			Translator(Inv).bShowHint = False;
			if (Message=="") Return;
			Trans = Translator(Inv);
			if (!bHitOnce) Translator(Inv).bNewMessage = true;
			else Translator(Inv).bNotNewMessage = true;
			Translator(Inv).NewMessage = Message;
			VocalTranslator(Inv).VocalMessageSound = VocalMessageSound;
			if (!bHitOnce) Pawn(Other).ClientMessage(M_NewMessage);
			else Pawn(Other).ClientMessage(M_TransMessage);
			bHitOnce = True;
			SetTimer(0.3,False);
			bHitDelay = True;
			PlaySound(NewMessageSound, SLOT_Misc);
			Break;
		}	
}