void MagpieFileImportPopup::onLevelPathChanged()
{
	ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
	TFilePath levelPath(m_levelField->getPath().toStdWString());
	levelPath = scene->decodeFilePath(levelPath);
	if (levelPath.isEmpty() || levelPath.getUndottedType().empty() || !TSystem::doesExistFileOrLevel(levelPath)) {
		DVGui::error(tr("The file path is missing."));
		return;
	}
	m_levelPath = levelPath;

	string format = m_levelPath.getType();
	if (format == "tzp" || format == "tzu") {

		wstring name = m_levelPath.getWideName();
		IoCmd::ConvertingPopup *convertingPopup = new IoCmd::ConvertingPopup(
			TApp::instance()->getMainWindow(),
			QString::fromStdWString(name) + QString::fromStdString(m_levelPath.getDottedType()));
		convertingPopup->show();

		bool ok = scene->convertLevelIfNeeded(m_levelPath);
		convertingPopup->hide();
		if (!ok)
			return;
	}
	m_flipbook->setLevel(m_levelPath);
}
Ejemplo n.º 2
0
Map::Map(QObject *parent = 0){
    _x = 22; level = 1; size = 10;

    map1T = levelTexture();
    map1Event = levelEvent();
    map1Path = levelPath();

    mapSet();
}