Pixel-Composer/scripts/globals/globals.gml

141 lines
3.2 KiB
Plaintext
Raw Normal View History

2022-01-13 05:24:03 +01:00
#region save
2022-09-27 06:37:28 +02:00
globalvar LOADING, APPENDING, MODIFIED, CURRENT_PATH, READONLY, CONNECTION_CONFLICT, GLOBAL_SEED;
2022-01-13 05:24:03 +01:00
LOADING = false;
APPENDING = false;
READONLY = false;
2022-09-27 06:37:28 +02:00
CURRENT_PATH = "";
MODIFIED = false;
2022-01-13 05:24:03 +01:00
CONNECTION_CONFLICT = ds_queue_create();
randomize();
GLOBAL_SEED = irandom(9999999999);
#endregion
#region main
globalvar DEBUG;
DEBUG = false;
globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING;
2022-11-01 03:06:03 +01:00
VERSION = 102;
2022-01-29 14:25:18 +01:00
SAVEFILE_VERSION = 90;
2022-11-01 03:06:03 +01:00
VERSION_STRING = "0.10.2";
2022-01-13 05:24:03 +01:00
2022-01-19 03:05:13 +01:00
globalvar NODES, ANIMATOR, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT;
2022-01-13 05:24:03 +01:00
NODES = ds_list_create();
NODE_MAP = ds_map_create();
2022-01-19 03:05:13 +01:00
APPEND_MAP = ds_map_create();
2022-01-13 05:24:03 +01:00
HOTKEYS = ds_map_create();
HOTKEY_CONTEXT = ds_list_create();
HOTKEY_CONTEXT[| 0] = "";
enum ANIMATOR_END {
loop,
stop
}
2022-11-01 03:06:03 +01:00
2022-01-13 05:24:03 +01:00
ANIMATOR = {
frames_total : 30,
current_frame : 0,
real_frame : 0,
framerate : 30,
is_playing : false,
is_scrubing : false,
frame_progress : false,
playback : ANIMATOR_END.loop
};
#endregion
2022-01-19 04:16:28 +01:00
#region inputs
2022-01-13 05:24:03 +01:00
globalvar FOCUS, FOCUS_STR, HOVER, DOUBLE_CLICK, CURRENT_PATH;
globalvar TEXTBOX_ACTIVE;
2022-01-19 04:16:28 +01:00
CURRENT_PATH = "";
DOUBLE_CLICK = false;
FOCUS = noone;
FOCUS_STR = "";
HOVER = noone;
2022-01-13 05:24:03 +01:00
TEXTBOX_ACTIVE = noone
2022-09-21 06:09:40 +02:00
globalvar ADD_NODE_PAGE, ADD_NODE_W, ADD_NODE_H, ADD_NODE_MODE;
2022-01-19 04:16:28 +01:00
ADD_NODE_PAGE = "";
2022-11-03 11:44:49 +01:00
ADD_NODE_W = -1;
ADD_NODE_H = -1;
2022-09-21 06:09:40 +02:00
ADD_NODE_MODE = 0;
2022-01-13 05:24:03 +01:00
globalvar AXIS_COLOR;
AXIS_COLOR = [ c_ui_red, c_ui_lime, c_ui_cyan, c_yellow, c_aqua, c_fuchsia, c_orange, c_ltgray ];
#endregion
#region macro
2022-11-01 03:06:03 +01:00
#macro WIN_W window_get_width()
#macro WIN_H window_get_height()
#macro WIN_SW window_get_width()
#macro WIN_SH window_get_height()
2022-11-03 11:44:49 +01:00
#macro UI_SCALE PREF_MAP[? "display_scaling"]
2022-01-13 05:24:03 +01:00
#macro mouse_mx device_mouse_x_to_gui(0)
#macro mouse_my device_mouse_y_to_gui(0)
2022-11-03 11:44:49 +01:00
#macro mouse_ui [device_mouse_x_to_gui(0), device_mouse_y_to_gui(0)]
#macro sFOCUS FOCUS == self
#macro sHOVER HOVER == self
2022-01-13 05:24:03 +01:00
#region color
#macro c_ui_blue_dkblack $251919
#macro c_ui_blue_mdblack $2c1e1e
#macro c_ui_blue_black $362727
#macro c_ui_blue_dkgrey $4e3b3b
#macro c_ui_blue_grey $816d6d
#macro c_ui_blue_ltgrey $8f7e7e
#macro c_ui_blue_white $e8d6d6
#macro c_ui_cyan $e9ff88
2022-11-01 03:06:03 +01:00
2022-01-13 05:24:03 +01:00
#macro c_ui_yellow $78e4ff
#macro c_ui_orange $6691ff
#macro c_ui_orange_light $92c2ff
#macro c_ui_red $4b00eb
#macro c_ui_pink $b700eb
#macro c_ui_purple $d40092
#macro c_ui_lime_dark $38995e
#macro c_ui_lime $5dde8f
#macro c_ui_lime_light $b2ffd0
#endregion
#region functions
#macro BLEND_ADD gpu_set_blendmode_ext(bm_one, bm_zero);
#macro BLEND_NORMAL gpu_set_blendmode(bm_normal);
#macro BLEND_OVERRIDE gpu_set_blendmode_ext(bm_one, bm_zero);
2022-01-13 05:24:03 +01:00
#endregion
2022-09-21 06:09:40 +02:00
2022-11-03 11:44:49 +01:00
#macro PIXEL_SURFACE surface_create_valid(1, 1)
2022-09-27 06:37:28 +02:00
#macro print show_debug_message
2022-01-13 05:24:03 +01:00
#endregion
#region presets
function INIT_FOLDERS() {
if(!directory_exists(DIRECTORY + "Palettes"))
directory_create(DIRECTORY + "Palettes");
if(!directory_exists(DIRECTORY + "Gradients"))
directory_create(DIRECTORY + "Gradients");
}
#endregion
#region default
globalvar DEF_SURFACE;
function DEF_SURFACE_RESET() {
2022-09-21 06:09:40 +02:00
DEF_SURFACE = PIXEL_SURFACE;
2022-01-13 05:24:03 +01:00
surface_set_target(DEF_SURFACE);
draw_clear_alpha(c_white, 0);
surface_reset_target();
}
DEF_SURFACE_RESET();
#endregion