mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-02-26 19:55:06 +01:00
[Graph] Fix copying node inside inline group not reconnect to the group.
This commit is contained in:
parent
d9b81b0706
commit
190dc19539
12 changed files with 156 additions and 131 deletions
Binary file not shown.
|
@ -1,10 +1,4 @@
|
|||
function GetAppendID(old_id) {
|
||||
if(old_id == noone) return noone;
|
||||
|
||||
if(ds_map_exists(APPEND_MAP, old_id))
|
||||
return APPEND_MAP[? old_id];
|
||||
return noone;
|
||||
}
|
||||
function GetAppendID(old_id) { return ds_map_try_get(APPEND_MAP, old_id, old_id); }
|
||||
|
||||
function APPEND(_path, context = PANEL_GRAPH.getCurrentContext()) {
|
||||
CALL("append");
|
||||
|
@ -54,7 +48,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext(), appended_
|
|||
var _node = nodeLoad(_node_list[i], true, context);
|
||||
if(_node && !ex) array_push(appended_list, _node);
|
||||
}
|
||||
printIf(log, "Load time: " + string(current_time - t)); t = current_time;
|
||||
printIf(log, $"Load time: {current_time - t}"); t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < array_length(appended_list); i++) {
|
||||
|
@ -67,7 +61,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext(), appended_
|
|||
} catch(e) {
|
||||
log_warning("APPEND, node", exception_print(e));
|
||||
}
|
||||
printIf(log, "Load group time: " + string(current_time - t)); t = current_time;
|
||||
printIf(log, $"Load group time: {current_time - t}"); t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < array_length(appended_list); i++)
|
||||
|
@ -75,7 +69,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext(), appended_
|
|||
} catch(e) {
|
||||
log_warning("APPEND, deserialize", exception_print(e));
|
||||
}
|
||||
printIf(log, "Deserialize time: " + string(current_time - t)); t = current_time;
|
||||
printIf(log, $"Deserialize time: {current_time - t}"); t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < array_length(appended_list); i++)
|
||||
|
@ -83,7 +77,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext(), appended_
|
|||
} catch(e) {
|
||||
log_warning("LOAD, apply deserialize", exception_print(e));
|
||||
}
|
||||
printIf(log, "Apply deserialize time: " + string(current_time - t)); t = current_time;
|
||||
printIf(log, $"Apply deserialize time: {current_time - t}"); t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < array_length(appended_list); i++)
|
||||
|
@ -97,7 +91,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext(), appended_
|
|||
} catch(e) {
|
||||
log_warning("APPEND, connect", exception_print(e));
|
||||
}
|
||||
printIf(log, "Connect time: " + string(current_time - t)); t = current_time;
|
||||
printIf(log, $"Connect time: {current_time - t}"); t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < array_length(appended_list); i++)
|
||||
|
@ -105,7 +99,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext(), appended_
|
|||
} catch(e) {
|
||||
log_warning("APPEND, update", exception_print(e));
|
||||
}
|
||||
printIf(log, "Update time: " + string(current_time - t)); t = current_time;
|
||||
printIf(log, $"Update time: {current_time - t}"); t = current_time;
|
||||
|
||||
Render(true);
|
||||
|
||||
|
@ -131,7 +125,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext(), appended_
|
|||
log_warning("APPEND, Conflict solver error : ", exception_print(e));
|
||||
}
|
||||
}
|
||||
printIf(log, "Conflict time: " + string(current_time - t)); t = current_time;
|
||||
printIf(log, $"Conflict time: {current_time - t}"); t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < array_length(appended_list); i++)
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
LATEST_VERSION = 1_18_00_0;
|
||||
VERSION = 1_18_06_2;
|
||||
SAVE_VERSION = 1_18_05_0;
|
||||
VERSION_STRING = MAC? "1.18.003m" : "1.18.7.011";
|
||||
VERSION_STRING = MAC? "1.18.003m" : "1.18.7";
|
||||
BUILD_NUMBER = 118070;
|
||||
PREF_VERSION = 1_17_1;
|
||||
|
||||
|
|
|
@ -318,6 +318,10 @@ function Node_Collection_Inline(_x, _y, _group = noone) : Node(_x, _y, _group) c
|
|||
static drawJunctions = function(_draw, _x, _y, _mx, _my, _s) {}
|
||||
|
||||
static postDeserialize = function() {
|
||||
if(APPENDING)
|
||||
for( var i = 0, n = array_length(attributes.members); i < n; i++ )
|
||||
attributes.members[i] = GetAppendID(attributes.members[i]);
|
||||
|
||||
refreshMember();
|
||||
}
|
||||
|
||||
|
|
|
@ -2417,8 +2417,10 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
_map.x = x;
|
||||
_map.y = y;
|
||||
_map.type = itype == noone? instanceof(self) : itype;
|
||||
if(isTool) _map.tool = isTool;
|
||||
if(group != noone) _map.group = group.node_id;
|
||||
|
||||
if(isTool) _map.tool = isTool;
|
||||
if(group != noone) _map.group = group.node_id;
|
||||
if(inline_context != noone) _map.ictx = inline_context.node_id;
|
||||
|
||||
if(!renderActive) _map.render = renderActive;
|
||||
if(!previewable) _map.previewable = previewable;
|
||||
|
@ -2495,7 +2497,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
|
||||
load_map = _map;
|
||||
load_scale = scale;
|
||||
renamed = struct_try_get(load_map, "renamed", false);
|
||||
renamed = load_map[$ "renamed"] ?? false;
|
||||
|
||||
preDeserialize();
|
||||
|
||||
|
@ -2505,38 +2507,36 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
|
||||
PROJECT.nodeMap[? node_id] = self;
|
||||
|
||||
if(struct_has(load_map, "name"))
|
||||
setDisplayName(load_map.name);
|
||||
if(struct_has(load_map, "name")) setDisplayName(load_map.name);
|
||||
internalName = load_map[$ "iname"] ?? internalName;
|
||||
if(internalName == "") resetInternalName();
|
||||
|
||||
internalName = struct_try_get(load_map, "iname", internalName);
|
||||
if(internalName == "")
|
||||
resetInternalName();
|
||||
|
||||
load_group = struct_try_get(load_map, "group", noone);
|
||||
load_group = load_map[$ "group"] ?? noone;
|
||||
if(load_group == -1) load_group = noone;
|
||||
|
||||
x = struct_try_get(load_map, "x");
|
||||
y = struct_try_get(load_map, "y");
|
||||
renderActive = struct_try_get(load_map, "render", true);
|
||||
previewable = struct_try_get(load_map, "previewable", true);
|
||||
isTool = struct_try_get(load_map, "tool", false);
|
||||
show_parameter = struct_try_get(load_map, "show_parameter", false);
|
||||
x = load_map[$ "x"] ?? 0;
|
||||
y = load_map[$ "y"] ?? 0;
|
||||
renderActive = load_map[$ "render"] ?? true;
|
||||
previewable = load_map[$ "previewable"] ?? true;
|
||||
isTool = load_map[$ "tool"] ?? false;
|
||||
show_parameter = load_map[$ "show_parameter"] ?? false;
|
||||
ictx = load_map[$ "ictx"] ?? "";
|
||||
}
|
||||
|
||||
if(struct_has(load_map, "attri")) {
|
||||
var _lattr = load_map.attri;
|
||||
_lattr.color_depth = struct_try_get(_lattr, "color_depth", 3);
|
||||
_lattr.interpolate = struct_try_get(_lattr, "interpolate", 1);
|
||||
_lattr.oversample = struct_try_get(_lattr, "oversample", 1);
|
||||
_lattr.node_width = struct_try_get(_lattr, "node_width", 0);
|
||||
_lattr.node_height = struct_try_get(_lattr, "node_height", 0);
|
||||
_lattr.node_param_width = struct_try_get(_lattr, "node_param_width", 192);
|
||||
_lattr.outp_meta = struct_try_get(_lattr, "outp_meta", false);
|
||||
_lattr.color_depth = _lattr[$ "color_depth"] ?? 3;
|
||||
_lattr.interpolate = _lattr[$ "interpolate"] ?? 1;
|
||||
_lattr.oversample = _lattr[$ "oversample"] ?? 1;
|
||||
_lattr.node_width = _lattr[$ "node_width"] ?? 0;
|
||||
_lattr.node_height = _lattr[$ "node_height"] ?? 0;
|
||||
_lattr.node_param_width = _lattr[$ "node_param_width"] ?? 192;
|
||||
_lattr.outp_meta = _lattr[$ "outp_meta"] ?? false;
|
||||
|
||||
_lattr.color = struct_try_get(_lattr, "color", -1);
|
||||
_lattr.update_graph = struct_try_get(_lattr, "update_graph", true);
|
||||
_lattr.show_update_trigger = struct_try_get(_lattr, "show_update_trigger", false);
|
||||
_lattr.array_process = struct_try_get(_lattr, "array_process", 0);
|
||||
_lattr.color = _lattr[$ "color"] ?? -1;
|
||||
_lattr.update_graph = _lattr[$ "update_graph"] ?? true;
|
||||
_lattr.show_update_trigger = _lattr[$ "show_update_trigger"] ?? false;
|
||||
_lattr.array_process = _lattr[$ "array_process"] ?? 0;
|
||||
|
||||
attributeDeserialize(CLONING? variable_clone(_lattr) : _lattr);
|
||||
}
|
||||
|
@ -2556,7 +2556,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
postLoad();
|
||||
}
|
||||
|
||||
anim_timeline = struct_try_get(attributes, "show_timeline", false);
|
||||
anim_timeline = attributes[$ "show_timeline"] ?? false;
|
||||
if(anim_timeline) refreshTimeline();
|
||||
}
|
||||
|
||||
|
|
|
@ -155,11 +155,14 @@
|
|||
var _type = _data.type;
|
||||
|
||||
if(ds_map_exists(APPEND_MAP, _data.id)) {
|
||||
var _node = APPEND_MAP[? _data.id];
|
||||
_node.x = _x;
|
||||
_node.y = _y;
|
||||
_node.deserialize(_data, scale);
|
||||
return _node;
|
||||
var _node = node_from_id(APPEND_MAP[? _data.id]);
|
||||
|
||||
if(_node != noone) {
|
||||
_node.x = _x;
|
||||
_node.y = _y;
|
||||
_node.deserialize(_data, scale);
|
||||
return _node;
|
||||
}
|
||||
}
|
||||
|
||||
var _node = nodeBuild(_type, _x, _y, _group);
|
||||
|
|
|
@ -29,8 +29,8 @@ function Node_Iterate_Each_Inline(_x, _y, _group = noone) : Node_Collection_Inli
|
|||
output_node.loop = self;
|
||||
|
||||
if(CLONING && is_instanceof(CLONING_GROUP, Node_Iterate_Each_Inline)) {
|
||||
APPEND_MAP[? CLONING_GROUP.input_node.node_id] = input;
|
||||
APPEND_MAP[? CLONING_GROUP.output_node.node_id] = output;
|
||||
APPEND_MAP[? CLONING_GROUP.input_node.node_id] = input.node_id;
|
||||
APPEND_MAP[? CLONING_GROUP.output_node.node_id] = output.node_id;
|
||||
|
||||
array_push(APPEND_LIST, input, output);
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ function Node_Iterate_Filter_Inline(_x, _y, _group = noone) : Node_Collection_In
|
|||
output_node.loop = self;
|
||||
|
||||
if(CLONING && is_instanceof(CLONING_GROUP, Node_Iterate_Filter_Inline)) {
|
||||
APPEND_MAP[? CLONING_GROUP.input_node.node_id] = input;
|
||||
APPEND_MAP[? CLONING_GROUP.output_node.node_id] = output;
|
||||
APPEND_MAP[? CLONING_GROUP.input_node.node_id] = input.node_id;
|
||||
APPEND_MAP[? CLONING_GROUP.output_node.node_id] = output.node_id;
|
||||
|
||||
array_push(APPEND_LIST, input, output);
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ function Node_Iterate_Sort_Inline(_x, _y, _group = noone) : Node_Collection_Inli
|
|||
output_node.loop = self;
|
||||
|
||||
if(CLONING && is_instanceof(CLONING_GROUP, Node_Iterate_Sort_Inline)) {
|
||||
APPEND_MAP[? CLONING_GROUP.input_node.node_id] = input;
|
||||
APPEND_MAP[? CLONING_GROUP.output_node.node_id] = output;
|
||||
APPEND_MAP[? CLONING_GROUP.input_node.node_id] = input.node_id;
|
||||
APPEND_MAP[? CLONING_GROUP.output_node.node_id] = output.node_id;
|
||||
|
||||
array_push(APPEND_LIST, input, output);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ function Node_MIDI_In(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
rtmidi_ignore_messages(true, true, true);
|
||||
|
||||
var inps = rtmidi_probe_ins();
|
||||
if(inps == 0) noti_warning($"No MIDI device detected.");
|
||||
var _miniNames = [];
|
||||
for( var i = 0; i < inps; i++ )
|
||||
_miniNames[i] = rtmidi_name_in(i);
|
||||
|
|
|
@ -1342,7 +1342,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
PANEL_INSPECTOR.inspecting = noone;
|
||||
|
||||
} else {
|
||||
if(is_instanceof(node_hovering, Node_Frame)) {
|
||||
if(is(node_hovering, Node_Frame)) {
|
||||
addKeyOverlay("Frames selection", [[ "Ctrl", "Exclude contents" ]]);
|
||||
|
||||
var fx0 = (node_hovering.x + graph_x) * graph_s;
|
||||
|
@ -1352,21 +1352,21 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
|
||||
nodes_selecting = [ node_hovering ];
|
||||
|
||||
if(!key_mod_press(CTRL))
|
||||
for(var i = 0; i < array_length(nodes_list); i++) { //select content
|
||||
var _node = nodes_list[i];
|
||||
if(_node == node_hovering) continue;
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
|
||||
if(!_node.selectable) continue;
|
||||
|
||||
var _x = (_node.x + graph_x) * graph_s;
|
||||
var _y = (_node.y + graph_y) * graph_s;
|
||||
var _w = _node.w * graph_s;
|
||||
var _h = _node.h * graph_s;
|
||||
|
||||
if(_w && _h && rectangle_inside_rectangle(fx0, fy0, fx1, fy1, _x, _y, _x + _w, _y + _h))
|
||||
array_push_unique(nodes_selecting, _node);
|
||||
if(!key_mod_press(CTRL)) {
|
||||
for( var i = 0, n = array_length(nodes_list); i < n; i++ ) { //select content
|
||||
var _node = nodes_list[i];
|
||||
if(_node == node_hovering) continue;
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
if(!_node.selectable) continue;
|
||||
|
||||
var _x = (_node.x + graph_x) * graph_s;
|
||||
var _y = (_node.y + graph_y) * graph_s;
|
||||
var _w = _node.w * graph_s;
|
||||
var _h = _node.h * graph_s;
|
||||
|
||||
if(_w && _h && rectangle_inside_rectangle(fx0, fy0, fx1, fy1, _x, _y, _x + _w, _y + _h))
|
||||
array_push_unique(nodes_selecting, _node);
|
||||
}
|
||||
}
|
||||
|
||||
} else if(DOUBLE_CLICK) {
|
||||
|
@ -1766,12 +1766,12 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
if(nodes_select_drag == 2) {
|
||||
draw_sprite_stretched_points_clamp(THEME.ui_selection, 0, nodes_select_mx, nodes_select_my, mx, my, COLORS._main_accent);
|
||||
|
||||
for(var i = 0; i < array_length(nodes_list); i++) {
|
||||
for( var i = 0, n = array_length(nodes_list); i < n; i++ ) {
|
||||
var _node = nodes_list[i];
|
||||
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
if(!_node.selectable) continue;
|
||||
if(is_instanceof(_node, Node_Frame) && !nodes_select_frame) continue;
|
||||
if(!display_parameter.show_control && _node.is_controller) continue;
|
||||
if(is(_node, Node_Frame) && !nodes_select_frame) continue;
|
||||
|
||||
var _x = (_node.x + graph_x) * graph_s;
|
||||
var _y = (_node.y + graph_y) * graph_s;
|
||||
|
@ -1779,11 +1779,18 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
var _h = _node.h * graph_s;
|
||||
|
||||
var _sel = _w && _h && rectangle_in_rectangle(_x, _y, _x + _w, _y + _h, nodes_select_mx, nodes_select_my, mx, my);
|
||||
var _selecting = array_exists(nodes_selecting, _node);
|
||||
|
||||
if(!array_exists(nodes_selecting, _node) && _sel)
|
||||
array_push(nodes_selecting, _node);
|
||||
if(array_exists(nodes_selecting, _node) && !_sel)
|
||||
array_remove(nodes_selecting, _node);
|
||||
if(!_selecting && _sel) array_push( nodes_selecting, _node);
|
||||
if( _selecting && !_sel) array_remove(nodes_selecting, _node);
|
||||
}
|
||||
|
||||
for( var i = 0, n = array_length(nodes_list); i < n; i++ ) { //select inline parent
|
||||
var _node = nodes_list[i];
|
||||
if(!is(_node, Node_Collection_Inline)) continue;
|
||||
|
||||
if(array_contains_ext(nodes_selecting, _node.nodes, true))
|
||||
array_push_unique(nodes_selecting, _node);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2853,28 +2860,27 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
|
||||
if(array_empty(APPEND_LIST)) return;
|
||||
|
||||
for(var i = 0; i < array_length(nodes_selecting); i++) {
|
||||
for( var i = 0, n = array_length(nodes_selecting); i < n; i++ ) {
|
||||
var _orignal = nodes_selecting[i];
|
||||
if(!_orignal.clonable) continue;
|
||||
|
||||
var _cloned = ds_map_try_get(APPEND_MAP, _orignal.node_id, "");
|
||||
var _cloned = ds_map_try_get(APPEND_MAP, _orignal.node_id, "");
|
||||
if(_cloned == "") continue;
|
||||
|
||||
var _inline_ctx = _orignal.inline_context;
|
||||
if(_inline_ctx == noone) continue;
|
||||
|
||||
if(_inline_ctx != noone && _cloned != "") {
|
||||
_inline_ctx = ds_map_try_get(APPEND_MAP, _inline_ctx.node_id, _inline_ctx);
|
||||
_inline_ctx.addNode(PROJECT.nodeMap[? _cloned]);
|
||||
}
|
||||
_inline_ctx = ds_map_try_get(APPEND_MAP, _inline_ctx.node_id, _inline_ctx);
|
||||
_inline_ctx.addNode(project.nodeMap[? _cloned]);
|
||||
}
|
||||
|
||||
var x0 = 99999999;
|
||||
var y0 = 99999999;
|
||||
var x0 = 99999999, y0 = 99999999;
|
||||
for(var i = 0; i < array_length(APPEND_LIST); i++) {
|
||||
var _node = APPEND_LIST[i];
|
||||
|
||||
x0 = min(x0, _node.x);
|
||||
y0 = min(y0, _node.y);
|
||||
}
|
||||
|
||||
|
||||
node_dragging = APPEND_LIST[0];
|
||||
node_drag_mx = x0; node_drag_my = y0;
|
||||
node_drag_sx = x0; node_drag_sy = y0;
|
||||
|
@ -2906,15 +2912,12 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
node_drag_ox = _nodeNew.x; node_drag_oy = _nodeNew.y;
|
||||
}
|
||||
|
||||
function doCopy() { //
|
||||
function doCopy() {
|
||||
if(array_empty(nodes_selecting)) return;
|
||||
clipboard_set_text("");
|
||||
LOADING_VERSION = SAVE_VERSION;
|
||||
|
||||
var _map = {
|
||||
version: SAVE_VERSION,
|
||||
nodes: [],
|
||||
};
|
||||
var _map = { version: SAVE_VERSION, nodes: [] };
|
||||
|
||||
for(var i = 0; i < array_length(nodes_selecting); i++)
|
||||
SAVE_NODE(_map.nodes, nodes_selecting[i],,,, getCurrentContext());
|
||||
|
@ -2922,7 +2925,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
clipboard_set_text(json_stringify_minify(_map));
|
||||
}
|
||||
|
||||
function doPaste() { //
|
||||
function doPaste() {
|
||||
var txt = clipboard_get_text();
|
||||
var _map = json_try_parse(txt, noone);
|
||||
|
||||
|
@ -2930,27 +2933,33 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
|
||||
if(is_struct(_map)) {
|
||||
ds_map_clear(APPEND_MAP);
|
||||
APPENDING = true;
|
||||
CLONING = true;
|
||||
CLONING = true;
|
||||
var _app = __APPEND_MAP(_map);
|
||||
APPENDING = false;
|
||||
CLONING = false;
|
||||
CLONING = false;
|
||||
|
||||
if(_app == noone)
|
||||
return;
|
||||
|
||||
if(array_empty(_app))
|
||||
return;
|
||||
|
||||
var x0 = 99999999;
|
||||
var y0 = 99999999;
|
||||
if(_app == noone || array_empty(_app)) return;
|
||||
|
||||
for( var i = 0, n = array_length(_app); i < n; i++ ) {
|
||||
var _sel = _app[i];
|
||||
|
||||
var _inline_ctx_id = _sel[$ "ictx"] ?? "";
|
||||
if(_inline_ctx_id == "") continue;
|
||||
|
||||
_inline_ctx_id = ds_map_try_get(APPEND_MAP, _inline_ctx_id, _inline_ctx_id);
|
||||
var _inline_ctx = ds_map_try_get(project.nodeMap, _inline_ctx_id, noone);
|
||||
|
||||
if(_inline_ctx == noone) continue;
|
||||
_inline_ctx.addNode(_sel);
|
||||
}
|
||||
|
||||
var x0 = 99999999, y0 = 99999999;
|
||||
for(var i = 0; i < array_length(_app); i++) {
|
||||
var _node = _app[i];
|
||||
|
||||
x0 = min(x0, _node.x);
|
||||
y0 = min(y0, _node.y);
|
||||
}
|
||||
|
||||
|
||||
node_dragging = _app[0];
|
||||
node_drag_mx = x0; node_drag_my = y0;
|
||||
node_drag_sx = x0; node_drag_sy = y0;
|
||||
|
@ -2960,35 +2969,38 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
|||
return;
|
||||
}
|
||||
|
||||
var _ext = filename_ext_raw(txt);
|
||||
var _ext = filename_ext_raw(string_trim(txt, ["\""]));
|
||||
|
||||
if(_ext == "pxc")
|
||||
APPEND(txt);
|
||||
|
||||
else if(_ext == "pxcc")
|
||||
APPEND(txt);
|
||||
|
||||
else if(_ext == "png") {
|
||||
if(file_exists_empty(txt)) {
|
||||
Node_create_Image_path(0, 0, txt);
|
||||
return;
|
||||
}
|
||||
|
||||
var path = TEMPDIR + "url_pasted_" + string(irandom_range(100000, 999999)) + ".png";
|
||||
var img = http_get_file(txt, path);
|
||||
CLONING = true;
|
||||
var node = Node_create_Image(0, 0);
|
||||
CLONING = false;
|
||||
var args = [node, path];
|
||||
|
||||
global.FILE_LOAD_ASYNC[? img] = [ function(args) {
|
||||
args[0].inputs[0].setValue(args[1]);
|
||||
args[0].doUpdate();
|
||||
}, args];
|
||||
switch(_ext) {
|
||||
case "pxc" :
|
||||
case "pxcc" :
|
||||
APPEND(txt);
|
||||
break;
|
||||
|
||||
case "png" :
|
||||
case "jpg" :
|
||||
if(file_exists_empty(txt)) {
|
||||
Node_create_Image_path(0, 0, txt);
|
||||
break;
|
||||
}
|
||||
|
||||
var path = $"{TEMPDIR}url_pasted_{seed_random()}.png";
|
||||
var img = http_get_file(txt, path);
|
||||
var node = new Node_Image(0, 0).skipDefault();
|
||||
var args = [ node, path ];
|
||||
|
||||
global.FILE_LOAD_ASYNC[? img] = [ function(a) /*=>*/ { a[0].inputs[0].setValue(a[1]); }, args];
|
||||
break;
|
||||
|
||||
case "gif" :
|
||||
if(file_exists_empty(txt))
|
||||
Node_create_Image_gif_path(0, 0, txt);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function doBlend() { //
|
||||
function doBlend() {
|
||||
if(array_empty(nodes_selecting)) {
|
||||
nodeBuild("Node_Blend", mouse_grid_x, mouse_grid_y, getCurrentContext()).skipDefault();
|
||||
return;
|
||||
|
|
|
@ -70,6 +70,17 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor
|
|||
|
||||
data = is_method(data_list)? data_list() : data_list;
|
||||
|
||||
if(array_empty(data)) {
|
||||
draw_sprite_stretched(THEME.textbox, 3, _x, _y, _w, _h);
|
||||
|
||||
if(type == 0) {
|
||||
draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, c_white, 0.5);
|
||||
draw_set_text(f_p2, fa_center, fa_center, COLORS._main_text_sub);
|
||||
draw_text_add(_x + _w / 2, _y + _h / 2, "no data");
|
||||
}
|
||||
return _h;
|
||||
}
|
||||
|
||||
var _selVal = _val;
|
||||
|
||||
if(is_array(_val)) return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue