About to implement load strategy
This commit is contained in:
@@ -21,6 +21,8 @@ for asset in inputAssets:
|
||||
asset = processAsset(asset)
|
||||
files.extend(asset['files'])
|
||||
|
||||
files.extend(processLanguageList()['files'])
|
||||
|
||||
# Take assets and add to a zip archive.
|
||||
outputFileName = args.output_file
|
||||
print(f"Creating output file: {outputFileName}")
|
||||
@@ -32,7 +34,6 @@ with zipfile.ZipFile(outputFileName, 'w') as zipf:
|
||||
# Generate additional headers.
|
||||
processPaletteList()
|
||||
processTilesetList()
|
||||
processLanguageList()
|
||||
|
||||
# Finalize build
|
||||
if args.build_type == 'header':
|
||||
|
||||
@@ -102,6 +102,7 @@ def processLanguageList():
|
||||
|
||||
# We have now chunked all the keys for this language!
|
||||
langBuffer = b""
|
||||
files = []
|
||||
|
||||
# Write header info
|
||||
langBuffer += b'DLF' # Dusk Language File
|
||||
@@ -128,6 +129,7 @@ def processLanguageList():
|
||||
|
||||
# Write out the language data file
|
||||
outputFile = os.path.join(args.output_assets, "language", f"{lang}.dlf")
|
||||
files.append(outputFile)
|
||||
os.makedirs(os.path.dirname(outputFile), exist_ok=True)
|
||||
with open(outputFile, "wb") as f:
|
||||
f.write(langBuffer)
|
||||
@@ -139,6 +141,10 @@ def processLanguageList():
|
||||
with open(outputFile, "w") as f:
|
||||
f.write(headerKeys)
|
||||
|
||||
return {
|
||||
'files': files
|
||||
}
|
||||
|
||||
def getLanguageVariableName(languageKey):
|
||||
# Take the language key, prepend LANG_, uppercase, replace any non symbols
|
||||
# with _
|
||||
|
||||
Reference in New Issue
Block a user