├── .classpath ├── .gitignore ├── .project ├── LICENSE ├── Libraries ├── fluent-hc-4.5.7.jar ├── httpclient-4.5.7.jar ├── httpcore-4.4.11.jar ├── jackson-annotations-2.9.8.jar ├── jackson-core-2.9.8.jar ├── jackson-databind-2.9.8.jar ├── jna-4.5.2.jar └── jna-platform-4.5.2.jar ├── README.md ├── data ├── tankmaster_coalesce │ ├── Gammtek.Conduit.CommandLine.dll │ ├── Gammtek.Conduit.Core.dll │ ├── Gammtek.Conduit.MassEffect3.dll │ ├── Gammtek.Conduit.UnrealEngine3.dll │ └── MassEffect3.Coalesce.exe └── tankmaster_tlk │ ├── Gammtek.Conduit.CommandLine.dll │ ├── Gammtek.Conduit.Core.dll │ ├── Gammtek.Conduit.MassEffect3.dll │ ├── Gammtek.Conduit.UnrealEngine3.dll │ ├── MassEffect3.TlkEditor.exe │ ├── MassEffect3.TlkEditor.exe.config │ ├── Microsoft.WindowsAPICodePack.Shell.dll │ └── Microsoft.WindowsAPICodePack.dll ├── dlcpatcher ├── BalanceChangesReplacer.asi ├── binkw23.dll ├── binkw32_asi.dll ├── me3logger_truncating.asi └── zlib1.dll ├── libraries ├── commons-io-2.5-javadoc.jar ├── commons-io-2.5.jar ├── commons-lang3-3.6-javadoc.jar ├── commons-lang3-3.6.jar ├── commons-logging-1.2.jar ├── commons-validator-1.6.jar ├── derby.jar ├── filedrop.jar ├── ini4j-0.5.2.jar ├── jsch-0.1.54.jar ├── json-simple-1.1.1.jar ├── sevenzipjbinding-Windows-amd64.jar ├── sevenzipjbinding.jar └── swingx-all-1.6.5-1.jar ├── licenses ├── 7zip.txt ├── Apache libraries.txt ├── ME3Explorer.txt ├── binkw32_asi.txt └── zlib.txt ├── modmanager3.iml ├── src ├── com │ └── me3tweaks │ │ └── modmanager │ │ ├── ALOTInstallerUpdaterWindow.java │ │ ├── ASIModWindow.java │ │ ├── AboutWindow2.java │ │ ├── AutoTocWindow.java │ │ ├── BackupWindow.java │ │ ├── CoalescedWindow.java │ │ ├── CommandLineToolsUpdaterWindow.java │ │ ├── CompressionOptionsWindow.java │ │ ├── CustomDLCConflictWindow.java │ │ ├── CustomDLCWindow.java │ │ ├── DeltaWindow.java │ │ ├── FailedModsWindow.java │ │ ├── FileDropWindow.java │ │ ├── ImportEntryWindow.java │ │ ├── KeybindsInjectionWindow.java │ │ ├── LogOptionsWindow.java │ │ ├── LogWindow.java │ │ ├── ME3ExplorerUpdaterWindow.java │ │ ├── ME3TweaksUpdaterServiceWindow.java │ │ ├── ModGroupCreatorWindow.java │ │ ├── ModGroupWindow.java │ │ ├── ModImportArchiveWindow.java │ │ ├── ModImportDLCWindow.java │ │ ├── ModInfoEditorWindow.java │ │ ├── ModInstallWindow.java │ │ ├── ModManager.java │ │ ├── ModManagerWindow.java │ │ ├── MountFileEditorWindow.java │ │ ├── NetFrameworkMissingWindow.java │ │ ├── OfficialDLCWindow.java │ │ ├── OptionsWindow.java │ │ ├── PCCDataDumperWindow.java │ │ ├── PatchApplicationWindow.java │ │ ├── PatchLibraryWindow.java │ │ ├── RestoreFilesWindow.java │ │ ├── SelectiveRestoreWindow.java │ │ ├── StarterKitWindow.java │ │ ├── TLKTool.java │ │ ├── UnpackWindow.java │ │ ├── UpdateAvailableWindow.java │ │ ├── UpdateJREAvailableWindow.java │ │ ├── VanillaBackupWindow.java │ │ ├── help │ │ ├── HelpItemPackage.java │ │ ├── HelpMenu.java │ │ └── ResourceWindowHelpModal.java │ │ ├── moddesceditor │ │ ├── MDEConditionalDLCItem.java │ │ ├── MDEConditionalFileItem.java │ │ ├── MDECustomDLC.java │ │ ├── MDEModFileChooser.java │ │ ├── MDEModFolderChooser.java │ │ ├── MDEOfficialJob.java │ │ ├── MDEOfficialJobConditionalFileItem.java │ │ ├── MDEOfficialJobNewFile.java │ │ ├── MDEOfficialTaskSelector.java │ │ ├── MDEOutdatedCustomDLC.java │ │ ├── ModDescEditorDirectoryChooser.java │ │ └── ModDescEditorWindow.java │ │ ├── modmaker │ │ ├── DynamicPatch.java │ │ ├── ME3TweaksUtils.java │ │ ├── ModMakerCompilerWindow.java │ │ ├── ModMakerEntryWindow.java │ │ └── TLKFragment.java │ │ ├── modupdater │ │ ├── AllModsUpdateWindow.java │ │ ├── ManifestModFile.java │ │ ├── ModUpdateWindow.java │ │ ├── ModXMLTools.java │ │ └── UpdatePackage.java │ │ ├── objects │ │ ├── ASIMod.java │ │ ├── ASIUpdateGroup.java │ │ ├── AlternateCustomDLC.java │ │ ├── AlternateFile.java │ │ ├── CompressedMod.java │ │ ├── CustomDLC.java │ │ ├── HelpMenuItem.java │ │ ├── InstalledASIMod.java │ │ ├── ME3TweaksPatchPackage.java │ │ ├── MainUIBackgroundJob.java │ │ ├── MergeModFile.java │ │ ├── MetaCMM.java │ │ ├── Mod.java │ │ ├── ModDelta.java │ │ ├── ModGroup.java │ │ ├── ModJob.java │ │ ├── ModList.java │ │ ├── ModTypeConstants.java │ │ ├── ModuleDelta.java │ │ ├── MountFile.java │ │ ├── MountFlag.java │ │ ├── PCCDumpOptions.java │ │ ├── Patch.java │ │ ├── PatchModBundle.java │ │ ├── ProcessResult.java │ │ ├── RestoreMode.java │ │ ├── ThirdPartyImportingInfo.java │ │ ├── ThirdPartyModInfo.java │ │ ├── ThreadCommand.java │ │ └── TocBatchDescriptor.java │ │ ├── repairdb │ │ ├── BasegameHashDB.java │ │ └── RepairFileInfo.java │ │ ├── testing │ │ └── Testing.java │ │ ├── ui │ │ ├── ASIActionColumn.java │ │ ├── AboutWindow2Controller.java │ │ ├── ButtonColumn.java │ │ ├── CheckBoxLabel.java │ │ ├── CompressedModCellRenderer.java │ │ ├── ConflictResolutionRadioButton.java │ │ ├── CustomDLCManagerTableCellRenderer.java │ │ ├── CustomDLCManagerToggleButtonColumn.java │ │ ├── HintTextAreaUI.java │ │ ├── HintTextFieldUI.java │ │ ├── ModCellRenderer.java │ │ ├── MountFlagCellRenderer.java │ │ ├── MultiLineTableCell.java │ │ ├── NumReqButtonColumn.java │ │ ├── SFARColumn.java │ │ ├── SelectiveRestoreTableCellRenderer.java │ │ ├── StayOpenJCheckboxMenuItem.java │ │ ├── SwingLink.java │ │ └── aboutwindow.fxml │ │ ├── utilities │ │ ├── ByteArrayInOutStream.java │ │ ├── DebugLogger.java │ │ ├── EXEFileInfo.java │ │ ├── MD5Checksum.java │ │ ├── NexusModsAPI.java │ │ ├── ResourceUtils.java │ │ ├── SevenZipCompressedModInspector.java │ │ ├── Version.java │ │ ├── datatypeconverter │ │ │ ├── DatatypeConverter.java │ │ │ ├── DatatypeConverterImpl.java │ │ │ ├── DatatypeConverterInterface.java │ │ │ ├── Messages.java │ │ │ └── WhiteSpaceProcessor.java │ │ └── nexusmods │ │ │ ├── NexusModsFileInfo.java │ │ │ └── NexusModsMod.java │ │ └── valueparsers │ │ ├── ValueParserLib.java │ │ ├── ammopower │ │ └── AmmoPowerGUI.java │ │ ├── bioai │ │ ├── BioAIGUI.java │ │ └── Range.java │ │ ├── biodifficulty │ │ ├── Category.java │ │ ├── DifficultyGUI.java │ │ ├── Stat.java │ │ └── StatRange.java │ │ ├── bioweapon │ │ ├── BioWeaponGUI.java │ │ ├── HTMLGenerator.java │ │ ├── HTMLParams.java │ │ └── Range.java │ │ ├── consumable │ │ └── ConsumableGUI.java │ │ ├── enemytype │ │ └── EnemyType.java │ │ ├── id │ │ └── ID.java │ │ ├── mpstorepack │ │ ├── Card.java │ │ ├── CardParser.java │ │ ├── CardPool.java │ │ ├── PackMetadata.java │ │ ├── PackSlot.java │ │ ├── PoolCard.java │ │ ├── RealCard.java │ │ ├── SlotPool.java │ │ ├── StorePack.java │ │ └── WeightWrapper.java │ │ ├── possessionwaves │ │ ├── Difficulty.java │ │ ├── PossessionWavesGUI.java │ │ └── Waves.java │ │ ├── powercustomaction │ │ ├── BaseRankUpgrade.java │ │ ├── ContainerRow.java │ │ ├── DetonationParameters.java │ │ ├── Power.java │ │ ├── PowerCustomActionGUI.java │ │ ├── PowerCustomActionGUI2.java │ │ ├── PowerVariable.java │ │ └── VariableRow.java │ │ ├── sharedassignment │ │ └── SharedDifficulty.java │ │ ├── waveclass │ │ └── WaveClass.java │ │ └── wavelist │ │ ├── Enemy.java │ │ ├── Wave.java │ │ └── WavelistGUI.java └── resource │ ├── icon128.png │ ├── icon32.png │ ├── icon64.png │ ├── me3tweaks.png │ ├── modmaker.png │ └── network.gif └── starterkit ├── Default.sfar ├── Default_DLC_MOD_StarterKit.bin ├── Mount.dlc └── StarterKitTLK.xml /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | data/BIOGAME_DIRECTORIES 2 | carddata/ 3 | data/temp 4 | ME3CMM.exe 5 | data/tools 6 | .classpath 7 | .project 8 | .settings/ 9 | bin/ 10 | mod_info 11 | me3mcc.ini 12 | me3cmm.ini 13 | coalesceds/ 14 | Testing Mod/ 15 | ME3Explorer/ 16 | update/ 17 | me3cmm_last_run_log.txt 18 | latest_version 19 | PCA-Generator/ 20 | *.xml 21 | signing/ 22 | data/databases 23 | data/mixinlibrary 24 | data/modmaker 25 | mods/ 26 | server/ 27 | patches/ 28 | derby.log 29 | data/Coalesced.original 30 | /bin/ 31 | data/me3tweaksservicescache/tipsservice.json 32 | data/help/DLC_AUTH_FAIL.png 33 | data/ALOTInstaller 34 | data/me3tweaksservicescache 35 | debug.log 36 | data/Deployed Mods/LangTest_1.0.7z 37 | NM_PersonalAPIKey.txt 38 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | modmanager3 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /Libraries/fluent-hc-4.5.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/Libraries/fluent-hc-4.5.7.jar -------------------------------------------------------------------------------- /Libraries/httpclient-4.5.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/Libraries/httpclient-4.5.7.jar -------------------------------------------------------------------------------- /Libraries/httpcore-4.4.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/Libraries/httpcore-4.4.11.jar -------------------------------------------------------------------------------- /Libraries/jackson-annotations-2.9.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/Libraries/jackson-annotations-2.9.8.jar -------------------------------------------------------------------------------- /Libraries/jackson-core-2.9.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/Libraries/jackson-core-2.9.8.jar -------------------------------------------------------------------------------- /Libraries/jackson-databind-2.9.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/Libraries/jackson-databind-2.9.8.jar -------------------------------------------------------------------------------- /Libraries/jna-4.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/Libraries/jna-4.5.2.jar -------------------------------------------------------------------------------- /Libraries/jna-platform-4.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/Libraries/jna-platform-4.5.2.jar -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [This project has been superceded by ME3Tweaks Mod Manager](https://github.com/ME3Tweaks/ME3TweaksModManager) 2 | This program is no longer supported. 3 | 4 | ## Mass Effect 3 Mod Manager 5 | Mass Effect 3 Mod Manager handles installing mods for Mass Effect 3 from basic coalesced swaps to advanced mods that change configuration based on what's already installed. 6 | 7 | ![Mass Effect 3 Mod Manager](https://raw.github.com/mgamerz/me3modmanager/static-content/modmanager.png) 8 | 9 | ## For developers 10 | The master branch is code for the latest stable release. The dev branch is the working branch and contains the most up to date code but will be less stable and possibly non-functional. Pull requests move code from dev to master and include the changelog. 11 | 12 | Mod Manager is compiled using Eclipse. Import the project and ensure all libraries are on the classpath. Additionally you will need to ensure non-code items that are embedded into the output jar are included (such as LauncherWV). 13 | 14 | Main website: http://me3tweaks.com/modmanager. 15 | -------------------------------------------------------------------------------- /data/tankmaster_coalesce/Gammtek.Conduit.CommandLine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_coalesce/Gammtek.Conduit.CommandLine.dll -------------------------------------------------------------------------------- /data/tankmaster_coalesce/Gammtek.Conduit.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_coalesce/Gammtek.Conduit.Core.dll -------------------------------------------------------------------------------- /data/tankmaster_coalesce/Gammtek.Conduit.MassEffect3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_coalesce/Gammtek.Conduit.MassEffect3.dll -------------------------------------------------------------------------------- /data/tankmaster_coalesce/Gammtek.Conduit.UnrealEngine3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_coalesce/Gammtek.Conduit.UnrealEngine3.dll -------------------------------------------------------------------------------- /data/tankmaster_coalesce/MassEffect3.Coalesce.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_coalesce/MassEffect3.Coalesce.exe -------------------------------------------------------------------------------- /data/tankmaster_tlk/Gammtek.Conduit.CommandLine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_tlk/Gammtek.Conduit.CommandLine.dll -------------------------------------------------------------------------------- /data/tankmaster_tlk/Gammtek.Conduit.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_tlk/Gammtek.Conduit.Core.dll -------------------------------------------------------------------------------- /data/tankmaster_tlk/Gammtek.Conduit.MassEffect3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_tlk/Gammtek.Conduit.MassEffect3.dll -------------------------------------------------------------------------------- /data/tankmaster_tlk/Gammtek.Conduit.UnrealEngine3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_tlk/Gammtek.Conduit.UnrealEngine3.dll -------------------------------------------------------------------------------- /data/tankmaster_tlk/MassEffect3.TlkEditor.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_tlk/MassEffect3.TlkEditor.exe -------------------------------------------------------------------------------- /data/tankmaster_tlk/MassEffect3.TlkEditor.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /data/tankmaster_tlk/Microsoft.WindowsAPICodePack.Shell.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_tlk/Microsoft.WindowsAPICodePack.Shell.dll -------------------------------------------------------------------------------- /data/tankmaster_tlk/Microsoft.WindowsAPICodePack.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/data/tankmaster_tlk/Microsoft.WindowsAPICodePack.dll -------------------------------------------------------------------------------- /dlcpatcher/BalanceChangesReplacer.asi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/dlcpatcher/BalanceChangesReplacer.asi -------------------------------------------------------------------------------- /dlcpatcher/binkw23.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/dlcpatcher/binkw23.dll -------------------------------------------------------------------------------- /dlcpatcher/binkw32_asi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/dlcpatcher/binkw32_asi.dll -------------------------------------------------------------------------------- /dlcpatcher/me3logger_truncating.asi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/dlcpatcher/me3logger_truncating.asi -------------------------------------------------------------------------------- /dlcpatcher/zlib1.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/dlcpatcher/zlib1.dll -------------------------------------------------------------------------------- /libraries/commons-io-2.5-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/commons-io-2.5-javadoc.jar -------------------------------------------------------------------------------- /libraries/commons-io-2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/commons-io-2.5.jar -------------------------------------------------------------------------------- /libraries/commons-lang3-3.6-javadoc.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/commons-lang3-3.6-javadoc.jar -------------------------------------------------------------------------------- /libraries/commons-lang3-3.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/commons-lang3-3.6.jar -------------------------------------------------------------------------------- /libraries/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/commons-logging-1.2.jar -------------------------------------------------------------------------------- /libraries/commons-validator-1.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/commons-validator-1.6.jar -------------------------------------------------------------------------------- /libraries/derby.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/derby.jar -------------------------------------------------------------------------------- /libraries/filedrop.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/filedrop.jar -------------------------------------------------------------------------------- /libraries/ini4j-0.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/ini4j-0.5.2.jar -------------------------------------------------------------------------------- /libraries/jsch-0.1.54.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/jsch-0.1.54.jar -------------------------------------------------------------------------------- /libraries/json-simple-1.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/json-simple-1.1.1.jar -------------------------------------------------------------------------------- /libraries/sevenzipjbinding-Windows-amd64.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/sevenzipjbinding-Windows-amd64.jar -------------------------------------------------------------------------------- /libraries/sevenzipjbinding.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/sevenzipjbinding.jar -------------------------------------------------------------------------------- /libraries/swingx-all-1.6.5-1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/libraries/swingx-all-1.6.5-1.jar -------------------------------------------------------------------------------- /licenses/7zip.txt: -------------------------------------------------------------------------------- 1 | 7-Zip 2 | ~~~~~ 3 | License for use and distribution 4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 | 6 | 7-Zip Copyright (C) 1999-2017 Igor Pavlov. 7 | 8 | Licenses for files are: 9 | 10 | 1) 7z.dll: GNU LGPL + unRAR restriction 11 | 2) All other files: GNU LGPL 12 | 13 | The GNU LGPL + unRAR restriction means that you must follow both 14 | GNU LGPL rules and unRAR restriction rules. 15 | 16 | 17 | Note: 18 | You can use 7-Zip on any computer, including a computer in a commercial 19 | organization. You don't need to register or pay for 7-Zip. 20 | 21 | 22 | GNU LGPL information 23 | -------------------- 24 | 25 | This library is free software; you can redistribute it and/or 26 | modify it under the terms of the GNU Lesser General Public 27 | License as published by the Free Software Foundation; either 28 | version 2.1 of the License, or (at your option) any later version. 29 | 30 | This library is distributed in the hope that it will be useful, 31 | but WITHOUT ANY WARRANTY; without even the implied warranty of 32 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 33 | Lesser General Public License for more details. 34 | 35 | You can receive a copy of the GNU Lesser General Public License from 36 | http://www.gnu.org/ 37 | 38 | 39 | unRAR restriction 40 | ----------------- 41 | 42 | The decompression engine for RAR archives was developed using source 43 | code of unRAR program. 44 | All copyrights to original unRAR code are owned by Alexander Roshal. 45 | 46 | The license for original unRAR code has the following restriction: 47 | 48 | The unRAR sources cannot be used to re-create the RAR compression algorithm, 49 | which is proprietary. Distribution of modified unRAR sources in separate form 50 | or as a part of other software is permitted, provided that it is clearly 51 | stated in the documentation and source comments that the code may 52 | not be used to develop a RAR (WinRAR) compatible archiver. 53 | 54 | 55 | -- 56 | Igor Pavlov -------------------------------------------------------------------------------- /licenses/ME3Explorer.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2012-2016 ME3Explorer Team https://github.com/ME3Explorer/ME3Explorer 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /licenses/binkw32_asi.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Erik JS 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /licenses/zlib.txt: -------------------------------------------------------------------------------- 1 | LICENSE FOR zlib.dll 2 | 3 | zlib.h -- interface of the 'zlib' general purpose compression library 4 | version 1.2.11, January 15th, 2017 5 | 6 | Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler 7 | 8 | This software is provided 'as-is', without any express or implied 9 | warranty. In no event will the authors be held liable for any damages 10 | arising from the use of this software. 11 | 12 | Permission is granted to anyone to use this software for any purpose, 13 | including commercial applications, and to alter it and redistribute it 14 | freely, subject to the following restrictions: 15 | 16 | 1. The origin of this software must not be misrepresented; you must not 17 | claim that you wrote the original software. If you use this software 18 | in a product, an acknowledgment in the product documentation would be 19 | appreciated but is not required. 20 | 2. Altered source versions must be plainly marked as such, and must not be 21 | misrepresented as being the original software. 22 | 3. This notice may not be removed or altered from any source distribution. 23 | 24 | Jean-loup Gailly Mark Adler 25 | jloup@gzip.org madler@alumni.caltech.edu 26 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/AboutWindow2.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager; 2 | 3 | import java.awt.Dialog; 4 | import java.awt.Dimension; 5 | import java.io.IOException; 6 | import java.net.URI; 7 | import java.net.URISyntaxException; 8 | import java.net.URL; 9 | 10 | import javax.swing.JDialog; 11 | import javax.swing.JPanel; 12 | 13 | import com.me3tweaks.modmanager.utilities.ResourceUtils; 14 | 15 | import javafx.animation.FadeTransition; 16 | import javafx.application.Platform; 17 | import javafx.embed.swing.JFXPanel; 18 | import javafx.event.ActionEvent; 19 | import javafx.event.EventHandler; 20 | import javafx.fxml.FXMLLoader; 21 | import javafx.geometry.HPos; 22 | import javafx.geometry.Pos; 23 | import javafx.scene.Group; 24 | import javafx.scene.Parent; 25 | import javafx.scene.Scene; 26 | import javafx.scene.control.Hyperlink; 27 | import javafx.scene.control.Label; 28 | import javafx.scene.image.Image; 29 | import javafx.scene.image.ImageView; 30 | import javafx.scene.layout.FlowPane; 31 | import javafx.scene.layout.GridPane; 32 | import javafx.scene.layout.Priority; 33 | import javafx.scene.text.Font; 34 | import javafx.scene.text.FontWeight; 35 | import javafx.util.Duration; 36 | 37 | public class AboutWindow2 extends JDialog { 38 | 39 | private Dimension WINDOW_SIZE = new Dimension(550, 415); 40 | 41 | public AboutWindow2() { 42 | super(null, Dialog.ModalityType.APPLICATION_MODAL); 43 | Platform.setImplicitExit(false); 44 | setupWindow(); 45 | setVisible(true); 46 | } 47 | 48 | private void setupWindow() { 49 | setResizable(false); 50 | setTitle("About Mod Manager"); 51 | setDefaultCloseOperation(DISPOSE_ON_CLOSE); 52 | setIconImages(ModManager.ICONS); 53 | setPreferredSize(WINDOW_SIZE); 54 | JFXPanel fxPanel = new JFXPanel(); 55 | add(fxPanel); 56 | //setPreferredSize(WINDOW_SIZE); 57 | pack(); 58 | setLocationRelativeTo(ModManagerWindow.ACTIVE_WINDOW); 59 | Platform.runLater(new Runnable() { 60 | @Override 61 | public void run() { 62 | initFX(fxPanel); 63 | } 64 | }); 65 | } 66 | 67 | private void initFX(JFXPanel fxPanel) { 68 | // This method is invoked on the JavaFX thread 69 | try { 70 | Parent root = FXMLLoader.load(getClass().getResource("/com/me3tweaks/modmanager/ui/aboutwindow.fxml")); 71 | Scene scene = new Scene(root); 72 | Label version = (Label) scene.lookup("#versionLabel"); 73 | version.setText("Version " + ModManager.VERSION + " - Build " + ModManager.BUILD_NUMBER + " - " + ModManager.BUILD_DATE); 74 | //Scene scene = createScene(); 75 | fxPanel.setScene(scene); 76 | } catch (Exception e) { 77 | ModManager.debugLogger.writeErrorWithException("ERROR CREATING SCENE...", e); 78 | } 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/CompressionOptionsWindow.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager; 2 | 3 | import javax.swing.*; 4 | import java.awt.*; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.ActionListener; 7 | 8 | public class CompressionOptionsWindow extends JDialog { 9 | private JCheckBox multiThreadCheckBox; 10 | private JSlider compressionLevelSlider; 11 | 12 | private int selectedCompressionLevel = -1; 13 | private boolean selectedMultiThread; 14 | 15 | public CompressionOptionsWindow(JFrame callingWindow, int defaultCompressionLevel, boolean defaultMultiThread) { 16 | super(null, Dialog.ModalityType.APPLICATION_MODAL); 17 | ModManager.debugLogger.writeMessage("Opening Compression Settings Window"); 18 | setupWindow(defaultCompressionLevel, defaultMultiThread); 19 | setLocationRelativeTo(callingWindow); 20 | setVisible(true); 21 | } 22 | 23 | private void setupWindow(int defaultCompressionLevel, boolean defaultMultiThread) { 24 | setTitle("Mod Deployment Compression Settings"); 25 | setDefaultCloseOperation(DISPOSE_ON_CLOSE); 26 | setIconImages(ModManager.ICONS); 27 | setResizable(false); 28 | 29 | JPanel optionsPanel = new JPanel(); 30 | optionsPanel.setLayout(new BoxLayout(optionsPanel, BoxLayout.PAGE_AXIS)); 31 | JLabel header = new JLabel("Select compression level", SwingConstants.CENTER); 32 | header.setAlignmentX(Component.CENTER_ALIGNMENT); 33 | optionsPanel.add(header); 34 | compressionLevelSlider = new JSlider(JSlider.HORIZONTAL, 35 | 0, 9, defaultCompressionLevel); 36 | compressionLevelSlider.setMajorTickSpacing(1); 37 | compressionLevelSlider.setPaintTicks(true); 38 | compressionLevelSlider.setPaintLabels(true); 39 | 40 | compressionLevelSlider.setToolTipText("Higher compression will take longer to compress and use more memory, but will use less disk space in the end"); 41 | 42 | multiThreadCheckBox = new JCheckBox("Multithreaded compression"); 43 | multiThreadCheckBox.setToolTipText("Compress in parallel, which uses more memory but significantly speeds up compression"); 44 | multiThreadCheckBox.setSelected(defaultMultiThread); 45 | JButton okButton = new JButton("OK"); 46 | okButton.addActionListener(new ActionListener() { 47 | @Override 48 | public void actionPerformed(ActionEvent e) { 49 | selectedCompressionLevel = compressionLevelSlider.getValue(); 50 | selectedMultiThread = multiThreadCheckBox.isSelected(); 51 | dispose(); 52 | } 53 | }); 54 | JButton cancelButton = new JButton("Cancel"); 55 | cancelButton.addActionListener(new ActionListener() { 56 | @Override 57 | public void actionPerformed(ActionEvent e) { 58 | dispose(); 59 | } 60 | }); 61 | cancelButton.setToolTipText("Cancels deployment"); 62 | optionsPanel.add(compressionLevelSlider); 63 | 64 | JPanel buttonPanel = new JPanel(); 65 | buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.LINE_AXIS)); 66 | buttonPanel.add(multiThreadCheckBox); 67 | buttonPanel.add(Box.createHorizontalGlue()); 68 | buttonPanel.add(cancelButton); 69 | buttonPanel.add(okButton); 70 | optionsPanel.add(buttonPanel); 71 | 72 | optionsPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 73 | getContentPane().add(optionsPanel); 74 | pack(); 75 | } 76 | 77 | public int getCompressionLevel() { 78 | return selectedCompressionLevel; 79 | 80 | } 81 | 82 | public boolean getMultithreaded() { 83 | return selectedMultiThread; 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/LogWindow.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.Color; 5 | import java.awt.Dialog; 6 | import java.awt.Dimension; 7 | import java.awt.event.ActionEvent; 8 | import java.awt.event.ActionListener; 9 | import java.io.File; 10 | import java.util.Scanner; 11 | 12 | import javax.swing.Box; 13 | import javax.swing.BoxLayout; 14 | import javax.swing.JButton; 15 | import javax.swing.JFrame; 16 | import javax.swing.JPanel; 17 | import javax.swing.JScrollPane; 18 | import javax.swing.JTextPane; 19 | import javax.swing.border.EmptyBorder; 20 | import javax.swing.text.Element; 21 | 22 | import org.apache.commons.io.input.Tailer; 23 | import org.apache.commons.io.input.TailerListener; 24 | import org.apache.commons.io.input.TailerListenerAdapter; 25 | 26 | import com.me3tweaks.modmanager.help.HelpMenu; 27 | import com.me3tweaks.modmanager.utilities.DebugLogger; 28 | import com.me3tweaks.modmanager.utilities.ResourceUtils; 29 | 30 | public class LogWindow extends JFrame { 31 | 32 | private JTextPane logArea; 33 | private Tailer tailer; 34 | private int caretline = 0; 35 | private int caretpos = 0; 36 | 37 | public LogWindow() { 38 | ModManager.debugLogger.writeMessage("Opening Logging Window"); 39 | setupWindow(); 40 | setupTailer(); 41 | setLocationRelativeTo(ModManagerWindow.ACTIVE_WINDOW); 42 | setVisible(true); 43 | } 44 | 45 | private void setupTailer() { 46 | TailerListener listener = new LogTailer(); 47 | File tailFile = new File(DebugLogger.LOGGING_FILENAME); 48 | tailer = Tailer.create(tailFile, new LogTailer(), 500, true); 49 | } 50 | 51 | class LogTailer extends TailerListenerAdapter { 52 | @Override 53 | public void handle(String line) { 54 | if (line.startsWith(DebugLogger.ERROR_PREFIX) || line.startsWith(DebugLogger.EN_EXCEPTION_PREFIX)) { 55 | ResourceUtils.appendToPane(logArea, line, Color.RED); 56 | } else { 57 | ResourceUtils.appendToPane(logArea, line, Color.BLACK); 58 | } 59 | } 60 | } 61 | 62 | private void shutdownTailer() { 63 | if (tailer != null) { 64 | tailer.stop(); 65 | } 66 | ModManager.debugLogger.writeMessage("Log tailer shutting down"); 67 | } 68 | 69 | public void setupWindow() { 70 | setTitle("Mod Manager session log"); 71 | setPreferredSize(new Dimension(720, 480)); 72 | setIconImages(ModManager.ICONS); 73 | addWindowListener(new java.awt.event.WindowAdapter() { 74 | @Override 75 | public void windowClosing(java.awt.event.WindowEvent windowEvent) { 76 | shutdownTailer(); 77 | } 78 | 79 | }); 80 | JPanel mainPanel = new JPanel(new BorderLayout()); 81 | mainPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 82 | logArea = new JTextPane(); 83 | JButton copyLog, findNextError; 84 | 85 | copyLog = new JButton("Generate Diagnostics File"); 86 | findNextError = new JButton("Find Next Error"); 87 | 88 | copyLog.addActionListener(new ActionListener() { 89 | 90 | @Override 91 | public void actionPerformed(ActionEvent arg0) { 92 | HelpMenu.copyLogToClipboard(); 93 | } 94 | }); 95 | 96 | findNextError.addActionListener(new ActionListener() { 97 | @Override 98 | public void actionPerformed(ActionEvent e) { 99 | String[] lines = logArea.getText().split("\\n"); 100 | for (int i = caretline; i < lines.length; i++) { 101 | String line = lines[i]; 102 | if (line.startsWith(DebugLogger.ERROR_PREFIX) || line.startsWith(DebugLogger.EN_EXCEPTION_PREFIX)) { 103 | logArea.setCaretPosition(caretpos); 104 | caretpos += line.length(); 105 | caretline++; 106 | break; 107 | } 108 | caretpos += line.length(); 109 | caretline++; 110 | } 111 | } 112 | }); 113 | 114 | JPanel buttonPanel = new JPanel(); 115 | buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS)); 116 | buttonPanel.add(Box.createHorizontalGlue()); 117 | buttonPanel.add(findNextError); 118 | buttonPanel.add(Box.createHorizontalGlue()); 119 | buttonPanel.add(copyLog); 120 | buttonPanel.add(Box.createHorizontalGlue()); 121 | 122 | JScrollPane scrollPane = new JScrollPane(logArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); 123 | mainPanel.add(scrollPane, BorderLayout.CENTER); 124 | mainPanel.add(buttonPanel, BorderLayout.SOUTH); 125 | 126 | add(mainPanel); 127 | pack(); 128 | 129 | //get log 130 | String log = ModManager.debugLogger.getLog(); 131 | Scanner scanner = new Scanner(log); 132 | while (scanner.hasNextLine()) { 133 | String line = scanner.nextLine(); 134 | if (line.startsWith(DebugLogger.ERROR_PREFIX) || line.startsWith(DebugLogger.EN_EXCEPTION_PREFIX)) { 135 | ResourceUtils.appendToPane(logArea, line, Color.RED); 136 | } else { 137 | ResourceUtils.appendToPane(logArea, line, Color.BLACK); 138 | } 139 | } 140 | logArea.setEditable(false); 141 | scanner.close(); 142 | } 143 | } 144 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/NetFrameworkMissingWindow.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager; 2 | 3 | import com.me3tweaks.modmanager.utilities.ResourceUtils; 4 | 5 | import javax.swing.*; 6 | import javax.swing.border.EmptyBorder; 7 | import java.awt.*; 8 | import java.awt.event.ActionEvent; 9 | import java.awt.event.ActionListener; 10 | import java.net.MalformedURLException; 11 | import java.net.URL; 12 | 13 | @SuppressWarnings("serial") 14 | public class NetFrameworkMissingWindow extends JDialog { 15 | JLabel introLabel; 16 | JButton downloadButton; 17 | private static final String netPage = "https://www.microsoft.com/net/download/dotnet-framework-runtime"; 18 | 19 | public NetFrameworkMissingWindow(String text) { 20 | this.setTitle("No usable .NET Framework installed"); 21 | this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); 22 | this.setResizable(false); 23 | this.setModalityType(Dialog.ModalityType.APPLICATION_MODAL); 24 | setupWindow(text); 25 | this.setIconImages(ModManager.ICONS); 26 | this.pack(); 27 | this.setLocationRelativeTo(null); 28 | this.setVisible(true); 29 | } 30 | 31 | private void setupWindow(String text) { 32 | JPanel updatePanel = new JPanel(); 33 | updatePanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 34 | updatePanel.setLayout(new BoxLayout(updatePanel, BoxLayout.Y_AXIS)); 35 | introLabel = new JLabel("
" + text + "
"); 36 | downloadButton = new JButton("Download .NET " + ModManager.MIN_REQUIRED_NET_FRAMEWORK_STR + " from Microsoft"); 37 | downloadButton.addActionListener(new ActionListener() { 38 | 39 | @Override 40 | public void actionPerformed(ActionEvent e) { 41 | try { 42 | ResourceUtils.openWebpage(new URL(netPage)); 43 | } catch (MalformedURLException e1) { 44 | ModManager.debugLogger.writeError("Invalid URL for .NET! This shouldn't happen..."); 45 | } 46 | } 47 | }); 48 | 49 | updatePanel.add(introLabel); 50 | updatePanel.add(Box.createRigidArea(new Dimension(5, 5))); 51 | updatePanel.add(downloadButton); 52 | updatePanel.add(new JLabel("
If you are certain that this is installed, turn off this check in the Actions > Options menu.
")); 53 | this.getContentPane().add(updatePanel); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/help/HelpItemPackage.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.help; 2 | 3 | public class HelpItemPackage { 4 | private String modalTitle; 5 | private String modalMessage; 6 | private String resource; 7 | private String url; 8 | public String getModalTitle() { 9 | return modalTitle; 10 | } 11 | public void setModalTitle(String modalTitle) { 12 | this.modalTitle = modalTitle; 13 | } 14 | public String getModalMessage() { 15 | return modalMessage; 16 | } 17 | public void setModalMessage(String modalMessage) { 18 | this.modalMessage = modalMessage; 19 | } 20 | public String getResource() { 21 | return resource; 22 | } 23 | public void setResource(String resource) { 24 | this.resource = resource; 25 | } 26 | public String getUrl() { 27 | return url; 28 | } 29 | public void setUrl(String url) { 30 | this.url = url; 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/help/ResourceWindowHelpModal.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.help; 2 | 3 | import java.awt.Component; 4 | import java.awt.Dialog; 5 | import java.awt.Dimension; 6 | import java.awt.event.ActionEvent; 7 | import java.awt.event.ActionListener; 8 | import java.awt.image.BufferedImage; 9 | import java.io.File; 10 | import java.io.IOException; 11 | 12 | import javax.imageio.ImageIO; 13 | import javax.swing.BorderFactory; 14 | import javax.swing.Box; 15 | import javax.swing.BoxLayout; 16 | import javax.swing.ImageIcon; 17 | import javax.swing.JButton; 18 | import javax.swing.JDialog; 19 | import javax.swing.JLabel; 20 | import javax.swing.JPanel; 21 | 22 | import com.me3tweaks.modmanager.ModManager; 23 | import com.me3tweaks.modmanager.ModManagerWindow; 24 | 25 | public class ResourceWindowHelpModal extends JDialog { 26 | 27 | public ResourceWindowHelpModal(HelpItemPackage pack) { 28 | super(null, Dialog.ModalityType.APPLICATION_MODAL); 29 | setupWindow(pack); 30 | setLocationRelativeTo(ModManagerWindow.ACTIVE_WINDOW); 31 | setVisible(true); 32 | } 33 | 34 | public void setupWindow(HelpItemPackage pack) { 35 | this.setTitle(pack.getModalTitle()); 36 | this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); 37 | this.setIconImages(ModManager.ICONS); 38 | 39 | JPanel panel = new JPanel(); 40 | panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS)); 41 | JLabel infoLabel = new JLabel("" + pack.getModalMessage() + ""); 42 | infoLabel.setAlignmentX(Component.CENTER_ALIGNMENT); 43 | panel.add(infoLabel); 44 | 45 | BufferedImage wPic; 46 | JLabel wIcon = new JLabel("Additional help item resource located at:\n" + pack.getResource()); 47 | 48 | if (pack.getResource().toLowerCase().endsWith(".jpg") || pack.getResource().toLowerCase().endsWith(".png")) { 49 | try { 50 | wPic = ImageIO.read(new File(pack.getResource())); 51 | wIcon = new JLabel(new ImageIcon(wPic)); 52 | } catch (IOException | NullPointerException e1) { 53 | wIcon = new JLabel("Failed to load image resource"); 54 | ModManager.debugLogger.writeErrorWithException("Failed to load IMAGE!", e1); 55 | } 56 | } 57 | wIcon.setAlignmentX(Component.CENTER_ALIGNMENT); 58 | panel.add(Box.createRigidArea(new Dimension(10, 10))); 59 | panel.add(wIcon); 60 | 61 | JButton ok = new JButton("OK"); 62 | ok.setAlignmentX(Component.CENTER_ALIGNMENT); 63 | ok.addActionListener(new ActionListener() { 64 | 65 | @Override 66 | public void actionPerformed(ActionEvent e) { 67 | dispose(); 68 | } 69 | }); 70 | panel.add(Box.createRigidArea(new Dimension(10, 10))); 71 | panel.add(ok); 72 | panel.setAlignmentX(CENTER_ALIGNMENT); 73 | panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); 74 | this.getContentPane().add(panel); 75 | this.pack(); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/moddesceditor/MDECustomDLC.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.moddesceditor; 2 | 3 | import javax.swing.*; 4 | import java.util.AbstractMap.SimpleEntry; 5 | 6 | public class MDECustomDLC { 7 | 8 | private JButton subtractButton; 9 | private SimpleEntry pair; 10 | private JPanel custDLCLineItem; 11 | 12 | public MDECustomDLC(JPanel custDLCLineItem, JButton subtractButton, SimpleEntry pair) { 13 | this.setSubtractButton(subtractButton); 14 | this.setCustDLCLineItem(custDLCLineItem); 15 | this.setPair(pair); 16 | } 17 | 18 | public JPanel getCustDLCLineItem() { 19 | return custDLCLineItem; 20 | } 21 | 22 | public void setCustDLCLineItem(JPanel custDLCLineItem) { 23 | this.custDLCLineItem = custDLCLineItem; 24 | } 25 | 26 | public SimpleEntry getPair() { 27 | return pair; 28 | } 29 | 30 | public void setPair(SimpleEntry pair) { 31 | this.pair = pair; 32 | } 33 | 34 | public JButton getSubtractButton() { 35 | return subtractButton; 36 | } 37 | 38 | public void setSubtractButton(JButton subtractButton) { 39 | this.subtractButton = subtractButton; 40 | } 41 | } -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/moddesceditor/MDEModFileChooser.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.moddesceditor; 2 | 3 | import com.me3tweaks.modmanager.ModManager; 4 | import com.me3tweaks.modmanager.objects.ModJob; 5 | import org.apache.commons.io.FilenameUtils; 6 | 7 | import javax.swing.*; 8 | import javax.swing.border.EmptyBorder; 9 | import javax.swing.event.ListSelectionEvent; 10 | import javax.swing.event.ListSelectionListener; 11 | import java.awt.*; 12 | import java.awt.event.ActionEvent; 13 | import java.awt.event.ActionListener; 14 | 15 | public class MDEModFileChooser extends JDialog { 16 | public static final int OPTIONTYPE_ADDONLY = 0; 17 | public static final int OPTIONTYPE_SELECTONLY = 1; 18 | 19 | private String selectedFile; 20 | 21 | public String getSelectedFile() { 22 | return selectedFile; 23 | } 24 | 25 | public void setSelectedFile(String selectedFile) { 26 | this.selectedFile = selectedFile; 27 | } 28 | 29 | public MDEModFileChooser(ModDescEditorWindow callingWindow, String currentOption, int optionType, ModJob job) { 30 | setupWindow(callingWindow, currentOption, optionType, job); 31 | setVisible(true); 32 | } 33 | 34 | public void setupWindow(ModDescEditorWindow callingWindow, String currentOption, int optionType, ModJob job) { 35 | DefaultListModel model = new DefaultListModel(); 36 | if (optionType == OPTIONTYPE_SELECTONLY) { 37 | //add files 38 | for (String file : job.getFilesToReplaceTargets()) { 39 | model.addElement(file); 40 | } 41 | } else { 42 | //add files 43 | for (String file : job.getDestFolders()) { 44 | model.addElement("/" + file); 45 | model.addElement("/" + file + "/CookedPCConsole/"); 46 | } 47 | } 48 | } 49 | 50 | public void setupWindowWithModel(ModDescEditorWindow callingWindow, DefaultListModel model, String currentOption, int optionType, ModJob job) { 51 | JPanel contentPanel = new JPanel(new BorderLayout()); 52 | 53 | JList mainFileList = new JList(model); 54 | JScrollPane listScroller = new JScrollPane(mainFileList); 55 | String textForField = currentOption; 56 | if (optionType == OPTIONTYPE_ADDONLY) { 57 | textForField = FilenameUtils.getName(currentOption); 58 | } 59 | JTextField itemField = new JTextField(currentOption == null ? "Select file from the list" : textForField); 60 | 61 | mainFileList.addListSelectionListener(new ListSelectionListener() { 62 | 63 | @Override 64 | public void valueChanged(ListSelectionEvent e) { 65 | // TODO Auto-generated method stub 66 | if (!e.getValueIsAdjusting() && optionType == OPTIONTYPE_SELECTONLY) { 67 | itemField.setText(mainFileList.getSelectedValue()); 68 | } 69 | } 70 | }); 71 | contentPanel.add(listScroller, BorderLayout.CENTER); 72 | 73 | JPanel bottomPanel = new JPanel(new BorderLayout()); 74 | JButton setFile = new JButton("Set File"); 75 | setFile.addActionListener(new ActionListener() { 76 | 77 | @Override 78 | public void actionPerformed(ActionEvent e) { 79 | if (validateFields()) { 80 | selectedFile = itemField.getText(); 81 | dispose(); 82 | } 83 | } 84 | 85 | private boolean validateFields() { 86 | // TODO Auto-generated method stub 87 | return true; 88 | } 89 | }); 90 | JLabel label = new JLabel("Type in a file name to install the extra file to.
Entry will be put into the folder listed above."); 91 | bottomPanel.add(label, BorderLayout.NORTH); 92 | bottomPanel.add(itemField, BorderLayout.CENTER); 93 | bottomPanel.add(setFile, BorderLayout.EAST); 94 | 95 | if (optionType == OPTIONTYPE_SELECTONLY) { 96 | label.setVisible(false); 97 | itemField.setEnabled(false); 98 | } 99 | contentPanel.add(bottomPanel, BorderLayout.SOUTH); 100 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 101 | add(contentPanel); 102 | 103 | setMinimumSize(new Dimension(500, 400)); 104 | setIconImages(ModManager.ICONS); 105 | setTitle(optionType == OPTIONTYPE_SELECTONLY ? "Select in-game modification target" : "Select additional file installation target"); 106 | setModalityType(ModalityType.APPLICATION_MODAL); 107 | pack(); 108 | setLocationRelativeTo(callingWindow); 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/moddesceditor/MDEModFolderChooser.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.moddesceditor; 2 | 3 | import com.me3tweaks.modmanager.ModManager; 4 | import com.me3tweaks.modmanager.objects.ModJob; 5 | 6 | import javax.swing.*; 7 | import javax.swing.border.EmptyBorder; 8 | import java.awt.*; 9 | import java.awt.event.ActionEvent; 10 | import java.awt.event.ActionListener; 11 | 12 | public class MDEModFolderChooser extends JDialog { 13 | private String selectedFolder; 14 | 15 | public String getSelectedFile() { 16 | return selectedFolder; 17 | } 18 | 19 | public void setSelectedFile(String selectedFile) { 20 | this.selectedFolder = selectedFile; 21 | } 22 | 23 | public MDEModFolderChooser(ModDescEditorWindow callingWindow, String currentOption, int optionType, ModJob job) { 24 | setupWindow(callingWindow, currentOption, optionType, job); 25 | setVisible(true); 26 | } 27 | 28 | public void setupWindow(ModDescEditorWindow callingWindow, String currentOption, int optionType, ModJob job) { 29 | JPanel contentPanel = new JPanel(new BorderLayout()); 30 | DefaultListModel model = new DefaultListModel(); 31 | for (String folder : job.getDestFolders()) { 32 | model.addElement(folder); 33 | } 34 | for (MDEConditionalDLCItem conddlc : callingWindow.getConditionalDLCItems()) { 35 | if (conddlc.getOperationBox().getSelectedIndex() == 0) { 36 | model.addElement(conddlc.getDLCDestination()); 37 | } 38 | } 39 | 40 | JList mainFileList = new JList(model); 41 | JScrollPane listScroller = new JScrollPane(mainFileList); 42 | contentPanel.add(listScroller, BorderLayout.CENTER); 43 | 44 | JButton setFile = new JButton("Set File"); 45 | setFile.addActionListener(new ActionListener() { 46 | 47 | @Override 48 | public void actionPerformed(ActionEvent e) { 49 | if (validateFields()) { 50 | selectedFolder = model.get(mainFileList.getSelectedIndex()); 51 | dispose(); 52 | } 53 | } 54 | 55 | private boolean validateFields() { 56 | // TODO Auto-generated method stub 57 | return true; 58 | } 59 | }); 60 | contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 61 | add(contentPanel); 62 | 63 | setMinimumSize(new Dimension(500, 400)); 64 | setIconImages(ModManager.ICONS); 65 | setTitle("Select folder"); 66 | setModalityType(ModalityType.APPLICATION_MODAL); 67 | pack(); 68 | setLocationRelativeTo(callingWindow); 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/moddesceditor/MDEOfficialJobNewFile.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.moddesceditor; 2 | 3 | import org.jdesktop.swingx.JXCollapsiblePane; 4 | 5 | import javax.swing.*; 6 | import java.awt.*; 7 | 8 | public class MDEOfficialJobNewFile { 9 | 10 | private JXCollapsiblePane collapsiblePanel; 11 | 12 | public JXCollapsiblePane getPanel() { 13 | return collapsiblePanel; 14 | } 15 | public MDEOfficialJobNewFile(String sourcefile, String destfile, boolean readOnly) { 16 | setupPanel(sourcefile,destfile,readOnly); 17 | } 18 | 19 | private void setupPanel(String sourcefile, String destfile, boolean readOnly) { 20 | collapsiblePanel = new JXCollapsiblePane(); 21 | JPanel panel = new JPanel(new GridBagLayout()); 22 | collapsiblePanel.add(panel); 23 | 24 | JButton minusButton = new JButton("-"); 25 | GridBagConstraints gridC = new GridBagConstraints(); 26 | gridC.fill = GridBagConstraints.NONE; 27 | gridC.gridx = 0; 28 | gridC.weightx = 0; 29 | panel.add(minusButton, gridC); 30 | 31 | JLabel fileReplaceLabel = new JLabel(sourcefile); 32 | JLabel replacePathLabel = new JLabel(destfile); 33 | 34 | gridC.gridx = 1; 35 | 36 | panel.add(fileReplaceLabel, gridC); 37 | gridC.gridx = 2; 38 | gridC.weightx = 0.5; 39 | 40 | panel.add(replacePathLabel, gridC); 41 | gridC.fill = GridBagConstraints.HORIZONTAL; 42 | 43 | gridC.gridx = 3; 44 | gridC.weightx = 1; 45 | 46 | JCheckBox readOnlyC = new JCheckBox("Read only"); 47 | readOnlyC.setSelected(readOnly); 48 | 49 | panel.add(readOnlyC, gridC); 50 | } 51 | } -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/moddesceditor/MDEOfficialTaskSelector.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.moddesceditor; 2 | 3 | import com.me3tweaks.modmanager.ModManager; 4 | import com.me3tweaks.modmanager.objects.ModTypeConstants; 5 | import org.jdesktop.swingx.HorizontalLayout; 6 | import org.jdesktop.swingx.JXCollapsiblePane; 7 | import org.jdesktop.swingx.VerticalLayout; 8 | 9 | import javax.swing.*; 10 | import javax.swing.border.EmptyBorder; 11 | import java.awt.*; 12 | import java.awt.event.ActionEvent; 13 | import java.awt.event.ActionListener; 14 | import java.util.ArrayList; 15 | import java.util.Arrays; 16 | 17 | public class MDEOfficialTaskSelector extends JDialog { 18 | private final ModDescEditorWindow windowRef; 19 | private int result = -1; 20 | 21 | public MDEOfficialTaskSelector(ModDescEditorWindow windowRef) { 22 | this.windowRef = windowRef; 23 | setupWindow(); 24 | } 25 | 26 | private void setupWindow() { 27 | this.setTitle("Select task header"); 28 | this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); 29 | this.setIconImages(ModManager.ICONS); 30 | this.setModalityType(Dialog.ModalityType.DOCUMENT_MODAL); 31 | this.setMinimumSize(new Dimension(200, 300)); 32 | 33 | ArrayList jobs = windowRef.getOfficialJobs(); 34 | 35 | JPanel chooserPanel = new JPanel(new BorderLayout()); 36 | chooserPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 37 | 38 | String[] headerArray = ModTypeConstants.getDLCHeaderNameArray(); 39 | ArrayList headerList = new ArrayList<>(Arrays.asList(headerArray)); 40 | headerList.add(0,"BASEGAME"); //add basegame header 41 | //check sfar size. 42 | 43 | int i = 0; 44 | // Add and enable/disable DLC checkboxes and add to hashmap 45 | JPanel MPHeadersPanel = new JPanel(new VerticalLayout()); 46 | JPanel SPHeadersPanel = new JPanel(new VerticalLayout()); 47 | for (String dlcName : headerList) { 48 | JCheckBox checkbox = new JCheckBox(dlcName); 49 | checkbox.setVerticalAlignment(SwingConstants.CENTER); 50 | JXCollapsiblePane backupPane = new JXCollapsiblePane(); 51 | backupPane.add(checkbox); 52 | 53 | JButton button = new JButton(dlcName); 54 | 55 | if (i < 9) { 56 | MPHeadersPanel.add(button); 57 | } else { 58 | SPHeadersPanel.add(button); 59 | } 60 | final int y = i; //final for passing into anonymous class 61 | button.addActionListener(new ActionListener() { 62 | @Override 63 | public void actionPerformed(ActionEvent e) { 64 | result = y; 65 | dispose(); 66 | } 67 | }); 68 | for (MDEOfficialJob job : jobs){ 69 | if (job.getRawHeader().equals(dlcName)) { 70 | button.setEnabled(false); 71 | break; 72 | } 73 | } 74 | i++; 75 | } 76 | JPanel listPanel = new JPanel(new HorizontalLayout()); 77 | listPanel.add(MPHeadersPanel); 78 | listPanel.add(SPHeadersPanel); 79 | chooserPanel.add(listPanel, BorderLayout.CENTER); 80 | 81 | JButton chooseButton = new JButton("Cancel adding job"); 82 | chooserPanel.add(chooseButton, BorderLayout.SOUTH); 83 | 84 | add(chooserPanel); 85 | pack(); 86 | setLocationRelativeTo(windowRef); 87 | } 88 | 89 | public int getResult() { 90 | return result; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/moddesceditor/MDEOutdatedCustomDLC.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.moddesceditor; 2 | 3 | import com.me3tweaks.modmanager.ui.HintTextFieldUI; 4 | import org.jdesktop.swingx.HorizontalLayout; 5 | import org.jdesktop.swingx.JXCollapsiblePane; 6 | 7 | import javax.swing.*; 8 | import java.awt.*; 9 | import java.awt.event.ActionEvent; 10 | import java.awt.event.ActionListener; 11 | 12 | public class MDEOutdatedCustomDLC { 13 | private JXCollapsiblePane collapsablePanel; 14 | 15 | public JXCollapsiblePane getPanel() { 16 | return collapsablePanel; 17 | } 18 | 19 | public JTextField getOutdatedDLCNameField() { 20 | return userReasonField; 21 | } 22 | 23 | public void setUserReasonField(JTextField userReasonField) { 24 | this.userReasonField = userReasonField; 25 | } 26 | 27 | private JButton minusButton; 28 | private JTextField userReasonField; 29 | private ModDescEditorWindow owningWindow; 30 | private static int itemSpacing = 5; 31 | 32 | public MDEOutdatedCustomDLC(ModDescEditorWindow owningWindow, String outdatedCustomDLC) { 33 | this.owningWindow = owningWindow; 34 | setupPanel(outdatedCustomDLC); 35 | } 36 | 37 | private void setupPanel(String outdatedCustomDLC) { 38 | collapsablePanel = new JXCollapsiblePane(); 39 | collapsablePanel.setCollapsed(true); 40 | JPanel panel = new JPanel(new HorizontalLayout()); 41 | collapsablePanel.add(panel); 42 | minusButton = new JButton("-"); 43 | panel.add(minusButton); 44 | minusButton.addActionListener(new ActionListener() { 45 | 46 | @Override 47 | public void actionPerformed(ActionEvent e) { 48 | collapsablePanel.setCollapsed(true); 49 | owningWindow.removeOutdatedCustomDLCItem(MDEOutdatedCustomDLC.this); 50 | } 51 | }); 52 | 53 | userReasonField = new JTextField(outdatedCustomDLC); 54 | userReasonField.setUI(new HintTextFieldUI("DLC_MOD_OLDName")); 55 | 56 | userReasonField.setToolTipText("User friendly name. If one is not entered, a automatically generated one is displayed instead."); 57 | userReasonField.setColumns(30); 58 | panel.add(Box.createRigidArea(new Dimension(itemSpacing, itemSpacing))); 59 | panel.add(userReasonField); 60 | collapsablePanel.add(panel); 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/moddesceditor/ModDescEditorDirectoryChooser.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.moddesceditor; 2 | 3 | import com.me3tweaks.modmanager.ModManager; 4 | 5 | import javax.swing.*; 6 | import javax.swing.border.EmptyBorder; 7 | import java.awt.*; 8 | import java.awt.event.MouseAdapter; 9 | import java.awt.event.MouseEvent; 10 | import java.io.File; 11 | import java.util.ArrayList; 12 | 13 | public class ModDescEditorDirectoryChooser extends JDialog { 14 | private File chosenFile; 15 | 16 | public ModDescEditorDirectoryChooser(ArrayList choices) { 17 | setupWindow(choices); 18 | setVisible(true); 19 | } 20 | 21 | private void setupWindow(ArrayList choices) { 22 | this.setTitle("Add Custom DLC Folder for installation"); 23 | this.setDefaultCloseOperation(DISPOSE_ON_CLOSE); 24 | this.setIconImages(ModManager.ICONS); 25 | this.setModalityType(ModalityType.DOCUMENT_MODAL); 26 | this.setMinimumSize(new Dimension(300, 300)); 27 | 28 | DefaultListModel demoList = new DefaultListModel(); 29 | for (File f : choices) { 30 | demoList.addElement(f.getName()); 31 | } 32 | JList choiceList = new JList(demoList); 33 | choiceList.setVisibleRowCount(8); 34 | 35 | choiceList.addMouseListener(new MouseAdapter() { 36 | public void mouseClicked(MouseEvent evt) { 37 | 38 | JList list = (JList) evt.getSource(); 39 | Rectangle r = list.getCellBounds(0, list.getLastVisibleIndex()); 40 | if (r != null && r.contains(evt.getPoint())) { 41 | if (evt.getClickCount() == 2) { 42 | // Double-click detected 43 | int index = list.locationToIndex(evt.getPoint()); 44 | chosenFile = choices.get(index); 45 | dispose(); 46 | } else if (evt.getClickCount() == 3) { 47 | // Triple-click detected 48 | int index = list.locationToIndex(evt.getPoint()); 49 | chosenFile = choices.get(index); 50 | dispose(); 51 | } 52 | } 53 | } 54 | }); 55 | 56 | JPanel chooserPanel = new JPanel(new BorderLayout()); 57 | chooserPanel.setBorder(new EmptyBorder(5, 5, 5, 5)); 58 | chooserPanel.add(choiceList, BorderLayout.CENTER); 59 | 60 | JButton chooseButton = new JButton("Add DLC folder"); 61 | chooserPanel.add(chooseButton, BorderLayout.SOUTH); 62 | 63 | add(chooserPanel); 64 | pack(); 65 | } 66 | 67 | public File getChosenFile() { 68 | return chosenFile; 69 | } 70 | 71 | public void setChosenFile(File chosenFile) { 72 | this.chosenFile = chosenFile; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/modmaker/DynamicPatch.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.modmaker; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.util.UUID; 6 | 7 | import org.apache.commons.io.FileUtils; 8 | import org.w3c.dom.DOMException; 9 | import org.w3c.dom.NamedNodeMap; 10 | import org.w3c.dom.Node; 11 | 12 | import com.me3tweaks.modmanager.ModManager; 13 | import com.me3tweaks.modmanager.objects.Patch; 14 | import com.me3tweaks.modmanager.utilities.datatypeconverter.DatatypeConverter; 15 | 16 | /** 17 | * Patch that can be compiled and applied on the fly 18 | * 19 | * @author mjperez 20 | * 21 | */ 22 | public class DynamicPatch { 23 | Patch finalPatch; 24 | private File outputfile; 25 | 26 | /** 27 | * Creates a dynamic mixin object from a node in modmaker xml 28 | * 29 | * @param dynamicmixinNode 30 | * node to create dynamic patch object from. 31 | * @throws DOMException 32 | * @throws Base64DecodingException 33 | * @throws IOException 34 | */ 35 | public DynamicPatch(Node dynamicmixinNode) throws DOMException, IOException { 36 | NamedNodeMap map = dynamicmixinNode.getAttributes(); 37 | String hexdata = dynamicmixinNode.getTextContent(); 38 | byte[] datatowrite = DatatypeConverter.parseHexBinary(hexdata); 39 | outputfile = new File(ModManager.getTempDir()+"dynamicpatch-"+UUID.randomUUID().toString()+".jsf"); 40 | FileUtils.writeByteArrayToFile(outputfile, datatowrite); 41 | ModManager.debugLogger.writeMessage("Wrote temporary mixin patch: "+outputfile); 42 | finalPatch = new Patch(); 43 | finalPatch.setTargetPath(map.getNamedItem("targetfile").getTextContent()); 44 | finalPatch.setTargetModule(map.getNamedItem("targetmodule").getTextContent()); 45 | finalPatch.setPatchPath(outputfile.getAbsolutePath()); 46 | finalPatch.setValid(true); 47 | finalPatch.setFinalizer(false); 48 | finalPatch.setPatchName(map.getNamedItem("name").getTextContent()); 49 | finalPatch.setPatchDescription("Automatically generated ModMaker MixIn"); 50 | finalPatch.setPatchFolderPath(""); 51 | finalPatch.setTargetSize(Long.parseLong(map.getNamedItem("targetsize").getTextContent())); 52 | finalPatch.setPatchVersion(1); 53 | finalPatch.setPatchCMMVer(ModManager.MODDESC_VERSION_SUPPORT); 54 | finalPatch.setPatchAuthor("ME3Tweaks ModMaker Dynamic MixIn"); 55 | finalPatch.setMe3tweaksid(0); 56 | finalPatch.setIsDynamic(true); 57 | } 58 | 59 | public File getOutputfile() { 60 | return outputfile; 61 | } 62 | 63 | /** 64 | * Returns a mixin defined from a dynamic mixin from me3tweaks modmaker 65 | * @return standard mixin object 66 | */ 67 | public Patch getFinalPatch() { 68 | return finalPatch; 69 | } 70 | 71 | public void setFinalPatch(Patch finalPatch) { 72 | this.finalPatch = finalPatch; 73 | } 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/modmaker/TLKFragment.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.modmaker; 2 | 3 | import org.w3c.dom.Document; 4 | import org.w3c.dom.NodeList; 5 | 6 | public class TLKFragment { 7 | private Document owningDocument; 8 | private NodeList stringsList; 9 | private int index; 10 | private String filepath; 11 | public Document getOwningDocument() { 12 | return owningDocument; 13 | } 14 | public void setOwningDocument(Document owningDocument) { 15 | this.owningDocument = owningDocument; 16 | } 17 | public NodeList getStringsList() { 18 | return stringsList; 19 | } 20 | public void setStringsList(NodeList stringsList) { 21 | this.stringsList = stringsList; 22 | } 23 | public int getIndex() { 24 | return index; 25 | } 26 | public void setIndex(int index) { 27 | this.index = index; 28 | } 29 | public TLKFragment(String filepath, Document owningDocument, NodeList stringsList, int index) { 30 | super(); 31 | this.filepath = filepath; 32 | this.owningDocument = owningDocument; 33 | this.stringsList = stringsList; 34 | this.index = index; 35 | } 36 | public String getFilepath() { 37 | return filepath; 38 | } 39 | public void setFilepath(String filepath) { 40 | this.filepath = filepath; 41 | } 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/modupdater/ManifestModFile.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.modupdater; 2 | 3 | /** 4 | * This object contains info about a entry in the server's manifest 5 | * about a mod 6 | * 7 | * @author mgamerz 8 | * 9 | */ 10 | public class ManifestModFile { 11 | private String relativePath; 12 | private String hash; 13 | private long size; 14 | private String lzmahash; 15 | private long lzmasize; 16 | private boolean sideloadOnly; 17 | 18 | public ManifestModFile(String relativePath, String svrHash, long svrSize, String svrCompressedHash, long svrCompressedSize) { 19 | super(); 20 | this.relativePath = relativePath.replaceAll("\\\\", "/"); 21 | this.hash = svrHash; 22 | this.size = svrSize; 23 | this.lzmahash = svrCompressedHash; 24 | this.lzmasize = svrCompressedSize; 25 | } 26 | 27 | public long getSize() { 28 | return size; 29 | } 30 | 31 | public void setSize(long size) { 32 | this.size = size; 33 | } 34 | 35 | public String getLzmahash() { 36 | return lzmahash; 37 | } 38 | 39 | public void setLzmahash(String lzmahash) { 40 | this.lzmahash = lzmahash; 41 | } 42 | 43 | public long getLzmasize() { 44 | return lzmasize; 45 | } 46 | 47 | public void setLzmasize(long lzmasize) { 48 | this.lzmasize = lzmasize; 49 | } 50 | 51 | public String getRelativePath() { 52 | return relativePath; 53 | } 54 | 55 | public void setRelativePath(String relativePath) { 56 | this.relativePath = relativePath; 57 | } 58 | 59 | public String getHash() { 60 | return hash; 61 | } 62 | 63 | public void setHash(String hash) { 64 | this.hash = hash; 65 | } 66 | 67 | public boolean isSideloadOnly() { 68 | return sideloadOnly; 69 | } 70 | 71 | public void setSideloadOnly(boolean sideloadOnly) { 72 | this.sideloadOnly = sideloadOnly; 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/modupdater/UpdatePackage.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.modupdater; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Comparator; 5 | 6 | import com.me3tweaks.modmanager.objects.Mod; 7 | import com.me3tweaks.modmanager.utilities.ResourceUtils; 8 | 9 | /** 10 | * Contains info about an update that can be executed (downloading new 11 | * files/deleting files) 12 | * 13 | * @author mgamerz 14 | * 15 | */ 16 | public class UpdatePackage { 17 | private ArrayList filesUpToDate; 18 | private ArrayList filesToDownload; 19 | private ArrayList filesToDelete; 20 | private String serverFolderName; 21 | private Mod mod; 22 | private double version; 23 | private boolean modmakerupdate; 24 | private String serverModName; 25 | private boolean requiresSideload = false; 26 | private String sideloadURL; 27 | private String changelog; 28 | 29 | public boolean requiresSideload() { 30 | return requiresSideload; 31 | } 32 | 33 | public void setRequiresSideload(boolean requiresSideload) { 34 | this.requiresSideload = requiresSideload; 35 | } 36 | 37 | public ArrayList getFilesToDownload() { 38 | return filesToDownload; 39 | } 40 | 41 | public ArrayList getFilesToDelete() { 42 | return filesToDelete; 43 | } 44 | 45 | public ArrayList getUpToDateFiles() { 46 | return filesUpToDate; 47 | } 48 | 49 | public String getServerFolderName() { 50 | return serverFolderName; 51 | } 52 | 53 | 54 | /** 55 | * Classic mod constructor for update package 56 | * 57 | * @param mod 58 | * @param version 59 | * Server version 60 | * @param filesToDownload 61 | * @param filesToDelete 62 | * @param serverFolderName 63 | */ 64 | public UpdatePackage(Mod mod, double version, ArrayList filesToDownload, ArrayList filesUpToDate, ArrayList filesToDelete, String serverFolderName,String changelog) { 65 | super(); 66 | this.mod = mod; 67 | this.version = version; 68 | this.filesToDownload = filesToDownload; 69 | this.filesToDelete = filesToDelete; 70 | this.serverFolderName = serverFolderName; 71 | this.modmakerupdate = false; 72 | this.serverModName = mod.getModName(); 73 | this.changelog = changelog; 74 | this.filesUpToDate = filesUpToDate; 75 | } 76 | 77 | /** 78 | * ModMaker update constructor 79 | * 80 | * @param mod 81 | * Mod to update 82 | * @param serverModName 83 | * Foldername where it will be placed (used if removing old 84 | * version) 85 | * @param version 86 | * Server version Server version of mod 87 | */ 88 | public UpdatePackage(Mod mod, String serverModName, double version, String changelog) { 89 | this.mod = mod; 90 | this.version = version; 91 | this.serverModName = serverModName; 92 | this.modmakerupdate = true; 93 | this.changelog = changelog; 94 | } 95 | 96 | public Mod getMod() { 97 | return mod; 98 | } 99 | 100 | public void setMod(Mod mod) { 101 | this.mod = mod; 102 | } 103 | 104 | public double getVersion() { 105 | return version; 106 | } 107 | 108 | public void setVersion(double version) { 109 | this.version = version; 110 | } 111 | 112 | public boolean isModmakerupdate() { 113 | return modmakerupdate; 114 | } 115 | 116 | public String getServerModName() { 117 | return serverModName; 118 | } 119 | 120 | public void sortByLargestFirst() { 121 | //Sort by uncompressed size. Theoretically a larger uncompressed file with compress to a larger compressed file. 122 | filesToDownload.sort(new Comparator() { 123 | 124 | @Override 125 | public int compare(ManifestModFile o1, ManifestModFile o2) { 126 | if (o1.getSize() > o2.getSize()) { 127 | return -1; 128 | } 129 | if (o1.getSize() < o2.getSize()) { 130 | return 1; 131 | } else 132 | return 0; 133 | } 134 | }); 135 | } 136 | 137 | public String getUpdateSizeMB() { 138 | long size = 0; 139 | for (ManifestModFile mf : filesToDownload) { 140 | //use LZMA if it exists on the server. 141 | long addSize = mf.getLzmasize() > 0 ? mf.getLzmasize() : mf.getSize(); 142 | //System.out.println("Update file " + mf.getRelativePath() + " is " + addSize + " bytes, using the " 143 | // + (mf.getLzmasize() > 0 ? "LZMA" : "DECOMPRESSED") + " download method. Current update size is " + (size + addSize) + " (" 144 | // + ResourceUtils.humanReadableByteCount(size + addSize, true) + ")"); 145 | size += addSize; 146 | } 147 | return ResourceUtils.humanReadableByteCount(size, true); 148 | } 149 | 150 | public void setSideloadURL(String sideloadURL) { 151 | this.sideloadURL = sideloadURL; 152 | } 153 | 154 | public String getSideloadURL() { 155 | return sideloadURL; 156 | } 157 | 158 | public String getChangeLog() { 159 | return changelog; 160 | } 161 | 162 | } 163 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/ASIMod.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import javax.xml.xpath.XPath; 7 | import javax.xml.xpath.XPathExpressionException; 8 | import javax.xml.xpath.XPathFactory; 9 | 10 | import org.apache.http.NameValuePair; 11 | import org.apache.http.client.utils.URIBuilder; 12 | import org.apache.http.message.BasicNameValuePair; 13 | import org.w3c.dom.Element; 14 | 15 | import com.me3tweaks.modmanager.ModManager; 16 | 17 | /** 18 | * Represents an ASI mod from the manifest 19 | * 20 | * @author Mgamerz 21 | * 22 | */ 23 | public class ASIMod implements Comparable { 24 | @Override 25 | public String toString() { 26 | return name; 27 | } 28 | 29 | private String name, installName, author, description; 30 | private String downloadURL, hash, sourceCode; 31 | private double version = 0; 32 | private static XPath xpath = XPathFactory.newInstance().newXPath(); 33 | 34 | public ASIMod(Element modVer, int updategroup) throws XPathExpressionException { 35 | name = xpath.evaluate("name", modVer); 36 | installName = xpath.evaluate("installedname", modVer); 37 | author = xpath.evaluate("author", modVer); 38 | description = xpath.evaluate("description", modVer); 39 | hash = xpath.evaluate("hash", modVer); 40 | sourceCode = xpath.evaluate("sourcecode", modVer); 41 | String strversion = xpath.evaluate("version", modVer); 42 | version = Double.parseDouble(strversion); 43 | 44 | List params = new ArrayList(2); 45 | params.add(new BasicNameValuePair("updategroup", Integer.toString(updategroup))); 46 | params.add(new BasicNameValuePair("version", Double.toString(version))); 47 | try { 48 | URIBuilder urib = new URIBuilder("https://me3tweaks.com/mods/asi/getasi"); 49 | urib.setParameters(params); 50 | downloadURL = urib.build().toString(); 51 | } catch (Exception e) { 52 | ModManager.debugLogger.writeErrorWithException("Failed to create the download link for this ASI! User will be unable to download it: "+name,e); 53 | } 54 | } 55 | 56 | public String getName() { 57 | return name; 58 | } 59 | 60 | public String getInstallName() { 61 | return installName; 62 | } 63 | 64 | public String getAuthor() { 65 | return author; 66 | } 67 | 68 | public String getDescription() { 69 | return description; 70 | } 71 | 72 | public String getDownloadURL() { 73 | return downloadURL; 74 | } 75 | 76 | public String getHash() { 77 | return hash; 78 | } 79 | 80 | public String getSourceCode() { 81 | return sourceCode; 82 | } 83 | 84 | public double getVersion() { 85 | return version; 86 | } 87 | 88 | @Override 89 | public int compareTo(ASIMod other) { 90 | if (version > other.getVersion()) 91 | return -1; 92 | if (version < other.getVersion()) 93 | return 1; 94 | return 0; 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/ASIUpdateGroup.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | 6 | public class ASIUpdateGroup { 7 | private int groupID; 8 | private ArrayList modVersions; 9 | public ASIUpdateGroup(int groupID) { 10 | super(); 11 | this.groupID = groupID; 12 | modVersions = new ArrayList<>(); 13 | } 14 | public int getGroupID() { 15 | return groupID; 16 | } 17 | public void setGroupID(int groupID) { 18 | this.groupID = groupID; 19 | } 20 | public ArrayList getModVersions() { 21 | return modVersions; 22 | } 23 | public void setModVersions(ArrayList modVersion) { 24 | this.modVersions = modVersion; 25 | } 26 | public void addVersion(ASIMod mod) { 27 | modVersions.add(mod); 28 | } 29 | 30 | /** 31 | * Sorts modVersions arraylist from highest to lowest 32 | */ 33 | public void sortVersions() { 34 | Collections.sort(modVersions); 35 | } 36 | public boolean containsModWithHash(String hash) { 37 | for (ASIMod mod : getModVersions()) { 38 | if (mod.getHash().equals(hash)) { 39 | return true; 40 | } 41 | } 42 | return false; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/CompressedMod.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class CompressedMod { 6 | 7 | public int fileIndexInArchive; 8 | public Mod modDescMod; // this will fail to be valid because the files are not decompressed yet. 9 | public String modName, modDescription; 10 | public long filesize = 0; 11 | private String unofficialModDescString; 12 | private String customDLCFolderName = ""; 13 | 14 | public String getCachedServerDesc() { 15 | return cachedServerDesc; 16 | } 17 | 18 | public void setCachedServerDesc(String cachedServerDesc) { 19 | this.cachedServerDesc = cachedServerDesc; 20 | } 21 | 22 | private String cachedServerDesc; 23 | 24 | public String getCustomDLCFolderName() { 25 | return customDLCFolderName; 26 | } 27 | 28 | public void setCustomDLCFolderName(String customDLCFolderName) { 29 | this.customDLCFolderName = customDLCFolderName; 30 | } 31 | 32 | public void setFullyUnofficial(boolean fullyUnofficial) { 33 | this.fullyUnofficial = fullyUnofficial; 34 | } 35 | 36 | public String getUnofficialModDescString() { 37 | return unofficialModDescString; 38 | } 39 | 40 | public void setUnofficialModDescString(String unofficialModDescString) { 41 | this.unofficialModDescString = unofficialModDescString; 42 | } 43 | 44 | public ArrayList fileList = new ArrayList<>(); 45 | private String descLocationInArchive; 46 | private String manifestLocationInArchive; 47 | private boolean isOfficiallySupported = false; 48 | private String unofficialImportRoot; 49 | private boolean fullyUnofficial; 50 | 51 | public boolean isOfficiallySupported() { 52 | return isOfficiallySupported; 53 | } 54 | 55 | public void setOfficiallySupported(boolean isOfficiallySupported) { 56 | this.isOfficiallySupported = isOfficiallySupported; 57 | } 58 | 59 | public String getManifestLocationInArchive() { 60 | return manifestLocationInArchive; 61 | } 62 | 63 | public void setManifestLocationInArchive(String manifestLocationInArchive) { 64 | this.manifestLocationInArchive = manifestLocationInArchive; 65 | } 66 | 67 | public long getFilesize() { 68 | return filesize; 69 | } 70 | 71 | public void setFilesize(long filesize) { 72 | this.filesize = filesize; 73 | } 74 | 75 | public ArrayList getFileList() { 76 | return fileList; 77 | } 78 | 79 | public void setFileList(ArrayList fileList) { 80 | this.fileList = fileList; 81 | } 82 | 83 | public int getFileIndexInArchive() { 84 | return fileIndexInArchive; 85 | } 86 | 87 | public void setFileIndexInArchive(int fileIndexInArchive) { 88 | this.fileIndexInArchive = fileIndexInArchive; 89 | } 90 | 91 | public Mod getModDescMod() { 92 | return modDescMod; 93 | } 94 | 95 | public void setModDescMod(Mod modDescMod) { 96 | this.modDescMod = modDescMod; 97 | } 98 | 99 | public String getModName() { 100 | return modName; 101 | } 102 | 103 | public void setModName(String modName) { 104 | this.modName = modName; 105 | } 106 | 107 | public String getModDescription() { 108 | return modDescription; 109 | } 110 | 111 | public void setModDescription(String modDescription) { 112 | this.modDescription = modDescription; 113 | } 114 | 115 | public void setDescLocationInArchive(String descLocaitonInArchive) { 116 | this.descLocationInArchive = descLocaitonInArchive; 117 | } 118 | 119 | public String getDescLocationInArchive() { 120 | return descLocationInArchive; 121 | } 122 | 123 | public void setUnofficialImportRoot(String str) { 124 | this.unofficialImportRoot = str; 125 | } 126 | 127 | public String getUnofficialImportRoot() { 128 | return unofficialImportRoot; 129 | } 130 | 131 | public void setFullyUnofficial() { 132 | fullyUnofficial = true; 133 | } 134 | 135 | public boolean isFullyUnofficial() { 136 | return fullyUnofficial; 137 | } 138 | 139 | @Override 140 | public String toString() { 141 | return getModName(); 142 | } 143 | 144 | } 145 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/CustomDLC.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.util.Arrays; 4 | 5 | import com.me3tweaks.modmanager.ModManager; 6 | 7 | public class CustomDLC implements Comparable { 8 | @Override 9 | public String toString() { 10 | return dlcName; 11 | } 12 | 13 | private MountFile mountFile; 14 | private String dlcName; 15 | 16 | public CustomDLC(MountFile mountFile, String dlcName) { 17 | super(); 18 | this.mountFile = mountFile; 19 | this.dlcName = dlcName; 20 | } 21 | 22 | public MountFile getMountFile() { 23 | return mountFile; 24 | } 25 | 26 | public void setMountFile(MountFile mountFile) { 27 | this.mountFile = mountFile; 28 | } 29 | 30 | public String getDlcName() { 31 | return dlcName; 32 | } 33 | 34 | public void setDlcName(String dlcName) { 35 | this.dlcName = dlcName; 36 | } 37 | 38 | @Override 39 | public int compareTo(CustomDLC o) { 40 | return new Integer(mountFile.getMountPriority()).compareTo(o.getMountFile().getMountPriority()); 41 | } 42 | 43 | public boolean isGUIMod() { 44 | return Arrays.asList(ModManager.KNOWN_GUI_CUSTOMDLC_MODS).contains(dlcName); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/HelpMenuItem.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.awt.event.ActionEvent; 4 | import java.awt.event.ActionListener; 5 | import java.net.MalformedURLException; 6 | import java.net.URL; 7 | 8 | import javax.swing.JLabel; 9 | import javax.swing.JMenuItem; 10 | import javax.swing.JOptionPane; 11 | 12 | import com.me3tweaks.modmanager.ModManagerWindow; 13 | import com.me3tweaks.modmanager.utilities.ResourceUtils; 14 | 15 | public class HelpMenuItem { 16 | private String menuItemTitle; 17 | private String tooltipText; 18 | private String url; 19 | private String popupText; 20 | private String popupTitle; 21 | private JLabel picture; 22 | private int messageType; 23 | 24 | public HelpMenuItem(String menuItemTitle, String popupTitle, String popupText) { 25 | this.menuItemTitle = menuItemTitle; 26 | this.popupTitle = popupTitle; 27 | this.popupText = popupText; 28 | this.messageType = JOptionPane.INFORMATION_MESSAGE; 29 | } 30 | 31 | public HelpMenuItem(String menuItemTitle, String popupTitle, String popupText, JLabel picture) { 32 | this.menuItemTitle = menuItemTitle; 33 | this.popupTitle = popupTitle; 34 | this.popupText = popupText; 35 | this.picture = picture; 36 | this.messageType = JOptionPane.INFORMATION_MESSAGE; } 37 | 38 | public JMenuItem createMenuItem() { 39 | JMenuItem item = new JMenuItem(menuItemTitle); 40 | if (tooltipText != null) { 41 | item.setToolTipText(tooltipText); 42 | } 43 | 44 | item.addActionListener(new ActionListener() { 45 | 46 | @Override 47 | public void actionPerformed(ActionEvent e) { 48 | if (url != null) { 49 | try { 50 | ResourceUtils.openWebpage(new URL(url)); 51 | } catch (MalformedURLException e1) { 52 | // TODO Auto-generated catch block 53 | e1.printStackTrace(); 54 | } 55 | } else { 56 | JOptionPane.showMessageDialog(ModManagerWindow.ACTIVE_WINDOW, "
" + popupText + "
", 57 | popupTitle, messageType); 58 | } 59 | } 60 | }); 61 | 62 | return item; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/InstalledASIMod.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.io.File; 4 | 5 | import org.apache.commons.io.FileUtils; 6 | 7 | import com.me3tweaks.modmanager.ModManager; 8 | 9 | public class InstalledASIMod { 10 | @Override 11 | public String toString() { 12 | return filename; 13 | } 14 | 15 | public String toLogString() { 16 | return "InstalledASIMod [installedPath=" + installedPath + ", filename=" + filename + ", hash=" + hash + "]"; 17 | } 18 | 19 | private String installedPath, filename, hash; 20 | 21 | public String getInstalledPath() { 22 | return installedPath; 23 | } 24 | 25 | public void setInstalledPath(String installedPath) { 26 | this.installedPath = installedPath; 27 | } 28 | 29 | public String getFilename() { 30 | return filename; 31 | } 32 | 33 | public void setFilename(String filename) { 34 | this.filename = filename; 35 | } 36 | 37 | public String getHash() { 38 | return hash; 39 | } 40 | 41 | public void setHash(String hash) { 42 | this.hash = hash; 43 | } 44 | 45 | public void deleteMod() { 46 | FileUtils.deleteQuietly(new File(installedPath)); 47 | ModManager.debugLogger.writeMessage("Installed mod deleted "+installedPath); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/ME3TweaksPatchPackage.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | public class ME3TweaksPatchPackage { 4 | private String patchname, patchdesc, patchdev, targetmodule, targetfile, patchurl, folder; 5 | private boolean finalizer; 6 | private long targetsize; 7 | private double patchver, targetversion; 8 | private int me3tweaksid; 9 | public String getPatchname() { 10 | return patchname; 11 | } 12 | public void setPatchname(String patchname) { 13 | this.patchname = patchname; 14 | } 15 | public String getPatchdesc() { 16 | return patchdesc; 17 | } 18 | public void setPatchdesc(String patchdesc) { 19 | this.patchdesc = patchdesc; 20 | } 21 | public String getPatchdev() { 22 | return patchdev; 23 | } 24 | public void setPatchdev(String patchdev) { 25 | this.patchdev = patchdev; 26 | } 27 | public String getTargetmodule() { 28 | return targetmodule; 29 | } 30 | public void setTargetmodule(String targetmodule) { 31 | this.targetmodule = targetmodule; 32 | } 33 | public String getTargetfile() { 34 | return targetfile; 35 | } 36 | public void setTargetfile(String targetfile) { 37 | this.targetfile = targetfile; 38 | } 39 | public String getPatchurl() { 40 | return patchurl; 41 | } 42 | public void setPatchurl(String patchurl) { 43 | this.patchurl = patchurl; 44 | } 45 | public String getFolder() { 46 | return folder; 47 | } 48 | public void setFolder(String folder) { 49 | this.folder = folder; 50 | } 51 | public boolean isFinalizer() { 52 | return finalizer; 53 | } 54 | public void setFinalizer(boolean finalizer) { 55 | this.finalizer = finalizer; 56 | } 57 | public long getTargetsize() { 58 | return targetsize; 59 | } 60 | public void setTargetsize(long targetsize) { 61 | this.targetsize = targetsize; 62 | } 63 | public double getPatchver() { 64 | return patchver; 65 | } 66 | public void setPatchver(double patchver) { 67 | this.patchver = patchver; 68 | } 69 | public double getTargetversion() { 70 | return targetversion; 71 | } 72 | public void setTargetversion(double targetversion) { 73 | this.targetversion = targetversion; 74 | } 75 | public int getMe3tweaksid() { 76 | return me3tweaksid; 77 | } 78 | public void setMe3tweaksid(int me3tweaksid) { 79 | this.me3tweaksid = me3tweaksid; 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/MainUIBackgroundJob.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | public class MainUIBackgroundJob { 4 | private String uiText; 5 | private String taskName; 6 | 7 | public MainUIBackgroundJob(String taskname, String uiText) { 8 | this.taskName = taskname; 9 | this.uiText = uiText; 10 | } 11 | 12 | @Override 13 | public int hashCode() { 14 | final int prime = 31; 15 | int result = 1; 16 | result = prime * result + ((taskName == null) ? 0 : taskName.hashCode()); 17 | return result; 18 | } 19 | 20 | @Override 21 | public boolean equals(Object obj) { 22 | if (this == obj) 23 | return true; 24 | if (obj == null) 25 | return false; 26 | if (getClass() != obj.getClass()) 27 | return false; 28 | MainUIBackgroundJob other = (MainUIBackgroundJob) obj; 29 | return hashCode() == other.hashCode(); 30 | } 31 | 32 | public String getTaskName() { 33 | return taskName; 34 | } 35 | public String getUIText() { 36 | return uiText; 37 | } 38 | 39 | 40 | public MainUIBackgroundJob(String taskName) { 41 | this.taskName = taskName; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/MergeModFile.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | public class MergeModFile { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/MetaCMM.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.File; 5 | import java.io.FileNotFoundException; 6 | import java.io.FileReader; 7 | import java.io.IOException; 8 | import java.nio.charset.StandardCharsets; 9 | 10 | import org.apache.commons.io.FileUtils; 11 | 12 | import com.me3tweaks.modmanager.ModManager; 13 | 14 | public class MetaCMM { 15 | 16 | private String installationGUID = ""; 17 | private String installedByModManagerBuild; 18 | private String modVersion; 19 | private String modName; 20 | 21 | public MetaCMM(File metacmmfile) { 22 | if (metacmmfile.exists()) { 23 | try (BufferedReader br = new BufferedReader(new FileReader(metacmmfile))) { 24 | String line; 25 | if ((line = br.readLine()) != null) { 26 | //Name of installed mod, or name + version if old mod manager versions 27 | modName = line; 28 | } 29 | 30 | if ((line = br.readLine()) != null) { 31 | //Name of installed mod, or name + version if old mod manager versions 32 | modVersion = line; 33 | } 34 | 35 | if ((line = br.readLine()) != null) { 36 | //Name of installed mod, or name + version if old mod manager versions 37 | installedByModManagerBuild = line; 38 | } 39 | 40 | if ((line = br.readLine()) != null) { 41 | //Name of installed mod, or name + version if old mod manager versions 42 | installationGUID = line; 43 | } 44 | 45 | } catch (FileNotFoundException e) { 46 | modName= "_metacmm.txt not found"; 47 | } catch (IOException e) { 48 | modName= "Could not read _metacmm.txt"; 49 | 50 | } 51 | } 52 | } 53 | 54 | public String getInstallationGUID() { 55 | return installationGUID; 56 | } 57 | 58 | public String getInstalledByModManagerBuild() { 59 | return installedByModManagerBuild; 60 | } 61 | 62 | public String getModVersion() { 63 | return modVersion; 64 | } 65 | 66 | public String getModName() { 67 | return modName; 68 | } 69 | 70 | public String getDisplayString() { 71 | return modName + (modVersion != null ? " " + modVersion : ""); 72 | } 73 | 74 | public static void writeMetaCMMFile(Mod mod, String destination) { 75 | try { 76 | ModManager.debugLogger.writeMessage("[METACMM]Writing custom DLC metadata file: " + destination); 77 | String metadatatext = mod.getModName(); 78 | metadatatext += "\n"+mod.getVersion(); 79 | metadatatext += "\n"+ModManager.BUILD_NUMBER; 80 | metadatatext += "\n"+ModManager.getGUID(); 81 | 82 | FileUtils.writeStringToFile(new File(destination), metadatatext, StandardCharsets.UTF_8); 83 | } catch (IOException e) { 84 | ModManager.debugLogger.writeErrorWithException("[METACMM]Couldn't write custom dlc metadata file:", e); 85 | } 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/ModDelta.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.io.ByteArrayInputStream; 4 | import java.io.File; 5 | import java.io.IOException; 6 | import java.nio.charset.StandardCharsets; 7 | 8 | import javax.xml.parsers.DocumentBuilder; 9 | import javax.xml.parsers.DocumentBuilderFactory; 10 | import javax.xml.parsers.ParserConfigurationException; 11 | import javax.xml.xpath.XPath; 12 | import javax.xml.xpath.XPathConstants; 13 | import javax.xml.xpath.XPathExpressionException; 14 | import javax.xml.xpath.XPathFactory; 15 | 16 | import org.apache.commons.io.FileUtils; 17 | import org.w3c.dom.Document; 18 | import org.w3c.dom.Element; 19 | import org.w3c.dom.NodeList; 20 | import org.xml.sax.InputSource; 21 | import org.xml.sax.SAXException; 22 | 23 | import com.me3tweaks.modmanager.ModManager; 24 | 25 | /** 26 | * Mod Delta describes a change that can be performed on the original mods files 27 | * to make a slight variant. They make use of deltas like ModMaker 28 | * 29 | * @author mgamerz 30 | * 31 | */ 32 | public class ModDelta { 33 | private String deltaFilepath; 34 | private String deltaDescription; 35 | private String deltaName; 36 | private boolean validDelta; 37 | 38 | private DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); 39 | private DocumentBuilder dBuilder; 40 | private Document doc; 41 | 42 | public ModDelta(String file) { 43 | this.deltaFilepath = file; 44 | preprocessDelta(file); 45 | } 46 | 47 | /** 48 | * Copy constructor 49 | * 50 | * @param delta 51 | * Delta to copy 52 | */ 53 | public ModDelta(ModDelta delta) { 54 | deltaFilepath = delta.deltaFilepath; 55 | deltaDescription = delta.deltaDescription; 56 | deltaName = delta.deltaName; 57 | validDelta = delta.validDelta; 58 | 59 | //can't clone without lots of work 60 | dbFactory = delta.dbFactory; 61 | dBuilder = delta.dBuilder; 62 | doc = delta.doc; 63 | } 64 | 65 | /** 66 | * Generates metadata information about mod. Gets name, description, files 67 | * modified etc 68 | * 69 | * @param file 70 | * path to delta xml. 71 | */ 72 | private void preprocessDelta(String file) { 73 | File deltaFile = new File(file); 74 | if (!deltaFile.exists()) { 75 | ModManager.debugLogger.writeError("Delta file does not exist: " + file); 76 | validDelta = false; 77 | return; 78 | } 79 | ModManager.debugLogger.writeMessageConditionally("Loading delta: " + file, ModManager.LOG_MOD_INIT); 80 | String deltaText; 81 | try { 82 | deltaText = FileUtils.readFileToString(new File(file), StandardCharsets.UTF_8); 83 | } catch (IOException e1) { 84 | validDelta = false; 85 | ModManager.debugLogger.writeErrorWithException("Delta could not be read from the filesystem.", e1); 86 | return; 87 | } 88 | 89 | try { 90 | dBuilder = dbFactory.newDocumentBuilder(); 91 | doc = dBuilder.parse(new InputSource(new ByteArrayInputStream(deltaText.getBytes("utf-8")))); 92 | } catch (SAXException | IOException e1) { 93 | validDelta = false; 94 | ModManager.debugLogger.writeErrorWithException("Delta could not be read from the filesystem.", e1); 95 | return; 96 | } //http://stackoverflow.com/questions/1706493/java-net-malformedurlexception-no-protocol 97 | catch (ParserConfigurationException e) { 98 | validDelta = false; 99 | ModManager.debugLogger.writeErrorWithException("Parser configuration exception... why :(", e); 100 | return; 101 | } 102 | doc.getDocumentElement().normalize(); 103 | 104 | //XPath to get name and description 105 | XPath xPath = XPathFactory.newInstance().newXPath(); 106 | try { 107 | deltaName = xPath.evaluate("/ModDelta/DeltaInfo/Name", doc.getDocumentElement()); 108 | deltaDescription = xPath.evaluate("/ModDelta/DeltaInfo/Description", doc.getDocumentElement()); 109 | } catch (XPathExpressionException e1) { 110 | validDelta = false; 111 | ModManager.debugLogger.writeErrorWithException("DeltaInfo paths were not found: /ModDelta/DeltaInfo requires a NAME and DESCRIPTION element.", e1); 112 | return; 113 | } 114 | 115 | if (deltaName.toLowerCase().equals("original")) { 116 | validDelta = false; 117 | ModManager.debugLogger.writeError("A delta cannot use the name \"Original\". This delta is being marked as invalid"); 118 | } else { 119 | validDelta = true; 120 | } 121 | } 122 | 123 | public Document getDoc() { 124 | return doc; 125 | } 126 | 127 | public void parseDelta() { 128 | 129 | } 130 | 131 | @Override 132 | public String toString() { 133 | return "ModDelta [deltaFilepath=" + deltaFilepath + ", deltaDescription=" + deltaDescription + ", deltaName=" + deltaName + ", validDelta=" + validDelta + "]"; 134 | } 135 | 136 | public String getDeltaFilepath() { 137 | return deltaFilepath; 138 | } 139 | 140 | public void setDeltaFilepath(String deltaFilepath) { 141 | this.deltaFilepath = deltaFilepath; 142 | } 143 | 144 | public String getDeltaDescription() { 145 | return deltaDescription; 146 | } 147 | 148 | public void setDeltaDescription(String deltaDescription) { 149 | this.deltaDescription = deltaDescription; 150 | } 151 | 152 | public String getDeltaName() { 153 | return deltaName; 154 | } 155 | 156 | public void setDeltaName(String deltaName) { 157 | this.deltaName = deltaName; 158 | } 159 | 160 | public boolean isValidDelta() { 161 | return validDelta; 162 | } 163 | 164 | public void setValidDelta(boolean validDelta) { 165 | this.validDelta = validDelta; 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/ModGroup.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.File; 5 | import java.io.FileNotFoundException; 6 | import java.io.FileReader; 7 | import java.io.IOException; 8 | import java.util.ArrayList; 9 | 10 | import com.me3tweaks.modmanager.ModManager; 11 | import com.me3tweaks.modmanager.utilities.ResourceUtils; 12 | 13 | /** 14 | * A modgroup is a list of moddesc files that can all be installed at the same 15 | * time in batch mode. 16 | * 17 | * @author Mgamerz 18 | * 19 | */ 20 | public class ModGroup { 21 | @Override 22 | public String toString() { 23 | return modGroupName; 24 | } 25 | 26 | private ArrayList descPaths; 27 | private String modGroupName; 28 | private String modGroupDescription; 29 | private String loadFilePath; 30 | 31 | /** 32 | * Used for loading an existing modgroup file. 33 | * 34 | * @param modgroupFilePath 35 | * Path to a modgroup file. 36 | */ 37 | public ModGroup(String modgroupFilePath) { 38 | loadFilePath = modgroupFilePath; 39 | File file = new File(modgroupFilePath); 40 | if (file.exists()) { 41 | //parse 42 | try (BufferedReader br = new BufferedReader(new FileReader(file))) { 43 | modGroupName = br.readLine(); 44 | modGroupDescription = br.readLine(); 45 | if (modGroupDescription!= null) { 46 | modGroupDescription = ResourceUtils.convertBrToNewline(modGroupDescription); 47 | } 48 | descPaths = new ArrayList<>(); 49 | String line; 50 | while ((line = br.readLine()) != null) { 51 | // process the line. 52 | if (new File(ModManager.getModsDir() + line).exists()) { 53 | descPaths.add(line); 54 | } 55 | } 56 | } catch (FileNotFoundException e) { 57 | //This won't happen 58 | } catch (IOException e) { 59 | ModManager.debugLogger.writeErrorWithException("Error reading modgroup file:", e); 60 | } 61 | } 62 | } 63 | 64 | public String getLoadFilePath() { 65 | return loadFilePath; 66 | } 67 | 68 | public ArrayList getDescPaths() { 69 | return descPaths; 70 | } 71 | 72 | public String getModGroupName() { 73 | return modGroupName; 74 | } 75 | 76 | public String getModGroupDescription() { 77 | return modGroupDescription; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/ModList.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * Contains list of valid and invalid mods 7 | * 8 | * @author mgamerz 9 | * 10 | */ 11 | public class ModList { 12 | private ArrayList validMods; 13 | private ArrayList invalidMods; 14 | 15 | public ModList(ArrayList validMods, ArrayList invalidMods) { 16 | super(); 17 | this.validMods = validMods; 18 | this.invalidMods = invalidMods; 19 | } 20 | 21 | public ArrayList getValidMods() { 22 | return validMods; 23 | } 24 | 25 | public void setValidMods(ArrayList validMods) { 26 | this.validMods = validMods; 27 | } 28 | 29 | public ArrayList getInvalidMods() { 30 | return invalidMods; 31 | } 32 | 33 | public void setInvalidMods(ArrayList invalidMods) { 34 | this.invalidMods = invalidMods; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/ModuleDelta.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | public class ModuleDelta { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/MountFile.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.nio.ByteBuffer; 6 | import java.nio.file.Files; 7 | import java.nio.file.Path; 8 | import java.nio.file.Paths; 9 | 10 | import com.me3tweaks.modmanager.ModManager; 11 | import com.me3tweaks.modmanager.MountFileEditorWindow; 12 | 13 | public class MountFile implements Comparable { 14 | @Override 15 | public String toString() { 16 | return "MountFile [filepath=" + filepath + ", tlkId1=" + tlkId1 + ", tlkId2=" + tlkId2 + ", mountFlag=" + mountFlag + ", mountPriority=" + mountPriority + "]"; 17 | } 18 | 19 | private static int PRIORITY_OFFSET = 16; 20 | private static int MPSPFLAG_OFFSET = 24; 21 | private static int TLKOFFSET_1 = 28; 22 | private static int TLKOFFSET_2 = 32; 23 | private static final int MOUNTDLC_LENGTH = 108; 24 | private String associatedModName, associatedDLCName; 25 | public String getAssociatedModName() { 26 | if (associatedModName == null) { 27 | return "Unknown"; 28 | } 29 | return associatedModName; 30 | } 31 | 32 | public void setAssociatedModName(String associatedModName) { 33 | this.associatedModName = associatedModName; 34 | } 35 | 36 | public String getAssociatedDLCName() { 37 | if (associatedDLCName == null) { 38 | return "Unknown"; 39 | } 40 | return associatedDLCName; 41 | } 42 | 43 | public String getReason() { 44 | return reason; 45 | } 46 | 47 | public void setReason(String reason) { 48 | this.reason = reason; 49 | } 50 | 51 | public String getMountName() { 52 | return mountName; 53 | } 54 | 55 | public void setMountName(String mountName) { 56 | this.mountName = mountName; 57 | } 58 | 59 | public void setAssociatedDLCName(String associatedDLCName) { 60 | this.associatedDLCName = associatedDLCName; 61 | } 62 | 63 | private String filepath; 64 | private int tlkId1, tlkId2; 65 | private byte mountFlag; 66 | private int mountPriority; 67 | private boolean matchingTLKIds = true; 68 | private boolean correctSize = true; 69 | private boolean validMount = true; 70 | private String reason; 71 | private String mountName; 72 | 73 | public String getFilepath() { 74 | return filepath; 75 | } 76 | 77 | public void setFilepath(String filepath) { 78 | this.filepath = filepath; 79 | } 80 | 81 | public int getTlkId1() { 82 | return tlkId1; 83 | } 84 | 85 | public void setTlkId1(int tlkId1) { 86 | this.tlkId1 = tlkId1; 87 | } 88 | 89 | public int getTlkId2() { 90 | return tlkId2; 91 | } 92 | 93 | public void setTlkId2(int tlkId2) { 94 | this.tlkId2 = tlkId2; 95 | } 96 | 97 | public byte getMountFlag() { 98 | return mountFlag; 99 | } 100 | 101 | public void setMountFlag(byte mountFlag) { 102 | this.mountFlag = mountFlag; 103 | } 104 | 105 | public int getMountPriority() { 106 | return mountPriority; 107 | } 108 | 109 | public void setMountPriority(int mountPriority) { 110 | this.mountPriority = mountPriority; 111 | } 112 | 113 | public boolean isMatchingTLKIds() { 114 | return matchingTLKIds; 115 | } 116 | 117 | public void setMatchingTLKIds(boolean matchingTLKIds) { 118 | this.matchingTLKIds = matchingTLKIds; 119 | } 120 | 121 | public boolean isValidMount() { 122 | return validMount; 123 | } 124 | 125 | public void setValidMount(boolean validMount) { 126 | this.validMount = validMount; 127 | } 128 | 129 | /** 130 | * Loads Mountfile properties from an existing mount file 131 | * @param path mount file to load 132 | */ 133 | public MountFile(String path) { 134 | if (!(new File(path).exists())) { 135 | return; 136 | } 137 | this.filepath = path; 138 | Path fpath = Paths.get(path); 139 | byte[] data; 140 | try { 141 | data = Files.readAllBytes(fpath); 142 | 143 | if (data.length != MOUNTDLC_LENGTH) { 144 | correctSize = false; 145 | } 146 | 147 | //MOUNT PRIORITY 148 | byte[] priorityArray = new byte[] { 0, 0, data[PRIORITY_OFFSET + 1], data[PRIORITY_OFFSET] }; 149 | ByteBuffer wrapped = ByteBuffer.wrap(priorityArray); 150 | mountPriority = wrapped.getInt(); 151 | 152 | //TLK 153 | byte[] tlkID1Array = new byte[] { data[TLKOFFSET_1 + 3], data[TLKOFFSET_1 + 2], data[TLKOFFSET_1 + 1], data[TLKOFFSET_1] }; 154 | wrapped = ByteBuffer.wrap(tlkID1Array); 155 | tlkId1 = wrapped.getInt(); 156 | 157 | byte[] tlkID2Array = new byte[] { data[TLKOFFSET_2 + 3], data[TLKOFFSET_2 + 2], data[TLKOFFSET_2 + 1], data[TLKOFFSET_2] }; 158 | wrapped = ByteBuffer.wrap(tlkID2Array); 159 | int tlkId2 = wrapped.getInt(); 160 | if (tlkId1 != tlkId2) { 161 | matchingTLKIds = false; 162 | } 163 | 164 | //MOUNT FLAG (8-BIT) 165 | mountFlag = data[MPSPFLAG_OFFSET]; 166 | } catch (IOException e) { 167 | ModManager.debugLogger.writeMessage("Invalid mount file."); 168 | // TODO Auto-generated catch block 169 | validMount = false; 170 | ModManager.debugLogger.writeErrorWithException("IOException reading mount file:", e); 171 | } 172 | } 173 | 174 | public MountFile(String dlcName, String reason) { 175 | this.mountName = dlcName; 176 | this.reason = reason; 177 | } 178 | 179 | public String getMountFlagString() { 180 | if (filepath != null) { 181 | return MountFileEditorWindow.getMountDescription(new File(this.filepath)); 182 | } else { 183 | return reason; 184 | } 185 | } 186 | 187 | @Override 188 | public int compareTo(MountFile other) { 189 | return new Integer(mountPriority).compareTo(other.mountPriority); 190 | } 191 | } 192 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/MountFlag.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | public class MountFlag { 4 | private String name; 5 | private byte value; 6 | 7 | public MountFlag(String name, int value) { 8 | this.name = name; 9 | this.value = (byte) value; 10 | } 11 | 12 | /** 13 | * Returns the human-readable description of this mount flag 14 | * 15 | * @return 16 | */ 17 | public String getName() { 18 | return name; 19 | } 20 | 21 | public void setName(String name) { 22 | this.name = name; 23 | } 24 | 25 | /** 26 | * Returns the radix 10 version of this mount flag as a byte 27 | * This byte is signed. 28 | * 29 | * @return 30 | */ 31 | public byte getValue() { 32 | return value; 33 | } 34 | 35 | public void setValue(byte value) { 36 | this.value = value; 37 | } 38 | 39 | public String getHexValue() { 40 | return "0x" + Integer.toHexString(value); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/PCCDumpOptions.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | /** 4 | * Options for the PCC Data Dumping tool 5 | * @author Mgamerz 6 | * 7 | */ 8 | public class PCCDumpOptions { 9 | public boolean scripts, coalesced, exports, imports, names, properties,swfs; 10 | public String gamePath; 11 | public String outputFolder; 12 | } 13 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/PatchModBundle.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | public class PatchModBundle { 4 | Patch patch; 5 | Mod mod; 6 | public Patch getPatch() { 7 | return patch; 8 | } 9 | public void setPatch(Patch patch) { 10 | this.patch = patch; 11 | } 12 | public Mod getMod() { 13 | return mod; 14 | } 15 | public void setMod(Mod mod) { 16 | this.mod = mod; 17 | } 18 | public PatchModBundle(Patch patch, Mod mod) { 19 | super(); 20 | this.patch = patch; 21 | this.mod = mod; 22 | } 23 | } -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/ProcessResult.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | public class ProcessResult { 4 | private int returnCode; 5 | private String output; 6 | private Exception error; 7 | 8 | /** 9 | * Gets the return code of the process. 10 | * @return return code from process 11 | */ 12 | public int getReturnCode() { 13 | return returnCode; 14 | } 15 | 16 | /** 17 | * Returns if the process had an exception. 18 | * @return true if error is not null, otherwise false 19 | */ 20 | public boolean hadError() { 21 | return error != null; 22 | } 23 | 24 | public ProcessResult(int returnCode, String output, Exception e) { 25 | super(); 26 | this.returnCode = returnCode; 27 | this.output = output; 28 | this.error = e; 29 | } 30 | 31 | /** 32 | * Returns the throwable that was thrown during running the process 33 | * @return Throwable error, otherwise false if no error. 34 | */ 35 | public Throwable getError() { 36 | return error; 37 | } 38 | 39 | public String getOutput() { 40 | return output; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/RestoreMode.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | /** 4 | * Defines constants to use when specifying items to restore 5 | * @author Mgamerz 6 | * 7 | */ 8 | public class RestoreMode { 9 | public final static int ALL = 0; 10 | public final static int MP = 1; 11 | public final static int SP = 2; 12 | public final static int BASEGAME = 3; 13 | public final static int MPBASE = 4; 14 | public final static int SPBASE = 5; 15 | public final static int UNPACKEDBASEGAME = 6; 16 | public final static int UNPACKED = 7; 17 | public static final int REMOVECUSTOMDLC = 8; 18 | public static final int ALLDLC = 9; 19 | public static final int REMOVEUNPACKEDITEMS = 10; 20 | public static final int BALANCE_CHANGES = 11; 21 | 22 | public static final int MP1SFAR = 11; 23 | public static final int MP2SFAR = 12; 24 | public static final int MP3SFAR = 13; 25 | public static final int MP4SFAR = 14; 26 | public static final int MP5SFAR = 15; 27 | public static final int PATCH1SFAR = 16; 28 | public static final int PATCH2SFAR = 17; 29 | public static final int TESTPATCHSFAR = 18; 30 | public static final int HENPRSFAR = 19; 31 | public static final int ENDSFAR = 20; 32 | public static final int EXP1SFAR = 21; 33 | public static final int EXP2SFAR = 22; 34 | public static final int EXP3SFAR = 23; 35 | public static final int EXP3BSFAR = 24; 36 | public static final int APP01SFAR = 25; 37 | public static final int GUN01SFAR = 26; 38 | public static final int GUN02SFAR = 27; 39 | public static final int DH1SFAR = 28; 40 | public static final int COLLECTORSEDITIONSFAR = 29; 41 | 42 | public static final int MP1UNPACKED = 30; 43 | public static final int MP2UNPACKED = 31; 44 | public static final int MP3UNPACKED = 32; 45 | public static final int MP4UNPACKED = 33; 46 | public static final int MP5UNPACKED = 34; 47 | public static final int PATCH1UNPACKED = 35; 48 | public static final int PATCH2UNPACKED = 36; 49 | public static final int TESTPATCHUNPACKED = 37; 50 | public static final int HENPRUNPACKED = 38; 51 | public static final int ENDUNPACKED = 39; 52 | public static final int EXP1UNPACKED = 40; 53 | public static final int EXP2UNPACKED = 41; 54 | public static final int EXP3UNPACKED = 42; 55 | public static final int EXP3BUNPACKED = 43; 56 | public static final int APP01UNPACKED = 44; 57 | public static final int GUN01UNPACKED = 45; 58 | public static final int GUN02UNPACKED = 46; 59 | public static final int DH1UNPACKED = 47; 60 | public static final int COLLECTORSEDITIONUNPACKED = 48; 61 | 62 | public static final int DEL_MP1UNPACKED = 49; 63 | public static final int DEL_MP2UNPACKED = 50; 64 | public static final int DEL_MP3UNPACKED = 51; 65 | public static final int DEL_MP4UNPACKED = 52; 66 | public static final int DEL_MP5UNPACKED = 53; 67 | public static final int DEL_PATCH1UNPACKED = 54; 68 | public static final int DEL_PATCH2UNPACKED = 55; 69 | public static final int DEL_TESTPATCHUNPACKED = 56; 70 | public static final int DEL_HENPRUNPACKED = 57; 71 | public static final int DEL_ENDUNPACKED = 58; 72 | public static final int DEL_EXP1UNPACKED = 59; 73 | public static final int DEL_EXP2UNPACKED = 60; 74 | public static final int DEL_EXP3UNPACKED = 61; 75 | public static final int DEL_EXP3BUNPACKED = 62; 76 | public static final int DEL_APP01UNPACKED = 63; 77 | public static final int DEL_GUN01UNPACKED = 64; 78 | public static final int DEL_GUN02UNPACKED = 65; 79 | public static final int DEL_DH1UNPACKED = 66; 80 | public static final int DEL_COLLECTORSEDITIONUNPACKED = 67; 81 | 82 | public static final int VANILLIFYDLC = 1000; 83 | 84 | //OPERATION TYPES 85 | public static final int SFAR_HEADER_RESTORE = 100; 86 | public static final int UNPACKED_HEADER_RESTORE = 101; 87 | public static final int UNPACKED_HEADER_DELETE = 102; 88 | } 89 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/ThirdPartyImportingInfo.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | public class ThirdPartyImportingInfo { 4 | private String md5; 5 | private String inarchivepathtosearch; 6 | 7 | public String getServermoddescname() { 8 | return servermoddescname; 9 | } 10 | 11 | public void setServermoddescname(String servermoddescname) { 12 | this.servermoddescname = servermoddescname; 13 | } 14 | 15 | private String servermoddescname; 16 | public String getMd5() { 17 | return md5; 18 | } 19 | 20 | public void setMd5(String md5) { 21 | this.md5 = md5; 22 | } 23 | 24 | public String getInarchivepathtosearch() { 25 | return inarchivepathtosearch; 26 | } 27 | 28 | public void setInarchivepathtosearch(String inarchivepathtosearch) { 29 | this.inarchivepathtosearch = inarchivepathtosearch; 30 | } 31 | 32 | public String getFilename() { 33 | return filename; 34 | } 35 | 36 | public void setFilename(String filename) { 37 | this.filename = filename; 38 | } 39 | 40 | public int getSubidrectorydepth() { 41 | return subidrectorydepth; 42 | } 43 | 44 | public void setSubidrectorydepth(int subidrectorydepth) { 45 | this.subidrectorydepth = subidrectorydepth; 46 | } 47 | 48 | public ThirdPartyImportingInfo(String md5, String inarchivepathtosearch, String filename, int subidrectorydepth, String servermoddescname) { 49 | super(); 50 | this.md5 = md5; 51 | this.inarchivepathtosearch = inarchivepathtosearch; 52 | this.filename = filename; 53 | this.subidrectorydepth = subidrectorydepth; 54 | this.servermoddescname = servermoddescname; 55 | } 56 | 57 | private String filename; 58 | private int subidrectorydepth; 59 | } 60 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/ThirdPartyModInfo.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.util.ArrayList; 4 | 5 | import org.json.simple.JSONArray; 6 | import org.json.simple.JSONObject; 7 | 8 | public class ThirdPartyModInfo { 9 | public boolean isBlacklistedForModImport() { 10 | return blacklistedForModImport; 11 | } 12 | 13 | public void setBlacklistedForModImport(boolean blacklistedForModImport) { 14 | this.blacklistedForModImport = blacklistedForModImport; 15 | } 16 | 17 | public int getMountpriority() { 18 | return mountpriority; 19 | } 20 | 21 | private String modname, modauthor, customDLCfolder, moddescription, modsite; 22 | private int mountpriority; //unsigned short 23 | private boolean blacklistedForModImport; 24 | private int updatecode; 25 | /** 26 | * Copy constructor 27 | * 28 | * @param modname 29 | * @param modauthor 30 | * @param customDLCfolder 31 | * @param moddescription 32 | * @param modsite 33 | * @param mountpriority 34 | */ 35 | public ThirdPartyModInfo(ThirdPartyModInfo original) { 36 | super(); 37 | this.modname = original.modname; 38 | this.modauthor = original.modauthor; 39 | this.customDLCfolder = original.customDLCfolder; 40 | this.moddescription = original.moddescription; 41 | this.modsite = original.modsite; 42 | this.mountpriority = original.mountpriority; 43 | this.blacklistedForModImport = original.blacklistedForModImport; 44 | this.updatecode = original.updatecode; 45 | } 46 | 47 | public ThirdPartyModInfo(String customdlcfolder, JSONObject modinfo) { 48 | this.customDLCfolder = customdlcfolder; 49 | this.modname = (String) modinfo.get("modname"); 50 | this.modauthor = (String) modinfo.get("moddev"); 51 | this.moddescription = (String) modinfo.get("moddesc"); 52 | this.modsite = (String) modinfo.get("modsite"); 53 | String priority = (String) modinfo.get("mountpriority"); 54 | this.mountpriority = Integer.parseInt(priority); 55 | String blacklistedForImport = (String) modinfo.get("preventimport"); 56 | if (blacklistedForImport != null) { 57 | this.blacklistedForModImport = Integer.parseInt(blacklistedForImport) != 0; 58 | } 59 | 60 | String updatecodestr = (String) modinfo.get("updatecode"); 61 | if (updatecodestr != null) { 62 | this.updatecode = Integer.parseInt(updatecodestr); 63 | } 64 | } 65 | 66 | public String getModname() { 67 | return modname; 68 | } 69 | 70 | public void setModname(String modname) { 71 | this.modname = modname; 72 | } 73 | 74 | public String getModauthor() { 75 | return modauthor; 76 | } 77 | 78 | public void setModauthor(String modauthor) { 79 | this.modauthor = modauthor; 80 | } 81 | 82 | public String getCustomDLCfolder() { 83 | return customDLCfolder; 84 | } 85 | 86 | public void setCustomDLCfolder(String customDLCfolder) { 87 | this.customDLCfolder = customDLCfolder; 88 | } 89 | 90 | public String getModdescription() { 91 | return moddescription; 92 | } 93 | 94 | public void setModdescription(String moddescription) { 95 | this.moddescription = moddescription; 96 | } 97 | 98 | public String getModsite() { 99 | return modsite; 100 | } 101 | 102 | public void setModsite(String modsite) { 103 | this.modsite = modsite; 104 | } 105 | 106 | public int getMountPriority() { 107 | return mountpriority; 108 | } 109 | 110 | public void setMountpriority(int mountpriority) { 111 | this.mountpriority = mountpriority; 112 | } 113 | 114 | public int getUpdateCode() { 115 | return updatecode; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/ThreadCommand.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | /** 4 | * Defines an object that contains a command and optionally a message for passing from background to UI threads 5 | * @author mgamerz 6 | * 7 | */ 8 | public class ThreadCommand { 9 | public final static String COMMAND_ERROR = "ERROR"; 10 | 11 | private String command; 12 | private String message; 13 | private Object data; 14 | public ThreadCommand(String command, String message) { 15 | super(); 16 | this.command = command; 17 | this.message = message; 18 | } 19 | public ThreadCommand(String command, String message, Object data) { 20 | this.command = command; 21 | this.message = message; 22 | this.data = data; 23 | } 24 | public ThreadCommand(String command) { 25 | this.command = command; 26 | } 27 | public String getCommand() { 28 | return command; 29 | } 30 | public void setCommand(String command) { 31 | this.command = command; 32 | } 33 | public String getMessage() { 34 | return message; 35 | } 36 | public void setMessage(String message) { 37 | this.message = message; 38 | } 39 | public Object getData() { 40 | return data; 41 | } 42 | public void setData(Object data) { 43 | this.data = data; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/objects/TocBatchDescriptor.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.objects; 2 | 3 | import java.util.AbstractMap; 4 | import java.util.ArrayList; 5 | 6 | /** 7 | * Describes a batch toc job, containing a list of search terms (for toceditor in me3exp) mapped to the size to set them to 8 | * @author Michael 9 | * 10 | */ 11 | public class TocBatchDescriptor { 12 | private ArrayList> nameSizePairs; 13 | 14 | public ArrayList> getNameSizePairs() { 15 | return nameSizePairs; 16 | } 17 | 18 | public void setNameSizePairs(ArrayList> nameSizePair) { 19 | this.nameSizePairs = nameSizePair; 20 | } 21 | 22 | public void addNameSizePair(String tocupdatesearchterm, long size) { 23 | AbstractMap.SimpleEntry newpair = new AbstractMap.SimpleEntry(tocupdatesearchterm, size); 24 | nameSizePairs.add(newpair); 25 | } 26 | 27 | public TocBatchDescriptor() { 28 | nameSizePairs = new ArrayList>(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/repairdb/RepairFileInfo.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.repairdb; 2 | 3 | public class RepairFileInfo { 4 | public long filesize; 5 | public String md5; 6 | public String filePath; 7 | } 8 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/testing/Testing.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.testing; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | 6 | import org.apache.commons.io.FileUtils; 7 | import org.json.simple.JSONObject; 8 | import org.json.simple.parser.JSONParser; 9 | import org.json.simple.parser.ParseException; 10 | 11 | import com.me3tweaks.modmanager.ModManager; 12 | import com.me3tweaks.modmanager.objects.ThirdPartyModInfo; 13 | 14 | /** 15 | * Contains test classes 16 | * 17 | * @author Mgamerz 18 | * 19 | */ 20 | public class Testing { 21 | 22 | public static void Test_validateTelemetryFoldernames() throws IOException, ParseException { 23 | JSONParser parser = new JSONParser(); 24 | JSONObject dbObj = (JSONObject) parser.parse(ModManager.THIRD_PARTY_MOD_JSON); 25 | for (Object key : dbObj.keySet()) { 26 | //based on you key typel 27 | String keyStr = (String) key; 28 | JSONObject keyVal = (JSONObject) dbObj.get(keyStr); 29 | ThirdPartyModInfo tpmi = new ThirdPartyModInfo(keyStr, keyVal); 30 | 31 | String importFoldername = tpmi.getModname();//.replaceAll("'", ""); 32 | String localModPath = ModManager.getTestingDir() + importFoldername; 33 | FileUtils.forceMkdir(new File(localModPath)); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/AboutWindow2Controller.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import com.me3tweaks.modmanager.utilities.ResourceUtils; 4 | 5 | import javafx.event.ActionEvent; 6 | import javafx.fxml.FXML; 7 | 8 | /** 9 | * Controller class for AboutWindow2 10 | * 11 | * @author Mgamerz 12 | * 13 | */ 14 | public class AboutWindow2Controller { 15 | public AboutWindow2Controller() { 16 | 17 | } 18 | 19 | @FXML 20 | private void openDerbyPage(ActionEvent event) { 21 | ResourceUtils.openWebpage("https://db.apache.org/derby/"); 22 | } 23 | 24 | @FXML 25 | private void open7ZipJBindingPage() { 26 | ResourceUtils.openWebpage("http://sevenzipjbind.sourceforge.net/"); 27 | } 28 | 29 | @FXML 30 | private void openCommonsIOPage() { 31 | ResourceUtils.openWebpage("https://commons.apache.org/proper/commons-io/"); 32 | } 33 | 34 | @FXML 35 | private void openCommonsLangPage() { 36 | ResourceUtils.openWebpage("https://commons.apache.org/proper/commons-lang/"); 37 | } 38 | 39 | @FXML 40 | private void openZlibPage() { 41 | ResourceUtils.openWebpage("https://zlib.net/"); 42 | } 43 | 44 | @FXML 45 | private void openCommonsValidatorPage() { 46 | ResourceUtils.openWebpage("https://commons.apache.org/proper/commons-validator/"); 47 | } 48 | 49 | @FXML 50 | private void openHttpComponentsPage() { 51 | ResourceUtils.openWebpage("https://hc.apache.org/"); 52 | } 53 | 54 | @FXML 55 | private void openME3ExplorerPage() { 56 | ResourceUtils.openWebpage("https://github.com/Mgamerz/ME3Explorer"); 57 | } 58 | 59 | @FXML 60 | private void openjsonsimplePage() { 61 | ResourceUtils.openWebpage("https://github.com/fangyidong/json-simple"); 62 | } 63 | 64 | @FXML 65 | private void openini4jPage() { 66 | ResourceUtils.openWebpage("http://ini4j.sourceforge.net/"); 67 | } 68 | 69 | @FXML 70 | private void openFileDropPage() { 71 | ResourceUtils.openWebpage("http://iharder.sourceforge.net/current/java/filedrop/"); 72 | } 73 | 74 | @FXML 75 | private void open7ZipPage() { 76 | ResourceUtils.openWebpage("http://www.7-zip.org/"); 77 | } 78 | 79 | @FXML 80 | private void openME3TweaksPage() { 81 | ResourceUtils.openWebpage("https://me3tweaks.com"); 82 | } 83 | 84 | @FXML 85 | private void openJNAPage() { 86 | ResourceUtils.openWebpage("https://github.com/java-native-access/jna"); 87 | } 88 | 89 | @FXML 90 | private void openBinkw32ASIPage() { 91 | ResourceUtils.openWebpage("https://github.com/Erik-JS/masseffect-binkw32"); 92 | } 93 | 94 | @FXML 95 | private void openElevatePage() { 96 | ResourceUtils.openWebpage("http://code.kliu.org/misc/elevate/"); 97 | } 98 | 99 | @FXML 100 | private void openJojoDiffPage() { 101 | ResourceUtils.openWebpage("http://jojodiff.sourceforge.net/"); 102 | } 103 | 104 | @FXML 105 | private void openLaunch4jPage() { 106 | ResourceUtils.openWebpage("http://launch4j.sourceforge.net/"); 107 | } 108 | 109 | @FXML 110 | private void openMEMPage() { 111 | ResourceUtils.openWebpage("https://github.com/MassEffectModder/MassEffectModder"); 112 | } 113 | 114 | @FXML 115 | private void openTankmasterPage() { 116 | ResourceUtils.openWebpage("http://me3explorer.freeforums.org/post12495.html#p12495"); 117 | } 118 | 119 | @FXML 120 | private void openSwingXPage() { 121 | ResourceUtils.openWebpage(" https://stackoverflow.com/questions/6818528/what-is-the-status-of-swinglabs-swingx-post-acquisition"); 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/CheckBoxLabel.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import java.awt.Component; 4 | import java.awt.Graphics; 5 | 6 | import javax.swing.Icon; 7 | import javax.swing.JCheckBox; 8 | import javax.swing.JComponent; 9 | import javax.swing.plaf.basic.BasicCheckBoxUI; 10 | 11 | public class CheckBoxLabel extends JCheckBox { 12 | public CheckBoxLabel(String string) { 13 | super(string); 14 | } 15 | 16 | public void updateUI() { 17 | setUI(new CheckBoxLabelUI()); 18 | } 19 | } 20 | 21 | class CheckBoxLabelUI extends BasicCheckBoxUI { 22 | public void installUI(JComponent c) { 23 | super.installUI(c); 24 | Icon i = super.getDefaultIcon(); 25 | icon_ = new EmptyIcon(); 26 | } 27 | 28 | public Icon getDefaultIcon() { 29 | return icon_; 30 | } 31 | 32 | private Icon icon_; 33 | } 34 | 35 | class EmptyIcon implements Icon { 36 | public EmptyIcon() { 37 | this(0, 0); 38 | } 39 | 40 | public EmptyIcon(int width, int height) { 41 | width_ = width; 42 | height_ = height; 43 | } 44 | 45 | public int getIconHeight() { 46 | return height_; 47 | } 48 | 49 | public int getIconWidth() { 50 | return width_; 51 | } 52 | 53 | public void paintIcon(Component c, Graphics g, int x, int y) { 54 | } 55 | 56 | private int width_; 57 | private int height_; 58 | } 59 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/CompressedModCellRenderer.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import java.awt.Component; 4 | 5 | import javax.swing.DefaultListCellRenderer; 6 | import javax.swing.JLabel; 7 | import javax.swing.JList; 8 | import javax.swing.ListCellRenderer; 9 | 10 | import com.me3tweaks.modmanager.objects.CompressedMod; 11 | 12 | public class CompressedModCellRenderer implements ListCellRenderer { 13 | protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer(); 14 | 15 | public Component getListCellRendererComponent(JList list, CompressedMod value, int index, boolean isSelected, boolean cellHasFocus) { 16 | JLabel renderer = (JLabel) defaultRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 17 | renderer.setText(value.getModName()); 18 | return renderer; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/ConflictResolutionRadioButton.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import javax.swing.Action; 4 | import javax.swing.Icon; 5 | import javax.swing.JRadioButton; 6 | 7 | public class ConflictResolutionRadioButton extends JRadioButton { 8 | public static final int REPLACECONFLICT = 0; 9 | public static final int ADDCONFLICT = 1; 10 | public static final int REPLACEREMOVECONFLICT = 2; 11 | public static final int ADDREMOVECONFLICT = 3; 12 | 13 | public static final int REPLACE = 0; 14 | public static final int ADD = 1; 15 | public static final int REMOVE = 2; 16 | 17 | public int getConflictType() { 18 | return conflictType; 19 | } 20 | 21 | public void setConflictType(int conflictType) { 22 | this.conflictType = conflictType; 23 | } 24 | 25 | public int conflictType = -1; 26 | public boolean isLeft = true; 27 | public String module; 28 | public String conflictTarget; 29 | public String sourcePath; 30 | 31 | public boolean isLeft() { 32 | return isLeft; 33 | } 34 | 35 | public void setLeft(boolean isLeft) { 36 | this.isLeft = isLeft; 37 | } 38 | 39 | public String getModule() { 40 | return module; 41 | } 42 | 43 | public ConflictResolutionRadioButton() { 44 | super(); 45 | // TODO Auto-generated constructor stub 46 | } 47 | 48 | public ConflictResolutionRadioButton(Action a) { 49 | super(a); 50 | // TODO Auto-generated constructor stub 51 | } 52 | 53 | public ConflictResolutionRadioButton(Icon icon, boolean selected) { 54 | super(icon, selected); 55 | // TODO Auto-generated constructor stub 56 | } 57 | 58 | public ConflictResolutionRadioButton(Icon icon) { 59 | super(icon); 60 | // TODO Auto-generated constructor stub 61 | } 62 | 63 | public ConflictResolutionRadioButton(String text, boolean selected) { 64 | super(text, selected); 65 | // TODO Auto-generated constructor stub 66 | } 67 | 68 | public ConflictResolutionRadioButton(String text, Icon icon, boolean selected) { 69 | super(text, icon, selected); 70 | // TODO Auto-generated constructor stub 71 | } 72 | 73 | public ConflictResolutionRadioButton(String text, Icon icon) { 74 | super(text, icon); 75 | // TODO Auto-generated constructor stub 76 | } 77 | 78 | public ConflictResolutionRadioButton(String text) { 79 | super(text); 80 | // TODO Auto-generated constructor stub 81 | } 82 | 83 | public void setModule(String module) { 84 | this.module = module; 85 | } 86 | 87 | public String getConflictTarget() { 88 | return conflictTarget; 89 | } 90 | 91 | public void setConflictTarget(String conflictTarget) { 92 | this.conflictTarget = conflictTarget; 93 | } 94 | 95 | public String getSourcePath() { 96 | return sourcePath; 97 | } 98 | 99 | public void setSourcePath(String sourcePath) { 100 | this.sourcePath = sourcePath; 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/CustomDLCManagerTableCellRenderer.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import java.awt.Color; 4 | import java.awt.Component; 5 | import java.awt.Font; 6 | 7 | import javax.swing.JLabel; 8 | import javax.swing.JTable; 9 | import javax.swing.table.DefaultTableCellRenderer; 10 | 11 | import com.me3tweaks.modmanager.CustomDLCWindow; 12 | import com.me3tweaks.modmanager.SelectiveRestoreWindow; 13 | 14 | public class CustomDLCManagerTableCellRenderer extends DefaultTableCellRenderer { 15 | public static Color badColor = new Color(255, 140, 140); 16 | private static Color naColor = Color.gray; 17 | 18 | @Override 19 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 20 | JLabel c = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 21 | if (value == null) 22 | return c; 23 | switch (column) { 24 | case CustomDLCWindow.COL_MOUNT_PRIORITY: 25 | setHorizontalAlignment(JLabel.CENTER); 26 | break; 27 | default: 28 | c.setBackground(null); 29 | c.setToolTipText(null); 30 | break; 31 | } 32 | return this; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/HintTextAreaUI.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import java.awt.Color; 4 | import java.awt.Graphics; 5 | import java.awt.event.FocusEvent; 6 | import java.awt.event.FocusListener; 7 | 8 | import javax.swing.LookAndFeel; 9 | import javax.swing.UIManager; 10 | import javax.swing.plaf.basic.BasicTextAreaUI; 11 | import javax.swing.text.JTextComponent; 12 | 13 | public class HintTextAreaUI extends BasicTextAreaUI implements FocusListener { 14 | private static Color windowsHintColor = Color.GRAY; 15 | private String hint; 16 | private boolean hideOnFocus; 17 | private Color color; 18 | 19 | public Color getColor() { 20 | return color; 21 | } 22 | 23 | public void setColor(Color color) { 24 | this.color = color; 25 | repaint(); 26 | } 27 | 28 | private void repaint() { 29 | if (getComponent() != null) { 30 | getComponent().repaint(); 31 | } 32 | } 33 | 34 | public boolean isHideOnFocus() { 35 | return hideOnFocus; 36 | } 37 | 38 | public void setHideOnFocus(boolean hideOnFocus) { 39 | this.hideOnFocus = hideOnFocus; 40 | repaint(); 41 | } 42 | 43 | public String getHint() { 44 | return hint; 45 | } 46 | 47 | public void setHint(String hint) { 48 | this.hint = hint; 49 | repaint(); 50 | } 51 | 52 | public HintTextAreaUI(String hint) { 53 | this(hint, false); 54 | } 55 | 56 | public HintTextAreaUI(String hint, boolean hideOnFocus) { 57 | this(hint, hideOnFocus, null); 58 | } 59 | 60 | public HintTextAreaUI(String hint, boolean hideOnFocus, Color color) { 61 | this.hint = hint; 62 | this.hideOnFocus = hideOnFocus; 63 | this.color = color; 64 | } 65 | 66 | @Override 67 | protected void paintSafely(Graphics g) { 68 | super.paintSafely(g); 69 | JTextComponent comp = getComponent(); 70 | if (hint != null && comp.getText().length() == 0 && (!(hideOnFocus && comp.hasFocus()))) { 71 | if (color != null) { 72 | g.setColor(color); 73 | } else { 74 | if (UIManager.getLookAndFeel().getID().equals("Windows")) { 75 | g.setColor(windowsHintColor); 76 | } else { 77 | g.setColor(comp.getForeground().brighter().brighter().brighter()); 78 | } 79 | } 80 | //int padding = (comp.getHeight() - comp.getFont().getSize())/2; 81 | // drawString(g,hint,2, comp.getHeight()-padding-1); comp.getFont().getSize() 82 | drawString(g, hint, 2, 0); 83 | 84 | } 85 | } 86 | 87 | /** 88 | * Can draw newlines 89 | * 90 | * @param g 91 | * @param text 92 | * @param x 93 | * @param y 94 | */ 95 | void drawString(Graphics g, String text, int x, int y) { 96 | for (String line : text.split("\n")) 97 | g.drawString(line, x, y += g.getFontMetrics().getHeight()); 98 | } 99 | 100 | @Override 101 | public void focusGained(FocusEvent e) { 102 | if (hideOnFocus) 103 | repaint(); 104 | 105 | } 106 | 107 | @Override 108 | public void focusLost(FocusEvent e) { 109 | if (hideOnFocus) 110 | repaint(); 111 | } 112 | 113 | @Override 114 | protected void installListeners() { 115 | super.installListeners(); 116 | getComponent().addFocusListener(this); 117 | } 118 | 119 | @Override 120 | protected void uninstallListeners() { 121 | super.uninstallListeners(); 122 | getComponent().removeFocusListener(this); 123 | } 124 | } -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/HintTextFieldUI.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import java.awt.Color; 4 | import java.awt.Graphics; 5 | import java.awt.event.FocusEvent; 6 | import java.awt.event.FocusListener; 7 | 8 | import javax.swing.UIManager; 9 | import javax.swing.plaf.basic.BasicTextFieldUI; 10 | import javax.swing.text.JTextComponent; 11 | 12 | public class HintTextFieldUI extends BasicTextFieldUI implements FocusListener { 13 | private static Color windowsHintColor = Color.GRAY; 14 | private String hint; 15 | private boolean hideOnFocus; 16 | private Color color; 17 | 18 | public Color getColor() { 19 | return color; 20 | } 21 | 22 | public void setColor(Color color) { 23 | this.color = color; 24 | repaint(); 25 | } 26 | 27 | private void repaint() { 28 | if (getComponent() != null) { 29 | getComponent().repaint(); 30 | } 31 | } 32 | 33 | public boolean isHideOnFocus() { 34 | return hideOnFocus; 35 | } 36 | 37 | public void setHideOnFocus(boolean hideOnFocus) { 38 | this.hideOnFocus = hideOnFocus; 39 | repaint(); 40 | } 41 | 42 | public String getHint() { 43 | return hint; 44 | } 45 | 46 | public void setHint(String hint) { 47 | this.hint = hint; 48 | repaint(); 49 | } 50 | 51 | public HintTextFieldUI(String hint) { 52 | this(hint, false); 53 | } 54 | 55 | public HintTextFieldUI(String hint, boolean hideOnFocus) { 56 | this(hint, hideOnFocus, null); 57 | } 58 | 59 | public HintTextFieldUI(String hint, boolean hideOnFocus, Color color) { 60 | this.hint = hint; 61 | this.hideOnFocus = hideOnFocus; 62 | this.color = color; 63 | } 64 | 65 | @Override 66 | protected void paintSafely(Graphics g) { 67 | super.paintSafely(g); 68 | JTextComponent comp = getComponent(); 69 | if (hint != null && comp.getText().length() == 0 && (!(hideOnFocus && comp.hasFocus()))) { 70 | if (color != null) { 71 | g.setColor(color); 72 | } else { 73 | if (UIManager.getLookAndFeel().getID().equals("Windows")) { 74 | g.setColor(windowsHintColor); 75 | } else { 76 | g.setColor(comp.getForeground().brighter().brighter().brighter()); 77 | } 78 | } 79 | int padding = (comp.getHeight() - comp.getFont().getSize()) / 2; 80 | g.drawString(hint, 5, comp.getHeight() - padding - 1); 81 | } 82 | } 83 | 84 | @Override 85 | public void focusGained(FocusEvent e) { 86 | if (hideOnFocus) 87 | repaint(); 88 | 89 | } 90 | 91 | @Override 92 | public void focusLost(FocusEvent e) { 93 | if (hideOnFocus) 94 | repaint(); 95 | } 96 | 97 | @Override 98 | protected void installListeners() { 99 | super.installListeners(); 100 | getComponent().addFocusListener(this); 101 | } 102 | 103 | @Override 104 | protected void uninstallListeners() { 105 | super.uninstallListeners(); 106 | getComponent().removeFocusListener(this); 107 | } 108 | } -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/ModCellRenderer.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import java.awt.Component; 4 | 5 | import javax.swing.DefaultListCellRenderer; 6 | import javax.swing.JLabel; 7 | import javax.swing.JList; 8 | import javax.swing.ListCellRenderer; 9 | 10 | import com.me3tweaks.modmanager.objects.Mod; 11 | 12 | public class ModCellRenderer implements ListCellRenderer { 13 | protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer(); 14 | 15 | public Component getListCellRendererComponent(JList list, Mod value, int index, boolean isSelected, boolean cellHasFocus) { 16 | JLabel renderer = (JLabel) defaultRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 17 | renderer.setText(value.getModName()); 18 | return renderer; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/MountFlagCellRenderer.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import java.awt.Component; 4 | 5 | import javax.swing.DefaultListCellRenderer; 6 | import javax.swing.JLabel; 7 | import javax.swing.JList; 8 | import javax.swing.ListCellRenderer; 9 | 10 | import com.me3tweaks.modmanager.objects.Mod; 11 | import com.me3tweaks.modmanager.objects.MountFlag; 12 | 13 | public class MountFlagCellRenderer implements ListCellRenderer { 14 | protected DefaultListCellRenderer defaultRenderer = new DefaultListCellRenderer(); 15 | 16 | public Component getListCellRendererComponent(JList list, MountFlag value, int index, boolean isSelected, boolean cellHasFocus) { 17 | JLabel renderer = (JLabel) defaultRenderer.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); 18 | if (value != null) { 19 | renderer.setText(value.getName() + " (" + value.getHexValue()+")"); 20 | } 21 | return renderer; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/MultiLineTableCell.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import java.awt.Component; 4 | import java.awt.Font; 5 | import java.awt.Graphics; 6 | import java.awt.Graphics2D; 7 | import java.awt.font.FontRenderContext; 8 | import java.awt.font.LineBreakMeasurer; 9 | import java.awt.font.TextLayout; 10 | import java.text.AttributedCharacterIterator; 11 | import java.text.AttributedString; 12 | import java.text.BreakIterator; 13 | 14 | import javax.swing.JTable; 15 | import javax.swing.table.DefaultTableCellRenderer; 16 | import javax.swing.table.TableCellRenderer; 17 | 18 | public class MultiLineTableCell implements TableCellRenderer { 19 | class CellArea extends DefaultTableCellRenderer { 20 | /** 21 | * 22 | */ 23 | private static final long serialVersionUID = 1L; 24 | private String text; 25 | protected int rowIndex; 26 | protected int columnIndex; 27 | protected JTable table; 28 | protected Font font; 29 | private int paragraphStart, paragraphEnd; 30 | private LineBreakMeasurer lineMeasurer; 31 | 32 | public CellArea(String s, JTable tab, int row, int column, boolean isSelected) { 33 | text = s; 34 | rowIndex = row; 35 | columnIndex = column; 36 | table = tab; 37 | font = table.getFont(); 38 | if (isSelected) { 39 | setForeground(table.getSelectionForeground()); 40 | setBackground(table.getSelectionBackground()); 41 | } 42 | } 43 | 44 | public void paintComponent(Graphics gr) { 45 | super.paintComponent(gr); 46 | if (text != null && !text.isEmpty()) { 47 | Graphics2D g = (Graphics2D) gr; 48 | if (lineMeasurer == null) { 49 | AttributedCharacterIterator paragraph = new AttributedString(text).getIterator(); 50 | paragraphStart = paragraph.getBeginIndex(); 51 | paragraphEnd = paragraph.getEndIndex(); 52 | FontRenderContext frc = g.getFontRenderContext(); 53 | lineMeasurer = new LineBreakMeasurer(paragraph, BreakIterator.getWordInstance(), frc); 54 | } 55 | float breakWidth = (float) table.getColumnModel().getColumn(columnIndex).getWidth(); 56 | float drawPosY = 0; 57 | // Set position to the index of the first character in the paragraph. 58 | lineMeasurer.setPosition(paragraphStart); 59 | // Get lines until the entire paragraph has been displayed. 60 | while (lineMeasurer.getPosition() < paragraphEnd) { 61 | // Retrieve next layout. A cleverer program would also cache 62 | // these layouts until the component is re-sized. 63 | TextLayout layout = lineMeasurer.nextLayout(breakWidth); 64 | // Compute pen x position. If the paragraph is right-to-left we 65 | // will align the TextLayouts to the right edge of the panel. 66 | // Note: this won't occur for the English text in this sample. 67 | // Note: drawPosX is always where the LEFT of the text is placed. 68 | float drawPosX = layout.isLeftToRight() ? 0 : breakWidth - layout.getAdvance(); 69 | // Move y-coordinate by the ascent of the layout. 70 | drawPosY += layout.getAscent(); 71 | // Draw the TextLayout at (drawPosX, drawPosY). 72 | layout.draw(g, drawPosX, drawPosY); 73 | // Move y-coordinate in preparation for next layout. 74 | drawPosY += layout.getDescent() + layout.getLeading(); 75 | } 76 | table.setRowHeight(rowIndex, (int) drawPosY); 77 | } 78 | } 79 | } 80 | 81 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 82 | CellArea area = new CellArea(value.toString(), table, row, column, isSelected); 83 | return area; 84 | } 85 | } -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/SelectiveRestoreTableCellRenderer.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import java.awt.Color; 4 | import java.awt.Component; 5 | import java.awt.Font; 6 | 7 | import javax.swing.JLabel; 8 | import javax.swing.JTable; 9 | import javax.swing.UIManager; 10 | import javax.swing.table.DefaultTableCellRenderer; 11 | 12 | import com.me3tweaks.modmanager.SelectiveRestoreWindow; 13 | 14 | public class SelectiveRestoreTableCellRenderer extends DefaultTableCellRenderer { 15 | public static Color badColor = new Color(255, 140, 140); 16 | private static Color naColor = Color.gray; 17 | 18 | @Override 19 | public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 20 | JLabel c = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 21 | if (value == null) 22 | return c; 23 | 24 | if (UIManager.getLookAndFeel().getID().equals("Windows")) { 25 | c.setForeground(Color.BLACK); 26 | } 27 | 28 | setHorizontalAlignment(JLabel.CENTER); 29 | switch (column) { 30 | case SelectiveRestoreWindow.COL_MODIFIED: 31 | if (value.toString().startsWith("MODIFIED")) { 32 | c.setBackground(badColor); 33 | c.setFont(c.getFont().deriveFont(Font.BOLD)); 34 | c.setToolTipText("SFAR DLC size does not match known original"); 35 | } else { 36 | c.setBackground(null); 37 | } 38 | break; 39 | case SelectiveRestoreWindow.COL_BACKEDUP: 40 | if (value.toString().equalsIgnoreCase("NO")) { 41 | c.setFont(c.getFont().deriveFont(Font.BOLD)); 42 | c.setToolTipText("DLC SFAR is not backed up. You should do so now via the Backup menu."); 43 | c.setBackground(badColor); 44 | } else { 45 | c.setBackground(null); 46 | } 47 | break; 48 | default: 49 | c.setBackground(null); 50 | c.setToolTipText(null); 51 | break; 52 | } 53 | return this; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/StayOpenJCheckboxMenuItem.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import java.awt.event.MouseEvent; 4 | 5 | import javax.swing.Action; 6 | import javax.swing.Icon; 7 | import javax.swing.JCheckBoxMenuItem; 8 | 9 | public class StayOpenJCheckboxMenuItem extends JCheckBoxMenuItem { 10 | 11 | public StayOpenJCheckboxMenuItem() { 12 | } 13 | 14 | public StayOpenJCheckboxMenuItem(Icon icon) { 15 | super(icon); 16 | } 17 | 18 | public StayOpenJCheckboxMenuItem(String text) { 19 | super(text); 20 | } 21 | 22 | public StayOpenJCheckboxMenuItem(Action a) { 23 | super(a); 24 | } 25 | 26 | public StayOpenJCheckboxMenuItem(String text, Icon icon) { 27 | super(text, icon); 28 | } 29 | 30 | public StayOpenJCheckboxMenuItem(String text, boolean b) { 31 | super(text, b); 32 | } 33 | 34 | public StayOpenJCheckboxMenuItem(String text, Icon icon, boolean b) { 35 | super(text, icon, b); 36 | } 37 | 38 | @Override 39 | protected void processMouseEvent(MouseEvent evt) { 40 | if (evt.getID() == MouseEvent.MOUSE_RELEASED && contains(evt.getPoint())) { 41 | doClick(); 42 | setArmed(true); 43 | } else { 44 | super.processMouseEvent(evt); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/ui/SwingLink.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.ui; 2 | 3 | import java.awt.Cursor; 4 | import java.awt.Desktop; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.ActionListener; 7 | import java.awt.event.MouseAdapter; 8 | import java.awt.event.MouseEvent; 9 | import java.io.IOException; 10 | import java.net.URI; 11 | 12 | import javax.swing.Action; 13 | import javax.swing.JLabel; 14 | import javax.swing.JOptionPane; 15 | 16 | public class SwingLink extends JLabel { 17 | private static final long serialVersionUID = 8273875024682878518L; 18 | private String text; 19 | private URI uri; 20 | private ActionListener action; 21 | 22 | public SwingLink(String text, URI uri) { 23 | super(); 24 | setup(text, uri); 25 | setCursor(new Cursor(Cursor.HAND_CURSOR)); 26 | } 27 | 28 | public SwingLink(String text, String tooltip, ActionListener action) { 29 | super(); 30 | setup(text, tooltip, action); 31 | setCursor(new Cursor(Cursor.HAND_CURSOR)); 32 | } 33 | 34 | public SwingLink(String text, String uri) { 35 | super(); 36 | setup(text, URI.create(uri)); 37 | setCursor(new Cursor(Cursor.HAND_CURSOR)); 38 | } 39 | 40 | public void setup(String t, URI u) { 41 | text = t; 42 | uri = u; 43 | setText(text); 44 | setToolTipText(uri.toString()); 45 | addMouseListener(new MouseAdapter() { 46 | public void mouseClicked(MouseEvent e) { 47 | open(uri); 48 | } 49 | 50 | public void mouseEntered(MouseEvent e) { 51 | setText(text, false); 52 | } 53 | 54 | public void mouseExited(MouseEvent e) { 55 | setText(text, true); 56 | } 57 | }); 58 | } 59 | 60 | public void setup(String t, String tooltip, ActionListener u) { 61 | text = t; 62 | action = u; 63 | setText(text); 64 | setToolTipText(tooltip); 65 | addMouseListener(new MouseAdapter() { 66 | public void mouseClicked(MouseEvent e) { 67 | u.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null)); 68 | } 69 | 70 | public void mouseEntered(MouseEvent e) { 71 | setText(text, false); 72 | } 73 | 74 | public void mouseExited(MouseEvent e) { 75 | setText(text, true); 76 | } 77 | }); 78 | } 79 | 80 | public void setup(String t, String tooltip, Action u) { 81 | text = t; 82 | action = u; 83 | setText(text); 84 | setToolTipText(tooltip); 85 | addMouseListener(new MouseAdapter() { 86 | public void mouseClicked(MouseEvent e) { 87 | u.actionPerformed(new ActionEvent(this, ActionEvent.ACTION_PERFORMED, null)); 88 | } 89 | 90 | public void mouseEntered(MouseEvent e) { 91 | setText(text, false); 92 | } 93 | 94 | public void mouseExited(MouseEvent e) { 95 | setText(text, true); 96 | } 97 | }); 98 | } 99 | 100 | @Override 101 | public void setText(String text) { 102 | setText(text, true); 103 | } 104 | 105 | public void setText(String text, boolean ul) { 106 | String link = ul ? "" + text + "" : text; 107 | super.setText("" + link + ""); 108 | this.text = text; 109 | } 110 | 111 | public String getRawText() { 112 | return text; 113 | } 114 | 115 | private static void open(URI uri) { 116 | if (Desktop.isDesktopSupported()) { 117 | Desktop desktop = Desktop.getDesktop(); 118 | try { 119 | desktop.browse(uri); 120 | } catch (IOException e) { 121 | JOptionPane.showMessageDialog(null, "Failed to launch the link, your computer is likely misconfigured.", "Cannot Launch Link", JOptionPane.WARNING_MESSAGE); 122 | } 123 | } else { 124 | JOptionPane.showMessageDialog(null, "Java is not able to launch links on your computer.", "Cannot Launch Link", JOptionPane.WARNING_MESSAGE); 125 | } 126 | } 127 | } -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/utilities/ByteArrayInOutStream.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.utilities; 2 | 3 | import java.io.ByteArrayInputStream; 4 | import java.io.ByteArrayOutputStream; 5 | 6 | /** 7 | * This class extends the ByteArrayOutputStream by providing a method that 8 | * returns a new ByteArrayInputStream which uses the internal byte array buffer. 9 | * This buffer is not copied, so no additional memory is used. After creating 10 | * the ByteArrayInputStream the instance of the ByteArrayInOutStream can not be 11 | * used anymore. 12 | *

13 | * The ByteArrayInputStream can be retrieved using getInputStream(). 14 | * 15 | * @author Nick Russler 16 | */ 17 | public class ByteArrayInOutStream extends ByteArrayOutputStream { 18 | /** 19 | * Creates a new ByteArrayInOutStream. The buffer capacity is initially 32 20 | * bytes, though its size increases if necessary. 21 | */ 22 | public ByteArrayInOutStream() { 23 | super(); 24 | } 25 | 26 | /** 27 | * Creates a new ByteArrayInOutStream, with a buffer capacity of the 28 | * specified size, in bytes. 29 | * 30 | * @param size 31 | * the initial size. 32 | * @exception IllegalArgumentException 33 | * if size is negative. 34 | */ 35 | public ByteArrayInOutStream(int size) { 36 | super(size); 37 | } 38 | 39 | /** 40 | * Creates a new ByteArrayInputStream that uses the internal byte array 41 | * buffer of this ByteArrayInOutStream instance as its buffer array. The 42 | * initial value of pos is set to zero and the initial value of count is the 43 | * number of bytes that can be read from the byte array. The buffer array is 44 | * not copied. This instance of ByteArrayInOutStream can not be used anymore 45 | * after calling this method. 46 | * 47 | * @return the ByteArrayInputStream instance 48 | */ 49 | public ByteArrayInputStream getInputStream() { 50 | // create new ByteArrayInputStream that respects the current count 51 | ByteArrayInputStream in = new ByteArrayInputStream(this.buf, 0, this.count); 52 | 53 | // set the buffer of the ByteArrayOutputStream 54 | // to null so it can't be altered anymore 55 | this.buf = null; 56 | 57 | return in; 58 | } 59 | } -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/utilities/EXEFileInfo.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.utilities; 2 | 3 | import com.sun.jna.Memory; 4 | import com.sun.jna.Pointer; 5 | import com.sun.jna.platform.win32.VerRsrc.VS_FIXEDFILEINFO; 6 | import com.sun.jna.ptr.IntByReference; 7 | import com.sun.jna.ptr.PointerByReference; 8 | 9 | public class EXEFileInfo { 10 | public static int MAJOR = 0; 11 | public static int MINOR = 1; 12 | public static int BUILD = 2; 13 | public static int REVISION = 3; 14 | 15 | public static int getMajorVersionOfProgram(String path) { 16 | return getVersionInfo(path)[MAJOR]; 17 | } 18 | 19 | public static int getMinorVersionOfProgram(String path) { 20 | return getVersionInfo(path)[MINOR]; 21 | } 22 | 23 | public static int getBuildOfProgram(String path) { 24 | return getVersionInfo(path)[BUILD]; 25 | } 26 | 27 | public static int getRevisionOfProgram(String path) { 28 | return getVersionInfo(path)[REVISION]; 29 | } 30 | 31 | public static int[] getVersionInfo(String path) { 32 | IntByReference dwDummy = new IntByReference(); 33 | dwDummy.setValue(0); 34 | 35 | int versionlength = com.sun.jna.platform.win32.Version.INSTANCE.GetFileVersionInfoSize(path, dwDummy); 36 | 37 | byte[] bufferarray = new byte[versionlength]; 38 | Pointer lpData = new Memory(bufferarray.length); 39 | PointerByReference lplpBuffer = new PointerByReference(); 40 | IntByReference puLen = new IntByReference(); 41 | boolean fileInfoResult = com.sun.jna.platform.win32.Version.INSTANCE.GetFileVersionInfo(path, 0, versionlength, lpData); 42 | boolean verQueryVal = com.sun.jna.platform.win32.Version.INSTANCE.VerQueryValue(lpData, "\\", lplpBuffer, puLen); 43 | 44 | VS_FIXEDFILEINFO lplpBufStructure = new VS_FIXEDFILEINFO(lplpBuffer.getValue()); 45 | lplpBufStructure.read(); 46 | 47 | int v1 = (lplpBufStructure.dwFileVersionMS).intValue() >> 16; 48 | int v2 = (lplpBufStructure.dwFileVersionMS).intValue() & 0xffff; 49 | int v3 = (lplpBufStructure.dwFileVersionLS).intValue() >> 16; 50 | int v4 = (lplpBufStructure.dwFileVersionLS).intValue() & 0xffff; 51 | return new int[] { v1, v2, v3, v4 }; 52 | } 53 | 54 | public static Version getVersion(String path) { 55 | IntByReference dwDummy = new IntByReference(); 56 | dwDummy.setValue(0); 57 | 58 | int versionlength = com.sun.jna.platform.win32.Version.INSTANCE.GetFileVersionInfoSize(path, dwDummy); 59 | 60 | byte[] bufferarray = new byte[versionlength]; 61 | Pointer lpData = new Memory(bufferarray.length); 62 | PointerByReference lplpBuffer = new PointerByReference(); 63 | IntByReference puLen = new IntByReference(); 64 | boolean fileInfoResult = com.sun.jna.platform.win32.Version.INSTANCE.GetFileVersionInfo(path, 0, versionlength, lpData); 65 | boolean verQueryVal = com.sun.jna.platform.win32.Version.INSTANCE.VerQueryValue(lpData, "\\", lplpBuffer, puLen); 66 | 67 | VS_FIXEDFILEINFO lplpBufStructure = new VS_FIXEDFILEINFO(lplpBuffer.getValue()); 68 | lplpBufStructure.read(); 69 | 70 | int v1 = (lplpBufStructure.dwFileVersionMS).intValue() >> 16; 71 | int v2 = (lplpBufStructure.dwFileVersionMS).intValue() & 0xffff; 72 | int v3 = (lplpBufStructure.dwFileVersionLS).intValue() >> 16; 73 | int v4 = (lplpBufStructure.dwFileVersionLS).intValue() & 0xffff; 74 | return new Version(v1 + "." + v2 + "." + v3 + "." + v4); 75 | } 76 | 77 | /** 78 | * Compares two version strings. 79 | * 80 | * Use this instead of String.compareTo() for a non-lexicographical 81 | * comparison that works for version strings. e.g. "1.10".compareTo("1.6"). 82 | * 83 | * @note It does not work if "1.10" is supposed to be equal to "1.10.0". 84 | * 85 | * @param str1 86 | * a string of ordinal numbers separated by decimal points. 87 | * @param str2 88 | * a string of ordinal numbers separated by decimal points. 89 | * @return The result is a negative integer if str1 is _numerically_ less 90 | * than str2. The result is a positive integer if str1 is 91 | * _numerically_ greater than str2. The result is zero if the 92 | * strings are _numerically_ equal. 93 | */ 94 | public static int versionCompare(String str1, String str2) { 95 | String[] vals1 = str1.split("\\."); 96 | String[] vals2 = str2.split("\\."); 97 | int i = 0; 98 | // set index to first non-equal ordinal or length of shortest version string 99 | while (i < vals1.length && i < vals2.length && vals1[i].equals(vals2[i])) { 100 | i++; 101 | } 102 | // compare first non-equal ordinal number 103 | if (i < vals1.length && i < vals2.length) { 104 | int diff = Integer.valueOf(vals1[i]).compareTo(Integer.valueOf(vals2[i])); 105 | return Integer.signum(diff); 106 | } 107 | // the strings are equal or one string is a substring of the other 108 | // e.g. "1.2.3" = "1.2.3" or "1.2.3" < "1.2.3.4" 109 | return Integer.signum(vals1.length - vals2.length); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/utilities/MD5Checksum.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.utilities; 2 | 3 | import java.io.*; 4 | import java.security.MessageDigest; 5 | 6 | public class MD5Checksum { 7 | 8 | public static byte[] createChecksum(String filename) throws Exception { 9 | InputStream fis = new FileInputStream(filename); 10 | 11 | byte[] buffer = new byte[1024]; 12 | MessageDigest complete = MessageDigest.getInstance("MD5"); 13 | int numRead; 14 | 15 | do { 16 | numRead = fis.read(buffer); 17 | if (numRead > 0) { 18 | complete.update(buffer, 0, numRead); 19 | } 20 | } while (numRead != -1); 21 | 22 | fis.close(); 23 | return complete.digest(); 24 | } 25 | 26 | // see this How-to for a faster way to convert 27 | // a byte array to a HEX string 28 | public static String getMD5Checksum(String filename) throws Exception { 29 | byte[] b = createChecksum(filename); 30 | String result = ""; 31 | 32 | for (int i=0; i < b.length; i++) { 33 | result += Integer.toString( ( b[i] & 0xff ) + 0x100, 16).substring( 1 ); 34 | } 35 | return result; 36 | } 37 | } -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/utilities/NexusModsAPI.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.utilities; 2 | 3 | import com.me3tweaks.modmanager.ModManager; 4 | import com.me3tweaks.modmanager.utilities.nexusmods.NexusModsFileInfo; 5 | import org.apache.commons.io.FileUtils; 6 | import org.apache.http.client.fluent.Request; 7 | import org.json.simple.JSONArray; 8 | import org.json.simple.JSONObject; 9 | import org.json.simple.parser.JSONParser; 10 | 11 | import java.io.File; 12 | 13 | public class NexusModsAPI { 14 | private static String API_ENDPOINT_BASE = "https://api.nexusmods.com/v1/"; 15 | private static String PERSONAL_API_KEY = ""; 16 | private static String SSO_API_KEY = ""; 17 | private static String GAME_NAME = "masseffect3"; 18 | 19 | public static NexusModsFileInfo GetModInfoByMD5(String md5) { 20 | try { 21 | ModManager.debugLogger.writeMessage("Looking up mod info on nexusmods via MD5: "+md5); 22 | if (PERSONAL_API_KEY.equals("")) { LoadAPIKeyFromDisk(); } 23 | String md5SeachResult = Request.Get(API_ENDPOINT_BASE + "games/" + GAME_NAME + "/mods/md5_search/" + md5 + ".json") 24 | .addHeader("apikey", PERSONAL_API_KEY) 25 | .setHeader("User-Agent", "Mass Effect 3 Mod Manager/Build " + ModManager.BUILD_NUMBER + " (Java) on " + System.getProperty("os.name")) 26 | .execute().returnContent().asString(); 27 | 28 | JSONParser parser = new JSONParser(); 29 | JSONArray results = (JSONArray) parser.parse(md5SeachResult); 30 | if (results.size() != 1) { 31 | return null; //More or less than one result. 32 | } 33 | return new NexusModsFileInfo((JSONObject)((JSONObject)results.get(0)).get("file_details")); 34 | } catch (Exception e) { 35 | ModManager.debugLogger.writeError("Error getting mod info by MD5: "+e.getMessage()); 36 | } 37 | return null; 38 | } 39 | 40 | 41 | /** 42 | * Loads your personal API key from disk. Do not commit this file to a repository. 43 | */ 44 | public static void LoadAPIKeyFromDisk() { 45 | try { 46 | PERSONAL_API_KEY = FileUtils.readFileToString(new File("NM_PersonalAPIKey.txt"), "UTF-8"); 47 | ModManager.debugLogger.writeMessage("Loaded NexusMods API key from disk"); 48 | } catch (Exception e) { 49 | ModManager.debugLogger.writeError("Could not read personal API key from disk"); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/utilities/Version.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.utilities; 2 | 3 | public class Version implements Comparable { 4 | 5 | private String version; 6 | 7 | public final String get() { 8 | return this.version; 9 | } 10 | 11 | public Version(String version) { 12 | if (version == null) 13 | throw new IllegalArgumentException("Version can not be null"); 14 | if (!version.matches("[0-9]+(\\.[0-9]+)*")) 15 | throw new IllegalArgumentException("Invalid version format"); 16 | this.version = version; 17 | } 18 | 19 | @Override 20 | public int compareTo(Version that) { 21 | if (that == null) 22 | return 1; 23 | String[] thisParts = this.get().split("\\."); 24 | String[] thatParts = that.get().split("\\."); 25 | int length = Math.max(thisParts.length, thatParts.length); 26 | for (int i = 0; i < length; i++) { 27 | int thisPart = i < thisParts.length ? Integer.parseInt(thisParts[i]) : 0; 28 | int thatPart = i < thatParts.length ? Integer.parseInt(thatParts[i]) : 0; 29 | if (thisPart < thatPart) 30 | return -1; 31 | if (thisPart > thatPart) 32 | return 1; 33 | } 34 | return 0; 35 | } 36 | 37 | @Override 38 | public boolean equals(Object that) { 39 | if (this == that) 40 | return true; 41 | if (that == null) 42 | return false; 43 | if (this.getClass() != that.getClass()) 44 | return false; 45 | return this.compareTo((Version) that) == 0; 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | return version; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/utilities/datatypeconverter/Messages.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.utilities.datatypeconverter; 2 | 3 | /* 4 | * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. 5 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6 | * 7 | * This code is free software; you can redistribute it and/or modify it 8 | * under the terms of the GNU General Public License version 2 only, as 9 | * published by the Free Software Foundation. Sun designates this 10 | * particular file as subject to the "Classpath" exception as provided 11 | * by Sun in the LICENSE file that accompanied this code. 12 | * 13 | * This code is distributed in the hope that it will be useful, but WITHOUT 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 16 | * version 2 for more details (a copy is included in the LICENSE file that 17 | * accompanied this code). 18 | * 19 | * You should have received a copy of the GNU General Public License version 20 | * 2 along with this work; if not, write to the Free Software Foundation, 21 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 22 | * 23 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 24 | * CA 95054 USA or visit www.sun.com if you need additional information or 25 | * have any questions. 26 | */ 27 | 28 | import java.text.MessageFormat; 29 | import java.util.ResourceBundle; 30 | 31 | /** 32 | * Formats error messages. 33 | */ 34 | class Messages { 35 | static String format(String property) { 36 | return format(property, null); 37 | } 38 | 39 | static String format(String property, Object arg1) { 40 | return format(property, new Object[] { arg1 }); 41 | } 42 | 43 | static String format(String property, Object arg1, Object arg2) { 44 | return format(property, new Object[] { arg1, arg2 }); 45 | } 46 | 47 | static String format(String property, Object arg1, Object arg2, Object arg3) { 48 | return format(property, new Object[] { arg1, arg2, arg3 }); 49 | } 50 | 51 | // add more if necessary. 52 | 53 | /** Loads a string resource and formats it with specified arguments. */ 54 | static String format(String property, Object[] args) { 55 | String text = ResourceBundle.getBundle(Messages.class.getName()).getString(property); 56 | return MessageFormat.format(text, args); 57 | } 58 | 59 | // 60 | // 61 | // Message resources 62 | // 63 | // 64 | static final String PROVIDER_NOT_FOUND = // 1 arg 65 | "ContextFinder.ProviderNotFound"; 66 | 67 | static final String COULD_NOT_INSTANTIATE = // 2 args 68 | "ContextFinder.CouldNotInstantiate"; 69 | 70 | static final String CANT_FIND_PROPERTIES_FILE = // 1 arg 71 | "ContextFinder.CantFindPropertiesFile"; 72 | 73 | static final String CANT_MIX_PROVIDERS = // 0 args 74 | "ContextFinder.CantMixProviders"; 75 | 76 | static final String MISSING_PROPERTY = // 2 args 77 | "ContextFinder.MissingProperty"; 78 | 79 | static final String NO_PACKAGE_IN_CONTEXTPATH = // 0 args 80 | "ContextFinder.NoPackageInContextPath"; 81 | 82 | static final String NAME_VALUE = // 2 args 83 | "PropertyException.NameValue"; 84 | 85 | static final String CONVERTER_MUST_NOT_BE_NULL = // 0 args 86 | "DatatypeConverter.ConverterMustNotBeNull"; 87 | 88 | static final String ILLEGAL_CAST = // 2 args 89 | "JAXBContext.IllegalCast"; 90 | } -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/utilities/nexusmods/NexusModsFileInfo.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.utilities.nexusmods; 2 | 3 | import org.json.simple.JSONObject; 4 | 5 | public class NexusModsFileInfo { 6 | public final long file_id; 7 | public final String name; 8 | public final String version; 9 | public final long size; 10 | public final String changeloghtml; 11 | public final String md5; 12 | public final String mod_version; 13 | public final String file_name; 14 | 15 | /** 16 | * Information about a file on NexusMods. Note this is not a mod, but rather a file download. 17 | * @param jsonObj 18 | */ 19 | public NexusModsFileInfo(JSONObject jsonObj) { 20 | file_id = (long) jsonObj.get("file_id"); 21 | name = (String) jsonObj.get("name"); 22 | version = (String) jsonObj.get("version"); 23 | size = (long) jsonObj.get("size"); 24 | file_name = (String) jsonObj.get("file_name"); 25 | mod_version = (String) jsonObj.get("mod_version"); 26 | md5 = (String) jsonObj.get("md5"); 27 | changeloghtml = (String) jsonObj.get("changelog_html"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/utilities/nexusmods/NexusModsMod.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.utilities.nexusmods; 2 | 3 | import org.json.simple.JSONObject; 4 | 5 | public class NexusModsMod { 6 | public final String name; 7 | public final String summary; 8 | public final String description; 9 | public final String picture_url; 10 | public final int mod_id; 11 | public final String version; 12 | public final String author; 13 | 14 | public NexusModsMod(JSONObject obj) { 15 | name = (String) obj.get("name"); 16 | summary = (String) obj.get("summary"); 17 | description = (String) obj.get("description"); 18 | picture_url = (String) obj.get("picture_url"); 19 | mod_id = (int) obj.get("mod_id"); 20 | version = (String) obj.get("version"); 21 | author = (String) obj.get("author"); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/bioai/Range.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.bioai; 2 | 3 | public class Range { 4 | double X, Y; 5 | /** 6 | * BioAI range value, in the form of (X=1.8f,Y=2.0f). 7 | * @param value String to parse 8 | */ 9 | public Range(String value) { 10 | //get name 11 | String workingStr; 12 | int charIndex = value.indexOf('='); // first =, marks start of X value 13 | workingStr = value.substring(charIndex+1); //start of X 14 | charIndex = workingStr.indexOf(','); // marks the end of X value 15 | X = Double.parseDouble(workingStr.substring(0, charIndex)); 16 | workingStr = workingStr.substring(charIndex); //clip off all of X. 17 | 18 | charIndex = workingStr.indexOf('='); // second =, marks start of Y value 19 | workingStr = workingStr.substring(charIndex+1); //start of Y 20 | charIndex = workingStr.indexOf(')'); //end of Y value 21 | Y = Double.parseDouble(workingStr.substring(0, charIndex)); 22 | } 23 | 24 | /*public String toString(){ 25 | String str = difficulty; 26 | str+="\nStats:\n"; 27 | for (Enemy stat : enemies){ 28 | str+=stat.toString()+"\n"; 29 | } 30 | return str; 31 | }*/ 32 | 33 | public String createWaveString() { 34 | StringBuilder str = new StringBuilder(); 35 | str.append("(X="); 36 | str.append(X); 37 | str.append("f,Y="); 38 | str.append(Y); 39 | str.append("f)"); 40 | return str.toString(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/biodifficulty/Category.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.biodifficulty; 2 | 3 | import java.util.ArrayList; 4 | 5 | import com.me3tweaks.modmanager.ModManager; 6 | 7 | 8 | public class Category { 9 | public String categoryname; 10 | ArrayList stats; 11 | public static String ENTRY_TEMPLATE = "\t\t\t\t\t

\n" 12 | + "\t\t\t\t\t\t
\n" 13 | + "\t\t\t\t\t\t\tHUMANNAME\n" 14 | + "\t\t\t\t\t\t\tDefault: PREFIX<\\?=\\$defaultsmod->TABLENAME_VARNAME[\\$difficulty];?>POSTFIX\n" 15 | + "\t\t\t\t\t\t
\n" 16 | + "\t\t\t\t\t\tTABLENAME_VARNAME[\\$difficulty];?>\">\n" 17 | + "\t\t\t\t\t
\n"; 18 | 19 | public Category(String value) { 20 | //get name 21 | String workingStr; 22 | int charIndex = value.indexOf('\"'); // first ", which is the lead into the name. 23 | workingStr = value.substring(charIndex+1); 24 | charIndex = workingStr.indexOf('\"'); // second " which is the end of the name. clip this to get what we want. 25 | categoryname = workingStr.substring(0, charIndex); 26 | //System.out.println("Processing: "+categoryname); 27 | workingStr = workingStr.substring(charIndex); 28 | charIndex = workingStr.indexOf('('); 29 | workingStr = workingStr.substring(charIndex+1); //start of stats array (removing the leading ( because of CategoryData = ( ). 30 | //Clip the ending two )) 31 | workingStr = workingStr.substring(0, workingStr.length()-2); 32 | 33 | //generate stats 34 | stats = new ArrayList(); 35 | 36 | charIndex = 0; 37 | int openBraces = 0; 38 | while (workingStr.length() > 0){ 39 | if (workingStr.charAt(charIndex) == '(') { 40 | openBraces++; 41 | charIndex++; 42 | //System.out.println("open brace, charindex: "+charIndex); 43 | continue; 44 | } 45 | if (workingStr.charAt(charIndex) == ')') { 46 | openBraces--; 47 | //System.out.println("close brace, ones left open: "+openBraces); 48 | charIndex++; 49 | if (openBraces == 0) { 50 | //we finished one item 51 | stats.add(new Stat(workingStr.substring(0, charIndex))); 52 | if (charIndex < workingStr.length()){ 53 | workingStr = workingStr.substring(charIndex+1); 54 | //System.out.println("Remaining workingStr: "+workingStr); 55 | } else { 56 | //System.out.println("End of string"); 57 | break; 58 | } 59 | charIndex = 0; 60 | } else if (openBraces < 0) { 61 | //System.out.println("Category Finished"); 62 | break; 63 | } 64 | continue; 65 | } 66 | //its none of the above 2 67 | charIndex++; 68 | } 69 | //category finished. 70 | } 71 | 72 | public void merge(Category mergeFrom) { 73 | for (Stat stat : mergeFrom.stats){ 74 | Stat statToUpdate = null; 75 | //merge that one into this one 76 | for (Stat localstat : stats) { 77 | //find our local stat that matches that one. 78 | //System.out.println("Comparing stat names: "+localstat.statname+" vs "+stat.statname); 79 | if (localstat.statname.equals(stat.statname)) { 80 | 81 | statToUpdate = localstat; 82 | break; 83 | } 84 | //keep looping. 85 | } 86 | if (statToUpdate == null) { 87 | //Check to make sure it isn't MPGlobal, as we have to add a stat to it. 88 | if (stat.statname.equals("ExtractionCredits")) { 89 | //System.out.println("EXTRACTION CREDITS FOUND."); 90 | Stat createdStat = new Stat(stat.createStatString()); //clone 91 | stats.add(createdStat); 92 | statToUpdate = createdStat; 93 | } else { 94 | //error 95 | ModManager.debugLogger.writeMessage("DIDN'T FIND STAT TO MERGE: "+stat.statname+", listing stats:"); 96 | ModManager.debugLogger.writeMessage("NEWDATA:"); 97 | ModManager.debugLogger.writeMessage(mergeFrom.toString()); 98 | ModManager.debugLogger.writeMessage("EXISTINGDATA:"); 99 | ModManager.debugLogger.writeMessage(this.toString()); 100 | return; 101 | } 102 | } 103 | //System.out.println("Merging: "+stat.statname); 104 | statToUpdate.statrange = stat.statrange; 105 | } 106 | } 107 | 108 | public String createCategoryString(){ 109 | StringBuilder str = new StringBuilder(); 110 | str.append("(Category=\""); 111 | str.append(categoryname); 112 | str.append("\", CategoryData=("); 113 | boolean firststat = true; 114 | for (Stat stat : stats) { 115 | if (firststat) { 116 | firststat = false; 117 | } else { 118 | str.append(","); 119 | } 120 | str.append(stat.createStatString()); 121 | } 122 | str.append("))"); //close categorydata, category 123 | return str.toString(); 124 | } 125 | 126 | 127 | public String toString(){ 128 | String str = categoryname; 129 | str+="\nStats:\n"; 130 | for (Stat stat : stats){ 131 | str+=stat.toString()+"\n"; 132 | } 133 | return str; 134 | } 135 | 136 | public boolean matchIdentifiers(Category importing) { 137 | ModManager.debugLogger.writeMessage("Matching "+categoryname+" against "+importing.categoryname); 138 | return categoryname.equals(importing.categoryname); 139 | } 140 | 141 | public String toCSV() { 142 | String str = categoryname; 143 | str+="\n"; 144 | for (Stat stat : stats){ 145 | str+=stat.toCSV()+"\n"; 146 | } 147 | return str; 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/biodifficulty/Stat.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.biodifficulty; 2 | 3 | public class Stat { 4 | String statname; 5 | StatRange statrange; 6 | 7 | public Stat(String str) { 8 | //System.out.println("Creating stat from string: "+str); 9 | String workingStr; 10 | int charIndex = str.indexOf('\"'); // first ", which is the lead into the name. 11 | workingStr = str.substring(charIndex+1); 12 | charIndex = workingStr.indexOf('\"'); // second " which is the end of the name. clip this to get what we want. 13 | statname = workingStr.substring(0, charIndex); 14 | workingStr = workingStr.substring(charIndex+2);//bypass " and , 15 | charIndex = workingStr.indexOf('='); //statrange start. 16 | workingStr = workingStr.substring(charIndex+1); 17 | 18 | charIndex = workingStr.indexOf('='); //x stat start 19 | workingStr = workingStr.substring(charIndex+1); 20 | 21 | charIndex = workingStr.indexOf(','); //x stat end 22 | String xstat = workingStr.substring(0, charIndex); 23 | //check for 2 decimal points (Engineer - thanks bioware!) 24 | int secondDecimalIndex = xstat.indexOf(".", xstat.indexOf(".") + 1); 25 | if (secondDecimalIndex != -1){ 26 | StringBuilder sb = new StringBuilder(xstat); 27 | sb.deleteCharAt(secondDecimalIndex); 28 | xstat = sb.toString(); 29 | } 30 | 31 | workingStr = workingStr.substring(charIndex); 32 | 33 | charIndex = workingStr.indexOf('='); //y stat start 34 | workingStr = workingStr.substring(charIndex+1); 35 | charIndex = workingStr.indexOf(')'); //y stat end 36 | String ystat = workingStr.substring(0, charIndex); 37 | secondDecimalIndex = ystat.indexOf(".", ystat.indexOf(".") + 1); 38 | if (secondDecimalIndex != -1){ 39 | StringBuilder sb = new StringBuilder(ystat); 40 | sb.deleteCharAt(secondDecimalIndex); 41 | ystat = sb.toString(); 42 | } 43 | statrange = new StatRange(xstat,ystat); 44 | } 45 | 46 | public String toString(){ 47 | String str = statname+" : "+statrange.toString(); 48 | return str; 49 | } 50 | 51 | public String createStatString() { 52 | StringBuilder str = new StringBuilder(); 53 | str.append("(StatName=\""); 54 | str.append(statname); 55 | str.append("\","); 56 | str.append(statrange.createStatString()); 57 | str.append(")"); //end stat 58 | return str.toString(); 59 | } 60 | 61 | public String toCSV() { 62 | String str = statname+","+statrange.toCSV(); 63 | return str; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/biodifficulty/StatRange.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.biodifficulty; 2 | 3 | 4 | public class StatRange { 5 | boolean isfloat = false; 6 | double floatx, floaty; 7 | int intx, inty; 8 | 9 | public StatRange(String xstat, String ystat) { 10 | try { 11 | Integer.parseInt(xstat); 12 | if (!xstat.contains("f") && !ystat.contains("f")){ 13 | this.intx = Integer.parseInt(xstat); 14 | this.inty = Integer.parseInt(ystat); 15 | isfloat = false; 16 | } 17 | } catch (NumberFormatException e) { 18 | this.floatx = Double.parseDouble(xstat.substring(0, xstat.length()-1)); 19 | this.floaty = Double.parseDouble(ystat.substring(0, ystat.length()-1)); 20 | isfloat = true; 21 | } 22 | } 23 | 24 | public String toString(){ 25 | if (isfloat) { 26 | return floatx +" - "+floaty; 27 | } else { 28 | return intx +" - "+inty; 29 | } 30 | } 31 | 32 | public String createStatString() { 33 | StringBuilder str = new StringBuilder(); 34 | str.append("StatRange=(X="); 35 | str.append((this.isfloat) ? this.floatx : this.intx); 36 | str.append("f,Y="); //append f, start Y 37 | str.append((this.isfloat) ? this.floaty : this.inty); 38 | str.append("f)"); //append f 39 | return str.toString(); 40 | } 41 | 42 | public String toCSV() { 43 | if (isfloat) { 44 | return floatx +","+floaty; 45 | } else { 46 | return intx +","+inty; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/bioweapon/Range.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.bioweapon; 2 | 3 | public class Range { 4 | double doubleX, doubleY; 5 | int intX, intY; 6 | boolean isInt = false; 7 | /** 8 | * BioAI range value, in the form of (X=1.8f,Y=2.0f). 9 | * @param value String to parse 10 | */ 11 | public Range(String value) { 12 | //get name 13 | String workingStr; 14 | int charIndex = value.indexOf('='); // first =, marks start of X value 15 | workingStr = value.substring(charIndex+1); //start of X 16 | charIndex = workingStr.indexOf(','); // marks the end of X value 17 | try { 18 | intX = Integer.parseInt(workingStr.substring(0, charIndex)); 19 | isInt = true; 20 | } catch (NumberFormatException e) { 21 | isInt = false; 22 | } 23 | if (!isInt) { 24 | doubleX = Double.parseDouble(workingStr.substring(0, charIndex)); 25 | } 26 | workingStr = workingStr.substring(charIndex); //clip off all of X. 27 | 28 | charIndex = workingStr.indexOf('='); // second =, marks start of Y value 29 | workingStr = workingStr.substring(charIndex+1); //start of Y 30 | charIndex = workingStr.indexOf(')'); //end of Y value 31 | if (isInt) { 32 | intY = Integer.parseInt(workingStr.substring(0, charIndex)); 33 | } else { 34 | doubleY = Double.parseDouble(workingStr.substring(0, charIndex)); 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/enemytype/EnemyType.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.enemytype; 2 | 3 | /** 4 | * Used for array properties: (EnemyType="X"... matching 5 | * This does not have output for this construct. ModMaker will require a full assignment of this value. 6 | * @author Michael 7 | * 8 | */ 9 | public class EnemyType { 10 | String enemyname; 11 | 12 | public EnemyType(String str) { 13 | //System.out.println(str); 14 | String workingStr; 15 | //(EnemyType="WAVE_RPR_Husk" 16 | int charIndex = str.indexOf('\"'); // first ", which is the lead into the name. 17 | workingStr = str.substring(charIndex + 1); 18 | charIndex = workingStr.indexOf('\"'); // second " which is the end of the name. clip this to get what we want. 19 | enemyname = workingStr.substring(0, charIndex); 20 | } 21 | 22 | public String toString() { 23 | return enemyname; 24 | } 25 | 26 | public boolean matchIdentifiers(EnemyType other) { 27 | return enemyname.equals(other.enemyname); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/id/ID.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.id; 2 | 3 | import com.me3tweaks.modmanager.ModManager; 4 | 5 | public class ID { 6 | public int ID; 7 | 8 | public ID(String value) { 9 | //get id 10 | String workingStr; 11 | int charIndex = value.indexOf('='); // first = 12 | workingStr = value.substring(charIndex + 1); 13 | charIndex = workingStr.indexOf(','); // marks the end of ID 14 | try { 15 | ID = Integer.parseInt(workingStr.substring(0, charIndex)); 16 | } catch (NumberFormatException e) { 17 | ModManager.debugLogger.writeError("ID IS NOT A NUMBER: " + workingStr.substring(0, charIndex)); 18 | } 19 | } 20 | 21 | public String toString() { 22 | return "ID: " + ID; 23 | } 24 | 25 | public boolean matchIdentifiers(ID importing) { 26 | return ID == importing.ID; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/mpstorepack/Card.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.mpstorepack; 2 | 3 | public abstract class Card { 4 | public enum Rarity { //rarity is the background of the card. 5 | Common("Rarity_Common"), //blue 6 | Uncommon("Rarity_Uncommon"), //silver 7 | Rare("Rarity_Rare"), //gold 8 | UltraRare("Rarity_UltraRare"), //black 9 | Unused("Rarity_Unused") //red 10 | ; 11 | 12 | private final String raritytext; 13 | 14 | /** 15 | * @param text 16 | */ 17 | private Rarity(final String text) { 18 | this.raritytext = text; 19 | } 20 | 21 | @Override 22 | public String toString() { 23 | return raritytext; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/mpstorepack/CardPool.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.mpstorepack; 2 | 3 | import java.util.TreeSet; 4 | 5 | import com.me3tweaks.modmanager.valueparsers.ValueParserLib; 6 | 7 | public class CardPool implements Comparable { 8 | private String poolname; 9 | private TreeSet poolContents; 10 | String inputStr; 11 | 12 | public CardPool(String poolString) { 13 | poolname = ValueParserLib.getStringProperty(poolString, "PoolName", true); 14 | poolContents = new TreeSet(); 15 | inputStr = poolString; 16 | } 17 | 18 | public boolean removeCard(PoolCard card) { 19 | return poolContents.remove(card); 20 | } 21 | 22 | public void addCard(PoolCard card) { 23 | poolContents.add(card); 24 | } 25 | 26 | public TreeSet getPoolContents() { 27 | return poolContents; 28 | } 29 | 30 | public void setPoolContents(TreeSet poolContents) { 31 | this.poolContents = poolContents; 32 | } 33 | 34 | public String getPoolname() { 35 | return poolname; 36 | } 37 | 38 | public void setPoolname(String poolname) { 39 | this.poolname = poolname; 40 | } 41 | 42 | public String getPoolHTML() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append("

Card Pool

\n"); 45 | sb.append("

" + getPoolname() + "

\n"); 46 | sb.append("

Slots in a store pack draw from a list of pools. Each slot can have independent pools from each other.

\n"); 47 | sb.append("
\n"); 48 | sb.append("
"); 49 | 50 | if (poolContents.size() > 0) { 51 | sb.append("

Cards in this pool

\n"); 52 | sb.append("
"); 53 | sb.append("
"); 54 | 55 | //MAIN POOLS 56 | for (PoolCard pcard : poolContents) { 57 | //these are only placeholder pools. we need to fetch the real ones 58 | RealCard realcard = CardParser.getRealCardFromPoolCard(pcard); 59 | if (realcard != null) { 60 | sb.append(realcard.getCardpageHTML()); 61 | } else { 62 | // System.err.println("POOL CARD HAS NO STORE DEFINITION: "+card); 63 | } 64 | } 65 | sb.append("
"); 66 | } else { 67 | sb.append("

This pool is empty.

If this pool is chosen by a pack, it will automatically choose the backup pool instead.

\n"); 68 | } 69 | 70 | sb.append("
"); 71 | return sb.toString(); 72 | 73 | } 74 | 75 | @Override 76 | public String toString() { 77 | return "CardPool [poolname=" + poolname + ", poolContents=" + poolContents + ", inputStr=" + inputStr + "]"; 78 | } 79 | 80 | @Override 81 | public int compareTo(CardPool other) { 82 | // compareTo should return < 0 if this is supposed to be 83 | // less than other, > 0 if this is supposed to be greater than 84 | // other and 0 if they are supposed to be equal 85 | return getPoolname().compareTo(other.getPoolname()); 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/mpstorepack/PackMetadata.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.mpstorepack; 2 | 3 | import java.util.ArrayList; 4 | 5 | import com.me3tweaks.modmanager.valueparsers.ValueParserLib; 6 | 7 | public class PackMetadata { 8 | //(nID=0, PackName="starter",Title=705015, SubTitle=, Description=705016, 9 | //CreditCost=0, srPromoString=703324, PerPlayerMax=1, 10 | //ImageData=(ImageLocation=EStoreImageLocation_Local, ImageReference="GUI_MPImages.StoreItems.Store001"), 11 | //RevealIntroTextureRef="GUI_MPImages.Creates.box", 12 | //RevealIntroHoloTextureRef="GUI_MPImages.Creates.boxHolo", RevealIntroSound=MPRevealCrate1) 13 | 14 | private String packname; 15 | private String title; 16 | private String description; 17 | private int cost; 18 | private String promotext; 19 | private int maxPurchases = 0; 20 | private String image; 21 | private int srTitle, srSubtitle, srDescription, srPromoString; 22 | 23 | public PackMetadata(String metadataStr) { 24 | packname = ValueParserLib.getStringProperty(metadataStr, "PackName", true); 25 | srTitle = ValueParserLib.getIntProperty(metadataStr, "Title"); 26 | srSubtitle = ValueParserLib.getIntProperty(metadataStr, "SubTitle"); 27 | srDescription = ValueParserLib.getIntProperty(metadataStr, "Description"); 28 | srPromoString = ValueParserLib.getIntProperty(metadataStr, "srPromoString"); 29 | maxPurchases = ValueParserLib.getIntProperty(metadataStr, "PerPlayerMax"); 30 | cost = ValueParserLib.getIntProperty(metadataStr, "CreditCost"); 31 | description = CardParser.tlkMap.get(srDescription); 32 | } 33 | 34 | public String getPackname() { 35 | return packname; 36 | } 37 | 38 | public void setPackname(String packname) { 39 | this.packname = packname; 40 | } 41 | 42 | public String getTitle() { 43 | return title; 44 | } 45 | 46 | public void setTitle(String title) { 47 | this.title = title; 48 | } 49 | 50 | public String getDescription() { 51 | return description; 52 | } 53 | 54 | public void setDescription(String description) { 55 | this.description = description; 56 | } 57 | 58 | public int getCost() { 59 | return cost; 60 | } 61 | 62 | public void setCost(int cost) { 63 | this.cost = cost; 64 | } 65 | 66 | public String getPromotext() { 67 | return promotext; 68 | } 69 | 70 | public void setPromotext(String promotext) { 71 | this.promotext = promotext; 72 | } 73 | 74 | public int getMaxPurchases() { 75 | return maxPurchases; 76 | } 77 | 78 | public void setMaxPurchases(int maxPurchases) { 79 | this.maxPurchases = maxPurchases; 80 | } 81 | 82 | public String getImage() { 83 | return image; 84 | } 85 | 86 | public void setImage(String image) { 87 | this.image = image; 88 | } 89 | 90 | public int getSrTitle() { 91 | return srTitle; 92 | } 93 | 94 | public void setSrTitle(int srTitle) { 95 | this.srTitle = srTitle; 96 | } 97 | 98 | public int getSrSubtitle() { 99 | return srSubtitle; 100 | } 101 | 102 | public void setSrSubtitle(int srSubtitle) { 103 | this.srSubtitle = srSubtitle; 104 | } 105 | 106 | public int getSrDescription() { 107 | return srDescription; 108 | } 109 | 110 | public void setSrDescription(int srDescription) { 111 | this.srDescription = srDescription; 112 | } 113 | 114 | public int getSrPromoString() { 115 | return srPromoString; 116 | } 117 | 118 | public void setSrPromoString(int srPromoString) { 119 | this.srPromoString = srPromoString; 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/mpstorepack/PackSlot.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.mpstorepack; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Stack; 6 | import java.util.regex.Matcher; 7 | import java.util.regex.Pattern; 8 | 9 | import com.me3tweaks.modmanager.valueparsers.ValueParserLib; 10 | 11 | public class PackSlot { 12 | private String packname; 13 | private int numCards; 14 | private ArrayList mainPools = new ArrayList(); 15 | private SlotPool backupPool; 16 | 17 | public PackSlot(String value) { 18 | packname = ValueParserLib.getStringProperty(value, "PackName", true); 19 | numCards = ValueParserLib.getIntProperty(value, "Quantity"); 20 | String backupPoolname = ValueParserLib.getStringProperty(value, "BackupPool", true); 21 | if (backupPoolname != null) { 22 | backupPool = new SlotPool("(PoolName=\"" + backupPoolname + "\")"); 23 | } 24 | 25 | String workingStr = value.substring(value.indexOf("Pools=") + 6); 26 | 27 | //Pools 28 | String matchingStr = workingStr; 29 | Matcher m = Pattern.compile("\\([a-zA-Z0-9=\",.]*\\)").matcher(workingStr); 30 | while (m.find()) { 31 | workingStr = matchingStr.substring(m.end()); 32 | mainPools.add(new SlotPool(m.group())); 33 | } 34 | 35 | if (mainPools.size() == 1) { 36 | mainPools.get(0).setPoolweight(1); 37 | } 38 | 39 | //Backup Pool, if any. 40 | 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return "PackSlot [packname=" + packname + ", numCards=" + numCards + ", mainPools=" + mainPools + ", backupPool=" + backupPool + "]"; 46 | } 47 | 48 | public String getDisplayString() { 49 | StringBuilder sb = new StringBuilder(); 50 | sb.append(numCards); 51 | sb.append(" card" + (numCards != 1 ? "s" : "")); 52 | sb.append(" from: "); 53 | for (SlotPool pool : mainPools) { 54 | sb.append("\n\t"); 55 | sb.append(pool.getPoolname()); 56 | } 57 | if (backupPool != null) { 58 | sb.append("\n\tBP: " + backupPool.getPoolname()); 59 | } 60 | return sb.toString(); 61 | } 62 | 63 | public String getPackname() { 64 | return packname; 65 | } 66 | 67 | public void setPackname(String packname) { 68 | this.packname = packname; 69 | } 70 | 71 | public int getNumCards() { 72 | return numCards; 73 | } 74 | 75 | public void setNumCards(int numCards) { 76 | this.numCards = numCards; 77 | } 78 | 79 | public ArrayList getMainPools() { 80 | return mainPools; 81 | } 82 | 83 | public void setMainPools(ArrayList mainPools) { 84 | this.mainPools = mainPools; 85 | } 86 | 87 | public SlotPool getBackupPool() { 88 | return backupPool; 89 | } 90 | 91 | public void setBackupPool(SlotPool backupPool) { 92 | this.backupPool = backupPool; 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/mpstorepack/SlotPool.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.mpstorepack; 2 | 3 | import java.util.TreeSet; 4 | 5 | import com.me3tweaks.modmanager.valueparsers.ValueParserLib; 6 | 7 | public class SlotPool implements Comparable { 8 | private String poolname; 9 | private double poolweight; 10 | private TreeSet poolContents; 11 | String inputStr; 12 | 13 | public SlotPool(String poolString) { 14 | poolname = ValueParserLib.getStringProperty(poolString, "PoolName", true); 15 | poolweight = ValueParserLib.getFloatProperty(poolString, "Weight"); 16 | inputStr = poolString; 17 | } 18 | 19 | public boolean removeCard(PoolCard card) { 20 | return poolContents.remove(card); 21 | } 22 | 23 | public void addCard(PoolCard card) { 24 | poolContents.add(card); 25 | } 26 | 27 | public TreeSet getPoolContents() { 28 | return poolContents; 29 | } 30 | 31 | public void setPoolContents(TreeSet poolContents) { 32 | this.poolContents = poolContents; 33 | } 34 | 35 | public String getPoolname() { 36 | return poolname; 37 | } 38 | 39 | public void setPoolname(String poolname) { 40 | this.poolname = poolname; 41 | } 42 | 43 | public double getPoolweight() { 44 | return poolweight; 45 | } 46 | 47 | public void setPoolweight(double poolweight) { 48 | this.poolweight = poolweight; 49 | } 50 | 51 | public String getPoolHTML() { 52 | StringBuilder sb = new StringBuilder(); 53 | sb.append("

Card Pool

\n"); 54 | sb.append("

" + getPoolname() + "

\n"); 55 | sb.append("

Slots in a store pack draw from a list of pools. Each slot can have independent pools from each other.

\n"); 56 | sb.append("
\n"); 57 | sb.append("
"); 58 | sb.append("

Cards in this pool

\n"); 59 | 60 | //MAIN POOLS 61 | for (PoolCard pcard : poolContents) { 62 | //these are only placeholder pools. we need to fetch the real ones 63 | RealCard realcard = CardParser.getRealCardFromPoolCard(pcard); 64 | if (realcard != null) { 65 | sb.append(realcard.getCardpageHTML()); 66 | } else { 67 | // System.err.println("POOL CARD HAS NO STORE DEFINITION: "+card); 68 | } 69 | } 70 | 71 | sb.append("
"); 72 | return sb.toString(); 73 | 74 | } 75 | 76 | @Override 77 | public String toString() { 78 | return "Pool [poolname=" + poolname + ", poolweight=" + poolweight + "]"; 79 | } 80 | 81 | @Override 82 | public int compareTo(SlotPool other) { 83 | // compareTo should return < 0 if this is supposed to be 84 | // less than other, > 0 if this is supposed to be greater than 85 | // other and 0 if they are supposed to be equal 86 | return getPoolname().compareTo(other.getPoolname()); 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/mpstorepack/WeightWrapper.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.mpstorepack; 2 | 3 | public class WeightWrapper { 4 | double weight; 5 | } 6 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/possessionwaves/Difficulty.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.possessionwaves; 2 | 3 | import com.me3tweaks.modmanager.ModManager; 4 | 5 | /** 6 | * Represents a PossessedWave array property. It's identifier is the Difficulty string. 7 | * @author Michael 8 | * 9 | */ 10 | public class Difficulty { 11 | public String difficulty; 12 | public Waves waves; 13 | public Difficulty(String str) { 14 | //get difficulty 15 | String workingStr; 16 | int charIndex = str.indexOf('='); // first =, which gets us to (Difficulty= 17 | workingStr = str.substring(charIndex+1); 18 | charIndex = workingStr.indexOf(','); // , following DO_LevelX 19 | difficulty = workingStr.substring(0, charIndex); 20 | workingStr = workingStr.substring(charIndex); 21 | charIndex = workingStr.indexOf('='); 22 | workingStr = workingStr.substring(charIndex+1, workingStr.length() - 1); //get rid of final ) and Waves= 23 | //System.out.println("Remaining str to do: "+workingStr); 24 | waves = new Waves(workingStr); 25 | return; 26 | } 27 | 28 | public void merge(Difficulty mergeFrom) { 29 | for(int i = 0; i < waves.possessionwaves.length; i++) { 30 | waves.possessionwaves[i] = mergeFrom.waves.possessionwaves[i]; 31 | } 32 | } 33 | 34 | public String createDifficultyString(){ 35 | StringBuilder str = new StringBuilder(); 36 | str.append("(Difficulty=\""); 37 | str.append(difficulty); 38 | str.append("\",Waves=("); 39 | str.append(waves.createWavesString()); 40 | str.append(")"); //close categorydata, category 41 | return str.toString(); 42 | } 43 | 44 | 45 | public String toString(){ 46 | String str = difficulty; 47 | str+="\nPossessed in wave:\n"; 48 | str+=waves.toString(); 49 | return str; 50 | } 51 | 52 | public boolean matchIdentifiers(Difficulty importing) { 53 | ModManager.debugLogger.writeMessage("[PossessionWaves]Matching "+difficulty+" against "+importing.difficulty); 54 | return difficulty.equals(importing.difficulty); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/possessionwaves/Waves.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.possessionwaves; 2 | 3 | import com.me3tweaks.modmanager.ModManager; 4 | 5 | public class Waves { 6 | public boolean[] possessionwaves = new boolean[11]; 7 | 8 | public Waves(String str) { 9 | //System.out.println("Parsing possessionwaves: "+str); 10 | String workingStr = str; 11 | workingStr = workingStr.substring(1,workingStr.length()-1); //get rid of ( and ) on the outside 12 | int waveIndex = 0; 13 | int charIndex = 0; 14 | while ((charIndex = workingStr.indexOf(',')) != -1) { 15 | possessionwaves[waveIndex] = strToBoolean(workingStr.substring(0,charIndex)); 16 | workingStr = workingStr.substring(charIndex+1); 17 | waveIndex++; 18 | } 19 | } 20 | 21 | private boolean strToBoolean(String bool){ 22 | if (bool.equals("true")) { 23 | return true; 24 | } 25 | if (bool.equals("false")){ 26 | return false; 27 | } else { 28 | ModManager.debugLogger.writeMessage("UNKNOWN STR TO BOOLEAN VALUE: "+bool+", defaulting to false"); 29 | return false; 30 | } 31 | } 32 | 33 | public String toString(){ 34 | StringBuilder sb = new StringBuilder(); 35 | for (int i = 0; i < 11; i++) { 36 | sb.append("Wave "); 37 | sb.append(i+1); 38 | sb.append(": "); 39 | sb.append((possessionwaves[i]) ? "Yes" : "No"); 40 | sb.append("\n"); 41 | } 42 | return sb.toString(); 43 | } 44 | 45 | public String createWavesString() { 46 | System.out.println("BREAK"); 47 | StringBuilder str = new StringBuilder(); 48 | boolean first = true; 49 | for (int i = 0; i <= possessionwaves.length; i++) { 50 | if (first) { 51 | first = false; 52 | } else { 53 | str.append(","); 54 | } 55 | str.append((possessionwaves[i]) ? "true" : "false"); 56 | } 57 | return str.toString(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/powercustomaction/BaseRankUpgrade.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.powercustomaction; 2 | 3 | import java.util.Collection; 4 | import java.util.HashMap; 5 | import java.util.StringTokenizer; 6 | import java.util.TreeMap; 7 | import java.util.regex.Pattern; 8 | 9 | public class BaseRankUpgrade { 10 | int intBaseValue; 11 | double doubleBaseValue; 12 | boolean isDouble = false; 13 | String formula; 14 | TreeMap rankBonuses; 15 | 16 | /** 17 | * Creates a new Detonation Parameters object. 18 | * @param valueToParse 19 | */ 20 | public BaseRankUpgrade(String tableName, String valueToParse) { 21 | rankBonuses = new TreeMap(); 22 | //valueToParse = "(BlockedByObjects=true,DistancedSorted=true,ImpactDeadPawns=false,ImpactFriends=false,ImpactPlaceables=true)"; 23 | //remove bioware's shitty QA 24 | String workingStr = valueToParse.replaceAll(";", ""); 25 | workingStr = workingStr.replaceAll(Pattern.quote("("), ""); 26 | workingStr = workingStr.replaceAll(Pattern.quote(")"), ""); 27 | /*while (workingStr.charAt(0) == '(' || workingStr.charAt(workingStr.length()) == ')') { 28 | if (workingStr.charAt(workingStr.length()) == ')'){ 29 | 30 | } 31 | if (workingStr.charAt(0) == '(') { 32 | 33 | } 34 | 35 | } 36 | workingStr = workingStr.substring(1,workingStr.length()-1);*/ 37 | StringTokenizer strok = new StringTokenizer(workingStr,","); 38 | //System.out.println("Parsing: "+workingStr); 39 | while (strok.hasMoreTokens()){ 40 | String assignment = strok.nextToken(); 41 | int equalsIndex = assignment.indexOf('='); 42 | String var = assignment.substring(0,equalsIndex).trim(); 43 | int rankbonus = -1; 44 | if (var.contains("[")) { 45 | //its a rankbonus 46 | rankbonus = Integer.parseInt(var.substring(var.indexOf('[')+1, var.indexOf(']'))); 47 | } 48 | String val = assignment.substring(equalsIndex+1,assignment.length()); 49 | if (rankbonus >= 0) { 50 | rankBonuses.put(rankbonus, Double.parseDouble(val)); 51 | continue; 52 | } 53 | 54 | switch(var){ 55 | case "BaseValue": 56 | try { 57 | intBaseValue = Integer.parseInt(val); 58 | } catch (Exception e) { 59 | doubleBaseValue = Double.parseDouble(val); 60 | isDouble = true; 61 | } 62 | 63 | break; 64 | case "Formula": //same thing, typical bioware. 65 | formula = val; 66 | break; 67 | default: 68 | System.err.println("UNKNOWN BASERANKUPGRADE PARAMETER:" +var); 69 | } 70 | } 71 | } 72 | 73 | public static boolean isRankBonusUpgrade(String input) { 74 | //input = "(BaseValue=0.075f,Formula=BonusIsHardValue,RankBonuses[2]=0.05f)"; 75 | if (input.contains("BaseValue") || input.contains("formula") || input.contains("RankBonuses")) { 76 | return true; 77 | } 78 | return false; 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/powercustomaction/ContainerRow.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.powercustomaction; 2 | 3 | import java.awt.FlowLayout; 4 | 5 | import javax.swing.JButton; 6 | import javax.swing.JPanel; 7 | import javax.swing.JTextField; 8 | import javax.swing.border.EtchedBorder; 9 | 10 | import com.me3tweaks.modmanager.ui.HintTextFieldUI; 11 | 12 | public class ContainerRow extends JPanel { 13 | public static String CONTAINER_TEMPLATE = "\t\t\t\t\n" + "\t\t\t\t
\n" 14 | + "\t\t\t\t\t\n" 15 | + "\t\t\t\t\t

CONTAINERNAME

\n" 16 | + "\t\t\t\t\t

CONTAINERDESCRIPTION

\n" + "INPUTS_PLACEHOLDER" + "\t\t\t\t
\n"; 17 | public static String DETONATION_CONTAINER_TEMPLATE = "\t\t\t\t\n" 18 | + "\t\t\t\t
\n" 19 | + "\t\t\t\t\t\n" 20 | + "\t\t\t\t\t

Detonation Parameters

\n" 21 | + "\t\t\t\t\t

Detonation parameters determine what gets hit when TABLENAME detonate.

\n" 22 | + "\t\t\t\t\t
\n" 23 | + "\t\t\t\t\t\t
\n" 24 | + "\t\t\t\t\t\t\tBlocked By Objects\n" 25 | + "\t\t\t\t\t\t\tDefault: BLOCKED_BY_OBJECTS\n" 26 | + "\t\t\t\t\t\t
\n" 27 | + "\t\t\t\t\t\tpowers->mod_powers_TABLENAME_DETONATIONVARNAME_blockedbyobjects) ? \"checked\" : \"\"?>>\n" 28 | + "\t\t\t\t\t
\n" 29 | + "\t\t\t\t\t
\n" 30 | + "\t\t\t\t\t\t
\n" 31 | + "\t\t\t\t\t\t\tDistance Sorted\n" 32 | + "\t\t\t\t\t\t\tDefault: DISTANCE_SORTED\n" 33 | + "\t\t\t\t\t\t
\n" 34 | + "\t\t\t\t\t\tpowers->mod_powers_TABLENAME_DETONATIONVARNAME_distancesorted) ? \"checked\" : \"\"?>>\n" 35 | + "\t\t\t\t\t
\n" 36 | + "\t\t\t\t\t
\n" 37 | + "\t\t\t\t\t\t
\n" 38 | + "\t\t\t\t\t\t\tImpacts Dead Characters\n" 39 | + "\t\t\t\t\t\t\tDefault: IMPACTS_DEAD_CHARS\n" 40 | + "\t\t\t\t\t\t
\n" 41 | + "\t\t\t\t\t\tpowers->mod_powers_TABLENAME_DETONATIONVARNAME_impactdeadpawns) ? \"checked\" : \"\"?>>\n" 42 | + "\t\t\t\t\t
\n" 43 | + "\t\t\t\t\t
\n" 44 | + "\t\t\t\t\t\t
\n" 45 | + "\t\t\t\t\t\t\tImpacts Friendlies\n" 46 | + "\t\t\t\t\t\t\tDefault: IMPACTS_FRIENDS\n" 47 | + "\t\t\t\t\t\t
\n" 48 | + "\t\t\t\t\t\tpowers->mod_powers_TABLENAME_DETONATIONVARNAME_impactfriends) ? \"checked\" : \"\"?>>\n" 49 | + "\t\t\t\t\t
\n" 50 | + "\t\t\t\t\t
\n" 51 | + "\t\t\t\t\t\t
\n" 52 | + "\t\t\t\t\t\t\tImpacts Placeables\n" 53 | + "\t\t\t\t\t\t\tDefault: IMPACTS_PLACEABLES\n" 54 | + "\t\t\t\t\t\t
\n" 55 | + "\t\t\t\t\t\tpowers->mod_powers_TABLENAME_DETONATIONVARNAME_impactplaceables) ? \"checked\" : \"\"?>>\n" 56 | + "\t\t\t\t\t
\n" + "CONEANGLE" + "\t\t\t\t
"; 57 | 58 | private JTextField containerTitle, containerText; 59 | private JButton deleteContainerButton, updateContainer; 60 | /** 61 | * Loads the variable and instantiates the interface 62 | */ 63 | public void configure() { 64 | setBorder(new EtchedBorder()); 65 | setLayout(new FlowLayout(FlowLayout.LEFT)); 66 | 67 | deleteContainerButton = new JButton("Delete Container"); 68 | add(deleteContainerButton); 69 | 70 | containerTitle = new JTextField(20); 71 | containerTitle.setUI(new HintTextFieldUI("Container Title")); 72 | add(containerTitle); 73 | 74 | containerText = new JTextField(50); 75 | containerText.setUI(new HintTextFieldUI("Container Text")); 76 | add(containerText); 77 | 78 | updateContainer = new JButton("Update Container"); 79 | add(updateContainer); 80 | } 81 | 82 | public String toString(){ 83 | return containerTitle.getText(); 84 | } 85 | 86 | public JButton getDeleteContainerButton() { 87 | return deleteContainerButton; 88 | } 89 | 90 | public JTextField getContainerTitle() { 91 | return containerTitle; 92 | } 93 | 94 | public JTextField getContainerText() { 95 | return containerText; 96 | } 97 | 98 | 99 | 100 | } 101 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/powercustomaction/DetonationParameters.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.powercustomaction; 2 | 3 | import java.util.StringTokenizer; 4 | 5 | public class DetonationParameters { 6 | String tableName; 7 | //defaults 8 | boolean blockedByObjects = true; 9 | boolean distancedSorted = true; 10 | boolean impactPlaceables = false; 11 | boolean impactDeadPawns = false; 12 | boolean impactFriends = false; 13 | double coneAngle = -1; 14 | int hitDirectionOffset = -1; 15 | 16 | public DetonationParameters(){ 17 | 18 | } 19 | 20 | /** 21 | * Creates a new Detonation Parameters object. If this throws an exception it is not a valid detonationobjects value. 22 | * @param valueToParse 23 | */ 24 | public DetonationParameters(String tableName, String valueToParse) { 25 | //valueToParse = "(BlockedByObjects=true,DistancedSorted=true,ImpactDeadPawns=false,ImpactFriends=false,ImpactPlaceables=true)"; 26 | String workingStr = valueToParse.substring(1,valueToParse.length()-1); 27 | StringTokenizer strok = new StringTokenizer(workingStr,","); 28 | while (strok.hasMoreTokens()){ 29 | String assignment = strok.nextToken(); 30 | int equalsIndex = assignment.indexOf('='); 31 | String var = assignment.substring(0,equalsIndex).trim(); 32 | String val = assignment.substring(equalsIndex+1,assignment.length()); 33 | switch(var){ 34 | case "BlockedByObjects": 35 | blockedByObjects = Boolean.parseBoolean(val); 36 | break; 37 | case "DistanceSorted": //same thing, typical bioware. 38 | System.err.println("USING SPECIAL SPELLING: DISTANCESORTED"); 39 | case "DistancedSorted": 40 | distancedSorted = Boolean.parseBoolean(val); 41 | break; 42 | case "ImpactPlaceables": 43 | impactPlaceables = Boolean.parseBoolean(val); 44 | break; 45 | case "ImpactDeadPawns": 46 | impactDeadPawns = Boolean.parseBoolean(val); 47 | break; 48 | case "ImpactFriends": 49 | impactFriends = Boolean.parseBoolean(val); 50 | break; 51 | case "ConeAngle": 52 | System.err.println("Found a coneangle"); 53 | coneAngle = Double.parseDouble(val); 54 | break; 55 | case "HitDirectionOffset": 56 | System.err.println("Found a hitdirectionoffset"); 57 | val = val.substring(val.indexOf('=')+1,val.indexOf(')')); 58 | 59 | break; 60 | default: 61 | System.err.println("UNKNOWN DETONATION PARAMETER:" +var); 62 | } 63 | } 64 | this.tableName = tableName; 65 | } 66 | 67 | public String createVars(int tabs){ 68 | StringBuilder sb = new StringBuilder(); 69 | if (blockedByObjects); 70 | { 71 | for (int i = 0; i < tabs; i++){ 72 | sb.append("\t"); 73 | } 74 | sb.append("public $mod_powers_"); 75 | sb.append(tableName); 76 | sb.append("_detonationparameters_"); 77 | sb.append("\n"); 78 | } 79 | for (int i = 0; i < tabs; i++){ 80 | sb.append("\t"); 81 | } 82 | 83 | for (int i = 0; i < tabs; i++){ 84 | sb.append("\t"); 85 | } 86 | 87 | for (int i = 0; i < tabs; i++){ 88 | sb.append("\t"); 89 | } 90 | 91 | for (int i = 0; i < tabs; i++){ 92 | sb.append("\t"); 93 | } 94 | 95 | return sb.toString(); 96 | } 97 | 98 | public static boolean isDetonationParameters(String data) { 99 | if (data.contains("DistanceSorted") || data.contains("BlockedByObjects") || data.contains("ImpactPlaceables") || data.contains("ImpactDeadPawns") || data.contains("ImpactFriends") || data.contains("ConeAngle") || data.contains("HitDirectionOffset")) { 100 | return true; 101 | } 102 | return false; 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/powercustomaction/Power.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.powercustomaction; 2 | 3 | public class Power { 4 | private boolean hasDetonationImpact = false; 5 | 6 | } 7 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/sharedassignment/SharedDifficulty.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.sharedassignment; 2 | 3 | import com.me3tweaks.modmanager.ModManager; 4 | 5 | /** 6 | * Represents a PossessedWave array property. It's identifier is the Difficulty 7 | * string. 8 | * 9 | * @author Michael 10 | * 11 | */ 12 | public class SharedDifficulty { 13 | public String difficulty; 14 | 15 | public SharedDifficulty(String str) { 16 | //get difficulty 17 | String workingStr; 18 | int charIndex = str.indexOf('='); // first =, which gets us to (Difficulty= 19 | workingStr = str.substring(charIndex + 1); 20 | charIndex = workingStr.indexOf(','); // , following DO_LevelX 21 | difficulty = workingStr.substring(0, charIndex); 22 | } 23 | 24 | public String toString() { 25 | return "SharedDifficulty: " + difficulty; 26 | } 27 | 28 | public boolean matchIdentifiers(SharedDifficulty importing) { 29 | ModManager.debugLogger.writeMessageConditionally("[SharedDifficulty]Matching " + difficulty + " against " + importing.difficulty, ModManager.LOG_MODMAKER); 30 | return difficulty.equals(importing.difficulty); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/waveclass/WaveClass.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.waveclass; 2 | 3 | import com.me3tweaks.modmanager.ModManager; 4 | 5 | public class WaveClass { 6 | public String waveClassName; 7 | public int selectionWeight; 8 | 9 | public WaveClass(String value) { 10 | //get name 11 | String workingStr; 12 | int charIndex = value.indexOf('='); // first = 13 | workingStr = value.substring(charIndex+1); 14 | charIndex = workingStr.indexOf(','); // marks the end of wave class 15 | waveClassName = workingStr.substring(0, charIndex); 16 | workingStr = workingStr.substring(charIndex); 17 | charIndex = workingStr.indexOf('='); //selection weight = 18 | workingStr = workingStr.substring(charIndex+1); //trash everything before this 19 | 20 | charIndex = workingStr.indexOf(')'); //selection weight = 21 | try { 22 | selectionWeight = Integer.parseInt(workingStr.substring(0, charIndex)); 23 | } catch (NumberFormatException e) { 24 | ModManager.debugLogger.writeError("SELECTION WEIGHT IS NOT A NUMBER: "+workingStr.substring(0, charIndex)); 25 | } 26 | } 27 | 28 | public String toString(){ 29 | return "WaveClass: "+waveClassName+", selection weight: "+selectionWeight; 30 | } 31 | 32 | 33 | public boolean matchIdentifiers(WaveClass importing) { 34 | return waveClassName.equals(importing.waveClassName); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/wavelist/Enemy.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.wavelist; 2 | 3 | public class Enemy { 4 | String enemyname; 5 | int min, max, maxperwave; 6 | 7 | public Enemy(String str) { 8 | //System.out.println(str); 9 | String workingStr; 10 | //(EnemyType="WAVE_RPR_Husk", MinCount=2, MaxCount=2) 11 | int charIndex = str.indexOf('\"'); // first ", which is the lead into the name. 12 | workingStr = str.substring(charIndex+1); 13 | charIndex = workingStr.indexOf('\"'); // second " which is the end of the name. clip this to get what we want. 14 | enemyname = workingStr.substring(0, charIndex); 15 | 16 | //check for , to see if there is more. 17 | if (workingStr.indexOf(',') != -1) { 18 | workingStr = workingStr.substring(charIndex+3);//bypass " , and 19 | charIndex = workingStr.indexOf('='); 20 | while (charIndex != -1){ 21 | //more , means more values. 22 | String wavestat = workingStr.substring(0,charIndex); 23 | //System.out.println("Before update "+workingStr); 24 | workingStr = workingStr.substring(charIndex+1); //got wavestat name 25 | //System.out.println("After update "+workingStr); 26 | int wavestatvalue = 0; 27 | int cIndex = workingStr.indexOf(','); 28 | if (cIndex != -1) { 29 | //theres more 30 | wavestatvalue = Integer.parseInt(workingStr.substring(0,cIndex)); 31 | charIndex = workingStr.indexOf(','); 32 | workingStr = workingStr.substring(charIndex+2); 33 | } else { 34 | wavestatvalue = Integer.parseInt(workingStr.substring(0,workingStr.length()-1)); 35 | } 36 | //System.out.println(wavestat+": "+wavestatvalue); 37 | switch (wavestat) { 38 | case "MinCount": 39 | min = wavestatvalue; 40 | break; 41 | case "MaxCount": 42 | max = wavestatvalue; 43 | break; 44 | case "MaxPerWave": 45 | maxperwave = wavestatvalue; 46 | break; 47 | } 48 | charIndex = workingStr.indexOf('='); 49 | } 50 | } 51 | } 52 | 53 | public String toString(){ 54 | String str = enemyname+", "; 55 | if (min == 0 && max == 0 && maxperwave == 0){ 56 | return str+"baseenemy"; 57 | } 58 | str += "min: "+min+" max: "+max+" maxperwave: "+maxperwave; 59 | return str; 60 | } 61 | 62 | public String createEnemyString() { 63 | StringBuilder str = new StringBuilder(); 64 | str.append("(EnemyType=\""); 65 | str.append(enemyname); 66 | str.append("\""); 67 | if (min != 0) { 68 | str.append(", MinCount="); 69 | str.append(min); 70 | } 71 | if (max != 0) { 72 | str.append(", MaxCount="); 73 | str.append(max); 74 | } 75 | if (maxperwave != 0) { 76 | str.append(", MaxPerWave="); 77 | str.append(maxperwave); 78 | } 79 | str.append(")"); //end stat 80 | return str.toString(); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /src/com/me3tweaks/modmanager/valueparsers/wavelist/Wave.java: -------------------------------------------------------------------------------- 1 | package com.me3tweaks.modmanager.valueparsers.wavelist; 2 | 3 | import java.util.ArrayList; 4 | 5 | 6 | public class Wave { 7 | public String difficulty; 8 | ArrayList enemies; 9 | public Wave(String value) { 10 | //get name 11 | String workingStr; 12 | int charIndex = value.indexOf('='); // first =, marks start of difficult string., 13 | workingStr = value.substring(charIndex+1); 14 | charIndex = workingStr.indexOf(','); // marks the end of difficulty name 15 | difficulty = workingStr.substring(0, charIndex); 16 | workingStr = workingStr.substring(charIndex); 17 | charIndex = workingStr.indexOf('('); 18 | workingStr = workingStr.substring(charIndex+1); //start of stats array (removing the leading ( because of CategoryData = ( ). 19 | //Clip the ending two )) 20 | workingStr = workingStr.substring(0, workingStr.length()-2); 21 | 22 | //generate stats 23 | enemies = new ArrayList(); 24 | 25 | charIndex = 0; 26 | int openBraces = 0; 27 | while (workingStr.length() > 0){ 28 | if (workingStr.charAt(charIndex) == '(') { 29 | openBraces++; 30 | charIndex++; 31 | continue; 32 | } 33 | if (workingStr.charAt(charIndex) == ')') { 34 | openBraces--; 35 | charIndex++; 36 | if (openBraces <= 0) { 37 | //we finished one 38 | enemies.add(new Enemy(workingStr.substring(0, charIndex))); 39 | if (charIndex < workingStr.length()){ 40 | workingStr = workingStr.substring(charIndex+1); 41 | } else { 42 | break; //we finished 43 | } 44 | charIndex = 0; 45 | } 46 | continue; 47 | } 48 | //its none of the above 2 49 | charIndex++; 50 | } 51 | //category finished. 52 | } 53 | 54 | public String toString(){ 55 | String str = difficulty; 56 | str+="\nStats:\n"; 57 | for (Enemy stat : enemies){ 58 | str+=stat.toString()+"\n"; 59 | } 60 | return str; 61 | } 62 | 63 | public String createWaveString() { 64 | StringBuilder str = new StringBuilder(); 65 | str.append("(Difficulty="); 66 | str.append(difficulty); 67 | str.append(",Enemies=("); 68 | boolean firstEnemy = true; 69 | for (Enemy enemy : enemies) { 70 | if (firstEnemy) { 71 | firstEnemy = false; 72 | } else { 73 | str.append(","); 74 | } 75 | str.append(enemy.createEnemyString()); 76 | } 77 | str.append("))"); //end stat 78 | return str.toString(); 79 | } 80 | 81 | public boolean matchIdentifiers(Wave importing) { 82 | return difficulty.equals(importing.difficulty); 83 | } 84 | 85 | public String getBaseEnemy() { 86 | for (Enemy enemy : enemies) { 87 | if (enemy.min == 0 && enemy.max == 0 && enemy.maxperwave == 0){ 88 | return enemy.enemyname; 89 | } 90 | } 91 | return null; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /src/resource/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/src/resource/icon128.png -------------------------------------------------------------------------------- /src/resource/icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/src/resource/icon32.png -------------------------------------------------------------------------------- /src/resource/icon64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/src/resource/icon64.png -------------------------------------------------------------------------------- /src/resource/me3tweaks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/src/resource/me3tweaks.png -------------------------------------------------------------------------------- /src/resource/modmaker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/src/resource/modmaker.png -------------------------------------------------------------------------------- /src/resource/network.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/src/resource/network.gif -------------------------------------------------------------------------------- /starterkit/Default.sfar: -------------------------------------------------------------------------------- 1 | RAFS amzl -------------------------------------------------------------------------------- /starterkit/Default_DLC_MOD_StarterKit.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/starterkit/Default_DLC_MOD_StarterKit.bin -------------------------------------------------------------------------------- /starterkit/Mount.dlc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ME3Tweaks/ME3ModManager/3c58c09dca8c83b5f1be945e8a0009ca03a22a39/starterkit/Mount.dlc -------------------------------------------------------------------------------- /starterkit/StarterKitTLK.xml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | %INTERNALDISPLAYNAME% 5 | %INTERNALDLCNAME% 6 | %LANG% 7 | Male 8 | Female 9 | 10 | --------------------------------------------------------------------------------