ScriptName xLVEventObserver extends xLVEventListener

xLVLogger Property PT_Logger Auto

Function RegisterEvent()
	RegisterForModEvent( "XLVLog", "OnXLVLogEvent" )
	XLV_EventRegister()
EndFunction

Event OnInit()
	RegisterEvent()
EndEvent

;;--------------------------------------------------------------------------------;;
;; SKSE Event
;;--------------------------------------------------------------------------------;;
Event OnXLVLogEvent( string eventName, string strArg, float numArg, Form sender )

	if ( eventName != "XLVLog" )
		return
	endif
	
	PT_Logger.Write( strArg, numArg as int )

EndEvent

;;--------------------------------------------------------------------------------;;
;; XLV Event
;;--------------------------------------------------------------------------------;;
Function XLV_Update_S( string event_name, Actor target, string arg_str, int arg_int )
	if ( target == None )
		return
	endif
	
	Debug.Trace( "[XLV(S):" + event_name + "] [target]:" + target.GetActorBase().GetName() )
EndFunction

Function XLV_Update_MF( string event_name, Actor offence, Actor defence, string arg_str, int arg_int )

	if ( offence == None || defence == None )
		return
	endif
	
	Debug.Trace( "[XLV(MF):"+event_name+"] [offence]:" + offence.GetActorBase().GetName() + " [defence]:" + defence.GetActorBase().GetName() )
	
	if ( event_name == "MotionUpdate" )
		if ( arg_int == -1 )
			if ( offence == Game.GetPlayer() || defence == Game.GetPlayer() )
				Game.FadeOutGame( False, False, 0.0, 1.0 )
			endif
		endif
	endif
	
EndFunction

Function XLV_Update_3P( string event_name, Actor target0, Actor target1, Actor target2, string arg_str, int arg_int )

	if ( target0 == None || target1 == None || target2 == None )
		return
	endif

	Debug.Trace( "[XLV(3P):" + event_name + "]")
EndFunction

;;--------------------------------------------------------------------------------;;
