ncannasse před 7 roky
rodič
revize
83e493b582
5 změnil soubory, kde provedl 6 přidání a 6 odebrání
  1. 2 0
      hide.hxml
  2. 1 1
      hide.hxproj
  3. 1 0
      hide/tools/FileWatcher.hx
  4. 1 1
      hide/ui/Ide.hx
  5. 1 4
      hide/view/FileTree.hx

+ 2 - 0
hide.hxml

@@ -8,4 +8,6 @@
 -main hide.ui.Ide
 -D hscriptPos
 -D old-error-format
+-D multidriver
+-D hide
 -dce no

+ 1 - 1
hide.hxproj

@@ -24,7 +24,7 @@
     <option noInlineOnDebug="False" />
     <option mainClass="hide.ui.Ide" />
     <option enabledebug="False" />
-    <option additional="-D hscriptPos&#xA;-D old-error-format&#xA;-D multidriver&#xA;-dce no" />
+    <option additional="-D hscriptPos&#xA;-D old-error-format&#xA;-D multidriver&#xA;-D hide&#xA;-dce no" />
   </build>
   <!-- haxelib libraries -->
   <haxelib>

+ 1 - 0
hide/tools/FileWatcher.hx

@@ -36,6 +36,7 @@ class FileWatcher {
 				changed : false,
 			};
 			w.w = try js.node.Fs.watch(ide.getPath(path), function(k:String, file:String) {
+				if( w.changed ) return;
 				w.changed = true;
 				haxe.Timer.delay(function() {
 					if( !w.changed ) return;

+ 1 - 1
hide/ui/Ide.hx

@@ -528,7 +528,7 @@ class Ide {
 	public static var inst : Ide;
 
 	static function main() {
-		hide.tools.Macros.include(["hide.view","h3d.prim","h3d.scene","h3d.pass"]);
+		hide.tools.Macros.include(["hide.view","h3d.prim","h3d.scene","h3d.pass","hxd.prefab"]);
 		new Ide();
 	}
 

+ 1 - 4
hide/view/FileTree.hx

@@ -80,10 +80,7 @@ class FileTree extends FileView {
 					children : isDir,
 				});
 			}
-			ide.fileWatcher.register(basePath, function() {
-				trace(basePath);
-				rebuild();
-			});
+			watch(basePath, function() rebuild(),{checkDelete:true});
 			content.sort(function(a,b) { if( a.children != b.children ) return a.children?-1:1; return Reflect.compare(a.text,b.text); });
 			return content;
 		};