diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 97585e9bc..0a8270c18 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -425,6 +425,7 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_resize.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_use_experssion.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_use_global.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_use_project.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_noti_icon_console_failed.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_noti_icon_console.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_noti_icon_error_strip2.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, diff --git a/datafiles/data/themes/default.zip b/datafiles/data/themes/default.zip index 3ab3b20fd..468daf76d 100644 Binary files a/datafiles/data/themes/default.zip and b/datafiles/data/themes/default.zip differ diff --git a/scripts/nodeValue_drawer/nodeValue_drawer.gml b/scripts/nodeValue_drawer/nodeValue_drawer.gml index 9d8da6e44..3dfa7c527 100644 --- a/scripts/nodeValue_drawer/nodeValue_drawer.gml +++ b/scripts/nodeValue_drawer/nodeValue_drawer.gml @@ -236,6 +236,13 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc if(jun.connect_type == JUNCTION_CONNECT.input) { wid.setInteract(!jun.hasJunctionFrom()); if(_focus) wid.register(_scrollPane); + + if(jun.value_tag == "dimension") { + var _proj = jun.node.attributes.use_project_dimension; + + wid.side_button.icon_index = _proj; + wid.side_button.icon_blend = _proj? c_white : COLORS._main_icon; + } } else { wid.setInteract(false); } diff --git a/scripts/node_armature_bind/node_armature_bind.gml b/scripts/node_armature_bind/node_armature_bind.gml index 61a7997d6..9f5d69f8c 100644 --- a/scripts/node_armature_bind/node_armature_bind.gml +++ b/scripts/node_armature_bind/node_armature_bind.gml @@ -907,6 +907,9 @@ function Node_Armature_Bind(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr } #endregion static attributeDeserialize = function(attr) { #region + if(struct_has(attributes, "use_project_dimension") && !struct_has(attr, "use_project_dimension")) + attributes.use_project_dimension = false; + if(struct_has(attr, "layer_visible")) attributes.layer_visible = attr.layer_visible; diff --git a/scripts/node_composite/node_composite.gml b/scripts/node_composite/node_composite.gml index 29723b676..aace0644a 100644 --- a/scripts/node_composite/node_composite.gml +++ b/scripts/node_composite/node_composite.gml @@ -831,6 +831,9 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) } #endregion static attributeDeserialize = function(attr) { #region + if(struct_has(attributes, "use_project_dimension") && !struct_has(attr, "use_project_dimension")) + attributes.use_project_dimension = false; + if(struct_has(attr, "layer_visible")) attributes.layer_visible = attr.layer_visible; diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 126f22a0d..872f23381 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -1774,7 +1774,12 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x createNewInput(); } #endregion - static attributeDeserialize = function(attr) { struct_override(attributes, attr); } + static attributeDeserialize = function(attr) { + if(struct_has(attributes, "use_project_dimension") && !struct_has(attr, "use_project_dimension")) + attributes.use_project_dimension = false; + struct_override(attributes, attr); + } + static postDeserialize = function() {} static processDeserialize = function() {} diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 382f29114..a3fe140f6 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -574,6 +574,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru def_length = is_array(def_val)? array_length(def_val) : 0; unit = new nodeValueUnit(self); dyna_depo = ds_list_create(); + value_tag = ""; is_changed = true; cache_value = [ false, false, undefined, undefined ]; @@ -849,6 +850,15 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(len == 2) { extract_node = [ "Node_Vector2", "Node_Path" ]; + + if(def_val == DEF_SURF) { + value_tag = "dimension"; + node.attributes.use_project_dimension = true; + editWidget.side_button = button(function() { + node.attributes.use_project_dimension = !node.attributes.use_project_dimension; + node.triggerRender(); + }).setIcon(THEME.node_use_project, 0, COLORS._main_icon).setTooltip("Use project dimension"); + } } else if(len == 3) extract_node = "Node_Vector3"; else if(len == 4) @@ -1389,6 +1399,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru static getValue = function(_time = CURRENT_FRAME, applyUnit = true, arrIndex = 0, useCache = false, log = false) { #region if(type == VALUE_TYPE.trigger) useCache = false; + if(value_tag == "dimension" && node.attributes.use_project_dimension) + return PROJECT.attributes.surface_dimension; global.cache_call++; if(useCache && use_cache) { @@ -1715,6 +1727,9 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(!updated) return false; + if(value_tag == "dimension" && struct_try_get(node.attributes, "use_project_dimension")) + node.attributes.use_project_dimension = false; + draw_junction_index = type; if(type == VALUE_TYPE.surface) { var _sval = val; diff --git a/scripts/project_data/project_data.gml b/scripts/project_data/project_data.gml index 0c4c04f9e..177c46b0b 100644 --- a/scripts/project_data/project_data.gml +++ b/scripts/project_data/project_data.gml @@ -59,8 +59,8 @@ } #endregion attributeEditor = [ #region - [ "Default Surface", "surface_dimension", new vectorBox(2, function(ind, val) { attributes.surface_dimension[ind] = val; return true; }) ], - [ "Palette", "palette", new buttonPalette(function(pal) { attributes.palette = pal; return true; }) ], + [ "Default Surface", "surface_dimension", new vectorBox(2, function(ind, val) { attributes.surface_dimension[ind] = val; RENDER_ALL return true; }) ], + [ "Palette", "palette", new buttonPalette(function(pal) { attributes.palette = pal; RENDER_ALL return true; }) ], ]; #endregion timelines = new timelineItemGroup();