Merge pull request #647 from Aireil/feat_warnings_position

This commit is contained in:
goaaats 2021-10-17 22:37:47 +02:00 committed by GitHub
commit aa38a8811d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -635,7 +635,7 @@ namespace Dalamud.Interface.Internal.Windows
this.DrawPluginCategorySelectors();
ImGui.TableNextColumn();
if (ImGui.BeginChild("ScrollingPlugins", new Vector2(-1, 0), false, ImGuiWindowFlags.HorizontalScrollbar | ImGuiWindowFlags.NoBackground))
if (ImGui.BeginChild("ScrollingPlugins", new Vector2(-1, 0), false, ImGuiWindowFlags.NoBackground))
{
this.DrawPluginCategoryContent();
}
@ -1110,7 +1110,28 @@ namespace Dalamud.Interface.Internal.Windows
cursor.Y += ImGui.GetTextLineHeightWithSpacing();
ImGui.SetCursorPos(cursor);
// Outdated warning
if (plugin is { IsOutdated: true, IsBanned: false })
{
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
ImGui.TextWrapped(Locs.PluginBody_Outdated);
ImGui.PopStyleColor();
}
// Banned warning
if (plugin is { IsBanned: true })
{
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
ImGui.TextWrapped(plugin.BanReason.IsNullOrEmpty()
? Locs.PluginBody_Banned
: Locs.PluginBody_BannedReason(plugin.BanReason));
ImGui.PopStyleColor();
}
// Description
if (plugin is null or { IsOutdated: false, IsBanned: false })
{
if (!string.IsNullOrWhiteSpace(manifest.Punchline))
{
ImGui.TextWrapped(manifest.Punchline);
@ -1124,6 +1145,7 @@ namespace Dalamud.Interface.Internal.Windows
? firstLine
: firstLine[..punchlineLen]);
}
}
startCursor.Y += sectionSize;
ImGui.SetCursorPos(startCursor);
@ -1421,23 +1443,6 @@ namespace Dalamud.Interface.Internal.Windows
ImGui.TextWrapped(manifest.Description);
}
if (plugin.IsOutdated && !plugin.IsBanned)
{
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
ImGui.TextWrapped(Locs.PluginBody_Outdated);
ImGui.PopStyleColor();
}
if (plugin.IsBanned)
{
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
ImGui.TextWrapped(plugin.BanReason.IsNullOrEmpty()
? Locs.PluginBody_Banned
: Locs.PluginBody_BannedReason(plugin.BanReason));
ImGui.PopStyleColor();
}
// Available commands (if loaded)
if (plugin.IsLoaded)
{