1
0
Fork 0
forked from aly/qstbak

muffin v7.5.1

This commit is contained in:
alydev 2026-05-01 08:59:48 +10:00
parent a6481e7b9a
commit 965a736f84
59 changed files with 4112 additions and 5059 deletions

View file

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Numerics;
using Dalamud.Bindings.ImGui;
@ -41,41 +40,26 @@ internal static class ChangelogCategoryComponent
{
float cursorPosY = ImGui.GetCursorPosY();
ImGui.SetCursorPosX(baseX);
FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true);
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
ImGui.TextColored(in color, icon.ToIconString());
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SameLine();
ImGui.SetCursorPosY(cursorPosY);
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Text, color, true);
try
using (ImRaii.PushColor(ImGuiCol.Text, color))
{
ImGui.TextUnformatted(text);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
private static void DrawChange(ChangeEntry change, float baseX, float changeIndent)
{
ImGui.SetCursorPosX(baseX + changeIndent);
float cursorPosY = ImGui.GetCursorPosY();
FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true);
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
ImGui.TextColored(new Vector4(0.95f, 0.95f, 1f, 1f), FontAwesomeIcon.CaretRight.ToIconString());
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SameLine();
ImGui.SetCursorPosY(cursorPosY);
float num = ImGui.GetContentRegionAvail().X - 8f;
@ -95,15 +79,10 @@ internal static class ChangelogCategoryComponent
{
ImGui.SetCursorPosX(baseX + num);
float cursorPosY = ImGui.GetCursorPosY();
FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true);
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
ImGui.TextColored(new Vector4(0.85f, 0.85f, 0.92f, 1f), FontAwesomeIcon.AngleRight.ToIconString());
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SameLine();
ImGui.SetCursorPosY(cursorPosY);
float num2 = ImGui.GetContentRegionAvail().X - 8f;

View file

@ -37,28 +37,20 @@ internal sealed class ChangelogEntryComponent
string text2 = "v" + changelog.Version;
float fontSize = ImGui.GetFontSize();
float num = fontSize;
FontDisposable val = ImRaii.PushFont(UiBuilder.MonoFont, true);
Vector2 versionSize;
try
using (ImRaii.PushFont(UiBuilder.MonoFont))
{
versionSize = ImGui.CalcTextSize(text2);
}
finally
{
((IDisposable)val)?.Dispose();
}
Vector2 dateSize = ImGui.CalcTextSize(text);
float scaledIconFontSize = fontSize * 0.85f;
float x = ImGui.GetContentRegionAvail().X;
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.Header, new Vector4(0.2f, 0.18f, 0.25f, 0.6f), true);
bool flag;
try
using (ImRaii.PushColor(ImGuiCol.Header, new Vector4(0.2f, 0.18f, 0.25f, 0.6f)))
{
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.HeaderHovered, new Vector4(0.3f, 0.25f, 0.35f, 0.8f), true);
try
using (ImRaii.PushColor(ImGuiCol.HeaderHovered, new Vector4(0.3f, 0.25f, 0.35f, 0.8f)))
{
ColorDisposable val4 = ImRaii.PushColor(ImGuiCol.HeaderActive, new Vector4(0.25f, 0.22f, 0.3f, 1f), true);
try
using (ImRaii.PushColor(ImGuiCol.HeaderActive, new Vector4(0.25f, 0.22f, 0.3f, 1f)))
{
Vector2 cursorPos = ImGui.GetCursorPos();
Vector2 cursorScreenPos = ImGui.GetCursorScreenPos();
@ -75,19 +67,7 @@ internal sealed class ChangelogEntryComponent
DrawDateWithIcon(text, dateSize, scaledIconFontSize, cursorScreenPos, cursorPos, x, verticalOffset, fontSize);
ImGui.SetCursorPos(cursorPos2);
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
if (flag)
{
@ -98,16 +78,11 @@ internal sealed class ChangelogEntryComponent
private static void DrawVersionText(string versionText, Vector2 versionSize, Vector2 headerStartPos, float verticalOffset)
{
float x = headerStartPos.X + ImGui.GetStyle().FramePadding.X * 2f + 20f;
FontDisposable val = ImRaii.PushFont(UiBuilder.MonoFont, true);
try
using (ImRaii.PushFont(UiBuilder.MonoFont))
{
ImGui.SetCursorPos(new Vector2(x, headerStartPos.Y + verticalOffset));
ImGui.TextColored(new Vector4(0.95f, 0.95f, 0.95f, 1f), versionText);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
private void DrawNewBadge(bool isNew, Vector2 headerStartScreenPos, float availableWidth)
@ -125,16 +100,11 @@ internal sealed class ChangelogEntryComponent
private static void DrawDateWithIcon(string dateText, Vector2 dateSize, float scaledIconFontSize, Vector2 headerStartScreenPos, Vector2 headerStartPos, float availableWidth, float verticalOffset, float defaultFontSize)
{
string text = FontAwesomeIcon.Calendar.ToIconString();
FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true);
Vector2 vector;
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
vector = ImGui.CalcTextSize(text);
}
finally
{
((IDisposable)val)?.Dispose();
}
float num = vector.X * (scaledIconFontSize / defaultFontSize);
float num2 = num + 4f + dateSize.X;
float num3 = availableWidth - num2 - 12f;

View file

@ -19,33 +19,18 @@ internal sealed class ChangelogFooterComponent
float num = 120f;
float num2 = (ImGui.GetContentRegionAvail().X - num) * 0.5f;
ImGui.SetCursorPosX(ImGui.GetCursorPosX() + num2);
ColorDisposable val = ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.55f, 0.45f, 0.75f, 0.6f), true);
try
using (ImRaii.PushColor(ImGuiCol.Button, new Vector4(0.55f, 0.45f, 0.75f, 0.6f)))
{
ColorDisposable val2 = ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.65f, 0.55f, 0.85f, 0.8f), true);
try
using (ImRaii.PushColor(ImGuiCol.ButtonHovered, new Vector4(0.65f, 0.55f, 0.85f, 0.8f)))
{
ColorDisposable val3 = ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.75f, 0.55f, 0.95f, 1f), true);
try
using (ImRaii.PushColor(ImGuiCol.ButtonActive, new Vector4(0.75f, 0.55f, 0.95f, 1f)))
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.CheckCircle, "Got It!"))
{
onConfirm();
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
}

View file

@ -162,8 +162,7 @@ internal sealed class ChangelogHeaderComponent
drawList.AddCircleFilled(center, num * 0.4f, col);
DrawAnimatedCross(drawList, center, flag);
ImGui.SetCursorScreenPos(vector);
ImGui.InvisibleButton("CloseButton", new Vector2(num, num));
if (ImGui.IsItemClicked())
if (ImGui.InvisibleButton("CloseButton", new Vector2(num, num)))
{
onCloseClicked(obj: false);
}
@ -200,8 +199,7 @@ internal sealed class ChangelogHeaderComponent
{
float num = MathF.Sin(_animationTime * 2f) * 3f;
float num2 = MathF.Sin(_animationTime * 1.5f + (float)Math.PI / 2f) * 1.5f;
FontDisposable val = ImRaii.PushFont(UiBuilder.IconFont, true);
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
string text = FontAwesomeIcon.FileAlt.ToIconString();
ImGui.SetCursorPosX(centerX - ImGui.CalcTextSize(text).X * 0.5f + num2);
@ -214,10 +212,6 @@ internal sealed class ChangelogHeaderComponent
ImGui.TextColored(new Vector4(0.75f, 0.55f, 0.95f, 1f), text);
ImGui.PopStyleVar();
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SetCursorPosY(ImGui.GetCursorPosY() - num + 4f);
}
@ -225,8 +219,7 @@ internal sealed class ChangelogHeaderComponent
{
float num = MathF.Max(0f, 1f - (_animationTime - 0.1f) * 3f);
float num2 = num * num * (3f - 2f * num) * 20f;
FontDisposable val = ImRaii.PushFont(UiBuilder.MonoFont, true);
try
using (ImRaii.PushFont(UiBuilder.MonoFont))
{
string text = "What's New in Questionable?";
ImGui.SetCursorPosX(centerX - ImGui.CalcTextSize(text).X * 0.5f - num2);
@ -234,10 +227,6 @@ internal sealed class ChangelogHeaderComponent
ImGui.TextColored(new Vector4(0.95f, 0.95f, 1f, 1f), text);
ImGui.PopStyleVar();
}
finally
{
((IDisposable)val)?.Dispose();
}
ImGui.SetCursorPosY(ImGui.GetCursorPosY() + 6f);
}