public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = base.GetHashCode();
         hashCode = (hashCode * 397) ^ InstallationDate.GetHashCode();
         hashCode = (hashCode * 397) ^ (InstallationChannel != null ? InstallationChannel.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (InstallPlatform != null ? InstallPlatform.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ Reinstall.GetHashCode();
         hashCode = (hashCode * 397) ^ InstallSuspicious.GetHashCode();
         return(hashCode);
     }
 }
Exemple #2
0
        private void Reinstall_Click(object sender, EventArgs e)
        {
            if (UserPreferences.Current.ShouldUseBetaPath)
            {
                UserPreferences.Current.ResetBetaSourceDirectory();
            }

            StatusLabel.Hide();
            installedModsView.Hide();
            installedModsTitle.Hide();
            InstallButton.Hide();
            CloseButton.Hide();
            Reinstall.Hide();
            modBotSettingsButton.Hide();
            LocalVersionLabel.Hide();
            LatestVersionLabel.Hide();
            ProgressBar.Show();
            installingModBotLabel.Show();
            ModBotInstallerManager.ProgressBar = ProgressBar;
            ModBotInstallerManager.Install(UserPreferences.Current.GameInstallationDirectory, OnInstallFinished);
        }
Exemple #3
0
 private void InstallButton_Click(object sender, EventArgs e)
 {
     if ((_installationState != ModBotInstallationState.UpToDate && _installationState != ModBotInstallationState.BetaVersion) || UserPreferences.Current.ShouldUseBetaPath)
     {
         StatusLabel.Hide();
         installedModsView.Hide();
         installedModsTitle.Hide();
         InstallButton.Hide();
         CloseButton.Hide();
         Reinstall.Hide();
         modBotSettingsButton.Hide();
         LocalVersionLabel.Hide();
         LatestVersionLabel.Hide();
         ProgressBar.Show();
         installingModBotLabel.Show();
         ModBotInstallerManager.ProgressBar = ProgressBar;
         ModBotInstallerManager.Install(UserPreferences.Current.GameInstallationDirectory, OnInstallFinished);
     }
     else
     {
         StartGameAndExit();
     }
 }
Exemple #4
0
        void refreshItemsBasedOnCurrentState()
        {
            switch (_installationState)
            {
            case ModBotInstallationState.NotInstalled:
                StatusLabel.Text      = "Mod-Bot not installed";
                StatusLabel.ForeColor = Color.FromArgb(252, 124, 0);
                InstallButton.Show();
                InstallButton.Text = "Install Mod-Bot";
                Reinstall.Hide();
                break;

            case ModBotInstallationState.OutOfDate:
                StatusLabel.Text      = "Mod-Bot out of date";
                StatusLabel.ForeColor = Color.FromArgb(255, 255, 0);
                InstallButton.Show();
                InstallButton.Text = "Update Mod-Bot";
                Reinstall.Hide();
                break;

            case ModBotInstallationState.UpToDate:
                InstallButton.Show();
                InstallButton.Text = "Start Game";
                Reinstall.Show();
                Reinstall.Text        = "Reinstall";
                StatusLabel.Text      = "Mod-Bot up to date!";
                StatusLabel.ForeColor = Color.FromArgb(124, 252, 0);
                break;

            case ModBotInstallationState.BetaVersion:
                InstallButton.Show();
                InstallButton.Text    = "Start Game (beta)";
                Reinstall.Text        = "Reinstall stable";
                StatusLabel.Text      = "Mod-Bot beta installed";
                StatusLabel.ForeColor = Color.FromArgb(255, 0, 255);
                break;

            case ModBotInstallationState.UnableToVerify:
                StatusLabel.Text      = "Unable to check latest Mod-Bot version";
                StatusLabel.ForeColor = Color.FromArgb(125, 0, 125);
                InstallButton.Show();
                InstallButton.Text = "Start Game";
                Reinstall.Hide();
                break;
            }

            if (UserPreferences.Current.ShouldUseBetaPath)
            {
                InstallButton.Text = "Start (beta)";
                Reinstall.Text     = "Start (non beta)";
            }

            InstallButton.Visible        = _numCurrentlyLoadingModItems == 0 && _numCurrentlyUpdatingModItems == 0 && (_missingModDependencies == null || _missingModDependencies.Count == 0);
            Reinstall.Visible            = _numCurrentlyLoadingModItems == 0 && _numCurrentlyUpdatingModItems == 0 && (_missingModDependencies == null || _missingModDependencies.Count == 0);
            installedModsLoading.Visible = _numCurrentlyLoadingModItems > 0;

            if (!_hasInitializedInstalledModsView && _installationState != ModBotInstallationState.Failed && _installationState != ModBotInstallationState.NotInstalled)
            {
                initializeInstalledModsView();
            }
        }