1.15.0.1 patch

This commit is contained in:
Tanasart 2023-08-13 09:00:58 +02:00
parent b5eaa3bedd
commit ef5560ef02
8 changed files with 105 additions and 116 deletions

View file

@ -468,7 +468,7 @@ event_inherited();
if(instanceof(_pref[2]) == "checkBox") if(instanceof(_pref[2]) == "checkBox")
params.halign = fa_center; params.halign = fa_center;
var th = _pref[2].drawParam(params); var th = _pref[2].drawParam(params) ?? 0;
yy += th + padd + ui(8); yy += th + padd + ui(8);
hh += th + padd + ui(8); hh += th + padd + ui(8);
@ -547,7 +547,7 @@ event_inherited();
var widget_y = yy + hh - ui(4); var widget_y = yy + hh - ui(4);
var params = new widgetParam(widget_x, widget_y, widget_w, widget_h, val, {}, _m, sp_hotkey.x, sp_hotkey.y); var params = new widgetParam(widget_x, widget_y, widget_w, widget_h, val, {}, _m, sp_hotkey.x, sp_hotkey.y);
var th = _pref[2].drawParam(params); var th = _pref[2].drawParam(params) ?? 0;
hh += th + padd + ui(8); hh += th + padd + ui(8);
ind++; ind++;

View file

@ -101,9 +101,9 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER; globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER;
VERSION = 11510; VERSION = 11501;
SAVE_VERSION = 11500; SAVE_VERSION = 11500;
VERSION_STRING = "1.15.1"; VERSION_STRING = "1.15.0.1";
BUILD_NUMBER = 11501; BUILD_NUMBER = 11501;
globalvar APPEND_MAP; globalvar APPEND_MAP;

View file

@ -239,7 +239,8 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
break; break;
} }
widH = jun.editWidget.drawParam(param) - (TEXTBOX_HEIGHT * !lineBreak); var _widH = jun.editWidget.drawParam(param) ?? 0;
widH = _widH - (TEXTBOX_HEIGHT * !lineBreak);
} else if(jun.display_type == VALUE_DISPLAY.label) { } else if(jun.display_type == VALUE_DISPLAY.label) {
draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub); draw_set_text(f_p1, fa_left, fa_top, COLORS._main_text_sub);

View file

@ -300,7 +300,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var hover = noone; var hover = noone;
var amo = array_length(input_display_list); var amo = array_length(input_display_list);
var hov = PANEL_GRAPH._junction_hovering; var hov = PANEL_GRAPH.value_focus;
var ind = -1; var ind = -1;
if(hov != noone && struct_has(hov, "surface_index")) if(hov != noone && struct_has(hov, "surface_index"))
ind = hov.surface_index; ind = hov.surface_index;
@ -365,7 +365,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
show_input_name = PANEL_GRAPH.pHOVER && point_in_rectangle(_mx, _my, xx - 8 * _s, yy + 20 * _s, xx + 8 * _s, yy + h * _s); show_input_name = PANEL_GRAPH.pHOVER && point_in_rectangle(_mx, _my, xx - 8 * _s, yy + 20 * _s, xx + 8 * _s, yy + h * _s);
show_output_name = PANEL_GRAPH.pHOVER && point_in_rectangle(_mx, _my, xx + (w - 8) * _s, yy + 20 * _s, xx + (w + 8) * _s, yy + h * _s); show_output_name = PANEL_GRAPH.pHOVER && point_in_rectangle(_mx, _my, xx + (w - 8) * _s, yy + 20 * _s, xx + (w + 8) * _s, yy + h * _s);
var hov = PANEL_GRAPH._junction_hovering; var hov = PANEL_GRAPH.value_focus;
var ind = -1; var ind = -1;
if(hov != noone && struct_has(hov, "surface_index")) if(hov != noone && struct_has(hov, "surface_index"))
ind = hov.surface_index; ind = hov.surface_index;
@ -414,7 +414,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var inamo = input_display_list == -1? ds_list_size(inputs) : array_length(input_display_list); var inamo = input_display_list == -1? ds_list_size(inputs) : array_length(input_display_list);
var _in = yy + ui(32) * _s; var _in = yy + ui(32) * _s;
var hov = PANEL_GRAPH._junction_hovering; var hov = PANEL_GRAPH.value_focus;
var ind = -1; var ind = -1;
if(hov != noone && struct_has(hov, "surface_index")) if(hov != noone && struct_has(hov, "surface_index"))
ind = hov.surface_index; ind = hov.surface_index;

View file

@ -1685,7 +1685,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
else else
hover = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s) < max(th * 2, 6); hover = distance_to_curve(mx, my, jx, jy, frx, fry, cx, cy, _s) < max(th * 2, 6);
if(PANEL_GRAPH._junction_hovering == noone) if(PANEL_GRAPH.value_focus == noone)
draw_line_shift_hover = hover; draw_line_shift_hover = hover;
break; break;
case 2 : case 2 :
@ -1694,7 +1694,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
else else
hover = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s, value_from.drawLineIndex, drawLineIndex) < max(th * 2, 6); hover = distance_to_elbow(mx, my, frx, fry, jx, jy, cx, cy, _s, value_from.drawLineIndex, drawLineIndex) < max(th * 2, 6);
if(PANEL_GRAPH._junction_hovering == noone) if(PANEL_GRAPH.value_focus == noone)
draw_line_shift_hover = hover; draw_line_shift_hover = hover;
break; break;
case 3 : case 3 :
@ -1703,7 +1703,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
else else
hover = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, value_from.drawLineIndex, drawLineIndex) < max(th * 2, 6); hover = distance_to_elbow_diag(mx, my, frx, fry, jx, jy, cx, cy, _s, value_from.drawLineIndex, drawLineIndex) < max(th * 2, 6);
if(PANEL_GRAPH._junction_hovering == noone) if(PANEL_GRAPH.value_focus == noone)
draw_line_shift_hover = hover; draw_line_shift_hover = hover;
break; break;
} }
@ -1713,7 +1713,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
var thicken = false; var thicken = false;
thicken |= PANEL_GRAPH.nodes_junction_d == self; thicken |= PANEL_GRAPH.nodes_junction_d == self;
thicken |= _active && PANEL_GRAPH.junction_hovering == self && PANEL_GRAPH._junction_hovering == noone; thicken |= _active && PANEL_GRAPH.junction_hovering == self && PANEL_GRAPH.value_focus == noone;
thicken |= instance_exists(o_dialog_add_node) && o_dialog_add_node.junction_hovering == self; thicken |= instance_exists(o_dialog_add_node) && o_dialog_add_node.junction_hovering == self;
th *= thicken? 2 : 1; th *= thicken? 2 : 1;
@ -1769,6 +1769,67 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
return hovering; return hovering;
} }
static drawConnectionMouse = function(_mx, _my, ss, target) {
var drawCorner = type == VALUE_TYPE.action;
if(target != noone) {
_mx = target.x;
_my = target.y;
drawCorner |= target.type == VALUE_TYPE.action;
}
var corner = PREF_MAP[? "connection_line_corner"] * ss;
var th = PREF_MAP[? "connection_line_width"] * ss;
var col = value_color(type);
draw_set_color(col);
switch(PREF_MAP[? "curve_connection_line"]) {
case 0 :
draw_line_width(x, y, _mx, _my, th);
break;
case 1 :
if(drawCorner) {
if(type == VALUE_TYPE.action)
draw_line_curve_corner(_mx, _my, x, y, ss, th, col, col);
else
draw_line_curve_corner(x, y, _mx, _my, ss, th, col, col);
} else {
if(connect_type == JUNCTION_CONNECT.output)
draw_line_curve_color(_mx, _my, x, y,,, ss, th, col, col);
else
draw_line_curve_color(x, y, _mx, _my,,, ss, th, col, col);
}
break;
case 2 :
if(drawCorner) {
if(type == VALUE_TYPE.action)
draw_line_elbow_corner(_mx, _my, x, y, ss, th, col, col, corner);
else
draw_line_elbow_corner(x, y, _mx, _my, ss, th, col, col, corner);
} else {
if(connect_type == JUNCTION_CONNECT.output)
draw_line_elbow_color(x, y, _mx, _my,,, ss, th, col, col, corner);
else
draw_line_elbow_color(_mx, _my, x, y,,, ss, th, col, col, corner);
}
break;
case 3 :
if(drawCorner) {
if(type == VALUE_TYPE.action)
draw_line_elbow_diag_corner(_mx, _my, x, y, ss, th, col, col, corner);
else
draw_line_elbow_diag_corner(x, y, _mx, _my, ss, th, col, col, corner);
} else {
if(connect_type == JUNCTION_CONNECT.output)
draw_line_elbow_diag_color(x, y, _mx, _my,,, ss, th, col, col, corner);
else
draw_line_elbow_diag_color(_mx, _my, x, y,,, ss, th, col, col, corner);
}
break;
}
}
static isVisible = function() { static isVisible = function() {
if(!node.active) if(!node.active)
return false; return false;

View file

@ -65,15 +65,15 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
node_focus = noone; node_focus = noone;
junction_hovering = noone; junction_hovering = noone;
_junction_hovering = noone;
add_node_draw_junc = false; add_node_draw_junc = false;
add_node_draw_x_fix = 0; add_node_draw_x_fix = 0;
add_node_draw_y_fix = 0; add_node_draw_y_fix = 0;
add_node_draw_x = 0; add_node_draw_x = 0;
add_node_draw_y = 0; add_node_draw_y = 0;
value_focus = noone; value_focus = noone;
value_dragging = noone; value_dragging = noone;
value_draggings = [];
minimap_show = false; minimap_show = false;
minimap_w = ui(160); minimap_w = ui(160);
@ -520,7 +520,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
ds_list_add(nodes_select_list, node_hovering); ds_list_add(nodes_select_list, node_hovering);
} else { } else {
var _prevFocus = node_focus; var _prevFocus = node_focus;
node_focus = node_hovering; if(node_hovering != noone || value_focus == noone)
node_focus = node_hovering;
if(node_focus) { if(node_focus) {
if(instanceof(node_focus) == "Node_Frame") { if(instanceof(node_focus) == "Node_Frame") {
@ -561,7 +562,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
ds_list_clear(nodes_select_list); ds_list_clear(nodes_select_list);
} }
} else { } else {
ds_list_clear(nodes_select_list); if(value_focus == noone)
ds_list_clear(nodes_select_list);
if(DOUBLE_CLICK && !PANEL_INSPECTOR.locked) if(DOUBLE_CLICK && !PANEL_INSPECTOR.locked)
PANEL_INSPECTOR.inspecting = noone; PANEL_INSPECTOR.inspecting = noone;
@ -794,7 +796,6 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
value_focus = val; value_focus = val;
} }
} }
_junction_hovering = value_focus;
for(var i = 0; i < ds_list_size(nodes_list); i++) for(var i = 0; i < ds_list_size(nodes_list); i++)
nodes_list[| i].drawBadge(gr_x, gr_y, graph_s); nodes_list[| i].drawBadge(gr_x, gr_y, graph_s);
@ -809,40 +810,6 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
if(node_dragging) { if(node_dragging) {
node_focus = node_dragging; node_focus = node_dragging;
// TODO: Mode node(s) into group.
//for(var i = 0; i < ds_list_size(nodes_list); i++) { //drag node to group
// var _node = nodes_list[| i];
// if(!_node.pointIn(gr_x, gr_y, mx, my, graph_s) || !variable_struct_exists(_node, "nodes"))
// continue;
// var _recur = false;
// if(ds_list_size(nodes_select_list) == 0) {
// if(_node == node_dragging) _recur = true;
// } else {
// for(var j = 0; j < ds_list_size(nodes_select_list); j++) {
// var _n = nodes_select_list[| j];
// if(_node == _n) _recur = true;
// }
// }
// if(_recur)
// continue;
// _node.drawActive(gr_x, gr_y, graph_s, 1);
// if(mouse_release(mb_left) && key_mod_press(ALT)) {
// if(ds_list_size(nodes_select_list) == 0) {
// _node.add(node_dragging);
// node_dragging.checkConnectGroup();
// } else {
// for(var j = 0; j < ds_list_size(nodes_select_list); j++)
// _node.add(nodes_select_list[| j]);
// for(var j = 0; j < ds_list_size(nodes_select_list); j++)
// nodes_select_list[| j].checkConnectGroup();
// }
// }
//}
if(ds_list_size(nodes_select_list) == 0) { // move single node if(ds_list_size(nodes_select_list) == 0) { // move single node
var nx = node_drag_sx + (mouse_graph_x - node_drag_mx); var nx = node_drag_sx + (mouse_graph_x - node_drag_mx);
var ny = node_drag_sy + (mouse_graph_y - node_drag_my); var ny = node_drag_sy + (mouse_graph_y - node_drag_my);
@ -939,8 +906,6 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
if(point_distance(nodes_select_mx, nodes_select_my, mx, my) > 16) { if(point_distance(nodes_select_mx, nodes_select_my, mx, my) > 16) {
draw_sprite_stretched_points(THEME.ui_selection, 0, nodes_select_mx, nodes_select_my, mx, my); draw_sprite_stretched_points(THEME.ui_selection, 0, nodes_select_mx, nodes_select_my, mx, my);
//ds_list_clear(nodes_select_list);
for(var i = 0; i < ds_list_size(nodes_list); i++) { for(var i = 0; i < ds_list_size(nodes_list); i++) {
var _node = nodes_list[| i]; var _node = nodes_list[| i];
if(instanceof(_node) == "Node_Frame") continue; if(instanceof(_node) == "Node_Frame") continue;
@ -1445,63 +1410,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
} }
} }
var drawCorner = value_dragging.type == VALUE_TYPE.action; value_dragging.drawConnectionMouse(_mx, _my, graph_s, target);
if(target != noone) {
_mx = target.x;
_my = target.y;
drawCorner |= target.type == VALUE_TYPE.action;
}
var col = value_color(value_dragging.type);
var corner = PREF_MAP[? "connection_line_corner"] * graph_s;
draw_set_color(col);
var th = PREF_MAP[? "connection_line_width"] * graph_s;
switch(PREF_MAP[? "curve_connection_line"]) {
case 0 :
draw_line_width(xx, yy, _mx, _my, th);
break;
case 1 :
if(drawCorner) {
if(value_dragging.type == VALUE_TYPE.action)
draw_line_curve_corner(_mx, _my, xx, yy, graph_s, th, col, col);
else
draw_line_curve_corner(xx, yy, _mx, _my, graph_s, th, col, col);
} else {
if(value_dragging.connect_type == JUNCTION_CONNECT.output)
draw_line_curve_color(_mx, _my, xx, yy,,, graph_s, th, col, col);
else
draw_line_curve_color(xx, yy, _mx, _my,,, graph_s, th, col, col);
}
break;
case 2 :
if(drawCorner) {
if(value_dragging.type == VALUE_TYPE.action)
draw_line_elbow_corner(_mx, _my, xx, yy, graph_s, th, col, col, corner);
else
draw_line_elbow_corner(xx, yy, _mx, _my, graph_s, th, col, col, corner);
} else {
if(value_dragging.connect_type == JUNCTION_CONNECT.output)
draw_line_elbow_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner);
else
draw_line_elbow_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner);
}
break;
case 3 :
if(drawCorner) {
if(value_dragging.type == VALUE_TYPE.action)
draw_line_elbow_diag_corner(_mx, _my, xx, yy, graph_s, th, col, col, corner);
else
draw_line_elbow_diag_corner(xx, yy, _mx, _my, graph_s, th, col, col, corner);
} else {
if(value_dragging.connect_type == JUNCTION_CONNECT.output)
draw_line_elbow_diag_color(xx, yy, _mx, _my,,, graph_s, th, col, col, corner);
else
draw_line_elbow_diag_color(_mx, _my, xx, yy,,, graph_s, th, col, col, corner);
}
break;
}
value_dragging.drawJunction(graph_s, value_dragging.x, value_dragging.y); value_dragging.drawJunction(graph_s, value_dragging.x, value_dragging.y);
if(target) if(target)
target.drawJunction(graph_s, target.x, target.y); target.drawJunction(graph_s, target.x, target.y);
@ -1534,15 +1443,18 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
value_dragging = noone; value_dragging = noone;
} }
} else if(!value_dragging && value_focus && mouse_press(mb_left, pFOCUS) && !key_mod_press(ALT)) } else if(!value_dragging && value_focus && mouse_press(mb_left, pFOCUS) && !key_mod_press(ALT)) {
value_dragging = value_focus; value_dragging = value_focus;
value_draggings = [];
if(ds_list_empty(nodes_select_list)) {}
}
#region draw junction name #region draw junction name
var gr_x = graph_x * graph_s; var gr_x = graph_x * graph_s;
var gr_y = graph_y * graph_s; var gr_y = graph_y * graph_s;
for(var i = 0; i < ds_list_size(nodes_list); i++) { for(var i = 0; i < ds_list_size(nodes_list); i++)
nodes_list[| i].drawJunctionNames(gr_x, gr_y, mx, my, graph_s); nodes_list[| i].drawJunctionNames(gr_x, gr_y, mx, my, graph_s);
}
#endregion #endregion
} }

View file

@ -6,10 +6,20 @@
global.FUNCTIONS[? "cos"] = [ ["radian"], function(val) { return cos(val[0]); } ]; global.FUNCTIONS[? "cos"] = [ ["radian"], function(val) { return cos(val[0]); } ];
global.FUNCTIONS[? "tan"] = [ ["radian"], function(val) { return tan(val[0]); } ]; global.FUNCTIONS[? "tan"] = [ ["radian"], function(val) { return tan(val[0]); } ];
global.FUNCTIONS[? "arcsin"] = [ ["number"], function(val) { return arcsin(val[0]); } ];
global.FUNCTIONS[? "arccos"] = [ ["number"], function(val) { return arccos(val[0]); } ];
global.FUNCTIONS[? "arctan"] = [ ["number"], function(val) { return arctan(val[0]); } ];
global.FUNCTIONS[? "abs"] = [ ["number"], function(val) { return abs(val[0]); } ]; global.FUNCTIONS[? "abs"] = [ ["number"], function(val) { return abs(val[0]); } ];
global.FUNCTIONS[? "round"] = [ ["number"], function(val) { return round(val[0]); } ]; global.FUNCTIONS[? "round"] = [ ["number"], function(val) { return round(val[0]); } ];
global.FUNCTIONS[? "ceil"] = [ ["number"], function(val) { return ceil(val[0]); } ]; global.FUNCTIONS[? "ceil"] = [ ["number"], function(val) { return ceil(val[0]); } ];
global.FUNCTIONS[? "floor"] = [ ["number"], function(val) { return floor(val[0]); } ]; global.FUNCTIONS[? "floor"] = [ ["number"], function(val) { return floor(val[0]); } ];
global.FUNCTIONS[? "fract"] = [ ["number"], function(val) { return frac(val[0]); } ];
global.FUNCTIONS[? "sign"] = [ ["number"], function(val) { return sign(val[0]); } ];
global.FUNCTIONS[? "min"] = [ ["number", "number"], function(val) { return min(array_safe_get(val, 0), array_safe_get(val, 1)); } ];
global.FUNCTIONS[? "max"] = [ ["number", "number"], function(val) { return max(array_safe_get(val, 0), array_safe_get(val, 1)); } ];
global.FUNCTIONS[? "clamp"] = [ ["number", "min = 0", "max = 1"], function(val) { return clamp(array_safe_get(val, 0), array_safe_get(val, 1, 0), array_safe_get(val, 2, 1)); } ];
global.FUNCTIONS[? "lerp"] = [ ["number_0", "number_1", "amount"], function(val) { return lerp(array_safe_get(val, 0), array_safe_get(val, 1), array_safe_get(val, 2)); } ]; global.FUNCTIONS[? "lerp"] = [ ["number_0", "number_1", "amount"], function(val) { return lerp(array_safe_get(val, 0), array_safe_get(val, 1), array_safe_get(val, 2)); } ];
@ -41,6 +51,11 @@
return 0; return 0;
} ]; } ];
global.FUNCTIONS[? "string"] = [ ["value"], function(val) { return string(val[0]); } ];
global.FUNCTIONS[? "number"] = [ ["value"], function(val) { return toNumber(val[0]); } ];
global.FUNCTIONS[? "chr"] = [ ["number"], function(val) { return chr(val[0]); } ];
global.FUNCTIONS[? "ord"] = [ ["char"], function(val) { return ord(val[0]); } ];
globalvar PROJECT_VARIABLES; globalvar PROJECT_VARIABLES;
PROJECT_VARIABLES = {}; PROJECT_VARIABLES = {};

View file

@ -1,5 +1,5 @@
#region symbols #region symbols
global.LOG_EXPRESSION = true; global.LOG_EXPRESSION = false;
global.EQUATION_PRES = ds_map_create(); global.EQUATION_PRES = ds_map_create();
global.EQUATION_PRES[? "+"] = 1; global.EQUATION_PRES[? "+"] = 1;