Pixel-Composer/scripts/node_value_output/node_value_output.gml

56 lines
1.8 KiB
Text
Raw Normal View History

function nodeValue_Output(_name, _node, _type, _value, _tooltip = "") { return new __NodeValue_Output(_name, _node, _type, _value, _tooltip); }
2024-08-06 14:04:41 +02:00
function __NodeValue_Output(_name, _node, _type, _value, _tooltip = "") : NodeValue(_name, _node, CONNECT_TYPE.output, _type, _value, _tooltip) constructor {
2024-08-06 14:04:41 +02:00
2024-08-14 09:55:53 +02:00
index = array_length(node.outputs);
2024-08-06 14:04:41 +02:00
/////============== GET =============
2024-08-09 13:30:09 +02:00
output_value = _value;
2024-08-06 14:04:41 +02:00
2024-08-14 09:55:53 +02:00
static getValue = function(_time = CURRENT_FRAME, applyUnit = true, arrIndex = 0, useCache = false, log = false) {
2024-08-06 14:04:41 +02:00
return output_value;
}
static getValueRecursive = function(arr = __curr_get_val, _time = CURRENT_FRAME) {
arr[@ 0] = output_value;
arr[@ 1] = self;
}
2024-08-14 09:55:53 +02:00
static __getAnimValue = function() /*=>*/ {return output_value};
static showValue = function() /*=>*/ {return output_value};
2024-08-06 14:04:41 +02:00
/////============== SET =============
2024-08-14 09:55:53 +02:00
static setValue = function(val = 0, record = true, time = CURRENT_FRAME, _update = true) {
2024-08-06 14:04:41 +02:00
output_value = val;
2024-08-08 06:57:51 +02:00
for( var i = 0, n = array_length(value_to_loop); i < n; i++ )
value_to_loop[i].updateValue();
2024-08-06 14:04:41 +02:00
return true;
}
static setValueDirect = function(val = 0, index = noone, record = true, time = CURRENT_FRAME, _update = true) {
output_value = val;
return true;
}
2024-11-14 10:45:27 +01:00
static shortenDisplay = function() { editWidget.shorted = true; return self; }
2024-08-14 09:55:53 +02:00
}
function __NodeValue_Input_Bypass(_from, _name, _node, _type, _index) : __NodeValue_Output(_name, _node, _type, 0, "") constructor {
2024-08-14 09:55:53 +02:00
from_junc = _from;
visible = false;
index = 1000 + _index;
static drawBypass = function(params = {}) {
if(!from_junc.isVisible()) return;
var _aa = params.aa;
var _s = params.s;
draw_set_color(color_display);
draw_line_width(from_junc.x * _aa, from_junc.y * _aa, x * _aa, y * _aa, 4 * _aa * _s);
}
2024-08-06 14:04:41 +02:00
}