示例#1
0
void MainWindow::on_actionNewWorld_map_triggered()
{
    //Check if data configs are valid
    if( configs.check() )
    {
        WriteToLog(QtCriticalMsg, QString("Error! *.INI configs not loaded"));
        QMessageBox::warning(this, tr("Configuration is loaded with errors"),
                             tr("Cannot create world map file:\nConfiguration package loaded with errors.").arg(ConfStatus::configPath));
        //Show configuration status window
        on_actionCurConfig_triggered();
        return;
    }

    WorldEdit *child = createWldChild();
    if(child->newFile(configs, GlobalSettings::LvlOpts))
    {
        child->show();
        child->updateGeometry();
        child->ResetPosition();
        updateMenus(true);
        on_actionSelect_triggered();
    } else {
        child->show();
        if(activeChildWindow()==3) activeWldEditWin()->WldData.modified = false;
        ui->centralWidget->activeSubWindow()->close();
    }
}
示例#2
0
void MainWindow::on_actionNewLevel_triggered()
{
    //Check if data configs are valid
    if( configs.check() )
    {
        WriteToLog(QtCriticalMsg, QString("Error! *.INI configs not loaded"));
        QMessageBox::warning(this, tr("Configuration is loaded with errors"),
                             tr("Cannot create level file:\nConfiguration package loaded with errors.").arg(ConfStatus::configPath));
        //Show configuration status window
        on_actionCurConfig_triggered();
        return;
    }

    LevelEdit *child = createLvlChild();
    if(child->newFile(configs, GlobalSettings::LvlOpts))
    {
        child->show();
        child->updateGeometry();
        child->ResetPosition();
        updateMenus(true);
        SetCurrentLevelSection(0);
        on_actionSelect_triggered();
        dock_LvlWarpProps->init();
        dock_LvlLayers->setLayersBox();

        if(GlobalSettings::autoPlayMusic) ui->actionPlayMusic->setChecked(true);
        LvlMusPlay::musicForceReset=true; //reset musics
        on_actionPlayMusic_triggered(ui->actionPlayMusic->isChecked());
    } else {
        child->show();
        if(activeChildWindow()==1) activeLvlEditWin()->LvlData.modified = false;
        ui->centralWidget->activeSubWindow()->close();
    }
}
示例#3
0
void MainWindow::on_actionNewLevel_triggered()
{
    leveledit *child = createLvlChild();
    child->newFile(configs, GlobalSettings::LvlOpts);
    child->show();
    updateMenus(true);
    SetCurrentLevelSection(0);
    on_actionSelect_triggered();
    setDoorsToolbox();
    setLayersBox();

    if(GlobalSettings::autoPlayMusic) ui->actionPlayMusic->setChecked(true);
    LvlMusPlay::musicForceReset=true; //reset musics
    on_actionPlayMusic_triggered(ui->actionPlayMusic->isChecked());
}