private void Lodestone() { const float sameLineOffset = 140f; var isLodestoneAvailable = this.plugin.LodestoneService.IsLodestoneAvailable(); var requests = this.plugin.LodestoneService.GetRequests(); // heading WindowManager.SpacerNoTabs(); ImGui.TextColored(ImGuiColors.DalamudViolet, Loc.Localize("Lodestone", "Lodestone")); // lodestone state ImGui.Text(Loc.Localize("LodestoneStatus", "Status")); ImGuiHelpers.ScaledRelativeSameLine(sameLineOffset); if (isLodestoneAvailable) { ImGui.TextColored(ImGuiColors.HealerGreen, Loc.Localize("LodestoneAvailable", "Available")); } else { ImGui.TextColored(ImGuiColors.DPSRed, Loc.Localize("LodestoneUnavailable", "Unavailable")); } // total requests ImGui.Text(Loc.Localize("LodestoneTotalRequests", "Request Count")); ImGuiHelpers.ScaledRelativeSameLine(sameLineOffset); ImGui.Text(requests.Length.ToString()); // requests ImGuiHelpers.ScaledDummy(new Vector2(0, 5f)); ImGui.TextColored(ImGuiColors.DalamudViolet, Loc.Localize("LodestoneRequestsInQueue", "Requests In Queue")); if (requests.Any()) { foreach (var request in requests) { ImGui.Text(request.PlayerName + " (" + request.WorldName + ")"); } } else { ImGui.Text(Loc.Localize("LodestoneNoRequests", "There are no pending lodestone requests.")); } }
private void AddPlayer() { WindowManager.SpacerNoTabs(); ImGui.TextColored(ImGuiColors.DalamudViolet, Loc.Localize("AddPlayerModalContent", "Add player manually to your list.")); ImGui.Spacing(); ImGui.SetNextItemWidth(150f * ImGuiHelpers.GlobalScale); ImGui.Combo( "###PlayerTrack_PlayerAdd_Combo", ref this.selectedWorld, this.worldNames, this.worldNames.Length); ImGui.SetNextItemWidth(150f * ImGuiHelpers.GlobalScale); ImGui.InputTextWithHint( "###PlayerTrack_PlayerNameAdd_Input", Loc.Localize("PlayerNameAddHint", "player name"), ref this.addPlayerInput, 30); ImGui.Spacing(); if (ImGui.Button(Loc.Localize("AddPlayerModalButton", "Add") + "###PlayerTrack_AddPlayerModalOK_Button")) { this.showInvalidNameError = false; this.showDuplicatePlayerError = false; if (this.addPlayerInput.IsValidCharacterName()) { var existingPlayer = this.plugin.PlayerService.GetPlayer(this.addPlayerInput, this.worldNames[this.selectedWorld]); if (existingPlayer != null) { this.showDuplicatePlayerError = true; } else { var player = this.plugin.PlayerService.AddPlayer(this.addPlayerInput, this.worldNames[this.selectedWorld]); this.addPlayerInput = string.Empty; this.SelectedPlayer = player; this.plugin.Configuration.CurrentView = View.PlayerDetail; } } else { this.showInvalidNameError = true; } } ImGui.SameLine(); if (ImGui.Button(Loc.Localize("Cancel", "Cancel") + "###PlayerTrack_AddPlayerModalCancel_Button")) { this.addPlayerInput = string.Empty; this.showInvalidNameError = false; this.showDuplicatePlayerError = false; // this.HideRightPanel(); TODO } ImGui.Spacing(); if (this.showInvalidNameError) { ImGui.TextColored(ImGuiColors.DPSRed, Loc.Localize("InvalidPlayerName", "Not a valid player name - try again.")); } else if (this.showDuplicatePlayerError) { ImGui.TextColored(ImGuiColors.DPSRed, Loc.Localize("DuplicatePlayer", "This player already exists in your list!")); } }