diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-11-23 10:34:39 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-11-23 10:34:39 -0300 |
commit | 0c75729f23a56afbec42ce7560fafa6f55540f21 (patch) | |
tree | ed97589716e89e8db3758c2764f01169b76b52df | |
parent | a38c9a6898006ae2528df0f64a77d9e7fbdfd1e8 (diff) | |
download | renpy-0c75729f23a56afbec42ce7560fafa6f55540f21.tar.gz renpy-0c75729f23a56afbec42ce7560fafa6f55540f21.tar.bz2 renpy-0c75729f23a56afbec42ce7560fafa6f55540f21.tar.xz renpy-0c75729f23a56afbec42ce7560fafa6f55540f21.zip |
Add a commandline parameter to automatically select world as well.
-rw-r--r-- | game/core.rpy | 13 | ||||
-rw-r--r-- | game/renpy.rpy | 6 |
2 files changed, 17 insertions, 2 deletions
diff --git a/game/core.rpy b/game/core.rpy index 14f22c9..8da3f7f 100644 --- a/game/core.rpy +++ b/game/core.rpy @@ -242,8 +242,9 @@ default MLP_DEST = None init -4 python: USE_DUMMY_DATA = False AUTOLAUNCH = False + AUTOWORLD = 0 def parse_command(): - global USE_DUMMY_DATA, AUTOLAUNCH + global USE_DUMMY_DATA, AUTOLAUNCH, AUTOWORLD global vault, VAULT_HOST, VAULT_CERT parser = renpy.arguments.ArgumentParser() @@ -299,8 +300,16 @@ init -4 python: print("version - shows the program version and exits") print("help - shows this help screen and exits") print("") - print("Last commands have precedence over earlier ones.") + print("Advanced:") + print("w<id> - logins to world <id> upon launching") + print("") + print("Latter commands have precedence over earlier ones.") renpy.quit() + elif (cmd.startswith("w")): + try: + AUTOWORLD=int(cmd[1:]) + except: + pass # Invalid world id else: print("\033[31;1mWARNING:\033[0m Unrecognized argument: %s" % cmd) return True diff --git a/game/renpy.rpy b/game/renpy.rpy index 2caa262..9cdb545 100644 --- a/game/renpy.rpy +++ b/game/renpy.rpy @@ -131,6 +131,12 @@ label start: #centered "Error" #if config.developer: # "User ID: [vaultId]" + + ## Automatic world selection from commandline + if (AUTOWORLD): + $ _return = AUTOWORLD + jump load_world + label start_loop: $ renpy.block_rollback() call screen mirrorlake |