Don't auto-close levemete interactions if questionable isn't running, part 2
This commit is contained in:
parent
2ee9360025
commit
3a27fc1211
@ -337,7 +337,8 @@ internal sealed class GameUiController : IDisposable
|
||||
}
|
||||
}
|
||||
|
||||
if (_questController.IsRunning && _questController.NextQuest == null)
|
||||
if ((_questController.IsRunning || _questController.WasLastTaskUpdateWithin(TimeSpan.FromSeconds(5)))
|
||||
&& _questController.NextQuest == null)
|
||||
{
|
||||
// make sure to always close the leve dialogue
|
||||
if (_questData.GetAllByIssuerDataId(target.DataId).Any(x => x.QuestId is LeveId))
|
||||
|
@ -47,6 +47,11 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||
/// </summary>
|
||||
private DateTime _safeAnimationEnd = DateTime.MinValue;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
private DateTime _lastTaskUpdate = DateTime.Now;
|
||||
|
||||
public QuestController(
|
||||
IClientState clientState,
|
||||
GameFunctions gameFunctions,
|
||||
@ -443,6 +448,8 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||
ExecuteNextStep(_automationType);
|
||||
else
|
||||
_logger.LogInformation("Couldn't execute next step during Stop() call");
|
||||
|
||||
_lastTaskUpdate = DateTime.Now;
|
||||
}
|
||||
else if (_automationType != EAutomationType.Manual)
|
||||
{
|
||||
@ -450,6 +457,7 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||
_automationType = EAutomationType.Manual;
|
||||
_nextQuest = null;
|
||||
_gatheringQuest = null;
|
||||
_lastTaskUpdate = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
@ -716,6 +724,12 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool WasLastTaskUpdateWithin(TimeSpan timeSpan)
|
||||
{
|
||||
_logger.LogInformation("Last update: {Update}", _lastTaskUpdate);
|
||||
return IsRunning || DateTime.Now <= _lastTaskUpdate.Add(timeSpan);
|
||||
}
|
||||
|
||||
public sealed record StepProgress(
|
||||
DateTime StartedAt,
|
||||
int PointMenuCounter = 0);
|
||||
|
Loading…
Reference in New Issue
Block a user