Skip to content

Commit

Permalink
Merge pull request #1856 from Dobby233Liu/Dobby233Liu-UTWithJSON-load…
Browse files Browse the repository at this point in the history
…er-speedup-1

Use buffer for reading JSON in UndertaleWithJSONs
  • Loading branch information
Miepee authored Aug 22, 2024
2 parents 7715977 + eba41ca commit a1b0fdd
Showing 1 changed file with 3 additions and 6 deletions.
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

0 comments on commit a1b0fdd

Please sign in to comment.