# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
init python:
import shutil
import os
import time
import re
def check_language_support():
language = _preferences.language
new = False
legacy = False
# Check for a translation of the words "New GUI Interface".
if (language is None) or (__("New GUI Interface") != "New GUI Interface"):
new = True
try:
if (language is None) or os.path.exists(os.path.join(config.renpy_base, "templates", language)):
legacy = True
except Exception:
pass
if new and legacy:
store.language_support = _("Both interfaces have been translated to your language.")
elif new:
store.language_support = _("Only the new GUI has been translated to your language.")
elif legacy:
store.language_support = _("Only the legacy theme interface has been translated to your language.")
else:
store.language_support = _("Neither interface has been translated to your language.")
label new_project:
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."))
python:
if persistent.legacy:
check_language_support()
gui_kind = interface.choice(
_("Which interface would you like to use? The new GUI has a modern look, supports wide screens and mobile devices, and is easier to customize. Legacy themes might be necessary to work with older example code.\n\n[language_support!t]\n\nIf in doubt, choose the new GUI, then click Continue on the bottom-right."),
new_project_language = __("{#language name and font}")
gui_kind = "new_gui_project"
# When translating this, feel free to replace [new_project_language] with the translation of your language.
interface.info(_("You will be creating an [new_project_language]{#this substitution may be localized} language project. Change the launcher language in preferences to create a project in another language."), cancel=Jump("front_page"))
python:
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)
text _("Please select a template to use for your new project. The template sets the default font and the user interface language. If your language is not supported, choose 'english'.")