Pixel-Composer/scripts/node_dynasurf_in/node_dynasurf_in.gml

58 lines
1.4 KiB
Text
Raw Normal View History

2023-09-11 16:08:58 +02:00
function Node_DynaSurf_In(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Input";
color = COLORS.node_blend_dynaSurf;
2024-05-02 12:13:35 +02:00
setDimension(96, 48);;
2023-09-11 16:08:58 +02:00
manual_deletable = false;
destroy_when_upgroup = true;
inParent = undefined;
2024-09-04 03:57:11 +02:00
newOutput(0, nodeValue_Output("Value", self, VALUE_TYPE.PCXnode, noone));
2023-09-11 16:08:58 +02:00
2023-10-28 04:07:43 +02:00
static createInput = function() { #region
2023-09-11 16:08:58 +02:00
if(group == noone || !is_struct(group)) return noone;
if(!is_undefined(inParent))
2024-08-08 06:57:51 +02:00
array_remove(group.inputs, inParent);
2023-09-11 16:08:58 +02:00
2024-08-07 11:48:39 +02:00
inParent = nodeValue_Surface("Value", group)
2023-09-11 16:08:58 +02:00
.uncache()
.setVisible(true, true);
inParent.from = self;
2024-08-08 06:57:51 +02:00
array_push(group.inputs, inParent);
2024-03-31 11:10:14 +02:00
group.refreshNodeDisplay();
2023-09-11 16:08:58 +02:00
group.sortIO();
return inParent;
} #endregion
if(!LOADING && !APPENDING) createInput();
static step = function() { #region
if(is_undefined(inParent)) return;
if(inParent.name != display_name) {
inParent.name = display_name;
group.inputMap[? string_replace_all(display_name, " ", "_")] = inParent;
}
} #endregion
2023-10-20 12:32:43 +02:00
static update = function(frame = CURRENT_FRAME) { #region
2023-09-11 16:08:58 +02:00
if(is_undefined(inParent)) return;
var _val = inParent.getValue();
2024-08-08 06:57:51 +02:00
outputs[0].setValue(new __funcTree("", _val));
2023-10-20 12:32:43 +02:00
} #endregion
static postDeserialize = function() { #region
createInput(false);
} #endregion
2023-10-20 12:32:43 +02:00
static doApplyDeserialize = function() { #region
if(group == noone) return;
group.sortIO();
} #endregion
2023-09-11 16:08:58 +02:00
}