1.14 update

This commit is contained in:
Tanasart 2023-04-14 12:23:25 +02:00
parent 6c3247a8b0
commit 4f1dbc7f8f
12 changed files with 1111 additions and 1042 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -38,5 +38,5 @@
"path": "sprites/s_fx_pixel/s_fx_pixel.yy",
},
"spriteMaskId": null,
"visible": true,
"visible": false,
}

View file

@ -40,12 +40,13 @@ function __LOAD_PATH(path, readonly = false, safe_mode = false) {
}
LOADING = true;
nodeCleanUp();
clearPanel();
setPanel();
instance_destroy(_p_dialog);
//room_restart();
ds_list_clear(ERRORS);
var temp_path = DIRECTORY + "\_temp";
if(file_exists(temp_path)) file_delete(temp_path);

View file

@ -148,7 +148,7 @@ function Node_9Slice(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
draw_surface_part_ext_safe(_inSurf, 0, sp_t, sp_l, ch, 0, sp_t, 1, sh, 0, c_white, 1);
draw_surface_part_ext_safe(_inSurf, in_w - sp_r, sp_t, sp_r, ch, ww - sp_r, sp_t, 1, sh, 0, c_white, 1);
draw_surface_part_ext_safe(_inSurf, sp_l, sp_t, cw, ch, sp_l, sp_t, sw, sh, c_white, 1);
draw_surface_part_ext_safe(_inSurf, sp_l, sp_t, cw, ch, sp_l, sp_t, sw, sh, 0, c_white, 1);
} else if(_fill == 1) {
var _cw_max = ww - sp_r;
var _ch_max = hh - sp_b;

View file

@ -1343,6 +1343,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
for( var i = 0; i < array_length(temp_surface); i++ )
surface_free(temp_surface[i]);
onCleanUp();
}
static onCleanUp = function() {}

View file

@ -31,20 +31,20 @@ function Node_Fluid_Render(_x, _y, _group = noone) : Node_Fluid(_x, _y, _group)
static onInspector2Update = function() { clearCache(); }
static update = function(frame = ANIMATOR.current_frame) {
var _dim = inputs[| 1].getValue(frame);
var _outSurf = outputs[| 0].getValue();
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
outputs[| 0].setValue(_outSurf);
if(recoverCache() || !ANIMATOR.is_playing)
return;
var _dom = inputs[| 0].getValue(frame);
var _dim = inputs[| 1].getValue(frame);
var _int = inputs[| 2].getValue(frame);
var _drw = inputs[| 3].getValue(frame);
if(_dom == noone || !instance_exists(_dom)) return;
var _outSurf = outputs[| 0].getValue();
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
outputs[| 0].setValue(_outSurf);
var fSurf = _dom.sf_material_0;
if(!is_surface(fSurf)) return;
outputs[| 1].setValue(_dom.sf_world);

View file

@ -334,10 +334,16 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
if(_cap) {
if(j == 1){
draw_set_color(_oc);
draw_circle_angle(_ox, _oy, _ow / 2, _d + 180 - 90, _d + 180 + 90, _capP);
draw_set_color(c_white);
_d = point_direction(_ox, _oy, _nx, _ny);
draw_circle_angle(_ox, _oy, _ow / 2, _d - 90, _d + 90, _capP);
}
if(j == array_length(points) - 1) {
draw_set_color(_nc);
draw_set_color(c_black);
_d = point_direction(_ox, _oy, _nx, _ny);
draw_circle_angle(_nx, _ny, _nw / 2, _d - 90, _d + 90, _capP);
}
}

View file

@ -2,7 +2,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
name = "Object";
color = COLORS.node_blend_simulation;
icon = THEME.rigidSim;
update_on_frame = true;
//update_on_frame = true;
w = 96;
min_h = 96;
@ -509,7 +509,8 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
if(is_array(_tex)) {
index = safe_mod(index, array_length(_tex));
_tex = _tex[index];
}
} else
index = 0;
var _spos = inputs[| 7].getValue();
@ -529,7 +530,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
physics_remove_fixture(object, object.fixture[i]);
object.fixture = [];
} else
return;
return noone;
if(_shp == 0) {
var fixture = physics_fixture_create();
@ -540,7 +541,11 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr
physics_fixture_set_circle_shape(fixture, min(_spos[2], _spos[3]));
fixtureCreate(fixture, object);
} else if(_shp == 2) {
var mesh = attributes[? "mesh"][index];
var meshes = attributes[? "mesh"];
if(array_safe_get(meshes, index, noone) == noone)
return noone;
var mesh = meshes[index];
var cx = 0, cy = 0;
var cmx = 0, cmy = 0;

View file

@ -30,9 +30,11 @@ function Node_Rigid_Object_Spawner(_x, _y, _group = noone) : Node(_x, _y, _group
inputs[| 6] = nodeValue("Spawn", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
.rejectArray();
inputs[| 7] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, irandom_range(10000, 99999))
outputs[| 0] = nodeValue("Object", self, JUNCTION_CONNECT.output, VALUE_TYPE.rigid, self);
input_display_list = [ 0,
input_display_list = [ 0, 7,
["Spawn", false], 6, 1, 2, 3, 5, 4,
];
@ -54,16 +56,16 @@ function Node_Rigid_Object_Spawner(_x, _y, _group = noone) : Node(_x, _y, _group
inputs[| 5].setVisible(_typ == 1);
}
static spawn = function() {
static spawn = function(seed = 0) {
var _obj = inputs[| 0].getValue();
var _are = inputs[| 1].getValue();
var _amo = inputs[| 4].getValue();
repeat(_amo) {
var pos = area_get_random_point(_are,,,,, irandom(9999));
var pos = area_get_random_point(_are,,,,, seed); seed += 10;
var _o = _obj;
if(is_array(_o))
_o = _o[irandom(array_length(_o) - 1)];
_o = _o[irandom_range_seed(0, array_length(_o) - 1, seed++)];
array_push(object, _o.spawn(pos, spawn_index++));
}
@ -75,17 +77,19 @@ function Node_Rigid_Object_Spawner(_x, _y, _group = noone) : Node(_x, _y, _group
var _obj = inputs[| 0].getValue();
if(_obj == noone) return;
var _spw = inputs[| 6].getValue();
if(!_spw) return;
var _typ = inputs[| 2].getValue();
var _del = inputs[| 3].getValue();
var _frm = inputs[| 5].getValue();
var _spw = inputs[| 6].getValue();
var _amo = inputs[| 4].getValue();
var _sed = inputs[| 7].getValue() + frame * _amo * 20;
if(_spw) {
if(_typ == 0 && (safe_mod(ANIMATOR.current_frame, _del) == 0))
spawn();
if(_typ == 1 && ANIMATOR.current_frame == _frm)
spawn();
}
if(_typ == 0 && (safe_mod(ANIMATOR.current_frame, _del) == 0))
spawn(_sed);
else if(_typ == 1 && ANIMATOR.current_frame == _frm)
spawn(_sed);
}
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {

View file

@ -1279,6 +1279,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
if(connect_type == JUNCTION_CONNECT.input)
node.onValueFromUpdate(index);
node.clearCacheForward();
return false;
}

View file

@ -1663,7 +1663,7 @@ function Panel_Animation() : PanelContent() constructor {
case 2 : txt = get_text("panel_animation_name_only", "Show node name"); break;
}
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.node_name_type) == 2)
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(24), [mx, my], pFOCUS, pHOVER, txt, THEME.node_name_type, node_name_type) == 2)
node_name_type = (node_name_type + 1) % 3;
}