//
// Tools_ReceivedMessages.h
//
// Created by Richard Rice - 25/05/2006
// 
// Copyright (C) 2006 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif


#ifndef _TOOLS_RECEIVEDMESSAGES_H_
#define _TOOLS_RECEIVEDMESSAGES_H_

#include "Core/Asura_Maths.h"
#include "Core/Asura_String.h"
#include "Network/Asura_Guid.h"

#include "Entity/Tools_Message_Editing.h"

class Tools_ReceivedMessageData;
template<class T> class List;


class Tools_ReceivedMessages
{
public :
	static void Initialise();
	static void Shutdown();

	static void Update();

	static void ToggleOverlay();
	static bool OverlayIsOn();
	static void CreateOverlay();
	static void CloseOverlay();

	static void InvalidateList();



private :
	static void BuildMessageList();
	static void DeleteMessageList();

	static void UpdateOverlay();

	static bool ValidateOverlayData();

	static void SelectSender();
	static void GotoSender();
	static void EditMessage();

	static void ChooseTarget();

	static bool CanSelectSender();

public :
	static Asura_Vector_2 s_xOverlayPosition;
	static bool s_bOverlayShouldBeOpen;

private :
	static Asura_Guid s_uCurrentGuid;
	static int s_iSelectedIndex;
	static bool s_bSelectedIndexChanged;
	static bool s_bLockTarget;

	static List<Tools_ReceivedMessageData*> s_xMessageList;
	static const char** s_pszListStrings;

	static bool s_bListInvalidated;

	static bool s_bMessageEditing;
	static Tools_StaticMessageID s_xEditedMessage;

};

class Tools_ReceivedMessageData
{
public :
	//message block that this comes from
	Tools_StaticMessageID m_xStaticMessageID;

	int m_iMessageID;

	//sender of message (if known)
	Asura_Guid m_uSender;
	Asura_String m_xSenderName;

	//description of message type
	Asura_String m_xMessageDesc;
	//condition for sending message (if known)
	Asura_String m_xMessageEvent;
	
	bool m_bDisabled;//disabled flag from message

};



#endif //_TOOLS_RECEIVEDMESSAGES_H_




