Example #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)
        {
            var pkfPFPForm = new PremadeFomodPackForm(PremadeFomodPackForm.OpenPFPMode.Edit);

            if (pkfPFPForm.ShowDialog(this) == DialogResult.Cancel)
            {
                return;
            }

            var pfpPack    = new PremadeFomodPack(pkfPFPForm.PFPPath);
            var fbfBuilder = new FomodBuilderForm(pfpPack, pkfPFPForm.SourcesPath);

            if (fbfBuilder.ShowDialog(this) == DialogResult.OK)
            {
                if (!String.IsNullOrEmpty(fbfBuilder.FomodPath))
                {
                    AddFomod(fbfBuilder.FomodPath, true);
                }
            }
        }
Example #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)
        {
            var pkfPFPForm = new PremadeFomodPackForm(PremadeFomodPackForm.OpenPFPMode.Install);

            if (pkfPFPForm.ShowDialog(this) == DialogResult.Cancel)
            {
                return;
            }

            var pfpPack             = new PremadeFomodPack(pkfPFPForm.PFPPath);
            var lstCopyInstructions = pfpPack.GetCopyInstructions(pkfPFPForm.SourcesPath);
            var strPremadeSource    = Archive.GenerateArchivePath(pkfPFPForm.PFPPath, pfpPack.PremadePath);

            lstCopyInstructions.Add(new KeyValuePair <string, string>(strPremadeSource, "/"));

            var fgnGenerator    = new NewFomodBuilder();
            var strNewFomodPath = fgnGenerator.BuildFomod(pfpPack.FomodName, lstCopyInstructions, null, null, false, null,
                                                          null);

            if (!String.IsNullOrEmpty(strNewFomodPath))
            {
                AddFomod(strNewFomodPath, true);
            }
        }