Beispiel #1
0
        public ArchiveDeployment(Mod mod, MainWindow mainWindow)
        {
            Analytics.TrackEvent(@"Started deployment panel for mod", new Dictionary <string, string>()
            {
                { @"Mod name", $@"{mod.ModName} {mod.ParsedModVersion}" }
            });
            DataContext      = this;
            this.mainWindow  = mainWindow;
            ModBeingDeployed = mod;
            string versionString = mod.ParsedModVersion != null?mod.ParsedModVersion.ToString(Utilities.GetDisplayableVersionFieldCount(mod.ParsedModVersion)) : mod.ModVersionString;

            string versionFormat     = mod.ModDescTargetVersion < 6 ? @"X.X" : @"X.X[.X[.X]]";
            string checklistItemText = mod.ParsedModVersion != null?M3L.GetString(M3L.string_verifyModVersion) : M3L.GetString(M3L.string_recommendedVersionFormatNotFollowed, versionFormat);

            DeploymentChecklistItems.Add(new DeploymentChecklistItem()
            {
                ItemText = $@"{checklistItemText}: {versionString}", ValidationFunction = ManualValidation
            });
            DeploymentChecklistItems.Add(new DeploymentChecklistItem()
            {
                ItemText           = $@"{M3L.GetString(M3L.string_verifyURLIsCorrect)} {mod.ModWebsite}",
                ValidationFunction = URLValidation,
                ErrorsMessage      = M3L.GetString(M3L.string_validation_badUrl),
                ErrorsTitle        = M3L.GetString(M3L.string_modUrlErrorsWereFound)
            });
            DeploymentChecklistItems.Add(new DeploymentChecklistItem()
            {
                ItemText           = M3L.GetString(M3L.string_verifyModDescription),
                ValidationFunction = ManualValidation
            });
            if (mod.Game == Mod.MEGame.ME3)
            {
                DeploymentChecklistItems.Add(new DeploymentChecklistItem()
                {
                    ItemText             = M3L.GetString(M3L.string_sfarFilesCheck),
                    ModToValidateAgainst = mod,
                    ErrorsMessage        = M3L.GetString(M3L.string_invalidSfarSize),
                    ErrorsTitle          = M3L.GetString(M3L.string_wrongSfarSizesFound),
                    ValidationFunction   = CheckModSFARs
                });
            }
            var customDLCJob = mod.GetJob(ModJob.JobHeader.CUSTOMDLC);

            if (customDLCJob != null)
            {
                //Todo: Implement this for ME1, ME2
                if (mod.Game == Mod.MEGame.ME3)
                {
                    var customDLCFolders = customDLCJob.CustomDLCFolderMapping.Keys.ToList();
                    customDLCFolders.AddRange(customDLCJob.AlternateDLCs.Where(x => x.Operation == AlternateDLC.AltDLCOperation.OP_ADD_CUSTOMDLC).Select(x => x.AlternateDLCFolder));

                    if (customDLCFolders.Count > 0)
                    {
                        DeploymentChecklistItems.Add(new DeploymentChecklistItem()
                        {
                            ItemText             = M3L.GetString(M3L.string_languageSupportCheck),
                            ModToValidateAgainst = mod,
                            ValidationFunction   = CheckLocalizationsME3,
                            ErrorsMessage        = M3L.GetString(M3L.string_languageSupportCheckDetectedFollowingIssues),
                            ErrorsTitle          = M3L.GetString(M3L.string_languageSupportIssuesDetectedInMod)
                        });
                    }
                }
            }
            if (mod.Game >= Mod.MEGame.ME2)
            {
                DeploymentChecklistItems.Add(new DeploymentChecklistItem()
                {
                    ItemText             = M3L.GetString(M3L.string_audioCheck),
                    ModToValidateAgainst = mod,
                    ValidationFunction   = CheckModForAFCCompactability,
                    ErrorsMessage        = M3L.GetString(M3L.string_audioCheckDetectedErrors),
                    ErrorsTitle          = M3L.GetString(M3L.string_audioIssuesDetectedInMod)
                });
            }
            DeploymentChecklistItems.Add(new DeploymentChecklistItem()
            {
                ItemText             = M3L.GetString(M3L.string_texturesCheck),
                ModToValidateAgainst = mod,
                ErrorsMessage        = M3L.GetString(M3L.string_texturesCheckDetectedErrors),
                ErrorsTitle          = M3L.GetString(M3L.string_textureErrorsInMod),
                ValidationFunction   = CheckModForTFCCompactability
            });
            LoadCommands();
            InitializeComponent();
        }
        public ArchiveDeployment(Mod mod, MainWindow mainWindow)
        {
            Analytics.TrackEvent("Started deployment panel for mod", new Dictionary <string, string>()
            {
                { "Mod name", mod.ModName + " " + mod.ParsedModVersion }
            });
            DataContext      = this;
            this.mainWindow  = mainWindow;
            ModBeingDeployed = mod;
            string versionString = mod.ParsedModVersion != null?mod.ParsedModVersion.ToString(Utilities.GetDisplayableVersionFieldCount(mod.ParsedModVersion)) : mod.ModVersionString;

            string versionFormat     = mod.ModDescTargetVersion < 6 ? "X.X" : "X.X[.X[.X]]";
            string checklistItemText = mod.ParsedModVersion != null ? "Verify mod version is correct" : $"Recommended version format not followed ({versionFormat})";

            DeploymentChecklistItems.Add(new DeploymentChecklistItem()
            {
                ItemText = $"{checklistItemText}: {versionString}", ValidationFunction = ManualValidation
            });
            DeploymentChecklistItems.Add(new DeploymentChecklistItem()
            {
                ItemText           = "Verify URL is correct: " + mod.ModWebsite,
                ValidationFunction = URLValidation,
                ErrorsMessage      = "Validation failed when attempting to validate the mod URL. A mod URL makes it easy for users to find your mod after importing it in the event they need assistance or want to endorse your mod.",
                ErrorsTitle        = "Mod URL errors were found",
            });
            DeploymentChecklistItems.Add(new DeploymentChecklistItem()
            {
                ItemText           = "Verify mod description accuracy",
                ValidationFunction = ManualValidation
            });
            if (mod.Game == Mod.MEGame.ME3)
            {
                DeploymentChecklistItems.Add(new DeploymentChecklistItem()
                {
                    ItemText             = "SFAR files check",
                    ModToValidateAgainst = mod,
                    ErrorsMessage        = "The following SFAR files are not 32 bytes, which is the only supported SFAR size in modding tools for Custom DLC mods.",
                    ErrorsTitle          = "Wrong SFAR sizes found errors in mod",
                    ValidationFunction   = CheckModSFARs
                });
            }
            var customDLCJob = mod.GetJob(ModJob.JobHeader.CUSTOMDLC);

            if (customDLCJob != null)
            {
                //Todo: Implement this for ME1, ME2
                if (mod.Game == Mod.MEGame.ME3)
                {
                    var customDLCFolders = customDLCJob.CustomDLCFolderMapping.Keys.ToList();
                    customDLCFolders.AddRange(customDLCJob.AlternateDLCs.Where(x => x.Operation == AlternateDLC.AltDLCOperation.OP_ADD_CUSTOMDLC).Select(x => x.AlternateDLCFolder));

                    if (customDLCFolders.Count > 0)
                    {
                        DeploymentChecklistItems.Add(new DeploymentChecklistItem()
                        {
                            ItemText             = "Language support check",
                            ModToValidateAgainst = mod,
                            ValidationFunction   = CheckLocalizationsME3,
                            ErrorsMessage        = "The language support check detected the following issues. Review these issues and fix them if applicable before deployment.",
                            ErrorsTitle          = "Language support issues detected in mod"
                        });
                    }
                }
            }
            if (mod.Game >= Mod.MEGame.ME2)
            {
                DeploymentChecklistItems.Add(new DeploymentChecklistItem()
                {
                    ItemText             = "Audio check",
                    ModToValidateAgainst = mod,
                    ValidationFunction   = CheckModForAFCCompactability,
                    ErrorsMessage        = "The audio check detected errors while attempting to verify all referenced audio will be usable by end users. Review these issues and fix them if applicable before deployment.",
                    ErrorsTitle          = "Audio issues detected in mod"
                });
            }
            DeploymentChecklistItems.Add(new DeploymentChecklistItem()
            {
                ItemText             = "Textures check",
                ModToValidateAgainst = mod,
                ErrorsMessage        = "The textures check detected errors while attempting to load all textures in the mod. Review these issues and fix them before deployment.",
                ErrorsTitle          = "Texture errors in mod",
                ValidationFunction   = CheckModForTFCCompactability
            });
            LoadCommands();
            InitializeComponent();
        }