class ReadAction extends BaseItemAction
{

	public override function CompleteAction( gameInstance : GameInstance )
	{
		var entryString : String;
		var entry : weak< JournalOnscreen >;
		var shardUIevent : NotifyShardRead;
		super.CompleteAction( gameInstance );
		entryString = GetJournalEntryFromAction();
		if( IsStringValid( entryString ) )
		{
			GameInstance.GetJournalManager( gameInstance ).ChangeEntryState( entryString, "gameJournalOnscreen", gameJournalEntryState.Active, JournalNotifyOption.Notify );
			entry = ( ( JournalOnscreen )( GameInstance.GetJournalManager( gameInstance ).GetEntryByString( entryString, "gameJournalOnscreen" ) ) );
		}
		shardUIevent = new NotifyShardRead;
		shardUIevent.title = entry.GetTitle();
		shardUIevent.text = entry.GetDescription();
		shardUIevent.m_imageId = entry.GetIconID();
		shardUIevent.entry = entry;
		GameInstance.GetUISystem( gameInstance ).QueueEvent( shardUIevent );
	}

	private function GetJournalEntryFromAction() : String
	{
		return TweakDBInterface.GetString( m_objectActionID + T".journalEntry", "" );
	}

	public static function GetJournalEntryFromAction( actionID : TweakDBID ) : String
	{
		return TweakDBInterface.GetString( actionID + T".journalEntry", "" );
	}

	public override function IsVisible( const context : ref< GetActionsContext >, optional objectActionsCallbackController : weak< gameObjectActionsCallbackController > ) : Bool
	{
		return true;
	}

}

