本文整理汇总了C++中CItemData::GetItemIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ CItemData::GetItemIndex方法的具体用法?C++ CItemData::GetItemIndex怎么用?C++ CItemData::GetItemIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CItemData
的用法示例。
在下文中一共展示了CItemData::GetItemIndex方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendMixNewMasterStroneReq
// ----------------------------------------------------------------------------
// Name : SendMixNewReq()
// Desc :
// ----------------------------------------------------------------------------
void CUIMixNew::SendMixNewMasterStroneReq()
{
if( m_bWaitMixResult == TRUE )
return;
if( m_bIsMixMasterStone == FALSE )
return;
CUIManager* pUIManager = CUIManager::getSingleton();
if( ( (CPlayerEntity*)CEntity::GetPlayerEntity(0) )->IsSkilling() )
{
pUIManager->GetChattingUI()->AddSysMessage( _S( 2658, "스킬 사용중에는 이용할 수 없습니다." ), SYSMSG_ERROR );
return;
}
if( pUIManager->IsCSFlagOn( CSF_TELEPORT ) )
{
pUIManager->GetChattingUI()->AddSysMessage( _S( 2659, "순간 이동중에는 이용할 수 없습니다." ), SYSMSG_ERROR );
return;
}
CItems* pItemsMStone = m_pIconsSlot[0]->getItems();
CItemData* pItemsMStoneData = pItemsMStone->ItemData;
CItems* pItemsItemTgt = m_pIconsSlot[1]->getItems();
CItemData* pItemsItemTgtData = pItemsItemTgt->ItemData;
_pNetwork->SendMasterStoneUseReq( pItemsMStone->Item_Tab, pItemsMStone->InvenIndex, pItemsMStoneData->GetItemIndex(),
pItemsItemTgt->Item_Tab, pItemsItemTgt->InvenIndex, pItemsItemTgtData->GetItemIndex() );
m_btnOK.SetEnable ( FALSE );
m_bWaitMixResult = TRUE;
// Lock inventory
pUIManager->GetInventory()->Lock( TRUE, FALSE, LOCK_MASTERSTONE );
}
示例2: LoadStringItem
void CWorld::LoadStringItem()
{
StringLoader* pLoader = StringLoader::getSingleton();
CUIManager* pUIManager = CUIManager::getSingleton();
if (pLoader == NULL)
return;
pLoader->LoadString(eSTRING_ITEM, g_iCountry);
int nIdx;
const char* strtmp = NULL;
CItemData::_map::iterator iter = CItemData::_mapdata.begin();
CItemData::_map::iterator eiter = CItemData::_mapdata.end();
for (;iter != eiter; ++iter)
{
CItemData* pItem = (*iter).second;
if (pItem == NULL)
continue;
nIdx = pItem->getindex();
if (nIdx >= 0)
{
strtmp = pLoader->getData(eSTRING_ITEM, nIdx, 0);
if (strtmp != NULL)
pItem->SetName( strtmp );
else
pUIManager->SetNoTranslateFlag( TRANS_NAME, &pItem->GetTransFlag() );
strtmp = pLoader->getData(eSTRING_ITEM, nIdx, 1);
if (strtmp != NULL)
pItem->SetDesc( strtmp );
else
pUIManager->SetNoTranslateFlag( TRANS_DESC, &pItem->GetTransFlag() );
if( pItem->GetTransFlag() > 0 ) //[sora] 미번역 스트링 index 표시
pUIManager->SetNoTranslationString( ITEM_STRING, pItem->GetItemIndex() );
}
}
pLoader->release(eSTRING_ITEM);
}
示例3: SetMixItem
// ----------------------------------------------------------------------------
// Name : !!SetMixItem()
// Desc :
// ----------------------------------------------------------------------------
void CUIMixNew::SetMixItem ( int nSlotIndex )
{
int i;
CUIManager* pUIManager = CUIManager::getSingleton();
CUIIcon* pDrag = pUIManager->GetDragIcon();
if (pDrag == NULL)
return;
CItems* pItems = pDrag->getItems();
if (pItems == NULL)
return;
// If this is wearing item
if (pDrag->IsWearTab() == true)
{
pUIManager->GetChattingUI()->AddSysMessage( _S( 554, "착용한 아이템은 조합이 불가능 합니다." ), SYSMSG_ERROR );
pUIManager->ResetHoldBtn();
return;
}
// If this is not weapon or armor
CItemData *pItemData = pItems->ItemData;
if(m_bIsMixMasterStone == TRUE)
{
ResetMixItem();
// 아이템이 현재 사용중인지 확인 한다.
for ( i = 0; i < MIXNEW_ITEM_SLOT_COUNT; i++ )
{
if ( !m_pIconsSlot[i]->IsEmpty () )
{
if (pItems->Item_UniIndex == m_pIconsSlot[i]->getItems()->Item_UniIndex)
{
pUIManager->GetChattingUI()->AddSysMessage( _S( 556, "이미 사용중인 아이템 입니다." ), SYSMSG_ERROR );
pUIManager->ResetHoldBtn();
return;
}
}
}
// 항목 체크
switch(nSlotIndex)
{
case 0 :
{
CTString tv_str;
int nItemIndex = pItemData->GetItemIndex();
if(!((nItemIndex >= 6111 && nItemIndex <= 6115) // 최하급~최상급 무기 마스터 스톤
|| (nItemIndex >= 7730 && nItemIndex <= 7735)
|| nItemIndex == 6124 // 무기마스터 스톤(+0 ~ +25 => +26)
|| nItemIndex == 6120 // 방어구 마스터 스톤(+0 => +26)
|| nItemIndex == 10970
|| nItemIndex == 10971
))
{
tv_str.PrintF("%p,%x",pItemData->GetFlag(),pItemData->GetFlag());
pUIManager->GetChattingUI()->AddSysMessage( _S( 5438, "마스터 스톤 종류의 아이템만 올릴 수 있습니다." ), SYSMSG_ERROR );
pUIManager->ResetHoldBtn();
return;
}
}
break;
case 1 :
{
if ( m_pIconsSlot[0]->IsEmpty() ){
pUIManager->GetChattingUI()->AddSysMessage( _S( 5439, "마스터 스톤을 먼저 넣어야 합니다." ), SYSMSG_ERROR );
pUIManager->ResetHoldBtn();
return;
}
BOOL bEnableMixItem = TRUE;
CItems* pItems0 = m_pIconsSlot[0]->getItems();
CItemData* pItemData0 = pItems0->ItemData;
INDEX idxItem = pItemData0->GetItemIndex();
bool bRet = false;
if(pItemData->IsFlag(ITEM_FLAG_UPGRADE) == true)
{
if ( (pItems->Item_Flag & FLAG_ITEM_COMPOSITION) || (pItems->Item_Flag & FLAG_ITEM_LENT) )
bRet = true;
}
else
{
if (!(pItems->Item_Flag & FLAG_ITEM_COMPOSITION))
bRet = true;
}
if (bRet == true)
{
// 아이템 플래그에 Upgrade 여부 검사
CUIMsgBox_Info MsgBoxInfo;
MsgBoxInfo.SetMsgBoxInfo( _S( 191, "확인" ), UMBS_OK, UI_NONE, MSGCMD_NULL );
//.........这里部分代码省略.........
示例4: SelectItem
// ----------------------------------------------------------------------------
// Name : SelectItem()
// Desc :
// ----------------------------------------------------------------------------
void CUIPetItemMix::SelectItem ( int _nIndex )
{
if ( _nIndex == -1 )
{
_nIndex = m_nSelectProcessItem;
if ( _nIndex == -1 ) return;
}
int i;
BOOL bNeedItemA = FALSE;
BOOL bNeedItemB = FALSE;
BOOL bNeedItemCount = FALSE;
BOOL bNeedItems[6];
for( i = 0; i < 6; i++ )
bNeedItems[i] = FALSE;
m_lbPreconditionDesc.ResetAllStrings();
// 생산 하고자 하는 아이템 목록
if ( m_vecIcons[_nIndex]->getIndex() == -1 ) return;
CItemData* pProcessItemData = _pNetwork-> GetItemData ( m_vecIcons[_nIndex]->getIndex() );
// 필요 아이템
int nIndexTemp = 0;
int NeedCntA[MAX_MAKE_ITEM_MATERIAL] = {0,};
int NeedCntB[MAX_MAKE_ITEM_MATERIAL] = {0,};
int nResultA = 0, nResultB = 0;
CItemData* pInvenItem = NULL;
int nCnt;
//필요 아이템 종류와 갯수 얻기
if( m_nPetType == DRAGON_WEAPON )
{
for( i = 0; i < DEF_MAX_DRAGON_WEAPON_MATERIAL_COUNT; i++ )
{
nIndexTemp = pProcessItemData->GetNeedItemIndex( i );
if( nIndexTemp == -1 ) return;
m_NeedItems[i].ItemData = _pNetwork->GetItemData ( nIndexTemp );
m_NeedItems[i].llCount = 1;
}
int t, i, each;
for (t = 0; t <= INVENTORY_TAB_CASH_2; ++t)
{
if (t == INVENTORY_TAB_NORMAL) each = ITEM_COUNT_IN_INVENTORY_NORMAL;
else if ( t == INVENTORY_TAB_CASH_1 ) each = ITEM_COUNT_IN_INVENTORY_CASH_1;
else each = ITEM_COUNT_IN_INVENTORY_CASH_2;
for (i = 0 ; i < each; ++i)
{
pInvenItem = _pNetwork->MySlotItem[t][i].ItemData;
for( nCnt = 0; nCnt < DEF_MAX_DRAGON_WEAPON_MATERIAL_COUNT; nCnt++ )
{
if (m_NeedItems[nCnt].ItemData != NULL &&
pInvenItem != NULL &&
pInvenItem->GetItemIndex() == m_NeedItems[nCnt].ItemData->GetItemIndex() )
{
NeedCntA[nCnt] = 1;
bNeedItemCount = TRUE;
m_NeedItems[nCnt].MatTab = t;
m_NeedItems[nCnt].inven_idx = i;
bNeedItems[nCnt] = TRUE;
// todo : 종료 조건 찾을 것
}
}
}
}
for ( i = 0; i < DEF_MAX_DRAGON_WEAPON_MATERIAL_COUNT; i++ )
{
nResultA += NeedCntA[i];
}
if( nResultA == DEF_MAX_DRAGON_WEAPON_MATERIAL_COUNT ) bNeedItemA = TRUE; // 조합 아이템 조건 만족
}
else if( m_nPetType == KNIGHT_AMOR )
{
int nJob = _pNetwork->MyCharacterInfo.job;
for( i = 0; i < DEF_MAX_KNIGHT_AMOR_MATERIAL_COUNT; i++ )
{
m_NeedItems[i].ItemData = _pNetwork->GetItemData( m_NStuffKnight[_nIndex].nNeedA[i] );
m_NeedItems[i].llCount = 1;
}
for( i = 0; i < DEF_MAX_KNIGHT_AMOR_MATERIAL_COUNT; i++ )
{
m_NeedItems[i+3].ItemData = _pNetwork->GetItemData( m_NStuffKnight[_nIndex].nNeedB[i] );
m_NeedItems[i+3].llCount = 1;
}
//.........这里部分代码省略.........
示例5: InitPetItemMix
// ----------------------------------------------------------------------------
// Name : InitPetItemMix()
// Desc : 아이템 정보 갱신
// ----------------------------------------------------------------------------
void CUIPetItemMix::InitPetItemMix( int nType )
{
ClearProcessItems();
CUIIcon* pIcon = NULL;
int bit = 0x00000001;
if( DRAGON_WEAPON == nType )
{
for( int i=0; i<T_DRAGON_MAX; i++ )
{
if( i == 0 )
{
CItemData* pItemData = _pNetwork->GetItemData( UNI_DRAGON_SWORD );
if( pItemData->GetItemIndex() == -1 )
continue;
pIcon = new CUIIcon;
pIcon->Create(this, 0, 0, BTN_SIZE, BTN_SIZE, UI_PETITEMMIX, UBET_ITEM);
pIcon->setData(UBET_ITEM, pItemData->GetItemIndex());
m_vecIcons.push_back ( pIcon );
}
else
{
CItemData* pItemData = _pNetwork->GetItemData( UNI_DUAL_DRAGON_SWORD + i-1 );
if( pItemData->GetItemIndex() == -1 )
continue;
pIcon = new CUIIcon;
pIcon->Create(this, 0, 0, BTN_SIZE, BTN_SIZE, UI_PETITEMMIX, UBET_ITEM);
pIcon->setData(UBET_ITEM, pItemData->GetItemIndex());
m_vecIcons.push_back ( pIcon );
}
}
}
else if( KNIGHT_AMOR == nType )
{
UBYTE ubJob = _pNetwork->MyCharacterInfo.job;
for( int i=0; i<T_SHIELD; i++ )
{
CItemData* pItemData = _pNetwork->GetItemData( m_nJobIndex[ubJob]+i );
if( pItemData->GetItemIndex() == -1 )
continue;
pIcon = new CUIIcon;
pIcon->Create(this, 0, 0, BTN_SIZE, BTN_SIZE, UI_PETITEMMIX, UBET_ITEM);
pIcon->setData(UBET_ITEM, pItemData->GetItemIndex());
m_vecIcons.push_back( pIcon );
}
if( ubJob == KNIGHT )
{
CItemData* pItemData = _pNetwork->GetItemData( UNI_KNIGHT_DEFENDSHIELD );
if( pItemData->GetItemIndex() != -1 )
{
pIcon = new CUIIcon;
pIcon->Create(this, 0, 0, BTN_SIZE, BTN_SIZE, UI_PETITEMMIX, UBET_ITEM);
pIcon->setData(UBET_ITEM, pItemData->GetItemIndex());
m_vecIcons.push_back( pIcon );
}
}
}
AddString ( _S( 561, "가공품을 선택해 주십시오." ), COLOR_TEXT );
m_sbProcessItem.SetScrollPos( 0 );
m_sbProcessItem.SetCurItemCount( m_vecIcons.size() );
if( DRAGON_WEAPON == nType )
m_btnOK[0].SetEnable ( m_bSatisfiedA );
else if( KNIGHT_AMOR == nType )
{
m_btnOK[1].SetEnable ( m_bSatisfiedA );
m_btnOK[2].SetEnable ( m_bSatisfiedB );
}
}