├── .gitignore ├── LICENSE ├── ModLauncher.ico ├── ModLauncher.rc ├── ModLauncher.sln ├── ModLauncher.vcxproj ├── ModLauncher.vcxproj.filters ├── README.md ├── dvar.cpp ├── dvar.h ├── main.cpp ├── mlMainWindow.cpp ├── mlMainWindow.h ├── resources.qrc ├── resources ├── AssetEditor.png ├── BlackOps3.png ├── Export2Bin.png ├── FileNew.png ├── Go.png ├── ModLauncher.png ├── Radiant.png └── upload.png ├── stdafx.cpp ├── stdafx.h └── stylesheet └── stylesheet ├── checkbox.png ├── down_arrow.png └── handle.png /.gitignore: -------------------------------------------------------------------------------- 1 | GeneratedFiles 2 | ipch 3 | x64 4 | sdk 5 | *.sdf 6 | *.opensdf 7 | *.suo 8 | *.HavokScriptPlugin 9 | *.user 10 | *.aps 11 | ModLauncher.rar 12 | ModLauncher.pro 13 | steam_api64.lib 14 | steam_api64.dll 15 | /steam -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /ModLauncher.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/ModLauncher.ico -------------------------------------------------------------------------------- /ModLauncher.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/ModLauncher.rc -------------------------------------------------------------------------------- /ModLauncher.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ModLauncher", "ModLauncher.vcxproj", "{5703602A-18C8-4781-8435-404AEFCAFEAA}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x64 = Debug|x64 9 | External_Release|x64 = External_Release|x64 10 | Release|x64 = Release|x64 11 | EndGlobalSection 12 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 13 | {5703602A-18C8-4781-8435-404AEFCAFEAA}.Debug|x64.ActiveCfg = Debug|x64 14 | {5703602A-18C8-4781-8435-404AEFCAFEAA}.Debug|x64.Build.0 = Debug|x64 15 | {5703602A-18C8-4781-8435-404AEFCAFEAA}.External_Release|x64.ActiveCfg = External_Release|x64 16 | {5703602A-18C8-4781-8435-404AEFCAFEAA}.External_Release|x64.Build.0 = External_Release|x64 17 | {5703602A-18C8-4781-8435-404AEFCAFEAA}.Release|x64.ActiveCfg = Release|x64 18 | {5703602A-18C8-4781-8435-404AEFCAFEAA}.Release|x64.Build.0 = Release|x64 19 | EndGlobalSection 20 | GlobalSection(SolutionProperties) = preSolution 21 | HideSolutionNode = FALSE 22 | EndGlobalSection 23 | GlobalSection(ExtensibilityGlobals) = postSolution 24 | Qt5Version = external 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /ModLauncher.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | External_Release 14 | Win32 15 | 16 | 17 | External_Release 18 | x64 19 | 20 | 21 | Release 22 | Win32 23 | 24 | 25 | Release 26 | x64 27 | 28 | 29 | 30 | {5703602A-18C8-4781-8435-404AEFCAFEAA} 31 | Qt4VSv1.0 32 | ModLauncher 33 | 34 | 35 | 36 | Application 37 | true 38 | v110 39 | 40 | 41 | 42 | 43 | Application 44 | true 45 | v110 46 | 47 | 48 | 49 | Application 50 | false 51 | v110 52 | false 53 | 54 | 55 | 56 | 57 | Application 58 | false 59 | v120 60 | false 61 | 62 | 63 | 64 | Application 65 | false 66 | v110 67 | false 68 | 69 | 70 | 71 | Application 72 | false 73 | v120 74 | false 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | true 101 | $(TA_TOOLS_PATH)\bin\ 102 | $(Platform)\$(Configuration)\ 103 | $(ProjectName)$(TA_EXECUTABLE_SUFFIX) 104 | 105 | 106 | $(Platform)\$(Configuration)\ 107 | $(ProjectName)_d$(TA_EXECUTABLE_SUFFIX) 108 | true 109 | $(TA_TOOLS_PATH)\bin\ 110 | 111 | 112 | false 113 | $(TA_TOOLS_PATH)\bin\ 114 | $(Platform)\$(Configuration)\ 115 | $(ProjectName)$(TA_EXECUTABLE_SUFFIX) 116 | 117 | 118 | false 119 | $(TA_TOOLS_PATH)\bin\ 120 | $(Platform)\$(Configuration)\ 121 | $(ProjectName)$(TA_EXECUTABLE_SUFFIX) 122 | 123 | 124 | $(Platform)\$(Configuration)\ 125 | $(ProjectName)$(TA_EXECUTABLE_SUFFIX) 126 | 127 | 128 | $(TA_TOOLS_PATH)\bin\ 129 | 130 | 131 | $(Platform)\$(Configuration)\ 132 | $(ProjectName)$(TA_EXECUTABLE_SUFFIX) 133 | 134 | $(TA_TOOLS_PATH)\bin\ 135 | 136 | 137 | 138 | Use 139 | Level1 140 | Disabled 141 | WIN32;_DEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) 142 | 143 | 144 | $(TA_CODE_PATH);$(TA_CODE_PATH)\tools;.\GeneratedFiles;.;$(QTDIR)\include;.\GeneratedFiles\$(ConfigurationName);$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtWidgets;%(AdditionalIncludeDirectories) 145 | true 146 | 147 | 148 | Windows 149 | true 150 | 151 | 152 | 153 | 154 | Use 155 | Level1 156 | Disabled 157 | WIN32;_DEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) 158 | 159 | 160 | $(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) 161 | true 162 | 163 | 164 | Windows 165 | true 166 | $(QTDIR)\lib;$(TA_TOOLS_PATH)\bin;$(TL_SDK)/Steamworks/sdk-1.37/redistributable_bin/win64;$(SolutionDir)/sdk/redistributable_bin/win64; 167 | 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) 168 | mainCRTStartup 169 | 170 | 171 | 172 | 173 | Level3 174 | Use 175 | MaxSpeed 176 | true 177 | true 178 | WIN32;NDEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) 179 | true 180 | 181 | 182 | Windows 183 | true 184 | true 185 | true 186 | 187 | 188 | 189 | 190 | Level3 191 | Use 192 | MaxSpeed 193 | true 194 | true 195 | WIN32;NDEBUG;_WINDOWS;QT_DLL;%(PreprocessorDefinitions) 196 | true 197 | 198 | 199 | Windows 200 | true 201 | true 202 | true 203 | 204 | 205 | 206 | 207 | Level1 208 | Use 209 | MaxSpeed 210 | 211 | 212 | true 213 | USE_CUSTOM_QT=1;UTILS;RELEASE_BUILD;AS_NO_USER_ALLOC;WIN32;QT_DLL;NDEBUG;%(PreprocessorDefinitions) 214 | 215 | 216 | $(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) 217 | true 218 | 219 | 220 | Windows 221 | true 222 | true 223 | true 224 | $(QTDIR)\lib;$(TA_TOOLS_PATH)\bin;$(TL_SDK)/Steamworks/sdk-1.37/redistributable_bin/win64;$(SolutionDir)/sdk/redistributable_bin/win64;%(AdditionalLibraryDirectories) 225 | %(AdditionalDependencies) 226 | mainCRTStartup 227 | 228 | 229 | true 230 | 231 | 232 | 233 | 234 | Level1 235 | Use 236 | MaxSpeed 237 | 238 | 239 | true 240 | UTILS;RELEASE_BUILD;AS_NO_USER_ALLOC;WIN32;QT_DLL;NDEBUG;%(PreprocessorDefinitions) 241 | 242 | 243 | $(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) 244 | true 245 | 246 | 247 | Windows 248 | true 249 | true 250 | true 251 | $(QTDIR)\lib;$(TA_TOOLS_PATH)\bin;$(TL_SDK)/Steamworks/sdk-1.37/redistributable_bin/win64;$(SolutionDir)/sdk/redistributable_bin/win64;%(AdditionalLibraryDirectories) 252 | %(AdditionalDependencies) 253 | mainCRTStartup 254 | 255 | 256 | true 257 | 258 | 259 | 260 | 261 | 262 | 263 | Performing Custom Build Tools 264 | 265 | 266 | 267 | 268 | 269 | 270 | Performing Custom Build Tools 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | Performing Custom Build Tools 280 | Performing Custom Build Tools 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | Performing Custom Build Tools 294 | Performing Custom Build Tools 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | true 309 | true 310 | true 311 | true 312 | 313 | 314 | true 315 | true 316 | true 317 | true 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | true 335 | true 336 | true 337 | true 338 | 339 | 340 | 341 | 342 | Create 343 | Create 344 | Create 345 | Create 346 | Create 347 | Create 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | Performing Custom Build Tools 358 | 359 | 360 | 361 | 362 | 363 | 364 | Performing Custom Build Tools 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | Performing Custom Build Tools 374 | Performing Custom Build Tools 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | Performing Custom Build Tools 388 | Performing Custom Build Tools 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | $(QTDIR)\bin\moc.exe;%(FullPath) 402 | Moc%27ing mlMainWindow.h... 403 | GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp 404 | "$(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" 405 | $(QTDIR)\bin\moc.exe;%(FullPath) 406 | Moc%27ing mlMainWindow.h... 407 | .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp 408 | "$(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" 409 | $(QTDIR)\bin\moc.exe;%(FullPath) 410 | $(QTDIR)\bin\moc.exe;%(FullPath) 411 | Moc%27ing mlMainWindow.h... 412 | Moc%27ing mlMainWindow.h... 413 | .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp 414 | .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp 415 | "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DWIN32 -DNDEBUG -D_WINDOWS -DQT_DLL "-fstdafx.h" "-f../../mlMainWindow.h" 416 | "$(QTDIR)\bin\moc.exe" "%(FullPath)" -o ".\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp" -DWIN32 -DNDEBUG -D_WINDOWS -DQT_DLL "-fstdafx.h" "-f../../mlMainWindow.h" 417 | $(QTDIR)\bin\moc.exe;%(FullPath) 418 | $(QTDIR)\bin\moc.exe;%(FullPath) 419 | Moc%27ing mlMainWindow.h... 420 | Moc%27ing mlMainWindow.h... 421 | .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp 422 | .\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp 423 | "$(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" 424 | "$(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" 425 | 426 | 427 | 428 | 429 | %(FullPath);%(AdditionalInputs) 430 | Rcc%27ing %(Identity)... 431 | GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) 432 | "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp 433 | %(FullPath);%(AdditionalInputs) 434 | Rcc%27ing %(Identity)... 435 | GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) 436 | "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp 437 | %(FullPath);%(AdditionalInputs) 438 | %(FullPath);%(AdditionalInputs) 439 | Rcc%27ing %(Identity)... 440 | Rcc%27ing %(Identity)... 441 | GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) 442 | GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) 443 | "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp 444 | "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp 445 | %(FullPath);%(AdditionalInputs) 446 | %(FullPath);%(AdditionalInputs) 447 | Rcc%27ing %(Identity)... 448 | Rcc%27ing %(Identity)... 449 | GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) 450 | GeneratedFiles\qrc_%(Filename).cpp;%(Outputs) 451 | "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp 452 | "$(QTDIR)\bin\rcc.exe" -name "%(Filename)" -no-compress "%(FullPath)" -o GeneratedFiles\qrc_%(Filename).cpp 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | -------------------------------------------------------------------------------- /ModLauncher.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | 7 | 8 | 9 | 10 | {D9D6E242-F8AF-46E4-B9FD-80ECBC20BA3E} 11 | qrc;* 12 | false 13 | 14 | 15 | {71ED8ED8-ACB9-4CE9-BBE1-E00B30144E11} 16 | moc;h;cpp 17 | true 18 | 19 | 20 | {b502a68c-39f1-45fa-aee3-e0b84597f5cd} 21 | cpp;moc 22 | False 23 | 24 | 25 | {5ddc88cb-5485-44df-aa7c-9ca4b497ec31} 26 | cpp;moc 27 | False 28 | 29 | 30 | {5fc30545-a821-4000-9780-d6dd6c4d03ff} 31 | 32 | 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | Generated Files\Debug 45 | 46 | 47 | Generated Files\Release 48 | 49 | 50 | Generated Files 51 | 52 | 53 | Generated Files\External_Release 54 | 55 | 56 | Source Files 57 | 58 | 59 | 60 | 61 | Resource Files 62 | 63 | 64 | 65 | 66 | Resource Files 67 | 68 | 69 | Resource Files 70 | 71 | 72 | Source Files 73 | 74 | 75 | Source Files 76 | 77 | 78 | 79 | 80 | Source Files 81 | 82 | 83 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ModLauncher 2 | ModTools Launcher App 3 | 4 | This is the Launcher App used by the Call of Duty: Black Ops III Mod Tools. 5 | 6 | It's licensed under the Apache 2.0 License, a copy of which is included in the LICENSE file. 7 | 8 | # Compiling 9 | 10 | You'll need the Qt and Steam SDK installed. We use VS 2012 to compile but newer versions should work too, even though we don't provide a Qt Creator project it should still be possible to use it if you create your own project. 11 | 12 | Openning the project with a different version of VS may display a prompt to upgrade, this is ok and shouldn't cause any problems. 13 | 14 | If you have the Qt VS Plugin installed you may get a message saying "There's no Qt Version assigned to this project for platform x64. Please use the 'change Qt version' feature and choose a valid Qt version for this platform", just select your Qt version from the Qt Project Settings Dialog. The plugin is not needed to compile the Launcher. 15 | 16 | You'll need to change the compiler and linker search paths to where you have the Qt and Steam SDK installed. Note that the version of the Steam SDK that you use must match the DLL in game\bin (currently 1.37) or you'll get errors when trying to run. 17 | 18 | Use the 'Release External' configuration to compile, as this matches the standard Qt DLL names. 19 | 20 | # Debugging and Running 21 | 22 | If you're trying to debug or launch the application from Visual Studio you'll need to create a file called steam_appid.txt with the number 455130 in the same folder of the exe. 23 | -------------------------------------------------------------------------------- /dvar.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | 3 | Dvar::Dvar(dvar_s _dvar, QTreeWidget *_dvarTree) : dvar(_dvar) 4 | { 5 | QString dvarSetting = QString("dvar_%1").arg(dvar.name); 6 | QSettings settings; 7 | 8 | QTreeWidgetItem* Item = new QTreeWidgetItem(_dvarTree, QStringList() << dvar.name); 9 | Item->setText(0, dvar.name); 10 | Item->setToolTip(0, dvar.description); 11 | 12 | QCheckBox* checkBox; 13 | QSpinBox* spinBox; 14 | QLineEdit* textBox; 15 | 16 | switch(this->dvar.type) 17 | { 18 | case DVAR_VALUE_BOOL: 19 | checkBox = new QCheckBox(); 20 | checkBox->setChecked(settings.value(dvarSetting, false).toBool()); 21 | checkBox->setToolTip("Boolean value, check to enable or uncheck to disable."); 22 | _dvarTree->setItemWidget(Item, 1, checkBox); 23 | break; 24 | case DVAR_VALUE_INT: 25 | spinBox = new QSpinBox(); 26 | spinBox->setValue(settings.value(dvarSetting, 0).toInt()); 27 | spinBox->setToolTip("Integer value, min to max any number."); 28 | spinBox->setMaximum(dvar.maxValue); 29 | spinBox->setMinimum(dvar.minValue); 30 | _dvarTree->setItemWidget(Item, 1, spinBox); 31 | break; 32 | case DVAR_VALUE_STRING: 33 | textBox = new QLineEdit(); 34 | textBox->setText(settings.value(dvarSetting, "").toString()); 35 | textBox->setToolTip(QString("String value, leave this blank for it to not be used.")); 36 | textBox->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); 37 | _dvarTree->setItemWidget(Item, 1, textBox); 38 | break; 39 | } 40 | } 41 | 42 | Dvar::~Dvar() 43 | { 44 | } 45 | 46 | dvar_s Dvar::findDvar(QString _dvarName, QTreeWidget* DvarTree, dvar_s* dvars, int DvarSize) 47 | { 48 | dvar_s _dvar; 49 | for(int DvarIdx = 0; DvarIdx < DvarSize; DvarIdx++) 50 | { 51 | _dvar = Dvar(dvars[DvarIdx], DvarTree).dvar; 52 | if(_dvar.name == _dvarName) 53 | return _dvar; 54 | } 55 | return _dvar; 56 | } 57 | 58 | QString Dvar::setDvarSetting(dvar_s _dvar, QCheckBox* _checkBox) 59 | { 60 | QSettings Settings; 61 | Settings.setValue(QString("dvar_%1").arg(_dvar.name), _checkBox->isChecked()); 62 | 63 | return Settings.value(QString("dvar_%1").arg(_dvar.name)).toString() == "true" ? "1" : "0"; // another way to do this? 64 | } 65 | 66 | QString Dvar::setDvarSetting(dvar_s _dvar, QSpinBox* _spinBox) 67 | { 68 | QSettings Settings; 69 | Settings.setValue(QString("dvar_%1").arg(_dvar.name), _spinBox->value()); 70 | 71 | return Settings.value(QString("dvar_%1").arg(_dvar.name)).toString(); 72 | } 73 | 74 | QString Dvar::setDvarSetting(dvar_s _dvar, QLineEdit* _lineEdit) 75 | { 76 | QSettings Settings; 77 | Settings.setValue(QString("dvar_%1").arg(_dvar.name), _lineEdit->text()); 78 | 79 | return Settings.value(QString("dvar_%1").arg(_dvar.name)).toString(); 80 | } 81 | -------------------------------------------------------------------------------- /dvar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | enum DvarType 4 | { 5 | DVAR_VALUE_BOOL, 6 | DVAR_VALUE_INT, 7 | DVAR_VALUE_STRING 8 | }; 9 | 10 | struct dvar_s 11 | { 12 | const char* name; 13 | const char* description; 14 | DvarType type; 15 | int minValue; 16 | int maxValue; 17 | bool isCmd; 18 | }; 19 | 20 | class Dvar 21 | { 22 | private: 23 | dvar_s dvar; 24 | 25 | public: 26 | Dvar(); 27 | Dvar(dvar_s, QTreeWidget*); 28 | ~Dvar(); 29 | 30 | static QString setDvarSetting(dvar_s, QCheckBox*); 31 | static QString setDvarSetting(dvar_s, QSpinBox*); 32 | static QString setDvarSetting(dvar_s, QLineEdit*); 33 | 34 | static dvar_s findDvar(QString, QTreeWidget*, dvar_s*, int); 35 | }; 36 | -------------------------------------------------------------------------------- /main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2016 Activision Publishing, Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #include "stdafx.h" 20 | #include "mlMainWindow.h" 21 | 22 | int main(int argc, char *argv[]) 23 | { 24 | QApplication App(argc, argv); 25 | 26 | QCoreApplication::setOrganizationDomain("treyarch.com"); 27 | QCoreApplication::setOrganizationName("Treyarch"); 28 | QCoreApplication::setApplicationName("ModLauncher"); 29 | // QCoreApplication::setApplicationVersion(); 30 | 31 | mlMainWindow MainWindow; 32 | MainWindow.UpdateDB(); 33 | MainWindow.show(); 34 | 35 | return App.exec(); 36 | } 37 | -------------------------------------------------------------------------------- /mlMainWindow.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2016 Activision Publishing, Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #include "stdafx.h" 20 | 21 | #include "mlMainWindow.h" 22 | 23 | #include 24 | #include 25 | #include 26 | #include 27 | 28 | #pragma comment(lib, "steam_api64.lib") 29 | 30 | const int AppId = 311210; 31 | 32 | const char* gLanguages[] = { "english", "french", "italian", "spanish", "german", "portuguese", "russian", "polish", "japanese", "traditionalchinese", "simplifiedchinese", "englisharabic" }; 33 | const char* gTags[] = { "Animation", "Audio", "Character", "Map", "Mod", "Mode", "Model", "Multiplayer", "Scorestreak", "Skin", "Specialist", "Texture", "UI", "Vehicle", "Visual Effect", "Weapon", "WIP", "Zombies" }; 34 | dvar_s gDvars[] = { 35 | {"ai_disableSpawn", "Disable AI from spawning", DVAR_VALUE_BOOL}, 36 | {"developer", "Run developer mode", DVAR_VALUE_INT, 0, 2}, 37 | {"g_password", "Password for your server", DVAR_VALUE_STRING}, 38 | {"logfile", "Console log information written to current fs_game", DVAR_VALUE_INT, 0, 2}, 39 | {"scr_mod_enable_devblock", "Developer blocks are executed in mods ", DVAR_VALUE_BOOL}, 40 | {"connect", "Connect to a specific server", DVAR_VALUE_STRING, NULL, NULL, true}, 41 | {"set_gametype", "Set a gametype to load with map", DVAR_VALUE_STRING, NULL, NULL, true}, 42 | {"splitscreen", "Enable splitscreen", DVAR_VALUE_BOOL}, 43 | {"splitscreen_playerCount", "Allocate the number of instances for splitscreen", DVAR_VALUE_INT, 0, 2} 44 | }; 45 | enum mlItemType 46 | { 47 | ML_ITEM_UNKNOWN, 48 | ML_ITEM_MAP, 49 | ML_ITEM_MOD 50 | }; 51 | 52 | mlBuildThread::mlBuildThread(const QList>& Commands, bool IgnoreErrors) 53 | : mCommands(Commands), mSuccess(false), mCancel(false), mIgnoreErrors(IgnoreErrors) 54 | { 55 | } 56 | 57 | void mlBuildThread::run() 58 | { 59 | bool Success = true; 60 | 61 | for (const QPair& Command : mCommands) 62 | { 63 | QProcess* Process = new QProcess(); 64 | connect(Process, SIGNAL(finished(int)), Process, SLOT(deleteLater())); 65 | Process->setWorkingDirectory(QFileInfo(Command.first).absolutePath()); 66 | Process->setProcessChannelMode(QProcess::MergedChannels); 67 | 68 | emit OutputReady(Command.first + ' ' + Command.second.join(' ') + "\n"); 69 | 70 | Process->start(Command.first, Command.second); 71 | for (;;) 72 | { 73 | Sleep(100); 74 | 75 | if (Process->waitForReadyRead(0)) 76 | emit OutputReady(Process->readAll()); 77 | 78 | QProcess::ProcessState State = Process->state(); 79 | if (State == QProcess::NotRunning) 80 | break; 81 | 82 | if (mCancel) 83 | Process->kill(); 84 | } 85 | 86 | if (Process->exitStatus() != QProcess::NormalExit) 87 | return; 88 | 89 | if (Process->exitCode() != 0) 90 | { 91 | Success = false; 92 | if (!mIgnoreErrors) 93 | return; 94 | } 95 | } 96 | 97 | mSuccess = Success; 98 | } 99 | 100 | mlConvertThread::mlConvertThread(QStringList& Files, QString& OutputDir, bool IgnoreErrors, bool OverwriteFiles) 101 | : mFiles(Files), mOutputDir(OutputDir), mSuccess(false), mCancel(false), mIgnoreErrors(IgnoreErrors), mOverwrite(OverwriteFiles) 102 | { 103 | } 104 | 105 | void mlConvertThread::run() 106 | { 107 | bool Success = true; 108 | 109 | unsigned int convCountSuccess = 0; 110 | unsigned int convCountSkipped = 0; 111 | unsigned int convCountFailed = 0; 112 | 113 | for (QString file : mFiles) 114 | { 115 | QFileInfo file_info(file); 116 | QString working_directory = file_info.absolutePath(); 117 | 118 | QProcess* Process = new QProcess(); 119 | connect(Process, SIGNAL(finished(int)), Process, SLOT(deleteLater())); 120 | Process->setWorkingDirectory(working_directory); 121 | Process->setProcessChannelMode(QProcess::MergedChannels); 122 | 123 | file = file_info.baseName(); 124 | 125 | QString ToolsPath = QDir::fromNativeSeparators(getenv("TA_TOOLS_PATH")); 126 | QString ExecutablePath = QString("%1bin/export2bin.exe").arg(ToolsPath); 127 | 128 | QStringList args; 129 | //args.append("/v"); // Verbose 130 | args.append("/piped"); 131 | 132 | QString filepath = file_info.absoluteFilePath(); 133 | 134 | QString ext = file_info.suffix().toUpper(); 135 | if (ext == "XANIM_EXPORT") 136 | ext = ".XANIM_BIN"; 137 | else if (ext == "XMODEL_EXPORT") 138 | ext = ".XMODEL_BIN"; 139 | else 140 | { 141 | emit OutputReady("Export2Bin: Skipping file '" + filepath + "' (file has invalid extension)\n"); 142 | convCountSkipped++; 143 | continue; 144 | } 145 | 146 | QString target_filepath = QDir::cleanPath(mOutputDir) + QDir::separator() + file + ext; 147 | 148 | QFile infile(filepath); 149 | QFile outfile(target_filepath); 150 | 151 | if (!mOverwrite && outfile.exists()) 152 | { 153 | emit OutputReady("Export2Bin: Skipping file '" + filepath + "' (file already exists)\n"); 154 | convCountSkipped++; 155 | continue; 156 | } 157 | 158 | infile.open(QIODevice::OpenMode::enum_type::ReadOnly); 159 | if (!infile.isOpen()) 160 | { 161 | emit OutputReady("Export2Bin: Could not open '" + filepath + "' for reading\n"); 162 | convCountFailed++; 163 | continue; 164 | } 165 | 166 | emit OutputReady("Export2Bin: Converting '" + file + "'"); 167 | 168 | QByteArray buf = infile.readAll(); 169 | infile.close(); 170 | 171 | Process->start(ExecutablePath, args); 172 | Process->write(buf); 173 | Process->closeWriteChannel(); 174 | 175 | QByteArray standardOutputPipeData; 176 | QByteArray standardErrorPipeData; 177 | 178 | for (;;) 179 | { 180 | Sleep(20); 181 | 182 | if (Process->waitForReadyRead(0)) 183 | { 184 | standardOutputPipeData.append(Process->readAllStandardOutput()); 185 | standardErrorPipeData.append(Process->readAllStandardError()); 186 | } 187 | 188 | QProcess::ProcessState State = Process->state(); 189 | if (State == QProcess::NotRunning) 190 | break; 191 | 192 | if (mCancel) 193 | Process->kill(); 194 | } 195 | 196 | if (Process->exitStatus() != QProcess::NormalExit) 197 | { 198 | emit OutputReady("ERROR: Process exited abnormally"); 199 | Success = false; 200 | break; 201 | } 202 | 203 | if (Process->exitCode() != 0) 204 | { 205 | emit OutputReady(standardOutputPipeData); 206 | emit OutputReady(standardErrorPipeData); 207 | 208 | convCountFailed++; 209 | 210 | if (!mIgnoreErrors) 211 | { 212 | Success = false; 213 | break; 214 | } 215 | 216 | continue; 217 | } 218 | 219 | outfile.open(QIODevice::OpenMode::enum_type::WriteOnly); 220 | if (!outfile.isOpen()) 221 | { 222 | emit OutputReady("Export2Bin: Could not open '" + target_filepath + "' for writing\n"); 223 | continue; 224 | } 225 | 226 | outfile.write(standardOutputPipeData); 227 | outfile.close(); 228 | 229 | convCountSuccess++; 230 | } 231 | 232 | mSuccess = Success; 233 | if (mSuccess) 234 | { 235 | QString msg = QString("Export2Bin: Finished!\n\n" 236 | "Files Processed: %1\n" 237 | "Successes: %2\n" 238 | "Skipped: %3\n" 239 | "Failures: %4\n").arg(mFiles.count()).arg(convCountSuccess).arg(convCountSkipped).arg(convCountFailed); 240 | emit OutputReady(msg); 241 | } 242 | } 243 | 244 | mlMainWindow::mlMainWindow() 245 | { 246 | QSettings Settings; 247 | 248 | mBuildThread = NULL; 249 | mBuildLanguage = Settings.value("BuildLanguage", "english").toString(); 250 | mTreyarchTheme = Settings.value("UseDarkTheme", false).toBool(); 251 | 252 | // Qt prefers '/' over '\\' 253 | mGamePath = QString(getenv("TA_GAME_PATH")).replace('\\', '/'); 254 | mToolsPath = QString(getenv("TA_TOOLS_PATH")).replace('\\', '/'); 255 | 256 | UpdateTheme(); 257 | 258 | setWindowIcon(QIcon(":/resources/ModLauncher.png")); 259 | setWindowTitle("Black Ops III Mod Tools Launcher"); 260 | 261 | resize(1024, 768); 262 | 263 | CreateActions(); 264 | CreateMenu(); 265 | CreateToolBar(); 266 | 267 | mExport2BinGUIWidget = NULL; 268 | 269 | QSplitter* CentralWidget = new QSplitter(); 270 | CentralWidget->setOrientation(Qt::Vertical); 271 | 272 | QWidget* TopWidget = new QWidget(); 273 | CentralWidget->addWidget(TopWidget); 274 | 275 | QHBoxLayout* TopLayout = new QHBoxLayout(TopWidget); 276 | TopWidget->setLayout(TopLayout); 277 | 278 | mFileListWidget = new QTreeWidget(); 279 | mFileListWidget->setHeaderHidden(true); 280 | mFileListWidget->setUniformRowHeights(true); 281 | mFileListWidget->setRootIsDecorated(false); 282 | mFileListWidget->setContextMenuPolicy(Qt::CustomContextMenu); 283 | TopLayout->addWidget(mFileListWidget); 284 | 285 | connect(mFileListWidget, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(ContextMenuRequested())); 286 | 287 | QVBoxLayout* ActionsLayout = new QVBoxLayout(); 288 | TopLayout->addLayout(ActionsLayout); 289 | 290 | QHBoxLayout* CompileLayout = new QHBoxLayout(); 291 | ActionsLayout->addLayout(CompileLayout); 292 | 293 | mCompileEnabledWidget = new QCheckBox("Compile"); 294 | CompileLayout->addWidget(mCompileEnabledWidget); 295 | 296 | mCompileModeWidget = new QComboBox(); 297 | mCompileModeWidget->addItems(QStringList() << "Ents" << "Full"); 298 | mCompileModeWidget->setCurrentIndex(1); 299 | CompileLayout->addWidget(mCompileModeWidget); 300 | 301 | QHBoxLayout* LightLayout = new QHBoxLayout(); 302 | ActionsLayout->addLayout(LightLayout); 303 | 304 | mLightEnabledWidget = new QCheckBox("Light"); 305 | LightLayout->addWidget(mLightEnabledWidget); 306 | 307 | mLightQualityWidget = new QComboBox(); 308 | mLightQualityWidget->addItems(QStringList() << "Low" << "Medium" << "High"); 309 | mLightQualityWidget->setCurrentIndex(1); 310 | mLightQualityWidget->setMinimumWidth(64); // Fix for "Medium" being cut off in the dark theme 311 | LightLayout->addWidget(mLightQualityWidget); 312 | 313 | mLinkEnabledWidget = new QCheckBox("Link"); 314 | ActionsLayout->addWidget(mLinkEnabledWidget); 315 | 316 | mRunEnabledWidget = new QCheckBox("Run"); 317 | ActionsLayout->addWidget(mRunEnabledWidget); 318 | 319 | mRunOptionsWidget = new QLineEdit(); 320 | mRunOptionsWidget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); 321 | ActionsLayout->addWidget(mRunOptionsWidget); 322 | 323 | mBuildButton = new QPushButton("Build"); 324 | connect(mBuildButton, SIGNAL(clicked()), mActionEditBuild, SLOT(trigger())); 325 | ActionsLayout->addWidget(mBuildButton); 326 | 327 | mDvarsButton = new QPushButton("Dvars"); 328 | connect(mDvarsButton, SIGNAL(clicked()), this, SLOT(OnEditDvars())); 329 | ActionsLayout->addWidget(mDvarsButton); 330 | 331 | mLogButton = new QPushButton("Save Log"); 332 | connect(mLogButton, SIGNAL(clicked()), this, SLOT(OnSaveLog())); 333 | ActionsLayout->addWidget(mLogButton); 334 | 335 | mIgnoreErrorsWidget = new QCheckBox("Ignore Errors"); 336 | ActionsLayout->addWidget(mIgnoreErrorsWidget); 337 | 338 | ActionsLayout->addStretch(1); 339 | 340 | mOutputWidget = new QPlainTextEdit(this); 341 | mOutputWidget->setReadOnly(true); 342 | CentralWidget->addWidget(mOutputWidget); 343 | 344 | setCentralWidget(CentralWidget); 345 | 346 | mShippedMapList << "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"; 347 | 348 | Settings.beginGroup("MainWindow"); 349 | resize(QSize(800, 600)); 350 | move(QPoint(200, 200)); 351 | restoreGeometry(Settings.value("Geometry").toByteArray()); 352 | restoreState(Settings.value("State").toByteArray()); 353 | Settings.endGroup(); 354 | 355 | SteamAPI_Init(); 356 | 357 | connect(&mTimer, SIGNAL(timeout()), this, SLOT(SteamUpdate())); 358 | mTimer.start(1000); 359 | 360 | PopulateFileList(); 361 | } 362 | 363 | mlMainWindow::~mlMainWindow() 364 | { 365 | } 366 | 367 | void mlMainWindow::CreateActions() 368 | { 369 | mActionFileNew = new QAction(QIcon(":/resources/FileNew.png"), "&New...", this); 370 | mActionFileNew->setShortcut(QKeySequence("Ctrl+N")); 371 | connect(mActionFileNew, SIGNAL(triggered()), this, SLOT(OnFileNew())); 372 | 373 | mActionFileAssetEditor = new QAction(QIcon(":/resources/AssetEditor.png"), "&Asset Editor", this); 374 | mActionFileAssetEditor->setShortcut(QKeySequence("Ctrl+A")); 375 | connect(mActionFileAssetEditor, SIGNAL(triggered()), this, SLOT(OnFileAssetEditor())); 376 | 377 | mActionFileLevelEditor = new QAction(QIcon(":/resources/Radiant.png"), "Open in &Radiant", this); 378 | mActionFileLevelEditor->setShortcut(QKeySequence("Ctrl+R")); 379 | mActionFileLevelEditor->setToolTip("Level Editor"); 380 | connect(mActionFileLevelEditor, SIGNAL(triggered()), this, SLOT(OnFileLevelEditor())); 381 | 382 | mActionFileExport2Bin = new QAction(QIcon(":/resources/Export2Bin.png"), "&Export2Bin GUI", this); 383 | mActionFileExport2Bin->setShortcut(QKeySequence("Ctrl+E")); 384 | connect(mActionFileExport2Bin, SIGNAL(triggered()), this, SLOT(OnFileExport2Bin())); 385 | 386 | mActionFileExit = new QAction("E&xit", this); 387 | connect(mActionFileExit, SIGNAL(triggered()), this, SLOT(close())); 388 | 389 | mActionEditBuild = new QAction(QIcon(":/resources/Go.png"), "Build", this); 390 | mActionEditBuild->setShortcut(QKeySequence("Ctrl+B")); 391 | connect(mActionEditBuild, SIGNAL(triggered()), this, SLOT(OnEditBuild())); 392 | 393 | mActionEditPublish = new QAction(QIcon(":/resources/upload.png"), "Publish", this); 394 | mActionEditPublish->setShortcut(QKeySequence("Ctrl+P")); 395 | connect(mActionEditPublish, SIGNAL(triggered()), this, SLOT(OnEditPublish())); 396 | 397 | mActionEditOptions = new QAction("&Options...", this); 398 | connect(mActionEditOptions, SIGNAL(triggered()), this, SLOT(OnEditOptions())); 399 | 400 | mActionHelpAbout = new QAction("&About...", this); 401 | connect(mActionHelpAbout, SIGNAL(triggered()), this, SLOT(OnHelpAbout())); 402 | } 403 | 404 | void mlMainWindow::CreateMenu() 405 | { 406 | QMenuBar* MenuBar = new QMenuBar(this); 407 | 408 | QMenu* FileMenu = new QMenu("&File", MenuBar); 409 | FileMenu->addAction(mActionFileNew); 410 | FileMenu->addSeparator(); 411 | FileMenu->addAction(mActionFileAssetEditor); 412 | FileMenu->addAction(mActionFileLevelEditor); 413 | FileMenu->addAction(mActionFileExport2Bin); 414 | FileMenu->addSeparator(); 415 | FileMenu->addAction(mActionFileExit); 416 | MenuBar->addAction(FileMenu->menuAction()); 417 | 418 | QMenu* EditMenu = new QMenu("&Edit", MenuBar); 419 | EditMenu->addAction(mActionEditBuild); 420 | EditMenu->addAction(mActionEditPublish); 421 | EditMenu->addSeparator(); 422 | EditMenu->addAction(mActionEditOptions); 423 | MenuBar->addAction(EditMenu->menuAction()); 424 | 425 | QMenu* HelpMenu = new QMenu("&Help", MenuBar); 426 | HelpMenu->addAction(mActionHelpAbout); 427 | MenuBar->addAction(HelpMenu->menuAction()); 428 | 429 | setMenuBar(MenuBar); 430 | } 431 | 432 | void mlMainWindow::CreateToolBar() 433 | { 434 | QToolBar* ToolBar = new QToolBar("Standard", this); 435 | ToolBar->setObjectName(QStringLiteral("StandardToolBar")); 436 | 437 | ToolBar->addAction(mActionFileNew); 438 | ToolBar->addAction(mActionEditBuild); 439 | ToolBar->addAction(mActionEditPublish); 440 | ToolBar->addSeparator(); 441 | ToolBar->addAction(mActionFileAssetEditor); 442 | ToolBar->addAction(mActionFileLevelEditor); 443 | ToolBar->addAction(mActionFileExport2Bin); 444 | 445 | addToolBar(Qt::TopToolBarArea, ToolBar); 446 | } 447 | 448 | void mlMainWindow::InitExport2BinGUI() 449 | { 450 | QDockWidget *dock = new QDockWidget(this, NULL); 451 | dock->setWindowTitle("Export2Bin"); 452 | dock->setFloating(true); 453 | 454 | QWidget* widget = new QWidget(dock); 455 | QGridLayout* gridLayout = new QGridLayout(); 456 | widget->setLayout(gridLayout); 457 | dock->setWidget(widget); 458 | 459 | Export2BinGroupBox* groupBox = new Export2BinGroupBox(dock, this); 460 | gridLayout->addWidget(groupBox, 0, 0); 461 | 462 | QLabel* label = new QLabel("Drag Files Here", groupBox); 463 | label->setAlignment(Qt::AlignCenter); 464 | QVBoxLayout* groupBoxLayout = new QVBoxLayout(groupBox); 465 | groupBoxLayout->addWidget(label); 466 | groupBox->setLayout(groupBoxLayout); 467 | 468 | mExport2BinOverwriteWidget = new QCheckBox("&Overwrite Existing Files", widget); 469 | gridLayout->addWidget(mExport2BinOverwriteWidget, 1, 0); 470 | 471 | QSettings Settings; 472 | mExport2BinOverwriteWidget->setChecked(Settings.value("Export2Bin_OverwriteFiles", true).toBool()); 473 | 474 | QHBoxLayout* dirLayout = new QHBoxLayout(); 475 | QLabel* dirLabel = new QLabel("Ouput Directory:", widget); 476 | mExport2BinTargetDirWidget = new QLineEdit(widget); 477 | QToolButton* dirBrowseButton = new QToolButton(widget); 478 | dirBrowseButton->setText("..."); 479 | 480 | const QDir defaultPath = QString("%1/model_export/export2bin/").arg(mToolsPath); 481 | mExport2BinTargetDirWidget->setText(Settings.value("Export2Bin_TargetDir", defaultPath.absolutePath()).toString()); 482 | 483 | connect(dirBrowseButton, SIGNAL(clicked()), this, SLOT(OnExport2BinChooseDirectory())); 484 | connect(mExport2BinOverwriteWidget, SIGNAL(clicked()), this, SLOT(OnExport2BinToggleOverwriteFiles())); 485 | 486 | dirBrowseButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); 487 | dirLayout->addWidget(dirLabel); 488 | dirLayout->addWidget(mExport2BinTargetDirWidget); 489 | dirLayout->addWidget(dirBrowseButton); 490 | 491 | gridLayout->addLayout(dirLayout, 2, 0); 492 | 493 | groupBox->setAcceptDrops(true); 494 | 495 | dock->resize(QSize(256, 256)); 496 | 497 | mExport2BinGUIWidget = dock; 498 | } 499 | 500 | void mlMainWindow::closeEvent(QCloseEvent* Event) 501 | { 502 | QSettings Settings; 503 | Settings.beginGroup("MainWindow"); 504 | Settings.setValue("Geometry", saveGeometry()); 505 | Settings.setValue("State", saveState()); 506 | Settings.endGroup(); 507 | 508 | Event->accept(); 509 | } 510 | 511 | void mlMainWindow::SteamUpdate() 512 | { 513 | SteamAPI_RunCallbacks(); 514 | } 515 | 516 | void mlMainWindow::UpdateDB() 517 | { 518 | if (mBuildThread) 519 | return; 520 | 521 | QList> Commands; 522 | Commands.append(QPair(QString("%1/gdtdb/gdtdb.exe").arg(mToolsPath), QStringList() << "/update")); 523 | 524 | StartBuildThread(Commands); 525 | } 526 | 527 | void mlMainWindow::StartBuildThread(const QList>& Commands) 528 | { 529 | mBuildButton->setText("Cancel"); 530 | mOutputWidget->clear(); 531 | 532 | mBuildThread = new mlBuildThread(Commands, mIgnoreErrorsWidget->isChecked()); 533 | connect(mBuildThread, SIGNAL(OutputReady(QString)), this, SLOT(BuildOutputReady(QString))); 534 | connect(mBuildThread, SIGNAL(finished()), this, SLOT(BuildFinished())); 535 | mBuildThread->start(); 536 | } 537 | 538 | void mlMainWindow::StartConvertThread(QStringList& pathList, QString& outputDir, bool allowOverwrite) 539 | { 540 | mConvertThread = new mlConvertThread(pathList, outputDir, true, allowOverwrite); 541 | connect(mConvertThread, SIGNAL(OutputReady(QString)), this, SLOT(BuildOutputReady(QString))); 542 | connect(mConvertThread, SIGNAL(finished()), this, SLOT(BuildFinished())); 543 | mConvertThread->start(); 544 | } 545 | 546 | void mlMainWindow::PopulateFileList() 547 | { 548 | mFileListWidget->clear(); 549 | 550 | QString UserMapsFolder = QDir::cleanPath(QString("%1/usermaps/").arg(mGamePath)); 551 | QStringList UserMaps = QDir(UserMapsFolder).entryList(QDir::AllDirs | QDir::NoDotAndDotDot); 552 | QTreeWidgetItem* MapsRootItem = new QTreeWidgetItem(mFileListWidget, QStringList() << "Maps"); 553 | 554 | QFont Font = MapsRootItem->font(0); 555 | Font.setBold(true); 556 | MapsRootItem->setFont(0, Font); 557 | 558 | for (QString MapName : UserMaps) 559 | { 560 | QString ZoneFileName = QString("%1/%2/zone_source/%3.zone").arg(UserMapsFolder, MapName, MapName); 561 | 562 | if (QFileInfo(ZoneFileName).isFile()) 563 | { 564 | QTreeWidgetItem* MapItem = new QTreeWidgetItem(MapsRootItem, QStringList() << MapName); 565 | MapItem->setCheckState(0, Qt::Unchecked); 566 | MapItem->setData(0, Qt::UserRole, ML_ITEM_MAP); 567 | } 568 | } 569 | 570 | QString ModsFolder = QDir::cleanPath(QString("%1/mods/").arg(mGamePath)); 571 | QStringList Mods = QDir(ModsFolder).entryList(QDir::AllDirs | QDir::NoDotAndDotDot); 572 | QTreeWidgetItem* ModsRootItem = new QTreeWidgetItem(mFileListWidget, QStringList() << "Mods"); 573 | ModsRootItem->setFont(0, Font); 574 | const char* Files[4] = { "core_mod", "mp_mod", "cp_mod", "zm_mod" }; 575 | 576 | for (QString ModName : Mods) 577 | { 578 | QTreeWidgetItem* ParentItem = NULL; 579 | 580 | for (int FileIdx = 0; FileIdx < 4; FileIdx++) 581 | { 582 | QString ZoneFileName = QString("%1/%2/zone_source/%3.zone").arg(ModsFolder, ModName, Files[FileIdx]); 583 | 584 | if (QFileInfo(ZoneFileName).isFile()) 585 | { 586 | if (!ParentItem) 587 | ParentItem = new QTreeWidgetItem(ModsRootItem, QStringList() << ModName); 588 | 589 | QTreeWidgetItem* ModItem = new QTreeWidgetItem(ParentItem, QStringList() << Files[FileIdx]); 590 | ModItem->setCheckState(0, Qt::Unchecked); 591 | ModItem->setData(0, Qt::UserRole, ML_ITEM_MOD); 592 | } 593 | } 594 | } 595 | 596 | mFileListWidget->expandAll(); 597 | } 598 | 599 | void mlMainWindow::ContextMenuRequested() 600 | { 601 | QList ItemList = mFileListWidget->selectedItems(); 602 | if (ItemList.isEmpty()) 603 | return; 604 | 605 | QTreeWidgetItem* Item = ItemList[0]; 606 | QString ItemType = (Item->data(0, Qt::UserRole).toInt() == ML_ITEM_MAP) ? "Map" : "Mod"; 607 | 608 | if (Item->data(0, Qt::UserRole).toInt() == ML_ITEM_UNKNOWN) 609 | return; 610 | 611 | QIcon GameIcon(":/resources/BlackOps3.png"); 612 | 613 | QMenu* Menu = new QMenu; 614 | Menu->addAction(GameIcon, QString("Run %1").arg(ItemType), this, SLOT(OnRunMapOrMod())); 615 | 616 | if (Item->data(0, Qt::UserRole).toInt() == ML_ITEM_MAP) 617 | Menu->addAction(mActionFileLevelEditor); 618 | 619 | Menu->addAction("Edit Zone File", this, SLOT(OnOpenZoneFile())); 620 | Menu->addAction(QString("Open %1 Folder").arg(ItemType), this, SLOT(OnOpenModRootFolder())); 621 | 622 | Menu->addSeparator(); 623 | Menu->addAction("Delete", this, SLOT(OnDelete())); 624 | Menu->addAction("Clean XPaks", this, SLOT(OnCleanXPaks())); 625 | 626 | Menu->exec(QCursor::pos()); 627 | } 628 | 629 | void mlMainWindow::OnFileAssetEditor() 630 | { 631 | QProcess* Process = new QProcess(); 632 | connect(Process, SIGNAL(finished(int)), Process, SLOT(deleteLater())); 633 | Process->start(QString("%1/bin/AssetEditor_modtools.exe").arg(mToolsPath), QStringList()); 634 | } 635 | 636 | void mlMainWindow::OnFileLevelEditor() 637 | { 638 | QProcess* Process = new QProcess(); 639 | connect(Process, SIGNAL(finished(int)), Process, SLOT(deleteLater())); 640 | 641 | QList ItemList = mFileListWidget->selectedItems(); 642 | if (ItemList.count() && ItemList[0]->data(0, Qt::UserRole).toInt() == ML_ITEM_MAP) 643 | { 644 | QString MapName = ItemList[0]->text(0); 645 | Process->start(QString("%1/bin/radiant_modtools.exe").arg(mToolsPath), QStringList() << QString("%1/map_source/%2/%3.map").arg(mGamePath, MapName.left(2), MapName)); 646 | } 647 | else 648 | { 649 | Process->start(QString("%1/bin/radiant_modtools.exe").arg(mToolsPath), QStringList()); 650 | } 651 | } 652 | 653 | void mlMainWindow::OnFileExport2Bin() 654 | { 655 | if (mExport2BinGUIWidget == NULL) 656 | { 657 | InitExport2BinGUI(); 658 | mExport2BinGUIWidget->hide(); // Ensure the window is hidden (just in case) 659 | } 660 | 661 | mExport2BinGUIWidget->isVisible() ? mExport2BinGUIWidget->hide() : mExport2BinGUIWidget->show(); 662 | } 663 | 664 | void mlMainWindow::OnFileNew() 665 | { 666 | QDir TemplatesFolder(QString("%1/rex/templates").arg(mToolsPath)); 667 | QStringList Templates = TemplatesFolder.entryList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name); 668 | 669 | if (Templates.isEmpty()) 670 | { 671 | QMessageBox::information(this, "Error", "Could not find any map templates."); 672 | return; 673 | } 674 | 675 | QDialog Dialog(this, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); 676 | Dialog.setWindowTitle("New Map or Mod"); 677 | 678 | QVBoxLayout* Layout = new QVBoxLayout(&Dialog); 679 | 680 | QFormLayout* FormLayout = new QFormLayout(); 681 | Layout->addLayout(FormLayout); 682 | 683 | QLineEdit* NameWidget = new QLineEdit(); 684 | NameWidget->setValidator(new QRegularExpressionValidator(QRegularExpression("[a-zA-Z0-9_]*"), this)); 685 | FormLayout->addRow("Name:", NameWidget); 686 | 687 | QComboBox* TemplateWidget = new QComboBox(); 688 | TemplateWidget->addItems(Templates); 689 | FormLayout->addRow("Template:", TemplateWidget); 690 | 691 | QFrame* Frame = new QFrame(); 692 | Frame->setFrameShape(QFrame::HLine); 693 | Frame->setFrameShadow(QFrame::Raised); 694 | Layout->addWidget(Frame); 695 | 696 | QDialogButtonBox* ButtonBox = new QDialogButtonBox(&Dialog); 697 | ButtonBox->setOrientation(Qt::Horizontal); 698 | ButtonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); 699 | ButtonBox->setCenterButtons(true); 700 | 701 | Layout->addWidget(ButtonBox); 702 | 703 | connect(ButtonBox, SIGNAL(accepted()), &Dialog, SLOT(accept())); 704 | connect(ButtonBox, SIGNAL(rejected()), &Dialog, SLOT(reject())); 705 | 706 | if (Dialog.exec() != QDialog::Accepted) 707 | return; 708 | 709 | QString Name = NameWidget->text(); 710 | 711 | if (Name.isEmpty()) 712 | { 713 | QMessageBox::information(this, "Error", "Map name cannot be empty."); 714 | return; 715 | } 716 | 717 | if (mShippedMapList.contains(Name, Qt::CaseInsensitive)) 718 | { 719 | QMessageBox::information(this, "Error", "Map name cannot be the same as a built-in map."); 720 | return; 721 | } 722 | 723 | QByteArray MapName = NameWidget->text().toLatin1().toLower(); 724 | QString Output; 725 | 726 | QString Template = Templates[TemplateWidget->currentIndex()]; 727 | 728 | if ((Template == "MP Mod Level" && !MapName.startsWith("mp_")) || (Template == "ZM Mod Level" && !MapName.startsWith("zm_"))) 729 | { 730 | QMessageBox::information(this, "Error", "Map name must start with 'mp_' or 'zm_'."); 731 | return; 732 | } 733 | 734 | std::function RecursiveCopy=[&](const QString& SourcePath, const QString& DestPath) -> bool 735 | { 736 | QDir Dir(SourcePath); 737 | if (!Dir.exists()) 738 | return false; 739 | 740 | foreach (QString DirEntry, Dir.entryList(QDir::Dirs | QDir::NoDotAndDotDot)) 741 | { 742 | QString NewPath = QString(DestPath + QDir::separator() + DirEntry).replace(QString("template"), MapName); 743 | Dir.mkpath(NewPath); 744 | if (!RecursiveCopy(SourcePath + QDir::separator() + DirEntry, NewPath)) 745 | return false; 746 | } 747 | 748 | foreach (QString DirEntry, Dir.entryList(QDir::Files)) 749 | { 750 | QFile SourceFile(SourcePath + QDir::separator() + DirEntry); 751 | QString DestFileName = QString(DestPath + QDir::separator() + DirEntry).replace(QString("template"), MapName); 752 | QFile DestFile(DestFileName); 753 | 754 | if (!SourceFile.open(QFile::ReadOnly) || !DestFile.open(QFile::WriteOnly)) 755 | return false; 756 | 757 | while (!SourceFile.atEnd()) 758 | { 759 | QByteArray Line = SourceFile.readLine(); 760 | 761 | if (Line.contains("guid")) 762 | { 763 | QString LineString(Line); 764 | LineString.replace(QRegExp("guid \"\\{(.*)\\}\""), QString("guid \"%1\"").arg(QUuid::createUuid().toString())); 765 | Line = LineString.toLatin1(); 766 | } 767 | else 768 | Line.replace("template", MapName); 769 | 770 | DestFile.write(Line); 771 | } 772 | 773 | Output += DestFileName + "\n"; 774 | } 775 | 776 | return true; 777 | }; 778 | 779 | if (RecursiveCopy(TemplatesFolder.absolutePath() + QDir::separator() + Templates[TemplateWidget->currentIndex()], QDir::cleanPath(mGamePath))) 780 | { 781 | PopulateFileList(); 782 | 783 | QMessageBox::information(this, "New Map Created", QString("Files created:\n") + Output); 784 | } 785 | else 786 | QMessageBox::information(this, "Error", "Error creating map files."); 787 | } 788 | 789 | void mlMainWindow::OnEditBuild() 790 | { 791 | if (mBuildThread) 792 | { 793 | mBuildThread->Cancel(); 794 | return; 795 | } 796 | 797 | QList> Commands; 798 | bool UpdateAdded = false; 799 | 800 | auto AddUpdateDBCommand = [&]() 801 | { 802 | if (!UpdateAdded) 803 | { 804 | Commands.append(QPair(QString("%1/gdtdb/gdtdb.exe").arg(mToolsPath), QStringList() << "/update")); 805 | UpdateAdded = true; 806 | } 807 | }; 808 | 809 | QList CheckedItems; 810 | 811 | std::function SearchCheckedItems=[&](QTreeWidgetItem* ParentItem) -> void 812 | { 813 | for (int ChildIdx = 0; ChildIdx < ParentItem->childCount(); ChildIdx++) 814 | { 815 | QTreeWidgetItem* Child = ParentItem->child(ChildIdx); 816 | if (Child->checkState(0) == Qt::Checked) 817 | CheckedItems.append(Child); 818 | else 819 | SearchCheckedItems(Child); 820 | } 821 | }; 822 | 823 | SearchCheckedItems(mFileListWidget->invisibleRootItem()); 824 | QString LastMap, LastMod; 825 | 826 | QStringList LanguageArgs; 827 | LanguageArgs; 828 | 829 | if (mBuildLanguage != "All") 830 | LanguageArgs << "-language" << mBuildLanguage; 831 | else for (const QString& Language : gLanguages) 832 | LanguageArgs << "-language" << Language; 833 | 834 | for (QTreeWidgetItem* Item : CheckedItems) 835 | { 836 | if (Item->data(0, Qt::UserRole).toInt() == ML_ITEM_MAP) 837 | { 838 | QString MapName = Item->text(0); 839 | 840 | if (mCompileEnabledWidget->isChecked()) 841 | { 842 | AddUpdateDBCommand(); 843 | 844 | QStringList Args; 845 | Args << "-platform" << "pc"; 846 | 847 | if (mCompileModeWidget->currentIndex() == 0) 848 | Args << "-onlyents"; 849 | else 850 | Args << "-navmesh" << "-navvolume"; 851 | 852 | Args << "-loadFrom" << QString("%1\\map_source\\%2\\%3.map").arg(mGamePath, MapName.left(2), MapName); 853 | Args << QString("%1\\share\\raw\\maps\\%2\\%3.d3dbsp").arg(mGamePath, MapName.left(2), MapName); 854 | 855 | Commands.append(QPair(QString("%1\\bin\\cod2map64.exe").arg(mToolsPath), Args)); 856 | } 857 | 858 | if (mLightEnabledWidget->isChecked()) 859 | { 860 | AddUpdateDBCommand(); 861 | 862 | QStringList Args; 863 | Args << "-ledSilent"; 864 | 865 | switch (mLightQualityWidget->currentIndex()) 866 | { 867 | case 0: 868 | Args << "+low"; 869 | break; 870 | 871 | default: 872 | case 1: 873 | Args << "+medium"; 874 | break; 875 | 876 | case 2: 877 | Args << "+high"; 878 | break; 879 | } 880 | 881 | Args << "+localprobes" << "+forceclean" << "+recompute" << QString("%1/map_source/%2/%3.map").arg(mGamePath, MapName.left(2), MapName); 882 | Commands.append(QPair(QString("%1/bin/radiant_modtools.exe").arg(mToolsPath), Args)); 883 | } 884 | 885 | if (mLinkEnabledWidget->isChecked()) 886 | { 887 | AddUpdateDBCommand(); 888 | 889 | Commands.append(QPair(QString("%1/bin/linker_modtools.exe").arg(mToolsPath), QStringList() << LanguageArgs << "-modsource" << MapName)); 890 | } 891 | 892 | LastMap = MapName; 893 | } 894 | else 895 | { 896 | QString ModName = Item->parent()->text(0); 897 | 898 | if (mLinkEnabledWidget->isChecked()) 899 | { 900 | AddUpdateDBCommand(); 901 | 902 | QString ZoneName = Item->text(0); 903 | Commands.append(QPair(QString("%1/bin/linker_modtools.exe").arg(mToolsPath), QStringList() << LanguageArgs << "-fs_game" << ModName << "-modsource" << ZoneName)); 904 | } 905 | 906 | LastMod = ModName; 907 | } 908 | } 909 | 910 | if (mRunEnabledWidget->isChecked() && (!LastMod.isEmpty() || !LastMap.isEmpty())) 911 | { 912 | QStringList Args; 913 | 914 | if(!mRunDvars.isEmpty()) 915 | Args << mRunDvars; 916 | 917 | Args << "+set" << "fs_game" << (LastMod.isEmpty() ? LastMap : LastMod); 918 | 919 | if (!LastMap.isEmpty()) 920 | Args << "+devmap" << LastMap; 921 | 922 | QString ExtraOptions = mRunOptionsWidget->text(); 923 | if (!ExtraOptions.isEmpty()) 924 | Args << ExtraOptions.split(' '); 925 | 926 | Commands.append(QPair(QString("%1/BlackOps3.exe").arg(mGamePath), Args)); 927 | } 928 | 929 | if (Commands.size() == 0 && !UpdateAdded) 930 | { 931 | QMessageBox::information(this, "No Tasks", "Please selected at least one file from the list and one action to be performed."); 932 | return; 933 | } 934 | 935 | StartBuildThread(Commands); 936 | } 937 | 938 | void mlMainWindow::OnEditPublish() 939 | { 940 | std::function SearchCheckedItem=[&](QTreeWidgetItem* ParentItem) -> QTreeWidgetItem* 941 | { 942 | for (int ChildIdx = 0; ChildIdx < ParentItem->childCount(); ChildIdx++) 943 | { 944 | QTreeWidgetItem* Child = ParentItem->child(ChildIdx); 945 | if (Child->checkState(0) == Qt::Checked) 946 | return Child; 947 | 948 | QTreeWidgetItem* Checked = SearchCheckedItem(Child); 949 | if (Checked) 950 | return Checked; 951 | } 952 | 953 | return nullptr; 954 | }; 955 | 956 | QTreeWidgetItem* Item = SearchCheckedItem(mFileListWidget->invisibleRootItem()); 957 | if (!Item) 958 | { 959 | QMessageBox::warning(this, "Error", "No maps or mods checked."); 960 | return; 961 | } 962 | 963 | QString Folder; 964 | if (Item->data(0, Qt::UserRole).toInt() == ML_ITEM_MAP) 965 | { 966 | Folder = "usermaps/" + Item->text(0); 967 | mType = "map"; 968 | mFolderName = Item->text(0); 969 | } 970 | else 971 | { 972 | Folder = "mods/" + Item->parent()->text(0); 973 | mType = "mod"; 974 | mFolderName = Item->parent()->text(0); 975 | } 976 | 977 | mWorkshopFolder = QString("%1/%2/zone").arg(mGamePath, Folder); 978 | QFile File(mWorkshopFolder + "/workshop.json"); 979 | 980 | if (!QFileInfo(mWorkshopFolder).isDir()) 981 | { 982 | QMessageBox::information(this, "Error", QString("The folder '%1' does not exist.").arg(mWorkshopFolder)); 983 | return; 984 | } 985 | 986 | mFileId = 0; 987 | mTitle.clear(); 988 | mDescription.clear(); 989 | mThumbnail.clear(); 990 | mTags.clear(); 991 | 992 | if (File.open(QIODevice::ReadOnly)) 993 | { 994 | QJsonDocument Document = QJsonDocument::fromJson(File.readAll()); 995 | QJsonObject Root = Document.object(); 996 | 997 | mFileId = Root["PublisherID"].toString().toULongLong(); 998 | mTitle = Root["Title"].toString(); 999 | mDescription = Root["Description"].toString(); 1000 | mThumbnail = Root["Thumbnail"].toString(); 1001 | mTags = Root["Tags"].toString().split(','); 1002 | } 1003 | 1004 | if (mFileId) 1005 | { 1006 | SteamAPICall_t SteamAPICall = SteamUGC()->RequestUGCDetails(mFileId, 10); 1007 | mSteamCallResultRequestDetails.Set(SteamAPICall, this, &mlMainWindow::OnUGCRequestUGCDetails); 1008 | } 1009 | else 1010 | ShowPublishDialog(); 1011 | } 1012 | 1013 | void mlMainWindow::OnUGCRequestUGCDetails(SteamUGCRequestUGCDetailsResult_t* RequestDetailsResult, bool IOFailure) 1014 | { 1015 | if (IOFailure || RequestDetailsResult->m_details.m_eResult != k_EResultOK) 1016 | { 1017 | QMessageBox::warning(this, "Error", "Error retrieving item data from the Steam Workshop."); 1018 | return; 1019 | } 1020 | 1021 | SteamUGCDetails_t* Details = &RequestDetailsResult->m_details; 1022 | 1023 | mTitle = Details->m_rgchTitle; 1024 | mDescription = Details->m_rgchDescription; 1025 | mTags = QString(Details->m_rgchTags).split(','); 1026 | 1027 | ShowPublishDialog(); 1028 | } 1029 | 1030 | void mlMainWindow::ShowPublishDialog() 1031 | { 1032 | QDialog Dialog(this, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); 1033 | Dialog.setWindowTitle("Publish Mod"); 1034 | 1035 | QVBoxLayout* Layout = new QVBoxLayout(&Dialog); 1036 | 1037 | QFormLayout* FormLayout = new QFormLayout(); 1038 | Layout->addLayout(FormLayout); 1039 | 1040 | QLineEdit* TitleWidget = new QLineEdit(); 1041 | TitleWidget->setText(mTitle); 1042 | FormLayout->addRow("Title:", TitleWidget); 1043 | 1044 | QLineEdit* DescriptionWidget = new QLineEdit(); 1045 | DescriptionWidget->setText(mDescription); 1046 | FormLayout->addRow("Description:", DescriptionWidget); 1047 | 1048 | QLineEdit* ThumbnailEdit = new QLineEdit(); 1049 | ThumbnailEdit->setText(mThumbnail); 1050 | 1051 | QToolButton* ThumbnailButton = new QToolButton(); 1052 | ThumbnailButton->setText("..."); 1053 | 1054 | QHBoxLayout* ThumbnailLayout = new QHBoxLayout(); 1055 | ThumbnailLayout->setContentsMargins(0, 0, 0, 0); 1056 | ThumbnailLayout->addWidget(ThumbnailEdit); 1057 | ThumbnailLayout->addWidget(ThumbnailButton); 1058 | 1059 | QWidget* ThumbnailWidget = new QWidget(); 1060 | ThumbnailWidget->setLayout(ThumbnailLayout); 1061 | 1062 | FormLayout->addRow("Thumbnail:", ThumbnailWidget); 1063 | 1064 | QTreeWidget* TagsTree = new QTreeWidget(&Dialog); 1065 | TagsTree->setHeaderHidden(true); 1066 | TagsTree->setUniformRowHeights(true); 1067 | TagsTree->setRootIsDecorated(false); 1068 | FormLayout->addRow("Tags:", TagsTree); 1069 | 1070 | for (int TagIdx = 0; TagIdx < ARRAYSIZE(gTags); TagIdx++) 1071 | { 1072 | const char* Tag = gTags[TagIdx]; 1073 | QTreeWidgetItem* Item = new QTreeWidgetItem(TagsTree, QStringList() << Tag); 1074 | Item->setCheckState(0, mTags.contains(Tag) ? Qt::Checked : Qt::Unchecked); 1075 | } 1076 | 1077 | QFrame* Frame = new QFrame(); 1078 | Frame->setFrameShape(QFrame::HLine); 1079 | Frame->setFrameShadow(QFrame::Raised); 1080 | Layout->addWidget(Frame); 1081 | 1082 | QDialogButtonBox* ButtonBox = new QDialogButtonBox(&Dialog); 1083 | ButtonBox->setOrientation(Qt::Horizontal); 1084 | ButtonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); 1085 | ButtonBox->setCenterButtons(true); 1086 | 1087 | Layout->addWidget(ButtonBox); 1088 | 1089 | auto ThumbnailBrowse = [=]() 1090 | { 1091 | QString FileName = QFileDialog::getOpenFileName(this, "Open Thumbnail", QString(), "All Files (*.*)"); 1092 | if (!FileName.isEmpty()) 1093 | ThumbnailEdit->setText(FileName); 1094 | }; 1095 | 1096 | connect(ThumbnailButton, &QToolButton::clicked, ThumbnailBrowse); 1097 | connect(ButtonBox, SIGNAL(accepted()), &Dialog, SLOT(accept())); 1098 | connect(ButtonBox, SIGNAL(rejected()), &Dialog, SLOT(reject())); 1099 | 1100 | if (Dialog.exec() != QDialog::Accepted) 1101 | return; 1102 | 1103 | mTitle = TitleWidget->text(); 1104 | mDescription = DescriptionWidget->text(); 1105 | mThumbnail = ThumbnailEdit->text(); 1106 | mTags.clear(); 1107 | 1108 | for (int ChildIdx = 0; ChildIdx < TagsTree->topLevelItemCount(); ChildIdx++) 1109 | { 1110 | QTreeWidgetItem* Child = TagsTree->topLevelItem(ChildIdx); 1111 | if (Child->checkState(0) == Qt::Checked) 1112 | mTags.append(Child->text(0)); 1113 | } 1114 | 1115 | if (!SteamUGC()) 1116 | { 1117 | QMessageBox::information(this, "Error", "Could not initialize Steam, make sure you're running the launcher from the Steam client."); 1118 | return; 1119 | } 1120 | 1121 | if (!mFileId) 1122 | { 1123 | SteamAPICall_t SteamAPICall = SteamUGC()->CreateItem(AppId, k_EWorkshopFileTypeCommunity); 1124 | mSteamCallResultCreateItem.Set(SteamAPICall, this, &mlMainWindow::OnCreateItemResult); 1125 | } 1126 | else 1127 | UpdateWorkshopItem(); 1128 | } 1129 | 1130 | void mlMainWindow::OnEditOptions() 1131 | { 1132 | QDialog Dialog(this, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); 1133 | Dialog.setWindowTitle("Options"); 1134 | 1135 | QVBoxLayout* Layout = new QVBoxLayout(&Dialog); 1136 | 1137 | QSettings Settings; 1138 | QCheckBox* Checkbox = new QCheckBox("Use Treyarch Theme"); 1139 | Checkbox->setToolTip("Toggle between the dark grey Treyarch colors and the default Windows colors"); 1140 | Checkbox->setChecked(Settings.value("UseDarkTheme", false).toBool()); 1141 | Layout->addWidget(Checkbox); 1142 | 1143 | QHBoxLayout* LanguageLayout = new QHBoxLayout(); 1144 | LanguageLayout->addWidget(new QLabel("Build Language:")); 1145 | 1146 | QStringList Languages; 1147 | Languages << "All"; 1148 | for (int LanguageIdx = 0; LanguageIdx < ARRAYSIZE(gLanguages); LanguageIdx++) 1149 | Languages << gLanguages[LanguageIdx]; 1150 | 1151 | QComboBox* LanguageCombo = new QComboBox(); 1152 | LanguageCombo->addItems(Languages); 1153 | LanguageCombo->setCurrentText(mBuildLanguage); 1154 | LanguageLayout->addWidget(LanguageCombo); 1155 | 1156 | Layout->addLayout(LanguageLayout); 1157 | 1158 | QDialogButtonBox* ButtonBox = new QDialogButtonBox(&Dialog); 1159 | ButtonBox->setOrientation(Qt::Horizontal); 1160 | ButtonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); 1161 | ButtonBox->setCenterButtons(true); 1162 | 1163 | Layout->addWidget(ButtonBox); 1164 | 1165 | connect(ButtonBox, SIGNAL(accepted()), &Dialog, SLOT(accept())); 1166 | connect(ButtonBox, SIGNAL(rejected()), &Dialog, SLOT(reject())); 1167 | 1168 | if (Dialog.exec() != QDialog::Accepted) 1169 | return; 1170 | 1171 | mBuildLanguage = LanguageCombo->currentText(); 1172 | mTreyarchTheme = Checkbox->isChecked(); 1173 | 1174 | Settings.setValue("BuildLanguage", mBuildLanguage); 1175 | Settings.setValue("UseDarkTheme", mTreyarchTheme); 1176 | 1177 | UpdateTheme(); 1178 | } 1179 | 1180 | void mlMainWindow::UpdateTheme() 1181 | { 1182 | if (mTreyarchTheme) 1183 | { 1184 | qApp->setStyle("plastique"); 1185 | QFile file(QString("%1/radiant/stylesheet.qss").arg(mToolsPath)); 1186 | file.open(QFile::ReadOnly); 1187 | QString styleSheet = QLatin1String(file.readAll()); 1188 | file.close(); 1189 | qApp->setStyleSheet(styleSheet); 1190 | } 1191 | else 1192 | { 1193 | qApp->setStyle("WindowsVista"); 1194 | qApp->setStyleSheet(""); 1195 | } 1196 | } 1197 | 1198 | void mlMainWindow::OnEditDvars() 1199 | { 1200 | QDialog Dialog(this, Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint); 1201 | Dialog.setWindowTitle("Dvar Options"); 1202 | 1203 | QVBoxLayout* Layout = new QVBoxLayout(&Dialog); 1204 | 1205 | QLabel* Label = new QLabel(&Dialog); 1206 | Label->setText("Dvars that are to be used when you run the game.\nMust press \"OK\" in order to save the values!"); 1207 | Layout->addWidget(Label); 1208 | 1209 | QTreeWidget* DvarTree = new QTreeWidget(&Dialog); 1210 | DvarTree->setColumnCount(2); 1211 | DvarTree->header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); 1212 | DvarTree->setHeaderLabels(QStringList() << "Dvar" << "Value"); 1213 | DvarTree->setUniformRowHeights(true); 1214 | DvarTree->setRootIsDecorated(false); 1215 | Layout->addWidget(DvarTree); 1216 | 1217 | QDialogButtonBox* ButtonBox = new QDialogButtonBox(&Dialog); 1218 | ButtonBox->setOrientation(Qt::Horizontal); 1219 | ButtonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); 1220 | ButtonBox->setCenterButtons(true); 1221 | 1222 | Layout->addWidget(ButtonBox); 1223 | 1224 | for(int DvarIdx = 0; DvarIdx < ARRAYSIZE(gDvars); DvarIdx++) 1225 | Dvar(gDvars[DvarIdx], DvarTree); 1226 | 1227 | connect(ButtonBox, SIGNAL(accepted()), &Dialog, SLOT(accept())); 1228 | connect(ButtonBox, SIGNAL(rejected()), &Dialog, SLOT(reject())); 1229 | 1230 | if (Dialog.exec() != QDialog::Accepted) 1231 | return; 1232 | 1233 | int size = 0; 1234 | QSettings settings; 1235 | QString dvarName, dvarValue; 1236 | QTreeWidgetItemIterator it(DvarTree); 1237 | 1238 | mRunDvars.clear(); 1239 | while (*it && size < ARRAYSIZE(gDvars)) 1240 | { 1241 | QWidget* widget = DvarTree->itemWidget(*it, 1); 1242 | dvarName = (*it)->data(0, 0).toString(); 1243 | dvar_s dvar = Dvar::findDvar(dvarName, DvarTree, gDvars, ARRAYSIZE(gDvars)); 1244 | switch(dvar.type) 1245 | { 1246 | case DVAR_VALUE_BOOL: 1247 | dvarValue = Dvar::setDvarSetting(dvar, (QCheckBox*)widget); 1248 | break; 1249 | case DVAR_VALUE_INT: 1250 | dvarValue = Dvar::setDvarSetting(dvar, (QSpinBox*)widget); 1251 | break; 1252 | case DVAR_VALUE_STRING: 1253 | dvarValue = Dvar::setDvarSetting(dvar, (QLineEdit*)widget); 1254 | break; 1255 | } 1256 | 1257 | if(!dvarValue.toLatin1().isEmpty()) 1258 | { 1259 | if(!dvar.isCmd) 1260 | mRunDvars << "+set" << dvarName; 1261 | else // hack for cmds 1262 | mRunDvars << QString("+%1").arg(dvarName); 1263 | mRunDvars << dvarValue; 1264 | } 1265 | size++; 1266 | ++it; 1267 | } 1268 | } 1269 | 1270 | void mlMainWindow::UpdateWorkshopItem() 1271 | { 1272 | QJsonObject Root; 1273 | 1274 | Root["PublisherID"] = QString::number(mFileId); 1275 | Root["Title"] = mTitle; 1276 | Root["Description"] = mDescription; 1277 | Root["Thumbnail"] = mThumbnail; 1278 | Root["Type"] = mType; 1279 | Root["FolderName"] = mFolderName; 1280 | Root["Tags"] = mTags.join(','); 1281 | 1282 | QString WorkshopFile(mWorkshopFolder + "/workshop.json"); 1283 | QFile File(WorkshopFile); 1284 | 1285 | if (!File.open(QIODevice::WriteOnly)) 1286 | { 1287 | QMessageBox::warning(this, "Error", QString("Error writing to file '%1'.").arg(WorkshopFile)); 1288 | return; 1289 | } 1290 | 1291 | File.write(QJsonDocument(Root).toJson()); 1292 | File.close(); 1293 | 1294 | UGCUpdateHandle_t UpdateHandle = SteamUGC()->StartItemUpdate(AppId, mFileId); 1295 | SteamUGC()->SetItemTitle(UpdateHandle, mTitle.toLatin1().constData()); 1296 | SteamUGC()->SetItemDescription(UpdateHandle, mDescription.toLatin1().constData()); 1297 | SteamUGC()->SetItemPreview(UpdateHandle, mThumbnail.toLatin1().constData()); 1298 | SteamUGC()->SetItemContent(UpdateHandle, mWorkshopFolder.toLatin1().constData()); 1299 | 1300 | const char* TagList[ARRAYSIZE(gTags)]; 1301 | SteamParamStringArray_t Tags; 1302 | Tags.m_ppStrings = TagList; 1303 | Tags.m_nNumStrings = 0; 1304 | 1305 | for (const QString& Tag : mTags) 1306 | { 1307 | QByteArray TagStr = Tag.toLatin1(); 1308 | 1309 | for (int TagIdx = 0; TagIdx < ARRAYSIZE(gTags); TagIdx++) 1310 | { 1311 | if (TagStr == gTags[TagIdx]) 1312 | { 1313 | TagList[Tags.m_nNumStrings++] = gTags[TagIdx]; 1314 | if (Tags.m_nNumStrings == ARRAYSIZE(TagList)) 1315 | break; 1316 | } 1317 | } 1318 | } 1319 | 1320 | SteamUGC()->SetItemTags(UpdateHandle, &Tags); 1321 | 1322 | SteamAPICall_t SteamAPICall = SteamUGC()->SubmitItemUpdate(UpdateHandle, ""); 1323 | mSteamCallResultUpdateItem.Set(SteamAPICall, this, &mlMainWindow::OnUpdateItemResult); 1324 | 1325 | QProgressDialog Dialog(this); 1326 | Dialog.setLabelText(QString("Uploading workshop item '%1'...").arg(QString::number(mFileId))); 1327 | Dialog.setCancelButton(NULL); 1328 | Dialog.setWindowModality(Qt::WindowModal); 1329 | Dialog.show(); 1330 | 1331 | for (;;) 1332 | { 1333 | uint64 Processed, Total; 1334 | 1335 | const auto Status = SteamUGC()->GetItemUpdateProgress(SteamAPICall, &Processed, &Total); 1336 | // if we get an invalid status exit out, it could mean we're finished or there's an actual problem 1337 | if (Status == k_EItemUpdateStatusInvalid) 1338 | { 1339 | break; 1340 | } 1341 | 1342 | switch (Status) 1343 | { 1344 | case EItemUpdateStatus::k_EItemUpdateStatusInvalid: 1345 | Dialog.setLabelText( 1346 | QString("Uploading workshop item '%1': %2").arg(QString::number(mFileId), QString("Invalid" ))); 1347 | break; 1348 | case EItemUpdateStatus::k_EItemUpdateStatusPreparingConfig: 1349 | Dialog.setLabelText( 1350 | QString("Uploading workshop item '%1': %2").arg(QString::number(mFileId), QString("Preparing Config"))); 1351 | break; 1352 | case EItemUpdateStatus::k_EItemUpdateStatusPreparingContent: 1353 | Dialog.setLabelText( 1354 | QString("Uploading workshop item '%1': %2").arg(QString::number(mFileId), QString("Preparing Content"))); 1355 | break; 1356 | case EItemUpdateStatus::k_EItemUpdateStatusUploadingContent: 1357 | Dialog.setLabelText( 1358 | QString("Uploading workshop item '%1': %2").arg(QString::number(mFileId), QString("Uploading Content"))); 1359 | break; 1360 | case EItemUpdateStatus::k_EItemUpdateStatusUploadingPreviewFile: 1361 | Dialog.setLabelText( 1362 | QString("Uploading workshop item '%1': %2").arg(QString::number(mFileId), QString("Uploading Preview file"))); 1363 | break; 1364 | case EItemUpdateStatus::k_EItemUpdateStatusCommittingChanges: 1365 | Dialog.setLabelText( 1366 | QString("Uploading workshop item '%1': %2").arg(QString::number(mFileId), QString("Committing Changes"))); 1367 | break; 1368 | } 1369 | 1370 | Dialog.setMaximum(Total); 1371 | Dialog.setValue(Processed); 1372 | QApplication::processEvents(QEventLoop::ExcludeUserInputEvents); 1373 | Sleep(100); 1374 | } 1375 | } 1376 | 1377 | void mlMainWindow::OnCreateItemResult(CreateItemResult_t* CreateItemResult, bool IOFailure) 1378 | { 1379 | if (IOFailure) 1380 | { 1381 | QMessageBox::warning(this, "Error", "Disk Read error."); 1382 | return; 1383 | } 1384 | 1385 | if (CreateItemResult->m_eResult != k_EResultOK) 1386 | { 1387 | QMessageBox::warning(this, "Error", QString("Error creating Steam Workshop item. Error code: %1\nVisit https://steamerrors.com/ for more information.").arg(CreateItemResult->m_eResult)); 1388 | return; 1389 | } 1390 | 1391 | mFileId = CreateItemResult->m_nPublishedFileId; 1392 | 1393 | UpdateWorkshopItem(); 1394 | } 1395 | 1396 | void mlMainWindow::OnUpdateItemResult(SubmitItemUpdateResult_t* UpdateItemResult, bool IOFailure) 1397 | { 1398 | if (IOFailure) 1399 | { 1400 | QMessageBox::warning(this, "Error", "Disk Read error."); 1401 | return; 1402 | } 1403 | 1404 | if (UpdateItemResult->m_eResult != k_EResultOK) 1405 | { 1406 | QMessageBox::warning(this, "Error", QString("Error updating Steam Workshop item. Error code: %1\nVisit https://steamerrors.com/ for more information.").arg(UpdateItemResult->m_eResult)); 1407 | return; 1408 | } 1409 | 1410 | if (QMessageBox::question(this, "Update", "Workshop item successfully updated. Do you want to visit the Workshop page for this item now?", QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) 1411 | ShellExecute(NULL, "open", QString("steam://url/CommunityFilePage/%1").arg(QString::number(mFileId)).toLatin1().constData(), "", NULL, SW_SHOWDEFAULT); 1412 | } 1413 | 1414 | void mlMainWindow::OnHelpAbout() 1415 | { 1416 | QMessageBox::about(this, "About Modtools Launcher", "Treyarch Modtools Launcher\nCopyright 2016 Treyarch"); 1417 | } 1418 | 1419 | void mlMainWindow::OnOpenZoneFile() 1420 | { 1421 | QList ItemList = mFileListWidget->selectedItems(); 1422 | if (ItemList.isEmpty()) 1423 | return; 1424 | 1425 | QTreeWidgetItem* Item = ItemList[0]; 1426 | 1427 | if (Item->data(0, Qt::UserRole).toInt() == ML_ITEM_MAP) 1428 | { 1429 | QString MapName = Item->text(0); 1430 | ShellExecute(NULL, "open", QString("\"%1/usermaps/%2/zone_source/%3.zone\"").arg(mGamePath, MapName, MapName).toLatin1().constData(), "", NULL, SW_SHOWDEFAULT); 1431 | } 1432 | else 1433 | { 1434 | QString ModName = Item->parent()->text(0); 1435 | QString ZoneName = Item->text(0); 1436 | ShellExecute(NULL, "open", (QString("\"%1/mods/%2/zone_source/%3.zone\"").arg(mGamePath, ModName, ZoneName)).toLatin1().constData(), "", NULL, SW_SHOWDEFAULT); 1437 | } 1438 | } 1439 | 1440 | void mlMainWindow::OnOpenModRootFolder() 1441 | { 1442 | QList ItemList = mFileListWidget->selectedItems(); 1443 | if (ItemList.isEmpty()) 1444 | return; 1445 | 1446 | QTreeWidgetItem* Item = ItemList[0]; 1447 | 1448 | if (Item->data(0, Qt::UserRole).toInt() == ML_ITEM_MAP) 1449 | { 1450 | QString MapName = Item->text(0); 1451 | ShellExecute(NULL, "open", (QString("\"%1/usermaps/%2\"").arg(mGamePath, MapName)).toLatin1().constData(), "", NULL, SW_SHOWDEFAULT); 1452 | } 1453 | else 1454 | { 1455 | QString ModName = Item->parent() ? Item->parent()->text(0) : Item->text(0); 1456 | ShellExecute(NULL, "open", (QString("\"%1/mods/%2\"").arg(mGamePath, ModName)).toLatin1().constData(), "", NULL, SW_SHOWDEFAULT); 1457 | } 1458 | } 1459 | 1460 | void mlMainWindow::OnRunMapOrMod() 1461 | { 1462 | QList ItemList = mFileListWidget->selectedItems(); 1463 | if (ItemList.isEmpty()) 1464 | return; 1465 | 1466 | QTreeWidgetItem* Item = ItemList[0]; 1467 | 1468 | QStringList Args; 1469 | 1470 | if(!mRunDvars.isEmpty()) 1471 | Args << mRunDvars; 1472 | 1473 | Args << "+set" << "fs_game"; 1474 | 1475 | if (Item->data(0, Qt::UserRole).toInt() == ML_ITEM_MAP) 1476 | { 1477 | QString MapName = Item->text(0); 1478 | Args << MapName; 1479 | Args << "+devmap" << MapName; 1480 | } 1481 | else 1482 | { 1483 | QString ModName = Item->parent() ? Item->parent()->text(0) : Item->text(0); 1484 | Args << ModName; 1485 | } 1486 | 1487 | QString ExtraOptions = mRunOptionsWidget->text(); 1488 | if (!ExtraOptions.isEmpty()) 1489 | Args << ExtraOptions.split(' '); 1490 | 1491 | QList> Commands; 1492 | Commands.append(QPair(QString("%1/BlackOps3.exe").arg(mGamePath), Args)); 1493 | StartBuildThread(Commands); 1494 | } 1495 | 1496 | void mlMainWindow::OnSaveLog() const 1497 | { 1498 | // want to make a logs directory for easy management of launcher logs (exe_dir/logs) 1499 | const auto dir = QDir{}; 1500 | if (!dir.exists("logs")) 1501 | { 1502 | const auto result = dir.mkdir("logs"); 1503 | if (!result) 1504 | { 1505 | QMessageBox::warning(nullptr, "Error", QString("Could not create the \"logs\" directory")); 1506 | return; 1507 | } 1508 | } 1509 | 1510 | const auto time = std::time(nullptr); 1511 | auto ss = std::stringstream{}; 1512 | const auto timeStr = std::put_time(std::localtime(&time), "%F_%T"); 1513 | 1514 | ss << timeStr; 1515 | 1516 | auto dateStr = ss.str(); 1517 | std::replace(dateStr.begin(), dateStr.end(), ':', '_'); 1518 | 1519 | QFile log(QString{ "logs/modlog_%1.txt" }.arg(dateStr.c_str())); 1520 | 1521 | if (!log.open(QIODevice::WriteOnly)) 1522 | return; 1523 | 1524 | QTextStream stream(&log); 1525 | stream << mOutputWidget->toPlainText(); 1526 | 1527 | QMessageBox::information(nullptr, QString("Save Log"), QString("The console log has been saved to %1").arg(log.fileName())); 1528 | } 1529 | 1530 | void mlMainWindow::OnCleanXPaks() 1531 | { 1532 | QList ItemList = mFileListWidget->selectedItems(); 1533 | if (ItemList.isEmpty()) 1534 | return; 1535 | 1536 | QTreeWidgetItem* Item = ItemList[0]; 1537 | QString Folder; 1538 | 1539 | if (Item->data(0, Qt::UserRole).toInt() == ML_ITEM_MAP) 1540 | { 1541 | QString MapName = Item->text(0); 1542 | Folder = QString("%1/usermaps/%2").arg(mGamePath, MapName); 1543 | } 1544 | else 1545 | { 1546 | QString ModName = Item->parent() ? Item->parent()->text(0) : Item->text(0); 1547 | Folder = QString("%1/mods/%2").arg(mGamePath, ModName); 1548 | } 1549 | 1550 | QString fileListString; 1551 | QStringList fileList; 1552 | QDirIterator it(Folder, QStringList() << "*.xpak", QDir::Files, QDirIterator::Subdirectories); 1553 | while (it.hasNext()) 1554 | { 1555 | QString filepath = it.next(); 1556 | fileList.append(filepath); 1557 | fileListString.append("\n" + QDir(Folder).relativeFilePath(filepath)); 1558 | } 1559 | 1560 | QString relativeFolder = QDir(mGamePath).relativeFilePath(Folder); 1561 | 1562 | if (fileList.count() == 0) 1563 | { 1564 | QMessageBox::information(this, QString("Clean XPaks (%1)").arg(relativeFolder), QString("There are no XPak's to clean!")); 1565 | return; 1566 | } 1567 | 1568 | if (QMessageBox::question(this, QString("Clean XPaks (%1)").arg(relativeFolder), QString("Are you sure you want to delete the following files?" + fileListString), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) 1569 | return; 1570 | 1571 | for (auto file : fileList) 1572 | { 1573 | qDebug() << file; 1574 | QFile(file).remove(); 1575 | } 1576 | } 1577 | 1578 | void mlMainWindow::OnDelete() 1579 | { 1580 | QList ItemList = mFileListWidget->selectedItems(); 1581 | if (ItemList.isEmpty()) 1582 | return; 1583 | 1584 | QTreeWidgetItem* Item = ItemList[0]; 1585 | QString Folder; 1586 | 1587 | if (Item->data(0, Qt::UserRole).toInt() == ML_ITEM_MAP) 1588 | { 1589 | QString MapName = Item->text(0); 1590 | Folder = QString("%1/usermaps/%2").arg(mGamePath, MapName); 1591 | } 1592 | else 1593 | { 1594 | QString ModName = Item->parent() ? Item->parent()->text(0) : Item->text(0); 1595 | Folder = QString("%1/mods/%2").arg(mGamePath, ModName); 1596 | } 1597 | 1598 | if (QMessageBox::question(this, "Delete Folder", QString("Are you sure you want to delete the folder '%1' and all of its contents?").arg(Folder), QMessageBox::Yes | QMessageBox::No) != QMessageBox::Yes) 1599 | return; 1600 | 1601 | QDir(Folder).removeRecursively(); 1602 | PopulateFileList(); 1603 | } 1604 | 1605 | void mlMainWindow::OnExport2BinChooseDirectory() 1606 | { 1607 | const QString dir = QFileDialog::getExistingDirectory(mExport2BinGUIWidget, tr("Open Directory"), mToolsPath, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); 1608 | this->mExport2BinTargetDirWidget->setText(dir); 1609 | 1610 | QSettings Settings; 1611 | Settings.setValue("Export2Bin_TargetDir", dir); 1612 | } 1613 | 1614 | void mlMainWindow::OnExport2BinToggleOverwriteFiles() 1615 | { 1616 | QSettings Settings; 1617 | Settings.setValue("Export2Bin_OverwriteFiles", mExport2BinOverwriteWidget->isChecked()); 1618 | } 1619 | 1620 | void mlMainWindow::BuildOutputReady(QString Output) 1621 | { 1622 | mOutputWidget->appendPlainText(Output); 1623 | } 1624 | 1625 | void mlMainWindow::BuildFinished() 1626 | { 1627 | mBuildButton->setText("Build"); 1628 | mBuildThread->deleteLater(); 1629 | mBuildThread = NULL; 1630 | } 1631 | 1632 | Export2BinGroupBox::Export2BinGroupBox(QWidget* parent, mlMainWindow* parent_window) : QGroupBox(parent), parentWindow(parent_window) 1633 | { 1634 | this->setAcceptDrops(true); 1635 | } 1636 | 1637 | void Export2BinGroupBox::dragEnterEvent(QDragEnterEvent* event) 1638 | { 1639 | event->acceptProposedAction(); 1640 | } 1641 | 1642 | void Export2BinGroupBox::dropEvent(QDropEvent* event) 1643 | { 1644 | const QMimeData* mimeData = event->mimeData(); 1645 | 1646 | if (parentWindow == NULL) 1647 | { 1648 | return; 1649 | } 1650 | 1651 | if (mimeData->hasUrls()) 1652 | { 1653 | QStringList pathList; 1654 | QList urlList = mimeData->urls(); 1655 | 1656 | QDir working_dir(parentWindow->mToolsPath); 1657 | for (int i = 0; i < urlList.size(); i++) 1658 | { 1659 | pathList.append(urlList.at(i).toLocalFile()); 1660 | } 1661 | 1662 | QProcess* Process = new QProcess(); 1663 | connect(Process, SIGNAL(finished(int)), Process, SLOT(deleteLater())); 1664 | 1665 | bool allowOverwrite = this->parentWindow->mExport2BinOverwriteWidget->isChecked(); 1666 | 1667 | QString outputDir = parentWindow->mExport2BinTargetDirWidget->text(); 1668 | parentWindow->StartConvertThread(pathList, outputDir, allowOverwrite); 1669 | 1670 | event->acceptProposedAction(); 1671 | } 1672 | } 1673 | 1674 | void Export2BinGroupBox::dragLeaveEvent(QDragLeaveEvent* event) 1675 | { 1676 | event->accept(); 1677 | } 1678 | -------------------------------------------------------------------------------- /mlMainWindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2016 Activision Publishing, Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #pragma once 20 | 21 | class mlBuildThread : public QThread 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | mlBuildThread(const QList>& Commands, bool IgnoreErrors); 27 | void run(); 28 | bool Succeeded() const 29 | { 30 | return mSuccess; 31 | } 32 | 33 | void Cancel() 34 | { 35 | mCancel = true; 36 | } 37 | 38 | signals: 39 | void OutputReady(const QString& Output); 40 | 41 | protected: 42 | QList> mCommands; 43 | bool mSuccess; 44 | bool mCancel; 45 | bool mIgnoreErrors; 46 | }; 47 | 48 | class mlConvertThread : public QThread 49 | { 50 | Q_OBJECT 51 | 52 | public: 53 | mlConvertThread(QStringList& Files, QString& OutputDir, bool IgnoreErrors, bool mOverwrite); 54 | void run(); 55 | bool Succeeded() const 56 | { 57 | return mSuccess; 58 | } 59 | 60 | void Cancel() 61 | { 62 | mCancel = true; 63 | } 64 | 65 | signals: 66 | void OutputReady(const QString& Output); 67 | 68 | protected: 69 | QStringList mFiles; 70 | QString mOutputDir; 71 | bool mOverwrite; 72 | 73 | bool mSuccess; 74 | bool mCancel; 75 | bool mIgnoreErrors; 76 | }; 77 | 78 | class mlMainWindow : public QMainWindow 79 | { 80 | Q_OBJECT 81 | 82 | friend class Export2BinGroupBox; 83 | 84 | public: 85 | mlMainWindow(); 86 | ~mlMainWindow(); 87 | 88 | void UpdateDB(); 89 | 90 | void OnCreateItemResult(CreateItemResult_t* CreateItemResult, bool IOFailure); 91 | CCallResult mSteamCallResultCreateItem; 92 | 93 | void OnUpdateItemResult(SubmitItemUpdateResult_t* UpdateItemResult, bool IOFailure); 94 | CCallResult mSteamCallResultUpdateItem; 95 | 96 | void OnUGCRequestUGCDetails(SteamUGCRequestUGCDetailsResult_t* RequestDetailsResult, bool IOFailure); 97 | CCallResult mSteamCallResultRequestDetails; 98 | 99 | protected slots: 100 | void OnFileNew(); 101 | void OnFileAssetEditor(); 102 | void OnFileLevelEditor(); 103 | void OnFileExport2Bin(); 104 | void OnEditBuild(); 105 | void OnEditPublish(); 106 | void OnEditOptions(); 107 | void OnEditDvars(); 108 | void OnHelpAbout(); 109 | void OnOpenZoneFile(); 110 | void OnOpenModRootFolder(); 111 | void OnRunMapOrMod(); 112 | void OnSaveLog() const; 113 | void OnCleanXPaks(); 114 | void OnDelete(); 115 | void OnExport2BinChooseDirectory(); 116 | void OnExport2BinToggleOverwriteFiles(); 117 | void BuildOutputReady(QString Output); 118 | void BuildFinished(); 119 | void ContextMenuRequested(); 120 | void SteamUpdate(); 121 | 122 | protected: 123 | void closeEvent(QCloseEvent* Event); 124 | 125 | void StartBuildThread(const QList>& Commands); 126 | void mlMainWindow::StartConvertThread(QStringList& pathList, QString& outputDir, bool allowOverwrite); 127 | 128 | void PopulateFileList(); 129 | void UpdateWorkshopItem(); 130 | void ShowPublishDialog(); 131 | void UpdateTheme(); 132 | 133 | void CreateActions(); 134 | void CreateMenu(); 135 | void CreateToolBar(); 136 | 137 | void InitExport2BinGUI(); 138 | 139 | QAction* mActionFileNew; 140 | QAction* mActionFileAssetEditor; 141 | QAction* mActionFileLevelEditor; 142 | QAction* mActionFileExport2Bin; 143 | QAction* mActionFileExit; 144 | QAction* mActionEditBuild; 145 | QAction* mActionEditPublish; 146 | QAction* mActionEditOptions; 147 | QAction* mActionHelpAbout; 148 | 149 | QTreeWidget* mFileListWidget; 150 | QPlainTextEdit* mOutputWidget; 151 | 152 | QPushButton* mBuildButton; 153 | QPushButton* mDvarsButton; 154 | QPushButton* mLogButton; 155 | QCheckBox* mCompileEnabledWidget; 156 | QComboBox* mCompileModeWidget; 157 | QCheckBox* mLightEnabledWidget; 158 | QComboBox* mLightQualityWidget; 159 | QCheckBox* mLinkEnabledWidget; 160 | QCheckBox* mRunEnabledWidget; 161 | QLineEdit* mRunOptionsWidget; 162 | QCheckBox* mIgnoreErrorsWidget; 163 | 164 | mlBuildThread* mBuildThread; 165 | mlConvertThread* mConvertThread; 166 | 167 | QDockWidget* mExport2BinGUIWidget; 168 | QCheckBox* mExport2BinOverwriteWidget; 169 | QLineEdit* mExport2BinTargetDirWidget; 170 | 171 | bool mTreyarchTheme; 172 | QString mBuildLanguage; 173 | 174 | QStringList mShippedMapList; 175 | QTimer mTimer; 176 | 177 | quint64 mFileId; 178 | QString mTitle; 179 | QString mDescription; 180 | QString mThumbnail; 181 | QString mWorkshopFolder; 182 | QString mFolderName; 183 | QString mType; 184 | QStringList mTags; 185 | 186 | QString mGamePath; 187 | QString mToolsPath; 188 | 189 | QStringList mRunDvars; 190 | }; 191 | 192 | class Export2BinGroupBox : public QGroupBox 193 | { 194 | private: 195 | mlMainWindow* parentWindow; 196 | 197 | protected: 198 | void dragEnterEvent(QDragEnterEvent* event); 199 | void dragLeaveEvent(QDragLeaveEvent* event); 200 | void dropEvent(QDropEvent *event); 201 | 202 | public: 203 | Export2BinGroupBox(QWidget *parent, mlMainWindow* parent_window); 204 | }; 205 | -------------------------------------------------------------------------------- /resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | resources/AssetEditor.png 4 | resources/BlackOps3.png 5 | resources/Export2Bin.png 6 | resources/Radiant.png 7 | resources/ModLauncher.png 8 | resources/Go.png 9 | resources/FileNew.png 10 | resources/upload.png 11 | stylesheet/stylesheet/checkbox.png 12 | stylesheet/stylesheet/down_arrow.png 13 | stylesheet/stylesheet/handle.png 14 | 15 | 16 | -------------------------------------------------------------------------------- /resources/AssetEditor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/resources/AssetEditor.png -------------------------------------------------------------------------------- /resources/BlackOps3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/resources/BlackOps3.png -------------------------------------------------------------------------------- /resources/Export2Bin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/resources/Export2Bin.png -------------------------------------------------------------------------------- /resources/FileNew.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/resources/FileNew.png -------------------------------------------------------------------------------- /resources/Go.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/resources/Go.png -------------------------------------------------------------------------------- /resources/ModLauncher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/resources/ModLauncher.png -------------------------------------------------------------------------------- /resources/Radiant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/resources/Radiant.png -------------------------------------------------------------------------------- /resources/upload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/resources/upload.png -------------------------------------------------------------------------------- /stdafx.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2016 Activision Publishing, Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #include "stdafx.h" 20 | 21 | #if USE_CUSTOM_QT // If a custom version of Qt (e.g. Treyarch's version) is being used, use the custom library names 22 | 23 | #if _DEBUG 24 | #pragma comment(lib, "Qt5Core64d.lib") 25 | #pragma comment(lib, "Qt5Gui64d.lib") 26 | #pragma comment(lib, "Qt5Widgets64d.lib") 27 | #else 28 | #pragma comment(lib, "Qt5Core64r.lib") 29 | #pragma comment(lib, "Qt5Gui64r.lib") 30 | #pragma comment(lib, "Qt5Widgets64r.lib") 31 | #endif 32 | 33 | #else //If a standard version of Qt is being used, link the standard library names 34 | #pragma comment(lib, "Qt5Core.lib") 35 | #pragma comment(lib, "Qt5Gui.lib") 36 | #pragma comment(lib, "Qt5Widgets.lib") 37 | #endif 38 | -------------------------------------------------------------------------------- /stdafx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2016 Activision Publishing, Inc. 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include "steam_api.h" 23 | #include "dvar.h" 24 | 25 | class mlMainWindow; 26 | class mlExport2BinWidget; 27 | -------------------------------------------------------------------------------- /stylesheet/stylesheet/checkbox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/stylesheet/stylesheet/checkbox.png -------------------------------------------------------------------------------- /stylesheet/stylesheet/down_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/stylesheet/stylesheet/down_arrow.png -------------------------------------------------------------------------------- /stylesheet/stylesheet/handle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TreyarchGames/ModLauncher/6ce0afde299d2cb3e24f5e63c98a3c554660453b/stylesheet/stylesheet/handle.png --------------------------------------------------------------------------------