This commit is contained in:
Tanasart 2023-07-31 20:06:44 +02:00
parent e113e9eaea
commit 47480f6517
9 changed files with 99 additions and 11 deletions

View file

@ -1,6 +1,7 @@
/// @description /// @description
if(!active) exit; if(!active) exit;
if(textbox == noone) exit; if(textbox == noone) exit;
if(textbox != WIDGET_CURRENT) exit;
#region #region
dialog_x = clamp(dialog_x, 0, WIN_W - dialog_w - 1); dialog_x = clamp(dialog_x, 0, WIN_W - dialog_w - 1);

View file

@ -1,6 +1,7 @@
/// @description /// @description
if(!active) exit; if(!active) exit;
if(textbox == noone) exit; if(textbox == noone) exit;
if(textbox != WIDGET_CURRENT) exit;
#region #region
draw_set_text(f_code, fa_left, fa_top, COLORS._main_text); draw_set_text(f_code, fa_left, fa_top, COLORS._main_text);

View file

@ -299,5 +299,5 @@
#endregion #endregion
#region debug #region debug
instance_create_depth(0, 0, 0, addon_key_displayer); //instance_create_depth(0, 0, 0, addon_key_displayer);
#endregion #endregion

View file

@ -380,9 +380,9 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
render(_time); render(_time);
} }
static step = function() {} static onStep = function() {}
static inspectorStep = function() { static step = function() {
var _inSurf = inputs[| 0].getValue(); var _inSurf = inputs[| 0].getValue();
var _dist = inputs[| 4].getValue(); var _dist = inputs[| 4].getValue();
var _scatt = inputs[| 24].getValue(); var _scatt = inputs[| 24].getValue();
@ -404,6 +404,8 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
inputs[| 26].setVisible(true); inputs[| 26].setVisible(true);
} }
} }
onStep();
} }
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {

View file

@ -92,10 +92,10 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER; globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER;
VERSION = 11472; VERSION = 11481;
SAVE_VERSION = 11470; SAVE_VERSION = 11480;
VERSION_STRING = "1.15rc1"; VERSION_STRING = "1.15rc1";
BUILD_NUMBER = 11472; BUILD_NUMBER = 11481;
globalvar APPEND_MAP; globalvar APPEND_MAP;
APPEND_MAP = ds_map_create(); APPEND_MAP = ds_map_create();

View file

@ -42,7 +42,7 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _
PROJECT.animator.setFrame(-1); PROJECT.animator.setFrame(-1);
} }
static step = function() { static onStep = function() {
var _dim = inputs[| input_len + 0].getValue(); var _dim = inputs[| input_len + 0].getValue();
var _outSurf = outputs[| 0].getValue(); var _outSurf = outputs[| 0].getValue();

View file

@ -594,7 +594,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
ind++; ind++;
} }
var anchor_hover = -1; var anchor_hover = -1;
var hover_type = 0; var hover_type = 0;
@ -957,10 +957,17 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
var _rat = inputs[| 0].getValue(); var _rat = inputs[| 0].getValue();
var _typ = inputs[| 2].getValue(); var _typ = inputs[| 2].getValue();
var _rnd = inputs[| 3].getValue();
var anchors = []; var anchors = [];
for(var i = input_fix_len; i < ds_list_size(inputs); i++) for(var i = input_fix_len; i < ds_list_size(inputs); i++) {
array_push(anchors, inputs[| i].getValue()); var _anc = inputs[| i].getValue();
if(_rnd) {
_anc[0] = round(_anc[0]);
_anc[1] = round(_anc[2]);
}
array_push(anchors, _anc);
}
outputs[| 2].setValue(anchors); outputs[| 2].setValue(anchors);
if(is_array(_rat)) { if(is_array(_rat)) {

View file

@ -3,6 +3,8 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr
previewable = false; previewable = false;
w = 96; w = 96;
length = 0;
lengthAcc = [];
inputs[| 0] = nodeValue("Point array", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, []) inputs[| 0] = nodeValue("Point array", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [])
.setVisible(true, true) .setVisible(true, true)
@ -12,6 +14,33 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr
outputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.output, VALUE_TYPE.pathnode, self); outputs[| 0] = nodeValue("Path", self, JUNCTION_CONNECT.output, VALUE_TYPE.pathnode, self);
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
var _lines = inputs[| 0].getValue();
var _conn = inputs[| 1].getValue();
draw_set_color(COLORS._main_accent);
if(_conn) {
for( var i = 1, n = array_length(_lines); i < n; i++ ) {
var p0 = _lines[i - 1];
var p1 = _lines[i - 0];
draw_line(_x + p0[0] * _s, _y + p0[1] * _s,
_x + p1[0] * _s, _y + p1[1] * _s);
}
} else {
var len = floor(array_length(_lines) / 2) * 2;
for( var i = 0; i < len; i += 2 ) {
var p0 = _lines[i + 0];
var p1 = _lines[i + 1];
draw_line(_x + p0[0] * _s, _y + p0[1] * _s,
_x + p1[0] * _s, _y + p1[1] * _s);
}
}
}
static getLineCount = function() { static getLineCount = function() {
var _lines = inputs[| 0].getValue(); var _lines = inputs[| 0].getValue();
var _conn = inputs[| 1].getValue(); var _conn = inputs[| 1].getValue();
@ -19,6 +48,17 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr
return _conn? 1 : floor(array_length(_lines) / 2); return _conn? 1 : floor(array_length(_lines) / 2);
} }
static getSegmentCount = function() {
var _lines = inputs[| 0].getValue();
var _conn = inputs[| 1].getValue();
return _conn? array_length(_lines) - 1 : 1;
}
static getLength = function(index) { return is_array(length)? array_safe_get(length, index) : length; }
static getAccuLength = function(index) { return array_safe_get(lengthAcc, index, []); }
static getBoundary = function() { static getBoundary = function() {
var boundary = new BoundingBox(); var boundary = new BoundingBox();
var _lines = inputs[| 0].getValue(); var _lines = inputs[| 0].getValue();
@ -60,10 +100,47 @@ function Node_Path_Builder(_x, _y, _group = noone) : Node(_x, _y, _group) constr
} }
} }
static getPointDistance = function(_dist, ind = 0) {
var _conn = inputs[| 1].getValue();
if(_conn) return getPointRatio(_dist / length);
else return getPointRatio(_dist / length[ind], ind);
}
function update() { function update() {
var _lines = inputs[| 0].getValue(); var _lines = inputs[| 0].getValue();
var _conn = inputs[| 1].getValue(); var _conn = inputs[| 1].getValue();
if(_conn) {
length = 0;
lengthAcc = [];
for( var i = 1, n = array_length(_lines); i < n; i++ ) {
var p0 = _lines[i - 1];
var p1 = _lines[i - 0];
var dist = point_distance(p0[0], p0[1], p1[0], p1[1]);
length += dist;
array_push(lengthAcc, length);
}
} else {
length = [];
lengthAcc = [];
var len = floor(array_length(_lines) / 2) * 2;
for( var i = 0; i < len; i += 2 ) {
var p0 = _lines[i + 0];
var p1 = _lines[i + 1];
var dist = point_distance(p0[0], p0[1], p1[0], p1[1]);
array_push(length, dist);
array_push(lengthAcc, [ dist ]);
}
}
outputs[| 0].setValue(self); outputs[| 0].setValue(self);
} }

View file

@ -61,7 +61,7 @@ function Node_Path_Shift(_x, _y, _group = noone) : Node(_x, _y, _group) construc
} }
static getPointDistance = function(_dist, ind = 0) { static getPointDistance = function(_dist, ind = 0) {
return getPointRatio(_rat * getLength()); return getPointRatio(_dist / getLength(), ind);
} }
function update() { function update() {