Files
Leviathan/Client/Game/game/Interface/SUIDestructionWnd.h
T
2026-06-01 12:46:52 +02:00

112 lines
3.9 KiB
C++

#pragma once
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
//
// class SUIDestructionWnd
//
// * 아이템 파괴 윈도우.
//
//
//--------------------------------------------------------------------------------------------------------------------------------------------------------------
#include <mmo/ArType.h>
//#include "SUIWnd.h"
class SGameManager;
class SUIDisplayInfo;
#define DESTRUCTION_HORIZONTAL_COUNT 5 // 슬롯 가로축 개수.
#define DESTRUCTION_VERTICAL_COUNT 5 // 슬롯 세로축 개수.
#define DESTRUCTION_TOTAL DESTRUCTION_HORIZONTAL_COUNT * DESTRUCTION_VERTICAL_COUNT
class SUIDestructionWnd : public SUIWnd
{
public:
private:
SUIDisplayInfo * m_pDisplayInfo;
// 슬롯에 들어갈 아이템묶음.
struct SItemSet
{
AR_HANDLE handle;
count_t count;
int FromWhere; // 2011. 9. 19 - marine 가방아이템인지 창고아이템인지 구분..
SItemSet() : handle(NULL), count(0), FromWhere(0)
{}
SItemSet( AR_HANDLE _handle, count_t _count = count_t(1), int FromWhere = 0 )
: handle( _handle ), count( _count ), FromWhere( FromWhere )
{}
};
std::vector< SItemSet > m_arrItems; // 아이템묶음 배열.
std::vector< KUIControlMultiIcon * > m_arrSlotControl; // 슬롯컨트롤 배열.
std::vector< KUIWnd * > m_arrCountControl; // 아이템 개수 컨트롤 배열.
int m_decreaseIndex; // 개수 감소시킬 아이템 인덱스.
AR_HANDLE m_ReserveDropItemHandle;
//servantes 2010.10.25
bool m_bDeleteItemFlag;
std::string m_strDeleteItem;
bool m_bisFromStorage; // 2011. 9. 19 - marine 창고에서도 파괴가 되야 하기 때문에 구분이 필요
enum{
FROM_INVENTORY = 0, // 인벤토리에서 온 아이템
FROM_STORAGE = 1 // 창고에서 온 아이템
};
public:
SUIDestructionWnd( SGameManager * pGamaManager, SUIDisplayInfo * pDisplayInfo ) : SUIWnd( pGamaManager ), m_pDisplayInfo( pDisplayInfo )
, m_bDeleteItemFlag( false ) //servantes 2010.10.25
{}
~SUIDestructionWnd();
//----------------------
// Override
//
virtual SUIWnd * CreateWnd( const char * szNUIFileName, KUIWndManager * pWndManager, KPoint kPos, int nWindowID = -1 );
virtual bool InitControls( KPoint kPos );
virtual void * Perform( KID id, KArg & msg );
virtual void PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam );
virtual void ProcMsgAtStatic( SGameMessage * pMsg );
virtual void OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd = true );
//----------------------
//
void Release(); // 메모리 해제.
// 파괴할 아이템의 유효성 검사.
bool ValidateDestructionItem( AR_HANDLE hItem );
//void AddItem( SGameMessage * pMsg ); // 아이템추가.
void AddItem( AR_HANDLE handle, count_t _count , int FromWhere = 0);
void DecreaseItem( std::string strID ); // 아이템 감소.
void SUIDestructionWnd::EraseItem( int index, count_t count=count_t(1) ); // 아이템묶음 배열의 해당인덱스의 요소 제거.
void RefreshAllSlot(); // RefreshAllSlot.
void RefreshSlot( int index, SInventorySlot * pSlot ); // RefreshSlot.
void ItemDestroy(); // 아이템 파괴 패킷 전송.
void ReleaseAllSlot(); // 아이템제거.
SInventorySlot* GetItemSlot(LPCSTR lpszControlID); //servantes 2010.10.25
int GetItemCount(LPCSTR lpszControlID);
int SetItemCount(LPCSTR lpszControlID, int nCnt);
};