Preferably, the ruby text should not be loaded or removed when the game attempts to load it, when the story text it belongs to has been translated.
Here's a snippet of my code from Carotene where I just update the assetbundle directly to remove the ruby data. You might be able to hook some function instead?
# Handle ruby text.
ruby_file_name = file_name.replace("storytimeline", "ast_ruby").replace("hometimeline_", "ast_ruby_hometimeline_")
with util.MetaConnection() as (conn, cursor):
cursor.execute("SELECT h FROM a WHERE n = ?;", (ruby_file_name,))
ruby_hash = cursor.fetchone()
if not ruby_hash:
# No ruby asset for this story.
return
ruby_path = handle_backup(ruby_hash[0])
ruby_bundle, _ = unity.load_assetbundle(ruby_path, ruby_hash[0])
for obj in ruby_bundle.assets[0].objects.values():
tree = obj.read_typetree()
if not tree.get('DataArray'):
continue
tree['DataArray'] = []
obj.save_typetree(tree)
Preferably, the ruby text should not be loaded or removed when the game attempts to load it, when the story text it belongs to has been translated.
Here's a snippet of my code from Carotene where I just update the assetbundle directly to remove the ruby data. You might be able to hook some function instead?