forked from aly/qstbak
muffin v7.5.0
This commit is contained in:
parent
afafd5e377
commit
a6481e7b9a
67 changed files with 4281 additions and 2372 deletions
|
|
@ -67,112 +67,142 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
|
||||
public override void DrawTab()
|
||||
{
|
||||
using ImRaii.IEndObject endObject = ImRaii.TabItem("Stop###StopConditionns");
|
||||
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)
|
||||
TabItemDisposable val = ImRaii.TabItem((ImU8String)"Stop###StopConditionns");
|
||||
try
|
||||
{
|
||||
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))
|
||||
if (!val)
|
||||
{
|
||||
base.Configuration.Stop.LevelStopMode = (Configuration.EStopConditionMode)currentItem;
|
||||
return;
|
||||
}
|
||||
bool v = base.Configuration.Stop.Enabled;
|
||||
if (ImGui.Checkbox("Enable stop conditions", ref v))
|
||||
{
|
||||
base.Configuration.Stop.Enabled = v;
|
||||
Save();
|
||||
}
|
||||
ImGui.SameLine();
|
||||
using (ImRaii.Disabled(base.Configuration.Stop.LevelStopMode == Questionable.Configuration.EStopConditionMode.Off))
|
||||
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();
|
||||
DisabledDisposable val2 = ImRaii.Disabled(!v);
|
||||
try
|
||||
{
|
||||
int data = base.Configuration.Stop.TargetLevel;
|
||||
ImGui.Text("Stop when character level reaches:");
|
||||
int currentItem = (int)base.Configuration.Stop.LevelStopMode;
|
||||
ImGui.SetNextItemWidth(100f);
|
||||
if (ImGui.InputInt("Target level", ref data, 1, 5))
|
||||
if (ImGui.Combo((ImU8String)"##LevelMode", ref currentItem, (ReadOnlySpan<string>)StopModeNames, StopModeNames.Length))
|
||||
{
|
||||
base.Configuration.Stop.TargetLevel = Math.Max(1, Math.Min(100, data));
|
||||
base.Configuration.Stop.LevelStopMode = (Configuration.EStopConditionMode)currentItem;
|
||||
Save();
|
||||
}
|
||||
int num = _objectTable.LocalPlayer?.Level ?? 0;
|
||||
if (num > 0)
|
||||
ImGui.SameLine();
|
||||
DisabledDisposable val3 = ImRaii.Disabled(base.Configuration.Stop.LevelStopMode == Questionable.Configuration.EStopConditionMode.Off);
|
||||
try
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImU8String text = new ImU8String(11, 1);
|
||||
text.AppendLiteral("(Current: ");
|
||||
text.AppendFormatted(num);
|
||||
text.AppendLiteral(")");
|
||||
ImGui.TextDisabled(text);
|
||||
}
|
||||
}
|
||||
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();
|
||||
using (ImRaii.Disabled(base.Configuration.Stop.SequenceStopMode == Questionable.Configuration.EStopConditionMode.Off))
|
||||
{
|
||||
int data2 = base.Configuration.Stop.TargetSequence;
|
||||
ImGui.SetNextItemWidth(100f);
|
||||
if (ImGui.InputInt("Target sequence", ref data2, 1, 1))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
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)))
|
||||
{
|
||||
if (ImGuiComponents.IconButtonWithText(FontAwesomeIcon.Trash, "Clear All"))
|
||||
int data = base.Configuration.Stop.TargetLevel;
|
||||
ImGui.SetNextItemWidth(100f);
|
||||
if (ImGui.InputInt("Target level", ref data, 1, 5))
|
||||
{
|
||||
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();
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
|
||||
finally
|
||||
{
|
||||
ImGui.SetTooltip("Hold CTRL to enable this button.");
|
||||
((IDisposable)val3)?.Dispose();
|
||||
}
|
||||
ImGui.Separator();
|
||||
ImGui.Text("(Drag arrow buttons to reorder)");
|
||||
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))
|
||||
{
|
||||
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
DrawStopQuestList(questsToStopAfter);
|
||||
finally
|
||||
{
|
||||
((IDisposable)val2)?.Dispose();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
((TabItemDisposable)(ref val)).Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -191,10 +221,11 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
{
|
||||
continue;
|
||||
}
|
||||
ImU8String id = new ImU8String(5, 1);
|
||||
id.AppendLiteral("Quest");
|
||||
id.AppendFormatted(elementId);
|
||||
using (ImRaii.PushId(id))
|
||||
ImU8String imU8String = new ImU8String(5, 1);
|
||||
imU8String.AppendLiteral("Quest");
|
||||
imU8String.AppendFormatted(elementId);
|
||||
IdDisposable val = ImRaii.PushId(imU8String, true);
|
||||
try
|
||||
{
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImU8String text = new ImU8String(1, 1);
|
||||
|
|
@ -252,7 +283,8 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
{
|
||||
ImGui.SetTooltip("Stop at specific sequence (unchecked = stop on quest completion)");
|
||||
}
|
||||
using (ImRaii.Disabled(!v))
|
||||
DisabledDisposable val2 = ImRaii.Disabled(!v);
|
||||
try
|
||||
{
|
||||
ImGui.SameLine();
|
||||
ImGui.Text("Seq:");
|
||||
|
|
@ -268,12 +300,21 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
Save();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
((IDisposable)val2)?.Dispose();
|
||||
}
|
||||
if (questsToStopAfter.Count > 1)
|
||||
{
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
FontDisposable val3 = ImRaii.PushFont(UiBuilder.IconFont, true);
|
||||
try
|
||||
{
|
||||
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)));
|
||||
|
|
@ -290,16 +331,25 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
}
|
||||
else
|
||||
{
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
FontDisposable val3 = ImRaii.PushFont(UiBuilder.IconFont, true);
|
||||
try
|
||||
{
|
||||
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));
|
||||
}
|
||||
|
|
@ -340,20 +390,25 @@ 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:");
|
||||
using (ImRaii.IEndObject endObject = ImRaii.Child("AcceptedQuestsList", new Vector2(-1f, 120f), border: true))
|
||||
ChildDisposable val = ImRaii.Child((ImU8String)"AcceptedQuestsList", new Vector2(-1f, 120f), 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;
|
||||
|
|
@ -371,11 +426,17 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
{
|
||||
_questTooltipComponent.Draw(item.Info);
|
||||
}
|
||||
using (ImRaii.PushFont(UiBuilder.IconFont))
|
||||
FontDisposable val3 = ImRaii.PushFont(UiBuilder.IconFont, true);
|
||||
try
|
||||
{
|
||||
ImGui.SameLine(ImGui.GetContentRegionAvail().X + ImGui.GetStyle().WindowPadding.X - ImGui.CalcTextSize(FontAwesomeIcon.Plus.ToIconString()).X - ImGui.GetStyle().FramePadding.X * 2f);
|
||||
}
|
||||
using (ImRaii.Disabled(flag2))
|
||||
finally
|
||||
{
|
||||
((IDisposable)val3)?.Dispose();
|
||||
}
|
||||
DisabledDisposable val4 = ImRaii.Disabled(flag2);
|
||||
try
|
||||
{
|
||||
if (ImGuiComponents.IconButton($"##Add{item.Id}", FontAwesomeIcon.Plus))
|
||||
{
|
||||
|
|
@ -384,11 +445,19 @@ 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
|
||||
|
|
@ -399,6 +468,10 @@ internal sealed class StopConditionComponent : ConfigComponent
|
|||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
((ChildDisposable)(ref val)).Dispose();
|
||||
}
|
||||
ImGui.Spacing();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue