Allow FC exclusions

This commit is contained in:
Liza 2024-02-28 12:01:38 +01:00
parent 7e0647913c
commit 139c269ddd
Signed by: liza
GPG Key ID: 7199F8D727D55F67
3 changed files with 18 additions and 4 deletions

View File

@ -15,9 +15,9 @@ public sealed class Configuration : IPluginConfiguration
{ {
public bool Enabled { get; set; } public bool Enabled { get; set; }
public string Server { get; set; } = "http://localhost:8086"; public string Server { get; set; } = "http://localhost:8086";
public string Token { get; set; } = "xxx"; public string Token { get; set; } = "";
public string Organization { get; set; } = "org"; public string Organization { get; set; } = "";
public string Bucket { get; set; } = "bucket"; public string Bucket { get; set; } = "";
} }
public sealed class CharacterInfo public sealed class CharacterInfo
@ -25,5 +25,6 @@ public sealed class Configuration : IPluginConfiguration
public ulong LocalContentId { get; set; } public ulong LocalContentId { get; set; }
public string? CachedPlayerName { get; set; } public string? CachedPlayerName { get; set; }
public string? CachedWorldName { get; set; } public string? CachedWorldName { get; set; }
public bool IncludeFreeCompany { get; set; } = true;
} }
} }

View File

@ -53,6 +53,7 @@ internal sealed class InfluxStatisticsClient : IDisposable
var validFcIds = currencyStats.Keys var validFcIds = currencyStats.Keys
.Where(x => x.CharacterType == CharacterType.Character) .Where(x => x.CharacterType == CharacterType.Character)
.Where(x => _configuration.IncludedCharacters.SingleOrDefault(config => config.LocalContentId == x.CharacterId)?.IncludeFreeCompany == true)
.Select(x => x.FreeCompanyId) .Select(x => x.FreeCompanyId)
.ToList(); .ToList();
Task.Run(async () => Task.Run(async () =>

View File

@ -88,9 +88,21 @@ internal sealed class ConfigurationWindow : Window
$"Current Character: {_clientState.LocalPlayer?.Name} @ {worldName} ({_clientState.LocalContentId:X})"); $"Current Character: {_clientState.LocalPlayer?.Name} @ {worldName} ({_clientState.LocalContentId:X})");
ImGui.Indent(30); ImGui.Indent(30);
if (_configuration.IncludedCharacters.Any(x => x.LocalContentId == _clientState.LocalContentId)) Configuration.CharacterInfo? includedCharacter =
_configuration.IncludedCharacters.FirstOrDefault(x => x.LocalContentId == _clientState.LocalContentId);
if (includedCharacter != null)
{ {
ImGui.TextColored(ImGuiColors.HealerGreen, "This character is currently included."); ImGui.TextColored(ImGuiColors.HealerGreen, "This character is currently included.");
bool includeFreeCompany = includedCharacter.IncludeFreeCompany;
if (ImGui.Checkbox("Include Free Company statistics", ref includeFreeCompany))
{
includedCharacter.IncludeFreeCompany = includeFreeCompany;
Save();
}
ImGui.Spacing();
if (ImGui.Button("Remove inclusion")) if (ImGui.Button("Remove inclusion"))
{ {
_configuration.IncludedCharacters.RemoveAll( _configuration.IncludedCharacters.RemoveAll(