/* Constructor */ public ScriptHost(Form hostForm, ScriptBase script) { HostForm = hostForm; Script = script; Script.Host = this; MacroPlayer = new MacroPlayer(); MacroPlayer.LapEnter += (sender) => { Script.OnMacroLapEnter(sender); }; var scriptForm = Script.ScriptForm; if (scriptForm != null) { // Intercept form closing scriptForm.FormClosing += (_sender, _e) => { if (_e.CloseReason == CloseReason.UserClosing) { _e.Cancel = true; scriptForm.Hide(); } }; } }
public void Pause() { IsPaused = true; if (MacroPlayer.IsPlaying) { MacroPlayer.Pause(); } }
public void PlayMacro(string path, int suspendDelay = 0) { MacroPlayer.LoadFile(path); MacroPlayer.Play(); if (suspendDelay > 0) { Suspend(suspendDelay); } }
public void PlayMacro(List <DualShockState> sequence, int suspendDelay = 0) { MacroPlayer.Sequence = ScriptHostUtility.ConvertAPIToInterceptorSequence(sequence); MacroPlayer.Play(); if (suspendDelay > 0) { Suspend(suspendDelay); } }
public void Play() { Start(); if (MacroPlayer.IsPaused) { MacroPlayer.Play(); } IsPaused = false; }
public void Stop() { if (Worker != null) { Worker.CancelAsync(); } MacroPlayer.Stop(); SuspendCounter = 0; IsRunning = false; IsPaused = false; }
public void Pause() { IsPaused = true; // Clear methods Script.ClearButtons(); if (MacroPlayer.IsPlaying) { MacroPlayer.Pause(); } // For cleanup Script.OnPaused(); }
public void OnReceiveData(ref PS4RemotePlayInterceptor.DualShockState state) { if (MacroPlayer.IsPlaying) { MacroPlayer.OnReceiveData(ref state); } else if (Script.CurrentState != null) { state = ScriptHostUtility.ConvertAPIToInterceptorState(Script.CurrentState); state.ReportTimeStamp = DateTime.Now; // Replace battery status state.Battery = 100; state.IsCharging = true; } }
public void Stop() { if (Worker != null) { Worker.CancelAsync(); } // Clear methods Script.ClearButtons(); MacroPlayer.Stop(); // Clear states SuspendCounter = 0; IsRunning = false; IsPaused = false; // For cleanup Script.OnStopped(); }
/* Constructor */ public SaveLoadHelper(MainForm mainForm, MacroPlayer macroPlayer) { m_MainForm = mainForm; m_MacroPlayer = macroPlayer; }
public void StopMacro() { MacroPlayer.Stop(); }