forked from aly/qstbak
muffin v7.5.1
This commit is contained in:
parent
a6481e7b9a
commit
965a736f84
59 changed files with 4112 additions and 5059 deletions
|
|
@ -51,175 +51,136 @@ internal sealed class BlacklistConfigComponent : ConfigComponent
|
|||
|
||||
public override void DrawTab()
|
||||
{
|
||||
//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
|
||||
using ImRaii.TabItemDisposable tabItemDisposable = ImRaii.TabItem("Blacklist###QuestBlacklist");
|
||||
if (!tabItemDisposable)
|
||||
{
|
||||
if (!val)
|
||||
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.ChildDisposable childDisposable = ImRaii.Child("BlacklistedQuestsList", new Vector2(-1f, 200f), border: true))
|
||||
{
|
||||
if ((bool)childDisposable)
|
||||
{
|
||||
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))
|
||||
if (blacklistedQuests.Count > 0)
|
||||
{
|
||||
if (blacklistedQuests.Count > 0)
|
||||
ElementId elementId = null;
|
||||
int num = 0;
|
||||
foreach (ElementId item in blacklistedQuests.OrderBy((ElementId x) => x.ToString()))
|
||||
{
|
||||
ElementId elementId = null;
|
||||
int num = 0;
|
||||
foreach (ElementId item in blacklistedQuests.OrderBy((ElementId x) => x.ToString()))
|
||||
if (!_questRegistry.TryGetQuest(item, out Quest quest))
|
||||
{
|
||||
IdDisposable val3;
|
||||
if (!_questRegistry.TryGetQuest(item, out Quest quest))
|
||||
ImU8String id = new ImU8String(5, 1);
|
||||
id.AppendLiteral("Quest");
|
||||
id.AppendFormatted(item);
|
||||
using (ImRaii.PushId(id))
|
||||
{
|
||||
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();
|
||||
ImGui.TextUnformatted(quest.Info.Name);
|
||||
flag |= ImGui.IsItemHovered();
|
||||
if (flag)
|
||||
{
|
||||
_questTooltipComponent.Draw(quest.Info);
|
||||
}
|
||||
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;
|
||||
}
|
||||
if (ImGui.IsItemHovered())
|
||||
{
|
||||
ImGui.SetTooltip("Remove from blacklist");
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
((IDisposable)val3)?.Dispose();
|
||||
}
|
||||
num++;
|
||||
continue;
|
||||
}
|
||||
if (elementId != null)
|
||||
ImU8String id2 = new ImU8String(5, 1);
|
||||
id2.AppendLiteral("Quest");
|
||||
id2.AppendFormatted(item);
|
||||
using (ImRaii.PushId(id2))
|
||||
{
|
||||
base.Configuration.General.BlacklistedQuests.Remove(elementId);
|
||||
Save();
|
||||
(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");
|
||||
}
|
||||
}
|
||||
num++;
|
||||
}
|
||||
else
|
||||
if (elementId != null)
|
||||
{
|
||||
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.Remove(elementId);
|
||||
Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
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"))
|
||||
else
|
||||
{
|
||||
base.Configuration.General.BlacklistedQuests.Clear();
|
||||
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();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
((IDisposable)val4)?.Dispose();
|
||||
}
|
||||
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
|
||||
{
|
||||
ImGui.SetTooltip("Hold CTRL to enable this button.");
|
||||
}
|
||||
}
|
||||
finally
|
||||
_questSelector.DrawSelection();
|
||||
if (blacklistedQuests.Count <= 0)
|
||||
{
|
||||
((TabItemDisposable)(ref val)).Dispose();
|
||||
return;
|
||||
}
|
||||
using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)))
|
||||
{
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
|
||||
{
|
||||
base.Configuration.General.BlacklistedQuests.Clear();
|
||||
Save();
|
||||
}
|
||||
}
|
||||
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
|
||||
{
|
||||
ImGui.SetTooltip("Hold CTRL to enable this button.");
|
||||
}
|
||||
}
|
||||
|
||||
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:");
|
||||
ChildDisposable val = ImRaii.Child((ImU8String)"AcceptedQuestsList", new Vector2(-1f, 100f), true);
|
||||
try
|
||||
using (ImRaii.ChildDisposable childDisposable = ImRaii.Child("AcceptedQuestsList", new Vector2(-1f, 100f), border: true))
|
||||
{
|
||||
if (ChildDisposable.op_Implicit(val))
|
||||
if ((bool)childDisposable)
|
||||
{
|
||||
if (currentlyAcceptedQuests.Count > 0)
|
||||
{
|
||||
foreach (Quest item in currentlyAcceptedQuests)
|
||||
{
|
||||
ImU8String imU8String = new ImU8String(13, 1);
|
||||
imU8String.AppendLiteral("AcceptedQuest");
|
||||
imU8String.AppendFormatted(item.Id);
|
||||
IdDisposable val2 = ImRaii.PushId(imU8String, true);
|
||||
try
|
||||
ImU8String id = new ImU8String(13, 1);
|
||||
id.AppendLiteral("AcceptedQuest");
|
||||
id.AppendFormatted(item.Id);
|
||||
using (ImRaii.PushId(id))
|
||||
{
|
||||
(Vector4, FontAwesomeIcon, string) questStyle = _uiUtils.GetQuestStyle(item.Id);
|
||||
bool flag = false;
|
||||
|
|
@ -238,8 +199,7 @@ 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);
|
||||
DisabledDisposable val3 = ImRaii.Disabled(flag2);
|
||||
try
|
||||
using (ImRaii.Disabled(flag2))
|
||||
{
|
||||
if (ImGuiComponents.IconButton($"##Blacklist{item.Id}", FontAwesomeIcon.Ban))
|
||||
{
|
||||
|
|
@ -247,19 +207,11 @@ 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
|
||||
|
|
@ -270,10 +222,6 @@ internal sealed class BlacklistConfigComponent : ConfigComponent
|
|||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
((ChildDisposable)(ref val)).Dispose();
|
||||
}
|
||||
ImGui.Spacing();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue