2306 lines
78 KiB
C++
2306 lines
78 KiB
C++
|
|
#include "stdafx.h"
|
|
#include "KUIWndManager.h"
|
|
#include "KUIDragAndDrop.h"
|
|
//#include "KUIControl.h"
|
|
#include "KUIControlStatic.h"
|
|
#include "KUIControlScroll.h"
|
|
#include "KUIControlButton.h"
|
|
#include "KUITabControl.h"
|
|
#include "SUIShopWnd_CRAFT.h"
|
|
#include "SGameManager.h"
|
|
//#include "SGameMessageUI.h"
|
|
#include "SItemDB.h"
|
|
#include "SStringDB.h"
|
|
#include "SkillBaseFile.h"
|
|
//#include "Util.h"
|
|
#include "ErrorCode/ErrorCode.h"
|
|
#include "SUISysMsgDefine.h"
|
|
#include "SStoreMgr.h"
|
|
#include "SPlayerInfoMgr.h"
|
|
#include "SInventoryMgr.h"
|
|
#include "SUIDisplayInfo.h"
|
|
// 2010.07.06 - prodongi
|
|
//#include "SUIUtil.h"
|
|
#include "SGameInterface.h" // 2012. 2. 21 - marine
|
|
#include "SNpcResourceDB.h"
|
|
#include "SGameNpc.h"
|
|
#include "SGame.h"
|
|
#include "SUILazyTooltip.h"
|
|
#include "SGameSystem.h"
|
|
|
|
|
|
///extern SGameSystem * g_pCurrentGameSystem;
|
|
///
|
|
///
|
|
///
|
|
///
|
|
///namespace
|
|
///{
|
|
/// const int c_nInvenWndMaxHeight = 628;
|
|
/// const int c_nInvenWndResizeUnitY = 38;
|
|
/// const int c_nInvenSlotReduceCount = 14;
|
|
///
|
|
/// const int c_nMaxShopSlotCount = 14;
|
|
/// const int c_nMaxKartSlotCount = 13;
|
|
///
|
|
/// const char* c_szTabItemCategory = "tab_itemcategory";
|
|
/// const char* c_szScrollInven = "vscroll_inven";
|
|
/// const char* c_szStaticItemBG = "static_common_itemslot";
|
|
///
|
|
/// const char* c_szIconControl = "icon_item";
|
|
/// const char* c_szStaticNameControl = "static_item";
|
|
/// const char* c_szStaticCountControl = "static_itemcount";
|
|
/// const char* c_szStaticPriceControl = "static_price";
|
|
/// const char* c_szStaticUnitControl = "text_unit";
|
|
///
|
|
/// const char* c_szButtonBuySell = "button_buysell";
|
|
///
|
|
/// const char* c_szTooltipSprName = c_szDEF_SPR_NAME;
|
|
///
|
|
/// // --;; 서버에서 int 사용하더라는 OTL -N4-
|
|
/// const int c_nBuySellCountLimit = 70000; // 매매갯수는 70000로 제한한다. ( 패킷에 갯수를 unsigned short을 사용하고 있음. )
|
|
///};
|
|
///
|
|
///void setSellItemUnitCaption2(KUIWnd* wnd)
|
|
///{
|
|
/// std::string strUnit;
|
|
/// XStringUtil::Format(strUnit, "%s%s", "<font:font_default><size:10><#fdec00>", S(6618));
|
|
/// wnd->SetCaption(strUnit.c_str());
|
|
///}
|
|
///
|
|
///void setBuyItemPriceCaption(SShopSlot_CRAFT* slot, count_t itemCount, KUIWnd* wnd)
|
|
///{
|
|
/// money_t price;
|
|
///
|
|
/// /*
|
|
/// if (slot->GetArenaPoint() > 0)
|
|
/// price = slot->GetArenaPoint() * itemCount;
|
|
/// else if (slot->GetHuntaHolicPoint() > 0)
|
|
/// price = slot->GetHuntaHolicPoint() * itemCount;
|
|
///
|
|
/// //Azia Mafia New money
|
|
/// else if (slot->GetFzPoint() > 0)
|
|
/// price = slot->GetFzPoint() * itemCount;
|
|
/// else if (slot->GetAfkPoint() > 0)
|
|
/// price = slot->GetAfkPoint() * itemCount;
|
|
/// else if (slot->GetGpPoint() > 0)
|
|
/// price = slot->GetGpPoint() * itemCount;
|
|
/// else if (slot->GetSpPoint() > 0)
|
|
/// price = slot->GetSpPoint() * itemCount;
|
|
///
|
|
/// else
|
|
/// */
|
|
/// price = slot->GetPrice() * itemCount;
|
|
///
|
|
/// std::string strPrice;
|
|
/// strPrice = CStringUtil::StringFormat( "<size:10><right>%s", CStringUtil::GetCommaNumberString( price.getAmount()).c_str());
|
|
/// wnd->SetCaption(strPrice.c_str());
|
|
///}
|
|
///
|
|
///void setBuyItemUnitCaption(SShopSlot_CRAFT* slot, KUIWnd* wnd)
|
|
///{
|
|
/// std::string strUnit;
|
|
///
|
|
/// /*
|
|
/// if (slot->GetArenaPoint() > 0)
|
|
/// {
|
|
/// XStringUtil::Format(strUnit, "%s%s", "<font:font_default><size:10><#1288d5>", S(2342));
|
|
/// }
|
|
/// else if (slot->GetHuntaHolicPoint() > 0)
|
|
/// {
|
|
/// XStringUtil::Format(strUnit, "%s%s", "<font:font_default><size:10><#ca4470>", S(9708));
|
|
/// }
|
|
///
|
|
/// //Azia Mafia New money
|
|
/// else if (slot->GetFzPoint() > 0)
|
|
/// {
|
|
/// XStringUtil::Format(strUnit, "%s%s", "<font:font_default><size:10><#ba9924>", S(2100033323));
|
|
/// }
|
|
/// else if (slot->GetAfkPoint() > 0)
|
|
/// {
|
|
/// XStringUtil::Format(strUnit, "%s%s", "<font:font_default><size:10><#64C845>", S(2100033324));
|
|
/// }
|
|
/// else if (slot->GetGpPoint() > 0)
|
|
/// {
|
|
/// XStringUtil::Format(strUnit, "%s%s", "<font:font_default><size:10><#FF4040>", S(2100033325));
|
|
/// }
|
|
/// else if (slot->GetSpPoint() > 0)
|
|
/// {
|
|
/// XStringUtil::Format(strUnit, "%s%s", "<font:font_default><size:10><#40FFBC>", S(2100033326));
|
|
/// }
|
|
///
|
|
///
|
|
/// else
|
|
///
|
|
/// */
|
|
///
|
|
/// {
|
|
/// XStringUtil::Format(strUnit, "%s%s", "<font:font_default><size:10><#fdec00>", S(6618));
|
|
/// }
|
|
///
|
|
/// wnd->SetCaption(strUnit.c_str());
|
|
///}
|
|
///
|
|
///
|
|
///void setSellItemUnitCaption_CRAFT(KUIWnd* wnd)
|
|
///{
|
|
/// std::string strUnit;
|
|
/// XStringUtil::Format(strUnit, "%s%s", "<font:font_default><size:10><#fdec00>", S(6618));
|
|
/// wnd->SetCaption(strUnit.c_str());
|
|
///}
|
|
///
|
|
///
|
|
///
|
|
///SUIShopWnd_CRAFT::SUIShopWnd_CRAFT( class SGameManager* pGameManager, SUIDisplayInfo* pDisplayInfo )
|
|
/// : SUIWnd( pGameManager )
|
|
/// , m_pDisplayInfo( pDisplayInfo )
|
|
/// , m_bCtrlKey(false)
|
|
/// , m_bShiptKey(false)
|
|
///{
|
|
/// m_pSlotControlIDs = new SLOT_INFO_CRAFT[ c_nMaxShopSlotCount ];
|
|
///
|
|
/// for( int n( 0 ); n < c_nMaxShopSlotCount; ++n )
|
|
/// {
|
|
/// std::string strNum = CStringUtil::StringFormat( "%02d", n );
|
|
/// m_pSlotControlIDs[ n ].strIconControl = c_szIconControl + strNum;
|
|
/// m_pSlotControlIDs[ n ].strStaticNameControl = c_szStaticNameControl + strNum;
|
|
/// m_pSlotControlIDs[ n ].strStaticCountControl = c_szStaticCountControl + strNum;
|
|
/// m_pSlotControlIDs[ n ].strStaticPriceControl = c_szStaticPriceControl + strNum;
|
|
/// m_pSlotControlIDs[ n ].strStaticUnitControl = c_szStaticUnitControl + strNum;
|
|
/// }
|
|
///}
|
|
///
|
|
///SUIShopWnd_CRAFT::~SUIShopWnd_CRAFT()
|
|
///{
|
|
/// delete [] m_pSlotControlIDs;
|
|
///}
|
|
///
|
|
///bool SUIShopWnd_CRAFT::InitControls( KPoint kPos )
|
|
///{
|
|
/// // 커스텀 윈도우 move 영역 설정
|
|
/// SetCustomMovingRect( KRect( 0, 0, 310, 20 ) );
|
|
///
|
|
/// {
|
|
/// RECT rc;
|
|
/// rc.left = 0; rc.top = c_nInvenWndResizeUnitY; rc.right = 0; rc.bottom = c_nInvenWndResizeUnitY;
|
|
/// int n = 0;
|
|
/// for( n = 0; n < c_nMaxShopSlotCount-1; n++ )
|
|
/// {
|
|
/// CopyControl( CStringUtil::StringFormat("icon_item%02d" , n).c_str(), CStringUtil::StringFormat("icon_item%02d" , n+1).c_str(), rc );
|
|
/// CopyControl( CStringUtil::StringFormat("static_item%02d" , n).c_str(), CStringUtil::StringFormat("static_item%02d" , n+1).c_str(), rc );
|
|
/// CopyControl( CStringUtil::StringFormat("static_itemcount%02d" , n).c_str(), CStringUtil::StringFormat("static_itemcount%02d" , n+1).c_str(), rc );
|
|
/// CopyControl( CStringUtil::StringFormat("static_price%02d" , n).c_str(), CStringUtil::StringFormat("static_price%02d" , n+1).c_str(), rc );
|
|
/// CopyControl( CStringUtil::StringFormat("text_unit%02d" , n).c_str(), CStringUtil::StringFormat("text_unit%02d" , n+1).c_str(), rc );
|
|
/// }
|
|
///
|
|
/// for( n = 0; n < c_nMaxShopSlotCount; n++ )
|
|
/// {
|
|
/// KUIControlMultiIcon* pIcon = dynamicCast<KUIControlMultiIcon*>(GetChild( CStringUtil::StringFormat("icon_item%02d" , n).c_str() ));
|
|
/// if( pIcon )
|
|
/// {
|
|
/// pIcon->SetIconLayer( 10 );
|
|
/// pIcon->SetCorrectionRect( KRect( 0, 0, 250, 0 ) );
|
|
/// }
|
|
/// }
|
|
/// }
|
|
///
|
|
/// // 아이템 category 탭 설정
|
|
/// KUISimpleTabControl* pTabItemCategory = dynamicCast<KUISimpleTabControl*>(GetChild( c_szTabItemCategory ));
|
|
/// if( NULL != pTabItemCategory )
|
|
/// {
|
|
/// pTabItemCategory->SetTabProperty( 0, false, 1 );
|
|
/// pTabItemCategory->AddTabItem( S(6242)/*"<size:10>Tout"*/, "" );
|
|
/// pTabItemCategory->SetSelectedItem( 0 );
|
|
/// }
|
|
///
|
|
/// SetChildShow( "static_select_over_back", false );
|
|
/// SetChildShow( "static_select_over" , false );
|
|
/// SetChildShow( "icon_select_over" , false );
|
|
///
|
|
/// return SUIWnd::InitControls( kPos );
|
|
///}
|
|
///bool SUIShopWnd_CRAFT::InitData( bool bReload )
|
|
///{
|
|
/// m_nScrollBarBottomOffset = 0;
|
|
/// m_nScrollBarTopOffset = 0;
|
|
/// m_CurrentCategory = UI_ITEM_ALL;
|
|
/// m_nCurrentSelect = -1;
|
|
/// m_nSlotStartIndex = 0;
|
|
/// m_nSlotCountY = c_nMaxShopSlotCount;
|
|
///
|
|
/// // 스크롤바 영역 조사
|
|
/// KUIControlVScroll* pScrollBar = dynamicCast<KUIControlVScroll*>(GetChild( c_szScrollInven ));
|
|
/// if( NULL != pScrollBar )
|
|
/// {
|
|
/// m_nScrollBarTopOffset = (pScrollBar->GetRectWithBtn().top - GetRect().top );
|
|
/// m_nScrollBarBottomOffset = (pScrollBar->GetRectWithBtn().bottom - GetRect().bottom);
|
|
/// }
|
|
///
|
|
/// int nInvenWndWidth = GetRect().GetWidth();
|
|
/// int nInvenWndMaxHeight = GetRect().GetHeight();
|
|
///
|
|
/// KUIWnd* pBottomWnd = GetChild( "static_inven_info" );
|
|
/// KUIWnd* pTopWnd = GetChild( "tab_itemcategory" );
|
|
///
|
|
/// int nTop = nInvenWndMaxHeight;
|
|
/// if( pTopWnd )
|
|
/// nTop = pTopWnd->GetRect().bottom;
|
|
///
|
|
/// int nInvenWndMinHeight = nTop + (c_nInvenWndResizeUnitY * c_nInvenSlotReduceCount);
|
|
/// if( pBottomWnd )
|
|
/// nInvenWndMinHeight += (nInvenWndMaxHeight-pBottomWnd->GetRect().top);
|
|
///
|
|
/// // 리사이즈 설정
|
|
/// KSize sizMin( nInvenWndWidth, nInvenWndMinHeight );
|
|
/// KSize sizMax( nInvenWndWidth, c_nInvenWndMaxHeight );
|
|
///
|
|
/// SetResizeUnit( 0, c_nInvenWndResizeUnitY, sizMin, sizMax );
|
|
/// Resize( KRect( KPoint( 0, 0 ), sizMin ) );
|
|
///
|
|
/// SetChildAsTop( "icon_select_over" );
|
|
///
|
|
///// int nDelta = nInvenWndMinHeight - nPrevHeight + 7; //7는 타이틀 높이
|
|
/// KUIWnd * pOutfram = GetChild( "outframe" );
|
|
/// if( pOutfram )
|
|
/// {
|
|
/// KRect rcChild = pOutfram->GetRect();
|
|
/// rcChild.bottom = nInvenWndMinHeight + 5;
|
|
/// pOutfram->Resize( rcChild );
|
|
/// }
|
|
///
|
|
/// KUIWnd * pInfram = GetChild( "inframe" );
|
|
/// if( pInfram )
|
|
/// {
|
|
/// KRect rcChild = pInfram->GetRect();
|
|
/// rcChild.bottom = nInvenWndMinHeight - 1;
|
|
/// pInfram->Resize( rcChild );
|
|
/// }
|
|
///
|
|
///
|
|
///
|
|
/// if( !bReload )
|
|
/// SetBuyModeShoppingKartWindow();
|
|
///
|
|
/// return SUIWnd::InitData(bReload);
|
|
///}
|
|
///void SUIShopWnd_CRAFT::OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd )
|
|
///{
|
|
/// SUIWnd::OnNotifyUIWindowOpen(bOpen);
|
|
///
|
|
/// if( bOpen )
|
|
/// {
|
|
/// //2012. 2. 20 - marine 열린 파괴창, 수리창, 조합창, 강화창 닫기,
|
|
/// m_pGameManager->GetGameInterface()->CloseAgainstUi();
|
|
/// m_pGameManager->StartSound( "ui_popup_window01.wav" );
|
|
///
|
|
/// MoveShoppingKartWindow();
|
|
/// RefreshGold();
|
|
/// RefreshWeight();
|
|
/// }
|
|
/// m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_SHOP_SUB_CRAFT, bOpen ) );
|
|
///}
|
|
///
|
|
///void* SUIShopWnd_CRAFT::Perform( KID id, KArg& msg )
|
|
///{
|
|
/// _CID( UI_BEGIN_DRAG );
|
|
/// _CID( UI_SEND_DROP );
|
|
///
|
|
/// if ( id == id_UI_BEGIN_DRAG )
|
|
/// {
|
|
/// KUIBeginDragMessage* pBeginMsg = static_cast<KUIBeginDragMessage*>( &msg );
|
|
/// const char* szControlID = pBeginMsg->sDragControlID.c_str();
|
|
///
|
|
/// KUIWnd* pWnd = GetChild( szControlID );
|
|
/// if( NULL != pWnd )
|
|
/// {
|
|
/// // 구입 상태인 경우
|
|
/// if( IsBuyMode() )
|
|
/// {
|
|
/// SShopSlot_CRAFT* pSlot = GetSlotBuyItem( GetSlotControlNum(szControlID) );
|
|
/// if( NULL != pSlot )
|
|
/// {
|
|
/// m_pDisplayInfo->SetUIDragInfo( new SUIShopBuyItemDragInfo( pSlot->GetItemCode() ) );
|
|
/// m_pDragAndDropIcon->SetStateIcon( pWnd->GetSprName(), pWnd->GetAniName(), pWnd->GetFrameIndex(), STATE_NORMAL );
|
|
///
|
|
/// pBeginMsg->pDragAndDropRenderer = m_pDragAndDropIcon;
|
|
/// }
|
|
/// }
|
|
/// // 판매 상태인 경우
|
|
/// else
|
|
/// {
|
|
/// SInventorySlot* pSlot = GetSlotSellItem( GetSlotControlNum(szControlID) );
|
|
/// if( NULL != pSlot )
|
|
/// {
|
|
/// m_pDisplayInfo->SetUIDragInfo( new SUIShopSellItemDragInfo( pSlot->GetHandle() ) );
|
|
/// m_pDragAndDropIcon->SetStateIcon( pWnd->GetSprName(), pWnd->GetAniName(), pWnd->GetFrameIndex(), STATE_NORMAL );
|
|
///
|
|
/// pBeginMsg->pDragAndDropRenderer = m_pDragAndDropIcon;
|
|
/// }
|
|
/// }
|
|
/// }
|
|
/// return NULL;
|
|
/// }
|
|
/// else if ( id == id_UI_SEND_DROP )
|
|
/// {
|
|
/// KUISendRecvDropMessage* pSendMsg = static_cast<KUISendRecvDropMessage*>( &msg );
|
|
///
|
|
/// SUIDragInfo* pUIDragInfo = m_pDisplayInfo->GetUIDragInfo();
|
|
/// if( NULL != pUIDragInfo )
|
|
/// {
|
|
/// // Drag & Drop 정보 제거
|
|
/// m_pDisplayInfo->SetUIDragInfo();
|
|
/// }
|
|
/// return NULL;
|
|
/// }
|
|
///
|
|
/// return SUIWnd::Perform( id, msg );
|
|
///}
|
|
///
|
|
///void SUIShopWnd_CRAFT::PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam )
|
|
///{
|
|
/// switch( nMessage )
|
|
/// {
|
|
/// case KUI_MESSAGE::KICON_PRESSING:
|
|
/// {
|
|
/// int nInvenIndex = IsBuyMode()
|
|
/// ? GetSlotBuyItemIndex( GetSlotControlNum( lpszControlID ) )
|
|
/// : GetSlotSellItemIndex( GetSlotControlNum( lpszControlID ) );
|
|
///
|
|
/// if( (-1) != nInvenIndex )
|
|
/// {
|
|
/// if( m_nSlotStartIndex <= nInvenIndex && nInvenIndex < (m_nSlotStartIndex + m_nSlotCountY) )
|
|
/// {
|
|
/// m_nCurrentSelect = nInvenIndex;
|
|
/// RefreshSelection();
|
|
/// }
|
|
/// }
|
|
/// if( ::_stricmp( lpszControlID, GetID() ) != 0 && (m_bCtrlKey || m_bShiptKey) )
|
|
/// SelectItemSendToCraft();
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case KUI_MESSAGE::KICON_DBLCLK:
|
|
/// {
|
|
///
|
|
/// if( ::_stricmp( lpszControlID, GetID() ) != 0 && (!m_bCtrlKey && !m_bShiptKey) )
|
|
/// SelectItemSendToCraft();
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case KUI_MESSAGE::KBUTTON_CLICK:
|
|
/// {
|
|
/// if( 0 == ::_stricmp( lpszControlID, "button_tokart" ) )
|
|
/// SelectItemSendToCraft();
|
|
///
|
|
/// else if( 0 == ::_stricmp( lpszControlID, "button_close" ) )
|
|
/// m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_SHOP_CRAFT, false ) );
|
|
/// m_pGameManager->PostMsgAtDynamic( new SIMSG_SHOW_UIWINDOW( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_INPUTNUMBER, false ) );
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case KUI_MESSAGE::KSCROLL_SELECT:
|
|
/// {
|
|
/// m_nSlotStartIndex = int(lparam);
|
|
/// RefreshSlots();
|
|
/// RefreshSelection();
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case KUI_MESSAGE::KGENWND_RESIZE:
|
|
/// {
|
|
/// int nDelta = GetRect().GetHeight() - static_cast<int>(wparam);
|
|
/// KUIWnd * pOutfram = GetChild( "outframe" );
|
|
/// if( pOutfram )
|
|
/// {
|
|
/// KRect rcChild = pOutfram->GetRect();
|
|
/// rcChild.bottom += nDelta;
|
|
/// pOutfram->Resize( rcChild );
|
|
/// }
|
|
///
|
|
/// KUIWnd * pInfram = GetChild( "inframe" );
|
|
/// if( pInfram )
|
|
/// {
|
|
/// KRect rcChild = pInfram->GetRect();
|
|
/// rcChild.bottom += nDelta;
|
|
/// pInfram->Resize( rcChild );
|
|
/// }
|
|
///
|
|
/// RefreshScrollBar();
|
|
/// RefreshSlots();
|
|
/// RefreshSelection();
|
|
/// MoveShoppingKartWindow();
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case KUI_MESSAGE::KGENWND_MOVE:
|
|
/// {
|
|
/// LimitMoveWnd();
|
|
/// MoveShoppingKartWindow();
|
|
/// }
|
|
/// break;
|
|
/// }
|
|
/// SUIWnd::PumpUpMessage( lpszControlID, nMessage, lparam, wparam );
|
|
///}
|
|
///
|
|
///void SUIShopWnd_CRAFT::ProcMsgAtStatic( SGameMessage* pMsg )
|
|
///{
|
|
/// switch( pMsg->nType )
|
|
/// {
|
|
/// case MSG_UPDATE_ITEM_COUNT:
|
|
/// case MSG_ITEM_DESTROY:
|
|
/// case MSG_ITEM_INVEN:
|
|
/// case MSG_ITEM_WEAR_INFO:
|
|
/// case MSG_SKILLCARD_INFO:
|
|
/// case MSG_BELT_SLOT_INFO: /// 2011.05.13 - prodongi
|
|
/// if( !IsBuyMode() && IsShow() )
|
|
/// {
|
|
/// RefreshItems();
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case MSG_MARKET_CRAFT:
|
|
/// {
|
|
/// //KUISimpleTabControl* pTabTradeMode = (KUISimpleTabControl*)GetChild( c_szTabTradeMode );
|
|
/// //if( NULL != pTabTradeMode ) pTabTradeMode->SetSelectedItem( 0 );
|
|
///
|
|
/// /*
|
|
/// KUIControlButtonCheck* pBtnSell = dynamicCast<KUIControlButtonCheck*>(GetChild("button_sell"));
|
|
/// KUIControlButtonCheck* pBtnBuy = dynamicCast<KUIControlButtonCheck*>(GetChild("button_buy"));
|
|
/// if( pBtnSell ) pBtnSell->SetCheck( false );
|
|
/// if( pBtnBuy ) pBtnBuy->SetCheck( true );
|
|
/// */
|
|
///
|
|
///
|
|
/// KUISimpleTabControl* pTabItemCategory = dynamicCast<KUISimpleTabControl*>(GetChild( c_szTabItemCategory ));
|
|
/// if( NULL != pTabItemCategory )
|
|
/// {
|
|
/// pTabItemCategory->SetSelectedItem( 0 );
|
|
/// m_CurrentCategory = UI_ITEM_ALL;
|
|
/// }
|
|
///
|
|
/// RefreshItems();
|
|
/// RefreshScrollBar();
|
|
/// RefreshSlots();
|
|
/// RefreshSelection();
|
|
///
|
|
/// //SetBuyModeShoppingKartWindow();
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case IMSG_HOTKEY_EX:
|
|
/// {
|
|
/// SIMSG_HOTKEY_EX* pHotKey = dynamicCast<SIMSG_HOTKEY_EX*>(pMsg);
|
|
///
|
|
/// if( pHotKey->wParam == VK_CONTROL )
|
|
/// m_bCtrlKey = (pHotKey->bUp == 0);
|
|
/// if( pHotKey->wParam == VK_SHIFT )
|
|
/// m_bShiptKey = (pHotKey->bUp == 0);
|
|
/// if( pHotKey->wParam == VK_MENU )
|
|
/// {
|
|
/// bool bPreState = m_bAltKey;
|
|
/// m_bAltKey = (pHotKey->bUp == 0);
|
|
///
|
|
/// if( bPreState != m_bAltKey && IsShow() )
|
|
/// {
|
|
/// RefreshSlots();
|
|
/// }
|
|
/// }
|
|
/// }
|
|
/// break;
|
|
/// }
|
|
///}
|
|
///
|
|
///
|
|
///
|
|
///void SUIShopWnd_CRAFT::RefreshGold()
|
|
///{
|
|
/// KUIWnd* pWnd = GetChild("static_rupy_value");
|
|
///
|
|
/// __int64 nGold = m_PlayerInfoMgr.GetPlayerInfo().GetGold().getAmount();
|
|
///
|
|
/// std::string strString = "";
|
|
/// if (nGold >= 1000000000000) strString += "<#FF0000>";
|
|
/// else if (nGold >= 100000000000) strString += "<#FF00F3>";
|
|
/// else if (nGold >= 10000000000) strString += "<#FF1493>";
|
|
/// else if (nGold >= 1000000000) strString += "<#00FFFC>";
|
|
/// else if (nGold >= 100000000) strString += "<#FF8C00>";
|
|
/// else if (nGold >= 10000000) strString += "<#FFFF00>";
|
|
/// else if (nGold >= 1000000) strString += "<#4AD55D>";
|
|
///
|
|
/// if (NULL != pWnd)
|
|
/// {
|
|
/// std::string strGold = "<right>";
|
|
/// strGold += S(6425);
|
|
/// strGold += strString;
|
|
/// strGold += CStringUtil::GetCommaNumberString(nGold);
|
|
///
|
|
/// pWnd->SetCaption(strGold.c_str());
|
|
/// }
|
|
///}
|
|
///
|
|
///
|
|
///void SUIShopWnd_CRAFT::RefreshWeight()
|
|
///{
|
|
/// float fInvenWeight = m_PlayerInfoMgr.GetPlayerInfo().GetInvenWeigth();
|
|
/// int nMaxWeight = m_PlayerInfoMgr.GetPlayerInfo().GetWeight();
|
|
/// float fWeightRatio = fInvenWeight / float(nMaxWeight) * 100.f;
|
|
///
|
|
/// KUIWnd* pWnd = GetChild( "static_weight_value" );
|
|
/// if( NULL != pWnd )
|
|
/// {
|
|
/// std::string strWeight = CStringUtil::StringFormat( "%s<right>%d%% (", S(6425), int(fWeightRatio) );
|
|
/// strWeight += CStringUtil::GetCommaNumberString( fInvenWeight );
|
|
/// strWeight += "/";
|
|
/// strWeight += CStringUtil::GetCommaNumberString( nMaxWeight );
|
|
/// strWeight += ")";
|
|
///
|
|
/// pWnd->SetCaption( strWeight.c_str() );
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopWnd_CRAFT::RefreshScrollBar()
|
|
///{
|
|
/// KUIControlVScroll* pScrollBar = dynamicCast<KUIControlVScroll*>(GetChild( c_szScrollInven ));
|
|
/// if( NULL != pScrollBar )
|
|
/// {
|
|
/// KRect rcScrollBar = pScrollBar->GetRectWithBtn();
|
|
/// rcScrollBar.top = (GetRect().top + m_nScrollBarTopOffset );
|
|
/// rcScrollBar.bottom = (GetRect().bottom + m_nScrollBarBottomOffset);
|
|
///
|
|
/// m_nSlotCountY = (rcScrollBar.bottom - rcScrollBar.top) / c_nInvenWndResizeUnitY + 1;
|
|
/// if( m_nSlotCountY > c_nMaxShopSlotCount ) m_nSlotCountY = c_nMaxShopSlotCount;
|
|
///
|
|
/// int nLineCount = int(IsBuyMode() ? m_vecBuyItemList.size() : m_vecSellItemList.size()) - 1;
|
|
/// if( 0 > nLineCount ) nLineCount = 0;
|
|
///
|
|
/// int nScrollRange = (nLineCount - m_nSlotCountY) + 1;
|
|
/// if( 0 > nScrollRange ) nScrollRange = 0;
|
|
///
|
|
/// pScrollBar->Resize( rcScrollBar );
|
|
/// pScrollBar->SetMaxRange( DWORD(nScrollRange + 1) );
|
|
///
|
|
/// m_nSlotStartIndex = pScrollBar->GetPosition();
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopWnd_CRAFT::RefreshSlots()
|
|
///{
|
|
/// // 구입 상태인 경우
|
|
/// if( IsBuyMode() )
|
|
/// {
|
|
/// for( int nSlot( 0 ); nSlot < c_nMaxShopSlotCount/*m_nSlotCountY*/; ++nSlot )
|
|
/// {
|
|
/// KUIControlMultiIcon* pItemIconControl = dynamicCast<KUIControlMultiIcon*>(GetChild( m_pSlotControlIDs[ nSlot ].strIconControl.c_str() ));
|
|
/// KUIWnd* pItemNameControl = GetChild( m_pSlotControlIDs[ nSlot ].strStaticNameControl.c_str() );
|
|
/// KUIWnd* pItemCountControl = GetChild( m_pSlotControlIDs[ nSlot ].strStaticCountControl.c_str() );
|
|
/// KUIWnd* pItemPriceControl = GetChild( m_pSlotControlIDs[ nSlot ].strStaticPriceControl.c_str() );
|
|
/// KUIWnd* pItemUnitControl = GetChild( m_pSlotControlIDs[ nSlot ].strStaticUnitControl.c_str() );
|
|
///
|
|
/// if( pItemCountControl ) pItemCountControl->SetShow(false); //보여질 필요 없음
|
|
///
|
|
/// if( nSlot >= m_nSlotCountY )
|
|
/// {
|
|
/// if( pItemIconControl ) pItemIconControl->SetShow(false);
|
|
/// if( pItemNameControl ) pItemNameControl->SetShow(false);
|
|
///// if( pItemCountControl ) pItemCountControl->SetShow(false);
|
|
/// if( pItemPriceControl ) pItemPriceControl->SetShow(false);
|
|
/// if( pItemUnitControl ) pItemUnitControl->SetShow(false);
|
|
/// continue;
|
|
/// }
|
|
///
|
|
/// if( NULL != pItemIconControl && NULL != pItemNameControl && NULL != pItemCountControl && NULL != pItemPriceControl && NULL != pItemUnitControl )
|
|
/// {
|
|
/// ResetMultiIcon( pItemIconControl, 0, 10 ); ///icon test
|
|
///
|
|
/// SShopSlot_CRAFT* pSlot = GetSlotBuyItem( nSlot );
|
|
/// if( NULL != pSlot )
|
|
/// {
|
|
/// if( pItemIconControl ) pItemIconControl->SetShow(true);
|
|
/// if( pItemNameControl ) pItemNameControl->SetShow(true);
|
|
/// if( pItemPriceControl ) pItemPriceControl->SetShow(true);
|
|
/// if( pItemUnitControl ) pItemUnitControl->SetShow(true);
|
|
///
|
|
/// const ItemBaseEx_info* rItemBase = GetItemDB().GetItemData( pSlot->GetItemCode() );
|
|
/// unsigned char byItemLevel = (ItemBase::TYPE_ARMOR == rItemBase->nType) ? rItemBase->level : 0;
|
|
///
|
|
/// // sonador 3.9.5 상점 판매 크리처 봉인 카드 켑션 수정
|
|
/// ItemBase::BaseFlag baseFlag;
|
|
/// baseFlag.CopyFrom( &rItemBase->status_flag );
|
|
/// int soket[ ItemBase::MAX_SOCKET_NUMBER ];
|
|
/// ::memset( soket, 0, sizeof( soket ) );
|
|
///
|
|
/// //!!!!
|
|
/// /// 2011.08.03 - prodongi
|
|
/// if (!setSkillCardIcon(pItemIconControl, pSlot->GetItemCode()))
|
|
/// {
|
|
/// // 채워진 슬롯
|
|
/// pItemIconControl->SetIcon( 0, c_szDEF_SPR_NAME, GetItemDB().GetIconName(pSlot->GetItemCode()) );
|
|
///
|
|
/// ////2010.01.19. 아이템내구도처리sfreer - 상점에선 '파괴' 인걸 팔진 않겠지..??;
|
|
/// pItemIconControl->SetIcon( 2, c_szDEF_SPR_NAME, NULL);
|
|
/// }
|
|
/// pItemIconControl->SetIcon( 1, c_szDEF_SPR_NAME, NULL );
|
|
///
|
|
/// EquipItemAddtionalIconSetter icon_setter( pItemIconControl, pSlot->GetItemCode(), rItemBase->enhance, rItemBase->nEthereal_durability, baseFlag );
|
|
///
|
|
/// // 상점 크루샵 아이템의 스텟 보이게 수정
|
|
/// // 2009-03-02: hunee
|
|
/// pItemIconControl->SetTooltip( m_pDisplayInfo->GetItemTooltipText(
|
|
/// pSlot->GetItemCode(),
|
|
/// true,
|
|
/// rItemBase->enhance,
|
|
/// byItemLevel,
|
|
/// baseFlag,
|
|
/// rItemBase->available_time,
|
|
/// soket,
|
|
/// 0,
|
|
/// 0,
|
|
/// 0,
|
|
/// 0,
|
|
/// 0,
|
|
/// 0,
|
|
/// 0,
|
|
/// true,
|
|
/// 0,
|
|
/// rItemBase->nEndurance,
|
|
/// 0,
|
|
/// rItemBase->nSummonId,
|
|
/// 0
|
|
/// ).c_str()
|
|
/// );
|
|
///
|
|
/// if( m_bAltKey )
|
|
/// {
|
|
/// m_pDisplayInfo->SetComparableEquipItemSubTooltip( pItemIconControl, pSlot->GetItemCode() );
|
|
/// }
|
|
///
|
|
/// pItemNameControl->SetCaption( CStringUtil::StringFormat( "<size:10><#fbe6ad><b>%s", m_pDisplayInfo->GetItemName( pSlot->GetItemCode(), true, rItemBase->enhance, byItemLevel, baseFlag ).c_str() ).c_str() );
|
|
///
|
|
/// setBuyItemPriceCaption(pSlot, count_t(1), pItemPriceControl);
|
|
/// setBuyItemUnitCaption(pSlot, pItemUnitControl);
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// // 빈 슬롯
|
|
/// pItemIconControl->SetIcon( 0, c_szDEF_SPR_NAME, c_szStaticItemBG );
|
|
/// pItemIconControl->SetIcon( 1, c_szDEF_SPR_NAME, c_szStaticItemBG );
|
|
/// pItemIconControl->SetIcon( 2 );
|
|
/// pItemIconControl->SetIcon( 3 );
|
|
/// pItemIconControl->SetTooltip();
|
|
/// pItemNameControl->SetCaption( "" );
|
|
/// pItemCountControl->SetShow(false);
|
|
/// pItemPriceControl->SetCaption( "" );
|
|
/// pItemUnitControl->SetShow(false);
|
|
/// }
|
|
/// }
|
|
/// }
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopWnd_CRAFT::RefreshSelection()
|
|
///{
|
|
/// KUIWnd* pSelectIcon = GetChild( "icon_select_over" );
|
|
/// KUIWnd* pSelectOver = GetChild( "static_select_over" );
|
|
/// KUIWnd* pSelectBG = GetChild( "static_select_over_back" );
|
|
/// if( NULL != pSelectIcon && NULL != pSelectOver && NULL != pSelectBG )
|
|
/// {
|
|
/// if( 0 <= m_nCurrentSelect && m_nCurrentSelect < (IsBuyMode() ? m_vecBuyItemList.size() : m_vecSellItemList.size()) )
|
|
/// {
|
|
/// int nSlot = (m_nCurrentSelect - m_nSlotStartIndex);
|
|
/// if( 0 <= nSlot && nSlot < m_nSlotCountY && nSlot < c_nMaxShopSlotCount )
|
|
/// {
|
|
/// KUIWnd* pItemIconControl = GetChild( m_pSlotControlIDs[ nSlot ].strIconControl.c_str() );
|
|
/// if( NULL != pItemIconControl )
|
|
/// {
|
|
/// const KRect& rIconRect = pItemIconControl->GetRect();
|
|
///
|
|
/// pSelectIcon->MovePos( rIconRect.left /*+ c_nIconSelectionCorrectX*/, rIconRect.top /*+ c_nIconSelectionCorrectY*/ );
|
|
/// pSelectOver->MovePos( rIconRect.left /*+ c_nNameSelectinCorrectX*/, rIconRect.top - 3 );
|
|
/// pSelectBG->MovePos( rIconRect.left /*+ c_nNameSelectinCorrectX*/, rIconRect.top - 3 );
|
|
/// pSelectIcon->SetShow( true );
|
|
/// pSelectOver->SetShow( true );
|
|
/// pSelectBG->SetShow( true );
|
|
/// }
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// pSelectIcon->SetShow( false );
|
|
/// pSelectOver->SetShow( false );
|
|
/// pSelectBG->SetShow( false );
|
|
/// }
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// m_nCurrentSelect = (-1);
|
|
/// pSelectIcon->SetShow( false );
|
|
/// pSelectOver->SetShow( false );
|
|
/// pSelectBG->SetShow( false );
|
|
/// }
|
|
/// }
|
|
///}
|
|
///
|
|
///
|
|
///void SUIShopWnd_CRAFT::RefreshSelectionCraft()
|
|
///{
|
|
/// KUIWnd* pSelectIcon = GetChild("icon_select_over");
|
|
/// KUIWnd* pSelectOver = GetChild("static_select_over");
|
|
/// KUIWnd* pSelectBG = GetChild("static_select_over_back");
|
|
/// if (NULL != pSelectIcon && NULL != pSelectOver && NULL != pSelectBG)
|
|
/// {
|
|
/// if (0 <= m_nCurrentSelect && m_nCurrentSelect < (IsBuyMode() ? m_vecBuyItemList.size() : m_vecSellItemList.size()))
|
|
/// {
|
|
/// int nSlot = (m_nCurrentSelect - m_nSlotStartIndex);
|
|
/// if (0 <= nSlot && nSlot < m_nSlotCountY && nSlot < c_nMaxShopSlotCount)
|
|
/// {
|
|
/// KUIWnd* pItemIconControl = GetChild(m_pSlotControlIDs[nSlot].strIconControl.c_str());
|
|
/// if (NULL != pItemIconControl)
|
|
/// {
|
|
/// const KRect& rIconRect = pItemIconControl->GetRect();
|
|
///
|
|
/// pSelectIcon->MovePos(rIconRect.left /*+ c_nIconSelectionCorrectX*/, rIconRect.top /*+ c_nIconSelectionCorrectY*/);
|
|
/// pSelectOver->MovePos(rIconRect.left /*+ c_nNameSelectinCorrectX*/, rIconRect.top - 3);
|
|
/// pSelectBG->MovePos(rIconRect.left /*+ c_nNameSelectinCorrectX*/, rIconRect.top - 3);
|
|
/// pSelectIcon->SetShow(true);
|
|
/// pSelectOver->SetShow(true);
|
|
/// pSelectBG->SetShow(true);
|
|
/// }
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// pSelectIcon->SetShow(false);
|
|
/// pSelectOver->SetShow(false);
|
|
/// pSelectBG->SetShow(false);
|
|
/// }
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// m_nCurrentSelect = (-1);
|
|
/// pSelectIcon->SetShow(false);
|
|
/// pSelectOver->SetShow(false);
|
|
/// pSelectBG->SetShow(false);
|
|
/// }
|
|
/// }
|
|
///}
|
|
///
|
|
///
|
|
///namespace
|
|
///{
|
|
/// struct BuyItemRankCompareFN
|
|
/// {
|
|
/// bool operator() ( SShopSlot_CRAFT*pr1, SShopSlot_CRAFT*pr2 )
|
|
/// {
|
|
/// return pr1->GetItemRank() < pr2->GetItemRank();
|
|
/// }
|
|
/// };
|
|
///}
|
|
///
|
|
///void SUIShopWnd_CRAFT::RefreshItems()
|
|
///{
|
|
/// m_nCurrentSelect = (-1);
|
|
///
|
|
/// if( IsBuyMode() )
|
|
/// {
|
|
/// m_InventoryMgr.GetShopDataList_CRAFT( m_CurrentCategory, m_vecBuyItemList );
|
|
/// //빼달라고 요청됨.
|
|
///// std::sort( m_vecBuyItemList.begin(), m_vecBuyItemList.end(), BuyItemRankCompareFN() );
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// /// 2010.11.24 카드의 장착 여부도 체크해야 됨 - prodongi
|
|
/// m_InventoryMgr.GetInvenDataList( m_CurrentCategory, m_vecSellItemList, m_CreatureSlotMgr, true, true );
|
|
/// //m_InventoryMgr.GetInvenDataList( m_CurrentCategory, m_vecSellItemList, true, true );
|
|
/// }
|
|
///
|
|
/// KUIControlVScroll* pScrollBar = dynamicCast<KUIControlVScroll*>(GetChild( c_szScrollInven ));
|
|
/// if( NULL != pScrollBar )
|
|
/// {
|
|
/// m_nSlotStartIndex = 0;
|
|
/// pScrollBar->SetPosition( 0 );
|
|
/// }
|
|
/// RefreshScrollBar();
|
|
///
|
|
/// RefreshSlots();
|
|
///
|
|
/// RefreshSelection();
|
|
///}
|
|
///
|
|
///void SUIShopWnd_CRAFT::SelectItemSendToCraft()
|
|
///{
|
|
/// int nItemCode(0);
|
|
/// if( IsBuyMode() )
|
|
/// {
|
|
/// if( 0 <= m_nCurrentSelect && m_nCurrentSelect < m_vecBuyItemList.size() )
|
|
/// {
|
|
/// /*
|
|
/// nItemCode = m_vecBuyItemList[ m_nCurrentSelect ]->GetItemCode();
|
|
/// if( m_bShiptKey && GetItemDB().IsJoin( nItemCode, false ) )
|
|
/// m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_REQ_INPUTNUMBER( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_SHOP, count_t( 1 ) ));//, SIMSG_UI_REQ_INPUTNUMBER::TYPE_NUMBER ) );
|
|
/// else if( m_bCtrlKey && GetItemDB().IsJoin( nItemCode, false ) ) //10개씩 증가
|
|
/// m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SHOP_BUYITEM_TOKART( m_vecBuyItemList[ m_nCurrentSelect ]->GetItemCode(), count_t( 10 ) ) );
|
|
/// else // 구입할 아이템 즉시 추가
|
|
/// m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SHOP_BUYITEM_TOKART( m_vecBuyItemList[ m_nCurrentSelect ]->GetItemCode(), count_t( 1 ) ) );
|
|
/// */
|
|
///
|
|
/// m_pGameManager->PostMsgAtDynamic(new SIMSG_UI_SHOP_BUYITEM_TOKART_CRAFT(m_vecBuyItemList[m_nCurrentSelect]->GetItemCode() , count_t(1) ,
|
|
/// m_vecBuyItemList[m_nCurrentSelect]->Getitems_1(), m_vecBuyItemList[m_nCurrentSelect]->Getcount_1(),
|
|
/// m_vecBuyItemList[m_nCurrentSelect]->Getitems_2(), m_vecBuyItemList[m_nCurrentSelect]->Getcount_2(),
|
|
/// m_vecBuyItemList[m_nCurrentSelect]->Getitems_3(), m_vecBuyItemList[m_nCurrentSelect]->Getcount_3(),
|
|
/// m_vecBuyItemList[m_nCurrentSelect]->Getitems_4(), m_vecBuyItemList[m_nCurrentSelect]->Getcount_4(),
|
|
/// m_vecBuyItemList[m_nCurrentSelect]->Getitems_5(), m_vecBuyItemList[m_nCurrentSelect]->Getcount_5(),
|
|
/// m_vecBuyItemList[m_nCurrentSelect]->Getitems_6(), m_vecBuyItemList[m_nCurrentSelect]->Getcount_6(),
|
|
/// m_vecBuyItemList[m_nCurrentSelect]->Getitems_7(), m_vecBuyItemList[m_nCurrentSelect]->Getcount_7(),
|
|
/// m_vecBuyItemList[m_nCurrentSelect]->Getitems_8(), m_vecBuyItemList[m_nCurrentSelect]->Getcount_8(),
|
|
/// m_vecBuyItemList[m_nCurrentSelect]->Getitems_9(), m_vecBuyItemList[m_nCurrentSelect]->Getcount_9()
|
|
/// ));
|
|
///
|
|
/// }
|
|
/// }
|
|
///
|
|
/// m_pGameManager->StartSound( m_pDisplayInfo->GetMaterialSound( GetItemDB().GetMaterial( nItemCode ) ) );
|
|
///}
|
|
///
|
|
///void SUIShopWnd_CRAFT::MoveShoppingKartWindow()
|
|
///{
|
|
/// m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_MOVE( SIMSG_TOGGLE_UIWINDOW::UIWINDOW_SHOP_SUB_CRAFT, GetRect().right, GetRect().bottom ) );
|
|
///}
|
|
///
|
|
///void SUIShopWnd_CRAFT::SetBuyModeShoppingKartWindow()
|
|
///{
|
|
/// m_pGameManager->PostMsgAtDynamic( new SIMSG_UI_SHOP_BUYMODECHANGE( IsBuyMode() ) );
|
|
///}
|
|
///
|
|
///int SUIShopWnd_CRAFT::GetSlotSellItemIndex( int nSlotControlNum ) const
|
|
///{
|
|
/// if( 0 <= nSlotControlNum && nSlotControlNum < c_nMaxShopSlotCount )
|
|
/// {
|
|
/// int nInvenIndex = (nSlotControlNum + m_nSlotStartIndex);
|
|
///
|
|
/// if( 0 <= nInvenIndex && nInvenIndex < m_vecSellItemList.size() )
|
|
/// return nInvenIndex;
|
|
/// }
|
|
/// return (-1);
|
|
///}
|
|
///
|
|
///int SUIShopWnd_CRAFT::GetSlotBuyItemIndex( int nSlotControlNum ) const
|
|
///{
|
|
/// if( 0 <= nSlotControlNum && nSlotControlNum < c_nMaxShopSlotCount )
|
|
/// {
|
|
/// int nInvenIndex = (nSlotControlNum + m_nSlotStartIndex);
|
|
///
|
|
/// if( 0 <= nInvenIndex && nInvenIndex < m_vecBuyItemList.size() )
|
|
/// return nInvenIndex;
|
|
/// }
|
|
/// return (-1);
|
|
///}
|
|
///
|
|
///SInventorySlot* SUIShopWnd_CRAFT::GetSlotSellItem( int nSlotControlNum ) const
|
|
///{
|
|
/// int nInvenIndex = GetSlotSellItemIndex( nSlotControlNum );
|
|
///
|
|
/// return ((-1) != nInvenIndex) ? m_vecSellItemList[ nInvenIndex ] : NULL;
|
|
///}
|
|
///
|
|
///SShopSlot_CRAFT* SUIShopWnd_CRAFT::GetSlotBuyItem( int nSlotControlNum ) const
|
|
///{
|
|
/// int nInvenIndex = GetSlotBuyItemIndex( nSlotControlNum );
|
|
///
|
|
/// return ((-1) != nInvenIndex) ? m_vecBuyItemList[ nInvenIndex ] : NULL;
|
|
///}
|
|
///
|
|
///bool SUIShopWnd_CRAFT::IsBuyMode() const
|
|
///{
|
|
/// /*
|
|
/// KUIControlButtonCheck* pBtnBuy = dynamicCast<KUIControlButtonCheck*>(GetChild("button_buy"));
|
|
/// if( !pBtnBuy ) return false;
|
|
///
|
|
/// return pBtnBuy->GetCheck();
|
|
/// */
|
|
///
|
|
/// return true;
|
|
///}
|
|
///
|
|
///int SUIShopWnd_CRAFT::GetSlotControlNum( const char* szSlotControlID ) const
|
|
///{
|
|
/// for( int nIndex( 0 ); nIndex < c_nMaxShopSlotCount; ++nIndex )
|
|
/// {
|
|
/// if( 0 == ::_stricmp( m_pSlotControlIDs[ nIndex ].strIconControl.c_str(), szSlotControlID ) )
|
|
/// return nIndex;
|
|
/// }
|
|
/// return (-1);
|
|
///}
|
|
///
|
|
///namespace
|
|
///{
|
|
/// const char* c_szStaticWt = "static_wt";
|
|
/// const char* c_szStaticRupy = "static_rupy";
|
|
///};
|
|
///
|
|
///static void SetItemControl( SUIDisplayInfo* pDisplayInfo,
|
|
/// KUIControlMultiIcon* pIcon,
|
|
/// KUIWnd* pName,
|
|
/// KUIWnd* pCount,
|
|
/// ItemBase::ItemCode nItemCode,
|
|
/// int nLevel,
|
|
/// int nEnhance,
|
|
/// int nFlag,
|
|
/// int remain_time,
|
|
/// int* pLevel,
|
|
/// count_t nCount,
|
|
/// int nSummonID,
|
|
/// char elemental_effect_type = 0,
|
|
/// int elemental_effect_remain_time = 0,
|
|
/// int elemental_effect_attack_point = 0,
|
|
/// int elemental_effect_magic_point = 0,
|
|
/// int ethereal_durability = 0,
|
|
/// int endurance = 0,
|
|
/// int etherealDurability = -1,
|
|
/// TS_ITEM_BASE_INFO::AwakenOption* pAwakenOption = NULL,
|
|
/// TS_ITEM_BASE_INFO::RANDOM_OPTION* pRandomOption = NULL,
|
|
/// int nAdditionalItemEffect = 0) // Fraun Sky Accessories 7/12/2025
|
|
///{
|
|
/// XFlag<int> itemFlag;
|
|
/// itemFlag.CopyFrom( &nFlag );
|
|
/// const ItemBaseEx_info * pItemBase = GetItemDB().GetItemData( nItemCode );
|
|
///
|
|
/// if( pItemBase == NULL ) return;
|
|
///
|
|
///// pIcon->SetIcon( 0, c_szDEF_SPR_NAME, (itemFlag.IsOn( ItemInstance::ITEM_FLAG_CARD ) ? "static_common_skillcardicon" : pItemBase->pIcon_name ) );
|
|
/// // 2010.07.06 - prodongi
|
|
/// std::string iconName;
|
|
/// getIconNameAtDurability(nItemCode, nEnhance, etherealDurability, iconName);
|
|
/// //pIcon->SetIcon( 0, c_szDEF_SPR_NAME, pItemBase->pIcon_name );
|
|
/// /// 2011.08.03 - prodongi
|
|
/// if( !setSkillCardIcon(pIcon, nItemCode) && !setSummonCardIcon( pIcon, nItemCode, nSummonID, nEnhance, nFlag, etherealDurability ) )
|
|
/// {
|
|
/// pIcon->SetIcon(0, c_szDEF_SPR_NAME, iconName.c_str());
|
|
/// pIcon->SetIcon(2);
|
|
/// pIcon->SetIcon(3);
|
|
/// pIcon->SetIcon(4);
|
|
/// pIcon->SetIcon(5);
|
|
/// pIcon->SetIcon(6);
|
|
/// pIcon->SetIcon(7);
|
|
/// }
|
|
///
|
|
/// pIcon->SetIcon( 1, c_szDEF_SPR_NAME, itemFlag.IsOn( ItemInstance::ITEM_FLAG_CARD ) ? "static_common_useunitcardicon" : NULL );
|
|
///
|
|
/// EquipItemAddtionalIconSetter icon_setter( pIcon, nItemCode, nEnhance, ethereal_durability, itemFlag );
|
|
///
|
|
/// pIcon->SetTooltip( pDisplayInfo->GetItemTooltipText( nItemCode,
|
|
/// true,
|
|
/// nEnhance,
|
|
/// nLevel,
|
|
/// itemFlag,
|
|
/// remain_time,
|
|
/// pLevel,
|
|
/// 0,
|
|
/// 0,
|
|
/// 0,
|
|
/// elemental_effect_type,
|
|
/// elemental_effect_remain_time,
|
|
/// elemental_effect_attack_point,
|
|
/// elemental_effect_magic_point,
|
|
/// true,
|
|
/// ethereal_durability,
|
|
/// endurance,
|
|
/// 0,
|
|
/// nSummonID,
|
|
/// false,
|
|
/// false,
|
|
/// 0,
|
|
/// pAwakenOption,
|
|
/// pRandomOption,
|
|
/// 0,
|
|
/// 0).c_str() // Fraun Sky Accessories 7/12/2025
|
|
/// );
|
|
///
|
|
///
|
|
///
|
|
/// pName->SetCaption( CStringUtil::StringFormat( "<size:10><#fbe6ad><b>%s", pDisplayInfo->GetItemName( nItemCode, true, nEnhance, nLevel, itemFlag, false, 0, false, pRandomOption ).c_str() ).c_str() );
|
|
///
|
|
/// if( pCount )
|
|
/// {
|
|
/// if( pItemBase->CheckFlag( ItemBase::FLAG_JOIN ) && !IsInstanceUnstackable(itemFlag) )
|
|
/// {
|
|
/// pCount->SetCaption( CStringUtil::StringFormat( "<RIGHT><shadow>%I64d", (nCount > 0 ) ? nCount.getAmount() : 0 ).c_str() );
|
|
/// pCount->SetShow( ( nCount > 0 ) ? true : false );
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// pCount->SetShow( false );
|
|
/// }
|
|
/// }
|
|
///}
|
|
///
|
|
///
|
|
///
|
|
///
|
|
//////////////// KART
|
|
///
|
|
///
|
|
///SUIShopKartWnd_CRAFT::SUIShopKartWnd_CRAFT(SGameManager* pGameManager, SUIDisplayInfo* pDisplayInfo)
|
|
/// : SUIWnd(pGameManager), m_pDisplayInfo(pDisplayInfo)
|
|
/// , m_nSlotStartIndex(0)
|
|
/// , m_bIsShop(true)
|
|
/// , m_bBuyMode(true)
|
|
/// , m_ReserveState(KART_NO_RESERVE)
|
|
/// , m_ReserveBuyItemID(0)
|
|
/// , m_ReserveSellItemHandle(NULL)
|
|
/// , m_bCtrlKey(false)
|
|
/// , m_bShiptKey(false)
|
|
/// , m_nCurrentSelect(-1)
|
|
/// , m_bAct(FALSE)
|
|
/// , m_PrevProcessTime(0)
|
|
///{
|
|
/// m_pSlotControlIDs = new SLOT_INFO[c_nMaxKartSlotCount];
|
|
///
|
|
/// for (int n(0); n < c_nMaxKartSlotCount; ++n)
|
|
/// {
|
|
/// std::string strNum = CStringUtil::StringFormat("%02d", n);
|
|
/// m_pSlotControlIDs[n].strIconControl = c_szIconControl + strNum;
|
|
/// m_pSlotControlIDs[n].strStaticNameControl = c_szStaticNameControl + strNum;
|
|
/// m_pSlotControlIDs[n].strStaticCountControl = c_szStaticCountControl + strNum;
|
|
/// m_pSlotControlIDs[n].strStaticPriceControl = c_szStaticPriceControl + strNum;
|
|
/// m_pSlotControlIDs[n].strStaticUnitControl = c_szStaticUnitControl + strNum;
|
|
/// }
|
|
///}
|
|
///
|
|
///SUIShopKartWnd_CRAFT::~SUIShopKartWnd_CRAFT()
|
|
///{
|
|
/// delete[] m_pSlotControlIDs;
|
|
///}
|
|
///
|
|
///bool SUIShopKartWnd_CRAFT::InitControls(KPoint kPos)
|
|
///{
|
|
/// //// 슬롯 icon 툴팁 스프라이트 설정, 클릭 영역 보정
|
|
/// //for( int nSlot( 0 ); nSlot < c_nMaxKartSlotCount; ++nSlot )
|
|
/// //{
|
|
/// // KUIControl* pItemIconControl = (KUIControl*)GetChild( m_pSlotControlIDs[ nSlot ].strIconControl.c_str() );
|
|
/// // if( NULL != pItemIconControl )
|
|
/// // pItemIconControl->SetCorrectionRect( KRect( 0, 0, c_nItemIconCorrection, 0 ) );
|
|
/// //}
|
|
///
|
|
/// {
|
|
/// RECT rc;
|
|
/// rc.left = 0; rc.top = c_nInvenWndResizeUnitY; rc.right = 0; rc.bottom = c_nInvenWndResizeUnitY;
|
|
/// int n = 0;
|
|
/// for (n = 0; n < c_nMaxKartSlotCount - 1; n++)
|
|
/// {
|
|
/// CopyControl(CStringUtil::StringFormat("icon_item%02d", n).c_str(), CStringUtil::StringFormat("icon_item%02d", n + 1).c_str(), rc);
|
|
/// CopyControl(CStringUtil::StringFormat("static_item%02d", n).c_str(), CStringUtil::StringFormat("static_item%02d", n + 1).c_str(), rc);
|
|
/// CopyControl(CStringUtil::StringFormat("static_itemcount%02d", n).c_str(), CStringUtil::StringFormat("static_itemcount%02d", n + 1).c_str(), rc);
|
|
/// CopyControl(CStringUtil::StringFormat("static_price%02d", n).c_str(), CStringUtil::StringFormat("static_price%02d", n + 1).c_str(), rc);
|
|
/// CopyControl(CStringUtil::StringFormat("text_unit%02d", n).c_str(), CStringUtil::StringFormat("text_unit%02d", n + 1).c_str(), rc);
|
|
/// }
|
|
///
|
|
/// for (n = 0; n < c_nMaxKartSlotCount; n++)
|
|
/// {
|
|
/// KUIControlMultiIcon* pIcon = dynamicCast<KUIControlMultiIcon*>(GetChild(CStringUtil::StringFormat("icon_item%02d", n).c_str()));
|
|
/// if (pIcon)
|
|
/// {
|
|
/// pIcon->SetIconLayer(10);
|
|
/// pIcon->SetCorrectionRect(KRect(0, 0, 200, 0));
|
|
/// }
|
|
/// }
|
|
/// }
|
|
///
|
|
/// SetChildCaption(c_szStaticWt, GetStringDB().GetString(STRING_WT));
|
|
/// SetChildCaption(c_szStaticRupy, GetStringDB().GetString(STRING_ITEMBUSINESSSHOP_TEXT));
|
|
///
|
|
/// return SUIWnd::InitControls(kPos);
|
|
///}
|
|
///bool SUIShopKartWnd_CRAFT::InitData(bool bReload)
|
|
///{
|
|
/// SetChildShow("static_select_over_back", false);
|
|
/// SetChildShow("static_select_over", false);
|
|
/// SetChildShow("icon_select_over", false);
|
|
///
|
|
/// SetChildAsTop("icon_select_over");
|
|
///
|
|
/// return SUIWnd::InitData(bReload);
|
|
///}
|
|
///void SUIShopKartWnd_CRAFT::OnNotifyUIWindowOpen(bool bOpen, bool bLimitWnd)
|
|
///{
|
|
/// SUIWnd::OnNotifyUIWindowOpen(bOpen);
|
|
///
|
|
/// if (bOpen)
|
|
/// {
|
|
/// m_bAct = FALSE;
|
|
/// m_KartBuyItemsVector.clear();
|
|
/// m_KartSellItemsVector.clear();
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// }
|
|
///}
|
|
///
|
|
///void* SUIShopKartWnd_CRAFT::Perform(KID id, KArg& msg)
|
|
///{
|
|
/// _CID(UI_BEGIN_DRAG);
|
|
/// _CID(UI_SEND_DROP);
|
|
/// _CID(UI_RECV_DROP);
|
|
///
|
|
/// if (id == id_UI_BEGIN_DRAG)
|
|
/// {
|
|
/// KUIBeginDragMessage* pBeginMsg = static_cast<KUIBeginDragMessage*>(&msg);
|
|
/// const char* szControlID = pBeginMsg->sDragControlID.c_str();
|
|
///
|
|
/// KUIWnd* pWnd = GetChild(szControlID);
|
|
/// if (NULL != pWnd)
|
|
/// {
|
|
/// int nKartItemIndex = IsBuyMode()
|
|
/// ? GetSlotKartBuyItemIndex(GetSlotControlNum(szControlID))
|
|
/// : GetSlotKartSellItemIndex(GetSlotControlNum(szControlID));
|
|
///
|
|
/// if ((-1) != nKartItemIndex)
|
|
/// {
|
|
/// m_pDisplayInfo->SetUIDragInfo(new SUIShoppingKartDragInfo(IsBuyMode(), nKartItemIndex));
|
|
/// m_pDragAndDropIcon->SetStateIcon(pWnd->GetSprName(), pWnd->GetAniName(), pWnd->GetFrameIndex(), STATE_NORMAL);
|
|
///
|
|
/// pBeginMsg->pDragAndDropRenderer = m_pDragAndDropIcon;
|
|
/// }
|
|
/// }
|
|
/// return NULL;
|
|
/// }
|
|
/// else if (id == id_UI_SEND_DROP)
|
|
/// {
|
|
/// KUISendRecvDropMessage* pSendMsg = static_cast<KUISendRecvDropMessage*>(&msg);
|
|
///
|
|
/// SUIDragInfo* pUIDragInfo = m_pDisplayInfo->GetUIDragInfo();
|
|
/// if (NULL != pUIDragInfo)
|
|
/// {
|
|
/// // 동일한 창이 아닌 곳에 드롭했다면
|
|
/// if (pSendMsg->sRecvDropParentID != std::string(GetID()))
|
|
/// {
|
|
/// if (SUIDragInfo::DRAGTYPE_SHOPPINGKART == pUIDragInfo->m_type)
|
|
/// {
|
|
/// SUIShoppingKartDragInfo* pShopKartDragInfo = (SUIShoppingKartDragInfo*)pUIDragInfo;
|
|
/// if (pShopKartDragInfo->m_bBuyMode)
|
|
/// {
|
|
/// // 구입할 아이템을 찾아서 제거한다.
|
|
/// RemoveBuyItem(pShopKartDragInfo->m_nIndex);
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// // 판매할 아이템을 찾아서 제거한다.
|
|
/// RemoveSellItem(pShopKartDragInfo->m_nIndex);
|
|
/// }
|
|
/// }
|
|
/// }
|
|
/// // Drag & Drop 정보 제거
|
|
/// m_pDisplayInfo->SetUIDragInfo();
|
|
/// }
|
|
/// return NULL;
|
|
/// }
|
|
/// else if (id == id_UI_RECV_DROP)
|
|
/// {
|
|
/// KUISendRecvDropMessage* pRecvMsg = static_cast<KUISendRecvDropMessage*>(&msg);
|
|
///
|
|
/// SUIDragInfo* pUIDragInfo = m_pDisplayInfo->GetUIDragInfo();
|
|
/// if (NULL != pUIDragInfo)
|
|
/// {
|
|
/// switch (pUIDragInfo->m_type)
|
|
/// {
|
|
/// case SUIDragInfo::DRAGTYPE_BOOTH:
|
|
/// {
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// }
|
|
/// }
|
|
/// return NULL;
|
|
/// }
|
|
/// return SUIWnd::Perform(id, msg);
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::PumpUpMessage(LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam)
|
|
///{
|
|
/// switch (nMessage)
|
|
/// {
|
|
/// case KUI_MESSAGE::KICON_PRESSING:
|
|
/// {
|
|
/// int nIndex = GetSlotControlNum(lpszControlID);
|
|
/// if (nIndex != -1)
|
|
/// {
|
|
/// KUIWnd* pWnd = GetChild(lpszControlID);
|
|
/// if (pWnd)
|
|
/// {
|
|
/// KUIWnd* pWnd01 = GetChild("static_select_over_back");
|
|
/// KUIWnd* pWnd02 = GetChild("static_select_over");
|
|
/// KUIWnd* pWnd03 = GetChild("icon_select_over");
|
|
///
|
|
/// const KRect& rIconRect = pWnd->GetRect();
|
|
/// if (pWnd01) { pWnd01->MovePos(rIconRect.left, rIconRect.top - 3); pWnd01->SetShow(true); }
|
|
/// if (pWnd02) { pWnd02->MovePos(rIconRect.left, rIconRect.top - 3); pWnd02->SetShow(true); }
|
|
/// if (pWnd03) { pWnd03->MovePos(rIconRect.left, rIconRect.top); pWnd03->SetShow(true); }
|
|
/// }
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// SetChildShow("static_select_over_back", false);
|
|
/// SetChildShow("static_select_over", false);
|
|
/// SetChildShow("icon_select_over", false);
|
|
/// }
|
|
///
|
|
/// int nInvenIndex = IsBuyMode()
|
|
/// ? GetSlotKartBuyItemIndex(GetSlotControlNum(lpszControlID))
|
|
/// : GetSlotKartSellItemIndex(GetSlotControlNum(lpszControlID));
|
|
///
|
|
/// if ((-1) != nInvenIndex)
|
|
/// {
|
|
/// if (m_nSlotStartIndex <= nInvenIndex && nInvenIndex < (m_nSlotStartIndex + c_nMaxKartSlotCount))
|
|
/// m_nCurrentSelect = nInvenIndex;
|
|
/// }
|
|
///
|
|
/// if (m_bCtrlKey || m_bShiptKey)
|
|
/// {
|
|
/// if (IsBuyMode())
|
|
/// RemoveBuyItem(nInvenIndex);
|
|
/// else RemoveSellItem(nInvenIndex);
|
|
/// }
|
|
/// }
|
|
/// break;
|
|
/// case KUI_MESSAGE::KBUTTON_CLICK:
|
|
/// {
|
|
/// if (0 == ::_stricmp(lpszControlID, c_szButtonBuySell))
|
|
/// {
|
|
/// if (IsBuyMode())
|
|
/// ShopBuyOrder(); // 구입
|
|
/// else
|
|
/// ShopSellOrder(); // 판매
|
|
/// }
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case KUI_MESSAGE::KICON_DBLCLK:
|
|
/// {
|
|
/// //m_pGameManager->PlaySound( "iconClick_iconmove_target.wav" );
|
|
///
|
|
/// if (!m_bCtrlKey && !m_bShiptKey)
|
|
/// {
|
|
/// int nInvenIndex(-1);
|
|
/// if (IsBuyMode())
|
|
/// {
|
|
/// nInvenIndex = GetSlotKartBuyItemIndex(GetSlotControlNum(lpszControlID));
|
|
/// RemoveBuyItem(nInvenIndex);
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// nInvenIndex = GetSlotKartSellItemIndex(GetSlotControlNum(lpszControlID));
|
|
/// RemoveSellItem(nInvenIndex);
|
|
/// }
|
|
/// }
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case KUI_MESSAGE::KSCROLL_SELECT:
|
|
/// {
|
|
/// m_nSlotStartIndex = int(lparam);
|
|
/// RefreshSlots();
|
|
/// }
|
|
/// break;
|
|
/// }
|
|
/// SUIWnd::PumpUpMessage(lpszControlID, nMessage, lparam, wparam);
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::ProcMsgAtStatic(SGameMessage* pMsg)
|
|
///{
|
|
/// switch (pMsg->nType)
|
|
/// {
|
|
/// case IMSG_UI_SEND_DATA:
|
|
/// {
|
|
/// if (static_cast<SIMSG_UI_SEND_DATA*>(pMsg)->m_strString == "set_booth_mode")
|
|
/// {
|
|
/// m_bIsShop = !static_cast<SIMSG_UI_SEND_DATA*>(pMsg)->m_nNumber;
|
|
/// }
|
|
/// if (static_cast<SIMSG_UI_SEND_DATA*>(pMsg)->m_strString == "shopkart_clear")
|
|
/// {
|
|
/// m_KartBuyItemsVector.clear();
|
|
/// m_KartSellItemsVector.clear();
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// }
|
|
///
|
|
/// break;
|
|
/// }
|
|
/// case MSG_UPDATE_ITEM_COUNT:
|
|
/// case MSG_ITEM_DESTROY:
|
|
/// case MSG_ITEM_INVEN:
|
|
/// case MSG_ITEM_WEAR_INFO:
|
|
/// case MSG_BELT_SLOT_INFO: /// 2011.05.13 - prodongi
|
|
/// if (!IsBuyMode())
|
|
/// {
|
|
/// bool bRemoved = false;
|
|
///
|
|
/// KARTSELLITEM_VECTOR::iterator itItem = m_KartSellItemsVector.begin();
|
|
/// while (itItem != m_KartSellItemsVector.end())
|
|
/// {
|
|
/// SInventorySlot* pSlot = m_InventoryMgr.GetItemInfo((*itItem).handle);
|
|
/// /// 2011.05.13 벨트 슬롯 체크 - prodongi
|
|
/// if (pSlot && !pSlot->IsEquipItem() && !m_InventoryMgr.IsBeltSlotCard((*itItem).handle))
|
|
/// {
|
|
/// // 카트에 올려놓은 양보다 실제 인벤아이템의 양이 줄어있는 경우
|
|
/// if (pSlot->GetItemCount() < (*itItem).nItemCount)
|
|
/// (*itItem).nItemCount = pSlot->GetItemCount();
|
|
///
|
|
/// // 존재하고 장착하지 않은 것은 그대로 유지
|
|
/// itItem++;
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// // 없어졌거나 장착된 아이템은 카트에서 제거한다.
|
|
/// itItem = m_KartSellItemsVector.erase(itItem);
|
|
/// bRemoved = true;
|
|
/// }
|
|
/// }
|
|
/// if (bRemoved)
|
|
/// {
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// RefreshScrollBar();
|
|
/// }
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case MSG_MARKET:
|
|
/// RemoveAllKartItems();
|
|
/// break;
|
|
///
|
|
/// // 카트에 담기
|
|
/// case IMSG_UI_STORE_BUYITEM_TOKART:
|
|
/// {
|
|
/// m_bIsShop = false;
|
|
/// m_bBuyMode = true;
|
|
///
|
|
/// SIMSG_UI_STORE_BUYITEM_TOKART* pBuyToKartMsg = (SIMSG_UI_STORE_BUYITEM_TOKART*)pMsg;
|
|
/// AddBuyItem(
|
|
/// KART_BUYITEM(
|
|
/// pBuyToKartMsg->m_ItemInfo.Code,
|
|
/// pBuyToKartMsg->m_ItemInfo.summon_id,
|
|
/// pBuyToKartMsg->m_byCount,
|
|
/// pBuyToKartMsg->m_ItemInfo.enhance,
|
|
/// pBuyToKartMsg->m_ItemInfo.level,
|
|
/// pBuyToKartMsg->m_ItemInfo.Flag,
|
|
/// pBuyToKartMsg->m_ItemInfo.endurance,
|
|
/// pBuyToKartMsg->m_ItemInfo.socket,
|
|
/// pBuyToKartMsg->m_nIndex,
|
|
/// pBuyToKartMsg->m_ItemInfo.remain_time,
|
|
/// pBuyToKartMsg->m_ItemInfo.elemental_effect_type,
|
|
/// pBuyToKartMsg->m_ItemInfo.elemental_effect_remain_time,
|
|
/// pBuyToKartMsg->m_ItemInfo.elemental_effect_attack_point,
|
|
/// pBuyToKartMsg->m_ItemInfo.elemental_effect_magic_point,
|
|
/// pBuyToKartMsg->m_ItemInfo.ethereal_durability,
|
|
/// 0,
|
|
/// &(pBuyToKartMsg->m_ItemInfo.awakenoption),
|
|
/// &(pBuyToKartMsg->m_ItemInfo.random_option)
|
|
/// )
|
|
/// );
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// // Azia Mafia New Craft Systeme
|
|
/// //case IMSG_UI_SHOP_BUYITEM_TOKART_CRAFT:
|
|
/// // {
|
|
/// // m_bIsShop = true;
|
|
/// // m_bBuyMode = true;
|
|
/// //
|
|
/// // SIMSG_UI_SHOP_BUYITEM_TOKART_CRAFT* pBuyToKartMsg = (SIMSG_UI_SHOP_BUYITEM_TOKART_CRAFT*)pMsg;
|
|
/// // AddBuyItem(pBuyToKartMsg->m_ItemID, pBuyToKartMsg->m_byCount
|
|
/// // , pBuyToKartMsg->m_ItemID1, pBuyToKartMsg->m_byCount1
|
|
/// // , pBuyToKartMsg->m_ItemID2, pBuyToKartMsg->m_byCount2
|
|
/// // , pBuyToKartMsg->m_ItemID3, pBuyToKartMsg->m_byCount3
|
|
/// // , pBuyToKartMsg->m_ItemID4, pBuyToKartMsg->m_byCount4
|
|
/// // , pBuyToKartMsg->m_ItemID5, pBuyToKartMsg->m_byCount5
|
|
/// // , pBuyToKartMsg->m_ItemID6, pBuyToKartMsg->m_byCount6
|
|
/// // , pBuyToKartMsg->m_ItemID7, pBuyToKartMsg->m_byCount7
|
|
/// // , pBuyToKartMsg->m_ItemID8, pBuyToKartMsg->m_byCount8
|
|
/// // , pBuyToKartMsg->m_ItemID9, pBuyToKartMsg->m_byCount9
|
|
/// // );
|
|
/// // }
|
|
/// // break;
|
|
///
|
|
/// case MSG_PROPERTY:
|
|
/// {
|
|
/// SMSG_PROPERTY* pPropertyMsg = (SMSG_PROPERTY*)pMsg;
|
|
///
|
|
/// if (m_PlayerInfoMgr.IsLocalPlayer(pPropertyMsg->handle))
|
|
/// {
|
|
/// switch (pPropertyMsg->nPropertyType)
|
|
/// {
|
|
/// case SMSG_PROPERTY::PROPERTY_WEIGHT:
|
|
/// RefreshGoldAndWeight();
|
|
/// break;
|
|
/// }
|
|
/// }
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case MSG_RESULT:
|
|
/// {
|
|
/// SMSG_RESULT* pResultMsg = (SMSG_RESULT*)pMsg;
|
|
/// int nGroupID = -1;
|
|
/// switch (pResultMsg->request_msg_id)
|
|
/// {
|
|
/// case TM_CS_BUY_FROM_BOOTH:
|
|
/// if (pResultMsg->result == RESULT_SUCCESS)
|
|
/// RemoveAllKartItems();
|
|
/// break;
|
|
/// case TM_CS_SELL_TO_BOOTH:
|
|
/// if (pResultMsg->result == RESULT_SUCCESS)
|
|
/// RemoveAllKartItems();
|
|
/// break;
|
|
/// }
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case IMSG_UI_MOVE:
|
|
/// {
|
|
/// SIMSG_UI_MOVE* pMoveMsg = (SIMSG_UI_MOVE*)pMsg;
|
|
///
|
|
/// MovePos(pMoveMsg->m_nX, pMoveMsg->m_nY - GetRect().GetHeight());
|
|
/// pMsg->bUse = true;
|
|
/// }
|
|
/// break;
|
|
///
|
|
/// case IMSG_UI_SHOP_BUYMODECHANGE:
|
|
/// {
|
|
/// m_bBuyMode = ((SIMSG_UI_SHOP_BUYMODECHANGE*)pMsg)->m_bBuyMode;
|
|
/// RemoveAllKartItems();
|
|
///
|
|
/// pMsg->bUse = true;
|
|
/// }
|
|
/// break;
|
|
/// case IMSG_HOTKEY_EX:
|
|
/// {
|
|
/// SIMSG_HOTKEY_EX* pHotKey = dynamicCast<SIMSG_HOTKEY_EX*>(pMsg);
|
|
///
|
|
/// if (pHotKey->wParam == VK_CONTROL)
|
|
/// m_bCtrlKey = (pHotKey->bUp == 0);
|
|
/// if (pHotKey->wParam == VK_SHIFT)
|
|
/// m_bShiptKey = (pHotKey->bUp == 0);
|
|
/// if (pHotKey->wParam == VK_MENU)
|
|
/// {
|
|
/// bool bPreState = m_bAltKey;
|
|
/// m_bAltKey = (pHotKey->bUp == 0);
|
|
///
|
|
/// if (bPreState != m_bAltKey && IsShow())
|
|
/// {
|
|
/// RefreshSlots();
|
|
/// }
|
|
/// }
|
|
/// }
|
|
/// break;
|
|
/// case IMSG_UI_STORE_SELL_WARNING:
|
|
/// {
|
|
/// SIMSG_UI_STORE_SELL_WARNING* pSellWarning = dynamicCast<SIMSG_UI_STORE_SELL_WARNING*>(pMsg);
|
|
/// if (!pSellWarning->bOK)
|
|
/// ShopSellbyUser();
|
|
/// }
|
|
/// break;
|
|
/// }
|
|
///}
|
|
///
|
|
///SUIShopKartWnd_CRAFT::KARTBUYITEM_VECTOR::iterator SUIShopKartWnd_CRAFT::GetBuyItem(ItemBase::ItemCode ItemID)
|
|
///{
|
|
/// for (KARTBUYITEM_VECTOR::iterator itKartBuy = m_KartBuyItemsVector.begin(); itKartBuy != m_KartBuyItemsVector.end(); itKartBuy++)
|
|
/// if ((*itKartBuy).ItemID == ItemID) return itKartBuy;
|
|
///
|
|
/// return m_KartBuyItemsVector.end();
|
|
///}
|
|
///
|
|
///SUIShopKartWnd_CRAFT::KARTSELLITEM_VECTOR::iterator SUIShopKartWnd_CRAFT::GetSellItem(AR_HANDLE hItem)
|
|
///{
|
|
/// for (KARTSELLITEM_VECTOR::iterator itKartSell = m_KartSellItemsVector.begin(); itKartSell != m_KartSellItemsVector.end(); itKartSell++)
|
|
/// if ((*itKartSell).handle == hItem) return itKartSell;
|
|
///
|
|
/// return m_KartSellItemsVector.end();
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::CheckWeightOver(int nItemCode, count_t& nItemCnt)
|
|
///{
|
|
/// money_t nTotalPrice;
|
|
/// float fTotalWeight;
|
|
/// GetTotalPriceAndWeight(nTotalPrice, fTotalWeight);
|
|
///
|
|
/// fTotalWeight += m_PlayerInfoMgr.GetPlayerInfo().GetInvenWeigth();
|
|
///
|
|
/// int nMaxWeight = m_PlayerInfoMgr.GetPlayerInfo().GetWeight();
|
|
///
|
|
/// float fExtraWeight(0.0f);
|
|
/// if (!IsShop()) fExtraWeight = (float)nMaxWeight * 0.9f - fTotalWeight; //노점만 90%
|
|
/// else fExtraWeight = (float)nMaxWeight * 1.0f - fTotalWeight;
|
|
///
|
|
/// if (fExtraWeight <= 0)
|
|
/// {
|
|
/// if (!IsShop()) //노점일때만 메세지 출력
|
|
/// m_pGameManager->PostMsgAtDynamic(new SIMSG_REQ_OPEN_MSGBOX(SIMSG_REQ_OPEN_MSGBOX::MSGBOX_STORE_WEIGHT_OVER, S(952), true));
|
|
/// nItemCnt = count_t(0);
|
|
/// return;
|
|
/// }
|
|
///
|
|
/// // if( !IsShop() ) //노점일때만 메세지 출력
|
|
/// {
|
|
/// float fItemWeight = GetItemDB().GetWeight(nItemCode);
|
|
/// float fInputItemWeight = fItemWeight * nItemCnt.getAmount();
|
|
/// if (fInputItemWeight > fExtraWeight)
|
|
/// {
|
|
/// nItemCnt = count_t(fExtraWeight / fItemWeight);
|
|
/// std::string strErr = SR(951, "#@item_count@#", nItemCnt.getAmount());
|
|
/// m_pGameManager->PostMsgAtDynamic(new SIMSG_REQ_OPEN_MSGBOX(SIMSG_REQ_OPEN_MSGBOX::MSGBOX_STORE_WEIGHT_OVER, strErr.c_str(), true));
|
|
/// }
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::AddBuyItem(const KART_BUYITEM& itemInfo)
|
|
///{
|
|
/// if (0 == itemInfo.ItemID) return;
|
|
///
|
|
/// KART_BUYITEM ResultItemInfo = itemInfo;
|
|
/// if (IsBuyMode()) CheckWeightOver(itemInfo.ItemID, ResultItemInfo.nItemCount);
|
|
/// if (ResultItemInfo.nItemCount == 0) return;
|
|
///
|
|
/// // 중첩 가능한 아이템인 경우
|
|
/// if (GetItemDB().IsJoin(itemInfo.ItemID, false))
|
|
/// {
|
|
/// KARTBUYITEM_VECTOR::iterator itKartBuy = GetBuyItem(itemInfo.ItemID);
|
|
/// if (m_KartBuyItemsVector.end() != itKartBuy)
|
|
/// {
|
|
/// // 기존 아이템의 갯수를 증가시킨다.
|
|
/// count_t nTotalCount = (*itKartBuy).nItemCount + ResultItemInfo.nItemCount;
|
|
/// if (nTotalCount > c_nBuySellCountLimit) nTotalCount = count_t(c_nBuySellCountLimit);
|
|
///
|
|
/// (*itKartBuy).nItemCount = nTotalCount;
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// return;
|
|
/// }
|
|
/// }
|
|
///
|
|
/// // 이미 있는 아이템이면 KIN
|
|
/// if (itemInfo.nIndex != -1)
|
|
/// {
|
|
/// for (KARTBUYITEM_VECTOR::iterator itKartBuy = m_KartBuyItemsVector.begin(); itKartBuy != m_KartBuyItemsVector.end(); itKartBuy++)
|
|
/// {
|
|
/// if ((*itKartBuy).nIndex == itemInfo.nIndex) return;
|
|
/// }
|
|
/// }
|
|
///
|
|
/// // 카트에 추가
|
|
/// m_KartBuyItemsVector.push_back(ResultItemInfo);
|
|
///
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// RefreshScrollBar();
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::AddBuyItem(ItemBase::ItemCode ItemID, count_t nItemCount, ItemBase::ItemCode ItemID1, int nCount1, ItemBase::ItemCode ItemID2, int nCount2, ItemBase::ItemCode ItemID3, int nCount3, ItemBase::ItemCode ItemID4, int nCount4, ItemBase::ItemCode ItemID5, int nCount5, ItemBase::ItemCode ItemID6, int nCount6, ItemBase::ItemCode ItemID7, int nCount7, ItemBase::ItemCode ItemID8, int nCount8, ItemBase::ItemCode ItemID9, int nCount9)
|
|
///{
|
|
/// const ItemBaseEx_info* ItemInfo = GetItemDB().GetItemData(ItemID);
|
|
/// if (!ItemInfo)
|
|
/// return;
|
|
///
|
|
///
|
|
/// // sonador 3.9.5 상점 판매 크리처 봉인 카드 켑션 수정
|
|
/// int nItemFlag = 0;
|
|
/// if (ItemInfo)
|
|
/// nItemFlag = ItemInfo->status_flag;
|
|
///
|
|
/// //sfreer 상점 및 카트에 담긴 아이템 비정상적인 수치출력관련 버그 수정 2009.03.05
|
|
/// AddBuyItem(KART_BUYITEM(ItemID, ItemInfo->nSummonId, nItemCount, ItemInfo->enhance, ItemInfo->level, nItemFlag, 0, NULL, -1));
|
|
///
|
|
///}
|
|
///// Azia Mafia New Craft Systeme
|
|
///void SUIShopKartWnd_CRAFT::RemoveBuyItem(int nIndex)
|
|
///{
|
|
/// if (0 <= nIndex && nIndex < int(m_KartBuyItemsVector.size()))
|
|
/// {
|
|
/// int nitemID(0);
|
|
/// // 카트에서 삭제
|
|
/// if (m_KartBuyItemsVector[nIndex].nItemCount > 1)
|
|
/// {
|
|
/// if (m_bShiptKey)
|
|
/// {
|
|
/// m_ReserveState = KART_BUYITEM_RESERVE;
|
|
/// m_ReserveBuyItemID = m_KartBuyItemsVector[nIndex].ItemID;
|
|
/// nitemID = m_KartBuyItemsVector[nIndex].ItemID;
|
|
///
|
|
/// count_t nMaxCount = m_KartBuyItemsVector[nIndex].nItemCount;
|
|
/// m_pGameManager->PostMsgAtDynamic(new SIMSG_UI_REQ_INPUTNUMBER(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_SHOP_SUB_CRAFT, nMaxCount));//, SIMSG_UI_REQ_INPUTNUMBER::TYPE_NUMBER ) );
|
|
/// }
|
|
/// else if (m_bCtrlKey) //10개씩 증가
|
|
/// {
|
|
/// if (m_KartBuyItemsVector[nIndex].nItemCount > 10)
|
|
/// m_KartBuyItemsVector[nIndex].nItemCount -= count_t(10);
|
|
/// else m_KartBuyItemsVector.erase(m_KartBuyItemsVector.begin() + nIndex);
|
|
/// }
|
|
/// else // 아이템 즉시 추가
|
|
/// m_KartBuyItemsVector[nIndex].nItemCount--;
|
|
/// }
|
|
/// else if (m_KartBuyItemsVector[nIndex].nItemCount == 1)
|
|
/// m_KartBuyItemsVector.erase(m_KartBuyItemsVector.begin() + nIndex);
|
|
/// else //아이템이 0개인데 어떻게 vector에 등록되있는감...
|
|
/// {
|
|
/// }
|
|
///
|
|
/// // m_KartBuyItemsVector.erase( m_KartBuyItemsVector.begin() + nIndex );
|
|
///
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// RefreshScrollBar();
|
|
///
|
|
/// m_pGameManager->StartSound(m_pDisplayInfo->GetMaterialSound(m_pDisplayInfo->GetMaterial_code(nitemID)));
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::RemoveBuyItem(int nIndex, count_t nCount)
|
|
///{
|
|
/// if (0 <= nIndex && nIndex < int(m_KartBuyItemsVector.size()))
|
|
/// {
|
|
/// // 카트에서 삭제
|
|
/// if (m_KartBuyItemsVector[nIndex].nItemCount > nCount)
|
|
/// {
|
|
/// m_KartBuyItemsVector[nIndex].nItemCount -= nCount;
|
|
/// }
|
|
/// else if (m_KartBuyItemsVector[nIndex].nItemCount <= nCount)
|
|
/// m_KartBuyItemsVector.erase(m_KartBuyItemsVector.begin() + nIndex);
|
|
/// else //아이템이 0개인데 어떻게 vector에 등록되있는감...
|
|
/// {
|
|
/// }
|
|
///
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// RefreshScrollBar();
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::AddSellItem(AR_HANDLE hItem, count_t nItemCount, int index)
|
|
///{
|
|
/// SInventorySlot* pSlot = m_InventoryMgr.GetItemInfo(hItem);
|
|
/// if (NULL != pSlot)
|
|
/// {
|
|
/// // 임시 !!! ... 소환카드는 팔 수 없게 함 .. ( 현재 서버도 임시 처리중 .. )
|
|
/// //if( ItemBase::GROUP_SUMMONCARD != GetItemDB().GetGroup( pItem->nID ) )
|
|
/// //{
|
|
///
|
|
/// count_t SellCount = nItemCount;
|
|
/// //팔고자 하는 아이템수보다 팔려는 아이템이 많으면 안되지...
|
|
/// if (!IsShop() && index != -1) //개인상점이 아닌 일반 npc상점에서는 index값이 -1이다.
|
|
/// {
|
|
/// SellCount = SStoreMgr::GetInstance().GetItemCount(index);
|
|
/// nItemCount = (SellCount < nItemCount) ? SellCount : nItemCount;
|
|
/// }
|
|
///
|
|
/// // 동일한 아이템이 이미 있는 경우
|
|
/// KARTSELLITEM_VECTOR::iterator itKartSell = GetSellItem(hItem);
|
|
/// if (m_KartSellItemsVector.end() != itKartSell)
|
|
/// {
|
|
/// // 중첩 가능한 아이템인 경우
|
|
/// if (GetItemDB().IsJoin(pSlot->GetItemCode(), IsInstanceUnstackable(pSlot)))
|
|
/// {
|
|
/// // 기존 아이템의 개수를 증가시킨다.
|
|
/// count_t nTotalCount = (*itKartSell).nItemCount + nItemCount;
|
|
/// if (!IsShop()) //노점에서 사려는 아이템 수보다 많이 팔 수 없으니 체크
|
|
/// if (nTotalCount > SellCount) nTotalCount = SellCount;
|
|
/// if (nTotalCount > pSlot->GetItemCount()) nTotalCount = pSlot->GetItemCount(); // 갖고있는 아이템의 전체 갯수보다 커지지 않도록 조정
|
|
/// if (nTotalCount > c_nBuySellCountLimit) nTotalCount = count_t(c_nBuySellCountLimit);
|
|
///
|
|
/// (*itKartSell).nItemCount = nTotalCount;
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// }
|
|
/// }
|
|
/// // 처음으로 추가하는 경우
|
|
/// else
|
|
/// {
|
|
/// // 중첩 가능한 아이템인 경우
|
|
/// if (GetItemDB().IsJoin(pSlot->GetItemCode(), IsInstanceUnstackable(pSlot)))
|
|
/// {
|
|
/// // 갖고있는 아이템의 전체 갯수보다 커지지 않도록 조정
|
|
/// if (nItemCount > pSlot->GetItemCount()) nItemCount = pSlot->GetItemCount();
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// // 한개만 가능
|
|
/// if (nItemCount > 1) nItemCount = count_t(1);
|
|
/// }
|
|
///
|
|
/// // 카트에 추가
|
|
/// m_KartSellItemsVector.push_back(KART_SELLITEM(hItem, nItemCount, index));
|
|
///
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// RefreshScrollBar();
|
|
/// }
|
|
/// //}
|
|
/// //else
|
|
/// // m_pGameManager->PostMsgAtDynamic( new SIMSG_REQ_OPEN_MSGBOX( SIMSG_REQ_OPEN_MSGBOX::MSGBOX_GENERAL, SYS_MSG_INVEN_NOTHROWITEM, true ) );
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::RemoveSellItem(int nIndex)
|
|
///{
|
|
/// if (0 <= nIndex && nIndex < int(m_KartSellItemsVector.size()))
|
|
/// {
|
|
/// int nHandle(0);
|
|
/// // 카트에서 삭제
|
|
/// if (m_KartSellItemsVector[nIndex].nItemCount > 1)
|
|
/// {
|
|
/// if (m_bShiptKey)
|
|
/// {
|
|
/// m_ReserveState = KART_SELLITEM_RESERVE;
|
|
/// m_ReserveSellItemHandle = m_KartSellItemsVector[nIndex].handle;
|
|
/// nHandle = m_KartSellItemsVector[nIndex].handle;
|
|
///
|
|
/// count_t nMaxCount = m_KartSellItemsVector[nIndex].nItemCount;
|
|
/// m_pGameManager->PostMsgAtDynamic(new SIMSG_UI_REQ_INPUTNUMBER(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_SHOP_SUB_CRAFT, nMaxCount));//, SIMSG_UI_REQ_INPUTNUMBER::TYPE_NUMBER ) );
|
|
/// }
|
|
/// else if (m_bCtrlKey) //10개씩 증가
|
|
/// {
|
|
/// if (m_KartSellItemsVector[nIndex].nItemCount > 10)
|
|
/// m_KartSellItemsVector[nIndex].nItemCount -= count_t(10);
|
|
/// else m_KartSellItemsVector.erase(m_KartSellItemsVector.begin() + nIndex);
|
|
/// }
|
|
/// else // 아이템 즉시 추가
|
|
/// m_KartSellItemsVector[nIndex].nItemCount--;
|
|
/// }
|
|
/// else if (m_KartSellItemsVector[nIndex].nItemCount == 1)
|
|
/// m_KartSellItemsVector.erase(m_KartSellItemsVector.begin() + nIndex);
|
|
/// else //아이템이 0개인데 어떻게 vector에 등록되있는감...
|
|
/// {
|
|
/// }
|
|
///
|
|
/// // m_KartSellItemsVector.erase( m_KartSellItemsVector.begin() + nIndex );
|
|
///
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// RefreshScrollBar();
|
|
///
|
|
/// m_pGameManager->StartSound(m_pDisplayInfo->GetMaterialSound(m_pDisplayInfo->GetMaterial(nHandle)));
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::RemoveSellItem(int nIndex, count_t nCount)
|
|
///{
|
|
/// if (0 <= nIndex && nIndex < int(m_KartSellItemsVector.size()))
|
|
/// {
|
|
/// // 카트에서 삭제
|
|
/// if (m_KartSellItemsVector[nIndex].nItemCount > nCount)
|
|
/// {
|
|
/// m_KartSellItemsVector[nIndex].nItemCount -= nCount;
|
|
/// }
|
|
/// else if (m_KartSellItemsVector[nIndex].nItemCount <= nCount)
|
|
/// m_KartSellItemsVector.erase(m_KartSellItemsVector.begin() + nIndex);
|
|
/// else //아이템이 0개인데 어떻게 vector에 등록되있는감...
|
|
/// {
|
|
/// }
|
|
///
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// RefreshScrollBar();
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::RemoveAllKartItems()
|
|
///{
|
|
/// m_KartBuyItemsVector.clear();
|
|
/// m_KartSellItemsVector.clear();
|
|
///
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// RefreshScrollBar();
|
|
/// m_bAct = FALSE;
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::StoreBuyOrder()
|
|
///{
|
|
/// // SIMSG_UI_ACT_BUYITEMS_FROM_STORE
|
|
/// if (0 < m_KartBuyItemsVector.size())
|
|
/// {
|
|
/// money_t nTotalPrice;
|
|
/// float fTotalWeight;
|
|
/// GetTotalPriceAndWeight(nTotalPrice, fTotalWeight);
|
|
///
|
|
/// if (nTotalPrice <= m_PlayerInfoMgr.GetPlayerInfo().GetGold())
|
|
/// {
|
|
/// SIMSG_UI_ACT_BUYITEMS buyMsg;
|
|
///
|
|
/// for (KARTBUYITEM_VECTOR::iterator itKartBuy = m_KartBuyItemsVector.begin(); itKartBuy != m_KartBuyItemsVector.end(); itKartBuy++)
|
|
/// buyMsg.vtBuyItems.push_back(SIMSG_UI_ACT_BUYITEMS::BuyItemInfo((*itKartBuy).ItemID, (*itKartBuy).nItemCount));
|
|
///
|
|
/// m_pGameManager->ProcMsgAtStatic(&buyMsg);
|
|
///
|
|
/// RemoveAllKartItems();
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// int nGroupID = GetStringDB().GetGroupID(283);
|
|
/// m_pDisplayInfo->AddSystemMessage(S(283), nGroupID);
|
|
/// }
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::ShopBuyOrder()
|
|
///{
|
|
/// if (m_KartBuyItemsVector.empty()) return;
|
|
///
|
|
/// money_t nTotalPrice;
|
|
/// float fTotalWeight;
|
|
/// GetTotalPriceAndWeight(nTotalPrice, fTotalWeight);
|
|
///
|
|
/// if (nTotalPrice > m_PlayerInfoMgr.GetPlayerInfo().GetGold())
|
|
/// {
|
|
/// int nGroupID = GetStringDB().GetGroupID(283);
|
|
/// m_pDisplayInfo->AddSystemMessage(S(283), nGroupID);
|
|
/// return;
|
|
/// }
|
|
///
|
|
/// if (IsShop())
|
|
/// {
|
|
/// m_bAct = TRUE;
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// SIMSG_UI_ACT_BUYITEMS_FROM_STORE msg;
|
|
/// msg.hTarget = SStoreMgr::GetInstance().GetTargetHandle();
|
|
/// for (KARTBUYITEM_VECTOR::iterator itKartBuy = m_KartBuyItemsVector.begin(); itKartBuy != m_KartBuyItemsVector.end(); itKartBuy++)
|
|
/// {
|
|
/// if (((*itKartBuy).nIndex != -1) && (*itKartBuy).ItemID && (*itKartBuy).nItemCount.getAmount())
|
|
/// msg.vList.push_back(
|
|
/// TS_SC_WATCH_BOOTH::TS_BOOTH_ITEM_INFO(
|
|
/// SStoreMgr::GetInstance().GetItemHandle((*itKartBuy).nIndex),
|
|
/// (*itKartBuy).ItemID,
|
|
/// (*itKartBuy).nItemCount.getAmount(),
|
|
/// SStoreMgr::GetInstance().GetItemPrice((*itKartBuy).nIndex).getAmount(),
|
|
/// (*itKartBuy).nLevel,
|
|
/// (*itKartBuy).nEnhance,
|
|
/// (*itKartBuy).nEndurance,
|
|
/// (*itKartBuy).nFlag,
|
|
/// (*itKartBuy).nSocket,
|
|
/// (*itKartBuy).elemental_effect_type,
|
|
/// (*itKartBuy).elemental_effect_attack_point,
|
|
/// (*itKartBuy).elemental_effect_magic_point,
|
|
/// (*itKartBuy).ethereal_durability,
|
|
/// (*itKartBuy).appearanceCode,
|
|
/// (*itKartBuy).stAwakenOption,
|
|
/// (*itKartBuy).stRandomOption,
|
|
/// (*itKartBuy).nSummonID,
|
|
/// (*itKartBuy).nAdditionalItemEffect // Fraun Sky Accessories 7/12/2025
|
|
/// )
|
|
/// );
|
|
/// }
|
|
/// if (!msg.vList.empty())
|
|
/// m_pGameManager->ProcMsgAtStatic(&msg);
|
|
///
|
|
/// m_pGameManager->PostMsgAtDynamic(new SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_INPUTNUMBER, false));
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::ShopSellbyUser()
|
|
///{
|
|
/// if (IsShop()) return;
|
|
///
|
|
/// SIMSG_UI_ACT_SELLITEMS_TO_STORE msg;
|
|
/// SIMSG_UI_ACT_SELLITEMS_TO_STORE::SellItemToStoreInfo SellInfo;
|
|
/// for (KARTSELLITEM_VECTOR::iterator itKartSell = m_KartSellItemsVector.begin(); itKartSell != m_KartSellItemsVector.end(); itKartSell++)
|
|
/// {
|
|
/// SellInfo.target = SStoreMgr::GetInstance().GetTargetHandle();
|
|
/// SellInfo.item_handle = (*itKartSell).handle;
|
|
/// SellInfo.cnt = (*itKartSell).nItemCount;
|
|
/// msg.vList.push_back(SellInfo);
|
|
/// }
|
|
/// if (!msg.vList.empty())
|
|
/// m_pGameManager->ProcMsgAtStatic(&msg);
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::ShopSellOrder()
|
|
///{
|
|
/// if (IsShop())
|
|
/// {
|
|
/// m_bAct = TRUE;
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// m_pGameManager->PostMsgAtDynamic(new SIMSG_REQ_OPEN_MSGBOX(SIMSG_REQ_OPEN_MSGBOX::MSGBOX_SELL_WARNING, S(6432), false));
|
|
/// m_pGameManager->PostMsgAtDynamic(new SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_INPUTNUMBER, false));
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::RefreshScrollBar()
|
|
///{
|
|
/// KUIControlVScroll* pScrollBar = dynamicCast<KUIControlVScroll*>(GetChild(c_szScrollInven));
|
|
/// if (NULL != pScrollBar)
|
|
/// {
|
|
/// int nLineCount = int(IsBuyMode() ? m_KartBuyItemsVector.size() : m_KartSellItemsVector.size()) - 1;
|
|
/// if (0 > nLineCount) nLineCount = 0;
|
|
///
|
|
/// int nScrollRange = (nLineCount - c_nMaxKartSlotCount) + 1;
|
|
/// if (0 > nScrollRange) nScrollRange = 0;
|
|
///
|
|
/// pScrollBar->SetMaxRange(DWORD(nScrollRange + 1));
|
|
/// m_nSlotStartIndex = pScrollBar->GetPosition();
|
|
/// }
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::Process(DWORD time)
|
|
///{
|
|
/// if (m_bAct && (m_PrevProcessTime == 0 || time - m_PrevProcessTime > 50))
|
|
/// {
|
|
///
|
|
/// //loop
|
|
/// SIMSG_UI_ACT_BUYITEMS buyMsg;
|
|
/// SIMSG_UI_ACT_SELLITEMS SellMsg;
|
|
///
|
|
/// int sz = m_KartBuyItemsVector.size() + m_KartSellItemsVector.size();
|
|
/// if (sz == 0)
|
|
/// {
|
|
/// RemoveAllKartItems();
|
|
/// m_pGameManager->PostMsgAtDynamic(new SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_SHOP_CRAFT, false));
|
|
/// m_pGameManager->PostMsgAtDynamic(new SIMSG_SHOW_UIWINDOW(SIMSG_TOGGLE_UIWINDOW::UIWINDOW_INPUTNUMBER, false));
|
|
/// }
|
|
/// else
|
|
/// {
|
|
///
|
|
/// if (!m_KartBuyItemsVector.empty())
|
|
/// {
|
|
/// KARTBUYITEM_VECTOR::iterator itItem = m_KartBuyItemsVector.begin();
|
|
/// buyMsg.vtBuyItems.push_back(SIMSG_UI_ACT_BUYITEMS::BuyItemInfo((*itItem).ItemID, (*itItem).nItemCount));
|
|
/// itItem = m_KartBuyItemsVector.erase(itItem);
|
|
/// }
|
|
///
|
|
/// if (!m_KartSellItemsVector.empty())
|
|
/// {
|
|
/// KARTSELLITEM_VECTOR::iterator itItem = m_KartSellItemsVector.begin();
|
|
/// SellMsg.vtSellItems.push_back(SIMSG_UI_ACT_SELLITEMS::SellItemInfo((*itItem).handle, (*itItem).nItemCount));
|
|
/// itItem = m_KartSellItemsVector.erase(itItem);
|
|
/// }
|
|
///
|
|
/// RefreshSlots();
|
|
/// RefreshGoldAndWeight();
|
|
/// RefreshScrollBar();
|
|
///
|
|
/// if (!buyMsg.vtBuyItems.empty()) m_pGameManager->ProcMsgAtStatic(&buyMsg);
|
|
/// if (!SellMsg.vtSellItems.empty()) m_pGameManager->ProcMsgAtStatic(&SellMsg);
|
|
/// }
|
|
///
|
|
/// m_PrevProcessTime = time;
|
|
/// }
|
|
///}
|
|
///
|
|
///
|
|
///
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::RefreshSlots()
|
|
///{
|
|
/// // 판매/구매하는 수량보다 많이 올렸으면 조절해주자
|
|
/// if (!IsShop())
|
|
/// {
|
|
/// for (KARTBUYITEM_VECTOR::iterator itKartBuy = m_KartBuyItemsVector.begin(); itKartBuy != m_KartBuyItemsVector.end(); itKartBuy++)
|
|
/// {
|
|
/// count_t cnt = SStoreMgr::GetInstance().GetItemCount((*itKartBuy).nIndex);
|
|
/// if (cnt < (*itKartBuy).nItemCount) (*itKartBuy).nItemCount = cnt;
|
|
/// }
|
|
/// }
|
|
///
|
|
/// // 구입 상태인 경우
|
|
/// if (IsBuyMode())
|
|
/// {
|
|
/// for (int nSlot(0); nSlot < c_nMaxKartSlotCount; ++nSlot)
|
|
/// {
|
|
/// KUIControlMultiIcon* pItemIconControl = dynamicCast<KUIControlMultiIcon*>(GetChild(m_pSlotControlIDs[nSlot].strIconControl.c_str()));
|
|
/// KUIWnd* pItemNameControl = GetChild(m_pSlotControlIDs[nSlot].strStaticNameControl.c_str());
|
|
/// KUIWnd* pItemCountControl = GetChild(m_pSlotControlIDs[nSlot].strStaticCountControl.c_str());
|
|
/// KUIWnd* pItemPriceControl = GetChild(m_pSlotControlIDs[nSlot].strStaticPriceControl.c_str());
|
|
/// KUIWnd* pItemUnitControl = GetChild(m_pSlotControlIDs[nSlot].strStaticUnitControl.c_str());
|
|
///
|
|
/// if (NULL == pItemIconControl || NULL == pItemNameControl || NULL == pItemCountControl || NULL == pItemPriceControl || NULL == pItemUnitControl) continue;
|
|
///
|
|
/// ResetMultiIcon(pItemIconControl, 0, 10); ////icon test
|
|
///
|
|
/// const SUIShopKartWnd_CRAFT::KART_BUYITEM* pKartBuyItem = GetSlotKartBuyItem(nSlot);
|
|
/// SShopSlot_CRAFT* pSlot = (pKartBuyItem && IsShop()) ? m_InventoryMgr.GetShopItem_CRAFT(pKartBuyItem->ItemID) : NULL;
|
|
///
|
|
/// if (NULL != pKartBuyItem)
|
|
/// {
|
|
/// const ItemBaseEx_info* pItemBase = GetItemDB().GetItemData(pKartBuyItem->ItemID);
|
|
///
|
|
/// // 채워진 슬롯
|
|
/// int nSocket[ItemBase::MAX_SOCKET_NUMBER];
|
|
/// ::memcpy(nSocket, &pKartBuyItem->nSocket[0], sizeof(nSocket));
|
|
///
|
|
/// TS_ITEM_BASE_INFO::AwakenOption stAwakenOption;
|
|
/// ::memcpy(&stAwakenOption, &pKartBuyItem->stAwakenOption, sizeof(stAwakenOption));
|
|
///
|
|
/// TS_ITEM_BASE_INFO::RANDOM_OPTION stRandomOption;
|
|
/// ::memcpy(&stRandomOption, &pKartBuyItem->stRandomOption, sizeof(stRandomOption));
|
|
///
|
|
///
|
|
/// SetItemControl(m_pDisplayInfo,
|
|
/// pItemIconControl,
|
|
/// pItemNameControl,
|
|
/// pItemCountControl,
|
|
/// pKartBuyItem->ItemID,
|
|
/// pKartBuyItem->nLevel,
|
|
/// pKartBuyItem->nEnhance,
|
|
/// pKartBuyItem->nFlag,
|
|
/// pKartBuyItem->remain_time,
|
|
/// nSocket,
|
|
/// pKartBuyItem->nItemCount,
|
|
/// pKartBuyItem->nSummonID,
|
|
/// pKartBuyItem->elemental_effect_type,
|
|
/// pKartBuyItem->elemental_effect_remain_time,
|
|
/// pKartBuyItem->elemental_effect_attack_point,
|
|
/// pKartBuyItem->elemental_effect_magic_point,
|
|
/// pKartBuyItem->ethereal_durability,
|
|
/// pKartBuyItem->nEndurance,
|
|
/// -1,
|
|
/// &stAwakenOption,
|
|
/// &stRandomOption,
|
|
/// pKartBuyItem->nAdditionalItemEffect); // Fraun Sky Accessories 7/12/2025
|
|
///
|
|
/// if (m_bAltKey)
|
|
/// {
|
|
/// m_pDisplayInfo->SetComparableEquipItemSubTooltip(pItemIconControl, pKartBuyItem->ItemID);
|
|
/// }
|
|
///
|
|
/// if (IsShop())
|
|
/// {
|
|
/// setBuyItemPriceCaption(pSlot, pKartBuyItem->nItemCount, pItemPriceControl);
|
|
/// setBuyItemUnitCaption(pSlot, pItemUnitControl);
|
|
/// pItemUnitControl->SetShow(true);
|
|
/// }
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// // 빈 슬롯
|
|
/// pItemIconControl->SetIcon(0, c_szDEF_SPR_NAME, c_szStaticItemBG);
|
|
/// pItemIconControl->SetIcon(1, c_szDEF_SPR_NAME, c_szStaticItemBG);
|
|
/// pItemIconControl->SetIcon(2);
|
|
/// pItemIconControl->SetIcon(3);
|
|
///
|
|
/// pItemIconControl->SetTooltip();
|
|
/// pItemNameControl->SetCaption("");
|
|
/// pItemCountControl->SetShow(false);
|
|
/// pItemPriceControl->SetCaption("");
|
|
/// pItemUnitControl->SetShow(false);
|
|
/// }
|
|
/// }
|
|
/// }
|
|
/// // 판매 상태인 경우
|
|
/// else
|
|
/// {
|
|
/// for (int nSlot(0); nSlot < c_nMaxKartSlotCount; ++nSlot)
|
|
/// {
|
|
/// KUIControlMultiIcon* pItemIconControl = dynamicCast<KUIControlMultiIcon*>(GetChild(m_pSlotControlIDs[nSlot].strIconControl.c_str()));
|
|
/// KUIWnd* pItemNameControl = GetChild(m_pSlotControlIDs[nSlot].strStaticNameControl.c_str());
|
|
/// KUIWnd* pItemCountControl = GetChild(m_pSlotControlIDs[nSlot].strStaticCountControl.c_str());
|
|
/// KUIWnd* pItemPriceControl = GetChild(m_pSlotControlIDs[nSlot].strStaticPriceControl.c_str());
|
|
/// KUIWnd* pItemUnitControl = GetChild(m_pSlotControlIDs[nSlot].strStaticUnitControl.c_str());
|
|
///
|
|
/// if (NULL == pItemIconControl || NULL == pItemNameControl || NULL == pItemCountControl || NULL == pItemPriceControl || NULL == pItemUnitControl) continue;
|
|
///
|
|
/// ResetMultiIcon(pItemIconControl, 0, 10); ///icon test
|
|
///
|
|
/// const SUIShopKartWnd_CRAFT::KART_SELLITEM* pKartSellItem = GetSlotKartSellItem(nSlot);
|
|
///
|
|
/// SInventorySlot* pSlot = (NULL != pKartSellItem) ? m_InventoryMgr.GetItemInfo(pKartSellItem->handle) : NULL;
|
|
/// if (NULL != pKartSellItem && NULL != pSlot)
|
|
/// {
|
|
/// // 채워진 슬롯
|
|
/// SetItemControl(m_pDisplayInfo,
|
|
/// pItemIconControl,
|
|
/// pItemNameControl,
|
|
/// pItemCountControl,
|
|
/// pSlot->GetItemCode(),
|
|
/// pSlot->GetLevel(),
|
|
/// pSlot->GetEnhance(),
|
|
/// *pSlot->GetXFlag().GetRawData(),
|
|
/// pSlot->GetItem()->remain_time,
|
|
/// pSlot->GetItem()->socket,
|
|
/// pKartSellItem->nItemCount,
|
|
/// pSlot->GetSummonID(),
|
|
/// pSlot->GetItem()->elemental_effect_type,
|
|
/// pSlot->GetItem()->elemental_effect_remain_time,
|
|
/// pSlot->GetItem()->elemental_effect_attack_point,
|
|
/// pSlot->GetItem()->elemental_effect_magic_point,
|
|
/// pSlot->GetItem()->ethereal_durability,
|
|
/// pSlot->GetItem()->endurance,
|
|
/// pSlot->GetEtherealDurability(),
|
|
/// pSlot->GetAwakening(),
|
|
/// pSlot->GetRandomOption()
|
|
/// );
|
|
///
|
|
/// if (m_bAltKey)
|
|
/// {
|
|
/// m_pDisplayInfo->SetComparableEquipItemSubTooltip(pItemIconControl, pSlot);
|
|
/// }
|
|
///
|
|
/// if (IsShop())
|
|
/// {
|
|
/// // 2010.07.14 - prodongi
|
|
/// money_t nPrice = m_pDisplayInfo->GetItemSellPrice(pSlot->GetItemCode(), pSlot->GetLevel(), pSlot->isExhausted()) * pKartSellItem->nItemCount;
|
|
/// //money_t nPrice = m_pDisplayInfo->GetItemSellPrice(pSlot->GetItemCode(), pSlot->GetLevel()) * pKartSellItem->nItemCount;
|
|
/// pItemPriceControl->SetCaption(CStringUtil::StringFormat("<size:10><right>%s", CStringUtil::GetCommaNumberString(nPrice.getAmount()).c_str()).c_str());
|
|
/// pItemUnitControl->SetShow(true);
|
|
/// setSellItemUnitCaption2(pItemUnitControl);
|
|
/// }
|
|
///
|
|
/// EquipItemAddtionalIconSetter icon_setter(pItemIconControl, pSlot);
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// // 빈 슬롯
|
|
/// pItemIconControl->SetIcon(0, c_szDEF_SPR_NAME, c_szStaticItemBG);
|
|
/// pItemIconControl->SetIcon(1, c_szDEF_SPR_NAME, c_szStaticItemBG);
|
|
/// pItemIconControl->SetIcon(2);
|
|
/// pItemIconControl->SetIcon(3);
|
|
/// pItemIconControl->SetTooltip();
|
|
/// pItemNameControl->SetCaption("");
|
|
/// pItemCountControl->SetShow(false);
|
|
/// pItemPriceControl->SetCaption("");
|
|
/// pItemUnitControl->SetShow(false);
|
|
/// }
|
|
/// }
|
|
/// }
|
|
///}
|
|
///
|
|
///
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::RefreshGoldAndWeight()
|
|
///{
|
|
/// money_t nTotalPrice;
|
|
/// float fTotalWeight;
|
|
/// GetTotalPriceAndWeight(nTotalPrice, fTotalWeight);
|
|
///
|
|
/// if (IsBuyMode())
|
|
/// fTotalWeight += m_PlayerInfoMgr.GetPlayerInfo().GetInvenWeigth();
|
|
/// else
|
|
/// fTotalWeight = m_PlayerInfoMgr.GetPlayerInfo().GetInvenWeigth() - fTotalWeight;
|
|
///
|
|
/// KUIWnd* pWndGold = GetChild("static_rupy_value");
|
|
/// std::string strGold = " <right>";
|
|
/// strGold += S(6425);
|
|
/// strGold += CStringUtil::GetCommaNumberString(nTotalPrice.getAmount());
|
|
/// strGold += " ";
|
|
/// if (NULL != pWndGold) pWndGold->SetCaption(strGold.c_str());
|
|
///
|
|
/// int nMaxWeight = m_PlayerInfoMgr.GetPlayerInfo().GetWeight();
|
|
/// float fWeightRatio = fTotalWeight / float(nMaxWeight) * 100.f;
|
|
///
|
|
/// KUIWnd* pWndWeight = GetChild("static_wt_value");
|
|
/// if (NULL != pWndWeight) pWndWeight->SetCaption(CStringUtil::StringFormat(" %s<right>%d%% (%d/%d) ", S(6425), int(fWeightRatio), int(fTotalWeight), nMaxWeight).c_str());
|
|
///}
|
|
///
|
|
///int SUIShopKartWnd_CRAFT::GetSlotKartSellItemIndex(int nSlotControlNum) const
|
|
///{
|
|
/// if (0 <= nSlotControlNum && nSlotControlNum < c_nMaxKartSlotCount)
|
|
/// {
|
|
/// int nInvenIndex = (nSlotControlNum + m_nSlotStartIndex);
|
|
///
|
|
/// if (0 <= nInvenIndex && nInvenIndex < m_KartSellItemsVector.size())
|
|
/// return nInvenIndex;
|
|
/// }
|
|
/// return (-1);
|
|
///}
|
|
///
|
|
///int SUIShopKartWnd_CRAFT::GetSlotKartBuyItemIndex(int nSlotControlNum) const
|
|
///{
|
|
/// if (0 <= nSlotControlNum && nSlotControlNum < c_nMaxKartSlotCount)
|
|
/// {
|
|
/// int nInvenIndex = (nSlotControlNum + m_nSlotStartIndex);
|
|
///
|
|
/// if (0 <= nInvenIndex && nInvenIndex < m_KartBuyItemsVector.size())
|
|
/// return nInvenIndex;
|
|
/// }
|
|
/// return (-1);
|
|
///}
|
|
///
|
|
///const SUIShopKartWnd_CRAFT::KART_SELLITEM* SUIShopKartWnd_CRAFT::GetSlotKartSellItem(int nSlotControlNum) const
|
|
///{
|
|
/// int nInvenIndex = GetSlotKartSellItemIndex(nSlotControlNum);
|
|
///
|
|
/// return ((-1) != nInvenIndex) ? &m_KartSellItemsVector[nInvenIndex] : NULL;
|
|
///}
|
|
///
|
|
///const SUIShopKartWnd_CRAFT::KART_BUYITEM* SUIShopKartWnd_CRAFT::GetSlotKartBuyItem(int nSlotControlNum) const
|
|
///{
|
|
/// int nInvenIndex = GetSlotKartBuyItemIndex(nSlotControlNum);
|
|
///
|
|
/// return ((-1) != nInvenIndex) ? &m_KartBuyItemsVector[nInvenIndex] : NULL;
|
|
///}
|
|
///
|
|
///int SUIShopKartWnd_CRAFT::GetSlotControlNum(const char* szSlotControlID) const
|
|
///{
|
|
/// for (int nIndex(0); nIndex < c_nMaxKartSlotCount; ++nIndex)
|
|
/// {
|
|
/// if (0 == ::_stricmp(m_pSlotControlIDs[nIndex].strIconControl.c_str(), szSlotControlID))
|
|
/// return nIndex;
|
|
/// }
|
|
/// return (-1);
|
|
///}
|
|
///
|
|
///void SUIShopKartWnd_CRAFT::GetTotalPriceAndWeight(money_t& rTotalPrice, float& rTotalWeight) const
|
|
///{
|
|
/// rTotalPrice = money_t(0);
|
|
/// rTotalWeight = 0;
|
|
///
|
|
/// if (IsBuyMode())
|
|
/// {
|
|
/// for (KARTBUYITEM_VECTOR::const_iterator itKartBuy = m_KartBuyItemsVector.begin(); itKartBuy != m_KartBuyItemsVector.end(); itKartBuy++)
|
|
/// {
|
|
/// money_t nPrice = money_t(0);
|
|
///
|
|
/// if (IsShop())
|
|
/// {
|
|
/// SShopSlot* pSlot = m_InventoryMgr.GetShopItem((*itKartBuy).ItemID);
|
|
/// if (!pSlot) continue;
|
|
/// nPrice = pSlot->GetPrice();
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// nPrice = SStoreMgr::GetInstance().GetItemPrice((*itKartBuy).nIndex);
|
|
/// }
|
|
///
|
|
/// float fWeight = GetItemDB().GetWeight((*itKartBuy).ItemID);
|
|
/// count_t nCount = (*itKartBuy).nItemCount;
|
|
///
|
|
/// rTotalPrice += (nPrice * nCount);
|
|
/// rTotalWeight += (fWeight * nCount.getAmount());
|
|
/// }
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// for (KARTSELLITEM_VECTOR::const_iterator itKartSell = m_KartSellItemsVector.begin(); itKartSell != m_KartSellItemsVector.end(); itKartSell++)
|
|
/// {
|
|
/// SInventorySlot* pSlot = m_InventoryMgr.GetItemInfo((*itKartSell).handle);
|
|
/// if (NULL != pSlot)
|
|
/// {
|
|
/// money_t nPrice(0);
|
|
/// if (IsShop())
|
|
/// {
|
|
/// // 2010.07.16 - prodongi
|
|
/// nPrice = m_pDisplayInfo->GetItemSellPrice(pSlot->GetItemCode(), pSlot->GetLevel(), pSlot->isExhausted());
|
|
/// //nPrice = m_pDisplayInfo->GetItemSellPrice( pSlot->GetItemCode(), pSlot->GetLevel() );
|
|
/// }
|
|
/// else
|
|
/// {
|
|
/// int SellListSize(SStoreMgr::GetInstance().GetListCount());
|
|
/// for (int i(0); i < SellListSize; ++i)
|
|
/// {
|
|
/// if ((*itKartSell).nIndex != -1)
|
|
/// {
|
|
/// nPrice = SStoreMgr::GetInstance().GetItemPrice((*itKartSell).nIndex);
|
|
/// break;
|
|
/// }
|
|
/// }
|
|
/// }
|
|
///
|
|
/// float fWeight = GetItemDB().GetWeight(pSlot->GetItemCode());
|
|
/// count_t nCount = (*itKartSell).nItemCount;
|
|
///
|
|
/// rTotalPrice += (nPrice * nCount);
|
|
/// rTotalWeight += (fWeight * nCount.getAmount());
|
|
/// }
|
|
/// }
|
|
/// }
|
|
///}
|
|
|