From fd66645f47d4aacea2b8a1c2f582e46c8b08f794 Mon Sep 17 00:00:00 2001 From: goat Date: Fri, 31 Mar 2023 20:19:15 +0200 Subject: [PATCH] add AppearCondition.Fools23 for installer category which checks date, remove popup for now --- Dalamud/Fools/FoolsManager.cs | 8 ++++++++ .../Internal/PluginCategoryManager.cs | 4 +++- .../PluginInstaller/PluginInstallerWindow.cs | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) diff --git a/Dalamud/Fools/FoolsManager.cs b/Dalamud/Fools/FoolsManager.cs index 336aed539..f929fdd5d 100644 --- a/Dalamud/Fools/FoolsManager.cs +++ b/Dalamud/Fools/FoolsManager.cs @@ -165,6 +165,12 @@ internal class FoolsManager : IDisposable, IServiceType }; } + public bool CheckIsApplicableAprilFoolsTime() + { + var now = DateTime.Now; + return now is { Year: 2023, Month: 4, Day: 1 }; + } + public void ActivatePlugin(string plugin) { if (this.ActivatedPlugins.ContainsKey(plugin)) @@ -238,10 +244,12 @@ internal class FoolsManager : IDisposable, IServiceType return; } + /* var di = Service.Get(); di.OpenFoolsWindow(); dalamudConfig.HasSeenFools23 = true; dalamudConfig.QueueSave(); + */ } } diff --git a/Dalamud/Interface/Internal/PluginCategoryManager.cs b/Dalamud/Interface/Internal/PluginCategoryManager.cs index 1a8acfa3f..9b322a78b 100644 --- a/Dalamud/Interface/Internal/PluginCategoryManager.cs +++ b/Dalamud/Interface/Internal/PluginCategoryManager.cs @@ -28,7 +28,7 @@ internal class PluginCategoryManager new(11, "special.devIconTester", () => Locs.Category_IconTester), new(12, "special.dalamud", () => Locs.Category_Dalamud), new(13, "special.plugins", () => Locs.Category_Plugins), - new(14, "special.alternateReality", () => "Alternate Reality"), + new(14, "special.alternateReality", () => "Alternate Reality", CategoryInfo.AppearCondition.Fools23), new(FirstTagBasedCategoryId + 0, "other", () => Locs.Category_Other), new(FirstTagBasedCategoryId + 1, "jobs", () => Locs.Category_Jobs), new(FirstTagBasedCategoryId + 2, "ui", () => Locs.Category_UI), @@ -362,6 +362,8 @@ internal class PluginCategoryManager /// Check if plugin testing is enabled. /// DoPluginTest, + + Fools23, } /// diff --git a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs index e934ea71b..e87803179 100644 --- a/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs +++ b/Dalamud/Interface/Internal/Windows/PluginInstaller/PluginInstallerWindow.cs @@ -1150,6 +1150,10 @@ internal class PluginInstallerWindow : Window, IDisposable if (!Service.Get().DoPluginTest) continue; break; + case PluginCategoryManager.CategoryInfo.AppearCondition.Fools23: + if (!Service.Get().CheckIsApplicableAprilFoolsTime()) + continue; + break; default: throw new ArgumentOutOfRangeException(); } @@ -1293,6 +1297,20 @@ internal class PluginInstallerWindow : Window, IDisposable { var manager = Service.Get(); + ImGui.TextWrapped(@" +A team of scientists and plugin developers have collaborated to create a new +version of Dalamud that includes plugins from other realities. + +With our high tech systems, the plugin installer now offers new and unique +plugins with endless possibilities. + +We hope you enjoy this new version of Dalamud, and we look forward to your feedback. +".Trim()); + + ImGuiHelpers.ScaledDummy(8); + ImGui.SameLine(); + ImGuiHelpers.ScaledDummy(8); + foreach (var plugin in manager.FoolsPlugins) { // dropdown