- Add preference option to disable mouse lock when sliding.

This commit is contained in:
Tanasart 2024-07-17 11:19:55 +07:00
parent c2c6305b5b
commit a0a02d7968
8 changed files with 349 additions and 467 deletions

View file

@ -12,8 +12,8 @@ event_inherited();
show_graph = false;
menu = [
menuItem("Toggle double click bar", function() { show_doubleclick = !show_doubleclick; }),
menuItem("Toggle graph", function() { show_graph = !show_graph; }),
menuItem("Toggle double click bar", function() /*=>*/ { show_doubleclick = !show_doubleclick; }),
menuItem("Toggle graph", function() /*=>*/ { show_graph = !show_graph; }),
];
extra_keys = [

View file

@ -43,8 +43,7 @@
nx = mlx + i;
ny = WIN_H - 4 - mouse_left[i] * 24;
if(i)
draw_line(ox, oy, nx, ny);
if(i) draw_line(ox, oy, nx, ny);
ox = nx;
oy = ny;
@ -58,15 +57,19 @@
nx = mlx + i;
ny = WIN_H - 64 - 4 - mouse_right[i] * 24;
if(i)
draw_line(ox, oy, nx, ny);
if(i) draw_line(ox, oy, nx, ny);
ox = nx;
oy = ny;
}
for( var i = 1, n = array_length(mouse_pos); i < n; i++ )
draw_line(mouse_pos[i - 1][0], mouse_pos[i - 1][1], mouse_pos[i][0], mouse_pos[i][1]);
// draw_set_color(PEN_USE? c_yellow : c_white);
// draw_set_alpha(0.75);
// BLEND_ADD
// for( var i = 1, n = array_length(mouse_pos); i < n; i++ )
// draw_line(mouse_pos[i - 1][0], mouse_pos[i - 1][1], mouse_pos[i][0], mouse_pos[i][1]);
// BLEND_NORMAL
// draw_set_alpha(1);
var mp = 0;
if(DOUBLE_CLICK) mp = 2;
@ -108,25 +111,21 @@
draw_sprite_stretched_ext(THEME.menu_button_mask, 0, dcx, dcy, _dcw, dch, COLORS._main_icon_light, 1.0);
}
draw_sprite_ext(s_key_display_mouse, 0, mxs, mys, 1, 1, 0, c_white, 0.5);
if(DOUBLE_CLICK)
draw_sprite_ext(s_key_display_mouse, 1, mxs, mys, 1, 1, 0, COLORS._main_value_positive, 1);
else if(mouse_click(mb_left))
draw_sprite_ext(s_key_display_mouse, 1, mxs, mys, 1, 1, 0, COLORS._main_icon_light, 1);
var cc = PEN_USE? COLORS._main_accent : c_white;
if(mouse_click(mb_right))
draw_sprite_ext(s_key_display_mouse, 2, mxs, mys, 1, 1, 0, COLORS._main_icon_light, 1);
if(DOUBLE_CLICK) draw_sprite_ext(s_key_display_mouse, 1, mxs, mys, 1, 1, 0, COLORS._main_value_positive, 1);
else if(mouse_click(mb_left)) draw_sprite_ext(s_key_display_mouse, 1, mxs, mys, 1, 1, 0, COLORS._main_icon_light, 1);
if(mouse_click(mb_middle))
draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_icon_light, 1);
if(mouse_click(mb_right)) draw_sprite_ext(s_key_display_mouse, 2, mxs, mys, 1, 1, 0, COLORS._main_icon_light, 1);
if(mouse_click(mb_middle)) draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_icon_light, 1);
if(mouse_wheel_up())
draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
if(mouse_wheel_down())
draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
if(mouse_wheel_up()) draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
if(mouse_wheel_down()) draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
draw_sprite_ext_add(s_key_display_mouse, 0, mxs, mys, 1, 1, 0, cc, 0.5);
#endregion
if(alpha > 0) { #region
if(alpha > 0) {
draw_set_text(_f_h5, fa_right, fa_bottom, COLORS._main_icon_dark);
var pd = ui(4);
var ww = string_width(disp_text) + pd * 3;
@ -141,5 +140,5 @@
draw_set_alpha(alpha);
draw_text(x1 - pd * 1.5, y1 - pd, disp_text);
draw_set_alpha(1);
} #endregion
}
#endregion

View file

@ -2,9 +2,9 @@
"$GMObject":"",
"%Name":"addon_key_displayer",
"eventList":[
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":75,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"v1","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":75,"eventType":8,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
{"$GMEvent":"","%Name":"","collisionObjectId":null,"eventNum":1,"eventType":3,"isDnD":false,"name":"","resourceType":"GMEvent","resourceVersion":"2.0",},
],
"managed":true,
"name":"addon_key_displayer",

View file

@ -17,7 +17,7 @@ event_inherited();
dialog_w_min = ui(640);
dialog_h_min = ui(480);
onResize = function() {
onResize = function() /*=>*/ {
sp_page.resize(page_width - ui(4), dialog_h - ui(title_height + padding));
sp_pref.resize( dialog_w - ui(padding + padding) - page_width, dialog_h - ui(title_height + padding));
@ -106,28 +106,23 @@ event_inherited();
ds_list_add(pref_global, new __Panel_Linear_Setting_Item(
__txtx("pref_directory", "Main directory path" + "*"),
new textBox(TEXTBOX_INPUT.text, function(txt) {
PRESIST_PREF.path = txt;
json_save_struct(APP_DIRECTORY + "persistPreference.json", PRESIST_PREF);
})
.setSideButton(button(function() {
new textBox(TEXTBOX_INPUT.text, function(txt) /*=>*/ { PRESIST_PREF.path = txt; json_save_struct(APP_DIRECTORY + "persistPreference.json", PRESIST_PREF); })
.setSideButton(button(function() /*=>*/ {
PRESIST_PREF.path = get_directory(PRESIST_PREF.path);
json_save_struct(APP_DIRECTORY + "persistPreference.json", PRESIST_PREF);
}, THEME.button_path_icon))
.setFont(f_p2)
.setEmpty(),
function() { return PRESIST_PREF.path; },
function(val) { PRESIST_PREF.path = val; json_save_struct(APP_DIRECTORY + "persistPreference.json", PRESIST_PREF); },
}, THEME.button_path_icon)).setFont(f_p2).setEmpty(),
function( ) /*=>*/ { return PRESIST_PREF.path; },
function(val) /*=>*/ { PRESIST_PREF.path = val; json_save_struct(APP_DIRECTORY + "persistPreference.json", PRESIST_PREF); },
APP_DIRECTORY,
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_directory_temp", "Temp directory path" + "*"),
"temp_path",
new textBox(TEXTBOX_INPUT.text, function(txt) { PREFERENCES.temp_path = txt; PREF_SAVE(); })
.setSideButton(button(function() { PREFERENCES.temp_path = get_directory(PREFERENCES.temp_path); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2)
.setEmpty(),
new textBox(TEXTBOX_INPUT.text, function(txt) /*=>*/ { PREFERENCES.temp_path = txt; PREF_SAVE(); })
.setSideButton(button(function() /*=>*/ { PREFERENCES.temp_path = get_directory(PREFERENCES.temp_path); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2).setEmpty(),
));
ds_list_add(pref_global, __txt("Inputs"));
@ -135,46 +130,37 @@ event_inherited();
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_double_click_delay", "Double click delay"),
"double_click_delay",
slider(0, 1, 0.01, function(val) {
PREFERENCES.double_click_delay = val;
PREF_SAVE();
})
slider(0, 1, 0.01, function(val) /*=>*/ { PREFERENCES.double_click_delay = val; PREF_SAVE(); })
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_mouse_wheel_speed", "Scroll speed"),
"mouse_wheel_speed",
new textBox(TEXTBOX_INPUT.number, function(val) {
PREFERENCES.mouse_wheel_speed = val;
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(val) /*=>*/ { PREFERENCES.mouse_wheel_speed = val; PREF_SAVE(); })
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_keyboard_hold_start", "Keyboard hold start"),
"keyboard_repeat_start",
slider(0, 1, 0.01, function(val) {
PREFERENCES.keyboard_repeat_start = val;
PREF_SAVE();
})
slider(0, 1, 0.01, function(val) /*=>*/ { PREFERENCES.keyboard_repeat_start = val; PREF_SAVE(); })
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_keyboard_repeat_delay", "Keyboard repeat delay"),
"keyboard_repeat_speed",
slider(0, 1, 0.01, function(val) {
PREFERENCES.keyboard_repeat_speed = val;
PREF_SAVE();
})
slider(0, 1, 0.01, function(val) /*=>*/ { PREFERENCES.keyboard_repeat_speed = val; PREF_SAVE(); })
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_expand_hovering_panel", "Expand hovering panel"),
"expand_hover",
new checkBox(function() {
PREFERENCES.expand_hover = !PREFERENCES.expand_hover;
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.expand_hover = !PREFERENCES.expand_hover; PREF_SAVE(); })
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_expand_lock_mouse_slider", "Lock mouse when sliding"),
"slider_lock_mouse",
new checkBox(function() /*=>*/ { PREFERENCES.slider_lock_mouse = !PREFERENCES.slider_lock_mouse; PREF_SAVE(); })
));
ds_list_add(pref_global, __txt("Save/Load"));
@ -182,28 +168,19 @@ event_inherited();
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_save_layout", "Save layout"),
"save_layout",
new checkBox(function() {
PREFERENCES.save_layout = !PREFERENCES.save_layout;
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.save_layout = !PREFERENCES.save_layout; PREF_SAVE(); })
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_save_file_minify", "Minify save file"),
"save_file_minify",
new checkBox(function() {
PREFERENCES.save_file_minify = !PREFERENCES.save_file_minify;
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.save_file_minify = !PREFERENCES.save_file_minify; PREF_SAVE(); })
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_save_backups", "Backup saves"),
"save_backup",
new textBox(TEXTBOX_INPUT.number, function(val) {
PREFERENCES.save_backup = max(0, val);
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(val) /*=>*/ { PREFERENCES.save_backup = max(0, val); PREF_SAVE(); })
));
ds_list_add(pref_global, __txt("Crash"));
@ -211,21 +188,13 @@ event_inherited();
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_legacy_exception", "Use legacy exception handler"),
"use_legacy_exception",
new checkBox(function() {
PREFERENCES.use_legacy_exception = !PREFERENCES.use_legacy_exception;
PREF_APPLY();
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.use_legacy_exception = !PREFERENCES.use_legacy_exception; PREF_APPLY(); PREF_SAVE(); })
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_crash_dialog", "Show dialog after crash"),
"show_crash_dialog",
new checkBox(function() {
PREFERENCES.show_crash_dialog = !PREFERENCES.show_crash_dialog;
PREF_APPLY();
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.show_crash_dialog = !PREFERENCES.show_crash_dialog; PREF_APPLY(); PREF_SAVE(); })
));
ds_list_add(pref_global, __txt("Misc"));
@ -233,20 +202,13 @@ event_inherited();
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_clear_temp", "Clear temp file on close"),
"clear_temp_on_close",
new checkBox(function() {
PREFERENCES.clear_temp_on_close = !PREFERENCES.clear_temp_on_close;
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.clear_temp_on_close = !PREFERENCES.clear_temp_on_close; PREF_SAVE(); })
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_enable_test_mode", "Enable developer mode" + "*"),
"test_mode",
new checkBox(function() {
PREFERENCES.test_mode = !PREFERENCES.test_mode;
should_restart = true;
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.test_mode = !PREFERENCES.test_mode; should_restart = true; PREF_SAVE(); })
));
ds_list_add(pref_global, __txt("Libraries"));
@ -254,37 +216,33 @@ event_inherited();
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_directory_ImageMagick", "ImageMagick path" + "*"),
"ImageMagick_path",
new textBox(TEXTBOX_INPUT.text, function(txt) { PREFERENCES.ImageMagick_path = txt; PREF_SAVE(); })
.setSideButton(button(function() { PREFERENCES.ImageMagick_path = get_directory(PREFERENCES.ImageMagick_path); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2)
.setEmpty(),
new textBox(TEXTBOX_INPUT.text, function(txt) /*=>*/ { PREFERENCES.ImageMagick_path = txt; PREF_SAVE(); })
.setSideButton(button(function() /*=>*/ { PREFERENCES.ImageMagick_path = get_directory(PREFERENCES.ImageMagick_path); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2).setEmpty(),
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_directory_webp", "Webp path" + "*"),
"webp_path",
new textBox(TEXTBOX_INPUT.text, function(txt) { PREFERENCES.webp_path = txt; PREF_SAVE(); })
.setSideButton(button(function() { PREFERENCES.webp_path = get_directory(PREFERENCES.webp_path); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2)
.setEmpty(),
new textBox(TEXTBOX_INPUT.text, function(txt) /*=>*/ { PREFERENCES.webp_path = txt; PREF_SAVE(); })
.setSideButton(button(function() /*=>*/ { PREFERENCES.webp_path = get_directory(PREFERENCES.webp_path); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2).setEmpty(),
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_directory_gifski", "Gifski path" + "*"),
"gifski_path",
new textBox(TEXTBOX_INPUT.text, function(txt) { PREFERENCES.gifski_path = txt; PREF_SAVE(); })
.setSideButton(button(function() { PREFERENCES.gifski_path = get_directory(PREFERENCES.gifski_path); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2)
.setEmpty(),
new textBox(TEXTBOX_INPUT.text, function(txt) /*=>*/ { PREFERENCES.gifski_path = txt; PREF_SAVE(); })
.setSideButton(button(function() /*=>*/ { PREFERENCES.gifski_path = get_directory(PREFERENCES.gifski_path); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2).setEmpty(),
));
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_directory_FFmpeg", "FFmpeg path" + "*"),
"ffmpeg_path",
new textBox(TEXTBOX_INPUT.text, function(txt) { PREFERENCES.gifski_path = txt; PREF_SAVE(); })
.setSideButton(button(function() { PREFERENCES.ffmpeg_path = get_directory(PREFERENCES.ffmpeg_path); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2)
.setEmpty(),
new textBox(TEXTBOX_INPUT.text, function(txt) /*=>*/ { PREFERENCES.gifski_path = txt; PREF_SAVE(); })
.setSideButton(button(function() /*=>*/ { PREFERENCES.ffmpeg_path = get_directory(PREFERENCES.ffmpeg_path); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2).setEmpty(),
));
#endregion
@ -297,22 +255,16 @@ event_inherited();
PREFERENCES._display_scaling = PREFERENCES.display_scaling;
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item(
__txtx("pref_gui_scaling", "GUI scaling*"),
slider(0.5, 2, 0.01, function(val) {
PREFERENCES._display_scaling = val;
should_restart = true;
}, function() {
slider(0.5, 2, 0.01, function(val) /*=>*/ { PREFERENCES._display_scaling = val; should_restart = true; },
function( ) /*=>*/ {
PREFERENCES._display_scaling = max(PREFERENCES._display_scaling, 0.5);
resetScale(PREFERENCES._display_scaling, true);
should_restart = true;
resetScale(PREFERENCES._display_scaling, true); should_restart = true;
}),
function() { return PREFERENCES._display_scaling; },
function(val) {
function( ) /*=>*/ { return PREFERENCES._display_scaling; },
function(val) /*=>*/ {
PREFERENCES._display_scaling = val;
resetScale(PREFERENCES._display_scaling, true);
should_restart = true;
resetScale(PREFERENCES._display_scaling, true); should_restart = true;
},
1,
));
@ -320,7 +272,7 @@ event_inherited();
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_ui_frame_rate", "UI frame rate"),
"ui_framerate",
new textBox(TEXTBOX_INPUT.number, function(str) {
new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ {
PREFERENCES.ui_framerate = max(15, round(real(str)));
game_set_speed(PREFERENCES.ui_framerate, gamespeed_fps);
PREF_SAVE();
@ -330,9 +282,7 @@ event_inherited();
locals = [];
var f = file_find_first(DIRECTORY + "Locale/*", fa_directory);
while(f != "") {
if(directory_exists(DIRECTORY + "Locale/" + f)) {
if(f != "_extend") array_push(locals, f);
}
if(directory_exists(DIRECTORY + "Locale/" + f)) { if(f != "_extend") array_push(locals, f); }
f = file_find_next();
}
file_find_close();
@ -340,7 +290,7 @@ event_inherited();
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_interface_language", "Interface Language" + "*"),
"local",
new scrollBox(locals, function(str) {
new scrollBox(locals, function(str) /*=>*/ {
if(str < 0) return;
PREFERENCES.local = locals[str];
PREF_SAVE();
@ -350,19 +300,15 @@ event_inherited();
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_ui_font", "Overwrite UI font") + "*",
"font_overwrite",
new textBox(TEXTBOX_INPUT.text, function(txt) { PREFERENCES.font_overwrite = txt; PREF_SAVE(); })
.setSideButton(button(function() { PREFERENCES.font_overwrite = get_open_filename_pxc("Font files (.ttf, .otf)|*.ttf;*.otf", ""); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2)
.setEmpty()
new textBox(TEXTBOX_INPUT.text, function(txt) /*=>*/ { PREFERENCES.font_overwrite = txt; PREF_SAVE(); })
.setSideButton(button(function() /*=>*/ { PREFERENCES.font_overwrite = get_open_filename_pxc("Font files (.ttf, .otf)|*.ttf;*.otf", ""); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2).setEmpty()
));
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_windows_control", "Use Windows style window control."),
"panel_menu_right_control",
new checkBox(function() {
PREFERENCES.panel_menu_right_control = !PREFERENCES.panel_menu_right_control;
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.panel_menu_right_control = !PREFERENCES.panel_menu_right_control; PREF_SAVE(); })
));
ds_list_add(pref_appr, __txt("Splash"));
@ -370,20 +316,14 @@ event_inherited();
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_auto_save_time", "Autosave delay (-1 to disable)"),
"auto_save_time",
new textBox(TEXTBOX_INPUT.number, function(val) {
PREFERENCES.auto_save_time = val;
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(val) /*=>*/ { PREFERENCES.auto_save_time = val; PREF_SAVE(); })
));
if(IS_PATREON)
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_supporter_icon", "Show supporter icon"),
"show_supporter_icon",
new checkBox(function() {
PREFERENCES.show_supporter_icon = !PREFERENCES.show_supporter_icon;
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.show_supporter_icon = !PREFERENCES.show_supporter_icon; PREF_SAVE(); })
));
ds_list_add(pref_appr, __txt("Graph")); //////////////////////////////////////////////////////////////////////// Graph
@ -391,80 +331,56 @@ event_inherited();
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_add_node_remember", "Remember add node position"),
"add_node_remember",
new checkBox(function() { PREFERENCES.add_node_remember = !PREFERENCES.add_node_remember; })
new checkBox(function() /*=>*/ { PREFERENCES.add_node_remember = !PREFERENCES.add_node_remember; })
));
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_connection_type", "Connection type"),
"curve_connection_line",
new buttonGroup([ THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection ],
function(val) {
PREFERENCES.curve_connection_line = val;
PREF_SAVE();
})
function(val) /*=>*/ { PREFERENCES.curve_connection_line = val; PREF_SAVE(); })
));
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_connection_thickness", "Connection thickness"),
"connection_line_width",
new textBox(TEXTBOX_INPUT.number, function(str) {
PREFERENCES.connection_line_width = real(str);
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.connection_line_width = real(str); PREF_SAVE(); })
));
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_connection_curve_smoothness", "Connection curve smoothness"),
"connection_line_sample",
new textBox(TEXTBOX_INPUT.number, function(str) {
PREFERENCES.connection_line_sample = real(str);
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.connection_line_sample = real(str); PREF_SAVE(); })
));
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_connection_aa", "Connection anti aliasing"),
"connection_line_aa",
new textBox(TEXTBOX_INPUT.number, function(str) {
PREFERENCES.connection_line_aa = max(1, real(str));
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.connection_line_aa = max(1, real(str)); PREF_SAVE(); })
));
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_connection_anim", "Connection line animation"),
"connection_line_transition",
new checkBox(function() {
PREFERENCES.connection_line_transition = !PREFERENCES.connection_line_transition;
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.connection_line_transition = !PREFERENCES.connection_line_transition; PREF_SAVE(); })
));
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_graph_group_in_tab", "Open group in new tab"),
"graph_open_group_in_tab",
new checkBox(function() {
PREFERENCES.graph_open_group_in_tab = !PREFERENCES.graph_open_group_in_tab;
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.graph_open_group_in_tab = !PREFERENCES.graph_open_group_in_tab; PREF_SAVE(); })
));
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_graph_zoom_smoothing", "Graph zoom smoothing"),
"graph_zoom_smoooth",
new textBox(TEXTBOX_INPUT.number, function(str) {
PREFERENCES.graph_zoom_smoooth = max(1, round(real(str)));
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.graph_zoom_smoooth = max(1, round(real(str))); PREF_SAVE(); })
));
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("panel_graph_group_require_shift", "Hold Shift to enter group"),
"panel_graph_group_require_shift",
new checkBox(function() {
PREFERENCES.panel_graph_group_require_shift = !PREFERENCES.panel_graph_group_require_shift;
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.panel_graph_group_require_shift = !PREFERENCES.panel_graph_group_require_shift; PREF_SAVE(); })
));
ds_list_add(pref_appr, __txt("Preview")); ////////////////////////////////////////////////////////////////////// Preview
@ -472,10 +388,7 @@ event_inherited();
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_preview_show_real_fps", "Show real fps"),
"panel_preview_show_real_fps",
new checkBox(function(str) {
PREFERENCES.panel_preview_show_real_fps = !PREFERENCES.panel_preview_show_real_fps;
PREF_SAVE();
})
new checkBox(function(str) /*=>*/ { PREFERENCES.panel_preview_show_real_fps = !PREFERENCES.panel_preview_show_real_fps; PREF_SAVE(); })
));
ds_list_add(pref_appr, __txt("Inspector")); //////////////////////////////////////////////////////////////////// Inspector
@ -483,10 +396,7 @@ event_inherited();
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_inspector_focus_on_double_click", "Focus on double click"),
"inspector_focus_on_double_click",
new checkBox(function(str) {
PREFERENCES.inspector_focus_on_double_click = !PREFERENCES.inspector_focus_on_double_click;
PREF_SAVE();
})
new checkBox(function(str) /*=>*/ { PREFERENCES.inspector_focus_on_double_click = !PREFERENCES.inspector_focus_on_double_click; PREF_SAVE(); })
));
ds_list_add(pref_appr, __txt("Collection")); /////////////////////////////////////////////////////////////////// Collection
@ -494,10 +404,7 @@ event_inherited();
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_collection_preview_speed", "Collection preview speed"),
"collection_preview_speed",
new textBox(TEXTBOX_INPUT.number, function(str) {
PREFERENCES.collection_preview_speed = max(1, round(real(str)));
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.collection_preview_speed = max(1, round(real(str))); PREF_SAVE(); })
));
ds_list_add(pref_appr, __txt("Notification")); ///////////////////////////////////////////////////////////////// Notification
@ -505,10 +412,7 @@ event_inherited();
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_warning_notification_time", "Warning notification time"),
"notification_time",
new textBox(TEXTBOX_INPUT.number, function(str) {
PREFERENCES.notification_time = max(0, round(real(str)));
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.notification_time = max(0, round(real(str))); PREF_SAVE(); })
));
ds_list_add(pref_appr, __txt("Text Area")); //////////////////////////////////////////////////////////////////// Text area
@ -516,29 +420,20 @@ event_inherited();
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_widget_autocomplete_delay", "Code Autocomplete delay"),
"widget_autocomplete_delay",
new textBox(TEXTBOX_INPUT.number, function(str) {
PREFERENCES.widget_autocomplete_delay = round(real(str));
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.widget_autocomplete_delay = round(real(str)); PREF_SAVE(); })
));
if(IS_PATREON) {
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_widget_textbox_shake", "Textbox shake"),
"textbox_shake",
new textBox(TEXTBOX_INPUT.number, function(str) {
PREFERENCES.textbox_shake = real(str);
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.textbox_shake = real(str); PREF_SAVE(); })
).patreon());
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_widget_textbox_particles", "Textbox particles"),
"textbox_particle",
new textBox(TEXTBOX_INPUT.number, function(str) {
PREFERENCES.textbox_particle = round(real(str));
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(str) /*=>*/ { PREFERENCES.textbox_particle = round(real(str)); PREF_SAVE(); })
).patreon());
}
@ -553,31 +448,19 @@ event_inherited();
ds_list_add(pref_node, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_node_param_show", "Show paramater on new node"),
"node_param_show",
new checkBox(function() {
PREFERENCES.node_param_show = !PREFERENCES.node_param_show;
PREF_SAVE();
})
new checkBox(function() /*=>*/ { PREFERENCES.node_param_show = !PREFERENCES.node_param_show; PREF_SAVE(); })
));
ds_list_add(pref_node, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_node_param_width", "Default param width"),
"node_param_width",
new textBox(TEXTBOX_INPUT.number, function(val) {
PREFERENCES.node_param_width = val;
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(val) /*=>*/ { PREFERENCES.node_param_width = val; PREF_SAVE(); })
));
ds_list_add(pref_node, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_node_3d_preview", "Preview surface size"),
"node_3d_preview_size",
new textBox(TEXTBOX_INPUT.number, function(val) {
PREFERENCES.node_3d_preview_size = clamp(val, 16, 1024);
PREF_SAVE();
})
new textBox(TEXTBOX_INPUT.number, function(val) /*=>*/ { PREFERENCES.node_3d_preview_size = clamp(val, 16, 1024); PREF_SAVE(); })
));
#endregion
@ -712,7 +595,7 @@ event_inherited();
ds_list_add(pref_hot, [
__txtx("pref_use_alt", "Use ALT for"),
"alt_picker",
new buttonGroup([ "Pan", "Color Picker" ], function(val) {
new buttonGroup([ "Pan", "Color Picker" ], function(val) /*=>*/ {
PREFERENCES.alt_picker = val;
PREF_SAVE();
})
@ -720,8 +603,8 @@ event_inherited();
ds_list_add(pref_hot, [
__txtx("pref_pan_key", "Panning key"),
function() { return PREFERENCES.pan_mouse_key - 3; },
new scrollBox([ "Middle Mouse", "Mouse 4", "Mouse 5" ], function(val) {
function() /*=>*/ { return PREFERENCES.pan_mouse_key - 3; },
new scrollBox([ "Middle Mouse", "Mouse 4", "Mouse 5" ], function(val) /*=>*/ {
PREFERENCES.pan_mouse_key = val + 3;
PREF_SAVE();
})
@ -1122,7 +1005,7 @@ event_inherited();
#endregion
#region search
tb_search = new textBox(TEXTBOX_INPUT.text, function(str) {
tb_search = new textBox(TEXTBOX_INPUT.text, function(str) /*=>*/ {
search_text = str;
});
tb_search.align = fa_left;

View file

@ -265,7 +265,7 @@ function addNodeObject(_list, _name, _spr, _node, _fun, _tag = [], tooltip = "")
return _n;
}
function addNodeCatagory( name, list, filter = [], color = noone) { global.__currPage = name; ds_list_add(NODE_CATEGORY, { name, list, filter, color }); }
function addNodeCatagory( name, list, filter = [], color = noone) { ds_list_add(NODE_CATEGORY, { name, list, filter, color }); global.__currPage = name; }
function addNodePBCatagory( name, list, filter = []) { ds_list_add(NODE_PB_CATEGORY, { name, list, filter }); }
function addNodePCXCatagory( name, list, filter = []) { ds_list_add(NODE_PCX_CATEGORY, { name, list, filter }); }

View file

@ -38,6 +38,7 @@
PREFERENCES.double_click_delay = 0.25;
PREFERENCES.mouse_wheel_speed = 1.00;
PREFERENCES.slider_lock_mouse = true;
PREFERENCES.keyboard_repeat_start = 0.50;
PREFERENCES.keyboard_repeat_speed = 0.10;

View file

@ -522,8 +522,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
}
if(sliding == 2) {
if(!slidePen)
CURSOR_LOCK = true;
if(!slidePen && PREFERENCES.slider_lock_mouse) CURSOR_LOCK = true;
if(mouse_press(mb_right)) {
_input_text = string_real(slider_def_val);