Exemple #1
0
        public CheApeApplier(BlamLib.BlamVersion version)
        {
            InitializeComponent();

            cbEngineVersion.Items.Add(BlamLib.BlamVersion.Halo1_CE);
            cbEngineVersion.Items.Add(BlamLib.BlamVersion.Halo2_PC);

            // NOTE: this isn't the best control logic for this. Will probably want to change this later
            if (version == BlamLib.BlamVersion.Halo1_CE)
            {
                cbEngineVersion.SelectedIndex = 0;
            }
            else if (version == BlamLib.BlamVersion.Halo2_PC)
            {
                cbEngineVersion.SelectedIndex = 1;
            }

//          txtPathOutput.Text = @"C:\Mount\B\Kornner\Projects\bin\_Halo1\";
//          txtPathGuerilla.Text = @"C:\Program Files (x86)\Microsoft Games\Halo Custom Edition\guerilla.exe";
//          txtPathTool.Text = @"C:\Program Files (x86)\Microsoft Games\Halo Custom Edition\tool.exe";
//          txtPathSapien.Text = @"C:\Program Files (x86)\Microsoft Games\Halo Custom Edition\sapien.exe";

//          txtPathOutput.Text = @"C:\Mount\B\Kornner\Projects\bin\_Halo2\";
//          txtPathGuerilla.Text = @"C:\Program Files (x86)\Microsoft Games\Halo 2 Map Editor\H2Guerilla.exe";
//          txtPathTool.Text = @"C:\Program Files (x86)\Microsoft Games\Halo 2 Map Editor\H2Tool.exe";
//          txtPathSapien.Text = @"C:\Program Files (x86)\Microsoft Games\Halo 2 Map Editor\H2Sapien.exe";
        }
Exemple #2
0
        public CheApe(BlamLib.BlamVersion engine)
        {
            InitializeComponent();

            MainMenu.Renderer     = MainForm.kOpenSauceIDEToolStripRenderer;
            FileViewMenu.Renderer = MainForm.kOpenSauceIDEToolStripRenderer;

            SetState(false);

            #region FileViewRoot
            this.FileViewRoot             = new System.Windows.Forms.TreeNode("Project Files");
            FileViewRoot.ContextMenuStrip = this.FileViewMenu;
            FileViewRoot.Name             = "FileViewRoot";
            this.FileView.Nodes.Add(FileViewRoot);
            #endregion

            OpenDialog.DefaultExt = kFileExt;
            OpenDialog.Filter     = kFileFilter;

            SaveDialog.DefaultExt = kFileExt;
            SaveDialog.Filter     = kFileFilter;

            OpenProjDialog.Multiselect = false;
            OpenProjDialog.Filter      = BlamLib.IO.TagGroups.CheApeProject.Filter;

            SaveProjDialog.Filter = BlamLib.IO.TagGroups.CheApeProject.Filter;

            ProjectInterface = BlamLib.CheApe.Project.GetInterface(engine);
        }
Exemple #3
0
        void OnApply(BlamLib.BlamVersion v)
        {
            Exception exception = null;

            CheApeInterface.UnlockToolsBase unlocker = null;

            switch (v)
            {
            case BlamLib.BlamVersion.Halo1_CE:
                try                                             { unlocker = new CheApeInterface.UnlockH1(txtPathOutput.Text, txtPathGuerilla.Text, txtPathTool.Text, txtPathSapien.Text); }
                catch (Exception ex)    { exception = ex; }
                break;

            case BlamLib.BlamVersion.Halo2_PC:
                try                                             { unlocker = new CheApeInterface.UnlockH2(txtPathOutput.Text, txtPathGuerilla.Text, txtPathTool.Text, txtPathSapien.Text); }
                catch (Exception ex)    { exception = ex; }
                break;

            default: MessageBox.Show(this, string.Format("the quarter ({0}) isn't under any of the cups you f****n cheater i kill you", cbEngineVersion.SelectedText),
                                     "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            if (unlocker != null)             // If the unlocker api was initialized OK, run the unlocking operations
            {
                try
                {
                    unlocker.Unlock(false);
                    unlocker.Close();
                }
                catch (Exception ex)    { exception = ex; }
            }

            if (exception != null)
            {
                OnApplyException(v, exception);
            }

            string msg = exception == null ?
                         "CheApe successfully applied!" :
                         "There was an error while trying to apply CheApe. Validate that you selected copies of the original tools and try again.";

            if (unlocker.EncounteredInvalidExe)
            {
                OnApplyMsg(true, "CheApe couldn't be applied to some or all of the exes. Check the debug log for more details");
            }
            else
            {
                OnApplyMsg(exception != null, msg);
            }
        }
Exemple #4
0
 void OnApplyException(BlamLib.BlamVersion v, Exception ex)
 {
     BlamLib.Debug.LogFile.WriteLine("CheApe Apply failed in {0}. Reason:{1}{2}", v.ToString(), BlamLib.Program.NewLine, ex);
 }