C# Класс kOS.Screen.TermWindow

Наследование: UnityEngine.MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Awake ( ) : void
ClearScreen ( ) : void
Close ( ) : void
DetachAllTelnets ( ) : void
GetFocus ( ) : void
GetRect ( ) : Rect
GetSoundMaker ( ) : kOS.Safe.Sound.ISoundMaker
LoadTexture ( String relativePath, Texture2D &targetTexture ) : void
LoseFocus ( ) : void
NumTelnets ( ) : int
OnDestroy ( ) : void
Open ( ) : void
OpenPopupEditor ( kOS.Persistence.Volume v, GlobalPath path ) : void
Print ( string str ) : void
ProcessOneInputChar ( char ch, TelnetSingletonServer whichTelnet, bool doQueuing = true ) : void

Respond to one single input character in Unicode, using the pretend virtual Unicode terminal keycodes described in the UnicodeCommand enum. To keep things simple, all key input is coerced into single Unicode chars even if the actual keypress takes multiple characters to express in its native form (i.e. ESC [ A means left-arrow on a VT100 terminal. If a telnet is talking via VT100 codes, that ESC [ A will get converted into a single UnicdeCommand.LEFTCURSORONE character before being sent here.)
This method is public because it is also how other mods should send input to the terminal if they want some other source to send simulated keystrokes.

TermWindow ( ) : System
Toggle ( ) : void

Защищенные методы

Метод Описание
AdjustColor ( Color baseColor, float brightness ) : Color
CheckResizeDrag ( ) : void
DrawTelnetStatus ( ) : void

Draw a little status line at the bottom as a reminder that you are sharing the terminal with a telnet session:

Приватные методы

Метод Описание
AttachTelnet ( TelnetSingletonServer server ) : void
AttachTo ( SharedObjects sharedObj ) : void
Beep ( ) : bool

Attempts to make Unity start a playthrough of the beep audio clip. The playthrough will continue on its own in the background while the rest of the code continues on. It will do nothing if the previous beep is still being played. (We only gave ourselves one audio beep source per GUI terminal so we can't play beeps simultaneously.)
Addendum: It will redirect into a visual beep if that is called for instead.

BuildPanelSkin ( ) : GUISkin
CalcualteTitle ( ) : string
ChangeTitle ( string newTitle ) : void
DetachTelnet ( TelnetSingletonServer server ) : void
GetNewestBuffer ( ) : void

Get the newest copy of the screen buffer once, for use in all calculations for a while. This was added when telnet clients were added. The execution cost of obtaining a buffer snapshot from the ScreenBuffer class is non-trivial, and therefore shouldn't be done over and over for each telnet client that needs it within the span of a short time. This gets it once for all of them to borrow. All calls will re-use this copy for a while, until the next terminal refresh (1/20th of a second, at the moment).

HowManyColumnsFit ( ) : int
HowManyRowsFit ( ) : int
LoadAudio ( ) : void
LoadFontArray ( ) : void
Lock ( ) : void
NotifyOfScreenResize ( IScreenBuffer sb ) : int
OnGUI ( ) : void
OnHideUI ( ) : void
OnShowUI ( ) : void
ProcessKeyEvents ( ) : void

Process the GUI event handler key events that are being seen the by GUI terminal, by translating them into values from the UnicodeCommand enum first if need be, and then passing them through to ProcessOneInputChar().

ProcessTelnetInput ( ) : void

Read all pending input from all telnet clients attached and process it all. Hopefully this won't bog down anything, as we don't expect to get lots of chars at once from keyboard input in a single update. The amount of characters pending in the queues should be very small since this is flushing it out every update. It could potentially be large if someone does a big cut-n-paste into their terminal window and their telnet client therefore sends a wall of text within the span of one Update(). Premature optimization is bad, so we'll wait to see if that is a problem later.

ProcessUnconsumedInput ( ) : void

When the input queue is not empty and the program or command is done such that the input cursor is now all the way back to the interpreter awaiting new input, send that queue out to the interpreter. This allows you to type the next command blindly while waiting for the previous one to finish. This is how people used to terminals would expect things to work.

RepaintTelnet ( TelnetSingletonServer telnet, bool fullSync ) : void

Do the repaint of the telnet session.

RepaintTelnetFull ( TelnetSingletonServer telnet ) : void

Cover the case where the whole screen needs to be repainted from scratch.

ResizeAndRepaintTelnet ( TelnetSingletonServer telnet, int width, int height, bool unconditional ) : void

Tell the telnet session to resize itself

SendTitleToTelnet ( TelnetSingletonServer telnet ) : void
ShowCharacterByAscii ( char ch, int x, int y, bool reversingScreen, int charWidth, int charHeight, float brightness ) : void
SpecialKey ( char key, bool doQueuing = true ) : void
TelnetOutputUpdate ( ) : void
TerminalGui ( int windowId ) : void
Type ( char ch, bool doQueuing = true ) : void
Unlock ( ) : void
Update ( ) : void
UpdateGUIBeeps ( ) : void

Описание методов

AdjustColor() защищенный Метод

protected AdjustColor ( Color baseColor, float brightness ) : Color
baseColor Color
brightness float
Результат Color

Awake() публичный Метод

public Awake ( ) : void
Результат void

CheckResizeDrag() защищенный Метод

protected CheckResizeDrag ( ) : void
Результат void

ClearScreen() публичный Метод

public ClearScreen ( ) : void
Результат void

Close() публичный Метод

public Close ( ) : void
Результат void

DetachAllTelnets() публичный Метод

public DetachAllTelnets ( ) : void
Результат void

DrawTelnetStatus() защищенный Метод

Draw a little status line at the bottom as a reminder that you are sharing the terminal with a telnet session:
protected DrawTelnetStatus ( ) : void
Результат void

GetFocus() публичный Метод

public GetFocus ( ) : void
Результат void

GetRect() публичный Метод

public GetRect ( ) : Rect
Результат UnityEngine.Rect

GetSoundMaker() публичный Метод

public GetSoundMaker ( ) : kOS.Safe.Sound.ISoundMaker
Результат kOS.Safe.Sound.ISoundMaker

LoadTexture() публичный Метод

public LoadTexture ( String relativePath, Texture2D &targetTexture ) : void
relativePath String
targetTexture UnityEngine.Texture2D
Результат void

LoseFocus() публичный Метод

public LoseFocus ( ) : void
Результат void

NumTelnets() публичный Метод

public NumTelnets ( ) : int
Результат int

OnDestroy() публичный Метод

public OnDestroy ( ) : void
Результат void

Open() публичный Метод

public Open ( ) : void
Результат void

OpenPopupEditor() публичный Метод

public OpenPopupEditor ( kOS.Persistence.Volume v, GlobalPath path ) : void
v kOS.Persistence.Volume
path GlobalPath
Результат void

Print() публичный Метод

public Print ( string str ) : void
str string
Результат void

ProcessOneInputChar() публичный Метод

Respond to one single input character in Unicode, using the pretend virtual Unicode terminal keycodes described in the UnicodeCommand enum. To keep things simple, all key input is coerced into single Unicode chars even if the actual keypress takes multiple characters to express in its native form (i.e. ESC [ A means left-arrow on a VT100 terminal. If a telnet is talking via VT100 codes, that ESC [ A will get converted into a single UnicdeCommand.LEFTCURSORONE character before being sent here.)
This method is public because it is also how other mods should send input to the terminal if they want some other source to send simulated keystrokes.
public ProcessOneInputChar ( char ch, TelnetSingletonServer whichTelnet, bool doQueuing = true ) : void
ch char The character, which might be a UnicodeCommand char
whichTelnet TelnetSingletonServer If this came from a telnet session, which one did it come from? /// Set to null in order to say it wasn't from a telnet but was from the interactive GUI
doQueuing bool true if the keypress should get queued if we're not ready for it /// right now. If false, then the keypress will be ignored if we're not ready for it.
Результат void

TermWindow() публичный Метод

public TermWindow ( ) : System
Результат System

Toggle() публичный Метод

public Toggle ( ) : void
Результат void