mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-22 23:48:08 -05:00
disable enable button on outdated mods
This commit is contained in:
parent
06eb32310c
commit
302eea1f47
2 changed files with 11 additions and 3 deletions
|
@ -466,8 +466,12 @@ void ModItem::updateState() {
|
|||
if (m_enableToggle && m_source.asMod()) {
|
||||
m_enableToggle->toggle(m_source.asMod()->isOrWillBeEnabled());
|
||||
|
||||
// Disable the toggle if the mod has been uninstalled
|
||||
if (modRequestedActionIsUninstall(m_source.asMod()->getRequestedAction())) {
|
||||
// Disable the toggle if the mod has been uninstalled or if the mod is
|
||||
// outdated
|
||||
if (
|
||||
modRequestedActionIsUninstall(m_source.asMod()->getRequestedAction()) ||
|
||||
m_source.asMod()->targetsOutdatedVersion()
|
||||
) {
|
||||
m_enableToggle->setEnabled(false);
|
||||
auto off = typeinfo_cast<CCRGBAProtocol*>(m_enableToggle->m_offButton->getNormalImage());
|
||||
auto on = typeinfo_cast<CCRGBAProtocol*>(m_enableToggle->m_onButton->getNormalImage());
|
||||
|
|
|
@ -672,7 +672,11 @@ void ModPopup::updateState() {
|
|||
m_cancelBtn->setVisible(false);
|
||||
|
||||
m_enableBtn->toggle(asMod && asMod->isOrWillBeEnabled());
|
||||
m_enableBtn->setVisible(asMod && asMod->getRequestedAction() == ModRequestedAction::None);
|
||||
m_enableBtn->setVisible(
|
||||
asMod &&
|
||||
asMod->getRequestedAction() == ModRequestedAction::None &&
|
||||
!asMod->targetsOutdatedVersion()
|
||||
);
|
||||
|
||||
m_reenableBtn->toggle(m_enableBtn->isToggled());
|
||||
m_reenableBtn->setVisible(asMod && modRequestedActionIsToggle(asMod->getRequestedAction()));
|
||||
|
|
Loading…
Reference in a new issue