File size: 619 Bytes
9ffe182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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);
}