#pragma once //#include "SUIWnd.h" #include "ItemBase.h" //--------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------- // // class SUIDurabilityWnd // // * 내구도 출력 UI\ //--------------------------------------------------------------------------------------------- namespace UIDurabilityWnd { typedef struct stUIMatchingInfo { UINT m_nWearType; // 장비 타입 UINT m_nUIIndex; // UI 인덱스 KUIWnd* m_pGaugeBarControl; // 게이지 컨트롤 포인터 KUIWnd* m_pBrokenIconControl; // X 아이콘 컨트롤 포인터 stUIMatchingInfo() : m_nWearType( ItemBase::ItemWearType::WEAR_NONE ) , m_nUIIndex( -1 ) , m_pGaugeBarControl( NULL ) , m_pBrokenIconControl( NULL ) { } }UIMATCHINGINFO, *PUIMATCHINGINFO; enum eWearItemStatus : BYTE { eNone = 0, // 장착 된 장비 없음 eNormalClass, // 내구도 없는 일반 장비 eHighClass, // 내구도 있는 상급 장비 eBroken, // 부서진 상급 장비 eMax, }; enum eDurabilityGaugaKind : BYTE { eDurabilityGauga_DontHave = 0, // 내구도가 존재하지 않음 eDurabilityGauga_Danger, // 내구도 위험 eDurabilityGauga_Warning, // 내구도 경고 eDurabilityGauga_Normal, // 내구도 보통 eDurabilityGauga_Broken, // 내구도 부서짐 eDurabilityGauga_Max, }; #define DEF_METIN_CREATURE #ifdef DEF_METIN_CREATURE enum { VECTOR_CREATURE_0, // 주 크리처 VECTOR_CREATURE_1 // 부 크리처 }; const int c_nUICreatureRepair0 = 12; // guage_base12 const int c_nUICreatureRepair1 = 19; // guage_base19 const int c_nRepairSlotSize = 7; #endif }; using namespace UIDurabilityWnd; using std::vector; class SUIDurabilityWnd : public SUIWnd { public : SUIDurabilityWnd( SGameManager * pGameManager ); virtual ~SUIDurabilityWnd( void ); virtual SUIWnd* CreateWnd( const char* szFile, KUIWndManager* pWndManager, KPoint kPos, int nWindowID ); virtual bool InitControls( KPoint kPos ); virtual void OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd = true ); virtual void ProcMsgAtStatic( SGameMessage* pMsg ); virtual void PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam ); void Release( void ); // 메모리 해제. private: void RefreshDurability( void ); // 내구도 갱신 void CreateUIMatchingInfo_Character( void ); // 캐릭터 내구도 UI와 장비의 매칭 정보 생성 UINT GetWearTypeFromDurabilityUIIndex( WORD wDurabilityUIIndex ); // 내구도 UI Index로 부터 장비 타입 얻기 PUIMATCHINGINFO FindUIMatchingInfoFromWearType( const int nWearType ); // 장비 타입으로 부터 매칭 정보 얻기 void GetDurabilityInfoFromWearType( IN const int nWearType, // 장비 타입 ( 입력 ) OUT eWearItemStatus& eItemStatus, // 아이템 상태 ( 출력 ) OUT float& fDurabilityPercent ); // 내구도 % ( 출력 ) #ifdef DEF_METIN_CREATURE void InitCreatureRepairUI(); void SetShowCreatureRepairUI(int nCreatureUI, bool bShow); #endif private: vector< UIMATCHINGINFO > m_vecUIMatchingInfo_Character; // UI 매칭 정보 ( 캐릭터 ) vector< KUIWnd * > m_arrGeneralItem; // 내구도 부서진 아이템의 X 아이콘 출력될 컨트롤 List vector< KUIWnd * > m_arrDrabilityGauge; // 내구도 게이지 Bar 출력을 위한 컨트롤 List float m_fGaugeWidth; // 내구도 게이지 기본 넓이. #ifdef DEF_METIN_CREATURE vector< KUIWnd* > m_arCreatureRepair0; // 주 크리쳐 내구도 UI vector< KUIWnd* > m_arCreatureRepair1; // 부 크리쳐 내구도 UI #endif };