Skip to content

Commit

Permalink
Merge pull request #4 from GanstaKingofSA/master-mpt
Browse files Browse the repository at this point in the history
DDMMaker 1.0.1 Update
  • Loading branch information
Bronya-Rand authored Jan 11, 2020
2 parents 16ec828 + bd33c76 commit 64bb8ab
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 57 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ errors.txt
*.rpyb
tmp
renpy-*.*.*-dists
DDMMaker-*.*.*-dists
DDMMaker-*.*.*-dists
renpy/*.pyo
launcher/project.json
47 changes: 0 additions & 47 deletions launcher/game/advanced.rpy

This file was deleted.

8 changes: 4 additions & 4 deletions launcher/game/front_page.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ screen front_page_project:

vbox:

label _("Open Directory") style "l_label_small"
label _("Open Folder") style "l_label_small"

frame style "l_indent":
has vbox
Expand Down Expand Up @@ -239,7 +239,7 @@ screen front_page_project:

add SPACER

label _("Actions") style "l_label_small"
label _("Options") style "l_label_small"

grid 2 1:
xfill True
Expand All @@ -249,7 +249,7 @@ screen front_page_project:
has vbox

textbutton _("Navigate Script") action Jump("navigation")
textbutton _("Check Script (Lint)") action Jump("lint")
textbutton _("Check Script for Errors") action Jump("lint")
textbutton _("Delete Persistent") action Jump("rmpersistent")
textbutton _("Force Recompile") action Jump("force_recompile")

Expand All @@ -259,7 +259,7 @@ screen front_page_project:
has vbox

if ability.can_distribute:
textbutton _("Build Distributions") action Jump("build_distributions")
textbutton _("Build Project/Mod") action Jump("build_distributions")
textbutton _("Generate Translations") action Jump("translate")
textbutton _("Extract Dialogue") action Jump("extract_dialogue")
textbutton _("Delete Project") action Jump("delete_folder")
Expand Down
5 changes: 3 additions & 2 deletions launcher/game/interface.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ screen bottom_info:

hbox:
spacing INDENT
textbutton _("Documentation") style "l_link" action interface.OpenDocumentation()
textbutton _("Ren'Py Docs") style "l_link" action interface.OpenDocumentation()
textbutton _("About") style "l_link" action Jump("about")
textbutton _("Download DDLC") style "l_link" action OpenURL(interface.DDLC_URL)
textbutton _("Install MPT") style "l_link" action Jump("mpt")
textbutton _("Updates") style "l_link" action OpenURL(interface.GIT_URL)

hbox:
Expand All @@ -127,7 +128,7 @@ screen bottom_info:

#if ability.can_update:
#textbutton _("update") action Jump("update") style "l_link"
textbutton _("Advanced") style "l_link" action Jump("advanced")
#textbutton _("Advanced") style "l_link" action Jump("advanced")
textbutton _("Settings") style "l_link" action Jump("preferences")
textbutton _("Exit") style "l_link" action Quit(confirm=False)

Expand Down
85 changes: 82 additions & 3 deletions launcher/game/new_project.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,35 @@ init python:
import zipfile
import shutil
try:
with zipfile.ZipFile(config.basedir + "/templates/DDLCModTemplate-2.2.4-Standard.zip", "r") as z:
z.extractall(persistent.project_dir)
if renpy.macintosh:
with zipfile.ZipFile(config.basedir + "/templates/DDLCModTemplate-2.2.4-Standard.zip", "r") as z:
z.extractall(persistent.project_dir + "/DDLC.app")
else:
with zipfile.ZipFile(config.basedir + "/templates/DDLCModTemplate-2.2.4-Standard.zip", "r") as z:
z.extractall(persistent.project_dir)
except:
shutil.rmtree(persistent.project_dir)
interface.error(_("Template ZIP file missing, or corrupt."), _("Check if the ZIP exists or re-download the tool."))
def mpt_extract():
import zipfile
import shutil
#try:
with zipfile.ZipFile(persistent.zip_directory + '/DDLC_MPT-1.0-unpacked.zip', "r") as z:
z.extractall(persistent.projects_directory + "/temp")
ddlc = persistent.projects_directory + '/temp/DDLC_Mood_Posing_Tool/game'
# if renpy.macintosh:
# shutil.move(ddlc, persistent.project_dir + '/DDLC.app')
# else:
files = os.listdir(ddlc)

for f in files:
shutil.move(ddlc+'/'+f, persistent.project_dir + '/game')
ddlc = persistent.projects_directory + '/temp/DDLC_Mood_Posing_Tool'
shutil.move(ddlc + "/commands.txt", persistent.project_dir)
shutil.move(ddlc + "/credits.txt", persistent.project_dir)
#except:
#shutil.rmtree(persistent.project_dir)
#interface.error(_("MPT ZIP file missing, or corrupt."), _("Check if the ZIP exists or re-download the tool."))

label new_project:
if persistent.projects_directory is None:
Expand Down Expand Up @@ -119,4 +143,59 @@ label new_project:
interface.info(_('A file named `renpy-version.txt` has been created in the base directory.'), _("Do not delete this file as it is needed to determine which version of Ren'Py it uses for building your mod."))
project.manager.scan()
break
return
return

label mpt:
if persistent.projects_directory is None:
call choose_projects_directory
if persistent.projects_directory is None:
$ interface.error(_("The projects directory could not be set. Giving up."))
if renpy.macintosh:
if persistent.safari is None:
call auto_extract
if persistent.safari is None:
$ interface.error(_("Couldn't check if OS auto-extracts ZIPs. Please reconfigure your settings."))
if persistent.zip_directory is None:
call ddlc_zip
if persistent.zip_directory is None:
$ interface.error(_("The DDLC ZIP directory could not be set. Giving up."))

python:
interface.info(_("Installing Mood Pose Tool requires you to download the Unpacked ZIP from http://bit.ly/DDLC_MPT_v1p0"), _("Download the ZIP and put it in your DDLC ZIP Directory."),)
project_name = ""
while True:
project_name = interface.input(
_("Project Name"),
_("Please enter the name of your project:"),
allow=interface.PROJECT_LETTERS,
cancel=Jump("front_page"),
default=project_name,
)

project_name = project_name.strip()
if not project_name:
interface.error(_("The project name may not be empty."), label=None)
if project_name == "launcher":
interface.error(_("'launcher' is a reserved project name. Please choose a different project name."))
persistent.project_dir = os.path.join(persistent.projects_directory, project_name)

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)
if os.path.exists(persistent.project_dir):
interface.error(_("[persistent.project_dir!q] already exists. Please choose a different project name."), project_dir=project_dir, label=None)
if persistent.safari == True and renpy.macintosh:
interface.interaction(_("Making a DDLC Folder"), _("Copying DDLC. Please wait..."),)
ddlc_copy()
else:
interface.interaction(_("Making a DDLC Folder"), _("Extracting DDLC. Please wait..."),)
zip_extract()
import shutil
shutil.rmtree(persistent.project_dir + '/game/python-packages')
interface.interaction(_("Installing MPT"), _("Please wait..."),)
mpt_extract()
f = open(persistent.project_dir + '/renpy-version.txt','w+')
f.write("7")
persistent.project_dir = None
interface.info(_('A file named `renpy-version.txt` has been created in the base directory.'), _("Do not delete this file as it is needed to determine which version of Ren'Py it uses for building your mod."))
project.manager.scan()
break

0 comments on commit 64bb8ab

Please sign in to comment.