class ScannerQuestClue extends inkLogicController
{
	private editable var m_CategoryTextRef : inkTextRef;
	private editable var m_DescriptionTextRef : inkTextRef;
	private editable var m_IconRef : inkImageRef;

	public function Setup( questEntry : IScriptable )
	{
		var iconName : CName;
		var record : ScannableData_Record;
		var iconRecord : UIIcon_Record;
		var questEntryUserData : QuestEntryUserData;
		questEntryUserData = ( ( QuestEntryUserData )( questEntry ) );
		if( !( IsNameValid( questEntryUserData.categoryName ) ) && !( IsNameValid( questEntryUserData.entryName ) ) )
		{
			GetRootWidget().SetVisible( false );
			return;
		}
		GetRootWidget().SetVisible( true );
		record = TweakDBInterface.GetScannableDataRecord( questEntryUserData.recordID );
		if( record != NULL )
		{
			iconRecord = record.IconRecord();
			if( iconRecord != NULL )
			{
				SetTexture( m_IconRef, iconRecord.GetID() );
				inkImageRef.SetVisible( m_IconRef, true );
			}
			else
			{
				iconName = record.IconName();
				if( IsNameValid( iconName ) )
				{
					inkImageRef.SetTexturePart( m_IconRef, iconName );
					inkImageRef.SetVisible( m_IconRef, true );
				}
				else
				{
					inkImageRef.SetVisible( m_IconRef, false );
				}
			}
		}
		inkTextRef.SetLocalizedTextScript( m_CategoryTextRef, questEntryUserData.categoryName );
		inkTextRef.SetLocalizedTextScript( m_DescriptionTextRef, questEntryUserData.entryName );
	}

}

