fix: populate empty context menu

This commit is contained in:
Anna 2022-07-10 14:33:19 -04:00
parent eefa7f5d64
commit bb8ce118d3
2 changed files with 7 additions and 1 deletions

View File

@ -42,7 +42,6 @@ internal class ChatTwo : IDisposable {
this._id = this.Register.InvokeFunc();
}
private void Integration(string id, PlayerPayload? sender, ulong contentId, Payload? payload, SeString? senderString, SeString? content) {
if (id != this._id) {
return;

View File

@ -740,6 +740,8 @@ internal class PluginUi : IDisposable {
}
if (ImGui.BeginPopupContextItem($"{this._selectedChannel}-{member.Name}@{member.World}-context")) {
var cursor = ImGui.GetCursorPos();
if (rank == Rank.Admin) {
if (member.Rank is not (Rank.Admin or Rank.Invited)) {
if (ImGuiUtil.SelectableConfirm("Promote to admin", tooltip: "This will demote you to moderator.")) {
@ -783,6 +785,11 @@ internal class PluginUi : IDisposable {
}
}
if (cursor == ImGui.GetCursorPos()) {
ImGui.PushStyleColor(ImGuiCol.Text, ImGui.GetStyle().Colors[(int) ImGuiCol.TextDisabled]);
ImGui.TextUnformatted("No options available");
ImGui.PopStyleColor();
}
ImGui.EndPopup();
}