public bool BeginPatching()
        {
            var patches = new Patches();

            Util.Logger.Instance.Log($"[BeginPatching] Applying patches");
            return(patches.ApplyPatches(patchWrapper));
        }
Beispiel #2
0
        public override void OnApplicationStart()
        {
            Logger    = LoggerInstance;
            HInstance = HarmonyInstance;

            ClassInjector.RegisterTypeInIl2Cpp <PortalPtr>();
            ClassInjector.RegisterTypeInIl2Cpp <EnableDisableListener>();
            MelonPreferences.CreateCategory("BetterPortalPlacement", "BetterPortalPlacement Settings");
            IsModOn = MelonPreferences.CreateEntry("BetterPortalPlacement", nameof(IsModOn), true, "Enable BetterPortalPlacement");
            UseConfirmationPopup = MelonPreferences.CreateEntry("BetterPortalPlacement", nameof(UseConfirmationPopup), false, "Use confirmation popup when dropping portal?");
            IsOnlyOnError        = MelonPreferences.CreateEntry("BetterPortalPlacement", nameof(IsOnlyOnError), false, "Use only on error?");
            Patches.ApplyPatches();

            WaitForUiInit();

            Logger.Msg("Successfully loaded!");
        }
Beispiel #3
0
        private void ApplyButton_Click(object sender, EventArgs e)
        {
            string[] availablePatches = new string[AvailablePatchesListBox.Items.Count];
            AvailablePatchesListBox.CheckedItems.CopyTo(availablePatches, 0);

            bool result = _patches.ApplyPatches(availablePatches, ProcessNameTextBox.Text);

            if (result == true)
            {
                MessageBox.Show("Selected patches successfully applied.",
                                "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            else
            {
                MessageBox.Show("There was a problem applying the selected patches.",
                                "Fail", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }