Pixel-Composer/scripts/node_dynasurf_in/node_dynasurf_in.gml

58 lines
1.5 KiB
Plaintext
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;
2023-09-11 16:08:58 +02:00
w = 96;
manual_deletable = false;
destroy_when_upgroup = true;
inParent = undefined;
outputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.PCXnode, noone);
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))
ds_list_remove(group.inputs, inParent);
inParent = nodeValue("Value", group, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone)
.uncache()
.setVisible(true, true);
inParent.from = self;
ds_list_add(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();
2023-09-11 16:08:58 +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
}