/* ==========================================================================
* 파    일 : LootingWindow.h
* 목    적 : 
* 작 성 자 : 김가람
* 작 성 일 : 2007-10-25
* 주의사항 :
*===========================================================================*/
#pragma once
#include "UIWindow.h"
#include "Item_Common.h"

const int ICONSIZE = 28;

/// 네트워크 락
enum
{
	eLOCK_CLOSE,
	eLOCK_GETITEM,
};

class cUIImage;
struct sLootData : sItemData
{
	cUIImageFont*	mFont;
	cUIImage*		mpImage;

	sLootData()
	{
		mFont = 0;
		mpImage = 0;
	}
};

class cListBox;
class cButton;
/// 아이템 습득 상자 윈도우
class cLootingWindow : public cUIWindow
{
public:
	cLootingWindow();
	virtual ~cLootingWindow();

	void Clear();

	/// 윈도우 닫기
	void Close();

	/// 아이템 추가 ( 루팅 아이템 맵에 추가 여부 )
	bool AddItem( sLootData* data, bool addlootlist = true );
	float GetWeight();

	///
	sLootData* GetSelectData();

	///
	void OnCommand( cUINode* pcaller, unsigned int id );

protected:
	bool OnCreate( cUINodeProperty* pproperty );
	void OnListBoxSelected(cUINode* , unsigned int );
	void OnListBoxImageHorvered(cUINode* , unsigned int , const cUIPos& , void* );
	void OnListBoxImageLeft(cUINode* , unsigned int );
	void UpdateSkin();
	void OnShow();
	void OnHide();
	void OnNetLock( int lockTry );
	void OnNetUnLock( int lockTry );

private:
	/// sLootData
	typedef tList<void*> cItemLootList;
	cItemLootList	mItemLootList;

	///
	cListBox*		mpItemList;

	///	습득버튼
	cButton*		mpGetButton;
	cButton*		mpCloseButton;

	/// 습득을 선택한 열 저장
	unsigned int mSelecetRow;
};
