void AssetsUpdateLayer::update(float delta) { if (1 || m_curBigVersion >= m_endBigVersion && m_curSmallVersion >= m_endSmallVersion) { CCLOG("Version check Ok"); unscheduleUpdate(); //MD5Check(); gameEnter(); return; } if (!m_isDownloading && checkUpdate()) { createLayerItem(); char str[128]; sprintf(str, "%s%s%d.%d.%d.zip", SERVER_ADDRESS, ASSETS_SERVER_PATH, m_curBigVersion, m_curMidVersion, m_curSmallVersion + 1); getAssetsManager()->setPackageUrl(str); sprintf(str, "%d.%d.%d", m_curBigVersion, m_curMidVersion, m_curSmallVersion + 1); getAssetsManager()->setVersionFileUrl(str); getAssetsManager()->setStoragePath(m_pathToSave.c_str()); //sprintf(str, Localization::getInstance()->getValueByKey("Loading_download_restBag_num"), m_endSmallVersion - m_curSmallVersion); //m_packegNumberLabel->setString(str); m_curPackageLength = 0; //getAssetsManager()->getPackageLength((long&)m_packageLength); m_isDownloading = true; download(); } }
void MapItem::createLayerItems(const QList<Layer *> &layers) { int layerIndex = 0; for (Layer *layer : layers) { LayerItem *layerItem = createLayerItem(layer); layerItem->setZValue(layerIndex); ++layerIndex; } }