Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use buffer for reading JSON in UndertaleWithJSONs #1856

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ Directory.CreateDirectory(langFolder);
ScriptMessage("JSONifies Undertale versions 1.05+");
ScriptMessage(@"Switch languages using F11.
Reload text for curent language from JSON on command using F12.
Note: reloading from JSON may take about 10 seconds.
");
//this is one of the rare cases when it's better without "ProgressUpdater()"
await Task.Run(() => {
Expand Down Expand Up @@ -121,11 +120,9 @@ ossafe_ini_close()

ImportGMLString("gml_Script_scr_84_load_map_json", @"
var filename = argument0
var file = file_text_open_read(filename)
var json = """"
while (file_text_eof(file) == 0)
json += file_text_readln(file)
file_text_close(file)
var file_buffer = buffer_load(filename)
var json = buffer_read(file_buffer, buffer_string)
buffer_delete(file_buffer)
return json_decode(json);
");

Expand Down
Loading