Snapshot for release 2026.10.6.1 (internal 1cbe514)
This commit is contained in:
parent
913a2a00b6
commit
abf9146a5b
93 changed files with 10168 additions and 597 deletions
43
src/RynthCore.Engine/ImGui/VideoPatchBanner.cs
Normal file
43
src/RynthCore.Engine/ImGui/VideoPatchBanner.cs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
// ============================================================================
|
||||
// RynthCore.Engine - ImGui/VideoPatchBanner.cs
|
||||
// The "rendering paused" banner of the video patch's "all" mode
|
||||
// (D3D9/VideoPatch.cs): AC draws nothing then (the back buffer is only
|
||||
// cleared to black), so the window says why and how to get it back. Drawn on
|
||||
// ImGui's background list, under every panel. AC's render thread, inside the
|
||||
// main ImGui frame.
|
||||
// ============================================================================
|
||||
|
||||
using System.Numerics;
|
||||
|
||||
namespace RynthCore.Engine.ImGuiBackend;
|
||||
|
||||
internal static class VideoPatchBanner
|
||||
{
|
||||
private const string Line1 = "Rendering paused (video patch: all)";
|
||||
private const string Line2 = "Type /rc video off, or Settings > Misc > Video patch";
|
||||
|
||||
private static readonly uint Back = RynthTheme.Argb(0xC0101820);
|
||||
private static readonly uint Border = RynthTheme.Argb(0xFF34587A);
|
||||
private static readonly uint Title = RynthTheme.Argb(0xFF26D9E6);
|
||||
private static readonly uint Text = RynthTheme.Argb(0xFFB8C8D8);
|
||||
|
||||
public static void Draw()
|
||||
{
|
||||
if (!D3D9.VideoPatch.WantsBanner) return;
|
||||
ImGuiNET.ImGuiIOPtr io = ImGuiNET.ImGui.GetIO();
|
||||
Vector2 display = io.DisplaySize;
|
||||
if (display.X <= 1 || display.Y <= 1) return;
|
||||
|
||||
var dl = ImGuiNET.ImGui.GetBackgroundDrawList();
|
||||
Vector2 s1 = ImGuiNET.ImGui.CalcTextSize(Line1);
|
||||
Vector2 s2 = ImGuiNET.ImGui.CalcTextSize(Line2);
|
||||
float w = System.MathF.Max(s1.X, s2.X) + 32f;
|
||||
float h = s1.Y + s2.Y + 28f;
|
||||
Vector2 min = new((display.X - w) * 0.5f, (display.Y - h) * 0.5f);
|
||||
Vector2 max = min + new Vector2(w, h);
|
||||
dl.AddRectFilled(min, max, Back, 6f);
|
||||
dl.AddRect(min, max, Border, 6f);
|
||||
dl.AddText(new Vector2((display.X - s1.X) * 0.5f, min.Y + 10f), Title, Line1);
|
||||
dl.AddText(new Vector2((display.X - s2.X) * 0.5f, min.Y + 18f + s1.Y), Text, Line2);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue