Exemplo n.º 1
0
void UpdatePetStrenthenWnd(CEGUI::Window* mainPage, long type)
{
	if (!mainPage)
		return;

	char tempText[256];

	CPlayer* player = GetGame()->GetMainPlayer();
	map<CGUID, CPet*>* petList = player->GetPetList();
	map<CGUID, CPet*>::iterator iterPet = petList->begin();
	for (int i=0; iterPet!=petList->end(); ++iterPet,++i)
	{
		sprintf(tempText, "PetStrengthen/PetSelectWnd/Pet%d/DragContainer", i+1);
		CEGUI::Window* dragItem = mainPage->getChildRecursive(tempText);
		if (dragItem)
		{
			CEGUI::GUISheet* childImg = WGUISheet(dragItem->getChildAtIdx(0));
			if(!childImg)
				return;
			SetBackGroundImage(childImg,"PetID","pictures\\Pet\\PetIcon","pet.jpg");
		}
		if (i>=PET_SELECT_WND_CNT-1)
			break;
	}
}
Exemplo n.º 2
0
bool OnUpdateLatestBuy(const CEGUI::EventArgs& e)
{
    CEGUI::Window* wnd = WEArgs(e).window;
    //先把图片清掉 ,默认为十个条目
    char name[256] = "";
    for(uint i = 0 ; i < 10 ; ++i)
    {
        sprintf(name,SHOPCITY_LATESTBUY_ITME_NAME_D,i);
        CEGUI::Window* temp = wnd->getChild(name);
        if(temp)
        {
            temp->setProperty("Image","");
            OutputDebugStr(temp->getName().c_str());
            OutputDebugStr("\n");
        }
    }

    //由索引关联商城类型
    SCGData::eSCType eCityType = GetShopCityTypeByTabContentSelIndex();
    SCGData* dt = GetInst(ShopCityMsgMgr).GetShopCityGoodsData();
    SCGData::MapSBT10& personal = dt->GetSelfBuyTop10();
    SCGData::VecGDPTA perDTA = personal[eCityType];

    size_t count = perDTA.size();
    for(size_t i = 0 ; i < count ; ++i)
    {
        char name[256] = "";
        sprintf(name,SHOPCITY_LATESTBUY_ITME_NAME_D,i);
        CEGUI::Window* temp = wnd->getChild(name);
        if(temp)
        {
            CGoodsList::tagGoods2* tg2 = CGoodsList::GetProperty(perDTA[i].index);
            if(tg2)
            {
                char imagesetname[256];
                sprintf(imagesetname,GOODS_PREFIXID,tg2->BaseProperty.dwIconId);
                CEGUI::String imagename = CEGUI::PropertyHelper::intToString(tg2->BaseProperty.dwIconId)+".jpg";
                SetBackGroundImage(WGUISheet(temp),imagesetname,GOODS_ICON_PATH,imagename.c_str());
            }
        }
    }
    return true;
}