minor ui stuff
This commit is contained in:
		
							parent
							
								
									3b6bc85271
								
							
						
					
					
						commit
						1881d8f488
					
				@ -7,6 +7,9 @@ import kernel.ButtonType;
 | 
			
		||||
import util.Vec.Vec2;
 | 
			
		||||
import lib.TermWriteable;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
	The main object you interact with when writing anything to the screen.
 | 
			
		||||
**/
 | 
			
		||||
class WindowContext implements TermWriteable {
 | 
			
		||||
	private final writer:VirtualTermWriter;
 | 
			
		||||
 | 
			
		||||
@ -26,7 +29,8 @@ class WindowContext implements TermWriteable {
 | 
			
		||||
	@:allow(kernel.ui.WindowManager) private final mouseUpTrigger:SignalTrigger<{button:ButtonType, pos:Vec2<Int>}>;
 | 
			
		||||
	@:allow(kernel.ui.WindowManager) private final pasteTrigger:SignalTrigger<String>;
 | 
			
		||||
 | 
			
		||||
	public function new(writer:VirtualTermWriter) {
 | 
			
		||||
	@:allow(kernel.ui.WindowManager)
 | 
			
		||||
	private function new(writer:VirtualTermWriter) {
 | 
			
		||||
		this.writer = writer;
 | 
			
		||||
		this.onResize = writer.onResize;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -67,10 +67,6 @@ class WindowManager {
 | 
			
		||||
 | 
			
		||||
		allContexts.push(newContext);
 | 
			
		||||
 | 
			
		||||
		// newContext.setTarget(MainTerm.instance);
 | 
			
		||||
		newContext.enable();
 | 
			
		||||
		currentMainContext = newContext;
 | 
			
		||||
 | 
			
		||||
		return newContext;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
@ -84,6 +80,7 @@ class WindowManager {
 | 
			
		||||
		var target:TermWriteable;
 | 
			
		||||
		if (output == "main") {
 | 
			
		||||
			target = MainTerm.instance;
 | 
			
		||||
			currentMainContext = context;
 | 
			
		||||
		} else {
 | 
			
		||||
			target = Peripheral.instance.getScreen(output);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -12,7 +12,7 @@ class TermIO {
 | 
			
		||||
	public function new(output:TermWriteable) {
 | 
			
		||||
		this.output = output;
 | 
			
		||||
 | 
			
		||||
		output.clear();
 | 
			
		||||
		output.reset();
 | 
			
		||||
		output.setCursorPos(0, 0);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user