mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-24 03:48:06 +01:00
Fix several more things
This commit is contained in:
parent
cf89efbeac
commit
292deadd78
36 changed files with 314 additions and 210 deletions
|
@ -1198,6 +1198,7 @@
|
||||||
{"name":"s_node_3d_plane","order":6,"path":"sprites/s_node_3d_plane/s_node_3d_plane.yy",},
|
{"name":"s_node_3d_plane","order":6,"path":"sprites/s_node_3d_plane/s_node_3d_plane.yy",},
|
||||||
{"name":"Regex","order":7,"path":"extensions/Regex/Regex.yy",},
|
{"name":"Regex","order":7,"path":"extensions/Regex/Regex.yy",},
|
||||||
{"name":"s_node_path_shift","order":4,"path":"sprites/s_node_path_shift/s_node_path_shift.yy",},
|
{"name":"s_node_path_shift","order":4,"path":"sprites/s_node_path_shift/s_node_path_shift.yy",},
|
||||||
|
{"name":"sh_slice_spritesheet_empty_scan","order":10,"path":"shaders/sh_slice_spritesheet_empty_scan/sh_slice_spritesheet_empty_scan.yy",},
|
||||||
{"name":"s_node_grid_tri","order":6,"path":"sprites/s_node_grid_tri/s_node_grid_tri.yy",},
|
{"name":"s_node_grid_tri","order":6,"path":"sprites/s_node_grid_tri/s_node_grid_tri.yy",},
|
||||||
{"name":"s_node_local_analyze","order":52,"path":"sprites/s_node_local_analyze/s_node_local_analyze.yy",},
|
{"name":"s_node_local_analyze","order":52,"path":"sprites/s_node_local_analyze/s_node_local_analyze.yy",},
|
||||||
{"name":"_f_p0b","order":5,"path":"fonts/_f_p0b/_f_p0b.yy",},
|
{"name":"_f_p0b","order":5,"path":"fonts/_f_p0b/_f_p0b.yy",},
|
||||||
|
|
|
@ -1891,6 +1891,7 @@
|
||||||
{"id":{"name":"Regex","path":"extensions/Regex/Regex.yy",},},
|
{"id":{"name":"Regex","path":"extensions/Regex/Regex.yy",},},
|
||||||
{"id":{"name":"s_node_path_shift","path":"sprites/s_node_path_shift/s_node_path_shift.yy",},},
|
{"id":{"name":"s_node_path_shift","path":"sprites/s_node_path_shift/s_node_path_shift.yy",},},
|
||||||
{"id":{"name":"node_rigid_group","path":"scripts/node_rigid_group/node_rigid_group.yy",},},
|
{"id":{"name":"node_rigid_group","path":"scripts/node_rigid_group/node_rigid_group.yy",},},
|
||||||
|
{"id":{"name":"sh_slice_spritesheet_empty_scan","path":"shaders/sh_slice_spritesheet_empty_scan/sh_slice_spritesheet_empty_scan.yy",},},
|
||||||
{"id":{"name":"s_node_grid_tri","path":"sprites/s_node_grid_tri/s_node_grid_tri.yy",},},
|
{"id":{"name":"s_node_grid_tri","path":"sprites/s_node_grid_tri/s_node_grid_tri.yy",},},
|
||||||
{"id":{"name":"s_node_local_analyze","path":"sprites/s_node_local_analyze/s_node_local_analyze.yy",},},
|
{"id":{"name":"s_node_local_analyze","path":"sprites/s_node_local_analyze/s_node_local_analyze.yy",},},
|
||||||
{"id":{"name":"_f_p0b","path":"fonts/_f_p0b/_f_p0b.yy",},},
|
{"id":{"name":"_f_p0b","path":"fonts/_f_p0b/_f_p0b.yy",},},
|
||||||
|
|
|
@ -363,7 +363,7 @@ event_inherited();
|
||||||
} else if(ADD_NODE_PAGE == -1) { #region
|
} else if(ADD_NODE_PAGE == -1) { #region
|
||||||
_list = NEW_NODES;
|
_list = NEW_NODES;
|
||||||
#endregion
|
#endregion
|
||||||
} else if(ADD_NODE_PAGE == NODE_PAGE_DEFAULT) { #region
|
} else if(ADD_NODE_PAGE == NODE_PAGE_DEFAULT && category == NODE_CATEGORY) { #region
|
||||||
_list = ds_list_create();
|
_list = ds_list_create();
|
||||||
|
|
||||||
var sug = [];
|
var sug = [];
|
||||||
|
|
|
@ -16,13 +16,16 @@ event_inherited();
|
||||||
meta_expand = false;
|
meta_expand = false;
|
||||||
updating = noone;
|
updating = noone;
|
||||||
update_note = "Updated";
|
update_note = "Updated";
|
||||||
|
onModify = -1;
|
||||||
|
|
||||||
node = noone;
|
node = noone;
|
||||||
data_path = "";
|
data_path = "";
|
||||||
|
|
||||||
ugc = 0;
|
ugc = 0;
|
||||||
ugc_loading = false;
|
ugc_loading = false;
|
||||||
//name = __txtx("new_collection_placeholder", "New collection");
|
|
||||||
|
tb_name = new textBox(TEXTBOX_INPUT.text, function(str) { meta.name = str; });
|
||||||
|
KEYBOARD_STRING = "";
|
||||||
|
|
||||||
t_desc = new textArea(TEXTBOX_INPUT.text, function(str) { meta.description = str; });
|
t_desc = new textArea(TEXTBOX_INPUT.text, function(str) { meta.description = str; });
|
||||||
t_auth = new textArea(TEXTBOX_INPUT.text, function(str) { meta.author = str; });
|
t_auth = new textArea(TEXTBOX_INPUT.text, function(str) { meta.author = str; });
|
||||||
|
@ -45,10 +48,3 @@ event_inherited();
|
||||||
dialog_h = dialog_h_expand;
|
dialog_h = dialog_h_expand;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region text
|
|
||||||
onModify = -1;
|
|
||||||
tb_name = new textBox(TEXTBOX_INPUT.text, function(str) { meta.name = str; });
|
|
||||||
|
|
||||||
KEYBOARD_STRING = "";
|
|
||||||
#endregion
|
|
|
@ -55,7 +55,7 @@
|
||||||
if(meta.author_steam_id == 0)
|
if(meta.author_steam_id == 0)
|
||||||
meta.author_steam_id = STEAM_USER_ID;
|
meta.author_steam_id = STEAM_USER_ID;
|
||||||
|
|
||||||
if(updating == noone) {
|
if(updating == noone && node != noone) {
|
||||||
saveCollection(node, data_path, meta.name, true, meta);
|
saveCollection(node, data_path, meta.name, true, meta);
|
||||||
} else {
|
} else {
|
||||||
var _map = json_load_struct(updating.path);
|
var _map = json_load_struct(updating.path);
|
||||||
|
@ -64,7 +64,22 @@
|
||||||
json_save_struct(updating.path, _map);
|
json_save_struct(updating.path, _map);
|
||||||
json_save_struct(updating.meta_path, _meta);
|
json_save_struct(updating.meta_path, _meta);
|
||||||
|
|
||||||
|
var _newPath = $"{filename_dir(updating.path)}/{meta.name}.pxcc";
|
||||||
|
var _newMeta = $"{filename_dir(updating.meta_path)}/{meta.name}.meta";
|
||||||
|
var _oldSpr = $"{filename_dir(updating.path)}/{filename_name_only(updating.path)}.png";
|
||||||
|
var _newSpr = $"{filename_dir(updating.path)}/{meta.name}.png";
|
||||||
|
|
||||||
|
if(_newPath != updating.path) {
|
||||||
|
file_rename(updating.path, _newPath);
|
||||||
|
file_rename(updating.meta_path, _newMeta);
|
||||||
|
if(file_exists(_oldSpr)) file_rename(_oldSpr, _newSpr);
|
||||||
|
}
|
||||||
|
|
||||||
|
updating.path = _newPath;
|
||||||
|
updating.meta_path = _newMeta;
|
||||||
|
updating.spr_path[0] = _newSpr;
|
||||||
updating.meta = meta;
|
updating.meta = meta;
|
||||||
|
|
||||||
PANEL_COLLECTION.refreshContext();
|
PANEL_COLLECTION.refreshContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +88,7 @@
|
||||||
ugc_loading = true;
|
ugc_loading = true;
|
||||||
} else if(ugc == 2) {
|
} else if(ugc == 2) {
|
||||||
saveCollection(node, data_path, updating.path, false, updating.meta);
|
saveCollection(node, data_path, updating.path, false, updating.meta);
|
||||||
steam_ugc_update_collection(updating,, update_note);
|
steam_ugc_update_collection(updating, false, update_note);
|
||||||
ugc_loading = true;
|
ugc_loading = true;
|
||||||
} else
|
} else
|
||||||
instance_destroy();
|
instance_destroy();
|
||||||
|
@ -86,7 +101,7 @@
|
||||||
doExpand();
|
doExpand();
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region metadata
|
#region display
|
||||||
dialog_h = ui(64);
|
dialog_h = ui(64);
|
||||||
|
|
||||||
if(meta_expand) {
|
if(meta_expand) {
|
||||||
|
|
|
@ -44,15 +44,18 @@ event_inherited();
|
||||||
draw_clear_alpha(COLORS.panel_bg_clear_inner, 0);
|
draw_clear_alpha(COLORS.panel_bg_clear_inner, 0);
|
||||||
var expand = PREFERENCES.splash_expand_recent;
|
var expand = PREFERENCES.splash_expand_recent;
|
||||||
var ww = ui(264);
|
var ww = ui(264);
|
||||||
var hh = 0;
|
var hh = ui(8);
|
||||||
var pad = ui(8);
|
var pad = ui(8);
|
||||||
var hgt = ui(16) + line_get_height(f_p0b) + line_get_height(f_p1);
|
var hgt = ui(16) + line_get_height(f_p0b) + line_get_height(f_p1);
|
||||||
_y += pad;
|
_y += pad;
|
||||||
|
|
||||||
var col = expand? 2 : 1;
|
var col = expand? 2 : 1;
|
||||||
var row = ceil(ds_list_size(RECENT_FILES) / col);
|
var row = ceil(ds_list_size(RECENT_FILES) / col);
|
||||||
|
var hg = recent_thumbnail? ui(100) : hgt;
|
||||||
|
|
||||||
for(var i = 0; i < row; i++) {
|
for(var i = 0; i < row; i++) {
|
||||||
|
|
||||||
|
if(_y > -(hg + pad) && _y < sp_recent.surface_h)
|
||||||
for(var j = 0; j < col; j++) {
|
for(var j = 0; j < col; j++) {
|
||||||
var ind = i * col + j;
|
var ind = i * col + j;
|
||||||
if(ind >= ds_list_size(RECENT_FILES)) break;
|
if(ind >= ds_list_size(RECENT_FILES)) break;
|
||||||
|
@ -61,13 +64,7 @@ event_inherited();
|
||||||
var _dat = RECENT_FILE_DATA[| ind];
|
var _dat = RECENT_FILE_DATA[| ind];
|
||||||
if(!file_exists(_rec)) continue;
|
if(!file_exists(_rec)) continue;
|
||||||
|
|
||||||
var thmb = noone;
|
var thmb = recent_thumbnail? _dat.getThumbnail() : noone;
|
||||||
var hg = hgt;
|
|
||||||
if(recent_thumbnail) {
|
|
||||||
hg = ui(100);
|
|
||||||
thmb = _dat.getThumbnail();
|
|
||||||
}
|
|
||||||
|
|
||||||
var fx = j * (ww + ui(8));
|
var fx = j * (ww + ui(8));
|
||||||
|
|
||||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, fx, _y, ww, hg);
|
draw_sprite_stretched(THEME.ui_panel_bg, 1, fx, _y, ww, hg);
|
||||||
|
|
|
@ -42,7 +42,7 @@ if !ready exit;
|
||||||
|
|
||||||
draw_set_text(f_p0, fa_left, fa_bottom, COLORS._main_text_sub);
|
draw_set_text(f_p0, fa_left, fa_bottom, COLORS._main_text_sub);
|
||||||
draw_text(x0, y0 - ui(4), __txt("Recent files"));
|
draw_text(x0, y0 - ui(4), __txt("Recent files"));
|
||||||
//draw_sprite_stretched(THEME.ui_panel_bg, 1, x0, y0, x1 - x0, y1 - y0);
|
|
||||||
sp_recent.setFocusHover(sFOCUS, sHOVER);
|
sp_recent.setFocusHover(sFOCUS, sHOVER);
|
||||||
sp_recent.draw(x0 + ui(6), y0);
|
sp_recent.draw(x0 + ui(6), y0);
|
||||||
draw_sprite_stretched(THEME.ui_panel_fg, 0, x0, y0, x1 - x0, y1 - y0);
|
draw_sprite_stretched(THEME.ui_panel_fg, 0, x0, y0, x1 - x0, y1 - y0);
|
||||||
|
|
|
@ -97,7 +97,11 @@ event_inherited();
|
||||||
textbox._input_text = $"{_sPreC}{rep}{_sPosC}";
|
textbox._input_text = $"{_sPreC}{rep}{_sPosC}";
|
||||||
textbox.cursor += _repAmo - _prmAmo;
|
textbox.cursor += _repAmo - _prmAmo;
|
||||||
textbox.cut_line();
|
textbox.cut_line();
|
||||||
|
textbox.autocomplete_delay = 0;
|
||||||
textbox = noone;
|
textbox = noone;
|
||||||
|
|
||||||
|
prompt = "";
|
||||||
|
data = [];
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -326,4 +326,6 @@
|
||||||
|
|
||||||
#region debug
|
#region debug
|
||||||
//instance_create_depth(0, 0, 0, addon_key_displayer);
|
//instance_create_depth(0, 0, 0, addon_key_displayer);
|
||||||
|
|
||||||
|
__debug_animator_counter = 0;
|
||||||
#endregion
|
#endregion
|
|
@ -75,7 +75,7 @@ _HOVERING_ELEMENT = noone;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region render
|
#region animation & render
|
||||||
//physics_pause_enable(true);
|
//physics_pause_enable(true);
|
||||||
DEF_SURFACE_RESET();
|
DEF_SURFACE_RESET();
|
||||||
|
|
||||||
|
|
|
@ -24,15 +24,14 @@
|
||||||
framerate = 30;
|
framerate = 30;
|
||||||
is_playing = false;
|
is_playing = false;
|
||||||
frame_progress = false;
|
frame_progress = false;
|
||||||
play_freeze = 0;
|
|
||||||
render_stop = false;
|
render_stop = false;
|
||||||
|
|
||||||
|
__debug_animator_counter = 0;
|
||||||
|
|
||||||
rendering = [];
|
rendering = [];
|
||||||
playback = ANIMATOR_END.loop;
|
playback = ANIMATOR_END.loop;
|
||||||
|
|
||||||
static setFrame = function(frame, resetTime = true) {
|
static setFrame = function(frame, resetTime = true) { #region
|
||||||
//if(frame == 0) resetAnimation();
|
|
||||||
|
|
||||||
var _c = current_frame;
|
var _c = current_frame;
|
||||||
frame = clamp(frame, 0, frames_total);
|
frame = clamp(frame, 0, frames_total);
|
||||||
real_frame = frame;
|
real_frame = frame;
|
||||||
|
@ -41,12 +40,12 @@
|
||||||
if(current_frame == frames_total) {
|
if(current_frame == frames_total) {
|
||||||
if(render_stop) {
|
if(render_stop) {
|
||||||
is_playing = false;
|
is_playing = false;
|
||||||
setFrame(0);
|
setFrame(0, resetTime);
|
||||||
render_stop = false;
|
render_stop = false;
|
||||||
} else if(playback == ANIMATOR_END.stop) {
|
} else if(playback == ANIMATOR_END.stop) {
|
||||||
is_playing = false;
|
is_playing = false;
|
||||||
} else {
|
} else {
|
||||||
setFrame(0);
|
setFrame(0, resetTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,9 +58,9 @@
|
||||||
frame_progress = false;
|
frame_progress = false;
|
||||||
|
|
||||||
if(array_length(rendering)) render_stop = true;
|
if(array_length(rendering)) render_stop = true;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static resetAnimation = function() {
|
static resetAnimation = function() { #region
|
||||||
var _key = ds_map_find_first(PROJECT.nodeMap);
|
var _key = ds_map_find_first(PROJECT.nodeMap);
|
||||||
var amo = ds_map_size(PROJECT.nodeMap);
|
var amo = ds_map_size(PROJECT.nodeMap);
|
||||||
|
|
||||||
|
@ -70,61 +69,63 @@
|
||||||
_node.resetAnimation();
|
_node.resetAnimation();
|
||||||
_key = ds_map_find_next(PROJECT.nodeMap, _key);
|
_key = ds_map_find_next(PROJECT.nodeMap, _key);
|
||||||
}
|
}
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static render = function() {
|
static render = function() { #region
|
||||||
setFrame(0);
|
setFrame(0);
|
||||||
is_playing = true;
|
is_playing = true;
|
||||||
frame_progress = true;
|
frame_progress = true;
|
||||||
time_since_last_frame = 0;
|
time_since_last_frame = 0;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static toggle = function() {
|
static toggle = function() { #region
|
||||||
is_playing = !is_playing;
|
is_playing = !is_playing;
|
||||||
frame_progress = true;
|
frame_progress = true;
|
||||||
time_since_last_frame = 0;
|
time_since_last_frame = 0;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static pause = function() {
|
static pause = function() { #region
|
||||||
is_playing = false;
|
is_playing = false;
|
||||||
frame_progress = true;
|
frame_progress = true;
|
||||||
time_since_last_frame = 0;
|
time_since_last_frame = 0;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static play = function() {
|
static play = function() { #region
|
||||||
setFrame(0);
|
setFrame(0);
|
||||||
is_playing = true;
|
is_playing = true;
|
||||||
frame_progress = true;
|
frame_progress = true;
|
||||||
time_since_last_frame = 0;
|
time_since_last_frame = 0;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static resume = function() {
|
static resume = function() { #region
|
||||||
is_playing = true;
|
is_playing = true;
|
||||||
frame_progress = true;
|
frame_progress = true;
|
||||||
time_since_last_frame = 0;
|
time_since_last_frame = 0;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static stop = function() {
|
static stop = function() { #region
|
||||||
setFrame(0);
|
setFrame(0);
|
||||||
is_playing = false;
|
is_playing = false;
|
||||||
time_since_last_frame = 0;
|
time_since_last_frame = 0;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static step = function() {
|
static step = function() { #region
|
||||||
if(is_playing && play_freeze == 0) {
|
if(!is_playing) return;
|
||||||
time_since_last_frame += framerate * (delta_time / 1000000);
|
|
||||||
|
|
||||||
if(time_since_last_frame >= 1) {
|
var _frTime = 1 / framerate;
|
||||||
|
time_since_last_frame += delta_time / 1_000_000;
|
||||||
|
var tslf = time_since_last_frame;
|
||||||
|
|
||||||
|
if(time_since_last_frame >= _frTime) {
|
||||||
setFrame(real_frame + 1, false);
|
setFrame(real_frame + 1, false);
|
||||||
time_since_last_frame -= 1;
|
time_since_last_frame -= _frTime;
|
||||||
}
|
|
||||||
} else {
|
//var _t = get_timer();
|
||||||
frame_progress = false;
|
//print($"Frame progress {current_frame} delay {(_t - __debug_animator_counter) / 1000}");
|
||||||
//setFrame(real_frame);
|
//__debug_animator_counter = _t;
|
||||||
time_since_last_frame = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
play_freeze = max(0, play_freeze - 1);
|
//print($" > TSLF: {tslf} > {_frTime} > {time_since_last_frame}");
|
||||||
}
|
} #endregion
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
|
@ -25,10 +25,10 @@
|
||||||
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
|
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
|
||||||
|
|
||||||
LATEST_VERSION = 11500;
|
LATEST_VERSION = 11500;
|
||||||
VERSION = 11584;
|
VERSION = 11585;
|
||||||
SAVE_VERSION = 11600;
|
SAVE_VERSION = 11600;
|
||||||
VERSION_STRING = "1.16rc4";
|
VERSION_STRING = "1.16rc5";
|
||||||
BUILD_NUMBER = 11584;
|
BUILD_NUMBER = 11585;
|
||||||
|
|
||||||
globalvar APPEND_MAP;
|
globalvar APPEND_MAP;
|
||||||
APPEND_MAP = ds_map_create();
|
APPEND_MAP = ds_map_create();
|
||||||
|
|
|
@ -295,7 +295,7 @@ function Node_Collection(_x, _y, _group = noone) : Node(_x, _y, _group) construc
|
||||||
static isActiveDynamic = function(frame = CURRENT_FRAME) { #region
|
static isActiveDynamic = function(frame = CURRENT_FRAME) { #region
|
||||||
if(update_on_frame) return true;
|
if(update_on_frame) return true;
|
||||||
|
|
||||||
for( var i = 0, n = ds_list_size(inputs); i < n; i++ )
|
for( var i = custom_input_index, n = ds_list_size(inputs); i < n; i++ )
|
||||||
if(inputs[| i].isActiveDynamic(frame) || !inputs[| i].from.rendered) return true;
|
if(inputs[| i].isActiveDynamic(frame) || !inputs[| i].from.rendered) return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -100,6 +100,8 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
sprite_valid = [];
|
sprite_valid = [];
|
||||||
spliceSurf = noone;
|
spliceSurf = noone;
|
||||||
|
|
||||||
|
temp_surface = [ noone ];
|
||||||
|
|
||||||
static getPreviewValues = function() { return getInputData(0); }
|
static getPreviewValues = function() { return getInputData(0); }
|
||||||
|
|
||||||
static onValueFromUpdate = function() { _inSurf = noone; }
|
static onValueFromUpdate = function() { _inSurf = noone; }
|
||||||
|
@ -300,6 +302,9 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
var _total = _amo[0] * _amo[1];
|
var _total = _amo[0] * _amo[1];
|
||||||
var _pad = getInputData(6);
|
var _pad = getInputData(6);
|
||||||
|
|
||||||
|
surf_space = getInputData(5);
|
||||||
|
surf_origin = getInputData(9);
|
||||||
|
|
||||||
var ww = _dim[0] + _pad[0] + _pad[2];
|
var ww = _dim[0] + _pad[0] + _pad[2];
|
||||||
var hh = _dim[1] + _pad[1] + _pad[3];
|
var hh = _dim[1] + _pad[1] + _pad[3];
|
||||||
|
|
||||||
|
@ -321,28 +326,37 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
|
|
||||||
if(_filt) {
|
if(_filt) {
|
||||||
var filSize = 4;
|
var filSize = 4;
|
||||||
var _empS = surface_create_valid(filSize, filSize, cDep);
|
temp_surface[0] = surface_verify(temp_surface[0], surface_get_width_safe(_inSurf), surface_get_height_safe(_inSurf));
|
||||||
var _buff = buffer_create(filSize * filSize * surface_format_get_bytes(cDep), buffer_fixed, 2);
|
|
||||||
|
surface_set_shader(temp_surface[0], sh_slice_spritesheet_empty_scan);
|
||||||
|
shader_set_dim("dimension", _inSurf);
|
||||||
|
shader_set_f("paddingStart", _pad[2], _pad[1]);
|
||||||
|
shader_set_f("spacing", surf_space[0], surf_space[1]);
|
||||||
|
shader_set_f("spriteDim", _dim[0], _dim[1]);
|
||||||
|
shader_set_color("color", _flcl);
|
||||||
|
shader_set_i("empty", !_fltp);
|
||||||
|
|
||||||
|
draw_surface(_inSurf, 0, 0);
|
||||||
|
surface_reset_shader();
|
||||||
}
|
}
|
||||||
|
|
||||||
var _atl = array_create(_total);
|
var _atl = array_create(_total);
|
||||||
var _sar = array_create(_total);
|
var _sar = array_create(_total);
|
||||||
var _arrAmo = 0;
|
var _arrAmo = 0;
|
||||||
|
|
||||||
surf_space = getInputData(5);
|
|
||||||
surf_origin = getInputData(9);
|
|
||||||
|
|
||||||
for(var i = 0; i < _total; i++)
|
for(var i = 0; i < _total; i++)
|
||||||
sprite_pos[i] = getSpritePosition(i);
|
sprite_pos[i] = getSpritePosition(i);
|
||||||
|
|
||||||
for(var i = 0; i < _total; i++) {
|
for(var i = 0; i < _total; i++) {
|
||||||
var _s = array_safe_get(surf_array, i);
|
var _s = array_safe_get(surf_array, i);
|
||||||
|
|
||||||
if(!surface_exists(_s)) _s = surface_create(ww, hh, cDep);
|
if(!is_surface(_s))
|
||||||
|
_s = surface_create(ww, hh, cDep);
|
||||||
else if(surface_get_format(_s) != cDep) {
|
else if(surface_get_format(_s) != cDep) {
|
||||||
surface_free(_s);
|
surface_free(_s);
|
||||||
_s = surface_create(ww, hh, cDep);
|
_s = surface_create(ww, hh, cDep);
|
||||||
} else if(_resizeSurf) _s = surface_resize(_s, ww, hh);
|
} else if(_resizeSurf)
|
||||||
|
surface_resize(_s, ww, hh);
|
||||||
|
|
||||||
var _a = array_safe_get(atls_array, i, 0);
|
var _a = array_safe_get(atls_array, i, 0);
|
||||||
if(_a == 0) _a = new SurfaceAtlas(_s, 0, 0);
|
if(_a == 0) _a = new SurfaceAtlas(_s, 0, 0);
|
||||||
|
@ -367,27 +381,8 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu_set_tex_filter(true);
|
var empPx = surface_get_pixel(temp_surface[0], _spr_pos[0], _spr_pos[1]);
|
||||||
surface_set_target(_empS);
|
var empty = empPx == 0.;
|
||||||
DRAW_CLEAR
|
|
||||||
draw_surface_stretched_safe(_s, 0, 0, filSize, filSize);
|
|
||||||
surface_reset_target();
|
|
||||||
gpu_set_tex_filter(false);
|
|
||||||
|
|
||||||
buffer_get_surface(_buff, _empS, 0);
|
|
||||||
buffer_seek(_buff, buffer_seek_start, 0);
|
|
||||||
var empty = true;
|
|
||||||
|
|
||||||
repeat(filSize * filSize - 1) {
|
|
||||||
var c = buffer_read(_buff, buffer_u32);
|
|
||||||
if(_fltp == 0 && ((c & 0xFF000000) >> 24) != 0) {
|
|
||||||
empty = false;
|
|
||||||
break;
|
|
||||||
} else if(_fltp == 1 && (c & 0x00FFFFFF) != _flcl) {
|
|
||||||
empty = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!empty) {
|
if(!empty) {
|
||||||
_atl[_arrAmo] = _a;
|
_atl[_arrAmo] = _a;
|
||||||
|
@ -408,11 +403,6 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
|
|
||||||
if(_out == 1) outputs[| 0].setValue(surf_array);
|
if(_out == 1) outputs[| 0].setValue(surf_array);
|
||||||
outputs[| 1].setValue(atls_array);
|
outputs[| 1].setValue(atls_array);
|
||||||
|
|
||||||
if(_filt) {
|
|
||||||
buffer_delete(_buff);
|
|
||||||
surface_free(_empS);
|
|
||||||
}
|
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static update = function(frame = CURRENT_FRAME) { #region
|
static update = function(frame = CURRENT_FRAME) { #region
|
||||||
|
@ -422,6 +412,8 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
if(_out == 1) {
|
if(_out == 1) {
|
||||||
outputs[| 0].setValue(surf_array);
|
outputs[| 0].setValue(surf_array);
|
||||||
update_on_frame = false;
|
update_on_frame = false;
|
||||||
|
|
||||||
|
//outputs[| 0].setValue(temp_surface[0]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,8 @@ function Node_Number(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
|
|
||||||
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
|
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
|
||||||
var _res = _data[1]? round(_data[0]) : _data[0];
|
var _res = _data[1]? round(_data[0]) : _data[0];
|
||||||
|
if(!is_numeric(_res)) _res = real(_res);
|
||||||
|
|
||||||
display_output = _res;
|
display_output = _res;
|
||||||
return _res;
|
return _res;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
|
@ -38,10 +38,8 @@ function Node_PB_Box_Divide(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group
|
||||||
|
|
||||||
var _res = noone;
|
var _res = noone;
|
||||||
|
|
||||||
if(_output_index == 0)
|
if(_output_index == 0) _res = array_create(_amou);
|
||||||
_res = array_create(_amou);
|
else if(_output_index == 1) _res = array_create(_amou - 1);
|
||||||
else if(_output_index == 1)
|
|
||||||
_res = array_create(_amou - 1);
|
|
||||||
|
|
||||||
var _spAmo = _amou;
|
var _spAmo = _amou;
|
||||||
switch(_spacing) {
|
switch(_spacing) {
|
||||||
|
|
|
@ -69,8 +69,8 @@ function Node_PB_Box_Inset(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group)
|
||||||
w = round(_nbox.w * _widt);
|
w = round(_nbox.w * _widt);
|
||||||
h = round(_nbox.h * _high);
|
h = round(_nbox.h * _high);
|
||||||
|
|
||||||
x0 = _nbox.x + (_nbox.w - w) * (_nbox.mirror_h? 1. - _hali : _hali);
|
x0 = round(_nbox.x + (_nbox.w - w) * (_nbox.mirror_h? 1. - _hali : _hali));
|
||||||
y0 = _nbox.y + (_nbox.h - h) * (_nbox.mirror_v? 1. - _vali : _vali);
|
y0 = round(_nbox.y + (_nbox.h - h) * (_nbox.mirror_v? 1. - _vali : _vali));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_output_index == 0) {
|
if(_output_index == 0) {
|
||||||
|
|
|
@ -166,7 +166,7 @@ function Node_PB_Box_Split(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group)
|
||||||
if(_mirr)
|
if(_mirr)
|
||||||
draw_surface_ext_safe(_pbox.mask, 0, _nbox.h + shf, 1, -1, 0, c_white, 1);
|
draw_surface_ext_safe(_pbox.mask, 0, _nbox.h + shf, 1, -1, 0, c_white, 1);
|
||||||
else
|
else
|
||||||
draw_surface_safe(_pbox.mask, -shf, 0);
|
draw_surface_safe(_pbox.mask, 0, -shf);
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ function Node_PB_Box_Split(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group)
|
||||||
if(_mirr)
|
if(_mirr)
|
||||||
draw_surface_ext_safe(_pbox.content, 0, _nbox.h + shf, 1, -1, 0, c_white, 1);
|
draw_surface_ext_safe(_pbox.content, 0, _nbox.h + shf, 1, -1, 0, c_white, 1);
|
||||||
else
|
else
|
||||||
draw_surface_safe(_pbox.content, -shf, 0);
|
draw_surface_safe(_pbox.content, 0, -shf);
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,9 +195,7 @@ function Node_PB_Box_Split(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group)
|
||||||
draw_set_color(c_white);
|
draw_set_color(c_white);
|
||||||
draw_rectangle_border(bbox.x0, bbox.y0, bbox.x1, bbox.y1, 2);
|
draw_rectangle_border(bbox.x0, bbox.y0, bbox.x1, bbox.y1, 2);
|
||||||
|
|
||||||
if(_axs == 0)
|
if(_axs == 0) draw_line(bbox.xc, bbox.y0, bbox.xc, bbox.y1);
|
||||||
draw_line(bbox.xc, bbox.y0, bbox.xc, bbox.y1);
|
else draw_line(bbox.x0, bbox.yc, bbox.x1, bbox.yc);
|
||||||
else
|
|
||||||
draw_line(bbox.x0, bbox.yc, bbox.x1, bbox.yc);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -46,15 +46,9 @@ function Node_PB_Draw_Round_Rectangle(_x, _y, _group = noone) : Node_PB_Draw(_x,
|
||||||
if(_rela) {
|
if(_rela) {
|
||||||
inputs[| 4].setType(VALUE_TYPE.float);
|
inputs[| 4].setType(VALUE_TYPE.float);
|
||||||
inputs[| 5].setType(VALUE_TYPE.float);
|
inputs[| 5].setType(VALUE_TYPE.float);
|
||||||
|
|
||||||
inputs[| 4].editWidget.setSlideSpeed(0.001);
|
|
||||||
inputs[| 5].editWidget.setSlideSpeed(0.001);
|
|
||||||
} else {
|
} else {
|
||||||
inputs[| 4].setType(VALUE_TYPE.integer);
|
inputs[| 4].setType(VALUE_TYPE.integer);
|
||||||
inputs[| 5].setType(VALUE_TYPE.integer);
|
inputs[| 5].setType(VALUE_TYPE.integer);
|
||||||
|
|
||||||
inputs[| 4].editWidget.setSlideSpeed(0.01);
|
|
||||||
inputs[| 5].editWidget.setSlideSpeed(0.01);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -112,7 +106,7 @@ function Node_PB_Draw_Round_Rectangle(_x, _y, _group = noone) : Node_PB_Draw(_x,
|
||||||
if(_rela) _corn = max(0, round(_corn * min(_pbox.w, _pbox.h)));
|
if(_rela) _corn = max(0, round(_corn * min(_pbox.w, _pbox.h)));
|
||||||
|
|
||||||
if(_corn > array_length(corner_pixels))
|
if(_corn > array_length(corner_pixels))
|
||||||
draw_roundrect_ext(_x0, _y0, _x1, _y1, 6 + _corn, 6 + _corn, false);
|
draw_roundrect_ext(_x0 - 1, _y0 - 1, _x1, _y1, 6 + _corn, 6 + _corn, false);
|
||||||
else {
|
else {
|
||||||
draw_rectangle(_x0, _y0, _x1, _y1, false);
|
draw_rectangle(_x0, _y0, _x1, _y1, false);
|
||||||
BLEND_SUBTRACT
|
BLEND_SUBTRACT
|
||||||
|
|
|
@ -5,6 +5,17 @@ function Node_PB_Fx(_x, _y, _group = noone) : Node_PB(_x, _y, _group) constructo
|
||||||
.setVisible(true, true);
|
.setVisible(true, true);
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("pBox", self, JUNCTION_CONNECT.output, VALUE_TYPE.pbBox, noone);
|
outputs[| 0] = nodeValue("pBox", self, JUNCTION_CONNECT.output, VALUE_TYPE.pbBox, noone);
|
||||||
|
|
||||||
|
static getGraphPreviewSurface = function() {
|
||||||
|
var _nbox = outputs[| 0].getValue();
|
||||||
|
if(_nbox == noone) return noone;
|
||||||
|
if(is_array(_nbox)) {
|
||||||
|
if(array_empty(_nbox)) return noone;
|
||||||
|
_nbox = _nbox[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
return _nbox.content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#macro PB_FX_PBOX if(_output_index == 1) { \
|
#macro PB_FX_PBOX if(_output_index == 1) { \
|
||||||
|
|
|
@ -10,7 +10,18 @@ function Node_PB_Layer(_x, _y, _group = noone) : Node(_x, _y, _group) constructo
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("pBox", self, JUNCTION_CONNECT.output, VALUE_TYPE.pbBox, noone );
|
outputs[| 0] = nodeValue("pBox", self, JUNCTION_CONNECT.output, VALUE_TYPE.pbBox, noone );
|
||||||
|
|
||||||
static update = function() {}
|
static update = function() {
|
||||||
|
var _dim = group.getInputData(0);
|
||||||
|
|
||||||
|
var _box = new __pbBox();
|
||||||
|
_box.layer = getInputData(0);
|
||||||
|
_box.w = array_safe_get(_dim, 0, 1);
|
||||||
|
_box.h = array_safe_get(_dim, 1, 1);
|
||||||
|
_box.layer_w = array_safe_get(_dim, 0, 1);
|
||||||
|
_box.layer_h = array_safe_get(_dim, 1, 1);
|
||||||
|
|
||||||
|
outputs[| 0].setValue(_box);
|
||||||
|
}
|
||||||
|
|
||||||
static getPreviewValues = function() { return group.outputs[| 0].getValue(); }
|
static getPreviewValues = function() { return group.outputs[| 0].getValue(); }
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ function Node_Pixel_Builder(_x, _y, _group = noone) : Node_Collection(_x, _y, _g
|
||||||
RENDER_ALL
|
RENDER_ALL
|
||||||
}
|
}
|
||||||
|
|
||||||
static getNextNodes = function() {
|
static getNextNodes = function() { #region
|
||||||
var allReady = true;
|
var allReady = true;
|
||||||
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
||||||
var _in = inputs[| i].from;
|
var _in = inputs[| i].from;
|
||||||
|
@ -30,9 +30,9 @@ function Node_Pixel_Builder(_x, _y, _group = noone) : Node_Collection(_x, _y, _g
|
||||||
if(!allReady) return [];
|
if(!allReady) return [];
|
||||||
|
|
||||||
return __nodeLeafList(getNodeList());
|
return __nodeLeafList(getNodeList());
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static checkComplete = function() {
|
static checkComplete = function() { #region
|
||||||
for( var i = 0; i < ds_list_size(nodes); i++ )
|
for( var i = 0; i < ds_list_size(nodes); i++ )
|
||||||
if(!nodes[| i].rendered) return [];
|
if(!nodes[| i].rendered) return [];
|
||||||
|
|
||||||
|
@ -47,33 +47,9 @@ function Node_Pixel_Builder(_x, _y, _group = noone) : Node_Collection(_x, _y, _g
|
||||||
}
|
}
|
||||||
|
|
||||||
return _nodes;
|
return _nodes;
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static update = function() {
|
static buildPixel = function() { #region
|
||||||
var _dim = getInputData(0);
|
|
||||||
|
|
||||||
for( var i = 0; i < ds_list_size(nodes); i++ ) {
|
|
||||||
var _n = nodes[| i];
|
|
||||||
|
|
||||||
if(!is_instanceof(_n, Node_PB_Layer))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
var _layer = _n.getInputData(0);
|
|
||||||
|
|
||||||
var _box = new __pbBox();
|
|
||||||
_box.layer = _layer;
|
|
||||||
_box.w = _dim[0];
|
|
||||||
_box.h = _dim[1];
|
|
||||||
_box.layer_w = _dim[0];
|
|
||||||
_box.layer_h = _dim[1];
|
|
||||||
|
|
||||||
_n.outputs[| 0].setValue(_box);
|
|
||||||
}
|
|
||||||
|
|
||||||
outputs[| 0].setValue(surface_create(_dim[0], _dim[1]));
|
|
||||||
}
|
|
||||||
|
|
||||||
static buildPixel = function() {
|
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
LOG_IF(global.FLAG.render == 1, $"================== BUILD PIXEL ==================");
|
LOG_IF(global.FLAG.render == 1, $"================== BUILD PIXEL ==================");
|
||||||
LOG_BLOCK_START();
|
LOG_BLOCK_START();
|
||||||
|
@ -119,13 +95,12 @@ function Node_Pixel_Builder(_x, _y, _group = noone) : Node_Collection(_x, _y, _g
|
||||||
}
|
}
|
||||||
|
|
||||||
var _layers = ds_map_keys_to_array(_surfs);
|
var _layers = ds_map_keys_to_array(_surfs);
|
||||||
|
|
||||||
array_sort(_layers, true);
|
array_sort(_layers, true);
|
||||||
|
|
||||||
_outSurf = surface_create(_dim[0], _dim[1]);
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_target(_outSurf);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
|
|
||||||
for( var k = 0; k < array_length(_layers); k++ ) {
|
for( var k = 0; k < array_length(_layers); k++ ) {
|
||||||
var _s = _surfs[? _layers[k]];
|
var _s = _surfs[? _layers[k]];
|
||||||
|
|
||||||
|
@ -134,13 +109,10 @@ function Node_Pixel_Builder(_x, _y, _group = noone) : Node_Collection(_x, _y, _g
|
||||||
draw_surface_safe(_box.content, _box.x, _box.y);
|
draw_surface_safe(_box.content, _box.x, _box.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
ds_map_destroy(_surfs);
|
ds_map_destroy(_surfs);
|
||||||
|
|
||||||
outputs[| 0].setValue(_outSurf);
|
outputs[| 0].setValue(_outSurf);
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
PATCH_STATIC
|
|
||||||
}
|
}
|
|
@ -24,11 +24,13 @@ function Node_Polar(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
inputs[| 9] = nodeValue("Radius mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
inputs[| 9] = nodeValue("Radius mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Linear", "Inverse Square", "Logarithm" ]);
|
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Linear", "Inverse Square", "Logarithm" ]);
|
||||||
|
|
||||||
|
inputs[| 10] = nodeValue("Swap", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
input_display_list = [ 3, 4,
|
input_display_list = [ 3, 4,
|
||||||
["Surfaces", false], 0, 1, 2, 7, 8,
|
["Surfaces", false], 0, 1, 2, 7, 8,
|
||||||
["Effect", false], 5, 6, 9,
|
["Effect", false], 5, 6, 9, 10,
|
||||||
]
|
]
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
@ -44,6 +46,7 @@ function Node_Polar(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
shader_set_i("invert", _data[5]);
|
shader_set_i("invert", _data[5]);
|
||||||
shader_set_i("distMode", _data[9]);
|
shader_set_i("distMode", _data[9]);
|
||||||
shader_set_f("blend", _data[6]);
|
shader_set_f("blend", _data[6]);
|
||||||
|
shader_set_i("swap", _data[10]);
|
||||||
|
|
||||||
draw_surface_safe(_data[0], 0, 0);
|
draw_surface_safe(_data[0], 0, 0);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
|
@ -267,11 +267,12 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
all_inputs = array_verify(all_inputs, _len);
|
all_inputs = array_verify(all_inputs, _len);
|
||||||
|
|
||||||
for(var i = 0; i < _len; i++) {
|
for(var i = 0; i < _len; i++) {
|
||||||
var val = inputs[| i].getValue();
|
var raw = inputs[| i].getValue();
|
||||||
var amo = inputs[| i].arrayLength(val);
|
var amo = inputs[| i].arrayLength(raw);
|
||||||
|
var val = raw;
|
||||||
|
|
||||||
if(amo == 0) val = noone; //empty array
|
if(amo == 0) val = noone; //empty array
|
||||||
else if(amo == 1) val = val[0]; //spread single array
|
else if(amo == 1) val = raw[0]; //spread single array
|
||||||
amo = max(1, amo);
|
amo = max(1, amo);
|
||||||
|
|
||||||
setInputData(i, val);
|
setInputData(i, val);
|
||||||
|
|
|
@ -36,7 +36,7 @@ function Node_Texture_Remap(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
||||||
_outSurf = surface_verify(_outSurf, _sw, _sh);
|
_outSurf = surface_verify(_outSurf, _sw, _sh);
|
||||||
|
|
||||||
surface_set_shader(_outSurf, shader);
|
surface_set_shader(_outSurf, shader);
|
||||||
shader_set_interpolation_surface(_data[0]);
|
shader_set_interpolation(_data[0]);
|
||||||
texture_set_stage(uniform_map, surface_get_texture(_data[1]));
|
texture_set_stage(uniform_map, surface_get_texture(_data[1]));
|
||||||
draw_surface_stretched_safe(_data[0], 0, 0, _sw, _sh);
|
draw_surface_stretched_safe(_data[0], 0, 0, _sw, _sh);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
|
@ -197,7 +197,8 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
var ww = surface_get_width_safe(ins);
|
var ww = surface_get_width_safe(ins);
|
||||||
var hh = surface_get_height_safe(ins);
|
var hh = surface_get_height_safe(ins);
|
||||||
var _ww = ww, _hh = hh;
|
var _ww = ww;
|
||||||
|
var _hh = hh;
|
||||||
if(_ww <= 1 && _hh <= 1) return _outSurf;
|
if(_ww <= 1 && _hh <= 1) return _outSurf;
|
||||||
|
|
||||||
switch(out_type) {
|
switch(out_type) {
|
||||||
|
@ -244,7 +245,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
pos = point_rotate(pos[0], pos[1], pos[0] + anc[0], pos[1] + anc[1], rot);
|
pos = point_rotate(pos[0], pos[1], pos[0] + anc[0], pos[1] + anc[1], rot);
|
||||||
|
|
||||||
if(mode == 1) {
|
if(mode == 1) { #region
|
||||||
var _w = _ww * sqrt(2);
|
var _w = _ww * sqrt(2);
|
||||||
var _h = _hh * sqrt(2);
|
var _h = _hh * sqrt(2);
|
||||||
var _px = (_w - _ww) / 2;
|
var _px = (_w - _ww) / 2;
|
||||||
|
@ -253,7 +254,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
surface_set_target(_s);
|
surface_set_target(_s);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
BLEND_OVERRIDE;
|
BLEND_OVERRIDE
|
||||||
|
|
||||||
if(is_surface(ins)) {
|
if(is_surface(ins)) {
|
||||||
var draw_x, draw_y;
|
var draw_x, draw_y;
|
||||||
|
@ -267,17 +268,18 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
draw_surface_tiled_ext_safe(ins, draw_x, draw_y, sca[0], sca[1], c_white, 1);
|
draw_surface_tiled_ext_safe(ins, draw_x, draw_y, sca[0], sca[1], c_white, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
BLEND_NORMAL;
|
BLEND_NORMAL
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
var _cc = point_rotate(-_px, -_py, _ww / 2, _hh / 2, rot);
|
var _cc = point_rotate(-_px, -_py, _ww / 2, _hh / 2, rot);
|
||||||
surface_set_shader(_outSurf);
|
surface_set_shader(_outSurf);
|
||||||
shader_set_interpolation_surface(_s);
|
shader_set_interpolation(_s);
|
||||||
draw_surface_ext_safe(_s, _cc[0], _cc[1], 1, 1, rot, c_white, 1);
|
draw_surface_ext_safe(_s, _cc[0], _cc[1], 1, 1, rot, c_white, 1);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
||||||
surface_free(_s);
|
surface_free(_s);
|
||||||
} else {
|
#endregion
|
||||||
|
} else { #region
|
||||||
var draw_x, draw_y;
|
var draw_x, draw_y;
|
||||||
draw_x = pos[0];
|
draw_x = pos[0];
|
||||||
draw_y = pos[1];
|
draw_y = pos[1];
|
||||||
|
@ -288,7 +290,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
}
|
}
|
||||||
|
|
||||||
surface_set_shader(_outSurf);
|
surface_set_shader(_outSurf);
|
||||||
shader_set_interpolation_surface(ins);
|
shader_set_interpolation(ins);
|
||||||
draw_surface_ext_safe(ins, draw_x, draw_y, sca[0], sca[1], rot, c_white, 1);
|
draw_surface_ext_safe(ins, draw_x, draw_y, sca[0], sca[1], rot, c_white, 1);
|
||||||
|
|
||||||
if(mode == 2) {
|
if(mode == 2) {
|
||||||
|
@ -304,6 +306,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
draw_surface_ext_safe(ins, draw_x + _ww, draw_y + _hh, sca[0], sca[1], rot, c_white, 1);
|
draw_surface_ext_safe(ins, draw_x + _ww, draw_y + _hh, sca[0], sca[1], rot, c_white, 1);
|
||||||
}
|
}
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
return _outSurf;
|
return _outSurf;
|
||||||
|
|
|
@ -575,6 +575,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
def_val = _value;
|
def_val = _value;
|
||||||
def_length = is_array(def_val)? array_length(def_val) : 0;
|
def_length = is_array(def_val)? array_length(def_val) : 0;
|
||||||
unit = new nodeValueUnit(self);
|
unit = new nodeValueUnit(self);
|
||||||
|
def_unit = VALUE_UNIT.constant;
|
||||||
dyna_depo = ds_list_create();
|
dyna_depo = ds_list_create();
|
||||||
value_tag = "";
|
value_tag = "";
|
||||||
|
|
||||||
|
@ -694,11 +695,16 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
return self;
|
return self;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static resetValue = function() { setValue(def_val); is_modified = false; }
|
static resetValue = function() { #region
|
||||||
|
unit.mode = def_unit;
|
||||||
|
setValue(unit.apply(def_val));
|
||||||
|
is_modified = false;
|
||||||
|
} #endregion
|
||||||
|
|
||||||
static setUnitRef = function(ref, mode = VALUE_UNIT.constant) { #region
|
static setUnitRef = function(ref, mode = VALUE_UNIT.constant) { #region
|
||||||
unit.reference = ref;
|
unit.reference = ref;
|
||||||
unit.mode = mode;
|
unit.mode = mode;
|
||||||
|
def_unit = mode;
|
||||||
cache_value[0] = false;
|
cache_value[0] = false;
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
@ -1406,6 +1412,20 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
return value;
|
return value;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
|
static valueExpressionProcess = function(value) { #region
|
||||||
|
switch(type) {
|
||||||
|
case VALUE_TYPE.float :
|
||||||
|
case VALUE_TYPE.integer :
|
||||||
|
if(!is_numeric(value))
|
||||||
|
return toNumber(value);
|
||||||
|
break;
|
||||||
|
case VALUE_TYPE.boolean :
|
||||||
|
return bool(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
} #endregion
|
||||||
|
|
||||||
static resetCache = function() { cache_value[0] = false; }
|
static resetCache = function() { cache_value[0] = false; }
|
||||||
|
|
||||||
static getValue = function(_time = CURRENT_FRAME, applyUnit = true, arrIndex = 0, useCache = false, log = false) { #region
|
static getValue = function(_time = CURRENT_FRAME, applyUnit = true, arrIndex = 0, useCache = false, log = false) { #region
|
||||||
|
@ -1497,6 +1517,15 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
if(connect_type == JUNCTION_CONNECT.output)
|
if(connect_type == JUNCTION_CONNECT.output)
|
||||||
return val;
|
return val;
|
||||||
|
|
||||||
|
if(expUse) {
|
||||||
|
if(is_array(val)) {
|
||||||
|
for( var i = 0, n = array_length(val); i < n; i++ )
|
||||||
|
val[i] = valueExpressionProcess(val[i]);
|
||||||
|
} else
|
||||||
|
val = valueExpressionProcess(val);
|
||||||
|
return arrayBalance(val);
|
||||||
|
}
|
||||||
|
|
||||||
if(typ == VALUE_TYPE.surface && (type == VALUE_TYPE.integer || type == VALUE_TYPE.float) && accept_array) { //Dimension conversion
|
if(typ == VALUE_TYPE.surface && (type == VALUE_TYPE.integer || type == VALUE_TYPE.float) && accept_array) { //Dimension conversion
|
||||||
if(is_array(val)) {
|
if(is_array(val)) {
|
||||||
var eqSize = true;
|
var eqSize = true;
|
||||||
|
@ -1562,12 +1591,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
};
|
};
|
||||||
|
|
||||||
var _exp_res = expTree.eval(variable_clone(expContext));
|
var _exp_res = expTree.eval(variable_clone(expContext));
|
||||||
//print(json_stringify(expTree, true));
|
printIf(global.LOG_EXPRESSION, $">>>> Result = {_exp_res}");
|
||||||
//print($"======= {_exp_res}");
|
|
||||||
|
|
||||||
if(is_undefined(_exp_res)) {
|
if(is_undefined(_exp_res)) {
|
||||||
val[0] = 0;
|
val[0] = 0;
|
||||||
noti_warning("Expression not returning any values.");
|
noti_warning("Expression not returning valid values.");
|
||||||
} else
|
} else
|
||||||
val[0] = _exp_res;
|
val[0] = _exp_res;
|
||||||
global.EVALUATE_HEAD = noone;
|
global.EVALUATE_HEAD = noone;
|
||||||
|
@ -1594,12 +1622,14 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
||||||
animators[i].values[| 0].time = CURRENT_FRAME;
|
animators[i].values[| 0].time = CURRENT_FRAME;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
var _val = animator.getValue();
|
||||||
ds_list_clear(animator.values);
|
ds_list_clear(animator.values);
|
||||||
animator.values[| 0] = new valueKey(0, animator.getValue(), animator);
|
animator.values[| 0] = new valueKey(0, _val, animator);
|
||||||
|
|
||||||
for( var i = 0, n = array_length(animators); i < n; i++ ) {
|
for( var i = 0, n = array_length(animators); i < n; i++ ) {
|
||||||
|
var _val = animators[i].getValue();
|
||||||
ds_list_clear(animators[i].values);
|
ds_list_clear(animators[i].values);
|
||||||
animators[i].values[| 0] = new valueKey(0, animators[i].getValue(), animators[i]);
|
animators[i].values[| 0] = new valueKey(0, _val, animators[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ function Panel_Collection() : PanelContent() constructor {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var icon_path = string_replace(_path, filename_ext(_path), "") + ".png";
|
var icon_path = string_replace(_path, filename_ext(_path), ".png");
|
||||||
surface_save_safe(preview_surface, icon_path);
|
surface_save_safe(preview_surface, icon_path);
|
||||||
|
|
||||||
refreshContext();
|
refreshContext();
|
||||||
|
@ -84,18 +84,11 @@ function Panel_Collection() : PanelContent() constructor {
|
||||||
if(STEAM_ENABLED) {
|
if(STEAM_ENABLED) {
|
||||||
if(!meta.steam) {
|
if(!meta.steam) {
|
||||||
array_push(contentMenu, menuItem(__txtx("panel_collection_workshop_upload", "Upload to Steam Workshop") + "...", function() {
|
array_push(contentMenu, menuItem(__txtx("panel_collection_workshop_upload", "Upload to Steam Workshop") + "...", function() {
|
||||||
var s = PANEL_PREVIEW.getNodePreviewSurface();
|
|
||||||
if(!is_surface(s)) {
|
|
||||||
noti_warning("Please send any node to preview panel to use as a thumbnail.")
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
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.getInspecting();
|
|
||||||
dia.data_path = data_path;
|
dia.data_path = data_path;
|
||||||
dia.ugc = 1;
|
dia.ugc = 1;
|
||||||
dia.updating = _menu_node;
|
dia.updating = _menu_node;
|
||||||
|
@ -104,12 +97,17 @@ function Panel_Collection() : PanelContent() constructor {
|
||||||
} else {
|
} else {
|
||||||
if(meta.author_steam_id == STEAM_USER_ID && meta.file_id != 0) {
|
if(meta.author_steam_id == STEAM_USER_ID && meta.file_id != 0) {
|
||||||
array_push(contentMenu, menuItem(__txtx("panel_collection_workshop_update", "Update Steam Workshop content") + "...", function() {
|
array_push(contentMenu, menuItem(__txtx("panel_collection_workshop_update", "Update Steam Workshop content") + "...", function() {
|
||||||
|
var _node = PANEL_INSPECTOR.getInspecting();
|
||||||
|
if(_node == noone) {
|
||||||
|
noti_warning("No node selected. Select a node in graph panel to update workshop content.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
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.getInspecting();
|
dia.node = _node;
|
||||||
dia.data_path = data_path;
|
dia.data_path = data_path;
|
||||||
dia.ugc = 2;
|
dia.ugc = 2;
|
||||||
dia.updating = _menu_node;
|
dia.updating = _menu_node;
|
||||||
|
|
|
@ -136,14 +136,14 @@ function graph_export_image(allList, nodeList, settings = {}) {
|
||||||
if(bgEnable) draw_clear(bgColor);
|
if(bgEnable) draw_clear(bgColor);
|
||||||
else draw_clear_alpha(0, 0);
|
else draw_clear_alpha(0, 0);
|
||||||
|
|
||||||
|
BLEND_ALPHA_MULP
|
||||||
draw_surface(s, borderPad, borderPad);
|
draw_surface(s, borderPad, borderPad);
|
||||||
|
|
||||||
draw_set_color(borderColor);
|
draw_set_color(borderColor);
|
||||||
draw_set_alpha(borderAlpha);
|
draw_set_alpha(borderAlpha);
|
||||||
|
|
||||||
draw_rectangle(borderPad, borderPad, bbox_w + borderPad, bbox_h + borderPad, 1);
|
draw_rectangle(borderPad, borderPad, bbox_w + borderPad, bbox_h + borderPad, 1);
|
||||||
|
|
||||||
draw_set_alpha(1);
|
draw_set_alpha(1);
|
||||||
|
BLEND_NORMAL
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@
|
||||||
return true;
|
return true;
|
||||||
} ];
|
} ];
|
||||||
|
|
||||||
|
global.FUNCTIONS[? "surface_get_dimension"] = [ ["surface"], function(val) { var s = array_safe_get(val, 0); return [ surface_get_width_safe(s), surface_get_height_safe(s) ]; } ];
|
||||||
global.FUNCTIONS[? "surface_get_width"] = [ ["surface"], function(val) { return surface_get_width_safe(array_safe_get(val, 0)); } ];
|
global.FUNCTIONS[? "surface_get_width"] = [ ["surface"], function(val) { return surface_get_width_safe(array_safe_get(val, 0)); } ];
|
||||||
global.FUNCTIONS[? "surface_get_height"] = [ ["surface"], function(val) { return surface_get_height_safe(array_safe_get(val, 0)); } ];
|
global.FUNCTIONS[? "surface_get_height"] = [ ["surface"], function(val) { return surface_get_height_safe(array_safe_get(val, 0)); } ];
|
||||||
|
|
||||||
|
@ -464,6 +465,7 @@
|
||||||
printIf(global.LOG_EXPRESSION, $"symbol : {symbol}");
|
printIf(global.LOG_EXPRESSION, $"symbol : {symbol}");
|
||||||
printIf(global.LOG_EXPRESSION, $"l : | {typeof(l)} |{l}|");
|
printIf(global.LOG_EXPRESSION, $"l : | {typeof(l)} |{l}|");
|
||||||
printIf(global.LOG_EXPRESSION, $"r : | {typeof(r)} |{r}|");
|
printIf(global.LOG_EXPRESSION, $"r : | {typeof(r)} |{r}|");
|
||||||
|
printIf(global.LOG_EXPRESSION, $"params : {params}");
|
||||||
printIf(global.LOG_EXPRESSION, "====================");
|
printIf(global.LOG_EXPRESSION, "====================");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,12 +8,13 @@ function steam_ugc_create_collection(file) { #region
|
||||||
|
|
||||||
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));
|
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)
|
||||||
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(array_safe_get(file.spr_path, 0));
|
||||||
|
|
||||||
STEAM_UGC_ITEM_ID = steam_ugc_create_item(STEAM_APP_ID, ugc_filetype_community);
|
STEAM_UGC_ITEM_ID = steam_ugc_create_item(STEAM_APP_ID, ugc_filetype_community);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
@ -28,6 +29,7 @@ function steam_ugc_update_collection(file, update_preview = false, update_note =
|
||||||
|
|
||||||
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));
|
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)
|
||||||
|
@ -44,17 +46,23 @@ function steam_ugc_update_collection(file, update_preview = false, update_note =
|
||||||
array_insert(tgs, 0, "Collection");
|
array_insert(tgs, 0, "Collection");
|
||||||
array_push(tgs, VERSION_STRING);
|
array_push(tgs, VERSION_STRING);
|
||||||
|
|
||||||
|
steam_ugc_collection_generate(array_safe_get(file.spr_path, 0));
|
||||||
|
|
||||||
steam_ugc_set_item_tags(STEAM_UGC_UPDATE_HANDLE, tgs);
|
steam_ugc_set_item_tags(STEAM_UGC_UPDATE_HANDLE, tgs);
|
||||||
steam_ugc_set_item_content(STEAM_UGC_UPDATE_HANDLE, DIRECTORY + "steamUGC");
|
steam_ugc_set_item_content(STEAM_UGC_UPDATE_HANDLE, DIRECTORY + "steamUGC");
|
||||||
|
if(file_exists(TEMPDIR + "steamUGCthumbnail.png"))
|
||||||
|
steam_ugc_set_item_preview(STEAM_UGC_UPDATE_HANDLE, TEMPDIR + "steamUGCthumbnail.png");
|
||||||
|
|
||||||
STEAM_UGC_SUBMIT_ID = steam_ugc_submit_item_update(STEAM_UGC_UPDATE_HANDLE, update_note);
|
STEAM_UGC_SUBMIT_ID = steam_ugc_submit_item_update(STEAM_UGC_UPDATE_HANDLE, update_note);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
function steam_ugc_collection_generate(file, dest_path = TEMPDIR + "steamUGCthumbnail.png") { #region
|
function steam_ugc_collection_generate(file, dest_path = TEMPDIR + "steamUGCthumbnail.png") { #region
|
||||||
file_delete(dest_path);
|
file_delete(dest_path);
|
||||||
var spr = STEAM_UGC_ITEM_FILE.getSpr();
|
|
||||||
var prev_size = 512;
|
var prev_size = 512;
|
||||||
|
var spr = sprite_add(file, 0, false, false, 0, 0);
|
||||||
var _s = surface_create(prev_size, prev_size);
|
var _s = surface_create(prev_size, prev_size);
|
||||||
|
|
||||||
surface_set_target(_s);
|
surface_set_target(_s);
|
||||||
draw_clear(COLORS._main_icon_dark);
|
draw_clear(COLORS._main_icon_dark);
|
||||||
draw_sprite_tiled(s_workshop_bg, 0, -64, -64);
|
draw_sprite_tiled(s_workshop_bg, 0, -64, -64);
|
||||||
|
@ -71,9 +79,9 @@ function steam_ugc_collection_generate(file, dest_path = TEMPDIR + "steamUGCthum
|
||||||
|
|
||||||
draw_set_text(f_h2, fa_right, fa_bottom, COLORS._main_icon_dark);
|
draw_set_text(f_h2, fa_right, fa_bottom, COLORS._main_icon_dark);
|
||||||
var _bw = 48 + string_width(VERSION_STRING);
|
var _bw = 48 + string_width(VERSION_STRING);
|
||||||
var _bh = 88;
|
var _bh = 80;
|
||||||
draw_sprite_stretched(s_workshop_badge_version, 0, prev_size - 8 - _bw, prev_size - 8 - _bh, _bw, _bh);
|
draw_sprite_stretched(s_workshop_badge_version, 0, prev_size - 8 - _bw, prev_size - 8 - _bh, _bw, _bh);
|
||||||
draw_text(prev_size - 16, prev_size - 12, VERSION_STRING);
|
draw_text(prev_size - 16, prev_size - 8, VERSION_STRING);
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
surface_save_safe(_s, dest_path);
|
surface_save_safe(_s, dest_path);
|
||||||
surface_free(_s);
|
surface_free(_s);
|
||||||
|
|
|
@ -147,10 +147,11 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
|
||||||
}
|
}
|
||||||
var guide = function_guide_server(_fn);
|
var guide = function_guide_server(_fn);
|
||||||
|
|
||||||
if(guide != "") {
|
|
||||||
o_dialog_textbox_function_guide.activate(self);
|
|
||||||
o_dialog_textbox_function_guide.dialog_x = rx + cursor_pos_x + 1;
|
o_dialog_textbox_function_guide.dialog_x = rx + cursor_pos_x + 1;
|
||||||
o_dialog_textbox_function_guide.dialog_y = ry + cursor_pos_y - 12;
|
o_dialog_textbox_function_guide.dialog_y = ry + cursor_pos_y - 12;
|
||||||
|
|
||||||
|
if(guide != "") {
|
||||||
|
o_dialog_textbox_function_guide.activate(self);
|
||||||
o_dialog_textbox_function_guide.prompt = guide;
|
o_dialog_textbox_function_guide.prompt = guide;
|
||||||
o_dialog_textbox_function_guide.index = amo;
|
o_dialog_textbox_function_guide.index = amo;
|
||||||
} else
|
} else
|
||||||
|
@ -207,7 +208,9 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(isCodeFormat() && o_dialog_textbox_autocomplete.textbox == self)) {
|
var tbActive = o_dialog_textbox_autocomplete.active && o_dialog_textbox_autocomplete.textbox == self;
|
||||||
|
|
||||||
|
if(!(isCodeFormat() && tbActive)) {
|
||||||
if(key == vk_up) {
|
if(key == vk_up) {
|
||||||
var _target;
|
var _target;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ varying vec4 v_vColour;
|
||||||
uniform int invert;
|
uniform int invert;
|
||||||
uniform float blend;
|
uniform float blend;
|
||||||
uniform int distMode;
|
uniform int distMode;
|
||||||
|
uniform int swap;
|
||||||
|
|
||||||
#region /////////////// SAMPLING ///////////////
|
#region /////////////// SAMPLING ///////////////
|
||||||
|
|
||||||
|
@ -67,7 +68,7 @@ void main() {
|
||||||
vec2 cenPos = v_vTexcoord - center;
|
vec2 cenPos = v_vTexcoord - center;
|
||||||
float angle = (atan(cenPos.y, cenPos.x) / PI + 1.) / 2.;
|
float angle = (atan(cenPos.y, cenPos.x) / PI + 1.) / 2.;
|
||||||
|
|
||||||
coord = fract(vec2(angle, dist));
|
coord = fract(vec2(dist, angle));
|
||||||
} else if(invert == 1) {
|
} else if(invert == 1) {
|
||||||
float dist = v_vTexcoord.x * 0.5;
|
float dist = v_vTexcoord.x * 0.5;
|
||||||
if(distMode == 1) dist = sqrt(dist);
|
if(distMode == 1) dist = sqrt(dist);
|
||||||
|
@ -78,5 +79,6 @@ void main() {
|
||||||
coord = fract(center + vec2(cos(ang), sin(ang)) * dist);
|
coord = fract(center + vec2(cos(ang), sin(ang)) * dist);
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_FragColor = texture2D( gm_BaseTexture, mix(v_vTexcoord, coord, blend) );
|
if(swap == 1) coord.xy = coord.yx;
|
||||||
|
gl_FragColor = texture2Dintp( gm_BaseTexture, mix(v_vTexcoord, coord, blend) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
//
|
||||||
|
// Simple passthrough fragment shader
|
||||||
|
//
|
||||||
|
varying vec2 v_vTexcoord;
|
||||||
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
uniform vec2 dimension;
|
||||||
|
uniform vec2 paddingStart;
|
||||||
|
uniform vec2 spacing;
|
||||||
|
uniform vec2 spriteDim;
|
||||||
|
uniform vec4 color;
|
||||||
|
uniform int empty;
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
vec2 px = v_vTexcoord * dimension - 0.5;
|
||||||
|
vec2 cls = floor((px - paddingStart) / (spriteDim + spacing)) * (spriteDim + spacing);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(0.);
|
||||||
|
|
||||||
|
for(float i = 0.; i < spriteDim.x; i++)
|
||||||
|
for(float j = 0.; j < spriteDim.y; j++) {
|
||||||
|
vec2 tx = (cls + vec2(i, j)) / dimension;
|
||||||
|
vec4 col = texture2D( gm_BaseTexture, tx );
|
||||||
|
|
||||||
|
if((empty == 1 && col.a != 0.) || (empty == 0 && col != color)) {
|
||||||
|
gl_FragColor = col;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
//
|
||||||
|
// Simple passthrough vertex shader
|
||||||
|
//
|
||||||
|
attribute vec3 in_Position; // (x,y,z)
|
||||||
|
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
|
||||||
|
attribute vec4 in_Colour; // (r,g,b,a)
|
||||||
|
attribute vec2 in_TextureCoord; // (u,v)
|
||||||
|
|
||||||
|
varying vec2 v_vTexcoord;
|
||||||
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
|
||||||
|
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
|
||||||
|
|
||||||
|
v_vColour = in_Colour;
|
||||||
|
v_vTexcoord = in_TextureCoord;
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
{
|
||||||
|
"resourceType": "GMShader",
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "sh_slice_spritesheet_empty_scan",
|
||||||
|
"parent": {
|
||||||
|
"name": "misc",
|
||||||
|
"path": "folders/shader/misc.yy",
|
||||||
|
},
|
||||||
|
"type": 1,
|
||||||
|
}
|
Loading…
Reference in a new issue