package hrt.shgraph.nodes; using hxsl.Ast; @name("Bool") @description("Boolean input (static)") @group("Property") @width(100) @noheader() class BoolConst extends ShaderConst { @output() var fakeOutput = SType.Bool; @prop() var value : Bool = true; override public function getOutputTExpr(key : String) : TExpr { return { e: TConst(CBool(value)), p: null, t: TBool }; } override public function build(key : String) : TExpr { return null; } #if editor override public function getPropertiesHTML(width : Float) : Array { var elements = super.getPropertiesHTML(width); var element = new hide.Element('
'); element.append(new hide.Element('')); var input = element.children("input"); input.on("change", function(e) { value = (input.is(":checked")) ? true : false; }); if (this.value) { input.prop("checked", true); } elements.push(element); return elements; } #end }