Created
April 2, 2019 14:46
-
-
Save cmoates/cb9c67fee3d0b038e2f4178e4161b5f0 to your computer and use it in GitHub Desktop.
Add the color ID of Boundless palette colors to the color description for in game sorting ease
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json | |
newdata={} | |
with open('english.json') as json_file: | |
data = json.load(json_file) | |
for key, value in data.iteritems(): | |
if key.startswith('GUI_PALETTECOLOR_'): | |
number = key.split('_', 2) | |
number = number[2] | |
newdata[key]='%s %s'%(value, number) | |
else: | |
newdata[key]=value | |
with open('englishnumbers.json','w') as outfile: | |
json.dump(newdata,outfile, indent=4, sort_keys=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment