예제 #1
0
        /// <summary>
        /// Handles the <see cref="Control.Click"/> event of the edit pfp button.
        /// </summary>
        /// <remarks>
        /// Edits a PFP.
        /// </remarks>
        /// <param name="sender">The object that raised the event.</param>
        /// <param name="e">An <see cref="EventArgs"/> describing the event arguments.</param>
        private void editPFPToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PremadeFomodPackForm pkfPFPForm = new PremadeFomodPackForm(PremadeFomodPackForm.OpenPFPMode.Edit);
            if (pkfPFPForm.ShowDialog(this) == DialogResult.Cancel)
                return;

            PremadeFomodPack pfpPack = new PremadeFomodPack(pkfPFPForm.PFPPath);
            FomodBuilderForm fbfBuilder = new FomodBuilderForm(pfpPack, pkfPFPForm.SourcesPath);
            if (fbfBuilder.ShowDialog(this) == DialogResult.OK)
            {
                if (!String.IsNullOrEmpty(fbfBuilder.FomodPath))
                    AddFomod(fbfBuilder.FomodPath, true);
            }
        }
예제 #2
0
        /// <summary>
        /// Handles the <see cref="Control.Click"/> event of the add pfp button.
        /// </summary>
        /// <remarks>
        /// Creates a FOMod from a PFP.
        /// </remarks>
        /// <param name="sender">The object that raised the event.</param>
        /// <param name="e">An <see cref="EventArgs"/> describing the event arguments.</param>
        private void addPFPToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PremadeFomodPackForm pkfPFPForm = new PremadeFomodPackForm(PremadeFomodPackForm.OpenPFPMode.Install);
            if (pkfPFPForm.ShowDialog(this) == DialogResult.Cancel)
                return;

            PremadeFomodPack pfpPack = new PremadeFomodPack(pkfPFPForm.PFPPath);
            List<KeyValuePair<string, string>> lstCopyInstructions = pfpPack.GetCopyInstructions(pkfPFPForm.SourcesPath);
            string strPremadeSource = Archive.GenerateArchivePath(pkfPFPForm.PFPPath, pfpPack.PremadePath);
            lstCopyInstructions.Add(new KeyValuePair<string, string>(strPremadeSource, "/"));

            NewFomodBuilder fgnGenerator = new NewFomodBuilder();
            string strNewFomodPath = fgnGenerator.BuildFomod(pfpPack.FomodName, lstCopyInstructions, null, null, false, null, null);
            if (!String.IsNullOrEmpty(strNewFomodPath))
                AddFomod(strNewFomodPath, true);
        }