mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 19:38:05 +01:00
Node alignment in graph
This commit is contained in:
parent
ab82009078
commit
d8bca51a23
29 changed files with 227 additions and 48 deletions
|
@ -47,6 +47,7 @@
|
|||
{"name":"importers","order":6,"path":"folders/functions/importers.yy",},
|
||||
{"name":"inputs","order":7,"path":"folders/functions/inputs.yy",},
|
||||
{"name":"lua","order":24,"path":"folders/functions/lua.yy",},
|
||||
{"name":"nodes","order":34,"path":"folders/functions/nodes.yy",},
|
||||
{"name":"packing","order":32,"path":"folders/functions/packing.yy",},
|
||||
{"name":"physics","order":21,"path":"folders/functions/physics.yy",},
|
||||
{"name":"shader","order":16,"path":"folders/functions/shader.yy",},
|
||||
|
@ -884,7 +885,7 @@
|
|||
{"name":"o_dialog_preview_window","order":1,"path":"objects/o_dialog_preview_window/o_dialog_preview_window.yy",},
|
||||
{"name":"s_node_sampler","order":11,"path":"sprites/s_node_sampler/s_node_sampler.yy",},
|
||||
{"name":"__background_get_element","order":1,"path":"scripts/__background_get_element/__background_get_element.yy",},
|
||||
{"name":"window_functions","order":27,"path":"scripts/window_functions/window_functions.yy",},
|
||||
{"name":"window_functions","order":2,"path":"scripts/window_functions/window_functions.yy",},
|
||||
{"name":"node_mesh_create_path","order":1,"path":"scripts/node_mesh_create_path/node_mesh_create_path.yy",},
|
||||
{"name":"sh_fd_calculate_pressure_srj_glsl","order":9,"path":"shaders/sh_fd_calculate_pressure_srj_glsl/sh_fd_calculate_pressure_srj_glsl.yy",},
|
||||
{"name":"curve_bounce_function","order":1,"path":"scripts/curve_bounce_function/curve_bounce_function.yy",},
|
||||
|
|
|
@ -70,6 +70,7 @@
|
|||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"inputs","folderPath":"folders/functions/inputs.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"lua","folderPath":"folders/functions/lua.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"migration","folderPath":"folders/functions/migration.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"nodes","folderPath":"folders/functions/nodes.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"packing","folderPath":"folders/functions/packing.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"physics","folderPath":"folders/functions/physics.yy",},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"shader","folderPath":"folders/functions/shader.yy",},
|
||||
|
@ -188,6 +189,7 @@
|
|||
],
|
||||
"IncludedFiles": [
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Addons.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Guides.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
|
@ -632,12 +634,15 @@
|
|||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_youtube.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics x2.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_area_strip2.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_obj_halign_strip3.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_obj_halign.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_obj_valign.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_padding.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_surface_halign.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_surface_valign.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_text_halign_strip3.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_inspector_text_valign_strip3.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_obj_distribute_h.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_obj_distribute_v.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_prop_area_type.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_prop_gradient_strip2.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_prop_keyframe_strip3.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/inspector",},
|
||||
|
@ -1355,6 +1360,7 @@
|
|||
{"id":{"name":"s_node_radial","path":"sprites/s_node_radial/s_node_radial.yy",},},
|
||||
{"id":{"name":"s_node_grid","path":"sprites/s_node_grid/s_node_grid.yy",},},
|
||||
{"id":{"name":"node_trigger","path":"scripts/node_trigger/node_trigger.yy",},},
|
||||
{"id":{"name":"node_align_functions","path":"scripts/node_align_functions/node_align_functions.yy",},},
|
||||
{"id":{"name":"node_perlin","path":"scripts/node_perlin/node_perlin.yy",},},
|
||||
{"id":{"name":"node_blur_simple","path":"scripts/node_blur_simple/node_blur_simple.yy",},},
|
||||
{"id":{"name":"node_feedback_input","path":"scripts/node_feedback_input/node_feedback_input.yy",},},
|
||||
|
|
BIN
datafiles/data/Addons.zip
Normal file
BIN
datafiles/data/Addons.zip
Normal file
Binary file not shown.
Binary file not shown.
|
@ -27,9 +27,9 @@ if(OS == os_windows && gameframe_is_minimized()) {
|
|||
if(PANEL_MAIN == 0) resetPanel();
|
||||
|
||||
var surf = surface_get_target();
|
||||
try
|
||||
try {
|
||||
PANEL_MAIN.draw();
|
||||
catch(e) {
|
||||
} catch(e) {
|
||||
while(surface_get_target() != surf)
|
||||
surface_reset_target();
|
||||
|
||||
|
|
|
@ -24,11 +24,11 @@ if(OS == os_windows && gameframe_is_minimized()) exit;
|
|||
if(PANEL_MAIN != 0)
|
||||
PANEL_MAIN.step();
|
||||
|
||||
for(var i = 0; i < ds_list_size(NODES); i++) {
|
||||
for(var i = 0; i < ds_list_size(NODES); i++)
|
||||
NODES[| i].step();
|
||||
}
|
||||
} catch(e)
|
||||
} catch(e) {
|
||||
noti_warning("Step error: " + exception_print(e));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region hotkey
|
||||
|
|
|
@ -65,10 +65,8 @@ _HOVERING_ELEMENT = noone;
|
|||
string_lead_zero(current_minute, 2) +
|
||||
string_lead_zero(current_second, 2) + ".pxc";
|
||||
|
||||
try
|
||||
SAVE_AT(loc + fname, "Autosaved ");
|
||||
catch(e)
|
||||
print(exception_print(e));
|
||||
try { SAVE_AT(loc + fname, "Autosaved "); }
|
||||
catch(e) { print(exception_print(e)); }
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -27,7 +27,8 @@ function Tween(value, valType = TWEEN_VALUE.number, twType = TWEEN_TYPE.log, twS
|
|||
|
||||
realVal = value;
|
||||
}
|
||||
static get = function(value) {
|
||||
|
||||
static get = function() {
|
||||
if(valType == TWEEN_VALUE.color)
|
||||
return colTrans == 1? realVal : merge_color(showVal, realVal, colTrans);
|
||||
else
|
||||
|
|
|
@ -82,9 +82,9 @@ enum CAMERA_PROJ {
|
|||
return ind;
|
||||
}
|
||||
|
||||
static addFace = function(v1, n1 = [0, 0, 0], t1 = [0, 0],
|
||||
v2, n2 = [0, 0, 0], t2 = [0, 0],
|
||||
v3, n3 = [0, 0, 0], t3 = [0, 0], _merge = false) {
|
||||
static addFace = function(v1 = [0, 0, 0], n1 = [0, 0, 0], t1 = [0, 0],
|
||||
v2 = [0, 0, 0], n2 = [0, 0, 0], t2 = [0, 0],
|
||||
v3 = [0, 0, 0], n3 = [0, 0, 0], t3 = [0, 0], _merge = false) {
|
||||
var pi0 = addPosition(v1, _merge);
|
||||
var pi1 = addPosition(v2, _merge);
|
||||
var pi2 = addPosition(v3, _merge);
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
function __addonDefault(root) {
|
||||
var _l = root + "/version";
|
||||
if(file_exists(_l)) {
|
||||
var res = json_load_struct(_l);
|
||||
if(res.version == BUILD_NUMBER) return;
|
||||
}
|
||||
json_save_struct(_l, { version: BUILD_NUMBER });
|
||||
|
||||
log_message("THEME", "unzipping default addon to DIRECTORY.");
|
||||
zip_unzip("data/Addons.zip", root);
|
||||
}
|
||||
|
||||
function __initAddon() {
|
||||
var dirPath = DIRECTORY + "Addons";
|
||||
globalvar ADDONS, ADDONS_ON_START;
|
||||
|
@ -9,6 +21,8 @@ function __initAddon() {
|
|||
return;
|
||||
}
|
||||
|
||||
__addonDefault(dirPath);
|
||||
|
||||
var f = file_find_first(dirPath + "\\*", fa_directory);
|
||||
var _f = "";
|
||||
|
||||
|
|
|
@ -643,6 +643,13 @@
|
|||
[ "matrix_stack_push", matrix_stack_push ],
|
||||
[ "matrix_stack_pop", matrix_stack_pop ],
|
||||
[ "matrix_stack_top", matrix_stack_top ],
|
||||
|
||||
[ "point_in_rectangle", point_in_rectangle ],
|
||||
[ "point_in_triangle", point_in_triangle ],
|
||||
[ "point_in_circle", point_in_circle ],
|
||||
[ "rectangle_in_rectangle", rectangle_in_rectangle ],
|
||||
[ "rectangle_in_triangle", rectangle_in_triangle ],
|
||||
[ "rectangle_in_circle", rectangle_in_circle ],
|
||||
|
||||
//file
|
||||
[ "file_exists", file_exists ],
|
||||
|
@ -828,7 +835,17 @@
|
|||
return node.outputMap[? input].getValue();
|
||||
}],
|
||||
|
||||
[ "element_get", function() { return HOVERING_ELEMENT; }],
|
||||
[ "element_get", function() {
|
||||
if(HOVERING_ELEMENT == noone)
|
||||
return undefined;
|
||||
|
||||
var ele = HOVERING_ELEMENT;
|
||||
for( var i = 0; i < argument_count; i++ ) {
|
||||
if(!struct_has(ele, argument[i])) return undefined;
|
||||
ele = ele[$ argument[i]];
|
||||
}
|
||||
return ele;
|
||||
}],
|
||||
|
||||
[ "__panel_create", function(ID, panel = "") {
|
||||
var _addon = noone;
|
||||
|
|
|
@ -144,6 +144,7 @@ function __addon_lua_setup_constants(lua, context) {
|
|||
function __addon_lua_panel_variable(lua, panel) {
|
||||
lua_add_code(lua,
|
||||
"Panel.mouse = {" + string(panel.mx) + ", " + string(panel.my) + "}\n" +
|
||||
"Panel.mouseUI = {" + string(mouse_mx) + ", " + string(mouse_my) + "}\n" +
|
||||
"Panel.x = " + string(panel.x ) + "\n" +
|
||||
"Panel.y = " + string(panel.y ) + "\n" +
|
||||
"Panel.w = " + string(panel.w ) + "\n" +
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
function json_try_parse(text, def = noone) {
|
||||
try
|
||||
try {
|
||||
return json_parse(text);
|
||||
catch(e)
|
||||
} catch(e) {
|
||||
return def;
|
||||
}
|
||||
|
||||
return def;
|
||||
}
|
|
@ -8,20 +8,17 @@ global.g_json_beautify_rb = buffer_create(1024, buffer_grow, 1);
|
|||
");
|
||||
|
||||
function buffer_write_slice(buffer, data_buffer, data_start, data_end) {
|
||||
var start = argument2;
|
||||
var next = argument3 - start;
|
||||
var next = data_end - data_start;
|
||||
if (next <= 0) exit;
|
||||
var buf = argument0;
|
||||
var data = argument1;
|
||||
var size = buffer_get_size(buf);
|
||||
var pos = buffer_tell(buf);
|
||||
var size = buffer_get_size(buffer);
|
||||
var pos = buffer_tell(buffer);
|
||||
var need = pos + next;
|
||||
if (size < need) {
|
||||
do size *= 2 until (size >= need);
|
||||
buffer_resize(buf, size);
|
||||
buffer_resize(buffer, size);
|
||||
}
|
||||
buffer_copy(data, start, next, buf, pos);
|
||||
buffer_seek(buf, buffer_seek_relative, next);
|
||||
buffer_copy(data_buffer, data_start, next, buffer, pos);
|
||||
buffer_seek(buffer, buffer_seek_relative, next);
|
||||
}
|
||||
|
||||
function json_beautify(src) {
|
||||
|
|
|
@ -10,7 +10,7 @@ function lerp_float(from, to, speed) {
|
|||
if(abs(from - to) < pre)
|
||||
return to;
|
||||
else
|
||||
return from + (to - from) * (1 - power(1 - 1 / speed, delta_time / 1000000 * room_speed));
|
||||
return from + (to - from) * (1 - power(1 - 1 / speed, delta_time / 1000000 * game_get_speed(gamespeed_fps)));
|
||||
}
|
||||
|
||||
function lerp_linear(from, to, speed) {
|
||||
|
@ -27,7 +27,7 @@ function lerp_angle_direct(from, to, speed) {
|
|||
|
||||
function lerp_angle(from, to, speed) {
|
||||
if(fps < 15) return to;
|
||||
return from + angle_difference(to, from) * (1 - power(1 - 1 / speed, delta_time / 1000000 * room_speed));
|
||||
return from + angle_difference(to, from) * (1 - power(1 - 1 / speed, delta_time / 1000000 * game_get_speed(gamespeed_fps)));
|
||||
}
|
||||
|
||||
function lerp_angle_linear(from, to, speed) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
enum WINDOW_DRAG_MODE {
|
||||
move = 1 << 0,
|
||||
_move = 1 << 0,
|
||||
resize_n = 1 << 1,
|
||||
resize_e = 1 << 2,
|
||||
resize_s = 1 << 3,
|
||||
|
|
|
@ -5,7 +5,7 @@ function mac_window_step() {
|
|||
var _my = mouse_raw_y;
|
||||
|
||||
if(__win_is_dragging) {
|
||||
if(__win_is_dragging == WINDOW_DRAG_MODE.move)
|
||||
if(__win_is_dragging == WINDOW_DRAG_MODE._move)
|
||||
window_set_position(__win_drag_sx + (_mx - __win_drag_mx), __win_drag_sy + (_my - __win_drag_my));
|
||||
else {
|
||||
if((__win_is_dragging & WINDOW_DRAG_MODE.resize_n) != 0) {
|
||||
|
@ -30,7 +30,7 @@ function mac_window_step() {
|
|||
|
||||
if(point_in_rectangle(mouse_mx, mouse_my, 6, 6, WIN_W - 6, ui(40))) {
|
||||
if(mouse_press(mb_left)) {
|
||||
__win_is_dragging = WINDOW_DRAG_MODE.move;
|
||||
__win_is_dragging = WINDOW_DRAG_MODE._move;
|
||||
__win_drag_mx = mouse_raw_x;
|
||||
__win_drag_my = mouse_raw_y;
|
||||
__win_drag_sx = window_get_x();
|
||||
|
|
|
@ -7,7 +7,7 @@ function drawWidgetInit() {
|
|||
lineBreak = true;
|
||||
}
|
||||
|
||||
function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover, _focus, _scrollPane, rx, ry) {
|
||||
function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _focus = false, _scrollPane = noone, rx = 0, ry = 0) {
|
||||
var con_w = ww - ui(4);
|
||||
var xc = xx + ww / 2;
|
||||
|
||||
|
|
111
scripts/node_align_functions/node_align_functions.gml
Normal file
111
scripts/node_align_functions/node_align_functions.gml
Normal file
|
@ -0,0 +1,111 @@
|
|||
function node_halign(nodeList, alignment = fa_center) {
|
||||
var amo = ds_list_size(nodeList);
|
||||
|
||||
switch(alignment) {
|
||||
case fa_left:
|
||||
var x0 = 999999;
|
||||
for( var i = 0; i < amo; i++ )
|
||||
x0 = min(x0, nodeList[| i].x);
|
||||
|
||||
for( var i = 0; i < amo; i++ )
|
||||
nodeList[| i].x = x0;
|
||||
break;
|
||||
case fa_center:
|
||||
var xc = 0;
|
||||
for( var i = 0; i < amo; i++ )
|
||||
xc += nodeList[| i].x + nodeList[| i].w / 2;
|
||||
xc /= amo;
|
||||
|
||||
for( var i = 0; i < amo; i++ )
|
||||
nodeList[| i].x = xc - nodeList[| i].w / 2;
|
||||
break;
|
||||
case fa_right:
|
||||
var x0 = -999999;
|
||||
for( var i = 0; i < amo; i++ )
|
||||
x0 = max(x0, nodeList[| i].x + nodeList[| i].w);
|
||||
|
||||
for( var i = 0; i < amo; i++ )
|
||||
nodeList[| i].x = x0 - nodeList[| i].w;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function node_valign(nodeList, alignment = fa_middle) {
|
||||
var amo = ds_list_size(nodeList);
|
||||
|
||||
switch(alignment) {
|
||||
case fa_top:
|
||||
var y0 = 999999;
|
||||
for( var i = 0; i < amo; i++ )
|
||||
y0 = min(y0, nodeList[| i].y);
|
||||
|
||||
for( var i = 0; i < amo; i++ )
|
||||
nodeList[| i].y = y0;
|
||||
break;
|
||||
case fa_middle:
|
||||
var yc = 0;
|
||||
for( var i = 0; i < amo; i++ )
|
||||
yc += nodeList[| i].y + nodeList[| i].h / 2;
|
||||
yc /= amo;
|
||||
|
||||
for( var i = 0; i < amo; i++ )
|
||||
nodeList[| i].y = yc - nodeList[| i].h / 2;
|
||||
break;
|
||||
case fa_bottom:
|
||||
var y0 = -999999;
|
||||
for( var i = 0; i < amo; i++ )
|
||||
y0 = max(y0, nodeList[| i].y + nodeList[| i].h);
|
||||
|
||||
for( var i = 0; i < amo; i++ )
|
||||
nodeList[| i].y = y0 - nodeList[| i].h;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function node_hdistribute(nodeList) {
|
||||
var amo = ds_list_size(nodeList);
|
||||
var nodes = ds_priority_create();
|
||||
|
||||
var x0 = 999999;
|
||||
var x1 = -999999;
|
||||
for( var i = 0; i < amo; i++ ) {
|
||||
var _x = nodeList[| i].x + nodeList[| i].w / 2;
|
||||
x0 = min(x0, _x);
|
||||
x1 = max(x1, _x);
|
||||
|
||||
ds_priority_add(nodes, nodeList[| i], _x);
|
||||
}
|
||||
|
||||
var sp = (x1 - x0) / (amo - 1);
|
||||
|
||||
for( var i = 0; i < amo; i++ ) {
|
||||
var n = ds_priority_delete_min(nodes);
|
||||
n.x = x0 + sp * i - n.w / 2;
|
||||
}
|
||||
|
||||
ds_priority_destroy(nodes);
|
||||
}
|
||||
|
||||
function node_vdistribute(nodeList) {
|
||||
var amo = ds_list_size(nodeList);
|
||||
var nodes = ds_priority_create();
|
||||
|
||||
var y0 = 999999;
|
||||
var y1 = -999999;
|
||||
for( var i = 0; i < amo; i++ ) {
|
||||
var _y = nodeList[| i].y + nodeList[| i].h / 2;
|
||||
y0 = min(y0, _y);
|
||||
y1 = max(y1, _y);
|
||||
|
||||
ds_priority_add(nodes, nodeList[| i], _y);
|
||||
}
|
||||
|
||||
var sp = (y1 - y0) / (amo - 1);
|
||||
|
||||
for( var i = 0; i < amo; i++ ) {
|
||||
var n = ds_priority_delete_min(nodes);
|
||||
n.y = y0 + sp * i - n.h / 2;
|
||||
}
|
||||
|
||||
ds_priority_destroy(nodes);
|
||||
}
|
11
scripts/node_align_functions/node_align_functions.yy
Normal file
11
scripts/node_align_functions/node_align_functions.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_align_functions",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
||||
"name": "nodes",
|
||||
"path": "folders/functions/nodes.yy",
|
||||
},
|
||||
}
|
|
@ -1030,6 +1030,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||
static cacheCurrentFrame = function(_frame) {
|
||||
cacheArrayCheck();
|
||||
if(ANIMATOR.current_frame < 0) return;
|
||||
if(ANIMATOR.current_frame >= array_length(cached_output)) return;
|
||||
|
||||
surface_array_free(cached_output[ANIMATOR.current_frame]);
|
||||
cached_output[ANIMATOR.current_frame] = surface_array_clone(_frame);
|
||||
|
|
|
@ -184,8 +184,8 @@ function Node_Lua_Compute(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
lua_projectData(getState());
|
||||
|
||||
var res = 0;
|
||||
try res = lua_call_w(getState(), _func, argument_val);
|
||||
catch(e) noti_warning(exception_print(e),, self);
|
||||
try { res = lua_call_w(getState(), _func, argument_val); }
|
||||
catch(e) { noti_warning(exception_print(e),, self); }
|
||||
|
||||
outputs[| 1].setValue(res);
|
||||
}
|
||||
|
|
|
@ -75,8 +75,8 @@ function Node_Lua_Global(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
lua_projectData(getState());
|
||||
|
||||
if(ANIMATOR.current_frame == 0 || _type == 1) {
|
||||
try lua_add_code(getState(), _code);
|
||||
catch(e) noti_warning(exception_print(e),, self);
|
||||
try { lua_add_code(getState(), _code); }
|
||||
catch(e) { noti_warning(exception_print(e),, self); }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -182,8 +182,8 @@ function Node_Lua_Surface(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
_outSurf = surface_verify(_outSurf, _dimm[0], _dimm[1], attrDepth());
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
try lua_call_w(getState(), _func, argument_val);
|
||||
catch(e) noti_warning(exception_print(e),, self);
|
||||
try { lua_call_w(getState(), _func, argument_val); }
|
||||
catch(e) { noti_warning(exception_print(e),, self); }
|
||||
surface_reset_target();
|
||||
|
||||
outputs[| 1].setValue(_outSurf);
|
||||
|
|
|
@ -240,7 +240,7 @@ function Node_Strand_Create(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
var rad = tool_dragging.attribute.radius;
|
||||
var fall = tool_dragging.attribute.fall;
|
||||
var stn = tool_dragging.attribute.strength;
|
||||
stn = tool_dragging == tool_stretch? stn / room_speed : stn / 10;
|
||||
stn = tool_dragging == tool_stretch? stn / game_get_speed(gamespeed_fps) : stn / 10;
|
||||
|
||||
for( var i = 0; i < array_length(groomed.hairs); i++ ) {
|
||||
var h = groomed.hairs[i];
|
||||
|
|
|
@ -575,6 +575,23 @@ function Panel_Graph() : PanelContent() constructor {
|
|||
|
||||
if(ds_list_size(nodes_select_list) >= 2) {
|
||||
array_push(menu, -1);
|
||||
array_push(menu,
|
||||
menuItem(get_text("panel_graph_align_nodes", "Align nodes"), function(_dat) {
|
||||
return submenuCall(_dat, [
|
||||
menuItemGroup(get_text("horizontal", "Horizontal"), [
|
||||
[ [THEME.inspector_surface_halign, 0], function() { node_halign(nodes_select_list, fa_left); } ],
|
||||
[ [THEME.inspector_surface_halign, 1], function() { node_halign(nodes_select_list, fa_center); } ],
|
||||
[ [THEME.inspector_surface_halign, 2], function() { node_halign(nodes_select_list, fa_right); } ],
|
||||
[ [THEME.obj_distribute_h, 0], function() { node_hdistribute(nodes_select_list); } ],
|
||||
]),
|
||||
menuItemGroup(get_text("vertical", "Vertical"), [
|
||||
[ [THEME.inspector_surface_valign, 0], function() { node_valign(nodes_select_list, fa_top); } ],
|
||||
[ [THEME.inspector_surface_valign, 1], function() { node_valign(nodes_select_list, fa_middle); } ],
|
||||
[ [THEME.inspector_surface_valign, 2], function() { node_valign(nodes_select_list, fa_bottom); } ],
|
||||
[ [THEME.obj_distribute_v, 0], function() { node_vdistribute(nodes_select_list); } ],
|
||||
]),
|
||||
]);
|
||||
}).setIsShelf());
|
||||
array_push(menu,
|
||||
menuItem(get_text("panel_graph_blend_nodes", "Blend nodes"), function() {
|
||||
doBlend();
|
||||
|
|
|
@ -130,8 +130,9 @@ function Render(partial = false, runAction = false) {
|
|||
LOG_IF(global.RENDER_LOG, "Rendered " + rendering.name + " (" + rendering.display_name + ") [" + string(instanceof(rendering)) + "]" + (renderable? " [Update]" : " [Skip]"));
|
||||
LOG_BLOCK_END();
|
||||
}
|
||||
} catch(e)
|
||||
} catch(e) {
|
||||
noti_warning(exception_print(e));
|
||||
}
|
||||
|
||||
LOG_IF(global.RENDER_LOG, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n");
|
||||
LOG_END();
|
||||
|
@ -191,8 +192,9 @@ function RenderList(list) {
|
|||
ds_queue_enqueue(queue, nextNodes[i]);
|
||||
}
|
||||
|
||||
} catch(e)
|
||||
} catch(e) {
|
||||
noti_warning(exception_print(e));
|
||||
}
|
||||
|
||||
LOG_IF(log, "=== RENDER COMPLETE ===\n");
|
||||
LOG_END();
|
||||
|
@ -251,6 +253,7 @@ function RenderListAction(list, context = PANEL_GRAPH.getCurrentContext()) {
|
|||
}
|
||||
|
||||
printIf(global.RENDER_LOG, "=== RENDER COMPLETE IN {" + string(current_time - t) + "ms} ===\n");
|
||||
} catch(e)
|
||||
noti_warning(exception_print(e));
|
||||
} catch(e) {
|
||||
noti_waning(exception_print(e));
|
||||
}
|
||||
}
|
|
@ -6,9 +6,9 @@ function __initTheme() {
|
|||
var _l = root + "/version";
|
||||
if(file_exists(_l)) {
|
||||
var res = json_load_struct(_l);
|
||||
if(res.version == BUILD_NUMBER) return;
|
||||
//if(res.version == BUILD_NUMBER) return;
|
||||
}
|
||||
//json_save_struct(_l, { version: BUILD_NUMBER });
|
||||
json_save_struct(_l, { version: BUILD_NUMBER });
|
||||
|
||||
log_message("THEME", "unzipping default theme to DIRECTORY.");
|
||||
zip_unzip("data/themes/default.zip", root);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
||||
"name": "functions",
|
||||
"path": "folders/functions.yy",
|
||||
"name": "window",
|
||||
"path": "folders/functions/window.yy",
|
||||
},
|
||||
}
|
Loading…
Reference in a new issue