Skip to content

Commit

Permalink
Merge pull request #54 from axel7083/fix/desactivate-addons-buttons-w…
Browse files Browse the repository at this point in the history
…hen-no-rom-selected

fix(addons): disable buttons when no rom is open
  • Loading branch information
axel7083 authored Mar 3, 2024
2 parents 0a336f7 + fb01b67 commit a6c3b4a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/ui/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1383,6 +1383,9 @@ private void SetupAddons()
// Default to addons
ShowOnlineAddons();
addonsList_Resize(null, null);

// Update buttons
RefreshAddonsButton();
}

private void addonsList_Resize(object sender, EventArgs e)
Expand Down Expand Up @@ -1493,6 +1496,14 @@ private void RefreshAddonsButton()
this.btnInstall.Enabled = false;
}
}

// If the rom is null - do not allow to switch from online to local
if (Program.m_ROM == null)
{
this.addonsChoice.Enabled = false;
this.btnDownloadAddon.Enabled = false;
this.btnInstall.Enabled = false;
}
}

/**
Expand Down

0 comments on commit a6c3b4a

Please sign in to comment.