57 |
|
this->vagoSettings->setValue("AeFolder", aefolder); |
58 |
|
iniChanged=true; |
59 |
|
} |
60 |
+ |
if(!this->vagoSettings->contains("WindowWidth")){ |
61 |
+ |
this->vagoSettings->setValue("WindowWidth", GlobalVars::DefaultWindowWidth); |
62 |
+ |
iniChanged=true; |
63 |
+ |
} |
64 |
+ |
if(!this->vagoSettings->contains("WindowHeight")){ |
65 |
+ |
this->vagoSettings->setValue("WindowHeight", GlobalVars::DefaultWindowHeight); |
66 |
+ |
iniChanged=true; |
67 |
+ |
} |
68 |
|
if(!this->vagoSettings->contains("OniWindow")){ |
69 |
|
this->vagoSettings->setValue("OniWindow", true); |
70 |
|
iniChanged=true; |
87 |
|
this->workspaceWizardsLocation=this->workspaceLocation+"/Wizards"; |
88 |
|
this->AeLocation=this->vagoSettings->value("AeFolder").toString(); |
89 |
|
this->outputFolder=this->workspaceLocation; |
90 |
+ |
this->startedWindowWidth=this->vagoSettings->value("WindowWidth").toInt(); |
91 |
+ |
this->startedWindowHeight=this->vagoSettings->value("WindowHeight").toInt(); |
92 |
|
|
93 |
|
//Create our workspace if it doesn't exists yet |
94 |
|
if(!QDir(this->workspaceLocation).exists()){ |
102 |
|
this->myBar->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Fixed); |
103 |
|
this->myBar->setMinimumWidth(150); |
104 |
|
this->myBar->hide(); //hide while not being used |
105 |
+ |
ui->tbAbortConversion->hide(); //hide while not being used |
106 |
|
|
107 |
< |
ui->statusBar->addPermanentWidget(myBar); //this adds automatically in right |
107 |
> |
ui->statusBar->addPermanentWidget(this->myBar); //this adds automatically in right |
108 |
> |
ui->statusBar->addPermanentWidget(ui->tbAbortConversion); |
109 |
|
|
110 |
|
//Initialize list pointers |
111 |
|
this->listToProccess = new QStringList; |
134 |
|
ui->menuTarget_Platform->addAction(ui->actionWindows); |
135 |
|
ui->actionWindows->setChecked(false); |
136 |
|
ui->actionMac_Windows_demo->setChecked(true); |
137 |
< |
resize(800,600); // Mac OS pcs should be able to render this resolution without any problem. It's also better |
138 |
< |
// because the components on mac use more space |
137 |
> |
// resize(800,600); // Mac OS pcs should be able to render this resolution without any problem. It's also better |
138 |
> |
//// because the components on mac use more space |
139 |
|
#else |
140 |
< |
resize(640,480); |
140 |
> |
//resize(640,480); // windows stuff |
141 |
|
#endif |
142 |
|
|
143 |
+ |
resize(this->startedWindowWidth,this->startedWindowHeight); |
144 |
+ |
|
145 |
|
connectSlots(); |
146 |
|
|
147 |
|
//Commands Mapping |
148 |
|
this->commandMap = QHash<QString, QString>(); |
149 |
|
mapCommands(); |
150 |
|
|
151 |
< |
updateItemsLoaded(ui->twSourcesGeneral); |
151 |
> |
updateItemsLoaded(ui->twSourcesXML); |
152 |
|
|
153 |
|
this->myLogger->writeString("Application started."); |
154 |
|
} |
217 |
|
QDesktopServices::openUrl(QUrl("file:///"+this->outputFolder)); |
218 |
|
} |
219 |
|
|
220 |
+ |
void MainWindow::on_tbAbortConversion_clicked() |
221 |
+ |
{ |
222 |
+ |
if(Util::showQuestionPopUp(this,"Are you sure you want to abort the current conversion?")){ |
223 |
+ |
emit terminateCurrProcess(); |
224 |
+ |
} |
225 |
+ |
} |
226 |
+ |
|
227 |
|
void MainWindow::on_cbEnvMap_toggled(bool checked) |
228 |
|
{ |
229 |
|
ui->leEnvMapTexture->setEnabled(checked); |
239 |
|
ui->leAnimationName->setEnabled(checked); |
240 |
|
} |
241 |
|
|
242 |
< |
void MainWindow::on_cbCamera_toggled(bool checked) |
222 |
< |
{ |
223 |
< |
if(checked){ |
224 |
< |
ui->cbGeometry->setChecked(false); |
225 |
< |
} |
226 |
< |
} |
227 |
< |
|
228 |
< |
void MainWindow::on_cbGeometry_toggled(bool checked) |
242 |
> |
void MainWindow::on_cbSpecificFilesLevels_toggled(bool checked) |
243 |
|
{ |
244 |
< |
ui->leGeometryName->setEnabled(checked); |
231 |
< |
if(checked){ |
232 |
< |
ui->cbCamera->setChecked(false); |
233 |
< |
} |
244 |
> |
ui->leSpecificFilesLevels->setEnabled(checked); |
245 |
|
} |
246 |
|
|
247 |
|
void MainWindow::on_actionCheck_For_Updates_triggered() |
280 |
|
result->deleteLater(); |
281 |
|
} |
282 |
|
|
283 |
< |
void MainWindow::on_pbAddSourceGeneral_clicked() |
283 |
> |
void MainWindow::on_pbAddSourceXML_clicked() |
284 |
|
{ |
285 |
< |
if(QString::compare(ui->cbFromGeneral->currentText(),"ONI",Qt::CaseSensitive)==0 && QString::compare(ui->cbToGeneral->currentText(),"DAT",Qt::CaseSensitive)==0){ //CaseSensitive is faster) |
275 |
< |
addFilesSource(ui->twSourcesGeneral,Util::multipleDirDialog("Choose folders with ONIs...")); |
276 |
< |
} |
277 |
< |
else{ |
278 |
< |
addFilesSource( ui->twSourcesGeneral,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)")); |
279 |
< |
} |
285 |
> |
addFilesSource( ui->twSourcesXML,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)")); |
286 |
|
} |
287 |
|
|
288 |
|
void MainWindow::on_pbAddSourceTextures_clicked() |
290 |
|
addFilesSource( ui->twSourcesTextures, QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)")); |
291 |
|
} |
292 |
|
|
293 |
< |
void MainWindow::on_pbAddSourceModels_clicked() |
293 |
> |
void MainWindow::on_pbAddSourceObjects_clicked() |
294 |
|
{ |
295 |
< |
addFilesSource( ui->twSourcesModels,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)")); |
295 |
> |
addFilesSource( ui->twSourcesObjects,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)")); |
296 |
|
} |
297 |
|
|
298 |
< |
void MainWindow::on_pbAddSourceAnimations_clicked() |
298 |
> |
void MainWindow::on_pbAddSourceCharacters_clicked() |
299 |
|
{ |
300 |
< |
addFilesSource( ui->twSourcesAnimations,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)")); |
300 |
> |
addFilesSource( ui->twSourcesCharacters,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)")); |
301 |
|
} |
302 |
|
|
303 |
|
void MainWindow::on_pbAddSourceLevels_clicked() |
304 |
|
{ |
305 |
< |
addFilesSource( ui->twSourcesLevels,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)")); |
305 |
> |
if(QString::compare(ui->cbFromXML->currentText(),"ONI FILES",Qt::CaseSensitive)==0 && QString::compare(ui->cbToXML->currentText(),"DAT",Qt::CaseSensitive)==0){ //CaseSensitive is faster) |
306 |
> |
addFilesSource(ui->twSourcesLevels,Util::multipleDirDialog("Choose folders with ONIs...")); |
307 |
> |
} |
308 |
> |
else{ |
309 |
> |
addFilesSource(ui->twSourcesLevels,QFileDialog::getOpenFileNames(this,"Choose the files...","./" , "All Files (*.*)")); |
310 |
> |
} |
311 |
|
} |
312 |
|
|
313 |
|
void MainWindow::on_pbAddSourceMisc_clicked() |
339 |
|
to = QString(fromTo).remove(0,fromTo.lastIndexOf("> ")+2); //+2 to start after "> " |
340 |
|
|
341 |
|
//Pre-processing (check if the files/folders received are valid), e.g. check for ONI->DAT if are only given folders and not files |
342 |
< |
if(QString::compare(from,"ONI",Qt::CaseSensitive)==0 && QString::compare(to,"DAT",Qt::CaseSensitive)==0){ |
342 |
> |
if(from=="ONI FILES" && to=="DAT"){ |
343 |
|
//check if it's a folder |
344 |
|
foreach(QString myFile, files){ |
345 |
|
if(!QDir(myFile).exists()){ |
391 |
|
updateItemsLoaded(myTable); |
392 |
|
} |
393 |
|
|
394 |
< |
QString MainWindow::fileParsingGeneral(QString myOutputFolder, QString from, QString to , QString file){ |
394 |
> |
QString MainWindow::fileParsingXML(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file){ |
395 |
|
|
396 |
|
QString command; |
397 |
|
|
398 |
< |
if(QString::compare(from,"ONI",Qt::CaseSensitive)==0 && QString::compare(to,"DAT",Qt::CaseSensitive)==0){ //CaseSensitive is faster |
399 |
< |
|
389 |
< |
QString datName; |
390 |
< |
|
391 |
< |
if(ui->cbDatGeneral->isChecked()){ |
392 |
< |
if(ui->leTargetDatGeneral->text().isEmpty()){ |
393 |
< |
showErrStatusMessage("Checkbox '"+ui->cbDatGeneral->text()+"' is selected. The name cannot be empty."); |
394 |
< |
return ""; |
395 |
< |
} |
396 |
< |
datName+=QString(myOutputFolder).insert(myOutputFolder.size()-1,ui->leTargetDatGeneral->text()); //set name inputted by user |
397 |
< |
if(!ui->leTargetDatGeneral->text().toUpper().endsWith(".DAT")){ |
398 |
< |
datName.insert(datName.size()-1,".dat"); //append extension if necessary (-1 to maintain final quote) |
399 |
< |
} |
400 |
< |
} |
401 |
< |
else{ |
402 |
< |
datName=QString(myOutputFolder).insert(myOutputFolder.size()-1,Util::cutName(file).remove("/")+".dat"); //if none iputted set the same name of input file |
403 |
< |
} |
404 |
< |
|
405 |
< |
if(ui->actionWindows->isChecked()){ //is target plataform select windows? |
406 |
< |
return command=this->commandMap.value("general->"+from+"->"+to+"(PC)")+" "+ file + " "+datName; |
407 |
< |
} |
408 |
< |
else{ |
409 |
< |
return command=this->commandMap.value("general->"+from+"->"+to+"(demoPCMAC)")+" "+ file + " "+datName; |
410 |
< |
} |
398 |
> |
if(from=="ONI" && to=="XML"){ |
399 |
> |
return command=this->commandMap.value(tabTitle+"->"+from+"->"+to)+" "+myOutputFolder+" "+file; |
400 |
|
} |
401 |
< |
else if(QString::compare(from,"ONI",Qt::CaseSensitive)==0 && QString::compare(to,"XML",Qt::CaseSensitive)==0 && ui->cbTRAMGeneral->isChecked()){ |
402 |
< |
if(ui->leTRAMGeneral->text().isEmpty()){ |
414 |
< |
showErrStatusMessage("Checkbox '"+ui->cbTRAMGeneral->text()+"' is selected. The source cannot be empty."); |
415 |
< |
return ""; |
416 |
< |
} |
417 |
< |
return command=this->commandMap.value("general->"+from+"->"+to)+" "+myOutputFolder+" "+this->commandMap.value("general->"+ui->cbTRAMGeneral->text())+file + " "+ Util::normalizeAndQuote(ui->leTRAMGeneral->text()); |
418 |
< |
} |
419 |
< |
else{ |
420 |
< |
return command=this->commandMap.value("general->"+from+"->"+to)+" "+myOutputFolder+" "+file; |
401 |
> |
else if(from=="XML" && to=="ONI"){ |
402 |
> |
return command=this->commandMap.value(tabTitle+"->"+from+"->"+to)+" "+myOutputFolder+" "+file; |
403 |
|
} |
404 |
|
|
405 |
+ |
return ""; |
406 |
+ |
|
407 |
|
} |
408 |
|
|
409 |
< |
QString MainWindow::fileParsingTextures(QString myOutputFolder, QString from, QString to , QString file){ |
409 |
> |
QString MainWindow::fileParsingTextures(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file){ |
410 |
|
|
411 |
< |
QString command=this->commandMap.value("textures->"+from+"->"+to)+" "+myOutputFolder; |
411 |
> |
QString command=this->commandMap.value(tabTitle+"->"+from+"->"+to)+" "+myOutputFolder; |
412 |
|
|
413 |
|
if(ui->gbTextures->isEnabled()){ //faster than compare strings (if is DAT/ONI) |
414 |
|
|
415 |
|
if(ui->cbMipMapsTextures->isChecked()){ |
416 |
< |
command+=" "+this->commandMap.value("textures->"+ui->cbMipMapsTextures->text()); |
416 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbMipMapsTextures->text()); |
417 |
|
} |
418 |
|
|
419 |
|
if(ui->cbNoUwrap->isChecked()){ |
420 |
< |
command+=" "+this->commandMap.value("textures->"+ui->cbNoUwrap->text()); |
420 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbNoUwrap->text()); |
421 |
|
} |
422 |
|
|
423 |
|
if(ui->cbNoVwrap->isChecked()){ |
424 |
< |
command+=" "+this->commandMap.value("textures->"+ui->cbNoVwrap->text()); |
424 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbNoVwrap->text()); |
425 |
|
} |
426 |
|
|
427 |
|
if(ui->cbLarge->isChecked()){ |
428 |
< |
command+=" "+this->commandMap.value("textures->"+ui->cbLarge->text()); |
428 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbLarge->text()); |
429 |
|
} |
430 |
|
|
431 |
|
if(ui->rbBGR32->isChecked()){ |
432 |
< |
command+=" "+this->commandMap.value("textures->"+ui->rbBGR32->text()); |
432 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbBGR32->text()); |
433 |
|
} |
434 |
|
else if(ui->rbBGRA32->isChecked()){ |
435 |
< |
command+=" "+this->commandMap.value("textures->"+ui->rbBGRA32->text()); |
435 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbBGRA32->text()); |
436 |
|
} |
437 |
|
else if(ui->rbBGR555->isChecked()){ |
438 |
< |
command+=" "+this->commandMap.value("textures->"+ui->rbBGR555->text()); |
438 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbBGR555->text()); |
439 |
|
} |
440 |
|
else if(ui->rbBGRA5551->isChecked()){ |
441 |
< |
command+=" "+this->commandMap.value("textures->"+ui->rbBGRA5551->text()); |
441 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbBGRA5551->text()); |
442 |
|
} |
443 |
|
else if(ui->rbBGRA444->isChecked()){ |
444 |
< |
command+=" "+this->commandMap.value("textures->"+ui->rbBGRA444->text()); |
444 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbBGRA444->text()); |
445 |
|
} |
446 |
|
else{ //dxt1 checked |
447 |
< |
command+=" "+this->commandMap.value("textures->"+ui->rbDxt1->text()); |
447 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->rbDxt1->text()); |
448 |
|
} |
449 |
|
|
450 |
|
if(ui->cbEnvMap->isChecked()){ |
452 |
|
showErrStatusMessage("Checkbox '"+ui->cbEnvMap->text()+"' is selected. The name texture name cannot be empty."); |
453 |
|
return ""; |
454 |
|
} |
455 |
< |
command+=" "+this->commandMap.value("textures->"+ui->cbEnvMap->text()) + ui->leEnvMapTexture->text().remove(".oni",Qt::CaseInsensitive); |
455 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbEnvMap->text()) + ui->leEnvMapTexture->text().remove(".oni",Qt::CaseInsensitive); |
456 |
|
} |
457 |
|
} |
458 |
|
|
459 |
|
return command+=" "+file; //add source |
460 |
|
} |
461 |
|
|
462 |
< |
QString MainWindow::fileParsingModels(QString myOutputFolder, QString from, QString to , QString file){ |
462 |
> |
QString MainWindow::fileParsingCharacters(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file){ |
463 |
|
|
464 |
< |
QString command=this->commandMap.value("models->"+from+"->"+to)+" "+myOutputFolder; |
464 |
> |
QString command=this->commandMap.value(tabTitle+"->"+from+"->"+to)+" "+myOutputFolder + " " + file ; |
465 |
|
|
482 |
– |
//TODO: This can be optimized. When some are not enable others are. |
483 |
– |
if(ui->cbTexture->isChecked()){ |
484 |
– |
if(ui->leTextureName->text().isEmpty()){ |
485 |
– |
showErrStatusMessage("Checkbox '"+ui->cbTexture->text()+"' is selected. The name cannot be empty."); |
486 |
– |
return ""; |
487 |
– |
} |
488 |
– |
command+=" "+this->commandMap.value("models->"+ui->cbTexture->text()) + ui->leTextureName->text().remove(".oni",Qt::CaseInsensitive); |
489 |
– |
} |
466 |
|
|
467 |
|
if(ui->cbCellShading->isChecked()){ |
468 |
< |
command+=" "+this->commandMap.value("models->"+ui->cbCellShading->text()); |
468 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbCellShading->text()); |
469 |
|
} |
470 |
|
|
471 |
|
if(ui->cbNormals->isChecked()){ |
472 |
< |
command+=" "+this->commandMap.value("models->"+ui->cbNormals->text()); |
472 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbNormals->text()); |
473 |
|
} |
474 |
|
|
475 |
< |
if(ui->cbWithAnimation->isEnabled()){ |
476 |
< |
if(ui->cbWithAnimation->isChecked()){ |
477 |
< |
command+=" "+this->commandMap.value("models->"+ui->cbWithAnimation->text())+ui->leAnimationName->text().remove(".oni",Qt::CaseInsensitive); |
478 |
< |
} |
503 |
< |
else{ |
504 |
< |
command+=" "+this->commandMap.value("models->No Animation"); |
475 |
> |
if(ui->cbWithTRBS_ONCC->isChecked()){ |
476 |
> |
if(ui->leTRBS_ONCC->text().isEmpty()){ |
477 |
> |
showErrStatusMessage("Checkbox '"+ui->cbWithTRBS_ONCC->text()+"' is selected. The name cannot be empty."); |
478 |
> |
return ""; |
479 |
|
} |
506 |
– |
} |
480 |
|
|
481 |
+ |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbWithTRBS_ONCC->text())+Util::normalizeAndQuote(ui->leTRBS_ONCC->text()); |
482 |
+ |
} |
483 |
|
|
484 |
< |
return command+=" "+file; //add source |
484 |
> |
return command; |
485 |
|
} |
486 |
|
|
512 |
– |
QString MainWindow::fileParsingAnimations(QString myOutputFolder, QString from, QString to , QString file){ |
487 |
|
|
488 |
< |
QString command=this->commandMap.value("animations->"+from+"->"+to)+" "+myOutputFolder + " " + file ; |
488 |
> |
QString MainWindow::fileParsingObjects(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file){ |
489 |
> |
|
490 |
> |
QString command=this->commandMap.value(tabTitle+"->"+from+"->"+to)+" "+myOutputFolder; |
491 |
|
|
492 |
< |
if(ui->cbCamera->isChecked()){ |
493 |
< |
command+=" "+this->commandMap.value("animations->"+ui->cbCamera->text()); |
492 |
> |
//TODO: This can be optimized. When some are not enable others are. |
493 |
> |
if(ui->cbTexture->isChecked()){ |
494 |
> |
if(ui->leTextureName->text().isEmpty()){ |
495 |
> |
showErrStatusMessage("Checkbox '"+ui->cbTexture->text()+"' is selected. The file source cannot be empty."); |
496 |
> |
return ""; |
497 |
> |
} |
498 |
> |
command+=" "+this->commandMap.value(tabTitle+"->"+ui->cbTexture->text()) + ui->leTextureName->text(); |
499 |
|
} |
500 |
< |
else if(ui->cbGeometry->isChecked()){ |
501 |
< |
if(ui->leGeometryName->text().isEmpty()){ |
502 |
< |
showErrStatusMessage("Checkbox '"+ui->cbGeometry->text()+"' is selected. The geometry file path cannot be empty."); |
500 |
> |
else if(ui->cbWithAnimation->isChecked()){ |
501 |
> |
if(ui->leAnimationName->text().isEmpty()){ |
502 |
> |
showErrStatusMessage("Checkbox '"+ui->cbWithAnimation->text()+"' is selected. The file source cannot be empty."); |
503 |
|
return ""; |
504 |
|
} |
505 |
< |
command+=" "+this->commandMap.value("animations->"+ui->cbGeometry->text()) + (ui->leGeometryName->text().startsWith('"')?ui->leGeometryName->text():Util::insertQuotes(ui->leGeometryName->text())); |
505 |
> |
command+=" "+Util::normalizeAndQuote(ui->leAnimationName->text()) + " " + this->commandMap.value(tabTitle+"->"+ui->cbWithAnimation->text()) + file; |
506 |
> |
return command; |
507 |
|
} |
508 |
|
|
509 |
< |
return command; |
509 |
> |
if(from=="OBAN ONI (cam)"){ |
510 |
> |
command+=" -geom:camera"; |
511 |
> |
} |
512 |
> |
|
513 |
> |
return command+=" "+file; //add source |
514 |
|
} |
515 |
|
|
516 |
< |
QString MainWindow::fileParsingLevels(QString myOutputFolder, QString from, QString to , QString file){ |
516 |
> |
QString MainWindow::fileParsingLevels(QString tabTitle, QString myOutputFolder, QString from, QString to , QString file){ |
517 |
|
|
518 |
|
QString datName, command; |
519 |
|
|
520 |
< |
command=this->commandMap.value("levels->"+from+"->"+to)+" "+myOutputFolder+" "+file; |
520 |
> |
if(!(from=="ONI FILES" && to=="DAT")){ // to all except this one |
521 |
> |
|
522 |
> |
command=this->commandMap.value(tabTitle+"->"+from+"->"+to); |
523 |
> |
|
524 |
> |
if(ui->cbSpecificFilesLevels->isChecked()){ |
525 |
|
|
526 |
< |
if(from=="MASTER XML" && to=="DAT"){ |
527 |
< |
command+=GlobalVars::OniSplitProcSeparator; //insert mark so we know this action will take 2 commands |
526 |
> |
if(ui->leSpecificFilesLevels->text().isEmpty()){ |
527 |
> |
showErrStatusMessage("Checkbox '"+ui->cbSpecificFilesLevels->text()+"' is selected. The files pattern cannot be empty."); |
528 |
> |
return ""; |
529 |
> |
} |
530 |
> |
|
531 |
> |
command+=":"+ui->leSpecificFilesLevels->text(); |
532 |
> |
} |
533 |
> |
command+=" "+myOutputFolder+" "+file; |
534 |
> |
|
535 |
> |
} |
536 |
|
|
537 |
+ |
if((from=="ONI FILES" || from=="MASTER XML") && to=="DAT"){ // almost the same command for both |
538 |
|
QString datName; |
539 |
+ |
|
540 |
+ |
if(from=="MASTER XML"){ |
541 |
+ |
command+=GlobalVars::OniSplitProcSeparator; //insert mark so we know this action will take 2 commands |
542 |
+ |
} |
543 |
+ |
|
544 |
|
if(ui->cbDatLevels->isChecked()){ |
545 |
|
if(ui->leTargetDatLevels->text().isEmpty()){ |
546 |
|
showErrStatusMessage("Checkbox '"+ui->cbDatLevels->text()+"' is selected. The name cannot be empty."); |
552 |
|
} |
553 |
|
} |
554 |
|
else{ |
555 |
< |
datName=QString(myOutputFolder).insert(myOutputFolder.size()-1,Util::cutName(file).remove("/").replace(".xml",".dat",Qt::CaseInsensitive)); //if none iputted set the same name of input file |
555 |
> |
if(from=="ONI FILES"){ |
556 |
> |
datName=QString(myOutputFolder).insert(myOutputFolder.size()-1,Util::cutName(file).remove("/")+".dat"); //if none iputted set the same name of input file |
557 |
> |
} |
558 |
> |
else if(from=="MASTER XML"){ |
559 |
> |
datName=QString(myOutputFolder).insert(myOutputFolder.size()-1,Util::cutName(file).remove("/").replace(".xml",".dat",Qt::CaseInsensitive)); //if none iputted set the same name of input file |
560 |
> |
} |
561 |
|
} |
562 |
< |
|
563 |
< |
if(ui->actionWindows->isChecked()){ //is target plataform select windows? |
564 |
< |
command+=this->commandMap.value("general->ONI->"+to+"(PC)")+" "+myOutputFolder+" "+datName; //add second command |
562 |
> |
if(from=="ONI FILES"){ |
563 |
> |
if(ui->actionWindows->isChecked()){ //is target plataform select windows? |
564 |
> |
return command=this->commandMap.value(tabTitle+"->"+from+"->"+to+"(PC)")+" "+ file + " "+datName; |
565 |
> |
} |
566 |
> |
else{ |
567 |
> |
return command=this->commandMap.value(tabTitle+"->"+from+"->"+to+"(demoPCMAC)")+" "+ file + " "+datName; |
568 |
> |
} |
569 |
|
} |
570 |
< |
else{ |
571 |
< |
command+=this->commandMap.value("general->ONI->"+to+"(demoPCMAC)")+" "+myOutputFolder+" "+datName; //add second command |
570 |
> |
else if(from=="MASTER XML"){ |
571 |
> |
if(ui->actionWindows->isChecked()){ //is target plataform select windows? |
572 |
> |
command+=this->commandMap.value(tabTitle+"->ONI FILES->"+to+"(PC)")+" "+myOutputFolder+" "+datName; //add second command |
573 |
> |
} |
574 |
> |
else{ |
575 |
> |
command+=this->commandMap.value(tabTitle+"->ONI FILES->"+to+"(demoPCMAC)")+" "+myOutputFolder+" "+datName; //add second command |
576 |
> |
} |
577 |
|
} |
578 |
|
} |
579 |
|
|
599 |
|
|
600 |
|
//parse all files (separated by spaces) |
601 |
|
while(true){ |
602 |
< |
nextIndex=additionalFiles.indexOf(" ",currentIndex+1); |
602 |
> |
nextIndex=additionalFiles.indexOf(";",currentIndex+1); |
603 |
|
|
604 |
|
command += " "+Util::normalizeAndQuote(additionalFiles.mid(currentIndex,(nextIndex-currentIndex))); |
605 |
|
|
611 |
|
} |
612 |
|
|
613 |
|
if(ui->cbGridsLevels->isChecked()){ |
614 |
< |
command+=GlobalVars::OniSplitProcSeparator+this->commandMap.value("levels->"+ui->cbGridsLevels->text())+" "+Util::normalizeAndQuote(ui->leBnvLevels->text())+" "+file+" -out:"+myOutputFolder; |
614 |
> |
command+=GlobalVars::OniSplitProcSeparator+this->commandMap.value(tabTitle+"->"+ui->cbGridsLevels->text())+" "+Util::normalizeAndQuote(ui->leBnvLevels->text())+" "+file+" -out:"+myOutputFolder; |
615 |
|
} |
616 |
|
|
617 |
|
return command; |
640 |
|
myTable->updateTableToolTips(twSize); //Update tool tips |
641 |
|
} |
642 |
|
|
643 |
< |
void MainWindow::on_pbConvertGeneral_clicked() |
643 |
> |
void MainWindow::on_pbConvertXML_clicked() |
644 |
|
{ |
645 |
< |
startConversion(ui->twSourcesGeneral); |
645 |
> |
startConversion(ui->twSourcesXML); |
646 |
|
} |
647 |
|
|
648 |
|
void MainWindow::on_pbConvertTextures_clicked() |
650 |
|
startConversion(ui->twSourcesTextures); |
651 |
|
} |
652 |
|
|
653 |
< |
void MainWindow::on_pbConvertModels_clicked() |
653 |
> |
void MainWindow::on_pbConvertObjects_clicked() |
654 |
|
{ |
655 |
< |
startConversion(ui->twSourcesModels); |
655 |
> |
startConversion(ui->twSourcesObjects); |
656 |
|
} |
657 |
|
|
658 |
< |
void MainWindow::on_pbConvertAnimations_clicked() |
658 |
> |
void MainWindow::on_pbConvertCharacters_clicked() |
659 |
|
{ |
660 |
< |
startConversion(ui->twSourcesAnimations); |
660 |
> |
startConversion(ui->twSourcesCharacters); |
661 |
|
} |
662 |
|
|
663 |
|
void MainWindow::on_pbConvertLevels_clicked() |
685 |
|
return; |
686 |
|
} |
687 |
|
|
688 |
< |
if(myBar->isVisible()){ |
688 |
> |
if(this->myBar->isVisible()){ |
689 |
|
Util::showErrorPopUp("Another conversion is progress. Please wait until it finishes."); |
690 |
|
return; |
691 |
|
} |
704 |
|
this->myBar->setValue(0); |
705 |
|
this->myBar->show(); |
706 |
|
this->myBar->setMaximum(max); |
707 |
+ |
ui->tbAbortConversion->show(); |
708 |
|
} |
709 |
|
|
710 |
|
void MainWindow::TupdateProgressBar(){ |
714 |
|
void MainWindow::TresultConversion(QString result, int numErrors){ |
715 |
|
QApplication::alert(this); //Show a notification if window is not active |
716 |
|
this->myBar->hide(); |
717 |
+ |
ui->tbAbortConversion->hide(); |
718 |
|
|
719 |
|
if(numErrors!=0){ |
720 |
|
QString sNumErrors=QString::number(numErrors); |
733 |
|
} |
734 |
|
} |
735 |
|
|
736 |
+ |
void MainWindow::TconversionAborted(){ |
737 |
+ |
this->myBar->hide(); |
738 |
+ |
ui->tbAbortConversion->hide(); |
739 |
+ |
|
740 |
+ |
showErrStatusMessage("Conversion was aborted."); |
741 |
+ |
} |
742 |
+ |
|
743 |
|
void MainWindow::showErrStatusMessage(QString message){ |
744 |
|
|
745 |
|
QPalette myPalete = QPalette(); |
759 |
|
} |
760 |
|
|
761 |
|
void MainWindow::mapCommands(){ |
762 |
< |
////////////////////////////////////////////////////////////////////////General Commands |
763 |
< |
this->commandMap.insert("general->DAT->ONI","-export"); |
764 |
< |
//this->commandMap.insert("general->ONI->DAT","-import"); //Not used. |
738 |
< |
this->commandMap.insert("general->ONI->DAT(PC)","-import:nosep"); |
739 |
< |
this->commandMap.insert("general->ONI->DAT(demoPCMAC)","-import:sep"); |
740 |
< |
this->commandMap.insert("general->ONI->XML","-extract:xml"); |
741 |
< |
this->commandMap.insert("general->XML->ONI","-create"); |
762 |
> |
////////////////////////////////////////////////////////////////////////XML Commands |
763 |
> |
this->commandMap.insert("xml->ONI->XML","-extract:xml"); |
764 |
> |
this->commandMap.insert("xml->XML->ONI","-create"); |
765 |
|
//######################General Options |
766 |
< |
this->commandMap.insert("general->"+ui->cbTRAMGeneral->text(),"-anim-body:"); |
766 |
> |
|
767 |
|
//Possible Combinations |
768 |
< |
this->commandMap.insertMulti("general->DAT","ONI"); |
769 |
< |
this->commandMap.insertMulti("general->ONI","DAT"); |
747 |
< |
this->commandMap.insertMulti("general->ONI","XML"); |
748 |
< |
this->commandMap.insertMulti("general->XML","ONI"); |
768 |
> |
this->commandMap.insertMulti("xml->ONI","XML"); |
769 |
> |
this->commandMap.insertMulti("xml->XML","ONI"); |
770 |
|
|
771 |
|
////////////////////////////////////////////////////////////////////////Textures Commands |
772 |
< |
this->commandMap.insert("textures->DAT / ONI->DDS","-extract:dds"); |
773 |
< |
this->commandMap.insert("textures->DAT / ONI->TGA","-extract:tga"); |
774 |
< |
this->commandMap.insert("textures->DAT / ONI->PNG","-extract:png"); |
775 |
< |
this->commandMap.insert("textures->DAT / ONI->JPG","-extract:jpg"); |
776 |
< |
this->commandMap.insert("textures->DDS / TGA / PNG / JPG->ONI","-create:txmp"); |
772 |
> |
this->commandMap.insert("textures->DAT / TXMP ONI->DDS","-extract:dds"); |
773 |
> |
this->commandMap.insert("textures->DAT / TXMP ONI->TGA","-extract:tga"); |
774 |
> |
this->commandMap.insert("textures->DAT / TXMP ONI->PNG","-extract:png"); |
775 |
> |
this->commandMap.insert("textures->DAT / TXMP ONI->JPG","-extract:jpg"); |
776 |
> |
this->commandMap.insert("textures->TGA / DDS / PNG / JPG->TXMP ONI","-create:txmp"); |
777 |
|
//######################Textures Options |
778 |
|
this->commandMap.insert("textures->"+ui->rbBGR32->text(),"-format:bgr32"); |
779 |
|
this->commandMap.insert("textures->"+ui->rbBGRA32->text(),"-format:bgra32"); |
787 |
|
this->commandMap.insert("textures->"+ui->cbLarge->text(),"-large"); |
788 |
|
this->commandMap.insert("textures->"+ui->cbEnvMap->text(),"-envmap:"); |
789 |
|
//Possible Combinations |
790 |
< |
this->commandMap.insertMulti("textures->DAT / ONI","DDS"); |
791 |
< |
this->commandMap.insertMulti("textures->DAT / ONI","TGA"); |
792 |
< |
this->commandMap.insertMulti("textures->DAT / ONI","PNG"); |
793 |
< |
this->commandMap.insertMulti("textures->DAT / ONI","JPG"); |
794 |
< |
this->commandMap.insertMulti("textures->DDS / TGA / PNG / JPG","ONI"); |
795 |
< |
|
796 |
< |
////////////////////////////////////////////////////////////////////////Models Commands |
797 |
< |
this->commandMap.insert("models->ONI->OBJ","-extract:obj"); |
798 |
< |
this->commandMap.insert("models->ONI->DAE","-extract:dae -search "+Util::insertQuotes(this->AeLocation+"/GameDataFolder/level0_Final")); |
799 |
< |
this->commandMap.insert("models->OBJ->ONI","-create:m3gm"); |
800 |
< |
this->commandMap.insert("models->DAE->ONI","-create:trbs"); |
801 |
< |
//######################Models Options |
802 |
< |
this->commandMap.insert("models->"+ui->cbCellShading->text(),"-cel"); |
803 |
< |
this->commandMap.insert("models->"+ui->cbNormals->text(),"-normals"); |
804 |
< |
this->commandMap.insert("models->"+ui->cbTexture->text(),"-tex:"); |
805 |
< |
this->commandMap.insert("models->"+ui->cbWithAnimation->text(),"-anim:"); |
806 |
< |
this->commandMap.insert("models->No Animation","-noanim"); //No label with this name so can't be dynamic |
790 |
> |
this->commandMap.insertMulti("textures->DAT / TXMP ONI","TGA"); |
791 |
> |
this->commandMap.insertMulti("textures->DAT / TXMP ONI","DDS"); |
792 |
> |
this->commandMap.insertMulti("textures->DAT / TXMP ONI","PNG"); |
793 |
> |
this->commandMap.insertMulti("textures->DAT / TXMP ONI","JPG"); |
794 |
> |
this->commandMap.insertMulti("textures->TGA / DDS / PNG / JPG","TXMP ONI"); |
795 |
> |
|
796 |
> |
////////////////////////////////////////////////////////////////////////Characters Commands |
797 |
> |
this->commandMap.insert("characters->TRAM ONI->XML / XML & DAE","-extract:xml"); |
798 |
> |
this->commandMap.insert("characters->TRBS / ONCC ONI->DAE","-extract:dae"); |
799 |
> |
this->commandMap.insert("characters->TRBS XML->TRBS ONI","-create"); |
800 |
> |
this->commandMap.insert("characters->TRBS DAE->TRBS ONI","-create:trbs"); |
801 |
> |
this->commandMap.insert("characters->FILM DAT->XML","film2xml"); |
802 |
> |
|
803 |
> |
//######################Characters Options |
804 |
> |
this->commandMap.insert("characters->"+ui->cbWithTRBS_ONCC->text(),"-anim-body:"); |
805 |
> |
this->commandMap.insert("characters->"+ui->cbCellShading->text(),"-cel"); |
806 |
> |
this->commandMap.insert("characters->"+ui->cbNormals->text(),"-normals"); |
807 |
|
//Possible Combinations |
808 |
< |
this->commandMap.insertMulti("models->ONI","OBJ"); |
809 |
< |
this->commandMap.insertMulti("models->ONI","DAE"); |
810 |
< |
this->commandMap.insertMulti("models->OBJ","ONI"); |
811 |
< |
this->commandMap.insertMulti("models->DAE","ONI"); |
812 |
< |
|
813 |
< |
////////////////////////////////////////////////////////////////////////Animations Commands |
814 |
< |
this->commandMap.insert("animations->ONI->DAE","-extract:dae"); |
815 |
< |
this->commandMap.insert("animations->FILM DAT->XML","film2xml"); |
816 |
< |
//######################Animations Options |
817 |
< |
this->commandMap.insert("animations->"+ui->cbCamera->text(),"-geom:camera"); |
818 |
< |
this->commandMap.insert("animations->"+ui->cbGeometry->text(),"-geom:"); |
808 |
> |
this->commandMap.insertMulti("characters->TRAM ONI","XML / XML & DAE"); |
809 |
> |
this->commandMap.insertMulti("characters->TRBS / ONCC ONI","DAE"); |
810 |
> |
this->commandMap.insertMulti("characters->DAE","TRBS ONI"); |
811 |
> |
this->commandMap.insertMulti("characters->TRBS DAE","TRBS ONI"); |
812 |
> |
this->commandMap.insertMulti("characters->TRBS XML","TRBS ONI"); |
813 |
> |
this->commandMap.insertMulti("characters->FILM DAT","XML"); |
814 |
> |
|
815 |
> |
////////////////////////////////////////////////////////////////////////Objects Commands |
816 |
> |
this->commandMap.insert("objects->M3GM ONI->OBJ","-extract:obj"); |
817 |
> |
this->commandMap.insert("objects->M3GM ONI->DAE","-extract:dae"); |
818 |
> |
this->commandMap.insert("objects->ONWC ONI->OBJ","-extract:obj"); |
819 |
> |
this->commandMap.insert("objects->ONWC ONI->DAE","-extract:dae"); |
820 |
> |
this->commandMap.insert("objects->OBAN ONI (cam)->DAE","-extract:dae"); |
821 |
> |
this->commandMap.insert("objects->OBJ->M3GM ONI","-create:m3gm"); |
822 |
> |
//######################Characters Options |
823 |
> |
this->commandMap.insert("objects->"+ui->cbTexture->text(),"-tex:"); |
824 |
> |
this->commandMap.insert("objects->"+ui->cbWithAnimation->text(),"-geom:"); |
825 |
|
//Possible Combinations |
826 |
< |
this->commandMap.insertMulti("animations->ONI","DAE"); |
827 |
< |
this->commandMap.insertMulti("animations->DAE","ONI"); |
828 |
< |
this->commandMap.insertMulti("animations->FILM DAT","XML"); |
826 |
> |
this->commandMap.insertMulti("objects->M3GM ONI","OBJ"); |
827 |
> |
this->commandMap.insertMulti("objects->M3GM ONI","DAE"); |
828 |
> |
this->commandMap.insertMulti("objects->ONWC ONI","OBJ"); |
829 |
> |
this->commandMap.insertMulti("objects->ONWC ONI","DAE"); |
830 |
> |
this->commandMap.insertMulti("objects->OBAN ONI (cam)","DAE"); |
831 |
> |
this->commandMap.insertMulti("objects->OBJ","M3GM ONI"); |
832 |
> |
|
833 |
|
|
834 |
|
////////////////////////////////////////////////////////////////////////Levels Commands |
835 |
< |
this->commandMap.insert("levels->ONI->DAE","-extract:dae -search "+Util::insertQuotes(this->AeLocation+"/GameDataFolder/level0_Final")); |
836 |
< |
this->commandMap.insert("levels->DAE->ONI","-create:akev"); |
835 |
> |
this->commandMap.insert("levels->DAT->ONI FILES","-export"); |
836 |
> |
//this->commandMap.insert("levels->ONI FILES->DAT","-import"); //Not used. |
837 |
> |
this->commandMap.insert("levels->ONI FILES->DAT(PC)","-import:nosep"); |
838 |
> |
this->commandMap.insert("levels->ONI FILES->DAT(demoPCMAC)","-import:sep"); |
839 |
> |
this->commandMap.insert("levels->AKEV ONI->DAE","-extract:dae"); |
840 |
> |
this->commandMap.insert("levels->DAE->AKEV ONI","-create:akev"); |
841 |
|
this->commandMap.insert("levels->MASTER XML->DAT","-create:level"); |
842 |
|
this->commandMap.insert("levels->MASTER XML->ONI FILES","-create:level"); |
843 |
|
//######################Levels Options |
844 |
|
this->commandMap.insert("levels->"+ui->cbGridsLevels->text(),"-grid:create"); |
845 |
|
//Possible Combinations |
846 |
< |
this->commandMap.insertMulti("levels->ONI","DAE"); |
847 |
< |
this->commandMap.insertMulti("levels->DAE","ONI"); |
846 |
> |
this->commandMap.insertMulti("levels->DAT","ONI FILES"); |
847 |
> |
this->commandMap.insertMulti("levels->ONI FILES","DAT"); |
848 |
> |
this->commandMap.insertMulti("levels->AKEV ONI","DAE"); |
849 |
> |
this->commandMap.insertMulti("levels->DAE","AKEV ONI"); |
850 |
|
this->commandMap.insertMulti("levels->MASTER XML","DAT"); |
851 |
|
this->commandMap.insertMulti("levels->MASTER XML","ONI FILES"); |
852 |
|
|
853 |
|
////////////////////////////////////////////////////////////////////////Misc Commands |
854 |
< |
this->commandMap.insert("misc->DAT / ONI->WAV","-extract:wav"); |
855 |
< |
this->commandMap.insert("misc->DAT / ONI->AIF","-extract:aif"); |
856 |
< |
this->commandMap.insert("misc->DAT / ONI->TXT","-extract:txt"); |
857 |
< |
this->commandMap.insert("misc->WAV / AIF->ONI","-create"); |
858 |
< |
this->commandMap.insert("misc->TXT->ONI","-create:subt"); |
854 |
> |
this->commandMap.insert("misc->DAT / SNDD ONI->WAV","-extract:wav"); |
855 |
> |
this->commandMap.insert("misc->DAT / SNDD ONI->AIF","-extract:aif"); |
856 |
> |
this->commandMap.insert("misc->DAT / SUBT ONI->TXT","-extract:txt"); |
857 |
> |
this->commandMap.insert("misc->WAV / AIF->SNDD ONI","-create"); |
858 |
> |
this->commandMap.insert("misc->TXT->SUBT ONI","-create:subt"); |
859 |
|
//Possible Combinations |
860 |
< |
this->commandMap.insertMulti("misc->DAT / ONI","WAV"); |
861 |
< |
this->commandMap.insertMulti("misc->DAT / ONI","AIF"); |
862 |
< |
this->commandMap.insertMulti("misc->DAT / ONI","TXT"); |
863 |
< |
this->commandMap.insertMulti("misc->WAV / AIF","ONI"); |
864 |
< |
this->commandMap.insertMulti("misc->TXT","ONI"); |
860 |
> |
this->commandMap.insertMulti("misc->DAT / SNDD ONI","WAV"); |
861 |
> |
this->commandMap.insertMulti("misc->DAT / SNDD ONI","AIF"); |
862 |
> |
this->commandMap.insertMulti("misc->DAT / SUBT ONI","TXT"); |
863 |
> |
this->commandMap.insertMulti("misc->WAV / AIF","SNDD ONI"); |
864 |
> |
this->commandMap.insertMulti("misc->TXT","SUBT ONI"); |
865 |
|
|
866 |
|
} |
867 |
|
|
868 |
< |
void MainWindow::on_cbFromGeneral_currentIndexChanged(const QString &arg1) |
868 |
> |
void MainWindow::on_cbFromXML_currentIndexChanged(const QString &arg1) |
869 |
|
{ |
870 |
< |
updateComboBox(arg1, ui->cbToGeneral, "general"); |
870 |
> |
updateComboBox(arg1, ui->cbToXML); |
871 |
|
} |
872 |
|
|
873 |
+ |
|
874 |
|
void MainWindow::on_cbFromTextures_currentIndexChanged(const QString &arg1) |
875 |
|
{ |
876 |
|
//Options are only used for DAT/ONI -> Image |
881 |
|
ui->gbTextures->setEnabled(true); |
882 |
|
} |
883 |
|
|
884 |
< |
updateComboBox(arg1, ui->cbToTextures, "textures"); |
884 |
> |
updateComboBox(arg1, ui->cbToTextures); |
885 |
|
} |
886 |
|
|
887 |
< |
void MainWindow::on_cbFromModels_currentIndexChanged(const QString &arg1) |
887 |
> |
void MainWindow::on_cbFromObjects_currentIndexChanged(const QString &arg1) |
888 |
|
{ |
851 |
– |
|
852 |
– |
ui->cbCellShading->setEnabled(false); |
853 |
– |
ui->cbCellShading->setChecked(false); |
854 |
– |
ui->cbNormals->setEnabled(false); |
855 |
– |
ui->cbNormals->setChecked(false); |
889 |
|
ui->cbTexture->setEnabled(false); |
890 |
|
ui->cbTexture->setChecked(false); |
891 |
|
ui->cbWithAnimation->setEnabled(false); |
892 |
|
ui->cbWithAnimation->setChecked(false); |
893 |
|
|
894 |
< |
if(QString::compare(arg1,"OBJ",Qt::CaseSensitive)==0){ //case sensitive is faster |
895 |
< |
ui->cbTexture->setEnabled(true); |
894 |
> |
if(QString::compare(arg1,"M3GM ONI",Qt::CaseSensitive)==0){ //case sensitive is faster |
895 |
> |
ui->cbWithAnimation->setEnabled(true); |
896 |
|
} |
897 |
< |
else if(QString::compare(arg1,"DAE",Qt::CaseSensitive)==0){ |
898 |
< |
ui->cbCellShading->setEnabled(true); |
866 |
< |
ui->cbNormals->setEnabled(true); |
897 |
> |
else if(QString::compare(arg1,"OBJ",Qt::CaseSensitive)==0){ |
898 |
> |
ui->cbTexture->setEnabled(true); |
899 |
|
} |
900 |
|
|
901 |
< |
updateComboBox(arg1, ui->cbToModels, "models"); |
901 |
> |
updateComboBox(arg1, ui->cbToObjects); |
902 |
|
} |
903 |
|
|
904 |
< |
void MainWindow::on_cbFromAnimations_currentIndexChanged(const QString &arg1) |
904 |
> |
void MainWindow::on_cbFromCharacters_currentIndexChanged(const QString &arg1) |
905 |
|
{ |
906 |
< |
ui->cbCamera->setEnabled(false); |
907 |
< |
ui->cbCamera->setChecked(false); |
908 |
< |
ui->cbGeometry->setEnabled(false); |
909 |
< |
ui->cbGeometry->setChecked(false); |
906 |
> |
ui->cbWithTRBS_ONCC->setEnabled(false); |
907 |
> |
ui->cbWithTRBS_ONCC->setChecked(false); |
908 |
> |
ui->cbCellShading->setEnabled(false); |
909 |
> |
ui->cbCellShading->setChecked(false); |
910 |
> |
ui->cbNormals->setEnabled(false); |
911 |
> |
ui->cbNormals->setChecked(false); |
912 |
|
|
913 |
< |
if(QString::compare(arg1,"ONI",Qt::CaseSensitive)==0){ //case sensitive is faster |
914 |
< |
ui->cbCamera->setEnabled(true); |
915 |
< |
ui->cbGeometry->setEnabled(true); |
913 |
> |
if(QString::compare(arg1,"TRAM ONI",Qt::CaseSensitive)==0){ //case sensitive is faster |
914 |
> |
ui->cbWithTRBS_ONCC->setEnabled(true); |
915 |
> |
} |
916 |
> |
else if(QString::compare(arg1,"TRBS DAE",Qt::CaseSensitive)==0){ |
917 |
> |
ui->cbNormals->setEnabled(true); |
918 |
> |
ui->cbCellShading->setEnabled(true); |
919 |
|
} |
920 |
|
|
921 |
< |
updateComboBox(arg1, ui->cbToAnimations, "animations"); |
921 |
> |
updateComboBox(arg1, ui->cbToCharacters); |
922 |
|
} |
923 |
|
|
924 |
|
void MainWindow::on_cbFromLevels_currentIndexChanged(const QString &arg1) |
925 |
|
{ |
926 |
< |
updateComboBox(arg1, ui->cbToLevels, "levels"); |
926 |
> |
|
927 |
> |
ui->cbSpecificFilesLevels->setEnabled(false); |
928 |
> |
ui->cbSpecificFilesLevels->setChecked(false); |
929 |
> |
ui->cbDatLevels->setEnabled(false); |
930 |
> |
ui->cbDatLevels->setChecked(false); |
931 |
> |
ui->cbBnvLevels->setEnabled(false); |
932 |
> |
ui->cbBnvLevels->setChecked(false); |
933 |
> |
ui->cbAdditionalSourcesLevels->setEnabled(false); |
934 |
> |
ui->cbAdditionalSourcesLevels->setChecked(false); |
935 |
> |
ui->cbGridsLevels->setEnabled(false); |
936 |
> |
ui->cbGridsLevels->setChecked(false); |
937 |
> |
|
938 |
> |
if(arg1=="DAT"){ //case sensitive is faster |
939 |
> |
ui->cbSpecificFilesLevels->setEnabled(true); |
940 |
> |
} |
941 |
> |
else if(arg1=="ONI FILES"){ //case sensitive is faster |
942 |
> |
ui->cbDatLevels->setEnabled(true); |
943 |
> |
} |
944 |
> |
else if(arg1=="DAE"){ |
945 |
> |
ui->cbBnvLevels->setEnabled(true); |
946 |
> |
ui->cbAdditionalSourcesLevels->setEnabled(true); |
947 |
> |
} |
948 |
> |
|
949 |
> |
updateComboBox(arg1, ui->cbToLevels); |
950 |
|
} |
951 |
|
|
952 |
|
void MainWindow::on_cbFromMisc_currentIndexChanged(const QString &arg1) |
953 |
|
{ |
954 |
< |
updateComboBox(arg1, ui->cbToMisc, "misc"); |
954 |
> |
updateComboBox(arg1, ui->cbToMisc); |
955 |
|
} |
956 |
|
|
957 |
< |
void MainWindow::updateComboBox(const QString &arg1, QComboBox *comboBox, const QString &identifier){ |
957 |
> |
void MainWindow::updateComboBox(const QString &arg1, QComboBox *comboBox){ |
958 |
> |
QString identifier=ui->tabWidget->tabText(ui->tabWidget->currentIndex()).toLower(); // get current tab title text (lower case) |
959 |
> |
|
960 |
|
comboBox->clear(); |
961 |
|
|
962 |
|
QStringList toUpdate=QStringList(); |
983 |
|
ui->actionWindows->setChecked(false); |
984 |
|
} |
985 |
|
|
986 |
< |
void MainWindow::on_pbRemoveSourceGeneral_clicked() |
986 |
> |
void MainWindow::on_pbRemoveSourceXML_clicked() |
987 |
|
{ |
988 |
< |
removeTableContents( ui->twSourcesGeneral); |
988 |
> |
removeTableContents( ui->twSourcesXML); |
989 |
|
} |
990 |
|
|
991 |
|
void MainWindow::on_pbRemoveSourceTextures_clicked() |
993 |
|
removeTableContents(ui->twSourcesTextures); |
994 |
|
} |
995 |
|
|
996 |
< |
void MainWindow::on_pbRemoveSourceModels_clicked() |
996 |
> |
void MainWindow::on_pbRemoveSourceObjects_clicked() |
997 |
|
{ |
998 |
< |
removeTableContents(ui->twSourcesModels); |
998 |
> |
removeTableContents(ui->twSourcesObjects); |
999 |
|
} |
1000 |
|
|
1001 |
< |
void MainWindow::on_pbRemoveSourceAnimations_clicked() |
1001 |
> |
void MainWindow::on_pbRemoveSourceCharacters_clicked() |
1002 |
|
{ |
1003 |
< |
removeTableContents(ui->twSourcesAnimations); |
1003 |
> |
removeTableContents(ui->twSourcesCharacters); |
1004 |
|
} |
1005 |
|
|
1006 |
|
void MainWindow::on_pbRemoveSourceLevels_clicked() |
1013 |
|
removeTableContents(ui->twSourcesMisc); |
1014 |
|
} |
1015 |
|
|
1016 |
< |
void MainWindow::on_pbClearSourcesGeneral_clicked() |
1016 |
> |
void MainWindow::on_pbClearSourcesXML_clicked() |
1017 |
|
{ |
1018 |
< |
clearTableContents(ui->twSourcesGeneral); |
1018 |
> |
clearTableContents(ui->twSourcesXML); |
1019 |
|
} |
1020 |
|
|
1021 |
|
void MainWindow::on_pbClearSourcesTextures_clicked() |
1023 |
|
clearTableContents(ui->twSourcesTextures); |
1024 |
|
} |
1025 |
|
|
1026 |
< |
void MainWindow::on_pbClearSourcesModels_clicked() |
1026 |
> |
void MainWindow::on_pbClearSourcesObjects_clicked() |
1027 |
|
{ |
1028 |
< |
clearTableContents(ui->twSourcesModels); |
1028 |
> |
clearTableContents(ui->twSourcesObjects); |
1029 |
|
} |
1030 |
|
|
1031 |
< |
void MainWindow::on_pbClearSourcesAnimations_clicked() |
1031 |
> |
void MainWindow::on_pbClearSourcesCharacters_clicked() |
1032 |
|
{ |
1033 |
< |
clearTableContents(ui->twSourcesAnimations); |
1033 |
> |
clearTableContents(ui->twSourcesCharacters); |
1034 |
|
} |
1035 |
|
|
1036 |
|
void MainWindow::on_pbClearSourcesLevels_clicked() |
1090 |
|
} |
1091 |
|
} |
1092 |
|
|
1031 |
– |
void MainWindow::on_cbToGeneral_currentIndexChanged(const QString &arg1) |
1032 |
– |
{ |
1033 |
– |
|
1034 |
– |
ui->cbDatGeneral->setEnabled(false); |
1035 |
– |
ui->cbDatGeneral->setChecked(false); |
1036 |
– |
ui->cbTRAMGeneral->setEnabled(false); |
1037 |
– |
ui->cbTRAMGeneral->setChecked(false); |
1038 |
– |
|
1039 |
– |
if(QString::compare(ui->cbFromGeneral->currentText(),"ONI",Qt::CaseSensitive)==0){ |
1040 |
– |
if(QString::compare(arg1,"DAT",Qt::CaseSensitive)==0){ |
1041 |
– |
ui->cbDatGeneral->setEnabled(true); |
1042 |
– |
} |
1043 |
– |
else{ |
1044 |
– |
ui->cbTRAMGeneral->setEnabled(true); |
1045 |
– |
} |
1046 |
– |
} |
1047 |
– |
|
1048 |
– |
} |
1049 |
– |
|
1050 |
– |
void MainWindow::on_cbToModels_currentIndexChanged(const QString &arg1) |
1051 |
– |
{ |
1052 |
– |
ui->cbWithAnimation->setEnabled(false); |
1053 |
– |
ui->cbWithAnimation->setChecked(false); |
1054 |
– |
|
1055 |
– |
if(arg1=="DAE"){ |
1056 |
– |
ui->cbWithAnimation->setEnabled(true); |
1057 |
– |
} |
1058 |
– |
} |
1059 |
– |
|
1093 |
|
void MainWindow::on_cbToLevels_currentIndexChanged(const QString &arg1) |
1094 |
|
{ |
1095 |
|
|
1063 |
– |
ui->cbDatLevels->setEnabled(false); |
1064 |
– |
ui->cbDatLevels->setChecked(false); |
1065 |
– |
ui->cbBnvLevels->setEnabled(false); |
1066 |
– |
ui->cbBnvLevels->setChecked(false); |
1067 |
– |
ui->cbAdditionalSourcesLevels->setEnabled(false); |
1068 |
– |
ui->cbAdditionalSourcesLevels->setChecked(false); |
1069 |
– |
ui->cbGridsLevels->setEnabled(false); |
1070 |
– |
ui->cbGridsLevels->setChecked(false); |
1071 |
– |
|
1096 |
|
if(ui->cbFromLevels->currentText()=="MASTER XML" && arg1=="DAT"){ |
1097 |
|
ui->cbDatLevels->setEnabled(true); |
1098 |
|
} |
1099 |
< |
else if(ui->cbFromLevels->currentText()=="DAE" && arg1=="ONI"){ |
1100 |
< |
ui->cbBnvLevels->setEnabled(true); |
1101 |
< |
ui->cbAdditionalSourcesLevels->setEnabled(true); |
1099 |
> |
else if(ui->cbFromLevels->currentText()=="MASTER XML" && arg1=="ONI FILES"){ |
1100 |
> |
ui->cbDatLevels->setEnabled(false); |
1101 |
> |
ui->cbDatLevels->setChecked(false); |
1102 |
|
} |
1079 |
– |
} |
1103 |
|
|
1081 |
– |
void MainWindow::on_cbDatGeneral_toggled(bool checked) |
1082 |
– |
{ |
1083 |
– |
ui->leTargetDatGeneral->setEnabled(checked); |
1084 |
– |
} |
1085 |
– |
|
1086 |
– |
void MainWindow::on_cbTRAMGeneral_toggled(bool checked) |
1087 |
– |
{ |
1088 |
– |
ui->leTRAMGeneral->setEnabled(checked); |
1089 |
– |
if(checked){ |
1090 |
– |
QString file=QFileDialog::getOpenFileName(this,"Choose the TRAM.oni file...","./" , "All Files (*.*)"); |
1091 |
– |
if(!file.isEmpty()){ |
1092 |
– |
ui->leTRAMGeneral->setText(file); |
1093 |
– |
} |
1094 |
– |
} |
1104 |
|
} |
1105 |
|
|
1106 |
|
void MainWindow::on_cbDatLevels_toggled(bool checked) |
1141 |
|
} |
1142 |
|
} |
1143 |
|
|
1144 |
+ |
void MainWindow::on_cbWithTRBS_ONCC_toggled(bool checked) |
1145 |
+ |
{ |
1146 |
+ |
ui->leTRBS_ONCC->setEnabled(checked); |
1147 |
+ |
} |
1148 |
+ |
|
1149 |
|
void MainWindow::on_actionCheck_OniSplit_version_triggered() |
1150 |
|
{ |
1151 |
|
QProcess *myProcess = new QProcess(); |
1174 |
|
void MainWindow::on_tabWidget_selected(const QString &arg1) |
1175 |
|
{ |
1176 |
|
if(arg1.compare("General",Qt::CaseSensitive)==0){ //case sentive is faster |
1177 |
< |
updateItemsLoaded(ui->twSourcesGeneral); |
1177 |
> |
updateItemsLoaded(ui->twSourcesXML); |
1178 |
|
} |
1179 |
|
else if(arg1.compare("Textures",Qt::CaseSensitive)==0){ |
1180 |
|
updateItemsLoaded(ui->twSourcesTextures); |
1181 |
|
} |
1182 |
< |
else if(arg1.compare("Models",Qt::CaseSensitive)==0){ |
1183 |
< |
updateItemsLoaded(ui->twSourcesModels); |
1182 |
> |
else if(arg1.compare("Objects",Qt::CaseSensitive)==0){ |
1183 |
> |
updateItemsLoaded(ui->twSourcesObjects); |
1184 |
|
} |
1185 |
|
else if(arg1.compare("Levels",Qt::CaseSensitive)==0){ |
1186 |
|
updateItemsLoaded(ui->twSourcesLevels); |
1243 |
|
Util::openLogFile(); |
1244 |
|
} |
1245 |
|
|
1246 |
+ |
void MainWindow::on_actionOpen_AE_folder_triggered() |
1247 |
+ |
{ |
1248 |
+ |
QDesktopServices::openUrl(QUrl("file:///"+this->AeLocation)); |
1249 |
+ |
} |
1250 |
+ |
|
1251 |
|
QString MainWindow::getTypeConversion(DropTableWidget *myTable){ |
1252 |
|
QString from,to; |
1253 |
|
|
1254 |
< |
if(myTable==ui->twSourcesGeneral){ |
1255 |
< |
from=ui->cbFromGeneral->currentText(); |
1256 |
< |
to=ui->cbToGeneral->currentText(); |
1254 |
> |
if(myTable==ui->twSourcesXML){ |
1255 |
> |
from=ui->cbFromXML->currentText(); |
1256 |
> |
to=ui->cbToXML->currentText(); |
1257 |
|
} |
1258 |
|
else if(myTable==ui->twSourcesTextures){ |
1259 |
|
from=ui->cbFromTextures->currentText(); |
1260 |
|
to=ui->cbToTextures->currentText(); |
1261 |
|
} |
1262 |
< |
else if(myTable==ui->twSourcesModels){ |
1263 |
< |
from=ui->cbFromModels->currentText(); |
1264 |
< |
to=ui->cbToModels->currentText(); |
1265 |
< |
} |
1266 |
< |
else if(myTable==ui->twSourcesAnimations){ |
1267 |
< |
from=ui->cbFromAnimations->currentText(); |
1268 |
< |
to=ui->cbToAnimations->currentText(); |
1262 |
> |
else if(myTable==ui->twSourcesObjects){ |
1263 |
> |
from=ui->cbFromObjects->currentText(); |
1264 |
> |
to=ui->cbToObjects->currentText(); |
1265 |
> |
} |
1266 |
> |
else if(myTable==ui->twSourcesCharacters){ |
1267 |
> |
from=ui->cbFromCharacters->currentText(); |
1268 |
> |
to=ui->cbToCharacters->currentText(); |
1269 |
|
} |
1270 |
|
else if(myTable==ui->twSourcesLevels){ |
1271 |
|
from=ui->cbFromLevels->currentText(); |
1491 |
|
} |
1492 |
|
|
1493 |
|
QString MainWindow::getCommand(DropTableWidget* myTable, QString myOutputFolder, QString from, QString to , QString file){ |
1494 |
< |
if(myTable==ui->twSourcesGeneral){ //So we only need to parse one command. |
1495 |
< |
return fileParsingGeneral(myOutputFolder,from,to,file); |
1494 |
> |
|
1495 |
> |
QString tabTitle=ui->tabWidget->tabText(ui->tabWidget->currentIndex()).toLower(); // get current tab title |
1496 |
> |
|
1497 |
> |
if(myTable==ui->twSourcesXML){ //So we only need to parse one command. |
1498 |
> |
return fileParsingXML(tabTitle, myOutputFolder,from,to,file); |
1499 |
|
} |
1500 |
|
else if(myTable==ui->twSourcesTextures){ |
1501 |
< |
return fileParsingTextures(myOutputFolder,from,to,file); |
1501 |
> |
return fileParsingTextures(tabTitle, myOutputFolder,from,to,file); |
1502 |
|
} |
1503 |
< |
else if(myTable==ui->twSourcesModels){ |
1504 |
< |
return fileParsingModels(myOutputFolder,from,to,file); |
1503 |
> |
else if(myTable==ui->twSourcesObjects){ |
1504 |
> |
return fileParsingObjects(tabTitle, myOutputFolder,from,to,file); |
1505 |
|
} |
1506 |
< |
else if(myTable==ui->twSourcesAnimations){ |
1507 |
< |
return fileParsingAnimations(myOutputFolder,from,to,file); |
1506 |
> |
else if(myTable==ui->twSourcesCharacters){ |
1507 |
> |
return fileParsingCharacters(tabTitle, myOutputFolder,from,to,file); |
1508 |
|
} |
1509 |
|
else if(myTable==ui->twSourcesLevels){ |
1510 |
< |
return fileParsingLevels(myOutputFolder,from,to,file); |
1510 |
> |
return fileParsingLevels(tabTitle, myOutputFolder,from,to,file); |
1511 |
|
} |
1512 |
|
else{ |
1513 |
|
return fileParsingMisc(myOutputFolder,from,to,file); |
1519 |
|
This is OS indepented. It maintain size ratio over the Windows and Mac. |
1520 |
|
**/ |
1521 |
|
void MainWindow::setConverterButtonsSize(){ |
1522 |
< |
int height=ui->pbConvertGeneral->sizeHint().height()*1.3; |
1523 |
< |
ui->pbConvertGeneral->setMinimumHeight(height); |
1522 |
> |
int height=ui->pbConvertXML->sizeHint().height()*1.3; |
1523 |
> |
ui->pbConvertXML->setMinimumHeight(height); |
1524 |
|
ui->pbConvertTextures->setMinimumHeight(height); |
1525 |
< |
ui->pbConvertModels->setMinimumHeight(height); |
1526 |
< |
ui->pbConvertAnimations->setMinimumHeight(height); |
1525 |
> |
ui->pbConvertObjects->setMinimumHeight(height); |
1526 |
> |
ui->pbConvertCharacters->setMinimumHeight(height); |
1527 |
|
ui->pbConvertLevels->setMinimumHeight(height); |
1528 |
|
ui->pbConvertMisc->setMinimumHeight(height); |
1529 |
|
} |
1556 |
|
//This signal is for thread that is working can show the result of a conversion |
1557 |
|
connect(myConverter, SIGNAL(resultConversion(QString,int)), this, SLOT(TresultConversion(QString,int))); |
1558 |
|
|
1559 |
+ |
//This signal is for thread that is working notify the gui thread that the conversion was aborted with sucess |
1560 |
+ |
connect(myConverter, SIGNAL(conversionAborted()), this, SLOT(TconversionAborted())); |
1561 |
+ |
|
1562 |
+ |
// This signal is to the user be able to terminate a conversion (OniSplit process in class myConverter will be terminated) |
1563 |
+ |
connect(this, SIGNAL(terminateCurrProcess()), myConverter, SLOT(terminateCurrProcess())); |
1564 |
+ |
|
1565 |
|
//Drop signal for General table |
1566 |
< |
connect(ui->twSourcesGeneral, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList))); |
1566 |
> |
connect(ui->twSourcesXML, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList))); |
1567 |
|
|
1568 |
|
//Drop signal for Textures table |
1569 |
|
connect(ui->twSourcesTextures, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList))); |
1570 |
|
|
1571 |
< |
//Drop signal for Models table |
1572 |
< |
connect(ui->twSourcesModels, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList))); |
1571 |
> |
//Drop signal for Objects table |
1572 |
> |
connect(ui->twSourcesObjects, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList))); |
1573 |
|
|
1574 |
< |
//Drop signal for Animations table |
1575 |
< |
connect(ui->twSourcesAnimations, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList))); |
1574 |
> |
//Drop signal for Characters table |
1575 |
> |
connect(ui->twSourcesCharacters, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList))); |
1576 |
|
|
1577 |
|
//Drop signal for Levels table |
1578 |
|
connect(ui->twSourcesLevels, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList))); |
1581 |
|
connect(ui->twSourcesMisc, SIGNAL(dropped(DropTableWidget*,QStringList)), this, SLOT(addFilesSource(DropTableWidget*,QStringList))); |
1582 |
|
|
1583 |
|
//Context menu for General table |
1584 |
< |
connect(ui->twSourcesGeneral, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*))); |
1584 |
> |
connect(ui->twSourcesXML, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*))); |
1585 |
|
|
1586 |
|
//Context menu for Textures table |
1587 |
|
connect(ui->twSourcesTextures, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*))); |
1588 |
|
|
1589 |
< |
//Context menu for Models table |
1590 |
< |
connect(ui->twSourcesModels, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*))); |
1589 |
> |
//Context menu for Objects table |
1590 |
> |
connect(ui->twSourcesObjects, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*))); |
1591 |
|
|
1592 |
< |
//Context menu for Animations table |
1593 |
< |
connect(ui->twSourcesAnimations, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*))); |
1592 |
> |
//Context menu for Characters table |
1593 |
> |
connect(ui->twSourcesCharacters, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*))); |
1594 |
|
|
1595 |
|
//Context menu for Levels table |
1596 |
|
connect(ui->twSourcesLevels, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*))); |
1598 |
|
//Context menu for Misc table |
1599 |
|
connect(ui->twSourcesMisc, SIGNAL(dtContextMenu(DropTableWidget*,QContextMenuEvent*)), this, SLOT(dtContextMenu(DropTableWidget*,QContextMenuEvent*))); |
1600 |
|
} |
1573 |
– |
|
1574 |
– |
|