示例#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);
                    });
                }
            });
        }
示例#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();
                });
            }
        }