forked from LeenkxTeam/LNXSDK
Consolidate and update
This commit is contained in:
@ -539,6 +539,12 @@ let project = new Project('""" + lnx.utils.safesrc(wrd.lnx_project_name + '-' +
|
||||
|
||||
if wrd.lnx_loadscreen:
|
||||
assets.add_khafile_def('lnx_loadscreen')
|
||||
custom_loadscreen = os.path.isfile(lnx.utils.get_fp() + '/Sources/' + wrd.lnx_project_package + '/LoadingScreen.hx')
|
||||
if wrd.lnx_loadscreen_mode == 'Image' or custom_loadscreen:
|
||||
loadscreen_image = bpy.path.abspath(wrd.lnx_loadscreen_image) if wrd.lnx_loadscreen_image else ''
|
||||
if loadscreen_image == '' or not os.path.isfile(loadscreen_image):
|
||||
loadscreen_image = os.path.join(sdk_path, 'leenkx', 'blender', 'theme', 'splash.png')
|
||||
khafile.write(add_assets(loadscreen_image.replace('\\', '/'), use_data_dir=use_data_dir, rel_path=do_relpath_sdk))
|
||||
|
||||
if wrd.lnx_winresize or state.target == 'html5':
|
||||
assets.add_khafile_def('lnx_resizable')
|
||||
@ -742,6 +748,20 @@ class Main {
|
||||
f.write("\n" + content_indent + "leenkx.system.Starter.numAssets = " + str(len(asset_references)) + ";")
|
||||
f.write("\n" + content_indent + "leenkx.system.Starter.drawLoading = " + loadscreen_class + ".render;")
|
||||
f.write("\n" + content_indent + "leenkx.system.Starter.assets = " + str([os.path.basename(path) for path in asset_references if 'Bundled' in path]) + ";")
|
||||
if loadscreen_class == 'leenkx.trait.internal.LoadingScreen':
|
||||
if wrd.lnx_loadscreen_mode == 'Image':
|
||||
li = bpy.path.abspath(wrd.lnx_loadscreen_image) if wrd.lnx_loadscreen_image else ''
|
||||
if li == '' or not os.path.isfile(li):
|
||||
li = os.path.join(lnx.utils.get_sdk_path(), 'leenkx', 'blender', 'theme', 'splash.png')
|
||||
f.write("\n" + content_indent + loadscreen_class + ".bgImageName = '" + os.path.basename(li) + "';")
|
||||
f.write("\n" + content_indent + loadscreen_class + ".imageFit = '" + wrd.lnx_loadscreen_fit + "';")
|
||||
else:
|
||||
f.write("\n" + content_indent + loadscreen_class + ".bgImageName = '';")
|
||||
c = wrd.lnx_loadscreen_color
|
||||
f.write("\n" + content_indent + loadscreen_class + ".barColor = " + hex(0xff000000 + (int(c[0] * 255) << 16) + (int(c[1] * 255) << 8) + int(c[2] * 255)) + ";")
|
||||
c = wrd.lnx_loadscreen_bgcolor
|
||||
f.write("\n" + content_indent + loadscreen_class + ".bgColor = " + hex(0xff000000 + (int(c[0] * 255) << 16) + (int(c[1] * 255) << 8) + int(c[2] * 255)) + ";")
|
||||
f.write("\n" + content_indent + loadscreen_class + ".showPercentage = " + ('true' if wrd.lnx_loadscreen_show_percentage else 'false') + ";")
|
||||
|
||||
scenes_list = [f"'{scene.name}'" for scene in bpy.data.scenes if getattr(scene, 'lnx_export', True)]
|
||||
scenes_array = "[" + ", ".join(scenes_list) + "]"
|
||||
@ -819,7 +839,7 @@ def write_indexhtml(w, h, is_publish):
|
||||
<title>"""+html.escape( wrd.lnx_project_name)+"""</title>
|
||||
"""+icon+"""
|
||||
</head>
|
||||
<body style='margin: 0; padding: 0'>
|
||||
<body style='margin: 0; padding: 0; background: #001A22'>
|
||||
""")
|
||||
if rpdat.rp_stereo or wrd.lnx_winmode == 'Fullscreen':
|
||||
f.write("""
|
||||
|
||||
Reference in New Issue
Block a user