Skip to content

Commit

Permalink
CheckForPopups perf. improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
PeteTimesSix committed Jul 10, 2024
1 parent 60506ba commit 571363d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ResearchReinvented/Source/Managers/ResearchOpportunityManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,15 @@ public override void GameComponentTick()
}
CheckForRegeneration();
//CancelMarkedPrototypes();
CheckForPopups();
}

public override void GameComponentUpdate()
{
base.GameComponentUpdate();
if (!Find.TickManager.Paused)
{
CheckForPopups();
}
}

public override void FinalizeInit()
Expand Down Expand Up @@ -153,8 +161,14 @@ public bool CheckForRegeneration()
return false;
}

private long popupCheckTick = -1;
public void CheckForPopups()
{
//for very low tickrate situations
if (popupCheckTick == Find.TickManager.TicksGame)
return;
popupCheckTick = Find.TickManager.TicksGame;

var currentProject = Find.ResearchManager.GetProject();
if (currentProject == null)
return;
Expand Down
Binary file modified ResearchReinvented/v1.5/Assemblies/ResearchReinvented.dll
Binary file not shown.

0 comments on commit 571363d

Please sign in to comment.