void IInputStream.ReadCommand(int maxChars, Action <string> callback) { Dispatch(() => { if (gameScriptService.HasNextCommand()) { ResetStatusHeight(); currStatusHeight = 0; string command = gameScriptService.GetNextCommand(); windowManager.ActiveWindow.PutString(command + "\r\n"); callback(command); } else { mainWindow.ReadCommand(maxChars, text => { ResetStatusHeight(); currStatusHeight = 0; callback(text); }); } }); }
public void ReadCommand(int maxChars, Action <string> callback) { if (gameScriptService.HasNextCommand()) { ResetStatusHeight(); currStatusHeight = 0; string command = gameScriptService.GetNextCommand(); windowManager.ActiveWindow.PutString(command + "\r\n"); callback(command); } else { debuggerService.BeginAwaitingInput(); mainWindow.ReadCommand(maxChars, text => { ResetStatusHeight(); currStatusHeight = 0; callback(text); debuggerService.EndAwaitingInput(); }); } }