Prog
This commit is contained in:
@@ -3,7 +3,7 @@ import os
|
||||
from assetstool.args import args
|
||||
from assetstool.assetcache import assetCache, assetGetCache
|
||||
from assetstool.assethelpers import getAssetRelativePath
|
||||
from dusk.defs import defs
|
||||
from dusk.defs import fileDefs
|
||||
|
||||
def processScript(asset):
|
||||
cache = assetGetCache(asset['path'])
|
||||
@@ -16,6 +16,10 @@ def processScript(asset):
|
||||
|
||||
# TODO: I will precompile or minify the Lua code here in the future
|
||||
|
||||
# Replace all definitions in the code
|
||||
for key, val in fileDefs.items():
|
||||
luaCode = luaCode.replace(key, str(val))
|
||||
|
||||
# Create output Dusk Script File (DSF) data
|
||||
data = ""
|
||||
data += "DSF"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from dotenv import load_dotenv
|
||||
from dotenv import load_dotenv, dotenv_values
|
||||
import os
|
||||
import sys
|
||||
|
||||
@@ -13,6 +13,8 @@ if not os.path.isfile(duskDefsPath):
|
||||
load_dotenv(dotenv_path=duskDefsPath)
|
||||
defs = {key: os.getenv(key) for key in os.environ.keys()}
|
||||
|
||||
fileDefs = dotenv_values(dotenv_path=duskDefsPath)
|
||||
|
||||
# Parsed out definitions
|
||||
CHUNK_WIDTH = int(defs.get('CHUNK_WIDTH'))
|
||||
CHUNK_HEIGHT = int(defs.get('CHUNK_HEIGHT'))
|
||||
|
||||
Reference in New Issue
Block a user