################################################################################# # This file is part of Mana Launcher. # Copyright (C) 2021 Jesusalva # # Distributed under the MIT license, except for Steam parts. ################################################################################# init 2 python: def handle_client(CLIENT_NAME="", launch=False, download=True, force=False): ## Local variables f=False if (CLIENT_NAME == ""): CLIENT_NAME=persistent.evol2cli ## Main loop if (CLIENT_NAME == "manaplus"): f=cli_manaplus(launch, download, force) elif (CLIENT_NAME == "manaverse"): f=cli_manaverse(launch, download, force) elif (CLIENT_NAME == "builtin"): f=cli_builtin(launch, download, force) else: status_update("ERROR, unrecognized client: %s" % CLIENT_NAME) return f def launch_game(idx): global progress, responsive, statusmsg, MLP_DEST, SCR_CUTIN ######################################################################## ## Setup RPCUpdate(persistent.serverlist[idx]["Name"], persistent.serverlist[idx]["Back"]) HOST=persistent.serverlist[idx]["Host"] PORT=persistent.serverlist[idx]["Port"] TYPE=persistent.serverlist[idx]["Type"] CMD=handle_client(launch=True) OPT="-s %s -y %s -p %s -S" % (HOST, TYPE, PORT) ## 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: paten="\\".join(CMD.replace('/', '\\').split("\\")[:-2]) 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. Where, exactly? # #