Create libs/ and lib/libs.txt.

The latter is the flags file that will load the libs directory in
libs mode.
This commit is contained in:
Tom Rothamel
2025-01-12 15:25:28 -05:00
parent 0c3b419dad
commit 732ef3af11
3 changed files with 15 additions and 1 deletions
+1
View File
@@ -0,0 +1 @@
## When this file exists, Ren'Py will load files in game/libs before other files in game.
+9
View File
@@ -26,6 +26,15 @@ define gui.asian = False
# and provides the full path to the template project.
default gui_template_path = None
define LIBS_TXT = _("""\
The game/libs/ directory is meant for third-party libraries that ask to be put in
game/libs.
When this file (game/libs/libs.txt) is present, Ren'Py will load all files in libs
before any other file in game/, and will not consider directory names when loading
these files.
""")
init -1 python:
import gui7
+5 -1
View File
@@ -28,15 +28,19 @@ import os
import shutil
def finish(p):
for dn in [ "images", "audio" ]:
for dn in [ "images", "audio", "libs" ]:
fulldn = os.path.join(p.prefix, dn)
if not os.path.exists(fulldn):
os.mkdir(fulldn)
with open(os.path.join(p.prefix, "libs", "libs.txt"), "w") as f:
f.write(renpy.translation.translate_string(renpy.store.LIBS_TXT, language=p.language))
def generate_gui(p):
ImageGenerator(p).generate_all()