importonly abstract class WidgetBaseComponent extends IPlacedComponent
{
}

import abstract class IWorldWidgetComponent extends WidgetBaseComponent
{
	public import function GetWidget() : inkWidget;
	protected import function GetGameControllerInterface() : weak< worlduiIGameController >;

	public function GetGameController() : weak< inkGameController >
	{
		return ( ( inkGameController )( GetGameControllerInterface() ) );
	}

	public const virtual function GetScreenDefinition() : ScreenDefinitionPackage
	{
		var screen : ScreenDefinitionPackage;
		return screen;
	}

	public const virtual function IsScreenDefinitionValid() : Bool
	{
		return false;
	}

	private function ShouldReactToHit() : Bool
	{
		var owner : Entity;
		owner = GetEntity();
		return ( ( ( Device )( owner ) ) == NULL ) && ( ( ( VehicleObject )( owner ) ) == NULL );
	}

	protected event OnHitEvent( hit : gameHitEvent )
	{
		if( ShouldReactToHit() )
		{
			StartGlitching( 1.0, 0.25 );
		}
	}

	protected function StartGlitching( intensity : Float, lifetime : Float )
	{
		var evt : AdvertGlitchEvent;
		evt = new AdvertGlitchEvent;
		evt.SetShouldGlitch( intensity );
		evt.SetGlitchTime( lifetime );
		QueueEntityEvent( evt );
	}

	protected function StopGlitching()
	{
		var evt : AdvertGlitchEvent;
		evt = new AdvertGlitchEvent;
		evt.SetShouldGlitch( 0.0 );
		QueueEntityEvent( evt );
	}

}

import abstract class worlduiWidgetComponent extends IWorldWidgetComponent
{
	[ category = "Screen Definition" ]
	protected instanceeditable var m_screenDefinition : SUIScreenDefinition;

	public const override function GetScreenDefinition() : ScreenDefinitionPackage
	{
		var screen : ScreenDefinitionPackage;
		screen.style = TweakDBInterface.GetWidgetStyleRecord( m_screenDefinition.style );
		screen.screenDefinition = TweakDBInterface.GetDeviceUIDefinitionRecord( m_screenDefinition.screenDefinition );
		return screen;
	}

	public const override function IsScreenDefinitionValid() : Bool
	{
		return TDBID.IsValid( m_screenDefinition.screenDefinition );
	}

}

importonly abstract class WidgetHudComponentInterface extends WidgetBaseComponent
{
	public import function GetWidget( entryName : CName ) : inkWidget;
}

importonly abstract class WidgetHudComponent extends WidgetHudComponentInterface
{
}

