2023-03-28 06:58:28 +02:00
|
|
|
function Node_Trigger(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|
|
|
name = "Trigger";
|
2024-05-08 06:44:41 +02:00
|
|
|
setDimension(96, 56);
|
2023-03-28 06:58:28 +02:00
|
|
|
|
2024-08-18 09:13:41 +02:00
|
|
|
newInput(0, nodeValue_Trigger("Trigger", self, false ))
|
2024-04-08 07:13:46 +02:00
|
|
|
.setDisplay(VALUE_DISPLAY.button, { name: "Trigger" });
|
2023-03-28 06:58:28 +02:00
|
|
|
|
2024-09-04 03:57:11 +02:00
|
|
|
newOutput(0, nodeValue_Output("Trigger", self, VALUE_TYPE.trigger, false ));
|
2023-03-28 06:58:28 +02:00
|
|
|
|
2024-11-26 05:52:57 +01:00
|
|
|
setTrigger(2, "Trigger", [ THEME.sequence_control, 1, COLORS._main_value_positive ]);
|
2023-03-28 06:58:28 +02:00
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
static onInspector2Update = function() { inputs[0].setAnim(true); inputs[0].setValue(true); }
|
2023-06-04 18:28:29 +02:00
|
|
|
|
2024-04-08 07:13:46 +02:00
|
|
|
static update = function() {
|
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
var _val = inputs[0].getValue();
|
|
|
|
outputs[0].setValue(_val);
|
2024-04-08 07:13:46 +02:00
|
|
|
}
|
2023-03-28 06:58:28 +02:00
|
|
|
|
2023-11-20 05:10:55 +01:00
|
|
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
2023-11-23 08:28:04 +01:00
|
|
|
draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text);
|
2023-03-28 06:58:28 +02:00
|
|
|
var bbox = drawGetBbox(xx, yy, _s);
|
2024-08-08 06:57:51 +02:00
|
|
|
var trg = outputs[0].getValue();
|
2023-03-28 06:58:28 +02:00
|
|
|
|
2023-09-28 13:15:29 +02:00
|
|
|
var cc = trg? COLORS._main_accent : COLORS._main_icon;
|
|
|
|
var rr = min(bbox.w, bbox.h) / 2 - 6;
|
|
|
|
|
|
|
|
draw_set_color(cc);
|
|
|
|
|
|
|
|
draw_set_circle_precision(32);
|
|
|
|
draw_circle_border(bbox.xc, bbox.yc, rr, 4);
|
|
|
|
|
|
|
|
draw_set_circle_precision(32);
|
2024-04-08 07:13:46 +02:00
|
|
|
if(trg) draw_circle(bbox.xc - 1, bbox.yc - 1, rr - 6, false);
|
2023-11-20 05:10:55 +01:00
|
|
|
} #endregion
|
2023-03-28 06:58:28 +02:00
|
|
|
}
|