Pixel-Composer/objects/o_dialog_add_node/Create_0.gml

517 lines
15 KiB
Plaintext
Raw Normal View History

2022-01-13 05:24:03 +01:00
/// @description init
event_inherited();
#region data
draggable = false;
node_target_x = 0;
node_target_y = 0;
node_called = noone;
junction_hovering = noone;
2022-01-13 05:24:03 +01:00
2022-11-03 11:44:49 +01:00
if(ADD_NODE_W == -1 || ADD_NODE_H == -1) {
ADD_NODE_W = ui(532);
2022-12-16 09:18:09 +01:00
ADD_NODE_H = ui(400);
2022-11-03 11:44:49 +01:00
}
2022-01-13 05:24:03 +01:00
dialog_w = ADD_NODE_W;
dialog_h = ADD_NODE_H;
destroy_on_click_out = true;
2022-01-18 05:31:19 +01:00
node_selecting = 0;
node_focusing = -1;
2022-01-13 05:24:03 +01:00
anchor = ANCHOR.left | ANCHOR.top;
2022-12-16 09:18:09 +01:00
function setPage(pageIndex) {
ADD_NODE_PAGE = pageIndex;
node_list = NODE_CATEGORY[| ADD_NODE_PAGE].list;
}
setPage(ADD_NODE_PAGE);
2022-01-13 05:24:03 +01:00
function buildNode(_node, _param = "") {
2022-01-13 05:24:03 +01:00
instance_destroy();
if(!_node) return;
2022-09-21 06:09:40 +02:00
var _new_node = noone;
2022-01-25 10:58:11 +01:00
var _inputs = 0, _outputs = 0;
2022-09-21 06:09:40 +02:00
2022-01-25 10:58:11 +01:00
if(is_struct(_node) && instanceof(_node) == "NodeObject") {
2022-12-16 09:18:09 +01:00
_new_node = _node.build(node_target_x, node_target_y,, _param);
2022-01-25 10:58:11 +01:00
if(!_new_node) return;
_inputs = _new_node.inputs;
_outputs = _new_node.outputs;
} else {
var _new_list = APPEND(_node.path);
_inputs = ds_list_create();
_outputs = ds_list_create();
for( var i = 0; i < ds_list_size(_new_list); i++ ) {
var _in = _new_list[| i].inputs;
for( var j = 0; j < ds_list_size(_in); j++ ) {
if(_in[| j].value_from == noone)
ds_list_add(_inputs, _in[| j]);
}
var _ot = _new_list[| i].outputs;
for( var j = 0; j < ds_list_size(_ot); j++ ) {
if(ds_list_empty(_ot[| j].value_to))
ds_list_add(_outputs, _ot[| j]);
}
}
ds_list_destroy(_new_list);
}
2022-01-13 05:24:03 +01:00
2022-01-25 10:58:11 +01:00
if(node_called != noone) {
var _node_list = node_called.connect_type == JUNCTION_CONNECT.input? _outputs : _inputs;
for(var i = 0; i < ds_list_size(_node_list); i++) {
var _target = _node_list[| i];
if( _target.isVisible() && (value_bit(_target.type) & value_bit(node_called.type)) ) {
if(node_called.connect_type == JUNCTION_CONNECT.input) {
node_called.setFrom(_node_list[| i]);
_new_node.x -= _new_node.w;
} else
_node_list[| i].setFrom(node_called);
break;
}
2022-01-25 10:58:11 +01:00
}
} else if(junction_hovering != noone) {
var to = junction_hovering;
var from = junction_hovering.value_from;
2022-01-25 10:58:11 +01:00
for( var i = 0; i < ds_list_size(_inputs); i++ ) {
var _in = _inputs[| i];
if(value_bit(_in.type) & value_bit(from.type)) {
_in.setFrom(from);
break;
}
2022-01-25 10:58:11 +01:00
}
2022-01-25 10:58:11 +01:00
for( var i = 0; i < ds_list_size(_outputs); i++ ) {
var _ot = _outputs[| i];
if(value_bit(_ot.type) & value_bit(to.type)) {
to.setFrom(_ot);
break;
2022-01-13 05:24:03 +01:00
}
}
}
}
2022-11-03 11:44:49 +01:00
catagory_pane = new scrollPane(ui(132), dialog_h - ui(66), function(_y, _m) {
2022-11-18 03:20:31 +01:00
draw_clear_alpha(COLORS.panel_bg_clear, 0);
2022-01-13 05:24:03 +01:00
var hh = 0;
2022-11-03 11:44:49 +01:00
var hg = ui(28);
2022-01-23 04:08:16 +01:00
var cnt = PANEL_GRAPH.getCurrentContext();
var context = cnt == -1? "" : instanceof(cnt);
2022-01-13 05:24:03 +01:00
2022-12-16 09:18:09 +01:00
for(var i = 0; i < ds_list_size(NODE_CATEGORY); i++) {
var cat = NODE_CATEGORY[| i];
var name = cat.name;
2022-11-18 03:20:31 +01:00
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
2022-01-23 04:08:16 +01:00
2022-12-16 09:18:09 +01:00
if(cat.filter != "") {
if(context != cat.filter) {
if(ADD_NODE_PAGE == i) setPage(NODE_PAGE_DEFAULT);
continue;
}
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text_accent);
2022-01-23 04:08:16 +01:00
}
2022-12-16 09:18:09 +01:00
if(i == ADD_NODE_PAGE) {
2022-11-18 03:20:31 +01:00
draw_sprite_stretched(THEME.ui_panel_bg, 0, 0, _y + hh, ui(132), hg);
2022-12-19 13:35:30 +01:00
} else if(sHOVER && catagory_pane.hover && point_in_rectangle(_m[0], _m[1], 0, _y + hh, ui(100), _y + hh + hg - 1)) {
2022-12-16 09:18:09 +01:00
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _y + hh, ui(132), hg, c_white, 0.75);
2022-12-10 05:06:01 +01:00
if(mouse_click(mb_left, sFOCUS)) {
2022-12-16 09:18:09 +01:00
setPage(i);
2022-01-13 05:24:03 +01:00
content_pane.scroll_y = 0;
content_pane.scroll_y_to = 0;
}
}
2022-12-16 09:18:09 +01:00
draw_text(ui(8), _y + hh + hg / 2, name);
2022-01-13 05:24:03 +01:00
hh += hg;
}
return hh;
});
2022-12-16 09:18:09 +01:00
content_pane = new scrollPane(dialog_w - ui(136), dialog_h - ui(66), function(_y, _m) {
2022-09-21 06:09:40 +02:00
draw_clear_alpha(c_white, 0);
2022-01-13 05:24:03 +01:00
2022-12-16 09:18:09 +01:00
var node_count = ds_list_size(node_list);
2022-12-19 13:35:30 +01:00
var hh = 0;
var _hover = sHOVER && content_pane.hover;
2022-01-13 05:24:03 +01:00
2023-01-09 03:14:20 +01:00
if(PREF_MAP[? "dialog_add_node_view"] == 0) {
2022-11-03 11:44:49 +01:00
var grid_size = ui(64);
var grid_width = ui(80);
var grid_space = ui(12);
2022-09-21 06:09:40 +02:00
var col = floor(content_pane.surface_w / (grid_width + grid_space));
var row = ceil(node_count / col);
var yy = _y + grid_space;
2023-01-01 02:06:02 +01:00
var curr_height = 0;
var cProg = 0;
2022-09-21 06:09:40 +02:00
hh += grid_space;
2023-01-01 02:06:02 +01:00
for(var index = 0; index < node_count; index++) {
var _node = node_list[| index];
if(is_string(_node)) {
2023-01-09 03:14:20 +01:00
if(!PREF_MAP[? "dialog_add_node_grouping"])
continue;
2023-01-01 02:06:02 +01:00
hh += curr_height;
yy += curr_height;
2022-01-13 05:24:03 +01:00
2023-01-01 02:06:02 +01:00
cProg = 0;
curr_height = 0;
BLEND_OVER
draw_sprite_stretched_ext(THEME.node_bg, 0, ui(16), yy, content_pane.surface_w - ui(32), ui(24), COLORS._main_icon, 1);
BLEND_NORMAL
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
draw_text(ui(16 + 16), yy + ui(12), _node);
hh += ui(24 + 12);
yy += ui(24 + 12);
continue;
}
var _nx = grid_space + (grid_width + grid_space) * cProg;
var _boxx = _nx + (grid_width - grid_size) / 2;
BLEND_OVER
draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size);
BLEND_NORMAL
2022-09-21 06:09:40 +02:00
2023-01-01 02:06:02 +01:00
if(_hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
draw_sprite_stretched_ext(THEME.node_active, 0, _boxx, yy, grid_size, grid_size, COLORS._main_accent, 1);
if(mouse_press(mb_left, sFOCUS))
buildNode(_node);
}
2022-09-21 06:09:40 +02:00
2023-01-01 02:06:02 +01:00
var spr_x = _boxx + grid_size / 2;
var spr_y = yy + grid_size / 2;
if(variable_struct_exists(_node, "spr") && sprite_exists(_node.spr))
draw_sprite_ui_uniform(_node.spr, 0, spr_x, spr_y);
2022-12-27 04:00:50 +01:00
2023-01-01 02:06:02 +01:00
if(_node.new_node)
draw_sprite_ui_uniform(THEME.node_new_badge, 0, _boxx + grid_size - ui(12), yy + ui(6));
2022-12-27 04:00:50 +01:00
2023-01-01 02:06:02 +01:00
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text);
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + 4, _node.name, -1, grid_width);
var name_height = string_height_ext(_node.name, -1, grid_width) + 8;
curr_height = max(curr_height, grid_size + grid_space + name_height);
if(++cProg >= col) {
hh += curr_height;
yy += curr_height;
cProg = 0;
curr_height = 0;
2022-09-21 06:09:40 +02:00
}
2023-01-01 02:06:02 +01:00
}
hh += curr_height;
yy += curr_height;
2023-01-09 03:14:20 +01:00
} else if(PREF_MAP[? "dialog_add_node_view"] == 1) {
2022-09-21 06:09:40 +02:00
var list_width = content_pane.surface_w;
2022-11-03 11:44:49 +01:00
var list_height = ui(28);
2022-09-21 06:09:40 +02:00
var yy = _y + list_height / 2;
hh += list_height;
for(var i = 0; i < node_count; i++) {
2022-12-16 09:18:09 +01:00
var _node = node_list[| i];
2023-01-01 02:06:02 +01:00
if(is_string(_node)) {
2023-01-09 03:14:20 +01:00
if(!PREF_MAP[? "dialog_add_node_grouping"])
continue;
2023-01-01 02:06:02 +01:00
hh += ui(8);
yy += ui(8);
BLEND_OVER
draw_sprite_stretched_ext(THEME.node_bg, 0, ui(8), yy, content_pane.surface_w - ui(24), ui(24), COLORS._main_icon, 1);
BLEND_NORMAL
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
draw_text(ui(24), yy + ui(12), _node);
hh += ui(32);
yy += ui(32);
continue;
}
2022-09-21 06:09:40 +02:00
if(i % 2) {
2022-12-27 04:00:50 +01:00
BLEND_OVER
2022-11-18 03:20:31 +01:00
draw_sprite_stretched_ext(THEME.node_bg, 0, ui(4), yy, list_width - ui(8), list_height, c_white, 0.2);
2022-09-21 06:09:40 +02:00
BLEND_NORMAL
}
2022-12-19 13:35:30 +01:00
if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, list_width, yy + list_height - 1)) {
2022-11-21 06:38:44 +01:00
draw_sprite_stretched_ext(THEME.node_active, 0, ui(4), yy, list_width - ui(8), list_height, COLORS._main_accent, 1);
2022-12-10 05:06:01 +01:00
if(mouse_press(mb_left, sFOCUS))
2022-09-21 06:09:40 +02:00
buildNode(_node);
}
2022-12-27 04:00:50 +01:00
2022-11-03 11:44:49 +01:00
var spr_x = list_height / 2 + ui(14);
2022-09-21 06:09:40 +02:00
var spr_y = yy + list_height / 2;
if(variable_struct_exists(_node, "spr") && sprite_exists(_node.spr)) {
2022-11-03 11:44:49 +01:00
var ss = (list_height - ui(8)) / max(sprite_get_width(_node.spr), sprite_get_height(_node.spr));
2022-09-21 06:09:40 +02:00
draw_sprite_ext(_node.spr, 0, spr_x, spr_y, ss, ss, 0, c_white, 1);
2022-01-13 05:24:03 +01:00
}
2022-09-21 06:09:40 +02:00
2022-12-27 04:00:50 +01:00
var tx = list_height + ui(20);
if(_node.new_node) {
draw_sprite_ui_uniform(THEME.node_new_badge, 0, tx + ui(16), yy + list_height / 2 + ui(1));
tx += ui(40);
}
2022-11-18 03:20:31 +01:00
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text);
2022-12-27 04:00:50 +01:00
draw_text_add(tx, yy + list_height / 2, _node.name);
2022-09-21 06:09:40 +02:00
yy += list_height;
hh += list_height;
2022-01-13 05:24:03 +01:00
}
}
2022-09-21 06:09:40 +02:00
2022-01-13 05:24:03 +01:00
return hh;
});
#endregion
#region resize
dialog_resizable = true;
2022-11-03 11:44:49 +01:00
dialog_w_min = ui(200);
dialog_h_min = ui(120);
2022-12-16 09:18:09 +01:00
dialog_w_max = ui(960);
dialog_h_max = ui(800);
2022-01-13 05:24:03 +01:00
onResize = function() {
2022-11-03 11:44:49 +01:00
catagory_pane.resize(ui(132), dialog_h - ui(66));
2022-12-16 09:18:09 +01:00
content_pane.resize(dialog_w - ui(136), dialog_h - ui(66));
search_pane.resize(dialog_w - ui(32), dialog_h - ui(66));
2022-01-13 05:24:03 +01:00
ADD_NODE_W = dialog_w;
ADD_NODE_H = dialog_h;
}
#endregion
#region search
search_string = "";
2022-01-25 10:58:11 +01:00
search_list = ds_list_create();
2022-01-13 05:24:03 +01:00
keyboard_lastchar = "";
2022-12-12 09:08:03 +01:00
KEYBOARD_STRING = "";
2022-01-13 05:24:03 +01:00
keyboard_lastkey = -1;
2022-09-21 06:09:40 +02:00
tb_search = new textBox(TEXTBOX_INPUT.text, function(str) {
2022-01-25 10:58:11 +01:00
search_string = string(str);
searchNodes();
});
2022-01-13 05:24:03 +01:00
tb_search.auto_update = true;
TEXTBOX_ACTIVE = tb_search;
2022-01-25 10:58:11 +01:00
function searchNodes() {
ds_list_clear(search_list);
2022-01-13 05:24:03 +01:00
2022-01-23 04:08:16 +01:00
var cnt = PANEL_GRAPH.getCurrentContext();
var context = cnt == -1? "" : instanceof(cnt);
2022-01-13 05:24:03 +01:00
var search_lower = string_lower(search_string);
2022-12-27 04:00:50 +01:00
var search_map = ds_map_create();
2022-01-18 05:31:19 +01:00
2022-12-16 09:18:09 +01:00
for(var i = 0; i < ds_list_size(NODE_CATEGORY); i++) {
var cat = NODE_CATEGORY[| i];
2022-01-23 04:08:16 +01:00
2022-12-16 09:18:09 +01:00
if(cat.filter != "" && context != cat.filter)
continue;
2022-01-13 05:24:03 +01:00
2022-12-16 09:18:09 +01:00
var _content = cat.list;
for(var j = 0; j < ds_list_size(_content); j++) {
var _node = _content[| j];
2022-01-13 05:24:03 +01:00
2023-01-01 02:06:02 +01:00
if(is_string(_node)) continue;
2022-12-27 04:00:50 +01:00
if(ds_map_exists(search_map, _node.node)) continue;
2022-01-13 05:24:03 +01:00
var match = string_pos(search_lower, string_lower(_node.name)) > 0;
var param = "";
2022-01-13 05:24:03 +01:00
for( var k = 0; k < array_length(_node.tags); k++ ) {
2022-12-27 04:00:50 +01:00
if(string_pos(search_lower, _node.tags[k]) == 0)
continue;
match = true;
param = _node.tags[k];
2022-01-13 05:24:03 +01:00
}
2022-12-27 04:00:50 +01:00
if(!match) continue;
ds_list_add(search_list, [_node, param]);
search_map[? _node.node] = 1;
2022-01-25 10:58:11 +01:00
}
}
2022-12-27 04:00:50 +01:00
ds_map_destroy(search_map);
2022-01-25 10:58:11 +01:00
searchCollection(search_list, search_string, false);
}
2022-12-16 09:18:09 +01:00
search_pane = new scrollPane(dialog_w - ui(32), dialog_h - ui(66), function(_y, _m) {
2022-09-21 06:09:40 +02:00
draw_clear_alpha(c_white, 0);
2022-01-25 10:58:11 +01:00
var amo = ds_list_size(search_list);
2022-09-21 06:09:40 +02:00
var hh = 0;
2022-12-19 13:35:30 +01:00
var _hover = sHOVER && search_pane.hover;
2022-01-25 10:58:11 +01:00
2023-01-09 03:14:20 +01:00
if(PREF_MAP[? "dialog_add_node_view"] == 0) {
2022-11-03 11:44:49 +01:00
var grid_size = ui(64);
var grid_width = ui(80);
var grid_space = ui(16);
2022-09-21 06:09:40 +02:00
var col = floor(search_pane.surface_w / (grid_width + grid_space));
var yy = _y + grid_space;
var index = 0;
var name_height = 0;
hh += (grid_space + grid_size) * 2;
2022-01-25 10:58:11 +01:00
2022-09-21 06:09:40 +02:00
for(var i = 0; i < amo; i++) {
var s_res = search_list[| i];
var _node = noone, _param = "";
if(is_array(s_res)) {
_node = s_res[0];
_param = s_res[1];
} else
_node = s_res;
2022-01-25 10:58:11 +01:00
2022-09-21 06:09:40 +02:00
var _nx = grid_space + (grid_width + grid_space) * index;
var _boxx = _nx + (grid_width - grid_size) / 2;
2022-12-27 04:00:50 +01:00
BLEND_OVER
2022-09-21 06:09:40 +02:00
if(is_array(s_res))
2022-11-18 03:20:31 +01:00
draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size);
2022-09-21 06:09:40 +02:00
else
2022-11-18 03:20:31 +01:00
draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS.dialog_add_node_collection, 1);
2022-09-21 06:09:40 +02:00
BLEND_NORMAL
2022-01-13 05:24:03 +01:00
2022-09-21 06:09:40 +02:00
if(variable_struct_exists(_node, "spr") && sprite_exists(_node.spr)) {
var _si = current_time * PREF_MAP[? "collection_preview_speed"] / 3000;
var _sw = sprite_get_width(_node.spr);
var _sh = sprite_get_height(_node.spr);
2022-11-03 11:44:49 +01:00
var _ss = ui(32) / max(_sw, _sh);
2022-01-13 05:24:03 +01:00
2022-09-21 06:09:40 +02:00
var _sox = sprite_get_xoffset(_node.spr);
var _soy = sprite_get_yoffset(_node.spr);
2022-01-29 14:25:18 +01:00
2022-09-21 06:09:40 +02:00
var _sx = _boxx + grid_size / 2;
var _sy = yy + grid_size / 2;
_sx += _sw * _ss / 2 - _sox * _ss;
_sy += _sh * _ss / 2 - _soy * _ss;
2022-01-29 14:25:18 +01:00
2022-09-21 06:09:40 +02:00
draw_sprite_ext(_node.spr, _si, _sx, _sy, _ss, _ss, 0, c_white, 1);
}
2022-12-27 04:00:50 +01:00
2022-11-18 03:20:31 +01:00
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text);
2022-09-21 06:09:40 +02:00
var txt = _node.name;
2022-11-03 11:44:49 +01:00
name_height = max(name_height, string_height_ext(txt, -1, grid_width) + ui(8));
2022-12-19 13:35:30 +01:00
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + 4, txt, -1, grid_width);
2022-01-13 05:24:03 +01:00
2022-12-19 13:35:30 +01:00
if(_hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
2022-09-21 06:09:40 +02:00
node_selecting = i;
2022-12-10 05:06:01 +01:00
if(mouse_press(mb_left, sFOCUS))
2022-09-21 06:09:40 +02:00
buildNode(_node, _param);
}
if(node_selecting == i) {
2022-11-21 06:38:44 +01:00
draw_sprite_stretched_ext(THEME.node_active, 0, _boxx, yy, grid_size, grid_size, COLORS._main_accent, 1);
2022-09-21 06:09:40 +02:00
if(keyboard_check_pressed(vk_enter))
buildNode(_node, _param);
}
2022-01-18 05:31:19 +01:00
2022-09-21 06:09:40 +02:00
if(node_focusing == i)
search_pane.scroll_y_to = -max(0, hh - search_pane.h);
2022-01-18 05:31:19 +01:00
2022-09-21 06:09:40 +02:00
if(++index >= col) {
index = 0;
var hght = grid_size + grid_space + name_height;
name_height = 0;
hh += hght;
yy += hght;
}
2022-01-25 10:58:11 +01:00
}
2023-01-09 03:14:20 +01:00
} else if(PREF_MAP[? "dialog_add_node_view"] == 1) {
2022-09-21 06:09:40 +02:00
var list_width = search_pane.surface_w;
2022-11-03 11:44:49 +01:00
var list_height = ui(28);
2022-09-21 06:09:40 +02:00
var yy = _y + list_height / 2;
hh += list_height;
for(var i = 0; i < amo; i++) {
var s_res = search_list[| i];
var _node = noone, _param = "";
if(is_array(s_res)) {
_node = s_res[0];
_param = s_res[1];
} else
_node = s_res;
if(i % 2) {
2022-12-27 04:00:50 +01:00
BLEND_OVER
2022-11-18 03:20:31 +01:00
draw_sprite_stretched_ext(THEME.node_bg, 0, ui(4), yy, list_width - ui(8), list_height, c_white, 0.2);
2022-09-21 06:09:40 +02:00
BLEND_NORMAL
}
if(variable_struct_exists(_node, "spr") && sprite_exists(_node.spr)) {
var _si = current_time * PREF_MAP[? "collection_preview_speed"] / 3000;
var _sw = sprite_get_width(_node.spr);
var _sh = sprite_get_height(_node.spr);
2022-11-03 11:44:49 +01:00
var _ss = (list_height - ui(8)) / max(_sw, _sh);
2022-09-21 06:09:40 +02:00
var _sox = sprite_get_xoffset(_node.spr);
var _soy = sprite_get_yoffset(_node.spr);
2022-01-18 05:31:19 +01:00
2022-11-03 11:44:49 +01:00
var _sx = list_height / 2 + ui(14);
2022-09-21 06:09:40 +02:00
var _sy = yy + list_height / 2;
_sx += _sw * _ss / 2 - _sox * _ss;
_sy += _sh * _ss / 2 - _soy * _ss;
draw_sprite_ext(_node.spr, _si, _sx, _sy, _ss, _ss, 0, c_white, 1);
}
2022-11-18 03:20:31 +01:00
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text);
2022-12-19 13:35:30 +01:00
draw_text_add(list_height + ui(20), yy + list_height / 2, _node.name);
2022-09-21 06:09:40 +02:00
2022-12-19 13:35:30 +01:00
if(_hover && point_in_rectangle(_m[0], _m[1], 0, yy, list_width, yy + list_height - 1)) {
2022-09-21 06:09:40 +02:00
node_selecting = i;
2022-12-10 05:06:01 +01:00
if(mouse_press(mb_left, sFOCUS))
2022-09-21 06:09:40 +02:00
buildNode(_node, _param);
}
if(node_selecting == i) {
2022-11-21 06:38:44 +01:00
draw_sprite_stretched_ext(THEME.node_active, 0, ui(4), yy, list_width - ui(8), list_height, COLORS._main_accent, 1);
2022-09-21 06:09:40 +02:00
if(keyboard_check_pressed(vk_enter))
buildNode(_node, _param);
}
if(node_focusing == i)
search_pane.scroll_y_to = -max(0, hh - search_pane.h);
hh += list_height;
yy += list_height;
2022-01-13 05:24:03 +01:00
}
}
2022-01-18 05:31:19 +01:00
node_focusing = -1;
if(keyboard_check_pressed(vk_up)) {
node_selecting = safe_mod(node_selecting - 1 + amo, amo);
node_focusing = node_selecting;
}
if(keyboard_check_pressed(vk_down)) {
node_selecting = safe_mod(node_selecting + 1, amo);
node_focusing = node_selecting;
}
2022-01-13 05:24:03 +01:00
return hh;
});
#endregion