mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-15 05:04:15 +01:00
title screen menu: some visual fixes
Use SeStringRenderer to render menu entries Clamp alpha values to avoid flickering
This commit is contained in:
parent
c79b1cd83a
commit
2e77e90532
1 changed files with 15 additions and 21 deletions
|
|
@ -11,6 +11,7 @@ using Dalamud.Game.ClientState;
|
|||
using Dalamud.Game.Gui;
|
||||
using Dalamud.Game.Text;
|
||||
using Dalamud.Interface.Animation.EasingFunctions;
|
||||
using Dalamud.Interface.ImGuiSeStringRenderer;
|
||||
using Dalamud.Interface.ManagedFontAtlas;
|
||||
using Dalamud.Interface.ManagedFontAtlas.Internals;
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
|
|
@ -251,7 +252,7 @@ internal class TitleScreenMenuWindow : Window, IDisposable
|
|||
|
||||
this.fadeOutEasing.Update();
|
||||
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.Alpha, (float)this.fadeOutEasing.Value))
|
||||
using (ImRaii.PushStyle(ImGuiStyleVar.Alpha, (float)Math.Max(this.fadeOutEasing.Value, 0)))
|
||||
{
|
||||
var i = 0;
|
||||
foreach (var entry in entries)
|
||||
|
|
@ -392,21 +393,14 @@ internal class TitleScreenMenuWindow : Window, IDisposable
|
|||
|
||||
if (overrideAlpha)
|
||||
{
|
||||
ImGui.PushStyleVar(ImGuiStyleVar.Alpha, showText ? (float)logoEasing.Value : 0f);
|
||||
ImGui.PushStyleVar(ImGuiStyleVar.Alpha, showText ? (float)Math.Min(logoEasing.Value, 1) : 0f);
|
||||
}
|
||||
|
||||
// Drop shadow
|
||||
using (ImRaii.PushColor(ImGuiCol.Text, 0xFF000000))
|
||||
{
|
||||
for (int i = 0, to = (int)Math.Ceiling(1 * scale); i < to; i++)
|
||||
{
|
||||
ImGui.SetCursorPos(new Vector2(cursor.X, cursor.Y + i));
|
||||
ImGui.Text(entry.Name);
|
||||
}
|
||||
}
|
||||
|
||||
ImGui.SetCursorPos(cursor);
|
||||
ImGui.Text(entry.Name);
|
||||
var renderStyle = default(SeStringDrawParams);
|
||||
renderStyle.FontSize = TargetFontSizePx;
|
||||
ImGuiHelpers.CompileSeStringWrapped($"<edge(1)><shadow(1)>{entry.Name}<shadow(0)><edge(0)>", renderStyle);
|
||||
|
||||
if (overrideAlpha)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue