Skip to content

DDMMaker 1.6.0 Update for Ren'Py 7 #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: mmaker-7.4
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ddmm_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Doki Doki Mod Maker",
"acronym": "DDMM",
"creator": "Schnee Dust Company - A Bronya Rand Division (bronya_rand)",
"description": "DDMM is a Ren'Py SDK Modification that makes DDLC Modding easier and efficient with better wording, auto-tool install, and more! This tool adheres to the Team Salvato IP Guidelines and RenpyTom Guidelines for DDLC and Ren'Py SDK modding.",
"restart": true
}
2 changes: 1 addition & 1 deletion launcher/Visual Studio Code (System).edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_code(self):
elif renpy.arch == "armv7l":
arch = "arm"
else:
arch = "x86_64"
arch = "x64"

code = os.path.join(RENPY_VSCODE, "VSCode-linux-" + arch, "bin", "code")
else:
Expand Down
2 changes: 1 addition & 1 deletion launcher/Visual Studio Code.edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_code(self):
elif renpy.arch == "armv7l":
arch = "arm"
else:
arch = "x86_64"
arch = "x64"

code = os.path.join(RENPY_VSCODE, "VSCode-linux-" + arch, "bin", "code")
else:
Expand Down
2 changes: 1 addition & 1 deletion launcher/game/ability.rpy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2004-2022 Tom Rothamel <[email protected]>
# Copyright 2004-2023 Tom Rothamel <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
Expand Down
9 changes: 3 additions & 6 deletions launcher/game/about.rpy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2004-2022 Tom Rothamel <[email protected]>
# Copyright 2004-2023 Tom Rothamel <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
Expand Down Expand Up @@ -37,12 +37,9 @@ screen about:
null height 15

text _("DDMM [config.version!q]") xalign 0.5 bold True
text _("[version!q]") xalign 0.5 bold True

null height 5

text _("Ren'Py " + renpy.version().split()[1]) xalign 0.5 bold False

null height 15
null height 20

textbutton _("View license") action interface.OpenLicense() xalign 0.5

Expand Down
2 changes: 1 addition & 1 deletion launcher/game/add_file.rpy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2004-2022 Tom Rothamel <[email protected]>
# Copyright 2004-2023 Tom Rothamel <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
Expand Down
75 changes: 40 additions & 35 deletions launcher/game/android.rpy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2004-2022 Tom Rothamel <[email protected]>
# Copyright 2004-2023 Tom Rothamel <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
Expand Down Expand Up @@ -31,22 +31,23 @@ init python:
ANDROID_NO_BUNDLE = 6
ANDROID_OK = 7

NO_RAPT_TEXT = _("To build Android packages, please download RAPT, unzip it, and place it into the DDMM directory. Then restart DDMM.")
NO_JDK_TEXT = _("A 64-bit/x64 Java 8 Development Kit is required to build Android packages on Windows. The JDK is different from the JRE, so it's possible you have Java without having the JDK.\n\nPlease {a=https://adoptium.net/temurin/releases/?version=8}download and install the JDK{/a}, then restart DDMM.")
JDK_REQUIREMENT=8

NO_RAPT_TEXT = _("To build Android packages, please download RAPT, unzip it, and place it into the Ren'Py directory. Then restart the Ren'Py launcher.")
NO_JDK_TEXT = _("A 64-bit/x64 Java [JDK_REQUIREMENT] Development Kit is required to build Android packages on Windows. The JDK is different from the JRE, so it's possible you have Java without having the JDK.\n\nPlease {a=https://www.renpy.org/jdk/[JDK_REQUIREMENT]}download and install the JDK{/a}, then restart the Ren'Py launcher.")
NO_SDK_TEXT = _("RAPT has been installed, but you'll need to install the Android SDK before you can build Android packages. Choose Install SDK to do this.")
NO_KEY_TEXT = _("RAPT has been installed, but a key hasn't been configured. Please create a new key, or restore android.keystore.")
NO_BUNDLE_KEY_TEXT = _("RAPT has been installed, but a bundle key hasn't been configured. Please create a new key, or restore bundle.keystore.")
NO_KEY_TEXT = _("RAPT has been installed, but a key hasn't been configured. Please generate new keys, or copy android.keystore and bundle.keystore to the base directory.")
NO_CONFIG_TEXT = _("The current project has not been configured. Use \"Configure\" to configure it before building.")
NO_BUNDLE_TEXT = _("Please select if you want a Play Bundle (for Google Play), or a Universal APK (for sideloading and other app stores).")
OK_TEXT = _("Choose \"Build\" to build the current project, or attach an Android device and choose \"Build & Install\" to build and install it on the device.")

PHONE_TEXT = _("Attempts to emulate an Android phone.\n\nTouch input is emulated through the mouse, but only when the button is held down. Escape is mapped to the menu button, and PageUp is mapped to the back button.")
TABLET_TEXT = _("Attempts to emulate an Android tablet.\n\nTouch input is emulated through the mouse, but only when the button is held down. Escape is mapped to the menu button, and PageUp is mapped to the back button.")
OUYA_TEXT = _("Attempts to emulate a televison-based Android console, like the OUYA or Fire TV.\n\nController input is mapped to the arrow keys, Enter is mapped to the select button, Escape is mapped to the menu button, and PageUp is mapped to the back button.")
OUYA_TEXT = _("Attempts to emulate a televison-based Android console.\n\nController input is mapped to the arrow keys, Enter is mapped to the select button, Escape is mapped to the menu button, and PageUp is mapped to the back button.")

INSTALL_SDK_TEXT = _("Downloads and installs the Android SDK and supporting packages. Optionally, generates the keys required to sign the package.")
INSTALL_SDK_TEXT = _("Downloads and installs the Android SDK and supporting packages.")
GENERATE_KEYS_TEXT = _("Generates the keys required to sign the package.")
CONFIGURE_TEXT = _("Configures the package name, version, and other information about this project.")
PLAY_KEYS_TEXT = _("Opens the file containing the Google Play keys in the editor.\n\nThis is only needed if the application is using an expansion APK. Read the documentation for more details.")
BUILD_TEXT = _("Builds the Android package.")
BUILD_AND_INSTALL_TEXT = _("Builds the Android package, and installs it on an Android device connected to your computer.")
BUILD_INSTALL_AND_LAUNCH_TEXT = _("Builds the Android package, installs it on an Android device connected to your computer, then launches the app on your device.")
Expand Down Expand Up @@ -94,6 +95,7 @@ init python:
import rapt.install_sdk
import rapt.plat
import rapt.interface
import rapt.keys

rapt.plat.renpy = True
rapt.plat.translate = __
Expand All @@ -112,11 +114,12 @@ init python:
return ANDROID_NO_JDK
if not os.path.exists(rapt.plat.adb):
return ANDROID_NO_SDK
if not os.path.exists(rapt.plat.path("project/local.properties")):
if not rapt.keys.keys_exist(project.current.path):
return ANDROID_NO_KEY
if not os.path.exists(rapt.plat.path("project/bundle.properties")):
return ANDROID_NO_BUNDLE_KEY
if not os.path.exists(os.path.join(project.current.path, ".android.json")):
if not any([
os.path.exists(os.path.join(project.current.path, "android.json")),
os.path.exists(os.path.join(project.current.path, ".android.json"))
]):
return ANDROID_NO_CONFIG
if persistent.android_bundle is None:
return ANDROID_NO_BUNDLE
Expand All @@ -137,8 +140,6 @@ init python:
return NO_SDK_TEXT
if state == ANDROID_NO_KEY:
return NO_KEY_TEXT
if state == ANDROID_NO_BUNDLE_KEY:
return NO_BUNDLE_KEY_TEXT
if state == ANDROID_NO_CONFIG:
return NO_CONFIG_TEXT
if state == ANDROID_NO_BUNDLE:
Expand Down Expand Up @@ -181,31 +182,23 @@ init python:

build = p.dump["build"]

filename = os.path.join(p.path, ".android.json")

with open(filename, "r") as f:
android_json = json.load(f)

old_android_json = dict(android_json)
c = rapt.configure.Configuration(p.path)

if "google_play_key" in build:
android_json["google_play_key"] = build["google_play_key"]
c.google_play_key = build["google_play_key"]
else:
android_json.pop("google_play_key", None)
c.google_play_key = None

if "google_play_salt" in build:

if len(build["google_play_salt"]) != 20:
raise Exception("build.google_play_salt must be exactly 20 bytes long.")

android_json["google_play_salt"] = ", ".join(str(i) for i in build["google_play_salt"])
c.google_play_salt = ", ".join(str(i) for i in build["google_play_salt"])
else:
android_json.pop("google_play_salt", None)
c.google_play_salt = None

if android_json != old_android_json:

with open(filename, "w") as f:
json.dump(android_json, f)
c.save(p.path)


def android_build(p=None, gui=True, bundle=False, install=False, launch=False, destination=None, opendir=False):
Expand Down Expand Up @@ -288,7 +281,7 @@ init python:


with interface.nolinks():
rapt.build.build(rapt_interface, dist, bundle=bundle, install=install, launch=launch, finished=finished, permissions=p.dump['build']['android_permissions'])
rapt.build.build(rapt_interface, dist, p.path, bundle=bundle, install=install, launch=launch, finished=finished, permissions=p.dump['build']['android_permissions'])


def android_build_argument(cmd):
Expand Down Expand Up @@ -388,12 +381,16 @@ screen android:
frame style "l_indent":

has vbox
textbutton _("Install SDK & Create Keys"):
textbutton _("Install SDK"):
action AndroidIfState(state, ANDROID_NO_SDK, Jump("android_installsdk"))
hovered tt.Action(INSTALL_SDK_TEXT)

textbutton _("Generate Keys"):
action AndroidIfState(state, ANDROID_NO_KEY, Jump("android_keys"))
hovered tt.Action(GENERATE_KEYS_TEXT)

textbutton _("Configure"):
action AndroidIfState(state, ANDROID_NO_CONFIG, Jump("android_configure"))
action AndroidIfState(state, ANDROID_NO_KEY, Jump("android_configure"))
hovered tt.Action(CONFIGURE_TEXT)

add SPACER
Expand All @@ -410,15 +407,15 @@ screen android:

add SPACER

textbutton _("Build Package"):
textbutton _("Build Mod APK"):
action AndroidIfState(state, ANDROID_OK, AndroidBuild("android_build"))
hovered tt.Action(BUILD_TEXT)

textbutton _("Build & Install"):
textbutton _("Build Mod APK & Install"):
action AndroidIfState(state, ANDROID_OK, AndroidBuild("android_build_and_install"))
hovered tt.Action(BUILD_AND_INSTALL_TEXT)

textbutton _("Build, Install & Launch"):
textbutton _("Build Mod APK, Install & Launch"):
action AndroidIfState(state, ANDROID_OK, AndroidBuild("android_build_install_and_launch"))
hovered tt.Action(BUILD_INSTALL_AND_LAUNCH_TEXT)

Expand Down Expand Up @@ -474,7 +471,7 @@ screen android:
hovered tt.Action(CLEAN_TEXT)

textbutton _("Open Android Mod Guide"):
action OpenDirectory(config.basedir + "/templates/Android Mod Guide.pdf")
action OpenDirectory(config.gamedir + "/mmupdater/data/DDLC MT/Documentation/Android Mod Guide.pdf")
hovered tt.Action(GUIDE_TEXT)

add SPACER
Expand Down Expand Up @@ -513,6 +510,14 @@ label android_installsdk:
jump android


label android_keys:

python:
rapt.keys.generate_keys(MobileInterface("android"), project.current.path)

jump android


label android_configure:

python:
Expand Down
41 changes: 25 additions & 16 deletions launcher/game/androidstrings.rpy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


# This file contains strings used by RAPT, so the Ren'Py translation framework
# can find them. It's automatically generated by rapt/update_translations.py, and
# hence should not be changed by hand.
Expand All @@ -11,7 +11,7 @@ init python hide:
__("Updating project.")
__("Creating assets directory.")
__("Packaging internal data.")
__("Building the mod using gradle.")
__("I'm using Gradle to build the package.")
__("The build seems to have failed.")
__("I'm installing the bundle.")
__("Installing the bundle appears to have failed.")
Expand All @@ -29,37 +29,46 @@ init python hide:
__("{} is a Java keyword, and can't be used as part of a package name.")
__("What is the application's version?\n\nThis should be the human-readable version that you would present to a person. It must contain only numbers and dots.")
__("The version number must contain only numbers and dots.")
__("How much RAM do you want to allocate to Gradle?\n\nThis must be a positive integer number.")
__("The RAM size must contain only numbers.")
__("How much RAM (in GB) do you want to allocate to Gradle?\nThis must be a positive integer number.")
__("The RAM size must contain only numbers and be positive.")
__("How would you like your application to be displayed?")
__("In landscape orientation.")
__("In portrait orientation.")
__("In the user's preferred orientation.")
__("Which app store would you like to support in-app purchasing through?")
__("Google Play.")
__("Amazon App Store.")
__("Both, in one app.")
__("Neither.")
__("Do you want to automatically update the Java source code?")
__("Yes. This is the best choice for most projects.")
__("No. This may require manual updates when Ren'Py or the project configuration changes.")
__("Unknown configuration variable: {}")
__("Compiling a short test program, to see if you have a working JDK on your system.")
__("Unable to use javac to compile a test file. If you haven't installed the Java Development Kit yet, please download it from:\n\n{a=https://adoptium.net/?variant=openjdk8}https://adoptium.net/?variant=openjdk8{/a}\n\nThe JDK is different from the JRE, so it's possible you have Java without having the JDK. Please make sure you installed the 'JavaSoft (Oracle) registry keys'.\n\nWithout a working JDK, I can't continue.")
__("I'm compiling a short test program, to see if you have a working JDK on your system.")
__("I was unable to use javac to compile a test file. If you haven't installed the Java Development Kit yet, please download it from:\n\n{a=https://adoptium.net/?variant=openjdk8}https://adoptium.net/?variant=openjdk8{/a}\n\nThe JDK is different from the JRE, so it's possible you have Java without having the JDK. Please make sure you installed the 'JavaSoft (Oracle) registry keys'.\n\nWithout a working JDK, I can't continue.")
__("The version of Java on your computer does not appear to be JDK 8, which is the only version supported by the Android SDK. If you need to install JDK 8, you can download it from:\n\n{a=https://adoptium.net/?variant=openjdk8}https://adoptium.net/?variant=openjdk8{/a}\n\nYou can also set the JAVA_HOME environment variable to use a different version of Java.")
__("The JDK is present and working. Good!")
__("The Android SDK has already been unpacked.")
__("Do you accept the Android SDK Terms and Conditions?")
__("Downloading the Android SDK. This might take a while.")
__("Extracting the Android SDK.")
__("Finished unpacking the Android SDK.")
__("Downloading and installing the required Android packages. This might take a while.")
__("Unable to accept the Android licenses.")
__("Unable to accept the Android licenses.")
__("Unable to install the required Android packages.")
__("Finished installing the required Android packages.")
__("I'm downloading the Android SDK. This might take a while.")
__("I'm extracting the Android SDK.")
__("I've finished unpacking the Android SDK.")
__("I'm about to download and install the required Android packages. This might take a while.")
__("I was unable to accept the Android licenses.")
__("I was unable to accept the Android licenses.")
__("I was unable to install the required Android packages.")
__("I've finished installing the required Android packages.")
__("It looks like you're ready to start packaging games.")
__("Please enter your name or the name of your organization.")
__("I found an android.keystore file in the rapt directory. Do you want to use this file?")
__("I can create an application signing key for you. This key is required to create Universal APK for sideloading and stores other than Google Play.\n\nDo you want to create a key?")
__("I will create the key in the android.keystore file.\n\nYou need to back this file up. If you lose it, you will not be able to upgrade your application.\n\nYou also need to keep the key safe. If evil people get this file, they could make fake versions of your application, and potentially steal your users' data.\n\nWill you make a backup of android.keystore, and keep it in a safe place?")
__("\n\nSaying 'No' will prevent key creation.")
__("Could not create android.keystore. Is keytool in your path?")
__("Finished creating android.keystore. Please back it up, and keep it in a safe place.")
__("I've finished creating android.keystore. Please back it up, and keep it in a safe place.")
__("I found a bundle.keystore file in the rapt directory. Do you want to use this file?")
__("I can create a bundle signing key for you. This key is required to build an Android App Bundle (AAB) for upload to Google Play.\n\nDo you want to create a key?")
__("I will create the key in the bundle.keystore file.\n\nYou need to back this file up. If you lose it, you will not be able to upgrade your application.\n\nYou also need to keep the key safe. If evil people get this file, they could make fake versions of your application, and potentially steal your users' data.\n\nWill you make a backup of bundle.keystore, and keep it in a safe place?")
__("\n\nSaying 'No' will prevent key creation.")
__("Could not create bundle.keystore. Is keytool in your path?")
__("I've opened the directory containing android.keystore and bundle.keystore. Please back them up, and keep them in a safe place.")
__("It looks like you're ready to start packaging games.")
2 changes: 1 addition & 1 deletion launcher/game/archiver.rpy
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2004-2022 Tom Rothamel <[email protected]>
# Copyright 2004-2023 Tom Rothamel <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
Expand Down
4 changes: 2 additions & 2 deletions launcher/game/cache/shaders.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
renpy.alpha renpy.texture
renpy.geometry renpy.solid
renpy.solid
renpy.alpha renpy.geometry renpy.texture
renpy.geometry renpy.texture
renpy.alpha renpy.geometry renpy.texture
renpy.solid
renpy.texture
renpy.ftl
Expand Down
2 changes: 1 addition & 1 deletion launcher/game/change_icon.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2004-2022 Tom Rothamel <[email protected]>
# Copyright 2004-2023 Tom Rothamel <[email protected]>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
Expand Down
Loading