From e5cd749735e676641aa011349c406a4f4cb3312c Mon Sep 17 00:00:00 2001 From: GanstaKingofSA Date: Tue, 1 Dec 2020 14:41:29 -0600 Subject: [PATCH] few code updates --- launcher/game/front_page.rpy | 2 ++ launcher/game/new_project.rpy | 29 +++++++++++++---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/launcher/game/front_page.rpy b/launcher/game/front_page.rpy index ca580fd..015d8c1 100644 --- a/launcher/game/front_page.rpy +++ b/launcher/game/front_page.rpy @@ -348,6 +348,8 @@ label set_version: interface.info(_("Set the Ren'Py mode version to Ren'Py 7.")) else: interface.error(_("Invalid Input. Please try again.")) + elif f.readline() == "7": + interface.error(_("The Ren'Py mode version is already set to Ren'Py 7.")) else: f = open(ver,'w+') f.write("7") diff --git a/launcher/game/new_project.rpy b/launcher/game/new_project.rpy index 0f81605..71856ff 100644 --- a/launcher/game/new_project.rpy +++ b/launcher/game/new_project.rpy @@ -20,11 +20,8 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. init python: + import zipfile, shutil, os, glob def zip_extract(): - import zipfile - import shutil - import os - import glob try: if renpy.macintosh: zip = "/ddlc-mac.zip" @@ -38,9 +35,9 @@ init python: ddlc = persistent.projects_directory + '/temp/DDLC-1.1.1-pc/game' except: if renpy.macintosh: - interface.error(_("Cannot Locate 'ddlc-mac.zip' in [persistent.zip_directory!q]."), _("Make sure you have DDLC downloaded from 'https://ddlc.moe' and check if it exists."),) + interface.error(_("Cannot locate 'ddlc-mac.zip' in [persistent.zip_directory!q]."), _("Make sure you have DDLC downloaded from 'https://ddlc.moe' and check if it exists.")) else: - interface.error(_("Cannot Locate 'ddlc-win.zip' in [persistent.zip_directory!q]."), _("Make sure you have DDLC downloaded from 'https://ddlc.moe' and check if it exists."),) + interface.error(_("Cannot locate 'ddlc-win.zip' in [persistent.zip_directory!q]."), _("Make sure you have DDLC downloaded from 'https://ddlc.moe' and check if it exists.")) try: shutil.move(ddlc, project_dir + '/game') except: @@ -55,7 +52,7 @@ init python: try: shutil.copytree(persistent.zip_directory + "/ddlc-mac/DDLC.app/Contents/Resources/autorun/game", persistent.pd + '/game') except: - interface.error(_("Cannot find DDLC.app."), _("Please make sure your OS and ZIP Directory are set correctly."), label=None) + interface.error(_("Cannot find DDLC.app."), _("Please make sure your OS and ZIP Directory are set correctly.")) #os.remove(persistent.pd + '/game/scripts.rpa') def template_extract(): try: @@ -63,7 +60,7 @@ init python: z.extractall(persistent.pd) except: shutil.rmtree(persistent.pd) - interface.error(_("Template ZIP file missing, or corrupt."), _("Check if the ZIP exists or re-download the tool."), label=None) + interface.error(_("Template ZIP file missing, or corrupt."), _("Check if the ZIP exists or re-download the tool.")) def mpt_extract(): mptzip = glob.glob(persistent.zip_directory + '/DDLC_MPT-[0-9].*_unpacked.*') @@ -164,12 +161,12 @@ label new_project: interface.error(_("[project_dir!q] already exists. Please choose a different project name."), project_dir=project_dir, label=None) continue if persistent.safari == True and renpy.macintosh: - interface.interaction(_("Making a DDLC Folder"), _("Copying DDLC. Please wait..."),) + interface.interaction(_("Making a DDLC Folder"), _("Copying DDLC. Please wait...")) ddlc_copy() else: - interface.interaction(_("Making a DDLC Folder"), _("Extracting DDLC. Please wait..."),) + interface.interaction(_("Making a DDLC Folder"), _("Extracting DDLC. Please wait...")) zip_extract() - interface.interaction(_("Copying Template Files"), _("Extracting DDLC Mod Template. Please wait..."),) + interface.interaction(_("Copying Template Files"), _("Extracting DDLC Mod Template. Please wait...")) template_extract() f = open(project_dir + '/renpy-version.txt','w+') f.write("7") @@ -226,7 +223,7 @@ label mpt: pass else: if not glob.glob(persistent.zip_directory + '/DDLC_MPT-[0-9].*_unpacked.*'): - interface.error(_("MPT ZIP file cannot be found by glob."), _("Check if the ZIP exists or re-download the tool."), label=None) + interface.error(_("MPT ZIP file cannot be found by glob."), _("Check if the ZIP exists or re-download the tool.")) break if project.manager.get(project_name) is not None: interface.error(_("[project_name!q] already exists. Please choose a different project name."), project_name=project_name, label=None) @@ -235,15 +232,15 @@ label mpt: interface.error(_("[project_dir!q] already exists. Please choose a different project name."), project_dir=project_dir, label=None) continue if persistent.safari == True and renpy.macintosh: - interface.interaction(_("Making a DDLC Folder"), _("Copying DDLC. Please wait..."),) + interface.interaction(_("Making a DDLC Folder"), _("Copying DDLC. Please wait...")) ddlc_copy() else: - interface.interaction(_("Making a DDLC Folder"), _("Extracting DDLC. Please wait..."),) + interface.interaction(_("Making a DDLC Folder"), _("Extracting DDLC. Please wait...")) zip_extract() import shutil - interface.interaction(_("Installing Mod Template"), _("Please wait..."),) + interface.interaction(_("Installing Mod Template"), _("Please wait...")) template_extract() - interface.interaction(_("Installing MPT"), _("Please wait..."),) + interface.interaction(_("Installing MPT"), _("Please wait...")) if renpy.macintosh and persistent.safari == True: mpt_copy() else: