Pixel-Composer/scripts/project_data/project_data.gml

92 lines
2.2 KiB
Plaintext
Raw Normal View History

2023-10-12 07:07:24 +02:00
#region global
globalvar PROJECTS, PROJECT;
#endregion
#region project
function Project() constructor {
active = true; /// @is {bool}
2023-12-08 03:50:09 +01:00
meta = __getdefaultMetaData();
path = ""; /// @is {string}
thumbnail = "";
version = SAVE_VERSION; /// @is {number}
seed = irandom_range(100000, 999999); /// @is {number}
2023-10-12 07:07:24 +02:00
modified = false; /// @is {bool}
readonly = false; /// @is {bool}
2023-11-01 08:10:25 +01:00
safeMode = false;
2023-10-12 07:07:24 +02:00
nodes = ds_list_create();
2023-11-08 08:38:04 +01:00
nodeArray = [];
2023-10-12 07:07:24 +02:00
nodeMap = ds_map_create();
nodeNameMap = ds_map_create();
nodeTopo = ds_list_create();
2023-12-18 08:27:31 +01:00
animator = new AnimationManager();
globalNode = new Node_Global();
nodeController = new __Node_Controller(self);
2023-10-12 07:07:24 +02:00
previewGrid = { #region
show : false,
snap : false,
size : [ 16, 16 ],
opacity : 0.5,
color : COLORS.panel_preview_grid,
} #endregion
graphGrid = { #region
show : true,
2023-10-18 14:58:55 +02:00
show_origin : false,
2023-10-12 07:07:24 +02:00
snap : true,
2023-10-18 14:58:55 +02:00
size : 16,
2023-10-12 07:07:24 +02:00
opacity : 0.05,
color : c_white,
2023-10-18 14:58:55 +02:00
highlight : 12,
2023-10-12 07:07:24 +02:00
} #endregion
addons = {};
onion_skin = { #region
enabled: false,
range: [ -1, 1 ],
step: 1,
color: [ c_red, c_blue ],
alpha: 0.5,
on_top: true,
}; #endregion
attributes = { #region
surface_dimension: [ 32, 32 ],
palette: [ c_black, c_white ]
} #endregion
attributeEditor = [ #region
[ "Default Surface", "surface_dimension", new vectorBox(2, function(ind, val) { attributes.surface_dimension[ind] = val; RENDER_ALL return true; }) ],
[ "Palette", "palette", new buttonPalette(function(pal) { attributes.palette = pal; RENDER_ALL return true; }) ],
2023-10-12 07:07:24 +02:00
]; #endregion
timelines = new timelineItemGroup();
2023-10-15 15:04:42 +02:00
notes = [];
2023-10-12 07:07:24 +02:00
static cleanup = function() { #region
if(!ds_map_empty(nodeMap))
array_map(ds_map_keys_to_array(nodeMap), function(_key, _ind) {
var _node = nodeMap[? _key];
_node.active = false;
_node.cleanUp();
});
ds_list_destroy(nodes);
ds_map_destroy(nodeMap);
ds_map_destroy(nodeNameMap);
gc_collect();
} #endregion
}
function __initProject() {
PROJECT = new Project();
PROJECTS = [ PROJECT ];
}
#endregion