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

@ -67,142 +67,112 @@ internal sealed class StopConditionComponent : 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)
TabItemDisposable val = ImRaii.TabItem((ImU8String)"Stop###StopConditionns");
try
using ImRaii.TabItemDisposable tabItemDisposable = ImRaii.TabItem("Stop###StopConditionns");
if (!tabItemDisposable)
{
if (!val)
return;
}
bool v = base.Configuration.Stop.Enabled;
if (ImGui.Checkbox("Enable stop conditions", ref v))
{
base.Configuration.Stop.Enabled = v;
Save();
}
ImGui.SameLine();
ImGuiComponents.HelpMarker("Pause: Stops automation when condition is met, but allows resuming past it.\nStop: True stop, blocks automation from starting/resuming if condition is already met.");
ImGui.Separator();
using (ImRaii.Disabled(!v))
{
ImGui.Text("Stop when character level reaches:");
int currentItem = (int)base.Configuration.Stop.LevelStopMode;
ImGui.SetNextItemWidth(100f);
if (ImGui.Combo((ImU8String)"##LevelMode", ref currentItem, (ReadOnlySpan<string>)StopModeNames, StopModeNames.Length))
{
return;
}
bool v = base.Configuration.Stop.Enabled;
if (ImGui.Checkbox("Enable stop conditions", ref v))
{
base.Configuration.Stop.Enabled = v;
base.Configuration.Stop.LevelStopMode = (Configuration.EStopConditionMode)currentItem;
Save();
}
ImGui.SameLine();
ImGuiComponents.HelpMarker("Pause: Stops automation when condition is met, but allows resuming past it.\nStop: True stop, blocks automation from starting/resuming if condition is already met.");
using (ImRaii.Disabled(base.Configuration.Stop.LevelStopMode == Questionable.Configuration.EStopConditionMode.Off))
{
int data = base.Configuration.Stop.TargetLevel;
ImGui.SetNextItemWidth(100f);
if (ImGui.InputInt("Target level", ref data, 1, 5))
{
base.Configuration.Stop.TargetLevel = Math.Max(1, Math.Min(100, data));
Save();
}
int num = _objectTable.LocalPlayer?.Level ?? 0;
if (num > 0)
{
ImGui.SameLine();
ImU8String text = new ImU8String(11, 1);
text.AppendLiteral("(Current: ");
text.AppendFormatted(num);
text.AppendLiteral(")");
ImGui.TextDisabled(text);
}
}
ImGui.Separator();
DisabledDisposable val2 = ImRaii.Disabled(!v);
try
ImGui.Text("Stop on quest sequence (global):");
int currentItem2 = (int)base.Configuration.Stop.SequenceStopMode;
ImGui.SetNextItemWidth(100f);
if (ImGui.Combo((ImU8String)"##SequenceMode", ref currentItem2, (ReadOnlySpan<string>)StopModeNames, StopModeNames.Length))
{
ImGui.Text("Stop when character level reaches:");
int currentItem = (int)base.Configuration.Stop.LevelStopMode;
base.Configuration.Stop.SequenceStopMode = (Configuration.EStopConditionMode)currentItem2;
Save();
}
ImGui.SameLine();
using (ImRaii.Disabled(base.Configuration.Stop.SequenceStopMode == Questionable.Configuration.EStopConditionMode.Off))
{
int data2 = base.Configuration.Stop.TargetSequence;
ImGui.SetNextItemWidth(100f);
if (ImGui.Combo((ImU8String)"##LevelMode", ref currentItem, (ReadOnlySpan<string>)StopModeNames, StopModeNames.Length))
if (ImGui.InputInt("Target sequence", ref data2, 1, 1))
{
base.Configuration.Stop.LevelStopMode = (Configuration.EStopConditionMode)currentItem;
base.Configuration.Stop.TargetSequence = Math.Max(0, Math.Min(255, data2));
Save();
}
ImGui.SameLine();
DisabledDisposable val3 = ImRaii.Disabled(base.Configuration.Stop.LevelStopMode == Questionable.Configuration.EStopConditionMode.Off);
try
QuestController.QuestProgress currentQuest = _questController.CurrentQuest;
if (currentQuest != null)
{
int data = base.Configuration.Stop.TargetLevel;
ImGui.SetNextItemWidth(100f);
if (ImGui.InputInt("Target level", ref data, 1, 5))
{
base.Configuration.Stop.TargetLevel = Math.Max(1, Math.Min(100, data));
Save();
}
int num = _objectTable.LocalPlayer?.Level ?? 0;
if (num > 0)
{
ImGui.SameLine();
ImU8String text = new ImU8String(11, 1);
text.AppendLiteral("(Current: ");
text.AppendFormatted(num);
text.AppendLiteral(")");
ImGui.TextDisabled(text);
}
int sequence = currentQuest.Sequence;
ImGui.SameLine();
ImU8String text2 = new ImU8String(11, 1);
text2.AppendLiteral("(Current: ");
text2.AppendFormatted(sequence);
text2.AppendLiteral(")");
ImGui.TextDisabled(text2);
}
finally
}
ImGui.TextWrapped("Note: Individual quest sequences below override this global setting.");
ImGui.Separator();
ImGui.Text("Stop when completing quests (or reaching specific sequences):");
DrawCurrentlyAcceptedQuests();
_questSelector.DrawSelection();
List<ElementId> questsToStopAfter = base.Configuration.Stop.QuestsToStopAfter;
if (questsToStopAfter.Count > 0)
{
using (ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl)))
{
((IDisposable)val3)?.Dispose();
}
ImGui.Separator();
ImGui.Text("Stop on quest sequence (global):");
int currentItem2 = (int)base.Configuration.Stop.SequenceStopMode;
ImGui.SetNextItemWidth(100f);
if (ImGui.Combo((ImU8String)"##SequenceMode", ref currentItem2, (ReadOnlySpan<string>)StopModeNames, StopModeNames.Length))
{
base.Configuration.Stop.SequenceStopMode = (Configuration.EStopConditionMode)currentItem2;
Save();
}
ImGui.SameLine();
val3 = ImRaii.Disabled(base.Configuration.Stop.SequenceStopMode == Questionable.Configuration.EStopConditionMode.Off);
try
{
int data2 = base.Configuration.Stop.TargetSequence;
ImGui.SetNextItemWidth(100f);
if (ImGui.InputInt("Target sequence", ref data2, 1, 1))
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
{
base.Configuration.Stop.TargetSequence = Math.Max(0, Math.Min(255, data2));
Save();
}
QuestController.QuestProgress currentQuest = _questController.CurrentQuest;
if (currentQuest != null)
{
int sequence = currentQuest.Sequence;
ImGui.SameLine();
ImU8String text2 = new ImU8String(11, 1);
text2.AppendLiteral("(Current: ");
text2.AppendFormatted(sequence);
text2.AppendLiteral(")");
ImGui.TextDisabled(text2);
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
ImGui.TextWrapped("Note: Individual quest sequences below override this global setting.");
ImGui.Separator();
ImGui.Text("Stop when completing quests (or reaching specific sequences):");
DrawCurrentlyAcceptedQuests();
_questSelector.DrawSelection();
List<ElementId> questsToStopAfter = base.Configuration.Stop.QuestsToStopAfter;
if (questsToStopAfter.Count > 0)
{
val3 = ImRaii.Disabled(!ImGui.IsKeyDown(ImGuiKey.ModCtrl));
try
{
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
foreach (ElementId item in questsToStopAfter)
{
foreach (ElementId item in questsToStopAfter)
{
string key = item.ToString();
base.Configuration.Stop.QuestSequences.Remove(key);
base.Configuration.Stop.QuestStopModes.Remove(key);
}
base.Configuration.Stop.QuestsToStopAfter.Clear();
Save();
string key = item.ToString();
base.Configuration.Stop.QuestSequences.Remove(key);
base.Configuration.Stop.QuestStopModes.Remove(key);
}
base.Configuration.Stop.QuestsToStopAfter.Clear();
Save();
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip("Hold CTRL to enable this button.");
}
ImGui.Separator();
ImGui.Text("(Drag arrow buttons to reorder)");
}
DrawStopQuestList(questsToStopAfter);
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip("Hold CTRL to enable this button.");
}
ImGui.Separator();
ImGui.Text("(Drag arrow buttons to reorder)");
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((TabItemDisposable)(ref val)).Dispose();
DrawStopQuestList(questsToStopAfter);
}
}
@ -221,11 +191,10 @@ internal sealed class StopConditionComponent : ConfigComponent
{
continue;
}
ImU8String imU8String = new ImU8String(5, 1);
imU8String.AppendLiteral("Quest");
imU8String.AppendFormatted(elementId);
IdDisposable val = ImRaii.PushId(imU8String, true);
try
ImU8String id = new ImU8String(5, 1);
id.AppendLiteral("Quest");
id.AppendFormatted(elementId);
using (ImRaii.PushId(id))
{
ImGui.AlignTextToFramePadding();
ImU8String text = new ImU8String(1, 1);
@ -283,8 +252,7 @@ internal sealed class StopConditionComponent : ConfigComponent
{
ImGui.SetTooltip("Stop at specific sequence (unchecked = stop on quest completion)");
}
DisabledDisposable val2 = ImRaii.Disabled(!v);
try
using (ImRaii.Disabled(!v))
{
ImGui.SameLine();
ImGui.Text("Seq:");
@ -300,21 +268,12 @@ internal sealed class StopConditionComponent : ConfigComponent
Save();
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
if (questsToStopAfter.Count > 1)
{
FontDisposable val3 = ImRaii.PushFont(UiBuilder.IconFont, true);
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.ArrowsUpDown.ToIconString()).X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 4f - ImGui.GetStyle().ItemSpacing.X);
}
finally
{
((IDisposable)val3)?.Dispose();
}
if (_draggedItem == elementId)
{
ImGuiComponents.IconButton("##Move", FontAwesomeIcon.ArrowsUpDown, ImGui.ColorConvertU32ToFloat4(ImGui.GetColorU32(ImGuiCol.ButtonActive)));
@ -331,25 +290,16 @@ internal sealed class StopConditionComponent : ConfigComponent
}
else
{
FontDisposable val3 = ImRaii.PushFont(UiBuilder.IconFont, true);
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.Times.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f);
}
finally
{
((IDisposable)val3)?.Dispose();
}
}
if (ImGuiComponents.IconButton($"##Remove{i}", FontAwesomeIcon.Times))
{
quest = quest3;
}
}
finally
{
((IDisposable)val)?.Dispose();
}
Vector2 item2 = new Vector2(item.X + x, ImGui.GetCursorScreenPos().Y - ImGui.GetStyle().ItemSpacing.Y + 2f);
list.Add((item, item2));
}
@ -390,25 +340,20 @@ internal sealed class StopConditionComponent : ConfigComponent
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, 120f), true);
try
using (ImRaii.ChildDisposable childDisposable = ImRaii.Child("AcceptedQuestsList", new Vector2(-1f, 120f), 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;
@ -426,17 +371,11 @@ internal sealed class StopConditionComponent : ConfigComponent
{
_questTooltipComponent.Draw(item.Info);
}
FontDisposable val3 = ImRaii.PushFont(UiBuilder.IconFont, true);
try
using (ImRaii.PushFont(UiBuilder.IconFont))
{
ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.Plus.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f);
}
finally
{
((IDisposable)val3)?.Dispose();
}
DisabledDisposable val4 = ImRaii.Disabled(flag2);
try
using (ImRaii.Disabled(flag2))
{
if (ImGuiComponents.IconButton($"##Add{item.Id}", FontAwesomeIcon.Plus))
{
@ -445,19 +384,11 @@ internal sealed class StopConditionComponent : ConfigComponent
Save();
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
ImGui.SetTooltip(flag2 ? "Quest already added to stop conditions" : "Add this quest to stop conditions");
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
}
else
@ -468,10 +399,6 @@ internal sealed class StopConditionComponent : ConfigComponent
}
}
}
finally
{
((ChildDisposable)(ref val)).Dispose();
}
ImGui.Spacing();
}