コード例 #1
0
ファイル: PackageManager.cs プロジェクト: AndreyThompson/fomm
        /// <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);
                }
            }
        }
コード例 #2
0
ファイル: PackageManager.cs プロジェクト: AndreyThompson/fomm
        /// <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);
            }
        }
コード例 #3
0
ファイル: PackageManager.cs プロジェクト: BioBrainX/fomm
        /// <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);
            }
        }
コード例 #4
0
ファイル: PackageManager.cs プロジェクト: BioBrainX/fomm
        /// <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);
        }