okay seems okay now
This commit is contained in:
parent
efa041a853
commit
acd17c2cbb
|
|
@ -114,7 +114,8 @@ def getScriptData():
|
||||||
start_char = struct.unpack("<Q", script_data[seeker:seeker+8])[0]
|
start_char = struct.unpack("<Q", script_data[seeker:seeker+8])[0]
|
||||||
end = read_until_space(start_char, script_data)
|
end = read_until_space(start_char, script_data)
|
||||||
script_block['character'] = script_data[start_char:end].decode('utf-8')
|
script_block['character'] = script_data[start_char:end].decode('utf-8')
|
||||||
index = f"{j}_{language_code}_{script_block['character']}"
|
#index = f"{j}_{language_code}_{script_block['character']}"
|
||||||
|
index = f"{j}_{script_block['character']}"
|
||||||
|
|
||||||
seeker = seeker + 8
|
seeker = seeker + 8
|
||||||
start_arg1 = struct.unpack("<Q", script_data[seeker:seeker+8])[0]
|
start_arg1 = struct.unpack("<Q", script_data[seeker:seeker+8])[0]
|
||||||
|
|
@ -137,7 +138,8 @@ def getScriptData():
|
||||||
scripts[script_titles[p]][index]['index'] = j
|
scripts[script_titles[p]][index]['index'] = j
|
||||||
scripts[script_titles[p]][index]['arg1'] = script_block['arg1']
|
scripts[script_titles[p]][index]['arg1'] = script_block['arg1']
|
||||||
scripts[script_titles[p]][index]['arg2'] = script_block['arg2']
|
scripts[script_titles[p]][index]['arg2'] = script_block['arg2']
|
||||||
scripts[script_titles[p]][index]['text'] = script_block['text']
|
#scripts[script_titles[p]][index]['text'] = script_block['text']
|
||||||
|
scripts[script_titles[p]][index][f"text_{language_code}"] = script_block['text']
|
||||||
|
|
||||||
#scripts[p]['blocks'].append(script_block.copy())
|
#scripts[p]['blocks'].append(script_block.copy())
|
||||||
print(script_block)
|
print(script_block)
|
||||||
|
|
@ -152,10 +154,10 @@ getScriptData()
|
||||||
print('again?')
|
print('again?')
|
||||||
#scripts = sorted(scripts.items(), key= lambda x: x[1]['index'], reverse=False)
|
#scripts = sorted(scripts.items(), key= lambda x: x[1]['index'], reverse=False)
|
||||||
|
|
||||||
for key in scripts:
|
# for key in scripts:
|
||||||
scripts[key] = sorted(scripts[key].items(), key = lambda x: x[1]['index'], reverse=False)
|
# scripts[key] = sorted(scripts[key].items(), key = lambda x: x[1]['index'], reverse=False)
|
||||||
|
|
||||||
with open(f"scripts_dump.json", "w", encoding="utf-8") as outfile:
|
with open(f"scripts_dump2.json", "w", encoding="utf-8") as outfile:
|
||||||
json.dump(scripts, outfile, ensure_ascii=False, indent=2)
|
json.dump(scripts, outfile, ensure_ascii=False, indent=2)
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user