mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 19:38:05 +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":"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":"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_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",},
|
||||
|
|
|
@ -1891,6 +1891,7 @@
|
|||
{"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":"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_local_analyze","path":"sprites/s_node_local_analyze/s_node_local_analyze.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
|
||||
_list = NEW_NODES;
|
||||
#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();
|
||||
|
||||
var sug = [];
|
||||
|
|
|
@ -16,13 +16,16 @@ event_inherited();
|
|||
meta_expand = false;
|
||||
updating = noone;
|
||||
update_note = "Updated";
|
||||
onModify = -1;
|
||||
|
||||
node = noone;
|
||||
node = noone;
|
||||
data_path = "";
|
||||
|
||||
ugc = 0;
|
||||
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_auth = new textArea(TEXTBOX_INPUT.text, function(str) { meta.author = str; });
|
||||
|
@ -44,11 +47,4 @@ event_inherited();
|
|||
dialog_w = dialog_w_expand;
|
||||
dialog_h = dialog_h_expand;
|
||||
}
|
||||
#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)
|
||||
meta.author_steam_id = STEAM_USER_ID;
|
||||
|
||||
if(updating == noone) {
|
||||
if(updating == noone && node != noone) {
|
||||
saveCollection(node, data_path, meta.name, true, meta);
|
||||
} else {
|
||||
var _map = json_load_struct(updating.path);
|
||||
|
@ -64,7 +64,22 @@
|
|||
json_save_struct(updating.path, _map);
|
||||
json_save_struct(updating.meta_path, _meta);
|
||||
|
||||
updating.meta = 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;
|
||||
|
||||
PANEL_COLLECTION.refreshContext();
|
||||
}
|
||||
|
||||
|
@ -73,7 +88,7 @@
|
|||
ugc_loading = true;
|
||||
} else if(ugc == 2) {
|
||||
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;
|
||||
} else
|
||||
instance_destroy();
|
||||
|
@ -86,7 +101,7 @@
|
|||
doExpand();
|
||||
#endregion
|
||||
|
||||
#region metadata
|
||||
#region display
|
||||
dialog_h = ui(64);
|
||||
|
||||
if(meta_expand) {
|
||||
|
|
|
@ -44,15 +44,18 @@ event_inherited();
|
|||
draw_clear_alpha(COLORS.panel_bg_clear_inner, 0);
|
||||
var expand = PREFERENCES.splash_expand_recent;
|
||||
var ww = ui(264);
|
||||
var hh = 0;
|
||||
var hh = ui(8);
|
||||
var pad = ui(8);
|
||||
var hgt = ui(16) + line_get_height(f_p0b) + line_get_height(f_p1);
|
||||
_y += pad;
|
||||
|
||||
var col = expand? 2 : 1;
|
||||
var row = ceil(ds_list_size(RECENT_FILES) / col);
|
||||
var hg = recent_thumbnail? ui(100) : hgt;
|
||||
|
||||
for(var i = 0; i < row; i++) {
|
||||
|
||||
if(_y > -(hg + pad) && _y < sp_recent.surface_h)
|
||||
for(var j = 0; j < col; j++) {
|
||||
var ind = i * col + j;
|
||||
if(ind >= ds_list_size(RECENT_FILES)) break;
|
||||
|
@ -61,14 +64,8 @@ event_inherited();
|
|||
var _dat = RECENT_FILE_DATA[| ind];
|
||||
if(!file_exists(_rec)) continue;
|
||||
|
||||
var thmb = noone;
|
||||
var hg = hgt;
|
||||
if(recent_thumbnail) {
|
||||
hg = ui(100);
|
||||
thmb = _dat.getThumbnail();
|
||||
}
|
||||
|
||||
var fx = j * (ww + ui(8));
|
||||
var thmb = recent_thumbnail? _dat.getThumbnail() : noone;
|
||||
var fx = j * (ww + ui(8));
|
||||
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, fx, _y, ww, hg);
|
||||
if(thmb && _y + hg > 0 && _y < sp_recent.h) {
|
||||
|
|
|
@ -42,7 +42,7 @@ if !ready exit;
|
|||
|
||||
draw_set_text(f_p0, fa_left, fa_bottom, COLORS._main_text_sub);
|
||||
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.draw(x0 + ui(6), 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.cursor += _repAmo - _prmAmo;
|
||||
textbox.cut_line();
|
||||
textbox.autocomplete_delay = 0;
|
||||
textbox = noone;
|
||||
|
||||
prompt = "";
|
||||
data = [];
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -326,4 +326,6 @@
|
|||
|
||||
#region debug
|
||||
//instance_create_depth(0, 0, 0, addon_key_displayer);
|
||||
|
||||
__debug_animator_counter = 0;
|
||||
#endregion
|
|
@ -75,7 +75,7 @@ _HOVERING_ELEMENT = noone;
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region render
|
||||
#region animation & render
|
||||
//physics_pause_enable(true);
|
||||
DEF_SURFACE_RESET();
|
||||
|
||||
|
|
|
@ -24,15 +24,14 @@
|
|||
framerate = 30;
|
||||
is_playing = false;
|
||||
frame_progress = false;
|
||||
play_freeze = 0;
|
||||
render_stop = false;
|
||||
|
||||
__debug_animator_counter = 0;
|
||||
|
||||
rendering = [];
|
||||
playback = ANIMATOR_END.loop;
|
||||
|
||||
static setFrame = function(frame, resetTime = true) {
|
||||
//if(frame == 0) resetAnimation();
|
||||
|
||||
static setFrame = function(frame, resetTime = true) { #region
|
||||
var _c = current_frame;
|
||||
frame = clamp(frame, 0, frames_total);
|
||||
real_frame = frame;
|
||||
|
@ -41,12 +40,12 @@
|
|||
if(current_frame == frames_total) {
|
||||
if(render_stop) {
|
||||
is_playing = false;
|
||||
setFrame(0);
|
||||
setFrame(0, resetTime);
|
||||
render_stop = false;
|
||||
} else if(playback == ANIMATOR_END.stop) {
|
||||
is_playing = false;
|
||||
} else {
|
||||
setFrame(0);
|
||||
setFrame(0, resetTime);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -59,9 +58,9 @@
|
|||
frame_progress = false;
|
||||
|
||||
if(array_length(rendering)) render_stop = true;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static resetAnimation = function() {
|
||||
static resetAnimation = function() { #region
|
||||
var _key = ds_map_find_first(PROJECT.nodeMap);
|
||||
var amo = ds_map_size(PROJECT.nodeMap);
|
||||
|
||||
|
@ -70,61 +69,63 @@
|
|||
_node.resetAnimation();
|
||||
_key = ds_map_find_next(PROJECT.nodeMap, _key);
|
||||
}
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static render = function() {
|
||||
static render = function() { #region
|
||||
setFrame(0);
|
||||
is_playing = true;
|
||||
frame_progress = true;
|
||||
time_since_last_frame = 0;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static toggle = function() {
|
||||
static toggle = function() { #region
|
||||
is_playing = !is_playing;
|
||||
frame_progress = true;
|
||||
time_since_last_frame = 0;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static pause = function() {
|
||||
static pause = function() { #region
|
||||
is_playing = false;
|
||||
frame_progress = true;
|
||||
time_since_last_frame = 0;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static play = function() {
|
||||
static play = function() { #region
|
||||
setFrame(0);
|
||||
is_playing = true;
|
||||
frame_progress = true;
|
||||
time_since_last_frame = 0;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static resume = function() {
|
||||
static resume = function() { #region
|
||||
is_playing = true;
|
||||
frame_progress = true;
|
||||
time_since_last_frame = 0;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static stop = function() {
|
||||
static stop = function() { #region
|
||||
setFrame(0);
|
||||
is_playing = false;
|
||||
time_since_last_frame = 0;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static step = function() {
|
||||
if(is_playing && play_freeze == 0) {
|
||||
time_since_last_frame += framerate * (delta_time / 1000000);
|
||||
static step = function() { #region
|
||||
if(!is_playing) return;
|
||||
|
||||
var _frTime = 1 / framerate;
|
||||
time_since_last_frame += delta_time / 1_000_000;
|
||||
var tslf = time_since_last_frame;
|
||||
|
||||
if(time_since_last_frame >= 1) {
|
||||
setFrame(real_frame + 1, false);
|
||||
time_since_last_frame -= 1;
|
||||
}
|
||||
} else {
|
||||
frame_progress = false;
|
||||
//setFrame(real_frame);
|
||||
time_since_last_frame = 0;
|
||||
if(time_since_last_frame >= _frTime) {
|
||||
setFrame(real_frame + 1, false);
|
||||
time_since_last_frame -= _frTime;
|
||||
|
||||
//var _t = get_timer();
|
||||
//print($"Frame progress {current_frame} delay {(_t - __debug_animator_counter) / 1000}");
|
||||
//__debug_animator_counter = _t;
|
||||
}
|
||||
|
||||
play_freeze = max(0, play_freeze - 1);
|
||||
}
|
||||
|
||||
//print($" > TSLF: {tslf} > {_frTime} > {time_since_last_frame}");
|
||||
} #endregion
|
||||
}
|
||||
#endregion
|
|
@ -25,10 +25,10 @@
|
|||
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
|
||||
|
||||
LATEST_VERSION = 11500;
|
||||
VERSION = 11584;
|
||||
VERSION = 11585;
|
||||
SAVE_VERSION = 11600;
|
||||
VERSION_STRING = "1.16rc4";
|
||||
BUILD_NUMBER = 11584;
|
||||
VERSION_STRING = "1.16rc5";
|
||||
BUILD_NUMBER = 11585;
|
||||
|
||||
globalvar APPEND_MAP;
|
||||
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
|
||||
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;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -100,6 +100,8 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
|||
sprite_valid = [];
|
||||
spliceSurf = noone;
|
||||
|
||||
temp_surface = [ noone ];
|
||||
|
||||
static getPreviewValues = function() { return getInputData(0); }
|
||||
|
||||
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 _pad = getInputData(6);
|
||||
|
||||
surf_space = getInputData(5);
|
||||
surf_origin = getInputData(9);
|
||||
|
||||
var ww = _dim[0] + _pad[0] + _pad[2];
|
||||
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) {
|
||||
var filSize = 4;
|
||||
var _empS = surface_create_valid(filSize, filSize, cDep);
|
||||
var _buff = buffer_create(filSize * filSize * surface_format_get_bytes(cDep), buffer_fixed, 2);
|
||||
temp_surface[0] = surface_verify(temp_surface[0], surface_get_width_safe(_inSurf), surface_get_height_safe(_inSurf));
|
||||
|
||||
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 _sar = array_create(_total);
|
||||
var _arrAmo = 0;
|
||||
|
||||
surf_space = getInputData(5);
|
||||
surf_origin = getInputData(9);
|
||||
|
||||
for(var i = 0; i < _total; i++)
|
||||
sprite_pos[i] = getSpritePosition(i);
|
||||
|
||||
for(var i = 0; i < _total; 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) {
|
||||
surface_free(_s);
|
||||
_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);
|
||||
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;
|
||||
}
|
||||
|
||||
gpu_set_tex_filter(true);
|
||||
surface_set_target(_empS);
|
||||
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;
|
||||
}
|
||||
}
|
||||
var empPx = surface_get_pixel(temp_surface[0], _spr_pos[0], _spr_pos[1]);
|
||||
var empty = empPx == 0.;
|
||||
|
||||
if(!empty) {
|
||||
_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);
|
||||
outputs[| 1].setValue(atls_array);
|
||||
|
||||
if(_filt) {
|
||||
buffer_delete(_buff);
|
||||
surface_free(_empS);
|
||||
}
|
||||
} #endregion
|
||||
|
||||
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) {
|
||||
outputs[| 0].setValue(surf_array);
|
||||
update_on_frame = false;
|
||||
|
||||
//outputs[| 0].setValue(temp_surface[0]);
|
||||
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
|
||||
var _res = _data[1]? round(_data[0]) : _data[0];
|
||||
if(!is_numeric(_res)) _res = real(_res);
|
||||
|
||||
display_output = _res;
|
||||
return _res;
|
||||
} #endregion
|
||||
|
|
|
@ -38,10 +38,8 @@ function Node_PB_Box_Divide(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group
|
|||
|
||||
var _res = noone;
|
||||
|
||||
if(_output_index == 0)
|
||||
_res = array_create(_amou);
|
||||
else if(_output_index == 1)
|
||||
_res = array_create(_amou - 1);
|
||||
if(_output_index == 0) _res = array_create(_amou);
|
||||
else if(_output_index == 1) _res = array_create(_amou - 1);
|
||||
|
||||
var _spAmo = _amou;
|
||||
switch(_spacing) {
|
||||
|
@ -52,7 +50,7 @@ function Node_PB_Box_Divide(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group
|
|||
}
|
||||
|
||||
if(_axis == 0) {
|
||||
var _ww = (_pbox.w - _spac * _spAmo) / _amou;
|
||||
var _ww = (_pbox.w - _spac * _spAmo) / _amou;
|
||||
|
||||
if(_output_index == 0)
|
||||
for( var i = 0; i < _amou; i++ ) {
|
||||
|
|
|
@ -69,8 +69,8 @@ function Node_PB_Box_Inset(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group)
|
|||
w = round(_nbox.w * _widt);
|
||||
h = round(_nbox.h * _high);
|
||||
|
||||
x0 = _nbox.x + (_nbox.w - w) * (_nbox.mirror_h? 1. - _hali : _hali);
|
||||
y0 = _nbox.y + (_nbox.h - h) * (_nbox.mirror_v? 1. - _vali : _vali);
|
||||
x0 = round(_nbox.x + (_nbox.w - w) * (_nbox.mirror_h? 1. - _hali : _hali));
|
||||
y0 = round(_nbox.y + (_nbox.h - h) * (_nbox.mirror_v? 1. - _vali : _vali));
|
||||
}
|
||||
|
||||
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)
|
||||
draw_surface_ext_safe(_pbox.mask, 0, _nbox.h + shf, 1, -1, 0, c_white, 1);
|
||||
else
|
||||
draw_surface_safe(_pbox.mask, -shf, 0);
|
||||
draw_surface_safe(_pbox.mask, 0, -shf);
|
||||
surface_reset_target();
|
||||
}
|
||||
|
||||
|
@ -177,7 +177,7 @@ function Node_PB_Box_Split(_x, _y, _group = noone) : Node_PB_Box(_x, _y, _group)
|
|||
if(_mirr)
|
||||
draw_surface_ext_safe(_pbox.content, 0, _nbox.h + shf, 1, -1, 0, c_white, 1);
|
||||
else
|
||||
draw_surface_safe(_pbox.content, -shf, 0);
|
||||
draw_surface_safe(_pbox.content, 0, -shf);
|
||||
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_rectangle_border(bbox.x0, bbox.y0, bbox.x1, bbox.y1, 2);
|
||||
|
||||
if(_axs == 0)
|
||||
draw_line(bbox.xc, bbox.y0, bbox.xc, bbox.y1);
|
||||
else
|
||||
draw_line(bbox.x0, bbox.yc, bbox.x1, bbox.yc);
|
||||
if(_axs == 0) draw_line(bbox.xc, bbox.y0, bbox.xc, bbox.y1);
|
||||
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) {
|
||||
inputs[| 4].setType(VALUE_TYPE.float);
|
||||
inputs[| 5].setType(VALUE_TYPE.float);
|
||||
|
||||
inputs[| 4].editWidget.setSlideSpeed(0.001);
|
||||
inputs[| 5].editWidget.setSlideSpeed(0.001);
|
||||
} else {
|
||||
inputs[| 4].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(_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 {
|
||||
draw_rectangle(_x0, _y0, _x1, _y1, false);
|
||||
BLEND_SUBTRACT
|
||||
|
|
|
@ -5,6 +5,17 @@ function Node_PB_Fx(_x, _y, _group = noone) : Node_PB(_x, _y, _group) constructo
|
|||
.setVisible(true, true);
|
||||
|
||||
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) { \
|
||||
|
|
|
@ -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 );
|
||||
|
||||
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(); }
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ function Node_Pixel_Builder(_x, _y, _group = noone) : Node_Collection(_x, _y, _g
|
|||
RENDER_ALL
|
||||
}
|
||||
|
||||
static getNextNodes = function() {
|
||||
static getNextNodes = function() { #region
|
||||
var allReady = true;
|
||||
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
||||
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 [];
|
||||
|
||||
return __nodeLeafList(getNodeList());
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static checkComplete = function() {
|
||||
static checkComplete = function() { #region
|
||||
for( var i = 0; i < ds_list_size(nodes); i++ )
|
||||
if(!nodes[| i].rendered) return [];
|
||||
|
||||
|
@ -47,33 +47,9 @@ function Node_Pixel_Builder(_x, _y, _group = noone) : Node_Collection(_x, _y, _g
|
|||
}
|
||||
|
||||
return _nodes;
|
||||
}
|
||||
} #endregion
|
||||
|
||||
static update = function() {
|
||||
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() {
|
||||
static buildPixel = function() { #region
|
||||
LOG_BLOCK_START();
|
||||
LOG_IF(global.FLAG.render == 1, $"================== BUILD PIXEL ==================");
|
||||
LOG_BLOCK_START();
|
||||
|
@ -119,28 +95,24 @@ function Node_Pixel_Builder(_x, _y, _group = noone) : Node_Collection(_x, _y, _g
|
|||
}
|
||||
|
||||
var _layers = ds_map_keys_to_array(_surfs);
|
||||
|
||||
array_sort(_layers, true);
|
||||
|
||||
_outSurf = surface_create(_dim[0], _dim[1]);
|
||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
DRAW_CLEAR
|
||||
|
||||
for( var k = 0; k < array_length(_layers); k++ ) {
|
||||
var _s = _surfs[? _layers[k]];
|
||||
for( var k = 0; k < array_length(_layers); k++ ) {
|
||||
var _s = _surfs[? _layers[k]];
|
||||
|
||||
for( var j = 0; j < array_length(_s); j++ ) {
|
||||
var _box = _s[j];
|
||||
draw_surface_safe(_box.content, _box.x, _box.y);
|
||||
}
|
||||
}
|
||||
|
||||
for( var j = 0; j < array_length(_s); j++ ) {
|
||||
var _box = _s[j];
|
||||
draw_surface_safe(_box.content, _box.x, _box.y);
|
||||
}
|
||||
}
|
||||
surface_reset_target();
|
||||
|
||||
ds_map_destroy(_surfs);
|
||||
|
||||
outputs[| 0].setValue(_outSurf);
|
||||
}
|
||||
|
||||
PATCH_STATIC
|
||||
} #endregion
|
||||
}
|
|
@ -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)
|
||||
.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);
|
||||
|
||||
input_display_list = [ 3, 4,
|
||||
["Surfaces", false], 0, 1, 2, 7, 8,
|
||||
["Effect", false], 5, 6, 9,
|
||||
["Effect", false], 5, 6, 9, 10,
|
||||
]
|
||||
|
||||
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("distMode", _data[9]);
|
||||
shader_set_f("blend", _data[6]);
|
||||
shader_set_i("swap", _data[10]);
|
||||
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
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);
|
||||
|
||||
for(var i = 0; i < _len; i++) {
|
||||
var val = inputs[| i].getValue();
|
||||
var amo = inputs[| i].arrayLength(val);
|
||||
var raw = inputs[| i].getValue();
|
||||
var amo = inputs[| i].arrayLength(raw);
|
||||
var val = raw;
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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]));
|
||||
draw_surface_stretched_safe(_data[0], 0, 0, _sw, _sh);
|
||||
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 hh = surface_get_height_safe(ins);
|
||||
var _ww = ww, _hh = hh;
|
||||
var _ww = ww;
|
||||
var _hh = hh;
|
||||
if(_ww <= 1 && _hh <= 1) return _outSurf;
|
||||
|
||||
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);
|
||||
|
||||
if(mode == 1) {
|
||||
if(mode == 1) { #region
|
||||
var _w = _ww * sqrt(2);
|
||||
var _h = _hh * sqrt(2);
|
||||
var _px = (_w - _ww) / 2;
|
||||
|
@ -253,8 +254,8 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
surface_set_target(_s);
|
||||
DRAW_CLEAR
|
||||
BLEND_OVERRIDE;
|
||||
|
||||
BLEND_OVERRIDE
|
||||
|
||||
if(is_surface(ins)) {
|
||||
var draw_x, draw_y;
|
||||
draw_x = _px + pos[0];
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
BLEND_NORMAL;
|
||||
BLEND_NORMAL
|
||||
surface_reset_target();
|
||||
|
||||
var _cc = point_rotate(-_px, -_py, _ww / 2, _hh / 2, rot);
|
||||
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);
|
||||
surface_reset_shader();
|
||||
|
||||
surface_free(_s);
|
||||
} else {
|
||||
#endregion
|
||||
} else { #region
|
||||
var draw_x, draw_y;
|
||||
draw_x = pos[0];
|
||||
draw_y = pos[1];
|
||||
|
@ -288,7 +290,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
}
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
}
|
||||
surface_reset_shader();
|
||||
#endregion
|
||||
}
|
||||
|
||||
return _outSurf;
|
||||
|
|
|
@ -575,6 +575,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
def_val = _value;
|
||||
def_length = is_array(def_val)? array_length(def_val) : 0;
|
||||
unit = new nodeValueUnit(self);
|
||||
def_unit = VALUE_UNIT.constant;
|
||||
dyna_depo = ds_list_create();
|
||||
value_tag = "";
|
||||
|
||||
|
@ -694,11 +695,16 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
return self;
|
||||
} #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
|
||||
unit.reference = ref;
|
||||
unit.mode = mode;
|
||||
def_unit = mode;
|
||||
cache_value[0] = false;
|
||||
|
||||
return self;
|
||||
|
@ -1406,6 +1412,20 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
return value;
|
||||
} #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 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)
|
||||
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(is_array(val)) {
|
||||
var eqSize = true;
|
||||
|
@ -1529,7 +1558,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
for( var i = 0, n = array_length(val); i < n; i++ )
|
||||
_val[i] = valueProcess(val[i], nod, applyUnit, arrIndex);
|
||||
return _val;
|
||||
}
|
||||
}
|
||||
|
||||
return valueProcess(val, nod, applyUnit, arrIndex);
|
||||
} #endregion
|
||||
|
@ -1562,12 +1591,11 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
};
|
||||
|
||||
var _exp_res = expTree.eval(variable_clone(expContext));
|
||||
//print(json_stringify(expTree, true));
|
||||
//print($"======= {_exp_res}");
|
||||
printIf(global.LOG_EXPRESSION, $">>>> Result = {_exp_res}");
|
||||
|
||||
if(is_undefined(_exp_res)) {
|
||||
val[0] = 0;
|
||||
noti_warning("Expression not returning any values.");
|
||||
noti_warning("Expression not returning valid values.");
|
||||
} else
|
||||
val[0] = _exp_res;
|
||||
global.EVALUATE_HEAD = noone;
|
||||
|
@ -1594,12 +1622,14 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
animators[i].values[| 0].time = CURRENT_FRAME;
|
||||
}
|
||||
} else {
|
||||
var _val = animator.getValue();
|
||||
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++ ) {
|
||||
var _val = animators[i].getValue();
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ function Panel_Collection() : PanelContent() constructor {
|
|||
|
||||
roots = [ ["Collections", COLLECTIONS] , ["Assets", global.ASSETS] ];
|
||||
mode = 0;
|
||||
root = roots[mode][1];
|
||||
root = roots[mode][1];
|
||||
context = root;
|
||||
|
||||
search_list = ds_list_create();
|
||||
|
@ -65,7 +65,7 @@ function Panel_Collection() : PanelContent() constructor {
|
|||
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);
|
||||
|
||||
refreshContext();
|
||||
|
@ -84,18 +84,11 @@ function Panel_Collection() : PanelContent() constructor {
|
|||
if(STEAM_ENABLED) {
|
||||
if(!meta.steam) {
|
||||
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 meta = _menu_node.getMetadata();
|
||||
if(meta != noone && meta != undefined)
|
||||
dia.meta = meta;
|
||||
|
||||
dia.node = PANEL_INSPECTOR.getInspecting();
|
||||
|
||||
dia.data_path = data_path;
|
||||
dia.ugc = 1;
|
||||
dia.updating = _menu_node;
|
||||
|
@ -104,12 +97,17 @@ function Panel_Collection() : PanelContent() constructor {
|
|||
} else {
|
||||
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() {
|
||||
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 meta = _menu_node.getMetadata();
|
||||
if(meta != noone && meta != undefined)
|
||||
dia.meta = meta;
|
||||
|
||||
dia.node = PANEL_INSPECTOR.getInspecting();
|
||||
dia.node = _node;
|
||||
dia.data_path = data_path;
|
||||
dia.ugc = 2;
|
||||
dia.updating = _menu_node;
|
||||
|
|
|
@ -136,14 +136,14 @@ function graph_export_image(allList, nodeList, settings = {}) {
|
|||
if(bgEnable) draw_clear(bgColor);
|
||||
else draw_clear_alpha(0, 0);
|
||||
|
||||
BLEND_ALPHA_MULP
|
||||
draw_surface(s, borderPad, borderPad);
|
||||
|
||||
draw_set_color(borderColor);
|
||||
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);
|
||||
BLEND_NORMAL
|
||||
surface_reset_target();
|
||||
|
||||
|
||||
|
|
|
@ -82,8 +82,9 @@
|
|||
return true;
|
||||
} ];
|
||||
|
||||
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_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_height"] = [ ["surface"], function(val) { return surface_get_height_safe(array_safe_get(val, 0)); } ];
|
||||
|
||||
global.FUNCTIONS[? "color_hex"] = [ ["char"], function(val) { return colorFromHex(array_safe_get(val, 0)); } ];
|
||||
global.FUNCTIONS[? "color_rgb"] = [ ["red", "green", "blue"], function(val) { return make_color_rgb(array_safe_get(val, 0), array_safe_get(val, 1), array_safe_get(val, 2)); } ];
|
||||
|
@ -464,6 +465,7 @@
|
|||
printIf(global.LOG_EXPRESSION, $"symbol : {symbol}");
|
||||
printIf(global.LOG_EXPRESSION, $"l : | {typeof(l)} |{l}|");
|
||||
printIf(global.LOG_EXPRESSION, $"r : | {typeof(r)} |{r}|");
|
||||
printIf(global.LOG_EXPRESSION, $"params : {params}");
|
||||
printIf(global.LOG_EXPRESSION, "====================");
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -8,12 +8,13 @@ function steam_ugc_create_collection(file) { #region
|
|||
|
||||
directory_destroy(DIRECTORY + "steamUGC");
|
||||
directory_create(DIRECTORY + "steamUGC");
|
||||
|
||||
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)
|
||||
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);
|
||||
} #endregion
|
||||
|
@ -28,6 +29,7 @@ function steam_ugc_update_collection(file, update_preview = false, update_note =
|
|||
|
||||
directory_destroy(DIRECTORY + "steamUGC");
|
||||
directory_create(DIRECTORY + "steamUGC");
|
||||
|
||||
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)
|
||||
|
@ -44,17 +46,23 @@ function steam_ugc_update_collection(file, update_preview = false, update_note =
|
|||
array_insert(tgs, 0, "Collection");
|
||||
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_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);
|
||||
} #endregion
|
||||
|
||||
function steam_ugc_collection_generate(file, dest_path = TEMPDIR + "steamUGCthumbnail.png") { #region
|
||||
file_delete(dest_path);
|
||||
var spr = STEAM_UGC_ITEM_FILE.getSpr();
|
||||
|
||||
var prev_size = 512;
|
||||
var _s = surface_create(prev_size, prev_size);
|
||||
var spr = sprite_add(file, 0, false, false, 0, 0);
|
||||
var _s = surface_create(prev_size, prev_size);
|
||||
|
||||
surface_set_target(_s);
|
||||
draw_clear(COLORS._main_icon_dark);
|
||||
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);
|
||||
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_text(prev_size - 16, prev_size - 12, VERSION_STRING);
|
||||
draw_text(prev_size - 16, prev_size - 8, VERSION_STRING);
|
||||
surface_reset_target();
|
||||
surface_save_safe(_s, dest_path);
|
||||
surface_free(_s);
|
||||
|
|
|
@ -146,11 +146,12 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
|
|||
_c--;
|
||||
}
|
||||
var guide = function_guide_server(_fn);
|
||||
|
||||
|
||||
o_dialog_textbox_function_guide.dialog_x = rx + cursor_pos_x + 1;
|
||||
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.dialog_x = rx + cursor_pos_x + 1;
|
||||
o_dialog_textbox_function_guide.dialog_y = ry + cursor_pos_y - 12;
|
||||
o_dialog_textbox_function_guide.prompt = guide;
|
||||
o_dialog_textbox_function_guide.index = amo;
|
||||
} else
|
||||
|
@ -207,10 +208,12 @@ 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) {
|
||||
var _target;
|
||||
|
||||
|
||||
if(cursor_line == 0)
|
||||
_target = 0;
|
||||
else {
|
||||
|
|
|
@ -6,6 +6,7 @@ varying vec4 v_vColour;
|
|||
uniform int invert;
|
||||
uniform float blend;
|
||||
uniform int distMode;
|
||||
uniform int swap;
|
||||
|
||||
#region /////////////// SAMPLING ///////////////
|
||||
|
||||
|
@ -67,7 +68,7 @@ void main() {
|
|||
vec2 cenPos = v_vTexcoord - center;
|
||||
float angle = (atan(cenPos.y, cenPos.x) / PI + 1.) / 2.;
|
||||
|
||||
coord = fract(vec2(angle, dist));
|
||||
coord = fract(vec2(dist, angle));
|
||||
} else if(invert == 1) {
|
||||
float dist = v_vTexcoord.x * 0.5;
|
||||
if(distMode == 1) dist = sqrt(dist);
|
||||
|
@ -78,5 +79,6 @@ void main() {
|
|||
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