-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert units.csv to units.json #9
base: master
Are you sure you want to change the base?
Changes from all commits
8ef6c0f
c6866bb
f1e72e0
31c6aee
018ecab
465d755
b39a2b9
bf4cfe2
1d49891
b00d984
d907508
9664dc5
13af49d
b6dbc39
ff2dc1c
e29e54c
311fa3f
7bb73ce
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,6 +36,34 @@ def __init__(self,screenX,screenY,marginX=None,marginY=None): | |
self.keyTarget = None | ||
Base.GlobalKeyPython('#\nfrom GUI import *\nGUIRootSingleton.keyEvent()\n') | ||
|
||
# VS Engine API version check ported verbatim from: | ||
# https://github.com/vegastrike/Assets-Production/blob/master/modules/GUI.py | ||
hasVersion = hasattr(VS, 'EngineVersion') | ||
# get the engine version tuple in a displayable format | ||
# if it needs to be compared, then use the original tuple version | ||
ev = ( | ||
VS.EngineVersion().GetVersion() | ||
if hasVersion | ||
else (0, 7, 0, 'unknown') # 0.7.x was the last version without this API | ||
) | ||
engineVersion = '.'.join( | ||
[ | ||
str(i) | ||
for i in ev | ||
] | ||
) | ||
|
||
apiVersion = ( | ||
VS.EngineVersion().GetAssetAPIVersion() | ||
if hasVersion | ||
else 0 | ||
) | ||
|
||
trace(TRACE_WARNING, "::: What's in VS object %s :::" %(dir(VS))) | ||
trace(TRACE_WARNING, "::: Engine Version {0} :::".format(engineVersion)) | ||
trace(TRACE_WARNING, "::: Asset API Version {0} :::".format(apiVersion)) | ||
# end VS Engine API version check | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stephengtuggy we (Vegastrike team) should post this code on its own and recommend people copy it in from that source so that we don't have to remember it for each game asset set. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the note |
||
|
||
def setScreenDimensions(self,screenX,screenY): | ||
self.screenX=screenX | ||
self.screenY=screenY | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
A brief guide on how to convert to JSON | ||
======================================= | ||
1. Open the CSV file in some kind of CSV editor (not a text editor). | ||
2. Search and replace all commas in the description with temporary, unused character. I used pipe. | ||
3. Save the file. | ||
4. Run python3 parser.py | ||
5. (Optional) Open the units.json file in a text editor. Search and replace all pipes back to commas. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add @ermo in too as he's the current lead on this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should get updated for this repo