mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-24 22:16:17 +01:00
- Fix some junctions still show up after hiding.
This commit is contained in:
parent
9e2b0fdcea
commit
f951f279c9
9 changed files with 73 additions and 47 deletions
|
@ -53,7 +53,7 @@
|
||||||
CURRENT_COLOR = c_white;
|
CURRENT_COLOR = c_white;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region inputsdis
|
#region input
|
||||||
globalvar FOCUS, FOCUS_STR, HOVER, HOVERING_ELEMENT, _HOVERING_ELEMENT;
|
globalvar FOCUS, FOCUS_STR, HOVER, HOVERING_ELEMENT, _HOVERING_ELEMENT;
|
||||||
globalvar DOUBLE_CLICK, DOUBLE_CLICK_POS;
|
globalvar DOUBLE_CLICK, DOUBLE_CLICK_POS;
|
||||||
globalvar DIALOG_CLICK;
|
globalvar DIALOG_CLICK;
|
||||||
|
|
|
@ -69,22 +69,24 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
|
||||||
|
|
||||||
butx += ui(20);
|
butx += ui(20);
|
||||||
if(!global_var) { // visibility
|
if(!global_var) { // visibility
|
||||||
index = jun.visible;
|
var _visi = jun.isVisible();
|
||||||
draw_sprite_ui_uniform(THEME.junc_visible, index, butx, lb_y, 1,, 0.8);
|
|
||||||
|
draw_sprite_ui_uniform(THEME.junc_visible, _visi, butx, lb_y, 1,, 0.8);
|
||||||
if(_hover && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) {
|
if(_hover && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) {
|
||||||
cHov = true;
|
cHov = true;
|
||||||
|
|
||||||
if(visi_hold != noone && jun.visible != visi_hold) {
|
if(visi_hold != noone && jun.visible_manual != visi_hold) {
|
||||||
jun.visible = visi_hold;
|
jun.visible_manual = visi_hold;
|
||||||
jun.node.refreshNodeDisplay();
|
jun.node.refreshNodeDisplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_sprite_ui_uniform(THEME.junc_visible, index, butx, lb_y, 1,, 1);
|
draw_sprite_ui_uniform(THEME.junc_visible, _visi, butx, lb_y, 1,, 1);
|
||||||
TOOLTIP = __txt("Visibility");
|
TOOLTIP = __txt("Visibility");
|
||||||
|
|
||||||
if(mouse_press(mb_left, _focus)) {
|
if(mouse_press(mb_left, _focus)) {
|
||||||
jun.visible = !jun.visible;
|
jun.visible_manual = _visi? -1 : 1;
|
||||||
visi_hold = jun.visible;
|
|
||||||
|
visi_hold = jun.visible_manual;
|
||||||
jun.node.refreshNodeDisplay();
|
jun.node.refreshNodeDisplay();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -162,9 +162,9 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group)
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
static onValueUpdate = function(index) { #region
|
static onValueUpdate = function(index) {
|
||||||
if(index == in_d3d + 9) PANEL_PREVIEW.tool_current = noone;
|
if(index == in_d3d + 9) PANEL_PREVIEW.tool_current = noone;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() { #region
|
||||||
var _proj = getInputData(in_d3d + 3);
|
var _proj = getInputData(in_d3d + 3);
|
||||||
|
|
|
@ -454,7 +454,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
var _dy = 9999;
|
var _dy = 9999;
|
||||||
|
|
||||||
for( var i = 0; i < ds_list_size(outputs); i++ ) {
|
for( var i = 0; i < ds_list_size(outputs); i++ ) {
|
||||||
if(!outputs[| i].visible) continue;
|
if(!outputs[| i].isVisible()) continue;
|
||||||
if(junc != noone && !junc.isConnectable(outputs[| i], true)) continue;
|
if(junc != noone && !junc.isConnectable(outputs[| i], true)) continue;
|
||||||
|
|
||||||
var _ddy = abs(outputs[| i].y - _y);
|
var _ddy = abs(outputs[| i].y - _y);
|
||||||
|
@ -473,7 +473,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
for( var i = shift; i < ds_list_size(inputs); i++ ) {
|
for( var i = shift; i < ds_list_size(inputs); i++ ) {
|
||||||
var _inp = inputs[| i];
|
var _inp = inputs[| i];
|
||||||
|
|
||||||
if(!_inp.visible) continue;
|
if(!_inp.isVisible()) continue;
|
||||||
if(_inp.value_from != noone) continue;
|
if(_inp.value_from != noone) continue;
|
||||||
if(junc != noone && (value_bit(junc.type) & value_bit(_inp.type)) == 0) continue;
|
if(junc != noone && (value_bit(junc.type) & value_bit(_inp.type)) == 0) continue;
|
||||||
|
|
||||||
|
@ -802,8 +802,8 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
if(!_inp.isDynamic()) continue;
|
if(!_inp.isDynamic()) continue;
|
||||||
|
|
||||||
var val = _inp.getValue(frame);
|
var val = _inp.getValue(frame);
|
||||||
// setInputData(i, val);
|
|
||||||
inputs_data[i] = val;
|
inputs_data[i] = val; // setInputData(i, val);
|
||||||
input_value_map[$ _inp.internalName] = val;
|
input_value_map[$ _inp.internalName] = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -878,7 +878,6 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
static valueUpdate = function(index) {
|
static valueUpdate = function(index) {
|
||||||
|
|
||||||
onValueUpdate(index);
|
onValueUpdate(index);
|
||||||
|
|
||||||
if(is_dynamic_input) will_setHeight = true;
|
if(is_dynamic_input) will_setHeight = true;
|
||||||
|
@ -887,6 +886,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
|
|
||||||
static valueFromUpdate = function(index) {
|
static valueFromUpdate = function(index) {
|
||||||
onValueFromUpdate(index);
|
onValueFromUpdate(index);
|
||||||
|
onValueUpdate(index);
|
||||||
|
|
||||||
if(auto_input && !LOADING && !APPENDING)
|
if(auto_input && !LOADING && !APPENDING)
|
||||||
refreshDynamicInput();
|
refreshDynamicInput();
|
||||||
|
@ -1494,10 +1494,10 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor {
|
||||||
|
|
||||||
if(show_output_name) {
|
if(show_output_name) {
|
||||||
for(var i = 0; i < ds_list_size(outputs); i++)
|
for(var i = 0; i < ds_list_size(outputs); i++)
|
||||||
if(outputs[| i].visible) outputs[| i].drawNameBG(_s);
|
if(outputs[| i].isVisible()) outputs[| i].drawNameBG(_s);
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(outputs); i++)
|
for(var i = 0; i < ds_list_size(outputs); i++)
|
||||||
if(outputs[| i].visible) outputs[| i].drawName(_s, _mx, _my);
|
if(outputs[| i].isVisible()) outputs[| i].drawName(_s, _mx, _my);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(hasInspector1Update() && PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, inspectInput1.x, inspectInput1.y, 10)) {
|
if(hasInspector1Update() && PANEL_GRAPH.pHOVER && point_in_circle(_mx, _my, inspectInput1.x, inspectInput1.y, 10)) {
|
||||||
|
|
|
@ -87,12 +87,12 @@ function Node_Grid_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
return _hov;
|
return _hov;
|
||||||
}
|
}
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() {
|
||||||
inputs[| 2].mappableStep();
|
inputs[| 2].mappableStep();
|
||||||
inputs[| 3].mappableStep();
|
inputs[| 3].mappableStep();
|
||||||
inputs[| 4].mappableStep();
|
inputs[| 4].mappableStep();
|
||||||
inputs[| 5].mappableStep();
|
inputs[| 5].mappableStep();
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _dim = _data[0];
|
var _dim = _data[0];
|
||||||
|
|
|
@ -237,7 +237,7 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
return _hov;
|
return _hov;
|
||||||
}
|
}
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _dim = _data[0];
|
var _dim = _data[0];
|
||||||
var _bg = _data[1];
|
var _bg = _data[1];
|
||||||
var _shape = _data[2];
|
var _shape = _data[2];
|
||||||
|
@ -364,7 +364,7 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
var _shp = array_safe_get(shape_types, _shape, "");
|
var _shp = array_safe_get(shape_types, _shape, "");
|
||||||
if(is_struct(_shp)) _shp = _shp.data;
|
if(is_struct(_shp)) _shp = _shp.data;
|
||||||
|
|
||||||
switch(_shp) { #region
|
switch(_shp) {
|
||||||
case "Rectangle" :
|
case "Rectangle" :
|
||||||
inputs[| 9].setVisible( true);
|
inputs[| 9].setVisible( true);
|
||||||
inputs[| 18].setVisible(false);
|
inputs[| 18].setVisible(false);
|
||||||
|
@ -547,7 +547,7 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
shader_set_f("teethAngle", _data[27]);
|
shader_set_f("teethAngle", _data[27]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
shader_set_f("dimension", _dim);
|
shader_set_f("dimension", _dim);
|
||||||
shader_set_f("bgColor", _bgcol);
|
shader_set_f("bgColor", _bgcol);
|
||||||
|
@ -565,5 +565,5 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
||||||
return _outSurf;
|
return _outSurf;
|
||||||
} #endregion
|
}
|
||||||
}
|
}
|
|
@ -178,6 +178,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
|
|
||||||
#region ---- inspector ----
|
#region ---- inspector ----
|
||||||
visible = _connect == JUNCTION_CONNECT.output || _type == VALUE_TYPE.surface || _type == VALUE_TYPE.path || _type == VALUE_TYPE.PCXnode;
|
visible = _connect == JUNCTION_CONNECT.output || _type == VALUE_TYPE.surface || _type == VALUE_TYPE.path || _type == VALUE_TYPE.PCXnode;
|
||||||
|
visible_manual = 0;
|
||||||
show_in_inspector = true;
|
show_in_inspector = true;
|
||||||
visible_in_list = true;
|
visible_in_list = true;
|
||||||
|
|
||||||
|
@ -492,6 +493,34 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static forceVisible = function(_vis) {
|
||||||
|
visible = _vis;
|
||||||
|
show_in_inspector = _vis;
|
||||||
|
visible_manual = 0;
|
||||||
|
|
||||||
|
node.will_setHeight = true;
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
static isVisible = function() {
|
||||||
|
if(!node.active) return false;
|
||||||
|
|
||||||
|
if(connect_type == JUNCTION_CONNECT.output) {
|
||||||
|
if(!array_empty(value_to)) return true;
|
||||||
|
if(visible_manual != 0) return visible_manual == 1;
|
||||||
|
|
||||||
|
return visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(value_from) return true;
|
||||||
|
if(visible_manual != 0) return visible_manual == 1;
|
||||||
|
if(!visible) return false;
|
||||||
|
|
||||||
|
if(index == -1) return true;
|
||||||
|
|
||||||
|
return visible_in_list;
|
||||||
|
}
|
||||||
|
|
||||||
static setDisplay = function(_type = VALUE_DISPLAY._default, _data = {}) { #region
|
static setDisplay = function(_type = VALUE_DISPLAY._default, _data = {}) { #region
|
||||||
display_type = _type;
|
display_type = _type;
|
||||||
display_data = _data;
|
display_data = _data;
|
||||||
|
@ -1985,20 +2014,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
}
|
}
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static isVisible = function() { #region
|
|
||||||
if(!node.active) return false;
|
|
||||||
|
|
||||||
if(connect_type == JUNCTION_CONNECT.output)
|
|
||||||
return visible || !array_empty(value_to);
|
|
||||||
|
|
||||||
if(value_from) return true;
|
|
||||||
if(!visible) return false;
|
|
||||||
|
|
||||||
if(index == -1) return true;
|
|
||||||
|
|
||||||
return visible_in_list;
|
|
||||||
} #endregion
|
|
||||||
|
|
||||||
/////========== EXPRESSION ==========
|
/////========== EXPRESSION ==========
|
||||||
|
|
||||||
static setUseExpression = function(useExp) { #region
|
static setUseExpression = function(useExp) { #region
|
||||||
|
@ -2026,6 +2041,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
var _map = {};
|
var _map = {};
|
||||||
|
|
||||||
_map.visible = visible;
|
_map.visible = visible;
|
||||||
|
_map.visible_manual = visible_manual;
|
||||||
_map.color = color;
|
_map.color = color;
|
||||||
|
|
||||||
if(connect_type == JUNCTION_CONNECT.output)
|
if(connect_type == JUNCTION_CONNECT.output)
|
||||||
|
@ -2073,6 +2089,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
if(!is_struct(_map)) return;
|
if(!is_struct(_map)) return;
|
||||||
|
|
||||||
visible = struct_try_get(_map, "visible", visible);
|
visible = struct_try_get(_map, "visible", visible);
|
||||||
|
visible_manual = struct_try_get(_map, "visible_manual", visible_manual);
|
||||||
color = struct_try_get(_map, "color", -1);
|
color = struct_try_get(_map, "color", -1);
|
||||||
|
|
||||||
if(connect_type == JUNCTION_CONNECT.output)
|
if(connect_type == JUNCTION_CONNECT.output)
|
||||||
|
|
|
@ -3071,18 +3071,18 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
|
||||||
|
|
||||||
for(var j = 0; j < ds_list_size(_node.inputs); j++) {
|
for(var j = 0; j < ds_list_size(_node.inputs); j++) {
|
||||||
var _jun = _node.inputs[| j];
|
var _jun = _node.inputs[| j];
|
||||||
if(!_jun.visible) continue;
|
if(!_jun.isVisible()) continue;
|
||||||
|
|
||||||
if(_jun.value_from == noone)
|
if(_jun.value_from == noone)
|
||||||
_jun.visible = false;
|
_jun.visible_manual = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var j = 0; j < ds_list_size(_node.outputs); j++) {
|
for(var j = 0; j < ds_list_size(_node.outputs); j++) {
|
||||||
var _jun = _node.outputs[| j];
|
var _jun = _node.outputs[| j];
|
||||||
if(!_jun.visible) continue;
|
if(!_jun.isVisible()) continue;
|
||||||
|
|
||||||
if(array_empty(_jun.getJunctionTo()))
|
if(array_empty(_jun.getJunctionTo()))
|
||||||
_jun.visible = false;
|
_jun.visible_manual = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
_node.will_setHeight = true;
|
_node.will_setHeight = true;
|
||||||
|
|
|
@ -13,6 +13,8 @@ enum RENDER_TYPE {
|
||||||
#macro RENDER_ALL_REORDER UPDATE_RENDER_ORDER = true; UPDATE |= RENDER_TYPE.full;
|
#macro RENDER_ALL_REORDER UPDATE_RENDER_ORDER = true; UPDATE |= RENDER_TYPE.full;
|
||||||
#macro RENDER_ALL UPDATE |= RENDER_TYPE.full;
|
#macro RENDER_ALL UPDATE |= RENDER_TYPE.full;
|
||||||
#macro RENDER_PARTIAL UPDATE |= RENDER_TYPE.partial;
|
#macro RENDER_PARTIAL UPDATE |= RENDER_TYPE.partial;
|
||||||
|
|
||||||
|
global.getvalue_hit = 0;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
function ResetAllNodesRender() { #region
|
function ResetAllNodesRender() { #region
|
||||||
|
@ -172,6 +174,8 @@ function Render(partial = false, runAction = false) { #region
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
LOG_IF(global.FLAG.render, $"============================== RENDER START [{partial? "PARTIAL" : "FULL"}] [frame {CURRENT_FRAME}] ==============================");
|
LOG_IF(global.FLAG.render, $"============================== RENDER START [{partial? "PARTIAL" : "FULL"}] [frame {CURRENT_FRAME}] ==============================");
|
||||||
|
|
||||||
|
// global.getvalue_hit = 0;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var t = get_timer();
|
var t = get_timer();
|
||||||
var t1 = get_timer();
|
var t1 = get_timer();
|
||||||
|
@ -259,6 +263,9 @@ function Render(partial = false, runAction = false) { #region
|
||||||
noti_warning(exception_print(e));
|
noti_warning(exception_print(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// print("\n============== render stat ==============");
|
||||||
|
// print($"Get value hit: {global.getvalue_hit}");
|
||||||
|
|
||||||
LOG_END();
|
LOG_END();
|
||||||
|
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
Loading…
Reference in a new issue