[Globalvar] Improve editing interface.

This commit is contained in:
Tanasart 2025-02-03 11:28:15 +07:00
parent 21de53e9a1
commit 174cdcf18e
32 changed files with 224 additions and 113 deletions

View file

@ -499,5 +499,8 @@
"use_expression" : "Use Expression",
"view_settings" : "View Settings",
//1.18
"" : ""
}

Binary file not shown.

View file

@ -499,5 +499,8 @@
"use_expression" : "Use Expression",
"view_settings" : "View Settings",
//1.18
"" : ""
}

View file

@ -1,9 +1,9 @@
/// @description
kb_hkey = vk_nokey;
if(keyboard_key > 0) kb_hkey = keyboard_key;
if(keyboard_lastkey > 0) kb_hkey = keyboard_lastkey;
if(kb_hkey < 0 && keyboard_key > 0) kb_hkey = keyboard_key;
if(kb_hkey < 0 && keyboard_lastkey > 0) kb_hkey = keyboard_lastkey;
if(kb_hkey <= 0) for(var i = 2; i < 256; i++) if(keyboard_check_pressed(i)) { kb_hkey = i; break; }
if(kb_hkey <= 0) for(var i = 2; i < 320; i++) if(keyboard_check_pressed(i)) { kb_hkey = i; break; }
kb_time = 0;
kb_hold = false;

View file

@ -6,6 +6,7 @@ kb_time += DELTA_TIME;
if(kb_hold && kb_time >= PREFERENCES.keyboard_repeat_speed) {
trigger = true;
kb_time = 0;
} else if(!kb_hold && kb_time >= PREFERENCES.keyboard_repeat_start) {
trigger = true;
kb_time = 0;

View file

@ -43,8 +43,8 @@
LATEST_VERSION = 1_18_00_0;
VERSION = 1_18_07_2;
SAVE_VERSION = 1_18_05_0;
VERSION_STRING = MAC? "1.18.003m" : "1.18.8.008";
BUILD_NUMBER = 118072.008;
VERSION_STRING = MAC? "1.18.003m" : "1.18.8.010";
BUILD_NUMBER = 118072.010;
PREF_VERSION = 1_17_1;
var _vsp = string_split(VERSION_STRING, ".");
@ -61,7 +61,6 @@
globalvar CURRENT_COLOR;
CURRENT_COLOR = cola(c_white);
// gml_release_mode(true);
#endregion
#region input

View file

@ -1,5 +1,6 @@
function GlobalVarDrawer() constructor {
editing = false;
ID = UUID_generate();
drawWidgetInit();
@ -71,7 +72,7 @@ function GlobalVarDrawer() constructor {
_hg += _hh;
var _wd_ww = (wd_w - ui(32)) / 2 - ui(2);
_edit.sc_type.draw(_wd_xx, _yy, _wd_ww, _wd_h, _edit.val_type_name[_edit.type_index], _m, rx, ry);
_edit.sc_type.draw(_wd_xx, _yy, _wd_ww, _wd_h, global.GLOBALVAR_TYPES_NAME[_edit.type_index], _m, rx, ry);
var _wd_xx2 = _wd_xx + _wd_ww + ui(4);
_edit.sc_disp.draw(_wd_xx2, _yy, _wd_ww, _wd_h, _edit.sc_disp.data_list[_edit.disp_index], _m, rx, ry);
@ -150,7 +151,7 @@ function GlobalVarDrawer() constructor {
}
for( var j = 0; j < array_length(_node.inputs); j++ ) {
var widg = drawWidget(xx, yy, ww, _m, _node.inputs[j], true, hover, focus, _scrollPane, rx, ry);
var widg = drawWidget(xx, yy, ww, _m, _node.inputs[j], true, hover, focus, _scrollPane, rx, ry, ID);
var widH = widg[0];
var mbRight = widg[1];
var widHov = widg[2];

View file

@ -14,7 +14,7 @@ function drawWidgetInit() {
tooltip_loop_type = new tooltipSelector(__txtx("panel_animation_looping_mode", "Looping mode"), global.junctionEndName);
}
function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _focus = false, _scrollPane = noone, rx = 0, ry = 0) {
function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _focus = false, _scrollPane = noone, rx = 0, ry = 0, _ID = undefined) {
#region data
var con_w = ww - ui(4);
var xc = xx + ww / 2;
@ -25,6 +25,14 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
var _name = jun.getName();
var wid = jun.editWidget;
if(_ID != undefined) {
var _map = jun.editWidgetMap;
if(!struct_has(_map, _ID))
_map[$ _ID] = wid.clone();
wid = _map[$ _ID];
}
var cHov = false;
switch(instanceof(wid)) {

View file

@ -1,9 +1,7 @@
function variable_editor(nodeVal) constructor {
value = nodeVal;
val_type = [ VALUE_TYPE.integer, VALUE_TYPE.float, VALUE_TYPE.boolean, VALUE_TYPE.color, VALUE_TYPE.gradient, VALUE_TYPE.path, VALUE_TYPE.curve, VALUE_TYPE.text ];
val_type_name = [ "Integer", "Float", "Boolean", "Color", "Gradient", "Path", "Curve", "Text" ];
display_list = [
#region data
global.GLOBALVAR_TYPES = [ VALUE_TYPE.integer, VALUE_TYPE.float, VALUE_TYPE.boolean, VALUE_TYPE.color, VALUE_TYPE.gradient, VALUE_TYPE.path, VALUE_TYPE.curve, VALUE_TYPE.text ];
global.GLOBALVAR_TYPES_NAME = [ "Integer", "Float", "Boolean", "Color", "Gradient", "Path", "Curve", "Text" ];
global.GLOBALVAR_DISPLAY = [
/*Integer*/ [ "Default", "Range", "Rotation", "Rotation range", "Slider", "Slider range", "Padding", "Vector2", "Vector3", "Vector4", "Vector range", "Vector2 range", "Area" ],
/*Float*/ [ "Default", "Range", "Rotation", "Rotation range", "Slider", "Slider range", "Padding", "Vector2", "Vector3", "Vector4", "Vector range", "Vector2 range", "Area" ],
/*Boolean*/ [ "Default" ],
@ -12,7 +10,30 @@ function variable_editor(nodeVal) constructor {
/*Path*/ [ "Read", "Write", "Font" ],
/*Curve*/ [ "Default", ],
/*Text*/ [ "Default", ],
]
];
global.GLOBALVAR_DISPLAY_MAP = {}
global.GLOBALVAR_DISPLAY_MAP[$ "Default"] = VALUE_DISPLAY._default;
global.GLOBALVAR_DISPLAY_MAP[$ "Range"] = VALUE_DISPLAY.range;
global.GLOBALVAR_DISPLAY_MAP[$ "Rotation"] = VALUE_DISPLAY.rotation;
global.GLOBALVAR_DISPLAY_MAP[$ "Rotation range"] = VALUE_DISPLAY.rotation_range;
global.GLOBALVAR_DISPLAY_MAP[$ "Slider"] = VALUE_DISPLAY.slider;
global.GLOBALVAR_DISPLAY_MAP[$ "Slider range"] = VALUE_DISPLAY.slider_range;
global.GLOBALVAR_DISPLAY_MAP[$ "Padding"] = VALUE_DISPLAY.padding;
global.GLOBALVAR_DISPLAY_MAP[$ "Vector2"] = VALUE_DISPLAY.vector;
global.GLOBALVAR_DISPLAY_MAP[$ "Vector3"] = VALUE_DISPLAY.vector;
global.GLOBALVAR_DISPLAY_MAP[$ "Vector4"] = VALUE_DISPLAY.vector;
global.GLOBALVAR_DISPLAY_MAP[$ "Vector range"] = VALUE_DISPLAY.vector_range;
global.GLOBALVAR_DISPLAY_MAP[$ "Vector2 range"] = VALUE_DISPLAY.vector_range;
global.GLOBALVAR_DISPLAY_MAP[$ "Area"] = VALUE_DISPLAY.area;
global.GLOBALVAR_DISPLAY_MAP[$ "Palette"] = VALUE_DISPLAY.palette;
global.GLOBALVAR_DISPLAY_MAP[$ "Read"] = VALUE_DISPLAY.path_load;
global.GLOBALVAR_DISPLAY_MAP[$ "Write"] = VALUE_DISPLAY.path_save;
global.GLOBALVAR_DISPLAY_MAP[$ "Font"] = VALUE_DISPLAY.path_font;
#endregion
function variable_editor(nodeVal) constructor {
value = nodeVal;
tb_name = new textBox(TEXTBOX_INPUT.text, function(s) /*=>*/ {
if(string_pos(" ", s)) { noti_warning("Global variable name can't have space."); return; }
@ -30,32 +51,25 @@ function variable_editor(nodeVal) constructor {
value.name = s;
RENDER_ALL
});
tb_name.hide = 1;
tb_name.slidable = false;
vb_range = new vectorBox(2, function(v, i) /*=>*/ { slider_range[i] = v; refreshInput(); });
vb_range.linkable = false;
}).setHide(1).setSlide(false);
vb_range = new vectorBox(2, function(v, i) /*=>*/ { slider_range[i] = v; refreshInput(); }).setLinkable(false);
tb_step = new textBox(TEXTBOX_INPUT.number, function(v) /*=>*/ { slider_step = v; refreshInput(); });
sc_type = new scrollBox(val_type_name, function(v) /*=>*/ {
sc_type = new scrollBox(global.GLOBALVAR_TYPES_NAME, function(v) /*=>*/ {
sc_disp.data_list = global.GLOBALVAR_DISPLAY[v];
type_index = v;
sc_disp.data_list = display_list[v];
disp_index = 0;
refreshInput();
RENDER_ALL
});
sc_type.text_color = CDEF.main_mdwhite;
sc_type.update_hover = false;
sc_disp = new scrollBox(display_list[0], function(v) /*=>*/ {
}).setTextColor(CDEF.main_mdwhite).setUpdateHover(false);
sc_disp = new scrollBox(global.GLOBALVAR_DISPLAY[0], function(v) /*=>*/ {
disp_index = v;
refreshInput();
RENDER_ALL
});
sc_disp.text_color = CDEF.main_mdwhite;
sc_disp.update_hover = false;
}).setTextColor(CDEF.main_mdwhite).setUpdateHover(false);
type_index = 0;
_type_index = 0;
@ -77,7 +91,7 @@ function variable_editor(nodeVal) constructor {
}
static refreshInput = function() {
value.setType(val_type[type_index]);
value.setType(global.GLOBALVAR_TYPES[type_index]);
if(_type_index != type_index || _disp_index != disp_index) {
switch(value.type) {
@ -121,30 +135,34 @@ function variable_editor(nodeVal) constructor {
_type_index = type_index;
_disp_index = disp_index;
var _dtype = global.GLOBALVAR_DISPLAY_MAP[$ sc_disp.data_list[disp_index]];
switch(sc_disp.data_list[disp_index]) {
case "Default" : value.setDisplay(VALUE_DISPLAY._default); break;
case "Range" : value.setDisplay(VALUE_DISPLAY.range); break;
case "Rotation" : value.setDisplay(VALUE_DISPLAY.rotation); break;
case "Rotation range" : value.setDisplay(VALUE_DISPLAY.rotation_range); break;
case "Slider" : value.setDisplay(VALUE_DISPLAY.slider, { range: [slider_range[0], slider_range[1], slider_step] }); break;
case "Slider range" : value.setDisplay(VALUE_DISPLAY.slider_range, { range: [slider_range[0], slider_range[1], slider_step] }); break;
case "Slider" :
case "Slider range" :
value.setDisplay(_dtype, { range: [slider_range[0], slider_range[1], slider_step] }); break;
case "Padding" : value.setDisplay(VALUE_DISPLAY.padding); break;
case "Vector2" :
case "Vector3" :
case "Vector4" : value.setDisplay(VALUE_DISPLAY.vector); break;
case "Vector range" :
case "Vector2 range" : value.setDisplay(VALUE_DISPLAY.vector_range); break;
case "Area" : value.setDisplay(VALUE_DISPLAY.area); break;
case "Palette" : value.setDisplay(VALUE_DISPLAY.palette); break;
case "Read" :
case "Write" :
value.setDisplay(_dtype, { filter: "" }); break;
case "Read" : value.setDisplay(VALUE_DISPLAY.path_load, { filter: "" }); break;
case "Write" : value.setDisplay(VALUE_DISPLAY.path_save, { filter: "" }); break;
case "Font" : value.setDisplay(VALUE_DISPLAY.path_font); break;
default : value.setDisplay(_dtype); break;
}
}
static updateType = function() {
type_index = array_find(global.GLOBALVAR_TYPES, value.type);
disp_index = 0;
sc_disp.data_list = global.GLOBALVAR_DISPLAY[type_index];
var _disp = value.display_type;
var _disK = struct_find_key(global.GLOBALVAR_DISPLAY_MAP, _disp);
if(_disK == undefined) return self;
disp_index = array_find(sc_disp.data_list, _disK);
return self;
}
static draw = function(_x, _y, _w, _m, _focus, _hover, viewMode) {
var _h = 0;
var _font = viewMode == INSP_VIEW_MODE.spacious? f_p0 : f_p2;
@ -184,7 +202,6 @@ function Node_Global(_x = 0, _y = 0) : __Node_Base(_x, _y) constructor {
node_id = 0;
group = noone;
use_cache = CACHE_USE.none;
value = ds_map_create();
@ -222,6 +239,8 @@ function Node_Global(_x = 0, _y = 0) : __Node_Base(_x, _y) constructor {
}
static step = function() {
ds_map_clear(value);
for( var i = 0; i < array_length(inputs); i++ ) {
var _inp = inputs[i];
value[? _inp.name] = _inp;

View file

@ -173,12 +173,20 @@ function Node_Surface_Tag(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
static step = function() {}
static processData = function(_outSurf, _data, _output_index, _array_index = 0) {
static processData_prebatch = function() {
var _amo = getInputAmount();
var _surf = _data[0];
for( var i = 0; i < _amo; i++ ) {
var _ind = input_fix_len + i * data_length;
var _tag_name = getSingleValue(_ind + 0);
inputs[_ind + 1].setName($"{_tag_name} positions");
}
}
static processData = function(_outSurf, _data, _output_index, _array_index = 0) {
var _surf = _data[0];
var _srf = new taggedSurf(_surf);
var _amo = getInputAmount();
for( var i = 0; i < _amo; i++ ) {
var _ind = input_fix_len + i * data_length;
var _tag_name = _data[_ind + 0];

View file

@ -45,12 +45,16 @@ function Node_Threshold(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
newInput(16, nodeValue_Int("Adaptive Radius", self, 4))
newInput(17, nodeValue_Bool("Brightness Invert", self, false));
newInput(18, nodeValue_Bool("Alpha Invert", self, false));
newOutput(0, nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone));
input_display_list = [ 6, 10,
["Surfaces", true], 0, 4, 5, 11, 12,
["Brightness", true, 1], 15, 2, 13, 3,16,
["Alpha", true, 7], 8, 14, 9,
["Brightness", true, 1], 15, 2, 13, 3, 16, 17,
["Alpha", true, 7], 8, 14, 9, 18,
];
attribute_surface_depth();
@ -77,6 +81,9 @@ function Node_Threshold(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var _algo = _data[15];
var _adap_size = _data[16];
var _brightInv = _data[17];
var _alhpaInv = _data[18];
inputs[16].setVisible(_algo == 1);
var _shader = sh_threshold;
@ -86,12 +93,14 @@ function Node_Threshold(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
shader_set_dim(, _surf);
shader_set_i("bright", _bright);
shader_set_i("brightInvert", _brightInv);
shader_set_f_map("brightThreshold", _brightThr, _data[13], inputs[2]);
shader_set_f("brightSmooth", _brightSmt);
shader_set_f("adaptiveRadius", _adap_size);
shader_set_f("gaussianCoeff", __gaussian_get_kernel(_adap_size));
shader_set_i("alpha", _alph);
shader_set_i("alphaInvert", _alhpaInv);
shader_set_f_map("alphaThreshold", _alphThr, _data[14], inputs[8]);
shader_set_f("alphaSmooth", _alphSmt);

View file

@ -36,6 +36,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
tooltip = _tooltip;
editWidget = noone;
editWidgetRaw = noone;
editWidgetMap = {};
editable = true;
graphWidget = noone;
@ -2327,6 +2328,31 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
////- MISC
static globalExtractable = function() { return array_exists(global.GLOBALVAR_TYPES, type) && struct_find_key(global.GLOBALVAR_DISPLAY_MAP, display_type) != undefined; }
static extractGlobal = function() {
if(!globalExtractable()) return noone;
var _key = $"{node.getDisplayName()}_{name}";
var _glb = node.project.globalNode;
if(_glb.inputExist(_key))
_key += string(array_length(_glb.inputs));
var _newVal = _glb.createValue();
_newVal.name = _key;
_newVal.setType(type);
_newVal.setDisplay(display_type, display_data);
_newVal.editor.updateType();
_newVal.setValue(getValue());
_glb.step();
if(!expUse) setExpression(_key);
return _newVal;
}
static extractNode = function(_type = extract_node) {
if(_type == "") return noone;

View file

@ -2,28 +2,23 @@ function Panel_Globalvar() : PanelContent() constructor {
title = __txtx("panel_globalvar", "Global Variables");
context_str = "Globalvar";
padding = 8;
auto_pin = true;
w = ui(320);
h = ui(480);
b_edit = button(function() /*=>*/ { var_editing = !var_editing; }).setTooltip("Edit").setIcon(THEME.gear, 0, COLORS._main_icon, .6);
// title_actions = [ b_edit ];
globalvar_viewer_init();
drawWidgetInit();
global_drawer = new GlobalVarDrawer();
function onResize() { contentPane.resize(w - ui(padding + padding), h - ui(padding + padding) - ui(28)); }
contentPane = new scrollPane(w - ui(padding + padding), h - ui(padding + padding) - ui(28), function(_y, _m) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
draw_clear_alpha(COLORS.panel_bg_clear_inner, 1);
var _hover = pHOVER && contentPane.hover;
var hh = 0;
var yy = _y;
var _x = ui(8);
var glPar = globalvar_viewer_draw(_x, yy, contentPane.surface_w - _x - ui(8), _m, pFOCUS, _hover, contentPane, x + _x + ui(padding), y + ui(title_height));
var glPar = global_drawer.draw(ui(8), yy, contentPane.surface_w - ui(16), _m, pFOCUS, _hover, contentPane, x + ui(padding), y + ui(padding));
var gvh = glPar[0];
if(glPar[1]) contentPane.hover_content = true;
@ -34,7 +29,7 @@ function Panel_Globalvar() : PanelContent() constructor {
});
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 0);
draw_clear_alpha(COLORS.panel_bg_clear, 1);
var px = ui(padding);
var py = ui(padding);
@ -51,13 +46,13 @@ function Panel_Globalvar() : PanelContent() constructor {
var _by = h - _add_h;
var _ww = w;
if(var_editing) {
if(global_drawer.editing) {
var _bw = _ww / 2 - ui(4);
var _hov = pHOVER && point_in_rectangle(mx, my, _bx, _by, _bx + _bw, _by + _add_h);
draw_sprite_stretched_ext(THEME.ui_panel, 0, _bx, _by, _bw, _add_h, _hov? COLORS._main_value_positive : COLORS._main_icon, .3 + _hov * .1);
draw_sprite_stretched_ext(THEME.ui_panel, 1, _bx, _by, _bw, _add_h, _hov? COLORS._main_value_positive : COLORS._main_icon, .6 + _hov * .25);
draw_set_text(f_p2, fa_center, fa_center, _hov? COLORS._main_value_positive : COLORS._main_icon);
draw_set_text(f_p2, fa_center, fa_center, _hov? COLORS._main_value_positive : COLORS._main_icon_light);
draw_text_add(_bx + _bw / 2, _by + _add_h / 2, __txt("Add"));
contentPane.hover_content |= _hov;
@ -69,24 +64,24 @@ function Panel_Globalvar() : PanelContent() constructor {
draw_sprite_stretched_ext(THEME.ui_panel, 0, _bx, _by, _bw, _add_h, _hov? COLORS._main_icon_light : COLORS._main_icon, .3 + _hov * .1);
draw_sprite_stretched_ext(THEME.ui_panel, 1, _bx, _by, _bw, _add_h, _hov? COLORS._main_icon_light : COLORS._main_icon, .6 + _hov * .25);
draw_set_text(f_p2, fa_center, fa_center, _hov? COLORS._main_icon_light : COLORS._main_icon);
draw_set_text(f_p2, fa_center, fa_center, _hov? COLORS._main_icon_light : COLORS._main_icon_light);
draw_text_add(_bx + _bw / 2, _by + _add_h / 2, __txt("Apply"));
contentPane.hover_content |= _hov;
if(mouse_press(mb_left, _hov && pFOCUS))
var_editing = false;
global_drawer.editing = false;
} else {
var _hov = pHOVER && point_in_rectangle(mx, my, _bx, _by, _ww, _by + _add_h);
draw_sprite_stretched_ext(THEME.ui_panel, 0, _bx, _by, _ww, _add_h, _hov? COLORS._main_value_positive : COLORS._main_icon, .3 + _hov * .1);
draw_sprite_stretched_ext(THEME.ui_panel, 1, _bx, _by, _ww, _add_h, _hov? COLORS._main_value_positive : COLORS._main_icon, .6 + _hov * .25);
draw_set_text(f_p2, fa_center, fa_center, _hov? COLORS._main_value_positive : COLORS._main_icon);
draw_set_text(f_p2, fa_center, fa_center, _hov? COLORS._main_value_positive : COLORS._main_icon_light);
draw_text_add(_bx + _ww / 2, _by + _add_h / 2, __txt("Edit"));
contentPane.hover_content |= _hov;
if(mouse_press(mb_left, _hov && pFOCUS))
var_editing = true;
global_drawer.editing = true;
}
}

View file

@ -16,8 +16,9 @@
function panel_inspector_axis_separate() { CALL("inspector_axis_separate"); PANEL_INSPECTOR.junction_axis_separate(); }
function panel_inspector_use_expression() { CALL("inspector_use_expression"); PANEL_INSPECTOR.junction_use_expression(); }
function panel_inspector_disable_expression() { CALL("inspector_disable_expression"); PANEL_INSPECTOR.junction_disable_expression(); }
function panel_inspector_extract_global() { CALL("inspector_extract_global"); PANEL_INSPECTOR.junction_extract_global(); }
function panel_inspector_extract_single() { CALL("inspector_extract_single"); PANEL_INSPECTOR.junction_extract_single(); }
function panel_inspector_junction_bypass_toggle() { CALL("inspector_extract_single"); PANEL_INSPECTOR.junction_bypass_toggle(); }
function panel_inspector_junction_bypass_toggle() { CALL("inspector_junc_bypass"); PANEL_INSPECTOR.junction_bypass_toggle(); }
function __fnInit_Inspector() {
registerFunction("", "Color Picker", "", MOD_KEY.alt, panel_inspector_color_pick ).setMenu("color_picker")
@ -36,6 +37,7 @@
registerFunction("Inspector", "Separate Axis", "", MOD_KEY.none, panel_inspector_axis_separate ).setMenu("inspector_separate_axis")
registerFunction("Inspector", "Use Expression", "", MOD_KEY.none, panel_inspector_use_expression ).setMenu("inspector_use_expression")
registerFunction("Inspector", "Disable Expression", "", MOD_KEY.none, panel_inspector_disable_expression ).setMenu("inspector_disable_expression")
registerFunction("Inspector", "Extract to Globalvar", "", MOD_KEY.none, panel_inspector_extract_global ).setMenu("inspector_extract_global")
registerFunction("Inspector", "Extract Value", "", MOD_KEY.none, panel_inspector_extract_single ).setMenu("inspector_extract_value")
registerFunction("Inspector", "Toggle Bypass", "", MOD_KEY.none, panel_inspector_junction_bypass_toggle ).setMenu("inspector_bypass_toggle")
@ -221,8 +223,8 @@ function Panel_Inspector() : PanelContent() constructor {
meta_display = [
[ __txt("Project Settings"), false, "settings" ],
[ __txt("Metadata"), true , "metadata" ],
[ __txt("Global variables"), true , "globalvar" ],
[ __txt("Group Properties"), true , "group prop" ],
[ __txt("Global variables"), false, "globalvar" ],
[ __txt("Group Properties"), false, "group prop" ],
];
meta_steam_avatar = new checkBox(function() { STEAM_UGC_ITEM_AVATAR = !STEAM_UGC_ITEM_AVATAR; });
@ -281,6 +283,7 @@ function Panel_Inspector() : PanelContent() constructor {
function junction_axis_separate() { if(__dialog_junction == noone) return; __dialog_junction.sep_axis = true; }
function junction_use_expression() { if(__dialog_junction == noone) return; __dialog_junction.expUse = true; }
function junction_disable_expression() { if(__dialog_junction == noone) return; __dialog_junction.expUse = false; }
function junction_extract_global() { if(__dialog_junction == noone) return; __dialog_junction.extractGlobal(); }
function junction_extract_single() { if(__dialog_junction == noone) return; __dialog_junction.extractNode(); }
function junction_bypass_toggle() {
if(__dialog_junction == noone || __dialog_junction.bypass_junc == noone) return;
@ -301,6 +304,7 @@ function Panel_Inspector() : PanelContent() constructor {
menu_junc_separate_axis = MENU_ITEMS.inspector_separate_axis;
menu_junc_expression_ena = MENU_ITEMS.inspector_use_expression;
menu_junc_expression_dis = MENU_ITEMS.inspector_disable_expression;
menu_junc_extract_global = MENU_ITEMS.inspector_extract_global;
menu_junc_extract = MENU_ITEMS.inspector_extract_value;
menu_junc_bypass_toggle = MENU_ITEMS.inspector_bypass_toggle;
@ -634,7 +638,7 @@ function Panel_Inspector() : PanelContent() constructor {
break;
case "globalvar" :
if(findPanel("Panel_Globalvar")) { yy += ui(4); hh += ui(4); continue; }
// if(findPanel("Panel_Globalvar")) { yy += ui(4); hh += ui(4); continue; }
if(_m[1] > yy) contentPane.hover_content = true;
global_drawer.viewMode = viewMode;
@ -1130,6 +1134,7 @@ function Panel_Inspector() : PanelContent() constructor {
}
array_push(_menuItem, jun.expUse? menu_junc_expression_dis : menu_junc_expression_ena);
if(jun.globalExtractable()) array_push(_menuItem, menu_junc_extract_global);
if(_inp) array_push(_menuItem, menu_junc_bypass_toggle);
array_push(_menuItem, -1, menu_junc_copy);

View file

@ -823,8 +823,17 @@ function Panel_Menu() : PanelContent() constructor {
#endregion
#region drag
if(mouse_press(mb_left, _draggable))
winMan_initDrag(0b10000);
if(_draggable) {
if(DOUBLE_CLICK) {
if(window_is_maximized)
winMan_Unmaximize();
else
winMan_Maximize();
DISPLAY_REFRESH
}
if(mouse_press(mb_left)) winMan_initDrag(0b10000);
}
#endregion
}
}

View file

@ -38,6 +38,9 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor
type = 0;
hide = 0;
static setTextColor = function(_l = noone) { text_color = _l; return self; }
static setUpdateHover = function(_l = noone) { update_hover = _l; return self; }
static trigger = function() {
data = is_method(data_list)? data_list() : data_list;

View file

@ -63,3 +63,10 @@ function struct_toggle(struct, key) {
if(struct_has(struct, key)) struct_remove(struct, key);
else struct[$ key] = 1;
}
function struct_find_key(struct, value) {
var _keys = struct_get_names(struct);
for( var i = 0, n = array_length(_keys); i < n; i++ )
if(value == struct[$ _keys[i]]) return _keys[i];
return undefined;
}

View file

@ -521,6 +521,7 @@ function textArea(_input, _onModify) : textInput(_input, _onModify) constructor
cursor_select = -1;
modified = true;
} else if(KEYBOARD_STRING != "" && KEYBOARD_STRING != "\b" && KEYBOARD_STRING != "\r") {
var ch = KEYBOARD_STRING;

View file

@ -116,6 +116,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
else onModify(value, onModifyParam);
}
static setSlide = function(_slidable) { slidable = _slidable; return self; }
static setSlideType = function(_slide_int = false) { slide_int = _slide_int; return self; }
static setSlideStep = function(_slide_step = 0) { slide_snap = _slide_step; return self; }
static setSlideRange = function(_min = 0, _max = 1) { slide_range = [_min, _max]; return self; }

View file

@ -48,6 +48,8 @@ function vectorBox(_size, _onModify, _unit = noone) : widget() constructor {
tb[i].slidable = true;
}
static setLinkable = function(_l = noone) { linkable = _l; return self; }
static setFont = function(_f = noone) {
for( var i = 0; i < size; i++ )
tb[i].setFont(_f);

View file

@ -2,12 +2,14 @@ varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform int bright;
uniform int brightInvert;
uniform vec2 brightThreshold;
uniform int brightThresholdUseSurf;
uniform sampler2D brightThresholdSurf;
uniform float brightSmooth;
uniform int alpha;
uniform int alphaInvert;
uniform vec2 alphaThreshold;
uniform int alphaThresholdUseSurf;
uniform sampler2D alphaThresholdSurf;
@ -32,11 +34,15 @@ void main() {
if(bright == 1) {
float cbright = dot(col.rgb, vec3(0.2126, 0.7152, 0.0722));
col.rgb = vec3(brightSmooth == 0.? _step(bri, cbright) : smoothstep(bri - brightSmooth, bri + brightSmooth, cbright));
float vBright = brightSmooth == 0.? _step(bri, cbright) : smoothstep(bri - brightSmooth, bri + brightSmooth, cbright);
if(brightInvert == 1) vBright = 1. - vBright;
col.rgb = vec3(vBright);
}
if(alpha == 1) {
col.a = alphaSmooth == 0.? _step(alp, col.a) : smoothstep(alp - alphaSmooth, alp + alphaSmooth, col.a);
if(alphaInvert == 1) col.a = 1. - col.a;
}
gl_FragColor = col;

View file

@ -5,6 +5,7 @@ uniform vec2 dimension;
uniform float gaussianCoeff[128];
uniform int bright;
uniform int brightInvert;
uniform vec2 brightThreshold;
uniform int brightThresholdUseSurf;
uniform sampler2D brightThresholdSurf;
@ -12,6 +13,7 @@ uniform float brightSmooth;
uniform float adaptiveRadius;
uniform int alpha;
uniform int alphaInvert;
uniform vec2 alphaThreshold;
uniform int alphaThresholdUseSurf;
uniform sampler2D alphaThresholdSurf;
@ -50,11 +52,14 @@ void main() {
bNeight -= bri;
float _res = brightSmooth == 0.? _step(bNeight, cbright) : smoothstep(bNeight - brightSmooth, bNeight + brightSmooth, cbright);
if(brightInvert == 1) _res = 1. - _res;
col.rgb = vec3(_res);
}
if(alpha == 1) {
col.a = alphaSmooth == 0.? _step(alp, col.a) : smoothstep(alp - alphaSmooth, alp + alphaSmooth, col.a);
if(alphaInvert == 1) col.a = 1. - col.a;
}
gl_FragColor = col;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View file

@ -2,24 +2,24 @@
"$GMSprite":"",
"%Name":"s_node_composite_tag",
"bboxMode":0,
"bbox_bottom":61,
"bbox_bottom":53,
"bbox_left":2,
"bbox_right":61,
"bbox_top":2,
"bbox_right":60,
"bbox_top":10,
"collisionKind":1,
"collisionTolerance":0,
"DynamicTexturePage":false,
"edgeFiltering":false,
"For3D":false,
"frames":[
{"$GMSpriteFrame":"","%Name":"48fa7fe0-e1f9-4ad3-b869-f4d6709c4d31","name":"48fa7fe0-e1f9-4ad3-b869-f4d6709c4d31","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"0a7b17bd-81c5-455a-8e4a-08c78714ae06","name":"0a7b17bd-81c5-455a-8e4a-08c78714ae06","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
],
"gridX":0,
"gridY":0,
"height":64,
"HTile":false,
"layers":[
{"$GMImageLayer":"","%Name":"99a715df-5b64-4a74-92f3-b40b6eb55d83","blendMode":0,"displayName":"default","isLocked":false,"name":"99a715df-5b64-4a74-92f3-b40b6eb55d83","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
{"$GMImageLayer":"","%Name":"4cb4c25a-07f0-4695-b0e0-5f8b60c5af80","blendMode":0,"displayName":"default","isLocked":false,"name":"4cb4c25a-07f0-4695-b0e0-5f8b60c5af80","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_node_composite_tag",
"nineSlice":null,
@ -69,8 +69,8 @@
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"48fa7fe0-e1f9-4ad3-b869-f4d6709c4d31","path":"sprites/s_node_composite_tag/s_node_composite_tag.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"309ec169-aa07-406f-8044-d57913d3613b","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"0a7b17bd-81c5-455a-8e4a-08c78714ae06","path":"sprites/s_node_composite_tag/s_node_composite_tag.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"9d630b55-4169-4442-b2df-c8d5a1d377f4","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange":null,

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -2,24 +2,24 @@
"$GMSprite":"",
"%Name":"s_node_surface_tag",
"bboxMode":0,
"bbox_bottom":61,
"bbox_bottom":53,
"bbox_left":2,
"bbox_right":61,
"bbox_top":2,
"bbox_right":60,
"bbox_top":10,
"collisionKind":1,
"collisionTolerance":0,
"DynamicTexturePage":false,
"edgeFiltering":false,
"For3D":false,
"frames":[
{"$GMSpriteFrame":"","%Name":"ce622434-3c89-4399-84ec-f319e262251f","name":"ce622434-3c89-4399-84ec-f319e262251f","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
{"$GMSpriteFrame":"","%Name":"870b1093-75c1-4b28-8a93-74b80af32021","name":"870b1093-75c1-4b28-8a93-74b80af32021","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
],
"gridX":0,
"gridY":0,
"height":64,
"HTile":false,
"layers":[
{"$GMImageLayer":"","%Name":"db386a22-99a6-4a60-82fb-052f2eb34503","blendMode":0,"displayName":"default","isLocked":false,"name":"db386a22-99a6-4a60-82fb-052f2eb34503","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
{"$GMImageLayer":"","%Name":"8f274f47-0a94-4a8f-8ab9-a38ee2d7d7b3","blendMode":0,"displayName":"default","isLocked":false,"name":"8f274f47-0a94-4a8f-8ab9-a38ee2d7d7b3","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
],
"name":"s_node_surface_tag",
"nineSlice":null,
@ -69,8 +69,8 @@
"tracks":[
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"ce622434-3c89-4399-84ec-f319e262251f","path":"sprites/s_node_surface_tag/s_node_surface_tag.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"dccab5d0-cb8a-45b9-a7df-7f2339ecdd7f","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"870b1093-75c1-4b28-8a93-74b80af32021","path":"sprites/s_node_surface_tag/s_node_surface_tag.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
},"Disabled":false,"id":"29ef40d3-0612-4a43-8c9b-28b8f86a4b16","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange":null,