Skip to content

Commit

Permalink
fix fonts for steam users
Browse files Browse the repository at this point in the history
change en fonts.
if start from launcher and change language, fonts won't reload.
  • Loading branch information
bssthu committed Nov 22, 2016
1 parent a032dbc commit 2a949f6
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions scripts/convert_txt_to_str.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def main():
sys.exit(2)
for o, a in opts:
if o == '-l':
lang = a
lang = a.lower()
elif o == '-m':
mode = a.lower()
if mode not in ('origin', 'translation', 'both'):
Expand Down Expand Up @@ -70,7 +70,7 @@ def main():

print('mode: %s' % mode)

# save lua
# save str
pregame_dest = os.path.join(dest_path, '%s_pregame.str' % lang)
pregame_lines = ui_mgr_pregame.get_str_lines(mode)
print('save to %s.' % pregame_dest)
Expand All @@ -85,6 +85,28 @@ def main():
fp.writelines(header)
fp.writelines(client_lines)

# save en str (fix fonts)
if lang != 'en':
pregame_dest = os.path.join(dest_path, 'en_pregame.str')
pregame_lines = ui_mgr_pregame.get_str_lines(mode)
print('save to %s.' % pregame_dest)
with open(pregame_dest, 'wt', encoding='utf-8') as fp:
fp.writelines(header)
# keep version info
for line in pregame_lines:
if line.startswith('[SI_VERSION] ='):
fp.write(line + '\n')

client_dest = os.path.join(dest_path, 'en_client.str')
client_lines = ui_mgr_client.get_str_lines(mode)
print('save to %s.' % client_dest)
with open(client_dest, 'wt', encoding='utf-8') as fp:
fp.writelines(header)
# keep version info
for line in client_lines:
if line.startswith('[SI_VERSION] ='):
fp.write(line + '\n')


if __name__ == '__main__':
main()

0 comments on commit 2a949f6

Please sign in to comment.