This commit is contained in:
Tanasart 2024-07-13 08:18:17 +07:00
parent 167515e75b
commit 7113b41b1e
4 changed files with 57 additions and 47 deletions

Binary file not shown.

View File

@ -38,7 +38,7 @@
LATEST_VERSION = 11700; LATEST_VERSION = 11700;
VERSION = 11761; VERSION = 11761;
SAVE_VERSION = 11700; SAVE_VERSION = 11700;
VERSION_STRING = "1.17.7.006"; VERSION_STRING = "1.17.7.007";
BUILD_NUMBER = 11761; BUILD_NUMBER = 11761;
globalvar HOTKEYS, HOTKEY_CONTEXT; globalvar HOTKEYS, HOTKEY_CONTEXT;

View File

@ -79,7 +79,8 @@ function Node_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
_surf = _surf[preview_index]; _surf = _surf[preview_index];
} }
if(!is_surface(_surf)) return; var _ss = current_data[0];
if(!is_surface(_ss)) return;
var tl = array_clone(current_data[1]); var tl = array_clone(current_data[1]);
var tr = array_clone(current_data[2]); var tr = array_clone(current_data[2]);
@ -115,9 +116,9 @@ function Node_Warp(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
warpSurface( warp_surface[0], warp_surface[1], params.w, params.h, tl, tr, bl, br, true ); warpSurface( warp_surface[0], warp_surface[1], params.w, params.h, tl, tr, bl, br, true );
BLEND_ADD // BLEND_ADD
draw_surface_safe(warp_surface[0]); // draw_surface_safe(warp_surface[0]);
BLEND_NORMAL // BLEND_NORMAL
#endregion #endregion
draw_set_color(COLORS._main_accent); draw_set_color(COLORS._main_accent);

View File

@ -82,17 +82,8 @@
function panel_graph_paste() { CALL("graph_paste"); PANEL_GRAPH.doPaste(); } function panel_graph_paste() { CALL("graph_paste"); PANEL_GRAPH.doPaste(); }
function panel_graph_auto_align() { CALL("graph_auto_align"); node_auto_align(PANEL_GRAPH.nodes_selecting); } function panel_graph_auto_align() { CALL("graph_auto_align"); node_auto_align(PANEL_GRAPH.nodes_selecting); }
function panel_graph_search() { CALL("graph_search"); PANEL_GRAPH.toggleSearch(); }
function panel_graph_search() { function panel_graph_toggle_minimap() { CALL("graph_toggle_minimap"); PANEL_GRAPH.minimap_show = !PANEL_GRAPH.minimap_show; }
CALL("graph_search");
PANEL_GRAPH.is_searching = !PANEL_GRAPH.is_searching;
if(PANEL_GRAPH.is_searching) {
PANEL_GRAPH.search_string = "";
WIDGET_CURRENT = PANEL_GRAPH.tb_search;
KEYBOARD_RESET
}
}
function panel_graph_pan() { function panel_graph_pan() {
CALL("graph_pan"); CALL("graph_pan");
@ -428,12 +419,14 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
addHotkey("Graph", "Zoom", "", MOD_KEY.alt | MOD_KEY.ctrl, panel_graph_zoom); addHotkey("Graph", "Zoom", "", MOD_KEY.alt | MOD_KEY.ctrl, panel_graph_zoom);
addHotkey("Graph", "Auto Align", "L", MOD_KEY.none, panel_graph_auto_align); addHotkey("Graph", "Auto Align", "L", MOD_KEY.none, panel_graph_auto_align);
addHotkey("Graph", "Search", "F", MOD_KEY.shift, panel_graph_search); addHotkey("Graph", "Search", "F", MOD_KEY.shift, panel_graph_search);
addHotkey("Graph", "Toggle Minimap", "M", MOD_KEY.ctrl, panel_graph_toggle_minimap);
#endregion #endregion
#region ++++ toolbars ++++ #region ++++ toolbars ++++
tooltip_center = new tooltipHotkey(__txtx("panel_graph_center_to_nodes", "Center to nodes"), "Graph", "Focus content"); tooltip_center = new tooltipHotkey(__txtx("panel_graph_center_to_nodes", "Center to nodes"), "Graph", "Focus content");
tooltip_search = new tooltipHotkey(__txt("Search"), "Graph", "Search");
tooltip_minimap = new tooltipHotkey(__txtx("panel_graph_toggle_minimap", "Toggle minimap"), "Graph", "Toggle Minimap");
toolbars_general = [ toolbars_general = [
[ [
@ -441,6 +434,11 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
function() /*=>*/ {return 0}, function() /*=>*/ {return __txtx("panel_graph_export_image", "Export graph as image")}, function() /*=>*/ {return 0}, function() /*=>*/ {return __txtx("panel_graph_export_image", "Export graph as image")},
function(param) /*=>*/ { dialogPanelCall(new Panel_Graph_Export_Image(self)); } function(param) /*=>*/ { dialogPanelCall(new Panel_Graph_Export_Image(self)); }
], ],
[
THEME.search_24,
function() /*=>*/ {return 0}, function() /*=>*/ {return tooltip_search},
function(param) /*=>*/ { toggleSearch(); }
],
[ [
THEME.icon_center_canvas, THEME.icon_center_canvas,
function() /*=>*/ {return 0}, function() /*=>*/ {return tooltip_center}, function() /*=>*/ {return 0}, function() /*=>*/ {return tooltip_center},
@ -448,7 +446,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
], ],
[ [
THEME.icon_minimap, THEME.icon_minimap,
function() /*=>*/ {return minimap_show}, function() /*=>*/ {return minimap_show? __txtx("panel_graph_minimap_enabled", "Minimap enabled") : __txtx("panel_graph_minimap_disabled", "Minimap disabled")}, function() /*=>*/ {return minimap_show}, function() /*=>*/ {return tooltip_minimap},
function(param) /*=>*/ { minimap_show = !minimap_show; } function(param) /*=>*/ { minimap_show = !minimap_show; }
], ],
[ [
@ -2109,32 +2107,6 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
draw_sprite_ui(THEME.node_resize, 0, mx0 + ui(2), my0 + ui(2), 0.5, 0.5, 180, c_white, 0.3); draw_sprite_ui(THEME.node_resize, 0, mx0 + ui(2), my0 + ui(2), 0.5, 0.5, 180, c_white, 0.3);
} #endregion } #endregion
function searchNodes() {
nodes_selecting = [];
search_result = [];
search_index = 0;
if(search_string == "") return;
var _search = string_lower(search_string);
for(var i = 0; i < array_length(nodes_list); i++) {
var _nl = nodes_list[i];
var _name = string_lower(_nl.getDisplayName());
var _match = string_full_match(_name, _search);
_nl.search_match = _match;
if( _match == -9999) continue;
array_push(nodes_selecting, _nl);
array_push(search_result, _nl);
}
if(!array_empty(nodes_selecting))
toCenterNode(nodes_selecting);
}
function drawSearch() { function drawSearch() {
if(!is_searching) return; if(!is_searching) return;
@ -2241,6 +2213,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
var ovy = ui(8); var ovy = ui(8);
if(show_view_control == 2) ovy += ui(36); if(show_view_control == 2) ovy += ui(36);
// if(is_searching) ovy += line_get_height(f_p2, 20);
drawNodes(); drawNodes();
@ -2822,6 +2795,42 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
static onFullScreen = function() { run_in(1, fullView); } static onFullScreen = function() { run_in(1, fullView); }
function searchNodes() {
nodes_selecting = [];
search_result = [];
search_index = 0;
if(search_string == "") return;
var _search = string_lower(search_string);
for(var i = 0; i < array_length(nodes_list); i++) {
var _nl = nodes_list[i];
var _name = string_lower(_nl.getDisplayName());
var _match = string_full_match(_name, _search);
_nl.search_match = _match;
if( _match == -9999) continue;
array_push(nodes_selecting, _nl);
array_push(search_result, _nl);
}
if(!array_empty(nodes_selecting))
toCenterNode(nodes_selecting);
}
function toggleSearch() {
is_searching = !is_searching;
if(is_searching) {
search_string = "";
WIDGET_CURRENT = tb_search;
KEYBOARD_RESET
}
}
//// =========== Serialize =========== //// =========== Serialize ===========
static serialize = function() { static serialize = function() {