Skip to content

Commit

Permalink
fix the toggling thing with dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Sep 12, 2023
1 parent ef47647 commit cd89ef1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions loader/src/ui/internal/list/ModListCell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,13 +251,14 @@ void ModCell::onRestart(CCObject*) {
void ModCell::updateState() {
bool unresolved = m_mod->hasUnresolvedDependencies();
bool shouldLoad = m_mod->shouldLoad();
auto toggleable = !unresolved || !shouldLoad;
if (m_enableToggle) {
m_enableToggle->toggle(m_mod->isEnabled());
m_enableToggle->setEnabled(!unresolved || shouldLoad);
m_enableToggle->m_offButton->setOpacity(unresolved ? 100 : 255);
m_enableToggle->m_offButton->setColor(unresolved ? cc3x(155) : cc3x(255));
m_enableToggle->m_onButton->setOpacity(unresolved ? 100 : 255);
m_enableToggle->m_onButton->setColor(unresolved ? cc3x(155) : cc3x(255));
m_enableToggle->setEnabled(toggleable);
m_enableToggle->m_offButton->setOpacity(toggleable ? 100 : 255);
m_enableToggle->m_offButton->setColor(toggleable ? cc3x(155) : cc3x(255));
m_enableToggle->m_onButton->setOpacity(toggleable ? 100 : 255);
m_enableToggle->m_onButton->setColor(toggleable ? cc3x(155) : cc3x(255));
}
bool hasProblems = false;
for (auto const& item : Loader::get()->getProblems()) {
Expand Down

0 comments on commit cd89ef1

Please sign in to comment.