muffin v7.38
This commit is contained in:
parent
411c0bbe76
commit
e5b98b3d57
35 changed files with 10700 additions and 7610 deletions
|
|
@ -45,6 +45,8 @@ internal sealed class CommandHandler : IDisposable
|
|||
|
||||
private readonly QuestSelectionWindow _questSelectionWindow;
|
||||
|
||||
private readonly QuestSequenceWindow _questSequenceWindow;
|
||||
|
||||
private readonly JournalProgressWindow _journalProgressWindow;
|
||||
|
||||
private readonly PriorityWindow _priorityWindow;
|
||||
|
|
@ -65,9 +67,11 @@ internal sealed class CommandHandler : IDisposable
|
|||
|
||||
private readonly Configuration _configuration;
|
||||
|
||||
private readonly ChangelogWindow _changelogWindow;
|
||||
|
||||
private IReadOnlyList<uint> _previouslyUnlockedUnlockLinks = Array.Empty<uint>();
|
||||
|
||||
public CommandHandler(ICommandManager commandManager, IChatGui chatGui, QuestController questController, MovementController movementController, QuestRegistry questRegistry, ConfigWindow configWindow, DebugOverlay debugOverlay, OneTimeSetupWindow oneTimeSetupWindow, QuestWindow questWindow, QuestSelectionWindow questSelectionWindow, JournalProgressWindow journalProgressWindow, PriorityWindow priorityWindow, ITargetManager targetManager, QuestFunctions questFunctions, GameFunctions gameFunctions, AetheryteFunctions aetheryteFunctions, IDataManager dataManager, IClientState clientState, IObjectTable objectTable, Configuration configuration)
|
||||
public CommandHandler(ICommandManager commandManager, IChatGui chatGui, QuestController questController, MovementController movementController, QuestRegistry questRegistry, ConfigWindow configWindow, DebugOverlay debugOverlay, OneTimeSetupWindow oneTimeSetupWindow, QuestWindow questWindow, QuestSelectionWindow questSelectionWindow, QuestSequenceWindow questSequenceWindow, JournalProgressWindow journalProgressWindow, PriorityWindow priorityWindow, ITargetManager targetManager, QuestFunctions questFunctions, GameFunctions gameFunctions, AetheryteFunctions aetheryteFunctions, IDataManager dataManager, IClientState clientState, IObjectTable objectTable, Configuration configuration, ChangelogWindow changelogWindow)
|
||||
{
|
||||
_commandManager = commandManager;
|
||||
_chatGui = chatGui;
|
||||
|
|
@ -79,6 +83,7 @@ internal sealed class CommandHandler : IDisposable
|
|||
_oneTimeSetupWindow = oneTimeSetupWindow;
|
||||
_questWindow = questWindow;
|
||||
_questSelectionWindow = questSelectionWindow;
|
||||
_questSequenceWindow = questSequenceWindow;
|
||||
_journalProgressWindow = journalProgressWindow;
|
||||
_priorityWindow = priorityWindow;
|
||||
_targetManager = targetManager;
|
||||
|
|
@ -89,10 +94,11 @@ internal sealed class CommandHandler : IDisposable
|
|||
_clientState = clientState;
|
||||
_objectTable = objectTable;
|
||||
_configuration = configuration;
|
||||
_changelogWindow = changelogWindow;
|
||||
_clientState.Logout += OnLogout;
|
||||
_commandManager.AddHandler("/qst", new CommandInfo(ProcessCommand)
|
||||
{
|
||||
HelpMessage = string.Join(Environment.NewLine + "\t", "Opens the Questing window", "/qst help - displays simplified commands", "/qst help-all - displays all available commands", "/qst config - opens the configuration window", "/qst start - starts doing quests", "/qst stop - stops doing quests")
|
||||
HelpMessage = string.Join(Environment.NewLine + "\t", "Opens the Questing window", "/qst help - displays simplified commands", "/qst help-all - displays all available commands", "/qst config - opens the configuration window", "/qst changelog - opens the changelog window", "/qst start - starts doing quests", "/qst stop - stops doing quests")
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -110,17 +116,19 @@ internal sealed class CommandHandler : IDisposable
|
|||
_chatGui.Print("/qst help - displays simplified commands", "Questionable", 576);
|
||||
_chatGui.Print("/qst help-all - displays all available commands", "Questionable", 576);
|
||||
_chatGui.Print("/qst config - opens the configuration window", "Questionable", 576);
|
||||
_chatGui.Print("/qst changelog - opens the changelog window", "Questionable", 576);
|
||||
_chatGui.Print("/qst start - starts doing quests", "Questionable", 576);
|
||||
_chatGui.Print("/qst stop - stops doing quests", "Questionable", 576);
|
||||
_chatGui.Print("/qst reload - reload all quest data", "Questionable", 576);
|
||||
break;
|
||||
case "help-all":
|
||||
case "ha":
|
||||
case "help-all":
|
||||
_chatGui.Print("Available commands:", "Questionable", 576);
|
||||
_chatGui.Print("/qst - toggles the Questing window", "Questionable", 576);
|
||||
_chatGui.Print("/qst help - displays available commands", "Questionable", 576);
|
||||
_chatGui.Print("/qst help-all - displays all available commands", "Questionable", 576);
|
||||
_chatGui.Print("/qst config - opens the configuration window", "Questionable", 576);
|
||||
_chatGui.Print("/qst changelog - opens the changelog window", "Questionable", 576);
|
||||
_chatGui.Print("/qst start - starts doing quests", "Questionable", 576);
|
||||
_chatGui.Print("/qst stop - stops doing quests", "Questionable", 576);
|
||||
_chatGui.Print("/qst reload - reload all quest data", "Questionable", 576);
|
||||
|
|
@ -134,6 +142,10 @@ internal sealed class CommandHandler : IDisposable
|
|||
case "config":
|
||||
_configWindow.ToggleOrUncollapse();
|
||||
break;
|
||||
case "cl":
|
||||
case "changelog":
|
||||
_changelogWindow.ToggleOrUncollapse();
|
||||
break;
|
||||
case "start":
|
||||
_questWindow.IsOpenAndUncollapsed = true;
|
||||
_questController.Start("Start command");
|
||||
|
|
@ -245,6 +257,25 @@ internal sealed class CommandHandler : IDisposable
|
|||
}
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch (text[1])
|
||||
{
|
||||
default:
|
||||
return;
|
||||
case 'i':
|
||||
if (text == "sim")
|
||||
{
|
||||
SetSimulatedQuest(array.Skip(1).ToArray());
|
||||
}
|
||||
return;
|
||||
case 'e':
|
||||
break;
|
||||
}
|
||||
if (!(text == "seq"))
|
||||
{
|
||||
break;
|
||||
}
|
||||
goto IL_0209;
|
||||
case 12:
|
||||
switch (text[0])
|
||||
{
|
||||
|
|
@ -282,11 +313,15 @@ internal sealed class CommandHandler : IDisposable
|
|||
case 9:
|
||||
switch (text[0])
|
||||
{
|
||||
default:
|
||||
return;
|
||||
case 's':
|
||||
break;
|
||||
case 'f':
|
||||
{
|
||||
if (!(text == "festivals"))
|
||||
{
|
||||
break;
|
||||
return;
|
||||
}
|
||||
List<string> list4 = new List<string>();
|
||||
for (byte b8 = 0; b8 < 4; b8++)
|
||||
|
|
@ -307,14 +342,14 @@ internal sealed class CommandHandler : IDisposable
|
|||
{
|
||||
_chatGui.Print(" " + item6, "Questionable", 576);
|
||||
}
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
case 'a':
|
||||
{
|
||||
if (!(text == "aethernet"))
|
||||
{
|
||||
break;
|
||||
return;
|
||||
}
|
||||
ushort territoryType = _clientState.TerritoryType;
|
||||
Dictionary<EAetheryteLocation, string> values = AethernetShardConverter.Values;
|
||||
|
|
@ -341,7 +376,7 @@ internal sealed class CommandHandler : IDisposable
|
|||
if (hashSet2.Count == 0)
|
||||
{
|
||||
_chatGui.Print("No aethernet shards found in current zone.", "Questionable", 576);
|
||||
break;
|
||||
return;
|
||||
}
|
||||
foreach (KeyValuePair<EAetheryteLocation, string> item8 in values)
|
||||
{
|
||||
|
|
@ -398,11 +433,15 @@ internal sealed class CommandHandler : IDisposable
|
|||
_chatGui.Print("", "Questionable", 576);
|
||||
}
|
||||
}
|
||||
break;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
if (!(text == "sequences"))
|
||||
{
|
||||
break;
|
||||
}
|
||||
goto IL_0209;
|
||||
case 5:
|
||||
if (text == "setup")
|
||||
{
|
||||
|
|
@ -415,12 +454,6 @@ internal sealed class CommandHandler : IDisposable
|
|||
ConfigureDebugOverlay(array.Skip(1).ToArray());
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (text == "sim")
|
||||
{
|
||||
SetSimulatedQuest(array.Skip(1).ToArray());
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (text == "mountid")
|
||||
{
|
||||
|
|
@ -607,6 +640,9 @@ internal sealed class CommandHandler : IDisposable
|
|||
case 8:
|
||||
case 10:
|
||||
break;
|
||||
IL_0209:
|
||||
_questSequenceWindow.ToggleOrUncollapse();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -142,6 +142,14 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
|||
|
||||
private DateTime _lastAutoRefresh = DateTime.MinValue;
|
||||
|
||||
private bool _lastEscDown;
|
||||
|
||||
private int _escPressCount;
|
||||
|
||||
private DateTime _lastEscPressTime = DateTime.MinValue;
|
||||
|
||||
private static readonly TimeSpan EscDoublePressWindow = TimeSpan.FromSeconds(1L);
|
||||
|
||||
private const char ClipboardSeparator = ';';
|
||||
|
||||
public EAutomationType AutomationType
|
||||
|
|
@ -307,9 +315,40 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
|||
StopAllDueToConditionFailed("HP = 0");
|
||||
}
|
||||
}
|
||||
else if (_configuration.General.UseEscToCancelQuesting && _keyState[VirtualKey.ESCAPE] && !_taskQueue.AllTasksComplete)
|
||||
else if (_configuration.General.UseEscToCancelQuesting)
|
||||
{
|
||||
StopAllDueToConditionFailed("ESC pressed");
|
||||
if (_keyState[VirtualKey.ESCAPE] && !_lastEscDown)
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
if (now - _lastEscPressTime <= EscDoublePressWindow)
|
||||
{
|
||||
_escPressCount++;
|
||||
}
|
||||
else
|
||||
{
|
||||
_escPressCount = 1;
|
||||
}
|
||||
_lastEscPressTime = now;
|
||||
if (_escPressCount >= 2)
|
||||
{
|
||||
if (!_taskQueue.AllTasksComplete)
|
||||
{
|
||||
StopAllDueToConditionFailed("ESC pressed twice");
|
||||
}
|
||||
_escPressCount = 0;
|
||||
}
|
||||
}
|
||||
if (!_keyState[VirtualKey.ESCAPE] && DateTime.Now - _lastEscPressTime > EscDoublePressWindow)
|
||||
{
|
||||
_escPressCount = 0;
|
||||
}
|
||||
_lastEscDown = _keyState[VirtualKey.ESCAPE];
|
||||
}
|
||||
else
|
||||
{
|
||||
_lastEscDown = _keyState[VirtualKey.ESCAPE];
|
||||
_escPressCount = 0;
|
||||
_lastEscPressTime = DateTime.MinValue;
|
||||
}
|
||||
if (_configuration.Stop.Enabled && _configuration.Stop.LevelToStopAfter && _clientState.LocalPlayer != null)
|
||||
{
|
||||
|
|
@ -344,14 +383,14 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
|||
if (step == 0 || step == 255)
|
||||
{
|
||||
flag2 = true;
|
||||
goto IL_0422;
|
||||
goto IL_04f5;
|
||||
}
|
||||
}
|
||||
flag2 = false;
|
||||
goto IL_0422;
|
||||
goto IL_04f5;
|
||||
}
|
||||
goto IL_0426;
|
||||
IL_0426:
|
||||
goto IL_04f9;
|
||||
IL_04f9:
|
||||
if (flag && DateTime.Now >= CurrentQuest.StepProgress.StartedAt.AddSeconds(15.0))
|
||||
{
|
||||
lock (_progressLock)
|
||||
|
|
@ -367,9 +406,9 @@ internal sealed class QuestController : MiniTaskController<QuestController>
|
|||
UpdateCurrentTask();
|
||||
}
|
||||
return;
|
||||
IL_0422:
|
||||
IL_04f5:
|
||||
flag = flag2;
|
||||
goto IL_0426;
|
||||
goto IL_04f9;
|
||||
}
|
||||
|
||||
private void CheckAutoRefreshCondition()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue