mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-10 12:34:06 +01:00
Command Palette
This commit is contained in:
parent
482878b245
commit
a9e1a56b67
@ -61,6 +61,8 @@ event_inherited();
|
||||
var match = string_partial_match(_fname, search_lower);
|
||||
if(match == -9999) continue;
|
||||
|
||||
if(_cnxt == "New node") match -= 1000;
|
||||
|
||||
ds_priority_add(pr_list, _menu, match);
|
||||
}
|
||||
|
||||
@ -78,9 +80,10 @@ event_inherited();
|
||||
|
||||
sc_content = new scrollPane(dialog_w - ui(4), dialog_h - ui(32), function(_y, _m) {
|
||||
draw_clear_alpha(COLORS.panel_bg_clear, 1);
|
||||
|
||||
var hght = line_get_height(f_p2, item_pad);
|
||||
var _dw = sc_content.surface_w;
|
||||
var _h = 0;
|
||||
var _h = array_length(data) * hght;
|
||||
var _ly = _y;
|
||||
|
||||
draw_set_color(CDEF.main_mdblack);
|
||||
@ -90,23 +93,29 @@ event_inherited();
|
||||
if(mouse_move) keyboard_trigger = false;
|
||||
|
||||
for(var i = 0; i < array_length(data); i++) {
|
||||
if(_ly < -hght) {
|
||||
_ly += hght;
|
||||
continue;
|
||||
}
|
||||
|
||||
var _menu = data[i];
|
||||
|
||||
var _menuItem = _menu.menu;
|
||||
var _key = _menu.hotkey;
|
||||
var _hasKey = struct_has(_menu, "hotkey");
|
||||
var _mhover = mouse_move && point_in_rectangle(_m[0], _m[1], 0, _ly, _dw, _ly + hght - 1);
|
||||
|
||||
if(selecting == i) {
|
||||
draw_sprite_stretched_ext(THEME.textbox, 3, 0, _ly, dialog_w, hght, COLORS.dialog_menubox_highlight, 1);
|
||||
draw_sprite_stretched_ext(THEME.textbox, 3, 0, _ly, _dw, hght, COLORS.dialog_menubox_highlight, 1);
|
||||
|
||||
if(sc_content.active) {
|
||||
if((!keyboard_trigger && mouse_press(mb_left)) || keyboard_check_pressed(vk_enter)) {
|
||||
_menu.action();
|
||||
call(_menu.action, _menu.params);
|
||||
array_push(RECENT_COMMANDS, _menu);
|
||||
instance_destroy();
|
||||
}
|
||||
|
||||
if(mouse_press(mb_right)) {
|
||||
if(_hasKey && mouse_press(mb_right)) {
|
||||
var _key = _menu.hotkey;
|
||||
selecting_hotkey = _key;
|
||||
|
||||
var _loadKey = _key.full_name();
|
||||
@ -147,41 +156,50 @@ event_inherited();
|
||||
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_icon_light);
|
||||
draw_text_match_ext(_tx, _ty, _name, _dw, search_string);
|
||||
|
||||
if(_menuItem != noone && _menuItem.spr != noone) {
|
||||
var spr = is_array(_menuItem.spr)? _menuItem.spr[0] : _menuItem.spr;
|
||||
var ind = is_array(_menuItem.spr)? _menuItem.spr[1] : 0;
|
||||
draw_sprite_ui(spr, ind, ui(16), _ty, .75, .75, 0, COLORS._main_icon, 0.75);
|
||||
var _spr = _menu.spr;
|
||||
if(_menuItem != noone) _spr = _menuItem.spr;
|
||||
|
||||
if(_spr != noone) {
|
||||
var spr = is_array(_spr)? _spr[0] : _spr;
|
||||
var ind = is_array(_spr)? _spr[1] : 0;
|
||||
var _ss = hght / max(sprite_get_width(spr), sprite_get_height(spr)) * .7;
|
||||
|
||||
draw_sprite_ext(spr, ind, ui(16), _ty, _ss, _ss, 0, COLORS._main_icon);
|
||||
}
|
||||
|
||||
if(is_instanceof(_key, hotkeyObject)) {
|
||||
var _hx = _dw - ui(6);
|
||||
var _hy = _ty + ui(1);
|
||||
if(_hasKey) {
|
||||
var _key = _menu.hotkey;
|
||||
|
||||
draw_set_text(f_p2, fa_right, fa_center, COLORS._main_accent);
|
||||
|
||||
var _ktxt = key_get_name(_key.key, _key.modi);
|
||||
var _tw = string_width(_ktxt);
|
||||
var _th = line_get_height();
|
||||
|
||||
var _bx = _hx - _tw - ui(4);
|
||||
var _by = _hy - _th / 2 - ui(2);
|
||||
var _bw = _tw + ui(8);
|
||||
var _bh = _th + ui(2);
|
||||
|
||||
if(hk_editing == _key) {
|
||||
draw_set_color(COLORS._main_accent);
|
||||
// draw_sprite_stretched_ext(THEME.ui_panel, 1, _bx, _by, _bw, _bh, COLORS._main_text_accent);
|
||||
if(is_instanceof(_key, hotkeyObject)) {
|
||||
var _hx = _dw - ui(6);
|
||||
var _hy = _ty + ui(1);
|
||||
|
||||
} else if(_ktxt != "") {
|
||||
draw_set_color(COLORS._main_text_sub);
|
||||
// draw_sprite_stretched_ext(THEME.ui_panel, 1, _bx, _by, _bw, _bh, CDEF.main_dkgrey);
|
||||
draw_set_text(f_p2, fa_right, fa_center, COLORS._main_accent);
|
||||
|
||||
var _ktxt = key_get_name(_key.key, _key.modi);
|
||||
var _tw = string_width(_ktxt);
|
||||
var _th = line_get_height();
|
||||
|
||||
var _bx = _hx - _tw - ui(4);
|
||||
var _by = _hy - _th / 2 - ui(2);
|
||||
var _bw = _tw + ui(8);
|
||||
var _bh = _th + ui(2);
|
||||
|
||||
if(hk_editing == _key) {
|
||||
draw_set_color(COLORS._main_accent);
|
||||
// draw_sprite_stretched_ext(THEME.ui_panel, 1, _bx, _by, _bw, _bh, COLORS._main_text_accent);
|
||||
|
||||
} else if(_ktxt != "") {
|
||||
draw_set_color(COLORS._main_text_sub);
|
||||
// draw_sprite_stretched_ext(THEME.ui_panel, 1, _bx, _by, _bw, _bh, CDEF.main_dkgrey);
|
||||
}
|
||||
|
||||
draw_text_add(_hx, _hy, _ktxt);
|
||||
}
|
||||
|
||||
draw_text_add(_hx, _hy, _ktxt);
|
||||
}
|
||||
|
||||
_ly += hght;
|
||||
_h += hght;
|
||||
if(_ly > sc_content.h) break;
|
||||
}
|
||||
|
||||
if(hk_editing != noone) {
|
||||
|
@ -5,6 +5,7 @@ event_inherited();
|
||||
dialog_w = min(WIN_W - ui(16), ui(1000));
|
||||
dialog_h = min(WIN_H - ui(16), ui(700));
|
||||
page_width = ui(160);
|
||||
// title_height = 8;
|
||||
|
||||
destroy_on_click_out = true;
|
||||
destroy_on_escape = false;
|
||||
@ -109,7 +110,6 @@ event_inherited();
|
||||
return hh;
|
||||
});
|
||||
|
||||
|
||||
sp_page.show_scroll = false;
|
||||
#endregion
|
||||
|
||||
@ -235,7 +235,7 @@ event_inherited();
|
||||
function( ) /*=>*/ { return PRESIST_PREF.path; },
|
||||
function(val) /*=>*/ { PRESIST_PREF.path = val; json_save_struct(APP_DIRECTORY + "persistPreference.json", PRESIST_PREF); },
|
||||
APP_DIRECTORY,
|
||||
));
|
||||
).setKey("main_dir_path"));
|
||||
|
||||
ds_list_add(pref_global, new __Panel_Linear_Setting_Item_Preference(
|
||||
__txtx("pref_directory_temp", "Temp directory path*"),
|
||||
@ -313,7 +313,7 @@ event_inherited();
|
||||
resetScale(PREFERENCES._display_scaling, true); should_restart = true;
|
||||
},
|
||||
1,
|
||||
));
|
||||
).setKey("ui_scale"));
|
||||
|
||||
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
|
||||
__txtx("pref_ui_frame_rate", "UI frame rate"),
|
||||
@ -470,7 +470,7 @@ event_inherited();
|
||||
__txtx("pref_pan_key", "Panning key"),
|
||||
new scrollBox([ "Middle Mouse", "Mouse 4", "Mouse 5" ], function(val) /*=>*/ { PREFERENCES.pan_mouse_key = val + 3; PREF_SAVE(); }),
|
||||
function() /*=>*/ { return PREFERENCES.pan_mouse_key - 3; },
|
||||
));
|
||||
).setKey("panning_key"));
|
||||
|
||||
ds_list_add(pref_appr, __txt("Preview")); ////////////////////////////////////////////////////////////////////// Preview
|
||||
|
||||
@ -861,12 +861,13 @@ event_inherited();
|
||||
|
||||
sp_pref = new scrollPane(panel_width, panel_height, function(_y, _m, _r) {
|
||||
draw_clear_alpha(COLORS.panel_bg_clear_inner, 1);
|
||||
var hh = 0;
|
||||
var th = line_get_height(font, 6);
|
||||
var x1 = sp_pref.surface_w;
|
||||
var yy = _y + ui(8);
|
||||
var padd = ui(6);
|
||||
var ind = 0;
|
||||
var ww = sp_pref.surface_w;
|
||||
var hh = 0;
|
||||
var th = line_get_height(font, 6);
|
||||
var x1 = sp_pref.surface_w;
|
||||
var yy = _y + ui(8);
|
||||
var padd = ui(6);
|
||||
var ind = 0;
|
||||
|
||||
for(var i = 0; i < ds_list_size(current_list); i++) {
|
||||
var _pref = current_list[| i];
|
||||
@ -905,7 +906,14 @@ event_inherited();
|
||||
if(search_text != "" && string_pos(string_lower(search_text), string_lower(name)) == 0)
|
||||
continue;
|
||||
|
||||
if(ind % 2 == 0) draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yy - padd, sp_pref.surface_w, max(_pref.editWidget.h, th) + padd * 2, COLORS.dialog_preference_prop_bg, 1);
|
||||
if(ind % 2 == 0) draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yy - padd, ww, max(_pref.editWidget.h, th) + padd * 2, COLORS.dialog_preference_prop_bg, 1);
|
||||
|
||||
if(goto_item == _pref) {
|
||||
if(goto_item_highlight == 2) sp_pref.setScroll(-hh);
|
||||
if(goto_item_highlight == 0) goto_item = noone;
|
||||
|
||||
draw_sprite_stretched_add(THEME.ui_panel_bg, 0, 0, yy - padd, ww, max(_pref.editWidget.h, th) + padd * 2, COLORS._main_accent, min(1, goto_item_highlight) * 0.5);
|
||||
}
|
||||
|
||||
draw_set_text(font, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text_add(ui(24), yy + th / 2, name);
|
||||
@ -965,6 +973,7 @@ event_inherited();
|
||||
}
|
||||
|
||||
sections[page_current] = sect;
|
||||
goto_item_highlight = lerp_float(goto_item_highlight, 0, 30);
|
||||
|
||||
return hh;
|
||||
});
|
||||
@ -975,4 +984,29 @@ event_inherited();
|
||||
tb_search.align = fa_left;
|
||||
|
||||
search_text = "";
|
||||
contents = {};
|
||||
goto_item = noone;
|
||||
goto_item_highlight = 0;
|
||||
|
||||
var _pref_lists = [ pref_global, pref_appr, pref_node ];
|
||||
|
||||
for (var j = 0, m = array_length(_pref_lists); j < m; j++)
|
||||
for (var i = 0, n = ds_list_size(_pref_lists[j]); i < n; i++) {
|
||||
var _pr = _pref_lists[j][| i];
|
||||
if(!is_struct(_pr)) continue;
|
||||
|
||||
contents[$ _pr.key] = { page: j, item: _pr };
|
||||
}
|
||||
|
||||
function goto(_tag) {
|
||||
if(!struct_has(contents, _tag)) return self;
|
||||
var _it = contents[$ _tag];
|
||||
|
||||
if(page_current != _it.page)
|
||||
page_current = _it.page;
|
||||
goto_item = _it.item;
|
||||
goto_item_highlight = 2;
|
||||
|
||||
return self;
|
||||
}
|
||||
#endregion
|
||||
|
@ -6,9 +6,11 @@ function __Panel_Linear_Setting_Item(name, editWidget, data, onEdit = noone, get
|
||||
self.onEdit = onEdit;
|
||||
self.getDefault = getDefault;
|
||||
self.action = action == noone? noone : struct_try_get(FUNCTIONS, string_to_var2(action[0], action[1]), noone);
|
||||
key = "";
|
||||
|
||||
self.is_patreon = false;
|
||||
|
||||
static setKey = function(_key) { self.key = _key; return self; }
|
||||
static patreon = function() { is_patreon = true; return self; }
|
||||
}
|
||||
|
||||
|
@ -29,24 +29,40 @@
|
||||
__fnInit_Presets();
|
||||
__fnInit_Notification();
|
||||
__fnInit_Preview_Window();
|
||||
|
||||
__fnInit_Preference();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
function registerFunction(_context, _name, _key, _mod, _action) { return new functionObject(_context, _name, _key, _mod, _action); }
|
||||
|
||||
function functionObject(_context, _name, _key, _mod, _action) constructor {
|
||||
function registerFunctionLite(_context, _name, _action, _param = noone) { return new functionObjectLite(_context, _name, _action, _param); }
|
||||
function functionObjectLite(_context, _name, _action, _param = noone) constructor {
|
||||
context = _context;
|
||||
name = _name;
|
||||
action = _action;
|
||||
params = _param;
|
||||
fnName = string_to_var2(_context, _name);
|
||||
menu = noone;
|
||||
spr = noone;
|
||||
|
||||
FUNCTIONS[$ fnName] = self;
|
||||
}
|
||||
|
||||
function registerFunction(_context, _name, _key, _mod, _action, _param = noone) { return new functionObject(_context, _name, _key, _mod, _action, _param); }
|
||||
function functionObject(_context, _name, _key, _mod, _action, _param = noone) constructor {
|
||||
hotkey = addHotkey(_context, _name, _key, _mod, _action);
|
||||
context = _context;
|
||||
name = _name;
|
||||
dkey = _key;
|
||||
dmod = _mod;
|
||||
action = _action;
|
||||
params = _param;
|
||||
hide = false;
|
||||
|
||||
fnName = string_to_var2(_context, _name);
|
||||
menu = noone;
|
||||
|
||||
spr = noone;
|
||||
|
||||
FUNCTIONS[$ fnName] = self;
|
||||
CMD_FUNCTIONS[$ fnName] = { action: _action, args: [] };
|
||||
|
||||
@ -89,27 +105,34 @@ function callFunction(name, args) {
|
||||
INLINE
|
||||
|
||||
var _f = CMD_FUNCTIONS[$ name];
|
||||
|
||||
switch(array_length(_f.args)) {
|
||||
case 0 : _f.fn(); break;
|
||||
case 1 : _f.fn(args[0]); break;
|
||||
case 2 : _f.fn(args[0], args[1]); break;
|
||||
case 3 : _f.fn(args[0], args[1], args[2]); break;
|
||||
case 4 : _f.fn(args[0], args[1], args[2], args[3]); break;
|
||||
case 5 : _f.fn(args[0], args[1], args[2], args[3], args[4]); break;
|
||||
case 6 : _f.fn(args[0], args[1], args[2], args[3], args[4], args[5]); break;
|
||||
case 7 : _f.fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); break;
|
||||
case 8 : _f.fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]); break;
|
||||
case 9 : _f.fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]); break;
|
||||
case 10 : _f.fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]); break;
|
||||
case 11 : _f.fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10]); break;
|
||||
case 12 : _f.fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11]); break;
|
||||
case 13 : _f.fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12]); break;
|
||||
case 14 : _f.fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13]); break;
|
||||
case 15 : _f.fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14]); break;
|
||||
case 16 : _f.fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14], args[15]); break;
|
||||
}
|
||||
call(_f.fn, args);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function call(fn, args) {
|
||||
if(!is_array(args)) {
|
||||
fn();
|
||||
return;
|
||||
}
|
||||
|
||||
switch(array_length(args)) {
|
||||
case 0 : fn(); break;
|
||||
case 1 : fn(args[0]); break;
|
||||
case 2 : fn(args[0], args[1]); break;
|
||||
case 3 : fn(args[0], args[1], args[2]); break;
|
||||
case 4 : fn(args[0], args[1], args[2], args[3]); break;
|
||||
case 5 : fn(args[0], args[1], args[2], args[3], args[4]); break;
|
||||
case 6 : fn(args[0], args[1], args[2], args[3], args[4], args[5]); break;
|
||||
case 7 : fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); break;
|
||||
case 8 : fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7]); break;
|
||||
case 9 : fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8]); break;
|
||||
case 10 : fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]); break;
|
||||
case 11 : fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10]); break;
|
||||
case 12 : fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11]); break;
|
||||
case 13 : fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12]); break;
|
||||
case 14 : fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13]); break;
|
||||
case 15 : fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14]); break;
|
||||
case 16 : fn(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9], args[10], args[11], args[12], args[13], args[14], args[15]); break;
|
||||
}
|
||||
}
|
@ -19,6 +19,9 @@ function NodeObject(_name, _spr, _node, _create, tooltip = "", tags = []) constr
|
||||
|
||||
is_patreon_extra = false;
|
||||
|
||||
_fn = registerFunctionLite("New node", _name, function(_node) { PANEL_GRAPH.createNodeHotkey(_node); }, [ _node ]);
|
||||
_fn.spr = _spr;
|
||||
|
||||
if(!IS_CMD) {
|
||||
var pth = DIRECTORY + $"Nodes/Tooltip/{node}.png";
|
||||
if(file_exists_empty(pth)) tooltip_spr = sprite_add(pth, 0, false, false, 0, 0);
|
||||
@ -69,6 +72,7 @@ function NodeObject(_name, _spr, _node, _create, tooltip = "", tags = []) constr
|
||||
if(IS_CMD) return self;
|
||||
|
||||
show_in_recent = false;
|
||||
variable_struct_remove(FUNCTIONS, _fn.fnName);
|
||||
return self;
|
||||
}
|
||||
|
||||
@ -257,7 +261,7 @@ function addNodeObject(_list, _name, _spr, _node, _fun, _tag = [], tooltip = "")
|
||||
ds_list_add(_list, _n);
|
||||
return _n;
|
||||
}
|
||||
|
||||
|
||||
var _n = new NodeObject(_name, _spr, _node, _fun, tooltip, _tag);
|
||||
ALL_NODES[? _node] = _n;
|
||||
|
||||
|
@ -401,3 +401,65 @@
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region command palette
|
||||
//!#mfunc __regFnPref {"args":["name"," key"],"order":[0,1]}
|
||||
#macro __regFnPref_mf0 { registerFunctionLite("Preference",
|
||||
#macro __regFnPref_mf1 , function() { dialogCall(o_dialog_preference).goto(
|
||||
#macro __regFnPref_mf2 ); }); }
|
||||
|
||||
function __fnInit_Preference() {
|
||||
__regFnPref_mf0 __txtx("pref_double_click_delay", "Double click delay") __regFnPref_mf1 "double_click_delay" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_mouse_wheel_speed", "Scroll speed") __regFnPref_mf1 "mouse_wheel_speed" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_keyboard_hold_start", "Keyboard hold start") __regFnPref_mf1 "keyboard_repeat_start" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_keyboard_repeat_delay", "Keyboard repeat delay") __regFnPref_mf1 "keyboard_repeat_speed" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_expand_hovering_panel", "Expand hovering panel") __regFnPref_mf1 "expand_hover" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_expand_lock_mouse_slider", "Lock mouse when sliding") __regFnPref_mf1 "slider_lock_mouse" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_pen_pool_delay", "Pen leave delay") __regFnPref_mf1 "pen_pool_delay" __regFnPref_mf2;
|
||||
|
||||
__regFnPref_mf0 __txtx("pref_auto_save_time", "Autosave delay (-1 to disable)") __regFnPref_mf1 "auto_save_time" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_save_layout", "Save layout") __regFnPref_mf1 "save_layout" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_save_file_minify", "Minify save file") __regFnPref_mf1 "save_file_minify" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_save_backups", "Backup saves") __regFnPref_mf1 "save_backup" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_legacy_exception", "Use legacy exception handler") __regFnPref_mf1 "use_legacy_exception" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_crash_dialog", "Show dialog after crash") __regFnPref_mf1 "show_crash_dialog" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_clear_temp", "Clear temp file on close") __regFnPref_mf1 "clear_temp_on_close" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_enable_test_mode", "Enable developer mode*") __regFnPref_mf1 "test_mode" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_exp_popup_dialog", "Pop-up Dialog") __regFnPref_mf1 "multi_window" __regFnPref_mf2;
|
||||
|
||||
__regFnPref_mf0 __txtx("pref_gui_scaling", "GUI scaling") __regFnPref_mf1 "ui_scale" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_ui_frame_rate", "UI frame rate") __regFnPref_mf1 "ui_framerate" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_ui_frame_rate", "UI inactive frame rate") __regFnPref_mf1 "ui_framerate_non_focus" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_interface_language", "Interface Language*") __regFnPref_mf1 "local" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_ui_font", "Overwrite UI font") + "*" __regFnPref_mf1 "font_overwrite" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_windows_control", "Use Windows style window control.") __regFnPref_mf1 "panel_menu_right_control" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_ui_fix_window_size", "Fix Window size on start") __regFnPref_mf1 "window_fix" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_ui_fix_width", "Fix width") __regFnPref_mf1 "window_fix_width" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_ui_fix_height", "Fix height") __regFnPref_mf1 "window_fix_height" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_supporter_icon", "Show supporter icon") __regFnPref_mf1 "show_supporter_icon" __regFnPref_mf2;
|
||||
|
||||
__regFnPref_mf0 __txtx("pref_add_node_remember", "Remember add node position") __regFnPref_mf1 "add_node_remember" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_connection_type", "Connection type") __regFnPref_mf1 "curve_connection_line" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_connection_thickness", "Connection thickness") __regFnPref_mf1 "connection_line_width" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_connection_curve_smoothness", "Connection curve smoothness") __regFnPref_mf1 "connection_line_sample" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_connection_aa", "Connection anti aliasing") __regFnPref_mf1 "connection_line_aa" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_connection_anim", "Connection line animation") __regFnPref_mf1 "connection_line_transition" __regFnPref_mf2;
|
||||
|
||||
__regFnPref_mf0 __txtx("pref_graph_group_in_tab", "Open group in new tab") __regFnPref_mf1 "graph_open_group_in_tab" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_graph_zoom_smoothing", "Graph zoom smoothing") __regFnPref_mf1 "graph_zoom_smoooth" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("panel_graph_group_require_shift", "Hold Shift to enter group") __regFnPref_mf1 "panel_graph_group_require_shift" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_use_alt", "Use ALT for") __regFnPref_mf1 "alt_picker" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_preview_show_real_fps", "Show real fps") __regFnPref_mf1 "panel_preview_show_real_fps" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_inspector_focus_on_double_click", "Focus on double click") __regFnPref_mf1 "inspector_focus_on_double_click" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_collection_preview_speed", "Collection preview speed") __regFnPref_mf1 "collection_preview_speed" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_warning_notification_time", "Warning notification time") __regFnPref_mf1 "notification_time" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_widget_autocomplete_delay", "Code Autocomplete delay") __regFnPref_mf1 "widget_autocomplete_delay" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_widget_textbox_shake", "Textbox shake") __regFnPref_mf1 "textbox_shake" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_widget_textbox_particles", "Textbox particles") __regFnPref_mf1 "textbox_particle" __regFnPref_mf2;
|
||||
|
||||
__regFnPref_mf0 __txtx("pref_node_param_show", "Show paramater on new node") __regFnPref_mf1 "node_param_show" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_node_param_width", "Default param width") __regFnPref_mf1 "node_param_width" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_node_3d_preview", "Preview surface size") __regFnPref_mf1 "node_3d_preview_size" __regFnPref_mf2;
|
||||
__regFnPref_mf0 __txtx("pref_file_watcher_delay", "File watcher delay (s)") __regFnPref_mf1 "file_watcher_delay" __regFnPref_mf2;
|
||||
}
|
||||
#endregion
|
@ -41,10 +41,7 @@ function scrollPane(_w, _h, ondraw) : widget() constructor {
|
||||
surface_h = _h;
|
||||
}
|
||||
|
||||
static setScroll = function(_scroll_y) {
|
||||
INLINE
|
||||
scroll_y_to = clamp(_scroll_y, -content_h, 0);
|
||||
}
|
||||
static setScroll = function(_scroll_y) { INLINE scroll_y_to = _scroll_y; }
|
||||
|
||||
static draw = function(x, y, mx = mouse_mx - x, my = mouse_my - y) {
|
||||
self.x = x;
|
||||
|
@ -114,7 +114,7 @@ function string_partial_match(str, key) {
|
||||
consec++;
|
||||
conMax = max(conMax, consec);
|
||||
run++;
|
||||
if(run > string_length(key)) return conMax - misMatch;
|
||||
if(run > string_length(key)) return conMax - misMatch - (amo - i);
|
||||
kchr = string_char_at(key, run);
|
||||
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user