gamemaker / repack.csx
Cnass's picture
Create repack.csx
9ffe182 verified
Raw History Blame Contribute Delete
619 Bytes
using System.IO;
using System.Text.Json;
using System.Collections.Generic;
using UndertaleModLib;
string json = File.ReadAllText("strings.json");
var dict = JsonSerializer.Deserialize<Dictionary<string, string>>(json);
int changed = 0;
foreach (var str in Data.Strings) {
if (dict.TryGetValue(str.Content, out string newStr)) {
if (str.Content != newStr) {
str.Content = newStr;
changed++;
}
}
}
// Düzenlenmiş dosyayı kaydet
using (var stream = new FileStream("repacked_game.droid", FileMode.Create, FileAccess.Write)) {
UndertaleWriter.Write(stream, Data);
}