RWELabs/Stardew-Valley-Mod-Manager

[Issue] When mod update check finds mod up to date, the operation button is read-only.

Closed this issue · 2 comments

Describe the Issue
After checking for a mod update, if the mod is found to be up to date already the console will state that it is up to date already (expected) but the button to check for an update remains read only. This means you have to close the window and re-open it to check for another mod

Steps to Replicate
Steps to reproduce the behavior:

  1. Open "Check for Mod Updates [Beta]"
  2. Check a mod for an update
  3. When the utility detects "This mod is up to date." the "Check for Updates" button is still read-only.

Expected behavior
After finishing any update check (whether an update is found, not found, or the logic is not present to check for updates) the option to check for another mod update should be present.

Screenshots
image

image

Environment:

  • Windows Version: Windows 11
  • Mod Manager Version: 220404

Suggested Resolution
Add Check.Enabled = true; to the code when the mod has been detected to be up to date.

Resolution

Will resolve issue by instating the original (.enabled = true;) state on the button (this.ModUpdateCheck.Check) when the results have been returned as the final state regardless of the result.

DoKeyValidation( );

  • Catch IPStatus other than IP.Status.Success and perform Check.Enabled = true;

CheckNexusModVersion( );

  • Catch Unable to determine mod version and perform Check.Enabled = true;

CompareVersions( );

  • Catch There are no updates available and perform Check.Enabled = true; if version > or =

DoNoUpdateKey( );

  • Catch Update key or manifest not found and perform Check.Enabled = true;
  • Catch The update key was not valid or was for an unsupported update service and perform Check.Enabled = true;
{
                Ouput.AppendText(Environment.NewLine + "[INFO] There are no updates available ");
                Ouput.AppendText(Environment.NewLine + "[INFO] This mod is up to date. " + Environment.NewLine + 
                Environment.NewLine);
                Check.Enabled = true;
}

if (VersionInstalled == VersionUpdated)
{
                Ouput.AppendText(Environment.NewLine + "[INFO] There are no updates available ");
                Ouput.AppendText(Environment.NewLine + "[INFO] This mod is up to date. " + Environment.NewLine + 
                Environment.NewLine);
                Check.Enabled = true;
}