//新品推荐 bool OnUpdateTwitter(const CEGUI::EventArgs& e) { CEGUI::Window* twitter = WEArgs(e).window; CEGUI::Listbox* lb = WListBox(twitter->getChildRecursive(SHOPCITY_TWITTER_CHILDLISTBOX_NAME)); #ifdef _DEBUG OutputDebugStr(lb->getName().c_str()); OutputDebugStr("\n"); OutputDebugStr(twitter->getChildAtIdx(0)->getName().c_str()); OutputDebugStr("n"); #endif //清空 lb->resetList(); //由索引关联商城类型 SCGData::eSCType eCityType = GetShopCityTypeByTabContentSelIndex(); SCGData* dt = GetInst(ShopCityMsgMgr).GetShopCityGoodsData(); //新品推荐显示 SCGData::MapNewestA& resdta = dt->GetNewestVec(); SCGData::VecGDPTA& vecDTA = resdta[eCityType]; for(uint i = 0 ; i < vecDTA.size() ; ++i) { CGoodsList::tagGoods2* ptg2 = CGoodsList::GetProperty(vecDTA[i].index); if(ptg2) { string str = ptg2->BaseProperty.strName.c_str(); //CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(str.c_str(),vecDTA[i].index);//索引关联Item ID CEGUI::ListboxTextItem* lti = new CEGUI::ListboxTextItem(ToCEGUIString(str.c_str()),vecDTA[i].index);//索引关联Item ID lti->setSelectionBrushImage(IMAGES_FILE_NAME,BRUSH_NAME); lb->addItem(lti); } } return true; }
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; } }
//------------------------------------------------------------------------------------------------------- DebugWindow::DebugWindow() : lastTimeSinceLastFrame(0) { mVehicle = nullptr; CEGUI::Window* rootWindow = CEGUI::WindowManager::getSingletonPtr()->getWindow("Game/DebugWindow"); int numChildren = rootWindow->getChildCount(); for (int iii = 0; iii < numChildren; ++iii) { mWindows.push_back(rootWindow->getChildAtIdx(iii)); mWindows[iii]->setFont("DejaVuSans-6"); } }
void ClearWindow(CEGUI::Window& i_window, bool i_destroy) { std::vector<CEGUI::Window*> children; CEGUI::WindowManager* p_window_manager = CEGUI::WindowManager::getSingletonPtr(); for(size_t i = 0; i < i_window.getChildCount(); ++i) children.push_back(i_window.getChildAtIdx(i)); for(size_t i = 0; i < children.size(); ++i) p_window_manager->destroyWindow(children.at(i)); if (i_destroy) p_window_manager->destroyWindow(&i_window); }