Browse Source

Wiring up close button and limiting the size of buffer

Josh Engebretson 10 years ago
parent
commit
14e7193fab

+ 7 - 0
Resources/EditorData/AtomicEditor/editor/ui/playeroutput.tb.txt

@@ -0,0 +1,7 @@
+TBLayout: axis: y, distribution: gravity, position: left
+	TBTextField: text: "Player Output:", id: project_name
+	TBEditField: multiline: 1, styling: 1, gravity: all, id: output, readonly: 1, adapt-to-content: 0
+		lp: min-width: 640, min-height: 480
+	TBSeparator: gravity: left right, skin: AESeparator
+	TBLayout: 
+		TBButton: text: Close, id: closebutton

+ 7 - 1
Script/AtomicEditor/ui/playmode/PlayerOutput.ts

@@ -19,6 +19,12 @@ class PlayerOutput extends Atomic.UIWindow {
 
 
         this.output = <Atomic.UIEditField> this.getWidget("output");
         this.output = <Atomic.UIEditField> this.getWidget("output");
 
 
+        (<Atomic.UIButton>this.getWidget("closebutton")).onClick = () => {
+
+            this.close();
+
+        }
+
         this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
         this.subscribeToEvent(this, "WidgetEvent", (data) => this.handleWidgetEvent(data));
         this.subscribeToEvent(EditorEvents.PlayerLog, (ev: EditorEvents.PlayerLogEvent) => this.handlePlayerLog(ev));
         this.subscribeToEvent(EditorEvents.PlayerLog, (ev: EditorEvents.PlayerLogEvent) => this.handlePlayerLog(ev));
 
 
@@ -32,7 +38,7 @@ class PlayerOutput extends Atomic.UIWindow {
 
 
         var text = this.output.text;
         var text = this.output.text;
         if (text.length > 32768)
         if (text.length > 32768)
-          text = "";
+            text = "";
         text += ev.message;
         text += ev.message;
         this.output.text = text + "\n";
         this.output.text = text + "\n";
         this.output.scrollTo(0, 0xffffff);
         this.output.scrollTo(0, 0xffffff);