Skip to content

Commit

Permalink
Call MarkAsShown() in OpenModal()
Browse files Browse the repository at this point in the history
- This ensures if panel breaks it won't be recurrent issue for user
  • Loading branch information
originalfoo committed Jan 26, 2022
1 parent d683652 commit 84745b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 2 additions & 1 deletion TLM/TLM/UI/WhatsNew/WhatsNew.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public WhatsNew() {
public static void OpenModal() {
UIView uiView = UIView.GetAView();
if (uiView) {
MarkAsShown();
WhatsNewPanel panel = uiView.AddUIComponent(typeof(WhatsNewPanel)) as WhatsNewPanel;
if (panel) {
Log.Info("Opened What's New panel!");
Expand All @@ -43,7 +44,7 @@ public static void OpenModal() {
}
}

public void MarkAsShown() {
public static void MarkAsShown() {
Log.Info($"What's New - mark as shown. Version {CurrentVersion}");
GlobalConfig.Instance.Main.LastWhatsNewPanelVersion = CurrentVersion;
GlobalConfig.WriteConfig();
Expand Down
2 changes: 0 additions & 2 deletions TLM/TLM/UI/WhatsNew/WhatsNewPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,6 @@ private Vector2 GetMaxContentSize() {
private void HandleClose() {
if (!gameObject) return;

TMPELifecycle.Instance.WhatsNew.MarkAsShown();

if (UIView.GetModalComponent() == this) {
UIView.PopModal();
UIComponent modal = UIView.GetModalComponent();
Expand Down

0 comments on commit 84745b5

Please sign in to comment.