																																																																
#pragma once

#include "MW4.hpp"
#include "hudcomp.hpp"

namespace MechWarrior4
{
	class HUDComm;
	class HUDChat : public HUDComponent
	{
	protected:

		typedef HUDComponent inherited;

		struct ChatData
		{
			int left,right,top,bottom;
			HUDText *text;
			BYTE from,type,sent_to;
			ChatData (void)
			{ text = NULL; }
			ChatData (HUDText *p1,BYTE p2,BYTE p3,BYTE p4)
			{
				text = p1;
				from = p2;
				type = p3;
				sent_to = p4;
			}
		};

		stlport::list<ChatData> m_Messages;
		HUDComm *comm;
		HUDText *curChatDisplay;
		char *m_CurrentChat;
		Stuff::Time m_CursorTime;
		int *m_CursorPos;
		bool m_CursorBlink;
		bool m_TeamChat;
		bool m_LargeSize;
		int* m_ChatLen;
// MSL 5.03 MR Damage Display
		int m_TargetMechID;

		void DrawImplementation(void);

		void KillData (void);

	public:
		virtual void Update (Stuff::Time till);
		virtual void Reset (void);

		HUDChat();
		~HUDChat();
		void AddChat (const char *mesg,BYTE from, BYTE type, BYTE player_sent_to);
		void TeamChat (bool value)
		{ m_TeamChat = value; }
		void SetCurrentChat (char *ptr)
		{ m_CurrentChat = ptr; }
		void ToggleLargeSize (void)
		{ m_LargeSize = !m_LargeSize; }
		void SetCursorPos (int *loc)
		{ m_CursorPos = loc; }
		void SetTextLength (int *len)
		{ m_ChatLen = len; }
	};
}
