virtual void execute (CCtrlBase * /* pCaller */, const string &Params) { CInterfaceManager *pIM = CInterfaceManager::getInstance(); CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(pIM->getElementFromId("ui:interface", Params)); if (pGC == NULL) { nlwarning("%s is not a container", Params.c_str()); return; } pGC->close(); }
virtual void execute (CCtrlBase * /* pCaller */, const string &/* Params */) { uint32 i; CInterfaceManager *pIM = CInterfaceManager::getInstance(); const vector<CInterfaceManager::SMasterGroup> &rVMG = pIM->getAllMasterGroup(); for (uint32 nMasterGroup = 0; nMasterGroup < rVMG.size(); nMasterGroup++) { const CInterfaceManager::SMasterGroup &rMG = rVMG[nMasterGroup]; const vector<CInterfaceGroup*> &rV = rMG.Group->getGroups(); // Active all containers (that can be activated) for (i = 0; i < rV.size(); ++i) { CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(rV[i]); if (pGC == NULL) continue; if (pGC->isSavable()) { // Yoyo: DO NOT force activation of containers who don't want to save their Active state. // Usually driven by server. if(pGC->isActiveSavable()) pGC->setActive(true); } } pIM->checkCoords(); pIM->getMasterGroup((uint8)nMasterGroup).centerAllContainers(); // Pop in and close all containers for (i = 0; i < rV.size(); ++i) { CGroupContainer *pGC = dynamic_cast<CGroupContainer*>(rV[i]); if (pGC == NULL) continue; if (pGC->isSavable()) { if (pGC->isPopable()&&pGC->isPopuped()) pGC->popin(); // Can close ? if (pGC->isOpenable()&&pGC->isOpen()) pGC->close(); } } pIM->getMasterGroup((uint8)nMasterGroup).deactiveAllContainers(); } }