Bug fix or something.

This commit is contained in:
Tanasart 2023-08-04 13:12:32 +02:00
parent f69bc86ff0
commit ea58e07865
24 changed files with 158 additions and 90 deletions

View file

@ -249,8 +249,8 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-Bold.ttf","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale/fonts",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-Bold.ttf","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale/fonts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-Medium.ttf","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale/fonts",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-Medium.ttf","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale/fonts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-SemiBold.ttf","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale/fonts",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"NotoSans-SemiBold.ttf","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale/fonts",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"nodes.json","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"HOW TO LOCALE.txt","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"HOW TO LOCALE.txt","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"nodes.json","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"UI.json","CopyToMask":-1,"filePath":"datafiles/data/locale/sample locale",}, {"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":"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":"nodes.json","CopyToMask":-1,"filePath":"datafiles/data",},

View file

@ -244,12 +244,15 @@
#region async #region async
globalvar PORT_MAP, NETWORK_SERVERS, NETWORK_CLIENTS; globalvar PORT_MAP, NETWORK_SERVERS, NETWORK_CLIENTS;
globalvar IMAGE_FETCH_MAP;
global.FILE_LOAD_ASYNC = ds_map_create(); global.FILE_LOAD_ASYNC = ds_map_create();
PORT_MAP = ds_map_create(); PORT_MAP = ds_map_create();
NETWORK_SERVERS = ds_map_create(); NETWORK_SERVERS = ds_map_create();
NETWORK_CLIENTS = ds_map_create(); NETWORK_CLIENTS = ds_map_create();
IMAGE_FETCH_MAP = ds_map_create();
asyncInit(); asyncInit();
#endregion #endregion

View file

@ -0,0 +1,5 @@
/// @description
if(!ds_map_exists(IMAGE_FETCH_MAP, async_load[? "id"])) exit;
var _callback = IMAGE_FETCH_MAP[? async_load[? "id"]];
_callback(async_load);

View file

@ -22,6 +22,7 @@
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":1,"eventType":9,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":1,"eventType":9,"isDnD":false,},
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":69,"eventType":7,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":69,"eventType":7,"isDnD":false,},
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":68,"eventType":7,"isDnD":false,}, {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":68,"eventType":7,"isDnD":false,},
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":60,"eventType":7,"isDnD":false,},
], ],
"managed": true, "managed": true,
"overriddenProperties": [], "overriddenProperties": [],

View file

@ -434,7 +434,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
static onPartDestroy = function(part) {} static onPartDestroy = function(part) {}
static postDeserialize = function() { static postDeserialize = function() {
if(PROJECT.version < SAVE_VERSION) { if(PROJECT.version < 11480) {
for( var i = 37; i <= 39; i++ ) for( var i = 37; i <= 39; i++ )
array_insert(load_map.inputs, i, noone); array_insert(load_map.inputs, i, noone);
} }

View file

@ -3,7 +3,7 @@ function APPEND(_path, context = PANEL_GRAPH.getCurrentContext()) {
var _map = json_load_struct(_path); var _map = json_load_struct(_path);
if(_map == -1) { if(_map == -1) {
printlog("Decode error"); printIf(log, "Decode error");
return noone; return noone;
} }
@ -42,7 +42,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
var _node = nodeLoad(_node_list[i], true, context); var _node = nodeLoad(_node_list[i], true, context);
if(_node) ds_list_add(appended_list, _node); if(_node) ds_list_add(appended_list, _node);
} }
printlog("Load time: " + string(current_time - t)); t = current_time; printIf(log, "Load time: " + string(current_time - t)); t = current_time;
try { try {
for(var i = 0; i < ds_list_size(appended_list); i++) { for(var i = 0; i < ds_list_size(appended_list); i++) {
@ -55,7 +55,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
} catch(e) { } catch(e) {
log_warning("APPEND, node", exception_print(e)); log_warning("APPEND, node", exception_print(e));
} }
printlog("Load group time: " + string(current_time - t)); t = current_time; printIf(log, "Load group time: " + string(current_time - t)); t = current_time;
try { try {
for(var i = 0; i < ds_list_size(appended_list); i++) for(var i = 0; i < ds_list_size(appended_list); i++)
@ -63,7 +63,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
} catch(e) { } catch(e) {
log_warning("APPEND, deserialize", exception_print(e)); log_warning("APPEND, deserialize", exception_print(e));
} }
printlog("Deserialize time: " + string(current_time - t)); t = current_time; printIf(log, "Deserialize time: " + string(current_time - t)); t = current_time;
try { try {
for(var i = 0; i < ds_list_size(appended_list); i++) for(var i = 0; i < ds_list_size(appended_list); i++)
@ -71,7 +71,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
} catch(e) { } catch(e) {
log_warning("LOAD, apply deserialize", exception_print(e)); log_warning("LOAD, apply deserialize", exception_print(e));
} }
printlog("Apply deserialize time: " + string(current_time - t)); t = current_time; printIf(log, "Apply deserialize time: " + string(current_time - t)); t = current_time;
try { try {
for(var i = 0; i < ds_list_size(appended_list); i++) for(var i = 0; i < ds_list_size(appended_list); i++)
@ -81,7 +81,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
} catch(e) { } catch(e) {
log_warning("APPEND, connect", exception_print(e)); log_warning("APPEND, connect", exception_print(e));
} }
printlog("Connect time: " + string(current_time - t)); t = current_time; printIf(log, "Connect time: " + string(current_time - t)); t = current_time;
try { try {
for(var i = 0; i < ds_list_size(appended_list); i++) for(var i = 0; i < ds_list_size(appended_list); i++)
@ -89,7 +89,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
} catch(e) { } catch(e) {
log_warning("APPEND, update", exception_print(e)); log_warning("APPEND, update", exception_print(e));
} }
printlog("Update time: " + string(current_time - t)); t = current_time; printIf(log, "Update time: " + string(current_time - t)); t = current_time;
Render(true); Render(true);
@ -115,7 +115,7 @@ function __APPEND_MAP(_map, context = PANEL_GRAPH.getCurrentContext()) {
log_warning("APPEND, Conflict solver error : ", exception_print(e)); log_warning("APPEND, Conflict solver error : ", exception_print(e));
} }
} }
printlog("Conflict time: " + string(current_time - t)); t = current_time; printIf(log, "Conflict time: " + string(current_time - t)); t = current_time;
try { try {
for(var i = 0; i < ds_list_size(appended_list); i++) for(var i = 0; i < ds_list_size(appended_list); i++)

View file

@ -2,11 +2,17 @@ function FileObject(_name, _path) constructor {
name = _name; name = _name;
path = _path; path = _path;
spr_path = []; spr_path = [];
spr = -1; spr = -1;
content = -1; sprFetchID = noone;
surface = noone;
meta = noone; content = -1;
type = FILE_TYPE.collection; surface = noone;
var _mdir = filename_dir(path);
var _mname = filename_name_only(path);
meta_path = $"{_mdir}/{_mname}.meta";
meta = noone;
type = FILE_TYPE.collection;
switch(string_lower(filename_ext(path))) { switch(string_lower(filename_ext(path))) {
case ".png" : case ".png" :
@ -44,40 +50,55 @@ function FileObject(_name, _path) constructor {
} }
static getSpr = function() { static getSpr = function() {
if(sprite_exists(spr)) return spr; if(sprite_exists(spr)) return spr;
if(sprFetchID != noone) return -1;
if(array_length(spr_path) == 0) { if(array_length(spr_path) == 0) {
spr = sprite_add(self.path, 0, false, false, 0, 0); sprFetchID = sprite_add_ext(self.path, 0, 0, 0, false);
sprite_set_offset(spr, sprite_get_width(spr) / 2, sprite_get_height(spr) / 2); 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);
};
return spr; return spr;
} }
var path = array_safe_get(spr_path, 0); var path = array_safe_get(spr_path, 0);
var amo = array_safe_get(spr_path, 1); var amo = array_safe_get(spr_path, 1);
var cent = array_safe_get(spr_path, 2);
if(path == 0) return -1; if(path == 0) return -1;
spr = sprite_add(path, amo, false, false, 0, 0);
if(cent) sprFetchID = sprite_add_ext(path, amo, 0, 0, false);
sprite_set_offset(spr, sprite_get_width(spr) / 2, sprite_get_height(spr) / 2); 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);
};
return spr; return spr;
} }
static getMetadata = function() { static getMetadata = function() {
retrive_data = true; retrive_data = true;
if(!file_exists(path)) return noone;
if(meta != noone) return meta;
if(meta == undefined) return noone;
var _f = file_text_read_all(path); if(!file_exists(path)) return noone;
var m = json_decode(_f); if(meta != noone) return meta;
if(meta == undefined) return noone;
meta = new MetaDataManager(); meta = new MetaDataManager();
if(ds_map_exists(m, "metadata"))
meta.deserialize(m[? "metadata"]);
if(ds_map_exists(m, "preview"))
thumbnail_data = json_try_parse(m[? "preview"], -1);
meta.version = m[? "version"]; if(file_exists(meta_path)) {
var m = json_load(meta_path);
meta.deserialize(m);
} else {
var m = json_load(path);
if(ds_map_exists(m, "metadata"))
meta.deserialize(m[? "metadata"]);
if(ds_map_exists(m, "preview"))
thumbnail_data = json_try_parse(m[? "preview"], -1);
meta.version = m[? "version"];
}
meta.name = name; meta.name = name;
switch(filename_ext(path)) { switch(filename_ext(path)) {

View file

@ -18,7 +18,7 @@
active = true; active = true;
path = ""; path = "";
version = 0; version = SAVE_VERSION;
seed = irandom_range(100000, 999999); seed = irandom_range(100000, 999999);
modified = false; modified = false;

View file

@ -19,7 +19,7 @@ function MetaDataManager() constructor {
author_steam_id = 0; author_steam_id = 0;
file_id = 0; file_id = 0;
tags = []; tags = [];
version = 0; version = SAVE_VERSION;
steam = false; steam = false;
static displays = [ static displays = [
@ -32,13 +32,14 @@ function MetaDataManager() constructor {
static serialize = function() { static serialize = function() {
var m = {}; var m = {};
m.description = description; m.description = description;
m.author = author; m.author = author;
m.contact = contact; m.contact = contact;
m.alias = alias; m.alias = alias;
m.aut_id = author_steam_id; m.aut_id = author_steam_id;
m.file_id = file_id; m.file_id = file_id;
m.tags = tags; m.tags = tags;
m.version = version;
return m; return m;
} }
@ -51,6 +52,7 @@ function MetaDataManager() constructor {
author_steam_id = struct_try_get(m, "aut_id", author_steam_id); author_steam_id = struct_try_get(m, "aut_id", author_steam_id);
file_id = struct_try_get(m, "file_id", file_id); file_id = struct_try_get(m, "file_id", file_id);
tags = struct_try_get(m, "tags", tags); tags = struct_try_get(m, "tags", tags);
version = struct_try_get(m, "version", version);
return self; return self;
} }

View file

@ -1,11 +1,13 @@
function Node_RGB_Channel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { function Node_RGB_Channel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "RGBA Extract"; name = "RGBA Extract";
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0); inputs[| 0] = nodeValue("Surface In", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue("Output type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) inputs[| 1] = nodeValue("Output Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, ["Channel value", "Greyscale"]); .setDisplay(VALUE_DISPLAY.enum_scroll, ["Channel value", "Greyscale"]);
inputs[| 2] = nodeValue("Keep Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
outputs[| 0] = nodeValue("Red", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); outputs[| 0] = nodeValue("Red", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
outputs[| 1] = nodeValue("Green", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); outputs[| 1] = nodeValue("Green", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
outputs[| 2] = nodeValue("Blue", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); outputs[| 2] = nodeValue("Blue", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
@ -15,6 +17,7 @@ function Node_RGB_Channel(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
static process_data = function(_outSurf, _data, output_index) { static process_data = function(_outSurf, _data, output_index) {
var _out = _data[1]; var _out = _data[1];
var _alp = _data[2];
surface_set_target(_outSurf); surface_set_target(_outSurf);
DRAW_CLEAR DRAW_CLEAR
@ -25,6 +28,8 @@ function Node_RGB_Channel(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
case 2 : shader_set(_out? sh_channel_B_grey : sh_channel_B); break; case 2 : shader_set(_out? sh_channel_B_grey : sh_channel_B); break;
case 3 : shader_set(_out? sh_channel_A_grey : sh_channel_A); break; case 3 : shader_set(_out? sh_channel_A_grey : sh_channel_A); break;
} }
shader_set_i("keepAlpha", _alp);
draw_surface_safe(_data[0], 0, 0); draw_surface_safe(_data[0], 0, 0);
shader_reset(); shader_reset();
BLEND_NORMAL; BLEND_NORMAL;

View file

@ -1461,8 +1461,8 @@ function Panel_Animation() : PanelContent() constructor {
var ot = 0, ov = true; var ot = 0, ov = true;
var x0 = 0, x1 = 0; var x0 = 0, x1 = 0;
for( var i = 0; i < ds_list_size(active_inp.animator.values); i++ ) { for( var j = 0; j < ds_list_size(active_inp.animator.values); j++ ) {
var k = active_inp.animator.values[| i]; var k = active_inp.animator.values[| j];
var t = k.time; var t = k.time;
var v = k.value; var v = k.value;

View file

@ -39,17 +39,20 @@ function Panel_Collection() : PanelContent() constructor {
if(meta == noone || !meta.steam) { if(meta == noone || !meta.steam) {
contentMenu = [ contentMenu = [
menuItem(__txtx("panel_collection_replace", "Replace with selected"), function() { menuItem(__txtx("panel_collection_replace", "Replace with selected"), function() {
saveCollection(PANEL_INSPECTOR.inspecting, _menu_node.data_path, _menu_node.path, false, _menu_node.meta); var _path = filename_dir(_menu_node.path);
var _name = filename_name(_menu_node.path);
saveCollection(PANEL_INSPECTOR.inspecting, _path, _name, false, _menu_node.meta);
}), }),
menuItem(__txtx("panel_collection_edit_meta", "Edit metadata") + "...", function() { menuItem(__txtx("panel_collection_edit_meta", "Edit metadata") + "...", function() {
var dia = dialogCall(o_dialog_file_name_collection, mouse_mx + ui(8), mouse_my + ui(-320)); var dia = dialogCall(o_dialog_file_name_collection, mouse_mx + ui(8), mouse_my + ui(-320));
var meta = _menu_node.getMetadata(); var meta = _menu_node.getMetadata();
if(meta != noone && meta != undefined) if(meta != noone && meta != undefined)
dia.meta = meta; dia.meta = meta;
dia.node = PANEL_INSPECTOR.inspecting; dia.node = PANEL_INSPECTOR.inspecting;
dia.data_path = data_path; dia.data_path = data_path;
dia.updating = _menu_node; dia.updating = _menu_node;
dia.doExpand(); dia.doExpand();
}), }),
-1, -1,

View file

@ -122,6 +122,8 @@ function SAVE_AT(project = PROJECT, path = "", log = "save at ") {
return true; return true;
} }
/////////////////////////////////////////////////////// COLLECTION ///////////////////////////////////////////////////////
function SAVE_COLLECTIONS(_list, _path, save_surface = true, metadata = noone, context = PANEL_GRAPH.getCurrentContext()) { function SAVE_COLLECTIONS(_list, _path, save_surface = true, metadata = noone, context = PANEL_GRAPH.getCurrentContext()) {
var _content = {}; var _content = {};
_content.version = SAVE_VERSION; _content.version = SAVE_VERSION;
@ -148,12 +150,16 @@ function SAVE_COLLECTIONS(_list, _path, save_surface = true, metadata = noone, c
SAVE_NODE(_nodes, _list[| i], cx, cy, true, context); SAVE_NODE(_nodes, _list[| i], cx, cy, true, context);
_content.nodes = _nodes; _content.nodes = _nodes;
if(metadata != noone) json_save_struct(_path, _content, !PREF_MAP[? "save_file_minify"]);
_content.metadata = metadata.serialize();
var file = file_text_open_write(_path); if(metadata != noone) {
file_text_write_string(file, PREF_MAP[? "save_file_minify"]? json_stringify_minify(_content) : json_stringify(_content, true)); var _meta = metadata.serialize();
file_text_close(file); var _dir = filename_dir(_path);
var _name = filename_name_only(_path);
var _mpath = $"{_dir}/{_name}.meta";
json_save_struct(_mpath, _meta, true);
}
var pane = findPanel("Panel_Collection"); var pane = findPanel("Panel_Collection");
if(pane) pane.refreshContext(); if(pane) pane.refreshContext();
@ -178,12 +184,16 @@ function SAVE_COLLECTION(_node, _path, save_surface = true, metadata = noone, co
SAVE_NODE(_nodes, _node, _node.x, _node.y, true, context); SAVE_NODE(_nodes, _node, _node.x, _node.y, true, context);
_content.nodes = _nodes; _content.nodes = _nodes;
if(metadata != noone) json_save_struct(_path, _content, !PREF_MAP[? "save_file_minify"]);
_content.metadata = metadata.serialize();
var file = file_text_open_write(_path); if(metadata != noone) {
file_text_write_string(file, PREF_MAP[? "save_file_minify"]? json_stringify_minify(_content) : json_stringify(_content, true)); var _meta = metadata.serialize();
file_text_close(file); var _dir = filename_dir(_path);
var _name = filename_name_only(_path);
var _mpath = $"{_dir}/{_name}.meta";
json_save_struct(_mpath, _meta, true);
}
var pane = findPanel("Panel_Collection"); var pane = findPanel("Panel_Collection");
if(pane) pane.refreshContext(); if(pane) pane.refreshContext();

View file

@ -9,6 +9,8 @@ function steam_ugc_create_collection(file) {
directory_destroy(DIRECTORY + "steamUGC"); directory_destroy(DIRECTORY + "steamUGC");
directory_create(DIRECTORY + "steamUGC"); directory_create(DIRECTORY + "steamUGC");
file_copy(file.path, DIRECTORY + "steamUGC/" + filename_name(file.path)); file_copy(file.path, DIRECTORY + "steamUGC/" + filename_name(file.path));
file_copy(file.meta_path, DIRECTORY + "steamUGC/" + filename_name(file.meta_path));
if(array_safe_get(file.spr_path, 0, 0) != 0) if(array_safe_get(file.spr_path, 0, 0) != 0)
file_copy(file.spr_path[0], DIRECTORY + "steamUGC/" + filename_name(file.spr_path[0])); file_copy(file.spr_path[0], DIRECTORY + "steamUGC/" + filename_name(file.spr_path[0]));
steam_ugc_collection_generate(file); steam_ugc_collection_generate(file);
@ -27,6 +29,7 @@ function steam_ugc_update_collection(file, update_preview = false) {
directory_destroy(DIRECTORY + "steamUGC"); directory_destroy(DIRECTORY + "steamUGC");
directory_create(DIRECTORY + "steamUGC"); directory_create(DIRECTORY + "steamUGC");
file_copy(file.path, DIRECTORY + "steamUGC/" + filename_name(file.path)); file_copy(file.path, DIRECTORY + "steamUGC/" + filename_name(file.path));
file_copy(file.meta_path, DIRECTORY + "steamUGC/" + filename_name(file.meta_path));
if(array_safe_get(file.spr_path, 0, 0) != 0) if(array_safe_get(file.spr_path, 0, 0) != 0)
file_copy(file.spr_path[0], DIRECTORY + "steamUGC/" + filename_name(file.spr_path[0])); file_copy(file.spr_path[0], DIRECTORY + "steamUGC/" + filename_name(file.spr_path[0]));

View file

@ -15,7 +15,7 @@ function __test_update_current_collections() {
print(" > Updating " + _node.path); print(" > Updating " + _node.path);
var _map = json_load(_node.path); var _map = json_load(_node.path);
_map[? "version"] = SAVE_VERSION; _map[? "version"] = SAVE_VERSION;
json_save(_node.path, _map); json_save(_node.meta_path, _map);
} }
for( var i = 0; i < ds_list_size(_st.subDir); i++ ) for( var i = 0; i < ds_list_size(_st.subDir); i++ )
@ -36,7 +36,7 @@ function __test_update_sample_projects() {
print(" > Updating " + _proj.path); print(" > Updating " + _proj.path);
var _map = json_load(_proj.path); var _map = json_load(_proj.path);
_map[? "version"] = SAVE_VERSION; _map[? "version"] = SAVE_VERSION;
json_save(_proj.path, _map); json_save(_proj.meta_path, _map);
} }
print("---------- PROJECT UPDATING ENDED ----------"); print("---------- PROJECT UPDATING ENDED ----------");
@ -125,7 +125,7 @@ function __test_load_all_nodes() {
if(index > inded) break; if(index > inded) break;
if(index > indst) { if(index > indst) {
var node = ALL_NODES[? k]; var node = ALL_NODES[? k];
print("==== Building " + node.node); print($"==== Building {node.node} ====");
var b = node.build(xx, yy); var b = node.build(xx, yy);
if(++ind > col) { if(++ind > col) {
@ -156,7 +156,8 @@ function __test_metadata_current_collections() {
print("---------- COLLECTION UPDATING STARTED ----------"); print("---------- COLLECTION UPDATING STARTED ----------");
var sel = PANEL_GRAPH.node_focus, outj = noone; var sel = PANEL_GRAPH.node_focus, outj = noone;
var _meta = METADATA.serialize();
if(sel != noone) outj = sel.outputs[| 0]; if(sel != noone) outj = sel.outputs[| 0];
while(!ds_stack_empty(st)) { while(!ds_stack_empty(st)) {
@ -165,9 +166,7 @@ function __test_metadata_current_collections() {
var _node = _st.content[| i]; var _node = _st.content[| i];
print(" > Updating " + _node.path); print(" > Updating " + _node.path);
var _map = json_load(_node.path); json_save_struct(_node.meta_path, _meta, true);
ds_map_add_map(_map, "metadata", METADATA.serialize());
json_save(_node.path, _map);
} }
for( var i = 0; i < ds_list_size(_st.subDir); i++ ) for( var i = 0; i < ds_list_size(_st.subDir); i++ )

View file

@ -4,6 +4,8 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
uniform int keepAlpha;
void main() { void main() {
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord); vec4 col = texture2D( gm_BaseTexture, v_vTexcoord);
gl_FragColor = vec4(vec3(1.), col.a); gl_FragColor = vec4(vec3(1.), col.a);

View file

@ -4,6 +4,8 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
uniform int keepAlpha;
void main() { void main() {
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord); vec4 col = texture2D( gm_BaseTexture, v_vTexcoord);
gl_FragColor = vec4(col.a, col.a, col.a, 1.); gl_FragColor = vec4(col.a, col.a, col.a, 1.);

View file

@ -4,7 +4,9 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
uniform int keepAlpha;
void main() { void main() {
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord); vec4 col = texture2D( gm_BaseTexture, v_vTexcoord);
gl_FragColor = vec4(0., 0., col.b, 1.); gl_FragColor = vec4(0., 0., col.b, keepAlpha == 1? col.a : 1.);
} }

View file

@ -4,7 +4,9 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
uniform int keepAlpha;
void main() { void main() {
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord); vec4 col = texture2D( gm_BaseTexture, v_vTexcoord);
gl_FragColor = vec4(col.b, col.b, col.b, 1.); gl_FragColor = vec4(col.b, col.b, col.b, keepAlpha == 1? col.a : 1.);
} }

View file

@ -4,7 +4,9 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
uniform int keepAlpha;
void main() { void main() {
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord); vec4 col = texture2D( gm_BaseTexture, v_vTexcoord);
gl_FragColor = vec4(0., col.g, 0., 1.); gl_FragColor = vec4(0., col.g, 0., keepAlpha == 1? col.a : 1.);
} }

View file

@ -4,7 +4,9 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
uniform int keepAlpha;
void main() { void main() {
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord); vec4 col = texture2D( gm_BaseTexture, v_vTexcoord);
gl_FragColor = vec4(col.g, col.g, col.g, 1.); gl_FragColor = vec4(col.g, col.g, col.g, keepAlpha == 1? col.a : 1.);
} }

View file

@ -4,7 +4,9 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
uniform int keepAlpha;
void main() { void main() {
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord); vec4 col = texture2D( gm_BaseTexture, v_vTexcoord);
gl_FragColor = vec4(col.r, 0., 0., 1.); gl_FragColor = vec4(col.r, 0., 0., keepAlpha == 1? col.a : 1.);
} }

View file

@ -4,7 +4,9 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
uniform int keepAlpha;
void main() { void main() {
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord); vec4 col = texture2D( gm_BaseTexture, v_vTexcoord);
gl_FragColor = vec4(col.r, col.r, col.r, 1.); gl_FragColor = vec4(col.r, col.r, col.r, keepAlpha == 1? col.a : 1.);
} }