示例#1
0
        internal static void Cmd_RefreshModList(params string[] args)
        {
            if (!Folders.IsCurrentOutwardPathValid())
            {
                Console.WriteLine("You need to set the Outward path first!");
                return;
            }

            WebManifestManager.UpdateWebManifests();

            LocalPackageManager.RefreshInstalledPackages();
        }
示例#2
0
        /// <summary>
        /// Refresh all packages, online and local. Optionally re-download new manifests as well, if <paramref name="refreshOnline"/> is <see langword="true"/>
        /// </summary>
        public static void RefreshAllPackages(bool refreshOnline = false)
        {
            if (refreshOnline)
            {
                WebManifestManager.UpdateWebManifests();
            }
            else
            {
                WebManifestManager.LoadWebManifestCache();
            }

            // refresh installed packages
            LocalPackageManager.RefreshInstalledPackages();
        }
示例#3
0
        internal void RefreshBepInExPanel()
        {
            if (!Folders.IsCurrentOutwardPathValid())
            {
                this._bepPanel.Visible        = false;
                this._uninstallButton.Visible = false;
                MefinoGUI.DisableFeaturePages();
                return;
            }

            this._bepPanel.Visible = true;

            if (BepInExHandler.IsBepInExUpdated())
            {
                this._bepStatus.Text           = "Installed";
                this._bepStatus.ForeColor      = Color.LightGreen;
                this._bepInstallButton.Visible = false;

                LocalPackageManager.RefreshInstalledPackages();

                MefinoGUI.EnabledFeaturePages();
                Folders.CheckOutwardMefinoInstall();

                this._uninstallButton.Visible = true;
            }
            else
            {
                this._uninstallButton.Visible = false;
                MefinoGUI.DisableFeaturePages();

                switch (BepInExHandler.s_lastInstallStateResult)
                {
                case InstallState.Outdated:
                    this._bepStatus.Text           = $"Outdated";
                    this._bepStatus.ForeColor      = Color.DarkKhaki;
                    this._bepInstallButton.Visible = true;
                    this._bepInstallButton.Text    = $"Update to {BepInExHandler.s_latestBepInExVersion}";
                    break;

                case InstallState.NotInstalled:
                    this._bepStatus.Text           = "Not installed";
                    this._bepStatus.ForeColor      = Color.IndianRed;
                    this._bepInstallButton.Visible = true;
                    this._bepInstallButton.Text    = $"Install BepInEx {BepInExHandler.s_latestBepInExVersion}";
                    break;
                }
            }
        }
示例#4
0
        private void _uninstallButton_Click(object sender, EventArgs e)
        {
            ProfileManager.SavePrompt(false);

            var result = OutwardHelper.UninstallFromOutward();

            if (result == DialogResult.Cancel)
            {
                return;
            }

            Folders.IsCurrentOutwardPathValid(out InstallState state);
            SetOtwPathResult(state);

            LocalPackageManager.RefreshInstalledPackages();
            LauncherPage.Instance.RebuildPackageList();
        }
示例#5
0
        private static void OnFileSystemChanged(object sender, FileSystemEventArgs e)
        {
            if (IOHelper.MefinoDoingIO)
            {
                return;
            }

            // Console.WriteLine("Manual folder IO detected");

            LocalPackageManager.RefreshInstalledPackages();

            if (ProfileManager.IsProfileDifferentToEnabledPackages())
            {
                ProfileManager.SetChangesSinceSave(true);
            }

            LauncherPage.Instance?.Invoke(new MethodInvoker(LauncherPage.Instance.RebuildPackageList));
        }