Example #1
0
// 编辑菜单
void CLogViewDlg::DoEditClearCmd()
{
    m_LogResult.clear();
    m_vctLogInfo.clear();
    UpdateItemCount();

    m_ProcPanel.RemoveAllOptions();
    m_LevelPanel.RemoveAllOptions();

    if(CConfig::GetConfig().IsClearFilterWhenClearLog())
        m_FilterPanel.RemoveAllOptions();
}
Example #2
0
void CLogViewDlg::OnTimer(UINT_PTR nIDEvent)
{
    if(m_uDelayUpdateItemCountTimerId == nIDEvent)
    {
        KillTimer(m_uDelayUpdateItemCountTimerId);
        m_uDelayUpdateItemCountTimerId = 0;

        UpdateItemCount();
    }
    else
    {
        __super::OnTimer(nIDEvent);
    }
}
Example #3
0
void GStateScene::BuyItem(GnIListCtrl* pInvenList, GnIListCtrl* pEquipList, GnINumberLabel* pMoneyLabel
	, GStateListCtrlItem* pItem)
{
	if( pItem == NULL )
		return;	
	
	gtuint itemIndex = pItem->GetItemIndex();
	GPlayingDataManager* dataMng = GPlayingDataManager::GetSingleton();	
	GPlayingData* playingData = dataMng->GetPlayingPlayerData();
	
	guint32 buyMoney = GetItemInfo()->GetBuyPrice( itemIndex, 0 );
	if( playingData->GetMoneyCount() < buyMoney )
		return;

	GUserHaveItem* haveItem = dataMng->GetPlayingHaveItem();
	haveItem->OpenPlayerItem( playingData->GetPlayerName() );

	GItemListCtrlItem* equipItem = NULL;
	guint32 itemCount = haveItem->GetItemCount( pItem->GetItemIndex() ) + 1;
	
	if( itemCount == 1 )
	{
		// add item to haveitem
		haveItem->AddItem( itemIndex, eItem );
		
		// add item to list
		GStateUILayer* interfaceLayer = (GStateUILayer*)mpInterfaceLayer;
		equipItem = interfaceLayer->CreateItemCtrlItem( itemIndex );
		pInvenList->AddItem( equipItem );
		equipItem->SetTegID( GInterfaceLayer::LISTITEM_INVEN );
		equipItem->SetItemIndex( itemIndex );
		equipItem->SetItemCount( itemCount );
	}
	else
	{
		UpdateItemCount( haveItem, pInvenList, pEquipList, itemIndex, itemCount );
	}
	
	haveItem->Close();
	
	// set money
	guint32 money = playingData->GetMoneyCount() - buyMoney;
	playingData->SetMoneyCount( money );
	pMoneyLabel->SetNumber( money );	
	
	dataMng->SaveData();
}
Example #4
0
guint32 GStateScene::SellItem(GnIListCtrl* pInvenList, GnIListCtrl* pEquipList, GnINumberLabel* pMoneyLabel
	, GStateListCtrlItem* pItem)
{
	if( pItem == NULL )
		return 0;
	
	GPlayingDataManager* dataMng = GPlayingDataManager::GetSingleton();
	GUserHaveItem* haveItem = dataMng->GetPlayingHaveItem();
	GPlayingData* playingData = dataMng->GetPlayingPlayerData();
	haveItem->OpenPlayerItem( playingData->GetPlayerName() );
	
	guint32 itemIndex = pItem->GetItemIndex();
	// delete item
	guint32 itemCount = haveItem->GetItemCount( itemIndex ) - 1;
	if( itemCount < 1 )
	{
		GItemListCtrlItem* existItem = GetListCtrlItemFromIndex( pInvenList, itemIndex );
		if( existItem )
		{
			haveItem->DeleteItem( itemIndex, eItem );
			pInvenList->RemoveItem( pItem );
		}
		
		existItem = GetListCtrlItemFromIndex( pEquipList, itemIndex );
		if( existItem )
		{
			haveItem->DeleteItem( itemIndex, eEquip );
			pEquipList->RemoveItem( pItem );
		}		
	}
	else
	{
		UpdateItemCount( haveItem, pInvenList, pEquipList, itemIndex, itemCount );
	}

	// set money
	guint32 sellMoney = GetItemInfo()->GetSellPrice( itemIndex, 0 );
	guint32 money = sellMoney + playingData->GetMoneyCount();
	playingData->SetMoneyCount( money );
	pMoneyLabel->SetNumber( money );
	
	haveItem->Close();
	
	dataMng->SaveData();
	return itemCount;
}
		void Launcher::OnListDeleteAllItems(const NMHDR&)
		{
			OnNoSelection();
			const uint size = list.Size();
			UpdateItemCount( size - (size != 0) );
		}
		void Launcher::OnListDeleteItem(const NMHDR&)
		{
			const uint size = list.Size();
			UpdateItemCount( size - (size != 0) );
		}
		void Launcher::OnListInsertItem(const NMHDR&)
		{
			UpdateItemCount( list.Size() );
		}