Pixel-Composer/#backups/scripts/globals/globals.gml.backup0

208 lines
5.0 KiB
Plaintext
Raw Normal View History

2024-04-18 07:12:31 +02:00
// 2024-04-18 12:08:21
2023-08-08 11:42:01 +02:00
#region save
2024-04-16 10:34:05 +02:00
globalvar LOADING, CLONING, CLONING_GROUP;
globalvar CONNECTION_CONFLICT, LOADING_VERSION;
globalvar MESSAGE;
2023-08-08 11:42:01 +02:00
2024-04-16 10:34:05 +02:00
globalvar APPENDING, APPEND_MAP, APPEND_LIST;
APPEND_MAP = ds_map_create();
APPEND_LIST = ds_list_create();
LOADING = false;
LOADING_VERSION = 0;
CLONING_GROUP = noone;
CLONING = false;
APPENDING = false;
MESSAGE = noone;
2023-08-08 11:42:01 +02:00
CONNECTION_CONFLICT = ds_queue_create();
randomize();
#endregion
2024-04-16 10:34:05 +02:00
#region ======================================================================= MAIN =======================================================================
2023-08-08 11:42:01 +02:00
globalvar OS, DEBUG, THEME, COLOR_KEYS;
2024-04-16 10:34:05 +02:00
globalvar CMD, CMDIN;
globalvar FPS_REAL;
OS = os_type;
CMD = [];
CMDIN = [];
FPS_REAL = 0;
2023-08-08 11:42:01 +02:00
DEBUG = false;
THEME = new Theme();
COLOR_KEYS = [];
2024-04-16 10:34:05 +02:00
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
LATEST_VERSION = 11600;
VERSION = 11700;
SAVE_VERSION = 11690;
2024-04-18 07:12:31 +02:00
VERSION_STRING = "1.17.rc3";
2024-04-16 10:34:05 +02:00
BUILD_NUMBER = 11700;
2023-08-08 11:42:01 +02:00
globalvar HOTKEYS, HOTKEY_CONTEXT;
HOTKEYS = ds_map_create();
HOTKEY_CONTEXT = ds_list_create();
HOTKEY_CONTEXT[| 0] = "";
2024-04-16 10:34:05 +02:00
globalvar TOOLTIP, DRAGGING, DIALOG_DEPTH_HOVER;
global.KEYS = {
download_links: "",
};
2023-08-08 11:42:01 +02:00
#endregion
#region inputs
globalvar FOCUS, FOCUS_STR, HOVER, HOVERING_ELEMENT, _HOVERING_ELEMENT;
globalvar DOUBLE_CLICK, DOUBLE_CLICK_POS;
globalvar DIALOG_CLICK;
DOUBLE_CLICK_POS = [ 0, 0 ];
DOUBLE_CLICK = false;
2024-04-16 10:34:05 +02:00
FOCUS = noone;
2023-08-08 11:42:01 +02:00
FOCUS_STR = "";
2024-04-16 10:34:05 +02:00
HOVER = noone;
2023-08-08 11:42:01 +02:00
HOVERING_ELEMENT = noone;
_HOVERING_ELEMENT = noone;
2024-04-16 10:34:05 +02:00
2023-08-08 11:42:01 +02:00
DIALOG_CLICK = true;
2024-04-16 10:34:05 +02:00
globalvar ADD_NODE_PAGE, ADD_NODE_SCROLL;
ADD_NODE_PAGE = 0;
ADD_NODE_SCROLL = 0;
2023-08-08 11:42:01 +02:00
#endregion
#region macro
2024-04-16 10:34:05 +02:00
#macro TEMPDIR filepath_resolve(PREFERENCES.temp_path)
#macro NOT_LOAD !LOADING && !APPENDING
2023-08-08 11:42:01 +02: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()
2024-04-16 10:34:05 +02:00
#macro UI_SCALE PREFERENCES.display_scaling
2023-08-08 11:42:01 +02:00
2024-04-16 10:34:05 +02:00
#macro mouse_mx (PEN_USE? PEN_X : device_mouse_x_to_gui(0))
#macro mouse_my (PEN_USE? PEN_Y : device_mouse_y_to_gui(0))
2023-08-08 11:42:01 +02:00
#macro mouse_raw_x (device_mouse_raw_x(0) + window_get_x())
#macro mouse_raw_y (device_mouse_raw_y(0) + window_get_y())
#macro mouse_ui [device_mouse_x_to_gui(0), device_mouse_y_to_gui(0)]
2024-04-16 10:34:05 +02:00
#macro sFOCUS (FOCUS == self.id)
#macro sHOVER (!CURSOR_IS_LOCK && HOVER == self.id)
2023-08-08 11:42:01 +02:00
#macro DELTA_TIME delta_time / 1_000_000
2024-04-16 10:34:05 +02:00
#macro INLINE gml_pragma("forceinline");
2023-08-08 11:42:01 +02:00
#macro CONF_TESTING false
globalvar TESTING, TEST_ERROR;
TESTING = CONF_TESTING;
TEST_ERROR = false;
#macro DEMO false
#macro ItchDemo:DEMO true
#macro SteamDemo:DEMO true
#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
#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
#macro c_ui_white $ffffff
#endregion
#macro printlog if(log) show_debug_message
#macro RETURN_ON_REST if(!PROJECT.animator.is_playing || !PROJECT.animator.frame_progress) return;
#macro PANEL_PAD THEME_VALUE.panel_padding
function print(str) {
2024-04-16 10:34:05 +02:00
INLINE
2023-08-08 11:42:01 +02:00
noti_status(string(str));
}
function printIf(cond, log) {
2024-04-16 10:34:05 +02:00
INLINE
if(cond) print(log);
2023-08-08 11:42:01 +02:00
}
#endregion
#region presets
function INIT_FOLDERS() {
2024-04-16 10:34:05 +02:00
directory_verify(DIRECTORY + "Palettes");
directory_verify(DIRECTORY + "Gradients");
2023-08-08 11:42:01 +02:00
}
#endregion
#region default
globalvar DEF_SURFACE, USE_DEF;
DEF_SURFACE = noone;
USE_DEF = -10;
function DEF_SURFACE_RESET() {
if(is_surface(DEF_SURFACE)) return;
DEF_SURFACE = surface_create_valid(32, 32);
surface_set_target(DEF_SURFACE);
draw_clear(c_white);
surface_reset_target();
}
DEF_SURFACE_RESET();
#endregion
2024-04-16 10:34:05 +02:00
#region functions
function __fnInit_Global() {
__registerFunction("fullscreen", global_fullscreen);
__registerFunction("render_all", global_render_all);
__registerFunction("project_close", global_project_close);
__registerFunction("theme_reload", global_theme_reload);
}
function global_fullscreen() { CALL("fullscreen"); winMan_setFullscreen(!window_is_fullscreen); }
function global_render_all() { CALL("render_all"); RENDER_ALL_REORDER }
function global_project_close() { CALL("project_close"); PANEL_GRAPH.close(); }
function global_theme_reload() { CALL("theme_reload"); loadGraphic(PREFERENCES.theme); resetPanel(); }
function reset_global_getset() {
COLORS_GLOBAL_GET = noone;
COLORS_GLOBAL_SET = noone;
}
2023-08-08 11:42:01 +02:00
#endregion
#region debug
global.FLAG = {};
2024-04-16 10:34:05 +02:00
global.FLAG.render = 0;
global.FLAG.renderTime = false;
global.FLAG.keyframe_override = true;
global.FLAG.wav_import = true;
global.FLAG.ase_import = false;
2023-08-08 11:42:01 +02:00
#endregion