void OnFlicker() { if (flickerOn) { screen.ResetInvertBlock(x, y); screen.Apply(); flickerOn = false; } else { screen.SetInvertBlock(x, y); screen.Apply(); flickerOn = true; } }
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(); } } }
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(); }
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(); }
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(); }