Plans: Cache whether any plans are currently visible

This commit is contained in:
Jonathan G Rennison
2024-01-17 19:03:10 +00:00
parent 1159224d6f
commit 3d87cfeca5
9 changed files with 65 additions and 5 deletions

View File

@@ -12,9 +12,24 @@
#include "plans_type.h"
void ShowPlansWindow();
extern Plan *_new_plan;
extern Plan *_current_plan;
extern uint64_t _plan_update_counter;
extern uint64_t _last_plan_visibility_check;
extern bool _last_plan_visibility_check_result;
void ShowPlansWindow();
void UpdateAreAnyPlansVisible();
inline bool AreAnyPlansVisible()
{
if (_plan_update_counter != _last_plan_visibility_check) UpdateAreAnyPlansVisible();
return _last_plan_visibility_check_result;
}
inline void InvalidatePlanCaches()
{
_plan_update_counter++;
}
#endif /* PLANS_FUNC_H */