Skip to content

Commit

Permalink
scene editor: more feedback when a shader definition is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoVgr committed Jan 19, 2024
1 parent cca4060 commit ddd90f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions hide/comp/SceneEditor.hx
Original file line number Diff line number Diff line change
Expand Up @@ -2082,6 +2082,12 @@ class SceneEditor {
}
lockTog.css({visibility: p.locked ? "visible" : "hidden"});
}

var shader = Std.downcast(p, hrt.prefab.Shader);
if (shader != null && (getContext(p) == null || shader.getShaderDefinition(getContext(p)) == null)) {
aEl.css("text-decoration", "line-through");
aEl.css("color", "#ff5555");
}
}

public function applySceneStyle(p: PrefabElement) {
Expand Down
6 changes: 5 additions & 1 deletion hrt/prefab/Shader.hx
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,12 @@ class Shader extends Prefab {

var ctx = ectx.getContext(this);
var shaderDef = getShaderDefinition(ctx);
if( shaderDef == null || ctx == null )
if( shaderDef == null || ctx == null ) {
var el = new Element("<p>Shader definition is missing</p>");
el.css("color", "#ff5555");
ectx.properties.add(el);
return;
}

var propGroup = new hide.Element('<div class="group" name="Properties">
<dl>
Expand Down

0 comments on commit ddd90f2

Please sign in to comment.