#pragma once /// 2011.07.14 //#include "SUIWnd.h" namespace WIN_NOTICE { const int c_nNoticeWidth = 500; const int c_nNoticeHeight = 150; }; struct sNoticeLine { void init(char const* text, int chatType); void updateCaption(bool show); bool updateAlpha(float elapsedtime); char const* getCaptionTag(int chatType); int getHeight(); void movePos(int x, int y); void setState(int state); bool isShow() const; void operator = (sNoticeLine const& line) { m_text = line.m_text; m_alpha = line.m_alpha; m_updateTime = line.m_updateTime; m_normalTime = line.m_normalTime; m_alphaTime = line.m_alphaTime; m_v = line.m_v; m_chatType = line.m_chatType; m_state = line.m_state; } enum { STATE_NORMAL, STATE_ALPHA }; std::string m_text; KUIControlStatic* m_control; float m_alpha; float m_updateTime; float m_normalTime; float m_alphaTime; float m_v; int m_chatType; int m_state; }; class SUINoticeWnd : public SUIWnd { public: SUINoticeWnd(SGameManager* pGameManager) : SUIWnd(pGameManager), m_ProcTime(0) {} virtual void Process(DWORD dwTime); virtual void ProcMsgAtStatic( SGameMessage* pMsg ); virtual DWORD OnMouseMessage(DWORD dwMessage, int x, int y); void GetCenterPos(int& x, int& y); bool CreateControls( class KUIWndManager* pWndManager ); protected: void addText(char const* str, int chatType); bool isFullLine(); void setCurLine(int line); void updateLinePos(); void updateLineAlpha(DWORD elapsedtime); protected: enum{ MAX_LINE_NUM = 3, LINE_WIDTH = 500, LINE_Y = 150 }; DWORD m_ProcTime; sNoticeLine m_line[MAX_LINE_NUM]; int m_curLine; };