/* ========================================================================== * ÀÛ ¼º ÀÚ : ±è°¡¶÷ * ÀÛ ¼º ÀÏ : 2009.06.05 * ³» ¿ë : * ÁÖÀÇ»çÇ× : *===========================================================================*/ #pragma once #include "UINode.h" #include "UIImage.h" #include "UINodeData.h" enum eIconType { eICON_NORMAL = 0, /// ÀϹÝŸÀÔ eICON_ITEM, eICON_SKILL, eICON_COMMUNITY, eICON_UNION, /// ÆÄƼ¿¬ÇÕ¿ë eICON_SHORTCUT, /// ´ÜÃàŰ¿ë eICON_MAX, }; /// ¾ÆÀÌÄÜ ÀÎÀÚ class cIconParam { public: /// ÅØ½ºÃ³ NiTexture* mpTexture; /// ÅØ½ºÃ³ À§Ä¡ ÁÂÇ¥ cUIPos mTexPos; cIconParam() { mpTexture = 0; mTexPos.mX = 0; mTexPos.mY = 0; } }; /// ±âº» ¾ÆÀÌÄÜ class cBaseIcon : public cUINode { public: cBaseIcon( eUINodeType type = eUINODE_ICON ); virtual ~cBaseIcon(); /// ¾ÆÀÌÄÜ È°¼ºÈ­ (À̺¥Æ®´Â ¹ÞµÇ, ºñȰ¼ºÈ­ ) void SetUsedFlag( bool enable, bool colorchange = true ); inline bool IsEnableUse() { return mEnableUse; } /// À̹ÌÁö void ChangeImage( cIconParam* param, unsigned int texW = 0, unsigned int texH = 0 ); void ClearImage(); /// »ö»ó void SetColor( const NiColorA& color ); void SetColor( float r, float g, float b, float a ); const NiColorA& GetColor() const; /// ¾ÆÀÌÄÜ ÀÎÀÚ inline cIconParam* GetIconParam() { return mParam; } void SetIconType( eIconType type ); unsigned int GetIconType(); protected: virtual bool SetSkin( const cUINodeSkin* skin ); virtual void UpdateRect(); /// À̺¥Æ® virtual bool HandleEvent( const cUIEvent& event ); virtual void OnProcess( unsigned long deltaTime, unsigned long accumTime ) {} virtual void OnRender( cUIFontItemKeeper* pKeeper ); virtual void OnMouseHovered(const cUIPos& pos ); virtual void OnMouseMove( const cUIPos& pos ); virtual void OnMouseLeft(const cUIPos& pos ); virtual void OnLButtonDown( const cUIPos& pos, bool ctrl, bool alt, bool shift ); virtual void OnLButtonUp( const cUIPos& pos ); virtual void OnLButtonDoubleClick( const cUIPos& pos ); virtual void OnRButtonDown( const cUIPos& pos, bool ctrl, bool alt, bool shift ); protected: /// ¾ÆÀÌÄÜ Å¸ÀÔ int mIconType; /// ¾ÆÀÌÄÜ ÀÎÀÚ cIconParam* mParam; /// ½¬ÇÁÆ® ´­¸² bool mShiftDown; /// ¾ÆÀÌÄÜȰ¼ºÈ­ ¿©ºÎ (À̵¿°¡´É) bool mEnableUse; NiColorA mColor; }; inline void cBaseIcon::SetIconType( eIconType type ) { mIconType = type; } inline unsigned int cBaseIcon::GetIconType() { return mIconType; } inline void cBaseIcon::SetColor( float r, float g, float b, float a ) { SetColor( NiColorA(r,g,b,a) ); } inline void cBaseIcon::SetColor( const NiColorA& color ) { mColor = color; if( mpImage ) mpImage->SetColor( color ); } inline const NiColorA& cBaseIcon::GetColor() const { if( mpImage ) return mpImage->GetColor(); return NiColorA::WHITE; } //////////////////////////////////////////////////////////////////////////////// /// ¾ÆÀÌÄÜ ½ºÅ² class cIconSkin : public cUINodeSkin { public: cIconSkin( eUINodeType type = eUINODE_ICON ); virtual ~cIconSkin(); /// ·Îµù virtual bool Load( cParser& parser ); };