From ddba0c17b630c597988fe0b0bdba6b2a368970f7 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 3 Dec 2022 17:27:24 -0300 Subject: Linux now uses custom configuration. I'll need a windows volunteer. --- game/client.rpy | 27 +++++++++++++++++++++++++-- game/core.rpy | 12 ++++++------ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/game/client.rpy b/game/client.rpy index df31fcd..85eff39 100644 --- a/game/client.rpy +++ b/game/client.rpy @@ -33,12 +33,35 @@ init 2 python: TYPE=persistent.serverlist[idx]["Type"] CMD=handle_client(launch=True) OPT="-s %s -y %s -p %s -S" % (HOST, TYPE, PORT) - #if renpy.variant("steam_deck"): + + ## Config and Local overrides + if renpy.linux: + paten="/".join(CMD.split("/")[:-1]) + paten='%s' % paten.replace("\\ ", " ") + OPT+=' -C "%s/Config" -L "%s/Local"' % (paten, paten) + elif renpy.windows and False: + paten="\\".join(CMD.replace('/', '\\').split("\\")[:-1]) + OPT+=' -C "%s/Config" -L "%s/Local"' % (paten, paten) + + ## Steam Deck must be fullscreen + if renpy.variant("steam_deck"): + bf=[] + with open("%s/Config/config.xml", "r") as f: + for l in f: + l=l.replace('"screen" value="0"', '"screen" value="0"') + l=l.replace('"screenwidth" value="1280"', '"screenwidth" value="800"') + l=l.replace('"screenheight" value="720"', '"screenheight" value="600"') + bf.append(l) + with open("%s/Config/config.xml", "w") as f: + for l in bf: + f.write(l) + del bf + # OPT+=" --fullscreen" #if True: #(CLIENT_NAME in ["manaplus", "manaverse"]): # #OPT+=" -C \"%s\" -ud \"%s/%s\"" % (get_path("config"), get_path("data"), HOST) # #OPT+=" -C \"%s\"" % (get_path("config")) - # # TODO: --screenshot-dir + # # TODO: --screenshot-dir. Where, exactly? # #