mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 06:26:42 +01:00
group input lock
This commit is contained in:
parent
a04a4c7b94
commit
b91cc3844f
4 changed files with 24 additions and 35 deletions
|
@ -27,8 +27,8 @@ function draw_line_elbow_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = 1, t
|
|||
corner = min(corner, abs(cy - y0) / 2, abs(cy - y1) / 2, abs(xx1 - xx0) / 2);
|
||||
|
||||
if(type == LINE_STYLE.solid) {
|
||||
draw_set_color(col1); draw_line_width(x0, y0, xx0 - corns, y0, thick);
|
||||
draw_set_color(col2); draw_line_width(xx1 + corns, y1, x1, y1, thick);
|
||||
__draw_set_color(col1); draw_line_width(x0, y0, xx0 - corns, y0, thick);
|
||||
__draw_set_color(col2); draw_line_width(xx1 + corns, y1, x1, y1, thick);
|
||||
|
||||
draw_line_width_color(xx0, y0 + corns * iy0, xx0, cy - corner * iy0, thick, col1, cm);
|
||||
draw_line_width_color(xx0 - corner * sign(xx0 - xx1), cy, xx1 + corner * sign(xx0 - xx1), cy, thick, cm, cm);
|
||||
|
@ -44,8 +44,8 @@ function draw_line_elbow_color(x0, y0, x1, y1, cx = noone, cy = noone, _s = 1, t
|
|||
draw_corner(xx1 + corner, cy, xx1, cy, xx1, cy + corner * iy1, thick, cm, sample);
|
||||
}
|
||||
} else {
|
||||
draw_set_color(col1); draw_line_width(x0, y0, xx0, y0, thick);
|
||||
draw_set_color(col2); draw_line_width(xx1, y1, x1, y1, thick);
|
||||
__draw_set_color(col1); draw_line_width(x0, y0, xx0, y0, thick);
|
||||
__draw_set_color(col2); draw_line_width(xx1, y1, x1, y1, thick);
|
||||
|
||||
draw_line_dashed_color(xx0, y0, xx0, cy, thick, col1, cm, 6 * _s);
|
||||
draw_line_dashed_color(xx0, cy, xx1, cy, thick, cm, cm, 6 * _s);
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample = 10) { #region
|
||||
function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample = 10) {
|
||||
var dir0 = point_direction(x1, y1, xc, yc);
|
||||
var dir1 = point_direction(x3, y3, xc, yc);
|
||||
|
||||
var dis = point_distance(x1, y1, x3, y3);
|
||||
if(dis < 8) {
|
||||
draw_set_color(col);
|
||||
__draw_set_color(col);
|
||||
draw_line_width(x1, y1, x3, y3, thick);
|
||||
return;
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample =
|
|||
var d0 = point_direction(px, py, x1, y1);
|
||||
var d1 = point_direction(px, py, x3, y3);
|
||||
|
||||
draw_set_color(col);
|
||||
__draw_set_color(col);
|
||||
draw_primitive_begin(pr_trianglestrip);
|
||||
|
||||
var ox, oy, nx, ny;
|
||||
|
@ -46,9 +46,9 @@ function draw_corner(x1, y1, xc, yc, x3, y3, thick = 1, col = c_white, sample =
|
|||
}
|
||||
|
||||
draw_primitive_end();
|
||||
} #endregion
|
||||
}
|
||||
|
||||
function get_corner(x1, y1, xc, yc, x3, y3, sample = 10) { #region
|
||||
function get_corner(x1, y1, xc, yc, x3, y3, sample = 10) {
|
||||
var dir0 = point_direction(x1, y1, xc, yc);
|
||||
var dir1 = point_direction(x3, y3, xc, yc);
|
||||
|
||||
|
@ -87,4 +87,4 @@ function get_corner(x1, y1, xc, yc, x3, y3, sample = 10) { #region
|
|||
}
|
||||
|
||||
return pnt;
|
||||
} #endregion
|
||||
}
|
|
@ -193,21 +193,18 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
group_output_display_list = [];
|
||||
attributes.input_display_list = [];
|
||||
attributes.output_display_list = [];
|
||||
attributes.lock_input = false;
|
||||
|
||||
managedRenderOrder = false;
|
||||
|
||||
skipDefault();
|
||||
|
||||
draw_dummy = false;
|
||||
dummy_input = nodeValue("Add to group", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0);
|
||||
__dummy_input = nodeValue("Add to group", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0);
|
||||
__dummy_input.setDummy(function() /*=>*/ { var input = nodeBuild("Node_Group_Input", 0, 0, self); return input.inParent; }, function(_junc) /*=>*/ { _junc.from.destroy() } );
|
||||
|
||||
dummy_input.setDummy(function() /*=>*/ { var input = nodeBuild("Node_Group_Input", 0, 0, self); return input.inParent; },
|
||||
function(_junc) /*=>*/ { _junc.from.destroy() }
|
||||
);
|
||||
|
||||
dummy_input.onSetFrom = function(juncFrom) {
|
||||
array_remove(juncFrom.value_to, dummy_input);
|
||||
dummy_input.value_from = noone;
|
||||
__dummy_input.onSetFrom = function(juncFrom) {
|
||||
array_remove(juncFrom.value_to, __dummy_input);
|
||||
__dummy_input.value_from = noone;
|
||||
|
||||
var input = nodeBuild("Node_Group_Input", 0, 0, self);
|
||||
var _type = juncFrom.type;
|
||||
|
@ -226,8 +223,9 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
tool_node = noone;
|
||||
draw_input_overlay = true;
|
||||
|
||||
array_push(attributeEditors, ["Edit Input Display", function() /*=>*/ {return 0}, button(function() { dialogCall(o_dialog_group_input_order).setNode(self, CONNECT_TYPE.input); }) ]);
|
||||
array_push(attributeEditors, ["Edit Output Display", function() /*=>*/ {return 0}, button(function() { dialogCall(o_dialog_group_input_order).setNode(self, CONNECT_TYPE.output); }) ]);
|
||||
array_push(attributeEditors, ["Lock Input", function() /*=>*/ {return attributes.lock_input}, new checkBox(function() /*=>*/ { attributes.lock_input = !attributes.lock_input }) ]);
|
||||
array_push(attributeEditors, ["Edit Input Display", function() /*=>*/ {return 0}, button(function() /*=>*/ { dialogCall(o_dialog_group_input_order).setNode(self, CONNECT_TYPE.input); }) ]);
|
||||
array_push(attributeEditors, ["Edit Output Display", function() /*=>*/ {return 0}, button(function() /*=>*/ { dialogCall(o_dialog_group_input_order).setNode(self, CONNECT_TYPE.output); }) ]);
|
||||
|
||||
/////========== INSPECTOR ===========
|
||||
|
||||
|
@ -316,6 +314,8 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
/////============= STEP ==============
|
||||
|
||||
static stepBegin = function() {
|
||||
dummy_input = attributes.lock_input? noone : __dummy_input;
|
||||
|
||||
if(will_refresh) refreshNodes();
|
||||
doStepBegin();
|
||||
}
|
||||
|
@ -515,8 +515,8 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
var xx = x * _s + _x;
|
||||
var yy = y * _s + _y;
|
||||
|
||||
dummy_input.x = xx;
|
||||
dummy_input.y = _iny;
|
||||
__dummy_input.x = xx;
|
||||
__dummy_input.y = _iny;
|
||||
|
||||
var _hv = PANEL_GRAPH.pHOVER && PANEL_GRAPH.node_hovering == self && (!PREFERENCES.panel_graph_group_require_shift || key_mod_press(SHIFT));
|
||||
bg_spr_add = 0.1 + (0.1 * _hv);
|
||||
|
@ -544,17 +544,6 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
|||
panelSetContext(PANEL_GRAPH);
|
||||
}
|
||||
|
||||
static onDrawJunctions = function(_x, _y, _mx, _my, _s) {
|
||||
dummy_input.visible = false;
|
||||
|
||||
if(draw_dummy) {
|
||||
dummy_input.visible = true;
|
||||
dummy_input.drawJunction(_s, _mx, _my);
|
||||
}
|
||||
|
||||
draw_dummy = false;
|
||||
}
|
||||
|
||||
static getTool = function() {
|
||||
for(var i = 0, n = array_length(nodes); i < n; i++) {
|
||||
var _node = nodes[i];
|
||||
|
|
|
@ -621,7 +621,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
|||
static newOutput = function(index, junction) { outputs[index] = junction; return junction; }
|
||||
|
||||
static getInputJunctionAmount = function() { return (input_display_list == -1 || !use_display_list)? array_length(inputs) : array_length(input_display_list); }
|
||||
static getInputJunctionIndex = function(index) {
|
||||
static getInputJunctionIndex = function(index) {
|
||||
INLINE
|
||||
|
||||
if(input_display_list == -1 || !use_display_list)
|
||||
|
|
Loading…
Reference in a new issue