This commit is contained in:
Tanasart 2023-08-06 16:00:59 +02:00
parent 7e69f6088d
commit 98e6f416b4
30 changed files with 37354 additions and 1770 deletions

View file

@ -254,7 +254,6 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"UI.json","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"words.json","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"nodes.json","CopyToMask":-1,"filePath":"datafiles/data",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"default x2.zip","CopyToMask":-1,"filePath":"datafiles/data/themes",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"default.zip","CopyToMask":-1,"filePath":"datafiles/data/themes",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"FiraCode-Medium.ttf","CopyToMask":-1,"filePath":"datafiles/data/themes/default/fonts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"fonts.json","CopyToMask":-1,"filePath":"datafiles/data/themes/default/fonts",},
@ -624,7 +623,6 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"5 Particle and effectors.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"5 Particle and effectors.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"6 Camera.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"6 Camera.pxc","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"7 Path.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"8 Batch processing.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"9 Armature.png","CopyToMask":-1,"filePath":"datafiles/Getting started",},

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -53,10 +53,10 @@ event_inherited();
content_w = dialog_w - ui(36) - folderW;
content_h = dialog_h - ui(32);
contentPane.resize(content_w, content_h);
folderPane.resize(folderW - ui(8), content_h - ui(32));
folderPane.resize(folderW - ui(12), content_h - ui(32));
}
folderPane = new scrollPane(folderW - ui(8), content_h - ui(32), function(_y, _m) {
folderPane = new scrollPane(folderW - ui(12), content_h - ui(32), function(_y, _m) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
var hh = 8;

View file

@ -60,13 +60,13 @@ event_inherited();
#region new preset
function newPresetFromNode(name) {
if(node == noone) return;
var dir = DIRECTORY + "Presets/" + instanceof(node) + "/";
var dir = $"{DIRECTORY}Presets/{instanceof(node)}/";
if(!directory_exists(dir))
directory_create(dir);
var pth = dir + name + ".json";
var map = node.serialize(true, true);
json_save(pth, map);
json_save_struct(pth, map);
__initPresets();
}
#endregion

View file

@ -70,6 +70,7 @@
function applyAutoComplete(rep) {
var line = array_safe_get(textbox._input_text_line, textbox.cursor_line, "");
var crop = string_copy(line, 1, textbox.cursor - textbox.char_run);
var rest = string_copy(line, textbox.cursor + 1, string_length(line) - textbox.cursor);
var slp = string_splice(crop, [" ", "(", ","], true);
slp[array_length(slp) - 1] = rep;
@ -78,12 +79,14 @@
if(i == textbox.cursor_line) {
for( var j = 0; j < array_length(slp); j++ )
txt += slp[j];
txt += rest;
continue;
}
txt += textbox._input_text_line[i];
}
txt = string_trim(txt, [ "\n" ]);
var shf = string_length(rep) - string_length(prompt);
textbox.cursor += shf;

View file

@ -31,9 +31,7 @@ if(textbox != WIDGET_CURRENT) exit;
#region draw
draw_sprite_stretched(THEME.textbox, 3, dialog_x, dialog_y, dialog_w, dialog_h);
sc_content.draw(dialog_x, dialog_y);
draw_sprite_stretched(THEME.textbox, 1, dialog_x, dialog_y, dialog_w, dialog_h);
#endregion

View file

@ -1,4 +1,6 @@
function FileObject(_name, _path) constructor {
static loadThumbnailAsync = false;
name = _name;
path = _path;
spr_path = [];
@ -54,11 +56,16 @@ function FileObject(_name, _path) constructor {
if(sprFetchID != noone) return -1;
if(array_length(spr_path) == 0) {
sprFetchID = sprite_add_ext(self.path, 0, 0, 0, false);
IMAGE_FETCH_MAP[? sprFetchID] = function(load_result) {
spr = load_result[? "id"];
if(loadThumbnailAsync) {
sprFetchID = sprite_add_ext(self.path, 0, 0, 0, true);
IMAGE_FETCH_MAP[? sprFetchID] = function(load_result) {
spr = load_result[? "id"];
sprite_set_offset(spr, sprite_get_width(spr) / 2, sprite_get_height(spr) / 2);
};
} else {
spr = sprite_add(self.path, 0, false, false, 0, 0);
sprite_set_offset(spr, sprite_get_width(spr) / 2, sprite_get_height(spr) / 2);
};
}
return spr;
}
@ -67,12 +74,18 @@ function FileObject(_name, _path) constructor {
if(path == 0) return -1;
sprFetchID = sprite_add_ext(path, amo, 0, 0, false);
IMAGE_FETCH_MAP[? sprFetchID] = function(load_result) {
spr = load_result[? "id"];
if(array_safe_get(spr_path, 2))
sprite_set_offset(spr, sprite_get_width(spr) / 2, sprite_get_height(spr) / 2);
};
if(loadThumbnailAsync) {
sprFetchID = sprite_add_ext(path, amo, 0, 0, true);
IMAGE_FETCH_MAP[? sprFetchID] = function(load_result) {
spr = load_result[? "id"];
if(array_safe_get(spr_path, 2))
sprite_set_offset(spr, sprite_get_width(spr) / 2, sprite_get_height(spr) / 2);
};
} else {
spr = sprite_add(path, amo, false, false, 0, 0);
if(array_safe_get(spr_path, 2))
sprite_set_offset(spr, sprite_get_width(spr) / 2, sprite_get_height(spr) / 2);
}
return spr;
}

View file

@ -218,7 +218,7 @@ function MetaDataManager() constructor {
var path = DIRECTORY + "meta.json";
if(!file_exists(path)) return meta;
var over = json_load(path);
var over = json_load_struct(path);
return meta.deserialize(over);
}
#endregion

View file

@ -175,7 +175,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
doUpdate();
}
run_in(1, method(self, resetDefault));
if(!APPENDING && !LOADING)
run_in(1, method(self, resetDefault));
static getInputJunctionIndex = function(index) {
if(input_display_list == -1)

View file

@ -102,7 +102,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru
outputs[| 0] = nodeValue("Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, 0)
.uncache();
attributes.inherit_name = true;
attributes.inherit_name = !LOADING && !APPENDING;
doTrigger = 0;
_onSetDisplayName = function() {

View file

@ -17,7 +17,7 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr
.uncache()
.rejectArray();
attributes.inherit_name = true;
attributes.inherit_name = !LOADING && !APPENDING;
outParent = undefined;
output_index = -1;

View file

@ -303,9 +303,9 @@ function Panel_Animation() : PanelContent() constructor {
]),
-1,
menuItemGroup(__txt("Align"), [
[ [THEME.timeline_key_halign, 0], function() { alignKeys(fa_left); } ],
[ [THEME.timeline_key_halign, 1], function() { alignKeys(fa_center); } ],
[ [THEME.timeline_key_halign, 2], function() { alignKeys(fa_right); } ],
[ [THEME.object_halign, 0], function() { alignKeys(fa_left); } ],
[ [THEME.object_halign, 1], function() { alignKeys(fa_center); } ],
[ [THEME.object_halign, 2], function() { alignKeys(fa_right); } ],
]),
menuItem(__txtx("panel_animation_stagger", "Stagger"), function() { stagger_mode = 1; }),
-1,

View file

@ -236,7 +236,7 @@ function Panel_Collection() : PanelContent() constructor {
}
}
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text_inner);
draw_set_text(f_p3, fa_center, fa_top, COLORS._main_text_inner);
name_height = max(name_height, string_height_ext(_node.name, -1, grid_width) + 8);
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + ui(4), _node.name, -1, grid_width);
}
@ -291,7 +291,7 @@ function Panel_Collection() : PanelContent() constructor {
} else
draw_sprite_ui_uniform(THEME.group, 0, spr_x, spr_y, 0.75, c_white);
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_inner);
draw_set_text(f_p3, fa_left, fa_center, COLORS._main_text_inner);
draw_text_add(list_height + ui(20), yy + list_height / 2, _node.name);
yy += list_height;

View file

@ -717,9 +717,7 @@ function Panel_Inspector() : PanelContent() constructor {
if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txtx("panel_inspector_set_default", "Set Metadata as default"), THEME.save, 0, COLORS._main_icon) == 2) {
var path = DIRECTORY + "meta.json";
var f = file_text_open_write(path);
file_text_write_string(f, json_encode_minify(METADATA.serialize()));
file_text_close(f);
json_save_struct(path, METADATA.serialize());
}
by += ui(36);

View file

@ -1,41 +1,60 @@
function Panel_Node_Align() : PanelContent() constructor {
title = __txt("Align");
w = ui(200);
h = ui(200);
w = 160;
h = 32 + 8 * 2;
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
var xc = w / 2;
var yy = 12;
var xx = 8;
var yy = 8;
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text_sub);
draw_text(xc, yy, __txt("Align"));
/////////////////////////////
yy += ui(24);
if(buttonInstant(THEME.button_hide, xc - ui(16) - ui(40), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_halign, 0, c_white) == 2)
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_halign, 0, c_white) == 2)
node_halign(PANEL_GRAPH.nodes_select_list, fa_left);
if(buttonInstant(THEME.button_hide, xc - ui(16), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_halign, 1, c_white) == 2)
xx += 34
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_halign, 1, c_white) == 2)
node_halign(PANEL_GRAPH.nodes_select_list, fa_center);
if(buttonInstant(THEME.button_hide, xc - ui(16) + ui(40), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_halign, 2, c_white) == 2)
xx += 34
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_halign, 2, c_white) == 2)
node_halign(PANEL_GRAPH.nodes_select_list, fa_right);
xx += 34
yy += ui(40);
if(buttonInstant(THEME.button_hide, xc - ui(16) - ui(40), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_valign, 0, c_white) == 2)
xx += 2;
draw_set_color(CDEF.main_dkblack);
draw_line_width(xx, yy + 16 - 10, xx, yy + 16 + 10, 3);
xx += 6;
/////////////////////////////
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_valign, 0, c_white) == 2)
node_valign(PANEL_GRAPH.nodes_select_list, fa_top);
if(buttonInstant(THEME.button_hide, xc - ui(16), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_valign, 1, c_white) == 2)
xx += 34
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_valign, 1, c_white) == 2)
node_valign(PANEL_GRAPH.nodes_select_list, fa_middle);
if(buttonInstant(THEME.button_hide, xc - ui(16) + ui(40), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.inspector_surface_valign, 2, c_white) == 2)
xx += 34
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.object_valign, 2, c_white) == 2)
node_valign(PANEL_GRAPH.nodes_select_list, fa_bottom);
xx += 34
yy += ui(44);
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text_sub);
draw_text(xc, yy, __txt("Distribute"));
xx += 2;
draw_set_color(CDEF.main_dkblack);
draw_line_width(xx, yy + 16 - 10, xx, yy + 16 + 10, 3);
xx += 6;
yy += ui(24);
if(buttonInstant(THEME.button_hide, xc - ui(16) - ui(20), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.obj_distribute_h, 0, c_white) == 2)
/////////////////////////////
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.obj_distribute_h, 0, c_white) == 2)
node_hdistribute(PANEL_GRAPH.nodes_select_list);
if(buttonInstant(THEME.button_hide, xc - ui(16) + ui(20), yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.obj_distribute_v, 0, c_white) == 2)
xx += 34
if(buttonInstant(THEME.button_hide, xx, yy, 32, 32, [mx, my], pFOCUS, pHOVER,, THEME.obj_distribute_v, 0, c_white) == 2)
node_vdistribute(PANEL_GRAPH.nodes_select_list);
xx += 34
}
}

View file

@ -29,7 +29,7 @@
for( var j = 0; j < ds_list_size(grp.content); j++ ) {
var pth = grp.content[| j].path;
var f = new FileObject(grp.content[| j].name, pth);
f.content = json_load(pth);
f.content = json_load_struct(pth);
array_push(l, f);
}
global.PRESETS_MAP[? grp.name] = l;

View file

@ -278,12 +278,11 @@ function functionStringClean(fx) {
dependency = [];
static _string = function(str) {
return string_char_at(str, 1) == "\"" &&
string_char_at(str, string_length(str)) == "\"";
return string_char_at(str, 1) == "\"" && string_char_at(str, string_length(str)) == "\"";
}
static _string_trim = function(str) {
return _string(str)? string_copy(str, 2, string_length(str) - 2) : string(str);
return string_trim(str, [ "\"" ]);
}
static getVal = function(val, params = {}, getRaw = false) {
@ -298,8 +297,10 @@ function functionStringClean(fx) {
if(struct_has(params, val))
return struct_try_get(params, val);
if(_string(string_trim(val)))
return string_trim(val);
val = string_trim(val);
if(_string(val))
return _string_trim(val);
return nodeGetData(val);
}
@ -465,10 +466,8 @@ function functionStringClean(fx) {
switch(_symbol) {
case "+":
case "⊕":
if(_string(v1) || _string(v2))
return _string_trim(v1) + _string_trim(v2);
if(is_real(v1) && is_real(v2))
return v1 + v2;
if(is_string(v1) || is_string(v2)) return string(v1) + string(v2);
if(is_real(v1) && is_real(v2)) return v1 + v2;
return 0;
case "-":
case "⊖": return (is_real(v1) && is_real(v2))? v1 - v2 : 0;

View file

@ -265,7 +265,7 @@ function textArea(_input, _onModify, _extras = noone) : textInput(_input, _onMod
var ss = "";
for( var i = 0, n = array_length(_txtLines); i < n; i++ ) {
var _txt = _txtLines[i] + (i < array_length(_txtLines)? "\n" : "");
var _txt = _txtLines[i] + (i < array_length(_txtLines)? "\n" : "");
var words = string_splice(_txt, " ");
var currW = 0;
var currL = "";

View file

@ -227,8 +227,8 @@ function Theme() constructor {
timeline_elastic = noone;
timeline_keyframe = noone;
timeline_keyframe_selecting = noone;
timeline_key_halign = noone;
timeline_key_valign = noone;
object_halign = noone;
object_valign = noone;
timeline_onion_skin = noone;
obj_distribute_h = noone;

View file

@ -11,7 +11,6 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor {
linked = false;
b_link = button(function() { linked = !linked; });
b_link.icon = THEME.value_link;
onModifyIndex = function(index, val) {
var v = toNumber(val);
@ -106,9 +105,10 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor {
}
b_link.setFocusHover(active, hover);
b_link.icon_index = linked;
b_link.icon_blend = linked? COLORS._main_accent : COLORS._main_icon;
b_link.tooltip = linked? __txt("Unlink values") : __txt("Link values");
b_link.icon = THEME.value_link;
b_link.icon_index = linked;
b_link.icon_blend = linked? COLORS._main_accent : COLORS._main_icon;
b_link.tooltip = linked? __txt("Unlink values") : __txt("Link values");
var bx = _x;
var by = _y + _h / 2 - ui(32 / 2);