This commit is contained in:
Tanasart 2023-07-30 13:56:22 +02:00
parent cfbcdd393a
commit 505056612a
51 changed files with 401 additions and 202 deletions

View file

@ -77,42 +77,43 @@
draw_sprite_stretched_ext(THEME.menu_button_mask, 0, dcx, dcy, _dcw, dch, COLORS._main_icon_light, 1.0);
}
draw_sprite(s_key_display_mouse, 0, mxs, mys);
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_press(mb_left))
draw_sprite_ext(s_key_display_mouse, 1, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
else if(mouse_release(mb_left))
draw_sprite_ext(s_key_display_mouse, 1, mxs, mys, 1, 1, 0, COLORS._main_value_negative, 1);
//else if(mouse_press(mb_left))
// draw_sprite_ext(s_key_display_mouse, 1, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
//else if(mouse_release(mb_left))
// draw_sprite_ext(s_key_display_mouse, 1, mxs, mys, 1, 1, 0, COLORS._main_value_negative, 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_press(mb_right))
draw_sprite_ext(s_key_display_mouse, 2, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
else if(mouse_release(mb_right))
draw_sprite_ext(s_key_display_mouse, 2, mxs, mys, 1, 1, 0, COLORS._main_value_negative, 1);
else if(mouse_click(mb_right))
//if(mouse_press(mb_right))
// draw_sprite_ext(s_key_display_mouse, 2, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
//else if(mouse_release(mb_right))
// draw_sprite_ext(s_key_display_mouse, 2, mxs, mys, 1, 1, 0, COLORS._main_value_negative, 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_press(mb_middle))
draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
else if(mouse_release(mb_middle))
draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_value_negative, 1);
else if(mouse_click(mb_middle))
//if(mouse_press(mb_middle))
// draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
//else if(mouse_release(mb_middle))
// draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_value_negative, 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, 4, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
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, 5, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
draw_sprite_ext(s_key_display_mouse, 3, mxs, mys, 1, 1, 0, COLORS._main_accent, 1);
#endregion
if(alpha > 0) {
draw_set_text(_f_h2, fa_right, fa_bottom, COLORS._main_icon_dark);
var ww = string_width(disp_text) + ui(16);
var hh = string_height(disp_text) + ui(16);
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;
var hh = string_height(disp_text) + pd * 2;
var x1 = WIN_W - ui(32 + 72);
var x1 = WIN_W - ui(40 + string_width(s_key_display_mouse));
var y1 = win_y - ui(8);
var x0 = x1 - ww;
var y0 = y1 - hh;
@ -120,7 +121,7 @@
draw_sprite_stretched_ext(THEME.key_display, 0, x0, y0, ww, hh,
pressing? COLORS._main_accent : COLORS._main_icon, alpha);
draw_set_alpha(alpha);
draw_text(x1 - ui(8), y1 - ui(8), disp_text);
draw_text(x1 - pd * 1.5, y1 - pd, disp_text);
draw_set_alpha(1);
}
#endregion

View file

@ -19,7 +19,7 @@ event_inherited();
PROJECT.animator.framerate = real(str);
})
eb_playback = buttonGroup([__txt("Loop"), __txt("Stop")], function(b) {
eb_playback = new buttonGroup([__txt("Loop"), __txt("Stop")], function(b) {
PROJECT.animator.playback = b;
});
#endregion

View file

@ -9,7 +9,7 @@ event_inherited();
#endregion
#region data
bs_type = buttonGroup([ THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection ],
bs_type = new buttonGroup([ THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection, THEME.icon_curve_connection ],
function(val) {
PREF_MAP[? "curve_connection_line"] = val;
}

View file

@ -487,6 +487,16 @@ event_inherited();
#endregion
#region hotkey
pref_hot = ds_list_create();
ds_list_add(pref_hot, [
__txtx("pref_use_alt", "Use ALT for"),
"alt_picker",
new buttonGroup([ "Pan", "Color Picker" ], function(val) {
PREF_MAP[? "alt_picker"] = val;
PREF_SAVE();
})
])
vk_list = [
vk_left, vk_right, vk_up, vk_down, vk_space, vk_backspace, vk_tab, vk_home, vk_end, vk_delete, vk_insert,
vk_pageup, vk_pagedown, vk_pause, vk_printscreen,
@ -497,11 +507,47 @@ event_inherited();
sp_hotkey = new scrollPane(dialog_w - ui(padding + padding + page_width), dialog_h - ui(title_height + padding), function(_y, _m) {
draw_clear_alpha(COLORS.panel_bg_clear, 1);
var padd = ui(8);
var hh = 0;
var hh = ui(8);
var currGroup = noone;
var x1 = sp_hotkey.surface_w;
var key_x1 = x1 - ui(32);
var x1 = sp_hotkey.surface_w;
var key_x1 = x1 - ui(32);
var modified = false;
draw_set_text(f_p0, fa_left, fa_top);
var th = string_height("l");
var yy = _y + ui(8);
var ind = 0;
for( var i = 0, n = ds_list_size(pref_hot); i < n; i++ ) {
var _pref = pref_hot[| i];
var name = _pref[0];
var val = _pref[1];
val = is_method(val)? val() : PREF_MAP[? val];
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 + hh - padd,
sp_hotkey.surface_w, th + padd * 2, COLORS.dialog_preference_prop_bg, 1);
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(ui(16), yy + hh, _pref[0]);
_pref[2].setFocusHover(sFOCUS, sHOVER && sp_hotkey.hover);
switch(instanceof(_pref[2])) {
case "buttonGroup" :
_pref[2].draw(x1 - ui(4 + 240), yy + ui(4), ui(240), th + (padd - ui(4)) * 2, val, _m, sp_hotkey.x, sp_hotkey.y);
break;
}
yy += th + padd + ui(8);
hh += th + padd + ui(8);
ind++;
}
for(var j = 0; j < ds_list_size(HOTKEY_CONTEXT); j++) {
var ll = HOTKEYS[? HOTKEY_CONTEXT[| j]];
@ -522,21 +568,19 @@ event_inherited();
if(group != currGroup) {
if(group != "") hh += ui(12);
draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text_sub);
draw_text(ui(16), _y + hh, group == ""? __txt("Global") : group);
draw_text(ui(16), yy + hh, group == ""? __txt("Global") : group);
hh += string_height("l") + ui(16);
currGroup = group;
}
draw_set_text(f_p0, fa_left, fa_top);
var th = string_height("l");
if(i % 2 == 0) {
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, _y + hh - padd,
draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, yy + hh - padd,
sp_hotkey.surface_w, th + padd * 2, COLORS.dialog_preference_prop_bg, 1);
}
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_text);
draw_text(ui(16), _y + hh, name);
draw_text(ui(16), yy + hh, name);
var dk = key_get_name(key.key, key.modi);
var kw = string_width(dk);
@ -584,10 +628,10 @@ event_inherited();
dk = key_get_name(key.key, key.modi);
kw = string_width(dk);
draw_sprite_stretched(THEME.button_hide, 2, key_x1 - ui(40) - kw, _y + hh - ui(6), kw + ui(32), th + ui(12));
draw_sprite_stretched(THEME.button_hide, 2, key_x1 - ui(40) - kw, yy + hh - ui(6), kw + ui(32), th + ui(12));
} else {
var bx = key_x1 - ui(40) - kw;
var by = _y + hh - ui(6);
var by = yy + hh - ui(6);
if(buttonInstant(THEME.button_hide, bx, by, kw + ui(32), th + ui(12), _m, sFOCUS, sHOVER && sp_hotkey.hover) == 2) {
hk_editing = key;
keyboard_lastchar = pkey;
@ -598,12 +642,12 @@ event_inherited();
if(hk_editing == key) cc = COLORS._main_text_accent;
draw_set_text(f_p0, fa_right, fa_top, cc);
draw_text(key_x1 - ui(24), _y + hh, dk);
draw_text(key_x1 - ui(24), yy + hh, dk);
if(key.key != dkey || key.modi != dmod) {
modified = true;
var bx = x1 - ui(32);
var by = _y + hh;
var by = yy + hh;
if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset"), THEME.refresh_s) == 2) {
key.key = dkey;
key.modi = dmod;
@ -616,7 +660,7 @@ event_inherited();
if(modified) {
var bx = x1 - ui(32);
var by = _y + ui(2);
var by = yy + ui(2);
if(buttonInstant(THEME.button_hide, bx, by, ui(24), ui(24), _m, sFOCUS, sHOVER && sp_hotkey.hover, __txt("Reset all"), THEME.refresh_s) == 2) {
for(var j = 0; j < ds_list_size(HOTKEY_CONTEXT); j++) {
var ll = HOTKEYS[? HOTKEY_CONTEXT[| j]];

View file

@ -296,4 +296,8 @@
NODE_DROPPER_TARGET = noone;
NODE_DROPPER_TARGET_CAN = false;
NODE_COLOR_SHOW_PALETTE = false;
#endregion
#region debug
instance_create_depth(0, 0, 0, addon_key_displayer);
#endregion

View file

@ -4,14 +4,17 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
inputs[| 0] = nodeValue("Particle sprite", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue("Spawn delay", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 4, "Frames delay between each particle spawn.");
inputs[| 1] = nodeValue("Spawn delay", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 4, "Frames delay between each particle spawn.")
.rejectArray();
inputs[| 2] = nodeValue("Spawn amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 2, "Amount of particle spawn in that frame.");
inputs[| 2] = nodeValue("Spawn amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 2, "Amount of particle spawn in that frame.")
.rejectArray();
inputs[| 3] = nodeValue("Spawn area", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ DEF_SURF_W / 2, DEF_SURF_H / 2, DEF_SURF_W / 2, DEF_SURF_H / 2, AREA_SHAPE.rectangle ])
.setDisplay(VALUE_DISPLAY.area);
inputs[| 4] = nodeValue("Spawn distribution", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.rejectArray()
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Area", "Border", "Map", "Direct Data" ]);
inputs[| 5] = nodeValue("Lifespan", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 20, 30 ])
@ -23,7 +26,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
inputs[| 7] = nodeValue("Acceleration", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
.setDisplay(VALUE_DISPLAY.range);
inputs[| 8] = nodeValue("Orientation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [0, 0])
inputs[| 8] = nodeValue("Orientation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 0 ])
.setDisplay(VALUE_DISPLAY.rotation_range);
inputs[| 9] = nodeValue("Rotational speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
@ -44,65 +47,82 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
inputs[| 15] = nodeValue("Rotate by direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Make the particle rotates to follow its movement.");
inputs[| 16] = nodeValue("Spawn type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.rejectArray()
.setDisplay(VALUE_DISPLAY.enum_button, [ "Stream", "Burst" ]);
inputs[| 17] = nodeValue("Spawn size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ] )
.setDisplay(VALUE_DISPLAY.range);
inputs[| 18] = nodeValue("Spawn velocity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [1, 2] )
inputs[| 18] = nodeValue("Spawn velocity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 2 ] )
.setDisplay(VALUE_DISPLAY.range);
inputs[| 19] = nodeValue("Gravity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 );
inputs[| 19] = nodeValue("Gravity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 )
.rejectArray();
inputs[| 20] = nodeValue("Wiggle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 );
inputs[| 20] = nodeValue("Wiggle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 )
.rejectArray();
inputs[| 21] = nodeValue("Loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true );
inputs[| 21] = nodeValue("Loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true )
.rejectArray();
inputs[| 22] = nodeValue("Surface array", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0, "Whether to select image from an array in order, at random, or treat array as animation." )
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Random", "Order", "Animation" ])
.setVisible(false);
inputs[| 23] = nodeValue("Animation speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1 )
.rejectArray()
.setVisible(false);
inputs[| 24] = nodeValue("Scatter", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1)
.rejectArray()
.setDisplay(VALUE_DISPLAY.enum_button, [ "Uniform", "Random", "Data" ]);
inputs[| 25] = nodeValue("Boundary data", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [])
.setVisible(false, true);
inputs[| 26] = nodeValue("On animation end", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, ANIM_END_ACTION.loop)
.rejectArray()
.setDisplay(VALUE_DISPLAY.enum_button, [ "Loop", "Ping pong", "Destroy" ])
.setVisible(false);
inputs[| 27] = nodeValue("Spawn", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
inputs[| 27] = nodeValue("Spawn", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true)
.rejectArray();
inputs[| 28] = nodeValue("Random blend", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject(c_white) );
inputs[| 29] = nodeValue("Directed from center", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Make particle move away from the spawn center.");
inputs[| 29] = nodeValue("Directed from center", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Make particle move away from the spawn center.")
.rejectArray();
inputs[| 30] = nodeValue("Distribution map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0)
.rejectArray()
inputs[| 31] = nodeValue("Distribution data", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [])
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 32] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, irandom_range(100000, 999999))
.rejectArray();
inputs[| 33] = nodeValue("Gravity direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, -90 )
.rejectArray()
.setDisplay(VALUE_DISPLAY.rotation);
inputs[| 34] = nodeValue("Turning", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ] )
.setDisplay(VALUE_DISPLAY.range);
inputs[| 35] = nodeValue("Turn both directions", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Apply randomized 1, -1 multiplier to the turning speed." );
inputs[| 35] = nodeValue("Turn both directions", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false, "Apply randomized 1, -1 multiplier to the turning speed." )
.rejectArray();
inputs[| 36] = nodeValue("Turn scale with speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false );
inputs[| 36] = nodeValue("Turn scale with speed", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false )
.rejectArray();
inputs[| 37] = nodeValue("Collide ground", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false );
inputs[| 37] = nodeValue("Collide ground", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false )
.rejectArray();
inputs[| 38] = nodeValue("Ground offset", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 );
inputs[| 38] = nodeValue("Ground offset", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 )
.rejectArray();
inputs[| 39] = nodeValue("Bounce amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5 )
.rejectArray()
.setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ]);
input_len = ds_list_size(inputs);

View file

@ -174,7 +174,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
if(buttonInstant(THEME.button_hide, _x + ui(76 - 24), _y + ui(28 - 12), ui(24), ui(24), _m, active, hover, txt, THEME.inspector_area_type, mode, c_white) == 2) {
switch(mode) {
case AREA_MODE.area :
case AREA_MODE.area : //area to padding
var cx = array_safe_get(_data, 0);
var cy = array_safe_get(_data, 1);
var sw = array_safe_get(_data, 2);
@ -187,7 +187,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
onModify(3, ss[1] - (cy + sh));
break;
case AREA_MODE.padding :
case AREA_MODE.padding : //padding to two points
var r = array_safe_get(_data, 0);
var t = array_safe_get(_data, 1);
var l = array_safe_get(_data, 2);
@ -200,7 +200,7 @@ function areaBox(_onModify, _unit = noone) : widget() constructor {
onModify(3, ss[1] - b);
break;
case AREA_MODE.two_point :
case AREA_MODE.two_point : //twp points to area
var x0 = array_safe_get(_data, 0);
var y0 = array_safe_get(_data, 1);
var x1 = array_safe_get(_data, 2);

View file

@ -1,8 +1,4 @@
function buttonGroup(_data, _onClick) {
return new buttonGroupClass(_data, _onClick);
}
function buttonGroupClass(_data, _onClick) : widget() constructor {
function buttonGroup(_data, _onClick) : widget() constructor {
data = _data;
onClick = _onClick;
display_button = false;

View file

@ -87,7 +87,7 @@ function colorSelector(onApply = noone) constructor {
resetHSV();
})
scr_disp = buttonGroup(["Hue", "Value"], function(mode) { disp_mode = mode; } );
scr_disp = new buttonGroup(["Hue", "Value"], function(mode) { disp_mode = mode; } );
function resetHSV() {
hue = round(color_get_hue(current_color));

View file

@ -16,6 +16,8 @@
SHIFT = KEYBOARD_STATUS.idle;
function key_release() {
gml_pragma("forceinline");
CTRL = KEYBOARD_STATUS.up;
ALT = KEYBOARD_STATUS.up;
SHIFT = KEYBOARD_STATUS.up;
@ -26,10 +28,14 @@
}
function key_mod_press(key) {
gml_pragma("forceinline");
return key == KEYBOARD_STATUS.pressing;
}
function key_mod_press_index(keyindex) {
gml_pragma("forceinline");
switch(keyindex) {
case MOD_KEY.alt : return ALT == KEYBOARD_STATUS.pressing;
case MOD_KEY.shift : return SHIFT == KEYBOARD_STATUS.pressing;
@ -46,11 +52,15 @@
WIDGET_CURRENT_SCROLL = noone;
function widget_start() {
gml_pragma("forceinline");
if(array_length(WIDGET_ACTIVE) == 0) return;
WIDGET_ACTIVE[0].activate();
}
function widget_next() {
gml_pragma("forceinline");
if(array_length(WIDGET_ACTIVE) == 0) return;
if(WIDGET_CURRENT == noone) {
widget_start()

View file

@ -92,10 +92,10 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER;
VERSION = 11471;
VERSION = 11472;
SAVE_VERSION = 11470;
VERSION_STRING = "1.14.7.1";
BUILD_NUMBER = 11471;
VERSION_STRING = "1.15rc1";
BUILD_NUMBER = 11472;
globalvar APPEND_MAP;
APPEND_MAP = ds_map_create();

View file

@ -29,6 +29,7 @@ function LOAD_PATH(path, readonly = false, safe_mode = false) {
PROJECT = new Project();
if(PANEL_GRAPH.project.path == "" && !PANEL_GRAPH.project.modified) {
var ind = array_find(PROJECTS, PANEL_GRAPH.project);
if(ind == -1) ind = 0;
PROJECTS[ind] = PROJECT;
PANEL_GRAPH.setProject(PROJECT);

View file

@ -1,6 +1,6 @@
#region attribute
global.SURFACE_INTERPOLATION = [
"No aliasing",
"Pixel",
"Bilinear",
"Bicubic",
"radSin"

View file

@ -1,6 +1,7 @@
function Node_Cache(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Cache";
use_cache = true;
clearCacheOnChange = false;
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);

View file

@ -1,6 +1,7 @@
function Node_Cache_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Cache Array";
use_cache = true;
clearCacheOnChange = false;
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
@ -27,17 +28,17 @@ function Node_Cache_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constru
static onInspector2Update = function() { clearCache(); }
static step = function() {
if(cache_loading) {
var _content = cache_content[cache_loading_progress];
if(!cache_loading) return;
var _content = cache_content[cache_loading_progress];
cached_output[cache_loading_progress] = __surface_array_deserialize(_content);
cache_result[cache_loading_progress] = true;
cache_loading_progress++;
cached_output[cache_loading_progress] = __surface_array_deserialize(_content);
cache_result[cache_loading_progress] = true;
cache_loading_progress++;
if(cache_loading_progress == array_length(cache_content)) {
cache_loading = false;
update();
}
if(cache_loading_progress == array_length(cache_content)) {
cache_loading = false;
update();
}
}

View file

@ -787,7 +787,7 @@ function Node_Composite(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var imageAmo = (ds_list_size(inputs) - input_fix_len) / data_length;
var _vis = attributes.layer_visible;
surface_set_shader(_outSurf, sh_sample, true, BLEND.alphamulp);
surface_set_shader(_outSurf, sh_sample, true, BLEND.alpha);
for(var i = 0; i < imageAmo; i++) {
var vis = _vis[i];

View file

@ -1078,6 +1078,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
static clearCache = function() {
clearInputCache();
if(!clearCacheOnChange) return;
if(!use_cache) return;
if(!isRenderActive()) return;
@ -1093,7 +1094,6 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
}
static clearCacheForward = function() {
if(!clearCacheOnChange) return;
_clearCacheForward();
}
@ -1247,6 +1247,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
static getPreviewBoundingBox = function() {
var _node = getPreviewValue();
if(_node == undefined) return noone;
if(_node.type != VALUE_TYPE.surface) return noone;
var _surf = _node.getValue();

View file

@ -12,8 +12,10 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
size_dragging_my = h;
auto_height = false;
name_hover = false;
draw_scale = 1;
name_hover = false;
draw_scale = 1;
ta_editor = new textArea(TEXTBOX_INPUT.text, function(val) { inputs[| 1].setValue(val); })
inputs[| 0] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white )
.rejectArray();
@ -29,7 +31,7 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01])
.rejectArray();
inputs[| 4] = nodeValue("Line width", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1000000)
inputs[| 4] = nodeValue("Line width", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, -1)
.rejectArray();
input_display_list = [1,
@ -172,34 +174,42 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
return ss;
}
static line_update = function(txt, line_width = 999999) {
static line_update = function(txt, line_width = -1) {
_prev_text = txt;
_lines = [];
var ch, i = 1, ss = "", _txt = _prev_text;
var len = string_length(_prev_text);
var _line_man = string_splice(_txt, "\n");
draw_set_font(font);
while(string_length(_txt) > 0) {
var sp = string_pos(" ", _txt);
if(sp == 0) sp = string_length(_txt);
for( var i = 0, n = array_length(_line_man); i < n; i++ ) {
var _tx = _line_man[i];
var _ps = string_copy(_txt, 1, sp);
_txt = string_copy(_txt, sp + 1, string_length(_txt) - sp);
while(string_length(_tx) > 0) {
var sp = min(string_pos("\n", _tx), string_pos(" ", _tx));
if(sp == 0) sp = string_length(_tx);
if(string_width(string_raw(ss + _ps)) >= line_width) {
array_push(_lines, ss);
ss = _ps;
} else if(string_length(_txt) <= 0) {
array_push(_lines, ss + _ps);
ss = "";
} else {
ss += _ps;
var _ps = string_copy(_tx, 1, sp);
_tx = string_copy(_tx, sp + 1, string_length(_tx) - sp);
if(line_width > 0 && string_width(string_raw(ss + _ps)) >= line_width) {
array_push(_lines, ss);
ss = _ps;
} else if(string_length(_tx) <= 0) {
array_push(_lines, ss + _ps);
ss = "";
} else if(string_char_at(_ps, string_length(_ps)) == "\n") {
array_push(_lines, ss + _ps);
ss = "";
} else
ss += _ps;
}
}
if(ss != "")
array_push(_lines, ss);
if(ss != "") array_push(_lines, ss);
}
static onValueUpdate = function(index = 0) {
@ -207,7 +217,7 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
line_update(inputs[| 1].getValue(), inputs[| 4].getValue());
}
static drawNodeBase = function(xx, yy, _s) {
static drawNodeBase = function(xx, yy, mx, my, _s) {
var color = inputs[| 0].getValue();
var txt = inputs[| 1].getValue();
if(txt == "") txt = "..."
@ -224,24 +234,37 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
var ww = 0;
var hh = 0;
var tx = xx + 4;
var ty = yy + 4;
if(_prev_text != txt)
line_update(txt, wid);
draw_set_alpha(alp);
draw_set_text(font, fa_left, fa_top, color);
for( var i = 0, n = array_length(_lines); i < n; i++ ) {
var _line = _lines[i];
var _h = line_get_height(font);
var _w = draw_text_style(tx, ty, _line, _s);
ww = max(ww, _w);
hh += _h;
ty += _h * _s;
if(WIDGET_CURRENT == ta_editor) {
ta_editor.font = font;
ta_editor.draw(tx, ty, wid * _s, 0, txt, [ mx, my ] );
} else {
if(_prev_text != txt)
line_update(txt, wid);
draw_set_alpha(alp);
draw_set_text(font, fa_left, fa_top, color);
for( var i = 0, n = array_length(_lines); i < n; i++ ) {
var _line = _lines[i];
var _h = line_get_height(font);
var _w = draw_text_style(tx, ty, _line, _s);
ww = max(ww, _w);
hh += _h;
ty += _h * _s;
}
draw_set_alpha(1);
if(PANEL_GRAPH.node_hovering == self && PANEL_GRAPH.node_focus == self) {
if(point_in_rectangle(mx, my, xx, yy, xx + ww + 8, yy + hh + 8) && DOUBLE_CLICK) {
ta_editor._current_text = txt;
ta_editor.activate();
}
}
}
draw_set_alpha(1);
draw_scale = _s;
w = ww + 8;
@ -257,7 +280,7 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
active_draw_index = -1;
}
drawNodeBase(xx, yy, _s);
drawNodeBase(xx, yy, _mx, _my, _s);
return noone;
}
}

View file

@ -7,9 +7,11 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _
inputs[| input_len + 0] = nodeValue("Output dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF)
.setDisplay(VALUE_DISPLAY.vector);
inputs[| input_len + 1] = nodeValue("Round position", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Round position to the closest integer value to avoid jittering.");
inputs[| input_len + 1] = nodeValue("Round position", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Round position to the closest integer value to avoid jittering.")
.rejectArray();
inputs[| input_len + 2] = nodeValue("Blend mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0 )
.rejectArray()
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Normal", "Alpha", "Additive" ]);
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);

View file

@ -692,8 +692,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
break;
case VALUE_DISPLAY.area :
editWidget = new areaBox(function(index, val) {
//var _val = animator.getValue();
//_val[index] = val;
return setValueDirect(val, index);
}, unit);
if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1);
@ -751,7 +749,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
extract_node = "";
break;
case VALUE_DISPLAY.enum_button :
editWidget = buttonGroup(display_data, function(val) {
editWidget = new buttonGroup(display_data, function(val) {
return setValueDirect(val);
} );
@ -988,35 +986,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
return [ value ];
}
if(display_type == VALUE_DISPLAY.area) {
var dispType = struct_try_get(nodeFrom.extra_data, "area_type", AREA_MODE.area);
var surfGet = nodeFrom.display_data;
if(!applyUnit || surfGet == -1) return value;
var surf = surfGet();
var ww = surf[0];
var hh = surf[1];
switch(dispType) {
case AREA_MODE.area :
return value;
case AREA_MODE.padding :
var cx = (ww - value[0] + value[2]) / 2
var cy = (value[1] + hh - value[3]) / 2;
var sw = abs((ww - value[0]) - value[2]) / 2;
var sh = abs(value[1] - (hh - value[3])) / 2;
return [cx, cy, sw, sh, value[4]];
case AREA_MODE.two_point :
var cx = (value[0] + value[2]) / 2
var cy = (value[1] + value[3]) / 2;
var sw = abs(value[0] - value[2]) / 2;
var sh = abs(value[1] - value[3]) / 2;
return [cx, cy, sw, sh, value[4]];
}
}
if(type == VALUE_TYPE.text) {
switch(display_type) {
case VALUE_DISPLAY.text_array :
@ -1306,10 +1275,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
else UPDATE |= RENDER_TYPE.partial;
}
if(!LOADING) {
//print("setValueDirect");
PROJECT.modified = true;
}
if(!LOADING) PROJECT.modified = true;
cache_value[0] = false;
}
onValidate();

View file

@ -1288,7 +1288,7 @@ function Panel_Animation() : PanelContent() constructor {
key = ds_map_find_next(PROJECT.nodeMap, key);
if(!_node || !_node.active) continue;
for(var i = 0; i < ds_list_size(n.inputs); i++) {
for(var i = 0; i < ds_list_size(_node.inputs); i++) {
var in = _node.inputs[| i];
if(!in.is_anim) continue;

View file

@ -12,7 +12,6 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
setProject(project);
scale = [ 0.01, 0.02, 0.05, 0.10, 0.15, 0.20, 0.25, 0.33, 0.5, 0.65, 0.8, 1, 1.2, 1.35, 1.5, 2.0];
graph_s_index = array_find(scale, 1);
graph_s = 1;
graph_s_to = graph_s;
graph_line_s = 32;
@ -20,12 +19,21 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
grid_opacity = 0.05;
graph_dragging_key = false;
graph_zooming_key = false;
graph_draggable= true;
graph_dragging = false;
graph_drag_mx = 0;
graph_drag_my = 0;
graph_drag_sx = 0;
graph_drag_sy = 0;
graph_zooming = false;
graph_zoom_mx = 0;
graph_zoom_my = 0;
graph_zoom_m = 0;
graph_zoom_s = 0;
drag_key = mb_middle;
drag_locking = false;
@ -250,7 +258,14 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
addHotkey("Graph", "Copy", "C", MOD_KEY.ctrl, function() { PANEL_GRAPH.doCopy(); });
addHotkey("Graph", "Paste", "V", MOD_KEY.ctrl, function() { PANEL_GRAPH.doPaste(); });
addHotkey("Graph", "Pan", "", MOD_KEY.alt, function() { PANEL_GRAPH.graph_dragging_key = true; });
addHotkey("Graph", "Pan", "", MOD_KEY.alt, function() {
if(PREF_MAP[? "alt_picker"]) return;
PANEL_GRAPH.graph_dragging_key = true;
});
addHotkey("Graph", "Zoom", "", MOD_KEY.alt | MOD_KEY.ctrl, function() {
if(PREF_MAP[? "alt_picker"]) return;
PANEL_GRAPH.graph_zooming_key = true;
});
function onFocusBegin() {
PANEL_GRAPH = self;
@ -315,14 +330,48 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
graph_dragging = false;
}
if(graph_zooming) {
if(!MOUSE_WRAPPING) {
var dy = -(my - graph_zoom_m) / 200;
var _s = graph_s;
graph_s_to = clamp(graph_s_to * (1 + dy), scale[0], scale[array_length(scale) - 1]);
graph_s = graph_s_to;
if(_s != graph_s) {
var mb_x = (graph_zoom_mx - graph_x * _s) / _s;
var ma_x = (graph_zoom_mx - graph_x * graph_s) / graph_s;
var md_x = ma_x - mb_x;
graph_x += md_x;
var mb_y = (graph_zoom_my - graph_y * _s) / _s;
var ma_y = (graph_zoom_my - graph_y * graph_s) / graph_s;
var md_y = ma_y - mb_y;
graph_y += md_y;
}
}
graph_zoom_m = my;
setMouseWrap();
if(mouse_release(drag_key))
graph_zooming = false;
}
if(mouse_on_graph && pFOCUS && graph_draggable) {
var _doDragging = false;
var _doZooming = false;
if(mouse_press(mb_middle)) {
_doDragging = true;
drag_key = mb_middle;
} else if(mouse_press(mb_left) && graph_dragging_key) {
_doDragging = true;
drag_key = mb_left;
} else if(mouse_press(mb_left) && graph_zooming_key) {
_doZooming = true;
drag_key = mb_left;
}
if(_doDragging) {
@ -332,18 +381,35 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
graph_drag_sx = graph_x;
graph_drag_sy = graph_y;
}
if(_doZooming) {
graph_zooming = true;
graph_zoom_mx = mx;
graph_zoom_my = my;
graph_zoom_m = my;
graph_zoom_s = graph_s;
}
}
if(mouse_on_graph && pHOVER && graph_draggable) {
var _s = graph_s;
if(mouse_wheel_down()) {
graph_s_index = max(0, graph_s_index - 1);
graph_s_to = ui(scale[graph_s_index]);
if(mouse_wheel_down()) { //zoom out
for( var i = 1, n = array_length(scale); i < n; i++ ) {
if(scale[i - 1] < graph_s_to && graph_s_to <= scale[i]) {
graph_s_to = scale[i - 1];
break;
}
}
}
if(mouse_wheel_up()) {
graph_s_index = min(array_length(scale) - 1, graph_s_index + 1);
graph_s_to = ui(scale[graph_s_index]);
if(mouse_wheel_up()) { // zoom in
for( var i = 1, n = array_length(scale); i < n; i++ ) {
if(scale[i - 1] <= graph_s_to && graph_s_to < scale[i]) {
graph_s_to = scale[i];
break;
}
}
}
graph_s = lerp_float(graph_s, graph_s_to, PREF_MAP[? "graph_zoom_smoooth"]);
if(_s != graph_s) {
@ -909,7 +975,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
nodes_junction_d = noone;
}
if(mouse_on_graph && mouse_press(mb_left, pFOCUS) && !graph_dragging_key) {
if(mouse_on_graph && mouse_press(mb_left, pFOCUS) && !graph_dragging_key && !graph_zooming_key) {
if(junction_hovering && junction_hovering.draw_line_shift_hover) {
nodes_select_mx = mx;
nodes_select_my = my;
@ -1811,6 +1877,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
}
graph_dragging_key = false;
graph_zooming_key = false;
}
static checkDropItem = function() {

View file

@ -22,6 +22,8 @@ function Panel_Inspector() : PanelContent() constructor {
prop_sel_drag_x = 0;
prop_sel_drag_y = 0;
color_picking = false;
static initSize = function() {
content_w = w - ui(32);
content_h = h - top_bar_h - ui(12);
@ -49,7 +51,7 @@ function Panel_Inspector() : PanelContent() constructor {
tb_prop_filter.hide = true;
filter_text = "";
prop_page_button = buttonGroup([ "Properties", "Settings" ], function(val) { prop_page = val; });
prop_page_button = new buttonGroup([ "Properties", "Settings" ], function(val) { prop_page = val; });
prop_page_button.buttonSpr = [ THEME.button_hide_left, THEME.button_hide_middle, THEME.button_hide_right ];
prop_page_button.font = f_p1;
prop_page_button.fColor = COLORS._main_text_sub;
@ -79,6 +81,11 @@ function Panel_Inspector() : PanelContent() constructor {
addHotkey("Inspector", "Paste property", "V", MOD_KEY.ctrl, function() { PANEL_INSPECTOR.propSelectPaste(); });
addHotkey("Inspector", "Toggle animation", "I", MOD_KEY.none, function() { PANEL_INSPECTOR.anim_toggling = true; });
addHotkey("", "Color picker", "", MOD_KEY.alt, function() {
if(!PREF_MAP[? "alt_picker"]) return;
PANEL_INSPECTOR.color_picking = true;
});
group_menu = [
menuItem(__txt("Expand all"), function() {
if(inspecting == noone) return;
@ -503,7 +510,7 @@ function Panel_Inspector() : PanelContent() constructor {
if(jun.connect_type == JUNCTION_CONNECT.input && jun.type == VALUE_TYPE.color && jun.display_type == VALUE_DISPLAY._default) {
pickers[color_picker_index] = jun;
if(color_picker_index == picker_index) {
if(ALT == KEYBOARD_STATUS.down && WIDGET_CURRENT == noone)
if(color_picking && WIDGET_CURRENT == noone && !instance_exists(_p_dialog))
jun.editWidget.onColorPick();
color_picker_selecting = jun;
}
@ -623,6 +630,8 @@ function Panel_Inspector() : PanelContent() constructor {
prop_dragging = noone;
}
color_picking = false;
return hh;
});

View file

@ -31,6 +31,13 @@ function Panel_Preview() : PanelContent() constructor {
canvas_drag_sx = 0;
canvas_drag_sy = 0;
canvas_zooming_key = false;
canvas_zooming = false;
canvas_zoom_mx = 0;
canvas_zoom_my = 0;
canvas_zoom_m = 0;
canvas_zoom_s = 0;
sample_color = noone;
sample_x = noone;
sample_y = noone;
@ -158,7 +165,14 @@ function Panel_Preview() : PanelContent() constructor {
addHotkey("Preview", "Preview window", "P", MOD_KEY.ctrl, function() { create_preview_window(PANEL_PREVIEW.getNodePreview()); });
addHotkey("Preview", "Toggle grid", "G", MOD_KEY.ctrl, function() { PANEL_PREVIEW.grid_show = !PANEL_PREVIEW.grid_show; });
addHotkey("Preview", "Pan", "", MOD_KEY.alt, function() { PANEL_PREVIEW.canvas_dragging_key = true; });
addHotkey("Preview", "Pan", "", MOD_KEY.alt, function() {
if(PREF_MAP[? "alt_picker"]) return;
PANEL_PREVIEW.canvas_dragging_key = true;
});
addHotkey("Preview", "Zoom", "", MOD_KEY.alt | MOD_KEY.ctrl, function() {
if(PREF_MAP[? "alt_picker"]) return;
PANEL_PREVIEW.canvas_zooming_key = true;
});
function setNodePreview(node) {
if(resetViewOnDoubleClick)
@ -242,17 +256,44 @@ function Panel_Preview() : PanelContent() constructor {
canvas_dragging = false;
}
if(canvas_zooming) {
if(!MOUSE_WRAPPING) {
var dy = -(my - canvas_zoom_m) / 200;
var _s = canvas_s;
canvas_s = clamp(canvas_s * (1 + dy), 0.10, 64);
if(_s != canvas_s) {
var dx = (canvas_s - _s) * ((canvas_zoom_mx - canvas_x) / _s);
var dy = (canvas_s - _s) * ((canvas_zoom_my - canvas_y) / _s);
canvas_x -= dx;
canvas_y -= dy;
}
}
canvas_zoom_m = my;
setMouseWrap();
if(mouse_release(canvas_drag_key))
canvas_zooming = false;
}
if(pFOCUS && pHOVER && canvas_hover) {
var hold = false;
var _doDragging = false;
var _doZooming = false;
if(mouse_press(mb_middle)) {
hold = true;
_doDragging = true;
canvas_drag_key = mb_middle;
} else if(mouse_press(mb_left) && canvas_dragging_key) {
hold = true;
_doDragging = true;
canvas_drag_key = mb_left;
} else if(mouse_press(mb_left) && canvas_zooming_key) {
_doZooming = true;
canvas_drag_key = mb_left;
}
if(hold) {
if(_doDragging) {
canvas_dragging = true;
canvas_drag_mx = mx;
canvas_drag_my = my;
@ -260,6 +301,14 @@ function Panel_Preview() : PanelContent() constructor {
canvas_drag_sy = canvas_y;
}
if(_doZooming) {
canvas_zooming = true;
canvas_zoom_mx = mx;
canvas_zoom_my = my;
canvas_zoom_m = my;
canvas_zoom_s = canvas_s;
}
var _canvas_s = canvas_s;
var inc = 0.1;
if(canvas_s > 16) inc = 2;
@ -278,6 +327,7 @@ function Panel_Preview() : PanelContent() constructor {
}
canvas_dragging_key = false;
canvas_zooming_key = false;
canvas_hover = point_in_rectangle(mx, my, 0, toolbar_height, w, h - toolbar_height);
}

View file

@ -70,6 +70,8 @@
PREF_MAP[? "save_file_minify"] = true;
PREF_MAP[? "render_all_export"] = true;
PREF_MAP[? "alt_picker"] = true;
#endregion
#region hotkeys

View file

@ -3,7 +3,7 @@ SAVING = false;
function NEW() {
PROJECT = new Project();
array_append(PROJECTS, PROJECT);
array_push(PROJECTS, PROJECT);
var graph = new Panel_Graph(PROJECT);
PANEL_GRAPH.panel.setContent(graph, true);

View file

@ -104,7 +104,7 @@ function shader_set_palette(pal, pal_uni = "palette", amo_uni = "paletteAmount",
}
function shader_set_interpolation(surface) {
var intp = struct_try_get(attributes, "interpolation", 0);
var intp = attributes.interpolation;
gpu_set_tex_filter(intp);
shader_set_i("interpolation", intp);

View file

@ -12,7 +12,8 @@ function struct_override(original, override) {
}
function struct_try_get(struct, key, def = 0) {
if(struct_has(struct, key)) return struct[$ key];
if(struct[$ key] != undefined) return struct[$ key];
key = string_replace_all(key, "_", " ");
return struct_has(struct, key)? struct[$ key] : def;
return struct[$ key] ?? def;
}

View file

@ -15,11 +15,12 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
_input_text_line = [];
_input_text_line_index = [];
_current_text = "";
_input_text = "";
_prev_text = "";
_last_value = "";
_prev_width = 0;
_current_text = "";
_input_text = "";
_prev_text = "";
_last_value = "";
_prev_width = 0;
_stretch_width = false;
min_lines = 0;
@ -579,14 +580,15 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
w = _w;
h = _h;
_stretch_width = _w < 0;
_text = string_real(_text);
_current_text = _text;
//if(format == TEXT_AREA_FORMAT.code) {
// print("=== TEXT BOX ===");
// print(_text);
// print(_current_text);
//}
draw_set_font(font);
if(_stretch_width) {
_w = string_width(self == WIDGET_CURRENT? _input_text : _text) + ui(16);
w = _w;
}
if(extras && instanceof(extras) == "buttonClass") {
extras.setFocusHover(active, hover);
@ -604,9 +606,10 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
tx += ui(code_line_width);
}
if(_stretch_width) line_width = 9999999;
cursor_tx = tx;
draw_set_font(font);
var c_h = line_get_height();
var line_count = max(min_lines, array_length(_input_text_line));
hh = max(_h, ui(14) + c_h * line_count);

View file

@ -7,7 +7,7 @@ function Theme() constructor {
group_label = noone;
shadow_drop_down_24 = noone;
menu_bg = noone;
accept = noone;
add = noone;
animate_clock = noone;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 432 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 612 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 614 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -2,10 +2,10 @@
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_key_display_mouse",
"bbox_bottom": 95,
"bbox_bottom": 63,
"bbox_left": 0,
"bbox_right": 71,
"bbox_top": 1,
"bbox_right": 47,
"bbox_top": 0,
"bboxMode": 0,
"collisionKind": 1,
"collisionTolerance": 0,
@ -13,19 +13,17 @@
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"7b438e2a-5a36-4ccf-90a6-4f7eda60ab61",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"9d877d47-45ed-4780-b05e-01663f6cb2c4",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"fc878844-5fcb-433e-8a2e-051f63fa0c89",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"62a0178d-1443-4d4f-8fe5-439bef18ef3a",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"d33d7943-e859-4525-a61c-3473ff442f1b",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"21bd74ca-b973-404d-8103-759924ba46db",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"b078fecf-9fc0-4616-8822-9baba8e9a823",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"e50b9852-1d82-4311-8ecb-99f0cf889aa3",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"b559309e-245a-404b-a5e5-f96d82af92af",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"751b8f29-3c58-47a7-ab0a-b665db885725",},
],
"gridX": 0,
"gridY": 0,
"height": 96,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"aede1936-7ef8-4772-adf7-8817a09f7cd1","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"a8a23aaf-66fe-4c32-9cc1-692691b7acfc","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 8,
@ -48,7 +46,7 @@
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"eventStubScript": null,
"eventToFunction": {},
"length": 6.0,
"length": 4.0,
"lockOrigin": false,
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"playback": 1,
@ -59,18 +57,16 @@
"timeUnits": 1,
"tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"7b438e2a-5a36-4ccf-90a6-4f7eda60ab61","path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",},},},"Disabled":false,"id":"5c634ef5-f13f-43ba-8e3b-88ff626c4a84","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"9d877d47-45ed-4780-b05e-01663f6cb2c4","path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",},},},"Disabled":false,"id":"97cfe72f-03be-41ef-bb68-6842163a702f","IsCreationKey":false,"Key":1.0,"Length":1.0,"Stretch":false,},
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"fc878844-5fcb-433e-8a2e-051f63fa0c89","path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",},},},"Disabled":false,"id":"1f74dc4b-06bd-45b2-84a1-02c2527cf188","IsCreationKey":false,"Key":2.0,"Length":1.0,"Stretch":false,},
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"62a0178d-1443-4d4f-8fe5-439bef18ef3a","path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",},},},"Disabled":false,"id":"acf82075-61dc-4ee9-9848-b3c5634666da","IsCreationKey":false,"Key":3.0,"Length":1.0,"Stretch":false,},
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"d33d7943-e859-4525-a61c-3473ff442f1b","path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",},},},"Disabled":false,"id":"1ef540d9-7d79-4acd-b0ec-4a9e21047188","IsCreationKey":false,"Key":4.0,"Length":1.0,"Stretch":false,},
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"21bd74ca-b973-404d-8103-759924ba46db","path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",},},},"Disabled":false,"id":"795a6f99-c238-4d67-9974-6f02a1b83076","IsCreationKey":false,"Key":5.0,"Length":1.0,"Stretch":false,},
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"b078fecf-9fc0-4616-8822-9baba8e9a823","path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",},},},"Disabled":false,"id":"9ef9832d-3fcb-4896-aee4-ff70e3a54003","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"e50b9852-1d82-4311-8ecb-99f0cf889aa3","path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",},},},"Disabled":false,"id":"e67077c6-8324-47ca-b482-b9133afb9763","IsCreationKey":false,"Key":1.0,"Length":1.0,"Stretch":false,},
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"b559309e-245a-404b-a5e5-f96d82af92af","path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",},},},"Disabled":false,"id":"9a782870-cd5f-423c-bd34-89a86dbc81a3","IsCreationKey":false,"Key":2.0,"Length":1.0,"Stretch":false,},
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"751b8f29-3c58-47a7-ab0a-b665db885725","path":"sprites/s_key_display_mouse/s_key_display_mouse.yy",},},},"Disabled":false,"id":"230b4df3-6635-43de-8f8a-8fa2ecc4d748","IsCreationKey":false,"Key":3.0,"Length":1.0,"Stretch":false,},
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange": null,
"volume": 1.0,
"xorigin": 72,
"yorigin": 96,
"xorigin": 48,
"yorigin": 64,
},
"swatchColours": null,
"swfPrecision": 2.525,
@ -80,5 +76,5 @@
},
"type": 0,
"VTile": false,
"width": 72,
"width": 48,
}