Add "loading dialog" for service init, unify blocking logic (#1779)

* wip

* hacky fix for overlapping event text in profiler

* move IsResumeGameAfterPluginLoad logic to PluginManager

* fix some warnings

* handle exceptions properly

* remove ability to cancel, rename button to "hide" instead

* undo Dalamud.Service refactor for now

* warnings

* add explainer, show which plugins are still loading

* add some text if loading takes more than 3 minutes

* undo wrong CS merge
This commit is contained in:
goat 2024-04-21 17:28:37 +02:00 committed by GitHub
parent 93adea0ac9
commit 448b0d16ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
294 changed files with 560 additions and 506 deletions

View file

@ -190,6 +190,9 @@ public class ProfilerWindow : Window
uint eventTextDepth = maxRectDept + 2;
var eventsXPos = new List<float>();
const float eventsXPosFudge = 5f;
foreach (var timingEvent in Timings.Events)
{
var startX = (timingEvent.StartTime - this.min) / (this.max - this.min) * width;
@ -214,11 +217,19 @@ public class ProfilerWindow : Window
{
textPos.X = pos.X + (uint)startX - textSize.X - padding;
}
var numClashes = eventsXPos.Count(x => Math.Abs(x - textPos.X) < textSize.X + eventsXPosFudge);
if (numClashes > 0)
{
textPos.Y -= numClashes * textSize.Y;
}
ImGui.GetWindowDrawList().AddText(
textPos,
ImGui.GetColorU32(ImGuiColors.DalamudWhite),
timingEvent.Name);
eventsXPos.Add(textPos.X);
}
}