コード例 #1
0
        /// <summary>
        /// Build a mod file at the given path from the current <see cref="Project"/>.
        /// </summary>
        /// <param name="p_strPath">The file path at which to build the mod.</param>
        protected void BuildMod(string p_strPath)
        {
            if (!Validate())
            {
                return;
            }
            if ((Warnings.Count > 0) && !GetIgnoreWarnings())
            {
                return;
            }
            //save project
            string strProjectPath = ModProject.FilePath;

            if (String.IsNullOrEmpty(strProjectPath))
            {
                strProjectPath = GetProjectSavePath();
            }
            if (String.IsNullOrEmpty(strProjectPath))
            {
                return;
            }
            ModProject.Save(strProjectPath);

            if (String.IsNullOrEmpty(p_strPath))
            {
                p_strPath = GetNewModSavePath();
            }
            if (!String.IsNullOrEmpty(p_strPath))
            {
                ModBuilder.PackageMod(p_strPath, ModProject);
                ModPackingStarted(this, new EventArgs <IBackgroundTask>(ModBuilder));
            }
        }
コード例 #2
0
 /// <summary>
 /// Saves the mod packaging <see cref="Project"/> to the given path.
 /// </summary>
 /// <param name="p_strPath">The file path to which to save the <see cref="Project"/>.</param>
 protected void SaveProject(string p_strPath)
 {
     if (String.IsNullOrEmpty(p_strPath))
     {
         p_strPath = ModProject.FilePath;
     }
     if (String.IsNullOrEmpty(p_strPath))
     {
         p_strPath = GetProjectSavePath();
     }
     if (!String.IsNullOrEmpty(p_strPath))
     {
         ModProject.Save(p_strPath);
     }
 }