Nuked console

This commit is contained in:
2025-11-03 09:22:18 -06:00
parent 3feb43fdad
commit 3ef6205ea3
53 changed files with 127 additions and 1570 deletions

View File

@@ -2,7 +2,6 @@ import sys
# from processtileset import processTileset
from processimage import processImage
from processpalette import processPalette
from processconfig import processConfig
from processtileset import processTileset
from processmap import processMap
@@ -19,8 +18,6 @@ def processAsset(asset):
return processPalette(asset)
elif t == 'image':
return processImage(asset)
elif t == 'config':
return processConfig(asset)
elif t == 'tileset':
return processTileset(asset)
elif t == 'map':

View File

@@ -1,49 +0,0 @@
import os
import sys
from args import args
from assethelpers import getAssetRelativePath
from assetcache import assetGetCache, assetCache
def processConfig(asset):
assetPath = asset['path']
cache = assetGetCache(assetPath)
if cache is not None:
return cache
print(f"Processing config: {assetPath}")
# Takes each line, seperates it by either semicolon or newline,
# trims whitespace. Then outputs it to a file.
with open(assetPath, "r") as f:
lines = f.read().replace('\r', '').split('\n')
commands = []
for line in lines:
lineCommands = line.split(';')
for command in lineCommands:
command = command.strip()
if command != '':
commands.append(command)
data = bytearray()
data.extend(b"DCF") # Dusk Config File
for command in commands:
# Convert to string and seperate each command with semicolon
data.extend(command.encode('utf-8'))
data.append(0x3B) # Semicolon
if len(commands) > 0:
data.pop() # Remove last semicolon
relative = getAssetRelativePath(assetPath)
fileNameWithoutExt = os.path.splitext(os.path.basename(assetPath))[0]
outputFileRelative = os.path.join(os.path.dirname(relative), f"{fileNameWithoutExt}.dcf")
outputFilePath = os.path.join(args.output_assets, outputFileRelative)
os.makedirs(os.path.dirname(outputFilePath), exist_ok=True)
with open(outputFilePath, "wb") as f:
f.write(data)
outConfig = {
"files": [ outputFilePath ],
}
return assetCache(assetPath, outConfig)