Skip to content

Commit

Permalink
Use original method to show update notice
Browse files Browse the repository at this point in the history
  • Loading branch information
sway2020 committed Sep 22, 2021
1 parent 867b57b commit e54bb08
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 10 deletions.
13 changes: 13 additions & 0 deletions src/GUI/UIThreading.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,19 @@ public void ProcessPressedKey(int index)
YetAnotherToolbar.instance.Expand();
YetAnotherToolbar.instance.mainButton.normalFgSprite = "Collapse";
}

// show update notice
if (!YetAnotherToolbar.instance.shownUpdateNoticeFlag)
{
YetAnotherToolbar.instance.shownUpdateNoticeFlag = true;
// show update notice
if (!Settings.disableUpdateNotice && (ModInfo.updateNoticeDate > Settings.lastUpdateNotice))
{
UIUpdateNoticePopUp.ShowAt();
Settings.lastUpdateNotice = ModInfo.updateNoticeDate;
XMLUtils.SaveSettings();
}
}
}
else if (index == 1)
{
Expand Down
20 changes: 10 additions & 10 deletions src/YetAnotherToolbar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ public void Start()
Expand();
mainButton.normalFgSprite = "Collapse";
}
};

// show update notice
if (!shownUpdateNoticeFlag)
{
shownUpdateNoticeFlag = true;
// show update notice
if (!Settings.disableUpdateNotice && (ModInfo.updateNoticeDate > Settings.lastUpdateNotice))
if (!YetAnotherToolbar.instance.shownUpdateNoticeFlag)
{
UIUpdateNoticePopUp.ShowAt();
Settings.lastUpdateNotice = ModInfo.updateNoticeDate;
XMLUtils.SaveSettings();
YetAnotherToolbar.instance.shownUpdateNoticeFlag = true;
// show update notice
if (!Settings.disableUpdateNotice && (ModInfo.updateNoticeDate > Settings.lastUpdateNotice))
{
UIUpdateNoticePopUp.ShowAt();
Settings.lastUpdateNotice = ModInfo.updateNoticeDate;
XMLUtils.SaveSettings();
}
}
}
};
}
}
catch (Exception ex)
Expand Down

0 comments on commit e54bb08

Please sign in to comment.