Browse Source

- support tags in l3d
- colorize tree bg

trethaller 6 years ago
parent
commit
afd06dd687
3 changed files with 12 additions and 5 deletions
  1. 2 3
      bin/defaultProps.json
  2. 6 2
      hide/comp/SceneEditor.hx
  3. 4 0
      hide/view/l3d/Level3D.hx

+ 2 - 3
bin/defaultProps.json

@@ -103,15 +103,14 @@
 		"settings": {"color": "#ffffff", "font-weight": "bold"}
 	},
 	"l3d.filterTypes": ["terrain", "model", "polygon", "box", "instance", "light"],
+	"l3d.tags": [ { "id": "tag", "color": "#802000" } ],
 
 	// FX editor
 	"fx.shaders": [
 		"h3d.shader.AnimatedTexture",
 		"h3d.shader.ColorAdd"],
 
-	"fx.tags": [
-		{ "id": "tag", "color": "#802000" }
-	],
+	"fx.tags": [ { "id": "tag", "color": "#802000" } ],
 
 	// DomKit css files list
 	"domkit.css" : [],

+ 6 - 2
hide/comp/SceneEditor.hx

@@ -936,10 +936,14 @@ class SceneEditor {
 
 		var tag = getTag(p);
 
-		if(tag != null)
+		if(tag != null) {
 			aEl.css("background", tag.color);
-		else if(pname == "tag")
+			el.find("ul").first().css("background", tag.color + "80");
+		}
+		else if(pname == "tag") {
 			aEl.css("background", "none");
+			el.find("ul").first().css("background", "none");
+		}
 
 		if(obj3d != null) {
 			el.toggleClass("disabled", !obj3d.visible);

+ 4 - 0
hide/view/l3d/Level3D.hx

@@ -280,6 +280,10 @@ private class Level3DSceneEditor extends hide.comp.SceneEditor {
 			}
 		}
 	}
+
+	override function getAvailableTags(p:PrefabElement) {
+		return cast ide.currentConfig.get("l3d.tags");
+	}
 }
 
 class Level3D extends FileView {