mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-03 13:01:33 +02:00
ExtractionOptions removed from MainWindow Class
This commit is contained in:
parent
9b3cab1181
commit
8377944fd1
@ -41,6 +41,15 @@
|
||||
#include "resourceExtractor/ResourceConverter.h"
|
||||
|
||||
static CBasicLogConfigurator * logConfig;
|
||||
ExtractionOptions * extractionOptions; // All command line options for resource extractor
|
||||
|
||||
ExtractionOptions::ExtractionOptions(const bool extractArchives, const bool splitDefs, const bool convertPcxToPng, const bool deleteOriginals) :
|
||||
extractArchives(extractArchives),
|
||||
splitDefs(splitDefs),
|
||||
convertPcxToPng(convertPcxToPng),
|
||||
deleteOriginals(deleteOriginals)
|
||||
{
|
||||
}
|
||||
|
||||
QJsonValue jsonFromPixmap(const QPixmap &p)
|
||||
{
|
||||
@ -109,10 +118,7 @@ void MainWindow::parseCommandLine()
|
||||
if (!positionalArgs.isEmpty())
|
||||
mapFilePath = positionalArgs.at(0);
|
||||
|
||||
extractArchives = parser.isSet("e");
|
||||
splitDefs = parser.isSet("s");
|
||||
convertPcxToPng = parser.isSet("c");
|
||||
deleteOriginals = parser.isSet("d");
|
||||
extractionOptions = new ExtractionOptions(parser.isSet("e"), parser.isSet("s"), parser.isSet("c"), parser.isSet("d"));
|
||||
}
|
||||
|
||||
MainWindow::MainWindow(QWidget *parent) :
|
||||
@ -138,7 +144,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
logGlobal->info("The log file will be saved to %s", logPath);
|
||||
|
||||
//init
|
||||
preinitDLL(::console, false, extractArchives);
|
||||
preinitDLL(::console, false, extractionOptions->extractArchives);
|
||||
settings.init();
|
||||
|
||||
// Initialize logging based on settings
|
||||
@ -169,7 +175,8 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||
graphics = new Graphics(); // should be before curh->init()
|
||||
graphics->load();//must be after Content loading but should be in main thread
|
||||
|
||||
convertExtractedResourceFiles(splitDefs, convertPcxToPng, deleteOriginals);
|
||||
if (extractionOptions->extractArchives)
|
||||
convertExtractedResourceFiles(extractionOptions->splitDefs, extractionOptions->convertPcxToPng, extractionOptions->deleteOriginals);
|
||||
|
||||
ui->mapView->setScene(controller.scene(0));
|
||||
ui->mapView->setController(&controller);
|
||||
|
@ -147,6 +147,12 @@ private:
|
||||
|
||||
// command line options
|
||||
QString mapFilePath; // FilePath to the H3 or VCMI map to open
|
||||
};
|
||||
|
||||
struct ExtractionOptions
|
||||
{
|
||||
ExtractionOptions(const bool extractArchives, const bool splitDefs, const bool convertPcxToPng, const bool deleteOriginals);
|
||||
|
||||
bool extractArchives = false; // extract original H3 archives into a separate folder
|
||||
bool splitDefs = false; // splits TwCrPort, CPRSMALL, FlagPort, ITPA, ITPt, Un32 and Un44 into individual PNG's
|
||||
bool convertPcxToPng = false; // converts single Images (found in Images folder) from .pcx to png.
|
||||
|
Loading…
x
Reference in New Issue
Block a user