コード例 #1
0
 void OnFlicker()
 {
     if (flickerOn)
     {
         screen.ResetInvertBlock(x, y);
         screen.Apply();
         flickerOn = false;
     }
     else
     {
         screen.SetInvertBlock(x, y);
         screen.Apply();
         flickerOn = true;
     }
 }
コード例 #2
0
ファイル: TextTyper.cs プロジェクト: Catofsky/UnityTerminal
 public void MoveCursor(bool left)
 {
     if (left)
     {
         if (Cursor.x > 1 + borderWidth)
         {
             Cursor.SetPosition(Cursor.x - 1, Cursor.y);
             Screen.Apply();
         }
     }
     else
     {
         if (Screen.GetLineLength(Cursor.y) > Cursor.x)
         {
             Cursor.SetPosition(Cursor.x + 1, Cursor.y);
             Screen.Apply();
         }
     }
 }
コード例 #3
0
    public TerminalConsole(DisplaySystem screen, Terminal terminal)
    {
        _terminal       = terminal;
        _screen         = screen;
        Typer           = new TextTyper(screen, this);
        _runEventsTimer = new Timer(_outDeltaTime, RunEvents);
        _buffer         = new CommandBuffer(10);
        _dynamicCode    = new DynamicCode(this, screen);
        _clipTimer      = new Timer(_startClipDelay, StartClip);
        _tick           = _tickDelay;
        _fileController = new FileController(this);
        _fileController.UpdateDirsList();
        _fileController.UpdateFileList();
        _runner = new CommandRunner(Typer, _fileController, this);

        Writter = new ConsoleWriter(Typer);
        Invoker = new ActionInvoker();

        _screen.BlackScreen();
        _screen.Apply();
    }
コード例 #4
0
    public void StartingUpdate()
    {
        _startingTime -= Time.deltaTime;
        _startingShow -= Time.deltaTime;

        if (_startingShow < 1)
        {
            _dynamicCode.CloseThreads();
            _screen.Clear();
            _screen.Apply();
        }

        if (_startingTime < 0)
        {
            _screen.Clear();
            _fileController = new FileController(this);
            _fileController.UpdateDirsList();
            _fileController.UpdateFileList();
            _runner.FileController = _fileController;
            StartScreen();
            NextCommad();
            IsStarting = false;
            _terminal.SetPowerOn(true);
            _startingShow = START_DELAY;
            _startingTime = START_DELAY;
        }

        Delta = Time.deltaTime;
        if (Delta <= 0.01f)
        {
            Delta = 0.01f;
        }
        Invoker.Update();
    }
コード例 #5
0
ファイル: NotePad.cs プロジェクト: Catofsky/UnityTerminal
        public void Action(string input)
        {
            if (input.Length == 1)
            {
                InsertIntoLine(position.y, position.x, input.ToString());
                saved = false;
                Display(screenPosition.x, screenPosition.y, false);
                PositionRight();
            }
            else
            {
                switch (input)
                {
                case "Return":
                    Return();
                    break;

                case "LeftArrow":
                    PositionLeft();
                    break;

                case "RightArrow":
                    PositionRight();
                    break;

                case "UpArrow":
                    PositionUp();
                    break;

                case "DownArrow":
                    PositionDown();
                    break;

                case "Backspace":
                    Back();
                    break;

                case "Delete":
                    Delete();
                    break;

                case "End":
                    PositionEnd();
                    break;

                case "Home":
                    PositionHome();
                    break;

                case "Tab":
                    Action(" ");
                    Action(" ");
                    Action(" ");
                    Action(" ");
                    break;

                case "save":
                    Save();
                    break;

                case "exit":
                    Close();
                    return;

                default:
                    return;
                }
            }
            UpdateStatusBar();
            screen.Apply();
        }