Refactor FoolsPluginMetadata

This commit is contained in:
NotNite 2023-03-20 11:09:11 -04:00
parent 6403c8af68
commit 171c281cca
No known key found for this signature in database
GPG key ID: BD91A5402CCEB08A
3 changed files with 55 additions and 23 deletions

View file

@ -45,10 +45,6 @@ namespace Dalamud.Fools;
// * //(/******,,,.,,..,,,****/*///((((#(###(/##(, // * //(/******,,,.,,..,,,****/*///((((#(###(/##(,
// //
// April fools! <3 // April fools! <3
// This was a group effort in one week lead by:
// NotNite: FoolsManager, Pixel Imperfect, Screensaver
// Berna: DailyLifeDuty
// Chirp: Oops, Maybe Lalafells!
/// <summary> /// <summary>
/// Manager for all the IFoolsPlugin instances. /// Manager for all the IFoolsPlugin instances.
@ -76,12 +72,51 @@ internal class FoolsManager : IDisposable, IServiceType
// reflect over all IFoolsPlugin implementations sometime(?) // reflect over all IFoolsPlugin implementations sometime(?)
this.FoolsPlugins = new List<FoolsPluginMetadata> this.FoolsPlugins = new List<FoolsPluginMetadata>
{ {
new("Pixel Imperfect", "PixelImperfectPlugin", "Whoops... we messed up the math on that one.", "Halpo", new()
typeof(PixelImperfectPlugin)), {
new("DailyLifeDuty", "DailyLifeDutyPlugin", "Easily Track Daily and Weekly tasks... in real life", "MidoriKami", typeof(DailyLifeDutyPlugin)), Name = "Pixel Imperfect",
new("Oops, Maybe Lalafells!", "OopsMaybeLalafellsPlugin", "Turn everyone into Lalafells? Maybe. We haven't quite tested it yet.", "Chrip", typeof(OopsMaybeLalafells)), InternalName = "PixelImperfectPlugin",
new("Screensaver", "ScreensaverPlugin", "Prevent burn-in on loading screens.", "NotNite", typeof(ScreensaverPlugin)), Description = "Whoops... we messed up the math on that one.",
new("Cat Bubbles", "CatBubblesPlugin", "Enables in-game sdfgasdfgkljewriogdfkjghahfvcxbnmlqpwoeiruty", "Chirp's Cat, Sir Fluffington III", typeof(CatBubblesPlugin)) Author = "Halpo",
RealAuthor = "NotNite",
Type = typeof(PixelImperfectPlugin),
},
new()
{
Name = "DailyLifeDuty",
InternalName = "DailyLifeDutyPlugin",
Description = "Easily Track Daily and Weekly tasks... in real life",
Author = "MidoriKami",
RealAuthor = "Berna",
Type = typeof(DailyLifeDutyPlugin),
},
new()
{
Name = "Oops, Maybe Lalafells!",
InternalName = "OopsMaybeLalafellsPlugin",
Description = "Turn everyone into Lalafells? Maybe. We haven't quite tested it yet.",
Author = "Chrip",
RealAuthor = "Chirp",
Type = typeof(OopsMaybeLalafells),
},
new()
{
Name = "Screensaver",
InternalName = "ScreensaverPlugin",
Description = "Prevent burn-in on loading screens.",
Author = "NotNite",
RealAuthor = "NotNite",
Type = typeof(ScreensaverPlugin),
},
new()
{
Name = "Cat Bubbles",
InternalName = "CatBubblesPlugin",
Description = "Enables in-game sdfgasdfgkljewriogdfkjghahfvcxbnmlqpwoeiruty",
Author = "Chirp's Cat, Sir Fluffington III",
RealAuthor = "Chirp",
Type = typeof(CatBubblesPlugin),
},
}; };
} }

View file

@ -4,22 +4,15 @@ namespace Dalamud.Fools;
public class FoolsPluginMetadata public class FoolsPluginMetadata
{ {
public string Name { get; } public string Name { get; init; }
public string InternalName { get; } public string InternalName { get; init; }
public string Description { get; } public string Description { get; init; }
public string Author { get; } public string Author { get; init; }
public Type Type { get; } public string RealAuthor { get; init; }
public FoolsPluginMetadata(string name, string internalName, string description, string author, Type type) public Type Type { get; init; }
{
this.Name = name;
this.InternalName = internalName;
this.Description = description;
this.Author = author;
this.Type = type;
}
} }

View file

@ -1303,6 +1303,10 @@ internal class PluginInstallerWindow : Window, IDisposable
ImGui.SameLine(); ImGui.SameLine();
ImGui.TextColored(ImGuiColors.DalamudGrey3, $" by {plugin.Author}"); ImGui.TextColored(ImGuiColors.DalamudGrey3, $" by {plugin.Author}");
if (ImGui.IsItemHovered() && plugin.Author != plugin.RealAuthor)
{
ImGui.SetTooltip($"actually by {plugin.RealAuthor}");
}
ImGui.TextWrapped(plugin.Description); ImGui.TextWrapped(plugin.Description);