diff --git a/Influx.sln b/Influx.sln index 5ddcc61..fb66e68 100644 --- a/Influx.sln +++ b/Influx.sln @@ -1,34 +1,58 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Influx", "Influx\Influx.csproj", "{588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}" +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35222.181 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Influx", "Influx\Influx.csproj", "{588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LLib", "LLib\LLib.csproj", "{C11552A8-9C8C-4084-A669-AAFE55E24DCC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LLib", "LLib\LLib.csproj", "{C11552A8-9C8C-4084-A669-AAFE55E24DCC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ECommons", "ECommons\ECommons\ECommons.csproj", "{FC6E184C-5B01-4298-87DF-CC10C4955936}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ECommons", "ECommons\ECommons\ECommons.csproj", "{FC6E184C-5B01-4298-87DF-CC10C4955936}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoRetainerAPI", "AutoRetainerAPI\AutoRetainerAPI\AutoRetainerAPI.csproj", "{7352C470-D652-4909-AD90-8A5171A86698}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AutoRetainerAPI", "AutoRetainerAPI\AutoRetainerAPI\AutoRetainerAPI.csproj", "{7352C470-D652-4909-AD90-8A5171A86698}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU + Debug|x64 = Debug|x64 + DebugForms|x64 = DebugForms|x64 + Release|x64 = Release|x64 + ReleaseForms|x64 = ReleaseForms|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.Debug|Any CPU.Build.0 = Debug|Any CPU - {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.Release|Any CPU.ActiveCfg = Release|Any CPU - {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.Release|Any CPU.Build.0 = Release|Any CPU - {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.Release|Any CPU.Build.0 = Release|Any CPU - {FC6E184C-5B01-4298-87DF-CC10C4955936}.Debug|Any CPU.ActiveCfg = Debug|x64 - {FC6E184C-5B01-4298-87DF-CC10C4955936}.Debug|Any CPU.Build.0 = Debug|x64 - {FC6E184C-5B01-4298-87DF-CC10C4955936}.Release|Any CPU.ActiveCfg = Release|x64 - {FC6E184C-5B01-4298-87DF-CC10C4955936}.Release|Any CPU.Build.0 = Release|x64 - {7352C470-D652-4909-AD90-8A5171A86698}.Debug|Any CPU.ActiveCfg = Debug|x64 - {7352C470-D652-4909-AD90-8A5171A86698}.Debug|Any CPU.Build.0 = Debug|x64 - {7352C470-D652-4909-AD90-8A5171A86698}.Release|Any CPU.ActiveCfg = Release|x64 - {7352C470-D652-4909-AD90-8A5171A86698}.Release|Any CPU.Build.0 = Release|x64 + {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.Debug|x64.ActiveCfg = Debug|x64 + {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.Debug|x64.Build.0 = Debug|x64 + {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.DebugForms|x64.ActiveCfg = Debug|x64 + {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.DebugForms|x64.Build.0 = Debug|x64 + {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.Release|x64.ActiveCfg = Release|x64 + {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.Release|x64.Build.0 = Release|x64 + {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.ReleaseForms|x64.ActiveCfg = Release|x64 + {588F6FDE-C6DF-42D9-BD7A-941BE2EB7E44}.ReleaseForms|x64.Build.0 = Release|x64 + {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.Debug|x64.ActiveCfg = Debug|x64 + {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.Debug|x64.Build.0 = Debug|x64 + {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.DebugForms|x64.ActiveCfg = Debug|x64 + {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.DebugForms|x64.Build.0 = Debug|x64 + {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.Release|x64.ActiveCfg = Release|x64 + {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.Release|x64.Build.0 = Release|x64 + {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.ReleaseForms|x64.ActiveCfg = Release|x64 + {C11552A8-9C8C-4084-A669-AAFE55E24DCC}.ReleaseForms|x64.Build.0 = Release|x64 + {FC6E184C-5B01-4298-87DF-CC10C4955936}.Debug|x64.ActiveCfg = Debug|x64 + {FC6E184C-5B01-4298-87DF-CC10C4955936}.Debug|x64.Build.0 = Debug|x64 + {FC6E184C-5B01-4298-87DF-CC10C4955936}.DebugForms|x64.ActiveCfg = DebugForms|x64 + {FC6E184C-5B01-4298-87DF-CC10C4955936}.DebugForms|x64.Build.0 = DebugForms|x64 + {FC6E184C-5B01-4298-87DF-CC10C4955936}.Release|x64.ActiveCfg = Release|x64 + {FC6E184C-5B01-4298-87DF-CC10C4955936}.Release|x64.Build.0 = Release|x64 + {FC6E184C-5B01-4298-87DF-CC10C4955936}.ReleaseForms|x64.ActiveCfg = ReleaseForms|x64 + {FC6E184C-5B01-4298-87DF-CC10C4955936}.ReleaseForms|x64.Build.0 = ReleaseForms|x64 + {7352C470-D652-4909-AD90-8A5171A86698}.Debug|x64.ActiveCfg = Debug|x64 + {7352C470-D652-4909-AD90-8A5171A86698}.Debug|x64.Build.0 = Debug|x64 + {7352C470-D652-4909-AD90-8A5171A86698}.DebugForms|x64.ActiveCfg = Debug|x64 + {7352C470-D652-4909-AD90-8A5171A86698}.DebugForms|x64.Build.0 = Debug|x64 + {7352C470-D652-4909-AD90-8A5171A86698}.Release|x64.ActiveCfg = Release|x64 + {7352C470-D652-4909-AD90-8A5171A86698}.Release|x64.Build.0 = Release|x64 + {7352C470-D652-4909-AD90-8A5171A86698}.ReleaseForms|x64.ActiveCfg = Release|x64 + {7352C470-D652-4909-AD90-8A5171A86698}.ReleaseForms|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE EndGlobalSection EndGlobal diff --git a/Influx/Configuration.cs b/Influx/Configuration.cs index a6de808..154e73c 100644 --- a/Influx/Configuration.cs +++ b/Influx/Configuration.cs @@ -8,6 +8,7 @@ internal sealed class Configuration : IPluginConfiguration public int Version { get; set; } = 1; public ServerConfiguration Server { get; set; } = new(); + public bool AutoEnrollCharacters { get; set; } public IList IncludedCharacters { get; set; } = new List(); public IList IncludedInventoryFilters { get; set; } = new List(); diff --git a/Influx/InfluxPlugin.cs b/Influx/InfluxPlugin.cs index 90ab990..4f6f0e7 100644 --- a/Influx/InfluxPlugin.cs +++ b/Influx/InfluxPlugin.cs @@ -8,6 +8,7 @@ using Dalamud.Game.Command; using Dalamud.Interface.Windowing; using Dalamud.Plugin; using Dalamud.Plugin.Services; +using ECommons; using Influx.AllaganTools; using Influx.Influx; using Influx.LocalStatistics; @@ -65,7 +66,15 @@ internal sealed class InfluxPlugin : IDalamudPlugin _configurationWindow.ConfigUpdated += (_, _) => _influxStatisticsClient.UpdateClient(); _windowSystem.AddWindow(_configurationWindow); - _commandManager.AddHandler("/influx", new CommandInfo(ProcessCommand)); + _commandManager.AddHandler("/influx", new CommandInfo(ProcessCommand) + { + HelpMessage = "Opens influx configuration" + }); + + _commandManager.AddHandler("/influx gil", new CommandInfo(ProcessCommand) + { + HelpMessage = "Opens influx statistics" + }); _timer = new Timer(TimeSpan.FromMinutes(1)); _timer.Elapsed += (_, _) => UpdateStatistics(); @@ -74,6 +83,7 @@ internal sealed class InfluxPlugin : IDalamudPlugin _pluginInterface.UiBuilder.Draw += _windowSystem.Draw; _pluginInterface.UiBuilder.OpenConfigUi += _configurationWindow.Toggle; + _pluginInterface.UiBuilder.OpenMainUi += _statisticsWindow.Toggle; _condition.ConditionChange += UpdateOnLogout; } @@ -220,6 +230,7 @@ internal sealed class InfluxPlugin : IDalamudPlugin _timer.Dispose(); _windowSystem.RemoveAllWindows(); _commandManager.RemoveHandler("/influx"); + _commandManager.RemoveHandler("/influx gil"); _influxStatisticsClient.Dispose(); _fcStatsCalculator.Dispose(); _localStatsCalculator.Dispose(); diff --git a/Influx/Windows/ConfigurationWindow.cs b/Influx/Windows/ConfigurationWindow.cs index 97cac3f..6befb8b 100644 --- a/Influx/Windows/ConfigurationWindow.cs +++ b/Influx/Windows/ConfigurationWindow.cs @@ -103,6 +103,12 @@ internal sealed class ConfigurationWindow : Window if (!tabItem) return; + var refIncludeAll = _configuration.AutoEnrollCharacters; + if (ImGui.Checkbox("Auto enroll characters", ref refIncludeAll)) + { + _configuration.AutoEnrollCharacters = refIncludeAll; + } + if (_clientState is { IsLoggedIn: true, LocalContentId: > 0, LocalPlayer.HomeWorld.RowId: > 0 }) { string worldName = _clientState.LocalPlayer.HomeWorld.Value.Name.ToString(); @@ -135,9 +141,7 @@ internal sealed class ConfigurationWindow : Window } else { - ImGui.TextColored(ImGuiColors.DalamudRed, - "This character is currently excluded."); - if (ImGui.Button("Include current character")) + if (_configuration.AutoEnrollCharacters) { _configuration.IncludedCharacters.Add(new Configuration.CharacterInfo { @@ -147,6 +151,21 @@ internal sealed class ConfigurationWindow : Window }); Save(); } + else + { + ImGui.TextColored(ImGuiColors.DalamudRed, + "This character is currently excluded."); + if (ImGui.Button("Include current character")) + { + _configuration.IncludedCharacters.Add(new Configuration.CharacterInfo + { + LocalContentId = _clientState.LocalContentId, + CachedPlayerName = _clientState.LocalPlayer?.Name.ToString() ?? "??", + CachedWorldName = worldName, + }); + Save(); + } + } } ImGui.Unindent(30);