fix: populate integrations menu when empty

This commit is contained in:
Anna 2022-07-10 14:29:20 -04:00
parent 9d0de2f386
commit c1935b1491
1 changed files with 8 additions and 0 deletions

View File

@ -93,6 +93,8 @@ internal sealed class PayloadHandler {
.FirstOrDefault(chunk => chunk is PlayerPayload) as PlayerPayload;
if (ImGui.BeginMenu(Language.Context_Integrations)) {
var cursor = ImGui.GetCursorPos();
foreach (var id in registered) {
try {
this.Ui.Plugin.Ipc.Invoke(id, sender, contentId, payload, chunk.Message?.SenderSource, chunk.Message?.ContentSource);
@ -101,6 +103,12 @@ internal sealed class PayloadHandler {
}
}
if (cursor == ImGui.GetCursorPos()) {
ImGui.PushStyleColor(ImGuiCol.Text, ImGui.GetStyle().Colors[(int) ImGuiCol.TextDisabled]);
ImGui.Text("No integrations available");
ImGui.PopStyleColor();
}
ImGui.EndMenu();
}
}