Esempio n. 1
0
        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);
                    });
                }
            });
        }
Esempio n. 2
0
        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();
                });
            }
        }