diff options
author | Jesusaves <cpntb1@ymail.com> | 2022-04-08 22:25:26 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2022-04-08 22:25:26 -0300 |
commit | f29fc21eb8eb7954c03aa80ca60f3a3a6e667eb5 (patch) | |
tree | e14a0bba18d076ea9e49eb899ae6a56c5890acd1 | |
parent | 9a7e251ca941e626d1f6c1fa0c6cfabfe84acc42 (diff) | |
download | renpy-f29fc21eb8eb7954c03aa80ca60f3a3a6e667eb5.tar.gz renpy-f29fc21eb8eb7954c03aa80ca60f3a3a6e667eb5.tar.bz2 renpy-f29fc21eb8eb7954c03aa80ca60f3a3a6e667eb5.tar.xz renpy-f29fc21eb8eb7954c03aa80ca60f3a3a6e667eb5.zip |
Add a built-in client which does nothing
-rw-r--r-- | game/3rdparty/builtin.rpy | 28 | ||||
-rw-r--r-- | game/client.rpy | 16 | ||||
-rw-r--r-- | game/core.rpy | 2 | ||||
-rw-r--r-- | game/python-extra/tmw/__init__.py | 3 | ||||
-rw-r--r-- | game/renpy.rpy | 6 | ||||
-rw-r--r-- | game/screens.rpy | 2 |
6 files changed, 50 insertions, 7 deletions
diff --git a/game/3rdparty/builtin.rpy b/game/3rdparty/builtin.rpy new file mode 100644 index 0000000..c1ac566 --- /dev/null +++ b/game/3rdparty/builtin.rpy @@ -0,0 +1,28 @@ +################################################################################# +# This file is part of Mana Launcher. +# Copyright (C) 2022 Jesusalva <jesusalva@tmw2.org> +# +# Distributed under the MIT license. +# Warning: Third Party game clients +################################################################################# + +init 1 python: + import tmw + ############################################################################# + ## Builtin client can't be auto-updated + def download_builtin(fname): + return True + + ####################### + ## Builtin client doesn't require installation + def install_builtin(): + return True + + ############################### + def cli_builtin(launch=False, download=True): + global SCR_PROMPT, SCR_RESULT + ########## + if launch: + return tmw.client + return True + diff --git a/game/client.rpy b/game/client.rpy index 585452d..0a41e32 100644 --- a/game/client.rpy +++ b/game/client.rpy @@ -16,6 +16,8 @@ init 2 python: f=cli_manaplus(launch, download) elif (CLIENT_NAME == "manaverse"): f=cli_manaverse(launch, download) + elif (CLIENT_NAME == "builtin"): + f=cli_builtin(launch, download) else: status_update("ERROR, unrecognized client: %s" % CLIENT_NAME) @@ -92,19 +94,23 @@ init 2 python: sdelay(0.2) try: ## Minimize to tray if set - if not renpy.mobile and persistent.iconify: + if not renpy.mobile and persistent.iconify and type(CMD) == str: renpy.iconify() ## Sanitize input to avoid arbitrary code execution - CMD=CMD.replace(";", "").replace("&", "").replace(">", "").replace("<", "").replace("|", "").replace("$", "") + if type(CMD) == str: + CMD=CMD.replace(";", "").replace("&", "").replace(">", "").replace("<", "").replace("|", "").replace("$", "") OPT=OPT.replace(";", "").replace("&", "").replace(">", "").replace("<", "").replace("|", "").replace("$", "") PWD=PWD.replace(";", "").replace("&", "").replace(">", "").replace("<", "").replace("|", "").replace("$", "") ## Launch your preferred game client, wait for it to finish - if renpy.windows: - app=execute(san("\"%s\" %s%s" % (CMD, OPT, PWD)), shell=True) + if type(CMD) == str: + if renpy.windows: + app=execute(san("\"%s\" %s%s" % (CMD, OPT, PWD)), shell=True) + else: + app=execute(san("%s %s%s" % (CMD, OPT, PWD)), shell=True) else: - app=execute(san("%s %s%s" % (CMD, OPT, PWD)), shell=True) + app=CMD(OPT, PWD) ## Determine error messages if app == 7: diff --git a/game/core.rpy b/game/core.rpy index 1e53304..90ba8eb 100644 --- a/game/core.rpy +++ b/game/core.rpy @@ -154,7 +154,7 @@ init -3 python: ############################################################################# # ["themanaworld.org", "germantmw.de", "moubootaurlegends.org"] - if config.developer and False: + if config.developer: VAULT_HOST = "https://localhost:13370" VAULT_CERT = "http://localhost/launcher/cert.pem" else: diff --git a/game/python-extra/tmw/__init__.py b/game/python-extra/tmw/__init__.py index 9c76689..252e7c8 100644 --- a/game/python-extra/tmw/__init__.py +++ b/game/python-extra/tmw/__init__.py @@ -1,3 +1,6 @@ # TMW Plugin, both built-in client as Google Auth workaround +def client(OPT, PWD): + print("---- I AM BEING RUN") + return 0 diff --git a/game/renpy.rpy b/game/renpy.rpy index 4ea7a78..edd36de 100644 --- a/game/renpy.rpy +++ b/game/renpy.rpy @@ -163,7 +163,11 @@ label load_world: while progress < 100: # Do we get a cutscene? if SCR_CUTIN: - renpy.call_in_new_context(SCR_CUTIN) + try: + renpy.call_in_new_context(SCR_CUTIN) + except: + traceback.print_exc() + pass SCR_CUTIN="" if responsive: sdelay() diff --git a/game/screens.rpy b/game/screens.rpy index 68e0d3c..298eac5 100644 --- a/game/screens.rpy +++ b/game/screens.rpy @@ -686,6 +686,8 @@ screen preferences(): action SetVariable("persistent.evol2cli", "manaverse") textbutton _("ManaPlus"): action SetVariable("persistent.evol2cli", "manaplus") + textbutton _("Built-In"): + action SetVariable("persistent.evol2cli", "builtin") vbox: |