diff --git a/GDTCreator.cpp b/GDTCreator.cpp new file mode 100644 index 0000000..210d116 --- /dev/null +++ b/GDTCreator.cpp @@ -0,0 +1,186 @@ +#include "stdafx.h" +#include "mlMainWindow.h" + +void GDTCreator::dropEvent(QDropEvent* event) +{ + if (parentWindow == NULL) + return; + + source_data_folder = new QDir(QString("%1/source_data").arg(parentWindow->mToolsPath)); + model_export_folder = new QDir(QString("%1/model_export").arg(parentWindow->mToolsPath)); + QStringList AllowedFileTypes = (QStringList() << "tiff" << "tif" << "xmodel_bin"); + + + if (event->mimeData()->hasUrls()) + { + QList FileList = event->mimeData()->urls(); + QString GDTType, FileName, Path; + for (int i = 0; i < FileList.size(); i++) + { + QFileInfo CurrentFile = FileList.at(i).toLocalFile(); + + if(!AllowedFileTypes.contains(CurrentFile.suffix())) + { + QMessageBox::information(this,"Hold Up!",QString("Sorry, I Don't Support The File Type: %1").arg(CurrentFile.suffix()),QMessageBox::Ok); + return; + } + + if(CurrentFile.isDir()) + { + QMessageBox::information(this,"Hold Up!","Sorry, I Don't Support Folders! Please Drag The Files Onto Me.",QMessageBox::Ok); + /*QDirIterator Iterator(CurrentFile.absolutePath(), QStringList() << "*.tif" << "*.tiff" << "*.xmodel_bin"); + while(Iterator.hasNext()) + { + GDTType = GetGDTType(Iterator.next()); + FileName = GetGDTFileName(Iterator.next().split(".",QString::SkipEmptyParts).at(0)); + + MakeGDT(GDTType,FileName,QFileInfo(Iterator.next()).suffix(), + }*/ + return; + } + + QString WorkingDir = QFileInfo(CurrentFile).fileName().split(".",QString::SkipEmptyParts).at(0); + QString SavePath = QString("%1/%2").arg(model_export_folder->absolutePath(),WorkingDir); + + if(parentWindow->mAutoCopyAssetsAfterGDTCreation->isChecked()) + { + if(!QDir().exists(SavePath)) + QDir().mkpath(SavePath); + + QFile().copy(FileList.at(i).toLocalFile(),QString("%1/%2/%3").arg(model_export_folder->absolutePath(),WorkingDir,CurrentFile.fileName())); + Path = QString("%1/%2/%3").arg("model_export",WorkingDir,CurrentFile.fileName()); + } + else + { + Path = FileList.at(i).toLocalFile(); + } + + GDTType = GetGDTType(CurrentFile); + + if(!GDTType.isEmpty()) + { + FileName = GetGDTFileName(WorkingDir); + MakeGDT(GDTType, FileName, CurrentFile.suffix(),Path); + } + } + } + + if(parentWindow->mOpenAPEAfterCreation->isChecked()) + parentWindow->mActionFileAssetEditor->trigger(); + + event->acceptProposedAction(); +} + +GDTCreator::GDTCreator(QWidget* parent, mlMainWindow* parent_window) : QGroupBox(parent), parentWindow(parent_window) +{ + this->setAcceptDrops(true); +} + +void GDTCreator::dragEnterEvent(QDragEnterEvent* event) +{ + event->acceptProposedAction(); +} + +void GDTCreator::dragLeaveEvent(QDragLeaveEvent* event) +{ + event->accept(); +} + +void GDTCreator::MakeGDT(QString Type, QString Name, QString Extension, QString Path) +{ + QString Template; + QFile* GDTFile; + + if(Type == "xmodel" && Extension == "xmodel_bin") + { + Template = + "{\n" + + QString("\t\"%1\" ( \"xmodel.gdf\" )\n").arg(Name) + + "\t{\n" + + "\t\t\"filename\" \"" + Path + "\"\n" + + "\t\t\"highLodDist\" \"751\"\n" + + "\t\t\"type\" \"rigid\"\n" + + "\t}\n" + + "}\n"; + + GDTFile = new QFile(QString("%1/%2.%3").arg(source_data_folder->absolutePath(),Name,"gdt")); + if(GDTFile->open(QFile::ReadWrite)) + { + QTextStream FileWriter(GDTFile); + FileWriter << Template; + FileWriter.flush(); + GDTFile->close(); + } + else + { + QMessageBox::critical(this,"Uh-Oh!","I Couldn't Open The File For Saving",QMessageBox::Ok); + return; + } + } + else if(Type == "image" && Extension == "tiff" || Extension == "tif") + { + Template = + "{\n" + + QString("\t\"%1\" ( \"image.gdf\" )\n").arg(Name) + + "\t{\n" + + "\t\t\"baseImage\" \"" + Path +"\"\n" + + "\t\t\"semantic\" \"diffuseMap\"\n" + + "\t\t\"imageType\" \"Texture\"\n" + + "\t\t\"type\" \"image\"\n" + + "\t\t\"compressionMethod\" \"uncompressed\"\n" + + "\t}\n" + + "}\n"; + + GDTFile = new QFile(QString("%1/%2.%3").arg(source_data_folder->absolutePath(),Name,"gdt")); + if(GDTFile->open(QFile::ReadWrite)) + { + QTextStream FileWriter(GDTFile); + FileWriter << Template; + FileWriter.flush(); + GDTFile->close(); + } + else + { + QMessageBox::critical(this,"Uh-Oh!","I Couldn't Open The File For Saving",QMessageBox::Ok); + return; + } + } +} + +QString GDTCreator::GetGDTType(QFileInfo CurrentFile) +{ + QInputDialog GDTType; + QString GDTTemplate; + int Ret; + + GDTType.setOption(QInputDialog::UseListViewForComboBoxItems); + GDTType.setWindowTitle("GDT Creation Type"); + GDTType.setLabelText(QString("What Type Of GDT Should I Create?\nAsset: %1").arg(CurrentFile.fileName())); + GDTType.setComboBoxItems(QStringList() << "xmodel" << "image"); + + do + { + Ret = GDTType.exec(); + }while(Ret != QDialog::Accepted); + + if(!GDTType.textValue().isEmpty()) + return GDTType.textValue(); +} + +QString GDTCreator::GetGDTFileName(QString WorkingDir) +{ + QString FileName = WorkingDir.left(WorkingDir.lastIndexOf('_')); + QInputDialog FileNameInput; + FileNameInput.setInputMode(QInputDialog::TextInput); + FileNameInput.setWindowTitle("File Name"); + FileNameInput.setLabelText("What Should I Call The GDT?"); + bool Res; + + do + { + FileName = FileNameInput.getText(this,"File Name","What Should I Call The GDT?",QLineEdit::Normal,FileName, &Res); + }while(Res != true); + + parentWindow->mOutputWidget->appendPlainText(FileName); + return FileName; +} \ No newline at end of file diff --git a/GDTCreator.h b/GDTCreator.h new file mode 100644 index 0000000..7dad6bf --- /dev/null +++ b/GDTCreator.h @@ -0,0 +1,24 @@ +#pragma once +#include "mlMainWindow.h" //Hmmm, I Don't Know Why I Need To Force That Here... + +class GDTCreator : public QGroupBox +{ +private: + mlMainWindow* parentWindow; + + QDir* source_data_folder; + QDir* model_export_folder; + + +protected: + void dragEnterEvent(QDragEnterEvent* event); + void dragLeaveEvent(QDragLeaveEvent* event); + void dropEvent(QDropEvent *event); + + void MakeGDT(QString, QString, QString, QString); //Type, Extension, Name, Path + QString GetGDTType(QFileInfo); //Current File + QString GetGDTFileName(QString); //Working Dir + +public: + GDTCreator(QWidget *parent, mlMainWindow* parent_window); +}; diff --git a/ModLauncher.sln b/ModLauncher.sln index 246b1f0..27a9883 100644 --- a/ModLauncher.sln +++ b/ModLauncher.sln @@ -21,6 +21,6 @@ Global HideSolutionNode = FALSE EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - Qt5Version = external + Qt5Version = qt EndGlobalSection EndGlobal diff --git a/ModLauncher.vcxproj b/ModLauncher.vcxproj index 8afec35..88683eb 100644 --- a/ModLauncher.vcxproj +++ b/ModLauncher.vcxproj @@ -1,466 +1,470 @@ - - - - - Debug - Win32 - - - Debug - x64 - - - External_Release - Win32 - - - External_Release - x64 - - - Release - Win32 - - - Release - x64 - - - - {5703602A-18C8-4781-8435-404AEFCAFEAA} - Qt4VSv1.0 - ModLauncher - - - - Application - true - v110 - - - - - Application - true - v110 - - - - Application - false - v110 - false - - - - - Application - false - v120 - false - - - - Application - false - v110 - false - - - - Application - false - v120 - false - - - - - - - - - - - - - - - - - - - - - - - - - - true - $(TA_TOOLS_PATH)\bin\ - $(Platform)\$(Configuration)\ - $(ProjectName)$(TA_EXECUTABLE_SUFFIX) - - - $(Platform)\$(Configuration)\ - $(ProjectName)_d$(TA_EXECUTABLE_SUFFIX) - true - $(TA_TOOLS_PATH)\bin\ - - - false - $(TA_TOOLS_PATH)\bin\ - $(Platform)\$(Configuration)\ - $(ProjectName)$(TA_EXECUTABLE_SUFFIX) - - - false - $(TA_TOOLS_PATH)\bin\ - $(Platform)\$(Configuration)\ - $(ProjectName)$(TA_EXECUTABLE_SUFFIX) - - - $(Platform)\$(Configuration)\ - $(ProjectName)$(TA_EXECUTABLE_SUFFIX) - - - $(TA_TOOLS_PATH)\bin\ - - - $(Platform)\$(Configuration)\ - $(ProjectName)$(TA_EXECUTABLE_SUFFIX) - - $(TA_TOOLS_PATH)\bin\ - - - - Use - Level1 - Disabled - WIN32;_DEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) - - - $(TA_CODE_PATH);$(TA_CODE_PATH)\tools;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;%(AdditionalIncludeDirectories) - true - - - Windows - true - - - - - Use - Level1 - Disabled - WIN32;_DEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) - - - $(TA_CODE_PATH);$(TA_CODE_PATH)\tools;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(TL_SDK)/Steamworks/sdk-1.37/public/steam;$(SolutionDir)/sdk/public/steam;%(AdditionalIncludeDirectories) - true - - - Windows - true - $(QTDIR)\lib;$(TA_TOOLS_PATH)\bin;$(TL_SDK)/Steamworks/sdk-1.37/redistributable_bin/win64;$(SolutionDir)/sdk/redistributable_bin/win64; - kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - mainCRTStartup - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - - - - - Level3 - Use - MaxSpeed - true - true - WIN32;NDEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) - true - - - Windows - true - true - true - - - - - Level1 - Use - MaxSpeed - - - true - USE_CUSTOM_QT=1;UTILS;RELEASE_BUILD;AS_NO_USER_ALLOC;WIN32;QT_DLL;NDEBUG;%(PreprocessorDefinitions) - - - $(TA_CODE_PATH);$(TA_CODE_PATH)\tools;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(TL_SDK)/Steamworks/sdk-1.37/public/steam;$(SolutionDir)/sdk/public/steam;%(AdditionalIncludeDirectories) - true - - - Windows - true - true - true - $(QTDIR)\lib;$(TA_TOOLS_PATH)\bin;$(TL_SDK)/Steamworks/sdk-1.37/redistributable_bin/win64;$(SolutionDir)/sdk/redistributable_bin/win64;%(AdditionalLibraryDirectories) - %(AdditionalDependencies) - mainCRTStartup - - - true - - - - - Level1 - Use - MaxSpeed - - - true - UTILS;RELEASE_BUILD;AS_NO_USER_ALLOC;WIN32;QT_DLL;NDEBUG;%(PreprocessorDefinitions) - - - $(TA_CODE_PATH);$(TA_CODE_PATH)\tools;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(TL_SDK)/Steamworks/sdk-1.37/public/steam;$(SolutionDir)/sdk/public/steam;%(AdditionalIncludeDirectories) - true - - - Windows - true - true - true - $(QTDIR)\lib;$(TA_TOOLS_PATH)\bin;$(TL_SDK)/Steamworks/sdk-1.37/redistributable_bin/win64;$(SolutionDir)/sdk/redistributable_bin/win64;%(AdditionalLibraryDirectories) - %(AdditionalDependencies) - mainCRTStartup - - - true - - - - - - - Performing Custom Build Tools - - - - - - - Performing Custom Build Tools - - - - - - - - - Performing Custom Build Tools - Performing Custom Build Tools - - - - - - - - - - - - - Performing Custom Build Tools - Performing Custom Build Tools - - - - - - - - - - - - - - true - true - true - true - - - true - true - true - true - - - - - - - - - - - - - - - - - true - true - true - true - - - - - Create - Create - Create - Create - Create - Create - - - - - - - - - - Performing Custom Build Tools - - - - - - - Performing Custom Build Tools - - - - - - - - - Performing Custom Build Tools - Performing Custom Build Tools - - - - - - - - - - - - - Performing Custom Build Tools - Performing Custom Build Tools - - - - - - - - - - - - - $(QTDIR)\bin\moc.exe;%(FullPath) - Moc%27ing mlMainWindow.h... - GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DWIN32 -D_DEBUG -D_WINDOWS -DQT_DLL "-I$(TA_CODE_PATH)\." "-I$(TA_CODE_PATH)\tools" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-fstdafx.h" "-f../../mlMainWindow.h" - $(QTDIR)\bin\moc.exe;%(FullPath) - Moc%27ing mlMainWindow.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DWIN32 -D_DEBUG -D_WINDOWS -DQT_DLL "-I$(TA_CODE_PATH)\." "-I$(TA_CODE_PATH)\tools" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(TL_SDK)\Steamworks\sdk-1.37\public\steam" "-I$(SolutionDir)\sdk\public\steam" "-fstdafx.h" "-f../../mlMainWindow.h" - $(QTDIR)\bin\moc.exe;%(FullPath) - $(QTDIR)\bin\moc.exe;%(FullPath) - Moc%27ing mlMainWindow.h... - Moc%27ing mlMainWindow.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DWIN32 -DNDEBUG -D_WINDOWS -DQT_DLL "-fstdafx.h" "-f../../mlMainWindow.h" - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DWIN32 -DNDEBUG -D_WINDOWS -DQT_DLL "-fstdafx.h" "-f../../mlMainWindow.h" - $(QTDIR)\bin\moc.exe;%(FullPath) - $(QTDIR)\bin\moc.exe;%(FullPath) - Moc%27ing mlMainWindow.h... - Moc%27ing mlMainWindow.h... - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUTILS -DRELEASE_BUILD -DAS_NO_USER_ALLOC -DWIN32 -DQT_DLL -DNDEBUG "-I$(TA_CODE_PATH)\." "-I$(TA_CODE_PATH)\tools" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(TL_SDK)\Steamworks\sdk-1.37\public\steam" "-I$(SolutionDir)\sdk\public\steam" "-fstdafx.h" "-f../../mlMainWindow.h" - "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUTILS -DRELEASE_BUILD -DAS_NO_USER_ALLOC -DWIN32 -DQT_DLL -DNDEBUG "-I$(TA_CODE_PATH)\." "-I$(TA_CODE_PATH)\tools" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(TL_SDK)\Steamworks\sdk-1.37\public\steam" "-I$(SolutionDir)\sdk\public\steam" "-fstdafx.h" "-f../../mlMainWindow.h" - - - - - %(FullPath);%(AdditionalInputs) - Rcc%27ing %(Identity)... - GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) - "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp - %(FullPath);%(AdditionalInputs) - Rcc%27ing %(Identity)... - GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) - "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp - %(FullPath);%(AdditionalInputs) - %(FullPath);%(AdditionalInputs) - Rcc%27ing %(Identity)... - Rcc%27ing %(Identity)... - GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) - GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) - "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp - "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp - %(FullPath);%(AdditionalInputs) - %(FullPath);%(AdditionalInputs) - Rcc%27ing %(Identity)... - Rcc%27ing %(Identity)... - GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) - GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) - "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp - "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp - - - - - - - - - - - - - + + + + + Debug + Win32 + + + Debug + x64 + + + External_Release + Win32 + + + External_Release + x64 + + + Release + Win32 + + + Release + x64 + + + + {5703602A-18C8-4781-8435-404AEFCAFEAA} + Qt4VSv1.0 + ModLauncher + + + + Application + true + v110 + + + + + Application + true + v110 + + + + Application + false + v110 + false + + + + + Application + false + v120 + false + + + + Application + false + v110 + false + + + + Application + false + v110 + false + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(TA_TOOLS_PATH)\bin\ + $(Platform)\$(Configuration)\ + $(ProjectName)$(TA_EXECUTABLE_SUFFIX) + + + $(Platform)\$(Configuration)\ + $(ProjectName)_d$(TA_EXECUTABLE_SUFFIX) + true + $(TA_TOOLS_PATH)\bin\ + + + false + $(TA_TOOLS_PATH)\bin\ + $(Platform)\$(Configuration)\ + $(ProjectName)$(TA_EXECUTABLE_SUFFIX) + + + false + $(TA_TOOLS_PATH)\bin\ + $(Platform)\$(Configuration)\ + $(ProjectName)$(TA_EXECUTABLE_SUFFIX) + + + $(Platform)\$(Configuration)\ + $(ProjectName)$(TA_EXECUTABLE_SUFFIX) + + + $(TA_TOOLS_PATH)\bin\ + + + $(Platform)\$(Configuration)\ + $(ProjectName)$(TA_EXECUTABLE_SUFFIX) + + $(TA_TOOLS_PATH)\bin\ + D:\Software\Qt\5.1.0\msvc2012_64\include\QtANGLE;D:\Johnathon\Documents\GitHub\steamworks\sdk\public\steam;$(IncludePath) + D:\Johnathon\Documents\GitHub\steamworks\sdk\redistributable_bin\win64;$(LibraryPath) + + + + Use + Level1 + Disabled + WIN32;_DEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) + + + $(TA_CODE_PATH);$(TA_CODE_PATH)\tools;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;%(AdditionalIncludeDirectories) + true + + + Windows + true + + + + + Use + Level1 + Disabled + WIN32;_DEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) + + + $(TA_CODE_PATH);$(TA_CODE_PATH)\tools;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(TL_SDK)/Steamworks/sdk-1.37/public/steam;$(SolutionDir)/sdk/public/steam;%(AdditionalIncludeDirectories) + true + + + Windows + true + $(QTDIR)\lib;$(TA_TOOLS_PATH)\bin;$(TL_SDK)/Steamworks/sdk-1.37/redistributable_bin/win64;$(SolutionDir)/sdk/redistributable_bin/win64; + kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + mainCRTStartup + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + Level3 + Use + MaxSpeed + true + true + WIN32;NDEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) + true + + + Windows + true + true + true + + + + + Level1 + Use + MaxSpeed + + + true + USE_CUSTOM_QT=1;UTILS;RELEASE_BUILD;AS_NO_USER_ALLOC;WIN32;QT_DLL;NDEBUG;%(PreprocessorDefinitions) + + + $(TA_CODE_PATH);$(TA_CODE_PATH)\tools;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(TL_SDK)/Steamworks/sdk-1.37/public/steam;$(SolutionDir)/sdk/public/steam;%(AdditionalIncludeDirectories) + true + + + Windows + true + true + true + $(QTDIR)\lib;$(TA_TOOLS_PATH)\bin;$(TL_SDK)/Steamworks/sdk-1.37/redistributable_bin/win64;$(SolutionDir)/sdk/redistributable_bin/win64;%(AdditionalLibraryDirectories) + %(AdditionalDependencies) + mainCRTStartup + + + true + + + + + Level1 + Use + MaxSpeed + + + true + UTILS;RELEASE_BUILD;AS_NO_USER_ALLOC;WIN32;QT_DLL;NDEBUG;%(PreprocessorDefinitions) + + + $(TA_CODE_PATH);$(TA_CODE_PATH)\tools;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;$(TL_SDK)/Steamworks/sdk-1.37/public/steam;$(SolutionDir)/sdk/public/steam;%(AdditionalIncludeDirectories) + true + + + Windows + true + true + true + $(QTDIR)\lib;$(TA_TOOLS_PATH)\bin;$(TL_SDK)/Steamworks/sdk-1.37/redistributable_bin/win64;$(SolutionDir)/sdk/redistributable_bin/win64;%(AdditionalLibraryDirectories) + %(AdditionalDependencies) + mainCRTStartup + + + true + + + + + + + Performing Custom Build Tools + + + + + + + Performing Custom Build Tools + + + + + + + + + Performing Custom Build Tools + Performing Custom Build Tools + + + + + + + + + + + + + Performing Custom Build Tools + Performing Custom Build Tools + + + + + + + + + + + + + + + true + true + true + true + + + true + true + true + true + + + + + + + + + + + + + + + + + true + true + true + true + + + + + Create + Create + Create + Create + Create + Create + + + + + + + + + + Performing Custom Build Tools + + + + + + + Performing Custom Build Tools + + + + + + + + + Performing Custom Build Tools + Performing Custom Build Tools + + + + + + + + + + + + + Performing Custom Build Tools + Performing Custom Build Tools + + + + + + + + + + + + + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing mlMainWindow.h... + GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DWIN32 -D_DEBUG -D_WINDOWS -DQT_DLL "-I$(TA_CODE_PATH)\." "-I$(TA_CODE_PATH)\tools" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-fstdafx.h" "-f../../mlMainWindow.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing mlMainWindow.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DWIN32 -D_DEBUG -D_WINDOWS -DQT_DLL "-I$(TA_CODE_PATH)\." "-I$(TA_CODE_PATH)\tools" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(TL_SDK)\Steamworks\sdk-1.37\public\steam" "-I$(SolutionDir)\sdk\public\steam" "-fstdafx.h" "-f../../mlMainWindow.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing mlMainWindow.h... + Moc%27ing mlMainWindow.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DWIN32 -DNDEBUG -D_WINDOWS -DQT_DLL "-fstdafx.h" "-f../../mlMainWindow.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DWIN32 -DNDEBUG -D_WINDOWS -DQT_DLL "-fstdafx.h" "-f../../mlMainWindow.h" + $(QTDIR)\bin\moc.exe;%(FullPath) + $(QTDIR)\bin\moc.exe;%(FullPath) + Moc%27ing mlMainWindow.h... + Moc%27ing mlMainWindow.h... + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUTILS -DRELEASE_BUILD -DAS_NO_USER_ALLOC -DWIN32 -DQT_DLL -DNDEBUG "-I$(TA_CODE_PATH)\." "-I$(TA_CODE_PATH)\tools" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(TL_SDK)\Steamworks\sdk-1.37\public\steam" "-I$(SolutionDir)\sdk\public\steam" "-fstdafx.h" "-f../../mlMainWindow.h" + "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DUTILS -DRELEASE_BUILD -DAS_NO_USER_ALLOC -DWIN32 -DQT_DLL -DNDEBUG "-I$(TA_CODE_PATH)\." "-I$(TA_CODE_PATH)\tools" "-I.\GeneratedFiles" "-I." "-I$(QTDIR)\include" "-I.\GeneratedFiles\$(ConfigurationName)\." "-I$(QTDIR)\include\QtCore" "-I$(QTDIR)\include\QtGui" "-I$(QTDIR)\include\QtWidgets" "-I$(TL_SDK)\Steamworks\sdk-1.37\public\steam" "-I$(SolutionDir)\sdk\public\steam" "-fstdafx.h" "-f../../mlMainWindow.h" + + + + + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp + %(FullPath);%(AdditionalInputs) + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + Rcc%27ing %(Identity)... + GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp + %(FullPath);%(AdditionalInputs) + %(FullPath);%(AdditionalInputs) + Rcc%27ing %(Identity)... + Rcc%27ing %(Identity)... + GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp + "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ModLauncher.vcxproj.filters b/ModLauncher.vcxproj.filters index e19633a..e4e3fc3 100644 --- a/ModLauncher.vcxproj.filters +++ b/ModLauncher.vcxproj.filters @@ -29,6 +29,9 @@ {5fc30545-a821-4000-9780-d6dd6c4d03ff} + + {fc29ef6f-4b5c-41e5-ae4f-6db41e4cd3f4} + @@ -55,6 +58,9 @@ Source Files + + Source Files\GDT + @@ -79,5 +85,8 @@ Source Files + + Source Files\GDT + \ No newline at end of file diff --git a/dvar.cpp b/dvar.cpp index be01b1e..743f46e 100644 --- a/dvar.cpp +++ b/dvar.cpp @@ -12,6 +12,7 @@ Dvar::Dvar(dvar_s _dvar, QTreeWidget *_dvarTree) : dvar(_dvar) QCheckBox* checkBox; QSpinBox* spinBox; QLineEdit* textBox; + QComboBox* comboBox; switch(this->dvar.type) { @@ -36,6 +37,11 @@ Dvar::Dvar(dvar_s _dvar, QTreeWidget *_dvarTree) : dvar(_dvar) textBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); _dvarTree->setItemWidget(Item, 1, textBox); break; + case DVAR_VALUE_COMBO: + comboBox = new QComboBox(); + comboBox->addItems(QStringList() << "mp_aerospace" << "mp_apartments" << "mp_arena" << "mp_banzai" << "mp_biodome" << "mp_chinatown" << "mp_city" << "mp_conduit" << "mp_crucible" << "mp_cryogen" << "mp_ethiopia" << "mp_freerun_01" << "mp_freerun_02" << "mp_freerun_03" << "mp_freerun_04" << "mp_havoc" << "mp_infection" << "mp_kung_fu" << "mp_metro" << "mp_miniature" << "mp_nuketown_x" << "mp_redwood" << "mp_rise" << "mp_rome" << "mp_ruins" << "mp_sector" << "mp_shrine" << "mp_skyjacked" << "mp_spire" << "mp_stronghold" << "mp_veiled" << "mp_waterpark" << "mp_western" << "zm_castle" << "zm_factory" << "zm_genesis" << "zm_island" << "zm_levelcommon" << "zm_stalingrad" << "zm_zod"); + comboBox->setEditable(true); + _dvarTree->setItemWidget(Item,1,comboBox); } } @@ -78,3 +84,10 @@ QString Dvar::setDvarSetting(dvar_s _dvar, QLineEdit* _lineEdit) return Settings.value(QString("dvar_%1").arg(_dvar.name)).toString(); } + +QString Dvar::setDvarSetting(dvar_s _dvar, QComboBox* _lineEdit) +{ + QSettings Settings; + Settings.setValue(QString("dvar_%1").arg(_dvar.name), _lineEdit->currentText()); + return Settings.value(QString("dvar_%1").arg(_dvar.name)).toString(); +} \ No newline at end of file diff --git a/dvar.h b/dvar.h index 14def60..dd9c87a 100644 --- a/dvar.h +++ b/dvar.h @@ -4,7 +4,8 @@ enum DvarType { DVAR_VALUE_BOOL, DVAR_VALUE_INT, - DVAR_VALUE_STRING + DVAR_VALUE_STRING, + DVAR_VALUE_COMBO }; struct dvar_s @@ -21,6 +22,7 @@ class Dvar { private: dvar_s dvar; + public: Dvar(); @@ -30,6 +32,7 @@ class Dvar static QString setDvarSetting(dvar_s, QCheckBox*); static QString setDvarSetting(dvar_s, QSpinBox*); static QString setDvarSetting(dvar_s, QLineEdit*); + static QString setDvarSetting(dvar_s, QComboBox*); static dvar_s findDvar(QString, QTreeWidget*, dvar_s*, int); }; diff --git a/mlMainWindow.cpp b/mlMainWindow.cpp index 5517292..f79ad8e 100644 --- a/mlMainWindow.cpp +++ b/mlMainWindow.cpp @@ -1,4 +1,4 @@ -/* +/* * * Copyright 2016 Activision Publishing, Inc. * @@ -26,17 +26,21 @@ const int AppId = 311210; const char* gLanguages[] = { "english", "french", "italian", "spanish", "german", "portuguese", "russian", "polish", "japanese", "traditionalchinese", "simplifiedchinese", "englisharabic" }; const char* gTags[] = { "Animation", "Audio", "Character", "Map", "Mod", "Mode", "Model", "Multiplayer", "Scorestreak", "Skin", "Specialist", "Texture", "UI", "Vehicle", "Visual Effect", "Weapon", "WIP", "Zombies" }; +QStringList mShippedMapList; + dvar_s gDvars[] = { - {"ai_disableSpawn", "Disable AI from spawning", DVAR_VALUE_BOOL}, - {"developer", "Run developer mode", DVAR_VALUE_INT, 0, 2}, - {"g_password", "Password for your server", DVAR_VALUE_STRING}, - {"logfile", "Console log information written to current fs_game", DVAR_VALUE_INT, 0, 2}, - {"scr_mod_enable_devblock", "Developer blocks are executed in mods ", DVAR_VALUE_BOOL}, - {"connect", "Connect to a specific server", DVAR_VALUE_STRING, NULL, NULL, true}, - {"set_gametype", "Set a gametype to load with map", DVAR_VALUE_STRING, NULL, NULL, true}, - {"splitscreen", "Enable splitscreen", DVAR_VALUE_BOOL}, - {"splitscreen_playerCount", "Allocate the number of instances for splitscreen", DVAR_VALUE_INT, 0, 2} - }; + {"ai_disableSpawn", "Disable AI from spawning", DVAR_VALUE_BOOL}, + {"developer", "Run developer mode", DVAR_VALUE_INT, 0, 2}, + {"g_password", "Password for your server", DVAR_VALUE_STRING}, + {"logfile", "Console log information written to current fs_game", DVAR_VALUE_INT, 0, 2}, + {"scr_mod_enable_devblock", "Developer blocks are executed in mods ", DVAR_VALUE_BOOL}, + {"connect", "Connect to a specific server", DVAR_VALUE_STRING, NULL, NULL, true}, + {"set_gametype", "Set a gametype to load with map", DVAR_VALUE_STRING, NULL, NULL, true}, + {"splitscreen", "Enable splitscreen", DVAR_VALUE_BOOL}, + {"splitscreen_playerCount", "Allocate the number of instances for splitscreen", DVAR_VALUE_INT, 0, 2}, + {"devmap","Launch to this map using devmap",DVAR_VALUE_COMBO,0,0,true}, +}; + enum mlItemType { ML_ITEM_UNKNOWN, @@ -92,8 +96,7 @@ void mlBuildThread::run() mSuccess = Success; } -mlConvertThread::mlConvertThread(QStringList& Files, QString& OutputDir, bool IgnoreErrors, bool OverwriteFiles) - : mFiles(Files), mOutputDir(OutputDir), mSuccess(false), mCancel(false), mIgnoreErrors(IgnoreErrors), mOverwrite(OverwriteFiles) +mlConvertThread::mlConvertThread(QStringList& Files, QString& OutputDir, bool IgnoreErrors, bool OverwriteFiles) : mFiles(Files), mOutputDir(OutputDir), mSuccess(false), mCancel(false), mIgnoreErrors(IgnoreErrors), mOverwrite(OverwriteFiles) { } @@ -118,11 +121,11 @@ void mlConvertThread::run() file = file_info.baseName(); QString ToolsPath = QDir::fromNativeSeparators(getenv("TA_TOOLS_PATH")); - QString ExecutablePath = QString("%1bin/export2bin.exe").arg(ToolsPath); + QString ExecutablePath = QString("%1bin\\export2bin.exe").arg(ToolsPath); QStringList args; //args.append("/v"); // Verbose - args.append("/piped"); + //args.append("/piped"); QString filepath = file_info.absoluteFilePath(); @@ -243,6 +246,8 @@ mlMainWindow::mlMainWindow() mBuildThread = NULL; mBuildLanguage = Settings.value("BuildLanguage", "english").toString(); mTreyarchTheme = Settings.value("UseDarkTheme", false).toBool(); + mUseBuiltInEditor= Settings.value("InBuiltEditor",false).toBool(); + mOpenAPEAfter = Settings.value("GDTCreate_OpenAPEAfterCreation",false).toBool(); // Qt prefers '/' over '\\' mGamePath = QString(getenv("TA_GAME_PATH")).replace('\\', '/'); @@ -252,7 +257,7 @@ mlMainWindow::mlMainWindow() setWindowIcon(QIcon(":/resources/ModLauncher.png")); setWindowTitle("Black Ops III Mod Tools Launcher"); - + resize(1024, 768); CreateActions(); @@ -260,6 +265,8 @@ mlMainWindow::mlMainWindow() CreateToolBar(); mExport2BinGUIWidget = NULL; + mGDTCreatorGUIWidget = NULL; + mZoneEditorGUIWidget = NULL; QSplitter* CentralWidget = new QSplitter(); CentralWidget->setOrientation(Qt::Vertical); @@ -311,9 +318,7 @@ mlMainWindow::mlMainWindow() mRunEnabledWidget = new QCheckBox("Run"); ActionsLayout->addWidget(mRunEnabledWidget); - mRunOptionsWidget = new QLineEdit(); - mRunOptionsWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - ActionsLayout->addWidget(mRunOptionsWidget); + mBuildButton = new QPushButton("Build"); connect(mBuildButton, SIGNAL(clicked()), mActionEditBuild, SLOT(trigger())); @@ -323,6 +328,10 @@ mlMainWindow::mlMainWindow() connect(mDvarsButton, SIGNAL(clicked()), this, SLOT(OnEditDvars())); ActionsLayout->addWidget(mDvarsButton); + mConvertButton = new QPushButton("Convert"); + connect(mConvertButton, SIGNAL(clicked()), this, SLOT(OnConvertButton())); + ActionsLayout->addWidget(mConvertButton); + mIgnoreErrorsWidget = new QCheckBox("Ignore Errors"); ActionsLayout->addWidget(mIgnoreErrorsWidget); @@ -346,6 +355,8 @@ mlMainWindow::mlMainWindow() connect(&mTimer, SIGNAL(timeout()), this, SLOT(SteamUpdate())); mTimer.start(1000); + SyntaxTimer.setSingleShot(true); + connect(&SyntaxTimer,SIGNAL(timeout()),this,SLOT(UpdateSyntax())); PopulateFileList(); } @@ -369,10 +380,14 @@ void mlMainWindow::CreateActions() mActionFileLevelEditor->setToolTip("Level Editor"); connect(mActionFileLevelEditor, SIGNAL(triggered()), this, SLOT(OnFileLevelEditor())); - mActionFileExport2Bin = new QAction(QIcon(":/resources/Export2Bin.png"), "&Export2Bin GUI", this); + mActionFileExport2Bin = new QAction(QIcon(":/resources/devhead.png"), "&Export2Bin GUI", this); mActionFileExport2Bin->setShortcut(QKeySequence("Ctrl+E")); connect(mActionFileExport2Bin, SIGNAL(triggered()), this, SLOT(OnFileExport2Bin())); + mActionCreateGdt = new QAction(QIcon(":/resources/GDTCreator.png"), "&GDT Creator", this); + mActionCreateGdt->setShortcut(QKeySequence("Ctrl+G")); + connect(mActionCreateGdt, SIGNAL(triggered()), this, SLOT(OnFileGDTCreator())); + mActionFileExit = new QAction("E&xit", this); connect(mActionFileExit, SIGNAL(triggered()), this, SLOT(close())); @@ -389,6 +404,14 @@ void mlMainWindow::CreateActions() mActionHelpAbout = new QAction("&About...", this); connect(mActionHelpAbout, SIGNAL(triggered()), this, SLOT(OnHelpAbout())); + + mActionOpenDocs = new QAction("&Documentation",this); + connect(mActionOpenDocs, SIGNAL(triggered()),this,SLOT(OnOpenDocs())); + + mActionSaveOutput = new QAction("&Save Console Output",this); + mActionSaveOutput->setShortcut(QKeySequence("CTRL+S")); + connect(mActionSaveOutput,SIGNAL(triggered()),this,SLOT(OnSaveOutput())); + } void mlMainWindow::CreateMenu() @@ -401,6 +424,9 @@ void mlMainWindow::CreateMenu() FileMenu->addAction(mActionFileAssetEditor); FileMenu->addAction(mActionFileLevelEditor); FileMenu->addAction(mActionFileExport2Bin); + FileMenu->addAction(mActionCreateGdt); + FileMenu->addSeparator(); + FileMenu->addAction(mActionSaveOutput); FileMenu->addSeparator(); FileMenu->addAction(mActionFileExit); MenuBar->addAction(FileMenu->menuAction()); @@ -414,6 +440,7 @@ void mlMainWindow::CreateMenu() QMenu* HelpMenu = new QMenu("&Help", MenuBar); HelpMenu->addAction(mActionHelpAbout); + HelpMenu->addAction(mActionOpenDocs); MenuBar->addAction(HelpMenu->menuAction()); setMenuBar(MenuBar); @@ -431,6 +458,9 @@ void mlMainWindow::CreateToolBar() ToolBar->addAction(mActionFileAssetEditor); ToolBar->addAction(mActionFileLevelEditor); ToolBar->addAction(mActionFileExport2Bin); + ToolBar->addAction(mActionCreateGdt); + + ToolBar->setMovable(false); addToolBar(Qt::TopToolBarArea, ToolBar); } @@ -457,7 +487,7 @@ void mlMainWindow::InitExport2BinGUI() mExport2BinOverwriteWidget = new QCheckBox("&Overwrite Existing Files", widget); gridLayout->addWidget(mExport2BinOverwriteWidget, 1, 0); - + QSettings Settings; mExport2BinOverwriteWidget->setChecked(Settings.value("Export2Bin_OverwriteFiles", true).toBool()); @@ -487,6 +517,44 @@ void mlMainWindow::InitExport2BinGUI() mExport2BinGUIWidget = dock; } +void mlMainWindow::InitGDTCreator() +{ + QDockWidget *dock = new QDockWidget(this, NULL); + dock->setWindowTitle("Quick GDT Creator"); + dock->setFloating(true); + + QWidget* widget = new QWidget(dock); + QGridLayout* gridLayout = new QGridLayout(); + widget->setLayout(gridLayout); + dock->setWidget(widget); + + GDTCreator* groupBox = new GDTCreator(dock, this); + gridLayout->addWidget(groupBox, 0, 0,1,0); + + QLabel* label = new QLabel("Drag Files Here", groupBox); + label->setAlignment(Qt::AlignCenter); + QVBoxLayout* groupBoxLayout = new QVBoxLayout(groupBox); + groupBoxLayout->addWidget(label); + groupBox->setLayout(groupBoxLayout); + + mOpenAPEAfterCreation = new QCheckBox("Open APE After Creation", widget); + mAutoCopyAssetsAfterGDTCreation = new QCheckBox("Copy Assets After Creation", widget); //Doesn't Need A Settings. + + gridLayout->addWidget(mOpenAPEAfterCreation, 1, 0); + gridLayout->addWidget(mAutoCopyAssetsAfterGDTCreation,1,1); + + QSettings Settings; + mOpenAPEAfterCreation->setChecked(Settings.value("GDTCreate_OpenAPEAfterCreation", true).toBool()); + + connect(mOpenAPEAfterCreation, SIGNAL(clicked()), this, SLOT(OnOpenAPEAfterToggle())); + + groupBox->setAcceptDrops(true); + + dock->resize(QSize(256, 256)); + + mGDTCreatorGUIWidget = dock; +} + void mlMainWindow::closeEvent(QCloseEvent* Event) { QSettings Settings; @@ -516,13 +584,19 @@ void mlMainWindow::UpdateDB() void mlMainWindow::StartBuildThread(const QList>& Commands) { - mBuildButton->setText("Cancel"); - mOutputWidget->clear(); + if(mBuildThread == NULL) + { + mBuildButton->setText("Cancel"); - mBuildThread = new mlBuildThread(Commands, mIgnoreErrorsWidget->isChecked()); - connect(mBuildThread, SIGNAL(OutputReady(QString)), this, SLOT(BuildOutputReady(QString))); - connect(mBuildThread, SIGNAL(finished()), this, SLOT(BuildFinished())); - mBuildThread->start(); + mBuildThread = new mlBuildThread(Commands, mIgnoreErrorsWidget->isChecked()); + connect(mBuildThread, SIGNAL(OutputReady(QString)), this, SLOT(BuildOutputReady(QString))); + connect(mBuildThread, SIGNAL(finished()), this, SLOT(BuildFinished())); + mBuildThread->start(); + } + else + { + QMessageBox::warning(NULL,"Task In Progress","There Is Already A Task In Progress.\nPlease Wait Or Cancel It!",QMessageBox::Ok); + } } void mlMainWindow::StartConvertThread(QStringList& pathList, QString& outputDir, bool allowOverwrite) @@ -607,6 +681,7 @@ void mlMainWindow::ContextMenuRequested() Menu->addAction(mActionFileLevelEditor); Menu->addAction("Edit Zone File", this, SLOT(OnOpenZoneFile())); + Menu->addAction(QString("Open %1 Folder").arg(ItemType), this, SLOT(OnOpenModRootFolder())); Menu->addSeparator(); @@ -651,6 +726,17 @@ void mlMainWindow::OnFileExport2Bin() mExport2BinGUIWidget->isVisible() ? mExport2BinGUIWidget->hide() : mExport2BinGUIWidget->show(); } +void mlMainWindow::OnFileGDTCreator() +{ + if (mGDTCreatorGUIWidget == NULL) + { + InitGDTCreator(); + mGDTCreatorGUIWidget->hide(); + } + + mGDTCreatorGUIWidget->isVisible() ? mGDTCreatorGUIWidget->hide() : mGDTCreatorGUIWidget->show(); +} + void mlMainWindow::OnFileNew() { QDir TemplatesFolder(QString("%1/rex/templates").arg(mToolsPath)); @@ -832,12 +918,13 @@ void mlMainWindow::OnEditBuild() AddUpdateDBCommand(); QStringList Args; - Args << "-platform" << "pc"; - if (mCompileModeWidget->currentIndex() == 0) - Args << "-onlyents"; - else - Args << "-navmesh" << "-navvolume"; + + Args << "-platform" << "pc"; + if (mCompileModeWidget->currentIndex() == 0) + Args << "-onlyents"; + else + Args << "-navmesh" << "-navvolume"; Args << "-loadFrom" << QString("%1\\map_source\\%2\\%3.map").arg(mGamePath, MapName.left(2), MapName); Args << QString("%1\\share\\raw\\maps\\%2\\%3.d3dbsp").arg(mGamePath, MapName.left(2), MapName); @@ -909,10 +996,6 @@ void mlMainWindow::OnEditBuild() if (!LastMap.isEmpty()) Args << "+devmap" << LastMap; - QString ExtraOptions = mRunOptionsWidget->text(); - if (!ExtraOptions.isEmpty()) - Args << ExtraOptions.split(' '); - Commands.append(QPair(QString("%1/BlackOps3.exe").arg(mGamePath), Args)); } @@ -1130,6 +1213,12 @@ void mlMainWindow::OnEditOptions() Checkbox->setChecked(Settings.value("UseDarkTheme", false).toBool()); Layout->addWidget(Checkbox); + QCheckBox* InBuiltEditor = new QCheckBox("Use Built-In Zone Editor"); + InBuiltEditor->setToolTip("Toggle between using default zone file editor, or the inbult one. (BETA)"); + InBuiltEditor->setChecked(Settings.value("InBuiltEditor",false).toBool()); + Layout->addWidget(InBuiltEditor); + + QHBoxLayout* LanguageLayout = new QHBoxLayout(); LanguageLayout->addWidget(new QLabel("Build Language:")); @@ -1160,10 +1249,11 @@ void mlMainWindow::OnEditOptions() mBuildLanguage = LanguageCombo->currentText(); mTreyarchTheme = Checkbox->isChecked(); + mUseBuiltInEditor = InBuiltEditor->isChecked(); Settings.setValue("BuildLanguage", mBuildLanguage); Settings.setValue("UseDarkTheme", mTreyarchTheme); - + Settings.setValue("InBuiltEditor",mUseBuiltInEditor); UpdateTheme(); } @@ -1185,6 +1275,9 @@ void mlMainWindow::UpdateTheme() } } + + + void mlMainWindow::OnEditDvars() { QDialog Dialog(this, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); @@ -1242,6 +1335,9 @@ void mlMainWindow::OnEditDvars() case DVAR_VALUE_STRING: dvarValue = Dvar::setDvarSetting(dvar, (QLineEdit*)widget); break; + case DVAR_VALUE_COMBO: + dvarValue = Dvar::setDvarSetting(dvar,(QComboBox*)widget); + break; } if(!dvarValue.toLatin1().isEmpty()) @@ -1250,6 +1346,7 @@ void mlMainWindow::OnEditDvars() mRunDvars << "+set" << dvarName; else // hack for cmds mRunDvars << QString("+%1").arg(dvarName); + mRunDvars << dvarValue; } size++; @@ -1309,26 +1406,26 @@ void mlMainWindow::UpdateWorkshopItem() SteamUGC()->SetItemTags(UpdateHandle, &Tags); - SteamAPICall_t SteamAPICall = SteamUGC()->SubmitItemUpdate(UpdateHandle, ""); - mSteamCallResultUpdateItem.Set(SteamAPICall, this, &mlMainWindow::OnUpdateItemResult); - - QProgressDialog Dialog(this); - Dialog.setLabelText(QString("Uploading workshop item '%1'...").arg(QString::number(mFileId))); - Dialog.setCancelButton(NULL); - Dialog.setWindowModality(Qt::WindowModal); - Dialog.show(); - - for (;;) - { - uint64 Processed, Total; - if (SteamUGC()->GetItemUpdateProgress(SteamAPICall, &Processed, &Total) == k_EItemUpdateStatusInvalid) - break; - - Dialog.setMaximum(Total); - Dialog.setValue(Processed); - QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); - Sleep(100); - } + SteamAPICall_t SteamAPICall = SteamUGC()->SubmitItemUpdate(UpdateHandle, ""); + mSteamCallResultUpdateItem.Set(SteamAPICall, this, &mlMainWindow::OnUpdateItemResult); + + QProgressDialog Dialog(this); + Dialog.setLabelText(QString("Uploading workshop item '%1'...").arg(QString::number(mFileId))); + Dialog.setCancelButton(NULL); + Dialog.setWindowModality(Qt::WindowModal); + Dialog.show(); + + for (;;) + { + uint64 Processed, Total; + if (SteamUGC()->GetItemUpdateProgress(SteamAPICall, &Processed, &Total) == k_EItemUpdateStatusInvalid) + break; + + Dialog.setMaximum(Total); + Dialog.setValue(Processed); + QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); + Sleep(100); + } } void mlMainWindow::OnCreateItemResult(CreateItemResult_t* CreateItemResult, bool IOFailure) @@ -1373,24 +1470,54 @@ void mlMainWindow::OnHelpAbout() QMessageBox::about(this, "About Modtools Launcher", "Treyarch Modtools Launcher\nCopyright 2016 Treyarch"); } +void mlMainWindow::OnOpenDocs() +{ + ShellExecute(NULL,"open",QString("%1/docs_modtools").arg(mGamePath).toLatin1().constData(),"",NULL,SW_SHOWDEFAULT); +} + +void mlMainWindow::OnSaveOutput() +{ + QFile* Output = new QFile("Output.txt"); + if(Output->open(QIODevice::WriteOnly | QIODevice::Text)) + { + QTextStream Out(Output); + Out << (mOutputWidget->toPlainText()); + Out.flush(); + QMessageBox::information(this,"Saved Console Output","Saved Console Output To: Output.txt",QMessageBox::Ok); + } + else + { + QMessageBox::warning(this,"Failed To Save Console Output!","Failed To Save!: "+Output->errorString(),QMessageBox::Ok); + } + Output->close(); +} + void mlMainWindow::OnOpenZoneFile() { QList ItemList = mFileListWidget->selectedItems(); if (ItemList.isEmpty()) return; - + QTreeWidgetItem* Item = ItemList[0]; if (Item->data(0, Qt::UserRole).toInt() == ML_ITEM_MAP) { QString MapName = Item->text(0); - ShellExecute(NULL, "open", QString("\"%1/usermaps/%2/zone_source/%3.zone\"").arg(mGamePath, MapName, MapName).toLatin1().constData(), "", NULL, SW_SHOWDEFAULT); + mZonePath = QString("%1/usermaps/%2/zone_source/%3.zone").arg(mGamePath, MapName, MapName); + if(mUseBuiltInEditor) + OpenZoneEditor(); + else + ShellExecute(NULL, "open", mZonePath.toLatin1().constData(), "", NULL, SW_SHOWDEFAULT); } else { QString ModName = Item->parent()->text(0); QString ZoneName = Item->text(0); - ShellExecute(NULL, "open", (QString("\"%1/mods/%2/zone_source/%3.zone\"").arg(mGamePath, ModName, ZoneName)).toLatin1().constData(), "", NULL, SW_SHOWDEFAULT); + mZonePath = QString("%1/mods/%2/zone_source/%3.zone").arg(mGamePath, ModName, ZoneName); + if(mUseBuiltInEditor) + OpenZoneEditor(); + else + ShellExecute(NULL, "open", mZonePath.toLatin1().constData(), "", NULL, SW_SHOWDEFAULT); } } @@ -1441,10 +1568,6 @@ void mlMainWindow::OnRunMapOrMod() Args << ModName; } - QString ExtraOptions = mRunOptionsWidget->text(); - if (!ExtraOptions.isEmpty()) - Args << ExtraOptions.split(' '); - QList> Commands; Commands.append(QPair(QString("%1/BlackOps3.exe").arg(mGamePath), Args)); StartBuildThread(Commands); @@ -1540,6 +1663,12 @@ void mlMainWindow::OnExport2BinToggleOverwriteFiles() Settings.setValue("Export2Bin_OverwriteFiles", mExport2BinOverwriteWidget->isChecked()); } +void mlMainWindow::OnOpenAPEAfterToggle() +{ + QSettings Settings; + Settings.setValue("GDTCreate_OpenAPEAfterCreation", mOpenAPEAfterCreation->isChecked()); +} + void mlMainWindow::BuildOutputReady(QString Output) { mOutputWidget->appendPlainText(Output); @@ -1552,6 +1681,168 @@ void mlMainWindow::BuildFinished() mBuildThread = NULL; } +void mlMainWindow::OnConvertButton() +{ + QList> Commands; + Commands.append(QPair(QString("%1/bin/linker_modtools.exe").arg(mToolsPath), QStringList() << "-language" << "english" << "-convertall" << "-verbose")); + + StartBuildThread(Commands); +} + +void mlMainWindow::OpenZoneEditor() +{ + InitZoneEditor(); + mZoneEditorGUIWidget->hide(); + + mZoneEditorGUIWidget->isVisible() ? mZoneEditorGUIWidget->hide() : mZoneEditorGUIWidget->show(); +} + +void mlMainWindow::InitZoneEditor() +{ + QDockWidget *Dock = new QDockWidget(this,NULL); + QWidget* Widget = new QWidget(Dock); + QGridLayout* GridLayout = new QGridLayout(); + mZoneTextEdit = new QPlainTextEdit(); + QPushButton* ZoneSave = new QPushButton(); + QPushButton* ZoneCancel = new QPushButton(); + + mFileTree = new QTreeView(); + mScriptList = new QFileSystemModel(this); + + mScriptList->setFilter(QDir::AllDirs | QDir::NoDotAndDotDot | QDir::Files | QDir::NoSymLinks); + + mScriptList->setNameFilterDisables(false); + + mScriptList->setRootPath(mToolsPath); + + mFileTree->setModel(mScriptList); + mFileTree->setRootIndex(mScriptList->setRootPath(mToolsPath)); + + for (int x = 1; x < mScriptList->columnCount(); x++) + mFileTree->hideColumn(x); + + Dock->resize(QSize(720,720)); + Dock->setWindowTitle("Zone Editor"); + Dock->setFloating(true); + Dock->setWidget(Widget); + + Widget->setLayout(GridLayout); + + ZoneSave->setText("Save"); + ZoneCancel->setText("Cancel"); + + connect(ZoneSave, SIGNAL(clicked()), this, SLOT(OnSaveZone())); + connect(ZoneCancel,SIGNAL(clicked()),this,SLOT(OnCancelZone())); + connect(mZoneTextEdit, SIGNAL(textChanged()),this,SLOT(OnTextChanged())); + + connect(mFileTree->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)), this, SLOT(OnItemSelected(const QItemSelection&,const QItemSelection&))); + + + ZoneFile = new QFile(mZonePath); + if(!ZoneFile->open(QIODevice::ReadOnly)) + QMessageBox::information(this, "Error!", ZoneFile->errorString()); + + QTextStream Read(ZoneFile); + while(!Read.atEnd()) { + mZoneTextEdit->appendPlainText(Read.readLine()); + } + + ZoneFile->close(); + + GridLayout->addWidget(mFileTree,0,0); + GridLayout->addWidget(mZoneTextEdit,0,1); + GridLayout->addWidget(ZoneSave,1,0); + GridLayout->addWidget(ZoneCancel,1,1); + + mZoneEditorGUIWidget = Dock; +} + +void mlMainWindow::OnItemSelected(const QItemSelection& Selected, const QItemSelection& Deselected) +{ + if(mScriptList->hasChildren(mFileTree->currentIndex())) + { + QMessageBox::information(this,"Hold Up!","I Can't Add folders! Please Select A File.",QMessageBox::Ok); + return; + } + + QModelIndexList ParentFolderList; + QStringList ParentFolderStringList; + ParentFolderList << mFileTree->currentIndex(); + + while (ParentFolderList.last().isValid() && ParentFolderList.last().parent().data().toString() != "raw") + { + if(ParentFolderList.last().parent().data().toString() == "raw" || ParentFolderList.last().parent().data().toString() == "Call of Duty Black Ops III") //Don't Process If It's Out Of Raw, or how the hell did you get that far? Maybe I should prmopt them...? + { + QMessageBox::question(this,"Hold Up!","Hey! This File Isn't In Raw! Please Move It To Raw.",QMessageBox::No); + return; + } + ParentFolderList << ParentFolderList.last().parent(); + } + foreach(const QModelIndex &CurrentIndex, ParentFolderList) + { + ParentFolderStringList << CurrentIndex.data(Qt::DisplayRole).toString(); + } + + std::reverse(ParentFolderStringList.begin(),ParentFolderStringList.end()); + + QInputDialog AssetType; + QStringList AssetList; + AssetList << "col_map" << "gfx_map" << "fx" << "scriptparsetree" << "rawfile" << "scriptbundle" << "xmodel" << "xanim" << "material" << "weaponfile" << "sound"; + AssetType.setOption(QInputDialog::UseListViewForComboBoxItems); + AssetType.setWindowTitle("Asset Type"); + AssetType.setLabelText("What Is This?:"); + AssetType.setComboBoxItems(AssetList); + int Ret = AssetType.exec(); + + if (Ret != QDialog::Accepted) + return; + + if(!AssetType.textValue().isEmpty()) + { + mZoneTextEdit->appendPlainText(QString("%1,%2").arg(AssetType.textValue(),ParentFolderStringList.join("/"))); + mOutputWidget->appendPlainText("Done"); + } + + +} + +void mlMainWindow::OnSaveZone() +{ + ZoneFile = new QFile(mZonePath); + if(ZoneFile->open(QIODevice::WriteOnly | QIODevice::Text)) + { + QTextStream Out(ZoneFile); + Out << (mZoneTextEdit->toPlainText()); + Out.flush(); + } + else + { + QMessageBox::warning(this,"Failed To Save Zone!","Failed To Save!: "+ZoneFile->errorString(),QMessageBox::Ok); + } + + ZoneFile->close(); + mZoneEditorGUIWidget->close(); +} + +void mlMainWindow::OnCancelZone() +{ + if(ZoneFile->isOpen()) + ZoneFile->close(); + + mZoneEditorGUIWidget->close(); + return; +} + +void mlMainWindow::OnTextChanged() +{ + SyntaxTimer.start(500); +} + +void mlMainWindow::UpdateSyntax() +{ + Syntax* highlighter = new Syntax(mZoneTextEdit->document()); +} + Export2BinGroupBox::Export2BinGroupBox(QWidget* parent, mlMainWindow* parent_window) : QGroupBox(parent), parentWindow(parent_window) { this->setAcceptDrops(true); @@ -1581,7 +1872,7 @@ void Export2BinGroupBox::dropEvent(QDropEvent* event) { pathList.append(urlList.at(i).toLocalFile()); } - + QProcess* Process = new QProcess(); connect(Process, SIGNAL(finished(int)), Process, SLOT(deleteLater())); @@ -1589,7 +1880,7 @@ void Export2BinGroupBox::dropEvent(QDropEvent* event) QString outputDir = parentWindow->mExport2BinTargetDirWidget->text(); parentWindow->StartConvertThread(pathList, outputDir, allowOverwrite); - + event->acceptProposedAction(); } } @@ -1598,3 +1889,74 @@ void Export2BinGroupBox::dragLeaveEvent(QDragLeaveEvent* event) { event->accept(); } + +Syntax::Syntax(QTextDocument *parent) : QSyntaxHighlighter(parent) +{ + QSettings Settings; + SyntaxRule CurrentRule; + + KeyWordFormat.setForeground(QColor("#63a058")); + QStringList Patterns; + Patterns << "col_map" << "gfx_map" << "fx" << "scriptparsetree" << "rawfile" << "scriptbundle" << "xmodel" << "xanim" << "material" << "weaponfile" << "sound"; //I Can't Find Docs On All, Would Be Nice To Get The Rest :). + + foreach (const QString &Pattern, Patterns) { + CurrentRule.RegExPattern = QRegExp(Pattern); + CurrentRule.CharFormat = KeyWordFormat; + Rules.append(CurrentRule); + } + + //Make It So I Can Set These Somehow? + IncludeFormat.setForeground(QColor(Settings.value("IncludeFormat_Color", "#fc8eac").toString())); + CurrentRule.RegExPattern = QRegExp("#[^\n]*"); //Start With #, Continue To New Line. + CurrentRule.CharFormat = IncludeFormat; + Rules.append(CurrentRule); + + QuoteFormat.setForeground(QColor(Settings.value("QuoteFormat_Color","#6c6999").toString())); + CurrentRule.RegExPattern = QRegExp("\".*\""); //Start With ", Continue To Next ". + CurrentRule.CharFormat = QuoteFormat; + Rules.append(CurrentRule); + + SingleLineCommentFormat.setForeground(QColor(Settings.value("SingleLineCommentFormat_Color","#c0e4ff").toString())); + CurrentRule.RegExPattern = QRegExp("//[^\n]*"); //Start With //, Continue To New Line. + CurrentRule.CharFormat = SingleLineCommentFormat; + Rules.append(CurrentRule); + + PreProcessor.setForeground(QColor(Settings.value("PreProcessor_Color","#a09c85").toString())); + CurrentRule.RegExPattern = QRegExp(">[^\n]*"); //Start with >, Continue To New Line. + CurrentRule.CharFormat = PreProcessor; + Rules.append(CurrentRule); + + MultiLineCommentFormat.setForeground(QColor(Settings.value("MultiLineCommentFormat_Color","#c0e4ff").toString())); + commentStartExpression = QRegExp("/\\*"); + commentEndExpression = QRegExp("\\*/"); +} + +void Syntax::highlightBlock(const QString &text) +{ + foreach (const SyntaxRule &rule, Rules) { + QRegExp expression(rule.RegExPattern); + int index = expression.indexIn(text); + while (index >= 0) { + int length = expression.matchedLength(); + setFormat(index, length, rule.CharFormat); + index = expression.indexIn(text, index + length); + } + } + setCurrentBlockState(0); + int startIndex = 0; + if (previousBlockState() != 1) + startIndex = commentStartExpression.indexIn(text); + while (startIndex >= 0) { + int endIndex = commentEndExpression.indexIn(text, startIndex); + int commentLength; + if (endIndex == -1) { + setCurrentBlockState(1); + commentLength = text.length() - startIndex; + } else { + commentLength = endIndex - startIndex + + commentEndExpression.matchedLength(); + } + setFormat(startIndex, commentLength, MultiLineCommentFormat); + startIndex = commentStartExpression.indexIn(text, startIndex + commentLength); + } +} \ No newline at end of file diff --git a/mlMainWindow.h b/mlMainWindow.h index e91eba2..5488530 100644 --- a/mlMainWindow.h +++ b/mlMainWindow.h @@ -80,6 +80,7 @@ class mlMainWindow : public QMainWindow Q_OBJECT friend class Export2BinGroupBox; + friend class GDTCreator; public: mlMainWindow(); @@ -101,11 +102,15 @@ protected slots: void OnFileAssetEditor(); void OnFileLevelEditor(); void OnFileExport2Bin(); + void OnFileGDTCreator(); void OnEditBuild(); void OnEditPublish(); void OnEditOptions(); void OnEditDvars(); + + void OnOpenDocs(); void OnHelpAbout(); + void OnSaveOutput(); void OnOpenZoneFile(); void OnOpenModRootFolder(); void OnRunMapOrMod(); @@ -113,11 +118,21 @@ protected slots: void OnDelete(); void OnExport2BinChooseDirectory(); void OnExport2BinToggleOverwriteFiles(); + void OnOpenAPEAfterToggle(); void BuildOutputReady(QString Output); void BuildFinished(); void ContextMenuRequested(); void SteamUpdate(); + void OnConvertButton(); + void OpenZoneEditor(); + void OnSaveZone(); + void OnTextChanged(); + void UpdateSyntax(); + void OnCancelZone(); + void OnItemSelected(const QItemSelection&,const QItemSelection&); + + protected: void closeEvent(QCloseEvent* Event); @@ -134,6 +149,22 @@ protected slots: void CreateToolBar(); void InitExport2BinGUI(); + void InitZoneEditor(); + void InitGDTCreator(); + + + + bool mTreyarchTheme; + bool mUseBuiltInEditor; + bool mOpenAPEAfter; + + QString mIncludeFormat; + QString mQuoteFormat; + QString mSingleLineCommentFormat; + QString mPreProcessor; + QString mMultiLineCommentFormat; + + quint64 mFileId; QAction* mActionFileNew; QAction* mActionFileAssetEditor; @@ -144,47 +175,67 @@ protected slots: QAction* mActionEditPublish; QAction* mActionEditOptions; QAction* mActionHelpAbout; + QAction* mActionCreateGdt; + QAction* mActionSaveOutput; + QAction* mActionOpenDocs; QTreeWidget* mFileListWidget; + QPlainTextEdit* mOutputWidget; + QPlainTextEdit* mZoneTextEdit; QPushButton* mBuildButton; QPushButton* mDvarsButton; + QPushButton* mConvertButton; + + QCheckBox* mCompileEnabledWidget; - QComboBox* mCompileModeWidget; QCheckBox* mLightEnabledWidget; - QComboBox* mLightQualityWidget; QCheckBox* mLinkEnabledWidget; QCheckBox* mRunEnabledWidget; - QLineEdit* mRunOptionsWidget; QCheckBox* mIgnoreErrorsWidget; + QCheckBox* mExport2BinOverwriteWidget; + QCheckBox* mGDTCreateOverwriteWidget; + QCheckBox* mOpenAPEAfterCreation; + QCheckBox* mAutoCopyAssetsAfterGDTCreation; + + QComboBox* mCompileModeWidget; + QComboBox* mLightQualityWidget; + + QLineEdit* mExport2BinTargetDirWidget; + QLineEdit* mGDTCreateTargetDir; mlBuildThread* mBuildThread; + mlConvertThread* mConvertThread; QDockWidget* mExport2BinGUIWidget; - QCheckBox* mExport2BinOverwriteWidget; - QLineEdit* mExport2BinTargetDirWidget; + QDockWidget* mZoneEditorGUIWidget; + QDockWidget* mGDTCreatorGUIWidget; + QDockWidget* mColorChangeWidget; - bool mTreyarchTheme; QString mBuildLanguage; - - QStringList mShippedMapList; - QTimer mTimer; - - quint64 mFileId; QString mTitle; QString mDescription; QString mThumbnail; QString mWorkshopFolder; QString mFolderName; QString mType; - QStringList mTags; - QString mGamePath; QString mToolsPath; + QString mZonePath; + QStringList mTags; QStringList mRunDvars; + + + QTimer mTimer; + QTimer SyntaxTimer; + + QFile* ZoneFile; + + QFileSystemModel* mScriptList; + QTreeView* mFileTree; }; class Export2BinGroupBox : public QGroupBox @@ -200,3 +251,33 @@ class Export2BinGroupBox : public QGroupBox public: Export2BinGroupBox(QWidget *parent, mlMainWindow* parent_window); }; + +class Syntax : public QSyntaxHighlighter +{ + Q_OBJECT + +public: + Syntax(QTextDocument *parent = 0); + +protected: + void highlightBlock(const QString &text) override; + +private: + struct SyntaxRule + { + QRegExp RegExPattern; + QTextCharFormat CharFormat; + }; + QVector Rules; + + QRegExp commentStartExpression; + QRegExp commentEndExpression; + + QTextCharFormat KeyWordFormat; + QTextCharFormat QuoteFormat; + QTextCharFormat SingleLineCommentFormat; + QTextCharFormat MultiLineCommentFormat; + QTextCharFormat IncludeFormat; + QTextCharFormat PreProcessor; +}; + diff --git a/resources.qrc b/resources.qrc index f718214..86714c3 100644 --- a/resources.qrc +++ b/resources.qrc @@ -2,7 +2,6 @@ resources/AssetEditor.png resources/BlackOps3.png - resources/Export2Bin.png resources/Radiant.png resources/ModLauncher.png resources/Go.png @@ -11,5 +10,7 @@ stylesheet/stylesheet/checkbox.png stylesheet/stylesheet/down_arrow.png stylesheet/stylesheet/handle.png + resources/devhead.png + resources/GDTCreator.png diff --git a/resources/Export2Bin.png b/resources/GDTCreator.png similarity index 100% rename from resources/Export2Bin.png rename to resources/GDTCreator.png diff --git a/resources/devhead.png b/resources/devhead.png new file mode 100644 index 0000000..ce7890c Binary files /dev/null and b/resources/devhead.png differ diff --git a/stdafx.h b/stdafx.h index e4df491..4e470f7 100644 --- a/stdafx.h +++ b/stdafx.h @@ -20,7 +20,11 @@ #include #include "steam_api.h" + #include "dvar.h" +//#include "cod2map.h" Not Ready For Ship Yet. +#include "GDTCreator.h" class mlMainWindow; class mlExport2BinWidget; +//class mlZoneEditorWidget; //Add Later \ No newline at end of file