⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guichatlog.h

📁 五行MMORPG引擎系统V1.0
💻 H
字号:
//guiChatLog.h
/*/////////////////////////////////////////////////////////////////

   李亦
	liease@163.com 4040719
	2006-8-5
/*/////////////////////////////////////////////////////////////////
#ifndef _GUICHATLOG_H_
#define _GUICHATLOG_H_

#ifndef _GUIMLTEXTCTRL_H_
#include "gui/controls/guiMLTextCtrl.h"
#endif

/////////////////////////////////////////////////////////////////
/// 聊天记录界面
class GuiChatLog: public GuiMLTextCtrl
{
	typedef  GuiMLTextCtrl Parent;
public:
	//构造/析构函数
	GuiChatLog();
	~GuiChatLog();

	Point2I	m_shadowOffset;
	ColorI	m_shadowColor;
protected:
	//CSTR HexToStr(U32 uHex);
public:
	void SetShadow(Point2I offset,ColorI& clr);
	void SetColor(ColorI& clr);
	void AppendText(CSTR szText);
public:
	bool onWake();

	static void initPersistFields();
	//static void consoleInit();

	DECLARE_CONOBJECT(GuiChatLog);
};//class GuiChatLog

/////////////////////////////////////////////////////////////////
//inline CSTR GuiChatLog::HexToStr(U32 uHex)
//{
//	char szBuf[4];
//}

#define COLOR_TO_HEX(clr)		(clr)<0x10?"0" : "",(clr)


inline void GuiChatLog::SetShadow(Point2I offset,ColorI& clr)
{
	char szText[128];
	dSprintf(szText,128, "<shadow:%d:%d><shadowcolor:%s%x%s%x%s%x>", 
					offset.x,offset.y ,
					COLOR_TO_HEX(clr.red),
					COLOR_TO_HEX(clr.green),
					COLOR_TO_HEX(clr.blue),
					COLOR_TO_HEX(clr.alpha));
	addText(szText,dStrlen(szText), false);
}


inline void GuiChatLog::SetColor(ColorI& clr)
{
	char szText[128];
	dSprintf(szText,128, "<color:%s%x%s%x%s%x>", 
					COLOR_TO_HEX(clr.red),
					COLOR_TO_HEX(clr.green),
					COLOR_TO_HEX(clr.blue),
					COLOR_TO_HEX(clr.alpha));
	addText(szText,dStrlen(szText), false);
}


/////////////////////////////////////////////////////////////////
DECLARE_CONSOLETYPE(GuiChatLog);

#endif //_GUICHATLOG_H_

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -