#pragma once #include "../eterBase/Singleton.h" class CPythonTextTail : public CSingleton { public: typedef struct STextTail { CGraphicTextInstance* pTextInstance; CGraphicTextInstance* pOwnerTextInstance; CGraphicMarkInstance* pMarkInstance; CGraphicTextInstance* pGuildNameTextInstance; CGraphicTextInstance* pTitleTextInstance; CGraphicTextInstance* pLevelTextInstance; #ifdef ENABLE_RANK_SYSTEM CGraphicImageInstance* pRankImageInstance; CGraphicImageInstance* pRankImageInstance2; #endif #ifdef ENABLE_PLAYTIME_TITLE CGraphicImageInstance* pTitleRank; #endif CGraphicObjectInstance * pOwner; DWORD dwVirtualID; float x, y, z; float fDistanceFromPlayer; D3DXCOLOR Color; BOOL bNameFlag; float xStart, yStart; float xEnd, yEnd; DWORD LivingTime; float fHeight; #ifdef __ENABLE_NEW_OFFLINESHOP__ # ifdef ENABLE_NEW_SHOP_IN_CITIES bool bIsShop; bool bRender; # endif #endif STextTail() {} virtual ~STextTail() {} } TTextTail; typedef std::map TTextTailMap; typedef std::list TTextTailList; typedef TTextTailMap TChatTailMap; public: CPythonTextTail(void); virtual ~CPythonTextTail(void); void GetInfo(std::string* pstInfo); void Initialize(); void Destroy(); void Clear(); void UpdateAllTextTail(); void UpdateShowingTextTail(); void Render(); void ArrangeTextTail(); void HideAllTextTail(); void ShowAllTextTail(); void ShowCharacterTextTail(DWORD VirtualID); void ShowItemTextTail(DWORD VirtualID); #ifdef ENABLE_GUILD_LEADER_GRADE_NAME void RegisterCharacterTextTail(DWORD dwGuildID, const char* c_szGuildLeaderGradeName, DWORD dwVirtualID, const D3DXCOLOR& c_rColor, float fAddHeight = 10.0f); #else void RegisterCharacterTextTail(DWORD dwGuildID, DWORD dwVirtualID, const D3DXCOLOR& c_rColor, float fAddHeight = 10.0f); #endif #ifdef ENABLE_EXTENDED_ITEMNAME_ON_GROUND void RegisterItemTextTail(DWORD VirtualID, const char* c_szText, CGraphicObjectInstance* pOwner, bool bHasAttr = false); #else void RegisterItemTextTail(DWORD VirtualID, const char* c_szText, CGraphicObjectInstance* pOwner); #endif void RegisterChatTail(DWORD VirtualID, const char * c_szChat); void RegisterInfoTail(DWORD VirtualID, const char * c_szChat); void SetCharacterTextTailColor(DWORD VirtualID, const D3DXCOLOR & c_rColor); void SetItemTextTailOwner(DWORD dwVID, const char * c_szName); void DeleteCharacterTextTail(DWORD VirtualID); void DeleteItemTextTail(DWORD VirtualID); #ifdef ENABLE_NEW_SHOP_IN_CITIES void RegisterShopInstanceTextTail(DWORD dwVirtualID, const char* c_szName, CGraphicObjectInstance* pOwner); void DeleteShopTextTail(DWORD VirtualID); TTextTail* RegisterShopTextTail(DWORD dwVirtualID, const char* c_szText, CGraphicObjectInstance* pOwner); bool GetPickedNewShop(DWORD* pdwVID); #endif int Pick(int ixMouse, int iyMouse); void SelectItemName(DWORD dwVirtualID); bool GetTextTailPosition(DWORD dwVID, float* px, float* py, float* pz); bool IsChatTextTail(DWORD dwVID); void EnablePKTitle(BOOL bFlag); void AttachTitle(DWORD dwVID, const char * c_szName, const D3DXCOLOR& c_rColor); void DetachTitle(DWORD dwVID); void AttachLevel(DWORD dwVID, const char* c_szText, const D3DXCOLOR& c_rColor); void DetachLevel(DWORD dwVID); #ifdef ENABLE_RANK_SYSTEM void AttachRank(DWORD dwVID, short sRank); void DeattachRank(DWORD dwVID); #endif #ifdef ENABLE_PLAYTIME_TITLE void AttachPTimeTitle(DWORD dwVID, const char* c_szName); void DetachPTimeTitle(DWORD dwVID); #endif protected: TTextTail * RegisterTextTail(DWORD dwVirtualID, const char * c_szText, CGraphicObjectInstance * pOwner, float fHeight, const D3DXCOLOR & c_rColor); void DeleteTextTail(TTextTail * pTextTail); void UpdateTextTail(TTextTail * pTextTail); void RenderTextTailBox(TTextTail * pTextTail); void RenderTextTailName(TTextTail * pTextTail); void UpdateDistance(const TPixelPosition & c_rCenterPosition, TTextTail * pTextTail); bool isIn(TTextTail * pSource, TTextTail * pTarget); protected: TTextTailMap m_CharacterTextTailMap; TTextTailMap m_ItemTextTailMap; TChatTailMap m_ChatTailMap; #ifdef ENABLE_NEW_SHOP_IN_CITIES TTextTailMap m_ShopTextTailMap; #endif TTextTailList m_CharacterTextTailList; TTextTailList m_ItemTextTailList; private: CDynamicPool m_TextTailPool; };