diff --git a/README.md b/README.md index 6e54ede..fd333f7 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

SNAP 5.8.0

+

SNAP 5.8.1

Data format converters for GameMaker Studio 2022 LTS by Juju Adams

diff --git a/options/windows/options_windows.yy b/options/windows/options_windows.yy index 3a642f8..77f33fc 100644 --- a/options/windows/options_windows.yy +++ b/options/windows/options_windows.yy @@ -4,7 +4,7 @@ "name": "Windows", "option_windows_display_name": "SNAP", "option_windows_executable_name": "${project_name}.exe", - "option_windows_version": "5.8.0.0", + "option_windows_version": "5.8.1.0", "option_windows_company_info": "@jujuadams", "option_windows_product_info": "SNAP", "option_windows_copyright_info": "@jujuadams 2023", diff --git a/scripts/SnapBufferReadGML/SnapBufferReadGML.gml b/scripts/SnapBufferReadGML/SnapBufferReadGML.gml index 71f0a7b..986dae2 100644 --- a/scripts/SnapBufferReadGML/SnapBufferReadGML.gml +++ b/scripts/SnapBufferReadGML/SnapBufferReadGML.gml @@ -126,7 +126,15 @@ function __SnapBufferReadGMLParser(_buffer, _buffer_size) constructor } else { - show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true); + var _asset_index = try_to_find_asset_index(token); + if (_asset_index >= 0) + { + token = _asset_index; + } + else + { + show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true); + } } } @@ -216,7 +224,15 @@ function __SnapBufferReadGMLParser(_buffer, _buffer_size) constructor } else { - show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true); + var _asset_index = try_to_find_asset_index(token); + if (_asset_index >= 0) + { + token = _asset_index; + } + else + { + show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true); + } } } @@ -355,7 +371,15 @@ function __SnapBufferReadGMLParser(_buffer, _buffer_size) constructor } else { - show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true); + var _asset_index = try_to_find_asset_index(token); + if (_asset_index >= 0) + { + token = _asset_index; + } + else + { + show_error("SNAP:\n\nLine " + string(line) + ", unexpected token " + string(token) + "\nis_string = " + string(token_is_string) + "\nis_real = " + string(token_is_real) + "\nis_symbol = " + string(token_is_symbol) + "\n ", true); + } } } @@ -469,5 +493,18 @@ function __SnapBufferReadGMLParser(_buffer, _buffer_size) constructor } } + static try_to_find_asset_index = function(_asset) + { + static _constantStruct = __DynamoGMLConstants(); + + if (!is_string(_asset)) return _asset; + + var _index = asset_get_index(_asset); + if (_index >= 0) return _index; + + if (!variable_struct_exists(_constantStruct, _asset)) return -1; + return _constantStruct[$ _asset]; + } + read_root(); } \ No newline at end of file diff --git a/scripts/__SnapSystem/__SnapSystem.gml b/scripts/__SnapSystem/__SnapSystem.gml index 4224e45..4ad4e24 100644 --- a/scripts/__SnapSystem/__SnapSystem.gml +++ b/scripts/__SnapSystem/__SnapSystem.gml @@ -1,4 +1,4 @@ -#macro __SNAP_VERSION "5.8.0" -#macro __SNAP_DATE "2023-04-27" +#macro __SNAP_VERSION "5.8.1" +#macro __SNAP_DATE "2023-04-30" show_debug_message("SNAP: Welcome to SNAP by @jujuadams! This is version " + __SNAP_VERSION + ", " + __SNAP_DATE); \ No newline at end of file