muffin v7.5.0

This commit is contained in:
alydev 2026-05-01 05:17:35 +10:00
parent afafd5e377
commit a6481e7b9a
67 changed files with 4281 additions and 2372 deletions

View file

@ -51,136 +51,175 @@ internal sealed class BlacklistConfigComponent : ConfigComponent
public override void DrawTab()
{
using ImRaii.IEndObject endObject = ImRaii.TabItem("Blacklist###QuestBlacklist");
if (!endObject)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
TabItemDisposable val = ImRaii.TabItem((ImU8String)"Blacklist###QuestBlacklist");
try
{
return;
}
ImGui.TextWrapped("Blacklisted quests will never be automatically picked up or executed by Questionable.");
ImGui.TextWrapped("Use this to permanently skip specific quests you don't want to do.");
ImGui.Separator();
DrawCurrentlyAcceptedQuests();
HashSet<ElementId> blacklistedQuests = base.Configuration.General.BlacklistedQuests;
ImU8String text = new ImU8String(22, 1);
text.AppendLiteral("Blacklisted Quests (");
text.AppendFormatted(blacklistedQuests.Count);
text.AppendLiteral("):");
ImGui.Text(text);
using (ImRaii.IEndObject endObject2 = ImRaii.Child("BlacklistedQuestsList", new Vector2(-1f, 200f), border: true))
{
if (endObject2)
if (!val)
{
if (blacklistedQuests.Count > 0)
return;
}
ImGui.TextWrapped("Blacklisted quests will never be automatically picked up or executed by Questionable.");
ImGui.TextWrapped("Use this to permanently skip specific quests you don't want to do.");
ImGui.Separator();
DrawCurrentlyAcceptedQuests();
HashSet<ElementId> blacklistedQuests = base.Configuration.General.BlacklistedQuests;
ImU8String text = new ImU8String(22, 1);
text.AppendLiteral("Blacklisted Quests (");
text.AppendFormatted(blacklistedQuests.Count);
text.AppendLiteral("):");
ImGui.Text(text);
ChildDisposable val2 = ImRaii.Child((ImU8String)"BlacklistedQuestsList", new Vector2(-1f, 200f), true);
try
{
if (ChildDisposable.op_Implicit(val2))
{
ElementId elementId = null;
int num = 0;
foreach (ElementId item in blacklistedQuests.OrderBy((ElementId x) => x.ToString()))
if (blacklistedQuests.Count > 0)
{
if (!_questRegistry.TryGetQuest(item, out Quest quest))
ElementId elementId = null;
int num = 0;
foreach (ElementId item in blacklistedQuests.OrderBy((ElementId x) => x.ToString()))
{
ImU8String id = new ImU8String(5, 1);
id.AppendLiteral("Quest");
id.AppendFormatted(item);
using (ImRaii.PushId(id))
IdDisposable val3;
if (!_questRegistry.TryGetQuest(item, out Quest quest))
{
ImU8String imU8String = new ImU8String(5, 1);
imU8String.AppendLiteral("Quest");
imU8String.AppendFormatted(item);
val3 = ImRaii.PushId(imU8String, true);
try
{
ImGui.AlignTextToFramePadding();
Vector4 col = new Vector4(0.7f, 0.7f, 0.7f, 1f);
ImU8String text2 = new ImU8String(16, 1);
text2.AppendLiteral("Unknown Quest (");
text2.AppendFormatted(item);
text2.AppendLiteral(")");
ImGui.TextColored(in col, text2);
ImGui.SameLine(ImGui.GetContentRegionAvail().X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f);
if (ImGuiComponents.IconButton($"##Remove{num}", FontAwesomeIcon.Times))
{
elementId = item;
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
num++;
continue;
}
ImU8String imU8String2 = new ImU8String(5, 1);
imU8String2.AppendLiteral("Quest");
imU8String2.AppendFormatted(item);
val3 = ImRaii.PushId(imU8String2, true);
try
{
(Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(item);
bool flag;
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
{
ImGui.AlignTextToFramePadding();
ImGui.TextColored(in questStyle.Item1, questStyle.Item2.ToIconString());
flag = ImGui.IsItemHovered();
}
ImGui.SameLine();
ImGui.AlignTextToFramePadding();
Vector4 col = new Vector4(0.7f, 0.7f, 0.7f, 1f);
ImU8String text2 = new ImU8String(16, 1);
text2.AppendLiteral("Unknown Quest (");
text2.AppendFormatted(item);
text2.AppendLiteral(")");
ImGui.TextColored(in col, text2);
ImGui.TextUnformatted(quest.Info.Name);
flag |= ImGui.IsItemHovered();
if (flag)
{
_questTooltipComponent.Draw(quest.Info);
}
ImGui.SameLine(ImGui.GetContentRegionAvail().X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f);
if (ImGuiComponents.IconButton($"##Remove{num}", FontAwesomeIcon.Times))
{
elementId = item;
}
if (ImGui.IsItemHovered())
{
ImGui.SetTooltip("Remove from blacklist");
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
num++;
continue;
}
ImU8String id2 = new ImU8String(5, 1);
id2.AppendLiteral("Quest");
id2.AppendFormatted(item);
using (ImRaii.PushId(id2))
if (elementId != null)
{
(Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(item);
bool flag;
using (_pluginInterface.UiBuilder.IconFontFixedWidthHandle.Push())
{
ImGui.AlignTextToFramePadding();
ImGui.TextColored(in questStyle.Item1, questStyle.Item2.ToIconString());
flag = ImGui.IsItemHovered();
}
ImGui.SameLine();
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted(quest.Info.Name);
flag |= ImGui.IsItemHovered();
if (flag)
{
_questTooltipComponent.Draw(quest.Info);
}
ImGui.SameLine(ImGui.GetContentRegionAvail().X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f);
if (ImGuiComponents.IconButton($"##Remove{num}", FontAwesomeIcon.Times))
{
elementId = item;
}
if (ImGui.IsItemHovered())
{
ImGui.SetTooltip("Remove from blacklist");
}
base.Configuration.General.BlacklistedQuests.Remove(elementId);
Save();
}
num++;
}
if (elementId != null)
else
{
base.Configuration.General.BlacklistedQuests.Remove(elementId);
Save();
ImGui.PushStyleColor(ImGuiCol.Text, new Vector4(0.7f, 0.7f, 0.7f, 1f));
ImGui.TextWrapped("No quests blacklisted. Use the dropdown above or add from currently accepted quests.");
ImGui.PopStyleColor();
}
}
else
}
finally
{
((ChildDisposable)(ref val2)).Dispose();
}
_questSelector.DrawSelection();
if (blacklistedQuests.Count <= 0)
{
return;
}
DisabledDisposable val4 = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl));
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
{
ImGui.PushStyleColor(ImGuiCol.Text, new Vector4(0.7f, 0.7f, 0.7f, 1f));
ImGui.TextWrapped("No quests blacklisted. Use the dropdown above or add from currently accepted quests.");
ImGui.PopStyleColor();
base.Configuration.General.BlacklistedQuests.Clear();
Save();
}
}
}
_questSelector.DrawSelection();
if (blacklistedQuests.Count <= 0)
{
return;
}
using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)))
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
finally
{
base.Configuration.General.BlacklistedQuests.Clear();
Save();
((IDisposable)val4)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip("Hold CTRL to enable this button.");
}
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
finally
{
ImGui.SetTooltip("Hold CTRL to enable this button.");
((TabItemDisposable)(ref val)).Dispose();
}
}
private void DrawCurrentlyAcceptedQuests()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
List<Quest> currentlyAcceptedQuests = GetCurrentlyAcceptedQuests();
ImGui.Text("Currently Accepted Quests:");
using (ImRaii.IEndObject endObject = ImRaii.Child("AcceptedQuestsList", new Vector2(-1f, 100f), border: true))
ChildDisposable val = ImRaii.Child((ImU8String)"AcceptedQuestsList", new Vector2(-1f, 100f), true);
try
{
if (endObject)
if (ChildDisposable.op_Implicit(val))
{
if (currentlyAcceptedQuests.Count > 0)
{
foreach (Quest item in currentlyAcceptedQuests)
{
ImU8String id = new ImU8String(13, 1);
id.AppendLiteral("AcceptedQuest");
id.AppendFormatted(item.Id);
using (ImRaii.PushId(id))
ImU8String imU8String = new ImU8String(13, 1);
imU8String.AppendLiteral("AcceptedQuest");
imU8String.AppendFormatted(item.Id);
IdDisposable val2 = ImRaii.PushId(imU8String, true);
try
{
(Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(item.Id);
bool flag = false;
@ -199,7 +238,8 @@ internal sealed class BlacklistConfigComponent : ConfigComponent
_questTooltipComponent.Draw(item.Info);
}
ImGui.SameLine(ImGui.GetContentRegionAvail().X - ImGui.CalcTextSize(FontAwesomeIcon.Ban.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f);
using (ImRaii.Disabled(flag2))
DisabledDisposable val3 = ImRaii.Disabled(flag2);
try
{
if (ImGuiComponents.IconButton($"##Blacklist{item.Id}", FontAwesomeIcon.Ban))
{
@ -207,11 +247,19 @@ internal sealed class BlacklistConfigComponent : ConfigComponent
Save();
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip(flag2 ? "Quest already blacklisted" : "Add this quest to blacklist");
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
}
else
@ -222,6 +270,10 @@ internal sealed class BlacklistConfigComponent : ConfigComponent
}
}
}
finally
{
((ChildDisposable)(ref val)).Dispose();
}
ImGui.Spacing();
}