/* ========================================================================== * ÆÄ ÀÏ : ChatWindow.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2006-11-28 * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "UIWindow.h" const int HEIGHT_GAP = 8; const int MAXROWNUM = 20; const int DEFAULT_ROWNUM = 8; enum eChatMsgKind; enum eSystemMsgKind; enum ePLAYER_JOB; class cTextBox; class cEditBox; class cButton; class cPlaneObject; class cUIImage; class cChatButtonWindow; class cItemIcon; class cPushButton; class cChatWindow : public cUIWindow { public: cChatWindow(); virtual ~cChatWindow(); virtual void Open(); virtual void Close(); /// ¿ÜºÎ¿¡¼­ äÆÃ¹Ú½º¿¡ Á÷Á¢ÀûÀ¸·Î ¹®ÀÚ¿­À» ³ÖÀ» °æ¿ì »ç¿ë virtual void InsertText( eChatMsgKind msgkind, unsigned long textIndex, LPCTSTR msg, unsigned long color, bool checkPress = true, bool paste = false ); virtual void InsertTextSystem( eSystemMsgKind kind, LPCTSTR chatmsg ); /// ¾ÆÀÌÅÛ È¹µæ ¸Þ¼¼Áö¿ë virtual void InsertItemText( unsigned long itemIndex, unsigned short slotIndex, LPCTSTR msg1, LPCTSTR msg2, bool IsQuest = false ); /// ¾ÆÀÌÅÛ ¾Ë¸² ¸Þ¼¼Áö¿ë virtual void InsertItemText( sInventory inventory, LPCTSTR name, LPCTSTR msg, ePLAYER_JOB job, eChatMsgKind kind, void* exdata = NULL ); /// Ŭ¸®¾î virtual void Clear(); /// ¿¡µðÆ® Æ÷Ä¿½º ÁÖ±â void SetFocusToEdit(); /// äÆÃ ¿¡µðÆ®¿¡ ÇØ´ç ¹®ÀÚ¿­À» ÀÔ·ÂÇÑ´Ù void SetChatText( LPCTSTR text ); /// ±Ó¼Ó¸» Ä£±¸ À̸§ µî·Ï void AddWhisperUser( const cStringT& name ); void ApplyLastWhisperUser(); void AddExtraWindow( cUIWindow* w ); /// ÇöÀç ¼±ÅÃÁßÀΠäÆÃ ŸÀÔ °»½Å void UpdateChatType( eChatMsgKind type ); /// ¸µÅ© ¾ÆÀÌÅÛ µî·Ï bool AddLinkItem( unsigned short slotIndex, unsigned long itemIndex ); void DeleteLinkItem(); unsigned short GetLinkSlotIndex(); unsigned long GetLinkItemIndex(); bool IsLinked(); /// cUIRect GetSelectButtonRect(); LPCTSTR GetWhisperName(); unsigned int GetMaxRowInPage(); /// void InitBoxSize( unsigned int size ); virtual void SetPress( bool normal, bool party, bool guild, bool shout, bool trade, bool whisper, bool system, bool megaphone ); virtual bool IsPressNormal(); virtual bool IsPressParty(); virtual bool IsPressGuild(); virtual bool IsPressShout(); virtual bool IsPressTrade(); virtual bool IsPressWhisper(); virtual bool IsPressSystem(); virtual bool IsPressMegaPhone(); // À̵¿ ±â´É °íÁ¤ bool IsLockedMove(); void SetMoveLock( bool lock ); protected: bool OnCreate( cUINodeProperty* pproperty ); void UpdateRect(); bool HandleEvent( const cUIEvent& event ); void OnRender( cUIFontItemKeeper* pKeeper ); void OnMouseMove( const cUIPos& pos ); void OnEditBoxEntered( cUINode* pcaller, unsigned int id ); void OnCommand( cUINode* pcaller, unsigned int id ); void OnButtonDowned(cUINode* pcaller, unsigned int id); void OnLButtonDoubleClick( const cUIPos& pos ); void OnLButtonDown( const cUIPos& pos, bool ctrl, bool alt, bool ); void OnIconDragged( cUINode* , unsigned int , const cUIPos& , bool ); void UpdateSkin(); void OnShow(); void OnHide(); /// »çÀÌÁî ¾÷µ¥ÀÌÆ® virtual void UpdateSize( int height ); void KeyEvent( eKeyCode code ); private: /// ºÐ¸® äÆÃ À©µµ¿ì ¸®½ºÆ® /// typedef tPointerList cExtraList; typedef tPointerList cExtraList; cExtraList mExtraList; /// ±Ó¼Ó¸» ÁÖ°í ¹ÞÀº À¯Àú ÀúÀå ( ÃÖ´ë 5°³±îÁö ) typedef tList cWhisperList; cWhisperList mWhisperList; protected: cTextBox* mpChatBox; cEditBox* mpChatEdit; cEditBox* mpChatEditWhisper; /// äÆÃ ÅØ½ºÆ®¹Ú½ºÀÇ ´Ã¾î³ª´Â ¹è°æ. cPlaneObject* mpChatBoxImage; cPlaneObject* mpChatBoxImageUp; /// ¹è°æ À­ÂÊ Æ² cPlaneObject* mpChatBoxImageDown; /// ¹è°æ ¾Æ·¡ÂÊ Æ² /// ¿É¼Ç ºÎºÐ À̹ÌÁö cUIImage* mpOptionImage; /// ¼±ÅÃÇÑ Ã¤ÆÃ»óÅ¿ë À̹ÌÁö cUIImage* mpSelectImage; /// cUINodeSkin* mpSelectSkin; cUINodeSkin* mpOptionSkin; cUINodeSkin* mpUpSkin; /// ÇöÀç äÆÃ»óŸ¦ ³ªÅ¸³¾ ÅØ½ºÃÄ ÁÂÇ¥ ÀúÀå cUINodeSkin* mpTexSkin[8]; /// ±âº» ¿­ ¼ö unsigned int mDefalutRowNum; /// ±Ó¼Ó¸» ¼ø¼­ int mCount; /// ÇöÀç äÆÃ »óÅ eChatMsgKind mSelectType; //// cChatButtonWindow* mpButtonWindow; /// ¸µÅ© ¾ÆÀÌÅÛ cItemIcon* mpLinkItemIcon; unsigned long mLinkItemIndex; /// cUINode* mpNormal; cUINode* mpParty; cUINode* mpGuild; cUINode* mpShout; cUINode* mpTrade; cUINode* mpWhisper; cUINode* mpSystem; cUINode* mpMegaPhone; // À̵¿ °íÁ¤ ±â´É cPushButton* mpMoveLock; }; /// ¹öư À©µµ¿ì class cChatButtonWindow : public cUIWindow { public: cChatButtonWindow(); virtual ~cChatButtonWindow(); virtual void Open() {} protected: bool OnCreate( cUINodeProperty* pproperty ); void OnCommand( cUINode* , unsigned int ); void OnMouseOtherClick( const cUIPos& pos ); void UpdateSkin(); private: cUINode* mpNormal; cUINode* mpParty; cUINode* mpGuild; cUINode* mpShout; cUINode* mpTrade; cUINode* mpWhisper; };