This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @func roomloader_export_screenshots() | |
/// @param {Array<Asset.GMRoom>} rooms=[all rooms] An array of rooms to export screenshots of. | |
/// @param {String} path=[prompt] The path to export the .zip to. | |
/// @descr Takes screenshots of all given rooms and exports them into a .zip archive at the given path. | |
/// Note: make sure to have the "Disable file system sandbox" setting disabled for your target platform. | |
function roomloader_export_screenshots(_rooms = asset_get_ids(asset_room), _path = undefined) { | |
with ({}) { | |
path = _path; | |
if (path == undefined) { | |
var _prefix = $"{game_project_name} Room Screenshots"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @func object_get_children() | |
/// @param {Asset.GMObject} parent The parent object to get children for. | |
/// @returns {Array<Asset.GMObject>} | |
/// @desc Returns an array of all child object indices for the given object. | |
function object_get_children(_parent) { | |
static _objects = asset_get_ids(asset_object); | |
return array_filter(_objects, method({_parent}, function(_obj) { | |
return object_is_ancestor(_obj, _parent); | |
})); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @func debug_rooms() | |
/// @desc Provides control over room switching and displays room history in a neat Rooms debug overlay view. | |
/// Call once at the start of the game. | |
function debug_rooms() { | |
static __ = new(function() constructor { | |
__rooms = asset_get_ids(asset_room); | |
__names = array_map(__rooms, function(_room, _index) { | |
return $"{_index}: {room_get_name(_room)}"; | |
}); | |
__n = array_length(__rooms); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @func debug_instances_imguigm() | |
/// @desc Displays the overall and per object amounts of instances in a neat ImGui table. | |
/// Call inside an ImGui window/popup/menu. | |
function debug_instances_imguigm() { | |
static _objects = array_map(asset_get_ids(asset_object), function(_obj) { | |
return { | |
__ref: _obj, | |
__name: object_get_name(_obj), | |
__n: 0, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @func debug_instances() | |
/// @desc Displays the overall and per object amounts of instances in a neat Instances debug overlay __view. | |
/// Call anywhere in the project. | |
function debug_instances() { | |
static __ = new (function() constructor { | |
__objects = array_map(asset_get_ids(asset_object), function(_obj) { | |
return { | |
__ref: _obj, | |
__name: object_get_name(_obj), | |
__n: undefined, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @func debug_resources() | |
/// @desc Displays the data fetched from debug_event("ResourceCounts") in a neat Resource Counts debug overlay view. | |
/// Call anywhere in the project. | |
function debug_resources() { | |
static __ = new (function() constructor { | |
var _refresh = function() { | |
if (not is_debug_overlay_open()) return; | |
struct_foreach(debug_event("ResourceCounts", true), function(_key, _value) { | |
self[$ _key] = _value; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// @func debug_resources_imguigm() | |
/// @desc Displays the data fetched from debug_event("ResourceCounts") in a neat ImGui_GM Table. | |
/// Call inside an ImGui window/popup/menu. | |
function debug_resources_imguigm() { | |
{static _map = [ | |
"listCount", "DS Lists", | |
"mapCount", "DS Maps", | |
"queueCount", "DS Queues", | |
"gridCount", "DS Grids", | |
"priorityCount", "DS Priority Queues", |