Nicolas Cannasse 4 роки тому
батько
коміт
16b098fe6f
2 змінених файлів з 38 додано та 0 видалено
  1. 1 0
      bin/app.html
  2. 37 0
      hide/Ide.hx

+ 1 - 0
bin/app.html

@@ -54,6 +54,7 @@
 			</div>
 		</menu>
 		<separator></separator>
+		<menu label="Build Files" class="build-files"></menu>
 		<menu label="Clear profile" class="clear-local"></menu>
 		<menu label="Exit" class="exit"></menu>
 	</menu>

+ 37 - 0
hide/Ide.hx

@@ -928,6 +928,43 @@ class Ide {
 			try sys.FileSystem.deleteFile(Ide.inst.appPath + "/props.json") catch( e : Dynamic ) {};
 			untyped chrome.runtime.reload();
 		});
+		menu.find(".build-files").click(function(_) {
+			var lastTime = haxe.Timer.stamp();
+			var all = [""];
+			var done = 0;
+			var prevTitle = window.title;
+			function loop() {
+				while( true ) {
+					if( all.length == 0 ) {
+						window.title = prevTitle;
+						return;
+					}
+					if( haxe.Timer.stamp() - lastTime > 0.1 ) {
+						lastTime = haxe.Timer.stamp();
+						window.title = '(${Std.int(done*1000/(done+all.length))/10}%) '+all[0];
+						haxe.Timer.delay(loop,0);
+						return;
+					}
+					var path = all.shift();
+					var e = try hxd.res.Loader.currentInstance.load(path).entry catch( e : hxd.res.NotFound ) null;
+					if( e == null && path == "" ) e = hxd.res.Loader.currentInstance.fs.getRoot();
+					if( e != null ) done++;
+					if( e != null && e.isDirectory ) {
+						var base = path;
+						if( base != "" ) base += "/";
+						for( f in sys.FileSystem.readDirectory(getPath(path)) ) {
+							var path = base + f;
+							if( path == ".tmp" ) continue;
+							if( sys.FileSystem.isDirectory(getPath(path)) )
+								all.unshift(path);
+							else
+								all.push(path);
+						}
+					}
+				}
+			}
+			loop();
+		});
 
 		for( r in renderers ) {
 			new Element("<menu type='checkbox'>").attr("label", r.name).prop("checked",r == h3d.mat.MaterialSetup.current).appendTo(menu.find(".project .renderers")).click(function(_) {