diff --git a/objects/_addon_custom/Create_0.gml b/objects/_addon_custom/Create_0.gml index bfff80716..c1f8db555 100644 --- a/objects/_addon_custom/Create_0.gml +++ b/objects/_addon_custom/Create_0.gml @@ -18,7 +18,7 @@ event_inherited(); var propPath = directory + "\\meta.json"; context_menus = {}; panels = {}; - + if(file_exists_empty(propPath)) { var meta = json_load_struct(propPath); if(struct_has(meta, "panels")) { diff --git a/scripts/addon_lua_constant/addon_lua_constant.gml b/scripts/addon_lua_constant/addon_lua_constant.gml index bfb4fea2d..4d52a736d 100644 --- a/scripts/addon_lua_constant/addon_lua_constant.gml +++ b/scripts/addon_lua_constant/addon_lua_constant.gml @@ -1,135 +1,137 @@ function __addon_lua_setup_constants(lua, context) { lua_add_code(lua, $"ID = '{context.ID}'"); - lua_add_code(lua, $"c_aqua = {c_aqua}"); - lua_add_code(lua, $"c_black = {c_black}"); - lua_add_code(lua, $"c_blue = {c_blue}"); - lua_add_code(lua, $"c_dkgray = {c_dkgray}"); - lua_add_code(lua, $"c_fuchsia = {c_fuchsia}"); - lua_add_code(lua, $"c_gray = {c_gray}"); - lua_add_code(lua, $"c_green = {c_green}"); - lua_add_code(lua, $"c_lime = {c_lime}"); - lua_add_code(lua, $"c_ltgray = {c_ltgray}"); - lua_add_code(lua, $"c_maroon = {c_maroon}"); - lua_add_code(lua, $"c_navy = {c_navy}"); - lua_add_code(lua, $"c_olive = {c_olive}"); - lua_add_code(lua, $"c_orange = {c_orange}"); - lua_add_code(lua, $"c_purple = {c_purple}"); - lua_add_code(lua, $"c_red = {c_red}"); - lua_add_code(lua, $"c_silver = {c_silver}"); - lua_add_code(lua, $"c_teal = {c_teal}"); - lua_add_code(lua, $"c_white = {c_white}"); - lua_add_code(lua, $"c_yellow = {c_yellow}"); + lua_add_code(lua, $"c_aqua = {c_aqua}"); + lua_add_code(lua, $"c_black = {c_black}"); + lua_add_code(lua, $"c_blue = {c_blue}"); + lua_add_code(lua, $"c_dkgray = {c_dkgray}"); + lua_add_code(lua, $"c_fuchsia = {c_fuchsia}"); + lua_add_code(lua, $"c_gray = {c_gray}"); + lua_add_code(lua, $"c_green = {c_green}"); + lua_add_code(lua, $"c_lime = {c_lime}"); + lua_add_code(lua, $"c_ltgray = {c_ltgray}"); + lua_add_code(lua, $"c_maroon = {c_maroon}"); + lua_add_code(lua, $"c_navy = {c_navy}"); + lua_add_code(lua, $"c_olive = {c_olive}"); + lua_add_code(lua, $"c_orange = {c_orange}"); + lua_add_code(lua, $"c_purple = {c_purple}"); + lua_add_code(lua, $"c_red = {c_red}"); + lua_add_code(lua, $"c_silver = {c_silver}"); + lua_add_code(lua, $"c_teal = {c_teal}"); + lua_add_code(lua, $"c_white = {c_white}"); + lua_add_code(lua, $"c_yellow = {c_yellow}"); - lua_add_code(lua, $"color_accent = {COLORS._main_accent}"); - lua_add_code(lua, $"color_icon = {COLORS._main_icon}"); - lua_add_code(lua, $"color_icon_dark = {COLORS._main_icon_dark}"); + lua_add_code(lua, $"color_accent = {COLORS._main_accent}"); + lua_add_code(lua, $"color_icon = {COLORS._main_icon}"); + lua_add_code(lua, $"color_icon_dark = {COLORS._main_icon_dark}"); lua_add_code(lua, $"color_icon_light = {COLORS._main_icon_light}"); - lua_add_code(lua, $"color_text = {COLORS._main_text}"); - lua_add_code(lua, $"color_text_sub = {COLORS._main_text_sub}"); - lua_add_code(lua, $"color_positive = {COLORS._main_value_positive}"); - lua_add_code(lua, $"color_negative = {COLORS._main_value_negative}"); + lua_add_code(lua, $"color_text = {COLORS._main_text}"); + lua_add_code(lua, $"color_text_sub = {COLORS._main_text_sub}"); + lua_add_code(lua, $"color_positive = {COLORS._main_value_positive}"); + lua_add_code(lua, $"color_negative = {COLORS._main_value_negative}"); lua_add_code(lua, $"color_dkblack = {CDEF.main_dkblack}"); lua_add_code(lua, $"color_mdblack = {CDEF.main_mdblack}"); - lua_add_code(lua, $"color_black = {CDEF.main_black}"); - lua_add_code(lua, $"color_dkgrey = {CDEF.main_dkgrey}"); - lua_add_code(lua, $"color_dark = {CDEF.main_dark}"); - lua_add_code(lua, $"color_grey = {CDEF.main_grey}"); - lua_add_code(lua, $"color_ltgrey = {CDEF.main_ltgrey}"); - lua_add_code(lua, $"color_white = {CDEF.main_white}"); + lua_add_code(lua, $"color_black = {CDEF.main_black}"); + lua_add_code(lua, $"color_dkgrey = {CDEF.main_dkgrey}"); + lua_add_code(lua, $"color_dark = {CDEF.main_dark}"); + lua_add_code(lua, $"color_grey = {CDEF.main_grey}"); + lua_add_code(lua, $"color_ltgrey = {CDEF.main_ltgrey}"); + lua_add_code(lua, $"color_white = {CDEF.main_white}"); - lua_add_code(lua, $"fa_left = {fa_left}"); - lua_add_code(lua, $"fa_middle = {fa_middle}"); - lua_add_code(lua, $"fa_right = {fa_right}"); + lua_add_code(lua, $"fa_left = {fa_left}"); + lua_add_code(lua, $"fa_middle = {fa_middle}"); + lua_add_code(lua, $"fa_right = {fa_right}"); // - lua_add_code(lua, $"fa_top = {fa_top}"); - lua_add_code(lua, $"fa_center = {fa_center}"); - lua_add_code(lua, $"fa_bottom = {fa_bottom}"); + lua_add_code(lua, $"fa_top = {fa_top}"); + lua_add_code(lua, $"fa_center = {fa_center}"); + lua_add_code(lua, $"fa_bottom = {fa_bottom}"); - lua_add_code(lua, $"mb_left = {mb_left}"); - lua_add_code(lua, $"mb_middle = {mb_middle}"); - lua_add_code(lua, $"mb_right = {mb_right}"); + lua_add_code(lua, $"mb_left = {mb_left}"); + lua_add_code(lua, $"mb_middle = {mb_middle}"); + lua_add_code(lua, $"mb_right = {mb_right}"); - lua_add_code(lua, $"vk_nokey = {vk_nokey}"); - lua_add_code(lua, $"vk_anykey = {vk_anykey}"); - lua_add_code(lua, $"vk_left = {vk_left}"); - lua_add_code(lua, $"vk_right = {vk_right}"); - lua_add_code(lua, $"vk_up = {vk_up}"); - lua_add_code(lua, $"vk_down = {vk_down}"); - lua_add_code(lua, $"vk_enter = {vk_enter}"); - lua_add_code(lua, $"vk_escape = {vk_escape}"); - lua_add_code(lua, $"vk_space = {vk_space}"); - lua_add_code(lua, $"vk_shift = {vk_shift}"); - lua_add_code(lua, $"vk_control = {vk_control}"); - lua_add_code(lua, $"vk_alt = {vk_alt}"); - lua_add_code(lua, $"vk_backspace = {vk_backspace}"); - lua_add_code(lua, $"vk_tab = {vk_tab}"); - lua_add_code(lua, $"vk_home = {vk_home}"); - lua_add_code(lua, $"vk_end = {vk_end}"); - lua_add_code(lua, $"vk_delete = {vk_delete}"); - lua_add_code(lua, $"vk_insert = {vk_insert}"); - lua_add_code(lua, $"vk_pageup = {vk_pageup}"); + lua_add_code(lua, $"vk_nokey = {vk_nokey}"); + lua_add_code(lua, $"vk_anykey = {vk_anykey}"); + lua_add_code(lua, $"vk_left = {vk_left}"); + lua_add_code(lua, $"vk_right = {vk_right}"); + lua_add_code(lua, $"vk_up = {vk_up}"); + lua_add_code(lua, $"vk_down = {vk_down}"); + lua_add_code(lua, $"vk_enter = {vk_enter}"); + lua_add_code(lua, $"vk_escape = {vk_escape}"); + lua_add_code(lua, $"vk_space = {vk_space}"); + lua_add_code(lua, $"vk_shift = {vk_shift}"); + lua_add_code(lua, $"vk_control = {vk_control}"); + lua_add_code(lua, $"vk_alt = {vk_alt}"); + lua_add_code(lua, $"vk_backspace = {vk_backspace}"); + lua_add_code(lua, $"vk_tab = {vk_tab}"); + lua_add_code(lua, $"vk_home = {vk_home}"); + lua_add_code(lua, $"vk_end = {vk_end}"); + lua_add_code(lua, $"vk_delete = {vk_delete}"); + lua_add_code(lua, $"vk_insert = {vk_insert}"); + lua_add_code(lua, $"vk_pageup = {vk_pageup}"); lua_add_code(lua, $"vk_pagedown = {vk_pagedown}"); - lua_add_code(lua, $"vk_pause = {vk_pause}"); - lua_add_code(lua, $"vk_printscreen = {vk_printscreen}"); - lua_add_code(lua, $"vk_f1 = {vk_f1}"); - lua_add_code(lua, $"vk_f2 = {vk_f2}"); - lua_add_code(lua, $"vk_f3 = {vk_f3}"); - lua_add_code(lua, $"vk_f4 = {vk_f4}"); - lua_add_code(lua, $"vk_f5 = {vk_f5}"); - lua_add_code(lua, $"vk_f6 = {vk_f6}"); - lua_add_code(lua, $"vk_f7 = {vk_f7}"); - lua_add_code(lua, $"vk_f8 = {vk_f8}"); - lua_add_code(lua, $"vk_f9 = {vk_f9}"); + lua_add_code(lua, $"vk_pause = {vk_pause}"); + lua_add_code(lua, $"vk_printscreen = {vk_printscreen}"); + + lua_add_code(lua, $"vk_f1 = {vk_f1}"); + lua_add_code(lua, $"vk_f2 = {vk_f2}"); + lua_add_code(lua, $"vk_f3 = {vk_f3}"); + lua_add_code(lua, $"vk_f4 = {vk_f4}"); + lua_add_code(lua, $"vk_f5 = {vk_f5}"); + lua_add_code(lua, $"vk_f6 = {vk_f6}"); + lua_add_code(lua, $"vk_f7 = {vk_f7}"); + lua_add_code(lua, $"vk_f8 = {vk_f8}"); + lua_add_code(lua, $"vk_f9 = {vk_f9}"); lua_add_code(lua, $"vk_f10 = {vk_f10}"); lua_add_code(lua, $"vk_f11 = {vk_f11}"); lua_add_code(lua, $"vk_f12 = {vk_f12}"); - lua_add_code(lua, $"vk_numpad0 = {vk_numpad0}"); - lua_add_code(lua, $"vk_numpad1 = {vk_numpad1}"); - lua_add_code(lua, $"vk_numpad2 = {vk_numpad2}"); - lua_add_code(lua, $"vk_numpad3 = {vk_numpad3}"); - lua_add_code(lua, $"vk_numpad4 = {vk_numpad4}"); - lua_add_code(lua, $"vk_numpad5 = {vk_numpad5}"); - lua_add_code(lua, $"vk_numpad6 = {vk_numpad6}"); - lua_add_code(lua, $"vk_numpad7 = {vk_numpad7}"); - lua_add_code(lua, $"vk_numpad8 = {vk_numpad8}"); - lua_add_code(lua, $"vk_numpad9 = {vk_numpad9}"); + + lua_add_code(lua, $"vk_numpad0 = {vk_numpad0}"); + lua_add_code(lua, $"vk_numpad1 = {vk_numpad1}"); + lua_add_code(lua, $"vk_numpad2 = {vk_numpad2}"); + lua_add_code(lua, $"vk_numpad3 = {vk_numpad3}"); + lua_add_code(lua, $"vk_numpad4 = {vk_numpad4}"); + lua_add_code(lua, $"vk_numpad5 = {vk_numpad5}"); + lua_add_code(lua, $"vk_numpad6 = {vk_numpad6}"); + lua_add_code(lua, $"vk_numpad7 = {vk_numpad7}"); + lua_add_code(lua, $"vk_numpad8 = {vk_numpad8}"); + lua_add_code(lua, $"vk_numpad9 = {vk_numpad9}"); lua_add_code(lua, $"vk_multiply = {vk_multiply}"); - lua_add_code(lua, $"vk_divide = {vk_divide}"); - lua_add_code(lua, $"vk_add = {vk_add}"); + lua_add_code(lua, $"vk_divide = {vk_divide}"); + lua_add_code(lua, $"vk_add = {vk_add}"); lua_add_code(lua, $"vk_subtract = {vk_subtract}"); - lua_add_code(lua, $"vk_decimal = {vk_decimal}"); + lua_add_code(lua, $"vk_decimal = {vk_decimal}"); - lua_add_code(lua, $"gp_face1 = {gp_face1}"); - lua_add_code(lua, $"gp_face2 = {gp_face2}"); - lua_add_code(lua, $"gp_face3 = {gp_face3}"); - lua_add_code(lua, $"gp_face4 = {gp_face4}"); - lua_add_code(lua, $"gp_shoulderl = {gp_shoulderl}"); - lua_add_code(lua, $"gp_shoulderlb = {gp_shoulderlb}"); - lua_add_code(lua, $"gp_shoulderr = {gp_shoulderr}"); - lua_add_code(lua, $"gp_shoulderrb = {gp_shoulderrb}"); - lua_add_code(lua, $"gp_select = {gp_select}"); - lua_add_code(lua, $"gp_start = {gp_start}"); - lua_add_code(lua, $"gp_stickl = {gp_stickl}"); - lua_add_code(lua, $"gp_stickr = {gp_stickr}"); - lua_add_code(lua, $"gp_padu = {gp_padu}"); - lua_add_code(lua, $"gp_padd = {gp_padd}"); - lua_add_code(lua, $"gp_padl = {gp_padl}"); - lua_add_code(lua, $"gp_padr = {gp_padr}"); + lua_add_code(lua, $"gp_face1 = {gp_face1}"); + lua_add_code(lua, $"gp_face2 = {gp_face2}"); + lua_add_code(lua, $"gp_face3 = {gp_face3}"); + lua_add_code(lua, $"gp_face4 = {gp_face4}"); + lua_add_code(lua, $"gp_shoulderl = {gp_shoulderl}"); + lua_add_code(lua, $"gp_shoulderlb = {gp_shoulderlb}"); + lua_add_code(lua, $"gp_shoulderr = {gp_shoulderr}"); + lua_add_code(lua, $"gp_shoulderrb = {gp_shoulderrb}"); + lua_add_code(lua, $"gp_select = {gp_select}"); + lua_add_code(lua, $"gp_start = {gp_start}"); + lua_add_code(lua, $"gp_stickl = {gp_stickl}"); + lua_add_code(lua, $"gp_stickr = {gp_stickr}"); + lua_add_code(lua, $"gp_padu = {gp_padu}"); + lua_add_code(lua, $"gp_padd = {gp_padd}"); + lua_add_code(lua, $"gp_padl = {gp_padl}"); + lua_add_code(lua, $"gp_padr = {gp_padr}"); lua_add_code(lua, $"gp_axislh = {gp_axislh}"); lua_add_code(lua, $"gp_axislv = {gp_axislv}"); lua_add_code(lua, $"gp_axisrh = {gp_axisrh}"); lua_add_code(lua, $"gp_axisrv = {gp_axisrv}"); - lua_add_code(lua, $"bm_normal = {bm_normal}"); - lua_add_code(lua, $"bm_add = {bm_add}"); + lua_add_code(lua, $"bm_normal = {bm_normal}"); + lua_add_code(lua, $"bm_add = {bm_add}"); lua_add_code(lua, $"bm_subtract = {bm_subtract}"); - lua_add_code(lua, $"bm_max = {bm_max}"); + lua_add_code(lua, $"bm_max = {bm_max}"); - lua_add_code(lua, $"tb_text = {TEXTBOX_INPUT.text}"); - lua_add_code(lua, $"tb_number = {TEXTBOX_INPUT.number}"); + lua_add_code(lua, $"tb_text = {TEXTBOX_INPUT.text}"); + lua_add_code(lua, $"tb_number = {TEXTBOX_INPUT.number}"); lua_add_code(lua, "Panel = {};"); lua_add_code(lua, "Animator = {};"); @@ -143,20 +145,18 @@ function __addon_lua_setup_constants(lua, context) { function __addon_lua_panel_variable(lua, panel) { lua_add_code(lua, - "Panel.mouse = {" + string(panel.mx) + ", " + string(panel.my) + "}\n" + - "Panel.mouseUI = {" + string(mouse_mx) + ", " + string(mouse_my) + "}\n" + - "Panel.x = " + string(panel.x ) + "\n" + - "Panel.y = " + string(panel.y ) + "\n" + - "Panel.w = " + string(panel.w ) + "\n" + - "Panel.h = " + string(panel.h ) + "\n" + + $"Panel.mouse = \{{panel.mx}, {panel.my}\}\n" + + $"Panel.mouseUI = \{{mouse_mx}, {mouse_my}\}\n" + + $"Panel.x = {panel.x}\n" + + $"Panel.y = {panel.y}\n" + + $"Panel.w = {panel.w}\n" + + $"Panel.h = {panel.h}\n" + - "Panel.hoverable = " + string(panel.pHOVER) + "\n" + - "Panel.clickable = " + string(panel.pFOCUS) + "\n" - ); + $"Panel.hoverable = {panel.pHOVER}\n" + + $"Panel.clickable = {panel.pFOCUS}\n" + - lua_add_code(lua, - "Animator.frame_current = " + string(CURRENT_FRAME) + "\n" + - "Animator.frame_total = " + string(TOTAL_FRAMES) + "\n" + - "Animator.frame_rate = " + string(PROJECT.animator.framerate) + "\n" + $"Animator.frame_current = {CURRENT_FRAME}\n" + + $"Animator.frame_total = {TOTAL_FRAMES}\n" + + $"Animator.frame_rate = {PROJECT.animator.framerate}\n" ); } diff --git a/scripts/addon_lua_function/addon_lua_function.gml b/scripts/addon_lua_function/addon_lua_function.gml index 51943532f..646db0f8b 100644 --- a/scripts/addon_lua_function/addon_lua_function.gml +++ b/scripts/addon_lua_function/addon_lua_function.gml @@ -34,48 +34,48 @@ [ "draw_set_colour", draw_set_colour ], // gpu - [ "gpu_get_blendenable", gpu_get_blendenable], - [ "gpu_get_ztestenable", gpu_get_ztestenable], - [ "gpu_get_zfunc", gpu_get_zfunc], - [ "gpu_get_zwriteenable", gpu_get_zwriteenable], - [ "gpu_get_fog", gpu_get_fog], - [ "gpu_get_cullmode", gpu_get_cullmode], - [ "gpu_get_blendmode", gpu_get_blendmode], - [ "gpu_get_blendmode_ext", gpu_get_blendmode_ext], - [ "gpu_get_blendmode_ext_sepalpha", gpu_get_blendmode_ext_sepalpha], - [ "gpu_get_blendmode_src", gpu_get_blendmode_src], - [ "gpu_get_blendmode_dest", gpu_get_blendmode_dest], - [ "gpu_get_blendmode_srcalpha", gpu_get_blendmode_srcalpha], - [ "gpu_get_blendmode_destalpha", gpu_get_blendmode_destalpha], - [ "gpu_get_colourwriteenable", gpu_get_colourwriteenable], - [ "gpu_get_alphatestenable", gpu_get_alphatestenable], - [ "gpu_get_alphatestref", gpu_get_alphatestref], - [ "gpu_get_texfilter", gpu_get_texfilter], - [ "gpu_get_texfilter_ext", gpu_get_texfilter_ext], - [ "gpu_get_texrepeat", gpu_get_texrepeat], - [ "gpu_get_texrepeat_ext", gpu_get_texrepeat_ext], + [ "gpu_get_blendenable", gpu_get_blendenable ], + [ "gpu_get_ztestenable", gpu_get_ztestenable ], + [ "gpu_get_zfunc", gpu_get_zfunc ], + [ "gpu_get_zwriteenable", gpu_get_zwriteenable ], + [ "gpu_get_fog", gpu_get_fog ], + [ "gpu_get_cullmode", gpu_get_cullmode ], + [ "gpu_get_blendmode", gpu_get_blendmode ], + [ "gpu_get_blendmode_ext", gpu_get_blendmode_ext ], + [ "gpu_get_blendmode_ext_sepalpha", gpu_get_blendmode_ext_sepalpha ], + [ "gpu_get_blendmode_src", gpu_get_blendmode_src ], + [ "gpu_get_blendmode_dest", gpu_get_blendmode_dest ], + [ "gpu_get_blendmode_srcalpha", gpu_get_blendmode_srcalpha ], + [ "gpu_get_blendmode_destalpha", gpu_get_blendmode_destalpha ], + [ "gpu_get_colourwriteenable", gpu_get_colourwriteenable ], + [ "gpu_get_alphatestenable", gpu_get_alphatestenable ], + [ "gpu_get_alphatestref", gpu_get_alphatestref ], + [ "gpu_get_texfilter", gpu_get_texfilter ], + [ "gpu_get_texfilter_ext", gpu_get_texfilter_ext ], + [ "gpu_get_texrepeat", gpu_get_texrepeat ], + [ "gpu_get_texrepeat_ext", gpu_get_texrepeat_ext ], - [ "gpu_set_blendenable", gpu_set_blendenable], - [ "gpu_set_ztestenable", gpu_set_ztestenable], - [ "gpu_set_zfunc", gpu_set_zfunc], - [ "gpu_set_zwriteenable", gpu_set_zwriteenable], - [ "gpu_set_fog", gpu_set_fog], - [ "gpu_set_cullmode", gpu_set_cullmode], - [ "gpu_set_blendmode", gpu_set_blendmode], - [ "gpu_set_blendmode_ext", gpu_set_blendmode_ext], - [ "gpu_set_blendmode_ext_sepalpha", gpu_set_blendmode_ext_sepalpha], - [ "gpu_set_colourwriteenable", gpu_set_colourwriteenable], - [ "gpu_set_alphatestenable", gpu_set_alphatestenable], - [ "gpu_set_alphatestref", gpu_set_alphatestref], - [ "gpu_set_texfilter", gpu_set_texfilter], - [ "gpu_set_texfilter_ext", gpu_set_texfilter_ext], - [ "gpu_set_texrepeat", gpu_set_texrepeat], - [ "gpu_set_texrepeat_ext", gpu_set_texrepeat_ext], + [ "gpu_set_blendenable", gpu_set_blendenable ], + [ "gpu_set_ztestenable", gpu_set_ztestenable ], + [ "gpu_set_zfunc", gpu_set_zfunc ], + [ "gpu_set_zwriteenable", gpu_set_zwriteenable ], + [ "gpu_set_fog", gpu_set_fog ], + [ "gpu_set_cullmode", gpu_set_cullmode ], + [ "gpu_set_blendmode", gpu_set_blendmode ], + [ "gpu_set_blendmode_ext", gpu_set_blendmode_ext ], + [ "gpu_set_blendmode_ext_sepalpha", gpu_set_blendmode_ext_sepalpha ], + [ "gpu_set_colourwriteenable", gpu_set_colourwriteenable ], + [ "gpu_set_alphatestenable", gpu_set_alphatestenable ], + [ "gpu_set_alphatestref", gpu_set_alphatestref ], + [ "gpu_set_texfilter", gpu_set_texfilter ], + [ "gpu_set_texfilter_ext", gpu_set_texfilter_ext ], + [ "gpu_set_texrepeat", gpu_set_texrepeat ], + [ "gpu_set_texrepeat_ext", gpu_set_texrepeat_ext ], - [ "gpu_push_state", gpu_push_state], - [ "gpu_pop_state", gpu_pop_state], - [ "gpu_get_state", gpu_get_state], - [ "gpu_set_state", gpu_set_state], + [ "gpu_push_state", gpu_push_state ], + [ "gpu_pop_state", gpu_pop_state ], + [ "gpu_get_state", gpu_get_state ], + [ "gpu_set_state", gpu_set_state ], // basic form [ "draw_set_color", draw_set_color ], @@ -233,7 +233,7 @@ [ "__sprite_add", function(_ID, _path, _amo, rem = false, smt = false, xoff = 0, yoff = 0) { var _addon = noone; with(_addon_custom) if(self.ID == _ID) _addon = self; - if(_addon == noone) return 0; + if(_addon == noone) return undefined; _path = string_replace(_path, "./", _addon.directory + "/"); return sprite_add(_path, _amo, rem, smt, xoff, yoff); @@ -792,6 +792,8 @@ case "inspector" : return PANEL_INSPECTOR; case "main" : return PANEL_MAIN; } + + return undefined; } ], [ "draw_text_set_format", function(ind) { @@ -802,35 +804,37 @@ case 3 : draw_set_font(f_p2); draw_set_color(COLORS._main_text_sub); break; case 4 : draw_set_font(f_p3); draw_set_color(COLORS._main_text_sub); break; } + + return undefined; }], //nodes [ "node_get", function(nodeId) { - if(!ds_map_exists(PROJECT.nodeNameMap, nodeId)) return 0; + if(!ds_map_exists(PROJECT.nodeNameMap, nodeId)) return undefined; return PROJECT.nodeNameMap[? nodeId]; }], [ "node_get_input_value", function(nodeId, input) { - if(!ds_map_exists(PROJECT.nodeNameMap, nodeId)) return 0; + if(!ds_map_exists(PROJECT.nodeNameMap, nodeId)) return undefined; var node = PROJECT.nodeNameMap[? nodeId]; - if(!ds_map_exists(node.inputMap, input)) return 0; + if(!ds_map_exists(node.inputMap, input)) return undefined; return node.inputMap[? input].getValue(); }], [ "node_set_input_value", function(nodeId, input, value) { - if(!ds_map_exists(PROJECT.nodeNameMap, nodeId)) return 0; + if(!ds_map_exists(PROJECT.nodeNameMap, nodeId)) return undefined; var node = PROJECT.nodeNameMap[? nodeId]; - if(!ds_map_exists(node.inputMap, input)) return 0; + if(!ds_map_exists(node.inputMap, input)) return undefined; return node.inputMap[? input].setValue(value); }], [ "node_get_output_value", function(nodeId, input) { - if(!ds_map_exists(PROJECT.nodeNameMap, nodeId)) return 0; + if(!ds_map_exists(PROJECT.nodeNameMap, nodeId)) return undefined; var node = PROJECT.nodeNameMap[? nodeId]; - if(!ds_map_exists(node.outputMap, input)) return 0; + if(!ds_map_exists(node.outputMap, input)) return undefined; return node.outputMap[? input].getValue(); }], @@ -840,7 +844,8 @@ var ele = HOVERING_ELEMENT; for( var i = 0; i < argument_count; i++ ) { - if(!struct_has(ele, argument[i])) return undefined; + if(!is_struct(ele) || !struct_has(ele, argument[i])) + return undefined; ele = ele[$ argument[i]]; } return ele; @@ -849,7 +854,7 @@ [ "__panel_create", function(ID, panel = "") { var _addon = noone; with(_addon_custom) if(self.ID == ID) _addon = self; - if(_addon == noone) return noone; + if(_addon == noone) return undefined; var arr = variable_struct_get_names(_addon.panels); @@ -860,7 +865,7 @@ dialogPanelCall(new addonPanel(_addon, pane)); } - return noone; + return undefined; }], @" diff --git a/scripts/buttonAnchor/buttonAnchor.gml b/scripts/buttonAnchor/buttonAnchor.gml index 5139e290c..aba369455 100644 --- a/scripts/buttonAnchor/buttonAnchor.gml +++ b/scripts/buttonAnchor/buttonAnchor.gml @@ -1,6 +1,7 @@ function buttonAnchor(_onClick) : widget() constructor { onClick = _onClick; index = 4; + click = true; static drawParam = function(params) { return draw(params.x, params.y, params.w, params.h, params.m); @@ -16,17 +17,20 @@ function buttonAnchor(_onClick) : widget() constructor { var cy = y + h / 2; hovering = false; + var spacing = 9; + for( var i = -1; i <= 1; i++ ) for( var j = -1; j <= 1; j++ ) { - var _bx = cx + j * 9; - var _by = cy + i * 9; - var _in = (i + 1) * 3 + (j + 1); + var _bx = cx + j * spacing; + var _by = cy + i * spacing; + var _in = (i + 1) * 3 + (j + 1); + var _fil = is_array(index)? index[_in] : _in == index; var hov = hover && point_in_rectangle(_m[0], _m[1], _bx - 4, _by - 4, _bx + 4, _by + 4); var cc = hov? COLORS._main_accent : COLORS._main_icon; - var aa = 0.75 + (_in == index || hov) * 0.25; + var aa = 0.75 + (_fil || hov) * 0.25; - draw_sprite_ext(THEME.prop_anchor, _in == index, _bx, _by, 1, 1, 0, cc, aa); + draw_sprite_ext(THEME.prop_anchor, _fil, _bx, _by, 1, 1, 0, cc, aa); if(hov) { hovering = true; @@ -41,9 +45,7 @@ function buttonAnchor(_onClick) : widget() constructor { } static clone = function() { #region - var cln = new buttonAnchor(); - - cln.onClick = onClick; + var cln = new buttonAnchor(onClick); return cln; } #endregion diff --git a/scripts/node_outline/node_outline.gml b/scripts/node_outline/node_outline.gml index 46a7fa3aa..b6e53bed3 100644 --- a/scripts/node_outline/node_outline.gml +++ b/scripts/node_outline/node_outline.gml @@ -1,9 +1,18 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Outline"; + filtering_vl = false; + filter_button = new buttonAnchor(function(ind) { + if(mouse_press(mb_left)) + filtering_vl = !attributes.filter[ind]; + attributes.filter[ind] = filtering_vl; + triggerRender(); + }); + inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); inputs[| 1] = nodeValue("Width", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + .setDisplay(VALUE_DISPLAY._default, { front_button : filter_button }) .setMappable(15); inputs[| 2] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white); @@ -61,7 +70,10 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c attribute_surface_depth(); attribute_oversample(); + attributes.filter = array_create(9, 1); + static step = function() { #region + var _wid = getInputData(1); var _side = getInputData(5); inputs[| 12].setVisible(_side == 0); @@ -84,6 +96,8 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c var sam = struct_try_get(attributes, "oversample"); var _crop = _data[12]; + filter_button.index = attributes.filter; + surface_set_shader(_outSurf, sh_outline); shader_set_f("dimension", ww, hh); shader_set_f_map("borderSize", _data[1], _data[15], inputs[| 1]); @@ -97,6 +111,7 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c shader_set_f_map("blend_alpha", _data[4], _data[16], inputs[| 4]); shader_set_i("sampleMode", sam); shader_set_i("crop_border", _crop); + shader_set_i("filter", attributes.filter); draw_surface_safe(_data[0]); surface_reset_shader(); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 45a8c5991..1f6d2032c 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -90,6 +90,7 @@ enum VALUE_DISPLAY { matrix, path_anchor, gradient_range, + boolean_grid, //Curve curve, @@ -381,6 +382,7 @@ function typeArray(_type) { #region case VALUE_DISPLAY.puppet_control : case VALUE_DISPLAY.matrix : case VALUE_DISPLAY.transform : + case VALUE_DISPLAY.boolean_grid : case VALUE_DISPLAY.curve : @@ -905,12 +907,10 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru editWidget = new textBox(_txt, function(val) { return setValueInspector(val); } ); editWidget.setSlidable(); - if(struct_has(display_data, "slide_speed")) editWidget.setSlidable(display_data.slide_speed); - if(struct_has(display_data, "unit")) editWidget.unit = display_data.unit; - if(struct_has(display_data, "side_button")) { - editWidget.side_button = display_data.side_button; - editWidget.side_button.context = self; - } + if(struct_has(display_data, "slide_speed")) editWidget.setSlidable(display_data.slide_speed); + if(struct_has(display_data, "unit")) editWidget.unit = display_data.unit; + if(struct_has(display_data, "side_button")) editWidget.side_button = display_data.side_button; + if(struct_has(display_data, "front_button")) editWidget.front_button = display_data.front_button; extract_node = "Node_Number"; break; #endregion @@ -1128,7 +1128,18 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1 / 10); for( var i = 0, n = array_length(animators); i < n; i++ ) - animators[i].suffix = " " + string(i); + animators[i].suffix = $" {i}"; + + extract_node = ""; + break; #endregion + + case VALUE_DISPLAY.boolean_grid : #region + editWidget = new matrixGrid(_txt, display_data.size, function(index, val) { + return setValueInspector(val, index); + }, unit ); + + for( var i = 0, n = array_length(animators); i < n; i++ ) + animators[i].suffix = $" {i}"; extract_node = ""; break; #endregion diff --git a/scripts/textBox/textBox.gml b/scripts/textBox/textBox.gml index 83b5628f0..eba04bc82 100644 --- a/scripts/textBox/textBox.gml +++ b/scripts/textBox/textBox.gml @@ -436,6 +436,14 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor { var _bs = min(h, ui(32)); + if(_w - _bs > ui(100) && front_button) { + front_button.setFocusHover(active, hover); + front_button.draw(_x, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); + + _x += _bs + ui(4); + _w -= _bs + ui(4); + } + if(_w - _bs > ui(100) && side_button) { side_button.setFocusHover(active, hover); side_button.draw(_x + _w - _bs, _y + _h / 2 - _bs / 2, _bs, _bs, _m, THEME.button_hide); diff --git a/scripts/widget/widget.gml b/scripts/widget/widget.gml index b0769ca46..6922b186e 100644 --- a/scripts/widget/widget.gml +++ b/scripts/widget/widget.gml @@ -6,7 +6,9 @@ function widget() constructor { ihover = false; parent = noone; interactable = true; + side_button = noone; + front_button = noone; hide = false; diff --git a/shaders/sh_outline/sh_outline.fsh b/shaders/sh_outline/sh_outline.fsh index d0e2bd51c..c9dc107c7 100644 --- a/shaders/sh_outline/sh_outline.fsh +++ b/shaders/sh_outline/sh_outline.fsh @@ -18,6 +18,7 @@ uniform int side; uniform int crop_border; uniform int is_aa; uniform int is_blend; +uniform int filter[9]; uniform vec2 blend_alpha; uniform int blend_alphaUseSurf; @@ -61,6 +62,24 @@ vec4 blendColor(vec4 base, vec4 colr, float alpha) { return col; } +bool angleFiltered(float angle) { + float _dg = mod((degrees(angle) + 360. + ((side == 0)? 180. : 0.)), 360.); + + int _ind = 0; + + if(_dg <= 22.5 + 45. * 0.) _ind = 3; + else if(_dg <= 22.5 + 45. * 1.) _ind = 0; + else if(_dg <= 22.5 + 45. * 2.) _ind = 1; + else if(_dg <= 22.5 + 45. * 3.) _ind = 2; + else if(_dg <= 22.5 + 45. * 4.) _ind = 5; + else if(_dg <= 22.5 + 45. * 5.) _ind = 8; + else if(_dg <= 22.5 + 45. * 6.) _ind = 7; + else if(_dg <= 22.5 + 45. * 7.) _ind = 6; + else _ind = 3; + + return filter[_ind] == 0; +} + void main() { #region #region params float bStr = borderStart.x; @@ -117,6 +136,7 @@ void main() { #region base *= 2.; } + if(angleFiltered(ang)) continue; vec2 pxs = pixelPosition + vec2( cos(ang), sin(ang)) * i; vec2 txs = pxs / dimension; pxs = floor(pxs) + 0.5; @@ -143,6 +163,8 @@ void main() { #region float tauDiv = TAU / 4.; for(float j = 0.; j < 4.; j++) { float ang = j * tauDiv; + if(angleFiltered(ang)) continue; + vec2 pxs = (pixelPosition + vec2( cos(ang), sin(ang)) ) / dimension; if(side == 0 && crop_border == 1 && (pxs.x < 0. || pxs.x > 1. || pxs.y < 0. || pxs.y > 1.)) continue;