rework cache creation conditions

clean up some stuff

revert pet clearing

fix initial cache creation not happening without changes/redraws

fix draw conditions when framework inactive
This commit is contained in:
Stanley Dimant
2025-02-23 03:04:08 +01:00
committed by Loporrit
parent c1940767bf
commit f033b1aa74
13 changed files with 299 additions and 321 deletions

View File

@@ -493,15 +493,18 @@ public class DalamudUtilService : IHostedService, IMediatorSubscriber
{
if (!_clientState.IsLoggedIn) return;
if (ct == null)
ct = CancellationToken.None;
const int tick = 250;
int curWaitTime = 0;
try
{
logger.LogTrace("[{redrawId}] Starting wait for {handler} to draw", redrawId, handler);
await Task.Delay(tick).ConfigureAwait(true);
await Task.Delay(tick, ct.Value).ConfigureAwait(true);
curWaitTime += tick;
while ((!ct?.IsCancellationRequested ?? true)
while ((!ct.Value.IsCancellationRequested)
&& curWaitTime < timeOut
&& await handler.IsBeingDrawnRunOnFrameworkAsync().ConfigureAwait(false)) // 0b100000000000 is "still rendering" or something
{