소스 검색

Move to base

luboslenco 2 년 전
부모
커밋
df5739afbb
2개의 변경된 파일0개의 추가작업 그리고 136개의 파일을 삭제
  1. 0 66
      Sources/arm/ui/TabConsole.hx
  2. 0 70
      Sources/arm/ui/TabScript.hx

+ 0 - 66
Sources/arm/ui/TabConsole.hx

@@ -1,66 +0,0 @@
-package arm.ui;
-
-import haxe.io.Bytes;
-import zui.Zui;
-import zui.Id;
-import arm.sys.Path;
-import arm.io.ImportAsset;
-import arm.Enums;
-
-class TabConsole {
-
-	@:access(zui.Zui)
-	public static function draw() {
-		var ui = UISidebar.inst.ui;
-
-		var title = Console.messageTimer > 0 ? Console.message + "        " : tr("Console");
-		var color = Console.messageTimer > 0 ? Console.messageColor : -1;
-
-		var statush = Config.raw.layout[LayoutStatusH];
-		if (ui.tab(UIStatus.inst.statustab, title, false, color) && statush > UIStatus.defaultStatusH * ui.SCALE()) {
-
-			ui.beginSticky();
-			#if (krom_windows || krom_linux || krom_darwin) // Copy
-			if (Config.raw.touch_ui) {
-				ui.row([1 / 4, 1 / 4, 1 / 4]);
-			}
-			else {
-				ui.row([1 / 14, 1 / 14, 1 / 14]);
-			}
-			#else
-			if (Config.raw.touch_ui) {
-				ui.row([1 / 4, 1 / 4]);
-			}
-			else {
-				ui.row([1 / 14, 1 / 14]);
-			}
-			#end
-
-			if (ui.button(tr("Clear"))) {
-				Console.lastTraces = [];
-			}
-			if (ui.button(tr("Export"))) {
-				var str = Console.lastTraces.join("\n");
-				UIFiles.show("txt", true, false, function(path: String) {
-					var f = UIFiles.filename;
-					if (f == "") f = tr("untitled");
-					path = path + Path.sep + f;
-					if (!path.endsWith(".txt")) path += ".txt";
-					Krom.fileSaveBytes(path, Bytes.ofString(str).getData());
-				});
-			}
-			#if (krom_windows || krom_linux || krom_darwin)
-			if (ui.button(tr("Copy"))) {
-				var str = Console.lastTraces.join("\n");
-				Krom.copyToClipboard(str);
-			}
-			#end
-
-			ui.endSticky();
-
-			for (t in Console.lastTraces) {
-				ui.text(t);
-			}
-		}
-	}
-}

+ 0 - 70
Sources/arm/ui/TabScript.hx

@@ -1,70 +0,0 @@
-package arm.ui;
-
-import haxe.io.Bytes;
-import zui.Zui;
-import zui.Ext;
-import zui.Id;
-import kha.Blob;
-import iron.data.Data;
-import arm.sys.Path;
-import arm.io.ImportAsset;
-import arm.Enums;
-
-class TabScript {
-
-	public static var hscript = Id.handle();
-
-	@:access(zui.Zui)
-	public static function draw() {
-		var ui = UISidebar.inst.ui;
-		var statush = Config.raw.layout[LayoutStatusH];
-		if (ui.tab(UIStatus.inst.statustab, tr("Script")) && statush > UIStatus.defaultStatusH * ui.SCALE()) {
-
-			ui.beginSticky();
-			if (Config.raw.touch_ui) {
-				ui.row([1 / 4, 1 / 4, 1 / 4, 1 / 4]);
-			}
-			else {
-				ui.row([1 / 14, 1 / 14, 1 / 14, 1 / 14]);
-			}
-			if (ui.button(tr("Run"))) {
-				try {
-					js.Lib.eval(hscript.text);
-				}
-				catch(e: Dynamic) {
-					Console.log(e);
-				}
-			}
-			if (ui.button(tr("Clear"))) {
-				hscript.text = "";
-			}
-			if (ui.button(tr("Import"))) {
-				UIFiles.show("js", false, false, function(path: String) {
-					Data.getBlob(path, function(b: Blob) {
-						hscript.text = b.toString();
-						Data.deleteBlob(path);
-					});
-				});
-			}
-			if (ui.button(tr("Export"))) {
-				var str = hscript.text;
-				UIFiles.show("js", true, false, function(path: String) {
-					var f = UIFiles.filename;
-					if (f == "") f = tr("untitled");
-					path = path + Path.sep + f;
-					if (!path.endsWith(".js")) path += ".js";
-					Krom.fileSaveBytes(path, Bytes.ofString(str).getData());
-				});
-			}
-			ui.endSticky();
-
-			var _font = ui.ops.font;
-			var _fontSize = ui.fontSize;
-			Data.getFont("font_mono.ttf", function(f: kha.Font) { ui.ops.font = f; }); // Sync
-			ui.fontSize = 15;
-			Ext.textArea(ui, hscript);
-			ui.ops.font = _font;
-			ui.fontSize = _fontSize;
-		}
-	}
-}