diff --git a/ContactsTracker/Configuration.cs b/ContactsTracker/Configuration.cs index 11d1265..b564ea5 100644 --- a/ContactsTracker/Configuration.cs +++ b/ContactsTracker/Configuration.cs @@ -12,6 +12,8 @@ public class Configuration : IPluginConfiguration public bool EnableLogParty { get; set; } = false; + public bool LogPartyClass { get; set; } = false; + public bool RecordSolo { get; set; } = false; public bool PrintToChat { get; set; } = false; diff --git a/ContactsTracker/ContactsTracker.csproj b/ContactsTracker/ContactsTracker.csproj index 509873b..abd89de 100644 --- a/ContactsTracker/ContactsTracker.csproj +++ b/ContactsTracker/ContactsTracker.csproj @@ -3,7 +3,7 @@ net8.0-windows - 0.1.0.3 + 0.2.0.0 Help you remember previous contacts. https://github.com/DueDine/ContactsTracker AGPL-3.0-or-later diff --git a/ContactsTracker/DataEntry.cs b/ContactsTracker/DataEntry.cs index ba64e34..f5fd902 100644 --- a/ContactsTracker/DataEntry.cs +++ b/ContactsTracker/DataEntry.cs @@ -47,7 +47,7 @@ public static unsafe void finalize(Configuration configuration) if (configuration.EnableLogParty == false) { - Instance.partyMembers = "Party Logging Disabled"; + Instance.partyMembers = "Party Logging Disabled For this Entry"; } else { @@ -69,12 +69,17 @@ public static unsafe void finalize(Configuration configuration) var names = new string[numOfParty]; for (var i = 0; i < numOfParty; i++) { - var partyMember = Plugin.PartyList.CreatePartyMemberReference(Plugin.PartyList.GetPartyMemberAddress(i)); + var partyMember = Plugin.PartyList[i]; if (partyMember != null) { var worldID = groupManager->GetPartyMemberByContentId((ulong)partyMember.ContentId)->HomeWorld; var worldName = Plugin.DataManager.GetExcelSheet()?.GetRow(worldID).Name.ExtractText(); - names[i] = partyMember.Name.ToString() + " @ " + worldName; + names[i] = $"{partyMember.Name} @ {worldName}"; + if (configuration.LogPartyClass) + { + var jobName = partyMember.ClassJob.Value.Abbreviation.ExtractText(); + names[i] += $" ({jobName})"; + } } } foreach (var name in names) diff --git a/ContactsTracker/Windows/MainWindow.cs b/ContactsTracker/Windows/MainWindow.cs index 208efa6..0173b5c 100644 --- a/ContactsTracker/Windows/MainWindow.cs +++ b/ContactsTracker/Windows/MainWindow.cs @@ -1,7 +1,9 @@ using Dalamud.Game.ClientState.Keys; +using Dalamud.Interface.Colors; using Dalamud.Interface.Utility; using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Windowing; +using Dalamud.Utility; using ImGuiNET; using System; using System.Linq; @@ -59,6 +61,13 @@ public override void Draw() DrawSettingsTab(); } } + using (var aboutTab = ImRaii.TabItem("About")) + { + if (aboutTab) + { + DrawAboutTab(); + } + } } private void DrawActiveTab() @@ -304,6 +313,23 @@ private void DrawSettingsTab() ImGui.SetTooltip("Enable to log party members on completion."); } + if (Plugin.Configuration.EnableLogParty) + { + ImGui.SameLine(); + + var logPartyClass = Plugin.Configuration.LogPartyClass; + if (ImGui.Checkbox("Log Party Class", ref logPartyClass)) + { + Plugin.Configuration.LogPartyClass = logPartyClass; + Plugin.Configuration.Save(); + } + + if (ImGui.IsItemHovered()) + { + ImGui.SetTooltip("Also record their class."); + } + } + var recordSolo = Plugin.Configuration.RecordSolo; if (ImGui.Checkbox("Record Solo", ref recordSolo)) { @@ -476,4 +502,26 @@ private void DrawSettingsTab() } } + private static void DrawAboutTab() + { + ImGuiHelpers.ScaledDummy(5f); + + ImGui.TextColored(ImGuiColors.DalamudRed, "This plugin is in early development. Please report any bugs or suggestions to the developer."); + + ImGuiHelpers.ScaledDummy(2f); + + ImGui.TextColored(ImGuiColors.DalamudOrange, "Discord: @lamitt"); + ImGui.TextColored(ImGuiColors.DalamudOrange, "You can ping me at the Dalamud Discord server. Or open an issue at the GitHub repository."); + + ImGuiHelpers.ScaledDummy(5f); + + using (ImRaii.PushColor(ImGuiCol.Button, ImGuiColors.ParsedBlue)) + { + if (ImGui.Button("GitHub Repository")) + { + Util.OpenLink("https://github.com/DueDine/ContactsTracker"); + } + } + } + }