format
This commit is contained in:
@@ -10,8 +10,9 @@ import util.Color;
|
||||
/**
|
||||
Represents the main computer screen.
|
||||
**/
|
||||
class MainTerm implements TermWriteable{
|
||||
public static var instance:MainTerm;
|
||||
class MainTerm implements TermWriteable {
|
||||
public static var instance:MainTerm;
|
||||
|
||||
public var onResize(default, null):Signal<Vec2<Int>>;
|
||||
|
||||
private var onResizeTrigger:SignalTrigger<Vec2<Int>>;
|
||||
@@ -21,72 +22,71 @@ class MainTerm implements TermWriteable{
|
||||
this.onResizeTrigger = Signal.trigger();
|
||||
this.onResize = this.onResizeTrigger.asSignal();
|
||||
|
||||
KernelEvents.instance.onTermResize.handle(_ ->{
|
||||
KernelEvents.instance.onTermResize.handle(_ -> {
|
||||
onResizeTrigger.trigger(getSize());
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public function write(text:String) {
|
||||
Term.write(text);
|
||||
}
|
||||
Term.write(text);
|
||||
}
|
||||
|
||||
public function scroll(y:Int) {
|
||||
Term.scroll(y);
|
||||
}
|
||||
Term.scroll(y);
|
||||
}
|
||||
|
||||
public function getCursorPos():Vec2<Int> {
|
||||
var rtn = Term.getCursorPos();
|
||||
return {
|
||||
x: rtn.x - 1,
|
||||
y: rtn.y - 1
|
||||
}
|
||||
return {
|
||||
x: rtn.x - 1,
|
||||
y: rtn.y - 1
|
||||
}
|
||||
}
|
||||
|
||||
public function setCursorPos(x:Int, y:Int) {
|
||||
Term.setCursorPos(x + 1,y + 1);
|
||||
}
|
||||
Term.setCursorPos(x + 1, y + 1);
|
||||
}
|
||||
|
||||
public function getCursorBlink():Bool {
|
||||
// Missing in api
|
||||
// Missing in api
|
||||
throw new haxe.exceptions.NotImplementedException();
|
||||
}
|
||||
|
||||
public function setCursorBlink(blink:Bool) {
|
||||
Term.setCursorBlink(blink);
|
||||
}
|
||||
Term.setCursorBlink(blink);
|
||||
}
|
||||
|
||||
public function getSize():Vec2<Int> {
|
||||
var rtn = Term.getSize();
|
||||
return {
|
||||
x: rtn.width,
|
||||
y: rtn.height,
|
||||
}
|
||||
return {
|
||||
x: rtn.width,
|
||||
y: rtn.height,
|
||||
}
|
||||
}
|
||||
|
||||
public function clear() {
|
||||
Term.clear();
|
||||
}
|
||||
Term.clear();
|
||||
}
|
||||
|
||||
public function clearLine() {
|
||||
Term.clearLine();
|
||||
}
|
||||
Term.clearLine();
|
||||
}
|
||||
|
||||
public function getTextColor():Color {
|
||||
return ColorConvert.ccToColor(Term.getTextColor());
|
||||
}
|
||||
|
||||
public function setTextColor(colour:Color) {
|
||||
Term.setTextColor(ColorConvert.colorToCC(colour));
|
||||
}
|
||||
Term.setTextColor(ColorConvert.colorToCC(colour));
|
||||
}
|
||||
|
||||
public function getBackgroundColor():Color {
|
||||
return ColorConvert.ccToColor(Term.getBackgroundColor());
|
||||
}
|
||||
|
||||
public function setBackgroundColor(color:Color) {
|
||||
Term.setBackgroundColor(ColorConvert.colorToCC(color));
|
||||
}
|
||||
Term.setBackgroundColor(ColorConvert.colorToCC(color));
|
||||
}
|
||||
|
||||
public function isColor():Bool {
|
||||
return Term.isColor();
|
||||
|
||||
Reference in New Issue
Block a user