mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-13 12:14:16 +01:00
feat: show ban/api warnings without expanding header
This commit is contained in:
parent
6a8256b827
commit
71bf1e549b
1 changed files with 32 additions and 27 deletions
|
|
@ -1110,19 +1110,41 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
cursor.Y += ImGui.GetTextLineHeightWithSpacing();
|
cursor.Y += ImGui.GetTextLineHeightWithSpacing();
|
||||||
ImGui.SetCursorPos(cursor);
|
ImGui.SetCursorPos(cursor);
|
||||||
|
|
||||||
// Description
|
// Outdated warning
|
||||||
if (!string.IsNullOrWhiteSpace(manifest.Punchline))
|
if (plugin is { IsOutdated: true, IsBanned: false })
|
||||||
{
|
{
|
||||||
ImGui.TextWrapped(manifest.Punchline);
|
ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudRed);
|
||||||
|
ImGui.TextWrapped(Locs.PluginBody_Outdated);
|
||||||
|
ImGui.PopStyleColor();
|
||||||
}
|
}
|
||||||
else if (!string.IsNullOrWhiteSpace(manifest.Description))
|
|
||||||
{
|
|
||||||
const int punchlineLen = 200;
|
|
||||||
var firstLine = manifest.Description.Split(new[] { '\r', '\n' })[0];
|
|
||||||
|
|
||||||
ImGui.TextWrapped(firstLine.Length < punchlineLen
|
// Banned warning
|
||||||
? firstLine
|
if (plugin is { IsBanned: true })
|
||||||
: firstLine[..punchlineLen]);
|
{
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
else if (!string.IsNullOrWhiteSpace(manifest.Description))
|
||||||
|
{
|
||||||
|
const int punchlineLen = 200;
|
||||||
|
var firstLine = manifest.Description.Split(new[] { '\r', '\n' })[0];
|
||||||
|
|
||||||
|
ImGui.TextWrapped(firstLine.Length < punchlineLen
|
||||||
|
? firstLine
|
||||||
|
: firstLine[..punchlineLen]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
startCursor.Y += sectionSize;
|
startCursor.Y += sectionSize;
|
||||||
|
|
@ -1421,23 +1443,6 @@ namespace Dalamud.Interface.Internal.Windows
|
||||||
ImGui.TextWrapped(manifest.Description);
|
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)
|
// Available commands (if loaded)
|
||||||
if (plugin.IsLoaded)
|
if (plugin.IsLoaded)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue