Skip to content

Commit

Permalink
[feat] Record Party ClassJob & About Tab | [chore] Up Version
Browse files Browse the repository at this point in the history
  • Loading branch information
DueDine committed Jan 7, 2025
1 parent ada6ada commit ef9ba91
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ContactsTracker/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion ContactsTracker/ContactsTracker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<Version>0.1.0.3</Version>
<Version>0.2.0.0</Version>
<Description>Help you remember previous contacts.</Description>
<PackageProjectUrl>https://github.com/DueDine/ContactsTracker</PackageProjectUrl>
<PackageLicenseExpression>AGPL-3.0-or-later</PackageLicenseExpression>
Expand Down
11 changes: 8 additions & 3 deletions ContactsTracker/DataEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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<World>()?.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)
Expand Down
48 changes: 48 additions & 0 deletions ContactsTracker/Windows/MainWindow.cs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -59,6 +61,13 @@ public override void Draw()
DrawSettingsTab();
}
}
using (var aboutTab = ImRaii.TabItem("About"))
{
if (aboutTab)
{
DrawAboutTab();
}
}
}

private void DrawActiveTab()
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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");
}
}
}

}

0 comments on commit ef9ba91

Please sign in to comment.