Compare commits
1 Commits
master
..
6.17.2.319
| Author | SHA1 | Date | |
|---|---|---|---|
| a0a58c9129 |
@@ -1,176 +1,54 @@
|
||||
# macOS-related files
|
||||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
|
||||
# Windows-related files
|
||||
Thumbs.db
|
||||
Thumbs.db:encryptable
|
||||
ehthumbs.db
|
||||
ehthumbs_vista.db
|
||||
[Dd]esktop.ini
|
||||
|
||||
# Python related files.
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.egg-info
|
||||
|
||||
# Editor/tool files.
|
||||
*~
|
||||
*.bak
|
||||
.gdb_history
|
||||
|
||||
# Compiled Ren'Py files.
|
||||
*.rpyc
|
||||
*.rpyb
|
||||
*.rpymc
|
||||
*.pyc
|
||||
*.pyo
|
||||
|
||||
*~
|
||||
*.bak
|
||||
|
||||
saves
|
||||
tmp
|
||||
cache
|
||||
|
||||
# Ren'Py log files.
|
||||
log.txt
|
||||
errors.txt
|
||||
traceback.txt
|
||||
lint.txt
|
||||
/errors.txt
|
||||
/traceback.txt
|
||||
|
||||
# Created directories.
|
||||
saves/
|
||||
tmp/
|
||||
cache/
|
||||
|
||||
# Executables.
|
||||
/renpy.exe
|
||||
/renpy2.exe
|
||||
/renpy3.exe
|
||||
/renpy-32.exe
|
||||
|
||||
/renpy.sh
|
||||
/renpy2.sh
|
||||
/renpy3.sh
|
||||
styles.txt
|
||||
|
||||
/android
|
||||
/build
|
||||
/dist
|
||||
/dists
|
||||
/renpy.app
|
||||
/renpy2.app
|
||||
/renpy3.app
|
||||
|
||||
/7z.sfx
|
||||
|
||||
# Libraries.
|
||||
/lib
|
||||
|
||||
# Platforms.
|
||||
/rapt
|
||||
/rapt2
|
||||
/rapt3
|
||||
|
||||
/renios
|
||||
/renios2
|
||||
/renios3
|
||||
|
||||
/web
|
||||
/web2
|
||||
/web3
|
||||
|
||||
# Docs.
|
||||
/sphinx/source/inc
|
||||
/sphinx/source/thequestion.rst
|
||||
/doc
|
||||
/doc-web
|
||||
/LICENSE.txt
|
||||
|
||||
# Gui template.
|
||||
/gui/game/gui
|
||||
|
||||
# Editors.
|
||||
/jedit
|
||||
/atom
|
||||
/vscode
|
||||
|
||||
# Generated source.
|
||||
/renpy/vc_version.py
|
||||
/module/gen/
|
||||
/module/gen3/
|
||||
/module/gen-static/
|
||||
/module/gen3-static/
|
||||
/tutorial/game/tutorial_director.rpy
|
||||
|
||||
# Module build.
|
||||
/module/build
|
||||
/module/dist
|
||||
/module/emscripten-static
|
||||
|
||||
# Download target.
|
||||
/dl
|
||||
|
||||
# Pygame_sdl2.
|
||||
/pygame_sdl2
|
||||
|
||||
# Updater.
|
||||
update.pem
|
||||
|
||||
# Steam.
|
||||
steam_appid.txt
|
||||
/steamapi.py
|
||||
|
||||
# Android.
|
||||
*.keystore
|
||||
|
||||
# Type analysis.
|
||||
/typings
|
||||
|
||||
# Live2D
|
||||
cubism
|
||||
CubismSdkForNative-4-*.zip
|
||||
|
||||
# Created files.
|
||||
/lint.txt
|
||||
/renpy.code
|
||||
/*testing*
|
||||
/screenshot*
|
||||
.android.json
|
||||
/renpy.exe
|
||||
/lib
|
||||
/lib.old
|
||||
/doc
|
||||
/.pydevproject
|
||||
/.pydevproject.bak
|
||||
/.project
|
||||
/.settings
|
||||
/LICENSE.txt
|
||||
/templates/english/README.html
|
||||
/the_question/README.html
|
||||
/tutorial/README.html
|
||||
/renpy/angle/*.pyx
|
||||
/renpy/angle/*.pxd
|
||||
/renpy-ppc.zip
|
||||
/module/build
|
||||
/module/gen
|
||||
/editra
|
||||
/launcher/game/theme
|
||||
/launcher/game/script_version.rpy
|
||||
|
||||
# Old files.
|
||||
/0old
|
||||
|
||||
# Works in progress, throwaway scripts, etc.
|
||||
/scratch
|
||||
/*-dists
|
||||
/c
|
||||
/cg
|
||||
/.vscode/launch.json
|
||||
/.vscode/tasks.json
|
||||
|
||||
|
||||
# Pyi Files (generated by scripts/generate_pyi.py)
|
||||
renpy/audio/filter.pyi
|
||||
renpy/audio/renpysound.pyi
|
||||
renpy/display/accelerator.pyi
|
||||
renpy/display/matrix.pyi
|
||||
renpy/display/quaternion.pyi
|
||||
renpy/display/render.pyi
|
||||
renpy/encryption.pyi
|
||||
renpy/gl2/gl2draw.pyi
|
||||
renpy/gl2/gl2mesh.pyi
|
||||
renpy/gl2/gl2mesh2.pyi
|
||||
renpy/gl2/gl2mesh3.pyi
|
||||
renpy/gl2/gl2model.pyi
|
||||
renpy/gl2/gl2polygon.pyi
|
||||
renpy/gl2/gl2shader.pyi
|
||||
renpy/gl2/gl2texture.pyi
|
||||
renpy/gl2/live2dmodel.pyi
|
||||
renpy/lexersupport.pyi
|
||||
renpy/pydict.pyi
|
||||
renpy/style.pyi
|
||||
renpy/style.pyi
|
||||
renpy/styledata/style_activate_functions.pyi
|
||||
renpy/styledata/style_functions.pyi
|
||||
renpy/styledata/style_hover_functions.pyi
|
||||
renpy/styledata/style_idle_functions.pyi
|
||||
renpy/styledata/style_insensitive_functions.pyi
|
||||
renpy/styledata/style_selected_activate_functions.pyi
|
||||
renpy/styledata/style_selected_functions.pyi
|
||||
renpy/styledata/style_selected_hover_functions.pyi
|
||||
renpy/styledata/style_selected_idle_functions.pyi
|
||||
renpy/styledata/style_selected_insensitive_functions.pyi
|
||||
renpy/styledata/styleclass.pyi
|
||||
renpy/styledata/stylesets.pyi
|
||||
renpy/text/ftfont.pyi
|
||||
renpy/text/hbfont.pyi
|
||||
renpy/text/textsupport.pyi
|
||||
renpy/text/texwrap.pyi
|
||||
renpy/uguu/gl.pyi
|
||||
renpy/uguu/uguu.pyi
|
||||
dl
|
||||
renpy/vc_version.py
|
||||
.externalToolBuilders
|
||||
rapt
|
||||
|
||||
@@ -1,284 +0,0 @@
|
||||
{
|
||||
"files.watcherExclude": {
|
||||
"**/renpy/0old/**": true,
|
||||
"**/renpy/atom/**": true,
|
||||
"**/renpy/cubism/**": true,
|
||||
"**/renpy/dists/**": true,
|
||||
"**/renpy/dl/**": true,
|
||||
"**/renpy/doc/**": true,
|
||||
"**/renpy/doc-web/**": true,
|
||||
"**/renpy/jedit/**": true,
|
||||
"**/renpy/renpy*.app/**": true,
|
||||
"**/renpy/tmp/**": true,
|
||||
"**/renpy/web/**": true
|
||||
},
|
||||
"files.exclude": {
|
||||
"0old": true,
|
||||
"**-dists": true,
|
||||
"**/*.pyc": true,
|
||||
"**/*.pyo": true,
|
||||
"**/*.rpmc": true,
|
||||
"**/*.rpyc": true,
|
||||
"**/__pycache__": true,
|
||||
"**/screenshot-*": true,
|
||||
"7z.sfx": true,
|
||||
"atom": true,
|
||||
"cubism": true,
|
||||
"dl": true,
|
||||
"doc": true,
|
||||
"doc-web": true,
|
||||
"jedit": true,
|
||||
"lib*": true,
|
||||
"live2d": true,
|
||||
"rapt*": true,
|
||||
"renios*": true,
|
||||
"renpy*.app": true,
|
||||
"renpy*.exe": true,
|
||||
"tmp": true,
|
||||
"vscode": true,
|
||||
"web": true,
|
||||
"web2": true,
|
||||
"web3": true,
|
||||
"**/*.rpa": true,
|
||||
"**/*.rpymc": true,
|
||||
"**/cache/": true,
|
||||
"renpy/audio/filter.pyi": true,
|
||||
"renpy/audio/renpysound.pyi": true,
|
||||
"renpy/display/accelerator.pyi": true,
|
||||
"renpy/display/matrix.pyi": true,
|
||||
"renpy/display/quaternion.pyi": true,
|
||||
"renpy/display/render.pyi": true,
|
||||
"renpy/encryption.pyi": true,
|
||||
"renpy/gl2/gl2draw.pyi": true,
|
||||
"renpy/gl2/gl2mesh.pyi": true,
|
||||
"renpy/gl2/gl2mesh2.pyi": true,
|
||||
"renpy/gl2/gl2mesh3.pyi": true,
|
||||
"renpy/gl2/gl2model.pyi": true,
|
||||
"renpy/gl2/gl2polygon.pyi": true,
|
||||
"renpy/gl2/gl2shader.pyi": true,
|
||||
"renpy/gl2/gl2texture.pyi": true,
|
||||
"renpy/gl2/live2dmodel.pyi": true,
|
||||
"renpy/lexersupport.pyi": true,
|
||||
"renpy/pydict.pyi": true,
|
||||
"renpy/style.pyi": true,
|
||||
"renpy/styledata/style_activate_functions.pyi": true,
|
||||
"renpy/styledata/style_functions.pyi": true,
|
||||
"renpy/styledata/style_hover_functions.pyi": true,
|
||||
"renpy/styledata/style_idle_functions.pyi": true,
|
||||
"renpy/styledata/style_insensitive_functions.pyi": true,
|
||||
"renpy/styledata/style_selected_activate_functions.pyi": true,
|
||||
"renpy/styledata/style_selected_functions.pyi": true,
|
||||
"renpy/styledata/style_selected_hover_functions.pyi": true,
|
||||
"renpy/styledata/style_selected_idle_functions.pyi": true,
|
||||
"renpy/styledata/style_selected_insensitive_functions.pyi": true,
|
||||
"renpy/styledata/styleclass.pyi": true,
|
||||
"renpy/styledata/stylesets.pyi": true,
|
||||
"renpy/text/ftfont.pyi": true,
|
||||
"renpy/text/hbfont.pyi": true,
|
||||
"renpy/text/textsupport.pyi": true,
|
||||
"renpy/text/texwrap.pyi": true,
|
||||
"renpy/uguu/gl.pyi": true,
|
||||
"renpy/uguu/uguu.pyi": true
|
||||
},
|
||||
"python.languageServer": "Pylance",
|
||||
"python.analysis.typeCheckingMode": "basic",
|
||||
"python.analysis.diagnosticMode": "workspace",
|
||||
"python.linting.pylintEnabled": false,
|
||||
"python.analysis.diagnosticSeverityOverrides": {
|
||||
"reportMissingModuleSource": "none"
|
||||
},
|
||||
"esbonio.server.enabled": true,
|
||||
"esbonio.sphinx.confDir": "",
|
||||
"renpy.excludeCompiledFilesFromWorkspace": true,
|
||||
"renpy.watchFoldersForChanges": false,
|
||||
"renpy.warnOnInvalidVariableNames": "Disabled",
|
||||
"renpy.warnOnInvalidFilenameIssues": "Disabled",
|
||||
"renpy.warnOnIndentationAndSpacingIssues": "Disabled",
|
||||
"editor.tokenColorCustomizations": {
|
||||
"[*Light*]": {
|
||||
"textMateRules": [
|
||||
{
|
||||
"scope": "ref.matchtext",
|
||||
"settings": {
|
||||
"foreground": "#000"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"[*Dark*]": {
|
||||
"textMateRules": [
|
||||
{
|
||||
"scope": "ref.matchtext",
|
||||
"settings": {
|
||||
"foreground": "#fff"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"textMateRules": [
|
||||
{
|
||||
"scope": "renpy.meta.plain",
|
||||
"settings": {
|
||||
"fontStyle": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.i",
|
||||
"settings": {
|
||||
"fontStyle": "italic"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.b",
|
||||
"settings": {
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": [
|
||||
"renpy.meta.u",
|
||||
"renpy.meta.a"
|
||||
],
|
||||
"settings": {
|
||||
"fontStyle": "underline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.s",
|
||||
"settings": {
|
||||
"fontStyle": "strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.i renpy.meta.b",
|
||||
"settings": {
|
||||
"fontStyle": "italic bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.i renpy.meta.u",
|
||||
"settings": {
|
||||
"fontStyle": "italic underline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.i renpy.meta.s",
|
||||
"settings": {
|
||||
"fontStyle": "italic strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.b renpy.meta.u",
|
||||
"settings": {
|
||||
"fontStyle": "bold underline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.b renpy.meta.s",
|
||||
"settings": {
|
||||
"fontStyle": "bold strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.u renpy.meta.s",
|
||||
"settings": {
|
||||
"fontStyle": "underline strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.i renpy.meta.b renpy.meta.u",
|
||||
"settings": {
|
||||
"fontStyle": "italic bold underline"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.i renpy.meta.b renpy.meta.s",
|
||||
"settings": {
|
||||
"fontStyle": "italic bold strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.i renpy.meta.u renpy.meta.s",
|
||||
"settings": {
|
||||
"fontStyle": "italic underline strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.b renpy.meta.u renpy.meta.s",
|
||||
"settings": {
|
||||
"fontStyle": "bold underline strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.i renpy.meta.b renpy.meta.u renpy.meta.s",
|
||||
"settings": {
|
||||
"fontStyle": "italic bold underline strikethrough"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.color.text",
|
||||
"settings": {
|
||||
"foreground": "#ffffff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.color.#f00",
|
||||
"settings": {
|
||||
"foreground": "#f00"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "text.notes.info",
|
||||
"settings": {
|
||||
"foreground": "#17a2b8",
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "text.notes.success",
|
||||
"settings": {
|
||||
"foreground": "#28a745",
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "text.notes.warning",
|
||||
"settings": {
|
||||
"foreground": "#ffc107",
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "text.notes.danger",
|
||||
"settings": {
|
||||
"foreground": "#dc3545",
|
||||
"fontStyle": "bold"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.color.#fff",
|
||||
"settings": {
|
||||
"foreground": "#fff"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.color.#fcc",
|
||||
"settings": {
|
||||
"foreground": "#fcc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.color.#cfc",
|
||||
"settings": {
|
||||
"foreground": "#cfc"
|
||||
}
|
||||
},
|
||||
{
|
||||
"scope": "renpy.meta.color.#c00",
|
||||
"settings": {
|
||||
"foreground": "#c00"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "2.0.0",
|
||||
"tasks": [
|
||||
{
|
||||
"label": "run.sh --build",
|
||||
"type": "shell",
|
||||
"command": "/home/tom/ab/renpy/run.sh --build",
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -2,51 +2,29 @@
|
||||
The Ren'Py Visual Novel Engine
|
||||
==============================
|
||||
|
||||
https://www.renpy.org
|
||||
|
||||
|
||||
Branches
|
||||
========
|
||||
|
||||
The following branches are the most interesting.
|
||||
|
||||
``fix``
|
||||
The fix branch is used for fixes to the current version of Ren'Py that do
|
||||
not require dangerous changes. The fix branch is also the source of the
|
||||
documentation on https://www.renpy.org/. This branch is automatically
|
||||
merged into master on a regular basis.
|
||||
|
||||
Pull requests that contain fixes or documentation improvements should be
|
||||
made to the fix branch. When a release is made, the master branch is
|
||||
copied to the fix branch.
|
||||
|
||||
``master``
|
||||
The master branch is where the main focus of development is. This branch
|
||||
will eventually become the next release of Ren'Py.
|
||||
|
||||
Pull requests that contain new features, that require incompatible changes,
|
||||
or major changes to Ren'Py's internals should be targeted at the master
|
||||
branch.
|
||||
http://www.renpy.org
|
||||
|
||||
Ren'Py development takes place on the ``master`` branch, and occasionally
|
||||
on feature branches.
|
||||
|
||||
Getting Started
|
||||
===============
|
||||
|
||||
Ren'Py depends on a number of Python modules written in Cython and C. For
|
||||
changes to Ren'Py that only involve Python modules, you can use the modules
|
||||
Ren'Py depends on a number of python modules written in Cython and C. For
|
||||
changes to Ren'Py that only involve python modules, you can use the modules
|
||||
found in the latest nightly build. Otherwise, you'll have to compile the
|
||||
modules yourself.
|
||||
|
||||
The development scripts assume a POSIX-like platform. The scripts should run
|
||||
on Linux or macOS, and can be made to run on Windows using an environment
|
||||
like MSYS.
|
||||
on Linux or Mac OS X, and can be made to run on Windows using an environment
|
||||
like Msys.
|
||||
|
||||
Nightly Build
|
||||
-------------
|
||||
|
||||
Nightly builds can be downloaded from:
|
||||
|
||||
https://nightly.renpy.org
|
||||
http://nightly.renpy.org
|
||||
|
||||
Note that the latest nightly build is at the bottom of the list. Once you've
|
||||
unpacked the nightly, change into this repository, and run::
|
||||
@@ -58,7 +36,7 @@ renpy.app, or renpy.exe, as appropriate for your platform.
|
||||
|
||||
If the current nightly build doesn't work, please wait 24 hours for a new
|
||||
build to occur. If that build still doesn't work, contact Tom (`pytom at bishoujo.us`,
|
||||
or @renpytom on Twitter/X) to find out what's wrong.
|
||||
or @renpytom on twitter) to find out what's wrong.
|
||||
|
||||
The ``doc`` symlink will dangle until documentation is built, as described
|
||||
below.
|
||||
@@ -67,63 +45,38 @@ Compiling the Modules
|
||||
----------------------
|
||||
|
||||
Building the modules requires you have the many dependencies installed on
|
||||
your system. On Ubuntu and Debian, these dependencies can be installed with
|
||||
the command::
|
||||
your system. On Ubuntu, these dependencies can be installed with the
|
||||
command::
|
||||
|
||||
sudo apt install virtualenvwrapper python3-dev libassimp-dev libavcodec-dev libavformat-dev \
|
||||
libswresample-dev libswscale-dev libharfbuzz-dev libfreetype6-dev libfribidi-dev libsdl2-dev \
|
||||
libsdl2-image-dev libsdl2-gfx-dev libsdl2-mixer-dev libsdl2-ttf-dev libjpeg-dev pkg-config
|
||||
apt-get install python-dev python-pygame libavcodec-dev libavformat-dev \
|
||||
libfreetype6-dev libglew1.6-dev libsdl1.2-dev libsdl-image1.2-dev \
|
||||
libfribidi-dev libswscale-dev libesd0-dev libpulse-dev
|
||||
|
||||
Ren'Py requires SDL_image 2.6 or greater. If your distribution doesn't include
|
||||
that version, you'll need to download it from:
|
||||
|
||||
https://github.com/libsdl-org/SDL_image/tree/SDL2
|
||||
Other platforms may have an equivalent command. Otherwise, you'll need to
|
||||
build `renpy-deps <https://github.com/renpy/renpy-deps>`_.
|
||||
|
||||
We strongly suggest installing the Ren'Py modules into a Python
|
||||
virtualenv. To create a new virtualenv, open a new terminal and run::
|
||||
virtualenv. `This page <http://dabapps.com/blog/introduction-to-pip-and-virtualenv-python/>`_
|
||||
describes how to install pip and the virtualenv tool, and set up a new virtualenv.
|
||||
|
||||
. /usr/share/virtualenvwrapper/virtualenvwrapper.sh
|
||||
mkvirtualenv renpy
|
||||
After activating the virtualenv, install cython::
|
||||
|
||||
To return to this virtualenv later, run::
|
||||
pip install -U cython
|
||||
|
||||
. /usr/share/virtualenvwrapper/virtualenvwrapper.sh
|
||||
workon renpy
|
||||
Next, set RENPY_DEPS_INSTALL To a \::-separated list of paths containing the
|
||||
dependencies, and RENPY_CYTHON to the name of the cython command::
|
||||
|
||||
After activating the virtualenv, install additional dependencies::
|
||||
export RENPY_DEPS_INSTALL=/usr::/usr/lib/x86_64-linux-gnu/
|
||||
export RENPY_CYTHON=cython
|
||||
|
||||
pip install -U setuptools cython future six typing pefile requests ecdsa
|
||||
|
||||
Then, install pygame_sdl2 by running the following commands::
|
||||
|
||||
git clone https://www.github.com/renpy/pygame_sdl2
|
||||
pushd pygame_sdl2
|
||||
python setup.py install
|
||||
popd
|
||||
|
||||
Finally, use setup.py to compile extension modules that support Ren'Py::
|
||||
Finally, change into the `modules` directory, and run::
|
||||
|
||||
python setup.py install
|
||||
|
||||
Ren'Py will be installed into the activated virtualenv. It can then be run
|
||||
using the command::
|
||||
|
||||
python renpy.py
|
||||
|
||||
|
||||
Other Platforms
|
||||
---------------
|
||||
|
||||
Where supported, Ren'Py will attempt to find include directories and library paths
|
||||
using pkg-config. If pkg-config is not present, include and library paths can be
|
||||
specified using CFLAGS and LDFLAGS.
|
||||
|
||||
If RENPY_CFLAGS is present in the environment and CFLAGS is not, setup.py
|
||||
will set CFLAGS to RENPY_CFLAGS. The same is true for RENPY_LDFLAGS,
|
||||
RENPY_CC, RENPY_CXX, and RENPY_LD.
|
||||
|
||||
Setup.py does not support cross-compiling. See https://github.com/renpy/renpy-build
|
||||
for software that cross-compiles Ren'Py for many platforms.
|
||||
python -O renpy.py
|
||||
|
||||
|
||||
Documentation
|
||||
@@ -134,10 +87,10 @@ Building
|
||||
|
||||
Building the documentation requires Ren'Py to work. You'll either need to
|
||||
link in a nightly build, or compile the modules as described above. You'll
|
||||
also need the `Sphinx <https://www.sphinx-doc.org>`_ documentation generator.
|
||||
also need the `Sphinx <http://sphinx-doc.org/>`_ documentation generator.
|
||||
If you have pip working, install Sphinx using::
|
||||
|
||||
pip install -U sphinx sphinx_rtd_theme sphinx_rtd_dark_mode
|
||||
pip install -U sphinx
|
||||
|
||||
Once Sphinx is installed, change into the ``sphinx`` directory inside the
|
||||
Ren'Py checkout and run::
|
||||
@@ -154,7 +107,7 @@ not edit the files in sphinx/source/inc directly, as they will be overwritten.
|
||||
Docstrings may include tags on the first few lines:
|
||||
|
||||
\:doc: `section` `kind`
|
||||
Indicates that this function should be documented. `section` gives
|
||||
Indicates that this functions should be documented. `section` gives
|
||||
the name of the include file the function will be documented in, while
|
||||
`kind` indicates the kind of object to be documented (one of ``function``,
|
||||
``method`` or ``class``. If omitted, `kind` will be auto-detected.
|
||||
@@ -179,15 +132,6 @@ For example::
|
||||
renpy.engine.warp_drive.engage(factor)
|
||||
|
||||
|
||||
Translating
|
||||
===========
|
||||
|
||||
For best practices when it comes to translating the launcher and template
|
||||
game, please read:
|
||||
|
||||
https://lemmasoft.renai.us/forums/viewtopic.php?p=321603#p321603
|
||||
|
||||
|
||||
Contributing
|
||||
============
|
||||
|
||||
@@ -195,9 +139,3 @@ For bug fixes, documentation improvements, and simple changes, just
|
||||
make a pull request. For more complex changes, it might make sense
|
||||
to file an issue first so we can discuss the design.
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
For the complete licensing terms, please read:
|
||||
|
||||
https://www.renpy.org/doc/html/license.html
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
This file contains the names, contact information, and notes about each
|
||||
language Ren'Py is translated in. When you're adding a translation or
|
||||
taking responsibility for a translation, please send a pull request updating
|
||||
this file.
|
||||
|
||||
|
||||
Pig Latin
|
||||
---------
|
||||
|
||||
This is an automatically-generated translation that lets me test various
|
||||
translation mechanisms.
|
||||
|
||||
* Tom Rothamel <pytom@bishoujo.us>
|
||||
|
||||
Russian
|
||||
---------
|
||||
|
||||
Translation to the Russian language. Most of translation provided by Project
|
||||
Gardares, especially Ria-kon.
|
||||
|
||||
* Project Gardares <guardares@gmail.com>
|
||||
|
||||
Malay
|
||||
---------
|
||||
|
||||
Translation to the Malay language. This will be translated to both writing
|
||||
systems used in Malay, namely the Latin-based Rumi script system and the
|
||||
Arabic-based Jawi script system, to provide compatibility in some areas where
|
||||
there is still exist Malay people who still cannot read their language in the
|
||||
newer Rumi script system, or refused to use it. The translation is being made
|
||||
as general and native as possible to cover the entire region that uses Malay
|
||||
language, this means native words take precedence over loanwords if and only if
|
||||
both native and loanwords exist and both are suitable in the context of use.
|
||||
|
||||
* Muhammad Nur Hidayat (MNH48) <translation@mnh48.moe>
|
||||
|
||||
Turkish
|
||||
---------
|
||||
|
||||
Translation to the Turkish language. Some terms and abbreviations (especially
|
||||
those related to coding) are deliberately left untranslated (or the original words
|
||||
are provided in brackets) to avoid confusion, relying on their common use in
|
||||
Turkish language and among Turkish developers.
|
||||
|
||||
* Arda Güler (WKFO) <ardaguler09@gmail.com>
|
||||
|
||||
Finnish
|
||||
---------
|
||||
|
||||
Translation to the Finnish language. Most terms have been translated,
|
||||
sometimes requiring some imagination to come up with suitable terms.
|
||||
The quality is not perfect, but it should make sense to any developer
|
||||
fluent in Finnish but not English. Adjustments will be made if better
|
||||
translations are suggested.
|
||||
|
||||
* Lari Liuhamo (Diapolo10) <lari.liuhamo+github116504@gmail.com>
|
||||
|
||||
Ukrainian
|
||||
---------
|
||||
|
||||
Translation to Ukrainian language. Most of translations provided by Veydzher.
|
||||
Feel free to report me any mistakes, fixes or improvements.
|
||||
|
||||
* Veydzher <veydzherdgswift008@gmail.com>
|
||||
@@ -1,31 +1,15 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
from renpy import version_tuple # @UnresolvedImport
|
||||
from renpy import version_tuple #@UnresolvedImport
|
||||
|
||||
branch = os.popen("git branch --show-current").read().strip()
|
||||
|
||||
SOURCE = [
|
||||
"/home/tom/ab/renpy",
|
||||
"/home/tom/ab/renpy-build-" + branch,
|
||||
"/home/tom/ab/pygame_sdl2",
|
||||
]
|
||||
|
||||
|
||||
from renpy.versions import generate_vc_version
|
||||
|
||||
version = generate_vc_version()["version"]
|
||||
short_version = version.rpartition(".")[0]
|
||||
major = version.partition(".")[0]
|
||||
print("Version", version)
|
||||
|
||||
if major == '7':
|
||||
SOURCE.append("/home/tom/ab/renpy-build-fix/renpyweb")
|
||||
version = ".".join(str(i) for i in version_tuple)
|
||||
short_version = ".".join(str(i) for i in version_tuple[:3])
|
||||
print "Version", version
|
||||
|
||||
ap = argparse.ArgumentParser()
|
||||
|
||||
@@ -33,78 +17,9 @@ ap.add_argument("--release", action="store_true")
|
||||
ap.add_argument("--prerelease", action="store_true")
|
||||
ap.add_argument("--experimental", action="store_true")
|
||||
ap.add_argument("--no-tag", "-n", action="store_true")
|
||||
ap.add_argument("--push-tags", action="store_true")
|
||||
ap.add_argument("--delete-tag")
|
||||
ap.add_argument("--github", action="store_true")
|
||||
ap.add_argument("--real", action="store_true")
|
||||
|
||||
args = ap.parse_args()
|
||||
|
||||
if not args.real:
|
||||
print("Did you want to use scripts/add_all.sh? If not, give --real.")
|
||||
sys.exit(1)
|
||||
|
||||
if args.github:
|
||||
subprocess.call([ "git", "push", "--tags" ])
|
||||
subprocess.call([ "gh", "release", "create", version, "--notes", "See https://www.renpy.org/release/" + short_version, "-t", "Ren'Py {}".format(short_version) ])
|
||||
|
||||
dn = "/home/tom/ab/renpy/dl/" + short_version
|
||||
|
||||
for fn in os.listdir(dn):
|
||||
|
||||
if fn == ".build_cache":
|
||||
continue
|
||||
|
||||
if fn.endswith(".update.gz"):
|
||||
continue
|
||||
|
||||
if fn.endswith(".update.json"):
|
||||
continue
|
||||
|
||||
if fn.startswith("updates.json"):
|
||||
continue
|
||||
|
||||
if fn.endswith(".zsync"):
|
||||
continue
|
||||
|
||||
if fn.endswith(".sums"):
|
||||
continue
|
||||
|
||||
subprocess.call([ "gh", "release", "upload", version, os.path.join(dn, fn) ])
|
||||
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
|
||||
if args.release:
|
||||
subprocess.check_call([ "/home/tom/ab/renpy/scripts/checksums.py", "/home/tom/ab/renpy/dl/" + short_version ])
|
||||
|
||||
if args.delete_tag:
|
||||
for i in SOURCE:
|
||||
|
||||
os.chdir(i)
|
||||
|
||||
if i == SOURCE[0]:
|
||||
tag = args.delete_tag
|
||||
else:
|
||||
tag = "renpy-" + args.delete_tag
|
||||
|
||||
subprocess.call([ "git", "tag", "-d", tag, ])
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
if args.push_tags:
|
||||
for i in SOURCE:
|
||||
os.chdir(i)
|
||||
|
||||
if subprocess.call([ "git", "push", "--tags" ]):
|
||||
print("Tags not pushed: {}".format(os.getcwd()))
|
||||
sys.exit(1)
|
||||
|
||||
print("Pushed tags.")
|
||||
sys.exit(0)
|
||||
|
||||
if args.release:
|
||||
links = [ "release", "prerelease", "experimental" ]
|
||||
tag = True
|
||||
@@ -118,29 +33,23 @@ else:
|
||||
links = [ ]
|
||||
tag = False
|
||||
|
||||
if args.no_tag:
|
||||
tag = False
|
||||
|
||||
links = [ i + "-" + major for i in links ]
|
||||
def check_dirty():
|
||||
if args.no_tag:
|
||||
return
|
||||
|
||||
if tag:
|
||||
for i in SOURCE:
|
||||
os.chdir(i)
|
||||
if subprocess.check_call([ "git", "diff", "--quiet", "HEAD" ]):
|
||||
print "Directory not checked in: {}".format(os.getcwd())
|
||||
sys.exit(1)
|
||||
|
||||
if subprocess.call([ "git", "diff", "--quiet", "HEAD" ]):
|
||||
print("Directory not checked in: {}".format(os.getcwd()))
|
||||
sys.exit(1)
|
||||
os.chdir("/home/tom/ab/renpy")
|
||||
check_dirty()
|
||||
|
||||
for i in SOURCE:
|
||||
os.chdir("/home/tom/ab/renpy/android")
|
||||
check_dirty()
|
||||
|
||||
os.chdir(i)
|
||||
|
||||
if i == SOURCE[0]:
|
||||
tag = version
|
||||
else:
|
||||
tag = "renpy-" + version
|
||||
|
||||
subprocess.check_call([ "git", "tag", "-a", tag, "-m", "Tagging Ren'Py + " + version + " release." ])
|
||||
if not args.no_tag:
|
||||
subprocess.check_call([ "git", "tag", "-a", "rapt-" + version, "-m", "Tagging RAPT release." ])
|
||||
|
||||
os.chdir("/home/tom/ab/renpy/dl")
|
||||
|
||||
@@ -149,13 +58,11 @@ for i in links:
|
||||
os.unlink(i)
|
||||
os.symlink(short_version, i)
|
||||
|
||||
os.chdir("/home/tom/ab/renpy")
|
||||
|
||||
if tag and not args.no_tag:
|
||||
cmd = [ "git", "tag", "-a", version, "-m", "Ren'Py " + version ]
|
||||
subprocess.check_call(cmd)
|
||||
|
||||
os.chdir("/home/tom/ab/website")
|
||||
subprocess.check_call("./upload.sh")
|
||||
|
||||
os.chdir("/home/tom/ab/renpy/sphinx")
|
||||
if args.release:
|
||||
subprocess.check_call("./upload.sh")
|
||||
elif args.prerelease:
|
||||
subprocess.check_call("./upload_dev.sh")
|
||||
|
||||
print("Version", version)
|
||||
|
||||
@@ -12,5 +12,4 @@ if [ "$1" != "" ]; then
|
||||
ln -s "$1/lib" "$ROOT/lib"
|
||||
ln -s "$1/renpy.app" "$ROOT"
|
||||
ln -s "$1/renpy.exe" "$ROOT"
|
||||
ln -s "$1/renpy.sh" "$ROOT"
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# This file sets up the normal python modules. It's used to help eclipse
|
||||
# do type detection, by providing an importable version of the cython code.
|
||||
|
||||
from distutils.core import setup
|
||||
|
||||
setup(
|
||||
packages=['renpy', 'renpy.gl', 'renpy.angle', 'renpy.display', 'renpy.audio', 'renpy.text', 'pysdlsound'],
|
||||
package_dir={ 'pysdlsound' : 'module' },
|
||||
)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
lib\windows-i686\python.exe -OO renpy.py
|
||||
pause
|
||||
@@ -1,11 +1,6 @@
|
||||
#!/home/tom/ab/renpy/lib/py3-linux-x86_64/python
|
||||
#!/home/tom/bin/renpython -O
|
||||
|
||||
# Builds a distribution of Ren'Py.
|
||||
from __future__ import division, absolute_import, with_statement, print_function, unicode_literals
|
||||
|
||||
import future.standard_library
|
||||
import future.utils
|
||||
PY2 = future.utils.PY2
|
||||
|
||||
import sys
|
||||
import os
|
||||
@@ -13,201 +8,140 @@ import compileall
|
||||
import shutil
|
||||
import subprocess
|
||||
import argparse
|
||||
import time
|
||||
import collections
|
||||
|
||||
try:
|
||||
from importlib import reload
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
import glob
|
||||
|
||||
ROOT = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
|
||||
def zip_rapt_symbols(destination):
|
||||
"""
|
||||
Zips up the rapt symbols.
|
||||
"""
|
||||
|
||||
import zipfile
|
||||
|
||||
if PY2:
|
||||
zf = zipfile.ZipFile(destination + "/android-native-symbols.zip", "w", zipfile.ZIP_DEFLATED)
|
||||
else:
|
||||
zf = zipfile.ZipFile(destination + "/android-native-symbols.zip", "w", zipfile.ZIP_DEFLATED, compresslevel=3)
|
||||
|
||||
for dn, dirs, files in os.walk("rapt/symbols"):
|
||||
for fn in dirs + files:
|
||||
fn = os.path.join(dn, fn)
|
||||
arcname = os.path.relpath(fn, "rapt/symbols")
|
||||
zf.write(fn, arcname)
|
||||
|
||||
zf.close()
|
||||
|
||||
def copy_tutorial_file(src, dest):
|
||||
"""
|
||||
Copies a file from src to dst. Lines between "# tutorial-only" and
|
||||
"# end-tutorial-only" comments are omitted from the copy.
|
||||
"""
|
||||
|
||||
sf = open(src, "rb")
|
||||
df = open(dest, "wb")
|
||||
|
||||
# True if we want to copy the line.
|
||||
copy = True
|
||||
|
||||
with open(src, "r") as sf, open(dest, "w") as df:
|
||||
for l in sf:
|
||||
if "# tutorial-only" in l:
|
||||
copy = False
|
||||
elif "# end-tutorial-only" in l:
|
||||
copy = True
|
||||
else:
|
||||
if copy:
|
||||
df.write(l)
|
||||
for l in sf:
|
||||
if "# tutorial-only" in l:
|
||||
copy = False
|
||||
elif "# end-tutorial-only" in l:
|
||||
copy = True
|
||||
else:
|
||||
if copy:
|
||||
df.write(l)
|
||||
|
||||
def link_directory(dirname):
|
||||
dn = os.path.join(ROOT, dirname)
|
||||
sf.close()
|
||||
df.close()
|
||||
|
||||
if os.path.exists(dn):
|
||||
os.unlink(dn)
|
||||
|
||||
if PY2:
|
||||
source = dn + "2"
|
||||
else:
|
||||
source = dn + "3"
|
||||
|
||||
if os.path.exists(source):
|
||||
os.symlink(source, dn)
|
||||
|
||||
def main():
|
||||
|
||||
start = time.time()
|
||||
if not sys.flags.optimize:
|
||||
raise Exception("Not running with python optimization.")
|
||||
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("version", nargs="?")
|
||||
ap.add_argument("version")
|
||||
ap.add_argument("--fast", action="store_true")
|
||||
ap.add_argument("--pygame", action="store", default=None)
|
||||
ap.add_argument("--no-rapt", action="store_true")
|
||||
ap.add_argument("--variant", action="store")
|
||||
ap.add_argument("--sign", action="store_true", default=True)
|
||||
ap.add_argument("--nosign", action="store_false", dest="sign")
|
||||
ap.add_argument("--notarized", action="store_true", dest="notarized")
|
||||
ap.add_argument("--vc-version-only", action="store_true")
|
||||
ap.add_argument("--link-directories", action="store_true")
|
||||
ap.add_argument("--append-version", action="store_true")
|
||||
ap.add_argument("--nightly", action="store_true")
|
||||
ap.add_argument("--print-version", action="store_true")
|
||||
|
||||
args = ap.parse_args()
|
||||
|
||||
link_directory("rapt")
|
||||
link_directory("renios")
|
||||
link_directory("web")
|
||||
# Revision updating is done early, so we can do it even if the rest
|
||||
# of the program fails.
|
||||
|
||||
import renpy.versions
|
||||
renpy.versions.generate_vc_version(nightly=args.nightly)
|
||||
# Determine the version. We grab the current revision, and if any
|
||||
# file has changed, bump it by 1.
|
||||
import renpy
|
||||
|
||||
if args.link_directories or args.vc_version_only:
|
||||
return
|
||||
match_version = ".".join(str(i) for i in renpy.version_tuple[:2]) #@UndefinedVariable
|
||||
zip_version = ".".join(str(i) for i in renpy.version_tuple[:3]) #@UndefinedVariable
|
||||
|
||||
if not os.path.abspath(sys.executable).startswith(ROOT + "/lib"):
|
||||
raise Exception("Distribute must be run with the python in lib/.")
|
||||
s = subprocess.check_output([ "git", "describe", "--tags", "--dirty", "--match", match_version ])
|
||||
parts = s.strip().split("-")
|
||||
|
||||
if args.sign:
|
||||
os.environ["RENPY_MAC_IDENTITY"] = "Developer ID Application: Tom Rothamel (XHTE5H7Z79)"
|
||||
if len(parts) <= 2:
|
||||
vc_version = 0
|
||||
else:
|
||||
vc_version = int(parts[1])
|
||||
|
||||
if PY2 and not sys.flags.optimize:
|
||||
raise Exception("Not running with python optimization.")
|
||||
if parts[-1] == "dirty":
|
||||
vc_version += 1
|
||||
|
||||
with open("renpy/vc_version.py", "w") as f:
|
||||
f.write("vc_version = {}".format(vc_version))
|
||||
|
||||
try:
|
||||
vc_version_base = os.path.splitext(renpy.vc_version.__file__)[0]
|
||||
reload(sys.modules['renpy.vc_version']) #@UndefinedVariable
|
||||
except:
|
||||
import renpy.vc_version # @UnusedImport
|
||||
|
||||
# Delete the .pyc and .pyo files, as reload can choose one of them instead
|
||||
# of the new .py file.
|
||||
for fn in [ vc_version_base + ".pyc", vc_version_base + ".pyo" ]:
|
||||
if os.path.exists(fn):
|
||||
os.unlink(fn)
|
||||
|
||||
reload(renpy.vc_version)
|
||||
except Exception:
|
||||
import renpy.vc_version
|
||||
|
||||
# A normal reload is fine, as renpy/__init__.py won't change.
|
||||
reload(renpy)
|
||||
|
||||
if args.print_version:
|
||||
print(renpy.version_only)
|
||||
return
|
||||
|
||||
if args.version is None:
|
||||
if args.nightly:
|
||||
args.version = renpy.version_only
|
||||
else:
|
||||
args.version = ".".join(str(i) for i in renpy.version_tuple[:-1])
|
||||
|
||||
if args.append_version:
|
||||
args.version += "-" + renpy.version_only
|
||||
reload(sys.modules['renpy'])
|
||||
|
||||
# Check that the versions match.
|
||||
full_version = renpy.version_only # @UndefinedVariable
|
||||
full_version = ".".join(str(i) for i in renpy.version_tuple) #@UndefinedVariable
|
||||
if args.version != "renpy-experimental" \
|
||||
and not args.version.startswith("renpy-nightly-") \
|
||||
and not full_version.startswith(args.version):
|
||||
|
||||
if "-" not in args.version \
|
||||
and not full_version.startswith(args.version):
|
||||
raise Exception("The command-line and Ren'Py versions do not match.")
|
||||
|
||||
os.environ['RENPY_BUILD_VERSION'] = args.version
|
||||
|
||||
# The destination directory.
|
||||
destination = os.path.join("dl", args.version)
|
||||
|
||||
if args.variant:
|
||||
destination += "-" + args.variant
|
||||
print "Version {} ({})".format(args.version, full_version)
|
||||
|
||||
if os.path.exists(os.path.join(destination, "checksums.txt")):
|
||||
raise Exception("The checksums.txt file exists.")
|
||||
|
||||
print("Version {} ({})".format(args.version, full_version))
|
||||
|
||||
if sys.version_info[0] >= 3:
|
||||
renpy_sh = "./renpy3.sh"
|
||||
else:
|
||||
renpy_sh = "./renpy2.sh"
|
||||
# Copy over the screens, to keep them up to date.
|
||||
copy_tutorial_file("tutorial/game/screens.rpy", "templates/english/game/screens.rpy")
|
||||
|
||||
# Compile all the python files.
|
||||
compileall.compile_dir("renpy/", ddir="renpy/", force=True, quiet=1)
|
||||
compileall.compile_dir("renpy/", ddir="renpy/", force=1, quiet=1)
|
||||
|
||||
# Generate launcher/game/script_version.rpy
|
||||
with open("launcher/game/script_version.rpy", "w") as f:
|
||||
f.write("init -999 python:\n")
|
||||
f.write(" config.script_version = {!r}\n".format(renpy.version_tuple[:3])) # @UndefinedVariable
|
||||
|
||||
# Compile the various games.
|
||||
if not args.fast:
|
||||
for i in [ 'tutorial', 'launcher', 'the_question' ]:
|
||||
print("Compiling", i)
|
||||
subprocess.check_call([renpy_sh, i, "compile" ])
|
||||
for i in [ 'tutorial', 'launcher', 'the_question' ] + glob.glob("templates/*"):
|
||||
print "Compiling", i
|
||||
subprocess.check_call(["./renpy.sh", i, "quit" ])
|
||||
|
||||
|
||||
# Kick off the rapt build.
|
||||
if not args.fast:
|
||||
out = open("/tmp/rapt_build.txt", "wb")
|
||||
|
||||
print("Cleaning RAPT.")
|
||||
print("Building RAPT.")
|
||||
|
||||
sys.path.insert(0, os.path.join(ROOT, "rapt", "buildlib"))
|
||||
android = os.path.abspath("android")
|
||||
|
||||
import rapt.interface # type: ignore
|
||||
import rapt.build # type: ignore
|
||||
rapt_build = subprocess.Popen([
|
||||
os.path.join(android, "build_renpy.sh"),
|
||||
"renpy",
|
||||
ROOT,
|
||||
],
|
||||
cwd = android,
|
||||
stdout=out,
|
||||
stderr=out)
|
||||
|
||||
interface = rapt.interface.Interface()
|
||||
rapt.build.distclean(interface)
|
||||
code = rapt_build.wait()
|
||||
|
||||
print("Compiling RAPT and renios.")
|
||||
|
||||
compileall.compile_dir("rapt/buildlib/", ddir="rapt/buildlib/", quiet=1)
|
||||
compileall.compile_dir("renios/buildlib/", ddir="renios/buildlib/", quiet=1)
|
||||
if code:
|
||||
print "RAPT build failed. The output is in /tmp/rapt_build.txt."
|
||||
sys.exit(1)
|
||||
else:
|
||||
print "RAPT build succeeded."
|
||||
|
||||
if not os.path.exists(destination):
|
||||
os.makedirs(destination)
|
||||
|
||||
zip_rapt_symbols(destination)
|
||||
|
||||
if args.fast:
|
||||
|
||||
cmd = [
|
||||
renpy_sh,
|
||||
"./renpy.sh",
|
||||
"launcher",
|
||||
"distribute",
|
||||
"launcher",
|
||||
@@ -220,7 +154,7 @@ def main():
|
||||
|
||||
else:
|
||||
cmd = [
|
||||
renpy_sh,
|
||||
"./renpy.sh",
|
||||
"launcher",
|
||||
"distribute",
|
||||
"launcher",
|
||||
@@ -228,13 +162,7 @@ def main():
|
||||
destination,
|
||||
]
|
||||
|
||||
if args.notarized:
|
||||
cmd.extend([
|
||||
"--macapp",
|
||||
"notarized/out",
|
||||
])
|
||||
|
||||
print()
|
||||
print
|
||||
subprocess.check_call(cmd)
|
||||
|
||||
# Sign the update.
|
||||
@@ -245,21 +173,12 @@ def main():
|
||||
os.path.join(destination, "updates.json"),
|
||||
])
|
||||
|
||||
# Package pygame_sdl2.
|
||||
if not args.fast:
|
||||
subprocess.check_call([
|
||||
"pygame_sdl2/setup.py",
|
||||
"-q",
|
||||
"egg_info",
|
||||
"--tag-build",
|
||||
"+renpy" + args.version.replace("+", "-"),
|
||||
"sdist",
|
||||
"-d",
|
||||
os.path.abspath(destination)
|
||||
])
|
||||
|
||||
# Write 7z.exe.
|
||||
sdk = "renpy-{}-sdk".format(args.version)
|
||||
sdk = "renpy-{}-sdk".format(zip_version)
|
||||
|
||||
if args.version.startswith("renpy-nightly-"):
|
||||
sdk = args.version + "-sdk"
|
||||
|
||||
if not args.fast:
|
||||
|
||||
@@ -280,8 +199,8 @@ def main():
|
||||
|
||||
sys.stdout.write("Creating -sdk.7z")
|
||||
|
||||
p = subprocess.Popen([ "7z", "a", sdk + ".7z", sdk], stdout=subprocess.PIPE)
|
||||
for i, _l in enumerate(p.stdout): # type: ignore
|
||||
p = subprocess.Popen([ "7z", "a", sdk +".7z", sdk], stdout=subprocess.PIPE)
|
||||
for i, _l in enumerate(p.stdout):
|
||||
if i % 10 != 0:
|
||||
continue
|
||||
|
||||
@@ -307,10 +226,7 @@ def main():
|
||||
if os.path.exists(sdk + ".7z.exe"):
|
||||
os.unlink(sdk + ".7z.exe")
|
||||
|
||||
print()
|
||||
|
||||
print("Distribute took {:.0f} seconds.".format(time.time() - start))
|
||||
|
||||
print
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
*.c
|
||||
*.so
|
||||
*.egg-info
|
||||
*.html
|
||||
build
|
||||
@@ -1 +0,0 @@
|
||||
../../renpy/cslots.pyx
|
||||
@@ -1,8 +0,0 @@
|
||||
from setuptools import setup, Extension
|
||||
|
||||
setup(
|
||||
name="cslots",
|
||||
version="1.0.0",
|
||||
ext_modules=[
|
||||
Extension("cslots", [ "cslots.pyx" ]),
|
||||
])
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
cython -a cslots.pyx
|
||||
pip install -e .
|
||||
python3 -m pytest
|
||||
@@ -1,262 +0,0 @@
|
||||
import sys
|
||||
import pickle
|
||||
|
||||
from cslots import Object, Slot, IntegerSlot
|
||||
|
||||
class C1(Object):
|
||||
str1 : str|None = None
|
||||
int1 : int = 0
|
||||
|
||||
def __init__(self, str1=None, int1=1):
|
||||
self.str1 = str1
|
||||
self.int1 = int1
|
||||
|
||||
class C2(C1):
|
||||
str2 : str|None = None
|
||||
int2 : int = 0
|
||||
|
||||
def __init__(self, str1=None, int1=0, str2=None, int2=0):
|
||||
self.str1 = str1
|
||||
self.int1 = int1
|
||||
self.str2 = str2
|
||||
self.int2 = int2
|
||||
|
||||
|
||||
def test_slot_count():
|
||||
assert C1._cslot_count == 2
|
||||
assert C2._cslot_count == 4
|
||||
|
||||
def test_slots():
|
||||
|
||||
o = C2()
|
||||
|
||||
assert o.str1 is None
|
||||
assert o.int1 == 0
|
||||
assert o.str2 is None
|
||||
assert o.int2 == 0
|
||||
|
||||
o.str1 = "hello"
|
||||
o.int1 = 42
|
||||
o.str2 = "world"
|
||||
o.int2 = 43
|
||||
|
||||
assert o.str1 == "hello"
|
||||
assert o.int1 == 42
|
||||
assert o.str2 == "world"
|
||||
assert o.int2 == 43
|
||||
|
||||
o.str1 = None
|
||||
o.int1 = 0
|
||||
o.str2 = None
|
||||
o.int2 = 0
|
||||
|
||||
assert o.str1 is None
|
||||
assert o.int1 == 0
|
||||
assert o.str2 is None
|
||||
assert o.int2 == 0
|
||||
|
||||
|
||||
def test_compress():
|
||||
|
||||
def expect_size(o, values, indexes):
|
||||
assert sys.getsizeof(o) == 32 + 8 * values + indexes
|
||||
|
||||
o = C2()
|
||||
|
||||
o.str1 = "hello"
|
||||
o.int1 = 42
|
||||
o.str2 = "world"
|
||||
o.int2 = 43
|
||||
expect_size(o, 4, 4)
|
||||
|
||||
o._compress()
|
||||
|
||||
assert o.str1 == "hello"
|
||||
assert o.int1 == 42
|
||||
assert o.str2 == "world"
|
||||
assert o.int2 == 43
|
||||
expect_size(o, 4, 4)
|
||||
|
||||
o = C2()
|
||||
|
||||
o.str2 = "world"
|
||||
o.int2 = 43
|
||||
|
||||
o._compress()
|
||||
|
||||
assert o.str1 is None
|
||||
assert o.int1 == 0
|
||||
assert o.str2 == "world"
|
||||
assert o.int2 == 43
|
||||
expect_size(o, 2, 4)
|
||||
|
||||
o = C2()
|
||||
o.str1 = "hello"
|
||||
|
||||
o._compress()
|
||||
|
||||
assert o.str1 == "hello"
|
||||
assert o.int1 == 0
|
||||
assert o.str2 is None
|
||||
assert o.int2 == 0
|
||||
expect_size(o, 1, 1)
|
||||
|
||||
|
||||
def test_decompress():
|
||||
|
||||
def expect_size(o, values, indexes):
|
||||
assert sys.getsizeof(o) == 32 + 8 * values + indexes
|
||||
|
||||
o = C2()
|
||||
|
||||
o.str1 = "hello"
|
||||
o.int1 = 42
|
||||
o.str2 = "world"
|
||||
o.int2 = 43
|
||||
expect_size(o, 4, 4)
|
||||
|
||||
o._compress()
|
||||
o._decompress()
|
||||
|
||||
assert o.str1 == "hello"
|
||||
assert o.int1 == 42
|
||||
assert o.str2 == "world"
|
||||
assert o.int2 == 43
|
||||
expect_size(o, 4, 4)
|
||||
|
||||
o = C2()
|
||||
|
||||
o.str2 = "world"
|
||||
o.int2 = 43
|
||||
|
||||
o._compress()
|
||||
o._decompress()
|
||||
|
||||
assert o.str1 is None
|
||||
assert o.int1 == 0
|
||||
assert o.str2 == "world"
|
||||
assert o.int2 == 43
|
||||
expect_size(o, 4, 4)
|
||||
|
||||
o = C2()
|
||||
o.str1 = "hello"
|
||||
|
||||
o._compress()
|
||||
o._decompress()
|
||||
|
||||
assert o.str1 == "hello"
|
||||
assert o.int1 == 0
|
||||
assert o.str2 is None
|
||||
assert o.int2 == 0
|
||||
expect_size(o, 4, 4)
|
||||
|
||||
|
||||
def test_kill():
|
||||
|
||||
o = C2()
|
||||
|
||||
o.str1 = "hello"
|
||||
o.int1 = 42
|
||||
o.str2 = "world"
|
||||
o.int2 = 43
|
||||
|
||||
o._kill()
|
||||
|
||||
assert o.str1 is None
|
||||
assert o.int1 == 0
|
||||
assert o.str2 is None
|
||||
assert o.int2 == 0
|
||||
|
||||
o = C2()
|
||||
|
||||
o.str2 = "world"
|
||||
o.int2 = 43
|
||||
|
||||
o._compress()
|
||||
o._kill()
|
||||
|
||||
assert o.str1 is None
|
||||
assert o.int1 == 0
|
||||
assert o.str2 is None
|
||||
assert o.int2 == 0
|
||||
|
||||
|
||||
def test_pickle():
|
||||
o = C2()
|
||||
|
||||
o.str1 = "hello"
|
||||
o.int1 = 42
|
||||
o.str2 = "world"
|
||||
o.int2 = 43
|
||||
|
||||
o = pickle.loads(pickle.dumps(o))
|
||||
|
||||
assert o.str1 == "hello"
|
||||
assert o.int1 == 42
|
||||
assert o.str2 == "world"
|
||||
assert o.int2 == 43
|
||||
|
||||
o = C2()
|
||||
|
||||
o.str2 = "world"
|
||||
o.int2 = 43
|
||||
|
||||
o = pickle.loads(pickle.dumps(o))
|
||||
|
||||
assert o.str1 is None
|
||||
assert o.int1 == 0
|
||||
assert o.str2 == "world"
|
||||
assert o.int2 == 43
|
||||
|
||||
o = C2()
|
||||
o.str1 = "hello"
|
||||
|
||||
o = pickle.loads(pickle.dumps(o))
|
||||
|
||||
assert o.str1 == "hello"
|
||||
assert o.int1 == 0
|
||||
assert o.str2 is None
|
||||
assert o.int2 == 0
|
||||
|
||||
|
||||
|
||||
def test_pickle_compressed():
|
||||
o = C2()
|
||||
|
||||
o.str1 = "hello"
|
||||
o.int1 = 42
|
||||
o.str2 = "world"
|
||||
o.int2 = 43
|
||||
|
||||
o._compress()
|
||||
|
||||
o = pickle.loads(pickle.dumps(o))
|
||||
|
||||
assert o.str1 == "hello"
|
||||
assert o.int1 == 42
|
||||
assert o.str2 == "world"
|
||||
assert o.int2 == 43
|
||||
|
||||
o = C2()
|
||||
|
||||
o.str2 = "world"
|
||||
o.int2 = 43
|
||||
|
||||
o._compress()
|
||||
o = pickle.loads(pickle.dumps(o))
|
||||
|
||||
assert o.str1 is None
|
||||
assert o.int1 == 0
|
||||
assert o.str2 == "world"
|
||||
assert o.int2 == 43
|
||||
|
||||
o = C2()
|
||||
o.str1 = "hello"
|
||||
|
||||
o._compress()
|
||||
o = pickle.loads(pickle.dumps(o))
|
||||
|
||||
assert o.str1 == "hello"
|
||||
assert o.int1 == 0
|
||||
assert o.str2 is None
|
||||
assert o.int2 == 0
|
||||
@@ -1,481 +0,0 @@
|
||||
################################################################################
|
||||
## Initialization
|
||||
################################################################################
|
||||
|
||||
## The init offset statement causes the initialization statements in this file
|
||||
## to run before init statements in any other file.
|
||||
init offset = -2
|
||||
|
||||
## Calling gui.init resets the styles to sensible default values, and sets the
|
||||
## width and height of the game.
|
||||
init python:
|
||||
gui.init(1280, 720)
|
||||
|
||||
## Enable checks for invalid or unstable properties in screens or transforms
|
||||
define config.check_conflicting_properties = True
|
||||
|
||||
|
||||
################################################################################
|
||||
## GUI Configuration Variables
|
||||
################################################################################
|
||||
|
||||
|
||||
## Colors ######################################################################
|
||||
##
|
||||
## The colors of text in the interface.
|
||||
|
||||
## An accent color used throughout the interface to label and highlight
|
||||
## text.
|
||||
define gui.accent_color = "#00b8c3"
|
||||
|
||||
## The color used for a text button when it is neither selected nor hovered.
|
||||
define gui.idle_color = "#888888"
|
||||
|
||||
## The small color is used for small text, which needs to be
|
||||
## brighter/darker to achieve the same effect.
|
||||
define gui.idle_small_color = "#aaaaaa"
|
||||
|
||||
## The color that is used for buttons and bars that are hovered.
|
||||
define gui.hover_color = Color(gui.accent_color).tint(.6)
|
||||
|
||||
## The color used for a text button when it is selected but not focused.
|
||||
## A button is selected if it is the current screen or preference value.
|
||||
define gui.selected_color = "#ffffff"
|
||||
|
||||
## The color used for a text button when it cannot be selected.
|
||||
define gui.insensitive_color = "#55555580"
|
||||
|
||||
## Colors used for the portions of bars that are not filled in. These are
|
||||
## not used directly, but are used when re-generating bar image files.
|
||||
define gui.muted_color = "#004e49"
|
||||
define gui.hover_muted_color = "#006e75"
|
||||
|
||||
## The colors used for dialogue and menu choice text.
|
||||
define gui.text_color = "#ffffff"
|
||||
define gui.interface_text_color = "#ffffff"
|
||||
|
||||
|
||||
## Fonts and Font Sizes ########################################################
|
||||
|
||||
## The font used for in-game text.
|
||||
define gui.text_font = "DejaVuSans.ttf"
|
||||
|
||||
## The font used for character names.
|
||||
define gui.name_text_font = "DejaVuSans.ttf"
|
||||
|
||||
## The font used for out-of-game text.
|
||||
define gui.interface_text_font = "DejaVuSans.ttf"
|
||||
|
||||
## The size of normal dialogue text.
|
||||
define gui.text_size = gui.scale(22)
|
||||
|
||||
## The size of character names.
|
||||
define gui.name_text_size = gui.scale(30)
|
||||
|
||||
## The size of text in the game's user interface.
|
||||
define gui.interface_text_size = gui.scale(22)
|
||||
|
||||
## The size of labels in the game's user interface.
|
||||
define gui.label_text_size = gui.scale(24)
|
||||
|
||||
## The size of text on the notify screen.
|
||||
define gui.notify_text_size = gui.scale(16)
|
||||
|
||||
## The size of the game's title.
|
||||
define gui.title_text_size = gui.scale(50)
|
||||
|
||||
|
||||
## Main and Game Menus #########################################################
|
||||
|
||||
## The images used for the main and game menus.
|
||||
define gui.main_menu_background = "gui/main_menu.png"
|
||||
define gui.game_menu_background = "gui/game_menu.png"
|
||||
|
||||
|
||||
## Dialogue ####################################################################
|
||||
##
|
||||
## These variables control how dialogue is displayed on the screen one line
|
||||
## at a time.
|
||||
|
||||
## The height of the textbox containing dialogue.
|
||||
define gui.textbox_height = gui.scale(185)
|
||||
|
||||
## The placement of the textbox vertically on the screen. 0.0 is the top, 0.5 is
|
||||
## center, and 1.0 is the bottom.
|
||||
define gui.textbox_yalign = 1.0
|
||||
|
||||
|
||||
## The placement of the speaking character's name, relative to the textbox.
|
||||
## These can be a whole number of pixels from the left or top, or 0.5 to center.
|
||||
define gui.name_xpos = gui.scale(240)
|
||||
define gui.name_ypos = gui.scale(0)
|
||||
|
||||
## The horizontal alignment of the character's name. This can be 0.0 for
|
||||
## left-aligned, 0.5 for centered, and 1.0 for right-aligned.
|
||||
define gui.name_xalign = 0.0
|
||||
|
||||
## The width, height, and borders of the box containing the character's
|
||||
## name, or None to automatically size it.
|
||||
define gui.namebox_width = None
|
||||
define gui.namebox_height = None
|
||||
|
||||
## The borders of the box containing the character's name, in left, top,
|
||||
## right, bottom order.
|
||||
define gui.namebox_borders = Borders(5, 5, 5, 5)
|
||||
|
||||
## If True, the background of the namebox will be tiled, if False, the background
|
||||
## of the namebox will be scaled.
|
||||
define gui.namebox_tile = False
|
||||
|
||||
|
||||
## The placement of dialogue relative to the textbox. These can be a whole
|
||||
## number of pixels relative to the left or top side of the textbox, or 0.5
|
||||
## to center.
|
||||
define gui.dialogue_xpos = gui.scale(268)
|
||||
define gui.dialogue_ypos = gui.scale(50)
|
||||
|
||||
## The maximum width of dialogue text, in pixels.
|
||||
define gui.dialogue_width = gui.scale(744)
|
||||
|
||||
## The horizontal alignment of the dialogue text. This can be 0.0 for
|
||||
## left-aligned, 0.5 for centered, and 1.0 for right-aligned.
|
||||
define gui.dialogue_text_xalign = 0.0
|
||||
|
||||
|
||||
## Buttons #####################################################################
|
||||
##
|
||||
## These variables, along with the image files in gui/button, control aspects
|
||||
## of how buttons are displayed.
|
||||
|
||||
## The width and height of a button, in pixels. If None, Ren'Py computes a size.
|
||||
define gui.button_width = None
|
||||
define gui.button_height = None
|
||||
|
||||
## The borders on each side of the button, in left, top, right, bottom order.
|
||||
define gui.button_borders = Borders(gui.scale(4), gui.scale(4), gui.scale(4), gui.scale(4))
|
||||
|
||||
## If True, the background image will be tiled. If False, the background image
|
||||
## will be linearly scaled.
|
||||
define gui.button_tile = False
|
||||
|
||||
## The font used by the button.
|
||||
define gui.button_text_font = gui.interface_text_font
|
||||
|
||||
## The size of the text used by the button.
|
||||
define gui.button_text_size = gui.interface_text_size
|
||||
|
||||
## The color of button text in various states.
|
||||
define gui.button_text_idle_color = gui.idle_color
|
||||
define gui.button_text_hover_color = gui.hover_color
|
||||
define gui.button_text_selected_color = gui.selected_color
|
||||
define gui.button_text_insensitive_color = gui.insensitive_color
|
||||
|
||||
## The horizontal alignment of the button text. (0.0 is left, 0.5 is center,
|
||||
## 1.0 is right).
|
||||
define gui.button_text_xalign = 0.0
|
||||
|
||||
|
||||
## These variables override settings for different kinds of buttons. Please
|
||||
## see the gui documentation for the kinds of buttons available, and what
|
||||
## each is used for.
|
||||
##
|
||||
## These customizations are used by the default interface:
|
||||
|
||||
define gui.radio_button_borders = Borders(gui.scale(18), gui.scale(4), gui.scale(4), gui.scale(4))
|
||||
|
||||
define gui.check_button_borders = Borders(gui.scale(18), gui.scale(4), gui.scale(4), gui.scale(4))
|
||||
|
||||
define gui.confirm_button_text_xalign = 0.5
|
||||
|
||||
define gui.page_button_borders = Borders(gui.scale(10), gui.scale(4), gui.scale(10), gui.scale(4))
|
||||
|
||||
define gui.quick_button_borders = Borders(gui.scale(10), gui.scale(4), gui.scale(10), gui.scale(0))
|
||||
define gui.quick_button_text_size = gui.scale(14)
|
||||
define gui.quick_button_text_idle_color = gui.idle_small_color
|
||||
define gui.quick_button_text_selected_color = gui.accent_color
|
||||
|
||||
## You can also add your own customizations, by adding properly-named variables.
|
||||
## For example, you can uncomment the following line to set the width of a
|
||||
## navigation button.
|
||||
|
||||
# define gui.navigation_button_width = 250
|
||||
|
||||
|
||||
## Choice Buttons ##############################################################
|
||||
##
|
||||
## Choice buttons are used in the in-game menus.
|
||||
|
||||
define gui.choice_button_width = gui.scale(790)
|
||||
define gui.choice_button_height = None
|
||||
define gui.choice_button_tile = False
|
||||
define gui.choice_button_borders = Borders(gui.scale(100), gui.scale(5), gui.scale(100), gui.scale(5))
|
||||
define gui.choice_button_text_font = gui.text_font
|
||||
define gui.choice_button_text_size = gui.text_size
|
||||
define gui.choice_button_text_xalign = 0.5
|
||||
define gui.choice_button_text_idle_color = "#cccccc"
|
||||
define gui.choice_button_text_hover_color = "#ffffff"
|
||||
define gui.choice_button_text_insensitive_color = "#444444"
|
||||
|
||||
|
||||
## File Slot Buttons ###########################################################
|
||||
##
|
||||
## A file slot button is a special kind of button. It contains a thumbnail
|
||||
## image, and text describing the contents of the save slot. A save slot
|
||||
## uses image files in gui/button, like the other kinds of buttons.
|
||||
|
||||
## The save slot button.
|
||||
define gui.slot_button_width = gui.scale(276)
|
||||
define gui.slot_button_height = gui.scale(206)
|
||||
define gui.slot_button_borders = Borders(gui.scale(10), gui.scale(10), gui.scale(10), gui.scale(10))
|
||||
define gui.slot_button_text_size = gui.scale(14)
|
||||
define gui.slot_button_text_xalign = 0.5
|
||||
define gui.slot_button_text_idle_color = gui.idle_small_color
|
||||
define gui.slot_button_text_selected_idle_color = gui.selected_color
|
||||
define gui.slot_button_text_selected_hover_color = gui.hover_color
|
||||
|
||||
## The width and height of thumbnails used by the save slots.
|
||||
define config.thumbnail_width = gui.scale(256)
|
||||
define config.thumbnail_height = gui.scale(144)
|
||||
|
||||
## The number of columns and rows in the grid of save slots.
|
||||
define gui.file_slot_cols = 3
|
||||
define gui.file_slot_rows = 2
|
||||
|
||||
|
||||
## Positioning and Spacing #####################################################
|
||||
##
|
||||
## These variables control the positioning and spacing of various user interface
|
||||
## elements.
|
||||
|
||||
## The position of the left side of the navigation buttons, relative
|
||||
## to the left side of the screen.
|
||||
define gui.navigation_xpos = gui.scale(40)
|
||||
|
||||
## The vertical position of the skip indicator.
|
||||
define gui.skip_ypos = gui.scale(10)
|
||||
|
||||
## The vertical position of the notify screen.
|
||||
define gui.notify_ypos = gui.scale(45)
|
||||
|
||||
## The spacing between menu choices.
|
||||
define gui.choice_spacing = gui.scale(22)
|
||||
|
||||
## Buttons in the navigation section of the main and game menus.
|
||||
define gui.navigation_spacing = gui.scale(4)
|
||||
|
||||
## Controls the amount of spacing between preferences.
|
||||
define gui.pref_spacing = gui.scale(10)
|
||||
|
||||
## Controls the amount of spacing between preference buttons.
|
||||
define gui.pref_button_spacing = gui.scale(0)
|
||||
|
||||
## The spacing between file page buttons.
|
||||
define gui.page_spacing = gui.scale(0)
|
||||
|
||||
## The spacing between file slots.
|
||||
define gui.slot_spacing = gui.scale(10)
|
||||
|
||||
## The position of the main menu text.
|
||||
define gui.main_menu_text_xalign = 1.0
|
||||
|
||||
|
||||
## Frames ######################################################################
|
||||
##
|
||||
## These variables control the look of frames that can contain user interface
|
||||
## components when an overlay or window is not present.
|
||||
|
||||
## Generic frames.
|
||||
define gui.frame_borders = Borders(gui.scale(4), gui.scale(4), gui.scale(4), gui.scale(4))
|
||||
|
||||
## The frame that is used as part of the confirm screen.
|
||||
define gui.confirm_frame_borders = Borders(gui.scale(40), gui.scale(40), gui.scale(40), gui.scale(40))
|
||||
|
||||
## The frame that is used as part of the skip screen.
|
||||
define gui.skip_frame_borders = Borders(gui.scale(16), gui.scale(5), gui.scale(50), gui.scale(5))
|
||||
|
||||
## The frame that is used as part of the notify screen.
|
||||
define gui.notify_frame_borders = Borders(gui.scale(16), gui.scale(5), gui.scale(40), gui.scale(5))
|
||||
|
||||
## Should frame backgrounds be tiled?
|
||||
define gui.frame_tile = False
|
||||
|
||||
|
||||
## Bars, Scrollbars, and Sliders ###############################################
|
||||
##
|
||||
## These control the look and size of bars, scrollbars, and sliders.
|
||||
##
|
||||
## The default GUI only uses sliders and vertical scrollbars.
|
||||
## All of the other bars are only used in creator-written screens.
|
||||
|
||||
## The height of horizontal bars, scrollbars, and sliders. The width of
|
||||
## vertical bars, scrollbars, and sliders.
|
||||
define gui.bar_size = gui.scale(25)
|
||||
define gui.scrollbar_size = gui.scale(12)
|
||||
define gui.slider_size = gui.scale(25)
|
||||
|
||||
## True if bar images should be tiled. False if they should be linearly scaled.
|
||||
define gui.bar_tile = False
|
||||
define gui.scrollbar_tile = False
|
||||
define gui.slider_tile = False
|
||||
|
||||
## Horizontal borders.
|
||||
define gui.bar_borders = Borders(gui.scale(4), gui.scale(4), gui.scale(4), gui.scale(4))
|
||||
define gui.scrollbar_borders = Borders(gui.scale(4), gui.scale(4), gui.scale(4), gui.scale(4))
|
||||
define gui.slider_borders = Borders(gui.scale(4), gui.scale(4), gui.scale(4), gui.scale(4))
|
||||
|
||||
## Vertical borders.
|
||||
define gui.vbar_borders = Borders(gui.scale(4), gui.scale(4), gui.scale(4), gui.scale(4))
|
||||
define gui.vscrollbar_borders = Borders(gui.scale(4), gui.scale(4), gui.scale(4), gui.scale(4))
|
||||
define gui.vslider_borders = Borders(gui.scale(4), gui.scale(4), gui.scale(4), gui.scale(4))
|
||||
|
||||
## What to do with unscrollable scrollbars in the game menu. "hide" hides them, while
|
||||
## None shows them.
|
||||
define gui.unscrollable = "hide"
|
||||
|
||||
|
||||
## History #####################################################################
|
||||
##
|
||||
## The history screen displays dialogue that the player has already dismissed.
|
||||
|
||||
## The number of blocks of dialogue history Ren'Py will keep.
|
||||
define config.history_length = 250
|
||||
|
||||
## The height of a history screen entry, or None to make the height variable
|
||||
## at the cost of performance.
|
||||
define gui.history_height = gui.scale(140)
|
||||
|
||||
## Additional space to add between history screen entries.
|
||||
define gui.history_spacing = 0
|
||||
|
||||
## The position, width, and alignment of the label giving the name of the
|
||||
## speaking character.
|
||||
define gui.history_name_xpos = gui.scale(155)
|
||||
define gui.history_name_ypos = 0
|
||||
define gui.history_name_width = gui.scale(155)
|
||||
define gui.history_name_xalign = 1.0
|
||||
|
||||
## The position, width, and alignment of the dialogue text.
|
||||
define gui.history_text_xpos = gui.scale(170)
|
||||
define gui.history_text_ypos = gui.scale(2)
|
||||
define gui.history_text_width = gui.scale(740)
|
||||
define gui.history_text_xalign = 0.0
|
||||
|
||||
|
||||
## NVL-Mode ###################################################################
|
||||
##
|
||||
## The NVL-mode screen displays the dialogue spoken by NVL-mode characters.
|
||||
|
||||
## The borders of the background of the NVL-mode background window.
|
||||
define gui.nvl_borders = Borders(0, gui.scale(10), 0, gui.scale(20))
|
||||
|
||||
## The maximum number of NVL-mode entries Ren'Py will display. When more
|
||||
## entries than this are to be show, the oldest entry will be removed.
|
||||
define gui.nvl_list_length = 6
|
||||
|
||||
## The height of an NVL-mode entry. Set this to None to have the entries
|
||||
## dynamically adjust height.
|
||||
define gui.nvl_height = gui.scale(115)
|
||||
|
||||
## The spacing between NVL-mode entries when gui.nvl_height is None, and
|
||||
## between NVL-mode entries and an NVL-mode menu.
|
||||
define gui.nvl_spacing = gui.scale(10)
|
||||
|
||||
## The position, width, and alignment of the label giving the name of the
|
||||
## speaking character.
|
||||
define gui.nvl_name_xpos = gui.scale(430)
|
||||
define gui.nvl_name_ypos = 0
|
||||
define gui.nvl_name_width = gui.scale(150)
|
||||
define gui.nvl_name_xalign = 1.0
|
||||
|
||||
## The position, width, and alignment of the dialogue text.
|
||||
define gui.nvl_text_xpos = gui.scale(450)
|
||||
define gui.nvl_text_ypos = gui.scale(8)
|
||||
define gui.nvl_text_width = gui.scale(590)
|
||||
define gui.nvl_text_xalign = 0.0
|
||||
|
||||
## The position, width, and alignment of nvl_thought text (the text said by
|
||||
## the nvl_narrator character.)
|
||||
define gui.nvl_thought_xpos = gui.scale(240)
|
||||
define gui.nvl_thought_ypos = gui.scale(0)
|
||||
define gui.nvl_thought_width = gui.scale(780)
|
||||
define gui.nvl_thought_xalign = 0.0
|
||||
|
||||
## The position of nvl menu_buttons.
|
||||
define gui.nvl_button_xpos = gui.scale(450)
|
||||
define gui.nvl_button_xalign = 0.0
|
||||
|
||||
|
||||
## Localization ################################################################
|
||||
|
||||
## This controls where a line break is permitted. The default is suitable for
|
||||
## most languages. A list of available values can be found at
|
||||
## https://www.renpy.org/doc/html/style_properties.html#style-property-language
|
||||
|
||||
define gui.language = "unicode"
|
||||
|
||||
|
||||
################################################################################
|
||||
## Mobile devices
|
||||
################################################################################
|
||||
|
||||
init python:
|
||||
|
||||
## This increases the size of the quick buttons to make them easier to
|
||||
## touch on tablets and phones.
|
||||
@gui.variant
|
||||
def touch():
|
||||
|
||||
gui.quick_button_borders = Borders(gui.scale(40), gui.scale(14), gui.scale(40), gui.scale(0))
|
||||
|
||||
## This changes the size and spacing of various GUI elements to ensure
|
||||
## they are easily visible on phones.
|
||||
@gui.variant
|
||||
def small():
|
||||
|
||||
## Font sizes.
|
||||
gui.text_size = gui.scale(30)
|
||||
gui.name_text_size = gui.scale(36)
|
||||
gui.notify_text_size = gui.scale(25)
|
||||
gui.interface_text_size = gui.scale(30)
|
||||
gui.button_text_size = gui.scale(30)
|
||||
gui.label_text_size = gui.scale(34)
|
||||
|
||||
## Adjust the location of the textbox.
|
||||
gui.textbox_height = gui.scale(240)
|
||||
gui.name_xpos = gui.scale(80)
|
||||
gui.dialogue_xpos = gui.scale(90)
|
||||
gui.dialogue_width = gui.scale(1100)
|
||||
|
||||
## Change the size and spacing of various things.
|
||||
gui.slider_size = gui.scale(36)
|
||||
|
||||
gui.choice_button_width = gui.scale(1240)
|
||||
gui.choice_button_text_size = gui.scale(30)
|
||||
|
||||
gui.navigation_spacing = gui.scale(20)
|
||||
gui.pref_button_spacing = gui.scale(10)
|
||||
|
||||
gui.history_height = gui.scale(190)
|
||||
gui.history_text_width = gui.scale(690)
|
||||
|
||||
gui.quick_button_text_size = gui.scale(20)
|
||||
|
||||
## File button layout.
|
||||
gui.file_slot_cols = 2
|
||||
gui.file_slot_rows = 2
|
||||
|
||||
## NVL-mode.
|
||||
gui.nvl_height = gui.scale(170)
|
||||
|
||||
gui.nvl_name_width = gui.scale(305)
|
||||
gui.nvl_name_xpos = gui.scale(325)
|
||||
|
||||
gui.nvl_text_width = gui.scale(915)
|
||||
gui.nvl_text_xpos = gui.scale(345)
|
||||
gui.nvl_text_ypos = gui.scale(5)
|
||||
|
||||
gui.nvl_thought_width = gui.scale(1240)
|
||||
gui.nvl_thought_xpos = gui.scale(20)
|
||||
|
||||
gui.nvl_button_width = gui.scale(1240)
|
||||
gui.nvl_button_xpos = gui.scale(20)
|
||||
|
Before Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 4.1 KiB |
@@ -1,30 +0,0 @@
|
||||
init -100 python in gui:
|
||||
|
||||
def scale(n):
|
||||
return int(n)
|
||||
|
||||
init 100 python in gui:
|
||||
|
||||
if not renpy.mobile:
|
||||
from store import config
|
||||
|
||||
import sys
|
||||
import os
|
||||
sys.path.insert(0, os.path.join(config.renpy_base, "launcher", "game"))
|
||||
|
||||
from gui7.parameters import GuiParameters
|
||||
from gui7.images import ImageGenerator
|
||||
from gui7 import generate_gui
|
||||
|
||||
p = GuiParameters(
|
||||
config.gamedir, config.gamedir,
|
||||
config.screen_width, config.screen_height,
|
||||
accent_color, "#000000", False, None,
|
||||
True, False, False, "gui")
|
||||
|
||||
p.skip_backup = True
|
||||
|
||||
generate_gui(p)
|
||||
|
||||
_skip_backup = True
|
||||
_gui_images()
|
||||
@@ -1 +0,0 @@
|
||||
## When this file exists, Ren'Py will load files in game/libs before other files in game.
|
||||
@@ -1,213 +0,0 @@
|
||||
## This file contains options that can be changed to customize your
|
||||
## game.
|
||||
##
|
||||
## Lines beginning with two '#' marks are comments, and you shouldn't
|
||||
## uncomment them. Lines beginning with a single '#' mark are
|
||||
## commented-out code, and you may want to uncomment them when
|
||||
## appropriate.
|
||||
|
||||
|
||||
## Basics ######################################################################
|
||||
|
||||
## A human-readable name of the game. This is used to set the default
|
||||
## window title, and shows up in the interface and error reports.
|
||||
##
|
||||
## The _() surrounding the string marks it as eligible for translation.
|
||||
|
||||
define config.name = _("Ren'Py 7 Default GUI")
|
||||
|
||||
|
||||
## Determines if the title given above is shown on the main menu
|
||||
## screen. Set this to False to hide the title.
|
||||
|
||||
define gui.show_name = True
|
||||
|
||||
|
||||
## The version of the game.
|
||||
|
||||
define config.version = "1.0"
|
||||
|
||||
|
||||
## Text that is placed on the game's about screen. Place the text between
|
||||
## the triple-quotes, and leave a blank line between paragraphs.
|
||||
|
||||
define gui.about = _p("""
|
||||
""")
|
||||
|
||||
|
||||
## A short name for the game used for executables and directories in the
|
||||
## built distribution. This must be ASCII-only, and must not contain
|
||||
## spaces, colons, or semicolons.
|
||||
|
||||
define build.name = "gui"
|
||||
|
||||
|
||||
## Sounds and music ############################################################
|
||||
|
||||
## These three variables control, among other things, which mixers are
|
||||
## shown to the player by default. Setting one of these to False will
|
||||
## hide the appropriate mixer.
|
||||
|
||||
define config.has_sound = True
|
||||
define config.has_music = True
|
||||
define config.has_voice = True
|
||||
|
||||
|
||||
## To allow the user to play a test sound on the sound or voice channel,
|
||||
## uncomment a line below and use it to set a sample sound to play.
|
||||
|
||||
# define config.sample_sound = "sample-sound.ogg"
|
||||
# define config.sample_voice = "sample-voice.ogg"
|
||||
|
||||
|
||||
## Uncomment the following line to set an audio file that will be played
|
||||
## while the player is at the main menu. This file will continue playing
|
||||
## into the game, until it is stopped or another file is played.
|
||||
|
||||
# define config.main_menu_music = "main-menu-theme.ogg"
|
||||
|
||||
|
||||
## Transitions #################################################################
|
||||
##
|
||||
## These variables set transitions that are used when certain events occur.
|
||||
## Each variable should be set to a transition, or None to indicate that
|
||||
## no transition should be used.
|
||||
|
||||
## Entering or exiting the game menu.
|
||||
|
||||
define config.enter_transition = dissolve
|
||||
define config.exit_transition = dissolve
|
||||
|
||||
|
||||
## Between screens of the game menu.
|
||||
|
||||
define config.intra_transition = dissolve
|
||||
|
||||
|
||||
## A transition that is used after a game has been loaded.
|
||||
|
||||
define config.after_load_transition = None
|
||||
|
||||
|
||||
## Used when entering the main menu after the game has ended.
|
||||
|
||||
define config.end_game_transition = None
|
||||
|
||||
|
||||
## A variable to set the transition used when the game starts
|
||||
## does not exist. Instead, use a with statement after showing
|
||||
## the initial scene.
|
||||
|
||||
|
||||
## Window management ###########################################################
|
||||
##
|
||||
## This controls when the dialogue window is displayed. If "show", it is always
|
||||
## displayed. If "hide", it is only displayed when dialogue is present. If
|
||||
## "auto", the window is hidden before scene statements and shown again
|
||||
## once dialogue is displayed.
|
||||
##
|
||||
## After the game has started, this can be changed with the "window show",
|
||||
## "window hide", and "window auto" statements.
|
||||
|
||||
define config.window = "auto"
|
||||
|
||||
|
||||
## Transitions used to show and hide the dialogue window
|
||||
|
||||
define config.window_show_transition = Dissolve(.2)
|
||||
define config.window_hide_transition = Dissolve(.2)
|
||||
|
||||
|
||||
## Preference defaults #########################################################
|
||||
|
||||
## Controls the default text speed. The default, 0, is infinite, while any
|
||||
## other number is the number of characters per second to type out.
|
||||
|
||||
default preferences.text_cps = 0
|
||||
|
||||
|
||||
## The default auto-forward delay. Larger numbers lead to longer waits,
|
||||
## with 0 to 30 being the valid range.
|
||||
|
||||
default preferences.afm_time = 15
|
||||
|
||||
|
||||
## Save directory ##############################################################
|
||||
##
|
||||
## Controls the platform-specific place Ren'Py will place the save
|
||||
## files for this game. The save files will be placed in:
|
||||
##
|
||||
## Windows: %APPDATA\RenPy\<config.save_directory>
|
||||
##
|
||||
## Macintosh: $HOME/Library/RenPy/<config.save_directory>
|
||||
##
|
||||
## Linux: $HOME/.renpy/<config.save_directory>
|
||||
##
|
||||
## This generally should not be changed, and if it is, should always be a
|
||||
## literal string, not an expression.
|
||||
|
||||
define config.save_directory = "gui-7"
|
||||
|
||||
|
||||
## Icon ########################################################################
|
||||
##
|
||||
## The icon displayed on the taskbar or dock.
|
||||
|
||||
define config.window_icon = "gui/window_icon.png"
|
||||
|
||||
|
||||
## Build configuration #########################################################
|
||||
##
|
||||
## This section controls how Ren'Py turns your project into distribution
|
||||
## files.
|
||||
|
||||
init python:
|
||||
|
||||
## The following functions take file patterns. File patterns are case-
|
||||
## insensitive, and matched against the path relative to the base
|
||||
## directory, with and without a leading /. If multiple patterns match,
|
||||
## the first is used.
|
||||
##
|
||||
## In a pattern:
|
||||
##
|
||||
## / is the directory separator.
|
||||
##
|
||||
## * matches all characters, except the directory separator.
|
||||
##
|
||||
## ** matches all characters, including the directory separator.
|
||||
##
|
||||
## For example, "*.txt" matches txt files in the base directory, "game/**.ogg"
|
||||
## matches ogg files in the game directory or any of its subdirectories, and
|
||||
## "**.psd" matches psd files anywhere in the project.
|
||||
|
||||
## Classify files as None to exclude them from the built distributions.
|
||||
|
||||
build.classify('**~', None)
|
||||
build.classify('**.bak', None)
|
||||
build.classify('**/.**', None)
|
||||
build.classify('**/#**', None)
|
||||
build.classify('**/thumbs.db', None)
|
||||
|
||||
## To archive files, classify them as 'archive'.
|
||||
|
||||
# build.classify('game/**.png', 'archive')
|
||||
# build.classify('game/**.jpg', 'archive')
|
||||
|
||||
## Files matching documentation patterns are duplicated in a mac app
|
||||
## build, so they appear in both the app and the zip file.
|
||||
|
||||
build.documentation('*.html')
|
||||
build.documentation('*.txt')
|
||||
|
||||
|
||||
## A Google Play license key is required to perform in-app purchases.
|
||||
## It can be found in the Google Play developer console,
|
||||
## under "Monetize" > "Monetization Setup" > "Licensing".
|
||||
|
||||
# define build.google_play_key = "..."
|
||||
|
||||
|
||||
## The username and project name associated with an itch.io project,
|
||||
## separated by a slash.
|
||||
|
||||
# define build.itch_project = "renpytom/test-project"
|
||||
@@ -1,33 +0,0 @@
|
||||
# The script of the game goes in this file.
|
||||
|
||||
# Declare characters used by this game. The color argument colorizes the
|
||||
# name of the character.
|
||||
|
||||
define e = Character("Eileen")
|
||||
|
||||
|
||||
# The game starts here.
|
||||
|
||||
label start:
|
||||
|
||||
# Show a background. This uses a placeholder by default, but you can
|
||||
# add a file (named either "bg room.png" or "bg room.jpg") to the
|
||||
# images directory to show it.
|
||||
|
||||
scene bg room
|
||||
|
||||
# This shows a character sprite. A placeholder is used, but you can
|
||||
# replace it by adding a file named "eileen happy.png" to the images
|
||||
# directory.
|
||||
|
||||
show eileen happy
|
||||
|
||||
# These display lines of dialogue.
|
||||
|
||||
e "You've created a new Ren'Py game."
|
||||
|
||||
e "Once you add a story, pictures, and music, you can release it to the world!"
|
||||
|
||||
# This ends the game.
|
||||
|
||||
return
|
||||
@@ -1,160 +0,0 @@
|
||||
testcase default:
|
||||
|
||||
"Start"
|
||||
pause .6
|
||||
|
||||
# Test rollback
|
||||
"Hello, World."
|
||||
"Back"
|
||||
|
||||
# Test history.
|
||||
click
|
||||
click
|
||||
"History"
|
||||
pause .6
|
||||
|
||||
# Test Help.
|
||||
"Help"
|
||||
"Keyboard"
|
||||
|
||||
# Test About
|
||||
"About"
|
||||
|
||||
# Test Preferences
|
||||
"Preferences"
|
||||
|
||||
"Left"
|
||||
"Right"
|
||||
"Disable"
|
||||
|
||||
"Unseen Text"
|
||||
"Unseen Text"
|
||||
|
||||
"After Choices"
|
||||
"After Choices"
|
||||
|
||||
"Transitions"
|
||||
"Transitions"
|
||||
|
||||
"Mute All"
|
||||
"Mute All"
|
||||
|
||||
"Save"
|
||||
"Load"
|
||||
|
||||
"Return"
|
||||
pause .6
|
||||
|
||||
run Jump("test")
|
||||
|
||||
"In testcase code."
|
||||
|
||||
# menu_1
|
||||
click until "Choice A"
|
||||
|
||||
|
||||
# input
|
||||
type "Test User\n"
|
||||
"Name: Test User"
|
||||
|
||||
# Nvl
|
||||
click
|
||||
click
|
||||
click
|
||||
|
||||
click
|
||||
click
|
||||
click until "NVL 6"
|
||||
|
||||
# NVL Menu.
|
||||
"Choice B"
|
||||
|
||||
$ renpy.unlink_save("1-1")
|
||||
"Save"
|
||||
|
||||
pause .6
|
||||
|
||||
"Save slot 1"
|
||||
|
||||
pause .6
|
||||
|
||||
"Save slot 1"
|
||||
"Yes"
|
||||
|
||||
"Main Menu"
|
||||
"Yes"
|
||||
|
||||
"Load"
|
||||
"Load slot 1"
|
||||
|
||||
pause .5
|
||||
|
||||
"Save"
|
||||
|
||||
pause .5
|
||||
|
||||
|
||||
"Load"
|
||||
"Load slot 1"
|
||||
"No"
|
||||
|
||||
"Return"
|
||||
|
||||
# Done.
|
||||
pause .5
|
||||
|
||||
"Done."
|
||||
"Quit"
|
||||
|
||||
|
||||
define nvle = Character("Eileen", kind=nvl)
|
||||
|
||||
|
||||
label test:
|
||||
|
||||
"In testcase code."
|
||||
|
||||
|
||||
menu menu_1:
|
||||
"This is a menu."
|
||||
|
||||
"Choice A":
|
||||
pass
|
||||
|
||||
"Choice B":
|
||||
pass
|
||||
|
||||
label after_menu_1:
|
||||
|
||||
|
||||
$ name = renpy.input("What is your name?")
|
||||
"Name: [name]"
|
||||
|
||||
nvle "NVL 1"
|
||||
nvle "NVL 2"
|
||||
nvle "NVL 3"
|
||||
|
||||
nvl clear
|
||||
|
||||
nvle "NVL 4"
|
||||
nvle "NVL 5"
|
||||
nvle "NVL 6"
|
||||
|
||||
|
||||
$ menu = nvl_menu
|
||||
|
||||
|
||||
menu menu_2:
|
||||
"This is a menu."
|
||||
|
||||
"Choice A":
|
||||
pass
|
||||
|
||||
"Choice B":
|
||||
pass
|
||||
|
||||
label after_menu_2:
|
||||
|
||||
"Done."
|
||||
|
||||
return
|
||||
@@ -1 +0,0 @@
|
||||
{ "type" : "hidden" }
|
||||
@@ -0,0 +1,128 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>README</title>
|
||||
<style>
|
||||
|
||||
BODY {
|
||||
background: #fff;
|
||||
color: #444;
|
||||
padding-left: 20%;
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em;
|
||||
padding-right: 20%;
|
||||
font-family: sans-serif;
|
||||
line-height: 1.6em;
|
||||
}
|
||||
|
||||
DT {
|
||||
font-weight: bold;
|
||||
margin-top: .33em;
|
||||
}
|
||||
|
||||
H2 {
|
||||
color: #000;
|
||||
margin-left: -2.5em;
|
||||
}
|
||||
|
||||
H3 {
|
||||
color: #000;
|
||||
margin-left: -1.5em;
|
||||
}
|
||||
|
||||
.editsection {
|
||||
display: none;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="renpy_help"></div>
|
||||
|
||||
|
||||
|
||||
|
||||
<p><a name="Basic_Help" id="Basic_Help"></a></p>
|
||||
<h2><span class="editsection">[<a href="/w/index.php?title=renpy/Help&action=edit&section=1" title="Edit section: Basic Help">edit</a>]</span> <span class="mw-headline">Basic Help</span></h2>
|
||||
<p>To advance through the game, <tt>left-click</tt> or press the <tt>space</tt> or <tt>enter</tt> keys. When at a menu, <tt>left-click</tt> to make a choice, or use the arrow keys to select a choice and <tt>enter</tt> to activate it.</p>
|
||||
<p><a name="Game_Menu" id="Game_Menu"></a></p>
|
||||
<h3><span class="editsection">[<a href="/w/index.php?title=renpy/Help&action=edit&section=2" title="Edit section: Game Menu">edit</a>]</span> <span class="mw-headline">Game Menu</span></h3>
|
||||
<p>When playing a game, <tt>right-click</tt> or press the <tt>escape</tt> key to enter the game menu. The game menu gives the following choices:</p>
|
||||
<dl>
|
||||
<dt>Return</dt>
|
||||
<dd>Returns to the game.</dd>
|
||||
<dt>Save Game</dt>
|
||||
<dd>Allows you to save a game by clicking on a save slot.</dd>
|
||||
<dt>Load Game</dt>
|
||||
<dd>Allows you to load a game by clicking on a save slot. Clicking on "Auto" accesses the automatic save slots.</dd>
|
||||
<dt>Preferences</dt>
|
||||
<dd>Changes the game preferences (options/configuration):
|
||||
<dl>
|
||||
<dt>Display</dt>
|
||||
<dd>Switches between fullscreen and windowed mode.</dd>
|
||||
<dt>Transitions</dt>
|
||||
<dd>Controls the display of transitions between game screens.</dd>
|
||||
<dt>Text Speed</dt>
|
||||
<dd>Controls the rate at which text displays. The further to the right this slider is, the faster the text will display. All the way to the right causes text to be shown instantly.</dd>
|
||||
<dt>Joystick</dt>
|
||||
<dd>Lets you control the game using a joystick.</dd>
|
||||
<dt>Skip</dt>
|
||||
<dd>Chooses between skipping messages that have been already seen (in any play through the game), and skipping all messages.</dd>
|
||||
<dt>Begin Skipping</dt>
|
||||
<dd>Returns to the game, while skipping.</dd>
|
||||
<dt>After Choices</dt>
|
||||
<dd>Controls if skipping stops upon reaching a menu.</dd>
|
||||
<dt>Auto-Forward Time</dt>
|
||||
<dd>Controls automatic advance. The further to the left this slider is, the shorter the amount of time before the game advances. All the way to the right means text will never auto-forward.</dd>
|
||||
<dt>Music, Sound, and Voice Volume</dt>
|
||||
<dd>Controls the volume of the Music, Sound effect, and Voice channels, respectively. The further to the right these are, the louder the volume.</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
</dl>
|
||||
<dl>
|
||||
<dt>Main Menu</dt>
|
||||
<dd>Returns to the main menu, ending the current game.</dd>
|
||||
<dt>Help</dt>
|
||||
<dd>Shows this help screen.</dd>
|
||||
<dt>Quit</dt>
|
||||
<dd>Exits the game; the game will be closed and ended.</dd>
|
||||
</dl>
|
||||
<p><a name="Key_and_Mouse_Bindings" id="Key_and_Mouse_Bindings"></a></p>
|
||||
<h3><span class="editsection">[<a href="/w/index.php?title=renpy/Help&action=edit&section=3" title="Edit section: Key and Mouse Bindings">edit</a>]</span> <span class="mw-headline">Key and Mouse Bindings</span></h3>
|
||||
<dl>
|
||||
<dt>Left-click, Enter</dt>
|
||||
<dd>Advances through the game, activates menu choices, buttons, and sliders.</dd>
|
||||
<dt>Space</dt>
|
||||
<dd>Advances through the game, but does not activate choices.</dd>
|
||||
<dt>Arrow Keys</dt>
|
||||
<dd>Selects menu choices, buttons, and sliders.</dd>
|
||||
<dt>Ctrl</dt>
|
||||
<dd>Causes skipping to occur while the ctrl key is held down.</dd>
|
||||
<dt>Tab</dt>
|
||||
<dd>Toggles skipping, causing it to occur until tab is pressed again.</dd>
|
||||
<dt>Mousewheel-Up, PageUp</dt>
|
||||
<dd>Causes rollback to occur. Rollback reverses the game back in time, showing prior text and even allowing menu choices to be changed.</dd>
|
||||
<dt>Mousewheel-Down, PageDown</dt>
|
||||
<dd>Causes rollforward to occur, cancelling out a previous rollback.</dd>
|
||||
<dt>Right-click, Escape</dt>
|
||||
<dd>Enters the game menu. When in the game menu, returns to the game.</dd>
|
||||
<dt>Middle-click, H</dt>
|
||||
<dd>Hides the text window and other transient displays.</dd>
|
||||
<dt>F</dt>
|
||||
<dd>Toggles fullscreen mode</dd>
|
||||
<dt>S</dt>
|
||||
<dd>Takes a screenshot, saving it in a file named screenshotxxxx.png, where xxxx is a serial number.</dd>
|
||||
<dt>Alt-M, Command-H</dt>
|
||||
<dd>Hides (iconifies) the window.</dd>
|
||||
<dt>Alt-F4, Command-Q</dt>
|
||||
<dd>Quits the game.</dd>
|
||||
<dt>Delete</dt>
|
||||
<dd>When a save slot is selected, deletes that save slot.</dd>
|
||||
</dl>
|
||||
<p><a name="Legal_Notice" id="Legal_Notice"></a></p>
|
||||
<h2><span class="editsection">[<a href="/w/index.php?title=renpy/Help&action=edit&section=4" title="Edit section: Legal Notice">edit</a>]</span> <span class="mw-headline">Legal Notice</span></h2>
|
||||
<p>This game uses source code from a number of open source projects. For a list, and a location where the source code can be downloaded from, please view the LICENSE.txt file in the renpy directory, or visit <a href="http://www.renpy.org/wiki/renpy/License" class="external free" title="http://www.renpy.org/wiki/renpy/License" rel="nofollow">http://www.renpy.org/wiki/renpy/License</a> .</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,86 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
# The path to a copy of Atom that's been installed globally, if one exists.
|
||||
# This is overidden by RENPY_ATOM, if set. If either is given, that is used
|
||||
# and no special handing of the .atom directory is performed.
|
||||
ATOM = None
|
||||
|
||||
import sys
|
||||
import os
|
||||
import subprocess
|
||||
import platform
|
||||
import shutil
|
||||
|
||||
import renpy
|
||||
|
||||
|
||||
class Editor(renpy.editor.Editor):
|
||||
|
||||
has_projects = True
|
||||
|
||||
def get_atom(self):
|
||||
"""
|
||||
Returns the path to the atom executable, if None. Also takes care
|
||||
of setting up the .atom directory if it's not available.
|
||||
"""
|
||||
|
||||
atom = os.environ.get("RENPY_ATOM", ATOM)
|
||||
|
||||
if atom is not None:
|
||||
return atom
|
||||
|
||||
DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
DIR = os.path.join(renpy.exports.fsdecode(DIR), "atom")
|
||||
|
||||
if renpy.windows:
|
||||
atom = os.path.join(DIR, "atom-windows", "atom.exe")
|
||||
elif renpy.macintosh:
|
||||
atom = os.path.join(DIR, "Atom.app", "Contents", "Resources", "app", "atom.sh")
|
||||
else:
|
||||
atom = os.path.join(DIR, "atom-linux-" + platform.machine(), "atom")
|
||||
|
||||
default_dot_atom = os.path.join(DIR, "default-dot-atom")
|
||||
dot_atom = os.path.join(DIR, ".atom")
|
||||
|
||||
if not os.path.exists(dot_atom) and os.path.exists(default_dot_atom):
|
||||
shutil.copytree(default_dot_atom, dot_atom)
|
||||
|
||||
return atom
|
||||
|
||||
def begin(self, new_window=False, **kwargs):
|
||||
self.args = [ ]
|
||||
|
||||
def open(self, filename, line=None, **kwargs):
|
||||
|
||||
if line:
|
||||
filename = "{}:{}".format(filename, line)
|
||||
|
||||
self.args.append(filename)
|
||||
|
||||
def open_project(self, project):
|
||||
self.args.append(project)
|
||||
|
||||
def end(self, **kwargs):
|
||||
|
||||
atom = self.get_atom()
|
||||
|
||||
self.args.reverse()
|
||||
|
||||
args = [ atom ] + self.args
|
||||
args = [ renpy.exports.fsencode(i) for i in args ]
|
||||
|
||||
subprocess.Popen(args)
|
||||
|
||||
|
||||
def main():
|
||||
e = Editor()
|
||||
e.begin()
|
||||
|
||||
for i in sys.argv[1:]:
|
||||
e.open(i)
|
||||
|
||||
e.end()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,93 +0,0 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import renpy
|
||||
|
||||
class Editor(renpy.editor.Editor):
|
||||
|
||||
has_projects = True
|
||||
|
||||
system = __file__.endswith(" (System).edit.py")
|
||||
|
||||
def get_code(self):
|
||||
"""
|
||||
Returns the path to the code executable.
|
||||
"""
|
||||
|
||||
if self.system:
|
||||
|
||||
if "RENPY_VSCODE" in os.environ:
|
||||
return os.environ["RENPY_VSCODE"]
|
||||
|
||||
if renpy.windows:
|
||||
return "code.cmd"
|
||||
|
||||
if renpy.macintosh and os.path.exists("/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"):
|
||||
return "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"
|
||||
|
||||
return "code"
|
||||
|
||||
else:
|
||||
|
||||
RENPY_VSCODE = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "vscode"))
|
||||
|
||||
if renpy.windows:
|
||||
code = os.path.join(RENPY_VSCODE, "VSCode-win32-x64", "bin", "code.cmd")
|
||||
elif renpy.macintosh:
|
||||
code = os.path.join(RENPY_VSCODE, "Visual Studio Code.app", "Contents", "Resources", "app", "bin", "code")
|
||||
elif renpy.linux:
|
||||
if renpy.arch == "aarch64":
|
||||
arch = "arm64"
|
||||
elif renpy.arch == "armv7l":
|
||||
arch = "arm"
|
||||
else:
|
||||
arch = "x64"
|
||||
|
||||
code = os.path.join(RENPY_VSCODE, "VSCode-linux-" + arch, "bin", "code")
|
||||
else:
|
||||
code = "code"
|
||||
|
||||
return code
|
||||
|
||||
def open(self, filename, line=None, **kwargs):
|
||||
if line:
|
||||
filename = "{}:{}".format(filename, line)
|
||||
self.args.append(filename)
|
||||
|
||||
def open_project(self, project):
|
||||
self.args.append(project)
|
||||
|
||||
def begin(self, new_window=False, **kwargs):
|
||||
self.args = [ ]
|
||||
|
||||
def end(self, **kwargs):
|
||||
self.args.reverse()
|
||||
|
||||
code = self.get_code()
|
||||
if self.system or not renpy.linux:
|
||||
args = [ code, "-g" ] + self.args
|
||||
else:
|
||||
args = [ code, "--no-sandbox", "-g" ] + self.args
|
||||
|
||||
args = [ renpy.exports.fsencode(i) for i in args ]
|
||||
|
||||
if renpy.windows:
|
||||
CREATE_NO_WINDOW = 0x08000000
|
||||
subprocess.Popen(args, creationflags=CREATE_NO_WINDOW)
|
||||
else:
|
||||
subprocess.Popen(args)
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
e = Editor()
|
||||
e.begin()
|
||||
|
||||
for i in sys.argv[1:]:
|
||||
e.open(i)
|
||||
|
||||
e.end()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,93 +0,0 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
import renpy
|
||||
|
||||
class Editor(renpy.editor.Editor):
|
||||
|
||||
has_projects = True
|
||||
|
||||
system = __file__.endswith(" (System).edit.py")
|
||||
|
||||
def get_code(self):
|
||||
"""
|
||||
Returns the path to the code executable.
|
||||
"""
|
||||
|
||||
if self.system:
|
||||
|
||||
if "RENPY_VSCODE" in os.environ:
|
||||
return os.environ["RENPY_VSCODE"]
|
||||
|
||||
if renpy.windows:
|
||||
return "code.cmd"
|
||||
|
||||
if renpy.macintosh and os.path.exists("/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"):
|
||||
return "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"
|
||||
|
||||
return "code"
|
||||
|
||||
else:
|
||||
|
||||
RENPY_VSCODE = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "vscode"))
|
||||
|
||||
if renpy.windows:
|
||||
code = os.path.join(RENPY_VSCODE, "VSCode-win32-x64", "bin", "code.cmd")
|
||||
elif renpy.macintosh:
|
||||
code = os.path.join(RENPY_VSCODE, "Visual Studio Code.app", "Contents", "Resources", "app", "bin", "code")
|
||||
elif renpy.linux:
|
||||
if renpy.arch == "aarch64":
|
||||
arch = "arm64"
|
||||
elif renpy.arch == "armv7l":
|
||||
arch = "arm"
|
||||
else:
|
||||
arch = "x64"
|
||||
|
||||
code = os.path.join(RENPY_VSCODE, "VSCode-linux-" + arch, "bin", "code")
|
||||
else:
|
||||
code = "code"
|
||||
|
||||
return code
|
||||
|
||||
def open(self, filename, line=None, **kwargs):
|
||||
if line:
|
||||
filename = "{}:{}".format(filename, line)
|
||||
self.args.append(filename)
|
||||
|
||||
def open_project(self, project):
|
||||
self.args.append(project)
|
||||
|
||||
def begin(self, new_window=False, **kwargs):
|
||||
self.args = [ ]
|
||||
|
||||
def end(self, **kwargs):
|
||||
self.args.reverse()
|
||||
|
||||
code = self.get_code()
|
||||
if self.system or not renpy.linux:
|
||||
args = [ code, "-g" ] + self.args
|
||||
else:
|
||||
args = [ code, "--no-sandbox", "-g" ] + self.args
|
||||
|
||||
args = [ renpy.exports.fsencode(i) for i in args ]
|
||||
|
||||
if renpy.windows:
|
||||
CREATE_NO_WINDOW = 0x08000000
|
||||
subprocess.Popen(args, creationflags=CREATE_NO_WINDOW)
|
||||
else:
|
||||
subprocess.Popen(args)
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
e = Editor()
|
||||
e.begin()
|
||||
|
||||
for i in sys.argv[1:]:
|
||||
e.open(i)
|
||||
|
||||
e.end()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,144 @@
|
||||
import binascii
|
||||
|
||||
|
||||
def a2b(a):
|
||||
return binascii.a2b_hex(''.join(a.split()))
|
||||
|
||||
|
||||
resources = {
|
||||
260 : a2b('''
|
||||
01 00 ff ff 00 00 00 00 00 00 00 00 c8 00 c0 80
|
||||
02 00 00 00 00 00 b8 00 29 00 00 00 00 00 00 00
|
||||
08 00 90 01 00 01 4d 00 53 00 20 00 53 00 68 00
|
||||
65 00 6c 00 6c 00 20 00 44 00 6c 00 67 00 00 00
|
||||
00 00 00 00 00 00 00 00 01 00 01 50 7f 00 14 00
|
||||
32 00 0e 00 01 00 00 00 ff ff 80 00 4f 00 4b 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 04 08 00 50
|
||||
07 00 07 00 aa 00 0c 00 ea 03 00 00 ff ff 81 00
|
||||
00 00 00 00
|
||||
'''),
|
||||
261 : a2b('''
|
||||
01 00 ff ff 00 00 00 00 00 00 00 00 c8 00 c0 80
|
||||
04 00 00 00 00 00 b8 00 3a 00 00 00 00 00 00 00
|
||||
08 00 90 01 00 01 4d 00 53 00 20 00 53 00 68 00
|
||||
65 00 6c 00 6c 00 20 00 44 00 6c 00 67 00 00 00
|
||||
00 00 00 00 00 00 00 00 80 00 81 50 07 00 14 00
|
||||
aa 00 0c 00 ec 03 00 00 ff ff 81 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 01 00 01 50 7f 00 25 00
|
||||
32 00 0e 00 01 00 00 00 ff ff 80 00 4f 00 4b 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 50
|
||||
4a 00 25 00 32 00 0e 00 02 00 00 00 ff ff 80 00
|
||||
43 00 61 00 6e 00 63 00 65 00 6c 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 04 08 00 50 07 00 07 00
|
||||
aa 00 0c 00 eb 03 00 00 ff ff 81 00 00 00 00 00
|
||||
'''),
|
||||
262 : a2b('''
|
||||
01 00 ff ff 00 00 00 00 00 00 00 00 c8 00 c0 80
|
||||
04 00 00 00 00 00 b8 00 29 00 00 00 00 00 00 00
|
||||
08 00 90 01 00 01 4d 00 53 00 20 00 53 00 68 00
|
||||
65 00 6c 00 6c 00 20 00 44 00 6c 00 67 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 01 50 7f 00 14 00
|
||||
32 00 0e 00 06 00 00 00 ff ff 80 00 59 00 65 00
|
||||
73 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
04 08 00 50 07 00 07 00 aa 00 0c 00 ed 03 00 00
|
||||
ff ff 81 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 01 50 07 00 14 00 32 00 0e 00 07 00 00 00
|
||||
ff ff 80 00 4e 00 6f 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 01 50 4b 00 14 00 32 00 0e 00
|
||||
02 00 00 00 ff ff 80 00 43 00 61 00 6e 00 63 00
|
||||
65 00 6c 00 00 00 00 00
|
||||
'''),
|
||||
263 : a2b('''
|
||||
01 00 ff ff 00 00 00 00 00 00 00 00 80 00 ca 80
|
||||
03 00 00 00 00 00 e2 00 29 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 81 50 07 00 14 00
|
||||
97 00 0e 00 eb 03 00 00 6d 00 73 00 63 00 74 00
|
||||
6c 00 73 00 5f 00 70 00 72 00 6f 00 67 00 72 00
|
||||
65 00 73 00 73 00 33 00 32 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 04 08 00 50 07 00 07 00
|
||||
d4 00 0c 00 ea 03 00 00 ff ff 81 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 50 a9 00 14 00
|
||||
32 00 0e 00 02 00 00 00 ff ff 80 00 43 00 61 00
|
||||
6e 00 63 00 65 00 6c 00 00 00 00 00
|
||||
'''),
|
||||
264 : a2b('''
|
||||
01 00 ff ff 00 00 00 00 00 00 00 00 c8 00 c0 80
|
||||
04 00 00 00 00 00 b8 00 3a 00 00 00 00 00 00 00
|
||||
08 00 90 01 00 01 4d 00 53 00 20 00 53 00 68 00
|
||||
65 00 6c 00 6c 00 20 00 44 00 6c 00 67 00 00 00
|
||||
00 00 00 00 00 00 00 00 a0 00 81 50 07 00 14 00
|
||||
aa 00 0c 00 ec 03 00 00 ff ff 81 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 01 00 01 50 7f 00 25 00
|
||||
32 00 0e 00 01 00 00 00 ff ff 80 00 4f 00 4b 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 50
|
||||
4a 00 25 00 32 00 0e 00 02 00 00 00 ff ff 80 00
|
||||
43 00 61 00 6e 00 63 00 65 00 6c 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 04 08 00 50 07 00 07 00
|
||||
aa 00 0c 00 eb 03 00 00 ff ff 81 00 00 00 00 00
|
||||
'''),
|
||||
265 : a2b('''
|
||||
01 00 ff ff 00 00 00 00 00 00 00 00 c8 00 c8 80
|
||||
12 00 00 00 00 00 d9 00 fc 00 00 00 00 00 00 00
|
||||
08 00 90 01 00 01 4d 00 53 00 20 00 53 00 68 00
|
||||
65 00 6c 00 6c 00 20 00 44 00 6c 00 67 00 00 00
|
||||
00 00 00 00 00 00 00 00 01 00 01 50 6c 00 ea 00
|
||||
30 00 0e 00 01 00 00 00 ff ff 80 00 4f 00 4b 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 50
|
||||
a2 00 ea 00 30 00 0e 00 02 00 00 00 ff ff 80 00
|
||||
43 00 61 00 6e 00 63 00 65 00 6c 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 07 00 00 50 06 00 06 00
|
||||
cc 00 4e 00 ff ff ff ff ff ff 80 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 03 00 21 50 48 00 12 00
|
||||
84 00 64 00 03 00 00 00 ff ff 85 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 02 50 0c 00 24 00
|
||||
c0 00 08 00 04 00 00 00 ff ff 82 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 80 00 81 50 0c 00 30 00
|
||||
c0 00 0e 00 05 00 00 00 ff ff 81 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 01 50 9c 00 42 00
|
||||
30 00 0e 00 06 00 00 00 ff ff 80 00 41 00 64 00
|
||||
64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
07 00 00 50 06 00 54 00 cb 00 3c 00 ff ff ff ff
|
||||
ff ff 80 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
03 00 21 50 48 00 61 00 84 00 64 00 07 00 00 00
|
||||
ff ff 85 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 02 50 0c 00 72 00 c0 00 08 00 08 00 00 00
|
||||
ff ff 82 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 01 50 9c 00 7e 00 30 00 0e 00 09 00 00 00
|
||||
ff ff 80 00 41 00 64 00 64 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 01 50 06 00 96 00
|
||||
42 00 0e 00 0a 00 00 00 ff ff 80 00 41 00 64 00
|
||||
64 00 20 00 66 00 69 00 6c 00 65 00 2e 00 2e 00
|
||||
2e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 01 50 4e 00 96 00 42 00 0e 00 0b 00 00 00
|
||||
ff ff 80 00 41 00 64 00 64 00 20 00 6e 00 65 00
|
||||
77 00 20 00 66 00 69 00 6c 00 65 00 2e 00 2e 00
|
||||
2e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
|
||||
00 00 01 50 06 00 a8 00 42 00 0e 00 0c 00 00 00
|
||||
ff ff 80 00 41 00 64 00 64 00 20 00 66 00 6f 00
|
||||
6c 00 64 00 65 00 72 00 2e 00 2e 00 2e 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 00 00 07 00 00 50
|
||||
06 00 c6 00 cc 00 1e 00 ff ff ff ff ff ff 80 00
|
||||
43 00 6f 00 6d 00 6d 00 61 00 6e 00 64 00 20 00
|
||||
6c 00 69 00 6e 00 65 00 3a 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 80 00 81 50 0c 00 d2 00
|
||||
c0 00 0e 00 0e 00 00 00 ff ff 81 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 02 50 0c 00 14 00
|
||||
3c 00 08 00 1e 00 00 00 ff ff 82 00 4f 00 70 00
|
||||
74 00 69 00 6f 00 6e 00 3a 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 00 00 00 00 02 50 0c 00 63 00
|
||||
3c 00 08 00 46 00 00 00 ff ff 82 00 43 00 6f 00
|
||||
6d 00 6d 00 61 00 6e 00 64 00 3a 00 00 00 00 00
|
||||
'''),
|
||||
270 : a2b('''
|
||||
01 00 ff ff 00 00 00 00 00 00 00 00 48 04 00 44
|
||||
02 00 00 00 00 00 23 01 1a 00 00 00 00 00 00 00
|
||||
08 00 00 00 00 00 4d 00 53 00 20 00 53 00 68 00
|
||||
65 00 6c 00 6c 00 20 00 44 00 6c 00 67 00 00 00
|
||||
00 00 00 00 00 00 00 00 01 00 02 50 00 00 07 00
|
||||
23 01 08 00 ff ff ff ff ff ff 82 00 53 00 74 00
|
||||
61 00 74 00 69 00 63 00 00 00 00 00 00 00 00 00
|
||||
00 00 00 00 00 00 02 40 00 00 12 00 23 01 08 00
|
||||
5f 04 00 00 ff ff 82 00 73 00 74 00 63 00 33 00
|
||||
32 00 00 00 00 00
|
||||
'''),
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -42,7 +42,7 @@ screen about:
|
||||
|
||||
textbutton _("View license") action interface.OpenLicense() xalign 0.5
|
||||
|
||||
textbutton _("Return") action Jump("front_page") style "l_left_button"
|
||||
textbutton _("Back") action Jump("front_page") style "l_left_button"
|
||||
|
||||
label about:
|
||||
call screen about
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -23,38 +23,28 @@ label add_file:
|
||||
|
||||
python hide:
|
||||
import os
|
||||
filename = ""
|
||||
while True:
|
||||
filename = interface.input(
|
||||
_("FILENAME"),
|
||||
_("Enter the name of the script file to create."),
|
||||
allow=interface.FILENAME_LETTERS,
|
||||
cancel=Jump("navigation"),
|
||||
default=filename,
|
||||
)
|
||||
filename = filename.strip()
|
||||
if not filename:
|
||||
interface.error(_("The file name may not be empty."), label=None)
|
||||
continue
|
||||
import codecs
|
||||
|
||||
if "." in filename and not filename.endswith(".rpy"):
|
||||
interface.error(_("The filename must have the .rpy extension."), label=None)
|
||||
continue
|
||||
elif "." not in filename:
|
||||
filename += ".rpy"
|
||||
filename = interface.input(_("FILENAME"), _("Enter the name of the script file to create."), filename="withslash", cancel=Jump("navigation"))
|
||||
|
||||
path = os.path.join(project.current.gamedir, filename)
|
||||
dir = os.path.dirname(path)
|
||||
if "." in filename and not filename.endswith(".rpy"):
|
||||
interface.error(_("The filename must have the .rpy extension."), label="navigation")
|
||||
elif "." not in filename:
|
||||
filename += ".rpy"
|
||||
|
||||
if os.path.exists(path):
|
||||
interface.error(_("The file already exists."), label=None)
|
||||
continue
|
||||
path = os.path.join(project.current.gamedir, filename)
|
||||
dir = os.path.dirname(path)
|
||||
|
||||
break
|
||||
if os.path.exists(path):
|
||||
interface.error(_("The file already exists."), label="navigation")
|
||||
|
||||
contents = u"\uFEFF"
|
||||
contents += _("# Ren'Py automatically loads all script files ending with .rpy. To use this\n# file, define a label and jump to it from another file.\n")
|
||||
contents += "\n"
|
||||
|
||||
try:
|
||||
os.makedirs(dir)
|
||||
except Exception:
|
||||
except:
|
||||
pass
|
||||
|
||||
contents = u"\uFEFF"
|
||||
@@ -64,3 +54,4 @@ label add_file:
|
||||
f.write(contents.encode("utf-8"))
|
||||
|
||||
jump navigation_refresh
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -19,54 +19,36 @@
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
default persistent.android_bundle = False
|
||||
|
||||
init python:
|
||||
ANDROID_NO_RAPT = 0
|
||||
ANDROID_NO_JDK = 1
|
||||
ANDROID_NO_SDK = 2
|
||||
ANDROID_NO_KEY = 3
|
||||
ANDROID_NO_BUNDLE_KEY = 4
|
||||
ANDROID_NO_CONFIG = 5
|
||||
ANDROID_NO_BUNDLE = 6
|
||||
ANDROID_OK = 7
|
||||
|
||||
JDK_REQUIREMENT = 42
|
||||
ANDROID_NO_CONFIG = 4
|
||||
ANDROID_OK = 5
|
||||
|
||||
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 32-bit Java 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=http://www.oracle.com/technetwork/java/javase/downloads/index.html}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 generate new keys, or copy android.keystore and bundle.keystore to the base directory.")
|
||||
NO_KEY_TEXT = _("RAPT has been installed, but a key hasn't been configured. Please create a new key, or restore android.keystore.")
|
||||
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.\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 an OUYA 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.")
|
||||
GENERATE_KEYS_TEXT = _("Generates the keys required to sign the package.")
|
||||
INSTALL_SDK_TEXT = _("Downloads and installs the Android SDK and supporting packages. Optionally, 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.")
|
||||
|
||||
LOGCAT_TEXT = _("Retrieves the log from the Android device and writes it to a file.")
|
||||
LIST_DEVICES_TEXT = _("Lists the connected devices.")
|
||||
PAIR_TEXT = _("Pairs with a device over Wi-Fi, on Android 11+.")
|
||||
CONNECT_TEXT = _("Connects to a device over Wi-Fi, on Android 11+.")
|
||||
DISCONNECT_TEXT = _("Disconnects a device connected over Wi-Fi.")
|
||||
|
||||
CLEAN_TEXT = _("Removes Android temporary files.")
|
||||
|
||||
PLAY_BUNDLE_TEXT = _("Builds an Android App Bundle (ABB), intended to be uploaded to Google Play. This can include up to 2GB of data.")
|
||||
UNIVERSAL_APK_TEXT = _("Builds a Universal APK package, intended for sideloading and stores other than Google Play. This can include up to 2GB of data.")
|
||||
|
||||
import subprocess
|
||||
import re
|
||||
import os
|
||||
import json
|
||||
import glob
|
||||
|
||||
def find_rapt():
|
||||
|
||||
@@ -76,11 +58,12 @@ init python:
|
||||
|
||||
RAPT_PATH = os.path.join(config.renpy_base, "rapt")
|
||||
|
||||
if os.path.isdir(RAPT_PATH) and check_hash_txt("rapt"):
|
||||
if os.path.isdir(RAPT_PATH):
|
||||
import sys
|
||||
sys.path.insert(0, os.path.join(RAPT_PATH, "buildlib"))
|
||||
else:
|
||||
RAPT_PATH = None
|
||||
RAPT_PATH is None
|
||||
|
||||
find_rapt()
|
||||
|
||||
@@ -93,17 +76,9 @@ init python:
|
||||
import rapt.install_sdk
|
||||
import rapt.plat
|
||||
import rapt.interface
|
||||
import rapt.keys
|
||||
|
||||
rapt.plat.renpy = True
|
||||
rapt.plat.translate = __
|
||||
|
||||
JDK_REQUIREMENT = rapt.plat.jdk_requirement
|
||||
|
||||
else:
|
||||
rapt = None
|
||||
|
||||
|
||||
def AndroidState():
|
||||
"""
|
||||
Determines the state of the android install, and returns it.
|
||||
@@ -111,18 +86,16 @@ init python:
|
||||
|
||||
if RAPT_PATH is None:
|
||||
return ANDROID_NO_RAPT
|
||||
if not os.path.exists(rapt.plat.adb):
|
||||
if renpy.windows and not "JAVA_HOME" in os.environ:
|
||||
return ANDROID_NO_JDK
|
||||
if not os.path.exists(os.path.join(RAPT_PATH, "android-sdk/extras/google/play_licensing")):
|
||||
return ANDROID_NO_SDK
|
||||
if not rapt.keys.keys_exist(project.current.path):
|
||||
if not os.path.exists(os.path.join(RAPT_PATH, "android.keystore")):
|
||||
return ANDROID_NO_KEY
|
||||
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"))
|
||||
]):
|
||||
if not os.path.exists(os.path.join(RAPT_PATH, "local.properties")):
|
||||
return ANDROID_NO_KEY
|
||||
if not 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
|
||||
|
||||
return ANDROID_OK
|
||||
|
||||
|
||||
@@ -133,14 +106,14 @@ init python:
|
||||
|
||||
if state == ANDROID_NO_RAPT:
|
||||
return NO_RAPT_TEXT
|
||||
if state == ANDROID_NO_JDK:
|
||||
return NO_JDK_TEXT
|
||||
if state == ANDROID_NO_SDK:
|
||||
return NO_SDK_TEXT
|
||||
if state == ANDROID_NO_KEY:
|
||||
return NO_KEY_TEXT
|
||||
if state == ANDROID_NO_CONFIG:
|
||||
return NO_CONFIG_TEXT
|
||||
if state == ANDROID_NO_BUNDLE:
|
||||
return NO_BUNDLE_TEXT
|
||||
if state == ANDROID_OK:
|
||||
return OK_TEXT
|
||||
|
||||
@@ -155,6 +128,146 @@ init python:
|
||||
else:
|
||||
return None
|
||||
|
||||
class AndroidInterface(object):
|
||||
|
||||
def __init__(self):
|
||||
self.process = None
|
||||
self.filename = project.current.temp_filename("android.txt")
|
||||
|
||||
self.info_msg = ""
|
||||
|
||||
with open(self.filename, "w"):
|
||||
pass
|
||||
|
||||
def log(self, msg):
|
||||
with open(self.filename, "a") as f:
|
||||
f.write("\n")
|
||||
f.write(msg)
|
||||
f.write("\n")
|
||||
|
||||
def info(self, prompt):
|
||||
self.info_msg = prompt
|
||||
interface.processing(prompt, pause=False)
|
||||
self.log(prompt)
|
||||
|
||||
def yesno(self, prompt, submessage=None):
|
||||
return interface.yesno(prompt, submessage=submessage)
|
||||
|
||||
def yesno_choice(self, prompt, default=None):
|
||||
choices = [ (True, "Yes"), (False, "No") ]
|
||||
return interface.choice(prompt, choices, default)
|
||||
|
||||
def terms(self, url, prompt):
|
||||
submessage = _("{a=%s}%s{/a}") % (url, url)
|
||||
|
||||
if not interface.yesno(prompt, submessage=submessage):
|
||||
self.fail("You must accept the terms and conditions to proceed.", edit=False)
|
||||
|
||||
|
||||
def input(self, prompt, empty=None):
|
||||
|
||||
if empty is None:
|
||||
empty = ''
|
||||
|
||||
while True:
|
||||
rv = interface.input(_("QUESTION"), prompt, default=empty, cancel=Jump("android"))
|
||||
|
||||
rv = rv.strip()
|
||||
|
||||
if rv:
|
||||
return rv
|
||||
|
||||
def choice(self, prompt, choices, default):
|
||||
return interface.choice(prompt, choices, default, cancel=Jump("android"))
|
||||
|
||||
def fail(self, prompt, edit=True):
|
||||
self.log(prompt)
|
||||
prompt = re.sub(r'(http://\S+)', r'{a=\1}\1{/a}', prompt)
|
||||
|
||||
# Open android.txt in the editor.
|
||||
if edit:
|
||||
editor.EditAbsolute(self.filename)()
|
||||
|
||||
interface.error(prompt, label="android")
|
||||
|
||||
def success(self, prompt):
|
||||
self.log(prompt)
|
||||
interface.info(prompt, pause=False)
|
||||
|
||||
def final_success(self, prompt):
|
||||
self.log(prompt)
|
||||
interface.info(prompt, label="android")
|
||||
|
||||
def call(self, cmd, cancel=False, use_path=False):
|
||||
|
||||
if not use_path:
|
||||
cmd = [ rapt.plat.path(cmd[0]) ] + list(cmd[1:])
|
||||
|
||||
self.cmd = cmd
|
||||
|
||||
f = open(self.filename, "a")
|
||||
|
||||
f.write("\n\n\n")
|
||||
|
||||
if cancel:
|
||||
cancel_action = self.cancel
|
||||
else:
|
||||
cancel_action = None
|
||||
|
||||
startupinfo = None
|
||||
if renpy.windows:
|
||||
startupinfo = subprocess.STARTUPINFO()
|
||||
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
||||
|
||||
try:
|
||||
interface.processing(self.info_msg, show_screen=True, cancel=cancel_action)
|
||||
self.process = subprocess.Popen(cmd, cwd=RAPT_PATH, stdout=f, stderr=f, startupinfo=startupinfo)
|
||||
renpy.call_screen("android_process", interface=self)
|
||||
finally:
|
||||
f.close()
|
||||
interface.hide_screen()
|
||||
self.process = None
|
||||
|
||||
def check_process(self):
|
||||
rv = self.process.poll()
|
||||
|
||||
if rv is not None:
|
||||
if rv:
|
||||
raise subprocess.CalledProcessError(rv, self.cmd)
|
||||
else:
|
||||
return True
|
||||
|
||||
def download(self, url, dest):
|
||||
try:
|
||||
d = Downloader(url, dest)
|
||||
cancel_action = [ d.cancel, Jump("android") ]
|
||||
interface.processing(self.info_msg, show_screen=True, cancel=cancel_action, bar_value=DownloaderValue(d))
|
||||
ui.timer(.1, action=d.check, repeat=True)
|
||||
ui.interact()
|
||||
finally:
|
||||
interface.hide_screen()
|
||||
|
||||
def background(self, f):
|
||||
try:
|
||||
t = threading.Thread(target=f)
|
||||
t.start()
|
||||
|
||||
interface.processing(self.info_msg, show_screen=True)
|
||||
|
||||
while t.is_alive():
|
||||
renpy.pause(0)
|
||||
t.join(0.25)
|
||||
|
||||
finally:
|
||||
interface.hide_screen()
|
||||
|
||||
|
||||
def cancel(self):
|
||||
if self.process:
|
||||
self.process.terminate()
|
||||
|
||||
renpy.jump("android")
|
||||
|
||||
|
||||
class AndroidBuild(Action):
|
||||
"""
|
||||
@@ -167,6 +280,22 @@ init python:
|
||||
def __call__(self):
|
||||
renpy.jump(self.label)
|
||||
|
||||
class LaunchEmulator(Action):
|
||||
|
||||
def __init__(self, emulator, variants):
|
||||
self.emulator = emulator
|
||||
self.variants = variants
|
||||
|
||||
def __call__(self):
|
||||
|
||||
env = {
|
||||
"RENPY_EMULATOR" : self.emulator,
|
||||
"RENPY_VARIANT" : self.variants,
|
||||
}
|
||||
|
||||
p = project.current
|
||||
p.launch(env=env)
|
||||
|
||||
def update_android_json(p, gui):
|
||||
"""
|
||||
Updates .android.json to include the google play information.
|
||||
@@ -179,26 +308,30 @@ init python:
|
||||
|
||||
build = p.dump["build"]
|
||||
|
||||
c = rapt.configure.Configuration(p.path)
|
||||
filename = os.path.join(p.path, ".android.json")
|
||||
|
||||
with open(filename, "r") as f:
|
||||
android_json = json.load(f)
|
||||
|
||||
if "google_play_key" in build:
|
||||
c.google_play_key = build["google_play_key"]
|
||||
android_json["google_play_key"] = build["google_play_key"]
|
||||
else:
|
||||
c.google_play_key = None
|
||||
android_json.pop("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.")
|
||||
|
||||
c.google_play_salt = ", ".join(str(i) for i in build["google_play_salt"])
|
||||
android_json["google_play_salt"] = ", ".join(str(i) for i in build["google_play_salt"])
|
||||
else:
|
||||
c.google_play_salt = None
|
||||
|
||||
c.save(p.path)
|
||||
android_json.pop("google_play_salt", None)
|
||||
|
||||
|
||||
def android_build(p=None, gui=True, bundle=False, install=False, launch=False, destination=None, opendir=False, packages=None):
|
||||
with open(filename, "w") as f:
|
||||
json.dump(android_json, f)
|
||||
|
||||
def android_build(command, p=None, gui=True):
|
||||
"""
|
||||
This actually builds the package.
|
||||
"""
|
||||
@@ -215,88 +348,22 @@ init python:
|
||||
|
||||
if gui:
|
||||
reporter = distribute.GuiReporter()
|
||||
rapt_interface = MobileInterface("android")
|
||||
rapt_interface = AndroidInterface()
|
||||
else:
|
||||
reporter = distribute.TextReporter()
|
||||
rapt_interface = rapt.interface.Interface()
|
||||
|
||||
if not packages:
|
||||
packages = ['android']
|
||||
|
||||
distribute.Distributor(p,
|
||||
distribute.Distributor(project.current,
|
||||
reporter=reporter,
|
||||
packages=packages,
|
||||
packages=[ 'android' ],
|
||||
build_update=False,
|
||||
noarchive=True,
|
||||
packagedest=dist,
|
||||
report_success=False,
|
||||
)
|
||||
|
||||
def finished(files, destination=destination):
|
||||
|
||||
source_dir = rapt.plat.path("bin")
|
||||
|
||||
try:
|
||||
|
||||
destination_dir = destination
|
||||
|
||||
# Use default destination if not configured
|
||||
if gui and destination is None:
|
||||
build = p.dump['build']
|
||||
destination = build["destination"]
|
||||
|
||||
if destination != "-dists":
|
||||
parent = os.path.dirname(p.path)
|
||||
destination_dir = os.path.join(parent, destination)
|
||||
|
||||
except Exception:
|
||||
destination_dir = None
|
||||
|
||||
dir_to_open = source_dir
|
||||
|
||||
if destination_dir is not None:
|
||||
|
||||
reporter.info(_("Copying Android files to distributions directory."))
|
||||
|
||||
try:
|
||||
os.makedirs(destination_dir)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
try:
|
||||
|
||||
for i in files:
|
||||
shutil.copy(i, renpy.fsencode(destination_dir))
|
||||
|
||||
dir_to_open = destination_dir
|
||||
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
pass
|
||||
|
||||
if opendir:
|
||||
dir_to_open = os.path.join(p.path, dir_to_open)
|
||||
renpy.run(store.OpenDirectory(dir_to_open, absolute=True))
|
||||
|
||||
|
||||
with interface.nolinks():
|
||||
rapt.build.build(
|
||||
rapt_interface,
|
||||
dist,
|
||||
p.path,
|
||||
bundle=bundle,
|
||||
install=install,
|
||||
launch=launch,
|
||||
finished=finished,
|
||||
permissions=p.dump['build']['android_permissions'],
|
||||
version=p.dump['build']['version'])
|
||||
|
||||
|
||||
def android_build_argument(cmd):
|
||||
return cmd + project.current.data["android_build"]
|
||||
|
||||
|
||||
rapt.build.build(rapt_interface, dist, command)
|
||||
|
||||
# The android support can stick unicode into os.environ. Fix that.
|
||||
init 100 python:
|
||||
@@ -313,7 +380,7 @@ screen android_process(interface):
|
||||
text "[ft.text!q]":
|
||||
size 14
|
||||
color TEXT
|
||||
font gui.LIGHT_FONT
|
||||
font "Roboto-Light.ttf"
|
||||
xpos 75
|
||||
ypos 350
|
||||
|
||||
@@ -334,7 +401,7 @@ screen android:
|
||||
|
||||
has vbox
|
||||
|
||||
label _("Android: [project.current.display_name!q]")
|
||||
label _("Android: [project.current.name!q]")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
@@ -360,19 +427,18 @@ screen android:
|
||||
|
||||
frame style "l_indent":
|
||||
|
||||
has hbox:
|
||||
spacing 15
|
||||
has vbox
|
||||
|
||||
textbutton _("Phone"):
|
||||
action LaunchEmulator("touch", "small phone touch android mobile")
|
||||
action LaunchEmulator("touch", "small phone touch android")
|
||||
hovered tt.Action(PHONE_TEXT)
|
||||
|
||||
textbutton _("Tablet"):
|
||||
action LaunchEmulator("touch", "medium tablet touch android mobile")
|
||||
action LaunchEmulator("touch", "medium tablet touch android")
|
||||
hovered tt.Action(TABLET_TEXT)
|
||||
|
||||
textbutton _("Television"):
|
||||
action LaunchEmulator("tv", "small tv android mobile")
|
||||
textbutton _("Television / OUYA"):
|
||||
action LaunchEmulator("tv", "small tv ouya android")
|
||||
hovered tt.Action(OUYA_TEXT)
|
||||
|
||||
|
||||
@@ -390,32 +456,15 @@ screen android:
|
||||
frame style "l_indent":
|
||||
|
||||
has vbox
|
||||
textbutton _("Install SDK"):
|
||||
|
||||
textbutton _("Install SDK & Create Keys"):
|
||||
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_KEY, Jump("android_configure"))
|
||||
action AndroidIfState(state, ANDROID_NO_CONFIG, Jump("android_configure"))
|
||||
hovered tt.Action(CONFIGURE_TEXT)
|
||||
|
||||
add SPACER
|
||||
|
||||
textbutton _("Play Bundle"):
|
||||
action SetField(persistent, "android_bundle", True)
|
||||
hovered tt.Action(PLAY_BUNDLE_TEXT)
|
||||
style "l_checkbox"
|
||||
|
||||
textbutton _("Universal APK"):
|
||||
action SetField(persistent, "android_bundle", False)
|
||||
hovered tt.Action(UNIVERSAL_APK_TEXT)
|
||||
style "l_checkbox"
|
||||
|
||||
add SPACER
|
||||
|
||||
textbutton _("Build Package"):
|
||||
action AndroidIfState(state, ANDROID_OK, AndroidBuild("android_build"))
|
||||
hovered tt.Action(BUILD_TEXT)
|
||||
@@ -424,13 +473,6 @@ screen android:
|
||||
action AndroidIfState(state, ANDROID_OK, AndroidBuild("android_build_and_install"))
|
||||
hovered tt.Action(BUILD_AND_INSTALL_TEXT)
|
||||
|
||||
textbutton _("Build, Install & Launch"):
|
||||
action AndroidIfState(state, ANDROID_OK, AndroidBuild("android_build_install_and_launch"))
|
||||
hovered tt.Action(BUILD_INSTALL_AND_LAUNCH_TEXT)
|
||||
|
||||
add SPACER
|
||||
|
||||
textbutton _("Force Recompile") action DataToggle("force_recompile") style "l_checkbox"
|
||||
|
||||
|
||||
# Right side.
|
||||
@@ -443,45 +485,6 @@ screen android:
|
||||
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Other:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
frame style "l_indent":
|
||||
|
||||
has vbox
|
||||
|
||||
textbutton _("Logcat"):
|
||||
action AndroidIfState(state, ANDROID_NO_KEY, Jump("logcat"))
|
||||
hovered tt.Action(LOGCAT_TEXT)
|
||||
|
||||
textbutton _("List Devices"):
|
||||
action AndroidIfState(state, ANDROID_NO_KEY, Jump("android_list_devices"))
|
||||
hovered tt.Action(LIST_DEVICES_TEXT)
|
||||
|
||||
textbutton _("Wi-Fi Debugging Pair"):
|
||||
action AndroidIfState(state, ANDROID_NO_KEY, Jump("android_pair"))
|
||||
hovered tt.Action(PAIR_TEXT)
|
||||
|
||||
textbutton _("Wi-Fi Debugging Connect"):
|
||||
action AndroidIfState(state, ANDROID_NO_KEY, Jump("android_connect"))
|
||||
hovered tt.Action(CONNECT_TEXT)
|
||||
|
||||
textbutton _("Wi-Fi Debugging Disconnect"):
|
||||
action AndroidIfState(state, ANDROID_NO_KEY, Jump("android_disconnect"))
|
||||
hovered tt.Action(DISCONNECT_TEXT)
|
||||
|
||||
textbutton _("Clean"):
|
||||
action AndroidIfState(state, ANDROID_NO_KEY, Jump("android_clean"))
|
||||
hovered tt.Action(CLEAN_TEXT)
|
||||
|
||||
add SPACER
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
@@ -494,7 +497,7 @@ screen android:
|
||||
text AndroidStateText(state)
|
||||
|
||||
|
||||
textbutton _("Return") action Jump("front_page") style "l_left_button"
|
||||
textbutton _("Back") action Jump("front_page") style "l_left_button"
|
||||
|
||||
|
||||
label android:
|
||||
@@ -510,15 +513,7 @@ label android_installsdk:
|
||||
|
||||
python:
|
||||
with interface.nolinks():
|
||||
rapt.install_sdk.install_sdk(MobileInterface("android"))
|
||||
|
||||
jump android
|
||||
|
||||
|
||||
label android_keys:
|
||||
|
||||
python:
|
||||
rapt.keys.generate_keys(MobileInterface("android"), project.current.path)
|
||||
rapt.install_sdk.install_sdk(AndroidInterface())
|
||||
|
||||
jump android
|
||||
|
||||
@@ -526,210 +521,38 @@ label android_keys:
|
||||
label android_configure:
|
||||
|
||||
python:
|
||||
project.current.update_dump(force=True)
|
||||
|
||||
rapt.configure.configure(
|
||||
MobileInterface("android", edit=False),
|
||||
project.current.path,
|
||||
default_name=project.current.dump.get("name", None),
|
||||
default_version=project.current.dump.get("version", None))
|
||||
rapt.configure.configure(AndroidInterface(), project.current.path)
|
||||
|
||||
jump android
|
||||
|
||||
|
||||
label android_build:
|
||||
|
||||
$ android_build(bundle=persistent.android_bundle, opendir=True)
|
||||
$ android_build([ 'release' ])
|
||||
|
||||
jump android
|
||||
|
||||
|
||||
label android_build_and_install:
|
||||
|
||||
$ android_build(bundle=persistent.android_bundle, install=True, opendir=True)
|
||||
$ android_build([ 'release', 'install' ])
|
||||
|
||||
jump android
|
||||
|
||||
label android_build_install_and_launch:
|
||||
|
||||
$ android_build(bundle=persistent.android_bundle, install=True, launch=True, opendir=True)
|
||||
|
||||
jump android
|
||||
|
||||
label logcat:
|
||||
|
||||
python hide:
|
||||
|
||||
interface = MobileInterface("android", filename="logcat.txt")
|
||||
interface.info(_("Retrieving logcat information from device."))
|
||||
interface.call([ rapt.plat.adb, "logcat", "-d" ], cancel=True)
|
||||
interface.open_editor()
|
||||
|
||||
jump android
|
||||
|
||||
label android_list_devices:
|
||||
|
||||
python hide:
|
||||
cc = ConsoleCommand()
|
||||
cc.add(rapt.plat.adb, "devices")
|
||||
cc.run()
|
||||
|
||||
jump android
|
||||
|
||||
|
||||
label android_pair:
|
||||
|
||||
python hide:
|
||||
pairing_code = interface.input(
|
||||
_("Wi-Fi Pairing Code"),
|
||||
_("If supported, this can be found in 'Developer options', 'Wireless debugging', 'Pair device with pairing code'."),
|
||||
sanitize=False,
|
||||
cancel=Jump("android"),
|
||||
)
|
||||
|
||||
host = interface.input(
|
||||
_("Pairing Host & Port"),
|
||||
_("If supported, this can be found in 'Developer options', 'Wireless debugging', 'Pair device with pairing code'."),
|
||||
sanitize=False,
|
||||
cancel=Jump("android"),
|
||||
)
|
||||
|
||||
cc = ConsoleCommand()
|
||||
cc.add(rapt.plat.adb, "pair", host, pairing_code)
|
||||
cc.run()
|
||||
|
||||
jump android
|
||||
|
||||
label android_connect:
|
||||
|
||||
python hide:
|
||||
host = interface.input(
|
||||
_("IP Address & Port"),
|
||||
_("If supported, this can be found in 'Developer options', 'Wireless debugging'."),
|
||||
sanitize=False,
|
||||
cancel=Jump("android"),
|
||||
)
|
||||
|
||||
cc = ConsoleCommand()
|
||||
cc.add(rapt.plat.adb, "connect", host)
|
||||
cc.run()
|
||||
|
||||
jump android
|
||||
|
||||
label android_disconnect:
|
||||
|
||||
python hide:
|
||||
host = interface.input(
|
||||
_("IP Address & Port"),
|
||||
_("This can be found in 'List Devices'."),
|
||||
sanitize=False,
|
||||
cancel=Jump("android"),
|
||||
)
|
||||
|
||||
cc = ConsoleCommand()
|
||||
cc.add(rapt.plat.adb, "disconnect", host)
|
||||
cc.run()
|
||||
|
||||
jump android
|
||||
|
||||
label android_clean:
|
||||
|
||||
python hide:
|
||||
import shutil
|
||||
import time
|
||||
|
||||
interface = MobileInterface("android")
|
||||
interface.info(_("Cleaning up Android project."))
|
||||
|
||||
# Get the android json file, for the update_always key.
|
||||
try:
|
||||
filename = os.path.join(project.current.path, ".android.json")
|
||||
with open(filename, "rb") as f:
|
||||
android_json = json.load(f)
|
||||
except Exception:
|
||||
android_json = {}
|
||||
|
||||
# Clean up the files.
|
||||
def clean(path):
|
||||
if os.path.exists(path):
|
||||
shutil.rmtree(path)
|
||||
|
||||
if android_json.get("update_always", True):
|
||||
|
||||
try:
|
||||
with open(rapt.plat.path("project/local.properties"), "r") as f:
|
||||
local_properties = f.read()
|
||||
except Exception:
|
||||
local_properties = None
|
||||
|
||||
try:
|
||||
with open(rapt.plat.path("project/bundle.properties"), "r") as f:
|
||||
bundle_properties = f.read()
|
||||
except Exception:
|
||||
bundle_properties = None
|
||||
|
||||
try:
|
||||
with open(rapt.plat.path("project/gradle.properties"), "r") as f:
|
||||
gradle_properties = f.read()
|
||||
except Exception:
|
||||
gradle_properties = None
|
||||
|
||||
clean(rapt.plat.path("project"))
|
||||
|
||||
if local_properties or bundle_properties or gradle_properties:
|
||||
|
||||
os.mkdir(rapt.plat.path("project"))
|
||||
|
||||
if local_properties:
|
||||
|
||||
with open(rapt.plat.path("project/local.properties"), "w") as f:
|
||||
f.write(local_properties)
|
||||
|
||||
if bundle_properties:
|
||||
|
||||
with open(rapt.plat.path("project/bundle.properties"), "w") as f:
|
||||
f.write(bundle_properties)
|
||||
|
||||
if gradle_properties:
|
||||
|
||||
with open(rapt.plat.path("project/gradle.properties"), "w") as f:
|
||||
f.write(gradle_properties)
|
||||
|
||||
clean(rapt.plat.path("bin"))
|
||||
clean(project.current.temp_filename("android.dist"))
|
||||
|
||||
# This can go really fast, so pause so it looks like something is happening.
|
||||
time.sleep(.5)
|
||||
|
||||
|
||||
jump android
|
||||
|
||||
|
||||
init python:
|
||||
|
||||
def android_build_command():
|
||||
ap = renpy.arguments.ArgumentParser()
|
||||
ap.add_argument("android_project", help="The path to the project directory.")
|
||||
ap.add_argument("--bundle", action="store_true", help="Builds an android app bundle.")
|
||||
ap.add_argument("--install", action="store_true", help="Installs the app on a device.")
|
||||
ap.add_argument("--launch", action="store_true", help="Launches the app after build and install complete. Implies --install.")
|
||||
ap.add_argument("--destination", "--dest", default=None, action="store", help="The directory where the packaged files should be placed.")
|
||||
ap.add_argument("--package", action="append", help="If given, a package to build. Defaults to building the 'android' package.")
|
||||
ap.add_argument("project", help="The path to the project directory.")
|
||||
ap.add_argument("command", help="Commands to pass to ant. (Try 'release' 'install'.)", nargs='+')
|
||||
|
||||
args = ap.parse_args()
|
||||
|
||||
if args.launch:
|
||||
args.install = True
|
||||
p = project.Project(args.project)
|
||||
|
||||
p = project.Project(args.android_project)
|
||||
|
||||
if args.package:
|
||||
packages = args.package
|
||||
else:
|
||||
packages = None
|
||||
|
||||
android_build(p=p, gui=False, bundle=args.bundle, install=args.install, launch=args.launch, destination=args.destination, packages=packages)
|
||||
android_build(args.command, p=p, gui=False)
|
||||
|
||||
return False
|
||||
|
||||
renpy.arguments.register_command("android_build", android_build_command)
|
||||
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
|
||||
# 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.
|
||||
|
||||
init python hide:
|
||||
__("{} is not a directory.")
|
||||
__("{} does not contain a Ren'Py game.")
|
||||
__("{} does not contain a Ren'Py game.")
|
||||
__("Run configure before attempting to build the app.")
|
||||
__("Updating project.")
|
||||
__("Creating assets directory.")
|
||||
__("Packaging internal data.")
|
||||
__("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.")
|
||||
__("Launching app.")
|
||||
__("Launching the app appears to have failed.")
|
||||
__("The build seems to have succeeded.")
|
||||
__("What is the full name of your application? This name will appear in the list of installed applications.")
|
||||
__("What is the short name of your application? This name will be used in the launcher, and for application shortcuts.")
|
||||
__("What is the name of the package?\n\nThis is usually of the form com.domain.program or com.domain.email.program. It may only contain ASCII letters and dots. It must contain at least one dot.")
|
||||
__("The package name may not be empty.")
|
||||
__("The package name may not contain spaces.")
|
||||
__("The package name must contain at least one dot.")
|
||||
__("The package name may not contain two dots in a row, or begin or end with a dot.")
|
||||
__("Each part of the package name must start with a letter, and contain only letters, numbers, and underscores.")
|
||||
__("{} is a Java keyword, and can't be used as part of a package name.")
|
||||
__("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: {}")
|
||||
__("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}https://adoptium.net/{/a}\n\nThe JDK is different from the JRE, so it's possible you have Java without having the JDK. Please install JDK [JDK_REQUIREMENT], and add it to your PATH.\n\nWithout a working JDK, I can't continue.")
|
||||
__("The version of Java on your computer does not appear to be JDK [JDK_REQUIREMENT], which is required to build Android apps. If you need to install a newer JDK, you can download it from:\n\n{a=https://adoptium.net/}https://adoptium.net/{/a}, and add it to your PATH.\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?")
|
||||
__("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 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?")
|
||||
__("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've opened the directory containing android.keystore and bundle.keystore. Please back them up, and keep them in a safe place.")
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -28,9 +28,8 @@ init python in archiver:
|
||||
import sys
|
||||
import random
|
||||
import glob
|
||||
import zlib
|
||||
|
||||
from pickle import dumps, HIGHEST_PROTOCOL
|
||||
from cPickle import dumps, HIGHEST_PROTOCOL
|
||||
|
||||
|
||||
class Archive(object):
|
||||
@@ -49,7 +48,7 @@ init python in archiver:
|
||||
# A fixed key minimizes difference between archive versions.
|
||||
self.key = 0x42424242
|
||||
|
||||
padding = b"RPA-3.0 XXXXXXXXXXXXXXXX XXXXXXXX\n"
|
||||
padding = "RPA-3.0 XXXXXXXXXXXXXXXX XXXXXXXX\n"
|
||||
self.f.write(padding)
|
||||
|
||||
def add(self, name, path):
|
||||
@@ -64,23 +63,23 @@ init python in archiver:
|
||||
dlen = len(data)
|
||||
|
||||
# Pad.
|
||||
padding = b"Made with Ren'Py."
|
||||
padding = "Made with Ren'Py."
|
||||
self.f.write(padding)
|
||||
|
||||
offset = self.f.tell()
|
||||
|
||||
self.f.write(data)
|
||||
|
||||
self.index[name].append((offset ^ self.key, dlen ^ self.key, b""))
|
||||
self.index[name].append((offset ^ self.key, dlen ^ self.key, ""))
|
||||
|
||||
def close(self):
|
||||
|
||||
indexoff = self.f.tell()
|
||||
|
||||
self.f.write(zlib.compress(dumps(self.index, HIGHEST_PROTOCOL)))
|
||||
self.f.write(dumps(self.index, HIGHEST_PROTOCOL).encode("zlib"))
|
||||
|
||||
self.f.seek(0)
|
||||
self.f.write(b"RPA-3.0 %016x %08x\n" % (indexoff, self.key))
|
||||
self.f.write("RPA-3.0 %016x %08x\n" % (indexoff, self.key))
|
||||
|
||||
self.f.close()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -19,42 +19,38 @@
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
# http://www.csn.ul.ie/~caolan/publink/winresdump/winresdump/doc/pefile.html
|
||||
# Contains a reasonable description of the format.
|
||||
|
||||
from __future__ import print_function
|
||||
from renpy.compat import bchr, chr, str, PY2
|
||||
|
||||
import struct
|
||||
import sys
|
||||
import array
|
||||
import pefile
|
||||
|
||||
import pefile # @UnresolvedImport
|
||||
|
||||
# This class performs various operations on memory-loaded binary files,
|
||||
# including modifications.
|
||||
|
||||
class BinFile(object):
|
||||
|
||||
def set_u32(self, addr, value):
|
||||
self.a[addr + 0] = (value >> 0) & 0xff
|
||||
self.a[addr + 1] = (value >> 8) & 0xff
|
||||
self.a[addr + 2] = (value >> 16) & 0xff
|
||||
self.a[addr + 3] = (value >> 24) & 0xff
|
||||
self.a[addr+0] = (value >> 0) & 0xff
|
||||
self.a[addr+1] = (value >> 8) & 0xff
|
||||
self.a[addr+2] = (value >> 16) & 0xff
|
||||
self.a[addr+3] = (value >> 24) & 0xff
|
||||
|
||||
def u32(self):
|
||||
addr = self.addr
|
||||
rv = self.a[addr]
|
||||
rv |= self.a[addr + 1] << 8
|
||||
rv |= self.a[addr + 2] << 16
|
||||
rv |= self.a[addr + 3] << 24
|
||||
rv |= self.a[addr+1] << 8
|
||||
rv |= self.a[addr+2] << 16
|
||||
rv |= self.a[addr+3] << 24
|
||||
self.addr += 4
|
||||
return rv
|
||||
|
||||
def u16(self):
|
||||
addr = self.addr
|
||||
rv = self.a[addr]
|
||||
rv |= self.a[addr + 1] << 8
|
||||
rv |= self.a[addr+1] << 8
|
||||
self.addr += 2
|
||||
return rv
|
||||
|
||||
@@ -68,7 +64,7 @@ class BinFile(object):
|
||||
|
||||
rv = u""
|
||||
for _i in range(c):
|
||||
rv += chr(self.u16())
|
||||
rv += unichr(self.u16())
|
||||
|
||||
return rv
|
||||
|
||||
@@ -76,26 +72,23 @@ class BinFile(object):
|
||||
self.addr = addr
|
||||
|
||||
def tostring(self):
|
||||
return self.a.tobytes()
|
||||
return self.a.tostring()
|
||||
|
||||
def substring(self, start, len): # @ReservedAssignment
|
||||
return self.a[start:start + len].tobytes()
|
||||
def substring(self, start, len): #@ReservedAssignment
|
||||
return self.a[start:start+len].tostring()
|
||||
|
||||
def __init__(self, data):
|
||||
self.a = array.array('B')
|
||||
self.a.frombytes(data)
|
||||
self.a.fromstring(data)
|
||||
|
||||
##############################################################################
|
||||
# These functions parse data out of the file. In these functions, offset is
|
||||
# relative to the start of the file.
|
||||
|
||||
|
||||
# The virtual address of the resource segment.
|
||||
resource_virtual = 0
|
||||
|
||||
# This parses a data block out of the resources.
|
||||
|
||||
|
||||
def parse_data(bf, offset):
|
||||
bf.seek(offset)
|
||||
data_offset = bf.u32()
|
||||
@@ -107,20 +100,18 @@ def parse_data(bf, offset):
|
||||
|
||||
bf.seek(data_offset - resource_virtual)
|
||||
for _i in range(data_len):
|
||||
l.append(bchr(bf.u8()))
|
||||
l.append(chr(bf.u8()))
|
||||
|
||||
return (code_page, b"".join(l))
|
||||
return (code_page, "".join(l))
|
||||
|
||||
# This parses a resource directory.
|
||||
|
||||
|
||||
def parse_directory(bf, offset):
|
||||
|
||||
bf.seek(offset)
|
||||
char = bf.u32() # @UnusedVariable
|
||||
timedate = bf.u32() # @UnusedVariable
|
||||
major = bf.u16() # @UnusedVariable
|
||||
minor = bf.u16() # @UnusedVariable
|
||||
char = bf.u32() #@UnusedVariable
|
||||
timedate = bf.u32() #@UnusedVariable
|
||||
major = bf.u16() #@UnusedVariable
|
||||
minor = bf.u16() #@UnusedVariable
|
||||
n_named = bf.u16()
|
||||
n_id = bf.u16()
|
||||
|
||||
@@ -152,33 +143,32 @@ def parse_directory(bf, offset):
|
||||
def show_resources(d, prefix):
|
||||
|
||||
if not isinstance(d, dict):
|
||||
print(prefix, "Codepage", d[0], "length", len(d[1]))
|
||||
print prefix, "Codepage", d[0], "length", len(d[1])
|
||||
return
|
||||
|
||||
for k in d:
|
||||
print(prefix, k)
|
||||
print prefix, k
|
||||
show_resources(d[k], prefix + " ")
|
||||
|
||||
##############################################################################
|
||||
# These functions repack the resources into a new resource segment. Here,
|
||||
# the offset is relative to the start of the resource segment.
|
||||
|
||||
|
||||
class Packer(object):
|
||||
|
||||
def pack(self, d):
|
||||
self.data = b""
|
||||
self.data = ""
|
||||
self.data_offset = 0
|
||||
|
||||
self.entries = b""
|
||||
self.entries = ""
|
||||
self.entries_offset = 0
|
||||
|
||||
head = self.pack_dict(d, 0)
|
||||
|
||||
self.data = b""
|
||||
self.data = ""
|
||||
self.data_offset = len(head) + len(self.entries)
|
||||
|
||||
self.entries = b""
|
||||
self.entries = ""
|
||||
self.entries_offset = len(head)
|
||||
|
||||
return self.pack_dict(d, 0) + self.entries + self.data
|
||||
@@ -188,7 +178,7 @@ class Packer(object):
|
||||
|
||||
l = len(s)
|
||||
s = s.encode("utf-16le")
|
||||
self.data += struct.pack("<H", l) + s + b"\0\0"
|
||||
self.data += struct.pack("<H", l) + s + "\0\0"
|
||||
|
||||
return rv
|
||||
|
||||
@@ -198,7 +188,7 @@ class Packer(object):
|
||||
rv = len(self.entries) + self.entries_offset
|
||||
|
||||
if len(self.data) % 2:
|
||||
self.data += b"P"
|
||||
self.data += "P"
|
||||
|
||||
daddr = len(self.data) + self.data_offset
|
||||
|
||||
@@ -211,17 +201,17 @@ class Packer(object):
|
||||
return rv
|
||||
|
||||
def pack_dict(self, d, offset):
|
||||
name_entries = sorted((a, b) for a, b in d.items() if isinstance(a, str))
|
||||
id_entries = sorted((a, b) for a, b in d.items() if isinstance(a, int))
|
||||
name_entries = sorted((a, b) for a, b in d.iteritems() if isinstance(a, unicode))
|
||||
id_entries = sorted((a, b) for a, b in d.iteritems() if isinstance(a, int))
|
||||
|
||||
rv = struct.pack("<IIHHHH", 0, 0, 4, 0, len(name_entries), len(id_entries))
|
||||
|
||||
offset += len(rv) + (len(name_entries) + len(id_entries)) * 8
|
||||
|
||||
rest = b""
|
||||
rest = ""
|
||||
|
||||
for (name, value) in name_entries + id_entries:
|
||||
if isinstance(name, str):
|
||||
if isinstance(name, unicode):
|
||||
name = 0x80000000 | self.pack_name(name)
|
||||
|
||||
if isinstance(value, dict):
|
||||
@@ -239,10 +229,8 @@ class Packer(object):
|
||||
##############################################################################
|
||||
# This loads in an icon file, and returns a dictionary that is suitable for
|
||||
# use in the resources of an exe file.
|
||||
|
||||
|
||||
def load_icon(fn):
|
||||
f = BinFile(open(fn, "rb").read())
|
||||
f = BinFile(file(fn, "rb").read())
|
||||
|
||||
f.seek(0)
|
||||
f.u16()
|
||||
@@ -269,17 +257,15 @@ def load_icon(fn):
|
||||
if not f.u32():
|
||||
f.set_u32(offset + 20, 0)
|
||||
|
||||
#rv[3][i + 1] = { 0 : (1252, f.substring(offset, size)) }
|
||||
#I do not have justification for the 0x0409 entry ID, other than copying what other files do. Same for codepage of 0
|
||||
rv[3][i + 1] = { 1033 : (0, f.substring(offset, size)) }
|
||||
rv[3][i + 1] = { 0 : (1252, f.substring(offset, size)) }
|
||||
|
||||
|
||||
group += struct.pack("BBBBHHIH", width, height, colors, reserved,
|
||||
planes, bpp, size, i + 1)
|
||||
|
||||
f.seek(addr)
|
||||
|
||||
#rv[14] = { 1 : { 0 : (1252, group) } }
|
||||
rv[14] = { 1 : { 1033 : (0, group) } }
|
||||
rv[14] = { 1 : { 0 : (1252, group) } }
|
||||
|
||||
return rv
|
||||
|
||||
@@ -293,7 +279,7 @@ def change_icons(oldexe, icofn):
|
||||
pe = pefile.PE(oldexe)
|
||||
|
||||
for s in pe.sections:
|
||||
if s.Name == b".rsrc\0\0\0":
|
||||
if s.Name == ".rsrc\0\0\0":
|
||||
rsrc_section = s
|
||||
break
|
||||
else:
|
||||
@@ -305,24 +291,9 @@ def change_icons(oldexe, icofn):
|
||||
physize = rsrc_section.SizeOfRawData
|
||||
virsize = rsrc_section.Misc_VirtualSize
|
||||
|
||||
f = open(oldexe, "rb")
|
||||
basedata = f.read(base)
|
||||
f = file(oldexe, "rb")
|
||||
f.seek(base)
|
||||
data = f.read(physize)
|
||||
|
||||
#Symbol table, I could not understand so well
|
||||
# Some analysis and the little I could find on how the symbol tables were layed out show that the PE table is in two sections. One is
|
||||
# a list of NumberOfSymbols*(18 bytes) symbol entries, followed immediately by a string table who's length is specified in the 4 bytes following the symbol structure list
|
||||
#Again, the information *seems* to indicate that this will always follow the entire block of all sections (so be at the end of the file)
|
||||
|
||||
|
||||
######
|
||||
# As a related note, apparently this flag has been deprecated, but appears to be set (I think ..) in the renpy.exe that is used to build from..
|
||||
# no idea of a consequence, just an observation
|
||||
# https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#characteristics , see "IMAGE_FILE_LINE_NUMS_STRIPPED" :
|
||||
# COFF line numbers have been removed. This flag is deprecated and should be zero.
|
||||
# In renpy.exe, this 2-byte flag is @ 0x096 and 0x097 in little-endian
|
||||
######
|
||||
|
||||
f.close()
|
||||
|
||||
bf = BinFile(data)
|
||||
@@ -334,85 +305,45 @@ def change_icons(oldexe, icofn):
|
||||
|
||||
rsrc = Packer().pack(resources)
|
||||
|
||||
newExactSize = len(rsrc)
|
||||
alignment = pe.OPTIONAL_HEADER.SectionAlignment
|
||||
|
||||
#From note about flags above regarding image flags. These two should be 0
|
||||
pe.FILE_HEADER.Characteristics = pe.FILE_HEADER.Characteristics & (~pefile.IMAGE_CHARACTERISTICS["IMAGE_FILE_LINE_NUMS_STRIPPED"])
|
||||
pe.FILE_HEADER.Characteristics = pe.FILE_HEADER.Characteristics & (~pefile.IMAGE_CHARACTERISTICS["IMAGE_FILE_LOCAL_SYMS_STRIPPED"])
|
||||
# print "Alignment is", alignment
|
||||
|
||||
#Per docs, symbol table can just be removed
|
||||
#https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#coff-file-header-object-and-image see "PointerToSymbolTable" and "NumberOfSymbols "
|
||||
|
||||
pe.FILE_HEADER.PointerToSymbolTable = 0
|
||||
pe.FILE_HEADER.NumberOfSymbols = 0
|
||||
|
||||
#####
|
||||
# Alignment requirements as I understand them
|
||||
#
|
||||
# SectionAlignment (misnomer.. 'memory' alignment) = 4096
|
||||
# FileAlignment = 512
|
||||
#
|
||||
# Section, SizeOfRawData = multiple of FileAlignment (On Disk size)
|
||||
# Scetion, VirtualSize is NOT aligned to any specific number, and rwdata may be > than this due to its alignment requirement (In memory size)
|
||||
#
|
||||
# the resource section should be padded out to meet the alignment requirement of SizeOfRawData = multiple of FileAlignment (So, in the file, since on disk)
|
||||
#
|
||||
#####
|
||||
# RVA table virt address and size = that in the section header
|
||||
#
|
||||
#####
|
||||
# SizeOfImage must be aligned to SectionAlignment (memory alignment)
|
||||
# There is NO padding needed, the image size number simply needs to be aligned to >= the
|
||||
|
||||
memoryalignment = pe.OPTIONAL_HEADER.SectionAlignment
|
||||
filealignment = pe.OPTIONAL_HEADER.FileAlignment
|
||||
|
||||
rsrc_section.Misc_VirtualSize = newExactSize
|
||||
rsrc_section.Misc_PhysicalAddress = newExactSize
|
||||
rsrc_section.Misc = newExactSize
|
||||
|
||||
#Size of resource section (and pointer, but we're not changing anything 'above' resource) is the same as virtual address in the section table
|
||||
# https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#optional-header-data-directories-image-only
|
||||
pe.OPTIONAL_HEADER.DATA_DIRECTORY[2].Size = rsrc_section.Misc_VirtualSize
|
||||
|
||||
|
||||
#Alignment for raw data
|
||||
if len(rsrc) % filealignment:
|
||||
pad = filealignment - (len(rsrc) % filealignment)
|
||||
padding = b"\0" * (pad)
|
||||
if len(rsrc) % alignment:
|
||||
pad = alignment - (len(rsrc) % alignment)
|
||||
padding = "RENPYVNE" * (pad / 8 + 1)
|
||||
padding = padding[:pad]
|
||||
rsrc += padding
|
||||
rsrc_section.SizeOfRawData = len(rsrc)
|
||||
|
||||
newsize = len(rsrc)
|
||||
|
||||
#Image size is the memory size of all sections + all headers, padded to memory alignment.
|
||||
#There's already a header size, and this isn't changing headers, so just add.
|
||||
#imageSize = pe.OPTIONAL_HEADER.ImageBase + pe.OPTIONAL_HEADER.SizeOfHeaders
|
||||
imageSize = pe.OPTIONAL_HEADER.SizeOfHeaders
|
||||
for s in pe.sections:
|
||||
sectionSize = s.Misc_VirtualSize
|
||||
#Align every section, so add padding to size
|
||||
pad = 0
|
||||
if sectionSize % memoryalignment:
|
||||
pad = memoryalignment - (sectionSize % memoryalignment)
|
||||
imageSize += (sectionSize + pad)
|
||||
pad = 0
|
||||
if imageSize % memoryalignment:
|
||||
pad = memoryalignment - (imageSize % memoryalignment)
|
||||
pe.OPTIONAL_HEADER.SizeOfImage = imageSize + pad
|
||||
rsrc_section.Misc_VirtualSize += newsize - virsize
|
||||
rsrc_section.Misc_PhysicalAddress += newsize - virsize
|
||||
rsrc_section.Misc += newsize - virsize
|
||||
rsrc_section.SizeOfRawData += newsize - physize
|
||||
|
||||
pe.OPTIONAL_HEADER.SizeOfInitializedData += newsize - physize
|
||||
|
||||
#The symbol table is simply left off. Its size DOES factor into ImageSize, but we didn't calculate it above, so fine
|
||||
#Correctly checksum the file. The entire file is involved in the calculation, so a new PE object must be generated for the calculation to work against
|
||||
newFile = pe.write()[:base] + rsrc
|
||||
newpe = pefile.PE(data=bytes(newFile))
|
||||
newpe.OPTIONAL_HEADER.CheckSum = newpe.generate_checksum()
|
||||
# Resource size.
|
||||
pe.OPTIONAL_HEADER.DATA_DIRECTORY[2].Size += newsize - virsize
|
||||
|
||||
return bytes(newpe.write())
|
||||
# Compute the total size of the image.
|
||||
total_size = 0
|
||||
|
||||
for i in pe.sections:
|
||||
|
||||
sec_size = i.Misc_VirtualSize
|
||||
sec_size = sec_size - (sec_size % alignment) + alignment
|
||||
|
||||
total_size += sec_size
|
||||
|
||||
pe.OPTIONAL_HEADER.SizeOfImage = total_size
|
||||
|
||||
return pe.write()[:base] + rsrc
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
f = open(sys.argv[3], "wb")
|
||||
f = file(sys.argv[3], "wb")
|
||||
f.write(change_icons(sys.argv[1], sys.argv[2]))
|
||||
f.close()
|
||||
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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:
|
||||
|
||||
try:
|
||||
import _renpytfd
|
||||
except Exception:
|
||||
_renpytfd = None
|
||||
|
||||
def directory_is_writable(path):
|
||||
test = os.path.join(path, "renpy test do not use")
|
||||
|
||||
try:
|
||||
if os.path.isdir(test):
|
||||
os.rmdir(test)
|
||||
|
||||
os.mkdir(test)
|
||||
os.rmdir(test)
|
||||
|
||||
return True
|
||||
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def choose_directory(default_path):
|
||||
"""
|
||||
Pops up a directory chooser.
|
||||
|
||||
`path`
|
||||
The directory that is selected by default. If None, config.renpy_base
|
||||
is selected.
|
||||
|
||||
Returns a (path, is_default) tuple, where path is the chosen directory,
|
||||
and is_default is true if and only if it was chosen by default mechanism
|
||||
rather than user choice.
|
||||
"""
|
||||
|
||||
if _renpytfd:
|
||||
path = _renpytfd.selectFolderDialog(__("Select Projects Directory"), default_path)
|
||||
else:
|
||||
path = None
|
||||
|
||||
if default_path is None:
|
||||
try:
|
||||
default_path = os.path.dirname(os.path.abspath(config.renpy_base))
|
||||
except Exception:
|
||||
default_path = os.path.abspath(config.renpy_base)
|
||||
|
||||
# Path being None or "" means nothing was selected.
|
||||
if not path:
|
||||
|
||||
if default_path is None or not os.path.isdir(default_path) or not directory_is_writable(default_path):
|
||||
interface.error(_("No directory was selected, but one is required."))
|
||||
|
||||
return default_path, True
|
||||
|
||||
# Apply more thorough checks to an explicit path.
|
||||
path = renpy.fsdecode(path)
|
||||
|
||||
if not os.path.isdir(path):
|
||||
interface.error(_("The selected directory does not exist."))
|
||||
elif not directory_is_writable(path):
|
||||
interface.error(_("The selected directory is not writable."))
|
||||
|
||||
return path, False
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -85,25 +85,14 @@ init python:
|
||||
return theme, scheme
|
||||
|
||||
def implement_theme(theme, scheme):
|
||||
"""
|
||||
Implement the current theme.
|
||||
|
||||
This function uses non-public APIs.
|
||||
"""
|
||||
|
||||
global showing_theme, showing_scheme
|
||||
|
||||
if theme == showing_theme and scheme == showing_scheme:
|
||||
return
|
||||
|
||||
renpy.style.restore(style_backup)
|
||||
exec(theme_data.THEME[theme][scheme], globals(), globals())
|
||||
|
||||
# Rebuild the style cache.
|
||||
renpy.style.rebuild(False)
|
||||
|
||||
# Bust the render cache, so we re-evaluate the styles.
|
||||
renpy.display.interface.kill_textures()
|
||||
exec theme_data.THEME[theme][scheme] in globals()
|
||||
renpy.style.rebuild()
|
||||
|
||||
showing_theme = theme
|
||||
showing_scheme = scheme
|
||||
@@ -167,8 +156,8 @@ init python:
|
||||
|
||||
def list_logical_lines(filename):
|
||||
"""
|
||||
This reads in filename, and turns it into a list of logical
|
||||
lines.
|
||||
This reads in filename, and turns it into a list of logical
|
||||
lines.
|
||||
"""
|
||||
|
||||
f = codecs.open(filename, "rb", "utf-8")
|
||||
@@ -187,7 +176,7 @@ init python:
|
||||
# The line that we're building up.
|
||||
line = ""
|
||||
|
||||
# The number of open parenthesis there are right now.
|
||||
# The number of open parenthesis there are right now.
|
||||
parendepth = 0
|
||||
|
||||
# Looping over the characters in a single logical line.
|
||||
@@ -293,7 +282,7 @@ init python:
|
||||
if changed:
|
||||
try:
|
||||
os.unlink(filename + ".bak")
|
||||
except Exception:
|
||||
except:
|
||||
pass
|
||||
|
||||
os.rename(filename, filename + ".bak")
|
||||
@@ -322,7 +311,7 @@ init python:
|
||||
if changed:
|
||||
try:
|
||||
os.unlink(filename + ".bak")
|
||||
except Exception:
|
||||
except:
|
||||
pass
|
||||
|
||||
os.rename(filename, filename + ".bak")
|
||||
@@ -332,7 +321,7 @@ init python:
|
||||
try:
|
||||
# just in case
|
||||
os.unlink(filename + ".new")
|
||||
except Exception:
|
||||
except:
|
||||
pass
|
||||
pass
|
||||
|
||||
@@ -345,7 +334,8 @@ init python:
|
||||
global style_backup
|
||||
style_backup = renpy.style.backup()
|
||||
|
||||
config.change_language_callbacks.append(make_style_backup)
|
||||
translate None python:
|
||||
make_style_backup()
|
||||
|
||||
screen theme_demo:
|
||||
|
||||
@@ -397,23 +387,9 @@ init -2 python:
|
||||
|
||||
style.soundtest_button.xalign = 1.0
|
||||
|
||||
|
||||
screen choose_theme:
|
||||
|
||||
default scheme_yadjustment = ui.adjustment()
|
||||
default theme_yadjustment = ui.adjustment()
|
||||
|
||||
default first = True
|
||||
|
||||
python:
|
||||
if first:
|
||||
theme_yinitial_value = theme_yinitial()
|
||||
scheme_yinitial_value = scheme_yinitial()
|
||||
else:
|
||||
theme_yinitial_value = None
|
||||
scheme_yinitial_value = None
|
||||
|
||||
first = False
|
||||
|
||||
frame:
|
||||
style_group "l"
|
||||
style "l_root"
|
||||
@@ -439,9 +415,8 @@ screen choose_theme:
|
||||
|
||||
viewport:
|
||||
scrollbars "vertical"
|
||||
yinitial theme_yinitial()
|
||||
mousewheel True
|
||||
yadjustment theme_yadjustment
|
||||
yinitial theme_yinitial_value
|
||||
|
||||
has vbox
|
||||
|
||||
@@ -465,8 +440,7 @@ screen choose_theme:
|
||||
viewport:
|
||||
scrollbars "vertical"
|
||||
mousewheel True
|
||||
yadjustment scheme_yadjustment
|
||||
yinitial scheme_yinitial_value
|
||||
yinitial scheme_yinitial()
|
||||
|
||||
has vbox
|
||||
|
||||
@@ -491,7 +465,7 @@ screen choose_theme:
|
||||
|
||||
use theme_demo
|
||||
|
||||
textbutton _("Return") action Jump("front_page") style "l_left_button"
|
||||
textbutton _("Back") action Jump("front_page") style "l_left_button"
|
||||
textbutton _("Continue") action Return(True) style "l_right_button"
|
||||
|
||||
|
||||
@@ -504,7 +478,7 @@ label choose_theme_callable:
|
||||
call screen choose_theme
|
||||
|
||||
python hide:
|
||||
with interface.error_handling(_("changing the theme")):
|
||||
with interface.error_handling("changing the theme"):
|
||||
switch_theme()
|
||||
|
||||
return
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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:
|
||||
|
||||
class ConsoleCommand():
|
||||
"""
|
||||
This runs a series of console commands in an OS-provided
|
||||
console window. This is done by creating a shell script
|
||||
or batch file as appropriate, then using an OS-approved
|
||||
method to run that file.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
|
||||
if renpy.macintosh:
|
||||
fn = "console.command"
|
||||
nl = b"\n"
|
||||
prefix = "#!/bin/sh"
|
||||
elif renpy.windows:
|
||||
fn = "console.bat"
|
||||
nl = b"\r\n"
|
||||
prefix = "@echo off"
|
||||
else:
|
||||
fn = "console.sh"
|
||||
nl = b"\n"
|
||||
prefix = "#!/bin/bash"
|
||||
|
||||
|
||||
self.fn = project.current.temp_filename(fn)
|
||||
self.f = open(self.fn, "wb")
|
||||
self.nl = nl
|
||||
|
||||
self.f.write(renpy.fsencode(prefix, force=True) + nl)
|
||||
|
||||
def add(self, *args):
|
||||
"""
|
||||
Adds a command to be run.
|
||||
"""
|
||||
|
||||
args = [ b'"' + renpy.fsencode(i, force=True) + b'"' for i in args]
|
||||
self.f.write(b" ".join(args) + self.nl)
|
||||
|
||||
def write(self, *args):
|
||||
"""
|
||||
Adds a command to be run.
|
||||
"""
|
||||
|
||||
args = [ renpy.fsencode(i, force=True) for i in args]
|
||||
self.f.write(b" ".join(args) + self.nl)
|
||||
|
||||
def run(self):
|
||||
"""
|
||||
Runs the queued up commands.
|
||||
"""
|
||||
|
||||
if renpy.windows:
|
||||
self.write("pause")
|
||||
elif renpy.linux:
|
||||
self.add("echo", "Press enter to close this window...")
|
||||
self.write("read")
|
||||
|
||||
self.f.close()
|
||||
os.chmod(self.fn, 0o755)
|
||||
|
||||
if renpy.linux:
|
||||
command = renpy.fsencode('"{}"'.format(self.fn.replace("\"", "\\\"")))
|
||||
subprocess.Popen([ "x-terminal-emulator", "-e", command ])
|
||||
else:
|
||||
command = renpy.fsencode(self.fn)
|
||||
os.startfile(command)
|
||||
|
||||
interface.interaction(_("INFORMATION"), _("The command is being run in a new operating system console window."), pause=2.5)
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -154,7 +154,7 @@ screen build_distributions:
|
||||
|
||||
has vbox
|
||||
|
||||
label _("Build Distributions: [project.current.display_name!q]")
|
||||
label _("Build Distributions: [project.current.name!q]")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
@@ -191,13 +191,8 @@ screen build_distributions:
|
||||
has vbox
|
||||
|
||||
textbutton _("Edit options.rpy") action editor.Edit("game/options.rpy", check=True)
|
||||
textbutton _("Add from clauses to calls, once") action Jump("add_from")
|
||||
textbutton _("Update old-game") action Jump("start_update_old_game")
|
||||
textbutton _("Refresh") action Jump("build_distributions")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
textbutton _("Upload to itch.io") action Jump("itch")
|
||||
|
||||
# Right side.
|
||||
frame:
|
||||
@@ -222,72 +217,16 @@ screen build_distributions:
|
||||
for pkg in packages:
|
||||
if not pkg["hidden"]:
|
||||
$ description = pkg["description"]
|
||||
button:
|
||||
action PackageToggle(pkg["name"]) style "l_checkbox"
|
||||
hbox:
|
||||
spacing 3
|
||||
text "[description!q]"
|
||||
if pkg["dlc"]:
|
||||
text _("(DLC)")
|
||||
textbutton "[description!q]" action PackageToggle(pkg["name"]) style "l_checkbox"
|
||||
|
||||
add SPACER
|
||||
add HALF_SPACER
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Options:")
|
||||
|
||||
add HALF_SPACER
|
||||
add SPACER
|
||||
|
||||
if project.current.dump["build"]["include_update"]:
|
||||
textbutton _("Build Updates") action DataToggle("build_update") style "l_checkbox"
|
||||
|
||||
textbutton _("Add from clauses to calls") action DataToggle("add_from") style "l_checkbox"
|
||||
textbutton _("Force Recompile") action DataToggle("force_recompile") style "l_checkbox"
|
||||
|
||||
|
||||
textbutton _("Return") action Jump("front_page") style "l_left_button"
|
||||
textbutton _("Build") action Jump("start_distribute") style "l_right_button"
|
||||
|
||||
label add_from_common:
|
||||
python:
|
||||
interface.processing(_("Adding from clauses to call statements that do not have them."))
|
||||
project.current.launch([ "add_from" ], wait=True)
|
||||
|
||||
return
|
||||
|
||||
label add_from:
|
||||
call add_from_common
|
||||
jump build_distributions
|
||||
|
||||
label start_update_old_game:
|
||||
call update_old_game
|
||||
jump build_distributions
|
||||
|
||||
label add_update_pem:
|
||||
|
||||
python hide:
|
||||
interface.info("You're trying to build an update, but an update.pem file doesn't exist.\n\nThis file is used to sign updates, and will be automatically created in your projects's base directory.\n\nYou'll need to back up update.pem and keep it safe.", cancel=Jump("build_distributions"))
|
||||
|
||||
import ecdsa
|
||||
key = ecdsa.SigningKey.generate(curve=ecdsa.NIST256p).to_pem()
|
||||
|
||||
with open(os.path.join(project.current.path, "update.pem"), "wb") as f:
|
||||
f.write(key)
|
||||
|
||||
return
|
||||
|
||||
label start_distribute:
|
||||
if project.current.dump["build"]["include_update"] and not os.path.exists(os.path.join(project.current.path, "update.pem")):
|
||||
call add_update_pem
|
||||
|
||||
if project.current.data["add_from"]:
|
||||
call add_from_common
|
||||
|
||||
jump distribute
|
||||
textbutton _("Back") action Jump("front_page") style "l_left_button"
|
||||
textbutton _("Build") action Jump("distribute") style "l_right_button"
|
||||
|
||||
label build_update_dump:
|
||||
python:
|
||||
@@ -302,8 +241,6 @@ label build_distributions:
|
||||
|
||||
call build_update_dump
|
||||
|
||||
label post_build:
|
||||
|
||||
if not project.current.dump["build"]["directory_name"]:
|
||||
jump build_missing
|
||||
|
||||
@@ -315,12 +252,7 @@ label build_missing:
|
||||
|
||||
interface.yesno(_("Your project does not contain build information. Would you like to add build information to the end of options.rpy?"), yes=Return(True), no=Jump("front_page"))
|
||||
|
||||
project_name = project.current.name
|
||||
project_name = project_name.replace(" ", "_")
|
||||
project_name = project_name.replace(":", "")
|
||||
project_name = project_name.replace(";", "")
|
||||
|
||||
build_info = DEFAULT_BUILD_INFO.replace("PROJECTNAME", project_name)
|
||||
build_info = DEFAULT_BUILD_INFO.replace("PROJECTNAME", project.current.name)
|
||||
|
||||
with open(os.path.join(project.current.path, "game", "options.rpy"), "a") as f:
|
||||
f.write(build_info)
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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.
|
||||
|
||||
# This file checks to see if we're inside a dmg, and displays an error
|
||||
# message to the player if we are.
|
||||
|
||||
|
||||
init python:
|
||||
|
||||
def dmgcheck():
|
||||
|
||||
if not renpy.macintosh:
|
||||
return
|
||||
|
||||
fn = os.path.join(config.renpy_base, "dmgcheck.txt")
|
||||
|
||||
try:
|
||||
if os.path.exists(fn):
|
||||
os.unlink(fn)
|
||||
|
||||
with open(fn, "w") as f:
|
||||
f.write("Testing to see if we're in a DMG.\r\n")
|
||||
|
||||
os.unlink(fn)
|
||||
return
|
||||
|
||||
except Exception:
|
||||
|
||||
# If we're here, we didn't make it through the checks safely. So
|
||||
# put up a warning message.
|
||||
|
||||
interface.info(
|
||||
message=_("Ren'Py is running from a read only folder. Some functionality will not work."),
|
||||
submessage=_("This is probably because Ren'Py is running directly from a Macintosh drive image. To fix this, quit this launcher, copy the entire %s folder somewhere else on your computer, and run Ren'Py again.") % (os.path.basename(config.renpy_base)),
|
||||
)
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -21,9 +21,7 @@
|
||||
|
||||
init python:
|
||||
|
||||
import requests
|
||||
|
||||
import urllib.request
|
||||
import urllib2
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
@@ -52,14 +50,13 @@ init python:
|
||||
# This is set to true by cancel() to indicate the download should be cancelled.
|
||||
self.cancelled = False
|
||||
|
||||
# Set on success or failure.
|
||||
# Set on succes or failure.
|
||||
self.success = False
|
||||
self.failure = None
|
||||
|
||||
try:
|
||||
# Open the URL.
|
||||
|
||||
self.urlfile = requests.get(url, stream=True, proxies=renpy.proxies, timeout=15)
|
||||
self.urlfile = urllib2.urlopen(url)
|
||||
|
||||
t = threading.Thread(target=self.thread)
|
||||
t.daemon = True
|
||||
@@ -78,7 +75,12 @@ init python:
|
||||
else:
|
||||
length = 0
|
||||
|
||||
for data in self.urlfile.iter_content(1024 * 1024):
|
||||
while not self.cancelled:
|
||||
|
||||
data = self.urlfile.read(65536)
|
||||
|
||||
if not data:
|
||||
break
|
||||
|
||||
count += len(data)
|
||||
self.tmpfile.write(data)
|
||||
@@ -86,9 +88,6 @@ init python:
|
||||
if length > 0:
|
||||
self.progress = 1.0 * count / length
|
||||
|
||||
if self.cancelled:
|
||||
break
|
||||
|
||||
self.tmpfile.close()
|
||||
|
||||
if self.cancelled:
|
||||
@@ -106,6 +105,7 @@ init python:
|
||||
except Exception as e:
|
||||
self.failure = str(e)
|
||||
|
||||
|
||||
def safe_unlink(self, fn):
|
||||
if os.path.exists(fn):
|
||||
os.unlink(fn)
|
||||
@@ -147,3 +147,4 @@ init python:
|
||||
def periodic(self, st):
|
||||
self.adjustment.change(self.downloader.progress)
|
||||
return .25
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -67,8 +67,8 @@ init 1 python in editor:
|
||||
ei = EditorInfo(filename)
|
||||
|
||||
if ei.name in editors:
|
||||
if editors[ei.name].mtime >= ei.mtime:
|
||||
return
|
||||
if editors[ei.name].mtime >= ei.mtime:
|
||||
return
|
||||
|
||||
editors[ei.name] = ei
|
||||
|
||||
@@ -112,7 +112,7 @@ init 1 python in editor:
|
||||
editor is installed or not.
|
||||
"""
|
||||
|
||||
def __init__(self, priority, name, description=None, dlc=None, dldescription=None, error_message=None, deprecated=False):
|
||||
def __init__(self, priority, name, description=None, dlc=None, dldescription=None, error_message=None):
|
||||
# The priority of the editor. Lower priorities will come later
|
||||
# in the list.
|
||||
self.priority = priority
|
||||
@@ -135,118 +135,67 @@ init 1 python in editor:
|
||||
# An error message to display if the editor failed to start.
|
||||
self.error_message = error_message
|
||||
|
||||
# If the editor is considered deprecated for use with Ren'Py.
|
||||
self.deprecated = deprecated
|
||||
|
||||
|
||||
def vscode_path():
|
||||
"""
|
||||
Gets the path to VS Code for this platform.
|
||||
"""
|
||||
|
||||
if renpy.windows:
|
||||
return os.path.join(config.renpy_base, "vscode/VSCode-win32-x64")
|
||||
elif renpy.macintosh:
|
||||
return os.path.join(config.renpy_base, "vscode/Visual Studio Code.app")
|
||||
else:
|
||||
if renpy.arch == "aarch64":
|
||||
arch = "arm64"
|
||||
elif renpy.arch == "armv7l":
|
||||
arch = "arm"
|
||||
else:
|
||||
arch = "x64"
|
||||
|
||||
return os.path.join(config.renpy_base, "vscode/VSCode-linux-" + arch)
|
||||
|
||||
def fancy_scan_editors():
|
||||
"""
|
||||
Creates the list of FancyEditorInfo objects.
|
||||
"""
|
||||
|
||||
import platform
|
||||
|
||||
global fancy_editors
|
||||
|
||||
scan_all()
|
||||
|
||||
fei = fancy_editors = [ ]
|
||||
|
||||
# Visual Studio Code
|
||||
AD1 = _("A modern editor with many extensions including advanced Ren'Py integration.")
|
||||
AD2 = _("A modern editor with many extensions including advanced Ren'Py integration.\n{a=jump:reinstall_vscode}Upgrade Visual Studio Code to the latest version.{/a}")
|
||||
|
||||
installed = os.path.exists(vscode_path())
|
||||
|
||||
e = FancyEditorInfo(
|
||||
0,
|
||||
_("Visual Studio Code"),
|
||||
AD2 if installed else AD2,
|
||||
"extension:vscode",
|
||||
_("Up to 110 MB download required."),
|
||||
None)
|
||||
|
||||
e.installed = e.installed and installed
|
||||
|
||||
fei.append(e)
|
||||
|
||||
# Atom.
|
||||
AD = _("Atom is deprecated and its bugs are known for corrupting games, using another editor is recommended.")
|
||||
# Editra.
|
||||
ED = _("{b}Recommended.{/b} A beta editor with an easy to use interface and features that aid in development, such as spell-checking. Editra currently lacks the IME support required for Chinese, Japanese, and Korean text input.")
|
||||
EDL = _("{b}Recommended.{/b} A beta editor with an easy to use interface and features that aid in development, such as spell-checking. Editra currently lacks the IME support required for Chinese, Japanese, and Korean text input. On Linux, Editra requires wxPython.")
|
||||
|
||||
if renpy.windows:
|
||||
dlc = "atom-windows"
|
||||
installed = os.path.exists(os.path.join(config.renpy_base, "atom/atom-windows"))
|
||||
dlc = "editra-windows"
|
||||
installed = os.path.exists(os.path.join(config.basedir, "editra/Editra-win32"))
|
||||
description = ED
|
||||
error_message = None
|
||||
elif renpy.macintosh:
|
||||
dlc = "atom-mac"
|
||||
installed = os.path.exists(os.path.join(config.renpy_base, "atom/Atom.app"))
|
||||
dlc = "editra-mac"
|
||||
installed = os.path.exists(os.path.join(config.basedir, "editra/Editra-mac.app"))
|
||||
description = ED
|
||||
error_message = None
|
||||
else:
|
||||
dlc = "atom-linux"
|
||||
installed = os.path.exists(os.path.join(config.renpy_base, "atom/atom-linux-" + platform.machine()))
|
||||
dlc = "editra-linux"
|
||||
installed = os.path.exists(os.path.join(config.basedir, "editra/Editra"))
|
||||
description = EDL
|
||||
error_message = _("This may have occured because wxPython is not installed on this system.")
|
||||
|
||||
if not (renpy.arch in [ "aarch64", "armv7l" ]):
|
||||
|
||||
e = FancyEditorInfo(
|
||||
1,
|
||||
_("Atom"),
|
||||
AD,
|
||||
"extension:atom",
|
||||
_("Up to 150 MB download required."),
|
||||
None,
|
||||
deprecated=True,
|
||||
)
|
||||
|
||||
e.installed = e.installed and (installed or 'RENPY_ATOM' in os.environ)
|
||||
|
||||
fei.append(e)
|
||||
|
||||
# jEdit - Only present if it exists on system.
|
||||
e = FancyEditorInfo(
|
||||
2,
|
||||
_("jEdit"),
|
||||
_("JEdit is deprecated, using another editor is recommended."),
|
||||
"jedit",
|
||||
_("1.8 MB download required."),
|
||||
_("This may have occurred because Java is not installed on this system."),
|
||||
deprecated=True,
|
||||
)
|
||||
1,
|
||||
"Editra",
|
||||
description,
|
||||
dlc,
|
||||
_("Up to 22 MB download required."),
|
||||
error_message)
|
||||
|
||||
e.installed = e.installed and os.path.exists(os.path.join(config.renpy_base, "jedit"))
|
||||
e.installed = e.installed or installed
|
||||
|
||||
fei.append(e)
|
||||
|
||||
# jEdit
|
||||
fei.append(FancyEditorInfo(
|
||||
3,
|
||||
_("Visual Studio Code (System)"),
|
||||
_("Uses a copy of Visual Studio Code that you have installed outside of Ren'Py. It's recommended you install the language-renpy extension to add support for Ren'Py files."),
|
||||
2,
|
||||
"jEdit",
|
||||
_("A mature editor that requires Java."),
|
||||
"jedit",
|
||||
_("1.8 MB download required."),
|
||||
_("This may have occured because Java is not installed on this system."),
|
||||
))
|
||||
|
||||
fei.append(FancyEditorInfo(
|
||||
3,
|
||||
_("System Editor"),
|
||||
"System Editor",
|
||||
_("Invokes the editor your operating system has associated with .rpy files."),
|
||||
None))
|
||||
|
||||
for k in editors:
|
||||
if k in [ "Visual Studio Code", "Visual Studio Code (System)", "Atom", "jEdit", "System Editor", "None" ]:
|
||||
if k in [ "Editra", "jEdit", "System Editor", "None" ]:
|
||||
continue
|
||||
|
||||
fei.append(FancyEditorInfo(
|
||||
@@ -257,7 +206,7 @@ init 1 python in editor:
|
||||
|
||||
fei.append(FancyEditorInfo(
|
||||
5,
|
||||
_("None"),
|
||||
"None",
|
||||
_("Prevents Ren'Py from opening a text editor."),
|
||||
None))
|
||||
|
||||
@@ -266,8 +215,7 @@ init 1 python in editor:
|
||||
# If we're in a linux distro or something, assume all editors work.
|
||||
if not updater.can_update():
|
||||
for i in fei:
|
||||
if i.dlc and not i.dlc.startswith("extension:") and not i.deprecated:
|
||||
i.installed = True
|
||||
i.installed = True
|
||||
|
||||
def fancy_activate_editor(default=False):
|
||||
"""
|
||||
@@ -314,12 +262,9 @@ init 1 python in editor:
|
||||
|
||||
if not fe.installed:
|
||||
|
||||
if fe.dlc.startswith("extension:"):
|
||||
import installer
|
||||
manifest = fe.dlc.partition(":")[2]
|
||||
renpy.invoke_in_new_context(installer.manifest, "https://www.renpy.org/extensions/{}/{}.py".format(manifest, manifest), renpy=True)
|
||||
else:
|
||||
store.add_dlc(fe.dlc)
|
||||
# We don't check the status of this because fancy_activate_editor
|
||||
# will fail if the editor is not installed.
|
||||
store.add_dlc(fe.dlc)
|
||||
|
||||
persistent.editor = fe.name
|
||||
fancy_activate_editor()
|
||||
@@ -352,7 +297,7 @@ init 1 python in editor:
|
||||
if not set_editor:
|
||||
return True
|
||||
|
||||
if persistent.editor and persistent.editor != "None":
|
||||
if persistent.editor:
|
||||
return True
|
||||
|
||||
return renpy.invoke_in_new_context(renpy.call_screen, "editor")
|
||||
@@ -362,8 +307,6 @@ init 1 python in editor:
|
||||
|
||||
|
||||
class Edit(Action):
|
||||
alt = _("Edit [text].")
|
||||
|
||||
def __init__(self, filename, line=None, check=False):
|
||||
"""
|
||||
An action that opens the given line of the given file in a
|
||||
@@ -389,7 +332,7 @@ init 1 python in editor:
|
||||
return True
|
||||
|
||||
fn = project.current.unelide_filename(self.filename)
|
||||
return os.path.exists(renpy.fsencode(fn))
|
||||
return os.path.exists(fn)
|
||||
|
||||
def __call__(self):
|
||||
|
||||
@@ -409,9 +352,9 @@ init 1 python in editor:
|
||||
e.open(fn, line=self.line)
|
||||
e.end()
|
||||
|
||||
except Exception as e:
|
||||
except Exception, e:
|
||||
exception = traceback.format_exception_only(type(e), e)[-1][:-1]
|
||||
renpy.invoke_in_new_context(interface.error, _("An exception occurred while launching the text editor:\n[exception!q]"), error_message, exception=exception)
|
||||
renpy.invoke_in_new_context(interface.error, _("An exception occured while launching the text editor:\n[exception!q]"), error_message, exception=exception)
|
||||
|
||||
class EditAbsolute(Action):
|
||||
def __init__(self, filename, line=None, check=False):
|
||||
@@ -437,7 +380,7 @@ init 1 python in editor:
|
||||
if not self.check:
|
||||
return True
|
||||
|
||||
return os.path.exists(renpy.fsencode(self.filename))
|
||||
return os.path.exists(self.filename)
|
||||
|
||||
def __call__(self):
|
||||
|
||||
@@ -455,9 +398,9 @@ init 1 python in editor:
|
||||
e.open(self.filename, line=self.line)
|
||||
e.end()
|
||||
|
||||
except Exception as e:
|
||||
except Exception, e:
|
||||
exception = traceback.format_exception_only(type(e), e)[-1][:-1]
|
||||
renpy.invoke_in_new_context(interface.error, _("An exception occurred while launching the text editor:\n[exception!q]"), error_message, exception=exception)
|
||||
renpy.invoke_in_new_context(interface.error, _("An exception occured while launching the text editor:\n[exception!q]"), error_message, exception=exception)
|
||||
|
||||
|
||||
class EditAll(Action):
|
||||
@@ -493,66 +436,9 @@ init 1 python in editor:
|
||||
|
||||
e.end()
|
||||
|
||||
except Exception as e:
|
||||
except Exception, e:
|
||||
exception = traceback.format_exception_only(type(e), e)[-1][:-1]
|
||||
renpy.invoke_in_new_context(interface.error, _("An exception occurred while launching the text editor:\n[exception!q]"), error_message, exception=exception)
|
||||
|
||||
|
||||
class EditProject(Action):
|
||||
"""
|
||||
Opens the project's base directory in an editor.
|
||||
"""
|
||||
|
||||
def __call__(self):
|
||||
|
||||
if not check_editor():
|
||||
return
|
||||
|
||||
try:
|
||||
|
||||
e = renpy.editor.editor
|
||||
|
||||
e.begin()
|
||||
e.open_project(project.current.path)
|
||||
e.end()
|
||||
|
||||
except Exception as e:
|
||||
exception = traceback.format_exception_only(type(e), e)[-1][:-1]
|
||||
renpy.invoke_in_new_context(interface.error, _("An exception occurred while launching the text editor:\n[exception!q]"), error_message, exception=exception)
|
||||
|
||||
|
||||
def CanEditProject():
|
||||
"""
|
||||
Returns True if EditProject can be used.
|
||||
"""
|
||||
|
||||
try:
|
||||
e = renpy.editor.editor
|
||||
return e.has_projects
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
def check_old_vscode_extension():
|
||||
"""
|
||||
Check to see if the old version of the Ren'Py vscode extension is installed.
|
||||
"""
|
||||
|
||||
extensions = os.path.join(vscode_path(), "data", "extensions")
|
||||
|
||||
if not os.path.isdir(extensions):
|
||||
return False
|
||||
|
||||
for i in util.listdir(extensions):
|
||||
if i.lower().startswith("renpy.language-renpy-"):
|
||||
return False
|
||||
|
||||
for i in util.listdir(extensions):
|
||||
if i.lower().startswith("luquedaniel.languague-renpy-"):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
renpy.invoke_in_new_context(interface.error, _("An exception occured while launching the text editor:\n[exception!q]"), error_message, exception=exception)
|
||||
|
||||
screen editor:
|
||||
|
||||
@@ -583,9 +469,6 @@ screen editor:
|
||||
|
||||
for fe in editor.fancy_editors:
|
||||
|
||||
if fe.deprecated and not fe.installed:
|
||||
continue
|
||||
|
||||
add SPACER
|
||||
|
||||
textbutton fe.name action editor.SelectEditor(fe.name)
|
||||
@@ -597,10 +480,7 @@ screen editor:
|
||||
has vbox
|
||||
|
||||
if fe.description:
|
||||
text fe.description:
|
||||
style "l_small_text"
|
||||
if fe.deprecated:
|
||||
color ERROR_COLOR
|
||||
text fe.description style "l_small_text"
|
||||
|
||||
if not fe.installed:
|
||||
add HALF_SPACER
|
||||
@@ -609,73 +489,6 @@ screen editor:
|
||||
|
||||
textbutton _("Cancel") action Return(False) style "l_left_button"
|
||||
|
||||
label reinstall_vscode:
|
||||
python hide:
|
||||
manifest = "vscode"
|
||||
renpy.invoke_in_new_context(installer.manifest, "https://www.renpy.org/extensions/{}/{}.py".format(manifest, manifest), renpy=True)
|
||||
|
||||
jump editor_preference
|
||||
|
||||
label upgrade_vscode_extension:
|
||||
python hide:
|
||||
manifest = "vscode"
|
||||
renpy.invoke_in_new_context(installer.manifest, "https://www.renpy.org/extensions/vscode/upgrade_extension.py", renpy=True)
|
||||
|
||||
jump post_extension_check
|
||||
|
||||
label editor_preference:
|
||||
call screen editor
|
||||
jump preferences
|
||||
|
||||
default persistent.ignore_obsolete_editor = set()
|
||||
|
||||
# This label is called when the launcher starts, to check if the editor
|
||||
# is obsolete, and let them change it.
|
||||
label editor_check:
|
||||
|
||||
if persistent.editor in persistent.ignore_obsolete_editor:
|
||||
jump post_editor_check
|
||||
|
||||
if persistent.editor == "Atom":
|
||||
$ result = interface.choice(
|
||||
_("The Atom text editor is no longer supported by its developers. We suggest switching to Visual Studio Code or another editor."), [
|
||||
( "select", _("Select editor now.")),
|
||||
( "ignore", _("Ignore until next launch.")),
|
||||
( "block", _("Do not ask again.")),
|
||||
], "select")
|
||||
|
||||
else:
|
||||
jump post_atom_check
|
||||
|
||||
if result == "select":
|
||||
$ renpy.pop_call()
|
||||
jump editor_preference
|
||||
|
||||
elif result == "block":
|
||||
$ persistent.ignore_obsolete_editor.add(persistent.editor)
|
||||
|
||||
|
||||
label post_atom_check:
|
||||
|
||||
if "luquedaniel.languague-renpy" in persistent.ignore_obsolete_editor:
|
||||
jump post_extension_check
|
||||
|
||||
if persistent.editor != "Visual Studio Code":
|
||||
jump post_extension_check
|
||||
|
||||
if editor.check_old_vscode_extension():
|
||||
$ result = interface.choice(
|
||||
_("You are using an old version of the Ren'Py Language support for Visual Studio Code. Would you like to upgrade?"), [
|
||||
( "upgrade", _("Upgrade.")),
|
||||
( "ignore", _("Ignore until next launch.")),
|
||||
( "block", _("Do not ask again.")),
|
||||
], "select")
|
||||
|
||||
if result == "upgrade":
|
||||
jump upgrade_vscode_extension
|
||||
|
||||
elif result == "block":
|
||||
$ persistent.ignore_obsolete_editor.add("luquedaniel.languague-renpy")
|
||||
|
||||
label post_extension_check:
|
||||
jump post_editor_check
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -23,7 +23,38 @@ define PROJECT_ADJUSTMENT = ui.adjustment()
|
||||
|
||||
init python:
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
class OpenDirectory(Action):
|
||||
"""
|
||||
Opens `directory` in a file browser. `directory` is relative to
|
||||
the project root.
|
||||
"""
|
||||
|
||||
def __init__(self, directory, absolute=False):
|
||||
if absolute:
|
||||
self.directory = directory
|
||||
else:
|
||||
self.directory = os.path.join(project.current.path, directory)
|
||||
|
||||
def get_sensitive(self):
|
||||
return os.path.exists(self.directory)
|
||||
|
||||
def __call__(self):
|
||||
|
||||
try:
|
||||
directory = renpy.fsencode(self.directory)
|
||||
|
||||
if renpy.windows:
|
||||
os.startfile(directory)
|
||||
elif renpy.macintosh:
|
||||
subprocess.Popen([ "open", directory ])
|
||||
else:
|
||||
subprocess.Popen([ "xdg-open", directory ])
|
||||
|
||||
except:
|
||||
pass
|
||||
|
||||
# Used for testing.
|
||||
def Relaunch():
|
||||
@@ -31,8 +62,6 @@ init python:
|
||||
|
||||
screen front_page:
|
||||
frame:
|
||||
alt ""
|
||||
|
||||
style_group "l"
|
||||
style "l_root"
|
||||
|
||||
@@ -46,7 +75,7 @@ screen front_page:
|
||||
right_margin 2
|
||||
|
||||
top_padding 20
|
||||
bottom_padding 13
|
||||
bottom_padding 26
|
||||
|
||||
side "t c b":
|
||||
|
||||
@@ -55,7 +84,7 @@ screen front_page:
|
||||
has hbox:
|
||||
xfill True
|
||||
|
||||
text _("PROJECTS:") style "l_label_text" size 36 yoffset 10
|
||||
text "PROJECTS:" style "l_label_text" size 36 yoffset 10
|
||||
|
||||
textbutton _("refresh"):
|
||||
xalign 1.0
|
||||
@@ -88,6 +117,8 @@ screen front_page:
|
||||
left_margin (HALF_INDENT)
|
||||
action Jump("new_project")
|
||||
|
||||
|
||||
|
||||
# Project section - on right.
|
||||
|
||||
if project.current is not None:
|
||||
@@ -95,7 +126,6 @@ screen front_page:
|
||||
|
||||
if project.current is not None:
|
||||
textbutton _("Launch Project") action project.Launch() style "l_right_button"
|
||||
key "K_F5" action project.Launch()
|
||||
|
||||
|
||||
|
||||
@@ -113,7 +143,6 @@ screen front_page_project_list:
|
||||
|
||||
textbutton _("[p.name!q] (template)"):
|
||||
action project.Select(p)
|
||||
alt _("Select project [text].")
|
||||
style "l_list"
|
||||
|
||||
null height 12
|
||||
@@ -124,13 +153,12 @@ screen front_page_project_list:
|
||||
|
||||
textbutton "[p.name!q]":
|
||||
action project.Select(p)
|
||||
alt _("Select project [text].")
|
||||
style "l_list"
|
||||
|
||||
null height 12
|
||||
|
||||
textbutton _("Tutorial") action project.SelectTutorial() style "l_list" alt _("Select project [text].")
|
||||
textbutton _("The Question") action project.Select("the_question") style "l_list" alt _("Select project [text].")
|
||||
textbutton _("Tutorial") action project.Select("tutorial") style "l_list"
|
||||
textbutton _("The Question") action project.Select("the_question") style "l_list"
|
||||
|
||||
|
||||
# This is used for the right side of the screen, which is where the project-specific
|
||||
@@ -145,7 +173,7 @@ screen front_page_project:
|
||||
|
||||
frame style "l_label":
|
||||
has hbox xfill True
|
||||
text "[p.display_name!q]" style "l_label_text"
|
||||
text "[p.name!q]" style "l_label_text"
|
||||
label _("Active Project") style "l_alternate"
|
||||
|
||||
grid 2 1:
|
||||
@@ -157,31 +185,35 @@ screen front_page_project:
|
||||
label _("Open Directory") style "l_label_small"
|
||||
|
||||
frame style "l_indent":
|
||||
has grid 2 max(5, (len(p.get_renpy_launcher()["open_directory"]) + 1) // 2):
|
||||
transpose True xfill True
|
||||
has vbox
|
||||
|
||||
for button_name, path in p.get_renpy_launcher()["open_directory"].items():
|
||||
textbutton button_name action OpenDirectory(os.path.join(p.path, path), absolute=True)
|
||||
textbutton _("game") action OpenDirectory("game")
|
||||
textbutton _("base") action OpenDirectory(".")
|
||||
# textbutton _("images") action OpenDirectory("game/images") style "l_list"
|
||||
# textbutton _("save") action None style "l_list"
|
||||
|
||||
vbox:
|
||||
if persistent.show_edit_funcs:
|
||||
|
||||
label _("Edit File") style "l_label_small"
|
||||
label _("Edit File") style "l_label_small"
|
||||
|
||||
frame style "l_indent":
|
||||
has vbox
|
||||
frame style "l_indent":
|
||||
has vbox
|
||||
|
||||
for button_name, path in p.get_renpy_launcher()["edit_file"].items():
|
||||
textbutton button_name action editor.Edit(path, check=True)
|
||||
|
||||
if editor.CanEditProject():
|
||||
textbutton _("Open project") action editor.EditProject()
|
||||
else:
|
||||
textbutton _("All script files") action editor.EditAll()
|
||||
textbutton "script.rpy" action editor.Edit("game/script.rpy", check=True)
|
||||
textbutton "options.rpy" action editor.Edit("game/options.rpy", check=True)
|
||||
textbutton "screens.rpy" action editor.Edit("game/screens.rpy", check=True)
|
||||
textbutton _("All script files") action editor.EditAll()
|
||||
|
||||
add SPACER
|
||||
add SEPARATOR
|
||||
add SPACER
|
||||
|
||||
label _("Actions") style "l_label_small"
|
||||
frame style "l_indent":
|
||||
has vbox
|
||||
|
||||
textbutton _("Navigate Script") text_size 30 action Jump("navigation")
|
||||
|
||||
add SPACER
|
||||
|
||||
grid 2 1:
|
||||
xfill True
|
||||
@@ -190,17 +222,9 @@ screen front_page_project:
|
||||
frame style "l_indent":
|
||||
has vbox
|
||||
|
||||
textbutton _("Navigate Script") action Jump("navigation")
|
||||
textbutton _("Check Script (Lint)") action Call("lint")
|
||||
|
||||
if project.current.exists("game/gui.rpy"):
|
||||
textbutton _("Change/Update GUI") action Jump("change_gui")
|
||||
else:
|
||||
textbutton _("Change Theme") action Jump("choose_theme")
|
||||
|
||||
|
||||
textbutton _("Check Script (Lint)") action Jump("lint")
|
||||
textbutton _("Change Theme") action Jump("choose_theme")
|
||||
textbutton _("Delete Persistent") action Jump("rmpersistent")
|
||||
textbutton _("Force Recompile") action Jump("force_recompile")
|
||||
|
||||
# textbutton "Relaunch" action Relaunch
|
||||
|
||||
@@ -211,8 +235,6 @@ screen front_page_project:
|
||||
textbutton _("Build Distributions") action Jump("build_distributions")
|
||||
|
||||
textbutton _("Android") action Jump("android")
|
||||
textbutton _("iOS") action Jump("ios")
|
||||
textbutton _("Web") action Jump("web")
|
||||
textbutton _("Generate Translations") action Jump("translate")
|
||||
textbutton _("Extract Dialogue") action Jump("extract_dialogue")
|
||||
|
||||
@@ -221,34 +243,8 @@ label main_menu:
|
||||
|
||||
label start:
|
||||
show screen bottom_info
|
||||
$ dmgcheck()
|
||||
|
||||
jump expression renpy.session.pop("launcher_start_label", "before_front_page")
|
||||
|
||||
default persistent.has_chosen_language = False
|
||||
default persistent.has_update = False
|
||||
|
||||
label before_front_page:
|
||||
|
||||
if (not persistent.has_chosen_language) or ("RENPY_CHOOSE_LANGUAGE" in os.environ):
|
||||
|
||||
if (_preferences.language is None) or ("RENPY_CHOOSE_LANGUAGE" in os.environ):
|
||||
hide screen bottom_info
|
||||
call choose_language
|
||||
show screen bottom_info
|
||||
|
||||
$ persistent.has_chosen_language = True
|
||||
|
||||
call editor_check
|
||||
|
||||
label post_editor_check:
|
||||
label front_page:
|
||||
|
||||
if persistent.daily_update_check and ((not persistent.last_update_check) or (datetime.date.today() > persistent.last_update_check)):
|
||||
python hide:
|
||||
persistent.last_update_check = datetime.date.today()
|
||||
renpy.invoke_in_thread(fetch_update_channels)
|
||||
|
||||
call screen front_page
|
||||
jump front_page
|
||||
|
||||
@@ -259,18 +255,14 @@ label lint:
|
||||
interface.processing(_("Checking script for potential problems..."))
|
||||
lint_fn = project.current.temp_filename("lint.txt")
|
||||
|
||||
persistent.lint_options.discard("--orphan-tl") # compat
|
||||
persistent.lint_options.discard("--builtins-parameters") # compat
|
||||
persistent.lint_options.discard("--words-char-count") # compat
|
||||
|
||||
project.current.launch([ 'lint', lint_fn, ] + list(persistent.lint_options), wait=True)
|
||||
project.current.launch([ 'lint', lint_fn ], wait=True)
|
||||
|
||||
e = renpy.editor.editor
|
||||
e.begin(True)
|
||||
e.open(lint_fn)
|
||||
e.end()
|
||||
|
||||
return
|
||||
jump front_page
|
||||
|
||||
label rmpersistent:
|
||||
|
||||
@@ -280,10 +272,3 @@ label rmpersistent:
|
||||
|
||||
jump front_page
|
||||
|
||||
label force_recompile:
|
||||
|
||||
python hide:
|
||||
interface.processing(_("Recompiling all rpy files into rpyc files..."))
|
||||
project.current.launch([ 'compile' ], wait=True)
|
||||
|
||||
jump front_page
|
||||
|
||||
@@ -1,512 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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.
|
||||
|
||||
define gui.project_system_font = None
|
||||
define gui.asian = False
|
||||
|
||||
# This is set in new_project before new_template_project is called,
|
||||
# and provides the full path to the template project.
|
||||
default gui_template_path = None
|
||||
|
||||
define LIBS_TXT = _("""\
|
||||
The game/libs/ directory is meant for third-party libraries that ask to be
|
||||
put in game/libs.
|
||||
|
||||
When this file (game/libs/libs.txt) is present, Ren'Py will load all files
|
||||
in libs before any other file in game/, and will not consider directory names
|
||||
when loading these files.
|
||||
""")
|
||||
|
||||
init -1 python:
|
||||
|
||||
import gui7
|
||||
from gui7 import translate_define, translate_copy, translate_code
|
||||
|
||||
import os
|
||||
|
||||
from store import config
|
||||
|
||||
def translate_font(language, font):
|
||||
"""
|
||||
Selects the font file that is used when translating `language`.
|
||||
|
||||
`font`
|
||||
Is the name of the font file used for both the launcher and
|
||||
the new GUI template. This should be a string giving the name
|
||||
of the font file.
|
||||
"""
|
||||
|
||||
def callback():
|
||||
gui.REGULAR_FONT = font
|
||||
gui.LIGHT_FONT = font
|
||||
gui.REGULAR_BOLD = True
|
||||
|
||||
style._default.font = font
|
||||
style.default.font = font
|
||||
|
||||
gui.system_font = font
|
||||
gui.project_system_font = font
|
||||
|
||||
config.language_callbacks[language].append(callback)
|
||||
|
||||
def s(s):
|
||||
return '"' + s + '"'
|
||||
|
||||
gui7.translate_copy(language, "sdk-fonts/" + font, font)
|
||||
gui7.translate_define(language, "gui.text_font", s(font))
|
||||
gui7.translate_define(language, "gui.name_text_font", s(font))
|
||||
gui7.translate_define(language, "gui.interface_text_font", s(font))
|
||||
|
||||
|
||||
for fn in [ "gui.rpy", "options.rpy", "screens.rpy" ]:
|
||||
fn = os.path.join(config.renpy_base, "gui", "game", fn)
|
||||
if os.path.exists(fn):
|
||||
config.translate_files.append(fn)
|
||||
|
||||
config.translate_comments = config.translate_files
|
||||
|
||||
|
||||
DARK_COLORS = [
|
||||
"#0099cc",
|
||||
"#99ccff",
|
||||
"#66cc00",
|
||||
"#cccc00",
|
||||
"#cc6600",
|
||||
# "#cc3300",
|
||||
|
||||
"#0066cc",
|
||||
"#9933ff",
|
||||
"#00cc99",
|
||||
"#cc0066",
|
||||
"#cc0000",
|
||||
]
|
||||
|
||||
LIGHT_COLORS = [
|
||||
"#003366", # Dark Blue
|
||||
"#0099ff", # Light Blue
|
||||
"#336600", # Green
|
||||
"#000000", # Black
|
||||
"#cc6600", # Orange
|
||||
|
||||
"#000066", # Darkest Blue
|
||||
"#660066", # Purple
|
||||
"#006666", # Dark Green
|
||||
"#cc0066", # Pinkish
|
||||
"#990000", # Red
|
||||
]
|
||||
|
||||
|
||||
# LIGHT_COLORS = DARK_COLORS
|
||||
|
||||
COLOR_OPTIONS = [
|
||||
(i, "#000000", False) for i in DARK_COLORS
|
||||
] + [
|
||||
(i, "#ffffff", True) for i in LIGHT_COLORS
|
||||
]
|
||||
|
||||
|
||||
screen gui_swatches():
|
||||
|
||||
grid 5 4:
|
||||
|
||||
for accent, bg, light in COLOR_OPTIONS:
|
||||
|
||||
frame:
|
||||
style "empty"
|
||||
xysize (85, 60)
|
||||
|
||||
add Color(accent).replace_hsv_saturation(.25).replace_value(.5)
|
||||
|
||||
if light:
|
||||
add Color(bg).opacity(.9)
|
||||
else:
|
||||
add Color(bg).opacity(.8)
|
||||
|
||||
button:
|
||||
style "empty"
|
||||
|
||||
if light:
|
||||
selected_background "#000"
|
||||
else:
|
||||
selected_background "#fff"
|
||||
|
||||
xpadding 3
|
||||
ypadding 3
|
||||
xmargin 10
|
||||
ymargin 10
|
||||
|
||||
action SetVariable("gui_color", (accent, bg, light))
|
||||
|
||||
idle_child Solid(accent)
|
||||
hover_child Solid(Color(accent).tint(.6))
|
||||
|
||||
screen gui_demo(accent, boring, light, display):
|
||||
|
||||
$ p = gui7.GuiParameters(
|
||||
"-",
|
||||
"-",
|
||||
1280,
|
||||
720,
|
||||
accent,
|
||||
boring,
|
||||
light,
|
||||
None,
|
||||
False,
|
||||
False,
|
||||
False,
|
||||
"-"
|
||||
)
|
||||
|
||||
frame:
|
||||
style "empty"
|
||||
|
||||
add p.menu_color
|
||||
|
||||
if light:
|
||||
add Solid(p.boring_color.opacity(.9))
|
||||
else:
|
||||
add Solid(p.boring_color.opacity(.8))
|
||||
|
||||
|
||||
frame:
|
||||
style "empty"
|
||||
|
||||
xpadding 10
|
||||
ypadding 10
|
||||
|
||||
has vbox
|
||||
|
||||
text _("Display"):
|
||||
style "empty"
|
||||
font (gui.system_font or "DejaVuSans.ttf")
|
||||
color p.accent_color
|
||||
size 24
|
||||
|
||||
for i in [ _("Window"), _("Fullscreen"), _("Planetarium") ]:
|
||||
|
||||
textbutton i:
|
||||
action (None if i == "Planetarium" else SetScreenVariable("display", i))
|
||||
style "empty"
|
||||
|
||||
text_style "empty"
|
||||
text_font (gui.system_font or "DejaVuSans.ttf")
|
||||
text_size 24
|
||||
|
||||
text_color p.idle_color
|
||||
text_hover_color p.hover_color
|
||||
text_selected_color p.selected_color
|
||||
text_insensitive_color p.insensitive_color
|
||||
|
||||
xmargin 4
|
||||
ymargin 4
|
||||
left_padding 21
|
||||
|
||||
selected_background Solid(p.accent_color, xsize=5)
|
||||
|
||||
null height 30
|
||||
|
||||
text _("Text Speed"):
|
||||
style "empty"
|
||||
color p.accent_color
|
||||
size 24
|
||||
font (gui.system_font or "DejaVuSans.ttf")
|
||||
|
||||
bar:
|
||||
value ScreenVariableValue("value", 1.0)
|
||||
style "empty"
|
||||
base_bar Solid(p.muted_color)
|
||||
hover_base_bar Solid(p.hover_muted_color)
|
||||
|
||||
thumb Solid(p.accent_color, xsize=10)
|
||||
hover_thumb Solid(p.hover_color, xsize=10)
|
||||
|
||||
ysize 30
|
||||
|
||||
|
||||
screen choose_gui_color():
|
||||
|
||||
default display = "Window"
|
||||
default value = 0.5
|
||||
|
||||
frame:
|
||||
style_group "l"
|
||||
style "l_root"
|
||||
|
||||
window:
|
||||
has vbox
|
||||
|
||||
label _("Select Accent and Background Colors")
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
|
||||
has hbox:
|
||||
yfill True
|
||||
|
||||
frame:
|
||||
style "l_default"
|
||||
xsize 425
|
||||
|
||||
has vbox
|
||||
|
||||
text _("Please click on the color scheme you wish to use, then click Continue. These colors can be changed and customized later.")
|
||||
|
||||
add SPACER
|
||||
|
||||
use gui_swatches()
|
||||
|
||||
|
||||
# Preview
|
||||
frame:
|
||||
xsize 350
|
||||
|
||||
style "l_default"
|
||||
background Frame(PATTERN, 0, 0, tile=True)
|
||||
xpadding 5
|
||||
ypadding 5
|
||||
|
||||
xfill True
|
||||
yfill True
|
||||
xmargin 20
|
||||
bottom_margin 6
|
||||
|
||||
use gui_demo(gui_color[0], gui_color[1], gui_color[2], display)
|
||||
|
||||
textbutton _("Return") action Jump("front_page") style "l_left_button"
|
||||
|
||||
if gui_color:
|
||||
textbutton _("Continue") action Return(True) style "l_right_button"
|
||||
key "input_enter" action Return(True)
|
||||
|
||||
|
||||
label change_gui:
|
||||
|
||||
python:
|
||||
|
||||
gui_new = False
|
||||
gui_replace_images = True
|
||||
gui_update_code = True
|
||||
gui_replace_code = False
|
||||
|
||||
project.current.update_dump(True)
|
||||
gui_size = tuple(project.current.dump["size"])
|
||||
|
||||
project_dir = project.current.path
|
||||
project_name = project.current.name
|
||||
|
||||
mode = interface.choice(
|
||||
__("{b}Warning{/b}\nContinuing will overwrite customized bar, button, save slot, scrollbar, and slider images.\n\nWhat would you like to do?") +
|
||||
__("{size=-4}\n\nThis will not overwrite gui/main_menu.png, gui/game_menu.png, and gui/window_icon.png, but will create files that do not exist.{/size}"),
|
||||
[
|
||||
("change", _("Choose new colors, then regenerate image files.")),
|
||||
("regenerate", _("Regenerate the image files using the colors in gui.rpy.")),
|
||||
],
|
||||
None,
|
||||
cancel=Jump("front_page"),
|
||||
)
|
||||
|
||||
if mode == "change":
|
||||
jump gui_project_common
|
||||
else:
|
||||
jump gui_generate_images
|
||||
|
||||
label new_gui_project:
|
||||
|
||||
python:
|
||||
gui_new = True
|
||||
gui_replace_images = True
|
||||
gui_replace_code = True
|
||||
gui_update_code = True
|
||||
|
||||
|
||||
label gui_project_size:
|
||||
|
||||
python:
|
||||
|
||||
default_size = (1920, 1080)
|
||||
|
||||
gui_size = interface.choice(
|
||||
_("What resolution should the project use? Although Ren'Py can scale the window up and down, this is the initial size of the window, the size at which assets should be drawn, and the size at which the assets will be at their sharpest.\n\nThe default of [default_size[0]]x[default_size[1]] is a reasonable compromise."),
|
||||
[
|
||||
((1280, 720), "1280x720"),
|
||||
((1920, 1080), "1920x1080"),
|
||||
((2560, 1440), "2560x1440"),
|
||||
((3840, 2160), "3840x2160"),
|
||||
("custom", _("Custom. The GUI is optimized for a 16:9 aspect ratio.")),
|
||||
],
|
||||
default_size,
|
||||
cancel=Jump("front_page"),
|
||||
)
|
||||
|
||||
if gui_size == "custom":
|
||||
|
||||
gui_width = ""
|
||||
while True:
|
||||
gui_width = interface.input(
|
||||
_("WIDTH"),
|
||||
_("Please enter the width of your game, in pixels."),
|
||||
cancel=Jump("front_page"),
|
||||
allow=interface.DIGITS_LETTERS,
|
||||
)
|
||||
|
||||
try:
|
||||
gui_width = int(gui_width)
|
||||
except Exception:
|
||||
interface.error(_("The width must be a number."), label=None)
|
||||
continue
|
||||
break
|
||||
|
||||
gui_height = ""
|
||||
while True:
|
||||
gui_height = interface.input(
|
||||
_("HEIGHT"),
|
||||
_("Please enter the height of your game, in pixels."),
|
||||
cancel=Jump("front_page"),
|
||||
allow=interface.DIGITS_LETTERS,
|
||||
)
|
||||
|
||||
try:
|
||||
gui_height = int(gui_height)
|
||||
except Exception:
|
||||
interface.error(_("The height must be a number."), label=None)
|
||||
continue
|
||||
break
|
||||
|
||||
gui_size = (gui_width, gui_height)
|
||||
|
||||
|
||||
label gui_project_common:
|
||||
|
||||
$ gui_color = (DARK_COLORS[0], "#000000", False)
|
||||
|
||||
call screen choose_gui_color
|
||||
|
||||
python hide:
|
||||
|
||||
width, height = gui_size
|
||||
accent, boring, light = gui_color
|
||||
|
||||
prefix = os.path.join(project_dir, "game")
|
||||
|
||||
if not os.path.isdir(prefix) and not gui_new:
|
||||
interface.error("{} does not appear to be a Ren'Py game.".format(prefix))
|
||||
|
||||
template = os.path.join(config.renpy_base, "gui", "game")
|
||||
|
||||
if not os.path.isdir(template):
|
||||
interface.error("{} does not appear to be a Ren'Py game.".format(template))
|
||||
|
||||
p = gui7.GuiParameters(
|
||||
prefix,
|
||||
template,
|
||||
width,
|
||||
height,
|
||||
accent,
|
||||
boring,
|
||||
light,
|
||||
_preferences.language,
|
||||
gui_replace_images,
|
||||
gui_replace_code,
|
||||
gui_update_code,
|
||||
project_name,
|
||||
)
|
||||
|
||||
if gui_new:
|
||||
interface.processing(_("Creating the new project..."))
|
||||
else:
|
||||
interface.processing(_("Updating the project..."))
|
||||
|
||||
with interface.error_handling(_("creating a new project")):
|
||||
gui7.generate_gui(p)
|
||||
|
||||
# Activate the project.
|
||||
with interface.error_handling(_("activating the new project")):
|
||||
project.manager.scan()
|
||||
project.Select(project.manager.get(project_name))()
|
||||
|
||||
if gui_new:
|
||||
|
||||
call update_renpy_strings_common
|
||||
|
||||
python hide:
|
||||
if gui.project_system_font:
|
||||
with open(os.path.join(project.current.gamedir, "tl/None/common.rpym"), "ab") as f:
|
||||
f.write("define gui.system_font = {!r}\r\n".format(gui.project_system_font).encode("utf-8"))
|
||||
|
||||
|
||||
label gui_generate_images:
|
||||
|
||||
python:
|
||||
|
||||
interface.processing(_("Updating the project..."))
|
||||
project.current.launch([ 'gui_images' ], env={ "RENPY_VARIANT" : "small phone" }, wait=True)
|
||||
project.current.launch([ 'gui_images' ], wait=True)
|
||||
|
||||
jump front_page
|
||||
|
||||
label new_template_project:
|
||||
|
||||
# Unused in new_template_project.
|
||||
$ gui_size = (1920, 1080)
|
||||
$ gui_color = (DARK_COLORS[0], "#000000", False)
|
||||
|
||||
python hide:
|
||||
|
||||
width, height = gui_size
|
||||
accent, boring, light = gui_color
|
||||
|
||||
prefix = os.path.join(project_dir, "game")
|
||||
template = os.path.join(gui_template_path, "game")
|
||||
|
||||
# Most of this isn't actually used.
|
||||
p = gui7.GuiParameters(
|
||||
prefix,
|
||||
template,
|
||||
width,
|
||||
height,
|
||||
accent,
|
||||
boring,
|
||||
light,
|
||||
_preferences.language,
|
||||
False,
|
||||
True,
|
||||
True,
|
||||
project_name,
|
||||
)
|
||||
|
||||
interface.processing(_("Creating the new project..."))
|
||||
|
||||
with interface.error_handling(_("creating a new project")):
|
||||
gui7.generate_minimal(p)
|
||||
|
||||
# Activate the project.
|
||||
with interface.error_handling(_("activating the new project")):
|
||||
project.manager.scan()
|
||||
project.Select(project.manager.get(project_name))()
|
||||
|
||||
call update_renpy_strings_common
|
||||
|
||||
python hide:
|
||||
if gui.project_system_font:
|
||||
with open(os.path.join(project.current.gamedir, "tl/None/common.rpym"), "ab") as f:
|
||||
f.write("define gui.system_font = {!r}\r\n".format(gui.project_system_font).encode("utf-8"))
|
||||
|
||||
jump front_page
|
||||
@@ -1,152 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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.
|
||||
|
||||
from gui7.code import CodeGenerator, translate_define, translate_copy, translate_code
|
||||
from gui7.images import ImageGenerator
|
||||
from gui7.parameters import GuiParameters
|
||||
|
||||
import renpy.arguments
|
||||
import os
|
||||
import shutil
|
||||
|
||||
|
||||
|
||||
def finish(p):
|
||||
|
||||
for dn in [ "images", "audio", "libs" ]:
|
||||
|
||||
fulldn = os.path.join(p.prefix, dn)
|
||||
|
||||
if not os.path.exists(fulldn):
|
||||
os.mkdir(fulldn)
|
||||
|
||||
with open(os.path.join(p.prefix, "libs", "libs.txt"), "w") as f:
|
||||
f.write(renpy.translation.translate_string(renpy.store.LIBS_TXT, language=p.language))
|
||||
|
||||
def generate_gui(p):
|
||||
|
||||
ImageGenerator(p).generate_all()
|
||||
CodeGenerator(p).generate_gui("gui.rpy", defines=True)
|
||||
CodeGenerator(p).generate_gui("screens.rpy")
|
||||
CodeGenerator(p).generate_code("options.rpy")
|
||||
CodeGenerator(p).copy_script("script.rpy")
|
||||
CodeGenerator(p).copy_files()
|
||||
|
||||
finish(p)
|
||||
|
||||
|
||||
def generate_minimal(p):
|
||||
|
||||
# Copy the template over.
|
||||
os.makedirs(os.path.dirname(p.prefix), 0o777)
|
||||
shutil.copytree(p.template, p.prefix)
|
||||
|
||||
def delete(fn):
|
||||
fn = os.path.join(p.prefix, fn)
|
||||
|
||||
if os.path.isdir(fn):
|
||||
shutil.rmtree(fn)
|
||||
elif os.path.exists(fn):
|
||||
os.unlink(fn)
|
||||
|
||||
# Prune directories.
|
||||
delete("cache")
|
||||
delete("saves")
|
||||
delete("tl")
|
||||
|
||||
# Prune files to be regenerated.
|
||||
delete("gui.rpy")
|
||||
delete("screens.rpy")
|
||||
delete("options.rpy")
|
||||
|
||||
# Generate files.
|
||||
CodeGenerator(p).generate_code("gui.rpy")
|
||||
CodeGenerator(p).generate_code("screens.rpy")
|
||||
CodeGenerator(p).generate_code("options.rpy")
|
||||
CodeGenerator(p).copy_files()
|
||||
|
||||
finish(p)
|
||||
|
||||
|
||||
def generate_gui_command():
|
||||
|
||||
ap = renpy.arguments.ArgumentParser()
|
||||
|
||||
ap.add_argument("target", action="store", help="The game into which the generated gui should be placed.")
|
||||
ap.add_argument("--width", default=1280, action="store", type=int, help="The width of the generated gui.")
|
||||
ap.add_argument("--height", default=720, action="store", type=int, help="The height of the generated gui.")
|
||||
ap.add_argument("--accent", default="#00b8c3", action="store", help="The accent color used throughout the gui.")
|
||||
ap.add_argument("--boring", default="#000000", action="store", help="The boring color used for the gui background.")
|
||||
ap.add_argument("--light", default=False, action="store_true", help="True if this is considered a light theme.")
|
||||
ap.add_argument("--template", default="gui", action="store", help="The template directory containing source code.")
|
||||
ap.add_argument("--language", default=None, action="store", help="The language to translate strings and comments to.")
|
||||
|
||||
ap.add_argument("--start", default=False, action="store_true", help="Starts a new project, replacing images and code.")
|
||||
ap.add_argument("--replace-images", default=False, action="store_true", help="True if existing images should be overwritten.")
|
||||
ap.add_argument("--replace-code", default=False, action="store_true", help="True if an existing gui.rpy file should be overwritten.")
|
||||
ap.add_argument("--update-code", default=False, action="store_true", help="True if an existing gui.rpy file should be updated.")
|
||||
|
||||
ap.add_argument("--minimal", default=False, action="store_true", help="Only update option.rpy and translations.")
|
||||
|
||||
args = ap.parse_args()
|
||||
|
||||
if args.start:
|
||||
args.replace_images = True
|
||||
args.replace_code = True
|
||||
args.update_code = True
|
||||
|
||||
if args.minimal:
|
||||
args.replace_code = True
|
||||
args.update_code = True
|
||||
|
||||
prefix = os.path.join(args.target, "game")
|
||||
|
||||
if os.path.exists(args.target):
|
||||
|
||||
if not os.path.isdir(prefix):
|
||||
ap.error("{} does not appear to be a Ren'Py game.".format(prefix))
|
||||
|
||||
template = os.path.join(args.template, "game")
|
||||
|
||||
if not os.path.isdir(template):
|
||||
ap.error("{} does not appear to be a Ren'Py game.".format(template))
|
||||
|
||||
p = GuiParameters(
|
||||
prefix,
|
||||
template,
|
||||
args.width,
|
||||
args.height,
|
||||
args.accent,
|
||||
args.boring,
|
||||
args.light,
|
||||
args.language,
|
||||
args.replace_images,
|
||||
args.replace_code,
|
||||
args.update_code,
|
||||
os.path.basename(args.target),
|
||||
)
|
||||
|
||||
if args.minimal:
|
||||
generate_minimal(p)
|
||||
else:
|
||||
generate_gui(p)
|
||||
|
||||
renpy.arguments.register_command("generate_gui", generate_gui_command)
|
||||
@@ -1,442 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import os
|
||||
import codecs
|
||||
import re
|
||||
import math
|
||||
import textwrap
|
||||
import collections
|
||||
import shutil
|
||||
|
||||
import renpy
|
||||
|
||||
|
||||
class Define(object):
|
||||
|
||||
def __init__(self, name, value, comment):
|
||||
self.name = name
|
||||
self.value = value
|
||||
self.comment = comment
|
||||
|
||||
|
||||
# A map from language name to a list of defines.
|
||||
language_defines = collections.defaultdict(list)
|
||||
|
||||
|
||||
def translate_define(language, name, value, comment=None):
|
||||
"""
|
||||
This function should be called to register the value of a define that is
|
||||
set when generating code in `language`.
|
||||
|
||||
`name`
|
||||
A string giving the name of the define.
|
||||
|
||||
`value`
|
||||
A string giving the value of the define. Be sure to quote it properly,
|
||||
or use repr().
|
||||
|
||||
`comment`
|
||||
If not None, a comment that will be generated before the define. The
|
||||
comment will only be generated if the define does not exist in
|
||||
gui.rpy. There is no need to use "## ", as the comment will be
|
||||
added and wrapped automatically.
|
||||
"""
|
||||
|
||||
language_defines[language].append(Define(name, value, comment))
|
||||
|
||||
|
||||
# A map from a language name to a list of (src, dst) pairs. Each represents a
|
||||
# file that is copied into place.
|
||||
language_copies = collections.defaultdict(list)
|
||||
|
||||
|
||||
def translate_copy(language, src, dst):
|
||||
"""
|
||||
This function should be called to copy a file from `src` to `dst`
|
||||
when generating code in `language`.
|
||||
|
||||
`src`
|
||||
A path, relative to the launcher game directory.
|
||||
|
||||
`dst`
|
||||
A path, relative to the game directory of the new game.
|
||||
"""
|
||||
|
||||
language_copies[language].append((src, dst))
|
||||
|
||||
|
||||
# A map from language name and filename to code that should be added to the
|
||||
# end of a newly-generated file.
|
||||
language_code = collections.defaultdict(list)
|
||||
|
||||
|
||||
def translate_code(language, filename, code):
|
||||
"""
|
||||
This function can be called to include a block of code verbatim
|
||||
into `file` when a game is generated in `language`.
|
||||
"""
|
||||
|
||||
language_code[language, filename].extend([''] + code.split("\n"))
|
||||
|
||||
|
||||
class CodeGenerator(object):
|
||||
"""
|
||||
This is used to generate and update the GUI code.
|
||||
"""
|
||||
|
||||
def __init__(self, parameters):
|
||||
"""
|
||||
Generates or updates gui.rpy.
|
||||
"""
|
||||
|
||||
self.p = parameters
|
||||
|
||||
def load_template(self, filename):
|
||||
|
||||
target = os.path.join(self.p.prefix, filename)
|
||||
|
||||
if os.path.exists(target) and not self.p.replace_code:
|
||||
template = target
|
||||
else:
|
||||
template = os.path.join(self.p.template, filename)
|
||||
|
||||
if not os.path.exists(template):
|
||||
return False
|
||||
else:
|
||||
with codecs.open(template, "r", "utf-8") as f:
|
||||
self.lines = [ i.rstrip().replace(u"\ufeff", "") for i in f ]
|
||||
|
||||
return True
|
||||
|
||||
def remove_scale(self):
|
||||
|
||||
def scale(m):
|
||||
original = int(m.group(1))
|
||||
scaled = int(math.ceil(original * self.p.scale))
|
||||
return str(scaled)
|
||||
|
||||
lines = [ ]
|
||||
|
||||
for l in self.lines:
|
||||
l = re.sub(r'gui.scale\((.*?)\)', scale, l)
|
||||
lines.append(l)
|
||||
|
||||
self.lines = lines
|
||||
|
||||
def update_size(self):
|
||||
|
||||
gui_init = "gui.init({}, {})".format(self.p.width, self.p.height)
|
||||
|
||||
lines = [ ]
|
||||
|
||||
for l in self.lines:
|
||||
l = re.sub(r'gui.init\(.*?\)', gui_init, l)
|
||||
lines.append(l)
|
||||
|
||||
self.lines = lines
|
||||
|
||||
def update_defines(self, replacements, additions=[]):
|
||||
"""
|
||||
Replaces define statements in gui.rpy.
|
||||
"""
|
||||
|
||||
replacements = dict(replacements)
|
||||
|
||||
for d in additions:
|
||||
replacements[d.name] = d.value
|
||||
|
||||
seen = set()
|
||||
|
||||
lines = [ ]
|
||||
|
||||
for l in self.lines:
|
||||
|
||||
m = re.match(r'^(\s*)define (.*?) =', l)
|
||||
|
||||
if m:
|
||||
indent = m.group(1)
|
||||
variable = m.group(2)
|
||||
|
||||
if variable in replacements:
|
||||
l = "{}define {} = {}".format(indent, variable, replacements[variable])
|
||||
|
||||
seen.add(variable)
|
||||
|
||||
lines.append(l)
|
||||
|
||||
for d in additions:
|
||||
|
||||
if d.name in seen:
|
||||
continue
|
||||
|
||||
seen.add(d.name)
|
||||
|
||||
lines.append("")
|
||||
|
||||
if d.comment:
|
||||
for s in textwrap.wrap(d.comment):
|
||||
lines.append("## " + s)
|
||||
|
||||
lines.append("define {} = {}".format(d.name, d.value))
|
||||
|
||||
self.lines = lines
|
||||
|
||||
def update_gui_defines(self):
|
||||
"""
|
||||
Replaces define statements in gui.rpy.
|
||||
"""
|
||||
|
||||
replacements = {
|
||||
'gui.accent_color' : repr(self.p.accent_color.hexcode),
|
||||
'gui.selected_color' : repr(self.p.selected_color.hexcode),
|
||||
'gui.hover_color' : repr(self.p.hover_color.hexcode),
|
||||
'gui.muted_color' : repr(self.p.muted_color.hexcode),
|
||||
'gui.hover_muted_color' : repr(self.p.hover_muted_color.hexcode),
|
||||
'gui.title_color' : repr(self.p.title_color.hexcode),
|
||||
'gui.idle_color' : repr(self.p.idle_color.hexcode),
|
||||
'gui.idle_small_color' : repr(self.p.idle_small_color.hexcode),
|
||||
'gui.insensitive_color' : repr(self.p.insensitive_color.hexcode),
|
||||
'gui.text_color' : repr(self.p.text_color.hexcode),
|
||||
'gui.interface_text_color' : repr(self.p.text_color.hexcode),
|
||||
'gui.choice_button_text_idle_color' : repr(self.p.idle_color.hexcode),
|
||||
'gui.choice_button_text_insensitive_color' : repr(self.p.insensitive_color.hexcode),
|
||||
}
|
||||
|
||||
self.update_defines(replacements, language_defines[self.p.language])
|
||||
|
||||
def update_options_defines(self):
|
||||
"""
|
||||
Replaces define statements in options.rpy.
|
||||
"""
|
||||
|
||||
def quote(s):
|
||||
s = s.replace("\\", "\\\\")
|
||||
s = s.replace("\"", "\\\"")
|
||||
return '"' + s + '"'
|
||||
|
||||
replacements = {
|
||||
'config.name' : "_({})".format(quote(self.p.name)),
|
||||
'build.name' : quote(self.p.simple_name),
|
||||
'config.save_directory' : quote(self.p.savedir),
|
||||
}
|
||||
|
||||
self.update_defines(replacements)
|
||||
|
||||
def write_target(self, filename):
|
||||
|
||||
target = os.path.join(self.p.prefix, filename)
|
||||
|
||||
if os.path.exists(target):
|
||||
|
||||
backup = 1
|
||||
|
||||
while True:
|
||||
|
||||
bfn = "{}.{}.bak".format(target, backup)
|
||||
|
||||
if not os.path.exists(bfn):
|
||||
break
|
||||
|
||||
backup += 1
|
||||
|
||||
if not self.p.skip_backup:
|
||||
os.rename(target, bfn)
|
||||
|
||||
with codecs.open(target, "w", "utf-8") as f:
|
||||
f.write(u"\ufeff")
|
||||
|
||||
for l in self.lines:
|
||||
f.write(l + "\r\n")
|
||||
|
||||
def translate_strings(self):
|
||||
|
||||
def replace(m):
|
||||
s = eval(m.group(1))
|
||||
s = renpy.translation.translate_string(s, language=self.p.language)
|
||||
s = renpy.translation.quote_unicode(s)
|
||||
|
||||
quote = m.group(1)[0]
|
||||
|
||||
s = u"_({}{}{})".format(quote, s, quote)
|
||||
|
||||
return s
|
||||
|
||||
lines = [ ]
|
||||
|
||||
for l in self.lines:
|
||||
|
||||
l = re.sub(r'_\((\".*?\")\)', replace, l)
|
||||
l = re.sub(r'_\((\'.*?\')\)', replace, l)
|
||||
|
||||
lines.append(l)
|
||||
|
||||
self.lines = lines
|
||||
|
||||
def translate_comments(self):
|
||||
|
||||
lines = [ ]
|
||||
|
||||
comment = [ ]
|
||||
indent = ""
|
||||
|
||||
for l in self.lines:
|
||||
|
||||
m = re.match(r'^(\s*## )(.*)', l.rstrip())
|
||||
|
||||
if m:
|
||||
|
||||
indent = m.group(1)
|
||||
c = m.group(2)
|
||||
|
||||
if comment:
|
||||
c = c.strip()
|
||||
|
||||
comment.append(c)
|
||||
|
||||
else:
|
||||
|
||||
if comment:
|
||||
s = "## " + ' '.join(comment)
|
||||
|
||||
if s.endswith("#"):
|
||||
hashpad = True
|
||||
s = s.rstrip('# ')
|
||||
else:
|
||||
hashpad = False
|
||||
|
||||
s = renpy.translation.translate_string(s, language=self.p.language)
|
||||
|
||||
m = re.match(r'## ?([ *]*)(.*)', s)
|
||||
|
||||
if m is None:
|
||||
raise Exception("Comment translation doesn't start with '## ': {}".format(s))
|
||||
|
||||
prefix = m.group(1)
|
||||
empty = ' ' * len(prefix)
|
||||
rest = m.group(2)
|
||||
|
||||
len_prefix = len(indent) + len(prefix)
|
||||
len_wrap = 80 - len_prefix
|
||||
|
||||
import store.gui
|
||||
|
||||
for i, s in enumerate(renpy.text.extras.textwrap(rest, len_wrap, store.gui.asian)):
|
||||
|
||||
if i == 0:
|
||||
s = indent + prefix + s
|
||||
else:
|
||||
s = indent + empty + s
|
||||
|
||||
if hashpad and len(s) < 79:
|
||||
s = s + ' ' + "#" * (79 - len(s))
|
||||
|
||||
lines.append(s)
|
||||
|
||||
comment = [ ]
|
||||
|
||||
lines.append(l)
|
||||
|
||||
self.lines = lines
|
||||
|
||||
def copy_files(self):
|
||||
|
||||
for src, dst in language_copies[self.p.language]:
|
||||
src = os.path.join(renpy.config.renpy_base, src)
|
||||
dst = os.path.join(self.p.prefix, dst)
|
||||
|
||||
if os.path.exists(dst):
|
||||
continue
|
||||
|
||||
dstdir = os.path.dirname(dst)
|
||||
|
||||
if not os.path.exists(dstdir):
|
||||
os.makedirs(dstdir, 0o777)
|
||||
|
||||
shutil.copy(src, dst)
|
||||
|
||||
def copy_script(self, name):
|
||||
dst = os.path.join(self.p.prefix, name)
|
||||
|
||||
if os.path.exists(dst):
|
||||
return
|
||||
|
||||
language = renpy.store._preferences.language # @UndefinedVariable
|
||||
|
||||
if language is None:
|
||||
language = "None"
|
||||
|
||||
src = os.path.join(renpy.config.gamedir, "tl", language, name + "m")
|
||||
|
||||
if not os.path.exists(src):
|
||||
src = os.path.join(self.p.template, name)
|
||||
|
||||
if not self.load_template(src):
|
||||
return
|
||||
|
||||
self.remove_scale()
|
||||
self.write_target(dst)
|
||||
|
||||
def add_code(self, fn):
|
||||
|
||||
if not self.p.replace_code:
|
||||
return
|
||||
|
||||
self.lines.extend(language_code[self.p.language, fn])
|
||||
|
||||
def generate_gui(self, fn, defines=False):
|
||||
if not self.p.update_code:
|
||||
return
|
||||
|
||||
if not self.load_template(fn):
|
||||
return
|
||||
|
||||
if defines:
|
||||
self.update_gui_defines()
|
||||
|
||||
if self.p.replace_code:
|
||||
self.remove_scale()
|
||||
self.update_size()
|
||||
self.translate_strings()
|
||||
self.translate_comments()
|
||||
self.add_code(fn)
|
||||
|
||||
self.write_target(fn)
|
||||
|
||||
def generate_code(self, fn):
|
||||
|
||||
target = os.path.join(self.p.prefix, fn)
|
||||
|
||||
if os.path.exists(target):
|
||||
return
|
||||
|
||||
if not self.load_template(fn):
|
||||
return
|
||||
|
||||
self.translate_strings()
|
||||
self.translate_comments()
|
||||
self.update_options_defines()
|
||||
|
||||
self.add_code(fn)
|
||||
|
||||
self.write_target(fn)
|
||||
|
Before Width: | Height: | Size: 14 KiB |
@@ -1,447 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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.
|
||||
|
||||
import pygame_sdl2
|
||||
import os
|
||||
|
||||
from renpy.store import config
|
||||
import renpy.display
|
||||
|
||||
|
||||
class ImageGenerator(object):
|
||||
|
||||
def __init__(self, parameters):
|
||||
|
||||
pygame_sdl2.image.init()
|
||||
|
||||
self.p = p = parameters
|
||||
|
||||
self.width = p.width
|
||||
self.height = p.height
|
||||
|
||||
self.scale = p.scale
|
||||
|
||||
self.accent_color = p.accent_color
|
||||
self.boring_color = p.boring_color
|
||||
|
||||
self.hover_color = p.hover_color
|
||||
self.muted_color = p.muted_color
|
||||
self.hover_muted_color = p.hover_muted_color
|
||||
|
||||
self.menu_color = p.menu_color
|
||||
|
||||
self.prefix = os.path.join(p.prefix, "gui", "")
|
||||
|
||||
try:
|
||||
os.mkdir(self.prefix, 0o777)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
self.full_width = self.width / self.scale
|
||||
self.full_height = self.height / self.scale
|
||||
|
||||
self.overwrite = p.replace_images
|
||||
|
||||
def scale_int(self, n):
|
||||
rv = int(n * self.scale)
|
||||
|
||||
if rv < 1:
|
||||
rv = 1
|
||||
|
||||
return rv
|
||||
|
||||
def rescale_template(self, t):
|
||||
|
||||
rv = [ ]
|
||||
|
||||
for pos, opacity in t:
|
||||
rv.append((pos * self.scale, opacity))
|
||||
|
||||
return rv
|
||||
|
||||
def generate_line(self, template):
|
||||
|
||||
size = int(max(i[0] for i in template))
|
||||
|
||||
rv = [ ]
|
||||
|
||||
right_pos, right_value = template[0]
|
||||
|
||||
for i in range(size):
|
||||
|
||||
if i == right_pos:
|
||||
rv.append(right_value)
|
||||
continue
|
||||
|
||||
while i >= right_pos:
|
||||
left_pos = right_pos
|
||||
left_value = right_value
|
||||
|
||||
right_pos, right_value = template.pop(0)
|
||||
|
||||
done = 1.0 * (i - left_pos) / (right_pos - left_pos)
|
||||
rv.append(left_value + done * (right_value - left_value))
|
||||
|
||||
return rv
|
||||
|
||||
def crop_line(self, line, size):
|
||||
"""
|
||||
Crops the center `size` pixels out of `line`.
|
||||
"""
|
||||
|
||||
if len(line) <= size:
|
||||
return line
|
||||
|
||||
start = (len(line) - size) // 2
|
||||
|
||||
return line[start:start + size ]
|
||||
|
||||
def save(self, s, filename, overwrite=True):
|
||||
|
||||
fn = self.prefix + filename + ".png"
|
||||
dn = os.path.dirname(fn)
|
||||
|
||||
try:
|
||||
os.makedirs(dn, 0o777)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if os.path.exists(fn):
|
||||
|
||||
if not overwrite:
|
||||
return
|
||||
|
||||
if not self.overwrite:
|
||||
return
|
||||
|
||||
index = 1
|
||||
|
||||
while True:
|
||||
bfn = u"{}.{}.bak".format(fn, index)
|
||||
|
||||
if not os.path.exists(bfn):
|
||||
break
|
||||
|
||||
index += 1
|
||||
|
||||
if not self.p.skip_backup:
|
||||
os.rename(fn, bfn)
|
||||
|
||||
pygame_sdl2.image.save(s, fn, 3)
|
||||
|
||||
def make_surface(self, width, height):
|
||||
return pygame_sdl2.Surface((width, height), pygame_sdl2.SRCALPHA)
|
||||
|
||||
def generate_image(self, filename, xtmpl, ytmpl, color=(0, 0, 0, 255)):
|
||||
|
||||
r, g, b, a = color
|
||||
|
||||
xtmpl = self.rescale_template(xtmpl)
|
||||
ytmpl = self.rescale_template(ytmpl)
|
||||
|
||||
xline = self.generate_line(xtmpl)
|
||||
yline = self.generate_line(ytmpl)
|
||||
|
||||
xline = self.crop_line(xline, self.width)
|
||||
yline = self.crop_line(yline, self.height)
|
||||
|
||||
s = self.make_surface(len(xline), len(yline))
|
||||
|
||||
for x, xv in enumerate(xline):
|
||||
for y, yv in enumerate(yline):
|
||||
v = xv * yv
|
||||
s.set_at((x, y), (r, g, b, int(a * v)))
|
||||
|
||||
self.save(s, filename)
|
||||
|
||||
def generate_textbox(self):
|
||||
|
||||
XSIZE = self.full_width
|
||||
XINSIDE = (XSIZE - 744) // 2
|
||||
|
||||
YSIZE = 185
|
||||
YBORDER = 5
|
||||
|
||||
X = [
|
||||
(0, 0.0),
|
||||
(XINSIDE, 1.0),
|
||||
(XSIZE - XINSIDE, 1.0),
|
||||
(XSIZE, 0.0),
|
||||
]
|
||||
|
||||
Y = [
|
||||
(0, 0.0),
|
||||
(YBORDER, 1.0),
|
||||
(YSIZE, 1.0),
|
||||
]
|
||||
|
||||
self.generate_image("textbox", X, Y, self.boring_color.opacity(.8))
|
||||
|
||||
YSIZE = 240
|
||||
YBORDER = 5
|
||||
|
||||
X = [ (0, 1.0), (self.full_width, 1.0) ]
|
||||
|
||||
Y = [
|
||||
(0, 0.0),
|
||||
(YBORDER, 1.0),
|
||||
(YSIZE, 1.0),
|
||||
]
|
||||
|
||||
self.generate_image("phone/textbox", X, Y, self.boring_color.opacity(.8))
|
||||
|
||||
width = self.scale_int(300)
|
||||
height = self.scale_int(36)
|
||||
|
||||
s = self.make_surface(width, height)
|
||||
self.save(s, "namebox")
|
||||
|
||||
def generate_nvl(self):
|
||||
XSIZE = self.full_width
|
||||
XINSIDE = (XSIZE - 800) // 2
|
||||
|
||||
YSIZE = self.full_height
|
||||
|
||||
X = [
|
||||
(0, 0.0),
|
||||
(XINSIDE, 1.0),
|
||||
(XSIZE - XINSIDE, 1.0),
|
||||
(XSIZE, 0.0),
|
||||
]
|
||||
|
||||
Y = [
|
||||
(0, 1.0),
|
||||
(YSIZE, 1.0),
|
||||
]
|
||||
|
||||
self.generate_image("nvl", X, Y, self.boring_color.opacity(.8))
|
||||
|
||||
X = [
|
||||
(0, 1.0),
|
||||
(XSIZE, 1.0),
|
||||
]
|
||||
|
||||
Y = [
|
||||
(0, 1.0),
|
||||
(YSIZE, 1.0),
|
||||
]
|
||||
|
||||
self.generate_image("phone/nvl", X, Y, self.boring_color.opacity(.8))
|
||||
|
||||
def generate_choice_button(self):
|
||||
XSIZE = 790
|
||||
XINSIDE = 100
|
||||
|
||||
YSIZE = 35
|
||||
YBORDER = 3
|
||||
|
||||
X = [
|
||||
(0, 0.0),
|
||||
(XINSIDE, 1.0),
|
||||
(XSIZE - XINSIDE, 1.0),
|
||||
(XSIZE, 0.0),
|
||||
]
|
||||
|
||||
Y = [
|
||||
(0, 0.0),
|
||||
(YBORDER, 1.0),
|
||||
(YSIZE - YBORDER, 1.0),
|
||||
(YSIZE, 0.0),
|
||||
]
|
||||
|
||||
self.generate_image("button/choice_idle_background", X, Y, self.boring_color.opacity(.8))
|
||||
self.generate_image("button/choice_hover_background", X, Y, self.accent_color.opacity(.95))
|
||||
self.generate_image("phone/button/choice_idle_background", X, Y, self.boring_color.opacity(.8))
|
||||
self.generate_image("phone/button/choice_hover_background", X, Y, self.accent_color.opacity(.95))
|
||||
|
||||
def generate_overlay(self):
|
||||
|
||||
width = self.scale_int(280)
|
||||
phone_width = self.scale_int(340)
|
||||
|
||||
game_y = self.scale_int(120)
|
||||
game_height = self.scale_int(570)
|
||||
|
||||
line_width = self.scale_int(3)
|
||||
|
||||
if self.p.light:
|
||||
opacity = 0.9
|
||||
else:
|
||||
opacity = 0.8
|
||||
|
||||
# Main menu.
|
||||
mm = self.make_surface(self.width, self.height)
|
||||
mm.subsurface((0, 0, width, self.height)).fill(self.boring_color.opacity(opacity))
|
||||
mm.subsurface((width - line_width, 0, line_width, self.height)).fill(self.accent_color)
|
||||
self.save(mm, "overlay/main_menu")
|
||||
|
||||
mm = self.make_surface(self.width, self.height)
|
||||
mm.subsurface((0, 0, phone_width, self.height)).fill(self.boring_color.opacity(opacity))
|
||||
mm.subsurface((phone_width - line_width, 0, line_width, self.height)).fill(self.accent_color)
|
||||
self.save(mm, "phone/overlay/main_menu")
|
||||
|
||||
# Game menu.
|
||||
gm = self.make_surface(self.width, self.height)
|
||||
gm.fill(self.boring_color.opacity(opacity))
|
||||
gm.subsurface((width - line_width, game_y, line_width, game_height)).fill(self.accent_color)
|
||||
self.save(gm, "overlay/game_menu")
|
||||
|
||||
gm = self.make_surface(self.width, self.height)
|
||||
gm.fill(self.boring_color.opacity(opacity))
|
||||
gm.subsurface((phone_width - line_width, game_y, line_width, game_height)).fill(self.accent_color)
|
||||
self.save(gm, "phone/overlay/game_menu")
|
||||
|
||||
# Confirm.
|
||||
gm = self.make_surface(self.width, self.height)
|
||||
gm.fill(self.boring_color.opacity(.6))
|
||||
self.save(gm, "overlay/confirm")
|
||||
|
||||
def generate_frame(self):
|
||||
width = self.scale_int(600)
|
||||
height = self.scale_int(250)
|
||||
|
||||
border = self.scale_int(3)
|
||||
|
||||
s = self.make_surface(width, height)
|
||||
s.fill(self.accent_color)
|
||||
s.subsurface((border, border, width - 2 * border, height - 2 * border)).fill(self.boring_color)
|
||||
self.save(s, "frame")
|
||||
|
||||
def generate_quick_buttons(self):
|
||||
width = self.scale_int(100)
|
||||
height = self.scale_int(30)
|
||||
|
||||
s = self.make_surface(width, height)
|
||||
self.save(s, "button/quick_idle_background")
|
||||
self.save(s, "button/quick_hover_background")
|
||||
|
||||
def generate_skip(self):
|
||||
XSIZE = 240
|
||||
XRIGHT = 50
|
||||
|
||||
YSIZE = 43
|
||||
|
||||
X = [
|
||||
(0, 1.0),
|
||||
(XSIZE - XRIGHT, 1.0),
|
||||
(XSIZE, 0.0),
|
||||
]
|
||||
|
||||
Y = [
|
||||
(0, 1.0),
|
||||
(YSIZE, 1.0),
|
||||
]
|
||||
|
||||
self.generate_image("skip", X, Y, self.boring_color.opacity(.8))
|
||||
|
||||
def generate_notify(self):
|
||||
XSIZE = 922
|
||||
XRIGHT = 50
|
||||
|
||||
YSIZE = 43
|
||||
|
||||
X = [
|
||||
(0, 1.0),
|
||||
(XSIZE - XRIGHT, 1.0),
|
||||
(XSIZE, 0.0),
|
||||
]
|
||||
|
||||
Y = [
|
||||
(0, 1.0),
|
||||
(YSIZE, 1.0),
|
||||
]
|
||||
|
||||
self.generate_image("notify", X, Y, self.boring_color.opacity(.8))
|
||||
|
||||
def generate_icon(self):
|
||||
|
||||
icon_fn = os.path.join(config.renpy_base, "launcher", "game", "gui7", "icon.png")
|
||||
icon = pygame_sdl2.image.load(icon_fn)
|
||||
|
||||
width, height = icon.get_size()
|
||||
surf = pygame_sdl2.Surface((width, height), pygame_sdl2.SRCALPHA)
|
||||
|
||||
ro, go, bo, _ao = tuple(self.accent_color)
|
||||
|
||||
ro -= 23
|
||||
go -= 23
|
||||
bo -= 23
|
||||
|
||||
for y in range(height):
|
||||
for x in range(width):
|
||||
r, g, b, a = icon.get_at((x, y))
|
||||
|
||||
r = max(0, min(r + ro, 255))
|
||||
g = max(0, min(g + go, 255))
|
||||
b = max(0, min(b + bo, 255))
|
||||
|
||||
surf.set_at((x, y), (r, g, b, a))
|
||||
|
||||
self.save(surf, "window_icon", overwrite=False)
|
||||
|
||||
def generate_menus(self):
|
||||
s = self.make_surface(self.width, self.height)
|
||||
s.fill(self.menu_color)
|
||||
|
||||
self.save(s, "main_menu", overwrite=False)
|
||||
self.save(s, "game_menu", overwrite=False)
|
||||
|
||||
def generate_bubble(self):
|
||||
|
||||
import shutil
|
||||
|
||||
for fn in [ "bubble.png", "thoughtbubble.png" ]:
|
||||
|
||||
source = os.path.join(config.renpy_base, "gui", "game", "gui", fn)
|
||||
dest = os.path.join(self.prefix, fn)
|
||||
|
||||
if source == dest:
|
||||
return
|
||||
|
||||
shutil.copyfile(source, dest)
|
||||
|
||||
|
||||
def generate_all(self):
|
||||
self.generate_textbox()
|
||||
self.generate_choice_button()
|
||||
self.generate_overlay()
|
||||
self.generate_frame()
|
||||
self.generate_nvl()
|
||||
self.generate_quick_buttons()
|
||||
self.generate_skip()
|
||||
self.generate_notify()
|
||||
self.generate_menus()
|
||||
self.generate_icon()
|
||||
self.generate_bubble()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import argparse
|
||||
|
||||
ap = argparse.ArgumentParser()
|
||||
|
||||
ap.add_argument("prefix")
|
||||
ap.add_argument("width", type=int)
|
||||
ap.add_argument("height", type=int)
|
||||
|
||||
args = ap.parse_args()
|
||||
|
||||
ImageGenerator(args.prefix, args.width, args.height).generate_all()
|
||||
@@ -1,113 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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.
|
||||
|
||||
from renpy.store import Color
|
||||
import time
|
||||
|
||||
# The target width used in templates.
|
||||
WIDTH = 1280
|
||||
HEIGHT = 720
|
||||
|
||||
|
||||
class GuiParameters(object):
|
||||
"""
|
||||
This represents the parameters to the gui. This is used to initialize
|
||||
the ImageGenerator and CodeGenerator objects to a consistent set of
|
||||
parameters.
|
||||
"""
|
||||
|
||||
def __init__(self, prefix, template, width, height, accent, boring, light, language, replace_images, replace_code, update_code, name=None):
|
||||
|
||||
self.prefix = prefix
|
||||
self.template = template
|
||||
|
||||
self.width = width
|
||||
self.height = height
|
||||
|
||||
self.scale = min(1.0 * width / WIDTH, 1.0 * height / HEIGHT)
|
||||
|
||||
self.accent_color = Color(accent)
|
||||
self.boring_color = Color(boring)
|
||||
|
||||
# tint = n * color + (1-n) * white
|
||||
# shade = n * color + (1-n) * black
|
||||
|
||||
self.light = light
|
||||
|
||||
if light:
|
||||
self.hover_color = self.accent_color # .tint(.95)
|
||||
self.muted_color = self.accent_color.tint(.6)
|
||||
self.hover_muted_color = self.accent_color.tint(.4)
|
||||
else:
|
||||
self.hover_color = self.accent_color.tint(.6)
|
||||
self.muted_color = self.accent_color.shade(.4)
|
||||
self.hover_muted_color = self.accent_color.shade(.6)
|
||||
|
||||
if light:
|
||||
self.menu_color = self.accent_color.replace_hsv_saturation(.25).replace_value(.75)
|
||||
else:
|
||||
self.menu_color = self.accent_color.replace_hsv_saturation(.25).replace_value(.25)
|
||||
|
||||
self.title_color = self.accent_color.replace_hsv_saturation(.5).replace_value(1.0)
|
||||
|
||||
if light:
|
||||
|
||||
self.selected_color = Color("#555555")
|
||||
self.idle_color = Color("#707070")
|
||||
self.idle_small_color = Color("#606060")
|
||||
self.text_color = Color("#404040")
|
||||
self.choice_color = Color("#cccccc")
|
||||
|
||||
else:
|
||||
|
||||
self.selected_color = Color("#ffffff")
|
||||
self.idle_color = Color("#888888")
|
||||
self.idle_small_color = Color("#aaaaaa")
|
||||
self.text_color = Color("#ffffff")
|
||||
self.choice_color = Color("#cccccc")
|
||||
|
||||
self.insensitive_color = self.idle_color.replace_opacity(.5)
|
||||
|
||||
self.language = language
|
||||
|
||||
if replace_code:
|
||||
update_code = True
|
||||
|
||||
self.replace_images = replace_images
|
||||
self.replace_code = replace_code
|
||||
self.update_code = update_code
|
||||
|
||||
self.skip_backup = False
|
||||
|
||||
name = name or ''
|
||||
|
||||
self.name = name
|
||||
|
||||
GOOD_CHARACTERS = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_"
|
||||
|
||||
simple_name = "".join(i for i in name if i in GOOD_CHARACTERS)
|
||||
|
||||
if not simple_name:
|
||||
simple_name = "game"
|
||||
|
||||
self.simple_name = simple_name
|
||||
|
||||
self.savedir = self.simple_name + "-" + str(int(time.time()))
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 60 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 433 B After Width: | Height: | Size: 687 B |
|
After Width: | Height: | Size: 96 B |
|
After Width: | Height: | Size: 106 B |
|
Before Width: | Height: | Size: 160 KiB |
|
Before Width: | Height: | Size: 71 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
@@ -1,197 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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 fnmatch
|
||||
import re
|
||||
import zipfile
|
||||
|
||||
def install_from_zip(name, zipglob, patterns):
|
||||
|
||||
# Determine the filename matching the zipglob, and put it into filename.
|
||||
filenames = [ i for i in os.listdir(config.renpy_base) if fnmatch.fnmatch(i.lower(), zipglob.lower()) ]
|
||||
|
||||
if not filenames:
|
||||
interface.error(
|
||||
_("Could not install [name!t], as a file matching [zipglob] was not found in the Ren'Py SDK directory."),
|
||||
label="install",
|
||||
name=name,
|
||||
zipglob=zipglob,
|
||||
)
|
||||
|
||||
filenames.sort(key=lambda a : a.lower())
|
||||
filename = filenames[-1]
|
||||
|
||||
# The zipfile.
|
||||
zf = zipfile.ZipFile(os.path.join(config.renpy_base, filename))
|
||||
|
||||
for fn in zf.namelist():
|
||||
matchfn = fn.replace("\\", "/")
|
||||
dstfn = None
|
||||
|
||||
renpy.write_log(fn)
|
||||
|
||||
for src, dst in patterns:
|
||||
if re.match(src, matchfn):
|
||||
dstfn = re.sub(src, dst, matchfn)
|
||||
break
|
||||
|
||||
if not dstfn:
|
||||
continue
|
||||
|
||||
dstfn = os.path.join(config.renpy_base, dstfn)
|
||||
|
||||
if not os.path.exists(os.path.dirname(dstfn)):
|
||||
try:
|
||||
os.makedirs(os.path.dirname(dstfn))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
renpy.write_log(fn + " -> " + dstfn)
|
||||
|
||||
data = zf.read(fn)
|
||||
with open(dstfn, "wb") as f:
|
||||
f.write(data)
|
||||
|
||||
try:
|
||||
os.chmod(dstfn, 0o755)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
interface.info(_("Successfully installed [name!t]."), name=name)
|
||||
|
||||
|
||||
label install_live2d:
|
||||
python hide:
|
||||
_prefix = r"lib/py3-"
|
||||
|
||||
patterns = [
|
||||
(r".*/Core/dll/linux/x86_64/(libLive2DCubismCore.so)", _prefix + r"linux-x86_64/\1"),
|
||||
(r".*/Core/dll/windows/x86_64/(Live2DCubismCore.dll)", _prefix + r"windows-x86_64/\1"),
|
||||
(r".*/Core/dll/macos/(libLive2DCubismCore.dylib)", _prefix + r"mac-universal/\1"),
|
||||
(r".*/Core/dll/experimental/rpi/(libLive2DCubismCore.so)", _prefix + r"linux-armv7l/\1"),
|
||||
|
||||
(r".*/Core/dll/android/(armeabi-v7a/libLive2DCubismCore.so)", r"rapt/prototype/renpyandroid/src/main/jniLibs/\1"),
|
||||
(r".*/Core/dll/android/(arm64-v8a/libLive2DCubismCore.so)", r"rapt/prototype/renpyandroid/src/main/jniLibs/\1"),
|
||||
(r".*/Core/dll/android/(x86_64/libLive2DCubismCore.so)", r"rapt/prototype/renpyandroid/src/main/jniLibs/\1"),
|
||||
]
|
||||
|
||||
install_from_zip("Live2D Cubism SDK for Native", "CubismSdkForNative-[45]-*.zip", patterns)
|
||||
|
||||
jump front_page
|
||||
|
||||
screen install_preferences():
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("This screen allows you to install libraries that can't be distributed with Ren'Py. Some of these libraries may require you to agree to a third-party license before being used or distributed.")
|
||||
|
||||
add SPACER
|
||||
|
||||
if not achievement.has_steam:
|
||||
|
||||
textbutton _("Install Steam Support"):
|
||||
action Jump("install_steam")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Before installing Steam support, please make sure you are a {a=https://partner.steamgames.com/}Steam partner{/a}.")
|
||||
|
||||
else:
|
||||
|
||||
textbutton _("Install Steam Support")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Steam support has already been installed.")
|
||||
|
||||
add SPACER
|
||||
|
||||
textbutton _("Install Live2D Cubism SDK for Native"):
|
||||
action Jump("prompt_live2d")
|
||||
|
||||
|
||||
screen install_live2d():
|
||||
|
||||
frame:
|
||||
style_group "l"
|
||||
style "l_root"
|
||||
|
||||
window:
|
||||
|
||||
has vbox
|
||||
|
||||
label _("Install Libraries")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
hbox:
|
||||
frame:
|
||||
style "l_indent"
|
||||
xfill True
|
||||
|
||||
viewport:
|
||||
scrollbars "vertical"
|
||||
mousewheel True
|
||||
|
||||
has vbox
|
||||
|
||||
add SPACER
|
||||
|
||||
textbutton _("Install Live2D Cubism SDK for Native"):
|
||||
action Jump("install_live2d")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("The {a=https://www.live2d.com/en/download/cubism-sdk/download-native/}Cubism SDK for Native{/a} adds support for displaying Live2D models. Place CubismSdkForNative-{i}version{/i}.zip in the Ren'Py SDK directory, and then click Install. Distributing a game with Live2D requires you to accept a license from Live2D, Inc.")
|
||||
|
||||
add SPACER
|
||||
|
||||
text _("Live2D in Ren'Py doesn't support the Web, Android x86_64 (including emulators and Chrome OS), and must be added to iOS projects manually. Live2D must be reinstalled after upgrading Ren'Py or installing Android support.")
|
||||
|
||||
|
||||
|
||||
textbutton _("Cancel") action Return(False) style "l_left_button"
|
||||
textbutton _("Open Ren'Py SDK Directory") action OpenDirectory(config.renpy_base, absolute=True) style "l_right_button"
|
||||
|
||||
timer 2.0 action renpy.restart_interaction repeat True
|
||||
|
||||
label prompt_live2d:
|
||||
call screen install_live2d
|
||||
jump preferences
|
||||
|
||||
label install_steam:
|
||||
$ add_dlc("steam", restart=True)
|
||||
jump install
|
||||
@@ -1,503 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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.
|
||||
|
||||
import hashlib
|
||||
import os
|
||||
import time
|
||||
import requests
|
||||
import zipfile
|
||||
import tarfile
|
||||
import shutil
|
||||
import subprocess
|
||||
import renpy
|
||||
import stat
|
||||
|
||||
VERSION = 1
|
||||
|
||||
# True if the installer should run in quiet mode.
|
||||
quiet = False
|
||||
|
||||
from store import _, config, interface, project, Jump # type: ignore
|
||||
|
||||
temp_exists = False
|
||||
|
||||
def _ensure_temp():
|
||||
"""
|
||||
Ensures that the directories needed by the extension API are present.
|
||||
"""
|
||||
|
||||
global temp_exists
|
||||
|
||||
if temp_exists:
|
||||
return
|
||||
|
||||
backups = os.path.join(config.renpy_base, "tmp", "installer", "backups")
|
||||
|
||||
try:
|
||||
if not os.path.exists(backups):
|
||||
os.makedirs(os.path.dirname(backups))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
temp_exists = True
|
||||
|
||||
# The target directory that the extensions API operates on.
|
||||
target = None
|
||||
|
||||
def set_target(directory):
|
||||
"""
|
||||
This sets the directory that the extension API targets. This is where
|
||||
packages are unpacked to and the default working directory where the
|
||||
programs are run.
|
||||
"""
|
||||
|
||||
global target
|
||||
target = directory
|
||||
|
||||
_clean("temp:", 3)
|
||||
|
||||
|
||||
def _path(filename):
|
||||
"""
|
||||
Returns the full path to `filename`. If `filename` starts with the
|
||||
prefix temp:, it's placed in the temp directory. If the filename
|
||||
starts with backup, a backup filename is returned. Otherwise,
|
||||
the path is interpreted relative to the target directory.
|
||||
"""
|
||||
|
||||
_ensure_temp()
|
||||
|
||||
tempdir = os.path.join(config.renpy_base, "tmp", "installer")
|
||||
backups = os.path.join(config.renpy_base, "tmp", "installer", "backups")
|
||||
|
||||
prefix, _, rest = filename.partition(":")
|
||||
|
||||
if prefix == "temp":
|
||||
return os.path.join(tempdir, rest)
|
||||
|
||||
if prefix == "backup":
|
||||
base = os.path.basename(rest.rpartition(":")[2])
|
||||
return os.path.join(backups, base + "." + str(time.time()))
|
||||
|
||||
if prefix == "renpy":
|
||||
return os.path.join(config.renpy_base, rest)
|
||||
|
||||
if target is None:
|
||||
raise Exception("The target directory has not been set.")
|
||||
|
||||
return os.path.join(target, filename)
|
||||
|
||||
|
||||
def _clean(directory, age=3):
|
||||
"""
|
||||
Removes files from `directory` that are older than `age` days.
|
||||
"""
|
||||
|
||||
directory = _path(directory)
|
||||
|
||||
for root, dirs, files in os.walk(directory, topdown=False):
|
||||
for f in files:
|
||||
filename = os.path.join(root, f)
|
||||
mtime = os.stat(filename).st_mtime
|
||||
if time.time() - mtime > age * 86400:
|
||||
try:
|
||||
os.unlink(filename)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
if root != directory:
|
||||
|
||||
try:
|
||||
os.rmdir(root)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
def _friendly(filename):
|
||||
"""
|
||||
Returns a version of the filename without any leading prefix.
|
||||
"""
|
||||
|
||||
return filename.rpartition(":")[2]
|
||||
|
||||
|
||||
def _check_hash(filename, hashj):
|
||||
"""
|
||||
Returns a cryptographic hash of `filename`. `filename` should
|
||||
be a full path, one returned by temp or path.
|
||||
"""
|
||||
|
||||
try:
|
||||
|
||||
sha = hashlib.sha256()
|
||||
|
||||
with open(filename, "rb") as f:
|
||||
while True:
|
||||
data = f.read(1024 * 1024)
|
||||
if not data:
|
||||
break
|
||||
|
||||
sha.update(data)
|
||||
|
||||
return sha.hexdigest() == hash
|
||||
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
# The name and url of the file that is currently being downloaded. This is meant to
|
||||
# to be used by the interface screens to show the user what files are being
|
||||
# downloaded.
|
||||
download_file = ""
|
||||
download_url = ""
|
||||
|
||||
def download(url, filename, hash=None, headers=None, requests_kwargs={}):
|
||||
"""
|
||||
Downloads `url` to `filename`, a tempfile.
|
||||
"""
|
||||
global download_url
|
||||
|
||||
global download_file
|
||||
|
||||
download_url = url
|
||||
download_file = _friendly(filename)
|
||||
|
||||
filename = _path(filename)
|
||||
|
||||
if hash is not None:
|
||||
if _check_hash(filename, hash):
|
||||
return
|
||||
|
||||
progress_time = time.time()
|
||||
|
||||
all_headers = {"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36 renpy/8'}
|
||||
if headers:
|
||||
all_headers.update(headers)
|
||||
|
||||
try:
|
||||
|
||||
response = requests.get(url, stream=True, proxies=renpy.exports.proxies, timeout=15, headers=all_headers, **requests_kwargs)
|
||||
response.raise_for_status()
|
||||
|
||||
total_size = int(response.headers.get('content-length', 1))
|
||||
|
||||
downloaded = 0
|
||||
|
||||
with open(filename, "wb") as f:
|
||||
|
||||
for i in response.iter_content(65536):
|
||||
|
||||
f.write(i)
|
||||
downloaded += len(i)
|
||||
|
||||
if time.time() - progress_time > 0.1:
|
||||
progress_time = time.time()
|
||||
if not quiet:
|
||||
interface.processing(
|
||||
_("Downloading [installer.download_file]..."),
|
||||
complete=downloaded, total=total_size)
|
||||
|
||||
except requests.HTTPError as e:
|
||||
if not quiet:
|
||||
raise
|
||||
|
||||
interface.error(_("Could not download [installer.download_file] from [installer.download_url]:\n{b}[installer.download_error]"))
|
||||
|
||||
if hash is not None:
|
||||
if not quiet:
|
||||
raise Exception("Hash check failed.")
|
||||
if not _check_hash(filename, hash):
|
||||
interface.error(_("The downloaded file [installer.download_file] from [installer.download_url] is not correct."))
|
||||
|
||||
class _FixedZipFile(zipfile.ZipFile):
|
||||
"""
|
||||
A patched version of zipfile.ZipFile that adds support for:
|
||||
|
||||
* Unix permissions bits.
|
||||
* Unix symbolic links.
|
||||
"""
|
||||
|
||||
def _extract_member(self, member, targetpath, pwd):
|
||||
|
||||
if not isinstance(member, zipfile.ZipInfo):
|
||||
member = self.getinfo(member)
|
||||
|
||||
# build the destination pathname, replacing
|
||||
# forward slashes to platform specific separators.
|
||||
arcname = member.filename.replace('/', os.path.sep)
|
||||
|
||||
if os.path.altsep:
|
||||
arcname = arcname.replace(os.path.altsep, os.path.sep)
|
||||
# interpret absolute pathname as relative, remove drive letter or
|
||||
# UNC path, redundant separators, "." and ".." components.
|
||||
arcname = os.path.splitdrive(arcname)[1]
|
||||
invalid_path_parts = ('', os.path.curdir, os.path.pardir)
|
||||
arcname = os.path.sep.join(x for x in arcname.split(os.path.sep) if x not in invalid_path_parts)
|
||||
|
||||
targetpath = os.path.join(targetpath, arcname)
|
||||
targetpath = os.path.normpath(targetpath)
|
||||
|
||||
# Create all upper directories if necessary.
|
||||
upperdirs = os.path.dirname(targetpath)
|
||||
if upperdirs and not os.path.exists(upperdirs):
|
||||
os.makedirs(upperdirs)
|
||||
|
||||
if member.filename.endswith("/"):
|
||||
if not os.path.isdir(targetpath):
|
||||
os.mkdir(targetpath)
|
||||
return targetpath
|
||||
|
||||
attr = member.external_attr >> 16
|
||||
|
||||
if stat.S_ISLNK(attr):
|
||||
|
||||
with self.open(member, pwd=pwd) as source:
|
||||
linkto = source.read()
|
||||
|
||||
os.symlink(linkto, targetpath)
|
||||
|
||||
else:
|
||||
|
||||
with self.open(member, pwd=pwd) as source, open(targetpath, "wb") as target:
|
||||
shutil.copyfileobj(source, target)
|
||||
|
||||
if attr:
|
||||
os.chmod(targetpath, attr)
|
||||
|
||||
return targetpath
|
||||
|
||||
|
||||
# The name of the archive being unpacked.
|
||||
unpack_archive = ""
|
||||
|
||||
|
||||
def unpack(archive, destination):
|
||||
"""
|
||||
Unpacks `archive` to `destination`. `archive` should be the name of
|
||||
a zip or (perhaps compressed) tar file. `destination` should be a
|
||||
directory that the contents are unpacked into.
|
||||
"""
|
||||
|
||||
global unpack_archive
|
||||
unpack_archive = _friendly(archive)
|
||||
|
||||
if not quiet:
|
||||
interface.processing(_("Unpacking [installer.unpack_archive]..."))
|
||||
|
||||
archive = _path(archive)
|
||||
destination = _path(destination)
|
||||
|
||||
if not os.path.exists(destination):
|
||||
os.makedirs(destination)
|
||||
|
||||
old_cwd = os.getcwd()
|
||||
|
||||
try:
|
||||
|
||||
os.chdir(destination)
|
||||
|
||||
if tarfile.is_tarfile(archive):
|
||||
tar = tarfile.open(archive)
|
||||
tar.extractall(".")
|
||||
tar.close()
|
||||
|
||||
elif zipfile.is_zipfile(archive):
|
||||
zip = _FixedZipFile(archive)
|
||||
zip.extractall(".")
|
||||
zip.close()
|
||||
|
||||
else:
|
||||
raise Exception("Unknown file type.")
|
||||
|
||||
finally:
|
||||
os.chdir(old_cwd)
|
||||
|
||||
|
||||
def exists(filename):
|
||||
"""
|
||||
Returns true if `filename` exists.
|
||||
"""
|
||||
|
||||
return os.path.exists(_path(filename))
|
||||
|
||||
|
||||
def remove(filename):
|
||||
"""
|
||||
Removes a file or directory from the target directory, backing it up
|
||||
the temporary directory.
|
||||
"""
|
||||
|
||||
if not exists(filename):
|
||||
return
|
||||
|
||||
backup = _path("backup:" + filename)
|
||||
shutil.move(_path(filename), backup)
|
||||
|
||||
# Now, touch everything so _cleanup doesn't get it too quickly.
|
||||
|
||||
if os.path.isdir(backup):
|
||||
for root, dirs, files in os.walk(backup):
|
||||
for f in files:
|
||||
try:
|
||||
os.utime(os.path.join(root, f), None)
|
||||
except Exception:
|
||||
pass
|
||||
else:
|
||||
try:
|
||||
os.utime(backup, None)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def move(old_filename, new_filename):
|
||||
"""
|
||||
Moves a filename from `old_filename` to `new_filename`.
|
||||
"""
|
||||
|
||||
remove(new_filename)
|
||||
shutil.move(_path(old_filename), _path(new_filename))
|
||||
|
||||
|
||||
def mkdir(dirname):
|
||||
"""
|
||||
Makes the named directory.
|
||||
"""
|
||||
|
||||
if not os.path.exists(_path(dirname)):
|
||||
os.makedirs(_path(dirname))
|
||||
|
||||
|
||||
def info(message, **kwargs):
|
||||
"""
|
||||
Displays `message` to the user, asking them to click through or
|
||||
cancel.
|
||||
"""
|
||||
|
||||
interface.info(message, cancel=Jump("front_page"), **kwargs)
|
||||
|
||||
|
||||
def processing(message, **kwargs):
|
||||
"""
|
||||
Displays `message` to the user, without waiting.
|
||||
"""
|
||||
|
||||
interface.processing(message, **kwargs)
|
||||
|
||||
|
||||
def error(message, **kwargs):
|
||||
"""
|
||||
Displays `message` to the user, as an error.
|
||||
"""
|
||||
|
||||
interface.error(message)
|
||||
|
||||
|
||||
install_args = [ ]
|
||||
install_error = ""
|
||||
|
||||
def run(*args, **kwargs):
|
||||
"""
|
||||
Runs a program with the given arguments, in the target directory.
|
||||
"""
|
||||
|
||||
environ = { renpy.exports.fsencode(k) : renpy.exports.fsencode(v) for k, v in os.environ.items() }
|
||||
|
||||
for k, v in kwargs.pop("environ", {}).items():
|
||||
environ[renpy.exports.fsencode(k)] = renpy.exports.fsencode(v)
|
||||
|
||||
global install_args
|
||||
global install_error
|
||||
|
||||
args = [ renpy.exports.fsencode(i) for i in args ]
|
||||
|
||||
try:
|
||||
subprocess.check_call(args, cwd=target, env=environ) # type: ignore
|
||||
except Exception as e:
|
||||
install_args = args
|
||||
install_error = str(e)
|
||||
|
||||
interface.error(_("Could not run [installer.install_args!r]:\n[installer.install_error]"))
|
||||
|
||||
|
||||
_renpy = renpy
|
||||
|
||||
def manifest(url, renpy=False, insecure=False):
|
||||
"""
|
||||
Executes the manifest at `url`.
|
||||
|
||||
`renpy`
|
||||
If true, the manifest applies to Ren'Py. If False, the manifest applies
|
||||
to the current project.
|
||||
|
||||
`insecure`
|
||||
If true, verificaiton is disabled.
|
||||
"""
|
||||
|
||||
import ecdsa
|
||||
|
||||
download(url, "temp:manifest.py")
|
||||
|
||||
with open(_path("temp:manifest.py"), "rb") as f:
|
||||
manifest = f.read()
|
||||
|
||||
if not insecure:
|
||||
download(url + ".sig", "temp:manifest.py.sig")
|
||||
|
||||
with open(_path("temp:manifest.py.sig"), "rb") as f:
|
||||
sig = f.read()
|
||||
|
||||
key = ecdsa.VerifyingKey.from_pem(_renpy.exports.open_file("renpy_ecdsa_public.pem").read())
|
||||
|
||||
if not key.verify(sig, manifest):
|
||||
error(_("The manifest signature is not valid."))
|
||||
return
|
||||
|
||||
if renpy:
|
||||
set_target(config.renpy_base)
|
||||
else:
|
||||
if project.current is None:
|
||||
error(_("No project has been selected."))
|
||||
return
|
||||
|
||||
set_target(project.current.path)
|
||||
|
||||
exec(manifest.decode("utf-8"), {}, {})
|
||||
|
||||
|
||||
def local_manifest(filename, renpy=False):
|
||||
"""
|
||||
Executes the manifest in `filename`.
|
||||
|
||||
`renpy`
|
||||
If true, the manifest applies to Ren'Py. If False, the manifest applies
|
||||
to the current project.
|
||||
"""
|
||||
|
||||
if renpy:
|
||||
set_target(config.renpy_base)
|
||||
else:
|
||||
if project.current is None:
|
||||
error(_("No project has been selected."))
|
||||
return
|
||||
|
||||
set_target(project.current.path)
|
||||
|
||||
with open(filename, "r") as f:
|
||||
exec(f.read(), {}, {})
|
||||
@@ -1,12 +0,0 @@
|
||||
|
||||
# This file imports the extensions API into the default store, and makes it
|
||||
# also contains the strings used by the extensions API, so the Ren'Py translation
|
||||
# framework can find them.
|
||||
|
||||
init python:
|
||||
import installer
|
||||
|
||||
init python hide:
|
||||
_("Downloading [extension.download_file].")
|
||||
_("Could not download [extension.download_file] from [extension.download_url]:\n{b}[extension.download_error]")
|
||||
_("The downloaded file [extension.download_file] from [extension.download_url] is not correct.")
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -22,59 +22,50 @@
|
||||
################################################################################
|
||||
# Interface actions.
|
||||
init python in interface:
|
||||
from store import OpenURL, config, Return, _preferences, persistent
|
||||
from store import OpenURL, config, Return
|
||||
import store
|
||||
|
||||
import os.path
|
||||
import contextlib
|
||||
|
||||
RENPY_URL = "http://www.renpy.org"
|
||||
DOC_PATH = os.path.join(config.renpy_base, "doc/")
|
||||
RENPY_GAMES_URL = "http://games.renpy.org"
|
||||
DOC_PATH = os.path.join(config.renpy_base, "doc/index.html")
|
||||
DOC_URL = "http://www.renpy.org/doc/html/"
|
||||
DOC_LOCAL_URL = "file:///" + DOC_PATH
|
||||
|
||||
# If true, the launcher should not link back to renpy.org.
|
||||
NO_LAUNCHER_LINKS = os.path.exists(os.path.join(config.renpy_base, "no_launcher_links.txt"))
|
||||
LICENSE_PATH = os.path.join(config.renpy_base, "doc/license.html")
|
||||
LICENSE_URL = "http://www.renpy.org/doc/html/license.html"
|
||||
|
||||
if os.path.exists(DOC_PATH):
|
||||
DOC_LOCAL_URL = "file:///" + DOC_PATH
|
||||
else:
|
||||
DOC_LOCAL_URL = None
|
||||
|
||||
local_doc_exists = os.path.exists(DOC_PATH)
|
||||
if os.path.exists(LICENSE_PATH):
|
||||
LICENSE_LOCAL_URL = "file:///" + LICENSE_PATH
|
||||
else:
|
||||
LICENSE_LOCAL_URL = None
|
||||
|
||||
def get_doc_url(page):
|
||||
"""
|
||||
Returns the URL to the documentation page.
|
||||
"""
|
||||
|
||||
if local_doc_exists and (NO_LAUNCHER_LINKS or not persistent.use_web_doc):
|
||||
from urllib.parse import urljoin
|
||||
from urllib.request import pathname2url
|
||||
|
||||
return urljoin('file:', pathname2url(DOC_PATH + page))
|
||||
else:
|
||||
return DOC_URL + page
|
||||
|
||||
def OpenDocumentation(page="index.html"):
|
||||
def OpenDocumentation():
|
||||
"""
|
||||
An action that opens the documentation.
|
||||
"""
|
||||
|
||||
return OpenURL(get_doc_url(page))
|
||||
if DOC_LOCAL_URL is not None:
|
||||
return OpenURL(DOC_LOCAL_URL)
|
||||
else:
|
||||
return OpenURL(DOC_URL)
|
||||
|
||||
def OpenLicense():
|
||||
"""
|
||||
An action that opens the license.
|
||||
"""
|
||||
|
||||
return OpenDocumentation("license.html")
|
||||
if LICENSE_LOCAL_URL is not None:
|
||||
return OpenURL(LICENSE_LOCAL_URL)
|
||||
else:
|
||||
return OpenURL(LICENSE_URL)
|
||||
|
||||
def get_sponsor_url():
|
||||
"""
|
||||
Returns the URL to the sponsors page.
|
||||
"""
|
||||
|
||||
return "https://www.renpy.org/sponsors.html?version={}&language={}".format(
|
||||
renpy.version_only,
|
||||
_preferences.language or "english"
|
||||
)
|
||||
|
||||
# Should we display the bottom links?
|
||||
links = True
|
||||
@@ -89,10 +80,6 @@ init python in interface:
|
||||
finally:
|
||||
links = True
|
||||
|
||||
# Version.
|
||||
import re
|
||||
version = re.sub(r'\.\d+(\w*)$', r'\1', renpy.version())
|
||||
|
||||
# This displays the bottom of the screen. If the tooltip is not None, this displays the
|
||||
# tooltip. Otherwise, it displays a list of links (to various websites, and to the
|
||||
# preferences and update screen), or is just blank.
|
||||
@@ -112,48 +99,26 @@ screen bottom_info:
|
||||
ypos 536
|
||||
yanchor 0.0
|
||||
|
||||
has vbox:
|
||||
spacing 20
|
||||
|
||||
hbox:
|
||||
xfill True
|
||||
|
||||
hbox:
|
||||
spacing INDENT
|
||||
textbutton _("Documentation") style "l_link" action interface.OpenDocumentation()
|
||||
|
||||
if not interface.NO_LAUNCHER_LINKS:
|
||||
textbutton _("Ren'Py Website") style "l_link" action OpenURL(interface.RENPY_URL)
|
||||
|
||||
textbutton _("[interface.version]") style "l_link" action Jump("about")
|
||||
textbutton _("Ren'Py Website") style "l_link" action OpenURL(interface.RENPY_URL)
|
||||
textbutton _("Ren'Py Games List") style "l_link" action OpenURL(interface.RENPY_GAMES_URL)
|
||||
textbutton _("About") style "l_link" action Jump("about")
|
||||
|
||||
hbox:
|
||||
spacing INDENT
|
||||
xalign 1.0
|
||||
|
||||
if ability.can_update:
|
||||
textbutton _("update") action Jump("update") style "l_link":
|
||||
if persistent.has_update:
|
||||
text_color "#F96854"
|
||||
text_hover_color Color("#F96854").tint(.8)
|
||||
textbutton _("update") action Jump("update") style "l_link"
|
||||
|
||||
textbutton _("preferences") style "l_link" action Jump("preferences")
|
||||
textbutton _("quit") style "l_link" action Quit(confirm=False)
|
||||
|
||||
if persistent.sponsor_message and not interface.NO_LAUNCHER_LINKS:
|
||||
|
||||
textbutton _("Ren'Py Sponsor Information"):
|
||||
style "l_link"
|
||||
text_color "#F96854"
|
||||
text_hover_color Color("#F96854").tint(.8)
|
||||
|
||||
xalign 0.0
|
||||
yalign 1.0
|
||||
yoffset -10
|
||||
|
||||
action OpenURL(interface.get_sponsor_url())
|
||||
|
||||
|
||||
|
||||
screen common:
|
||||
|
||||
@@ -174,7 +139,7 @@ screen common:
|
||||
has vbox
|
||||
|
||||
text message:
|
||||
textalign 0.5
|
||||
text_align 0.5
|
||||
xalign 0.5
|
||||
layout "subtitle"
|
||||
|
||||
@@ -204,15 +169,7 @@ screen common:
|
||||
add SPACER
|
||||
|
||||
for v, l in choices:
|
||||
textbutton l:
|
||||
action SetScreenVariable("selected", v)
|
||||
selected_background REVERSE_IDLE
|
||||
selected_hover_background REVERSE_HOVER
|
||||
xpadding 20
|
||||
size_group "choice"
|
||||
text_selected_idle_color REVERSE_TEXT
|
||||
text_selected_hover_color REVERSE_TEXT
|
||||
text_xalign 0.5
|
||||
textbutton l action SetScreenVariable("selected", v)
|
||||
|
||||
if selected is not None:
|
||||
$ continue_ = Return(selected)
|
||||
@@ -223,7 +180,7 @@ screen common:
|
||||
add SPACER
|
||||
|
||||
text submessage:
|
||||
textalign 0.5
|
||||
text_align 0.5
|
||||
xalign 0.5
|
||||
layout "subtitle"
|
||||
|
||||
@@ -240,19 +197,16 @@ screen common:
|
||||
label title text_color title_color style "l_info_label"
|
||||
|
||||
if back:
|
||||
textbutton _("Return") action back style "l_left_button"
|
||||
textbutton _("Back") action back style "l_left_button"
|
||||
elif cancel:
|
||||
textbutton _("Cancel") action cancel style "l_left_button"
|
||||
|
||||
if continue_:
|
||||
textbutton _("Continue") action continue_ style "l_right_button"
|
||||
key "input_enter" action continue_
|
||||
|
||||
|
||||
screen launcher_input:
|
||||
|
||||
default value = default
|
||||
|
||||
frame:
|
||||
style "l_root"
|
||||
|
||||
@@ -262,19 +216,13 @@ screen launcher_input:
|
||||
has vbox
|
||||
|
||||
text message:
|
||||
textalign 0.5
|
||||
text_align 0.5
|
||||
xalign 0.5
|
||||
layout "subtitle"
|
||||
|
||||
add SPACER
|
||||
|
||||
input style "l_default":
|
||||
value ScreenVariableInputValue("value", returnable=True)
|
||||
size 24
|
||||
xalign 0.5
|
||||
color INPUT_COLOR
|
||||
allow allow
|
||||
copypaste True
|
||||
input style "l_default" size 24 xalign 0.5 default default color INPUT_COLOR
|
||||
|
||||
if filename:
|
||||
add SPACER
|
||||
@@ -285,14 +233,10 @@ screen launcher_input:
|
||||
if cancel:
|
||||
textbutton _("Cancel") action cancel style "l_left_button"
|
||||
|
||||
textbutton _("Continue") action Return(value) style "l_right_button"
|
||||
|
||||
|
||||
init python in interface:
|
||||
|
||||
import traceback
|
||||
from store import Jump
|
||||
import store._errorhandling as _errorhandling
|
||||
|
||||
def common(title, title_color, message, submessage=None, back=None, continue_=None, pause0=False, show_screen=False, **kwargs):
|
||||
"""
|
||||
@@ -352,7 +296,7 @@ init python in interface:
|
||||
|
||||
def error(message, submessage=None, label="front_page", **kwargs):
|
||||
"""
|
||||
Indicates to the user that an error has occurred.
|
||||
Indicates to the user that an error has occured.
|
||||
|
||||
`message`
|
||||
The message to display.
|
||||
@@ -377,13 +321,6 @@ init python in interface:
|
||||
common(_("ERROR"), store.ERROR_COLOR, message=message, submessage=submessage, back=action, **kwargs)
|
||||
|
||||
|
||||
store._ignore_action = Jump("front_page")
|
||||
|
||||
_errorhandling.rollback = False
|
||||
_errorhandling.ignore = True
|
||||
_errorhandling.reload = False
|
||||
_errorhandling.console = False
|
||||
|
||||
@contextlib.contextmanager
|
||||
def error_handling(what, label="front_page"):
|
||||
"""
|
||||
@@ -399,28 +336,24 @@ init python in interface:
|
||||
|
||||
As an example of usage::
|
||||
|
||||
with interface.error_handling(_("opening the log file")):
|
||||
with interface.error_handling("opening the log file"):
|
||||
f = open("log.txt", "w")
|
||||
"""
|
||||
|
||||
|
||||
try:
|
||||
yield
|
||||
except Exception as e:
|
||||
renpy.renpy.error.report_exception(e, editor=False)
|
||||
except Exception, e:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
error(_("While [what!qt], an error occurred:"),
|
||||
error(_("While [what!q], an error occured:"),
|
||||
_("[exception!q]"),
|
||||
what=what,
|
||||
label=label,
|
||||
exception=traceback.format_exception_only(type(e), e)[-1][:-1])
|
||||
|
||||
import string
|
||||
DIGITS_LETTERS = string.digits
|
||||
PROJECT_LETTERS = string.digits + string.ascii_letters + " _"
|
||||
FILENAME_LETTERS = PROJECT_LETTERS + "\\/"
|
||||
TRANSLATE_LETTERS = string.ascii_letters + string.digits + "_"
|
||||
|
||||
def input(title, message, filename=False, sanitize=True, cancel=None, allow=None, default=""):
|
||||
def input(title, message, filename=False, sanitize=True, cancel=None, default=""):
|
||||
"""
|
||||
Requests typewritten input from the user.
|
||||
"""
|
||||
@@ -429,15 +362,7 @@ init python in interface:
|
||||
|
||||
while True:
|
||||
|
||||
rv = renpy.call_screen(
|
||||
"launcher_input",
|
||||
title=title,
|
||||
message=message,
|
||||
filename=filename or (allow in [PROJECT_LETTERS, FILENAME_LETTERS]),
|
||||
allow=allow,
|
||||
cancel=cancel,
|
||||
default=rv
|
||||
)
|
||||
rv = renpy.call_screen("launcher_input", title=title, message=message, filename=filename, cancel=cancel, default=rv)
|
||||
|
||||
if sanitize:
|
||||
if ("[" in rv) or ("{" in rv):
|
||||
@@ -451,7 +376,7 @@ init python in interface:
|
||||
|
||||
try:
|
||||
rv.encode("ascii")
|
||||
except Exception:
|
||||
except:
|
||||
error(_("File and directory names must consist of ASCII characters."), label=None)
|
||||
continue
|
||||
|
||||
@@ -496,7 +421,7 @@ init python in interface:
|
||||
The amount of time to pause for after showing the message.
|
||||
"""
|
||||
|
||||
common(title, store.INTERACTION_COLOR, message, submessage=submessage, pause=pause, show_screen=True, **kwargs)
|
||||
common(title, store.INTERACTION_COLOR, message, submessage=None, pause=pause, show_screen=True, **kwargs)
|
||||
renpy.pause(pause)
|
||||
|
||||
def processing(message, submessage=None, complete=None, total=None, **kwargs):
|
||||
@@ -551,3 +476,6 @@ init python in interface:
|
||||
"""
|
||||
|
||||
return common(_("CHOICE"), store.QUESTION_COLOR, message, choices=choices, selected=selected, **kwargs)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,457 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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:
|
||||
IOS_NO_RENIOS = 0
|
||||
IOS_NO_DIRECTORY = 1
|
||||
IOS_NO_PROJECT = 2
|
||||
IOS_OK = 3
|
||||
|
||||
IOS_NO_RENIOS_TEXT = _("To build iOS packages, please download renios, unzip it, and place it into the Ren'Py directory. Then restart the Ren'Py launcher.")
|
||||
IOS_NO_DIRECTORY_TEXT = _("The directory in where Xcode projects will be placed has not been selected. Choose 'Select Directory' to select it.")
|
||||
IOS_NO_PROJECT_TEXT = _("There is no Xcode project corresponding to the current Ren'Py project. Choose 'Create Xcode Project' to create one.")
|
||||
IOS_OK_TEXT = _("An Xcode project exists. Choose 'Update Xcode Project' to update it with the latest game files, or use Xcode to build and install it.")
|
||||
|
||||
IPHONE_TEXT = _("Attempts to emulate an iPhone.\n\nTouch input is emulated through the mouse, but only when the button is held down.")
|
||||
IPAD_TEXT = _("Attempts to emulate an iPad.\n\nTouch input is emulated through the mouse, but only when the button is held down.")
|
||||
|
||||
IOS_SELECT_DIRECTORY_TEXT = _("Selects the directory where Xcode projects will be placed.")
|
||||
IOS_CREATE_PROJECT_TEXT = _("Creates an Xcode project corresponding to the current Ren'Py project.")
|
||||
IOS_UPDATE_PROJECT_TEXT = _("Updates the Xcode project with the latest game files. This must be done each time the Ren'Py project changes.")
|
||||
IOS_XCODE_TEXT = _("Opens the Xcode project in Xcode.")
|
||||
|
||||
IOS_OPEN_DIRECTORY_TEXT = _("Opens the directory containing Xcode projects.")
|
||||
|
||||
def find_renios():
|
||||
|
||||
global RENIOS_PATH
|
||||
|
||||
candidates = [ ]
|
||||
|
||||
RENIOS_PATH = os.path.join(config.renpy_base, "renios")
|
||||
|
||||
if os.path.isdir(RENIOS_PATH) and check_hash_txt("renios"):
|
||||
import sys
|
||||
sys.path.insert(0, os.path.join(RENIOS_PATH, "buildlib"))
|
||||
else:
|
||||
RENIOS_PATH = None
|
||||
|
||||
find_renios()
|
||||
|
||||
if RENIOS_PATH:
|
||||
import renios.create
|
||||
import renios.image
|
||||
import renios.interface
|
||||
|
||||
def IOSState():
|
||||
if not RENIOS_PATH:
|
||||
return IOS_NO_RENIOS
|
||||
elif not persistent.xcode_projects_directory:
|
||||
return IOS_NO_DIRECTORY
|
||||
elif not os.path.exists(xcode_project()):
|
||||
return IOS_NO_PROJECT
|
||||
else:
|
||||
return IOS_OK
|
||||
|
||||
def IOSStateText(state):
|
||||
if state == IOS_NO_RENIOS:
|
||||
return IOS_NO_RENIOS_TEXT
|
||||
elif state == IOS_NO_DIRECTORY:
|
||||
return IOS_NO_DIRECTORY_TEXT
|
||||
elif state == IOS_NO_PROJECT:
|
||||
return IOS_NO_PROJECT_TEXT
|
||||
else:
|
||||
return IOS_OK_TEXT
|
||||
|
||||
def IOSIfState(state, needed, action):
|
||||
"""
|
||||
If `state` is `needed` or better, `action` is returned. Otherwise,
|
||||
returns None, disabling the button.
|
||||
"""
|
||||
|
||||
if state >= needed:
|
||||
return action
|
||||
else:
|
||||
return None
|
||||
|
||||
xcode_name_cache = { }
|
||||
|
||||
def xcode_name(s):
|
||||
"""
|
||||
Returns a version of `s` that's safe to use in Xcode.
|
||||
"""
|
||||
|
||||
if s in xcode_name_cache:
|
||||
return xcode_name_cache[s]
|
||||
|
||||
s = re.sub(r'[^\w\-\.]', '', s)
|
||||
xcode_name_cache[s] = s
|
||||
return s
|
||||
|
||||
def xcode_project(p=None, target=None):
|
||||
"""
|
||||
Return the path to the Xcode project corresponding to `p`, or the current
|
||||
project if `p` is None
|
||||
"""
|
||||
|
||||
if target is not None:
|
||||
return target
|
||||
|
||||
if p is None:
|
||||
p = project.current
|
||||
|
||||
if persistent.xcode_projects_directory is None:
|
||||
raise Exception("The Xcode projects directory has not been set.")
|
||||
|
||||
return os.path.join(persistent.xcode_projects_directory, xcode_name(p.name))
|
||||
|
||||
def ios_create(p=None, gui=True, target=None):
|
||||
if p is None:
|
||||
p = project.current
|
||||
p.update_dump(force=True, gui=gui)
|
||||
|
||||
name = p.dump.get("name", None)
|
||||
version = p.dump.get("version", None)
|
||||
|
||||
dest = xcode_project(p, target)
|
||||
|
||||
if gui:
|
||||
iface = MobileInterface("ios")
|
||||
else:
|
||||
iface = renios.interface.Interface()
|
||||
|
||||
if os.path.exists(dest):
|
||||
if not iface.yesno(_("The Xcode project already exists. Would you like to rename the old project, and replace it with a new one?")):
|
||||
return
|
||||
|
||||
i = 0
|
||||
while True:
|
||||
i += 1
|
||||
backup = dest + "." + str(i)
|
||||
if not os.path.exists(backup):
|
||||
break
|
||||
|
||||
os.rename(dest, backup)
|
||||
|
||||
renios.create.create_project(iface, dest, name, version)
|
||||
|
||||
ios_populate(p, gui=gui, target=target)
|
||||
|
||||
|
||||
def eliminate_pycache(directory):
|
||||
"""
|
||||
Eliminates the __pycache__ directory, and moves the files in it up a level,
|
||||
renaming them to remove the cache tag.
|
||||
"""
|
||||
|
||||
print("Eliminating __pycache__...")
|
||||
|
||||
import pathlib
|
||||
import sys
|
||||
|
||||
paths = list(pathlib.Path(directory).glob("**/__pycache__/*.pyc"))
|
||||
|
||||
for p in paths:
|
||||
name = p.stem.partition(".")[0]
|
||||
p.rename(p.parent.parent / (name + ".pyc"))
|
||||
|
||||
paths = list(pathlib.Path(directory).glob("**/__pycache__"))
|
||||
|
||||
for p in paths:
|
||||
p.rmdir()
|
||||
|
||||
|
||||
def ios_populate(p=None, gui=True, target=None):
|
||||
"""
|
||||
This actually builds the package.
|
||||
"""
|
||||
|
||||
import shutil
|
||||
|
||||
if p is None:
|
||||
p = project.current
|
||||
|
||||
dist = os.path.join(xcode_project(p, target), "base")
|
||||
|
||||
if os.path.exists(dist):
|
||||
shutil.rmtree(dist)
|
||||
|
||||
if gui:
|
||||
reporter = distribute.GuiReporter()
|
||||
else:
|
||||
reporter = distribute.TextReporter()
|
||||
|
||||
distribute.Distributor(p,
|
||||
reporter=reporter,
|
||||
packages=[ 'ios' ],
|
||||
build_update=False,
|
||||
noarchive=True,
|
||||
packagedest=dist,
|
||||
report_success=False,
|
||||
)
|
||||
|
||||
eliminate_pycache(dist)
|
||||
|
||||
main_fn = os.path.join(dist, "main.py")
|
||||
|
||||
for fn in os.listdir(dist):
|
||||
if fn.endswith(".py"):
|
||||
py_fn = os.path.join(dist, fn)
|
||||
break
|
||||
else:
|
||||
raise Exception("Could not find a .py file.")
|
||||
|
||||
with open(py_fn, "r") as py_f:
|
||||
with open(main_fn, "w") as main_f:
|
||||
for l in py_f:
|
||||
if l.startswith("#!"):
|
||||
continue
|
||||
|
||||
main_f.write(l)
|
||||
|
||||
os.unlink(py_fn)
|
||||
|
||||
ios_image(p, "ios-icon.png", "Media.xcassets/AppIcon.appiconset", True, target)
|
||||
# ios_image(p, "ios-launchimage.png", "Media.xcassets/LaunchImage.launchimage", False, target)
|
||||
|
||||
def ios_image(p, source, destination, scale, target):
|
||||
source = os.path.join(p.path, source)
|
||||
destination = os.path.join(xcode_project(p, target), destination)
|
||||
|
||||
renios.image.generate(source, destination, scale)
|
||||
|
||||
|
||||
def launch_xcode():
|
||||
dist = xcode_project(None)
|
||||
|
||||
if not os.path.exists(dist):
|
||||
return
|
||||
|
||||
for fn in os.listdir(dist):
|
||||
if fn.endswith(".xcodeproj"):
|
||||
xcodeproj = os.path.join(dist, fn)
|
||||
subprocess.call([ 'open', renpy.fsencode(xcodeproj) ])
|
||||
|
||||
break
|
||||
|
||||
|
||||
screen ios:
|
||||
|
||||
default tt = Tooltip(None)
|
||||
$ state = IOSState()
|
||||
|
||||
frame:
|
||||
style_group "l"
|
||||
style "l_root"
|
||||
|
||||
window:
|
||||
|
||||
has vbox
|
||||
|
||||
label _("iOS: [project.current.display_name!q]")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
hbox:
|
||||
|
||||
# Left side.
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum ONEHALF
|
||||
xfill True
|
||||
|
||||
has vbox
|
||||
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Emulation:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
frame style "l_indent":
|
||||
|
||||
has hbox:
|
||||
spacing 15
|
||||
|
||||
textbutton _("iPhone"):
|
||||
action LaunchEmulator("ios-touch", "small phone touch ios mobile")
|
||||
hovered tt.Action(IPHONE_TEXT)
|
||||
|
||||
textbutton _("iPad"):
|
||||
action LaunchEmulator("ios-touch", "medium tablet touch ios mobile")
|
||||
hovered tt.Action(IPAD_TEXT)
|
||||
|
||||
|
||||
add SPACER
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Build:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
frame style "l_indent":
|
||||
|
||||
has vbox
|
||||
|
||||
textbutton _("Select Xcode Projects Directory"):
|
||||
action IOSIfState(state, IOS_NO_DIRECTORY, Jump("select_xcode_projects_directory"))
|
||||
hovered tt.Action(IOS_SELECT_DIRECTORY_TEXT)
|
||||
|
||||
textbutton _("Create Xcode Project"):
|
||||
action IOSIfState(state, IOS_NO_PROJECT, Jump("create_xcode_project"))
|
||||
hovered tt.Action(IOS_CREATE_PROJECT_TEXT)
|
||||
|
||||
textbutton _("Update Xcode Project"):
|
||||
action IOSIfState(state, IOS_NO_PROJECT, Jump("update_xcode_project"))
|
||||
hovered tt.Action(IOS_UPDATE_PROJECT_TEXT)
|
||||
|
||||
if renpy.macintosh:
|
||||
textbutton _("Launch Xcode"):
|
||||
action IOSIfState(state, IOS_OK, launch_xcode)
|
||||
hovered tt.Action(IOS_XCODE_TEXT)
|
||||
|
||||
add SPACER
|
||||
|
||||
textbutton _("Force Recompile") action DataToggle("force_recompile") style "l_checkbox"
|
||||
|
||||
add SPACER
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Other:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
frame style "l_indent":
|
||||
|
||||
has vbox
|
||||
|
||||
textbutton _("Open Xcode Projects Directory"):
|
||||
action IOSIfState(state, IOS_NO_PROJECT, OpenDirectory(persistent.xcode_projects_directory, absolute=True))
|
||||
hovered tt.Action(IOS_OPEN_DIRECTORY_TEXT)
|
||||
|
||||
|
||||
# Right side.
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum ONEHALF
|
||||
xfill True
|
||||
|
||||
has vbox
|
||||
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
add SPACER
|
||||
|
||||
text _("There are known issues with the iOS simulator on Apple Silicon. Please test on x86_64 or iOS devices.")
|
||||
|
||||
add SPACER
|
||||
|
||||
if tt.value:
|
||||
text tt.value
|
||||
else:
|
||||
text IOSStateText(state)
|
||||
|
||||
|
||||
textbutton _("Return") action Jump("front_page") style "l_left_button"
|
||||
|
||||
|
||||
label ios:
|
||||
|
||||
if RENIOS_PATH is None:
|
||||
$ interface.yesno(_("Before packaging iOS apps, you'll need to download renios, Ren'Py's iOS support. Would you like to download renios now?"), no=Jump("front_page"))
|
||||
$ add_dlc("renios", restart=True)
|
||||
|
||||
call screen ios
|
||||
|
||||
label select_xcode_projects_directory:
|
||||
|
||||
python hide:
|
||||
|
||||
interface.interaction(_("XCODE PROJECTS DIRECTORY"), _("Please choose the Xcode Projects Directory using the directory chooser.\n{b}The directory chooser may have opened behind this window.{/b}"))
|
||||
|
||||
path, is_default = choose_directory(persistent.xcode_projects_directory)
|
||||
|
||||
if is_default:
|
||||
interface.info(_("Ren'Py has set the Xcode Projects Directory to:"), "[path!q]", path=path)
|
||||
|
||||
persistent.xcode_projects_directory = path
|
||||
|
||||
jump ios
|
||||
|
||||
label create_xcode_project:
|
||||
|
||||
$ ios_create(None, True)
|
||||
|
||||
jump ios
|
||||
|
||||
label update_xcode_project:
|
||||
$ ios_populate(None, True)
|
||||
|
||||
jump ios
|
||||
|
||||
init python:
|
||||
|
||||
def ios_create_command():
|
||||
ap = renpy.arguments.ArgumentParser()
|
||||
ap.add_argument("project", help="The path to the Ren'Py project.")
|
||||
ap.add_argument("destination", help="The path the iOS project that will be created.")
|
||||
|
||||
args = ap.parse_args()
|
||||
|
||||
p = project.Project(args.project)
|
||||
|
||||
ios_create(p, False, args.destination)
|
||||
|
||||
return False
|
||||
|
||||
renpy.arguments.register_command("ios_create", ios_create_command)
|
||||
|
||||
|
||||
def ios_populate_command():
|
||||
ap = renpy.arguments.ArgumentParser()
|
||||
ap.add_argument("project", help="The path to the Ren'Py project.")
|
||||
ap.add_argument("destination", help="The path the iOS project that will be created.")
|
||||
|
||||
args = ap.parse_args()
|
||||
|
||||
p = project.Project(args.project)
|
||||
|
||||
ios_populate(p, False, args.destination)
|
||||
|
||||
return False
|
||||
|
||||
renpy.arguments.register_command("ios_populate", ios_populate_command)
|
||||
@@ -1,150 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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:
|
||||
|
||||
def find_itch_butler():
|
||||
|
||||
import requests
|
||||
|
||||
if renpy.windows:
|
||||
platform = "windows-amd64"
|
||||
exe = "butler.exe"
|
||||
elif renpy.macintosh:
|
||||
platform = "darwin-amd64"
|
||||
exe = "butler"
|
||||
else:
|
||||
platform = "linux-amd64"
|
||||
exe = "butler"
|
||||
|
||||
dn = os.path.join(config.renpy_base, "tmp", "butler-" + platform)
|
||||
zip = os.path.join(dn, "butler.zip")
|
||||
exe = os.path.join(dn, exe)
|
||||
|
||||
if os.path.exists(exe):
|
||||
return exe
|
||||
|
||||
interface.processing(_("Downloading the itch.io butler."))
|
||||
|
||||
try:
|
||||
os.makedirs(dn)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
with interface.error_handling(_("Downloading the itch.io butler.")):
|
||||
url = "https://broth.itch.zone/butler/{}/LATEST/archive/default".format(platform)
|
||||
|
||||
response = requests.get(url, headers={'User-Agent' : "Renpy"}, proxies=renpy.proxies)
|
||||
|
||||
with open(zip, "wb") as f:
|
||||
f.write(response.content)
|
||||
|
||||
import zipfile
|
||||
|
||||
with zipfile.ZipFile(zip) as zf:
|
||||
zf.extractall(dn)
|
||||
|
||||
try:
|
||||
os.chmod(exe, 0o755)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return exe
|
||||
|
||||
|
||||
label itch:
|
||||
|
||||
call build_update_dump
|
||||
|
||||
|
||||
python hide:
|
||||
|
||||
butler = find_itch_butler()
|
||||
|
||||
build = project.current.dump["build"]
|
||||
|
||||
destination = build["destination"]
|
||||
parent = os.path.dirname(project.current.path)
|
||||
destination = os.path.join(parent, destination)
|
||||
|
||||
version = build["version"]
|
||||
|
||||
if not os.path.exists(destination):
|
||||
interface.error(
|
||||
_("The built distributions could not be found. Please choose 'Build' and try again."),
|
||||
label="build_distributions"
|
||||
)
|
||||
|
||||
# A list of full filename, channel tuples.
|
||||
files = [ ]
|
||||
|
||||
for fn in os.listdir(destination):
|
||||
|
||||
for pattern, channel in reversed(build['itch_channels'].items()):
|
||||
if fnmatch.fnmatch(fn, pattern):
|
||||
break
|
||||
else:
|
||||
continue
|
||||
|
||||
fn = os.path.join(destination, fn)
|
||||
files.append((fn, channel))
|
||||
|
||||
if not os.path.exists(destination):
|
||||
interface.error(
|
||||
_("No uploadable files were found. Please choose 'Build' and try again."),
|
||||
label="build_distributions"
|
||||
)
|
||||
|
||||
if not butler:
|
||||
interface.error(
|
||||
_("The butler program was not found."),
|
||||
_("Please install the itch.io app, which includes butler, and try again."),
|
||||
label="build_distributions"
|
||||
)
|
||||
|
||||
itch_project = project.current.dump["build"].get("itch_project", None)
|
||||
|
||||
if itch_project is None or ("/" not in itch_project):
|
||||
interface.error(
|
||||
_("The name of the itch project has not been set."),
|
||||
_("Please {a=https://itch.io/game/new}create your project{/a}, then add a line like \n{vspace=5}define build.itch_project = \"user-name/game-name\"\n{vspace=5} to options.rpy."),
|
||||
label="build_distributions"
|
||||
)
|
||||
|
||||
cc = ConsoleCommand()
|
||||
|
||||
for filename, channel in files:
|
||||
|
||||
cc.add(
|
||||
butler,
|
||||
"push",
|
||||
filename,
|
||||
itch_project + ":" + channel,
|
||||
"--userversion",
|
||||
build["version"],
|
||||
)
|
||||
|
||||
cc.run()
|
||||
|
||||
|
||||
|
||||
|
||||
jump build_distributions
|
||||
@@ -1,271 +0,0 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# 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.
|
||||
|
||||
# This file contains mobile build things that are shared by the android
|
||||
# and iOS builds.
|
||||
|
||||
init -1 python:
|
||||
|
||||
def check_hash_txt(module):
|
||||
fn1 = module + "_hash.txt"
|
||||
fn2 = renpy.fsencode(os.path.join(config.renpy_base, module, "hash.txt"))
|
||||
|
||||
# No hash file? We're in dev mode - ignore.
|
||||
if not renpy.loadable(fn1):
|
||||
return True
|
||||
|
||||
hash1 = renpy.open_file(fn1, encoding="utf-8").read()
|
||||
|
||||
if not os.path.exists(fn2):
|
||||
return False
|
||||
|
||||
hash2 = open(fn2).read()
|
||||
|
||||
return hash1.strip() == hash2.strip()
|
||||
|
||||
class LaunchEmulator(Action):
|
||||
|
||||
def __init__(self, emulator, variants):
|
||||
self.emulator = emulator
|
||||
self.variants = variants
|
||||
|
||||
def __call__(self):
|
||||
|
||||
env = {
|
||||
"RENPY_EMULATOR" : self.emulator,
|
||||
"RENPY_VARIANT" : self.variants,
|
||||
}
|
||||
|
||||
p = project.current
|
||||
p.launch(env=env)
|
||||
|
||||
class MobileInterface(object):
|
||||
"""
|
||||
This is used to interface between the launcher and RAPT/RENIOS.
|
||||
"""
|
||||
|
||||
def __init__(self, platform, edit=True, filename=None):
|
||||
"""
|
||||
`platform`
|
||||
The name of the platform we're using for. Used for libraries,
|
||||
cancel labels, and logfiles.
|
||||
|
||||
`edit`
|
||||
If true, we launch the log file in the editor on failure.
|
||||
"""
|
||||
|
||||
self.platform = platform
|
||||
self.edit = edit
|
||||
|
||||
self.process = None
|
||||
|
||||
if filename is None:
|
||||
filename = platform + ".txt"
|
||||
|
||||
self.filename = project.current.temp_filename(filename)
|
||||
|
||||
self.info_msg = ""
|
||||
|
||||
with open(self.filename, "w") as f:
|
||||
f.write(renpy.version() + "\n")
|
||||
pass
|
||||
|
||||
def log(self, msg):
|
||||
with open(self.filename, "a") as f:
|
||||
f.write("\n")
|
||||
f.write(msg)
|
||||
f.write("\n")
|
||||
|
||||
def info(self, prompt):
|
||||
self.info_msg = prompt
|
||||
interface.processing(prompt, pause=False)
|
||||
self.log(prompt)
|
||||
|
||||
def open_directory(self, directory, prompt):
|
||||
renpy.run(store.OpenDirectory(directory, absolute=True))
|
||||
interface.info(prompt)
|
||||
|
||||
def yesno(self, prompt, submessage=None):
|
||||
return interface.yesno(prompt, submessage=submessage)
|
||||
|
||||
def yesno_choice(self, prompt, default=None):
|
||||
choices = [ (True, "Yes"), (False, "No") ]
|
||||
return interface.choice(prompt, choices, default)
|
||||
|
||||
def terms(self, url, prompt):
|
||||
submessage = _("{a=%s}%s{/a}") % (url, url)
|
||||
|
||||
if not interface.yesno(prompt, submessage=submessage):
|
||||
self.fail("You must accept the terms and conditions to proceed.", edit=False)
|
||||
|
||||
|
||||
def input(self, prompt, empty=None):
|
||||
|
||||
if empty is None:
|
||||
empty = ''
|
||||
|
||||
while True:
|
||||
rv = interface.input(_("QUESTION"), prompt, default=empty, cancel=Jump("android"))
|
||||
|
||||
rv = rv.strip()
|
||||
|
||||
if rv:
|
||||
return rv
|
||||
|
||||
def choice(self, prompt, choices, default):
|
||||
return interface.choice(prompt, choices, default, cancel=Jump("android"))
|
||||
|
||||
def fail(self, prompt, edit=True):
|
||||
self.log(prompt)
|
||||
prompt = re.sub(r'(http://\S+)', r'{a=\1}\1{/a}', prompt)
|
||||
|
||||
# Open android.txt in the editor.
|
||||
if edit and self.edit:
|
||||
self.open_editor()
|
||||
|
||||
interface.error(prompt, label="android")
|
||||
|
||||
def open_editor(self):
|
||||
editor.EditAbsolute(self.filename)()
|
||||
|
||||
def success(self, prompt):
|
||||
self.log(prompt)
|
||||
interface.info(prompt, pause=False)
|
||||
|
||||
def final_success(self, prompt):
|
||||
self.log(prompt)
|
||||
interface.info(prompt, label="android")
|
||||
|
||||
def run_yes_thread(self):
|
||||
import time
|
||||
|
||||
try:
|
||||
while self.run_yes:
|
||||
self.process.stdin.write(b'y\n')
|
||||
self.process.stdin.flush()
|
||||
time.sleep(.2)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def call(self, cmd, cancel=False, use_path=False, yes=False):
|
||||
|
||||
renpy.not_infinite_loop(30)
|
||||
|
||||
cmd = [ renpy.fsencode(i) for i in cmd ]
|
||||
|
||||
self.cmd = cmd
|
||||
|
||||
f = open(self.filename, "a")
|
||||
|
||||
f.write("\n\n\n")
|
||||
|
||||
if cancel:
|
||||
cancel_action = self.cancel
|
||||
else:
|
||||
cancel_action = None
|
||||
|
||||
startupinfo = None
|
||||
if renpy.windows:
|
||||
startupinfo = subprocess.STARTUPINFO()
|
||||
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
||||
|
||||
self.yes_thread = None
|
||||
|
||||
try:
|
||||
interface.processing(self.info_msg, show_screen=True, cancel=cancel_action)
|
||||
|
||||
kwargs = { }
|
||||
|
||||
try:
|
||||
self.process = subprocess.Popen(cmd, cwd=renpy.fsencode(RAPT_PATH), stdout=f, stderr=f, stdin=subprocess.PIPE, startupinfo=startupinfo, **kwargs)
|
||||
# avoid SIGTTIN caused by e.g. gradle doing empty read on terminal stdin
|
||||
if not yes:
|
||||
self.process.stdin.close()
|
||||
except Exception:
|
||||
import traceback
|
||||
traceback.print_exc(file=f)
|
||||
raise
|
||||
|
||||
if yes:
|
||||
import threading
|
||||
self.run_yes = True
|
||||
self.yes_thread = threading.Thread(target=self.run_yes_thread)
|
||||
self.yes_thread.daemon = True
|
||||
self.yes_thread.start()
|
||||
|
||||
renpy.call_screen("android_process", interface=self)
|
||||
finally:
|
||||
f.close()
|
||||
interface.hide_screen()
|
||||
|
||||
if yes and self.yes_thread:
|
||||
self.run_yes = False
|
||||
self.yes_thread.join()
|
||||
|
||||
try:
|
||||
self.process.stdin.close()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
self.process = None
|
||||
self.yes_thread = None
|
||||
|
||||
def check_process(self):
|
||||
rv = self.process.poll()
|
||||
|
||||
if rv is not None:
|
||||
renpy.not_infinite_loop(30)
|
||||
|
||||
if rv:
|
||||
raise subprocess.CalledProcessError(rv, self.cmd)
|
||||
else:
|
||||
return True
|
||||
|
||||
def download(self, url, dest):
|
||||
try:
|
||||
d = Downloader(url, dest)
|
||||
cancel_action = [ d.cancel, Jump(self.platform) ]
|
||||
interface.processing(self.info_msg, show_screen=True, cancel=cancel_action, bar_value=DownloaderValue(d))
|
||||
ui.timer(.1, action=d.check, repeat=True)
|
||||
ui.interact()
|
||||
finally:
|
||||
interface.hide_screen()
|
||||
|
||||
def background(self, f):
|
||||
try:
|
||||
t = threading.Thread(target=f)
|
||||
t.start()
|
||||
|
||||
interface.processing(self.info_msg, show_screen=True)
|
||||
|
||||
while t.is_alive():
|
||||
renpy.pause(0)
|
||||
t.join(0.25)
|
||||
|
||||
finally:
|
||||
interface.hide_screen()
|
||||
|
||||
|
||||
def cancel(self):
|
||||
if self.process:
|
||||
self.process.terminate()
|
||||
|
||||
renpy.jump(self.platform)
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -19,9 +19,6 @@
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
# Should translation files be shown in the launcher file navigation?
|
||||
default persistent.show_translation_files = True
|
||||
|
||||
init python in navigation:
|
||||
import store.interface as interface
|
||||
import store.project as project
|
||||
@@ -113,9 +110,6 @@ init python in navigation:
|
||||
if shortfn.startswith("game/"):
|
||||
shortfn = fn[5:]
|
||||
|
||||
if shortfn.startswith("tl/") and not persistent.show_translation_files:
|
||||
continue
|
||||
|
||||
rv.append((shortfn, fn, None))
|
||||
|
||||
rv.sort()
|
||||
@@ -161,8 +155,6 @@ init python in navigation:
|
||||
|
||||
screen navigation:
|
||||
|
||||
$ todo_count = len(project.current.dump.get("location", {}).get("todo", []))
|
||||
|
||||
frame:
|
||||
style_group "l"
|
||||
style "l_root"
|
||||
@@ -173,8 +165,7 @@ screen navigation:
|
||||
|
||||
frame style "l_label":
|
||||
has hbox xfill True
|
||||
text _("Navigate: [project.current.display_name!q]") style "l_label_text"
|
||||
alt _("Navigate Script")
|
||||
text _("Navigate: [project.current.name]") style "l_label_text"
|
||||
|
||||
frame:
|
||||
style "l_alternate"
|
||||
@@ -201,7 +192,6 @@ screen navigation:
|
||||
hbox:
|
||||
spacing HALF_INDENT
|
||||
text _("Category:")
|
||||
alt ""
|
||||
|
||||
textbutton _("files") action navigation.ChangeKind("file")
|
||||
textbutton _("labels") action navigation.ChangeKind("label")
|
||||
@@ -209,7 +199,7 @@ screen navigation:
|
||||
textbutton _("transforms") action navigation.ChangeKind("transform")
|
||||
textbutton _("screens") action navigation.ChangeKind("screen")
|
||||
textbutton _("callables") action navigation.ChangeKind("callable")
|
||||
textbutton (__("TODOs") + " (" + str(todo_count) + ")") action navigation.ChangeKind("todo")
|
||||
textbutton _("TODOs") action navigation.ChangeKind("todo")
|
||||
|
||||
add SPACER
|
||||
add SEPARATOR
|
||||
@@ -226,10 +216,6 @@ screen navigation:
|
||||
vbox:
|
||||
style_group "l_navigation"
|
||||
|
||||
if persistent.navigation == "file":
|
||||
textbutton _("Show translation files") style "l_checkbox" action [ ToggleField(persistent, "show_translation_files"), Jump("navigation_loop") ]
|
||||
add SPACER
|
||||
|
||||
for group_name, group in groups:
|
||||
|
||||
if group_name is not None:
|
||||
@@ -261,7 +247,7 @@ screen navigation:
|
||||
if persistent.navigation == "todo":
|
||||
|
||||
text _("No TODO comments found.\n\nTo create one, include \"# TODO\" in your script."):
|
||||
textalign 0.5
|
||||
text_align 0.5
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
|
||||
@@ -271,7 +257,7 @@ screen navigation:
|
||||
xalign 0.5
|
||||
yalign 0.5
|
||||
|
||||
textbutton _("Return") action Jump("front_page") style "l_left_button"
|
||||
textbutton _("Back") action Jump("front_page") style "l_left_button"
|
||||
textbutton _("Launch Project") action project.Launch() style "l_right_button"
|
||||
|
||||
label navigation:
|
||||
@@ -291,3 +277,4 @@ label navigation_loop:
|
||||
label navigation_refresh:
|
||||
$ project.current.update_dump(True)
|
||||
jump navigation_loop
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -25,6 +25,42 @@ init python:
|
||||
import time
|
||||
import re
|
||||
|
||||
screen select_template:
|
||||
|
||||
default result = project.manager.get("english")
|
||||
|
||||
frame:
|
||||
style_group "l"
|
||||
style "l_root"
|
||||
|
||||
window:
|
||||
|
||||
has vbox
|
||||
|
||||
label _("Choose Project Template")
|
||||
|
||||
hbox:
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum ONETHIRD
|
||||
|
||||
viewport:
|
||||
scrollbars "vertical"
|
||||
vbox:
|
||||
for p in project.manager.templates:
|
||||
textbutton "[p.name!q]" action SetScreenVariable("result", p) style "l_list"
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum TWOTHIRDS
|
||||
|
||||
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'.")
|
||||
|
||||
|
||||
textbutton _("Back") action Jump("front_page") style "l_left_button"
|
||||
textbutton _("Continue") action Return(result) style "l_right_button"
|
||||
|
||||
|
||||
label new_project:
|
||||
|
||||
@@ -34,48 +70,59 @@ label new_project:
|
||||
if persistent.projects_directory is None:
|
||||
$ interface.error(_("The projects directory could not be set. Giving up."))
|
||||
|
||||
python:
|
||||
new_project_language = __("{#language name and font}")
|
||||
gui_kind = "new_gui_project"
|
||||
python hide:
|
||||
|
||||
# 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"))
|
||||
project_name = interface.input(
|
||||
_("PROJECT NAME"),
|
||||
_("Please enter the name of your project:"),
|
||||
filename=True,
|
||||
cancel=Jump("front_page"))
|
||||
|
||||
python:
|
||||
if project.manager.templates:
|
||||
gui_kind, gui_template_path = interface.choice(
|
||||
_("Please select a template project to use."),
|
||||
[ ( ("new_gui_project", None), _("Do not use a template project.") ) ] +
|
||||
[ ( ("new_template_project", p.path ), p.name) for p in project.manager.templates ],
|
||||
("new_gui_project", None),
|
||||
cancel=Jump("front_page"),
|
||||
)
|
||||
project_name = project_name.strip()
|
||||
if not project_name:
|
||||
interface.error(_("The project name may not be empty."))
|
||||
|
||||
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_dir = os.path.join(persistent.projects_directory, project_name)
|
||||
|
||||
project_name = project_name.strip()
|
||||
if not project_name:
|
||||
interface.error(_("The project name may not be empty."), label=None)
|
||||
continue
|
||||
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)
|
||||
|
||||
project_dir = os.path.join(persistent.projects_directory, project_name)
|
||||
if os.path.exists(project_dir):
|
||||
interface.error(_("[project_dir!q] already exists. Please choose a different project name."), project_dir=project_dir)
|
||||
|
||||
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)
|
||||
continue
|
||||
if len(project.manager.templates) == 1:
|
||||
template = project.manager.templates[0]
|
||||
else:
|
||||
template = renpy.call_screen("select_template")
|
||||
|
||||
if os.path.exists(project_dir):
|
||||
interface.error(_("[project_dir!q] already exists. Please choose a different project name."), project_dir=project_dir, label=None)
|
||||
continue
|
||||
break
|
||||
template_path = template.path
|
||||
|
||||
jump expression gui_kind
|
||||
with interface.error_handling("creating a new project"):
|
||||
shutil.copytree(template_path, project_dir)
|
||||
|
||||
# Delete the tmp directory, if it exists.
|
||||
if os.path.isdir(os.path.join(project_dir, "tmp")):
|
||||
shutil.rmtree(os.path.join(project_dir, "tmp"))
|
||||
|
||||
# Delete project.json, which must exist.
|
||||
os.unlink(os.path.join(project_dir, "project.json"))
|
||||
|
||||
# Change the save directory in options.rpy
|
||||
fn = os.path.join(project_dir, "game/options.rpy")
|
||||
with open(fn, "rb") as f:
|
||||
options = f.read().decode("utf-8")
|
||||
|
||||
options = options.replace("PROJECT_NAME", project_name)
|
||||
options = options.replace("UNIQUE", str(int(time.time())))
|
||||
|
||||
with open(fn, "wb") as f:
|
||||
f.write(options.encode("utf-8"))
|
||||
|
||||
# Activate the project.
|
||||
with interface.error_handling("activating the new project"):
|
||||
project.manager.scan()
|
||||
project.Select(project.manager.get(project_name))()
|
||||
|
||||
call choose_theme_callable
|
||||
|
||||
jump front_page
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -19,33 +19,30 @@
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
# This file contains some of the options that can be changed to customize
|
||||
# your Ren'Py game. It only contains the most common options... there
|
||||
# is quite a bit more customization you can do.
|
||||
#
|
||||
# Lines beginning with two '#' marks are comments, and you shouldn't
|
||||
# uncomment them. Lines beginning with a single '#' mark are
|
||||
# commented-out code, and you may want to uncomment them when
|
||||
# appropriate.
|
||||
## This file contains some of the options that can be changed to customize
|
||||
## your Ren'Py game. It only contains the most common options... there
|
||||
## is quite a bit more customization you can do.
|
||||
##
|
||||
## Lines beginning with two '#' marks are comments, and you shouldn't
|
||||
## uncomment them. Lines beginning with a single '#' mark are
|
||||
## commented-out code, and you may want to uncomment them when
|
||||
## appropriate.
|
||||
|
||||
init -1 python hide:
|
||||
|
||||
# Update the searchpath to find additional fonts.
|
||||
config.searchpath.append(config.renpy_base + "/sdk-fonts")
|
||||
|
||||
# Should we enable the use of developer tools? This should be
|
||||
# set to False before the game is released, so the user can't
|
||||
# cheat using developer tools.
|
||||
## Should we enable the use of developer tools? This should be
|
||||
## set to False before the game is released, so the user can't
|
||||
## cheat using developer tools.
|
||||
|
||||
config.developer = True
|
||||
|
||||
# These control the width and height of the screen.
|
||||
## These control the width and height of the screen.
|
||||
|
||||
config.screen_width = 800
|
||||
config.screen_height = 600
|
||||
|
||||
# This controls the title of the window, when Ren'Py is
|
||||
# running in a window.
|
||||
## This controls the title of the window, when Ren'Py is
|
||||
## running in a window.
|
||||
|
||||
config.window_title = u"Ren'Py Launcher"
|
||||
|
||||
@@ -54,217 +51,187 @@ init -1 python hide:
|
||||
config.name = "Ren'Py Launcher"
|
||||
config.version = renpy.version().split()[1]
|
||||
|
||||
#####################
|
||||
#########################################
|
||||
# Themes
|
||||
|
||||
# We then want to call a theme function. themes.roundrect is
|
||||
# a theme that features the use of rounded rectangles. It's
|
||||
# the only theme we currently support.
|
||||
#
|
||||
# The theme function takes a number of parameters that can
|
||||
# customize the color scheme.
|
||||
## We then want to call a theme function. themes.roundrect is
|
||||
## a theme that features the use of rounded rectangles. It's
|
||||
## the only theme we currently support.
|
||||
##
|
||||
## The theme function takes a number of parameters that can
|
||||
## customize the color scheme.
|
||||
|
||||
theme.roundrect(
|
||||
# Theme: Roundrect
|
||||
# Color scheme: Basic Blue
|
||||
## Theme: Roundrect
|
||||
## Color scheme: Basic Blue
|
||||
|
||||
# The color of an idle widget face.
|
||||
## The color of an idle widget face.
|
||||
widget = "#003c78",
|
||||
|
||||
# The color of a focused widget face.
|
||||
## The color of a focused widget face.
|
||||
widget_hover = "#0050a0",
|
||||
|
||||
# The color of the text in a widget.
|
||||
## The color of the text in a widget.
|
||||
widget_text = "#c8ffff",
|
||||
|
||||
# The color of the text in a selected widget. (For
|
||||
# example, the current value of a preference.)
|
||||
## The color of the text in a selected widget. (For
|
||||
## example, the current value of a preference.)
|
||||
widget_selected = "#ffffc8",
|
||||
|
||||
# The color of a disabled widget face.
|
||||
## The color of a disabled widget face.
|
||||
disabled = "#404040",
|
||||
|
||||
# The color of disabled widget text.
|
||||
## The color of disabled widget text.
|
||||
disabled_text = "#c8c8c8",
|
||||
|
||||
# The color of informational labels.
|
||||
## The color of informational labels.
|
||||
label = "#ffffff",
|
||||
|
||||
# The color of a frame containing widgets.
|
||||
## The color of a frame containing widgets.
|
||||
frame = "#6496c8",
|
||||
|
||||
# The background of the main menu. This can be a color
|
||||
# beginning with '#', or an image filename. The latter
|
||||
# should take up the full height and width of the screen.
|
||||
## The background of the main menu. This can be a color
|
||||
## beginning with '#', or an image filename. The latter
|
||||
## should take up the full height and width of the screen.
|
||||
mm_root = "#dcebff",
|
||||
|
||||
# The background of the game menu. This can be a color
|
||||
# beginning with '#', or an image filename. The latter
|
||||
# should take up the full height and width of the screen.
|
||||
## The background of the game menu. This can be a color
|
||||
## beginning with '#', or an image filename. The latter
|
||||
## should take up the full height and width of the screen.
|
||||
gm_root = "#dcebff",
|
||||
|
||||
# If this is True, the in-game window is rounded. If False,
|
||||
# the in-game window is square.
|
||||
## If this is True, the in-game window is rounded. If False,
|
||||
## the in-game window is square.
|
||||
rounded_window = False,
|
||||
|
||||
# And we're done with the theme. The theme will customize
|
||||
# various styles, so if we want to change them, we should
|
||||
# do so below.
|
||||
## And we're done with the theme. The theme will customize
|
||||
## various styles, so if we want to change them, we should
|
||||
## do so below.
|
||||
)
|
||||
|
||||
#####################
|
||||
# Help.
|
||||
#########################################
|
||||
## Help.
|
||||
|
||||
# This lets you configure the help option on the Ren'Py menus.
|
||||
# It may be:
|
||||
# - A label in the script, in which case that label is called to
|
||||
# show help to the user.
|
||||
# - A file name relative to the base directory, which is opened in a
|
||||
# web browser.
|
||||
# - None, to disable help.
|
||||
## This lets you configure the help option on the Ren'Py menus.
|
||||
## It may be:
|
||||
## - A label in the script, in which case that label is called to
|
||||
## show help to the user.
|
||||
## - A file name relative to the base directory, which is opened in a
|
||||
## web browser.
|
||||
## - None, to disable help.
|
||||
config.help = "README.html"
|
||||
|
||||
#####################
|
||||
# Transitions.
|
||||
#########################################
|
||||
## Transitions.
|
||||
|
||||
# Used when entering the game menu from the game.
|
||||
## Used when entering the game menu from the game.
|
||||
config.enter_transition = None
|
||||
|
||||
# Used when exiting the game menu to the game.
|
||||
## Used when exiting the game menu to the game.
|
||||
config.exit_transition = None
|
||||
|
||||
# Used between screens of the game menu.
|
||||
## Used between screens of the game menu.
|
||||
config.intra_transition = None
|
||||
|
||||
# Used when entering the game menu from the main menu.
|
||||
## Used when entering the game menu from the main menu.
|
||||
config.main_game_transition = None
|
||||
|
||||
# Used when returning to the main menu from the game.
|
||||
## Used when returning to the main menu from the game.
|
||||
config.game_main_transition = None
|
||||
|
||||
# Used when entering the main menu from the splashscreen.
|
||||
## Used when entering the main menu from the splashscreen.
|
||||
config.end_splash_transition = None
|
||||
|
||||
# Used when entering the main menu after the game has ended.
|
||||
## Used when entering the main menu after the game has ended.
|
||||
config.end_game_transition = None
|
||||
|
||||
# Used when a game is loaded.
|
||||
## Used when a game is loaded.
|
||||
config.after_load_transition = None
|
||||
|
||||
# Used when the window is shown.
|
||||
## Used when the window is shown.
|
||||
config.window_show_transition = None
|
||||
|
||||
# Used when the window is hidden.
|
||||
## Used when the window is hidden.
|
||||
config.window_hide_transition = None
|
||||
|
||||
|
||||
#####################
|
||||
# This is the name of the directory where the game's data is
|
||||
# stored. (It needs to be set early, before any other init code
|
||||
# is run, so the persistent information can be found by the init code.)
|
||||
#########################################
|
||||
## This is the name of the directory where the game's data is
|
||||
## stored. (It needs to be set early, before any other init code
|
||||
## is run, so the persistent information can be found by the init code.)
|
||||
python early:
|
||||
config.save_directory = "launcher-4"
|
||||
|
||||
init -1 python hide:
|
||||
#####################
|
||||
# Default values of Preferences.
|
||||
#########################################
|
||||
## Default values of Preferences.
|
||||
|
||||
# Note: These options are only evaluated the first time a
|
||||
# game is run. To have them run a second time, delete
|
||||
# game/saves/persistent
|
||||
## Note: These options are only evaluated the first time a
|
||||
## game is run. To have them run a second time, delete
|
||||
## game/saves/persistent
|
||||
|
||||
# Should we start in fullscreen mode?
|
||||
## Should we start in fullscreen mode?
|
||||
|
||||
config.default_fullscreen = False
|
||||
|
||||
# The default text speed in characters per second. 0 is infinite.
|
||||
## The default text speed in characters per second. 0 is infinite.
|
||||
|
||||
config.default_text_cps = 0
|
||||
|
||||
#####################
|
||||
# More customizations can go here.
|
||||
#########################################
|
||||
## More customizations can go here.
|
||||
|
||||
config.has_sound = False
|
||||
config.has_music = False
|
||||
config.has_voice = False
|
||||
config.force_sound = False
|
||||
config.sound = False
|
||||
config.quit_action = Quit(confirm=False)
|
||||
|
||||
if renpy.macintosh:
|
||||
config.window_icon = "images/window-icon-mac.png"
|
||||
else:
|
||||
config.window_icon = "images/window-icon.png"
|
||||
|
||||
config.gl_resize = False
|
||||
config.window_icon = "images/logo.png"
|
||||
config.windows_icon = "images/logo32.png"
|
||||
config.has_autosave = False
|
||||
config.log_enable = False
|
||||
config.mouse_hide_time = None
|
||||
config.mouse_hide_time = 86400 * 366
|
||||
|
||||
_game_menu_screen = None
|
||||
|
||||
config.underlay = [
|
||||
renpy.Keymap(
|
||||
screenshot = _screenshot,
|
||||
reload_game = _reload_game,
|
||||
developer = _developer,
|
||||
quit = renpy.quit_event,
|
||||
iconify = renpy.iconify,
|
||||
help = _help,
|
||||
choose_renderer = renpy.curried_call_in_new_context("_choose_renderer"),
|
||||
console = _console.enter,
|
||||
profile_once = _profile_once,
|
||||
memory_profile = _memory_profile,
|
||||
self_voicing = Preference("self voicing", "toggle"),
|
||||
clipboard_voicing = Preference("clipboard voicing", "toggle"),
|
||||
debug_voicing = Preference("debug voicing", "toggle"),
|
||||
progress_screen = _progress_screen,
|
||||
),
|
||||
]
|
||||
]
|
||||
|
||||
config.rollback_enabled = False
|
||||
|
||||
# This section controls how to build Ren'Py. (Building the launcher is how
|
||||
# we build Ren'Py distributions.)
|
||||
|
||||
## This section controls how to build Ren'Py. (Building the launcher is how
|
||||
## we build Ren'Py distributions.)
|
||||
init python:
|
||||
|
||||
# We're building Ren'Py tonight.
|
||||
## We're building Ren'Py tonight.
|
||||
build.renpy = True
|
||||
|
||||
# The version number that's supplied to the updater.
|
||||
## The version number that's supplied to the updater.
|
||||
build.version = "Ren'Py {}".format(config.version)
|
||||
|
||||
# The name that's used for directories and archive files. For example, if
|
||||
# this is 'mygame-1.0', the windows distribution will be in the
|
||||
# directory 'mygame-1.0-win', in the 'mygame-1.0-win.zip' file.
|
||||
## The name that's used for directories and archive files. For example, if
|
||||
## this is 'mygame-1.0', the windows distribution will be in the
|
||||
## directory 'mygame-1.0-win', in the 'mygame-1.0-win.zip' file.
|
||||
|
||||
if 'RENPY_BUILD_VERSION' in os.environ:
|
||||
build.directory_name = "renpy-" + os.environ['RENPY_BUILD_VERSION']
|
||||
if 'RENPY_NIGHTLY' in os.environ:
|
||||
build.directory_name = os.environ['RENPY_NIGHTLY']
|
||||
else:
|
||||
build.directory_name = "renpy-" + config.version.rsplit('.', 1)[0]
|
||||
|
||||
# The name that's uses for executables - the program that users will run
|
||||
# to start the game. For example, if this is 'mygame', then on Windows,
|
||||
# users can click 'mygame.exe' to start the game.
|
||||
## The name that's uses for executables - the program that users will run
|
||||
## to start the game. For example, if this is 'mygame', then on Windows,
|
||||
## users can click 'mygame.exe' to start the game.
|
||||
build.executable_name = "renpy"
|
||||
|
||||
# If True, Ren'Py will include update information into packages. This
|
||||
# allows the updater to run.
|
||||
## If True, Ren'Py will include update information into packages. This
|
||||
## allows the updater to run.
|
||||
build.include_update = True
|
||||
|
||||
# Build both kinds of updates.
|
||||
build.update_formats = [ "zsync", "rpu" ]
|
||||
|
||||
# Allow empty directories, so we can distribute the images directory.
|
||||
build.exclude_empty_directories = False
|
||||
|
||||
# Mac signing options.
|
||||
import os
|
||||
build.mac_identity = os.environ.get("RENPY_MAC_IDENTITY", None)
|
||||
build.mac_codesign_command = [ config.renpy_base + "/scripts/mac/mac_sign_client.sh", "{identity}", "{app}" ]
|
||||
build.mac_create_dmg_command = [ config.renpy_base + "/scripts/mac/mac_dmg_client.sh", "{identity}", "{volname}", "{sourcedir}", "{dmg}" ]
|
||||
build.mac_codesign_dmg_command = [ "/bin/true" ]
|
||||
|
||||
|
||||
# Clear out various file patterns.
|
||||
## Clear out various file patterns.
|
||||
build.renpy_patterns = [ ]
|
||||
build.early_base_patterns = [ ]
|
||||
build.base_patterns = [ ]
|
||||
@@ -273,113 +240,51 @@ init python:
|
||||
# We don't need to clear out the executable patterns, since they're
|
||||
# correct for Ren'Py.
|
||||
|
||||
# Now, add the Ren'Py distribution in using classify_renpy.
|
||||
## Now, add the Ren'Py distribution in using classify_renpy.
|
||||
|
||||
build.classify_renpy("rapt/**", "rapt")
|
||||
|
||||
build.classify_renpy("**~", None)
|
||||
build.classify_renpy("**/#*", None)
|
||||
build.classify_renpy("**/thumbs.db", None)
|
||||
build.classify_renpy("**/.*", None)
|
||||
|
||||
build.classify_renpy("rapt/**/libLive2DCubismCore.so", None)
|
||||
build.classify_renpy("rapt/symbols/", None)
|
||||
build.classify_renpy("rapt/**", "rapt")
|
||||
build.executable("rapt/prototype/gradlew")
|
||||
|
||||
build.classify_renpy("renios/prototype/base/", None)
|
||||
build.classify_renpy("renios/prototype/prototype.xcodeproj/*.xcworkspace/", None)
|
||||
build.classify_renpy("renios/prototype/prototype.xcodeproj/xcuserdata/", None)
|
||||
build.classify_renpy("renios/prototype/**", "renios")
|
||||
build.classify_renpy("renios/buildlib/**", "renios")
|
||||
build.classify_renpy("renios/ios.py", "renios")
|
||||
build.classify_renpy("renios/version.txt", "renios")
|
||||
build.classify_renpy("renios/", "renios")
|
||||
|
||||
build.classify_renpy("web/game.zip", None)
|
||||
build.classify_renpy("web/**", "web")
|
||||
|
||||
build.classify_renpy("**.old", None)
|
||||
build.classify_renpy("**.new", None)
|
||||
build.classify_renpy("**.bak", None)
|
||||
|
||||
build.classify_renpy("**.keystore", None)
|
||||
build.classify_renpy("**.pyc", None)
|
||||
|
||||
build.classify_renpy("**/log.txt", None)
|
||||
build.classify_renpy("**/traceback.txt", None)
|
||||
build.classify_renpy("**/errors.txt", None)
|
||||
build.classify_renpy("**/steam_appid.txt", None)
|
||||
build.classify_renpy("**/saves/", None)
|
||||
build.classify_renpy("**/tmp/", None)
|
||||
build.classify_renpy("**/.Editra", None)
|
||||
|
||||
|
||||
# main source.
|
||||
|
||||
def source_and_binary(pattern, source="source", binary="binary", py=True):
|
||||
def source_and_binary(pattern):
|
||||
"""
|
||||
Classifies source and binary files beginning with `pattern`.
|
||||
.pyo, .rpyc, .rpycm, and .rpyb go into binary, everything
|
||||
else but .pyi files go into source.
|
||||
else goes into source.
|
||||
"""
|
||||
|
||||
if py is True:
|
||||
py = 'pycache'
|
||||
build.classify_renpy(pattern + ".pyo", "binary")
|
||||
build.classify_renpy(pattern + ".rpyc", "binary")
|
||||
build.classify_renpy(pattern + ".rpymc", "binary")
|
||||
build.classify_renpy(pattern + ".rpyb", "binary")
|
||||
build.classify_renpy(pattern, "source")
|
||||
|
||||
if py == 'pycache':
|
||||
build.classify_renpy(pattern + "/**__pycache__/", binary)
|
||||
build.classify_renpy(pattern + "/**__pycache__/*.{}.pyc".format(sys.implementation.cache_tag), binary)
|
||||
build.classify_renpy(pattern + "/**.pyc", None)
|
||||
build.classify_renpy(pattern + "/**.pyo", None)
|
||||
|
||||
elif py == 'pyc':
|
||||
build.classify_renpy(pattern + "/**__pycache__/", None)
|
||||
build.classify_renpy(pattern + "/**.pyc", binary)
|
||||
build.classify_renpy(pattern + "/**.pyo", None)
|
||||
|
||||
elif py == 'pyo':
|
||||
build.classify_renpy(pattern + "/**__pycache__/", None)
|
||||
build.classify_renpy(pattern + "/**.pyc", None)
|
||||
build.classify_renpy(pattern + "/**.pyo", binary)
|
||||
|
||||
else:
|
||||
build.classify_renpy(pattern + "/**__pycache__/", None)
|
||||
build.classify_renpy(pattern + "/**.pyc", None)
|
||||
build.classify_renpy(pattern + "/**.pyo", None)
|
||||
|
||||
build.classify_renpy(pattern + "/**.pyi", None)
|
||||
build.classify_renpy(pattern + "/**.pyx", "source_only")
|
||||
build.classify_renpy(pattern + "/**.pxd", "source_only")
|
||||
|
||||
build.classify_renpy(pattern + "/**.rpyc", binary)
|
||||
build.classify_renpy(pattern + "/**.rpymc", binary)
|
||||
|
||||
build.classify_renpy(pattern + "/**/" + renpy.script.BYTECODE_FILE, binary)
|
||||
build.classify_renpy(pattern + "/**/cache/bytecode-*.rpyb", None)
|
||||
|
||||
build.classify_renpy(pattern + "/**/cache/*", binary)
|
||||
|
||||
build.classify_renpy(pattern + "/**", source)
|
||||
|
||||
build.classify_renpy("renpy/gl/", None)
|
||||
|
||||
build.classify_renpy("renpy.py", "binary")
|
||||
source_and_binary("renpy")
|
||||
build.classify_renpy("renpy.py", "source")
|
||||
source_and_binary("renpy/**")
|
||||
|
||||
# games.
|
||||
build.classify_renpy("launcher/game/theme/", None)
|
||||
|
||||
build.classify_renpy("gui/game/gui/", "source")
|
||||
build.classify_renpy("gui/game/gui/bubble.png", "source")
|
||||
build.classify_renpy("gui/game/gui/thoughtbubble.png", "source")
|
||||
build.classify_renpy("gui/game/gui/*", None)
|
||||
|
||||
source_and_binary("launcher", py=False)
|
||||
source_and_binary("gui", binary=None, py=False)
|
||||
|
||||
source_and_binary("the_question")
|
||||
source_and_binary("tutorial")
|
||||
|
||||
# extra fonts.
|
||||
build.classify_renpy("sdk-fonts/**", "source")
|
||||
source_and_binary("launcher/**")
|
||||
source_and_binary("templates/**")
|
||||
source_and_binary("the_question/**")
|
||||
source_and_binary("tutorial/**")
|
||||
|
||||
# docs.
|
||||
build.classify_renpy("doc/", "source")
|
||||
@@ -388,75 +293,51 @@ init python:
|
||||
build.classify_renpy("doc/**", "source")
|
||||
build.classify_renpy("LICENSE.txt", "source")
|
||||
|
||||
build.classify_renpy("sphinx/", "source_only")
|
||||
build.classify_renpy("sphinx/build.sh", "source_only")
|
||||
build.classify_renpy("sphinx/checks.py", "source_only")
|
||||
build.classify_renpy("sphinx/game/**", "source_only")
|
||||
build.classify_renpy("sphinx/source/inc/", None)
|
||||
build.classify_renpy("sphinx/source/**", "source_only")
|
||||
|
||||
# Build System.
|
||||
build.classify_renpy("setup.py", "source_only")
|
||||
build.classify_renpy("src/**", "source_only")
|
||||
build.classify_renpy("scripts/", "source_only")
|
||||
build.classify_renpy("scripts/setuplib.py", "source_only")
|
||||
build.classify_renpy("scripts/generate_styles.py", "source_only")
|
||||
# module.
|
||||
build.classify_renpy("module/", "source")
|
||||
build.classify_renpy("module/*.c", "source")
|
||||
build.classify_renpy("module/gen/", "source")
|
||||
build.classify_renpy("module/gen/*.c", "source")
|
||||
build.classify_renpy("module/*.h", "source")
|
||||
build.classify_renpy("module/*.py*", "source")
|
||||
build.classify_renpy("module/include/", "source")
|
||||
build.classify_renpy("module/include/*.pxd", "source")
|
||||
build.classify_renpy("module/pysdlsound/", "source")
|
||||
build.classify_renpy("module/pysdlsound/*.py", "source")
|
||||
build.classify_renpy("module/pysdlsound/*.pyx", "source")
|
||||
|
||||
# all-platforms binary.
|
||||
build.classify_renpy("lib/**/libpython{}.{}.dll".format(sys.version_info.major, sys.version_info.minor), "binary")
|
||||
build.classify_renpy("lib/**/libpython*.dll", None)
|
||||
build.classify_renpy("lib/*/renpy", None)
|
||||
build.classify_renpy("lib/*/renpy.exe", None)
|
||||
build.classify_renpy("lib/**", "binary")
|
||||
build.classify_renpy("renpy.sh", "binary")
|
||||
build.classify_renpy("renpy.exe", "binary")
|
||||
# renpy.app is now built from scratch from distribute.rpy.
|
||||
|
||||
build.classify_renpy("lib/**/*steam_api*", "steam")
|
||||
build.classify_renpy("lib/**/*Live2D*", None)
|
||||
# jedit rules.
|
||||
build.classify_renpy("jedit/**", "jedit")
|
||||
|
||||
build.classify_renpy("lib/py3-linux-armv7l", None)
|
||||
build.classify_renpy("lib/py3-linux-aarch64/**", "linux_arm")
|
||||
source_and_binary("lib/py3-**", "binary", "binary")
|
||||
# editra rules.
|
||||
build.classify_renpy("editra/", "editra-all")
|
||||
build.classify_renpy("editra/Editra.edit.py", "editra-all")
|
||||
build.classify_renpy("editra/Editra/**", "editra-linux editra-windows")
|
||||
build.classify_renpy("editra/Editra-mac.app/**", "editra-mac")
|
||||
build.classify_renpy("editra/lib/**", "editra-windows")
|
||||
build.classify_renpy("editra/editra.exe", "editra-windows")
|
||||
|
||||
libpython = "lib/python{}.{}".format(sys.version_info.major, sys.version_info.minor)
|
||||
source_and_binary(libpython, "binary", "binary", py='pyc')
|
||||
|
||||
build.classify_renpy("lib/python**", None)
|
||||
build.classify_renpy("lib/py2-**", None)
|
||||
|
||||
build.classify_renpy("renpy3.sh", "binary")
|
||||
|
||||
build.classify_renpy("lib/", "binary")
|
||||
# Executable rules.
|
||||
build.executable("editra/Editra/Editra")
|
||||
|
||||
# Packages.
|
||||
build.packages = [ ]
|
||||
|
||||
build.package("sdk", "zip tar.bz2 dmg", "source binary")
|
||||
build.package("sdkarm", "tar.bz2", "source binary linux_arm")
|
||||
build.package("source", "tar.bz2", "source source_only", update=False)
|
||||
build.package("steam", "zip", "steam", dlc=True)
|
||||
build.package("sdk", "zip tar.bz2", "source binary")
|
||||
build.package("source", "tar.bz2", "source", update=False)
|
||||
|
||||
build.package("jedit", "zip", "jedit", dlc=True)
|
||||
build.package("editra-linux", "tar.bz2", "editra-all editra-linux", dlc=True)
|
||||
build.package("editra-mac", "zip", "editra-all editra-mac", dlc=True)
|
||||
build.package("editra-windows", "zip", "editra-all editra-windows", dlc=True)
|
||||
build.package("rapt", "zip", "rapt", dlc=True)
|
||||
build.package("renios", "zip", "renios", dlc=True)
|
||||
build.package("web", "zip", "web", dlc=True)
|
||||
|
||||
# The identifier for the SDK.
|
||||
define build.mac_info_plist["CFBundleIdentifier"] = "org.renpy.sdk"
|
||||
|
||||
# Enable the special launcher translation mode.
|
||||
define config.translate_launcher = True
|
||||
|
||||
# Allow clicks that focus the window to be processed.
|
||||
define config.mouse_focus_clickthrough = True
|
||||
|
||||
# Reduce the rate of screen updates.
|
||||
default preferences.gl_powersave = True
|
||||
|
||||
# Enable rtl.
|
||||
define config.rtl = True
|
||||
|
||||
# Disable steam.
|
||||
python early:
|
||||
config.enable_steam = False
|
||||
|
||||
# Since the launcher can be run directly or can be run from the SDK directory,
|
||||
# uneliding files needs to be handled slightly differently.
|
||||
define config.alternate_unelide_path = os.path.join(config.basedir, "launcher")
|
||||
|
||||
# Disable skipping.
|
||||
define config.allow_skipping = False
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -28,27 +28,77 @@ init python in distribute:
|
||||
import struct
|
||||
import stat
|
||||
import shutil
|
||||
import sys
|
||||
import threading
|
||||
|
||||
from zipfile import crc32
|
||||
|
||||
# Since the long type doesn't exist on py3, define it here
|
||||
long = int
|
||||
|
||||
zlib.Z_DEFAULT_COMPRESSION = 5
|
||||
zlib.Z_DEFAULT_COMPRESSION = 9
|
||||
|
||||
class ZipFile(zipfile.ZipFile):
|
||||
|
||||
def write_with_info(self, zinfo, filename):
|
||||
"""Put the bytes from filename into the archive under the name
|
||||
arcname."""
|
||||
if not self.fp:
|
||||
raise RuntimeError(
|
||||
"Attempt to write to ZIP archive that was already closed")
|
||||
|
||||
if zinfo.filename.endswith("/"):
|
||||
data = b''
|
||||
st = os.stat(filename)
|
||||
isdir = stat.S_ISDIR(st.st_mode)
|
||||
|
||||
zinfo.file_size = st.st_size
|
||||
zinfo.flag_bits = 0x00
|
||||
zinfo.header_offset = self.fp.tell() # Start of header bytes
|
||||
|
||||
self._writecheck(zinfo)
|
||||
self._didModify = True
|
||||
|
||||
if isdir:
|
||||
zinfo.file_size = 0
|
||||
zinfo.compress_size = 0
|
||||
zinfo.CRC = 0
|
||||
self.filelist.append(zinfo)
|
||||
self.NameToInfo[zinfo.filename] = zinfo
|
||||
self.fp.write(zinfo.FileHeader())
|
||||
return
|
||||
|
||||
with open(filename, "rb") as fp:
|
||||
# Must overwrite CRC and sizes with correct data later
|
||||
zinfo.CRC = CRC = 0
|
||||
zinfo.compress_size = compress_size = 0
|
||||
zinfo.file_size = file_size = 0
|
||||
self.fp.write(zinfo.FileHeader())
|
||||
if zinfo.compress_type == zipfile.ZIP_DEFLATED:
|
||||
cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION,
|
||||
zlib.DEFLATED, -15)
|
||||
else:
|
||||
cmpr = None
|
||||
while 1:
|
||||
buf = fp.read(1024 * 1024)
|
||||
if not buf:
|
||||
break
|
||||
file_size = file_size + len(buf)
|
||||
CRC = crc32(buf, CRC) & 0xffffffff
|
||||
if cmpr:
|
||||
buf = cmpr.compress(buf)
|
||||
compress_size = compress_size + len(buf)
|
||||
self.fp.write(buf)
|
||||
if cmpr:
|
||||
buf = cmpr.flush()
|
||||
compress_size = compress_size + len(buf)
|
||||
self.fp.write(buf)
|
||||
zinfo.compress_size = compress_size
|
||||
else:
|
||||
with open(filename, "rb") as f:
|
||||
data = f.read()
|
||||
|
||||
self.writestr(zinfo, data)
|
||||
zinfo.compress_size = file_size
|
||||
zinfo.CRC = CRC
|
||||
zinfo.file_size = file_size
|
||||
# Seek backwards and write CRC and file sizes
|
||||
position = self.fp.tell() # Preserve current position in file
|
||||
self.fp.seek(zinfo.header_offset + 14, 0)
|
||||
self.fp.write(struct.pack("<LLL", zinfo.CRC, zinfo.compress_size,
|
||||
zinfo.file_size))
|
||||
self.fp.seek(position, 0)
|
||||
self.filelist.append(zinfo)
|
||||
self.NameToInfo[zinfo.filename] = zinfo
|
||||
|
||||
|
||||
class ZipPackage(object):
|
||||
@@ -57,28 +107,7 @@ init python in distribute:
|
||||
"""
|
||||
|
||||
def __init__(self, filename):
|
||||
self.zipfile = ZipFile(filename, "w", zipfile.ZIP_DEFLATED, True)
|
||||
|
||||
def get_date_time(self, path):
|
||||
"""
|
||||
Gets the datetime for a file. If the time doesn't exist or is
|
||||
weird, use the current time instead.
|
||||
"""
|
||||
|
||||
try:
|
||||
s = os.stat(path)
|
||||
rv = time.gmtime(s.st_mtime)[:6]
|
||||
|
||||
# Check that the time is sensible.
|
||||
if rv[0] < 2000:
|
||||
rv = None
|
||||
except Exception:
|
||||
rv = None
|
||||
|
||||
if rv is None:
|
||||
rv = time.gmtime()[:6]
|
||||
|
||||
return rv
|
||||
self.zipfile = ZipFile(filename, "w", zipfile.ZIP_DEFLATED)
|
||||
|
||||
def add_file(self, name, path, xbit):
|
||||
|
||||
@@ -86,14 +115,20 @@ init python in distribute:
|
||||
raise Exception("path for " + name + " must not be None.")
|
||||
|
||||
zi = zipfile.ZipInfo(name)
|
||||
zi.date_time = self.get_date_time(path)
|
||||
|
||||
try:
|
||||
s = os.stat(path)
|
||||
zi.date_time = time.gmtime(s.st_mtime)[:6]
|
||||
except:
|
||||
zi.date_time = time.gmtime()[:6]
|
||||
|
||||
zi.compress_type = zipfile.ZIP_DEFLATED
|
||||
zi.create_system = 3
|
||||
|
||||
if xbit:
|
||||
zi.external_attr = long(0o100755) << 16
|
||||
zi.external_attr = long(0100755) << 16
|
||||
else:
|
||||
zi.external_attr = long(0o100644) << 16
|
||||
zi.external_attr = long(0100644) << 16
|
||||
|
||||
self.zipfile.write_with_info(zi, path)
|
||||
|
||||
@@ -102,14 +137,16 @@ init python in distribute:
|
||||
return
|
||||
|
||||
zi = zipfile.ZipInfo(name + "/")
|
||||
zi.date_time = self.get_date_time(path)
|
||||
|
||||
s = os.stat(path)
|
||||
zi.date_time = time.gmtime(s.st_mtime)[:6]
|
||||
zi.compress_type = zipfile.ZIP_STORED
|
||||
zi.create_system = 3
|
||||
zi.external_attr = (long(0o040755) << 16) | 0x10
|
||||
zi.external_attr = (long(0040755) << 16) | 0x10
|
||||
|
||||
self.zipfile.write_with_info(zi, path)
|
||||
|
||||
def close(self, progress=None):
|
||||
def close(self):
|
||||
self.zipfile.close()
|
||||
|
||||
|
||||
@@ -121,7 +158,7 @@ init python in distribute:
|
||||
If true, times will be forced to the epoch.
|
||||
"""
|
||||
|
||||
self.tarfile = tarfile.open(filename, mode, format=tarfile.PAX_FORMAT)
|
||||
self.tarfile = tarfile.open(filename, mode)
|
||||
self.tarfile.dereference = True
|
||||
self.notime = notime
|
||||
|
||||
@@ -136,9 +173,9 @@ init python in distribute:
|
||||
info.type = tarfile.DIRTYPE
|
||||
|
||||
if xbit:
|
||||
info.mode = 0o755
|
||||
info.mode = 0755
|
||||
else:
|
||||
info.mode = 0o644
|
||||
info.mode = 0644
|
||||
|
||||
info.uid = 1000
|
||||
info.gid = 1000
|
||||
@@ -157,232 +194,33 @@ init python in distribute:
|
||||
def add_directory(self, name, path):
|
||||
self.add_file(name, path, True)
|
||||
|
||||
def close(self, progress=None):
|
||||
def close(self):
|
||||
self.tarfile.close()
|
||||
|
||||
|
||||
class UpdatePackage(TarPackage):
|
||||
|
||||
def __init__(self, filename, basename, destination):
|
||||
self.path = filename
|
||||
self.basename = basename
|
||||
self.destination = destination
|
||||
|
||||
TarPackage.__init__(self, filename, "w", notime=True)
|
||||
|
||||
def close(self, progress=None):
|
||||
TarPackage.close(self)
|
||||
|
||||
cmd = [
|
||||
updater.zsync_path("zsyncmake"),
|
||||
"-z",
|
||||
# -u url to gzipped data - not a local filename!
|
||||
"-u", self.basename + ".update.gz",
|
||||
"-o", os.path.join(self.destination, self.basename + ".zsync"),
|
||||
os.path.abspath(self.path),
|
||||
]
|
||||
|
||||
subprocess.check_call([ renpy.fsencode(i) for i in cmd ])
|
||||
|
||||
# Build the sums file. This is a file with an adler32 hash of each 64k block
|
||||
# of the zsync file. It's used to help us determine how much of the file is
|
||||
# downloaded.
|
||||
with open(self.path, "rb") as src:
|
||||
with open(renpy.fsencode(os.path.join(self.destination, self.basename + ".sums")), "wb") as sums:
|
||||
while True:
|
||||
data = src.read(65536)
|
||||
|
||||
if not data:
|
||||
break
|
||||
|
||||
sums.write(struct.pack("<I", zlib.adler32(data) & 0xffffffff))
|
||||
|
||||
|
||||
class DirectoryPackage(object):
|
||||
|
||||
def mkdir(self, path):
|
||||
if not os.path.isdir(path):
|
||||
os.makedirs(path, 0o755)
|
||||
os.mkdir(path, 0755)
|
||||
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
|
||||
if os.path.isdir(path):
|
||||
shutil.rmtree(path)
|
||||
|
||||
self.mkdir(path)
|
||||
|
||||
def add_file(self, name, path, xbit):
|
||||
fn = os.path.join(self.path, name)
|
||||
|
||||
# If this is not a directory, ensure all parent directories
|
||||
# have been created
|
||||
self.mkdir(os.path.dirname(fn))
|
||||
shutil.copy(path, fn)
|
||||
shutil.copy2(path, fn)
|
||||
|
||||
if xbit:
|
||||
os.chmod(fn, 0o755)
|
||||
os.chmod(fn, 0755)
|
||||
else:
|
||||
os.chmod(fn, 0o644)
|
||||
os.chmod(fn, 0644)
|
||||
|
||||
def add_directory(self, name, path):
|
||||
fn = os.path.join(self.path, name)
|
||||
self.mkdir(fn)
|
||||
|
||||
def close(self, progress=None):
|
||||
def close(self):
|
||||
return
|
||||
|
||||
|
||||
class ExternalZipPackage(object):
|
||||
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
self.directory = path + ".zd"
|
||||
self.dp = DirectoryPackage(self.directory)
|
||||
|
||||
def add_file(self, name, path, xbit):
|
||||
self.dp.add_file(name, path, xbit)
|
||||
|
||||
def add_directory(self, name, path):
|
||||
self.dp.add_directory(name, path)
|
||||
|
||||
def close(self, progress=None):
|
||||
self.dp.close()
|
||||
|
||||
if os.path.exists(self.path):
|
||||
os.unlink(self.path)
|
||||
|
||||
p = subprocess.Popen([
|
||||
"zip",
|
||||
"-9rq",
|
||||
os.path.abspath(self.path),
|
||||
] + os.listdir(self.directory),
|
||||
cwd=os.path.abspath(self.directory)
|
||||
)
|
||||
|
||||
p.wait()
|
||||
|
||||
shutil.rmtree(self.directory)
|
||||
|
||||
|
||||
class DMGPackage(DirectoryPackage):
|
||||
def __init__(self, path, make_dmg):
|
||||
self.make_dmg = make_dmg
|
||||
DirectoryPackage.__init__(self, path)
|
||||
|
||||
def close(self, progress=None):
|
||||
DirectoryPackage.close(self)
|
||||
self.make_dmg()
|
||||
|
||||
|
||||
class RPUPackage(object):
|
||||
|
||||
generator = None
|
||||
|
||||
def __init__(self, directory, variant):
|
||||
import renpy.update.common
|
||||
|
||||
self.directory = directory + "/rpu"
|
||||
self.variant = variant
|
||||
self.file_list = renpy.update.common.FileList()
|
||||
|
||||
if not os.path.exists(self.directory):
|
||||
os.mkdir(self.directory)
|
||||
|
||||
def add_file(self, name, path, xbit):
|
||||
self.file_list.add_file(name, path, xbit)
|
||||
|
||||
def add_directory(self, name, _path):
|
||||
self.file_list.add_directory(name)
|
||||
|
||||
def close(self, progress=None):
|
||||
import renpy.update.generate
|
||||
|
||||
if RPUPackage.generator is None:
|
||||
RPUPackage.generator = renpy.update.generate.BlockGenerator(self.directory)
|
||||
|
||||
RPUPackage.generator.generate(self.variant, self.file_list, progress)
|
||||
|
||||
@staticmethod
|
||||
def reset():
|
||||
RPUPackage.generator = None
|
||||
|
||||
|
||||
class NullPackage(object):
|
||||
"""
|
||||
A package format that doesn't create an output file,
|
||||
only updates.
|
||||
"""
|
||||
|
||||
def add_file(self, name, path, xbit):
|
||||
return
|
||||
|
||||
def add_directory(self, name, _path):
|
||||
return
|
||||
|
||||
def close(self, progress=None):
|
||||
return
|
||||
|
||||
|
||||
parallel_threads = [ ]
|
||||
|
||||
class ParallelPackage(object):
|
||||
|
||||
def __init__(self, package, done, what):
|
||||
self.package = package
|
||||
self.done = done
|
||||
self.what = what
|
||||
|
||||
self.worklist = [ ]
|
||||
|
||||
def add_file(self, name, path, xbit):
|
||||
self.worklist.append((False, name, path, xbit))
|
||||
|
||||
def add_directory(self, name, path):
|
||||
self.worklist.append((True, name, path, True))
|
||||
|
||||
def close(self, progress=None):
|
||||
t = threading.Thread(target=self.run)
|
||||
t.start()
|
||||
|
||||
self.thread = t
|
||||
parallel_threads.append(self)
|
||||
|
||||
def run(self):
|
||||
|
||||
for i in self.worklist:
|
||||
directory, name, path, xbit = i
|
||||
if directory:
|
||||
self.package.add_directory(name, path)
|
||||
else:
|
||||
self.package.add_file(name, path, xbit)
|
||||
|
||||
self.package.close()
|
||||
|
||||
|
||||
def wait_parallel_threads():
|
||||
|
||||
t = 0
|
||||
|
||||
while parallel_threads:
|
||||
|
||||
alive = [ ]
|
||||
|
||||
for i in parallel_threads:
|
||||
i.thread.join(0)
|
||||
if i.thread.is_alive():
|
||||
alive.append(i)
|
||||
|
||||
if not alive:
|
||||
break
|
||||
|
||||
t += 1
|
||||
print("\r " + str(t) + " " + " ".join(sorted([ i.what for i in alive ])))
|
||||
|
||||
time.sleep(1)
|
||||
|
||||
for i in parallel_threads:
|
||||
if i.done:
|
||||
i.done()
|
||||
|
||||
parallel_threads.clear()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -19,96 +19,37 @@
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
default persistent.show_edit_funcs = True
|
||||
default persistent.windows_console = False
|
||||
default persistent.lint_options = set()
|
||||
default persistent.use_web_doc = False
|
||||
|
||||
init python:
|
||||
from math import ceil
|
||||
if persistent.gl_enable is None:
|
||||
persistent.gl_enable = True
|
||||
|
||||
def scan_translations(piglatin=True):
|
||||
config.gl_enable = persistent.gl_enable
|
||||
|
||||
if persistent.windows_console is None:
|
||||
persistent.windows_console = False
|
||||
|
||||
def scan_translations():
|
||||
|
||||
languages = renpy.known_languages()
|
||||
|
||||
if not languages:
|
||||
return None
|
||||
|
||||
languages.remove("piglatin")
|
||||
rv = [ ( "English", None) ]
|
||||
|
||||
rv = [(i, renpy.translate_string("{#language name and font}", i)) for i in languages ]
|
||||
rv.sort(key=lambda a : renpy.filter_text_tags(a[1], allow=[]).lower())
|
||||
for i in languages:
|
||||
rv.append((i.title(), i))
|
||||
|
||||
rv.insert(0, (None, "English"))
|
||||
|
||||
if piglatin:
|
||||
rv.append(("piglatin", "Igpay Atinlay"))
|
||||
|
||||
bound = ceil(len(rv)/3.)
|
||||
return (rv[:bound], rv[bound:2*bound], rv[2*bound:])
|
||||
|
||||
class RestartAtPreferences(Action):
|
||||
def __call__(self):
|
||||
renpy.session["launcher_start_label"] = "preferences"
|
||||
renpy.utter_restart()
|
||||
|
||||
class EnsureProjectsTxt(Action):
|
||||
"""
|
||||
Ensures the projects.txt file exists before it's opened.
|
||||
"""
|
||||
|
||||
def __call__(self):
|
||||
fn = os.path.join(project.manager.projects_directory, "projects.txt")
|
||||
|
||||
if os.path.exists(fn):
|
||||
return
|
||||
|
||||
with open(fn, "w") as f:
|
||||
f.write("""\
|
||||
# This file can be used to add projects not in the projects directory
|
||||
# by listing the full path to each project, one per line.
|
||||
|
||||
""")
|
||||
return rv
|
||||
|
||||
|
||||
default persistent.force_new_tutorial = False
|
||||
default persistent.sponsor_message = True
|
||||
default persistent.daily_update_check = True
|
||||
default persistent.daily_update_check_once = False
|
||||
screen preferences:
|
||||
|
||||
# Keep the default update check from triggering until tomorrow.
|
||||
default persistent.last_update_check = datetime.date.today()
|
||||
|
||||
# Should we try to skip the splashscreen?
|
||||
default persistent.skip_splashscreen = False
|
||||
|
||||
# Should we prefer rpu updates?
|
||||
default persistent.prefer_rpu = True
|
||||
|
||||
init python:
|
||||
if not persistent.daily_update_check_once:
|
||||
persistent.daily_update_check_once = True
|
||||
persistent.daily_update_check = True
|
||||
|
||||
|
||||
default preference_tab = "general"
|
||||
define preference_tabs = (
|
||||
("general", _("General")),
|
||||
("options", _("Options")),
|
||||
("theme", _("Theme")),
|
||||
("install", _("Install Libraries")),
|
||||
("actions", _("Actions")),
|
||||
("lint", _("Lint")),
|
||||
)
|
||||
|
||||
screen preferences():
|
||||
|
||||
default translations = scan_translations()
|
||||
$ translations = scan_translations()
|
||||
|
||||
frame:
|
||||
style_group "l"
|
||||
style "l_root"
|
||||
alt "Preferences"
|
||||
|
||||
window:
|
||||
|
||||
@@ -127,44 +68,126 @@ screen preferences():
|
||||
|
||||
has vbox
|
||||
|
||||
# Projects directory selection.
|
||||
add SEPARATOR2
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
for i, l in preference_tabs:
|
||||
textbutton l action SetVariable("preference_tab", i) style "l_list"
|
||||
|
||||
if preference_tab == "general":
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum TWOTHIRDS
|
||||
xfill True
|
||||
|
||||
yminimum 75
|
||||
has vbox
|
||||
|
||||
add SEPARATOR2
|
||||
text _("Projects Directory:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
|
||||
frame style "l_indent":
|
||||
if persistent.projects_directory:
|
||||
textbutton _("[persistent.projects_directory!q]") action Jump("projects_directory_preference")
|
||||
else:
|
||||
textbutton _("Not Set") action Jump("projects_directory_preference")
|
||||
|
||||
|
||||
|
||||
add SPACER
|
||||
|
||||
# Text editor selection.
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
yminimum 75
|
||||
has vbox
|
||||
|
||||
text _("Text Editor:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
frame style "l_indent":
|
||||
if persistent.editor:
|
||||
textbutton persistent.editor action Jump("editor_preference")
|
||||
else:
|
||||
textbutton _("Not Set") action Jump("editor_preference")
|
||||
|
||||
add SPACER
|
||||
|
||||
if ability.can_update:
|
||||
|
||||
# Update URL selection.
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
|
||||
yminimum 75
|
||||
has vbox
|
||||
|
||||
text _("Projects Directory:")
|
||||
text _("Update Channel:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
|
||||
frame style "l_indent":
|
||||
if persistent.projects_directory:
|
||||
textbutton _("[persistent.projects_directory!q]"):
|
||||
action Jump("projects_directory_preference")
|
||||
alt _("Projects directory: [text]")
|
||||
else:
|
||||
textbutton _("Not Set"):
|
||||
action Jump("projects_directory_preference")
|
||||
alt _("Projects directory: [text]")
|
||||
textbutton persistent.update_channel action Jump("update_preference")
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum ONETHIRD
|
||||
xfill True
|
||||
|
||||
has vbox
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
yminimum 75
|
||||
has vbox
|
||||
|
||||
text _("Navigation Options:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
textbutton _("Include private names") style "l_checkbox" action ToggleField(persistent, "navigate_private")
|
||||
textbutton _("Include library names") style "l_checkbox" action ToggleField(persistent, "navigate_library")
|
||||
|
||||
add SPACER
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
yminimum 75
|
||||
has vbox
|
||||
|
||||
text _("Launcher Options:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
textbutton _("Hardware rendering") style "l_checkbox" action ToggleField(persistent, "gl_enable")
|
||||
textbutton _("Show templates") style "l_checkbox" action ToggleField(persistent, "show_templates")
|
||||
|
||||
if renpy.windows:
|
||||
textbutton _("Console output") style "l_checkbox" action ToggleField(persistent, "windows_console")
|
||||
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum ONETHIRD
|
||||
xfill True
|
||||
|
||||
has vbox
|
||||
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
yminimum 75
|
||||
has vbox
|
||||
|
||||
text _("Actions:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
textbutton _("Open launcher project") style "l_nonbox" action [ project.Select("launcher"), Jump("front_page") ]
|
||||
|
||||
if translations:
|
||||
|
||||
add SPACER
|
||||
|
||||
@@ -173,224 +196,20 @@ screen preferences():
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Text Editor:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
frame style "l_indent":
|
||||
textbutton (persistent.editor or _("Not Set")) action Jump("editor_preference") alt _("Text editor: [text]")
|
||||
|
||||
add SPACER
|
||||
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
yminimum 75
|
||||
has vbox
|
||||
|
||||
text _("Language:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
hbox:
|
||||
for tran in translations:
|
||||
vbox:
|
||||
for tlid, tlname in tran:
|
||||
textbutton tlname:
|
||||
xmaximum (TWOTHIRDS//3)
|
||||
action [Language(tlid), project.SelectTutorial(True)]
|
||||
style "l_list"
|
||||
# frame style "l_indent":
|
||||
|
||||
elif preference_tab == "options":
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum TWOTHIRDS
|
||||
xfill True
|
||||
|
||||
has vbox
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Navigation Options:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
textbutton _("Include private names") style "l_checkbox" action ToggleField(persistent, "navigate_private")
|
||||
textbutton _("Include library names") style "l_checkbox" action ToggleField(persistent, "navigate_library")
|
||||
|
||||
add SPACER
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Game Options:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
if renpy.windows:
|
||||
textbutton _("Console output") style "l_checkbox" action ToggleField(persistent, "windows_console")
|
||||
|
||||
textbutton _("Skip splashscreen") style "l_checkbox" action ToggleField(persistent, "skip_splashscreen")
|
||||
|
||||
add SPACER
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Launcher Options:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
textbutton _("Show edit file section") style "l_checkbox" action ToggleField(persistent, "show_edit_funcs")
|
||||
textbutton _("Large fonts") style "l_checkbox" action [ ToggleField(persistent, "large_print"), renpy.utter_restart ]
|
||||
|
||||
if interface.local_doc_exists:
|
||||
textbutton _("Prefer the web documentation") style "l_checkbox" action ToggleField(persistent, "use_web_doc")
|
||||
|
||||
textbutton _("Sponsor message") style "l_checkbox" action ToggleField(persistent, "sponsor_message")
|
||||
|
||||
textbutton _("Restore window position") style "l_checkbox" action Preference("restore window position", "toggle")
|
||||
|
||||
if ability.can_update:
|
||||
textbutton _("Daily check for update") style "l_checkbox" action [ToggleField(persistent, "daily_update_check"), SetField(persistent, "last_update_check", None)] selected persistent.daily_update_check
|
||||
textbutton _("Prefer RPU updates") style "l_checkbox" action ToggleField(persistent, "prefer_rpu")
|
||||
|
||||
elif preference_tab == "theme":
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum TWOTHIRDS
|
||||
xfill True
|
||||
|
||||
has vbox
|
||||
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Launcher Theme:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
textbutton _("Default theme") style "l_checkbox" action [SetField(persistent, "theme", None), RestartAtPreferences() ]
|
||||
textbutton _("Dark theme") style "l_checkbox" action [SetField(persistent, "theme", "dark"), RestartAtPreferences()]
|
||||
textbutton _("Custom theme") style "l_checkbox" action [SetField(persistent, "theme", "custom"), RestartAtPreferences()]
|
||||
|
||||
add SPACER
|
||||
|
||||
$ skins_url = interface.get_doc_url("skins.html")
|
||||
|
||||
text _("Information about creating a custom theme can be found {a=[skins_url]}in the Ren'Py Documentation{/a}.")
|
||||
|
||||
elif preference_tab == "install":
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum TWOTHIRDS
|
||||
xfill True
|
||||
|
||||
has vbox
|
||||
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Install Libraries:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
use install_preferences
|
||||
|
||||
elif preference_tab == "actions":
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum TWOTHIRDS
|
||||
xfill True
|
||||
|
||||
has vbox
|
||||
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Actions:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
textbutton _("Open launcher project") style "l_nonbox" action [ project.Select("launcher"), Jump("front_page") ]
|
||||
textbutton _("Open projects.txt"):
|
||||
style "l_nonbox"
|
||||
if project.manager.projects_directory:
|
||||
action [
|
||||
EnsureProjectsTxt(),
|
||||
editor.EditAbsolute(os.path.join(project.manager.projects_directory, "projects.txt"))
|
||||
]
|
||||
|
||||
textbutton _("Reset window size") style "l_nonbox" action Preference("display", 1.0)
|
||||
textbutton _("Clean temporary files") style "l_nonbox" action Jump("clean_tmp")
|
||||
|
||||
elif preference_tab == "lint":
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
xmaximum TWOTHIRDS
|
||||
xfill True
|
||||
|
||||
has vbox
|
||||
|
||||
add SEPARATOR2
|
||||
|
||||
frame:
|
||||
style "l_indent"
|
||||
has vbox
|
||||
|
||||
text _("Lint toggles:")
|
||||
|
||||
add HALF_SPACER
|
||||
|
||||
textbutton _("Check for orphan/obsolete translations"):
|
||||
style "l_checkbox"
|
||||
action InvertSelected(ToggleSetMembership(persistent.lint_options, "--no-orphan-tl"))
|
||||
textbutton _("Check parameters shadowing reserved names"):
|
||||
style "l_checkbox"
|
||||
action ToggleSetMembership(persistent.lint_options, "--reserved-parameters")
|
||||
textbutton _("Print block, word, and character counts by speaking character."):
|
||||
style "l_checkbox"
|
||||
action ToggleSetMembership(persistent.lint_options, "--by-character")
|
||||
textbutton _("Unclosed text tags"):
|
||||
style "l_checkbox"
|
||||
action ToggleSetMembership(persistent.lint_options, "--check-unclosed-tags")
|
||||
textbutton _("Show all unreachable blocks and orphaned translations."):
|
||||
style "l_checkbox"
|
||||
action ToggleSetMembership(persistent.lint_options, "--all-problems")
|
||||
for tlname, tlvalue in translations:
|
||||
textbutton tlname action Language(tlvalue) style "l_list"
|
||||
|
||||
|
||||
textbutton _("Return") action Jump("front_page") style "l_left_button"
|
||||
|
||||
label clean_tmp:
|
||||
python hide:
|
||||
installer.processing(_("Cleaning temporary files..."))
|
||||
installer._clean("renpy:tmp", 0)
|
||||
time.sleep(0.5)
|
||||
|
||||
jump preferences
|
||||
textbutton _("Back") action Jump("front_page") style "l_left_button"
|
||||
|
||||
label projects_directory_preference:
|
||||
call choose_projects_directory
|
||||
@@ -400,74 +219,3 @@ label projects_directory_preference:
|
||||
label preferences:
|
||||
call screen preferences
|
||||
jump preferences
|
||||
|
||||
|
||||
screen choose_language():
|
||||
default local_lang = _preferences.language
|
||||
default chosen_lang = _preferences.language
|
||||
default translations = scan_translations(piglatin=False)
|
||||
|
||||
add BACKGROUND
|
||||
|
||||
vbox:
|
||||
xalign .5
|
||||
yalign .5
|
||||
|
||||
fixed:
|
||||
ysize 0
|
||||
|
||||
text renpy.translate_string(_("{#in language font}Welcome! Please choose a language"), local_lang):
|
||||
xalign .5
|
||||
yanchor 1.0
|
||||
ypos 1.0
|
||||
|
||||
style "l_label_text"
|
||||
|
||||
size 36
|
||||
textalign .5
|
||||
layout "subtitle"
|
||||
|
||||
add SPACER
|
||||
add SPACER
|
||||
|
||||
hbox:
|
||||
xalign .5
|
||||
for tran in translations:
|
||||
vbox:
|
||||
for tlid, tlname in tran:
|
||||
textbutton tlname:
|
||||
xmaximum (TWOTHIRDS//3)
|
||||
action [ SetScreenVariable("chosen_lang", tlid), Language(tlid), project.SelectTutorial(True), Return() ]
|
||||
hovered SetScreenVariable("local_lang", tlid)
|
||||
unhovered SetScreenVariable("local_lang", chosen_lang)
|
||||
style "l_list"
|
||||
text_xalign .5
|
||||
|
||||
add SPACER
|
||||
add SPACER
|
||||
|
||||
$ lang_name = renpy.translate_string("{#language name and font}", local_lang)
|
||||
|
||||
fixed:
|
||||
ysize 0
|
||||
|
||||
textbutton renpy.translate_string(_("{#in language font}Start using Ren'Py in [lang_name]"), local_lang):
|
||||
xalign .5
|
||||
action [Language(chosen_lang), project.SelectTutorial(True), Return()]
|
||||
style "l_default"
|
||||
text_style "l_default"
|
||||
|
||||
text_size 30
|
||||
text_textalign .5
|
||||
text_layout "subtitle"
|
||||
|
||||
|
||||
label choose_language:
|
||||
call screen choose_language
|
||||
return
|
||||
|
||||
|
||||
translate None strings:
|
||||
# game/new_project.rpy:77
|
||||
old "{#language name and font}"
|
||||
new "English"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -22,10 +22,15 @@
|
||||
# Code that manages projects.
|
||||
|
||||
init python:
|
||||
try:
|
||||
import EasyDialogsWin as EasyDialogs
|
||||
except:
|
||||
EasyDialogs = None
|
||||
|
||||
import os
|
||||
|
||||
init python in project:
|
||||
from store import persistent, config, Action, renpy, _preferences, MultiPersistent
|
||||
from store import persistent, config, Action, renpy
|
||||
import store.util as util
|
||||
import store.interface as interface
|
||||
|
||||
@@ -36,35 +41,27 @@ init python in project:
|
||||
import re
|
||||
import tempfile
|
||||
|
||||
multipersistent = MultiPersistent("launcher.renpy.org")
|
||||
|
||||
if persistent.blurb is None:
|
||||
persistent.blurb = 0
|
||||
|
||||
project_filter = [ i.strip() for i in os.environ.get("RENPY_PROJECT_FILTER", "").split(":") if i.strip() ]
|
||||
|
||||
LAUNCH_BLURBS = [
|
||||
_("After making changes to the script, press shift+R to reload your game."),
|
||||
_("Press shift+O (the letter) to access the console."),
|
||||
_("Press shift+D to access the developer menu."),
|
||||
_("Have you backed up your projects recently?"),
|
||||
_("Lint checks your game for potential mistakes, and gives you statistics."),
|
||||
]
|
||||
|
||||
class Project(object):
|
||||
|
||||
def __init__(self, path, name=None):
|
||||
def __init__(self, path):
|
||||
|
||||
while path.endswith("/"):
|
||||
path = path[:-1]
|
||||
|
||||
if name is None:
|
||||
name = os.path.basename(path)
|
||||
|
||||
if not os.path.exists(path):
|
||||
raise Exception("{} does not exist.".format(path))
|
||||
|
||||
self.name = name
|
||||
# The name of the project.
|
||||
self.name = os.path.basename(path)
|
||||
|
||||
# The path to the project.
|
||||
self.path = path
|
||||
@@ -79,9 +76,6 @@ init python in project:
|
||||
# Load the data.
|
||||
self.load_data()
|
||||
|
||||
# A name to display the project.
|
||||
self.display_name = self.data.get("display_name", self.name)
|
||||
|
||||
# The project's temporary directory.
|
||||
self.tmp = None
|
||||
|
||||
@@ -92,110 +86,37 @@ init python in project:
|
||||
# The mtime of the last dump file loaded.
|
||||
self.dump_mtime = 0
|
||||
|
||||
# A processed version of data['renpy_launcher'] with missing files
|
||||
# and directories removed.
|
||||
self.renpy_launcher = None
|
||||
|
||||
def get_dump_filename(self):
|
||||
|
||||
if os.path.exists(os.path.join(self.gamedir, "saves")):
|
||||
return os.path.join(self.gamedir, "saves", "navigation.json")
|
||||
|
||||
self.make_tmp()
|
||||
return os.path.join(self.tmp, "navigation.json")
|
||||
|
||||
def load_data(self):
|
||||
try:
|
||||
with open(os.path.join(self.path, "project.json"), "r") as f:
|
||||
self.data = json.load(f)
|
||||
except Exception:
|
||||
f = open(os.path.join(self.path, "project.json"), "rb")
|
||||
self.data = json.load(f)
|
||||
f.close()
|
||||
except:
|
||||
self.data = { }
|
||||
|
||||
self.update_data()
|
||||
|
||||
|
||||
def save_data(self):
|
||||
"""
|
||||
Saves the project data.
|
||||
"""
|
||||
|
||||
try:
|
||||
with open(os.path.join(self.path, "project.json"), "w") as f:
|
||||
json.dump(self.data, f, indent=2)
|
||||
except Exception:
|
||||
with open(os.path.join(self.path, "project.json"), "wb") as f:
|
||||
json.dump(self.data, f)
|
||||
except:
|
||||
self.load_data()
|
||||
|
||||
def update_data(self):
|
||||
data = self.data
|
||||
|
||||
data.setdefault("build_update", False)
|
||||
data.setdefault("packages", [ "pc", "mac" ])
|
||||
data.setdefault("add_from", True)
|
||||
data.setdefault("force_recompile", True)
|
||||
data.setdefault("android_build", "Release")
|
||||
data.setdefault("tutorial", False)
|
||||
|
||||
if "renamed_all" not in data:
|
||||
dp = data["packages"]
|
||||
|
||||
if "all" in dp:
|
||||
dp.remove("all")
|
||||
|
||||
if "pc" not in dp:
|
||||
dp.append("pc")
|
||||
|
||||
if "mac" not in dp:
|
||||
dp.append("mac")
|
||||
|
||||
data["renamed_all"] = True
|
||||
|
||||
if "renamed_steam" not in data:
|
||||
dp = data["packages"]
|
||||
|
||||
if "steam" in dp:
|
||||
dp.remove("steam")
|
||||
|
||||
if "market" not in dp:
|
||||
dp.append("market")
|
||||
|
||||
data["renamed_steam"] = True
|
||||
|
||||
|
||||
def get_renpy_launcher(self):
|
||||
|
||||
if self.renpy_launcher is not None:
|
||||
return self.renpy_launcher
|
||||
|
||||
rv = { }
|
||||
|
||||
default_values = {
|
||||
"open_directory":
|
||||
{
|
||||
"game": "game",
|
||||
"base": ".",
|
||||
"images": "game/images",
|
||||
"audio": "game/audio",
|
||||
"gui": "game/gui",
|
||||
"libs": "game/libs",
|
||||
"mods": "game/mods",
|
||||
},
|
||||
"edit_file":
|
||||
{
|
||||
"script.rpy": "game/script.rpy",
|
||||
"options.rpy": "game/options.rpy",
|
||||
"gui.rpy": "game/gui.rpy",
|
||||
"screens.rpy": "game/screens.rpy"
|
||||
}
|
||||
}
|
||||
|
||||
for k, default_d in default_values.items():
|
||||
d = self.data.get("renpy_launcher", {}).get(k, default_d)
|
||||
rv[k] = { name : path for name, path in d.items() if os.path.exists(os.path.join(self.path, path)) }
|
||||
|
||||
self.renpy_launcher = rv
|
||||
|
||||
return rv
|
||||
|
||||
|
||||
data.setdefault("packages", [ "all" ])
|
||||
|
||||
def make_tmp(self):
|
||||
"""
|
||||
@@ -206,31 +127,16 @@ init python in project:
|
||||
if self.tmp and os.path.isdir(self.tmp):
|
||||
return
|
||||
|
||||
tmp = os.path.join(config.renpy_base, "tmp", self.name)
|
||||
tmp = os.path.join(self.path, "tmp")
|
||||
|
||||
try:
|
||||
os.makedirs(tmp)
|
||||
except Exception:
|
||||
os.mkdir(tmp)
|
||||
except:
|
||||
pass
|
||||
|
||||
if os.path.isdir(tmp):
|
||||
try:
|
||||
|
||||
fn = os.path.join(tmp, "write_test.txt")
|
||||
|
||||
if os.path.exists(fn):
|
||||
os.unlink(fn)
|
||||
|
||||
with open(fn, "w") as f:
|
||||
f.write("Test")
|
||||
|
||||
os.unlink(fn)
|
||||
|
||||
self.tmp = tmp
|
||||
return
|
||||
|
||||
except Exception:
|
||||
pass
|
||||
self.tmp = tmp
|
||||
return
|
||||
|
||||
self.tmp = tempfile.mkdtemp()
|
||||
|
||||
@@ -260,7 +166,7 @@ init python in project:
|
||||
self.make_tmp()
|
||||
|
||||
# Find the python executable to run.
|
||||
executable_path = os.path.dirname(renpy.fsdecode(sys.executable))
|
||||
executable_path = os.path.dirname(sys.executable)
|
||||
|
||||
if renpy.renpy.windows:
|
||||
extension = ".exe"
|
||||
@@ -282,7 +188,7 @@ init python in project:
|
||||
raise Exception("Python interpreter not found: %r", executables)
|
||||
|
||||
# Put together the basic command line.
|
||||
cmd = [ executable, sys.argv[0] ]
|
||||
cmd = [ executable, "-EO", sys.argv[0] ]
|
||||
|
||||
cmd.append(self.path)
|
||||
cmd.extend(args)
|
||||
@@ -297,47 +203,22 @@ init python in project:
|
||||
if persistent.navigate_library:
|
||||
cmd.append("--json-dump-common")
|
||||
|
||||
cmd.append("--errors-in-editor")
|
||||
|
||||
environ = dict(os.environ)
|
||||
environ["RENPY_LAUNCHER_LANGUAGE"] = _preferences.language or "english"
|
||||
|
||||
if persistent.skip_splashscreen:
|
||||
environ["RENPY_SKIP_SPLASHSCREEN"] = "1"
|
||||
|
||||
environ.update(env)
|
||||
|
||||
# Filter out system PYTHON* environment variables.
|
||||
if hasattr(sys, "renpy_executable"):
|
||||
environ = { k : v for k, v in environ.items() if not k.startswith("PYTHON") }
|
||||
|
||||
encoded_environ = { }
|
||||
|
||||
for k, v in environ.items():
|
||||
if v is None:
|
||||
continue
|
||||
|
||||
encoded_environ[renpy.fsencode(k)] = renpy.fsencode(v)
|
||||
for k in environ:
|
||||
environ[k] = renpy.fsencode(environ[k])
|
||||
|
||||
# Launch the project.
|
||||
cmd = [ renpy.fsencode(i) for i in cmd ]
|
||||
|
||||
p = subprocess.Popen(cmd, env=encoded_environ)
|
||||
p = subprocess.Popen(cmd, env=environ)
|
||||
|
||||
if wait:
|
||||
if p.wait():
|
||||
interface.error(_("Launching the project failed."), _("Please ensure that your project launches normally before running this command."))
|
||||
|
||||
print("Launch failed. command={!r}, returncode={!r}".format(cmd, p.returncode))
|
||||
|
||||
if args and not self.is_writeable():
|
||||
interface.error(_("Launching the project failed."), _("This may be because the project is not writeable."))
|
||||
else:
|
||||
interface.error(_("Launching the project failed."), _("Please ensure that your project launches normally before running this command."))
|
||||
|
||||
renpy.not_infinite_loop(30)
|
||||
|
||||
|
||||
def update_dump(self, force=False, gui=True, compile=False):
|
||||
def update_dump(self, force=False, gui=True):
|
||||
"""
|
||||
If the dumpfile does not exist, runs Ren'Py to create it. Otherwise,
|
||||
loads it in iff it's newer than the one that's already loaded.
|
||||
@@ -350,10 +231,7 @@ init python in project:
|
||||
if gui:
|
||||
interface.processing(_("Ren'Py is scanning the project..."))
|
||||
|
||||
if compile:
|
||||
self.launch(["compile", "--keep-orphan-rpyc" ], wait=True)
|
||||
else:
|
||||
self.launch(["quit"], wait=True)
|
||||
self.launch(["quit"], wait=True)
|
||||
|
||||
if not os.path.exists(dump_filename):
|
||||
self.dump["error"] = True
|
||||
@@ -371,7 +249,7 @@ init python in project:
|
||||
# add todo list to dump data
|
||||
self.update_todos()
|
||||
|
||||
except Exception:
|
||||
except:
|
||||
self.dump["error"] = True
|
||||
|
||||
def update_todos(self):
|
||||
@@ -386,14 +264,17 @@ init python in project:
|
||||
|
||||
for f in files:
|
||||
|
||||
data = open(self.unelide_filename(f), encoding="utf-8")
|
||||
data = file(self.unelide_filename(f))
|
||||
|
||||
for l, line in enumerate(data):
|
||||
l += 1
|
||||
|
||||
line = line[:1024]
|
||||
try:
|
||||
line = line.decode("utf-8")
|
||||
except:
|
||||
continue
|
||||
|
||||
m = re.search(r"#\s*TODO(\s*:\s*|\s+)(.*)", line, re.I)
|
||||
m = re.search(ur".*#\s*TODO(\s*:\s*|\s+)(.*)", line, re.I)
|
||||
|
||||
if m is None:
|
||||
continue
|
||||
@@ -415,8 +296,6 @@ init python in project:
|
||||
Unelides the filename relative to the project base.
|
||||
"""
|
||||
|
||||
fn = os.path.normpath(fn)
|
||||
|
||||
fn1 = os.path.join(self.path, fn)
|
||||
if os.path.exists(fn1):
|
||||
return fn1
|
||||
@@ -434,36 +313,11 @@ init python in project:
|
||||
can be included in the project.
|
||||
"""
|
||||
|
||||
def is_script(fn):
|
||||
fn = fn.lower()
|
||||
|
||||
for i in [ ".rpy", ".rpym", "_ren.py" ]:
|
||||
if fn.endswith(i):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
rv = [ ]
|
||||
rv.extend(i for i, isdir in util.walk(self.path)
|
||||
if (not isdir) and is_script(i) and (not i.startswith("tmp/")) )
|
||||
rv.extend(i for i, isdir in util.walk(self.path) if (not isdir) and (i.endswith(".rpy") or i.endswith(".rpym")) )
|
||||
|
||||
return rv
|
||||
|
||||
def exists(self, fn):
|
||||
"""
|
||||
Returns true if the file exists in the game.
|
||||
"""
|
||||
|
||||
return os.path.exists(os.path.join(self.path, fn))
|
||||
|
||||
def is_writeable(self):
|
||||
"""
|
||||
Returns true if it's possible to write a file in the projects
|
||||
directory.
|
||||
"""
|
||||
|
||||
return os.access(self.path, os.W_OK)
|
||||
|
||||
|
||||
class ProjectManager(object):
|
||||
"""
|
||||
@@ -473,46 +327,31 @@ init python in project:
|
||||
|
||||
def __init__(self):
|
||||
|
||||
# The projects directory.
|
||||
self.projects_directory = ""
|
||||
# The projects directory.
|
||||
self.projects_directory = ""
|
||||
|
||||
# Normal projects, in alphabetical order by lowercase name.
|
||||
self.projects = [ ]
|
||||
# Normal projects, in alphabetical order by lowercase name.
|
||||
self.projects = [ ]
|
||||
|
||||
# Template projects.
|
||||
self.templates = [ ]
|
||||
# Template projects.
|
||||
self.templates = [ ]
|
||||
|
||||
# All projects - normal, template, and hidden.
|
||||
self.all_projects = [ ]
|
||||
# All projects - normal, template, and hidden.
|
||||
self.all_projects = [ ]
|
||||
|
||||
# Directories that have been scanned.
|
||||
self.scanned = set()
|
||||
# Directories that have been scanned.
|
||||
self.scanned = set()
|
||||
|
||||
# The tutorial game, and the language it's for.
|
||||
self.tutoral = None
|
||||
self.tutorial_language = "the meowing of a cat"
|
||||
|
||||
self.scan()
|
||||
self.scan()
|
||||
|
||||
def scan(self):
|
||||
"""
|
||||
Scans for projects.
|
||||
"""
|
||||
|
||||
global current
|
||||
|
||||
if persistent.projects_directory is None:
|
||||
if multipersistent.projects_directory is not None:
|
||||
persistent.projects_directory = multipersistent.projects_directory
|
||||
|
||||
if (persistent.projects_directory is not None) and not os.path.isdir(persistent.projects_directory):
|
||||
persistent.projects_directory = None
|
||||
|
||||
if persistent.projects_directory is not None:
|
||||
if multipersistent.projects_directory is None:
|
||||
multipersistent.projects_directory = persistent.projects_directory
|
||||
multipersistent.save()
|
||||
|
||||
self.projects_directory = persistent.projects_directory
|
||||
|
||||
self.projects = [ ]
|
||||
@@ -524,47 +363,11 @@ init python in project:
|
||||
self.scan_directory(self.projects_directory)
|
||||
|
||||
self.scan_directory(config.renpy_base)
|
||||
self.scan_directory(os.path.join(config.renpy_base, "templates"))
|
||||
|
||||
self.projects.sort(key=lambda p : p.name.lower())
|
||||
self.templates.sort(key=lambda p : p.name.lower())
|
||||
|
||||
# Select the default project.
|
||||
if persistent.active_project is not None:
|
||||
p = self.get(persistent.active_project)
|
||||
|
||||
if (p is not None) and (p.name not in [ "tutorial", "tutorial_7" ]):
|
||||
current = p
|
||||
return
|
||||
|
||||
current = self.get_tutorial()
|
||||
|
||||
|
||||
def find_basedir(self, d):
|
||||
"""
|
||||
Try to find a project basedir in d.
|
||||
"""
|
||||
|
||||
def has_game(dn):
|
||||
return os.path.isdir(os.path.join(dn, "game"))
|
||||
|
||||
if has_game(d):
|
||||
return d
|
||||
|
||||
dn = os.path.join(d, "Contents", "Resources", "autorun")
|
||||
if has_game(dn):
|
||||
return dn
|
||||
|
||||
for dn in os.listdir(d):
|
||||
if not dn.endswith(".app"):
|
||||
continue
|
||||
|
||||
dn = os.path.join(d, dn, "Contents", "Resources", "autorun")
|
||||
|
||||
if has_game(dn):
|
||||
return dn
|
||||
|
||||
return None
|
||||
|
||||
def scan_directory(self, d):
|
||||
"""
|
||||
Scans for projects in directories directly underneath `d`.
|
||||
@@ -580,65 +383,48 @@ init python in project:
|
||||
for pdir in util.listdir(d):
|
||||
|
||||
ppath = os.path.join(d, pdir)
|
||||
self.scan_directory_direct(ppath, pdir)
|
||||
|
||||
# If a file called "projects.txt" exists, include any projects listed in it.
|
||||
extra_projects_fn = os.path.join(d, "projects.txt")
|
||||
# A project must be a directory.
|
||||
if not os.path.isdir(ppath):
|
||||
continue
|
||||
|
||||
if os.path.exists(extra_projects_fn):
|
||||
# A project has either a game/ directory, or a project.json
|
||||
# file.
|
||||
if (not os.path.isdir(os.path.join(ppath, "game"))) and (not os.path.exists(os.path.join(ppath, "project.json"))):
|
||||
continue
|
||||
|
||||
with open(extra_projects_fn, "r") as f:
|
||||
if ppath in self.scanned:
|
||||
continue
|
||||
self.scanned.add(ppath)
|
||||
|
||||
for path in f:
|
||||
path = path.strip()
|
||||
# We have a project directory, so create a Project.
|
||||
p = Project(ppath)
|
||||
|
||||
if path.startswith("#"):
|
||||
continue
|
||||
project_type = p.data.get("type", "normal")
|
||||
|
||||
if len(path) > 0:
|
||||
self.scan_directory_direct(path)
|
||||
if project_type == "hidden":
|
||||
pass
|
||||
elif project_type == "template":
|
||||
self.templates.append(p)
|
||||
else:
|
||||
self.projects.append(p)
|
||||
|
||||
self.all_projects.append(p)
|
||||
|
||||
def scan_directory_direct(self, ppath, name=None):
|
||||
"""
|
||||
Checks if there is a project in `ppath` and creates a project
|
||||
object with the name `name` if so.
|
||||
"""
|
||||
# Select the default project.
|
||||
if persistent.active_project is not None:
|
||||
p = self.get(persistent.active_project)
|
||||
|
||||
# A project must be a directory.
|
||||
if not os.path.isdir(ppath):
|
||||
if p is not None:
|
||||
current = p
|
||||
return
|
||||
|
||||
p = self.get("tutorial")
|
||||
if p is not None:
|
||||
current = p
|
||||
return
|
||||
|
||||
try:
|
||||
ppath = self.find_basedir(ppath)
|
||||
except Exception:
|
||||
return
|
||||
|
||||
if ppath is None:
|
||||
return
|
||||
|
||||
if ppath in self.scanned:
|
||||
return
|
||||
|
||||
self.scanned.add(ppath)
|
||||
|
||||
# We have a project directory, so create a Project.
|
||||
p = Project(ppath, name)
|
||||
|
||||
if project_filter and (p.name not in project_filter):
|
||||
return
|
||||
|
||||
project_type = p.data.get("type", "normal")
|
||||
|
||||
if project_type == "hidden":
|
||||
pass
|
||||
elif project_type == "template":
|
||||
self.projects.append(p)
|
||||
self.templates.append(p)
|
||||
else:
|
||||
self.projects.append(p)
|
||||
|
||||
self.all_projects.append(p)
|
||||
current = None
|
||||
|
||||
|
||||
def get(self, name):
|
||||
@@ -654,37 +440,6 @@ init python in project:
|
||||
|
||||
return None
|
||||
|
||||
def get_tutorial(self):
|
||||
|
||||
language = _preferences.language
|
||||
if persistent.force_new_tutorial:
|
||||
language = None
|
||||
|
||||
if language == self.tutorial_language:
|
||||
return self.tutorial
|
||||
|
||||
rv = self.get("oldtutorial")
|
||||
p = self.get("tutorial")
|
||||
|
||||
if p is not None:
|
||||
|
||||
if language is None:
|
||||
rv = p
|
||||
|
||||
elif rv is None:
|
||||
rv = p
|
||||
|
||||
elif os.path.exists(os.path.join(p.path, "game", "tl", _preferences.language)):
|
||||
rv = p
|
||||
|
||||
elif not os.path.exists(os.path.join(rv.path, "game", "tl", _preferences.language)):
|
||||
rv = p
|
||||
|
||||
self.tutorial_language = language
|
||||
self.tutorial = rv
|
||||
|
||||
return rv
|
||||
|
||||
manager = ProjectManager()
|
||||
|
||||
# The current project.
|
||||
@@ -707,7 +462,7 @@ init python in project:
|
||||
The label to jump to when clicked.
|
||||
"""
|
||||
|
||||
if isinstance(p, str):
|
||||
if isinstance(p, basestring):
|
||||
p = manager.get(p)
|
||||
|
||||
self.project = p
|
||||
@@ -736,55 +491,6 @@ init python in project:
|
||||
if self.label is not None:
|
||||
renpy.jump(self.label)
|
||||
|
||||
class SelectTutorial(Action):
|
||||
"""
|
||||
Selects the tutorial.
|
||||
"""
|
||||
|
||||
def __init__(self, if_tutorial=False):
|
||||
"""
|
||||
Only selects if we're already in a tutorial.
|
||||
"""
|
||||
|
||||
self.if_tutorial = if_tutorial
|
||||
|
||||
def __call__(self):
|
||||
|
||||
p = manager.get_tutorial()
|
||||
|
||||
if p is None:
|
||||
return
|
||||
|
||||
global current
|
||||
|
||||
if self.if_tutorial:
|
||||
if (current is not None) and current.name not in [ "tutorial", "oldtutorial" ]:
|
||||
return None
|
||||
|
||||
current = p
|
||||
persistent.active_project = p.name
|
||||
|
||||
renpy.restart_interaction()
|
||||
|
||||
def get_sensitive(self):
|
||||
if self.if_tutorial:
|
||||
return True
|
||||
|
||||
return (manager.get_tutorial() is not None)
|
||||
|
||||
def get_selected(self):
|
||||
if self.if_tutorial:
|
||||
return False
|
||||
|
||||
p = manager.get_tutorial()
|
||||
|
||||
if p is None:
|
||||
return False
|
||||
|
||||
if current is None:
|
||||
return False
|
||||
|
||||
return current.path == p.path
|
||||
|
||||
class Launch(Action):
|
||||
"""
|
||||
@@ -795,7 +501,7 @@ init python in project:
|
||||
def __init__(self, p=None):
|
||||
if p is None:
|
||||
self.project = current
|
||||
elif isinstance(p, str):
|
||||
elif isinstance(p, basestring):
|
||||
self.project = manager.get(p)
|
||||
else:
|
||||
self.project = p
|
||||
@@ -807,12 +513,7 @@ init python in project:
|
||||
blurb = LAUNCH_BLURBS[persistent.blurb % len(LAUNCH_BLURBS)]
|
||||
persistent.blurb += 1
|
||||
|
||||
if persistent.skip_splashscreen:
|
||||
submessage = _("Splashscreen skipped in launcher preferences.")
|
||||
else:
|
||||
submessage = None
|
||||
|
||||
interface.interaction(_("Launching"), blurb, submessage=submessage, pause=2.5)
|
||||
interface.interaction(_("Launching"), blurb, pause=2.5)
|
||||
|
||||
|
||||
def __call__(self):
|
||||
@@ -834,19 +535,6 @@ init python in project:
|
||||
if isinstance(persistent.projects_directory, str):
|
||||
persistent.projects_directory = renpy.fsdecode(persistent.projects_directory)
|
||||
|
||||
init 10 python:
|
||||
if persistent.projects_directory is not None:
|
||||
if not directory_is_writable(persistent.projects_directory):
|
||||
persistent.projects_directory = None
|
||||
|
||||
label after_load:
|
||||
python:
|
||||
if project.current is not None:
|
||||
project.current.update_dump()
|
||||
|
||||
return
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Code to choose the projects directory.
|
||||
|
||||
@@ -856,64 +544,63 @@ label choose_projects_directory:
|
||||
|
||||
interface.interaction(_("PROJECTS DIRECTORY"), _("Please choose the projects directory using the directory chooser.\n{b}The directory chooser may have opened behind this window.{/b}"), _("This launcher will scan for projects in this directory, will create new projects in this directory, and will place built projects into this directory."),)
|
||||
|
||||
path, is_default = choose_directory(persistent.projects_directory)
|
||||
path = persistent.projects_directory
|
||||
|
||||
if is_default:
|
||||
if path:
|
||||
default_path = path
|
||||
else:
|
||||
try:
|
||||
default_path = os.path.dirname(os.path.abspath(config.renpy_base))
|
||||
except:
|
||||
default_path = os.path.abspath(config.renpy_base)
|
||||
|
||||
|
||||
if EasyDialogs:
|
||||
|
||||
choice = EasyDialogs.AskFolder(defaultLocation=default_path, wanted=unicode)
|
||||
|
||||
if choice is not None:
|
||||
path = choice
|
||||
else:
|
||||
path = None
|
||||
|
||||
else:
|
||||
|
||||
try:
|
||||
|
||||
cmd = [ "/usr/bin/python", os.path.join(config.gamedir, "tkaskdir.py"), renpy.fsencode(default_path) ]
|
||||
|
||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
choice = p.stdout.read()
|
||||
code = p.wait()
|
||||
|
||||
except:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
code = 0
|
||||
choice = ""
|
||||
path = None
|
||||
|
||||
interface.error(_("Ren'Py was unable to run python with tkinter to choose the projects directory. Please install the python-tk or tkinter package."), label=None)
|
||||
|
||||
if code:
|
||||
interface.error(_("Ren'Py was unable to run python with tkinter to choose the projects directory. Please install the python-tk or tkinter package."), label=None)
|
||||
|
||||
elif choice:
|
||||
path = renpy.fsdecode(choice)
|
||||
|
||||
if path is None:
|
||||
path = default_path
|
||||
interface.info(_("Ren'Py has set the projects directory to:"), "[path!q]", path=path)
|
||||
|
||||
persistent.projects_directory = path
|
||||
project.multipersistent.projects_directory = path
|
||||
project.multipersistent.save()
|
||||
path = renpy.fsdecode(path)
|
||||
|
||||
if os.path.isdir(path):
|
||||
persistent.projects_directory = path
|
||||
else:
|
||||
path = os.path.abspath(config.renpy_base)
|
||||
|
||||
project.manager.scan()
|
||||
|
||||
return
|
||||
|
||||
init python:
|
||||
|
||||
def set_projects_directory_command():
|
||||
ap = renpy.arguments.ArgumentParser()
|
||||
ap.add_argument("projects", help="The path to the projects directory.")
|
||||
|
||||
args = ap.parse_args()
|
||||
|
||||
persistent.projects_directory = renpy.fsdecode(args.projects)
|
||||
project.multipersistent.projects_directory = persistent.projects_directory
|
||||
project.multipersistent.save()
|
||||
renpy.save_persistent()
|
||||
|
||||
return False
|
||||
|
||||
renpy.arguments.register_command("set_projects_directory", set_projects_directory_command)
|
||||
|
||||
def get_projects_directory_command():
|
||||
ap = renpy.arguments.ArgumentParser()
|
||||
args = ap.parse_args()
|
||||
|
||||
if persistent.projects_directory is not None:
|
||||
print(persistent.projects_directory)
|
||||
|
||||
return False
|
||||
|
||||
renpy.arguments.register_command("get_projects_directory", get_projects_directory_command)
|
||||
|
||||
def set_project_command():
|
||||
ap = renpy.arguments.ArgumentParser()
|
||||
ap.add_argument("project", help="The full path to the project to select.")
|
||||
|
||||
args = ap.parse_args()
|
||||
|
||||
projects = os.path.dirname(os.path.abspath(args.project))
|
||||
name = os.path.basename(args.project)
|
||||
|
||||
persistent.projects_directory = renpy.fsdecode(projects)
|
||||
project.multipersistent.projects_directory = persistent.projects_directory
|
||||
|
||||
persistent.active_project = name
|
||||
|
||||
project.multipersistent.save()
|
||||
renpy.save_persistent()
|
||||
|
||||
return False
|
||||
|
||||
renpy.arguments.register_command("set_project", set_project_command)
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
-----BEGIN PUBLIC KEY-----
|
||||
MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAEmkuXOrZ2viRe4fRCrlqUFGdgRqy9IcWt
|
||||
5lJvsUqRN619pWZIefz/bau9Sd8vcJt6VKwexOeBmMhzXwZ/1Lm3OQ==
|
||||
-----END PUBLIC KEY-----
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -19,66 +19,8 @@
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
# Defaults for custom theme properties.
|
||||
init -99 python:
|
||||
# The color of non-interactive text.
|
||||
custom_text = "#545454"
|
||||
|
||||
# Colors for buttons in various states.
|
||||
custom_idle = "#42637b"
|
||||
custom_hover = "#d86b45"
|
||||
custom_disable = "#808080"
|
||||
|
||||
# Colors for reversed text buttons (selected list entries).
|
||||
custom_reverse_idle = "#78a5c5"
|
||||
reverse_hover = "#d86b45"
|
||||
custom_reverse_text = "#ffffff"
|
||||
|
||||
# Colors for the scrollbar thumb.
|
||||
custom_scrollbar_idle = "#dfdfdf"
|
||||
custom_scrollbar_hover = "#d86b45"
|
||||
# An image used as a separator pattern.
|
||||
custom_pattern = "images/pattern.png"
|
||||
|
||||
# A displayable used for the background of everything.
|
||||
custom_background = "images/background.png"
|
||||
|
||||
# A displayable used for the background of the projects list.
|
||||
custom_projects_window = Null()
|
||||
|
||||
# A displayable used the background of information boxes.
|
||||
custom_info_window = "#f9f9f9c0"
|
||||
|
||||
# Colors for the titles of information boxes.
|
||||
custom_error_color = "#d15353"
|
||||
custom_info_color = "#545454"
|
||||
custom_interaction_color = "#d19753"
|
||||
custom_question_color = "#d19753"
|
||||
|
||||
# The color of input text.
|
||||
custom_input_color = "#d86b45"
|
||||
|
||||
# A displayable used for the background of windows
|
||||
# containing commands, preferences, and navigation info.
|
||||
custom_window = Frame(Fixed(Solid(custom_reverse_idle, xsize=4, xalign=0), Solid(custom_info_window, xsize=794, xalign=1.0), xsize=800, ysize=600), 0, 0, tile=True)
|
||||
|
||||
|
||||
init -1:
|
||||
|
||||
# Fonts.
|
||||
define gui.LIGHT_FONT = "fonts/Roboto-Light.ttf"
|
||||
define gui.REGULAR_FONT = "fonts/Roboto-Regular.ttf"
|
||||
|
||||
# Used to scale the size of fonts.
|
||||
define gui.FONT_SCALE = 1.0
|
||||
|
||||
# Should places where the regular font used be bolded?
|
||||
define gui.REGULAR_BOLD = False
|
||||
|
||||
init -1 python:
|
||||
|
||||
config.defer_styles = True
|
||||
|
||||
# The color of non-interactive text.
|
||||
TEXT = "#545454"
|
||||
|
||||
@@ -100,11 +42,11 @@ init -1 python:
|
||||
PATTERN = "images/pattern.png"
|
||||
|
||||
# A displayable used for the background of everything.
|
||||
BACKGROUND = "background"
|
||||
BACKGROUND = "images/background.png"
|
||||
|
||||
# A displayable used for the background of windows
|
||||
# containing commands, preferences, and navigation info.
|
||||
WINDOW = Frame("window", 0, 0, tile=True)
|
||||
WINDOW = Frame("images/window.png", 0, 0, tile=True)
|
||||
|
||||
# A displayable used for the background of the projects list.
|
||||
PROJECTS_WINDOW = Null()
|
||||
@@ -121,167 +63,13 @@ init -1 python:
|
||||
# The color of input text.
|
||||
INPUT_COLOR = "#d86b45"
|
||||
|
||||
if persistent.theme == 'dark':
|
||||
# The color of non-interactive text.
|
||||
TEXT = "#ababab"
|
||||
|
||||
# Colors for buttons in various states.
|
||||
IDLE = "#709cbe"
|
||||
HOVER = "#d86b45"
|
||||
DISABLED = "#7f7f7f"
|
||||
|
||||
# Colors for reversed text buttons (selected list entries).
|
||||
REVERSE_IDLE = "#78a5c5"
|
||||
REVERSE_HOVER = "#d86b45"
|
||||
REVERSE_TEXT = "#0a0a0a"
|
||||
|
||||
# Colors for the scrollbar thumb.
|
||||
SCROLLBAR_IDLE = "#282828"
|
||||
SCROLLBAR_HOVER = "#d86b45"
|
||||
|
||||
# An image used as a separator pattern.
|
||||
PATTERN = "images/pattern.png"
|
||||
|
||||
# A displayable used for the background of everything.
|
||||
BACKGROUND = Fixed(Solid(REVERSE_TEXT), xsize=800, ysize=600)
|
||||
|
||||
# A displayable used for the background of the projects list.
|
||||
PROJECTS_WINDOW = Null()
|
||||
|
||||
# A displayable used the background of information boxes.
|
||||
INFO_WINDOW = "#101010"
|
||||
|
||||
# Colors for the titles of information boxes.
|
||||
ERROR_COLOR = "#d15353"
|
||||
INFO_COLOR = "#ababab"
|
||||
INTERACTION_COLOR = "#d19753"
|
||||
QUESTION_COLOR = "#d19753"
|
||||
|
||||
# The color of input text.
|
||||
INPUT_COLOR = "#d86b45"
|
||||
|
||||
# A displayable used for the background of windows
|
||||
# containing commands, preferences, and navigation info.
|
||||
WINDOW = Frame(Fixed(Solid(REVERSE_IDLE, xsize=4, xalign=0), Solid(INFO_WINDOW, xsize=794, xalign=1.0), xsize=800, ysize=600), 0, 0, tile=True)
|
||||
|
||||
elif persistent.theme == 'clear':
|
||||
|
||||
# The color of non-interactive text.
|
||||
TEXT = "#545454"
|
||||
|
||||
# Colors for buttons in various states.
|
||||
IDLE = "#42637b"
|
||||
HOVER = "#d86b45"
|
||||
DISABLED = "#808080"
|
||||
|
||||
# Colors for reversed text buttons (selected list entries).
|
||||
REVERSE_IDLE = "#78a5c5"
|
||||
REVERSE_HOVER = "#d86b45"
|
||||
REVERSE_TEXT = "#ffffff"
|
||||
|
||||
# Colors for the scrollbar thumb.
|
||||
SCROLLBAR_IDLE = "#dfdfdf"
|
||||
SCROLLBAR_HOVER = "#d86b45"
|
||||
|
||||
# An image used as a separator pattern.
|
||||
PATTERN = "images/pattern.png"
|
||||
|
||||
# A displayable used for the background of everything.
|
||||
BACKGROUND = Fixed(Solid(REVERSE_TEXT), xsize=800, ysize=600)
|
||||
|
||||
# A displayable used for the background of the projects list.
|
||||
PROJECTS_WINDOW = Null()
|
||||
|
||||
# A displayable used the background of information boxes.
|
||||
INFO_WINDOW = "#f9f9f9"
|
||||
|
||||
# Colors for the titles of information boxes.
|
||||
ERROR_COLOR = "#d15353"
|
||||
INFO_COLOR = "#545454"
|
||||
INTERACTION_COLOR = "#d19753"
|
||||
QUESTION_COLOR = "#d19753"
|
||||
|
||||
# The color of input text.
|
||||
INPUT_COLOR = "#d86b45"
|
||||
|
||||
# A displayable used for the background of windows
|
||||
# containing commands, preferences, and navigation info.
|
||||
WINDOW = Frame(Fixed(Solid(REVERSE_IDLE, xsize=4, xalign=0), Solid(INFO_WINDOW, xsize=794, xalign=1.0), xsize=800, ysize=600), 0, 0, tile=True)
|
||||
|
||||
elif persistent.theme == 'custom':
|
||||
|
||||
# The color of non-interactive text.
|
||||
TEXT = custom_text
|
||||
|
||||
# Colors for buttons in various states.
|
||||
IDLE = custom_idle
|
||||
HOVER = custom_hover
|
||||
DISABLED = custom_disable
|
||||
|
||||
# Colors for reversed text buttons (selected list entries).
|
||||
REVERSE_IDLE = custom_reverse_idle
|
||||
REVERSE_HOVER = reverse_hover
|
||||
REVERSE_TEXT = custom_reverse_text
|
||||
|
||||
# Colors for the scrollbar thumb.
|
||||
SCROLLBAR_IDLE = custom_scrollbar_idle
|
||||
SCROLLBAR_HOVER = custom_scrollbar_hover
|
||||
|
||||
# An image used as a separator pattern.
|
||||
PATTERN = custom_pattern
|
||||
|
||||
# A displayable used for the background of everything.
|
||||
BACKGROUND = custom_background
|
||||
|
||||
# A displayable used for the background of the projects list.
|
||||
PROJECTS_WINDOW = custom_projects_window
|
||||
|
||||
# A displayable used the background of information boxes.
|
||||
INFO_WINDOW = custom_info_window
|
||||
|
||||
# Colors for the titles of information boxes.
|
||||
ERROR_COLOR = custom_error_color
|
||||
INFO_COLOR = custom_info_color
|
||||
INTERACTION_COLOR = custom_interaction_color
|
||||
QUESTION_COLOR = custom_question_color
|
||||
|
||||
# The color of input text.
|
||||
INPUT_COLOR = custom_input_color
|
||||
|
||||
# A displayable used for the background of windows
|
||||
# containing commands, preferences, and navigation info.
|
||||
WINDOW = custom_window
|
||||
|
||||
|
||||
# FONTS/WEIGHTS
|
||||
LIGHT = "Roboto-Light.ttf"
|
||||
REGULAR = "Roboto-Regular.ttf"
|
||||
DARK = "Roboto-Medium.ttf"
|
||||
|
||||
init 1 python:
|
||||
|
||||
if not renpy.has_image('scrollbar_center'):
|
||||
renpy.image('scrollbar_center', Fixed(Solid(REVERSE_TEXT, area=(2, 2, 2, 4)), Solid(REVERSE_TEXT, area=(8, 2, 2, 4)), Solid(REVERSE_TEXT, area=(14, 2, 2, 4)), xysize=(18, 8)))
|
||||
if not renpy.has_image('vscrollbar_center'):
|
||||
renpy.image('vscrollbar_center', Fixed(Solid(REVERSE_TEXT, area=(2, 2, 4, 2)), Solid(REVERSE_TEXT, area=(2, 8, 4, 2)), Solid(REVERSE_TEXT, area=(2, 14, 4, 2)), xysize=(8, 18)))
|
||||
|
||||
def size(n):
|
||||
"""
|
||||
Adjusts the font size if we're in large-print mode.
|
||||
"""
|
||||
|
||||
if persistent.large_print and n < 18:
|
||||
n = 18
|
||||
|
||||
n = int(n * gui.FONT_SCALE)
|
||||
|
||||
return n
|
||||
|
||||
def light_font():
|
||||
if persistent.large_print:
|
||||
return gui.REGULAR_FONT
|
||||
|
||||
return gui.LIGHT_FONT
|
||||
|
||||
def regular_font():
|
||||
return gui.REGULAR_FONT
|
||||
|
||||
INDENT = 20
|
||||
HALF_INDENT = 10
|
||||
|
||||
@@ -290,10 +78,10 @@ init 1 python:
|
||||
SEPARATOR = Frame(PATTERN, 0, 0, tile=True, ymaximum=5, yalign=1.0)
|
||||
SEPARATOR2 = Frame(PATTERN, 0, 0, tile=True, ymaximum=10, yalign=1.0)
|
||||
|
||||
SPACER_HEIGHT = 8
|
||||
SPACER_HEIGHT = 12
|
||||
SPACER = Null(height=SPACER_HEIGHT)
|
||||
|
||||
HALF_SPACER_HEIGHT = 4
|
||||
HALF_SPACER_HEIGHT = 6
|
||||
HALF_SPACER = Null(height=HALF_SPACER_HEIGHT)
|
||||
|
||||
# DIVIDING THE SCREEN
|
||||
@@ -302,249 +90,241 @@ init 1 python:
|
||||
ONEHALF = 377
|
||||
|
||||
def checkbox(full, color):
|
||||
if renpy.has_image('checkbox_full'):
|
||||
check = im.Twocolor(''.join(["images/checkbox_", "full" if full else "empty", ".png"]), color, color)
|
||||
if full:
|
||||
return im.Twocolor("images/checkbox_full.png", color, color, yalign=0.5)
|
||||
else:
|
||||
check = Fixed(Solid(color, xsize=1, xalign=.0), Solid(color, xsize=1, xalign=1.0), Solid(color, ysize=1, yalign=.0), Solid(color, ysize=1, yalign=1.0), xsize=10, ysize=10)
|
||||
if full:
|
||||
check = Fixed(check, Solid(color, xsize=6, ysize=6, align=(.5, .5)), xsize=10, ysize=10)
|
||||
return At(check, l_checkbox_box)
|
||||
return im.Twocolor("images/checkbox_empty.png", color, color, yalign=0.5)
|
||||
|
||||
init 1:
|
||||
|
||||
# The default style.
|
||||
style l_default is default:
|
||||
font LIGHT
|
||||
color TEXT
|
||||
idle_color IDLE
|
||||
hover_color HOVER
|
||||
size 18
|
||||
|
||||
style l_text is l_default
|
||||
|
||||
style l_button is l_default
|
||||
style l_button_text is l_default:
|
||||
insensitive_color DISABLED
|
||||
selected_font REGULAR
|
||||
|
||||
# A small button, used at the bottom of the screen.
|
||||
style l_link is l_default
|
||||
style l_link_text is l_default:
|
||||
size 14
|
||||
font LIGHT
|
||||
|
||||
# Action buttons on the bottom of the screen.
|
||||
style l_right_button is l_default:
|
||||
xalign 1.0
|
||||
ypos 600 - 128 + 12
|
||||
left_margin 8 + INDENT
|
||||
right_margin 10 + INDENT
|
||||
|
||||
style l_right_button_text is l_default:
|
||||
size 30
|
||||
|
||||
style l_left_button is l_right_button:
|
||||
xalign 0.0
|
||||
|
||||
style l_left_button_text is l_right_button_text
|
||||
|
||||
|
||||
# The root frame. This contains everything but the bottom navigation,
|
||||
# and buttons.
|
||||
style l_root is l_default:
|
||||
background BACKGROUND
|
||||
xpadding 10
|
||||
top_padding 64
|
||||
bottom_padding 128
|
||||
|
||||
# The default style.
|
||||
style l_default is default:
|
||||
font light_font()
|
||||
color TEXT
|
||||
idle_color IDLE
|
||||
hover_color HOVER
|
||||
size size(18)
|
||||
# An inner window.
|
||||
style l_window is l_default:
|
||||
background WINDOW
|
||||
left_padding 6
|
||||
xfill True
|
||||
yfill True
|
||||
|
||||
style l_text is l_default
|
||||
# Normal size labels.
|
||||
style l_label is l_default:
|
||||
xfill True
|
||||
top_padding 10
|
||||
bottom_padding 8
|
||||
bottom_margin 12
|
||||
background SEPARATOR
|
||||
|
||||
style l_button is l_default
|
||||
style l_button_text is l_default:
|
||||
insensitive_color DISABLED
|
||||
selected_font regular_font()
|
||||
selected_bold gui.REGULAR_BOLD
|
||||
style l_label_text is l_default:
|
||||
size 24
|
||||
xpos INDENT
|
||||
yoffset 6
|
||||
|
||||
# A small button, used at the bottom of the screen.
|
||||
style l_link is l_default
|
||||
style l_link_text is l_default:
|
||||
size size(14)
|
||||
font light_font()
|
||||
style l_label_small is l_default:
|
||||
xfill True
|
||||
bottom_padding 8
|
||||
bottom_margin HALF_SPACER_HEIGHT
|
||||
background SEPARATOR
|
||||
|
||||
# Action buttons on the bottom of the screen.
|
||||
style l_right_button is l_default:
|
||||
xalign 1.0
|
||||
ypos 600 - 128 + 12
|
||||
left_margin 8 + INDENT
|
||||
right_margin 10 + INDENT
|
||||
# Small labels.
|
||||
style l_label_small_text is l_default:
|
||||
xpos INDENT
|
||||
yoffset 6
|
||||
size 20
|
||||
|
||||
style l_right_button_text is l_default:
|
||||
size size(30)
|
||||
# Alternate labels. This nests inside an l_label, and gives a button
|
||||
# or label that's nested inside another label.
|
||||
|
||||
style l_left_button is l_right_button:
|
||||
xalign 0.0
|
||||
style l_alternate is l_default:
|
||||
xalign 1.0
|
||||
yalign 1.0
|
||||
yoffset 4
|
||||
right_margin INDENT
|
||||
|
||||
style l_left_button_text is l_right_button_text
|
||||
style l_alternate_text is l_default:
|
||||
size 14
|
||||
font LIGHT
|
||||
text_align 1.0
|
||||
|
||||
style l_small_button is l_button
|
||||
|
||||
# The root frame. This contains everything but the bottom navigation,
|
||||
# and buttons.
|
||||
style l_root is l_default:
|
||||
background BACKGROUND
|
||||
xpadding 10
|
||||
top_padding 32
|
||||
bottom_padding 120
|
||||
style l_small_button_text is l_button_text:
|
||||
size 14
|
||||
|
||||
# An inner window.
|
||||
style l_window is l_default:
|
||||
background WINDOW
|
||||
left_padding 6
|
||||
xfill True
|
||||
yfill True
|
||||
style l_small_text is l_text:
|
||||
size 14
|
||||
|
||||
# Normal size labels.
|
||||
style l_label is l_default:
|
||||
xfill True
|
||||
top_padding 10
|
||||
bottom_padding 8
|
||||
bottom_margin 12
|
||||
background SEPARATOR
|
||||
# Indents its contents.
|
||||
style l_indent is l_default:
|
||||
left_margin INDENT
|
||||
|
||||
style l_label_text is l_default:
|
||||
size size(24)
|
||||
xpos INDENT
|
||||
yoffset 6
|
||||
# Indents its contents and pads vertically.
|
||||
style l_indent_margin is l_indent:
|
||||
ymargin 6
|
||||
|
||||
style l_label_small is l_default:
|
||||
xfill True
|
||||
bottom_padding 8
|
||||
bottom_margin HALF_SPACER_HEIGHT
|
||||
background SEPARATOR
|
||||
# Lists.
|
||||
style l_list is l_default:
|
||||
left_padding HALF_INDENT
|
||||
xfill True
|
||||
selected_background REVERSE_IDLE
|
||||
selected_hover_background REVERSE_HOVER
|
||||
|
||||
# Small labels.
|
||||
style l_label_small_text is l_default:
|
||||
xpos INDENT
|
||||
yoffset 6
|
||||
size size(20)
|
||||
style l_list_text is l_default:
|
||||
idle_color IDLE
|
||||
hover_color HOVER
|
||||
selected_idle_color REVERSE_TEXT
|
||||
selected_hover_color REVERSE_TEXT
|
||||
insensitive_color DISABLED
|
||||
|
||||
# Alternate labels. This nests inside an l_label, and gives a button
|
||||
# or label that's nested inside another label.
|
||||
style l_list2 is l_list:
|
||||
left_padding (HALF_INDENT + INDENT)
|
||||
|
||||
style l_alternate is l_default:
|
||||
xalign 1.0
|
||||
yalign 1.0
|
||||
yoffset 4
|
||||
right_margin INDENT
|
||||
style l_list2_text is l_list_text
|
||||
|
||||
style l_alternate_text is l_default:
|
||||
size size(14)
|
||||
font light_font()
|
||||
textalign 1.0
|
||||
# Scrollbar.
|
||||
style l_vscrollbar is l_default:
|
||||
thumb Fixed(
|
||||
Solid(SCROLLBAR_IDLE, xmaximum=8, xalign=0.5),
|
||||
Image("images/vscrollbar_center.png", xalign=0.5, yalign=0.5),
|
||||
xmaximum = SCROLLBAR_SIZE)
|
||||
hover_thumb Fixed(
|
||||
Solid(SCROLLBAR_HOVER, xmaximum=8, xalign=0.5),
|
||||
Image("images/vscrollbar_center.png", xalign=0.5, yalign=0.5),
|
||||
xmaximum = SCROLLBAR_SIZE)
|
||||
xmaximum SCROLLBAR_SIZE
|
||||
bar_vertical True
|
||||
bar_invert True
|
||||
unscrollable "hide"
|
||||
|
||||
style l_small_button is l_button
|
||||
# Information window.
|
||||
style l_info_vbox is vbox:
|
||||
yalign 0.5
|
||||
xalign 0.5
|
||||
xfill True
|
||||
|
||||
style l_small_button_text is l_button_text:
|
||||
size size(14)
|
||||
style l_info_frame is l_default:
|
||||
ypadding 21
|
||||
xfill True
|
||||
background Fixed(
|
||||
INFO_WINDOW,
|
||||
Frame(PATTERN, 0, 0, tile=True, ymaximum=5, yalign=0.0, yoffset=8),
|
||||
Frame(PATTERN, 0, 0, tile=True, ymaximum=5, yalign=1.0, yoffset=-8),
|
||||
)
|
||||
yminimum 180
|
||||
ypos 75
|
||||
|
||||
style l_small_text is l_text:
|
||||
size size(14)
|
||||
style l_info_label is l_default:
|
||||
xalign 0.5
|
||||
ypos 75
|
||||
yanchor 1.0
|
||||
yoffset 12
|
||||
|
||||
# Indents its contents.
|
||||
style l_indent is l_default:
|
||||
left_margin INDENT
|
||||
style l_info_label_text is l_default:
|
||||
size 36
|
||||
|
||||
# Indents its contents and pads vertically.
|
||||
style l_indent_margin is l_indent:
|
||||
ymargin 6
|
||||
style l_info_text is l_default:
|
||||
xalign 0.5
|
||||
|
||||
# Lists.
|
||||
style l_list is l_default:
|
||||
left_padding HALF_INDENT
|
||||
xfill True
|
||||
selected_background REVERSE_IDLE
|
||||
selected_hover_background REVERSE_HOVER
|
||||
style l_info_button is l_button:
|
||||
xalign 0.5
|
||||
xmargin 50
|
||||
|
||||
style l_list_text is l_default:
|
||||
idle_color IDLE
|
||||
hover_color HOVER
|
||||
selected_idle_color REVERSE_TEXT
|
||||
selected_hover_color REVERSE_TEXT
|
||||
insensitive_color DISABLED
|
||||
style l_info_button_text is l_button_text:
|
||||
text_align 0.5
|
||||
layout "subtitle"
|
||||
|
||||
style l_list2 is l_list:
|
||||
left_padding (HALF_INDENT + INDENT)
|
||||
# Progress bar.
|
||||
style l_progress_frame is l_default:
|
||||
background Frame(PATTERN, 0, 0, tile=True)
|
||||
ypadding 5
|
||||
|
||||
style l_list2_text is l_list_text
|
||||
style l_progress_bar is l_default:
|
||||
left_bar REVERSE_IDLE
|
||||
right_bar Null()
|
||||
ymaximum 24
|
||||
|
||||
# Scrollbar.
|
||||
style l_vscrollbar is l_default:
|
||||
thumb Fixed(
|
||||
Solid(SCROLLBAR_IDLE, xmaximum=8, xalign=0.5),
|
||||
Transform('vscrollbar_center', xalign=0.5, yalign=0.5),
|
||||
xmaximum = SCROLLBAR_SIZE)
|
||||
hover_thumb Fixed(
|
||||
Solid(SCROLLBAR_HOVER, xmaximum=8, xalign=0.5),
|
||||
Transform('vscrollbar_center', xalign=0.5, yalign=0.5),
|
||||
xmaximum = SCROLLBAR_SIZE)
|
||||
xmaximum SCROLLBAR_SIZE
|
||||
bar_vertical True
|
||||
bar_invert True
|
||||
unscrollable "hide"
|
||||
# Navigation.
|
||||
style l_navigation_button is l_button:
|
||||
size_group "navigation"
|
||||
right_margin INDENT
|
||||
top_margin 3
|
||||
|
||||
# Information window.
|
||||
style l_info_vbox is vbox:
|
||||
yalign 0.5
|
||||
xalign 0.5
|
||||
xfill True
|
||||
style l_navigation_button_text is l_button_text:
|
||||
size 14
|
||||
font REGULAR
|
||||
|
||||
style l_info_frame is l_default:
|
||||
ypadding 21
|
||||
xfill True
|
||||
background Fixed(
|
||||
INFO_WINDOW,
|
||||
Frame(PATTERN, 0, 0, tile=True, ymaximum=5, yalign=0.0, yoffset=8),
|
||||
Frame(PATTERN, 0, 0, tile=True, ymaximum=5, yalign=1.0, yoffset=-8),
|
||||
)
|
||||
yminimum 180
|
||||
ypos 75
|
||||
style l_navigation_text is l_text:
|
||||
size 12
|
||||
font LIGHT
|
||||
color TEXT
|
||||
|
||||
style l_info_label is l_default:
|
||||
xalign 0.5
|
||||
ypos 75
|
||||
yanchor 1.0
|
||||
yoffset 12
|
||||
# Checkboxes.
|
||||
style l_checkbox is l_button:
|
||||
left_padding INDENT
|
||||
background checkbox(False, IDLE)
|
||||
hover_background checkbox(False, HOVER)
|
||||
selected_idle_background checkbox(True, IDLE)
|
||||
selected_hover_background checkbox(True, HOVER)
|
||||
insensitive_background checkbox(False, DISABLED)
|
||||
|
||||
style l_info_label_text is l_default:
|
||||
size size(36)
|
||||
style l_checkbox_text is l_button_text:
|
||||
selected_font LIGHT
|
||||
|
||||
style l_info_text is l_default:
|
||||
xalign 0.5
|
||||
# Lines up with a checkbox.
|
||||
style l_nonbox is l_button:
|
||||
xpadding INDENT
|
||||
|
||||
style l_info_button is l_button:
|
||||
xalign 0.5
|
||||
xmargin 50
|
||||
style l_nonbox_text is l_button_text:
|
||||
selected_font LIGHT
|
||||
|
||||
style l_info_button_text is l_button_text:
|
||||
textalign 0.5
|
||||
layout "subtitle"
|
||||
# Projects list.
|
||||
style l_projects is l_default:
|
||||
background PROJECTS_WINDOW
|
||||
|
||||
# Progress bar.
|
||||
style l_progress_frame is l_default:
|
||||
background Frame(PATTERN, 0, 0, tile=True)
|
||||
ypadding 5
|
||||
|
||||
style l_progress_bar is l_default:
|
||||
left_bar REVERSE_IDLE
|
||||
right_bar Null()
|
||||
ymaximum 24
|
||||
|
||||
# Navigation.
|
||||
style l_navigation_button is l_button:
|
||||
size_group "navigation"
|
||||
right_margin INDENT
|
||||
top_margin 3
|
||||
|
||||
style l_navigation_button_text is l_button_text:
|
||||
size size(14)
|
||||
font regular_font()
|
||||
|
||||
style l_navigation_text is l_text:
|
||||
size size(14)
|
||||
font light_font()
|
||||
color TEXT
|
||||
|
||||
# Checkboxes.
|
||||
style l_checkbox is l_button:
|
||||
left_padding INDENT
|
||||
background checkbox(False, IDLE)
|
||||
hover_background checkbox(False, HOVER)
|
||||
selected_idle_background checkbox(True, IDLE)
|
||||
selected_hover_background checkbox(True, HOVER)
|
||||
insensitive_background checkbox(False, DISABLED)
|
||||
|
||||
transform l_checkbox_box:
|
||||
ycenter 11
|
||||
|
||||
style l_checkbox_text is l_button_text:
|
||||
selected_font light_font()
|
||||
selected_bold False
|
||||
|
||||
# Lines up with a checkbox.
|
||||
style l_nonbox is l_button:
|
||||
xpadding INDENT
|
||||
|
||||
style l_nonbox_text is l_button_text:
|
||||
selected_font light_font()
|
||||
|
||||
# Projects list.
|
||||
style l_projects is l_default:
|
||||
background PROJECTS_WINDOW
|
||||
|
||||
style hyperlink_text:
|
||||
size size(18)
|
||||
font light_font()
|
||||
color IDLE
|
||||
hover_color HOVER
|
||||
style hyperlink_text:
|
||||
size 18
|
||||
font LIGHT
|
||||
color IDLE
|
||||
hover_color HOVER
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
init python:
|
||||
|
||||
|
||||
class FileTail(object):
|
||||
|
||||
def __init__(self, filename, lines=8):
|
||||
@@ -32,18 +31,13 @@ init python:
|
||||
|
||||
def update(self):
|
||||
|
||||
def filter_text(s):
|
||||
if "Unknown chunk type '200'" in s:
|
||||
return False
|
||||
return True
|
||||
|
||||
try:
|
||||
with open(self.filename) as f:
|
||||
text = f.read()
|
||||
|
||||
try:
|
||||
text = renpy.fsdecode(text)
|
||||
except Exception:
|
||||
except:
|
||||
text = text.decode("latin-1")
|
||||
|
||||
text = text.strip()
|
||||
@@ -55,9 +49,6 @@ init python:
|
||||
if "\r" in l:
|
||||
_head, _sep, l = l.rpartition("\r")
|
||||
|
||||
if not filter_text(l):
|
||||
continue
|
||||
|
||||
while l:
|
||||
newtext.append(l[:100])
|
||||
l = l[100:]
|
||||
@@ -70,5 +61,8 @@ init python:
|
||||
self.text = text
|
||||
renpy.restart_interaction()
|
||||
|
||||
except Exception:
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
init python:
|
||||
TEST_PROJECTS = u"/tmp/renpy-moé"
|
||||
import shutil
|
||||
|
||||
|
||||
testcase default:
|
||||
|
||||
call new_project
|
||||
call translate_project
|
||||
call extract_dialogue
|
||||
|
||||
"Delete Persistent"
|
||||
"Force Recompile"
|
||||
|
||||
call build_project
|
||||
|
||||
"quit"
|
||||
|
||||
|
||||
testcase new_project:
|
||||
python:
|
||||
if os.path.exists(TEST_PROJECTS):
|
||||
shutil.rmtree(TEST_PROJECTS)
|
||||
|
||||
os.mkdir(TEST_PROJECTS, 0o777)
|
||||
|
||||
persistent.projects_directory = TEST_PROJECTS
|
||||
|
||||
"refresh"
|
||||
"Create New Project"
|
||||
|
||||
"Continue"
|
||||
|
||||
# Name
|
||||
type "Test Project"
|
||||
"Continue"
|
||||
|
||||
# Size
|
||||
"1280x720"
|
||||
"Continue"
|
||||
|
||||
# Color Selection
|
||||
"Continue"
|
||||
|
||||
|
||||
testcase choose_colors:
|
||||
"Change/Update GUI"
|
||||
"Choose new colors"
|
||||
"Continue"
|
||||
"Continue"
|
||||
|
||||
"Change/Update GUI"
|
||||
"Regenerate the"
|
||||
"Continue"
|
||||
|
||||
|
||||
testcase delete10:
|
||||
type BACKSPACE
|
||||
type BACKSPACE
|
||||
type BACKSPACE
|
||||
type BACKSPACE
|
||||
type BACKSPACE
|
||||
type BACKSPACE
|
||||
type BACKSPACE
|
||||
type BACKSPACE
|
||||
type BACKSPACE
|
||||
type BACKSPACE
|
||||
|
||||
|
||||
testcase delete30:
|
||||
call delete10
|
||||
call delete10
|
||||
call delete10
|
||||
|
||||
|
||||
testcase translate_project:
|
||||
"Generate Translations"
|
||||
|
||||
call delete30
|
||||
|
||||
type "piglatin"
|
||||
|
||||
"Generate Translations"
|
||||
"Continue"
|
||||
|
||||
"Generate Translations"
|
||||
"Extract String Translations"
|
||||
"Continue"
|
||||
|
||||
"Generate Translations"
|
||||
"Merge String Translations"
|
||||
"Continue"
|
||||
|
||||
"Generate Translations"
|
||||
"Update Default"
|
||||
|
||||
|
||||
testcase build_project:
|
||||
"Build Distributions"
|
||||
"Build"
|
||||
|
||||
|
||||
testcase extract_dialogue_common:
|
||||
"Extract Dialogue"
|
||||
"Strip text tags"
|
||||
"Escape quotes"
|
||||
"Extract all"
|
||||
|
||||
testcase extract_dialogue:
|
||||
call extract_dialogue_common
|
||||
"Tab-delimited"
|
||||
"Continue"
|
||||
"Continue"
|
||||
|
||||
call extract_dialogue_common
|
||||
"Text Only"
|
||||
"Continue"
|
||||
"Continue"
|
||||
|
||||
|
||||
testcase android:
|
||||
|
||||
$ _test.timeout = 60.0
|
||||
$ _test.maximum_framerate = False
|
||||
|
||||
"Tutorial"
|
||||
"Android"
|
||||
|
||||
# Download and install RAPT.
|
||||
if "Yes":
|
||||
|
||||
"Yes"
|
||||
"Proceed"
|
||||
|
||||
"Install SDK"
|
||||
"Yes" until "Continue"
|
||||
|
||||
# We have to create the key.
|
||||
if "Cancel":
|
||||
type "Test Key"
|
||||
"Continue"
|
||||
"Continue"
|
||||
|
||||
# Configure the application.
|
||||
"Configure"
|
||||
|
||||
$ _test.maximum_framerate = True
|
||||
|
||||
call delete30
|
||||
type "Ren'Py Tutorial"
|
||||
"Continue"
|
||||
|
||||
call delete30
|
||||
type "Ren'Py Tutorial"
|
||||
"Continue"
|
||||
|
||||
call delete30
|
||||
type "org.renpy.tutorial"
|
||||
"Continue"
|
||||
|
||||
call delete30
|
||||
type "1.2.3"
|
||||
"Continue"
|
||||
|
||||
call delete30
|
||||
type "10203"
|
||||
"Continue"
|
||||
|
||||
$ _test.maximum_framerate = False
|
||||
|
||||
"In landscape"
|
||||
"Continue"
|
||||
|
||||
"Neither"
|
||||
"Continue"
|
||||
|
||||
"No."
|
||||
"Continue"
|
||||
|
||||
"Android 4.0"
|
||||
"Continue"
|
||||
|
||||
# Access the internet.
|
||||
"No"
|
||||
"Continue"
|
||||
|
||||
# Build the package.
|
||||
"Build Package"
|
||||
"Continue"
|
||||
|
||||
"quit"
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -534,7 +534,7 @@ init python in theme_data:
|
||||
THEME_FUNCTIONS.add(function)
|
||||
THEME_SCREEN_OPERATIONS[theme] = roundrect_screen_ops
|
||||
|
||||
for scheme, colors in ROUNDRECT_SCHEMES.items():
|
||||
for scheme, colors in ROUNDRECT_SCHEMES.iteritems():
|
||||
subs = dict(colors)
|
||||
subs["function"] = function
|
||||
subs["theme"] = theme
|
||||
@@ -587,7 +587,7 @@ init python in theme_data:
|
||||
THEME_SCREEN_OPERATIONS["A White Tulip"] = awt_screen_ops
|
||||
|
||||
|
||||
for scheme, colors in ROUNDRECT_SCHEMES.items():
|
||||
for scheme, colors in ROUNDRECT_SCHEMES.iteritems():
|
||||
subs = dict(colors)
|
||||
subs["scheme"] = scheme
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# Copyright 2004-2025 Tom Rothamel <pytom@bishoujo.us>
|
||||
#!/usr/bin/env python
|
||||
|
||||
# Copyright 2004-2014 Tom Rothamel <pytom@bishoujo.us>
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person
|
||||
# obtaining a copy of this software and associated documentation files
|
||||
@@ -19,30 +21,24 @@
|
||||
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
from renpy.uguu.gl cimport *
|
||||
# This is used on Linux and Mac to prompt the user for the projects
|
||||
# directory.
|
||||
|
||||
cdef class Program:
|
||||
import sys
|
||||
|
||||
# The name of this program.
|
||||
cdef public object name
|
||||
# Python3 and Python2-style imports.
|
||||
try:
|
||||
from tkinter import Tk
|
||||
from tkinter.filedialog import askdirectory
|
||||
except ImportError:
|
||||
from Tkinter import Tk
|
||||
from tkFileDialog import askdirectory
|
||||
|
||||
# The number of the OpenGL program created.
|
||||
cdef GLuint program
|
||||
# Create the TK canvas.
|
||||
|
||||
# The text of the vertex and fragment shaders.
|
||||
cdef object vertex
|
||||
cdef object fragment
|
||||
if __name__ == "__main__":
|
||||
root = Tk()
|
||||
root.withdraw()
|
||||
|
||||
cdef public dict uniforms
|
||||
|
||||
cdef public list attributes
|
||||
|
||||
cdef public int samplers
|
||||
|
||||
cdef public int nearest
|
||||
|
||||
cdef dict properties
|
||||
|
||||
cdef GLuint load_shader(self, GLenum shader_type, source) except 0
|
||||
|
||||
cdef dict uniform_values
|
||||
result = askdirectory(initialdir=sys.argv[1], parent=root, title="Select Ren'Py Projects Directory")
|
||||
sys.stdout.write(result)
|
||||
@@ -1,335 +0,0 @@
|
||||
|
||||
translate arabic strings:
|
||||
|
||||
# 00action_file.rpy:26
|
||||
old "{#weekday}Monday"
|
||||
new "{#weekday}الأثنين"
|
||||
|
||||
# 00action_file.rpy:26
|
||||
old "{#weekday}Tuesday"
|
||||
new "{#weekday}الثلاثاء"
|
||||
|
||||
# 00action_file.rpy:26
|
||||
old "{#weekday}Wednesday"
|
||||
new "{#weekday}الأربعاء"
|
||||
|
||||
# 00action_file.rpy:26
|
||||
old "{#weekday}Thursday"
|
||||
new "{#weekday}الخميس"
|
||||
|
||||
# 00action_file.rpy:26
|
||||
old "{#weekday}Friday"
|
||||
new "{#weekday}الجمعة"
|
||||
|
||||
# 00action_file.rpy:26
|
||||
old "{#weekday}Saturday"
|
||||
new "{#weekday}السبت"
|
||||
|
||||
# 00action_file.rpy:26
|
||||
old "{#weekday}Sunday"
|
||||
new "{#weekday}الأحد"
|
||||
|
||||
# 00action_file.rpy:37
|
||||
old "{#weekday_short}Mon"
|
||||
new "{#weekday_short}اثن"
|
||||
|
||||
# 00action_file.rpy:37
|
||||
old "{#weekday_short}Tue"
|
||||
new "{#weekday_short}ثلا"
|
||||
|
||||
# 00action_file.rpy:37
|
||||
old "{#weekday_short}Wed"
|
||||
new "{#weekday_short}أرب"
|
||||
|
||||
# 00action_file.rpy:37
|
||||
old "{#weekday_short}Thu"
|
||||
new "{#weekday_short}خمي"
|
||||
|
||||
# 00action_file.rpy:37
|
||||
old "{#weekday_short}Fri"
|
||||
new "{#weekday_short}جمع"
|
||||
|
||||
# 00action_file.rpy:37
|
||||
old "{#weekday_short}Sat"
|
||||
new "{#weekday_short}سبت"
|
||||
|
||||
# 00action_file.rpy:37
|
||||
old "{#weekday_short}Sun"
|
||||
new "{#weekday_short}أحد"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}January"
|
||||
new "{#month}يناير"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}February"
|
||||
new "{#month}فبراير"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}March"
|
||||
new "{#month}مارس"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}April"
|
||||
new "{#month}أبريل"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}May"
|
||||
new "{#month}مايو"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}June"
|
||||
new "{#month}يونيو"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}July"
|
||||
new "{#month}يوليو"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}August"
|
||||
new "{#month}أغسطس"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}September"
|
||||
new "{#month}سبتمبر"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}October"
|
||||
new "{#month}أكتوبر"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}November"
|
||||
new "{#month}نوفمبر"
|
||||
|
||||
# 00action_file.rpy:47
|
||||
old "{#month}December"
|
||||
new "{#month}ديسمبر"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}Jan"
|
||||
new "{#month_short}ينا"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}Feb"
|
||||
new "{#month_short}فبر"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}Mar"
|
||||
new "{#month_short}مار"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}Apr"
|
||||
new "{#month_short}ابر"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}May"
|
||||
new "{#month_short}ماي"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}Jun"
|
||||
new "{#month_short}يون"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}Jul"
|
||||
new "{#month_short}يول"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}Aug"
|
||||
new "{#month_short}أغس"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}Sep"
|
||||
new "{#month_short}سبتم"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}Oct"
|
||||
new "{#month_short}أكت"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}Nov"
|
||||
new "{#month_short}نوف"
|
||||
|
||||
# 00action_file.rpy:63
|
||||
old "{#month_short}Dec"
|
||||
new "{#month_short}ديس"
|
||||
|
||||
# 00action_file.rpy:235
|
||||
old "%b %d, %H:%M"
|
||||
new "%b %d, %H:%M"
|
||||
|
||||
# 00action_file.rpy:820
|
||||
old "Quick save complete."
|
||||
new "تم الحفظ السريع"
|
||||
|
||||
# 00gui.rpy:227
|
||||
old "Are you sure?"
|
||||
new "هل انت متأكد؟"
|
||||
|
||||
# 00gui.rpy:228
|
||||
old "Are you sure you want to delete this save?"
|
||||
new "هل انت متأكد من رغبتك في حذف خانة الحفظ هذه؟"
|
||||
|
||||
# 00gui.rpy:229
|
||||
old "Are you sure you want to overwrite your save?"
|
||||
new "هل انت متأكد من رغبتك في الحفظ على هذه الخانة؟"
|
||||
|
||||
# 00gui.rpy:230
|
||||
old "Loading will lose unsaved progress.\nAre you sure you want to do this?"
|
||||
new "الاسترجاع سيضيع كل ما فعلته منذ خانة الحفظ السابقة. \n هل انت متأكد من رغبتك في الاسترجاع إلى هذه النقطة؟"
|
||||
|
||||
# 00gui.rpy:231
|
||||
old "Are you sure you want to quit?"
|
||||
new "هل انت متأكد من رغبتك في الخروج؟"
|
||||
|
||||
# 00gui.rpy:232
|
||||
old "Are you sure you want to return to the main menu?\nThis will lose unsaved progress."
|
||||
new "هل انت متأكد من رغبتك في العودة للقائمة الرئيسية؟ \n كل ما لم تقم بحفظة سيضيع."
|
||||
|
||||
# 00gui.rpy:233
|
||||
old "Are you sure you want to end the replay?"
|
||||
new "هل أنت متأكد من رغبتك في الخروج من الإعادة؟"
|
||||
|
||||
# 00gui.rpy:234
|
||||
old "Are you sure you want to begin skipping?"
|
||||
new "هل أنت متأكد من رغبتك في البدء بالتسريع؟"
|
||||
|
||||
# 00gui.rpy:235
|
||||
old "Are you sure you want to skip to the next choice?"
|
||||
new "هل انت متأكد من رغبتك في التسريع حتى الخيار التالي؟"
|
||||
|
||||
# 00gui.rpy:236
|
||||
old "Are you sure you want to skip unseen dialogue to the next choice?"
|
||||
new "هل أنت متأكد من رغبتك في تسريع كل الحوارات حتى التي لم تسبق رؤيتها؟"
|
||||
|
||||
# 00keymap.rpy:250
|
||||
old "Saved screenshot as %s."
|
||||
new "تم حفظ الصورة كـ %s"
|
||||
|
||||
# 00library.rpy:142
|
||||
old "Self-voicing disabled."
|
||||
new "تم الغاء تفعيل النطق التلقائي."
|
||||
|
||||
# 00library.rpy:143
|
||||
old "Clipboard voicing enabled. "
|
||||
new "تم تفعيل النطق التلقائي من لوح الحفظ. "
|
||||
|
||||
# 00library.rpy:144
|
||||
old "Self-voicing enabled. "
|
||||
new "تم تفعيل النطق التلقائي."
|
||||
|
||||
# 00library.rpy:179
|
||||
old "Skip Mode"
|
||||
new "وضع التسريع"
|
||||
|
||||
# 00library.rpy:262
|
||||
old "This program contains free software under a number of licenses, including the MIT License and GNU Lesser General Public License. A complete list of software, including links to full source code, can be found {a=https://www.renpy.org/l/license}here{/a}."
|
||||
new "This program contains free software under a number of licenses, including the MIT License and GNU Lesser General Public License. A complete list of software, including links to full source code, can be found {a=https://www.renpy.org/l/license}here{/a}."
|
||||
|
||||
# 00preferences.rpy:422
|
||||
old "Clipboard voicing enabled. Press 'shift+C' to disable."
|
||||
new "تشغيل الأصوات من الحافظة مفعّل. إضغط لإيقافه زريّ: Shift+C"
|
||||
|
||||
# 00preferences.rpy:424
|
||||
old "Self-voicing would say \"[renpy.display.tts.last]\". Press 'alt+shift+V' to disable."
|
||||
new "Self-voicing would say \"[renpy.display.tts.last]\". Press 'alt+shift+V' to disable."
|
||||
|
||||
# 00preferences.rpy:426
|
||||
old "Self-voicing enabled. Press 'v' to disable."
|
||||
new "النطق التلقائي مفعَل. لإيقافه إضغط زر V"
|
||||
|
||||
# 00iap.rpy:217
|
||||
old "Contacting App Store\nPlease Wait..."
|
||||
new "Contacting App Store\nPlease Wait..."
|
||||
|
||||
# 00updater.rpy:367
|
||||
old "The Ren'Py Updater is not supported on mobile devices."
|
||||
new "تحديث برنامج رينباي غير مدعوم على الأجهزة المحمولة."
|
||||
|
||||
# 00updater.rpy:486
|
||||
old "An error is being simulated."
|
||||
new "يتم محاكاة خطأ الآن."
|
||||
|
||||
# 00updater.rpy:662
|
||||
old "Either this project does not support updating, or the update status file was deleted."
|
||||
new "هذا المشروع لا يدعم التحديث، أو أن ملف حالة نسخة البرنامج محذوفة."
|
||||
|
||||
# 00updater.rpy:676
|
||||
old "This account does not have permission to perform an update."
|
||||
new "هذا الحساب ليست لديه الصلاحية ليقوم بالتحديث."
|
||||
|
||||
# 00updater.rpy:679
|
||||
old "This account does not have permission to write the update log."
|
||||
new " هذا الحساب ليست لديه الصلاحية ليكتب ملف التحديث."
|
||||
|
||||
# 00updater.rpy:704
|
||||
old "Could not verify update signature."
|
||||
new "لم نتمكن من التحقق من توقيع التحديث update signature."
|
||||
|
||||
# 00updater.rpy:975
|
||||
old "The update file was not downloaded."
|
||||
new "لم يتم تحميل ملف التحديث."
|
||||
|
||||
# 00updater.rpy:993
|
||||
old "The update file does not have the correct digest - it may have been corrupted."
|
||||
new "ملف التحديث لا يحتوي على المختصرات الصحيحة - قد يكون معطوباً."
|
||||
|
||||
# 00updater.rpy:1049
|
||||
old "While unpacking {}, unknown type {}."
|
||||
new "عند فك الحزمة {}، نوع مجهول {}."
|
||||
|
||||
# 00updater.rpy:1393
|
||||
old "Updater"
|
||||
new "برنامج التحديث"
|
||||
|
||||
# 00updater.rpy:1404
|
||||
old "This program is up to date."
|
||||
new "هذه النسخة هي الأحدث"
|
||||
|
||||
# 00updater.rpy:1406
|
||||
old "[u.version] is available. Do you want to install it?"
|
||||
new "النسخة [u.version] متوفرة, هل ترغب في تنصيبها؟"
|
||||
|
||||
# 00updater.rpy:1408
|
||||
old "Preparing to download the updates."
|
||||
new "يتم التجهيز لتحميل البرنامج من الانترنت"
|
||||
|
||||
# 00updater.rpy:1410
|
||||
old "Downloading the updates."
|
||||
new "يتم تنزيل التحديثات"
|
||||
|
||||
# 00updater.rpy:1412
|
||||
old "Unpacking the updates."
|
||||
new "يتم فك الضغط عن التحديثات"
|
||||
|
||||
# 00updater.rpy:1416
|
||||
old "The updates have been installed. The program will restart."
|
||||
new "تم التحديث.. سيتم إعادة تشغيل البرنامج."
|
||||
|
||||
# 00updater.rpy:1418
|
||||
old "The updates have been installed."
|
||||
new "تم التحديث."
|
||||
|
||||
# 00updater.rpy:1420
|
||||
old "The updates were cancelled."
|
||||
new "تم إلغاء التحديث."
|
||||
|
||||
# 00gallery.rpy:563
|
||||
old "Image [index] of [count] locked."
|
||||
new "يوجد عدد صور [index] من أصل [count] مقفل"
|
||||
|
||||
# 00gallery.rpy:583
|
||||
old "prev"
|
||||
new "السابق"
|
||||
|
||||
# 00gallery.rpy:584
|
||||
old "next"
|
||||
new "التالي"
|
||||
|
||||
# 00gallery.rpy:585
|
||||
old "slideshow"
|
||||
new "عرض الشرائح"
|
||||
|
||||
# 00gallery.rpy:586
|
||||
old "return"
|
||||
new "العودة"
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
|
||||
translate arabic strings:
|
||||
|
||||
# _developer/developer.rpym:38
|
||||
old "Developer Menu"
|
||||
new "قائمة المبرمج"
|
||||
|
||||
# _developer/developer.rpym:43
|
||||
old "Reload Game (Shift+R)"
|
||||
new "إعادة تشغيل اللعبة (Shift+R)"
|
||||
|
||||
# _developer/developer.rpym:45
|
||||
old "Console (Shift+O)"
|
||||
new "لوحة التحكم (Shift+O)"
|
||||
|
||||
# _developer/developer.rpym:47
|
||||
old "Variable Viewer"
|
||||
new "مستعرض الأوامر"
|
||||
|
||||
# _developer/developer.rpym:49
|
||||
old "Theme Test"
|
||||
new "اختبار القوالب"
|
||||
|
||||
# _developer/developer.rpym:51
|
||||
old "Image Location Picker"
|
||||
new "مكان الصور المطلوبة"
|
||||
|
||||
# _developer/developer.rpym:53
|
||||
old "Filename List"
|
||||
new "قائمة اسماء الملفات"
|
||||
|
||||
# _developer/developer.rpym:57
|
||||
old "Show Image Load Log"
|
||||
new "عرض قائمة الصور "
|
||||
|
||||
# _developer/developer.rpym:60
|
||||
old "Hide Image Load Log"
|
||||
new "إخفاء قائمة الصور"
|
||||
|
||||
# _developer/developer.rpym:95
|
||||
old "Nothing to inspect."
|
||||
new "لا يوجد شيء ليتم اختباره"
|
||||
|
||||
# _developer/developer.rpym:217
|
||||
old "Return to the developer menu"
|
||||
new "العودة للوحة المبرمج"
|
||||
|
||||
# _developer/developer.rpym:373
|
||||
old "Rectangle: %r"
|
||||
new "مثلث: %r"
|
||||
|
||||
# _developer/developer.rpym:378
|
||||
old "Mouse position: %r"
|
||||
new "مكان المؤشر: %r"
|
||||
|
||||
# _developer/developer.rpym:383
|
||||
old "Right-click or escape to quit."
|
||||
new "إضغط بالزر الايمن او إضغط زر الخروح للإغلاق"
|
||||
|
||||
# _developer/developer.rpym:412
|
||||
old "Rectangle copied to clipboard."
|
||||
new "تم نسخ المربع إلى الحافظة."
|
||||
|
||||
# _developer/developer.rpym:415
|
||||
old "Position copied to clipboard."
|
||||
new "تم نسخ الموضع إلى الحافظة."
|
||||
|
||||
# _developer/developer.rpym:524
|
||||
old "✔ "
|
||||
new "✔ "
|
||||
|
||||
# _developer/developer.rpym:527
|
||||
old "✘ "
|
||||
new "✘ "
|
||||
|
||||
# _developer/developer.rpym:532
|
||||
old "\n{color=#cfc}✔ predicted image (good){/color}\n{color=#fcc}✘ unpredicted image (bad){/color}\n{color=#fff}Drag to move.{/color}"
|
||||
new "\n{color=#cfc}✔ predicted image (good){/color}\n{color=#fcc}✘ unpredicted image (bad){/color}\n{color=#fff}Drag to move.{/color}"
|
||||
|
||||
# _developer/inspector.rpym:38
|
||||
old "Displayable Inspector"
|
||||
new "اختبار المستعرضات"
|
||||
|
||||
# _developer/inspector.rpym:61
|
||||
old "Size"
|
||||
new "حجم"
|
||||
|
||||
# _developer/inspector.rpym:65
|
||||
old "Style"
|
||||
new "مظهر"
|
||||
|
||||
# _developer/inspector.rpym:71
|
||||
old "Location"
|
||||
new "الموقع"
|
||||
|
||||
# _developer/inspector.rpym:122
|
||||
old "Inspecting Styles of [displayable_name!q]"
|
||||
new "يتم اختبار المظهر الخاص بـ [displayable_name!q]"
|
||||
|
||||
# _developer/inspector.rpym:139
|
||||
old "displayable:"
|
||||
new "مستعرضات"
|
||||
|
||||
# _developer/inspector.rpym:145
|
||||
old " (no properties affect the displayable)"
|
||||
new " (لا توجد اي مؤثرات على هذا المستعرض)"
|
||||
|
||||
# _developer/inspector.rpym:147
|
||||
old " (default properties omitted)"
|
||||
new " (تم استبعاد تأثير المؤثرات القياسية)"
|
||||
|
||||
# _developer/inspector.rpym:185
|
||||
old "<repr() failed>"
|
||||
new "<repr() failed>"
|
||||
|
||||
# 00console.rpy:182
|
||||
old "Press <esc> to exit console. Type help for help.\n"
|
||||
new "إضغط زر الخروج لإغلاق لوحة التحكم, اكتب كلمة help للمساعدة"
|
||||
|
||||
# 00console.rpy:186
|
||||
old "Ren'Py script enabled."
|
||||
new "لغة برمحة رينباي متاحه"
|
||||
|
||||
# 00console.rpy:188
|
||||
old "Ren'Py script disabled."
|
||||
new "لغة برمجة رينباي غير متاحه"
|
||||
|
||||
# 00console.rpy:398
|
||||
old "help: show this help"
|
||||
new "مساعده: عرض هذه المساعده"
|
||||
|
||||
# 00console.rpy:403
|
||||
old "commands:\n"
|
||||
new "أوامر: \n"
|
||||
|
||||
# 00console.rpy:413
|
||||
old " <renpy script statement>: run the statement\n"
|
||||
new "<renpy script statement>: عرض الأوامر\n"
|
||||
|
||||
# 00console.rpy:415
|
||||
old " <python expression or statement>: run the expression or statement"
|
||||
new " <python expression or statement>: عرض التعبير او الأوامر"
|
||||
|
||||
# 00console.rpy:423
|
||||
old "clear: clear the console history"
|
||||
new "clear: مسح تاريخ لوحة التحكم"
|
||||
|
||||
# 00console.rpy:427
|
||||
old "exit: exit the console"
|
||||
new "exit: الخروج من لوحة التحكم"
|
||||
|
||||
# 00console.rpy:435
|
||||
old "load <slot>: loads the game from slot"
|
||||
new "استرجاع <slot>: يقوم باسترجاع اللعب من نقطة الحفظ"
|
||||
|
||||
# 00console.rpy:448
|
||||
old "save <slot>: saves the game in slot"
|
||||
new "حفظ <slot>: يقوم بحفظ اللعب في نقطة الحفظ"
|
||||
|
||||
# 00console.rpy:459
|
||||
old "reload: reloads the game, refreshing the scripts"
|
||||
new "reload: يعيد تشغيل اللعبة مع عرض التغييرات في النص"
|
||||
|
||||
# 00console.rpy:467
|
||||
old "watch <expression>: watch a python expression"
|
||||
new "مشاهده <expression>: يقوم بعرض تعبيرات بايثون"
|
||||
|
||||
# 00console.rpy:493
|
||||
old "unwatch <expression>: stop watching an expression"
|
||||
new "unwatch <expression>: يقوم بإيقاف تعبير بايثون"
|
||||
|
||||
# 00console.rpy:519
|
||||
old "unwatchall: stop watching all expressions"
|
||||
new "unwatchall: يقوم بإيقاف كل تعبيرات بايثون"
|
||||
|
||||
# 00console.rpy:536
|
||||
old "jump <label>: jumps to label"
|
||||
new "jump <label>: يقفز للعنوان"
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
|
||||
translate arabic strings:
|
||||
|
||||
# 00gltest.rpy:64
|
||||
old "Graphics Acceleration"
|
||||
new "تسريع الرسومات"
|
||||
|
||||
# 00gltest.rpy:70
|
||||
old "Automatically Choose"
|
||||
new "إختيار اوتوماتيكي"
|
||||
|
||||
# 00gltest.rpy:75
|
||||
old "Force Angle/DirectX Renderer"
|
||||
new "فرض الزاوية/دايركت × ومحركاته"
|
||||
|
||||
# 00gltest.rpy:79
|
||||
old "Force OpenGL Renderer"
|
||||
new "فرض محرك OpenGL"
|
||||
|
||||
# 00gltest.rpy:83
|
||||
old "Force Software Renderer"
|
||||
new "فرض محركات البرامج"
|
||||
|
||||
# 00gltest.rpy:93
|
||||
old "Enable"
|
||||
new "تفعيل"
|
||||
|
||||
# 00gltest.rpy:109
|
||||
old "Changes will take effect the next time this program is run."
|
||||
new "التغييرات سيتم تطبيقها في المرة القادمة تفتح البرنامج"
|
||||
|
||||
# 00gltest.rpy:141
|
||||
old "Performance Warning"
|
||||
new "تحذير تشغيلي"
|
||||
|
||||
# 00gltest.rpy:146
|
||||
old "This computer is using software rendering."
|
||||
new "هذا الحاسوب يستعمل محركات البرامج software rendering"
|
||||
|
||||
# 00gltest.rpy:148
|
||||
old "This computer is not using shaders."
|
||||
new "هذا الحاسوب لا يستعمل اي shaders"
|
||||
|
||||
# 00gltest.rpy:150
|
||||
old "This computer is displaying graphics slowly."
|
||||
new "هذا الحاسوب يستعرض الرسوميات بشكل بطيء"
|
||||
|
||||
# 00gltest.rpy:152
|
||||
old "This computer has a problem displaying graphics: [problem]."
|
||||
new "هذا الحاسوب يواجه مشكلة في عرض الرسوميات [problem]"
|
||||
|
||||
# 00gltest.rpy:157
|
||||
old "Its graphics drivers may be out of date or not operating correctly. This can lead to slow or incorrect graphics display. Updating DirectX could fix this problem."
|
||||
new "محركات الرسوميات قد تكون قديمة او لا تعمل بشكل صحيح. قد يسبب ذلك بطء او اخطاء في الاستعراض, القيام بتحديث directX قد يساعد في حل المشكلة."
|
||||
|
||||
# 00gltest.rpy:159
|
||||
old "Its graphics drivers may be out of date or not operating correctly. This can lead to slow or incorrect graphics display."
|
||||
new " محركات الرسوميات قد تكون قديمة او لا تعمل بشكل صحيح. قد يسبب ذلك بطء او اخطاء في الاستعراض."
|
||||
|
||||
# 00gltest.rpy:164
|
||||
old "Update DirectX"
|
||||
new "تحديث DirectX"
|
||||
|
||||
# 00gltest.rpy:170
|
||||
old "Continue, Show this warning again"
|
||||
new "استمرار, الرجاء عرض هذا التحذير في المرة الثادمة ايضاً"
|
||||
|
||||
# 00gltest.rpy:174
|
||||
old "Continue, Don't show warning again"
|
||||
new "استمرار, لا تعرض هذا التحذير مرة اخرى"
|
||||
|
||||
# 00gltest.rpy:192
|
||||
old "Updating DirectX."
|
||||
new "يتم تحديث DirectX"
|
||||
|
||||
# 00gltest.rpy:196
|
||||
old "DirectX web setup has been started. It may start minimized in the taskbar. Please follow the prompts to install DirectX."
|
||||
new "يتم الآن تنصيب DirectX, قد يبدأ ذلك بشكل مصغر في شريط المهام. الرجاء اتباع التعليمات لاكمال التنصيب."
|
||||
|
||||
# 00gltest.rpy:200
|
||||
old "{b}Note:{/b} Microsoft's DirectX web setup program will, by default, install the Bing toolbar. If you do not want this toolbar, uncheck the appropriate box."
|
||||
new "{b}ملاحظة:{/b} مايكروسوفت دايركت أكس يقوم تلقائياً بتنصيب شريط بينق Bing toolbar. إذا لم ترغب بذلك الرجاء القيام بإلغاء تحديد خانة الاختيار"
|
||||
|
||||
# 00gltest.rpy:204
|
||||
old "When setup finishes, please click below to restart this program."
|
||||
new "حيثن ينتهي التنصيب, الرجاء الضغط ادناه لإعادة تشغيل البرنامج"
|
||||
|
||||
# 00gltest.rpy:206
|
||||
old "Restart"
|
||||
new "إعادة تشغيل"
|
||||
|
||||
# 00gamepad.rpy:32
|
||||
old "Select Gamepad to Calibrate"
|
||||
new "الرجاء اختيار يد التحكم التي ترغب في تهيئتها"
|
||||
|
||||
# 00gamepad.rpy:35
|
||||
old "No Gamepads Available"
|
||||
new "لا توجد يد تحكم"
|
||||
|
||||
# 00gamepad.rpy:54
|
||||
old "Calibrating [name] ([i]/[total])"
|
||||
new "يتم تهيئة [name] ([i]/[total])"
|
||||
|
||||
# 00gamepad.rpy:58
|
||||
old "Press or move the [control!s] [kind]."
|
||||
new "الرجاء ضغط الزر او تحريك [control!s] [kind]."
|
||||
|
||||
# 00gamepad.rpy:66
|
||||
old "Skip (A)"
|
||||
new "تخطي (A)"
|
||||
|
||||
# 00gamepad.rpy:69
|
||||
old "Back (B)"
|
||||
new "عودة (B)"
|
||||
|
||||
# _errorhandling.rpym:495
|
||||
old "Open Traceback"
|
||||
new "قراءة التقرير"
|
||||
|
||||
# _errorhandling.rpym:497
|
||||
old "Opens the traceback.txt file in a text editor."
|
||||
new "يفتح تقرير الخطأ في برنامج الملفات النصية."
|
||||
|
||||
# _errorhandling.rpym:499
|
||||
old "Copy to Clipboard"
|
||||
new "نسخ إلى الحافظة"
|
||||
|
||||
# _errorhandling.rpym:501
|
||||
old "Copies the traceback.txt file to the clipboard."
|
||||
new "ينسخ ملف trackback.txt إلى الحافظة."
|
||||
|
||||
# _errorhandling.rpym:519
|
||||
old "An exception has occurred."
|
||||
new "حصل استثناء"
|
||||
|
||||
# _errorhandling.rpym:538
|
||||
old "Rollback"
|
||||
new "تراجع"
|
||||
|
||||
# _errorhandling.rpym:540
|
||||
old "Attempts a roll back to a prior time, allowing you to save or choose a different choice."
|
||||
new "يقوم بالتراجع لنقطة سابقة لكي تستطيع اختيار شيء آخر"
|
||||
|
||||
# _errorhandling.rpym:543
|
||||
old "Ignore"
|
||||
new "تجاهل"
|
||||
|
||||
# _errorhandling.rpym:545
|
||||
old "Ignores the exception, allowing you to continue. This often leads to additional errors."
|
||||
new "يتجاهل الاستثناء مما يستمح لك بالاستمرار. قد يسبب هذا المزيد من الاخطاء."
|
||||
|
||||
# _errorhandling.rpym:548
|
||||
old "Reload"
|
||||
new "إعادة المحاولة"
|
||||
|
||||
# _errorhandling.rpym:550
|
||||
old "Reloads the game from disk, saving and restoring game state if possible."
|
||||
new "يعيد تشغيل اللعبة من القرص الصلب, مع محاولة استعمادة آخر نقطة وحفظها عند الإستطاعة."
|
||||
|
||||
# _errorhandling.rpym:560
|
||||
old "Quits the game."
|
||||
new "يخرج من اللعبة."
|
||||
|
||||
# _errorhandling.rpym:582
|
||||
old "Parsing the script failed."
|
||||
new "حصل خطأ أثناء تشغيل النص."
|
||||
|
||||
# _errorhandling.rpym:606
|
||||
old "Open Parse Errors"
|
||||
new "يفتح قائمة اخطاء التشغيل."
|
||||
|
||||
# _errorhandling.rpym:608
|
||||
old "Opens the errors.txt file in a text editor."
|
||||
new "يفتح ملف errors.txt في برنامج الملفات النصية"
|
||||
|
||||
# _errorhandling.rpym:612
|
||||
old "Copies the errors.txt file to the clipboard."
|
||||
new "Copies the errors.txt file to the clipboard."
|
||||
|
||||
@@ -1,411 +0,0 @@
|
||||
|
||||
translate arabic strings:
|
||||
|
||||
# gui.rpy:2
|
||||
old "## Initialization"
|
||||
new "## تتم التهيئة الآن"
|
||||
|
||||
# gui.rpy:5
|
||||
old "## The init offset statement causes the init code in this file to run before init code in any other file."
|
||||
new "## The init offset statement causes the init code in this file to run before init code in any other file."
|
||||
|
||||
# gui.rpy:9
|
||||
old "## Calling gui.init resets the styles to sensible default values, and sets the width and height of the game."
|
||||
new "## Calling gui.init resets the styles to sensible default values, and sets the width and height of the game."
|
||||
|
||||
# gui.rpy:21
|
||||
old "## Colors"
|
||||
new "## الألوان"
|
||||
|
||||
# gui.rpy:23
|
||||
old "## The colors of text in the interface."
|
||||
new "## ألوان الخطوط الظاهرة في الواجهة."
|
||||
|
||||
# gui.rpy:25
|
||||
old "## An accent color used throughout the interface to label and highlight text."
|
||||
new "## لون إضافي ينطبق على الوسوم و العناوين الرئيسية في اماكن مختلفة من الواجهة."
|
||||
|
||||
# gui.rpy:29
|
||||
old "## The color used for a text button when it is neither selected nor hovered."
|
||||
new "## اللون المطلوب للأزرار حين لا تكون قيد الاستعمال ولا مظللة."
|
||||
|
||||
# gui.rpy:32
|
||||
old "## The small color is used for small text, which needs to be brighter/darker to achieve the same effect."
|
||||
new "## اللون الصغير هو اللون الذي ينطبق على الخطوط الصغيرة, والتي تحتاج ان تكون ذات لون فاتح او داكن اكثر مما حولها لتظهر بشكل واضح."
|
||||
|
||||
# gui.rpy:36
|
||||
old "## The color that is used for buttons and bars that are hovered."
|
||||
new "## اللون الذي ينطبق على الازرار و اشرطة التمرير عند تظليلها بالمؤشر."
|
||||
|
||||
# gui.rpy:39
|
||||
old "## The color used for a text button when it is selected but not focused. A button is selected if it is the current screen or preference value."
|
||||
new "## اللون الذي ينطبق على الزر المفعّل الآن لكن ليس حين يكون مظللا. تفعيل الزر هو ما يظهر عندما تكون في الصفحه الخاصة به او الصفحة التي يؤدي إليها."
|
||||
|
||||
# gui.rpy:43
|
||||
old "## The color used for a text button when it cannot be selected."
|
||||
new "## اللون الخاص بالزر حين يكون غير قابل للضغط."
|
||||
|
||||
# gui.rpy:46
|
||||
old "## Colors used for the portions of bars that are not filled in. These are not used directly, but are used when re-generating bar image files."
|
||||
new "## اللون الذي يتم استعماله لملء الفراغات في اشرطة التمرير. هذا اللون لا يظهر فعليا, لكن يتم استعماله عند اعادة تكوين الصور الخاصة باشرطة التمرير."
|
||||
|
||||
# gui.rpy:51
|
||||
old "## The colors used for dialogue and menu choice text."
|
||||
new "## اللون الخاص بالنص عند الحوار و في ازرار القائمة الرئيسية."
|
||||
|
||||
# gui.rpy:56
|
||||
old "## Fonts and Font Sizes"
|
||||
new "##نوع الخط و حجمه."
|
||||
|
||||
# gui.rpy:58
|
||||
old "## The font used for in-game text."
|
||||
new "##نوع الخط المستخدم داخل نص اللعبة."
|
||||
|
||||
# gui.rpy:61
|
||||
old "## The font used for character names."
|
||||
new "##نوع الخط المستخدم في أسماء الشخصيات."
|
||||
|
||||
# gui.rpy:64
|
||||
old "## The font used for out-of-game text."
|
||||
new "##نوع الخط المستخدم في النصوص خارج الحوار في اللعبة."
|
||||
|
||||
# gui.rpy:67
|
||||
old "## The size of normal dialogue text."
|
||||
new "##حجم الخط المستخدم في الحوار."
|
||||
|
||||
# gui.rpy:70
|
||||
old "## The size of character names."
|
||||
new "##حجم الخط المستخدم لأسماء الشخصيات."
|
||||
|
||||
# gui.rpy:73
|
||||
old "## The size of text in the game's user interface."
|
||||
new "##حجم الخط المستخدم في واجهة اللعبة التشغيلية."
|
||||
|
||||
# gui.rpy:76
|
||||
old "## The size of labels in the game's user interface."
|
||||
new "## حجم العناوين الرئيسية في واجهة اللعبة التشغيلية."
|
||||
|
||||
# gui.rpy:79
|
||||
old "## The size of text on the notify screen."
|
||||
new "##حجم الخط المستخدم في صفحة الملاحظات."
|
||||
|
||||
# gui.rpy:82
|
||||
old "## The size of the game's title."
|
||||
new "## حجم الخط المستخدم لعنوان اللعبة الرئيسي."
|
||||
|
||||
# gui.rpy:86
|
||||
old "## Main and Game Menus"
|
||||
new "## القائمة الرئيسية و قائمة اللعبة."
|
||||
|
||||
# gui.rpy:88
|
||||
old "## The images used for the main and game menus."
|
||||
new "## الصور المستخدمة في القائمة الرئيسية و قوائم اللعبة."
|
||||
|
||||
# gui.rpy:92
|
||||
old "## Should we show the name and version of the game?"
|
||||
new "## هل سنقوم بعرض اسم و نسخه اللعبة الحالية؟"
|
||||
|
||||
# gui.rpy:96
|
||||
old "## Dialogue"
|
||||
new "## الحوار"
|
||||
|
||||
# gui.rpy:98
|
||||
old "## These variables control how dialogue is displayed on the screen one line at a time."
|
||||
new "## هذه المتغيرات تقوم بتحديد طريقة عرض الحوار الظاهر على الشاشة سطراً سطراً."
|
||||
|
||||
# gui.rpy:101
|
||||
old "## The height of the textbox containing dialogue."
|
||||
new "## ارتفاع الصندوق الذي يحتوي على النصوص."
|
||||
|
||||
# gui.rpy:104
|
||||
old "## The placement of the textbox vertically on the screen. 0.0 is the top, 0.5 is center, and 1.0 is the bottom."
|
||||
new "## مكان صندوق الحوار عموديا على الشاشة. 0.0 يضعه في الأعلى, 0.5 في المنتصف, و 1.0 يضع الصندوق في أسفل الشاشة."
|
||||
|
||||
# gui.rpy:109
|
||||
old "## The placement of the speaking character's name, relative to the textbox. These can be a whole number of pixels from the left or top, or 0.5 to center."
|
||||
new "##مكان الخانة الخاصة بعرض اسم الشخصية و تناسبها مع صندوق الحوار الرئيسي. يمكن وضع ارقام تعبر عن عدد البكسلات بينها و بين الجزء العلوي الأيسر من الشاشة, او استعمال نسبة مثل 0.5 لوضعها في المنتصف."
|
||||
|
||||
# gui.rpy:114
|
||||
old "## The horizontal alignment of the character's name. This can be 0.0 for left-aligned, 0.5 for centered, and 1.0 for right-aligned."
|
||||
new "##هذا يحدد مكان ظهور اسم الشخصية, يمكن ان يكون 0.0 ليقارب اليسار, 0.5 ليكون في المنتصف, و 1.0 ليقارب اليمين."
|
||||
|
||||
# gui.rpy:118
|
||||
old "## The width, height, and borders of the box containing the character's name, or None to automatically size it."
|
||||
new "## طول و عرض و ارتفاع الصندوق الذي يحتوي على اسم الشخصية, او None ليتم استعمال حجم قياسي."
|
||||
|
||||
# gui.rpy:123
|
||||
old "## The borders of the box containing the character's name, in left, top, right, bottom order."
|
||||
new "## حجم الخط الذي يحيط بصندوق اسم الشخصية, الاحجام بالترتيب هي اليسار, الأعلى, اليمين, و الأسفل."
|
||||
|
||||
# gui.rpy:127
|
||||
old "## If True, the background of the namebox will be tiled, if False, the background of the namebox will be scaled."
|
||||
new "## عندما يتم اختيار True سيتم تكرار الخلفية حتى تغطي الصندوق, عند اختيار False سيتم تمديد الصورة لتغطي الصندوق."
|
||||
|
||||
# gui.rpy:132
|
||||
old "## The placement of dialogue relative to the textbox. These can be a whole number of pixels relative to the left or top side of the textbox, or 0.5 to center."
|
||||
new "## مكان نص الحوار و تناسبه مع صندوق الحوار الرئيسي. يمكن وضع ارقام تعبر عن عدد البكسلات بينها و بين الجزء العلوي الأيسر من الشاشة, او استعمال نسبة مثل 0.5 لوضعه في المنتصف."
|
||||
|
||||
# gui.rpy:138
|
||||
old "## The maximum width of dialogue text, in pixels."
|
||||
new "## عدد البكسلات القصوى التي يمكن ان يتمدد إليها صندوق الحوار بالعرض."
|
||||
|
||||
# gui.rpy:141
|
||||
old "## The horizontal alignment of the dialogue text. This can be 0.0 for left-aligned, 0.5 for centered, and 1.0 for right-aligned."
|
||||
new "## اتجاه النص عرضياً: يمكن استعمال 0.0 ليقارب اليسار, 0.5 ليكون في المنتصف, و 1.0 ليقارب اليمين."
|
||||
|
||||
# gui.rpy:146
|
||||
old "## Buttons"
|
||||
new "## أزرار"
|
||||
|
||||
# gui.rpy:148
|
||||
old "## These variables, along with the image files in gui/button, control aspects of how buttons are displayed."
|
||||
new "## هذه المتغيرات تتشارك مع ملفات الصور في gui/button في تحديد مظهر الأزرار."
|
||||
|
||||
# gui.rpy:151
|
||||
old "## The width and height of a button, in pixels. If None, Ren'Py computes a size."
|
||||
new "## طول و عرض الزر بالبكسل. لو تم استعمال None سيقوم رينباي باختيار حجم مناسب."
|
||||
|
||||
# gui.rpy:155
|
||||
old "## The borders on each side of the button, in left, top, right, bottom order."
|
||||
new "## حجم الخط الذي يحيط بصندوق الزر, الاحجام بالترتيب هي اليسار, الأعلى, اليمين, و الأسفل."
|
||||
|
||||
# gui.rpy:158
|
||||
old "## If True, the background image will be tiled. If False, the background image will be linearly scaled."
|
||||
new "## عندما يتم اختيار True سيتم تكرار الخلفية حتى تغطي المساحه بأكملها, عند اختيار False سيتم تمديد الصورة."
|
||||
|
||||
# gui.rpy:162
|
||||
old "## The font used by the button."
|
||||
new "## الخط المستخدم في الزر."
|
||||
|
||||
# gui.rpy:165
|
||||
old "## The size of the text used by the button."
|
||||
new "## حجم الخط المستخدم في الزر."
|
||||
|
||||
# gui.rpy:179
|
||||
old "## These variables override settings for different kinds of buttons. Please see the gui documentation for the kinds of buttons available, and what each is used for."
|
||||
new "## هذه المتغيرات تقوم بتجاهل الخيارات التي تنطبق على انواع الازرار الأخرى. الرجاء قراءة دليل المستخدم الخاص بالواجهة للتعرف على انواع الازرار المتاحه و كيفية استعمالها."
|
||||
|
||||
# gui.rpy:183
|
||||
old "## These customizations are used by the default interface:"
|
||||
new "## هذه الخيارات تنطبق على الواجهة القياسية:"
|
||||
|
||||
# gui.rpy:198
|
||||
old "## You can also add your own customizations, by adding properly-named variables. For example, you can uncomment the following line to set the width of a navigation button."
|
||||
new "## يمكنك اضافة تغييرات يدويا عن طريق اضافة متغيرات بأسماء مميزة. مثلا, يمكنك ازالة اقتباسات الحماية ## عن السطر التالي لتغيير طول و عرض الازرار الخاصة بالقائمة."
|
||||
|
||||
# gui.rpy:205
|
||||
old "## Choice Buttons"
|
||||
new "## أزرار الخيارات"
|
||||
|
||||
# gui.rpy:207
|
||||
old "## Choice buttons are used in the in-game menus."
|
||||
new "## أزرار الخيارات يتم استعمالها داخل قوائم اللعبة."
|
||||
|
||||
# gui.rpy:220
|
||||
old "## File Slot Buttons"
|
||||
new "## أزرار قائمة الحفظ."
|
||||
|
||||
# gui.rpy:222
|
||||
old "## A file slot button is a special kind of button. It contains a thumbnail image, and text describing the contents of the save slot. A save slot uses image files in gui/button, like the other kinds of buttons."
|
||||
new "## زر خانة الحفظ هو زر مميز عن غيره لانه يعرض صورة رمزية و نص يشرح محتويات الخانة. زر الحفظ يستعمل صور من مجلد الواجهة مثل باقي الأزرار في gui/button."
|
||||
|
||||
# gui.rpy:226
|
||||
old "## The save slot button."
|
||||
new "## زر خانة الحفظ."
|
||||
|
||||
# gui.rpy:234
|
||||
old "## The width and height of thumbnails used by the save slots."
|
||||
new "## طول و عرض الصورة الرمزية لخانة الحفظ."
|
||||
|
||||
# gui.rpy:238
|
||||
old "## The number of columns and rows in the grid of save slots."
|
||||
new "## عدد الخانات الطولية و العرضية التي يمكن الحفظ فيها."
|
||||
|
||||
# gui.rpy:243
|
||||
old "## Positioning and Spacing"
|
||||
new "## مكان الخانات و المساحه بينها."
|
||||
|
||||
# gui.rpy:245
|
||||
old "## These variables control the positioning and spacing of various user interface elements."
|
||||
new "## هذه المتغيرات تحدد المساحة و مكان عرض عدة عناصر خاصة بالواجهة."
|
||||
|
||||
# gui.rpy:248
|
||||
old "## The position of the left side of the navigation buttons, relative to the left side of the screen."
|
||||
new "## مكان الجزء الأيسر من ازرار القوائم وتناسبه مع الحد الأيسر من الشاشة."
|
||||
|
||||
# gui.rpy:252
|
||||
old "## The vertical position of the skip indicator."
|
||||
new "## موقع مؤشر استمرار الحوار رأسياً."
|
||||
|
||||
# gui.rpy:255
|
||||
old "## The vertical position of the notify screen."
|
||||
new "## موقع شاشة التنبيهات رأسياً."
|
||||
|
||||
# gui.rpy:258
|
||||
old "## The spacing between menu choices."
|
||||
new "## الفراغات بين خيارات القوائم."
|
||||
|
||||
# gui.rpy:261
|
||||
old "## Buttons in the navigation section of the main and game menus."
|
||||
new "## الأزرار في صفحات الخيارات و القائمة الرئيسية."
|
||||
|
||||
# gui.rpy:264
|
||||
old "## Controls the amount of spacing between preferences."
|
||||
new "## يتحكم في المساحه بين الخيارات."
|
||||
|
||||
# gui.rpy:267
|
||||
old "## Controls the amount of spacing between preference buttons."
|
||||
new "## يتحكم في المساحه بين ازرار الخيارات."
|
||||
|
||||
# gui.rpy:270
|
||||
old "## The spacing between file page buttons."
|
||||
new "## المساحه بين ازرار صفحات الحفظ."
|
||||
|
||||
# gui.rpy:273
|
||||
old "## The spacing between file slots."
|
||||
new "## المساحه بين خانات الحفظ."
|
||||
|
||||
# gui.rpy:277
|
||||
old "## Frames"
|
||||
new "## الإطارات"
|
||||
|
||||
# gui.rpy:279
|
||||
old "## These variables control the look of frames that can contain user interface components when an overlay or window is not present."
|
||||
new "## هذه المتغيرات تحدد شكل الإطارات الخاصة بعناصر الواجهة عند انعدام نافذة تتحكم بظهورها."
|
||||
|
||||
# gui.rpy:282
|
||||
old "## Generic frames that are introduced by player code."
|
||||
new "## إطارات قياسية يتم تقديمها حسب برمجة اللاعب."
|
||||
|
||||
# gui.rpy:285
|
||||
old "## The frame that is used as part of the confirm screen."
|
||||
new "## الإطار الخاص بصفحة التأكيد."
|
||||
|
||||
# gui.rpy:288
|
||||
old "## The frame that is used as part of the skip screen."
|
||||
new "## الإطار المستخدم في صفحة التسريع."
|
||||
|
||||
# gui.rpy:291
|
||||
old "## The frame that is used as part of the notify screen."
|
||||
new "## الإطار المستخدم في صفحة التنبيهات."
|
||||
|
||||
# gui.rpy:294
|
||||
old "## Should frame backgrounds be tiled?"
|
||||
new "## هل تريد ان تكون خلفية الإطار متكررة؟"
|
||||
|
||||
# gui.rpy:298
|
||||
old "## Bars, Scrollbars, and Sliders"
|
||||
new "## أشرطة التمرير, الأشرطة, و العناصر المنزلقة."
|
||||
|
||||
# gui.rpy:300
|
||||
old "## These control the look and size of bars, scrollbars, and sliders."
|
||||
new "## هذه تتحكم بشكل و حجم الأشرطة والعناصر المنزلقة."
|
||||
|
||||
# gui.rpy:302
|
||||
old "## The default GUI only uses sliders and vertical scrollbars. All of the other bars are only used in creator-written code."
|
||||
new "## الواجهة القياسية لا تستخدم سوى العناصر المنزلقة و الأشرطة رأسياً, الأشرطة الباقية لا يتم استعمالها إلا عندما يقرر ذلك صانع اللعبة."
|
||||
|
||||
# gui.rpy:305
|
||||
old "## The height of horizontal bars, scrollbars, and sliders. The width of vertical bars, scrollbars, and sliders."
|
||||
new "## ارتفاع الأشرطة و العناصر المنزلقة الأفقية. سماكة الأشرطة و العناصر المنزلقة الرأسية."
|
||||
|
||||
# gui.rpy:311
|
||||
old "## True if bar images should be tiled. False if they should be linearly scaled."
|
||||
new "## استعمل True لتكون الصورة المستخدمة في الأشرطة المنزلقة متكررة, False ليتم تمديدها على حجم الشريط."
|
||||
|
||||
# gui.rpy:316
|
||||
old "## Horizontal borders."
|
||||
new "## الحاشية بالعرض."
|
||||
|
||||
# gui.rpy:321
|
||||
old "## Vertical borders."
|
||||
new "## الحاضية بالطول."
|
||||
|
||||
# gui.rpy:326
|
||||
old "## What to do with unscrollable scrollbars in the gui. \"hide\" hides them, while None shows them."
|
||||
new "## ماذا سنفعل بالأشرطة التي لا يمكن سحبها؟ يمكن استعمال hide لإخفائها, او None لتكون ظاهره في كل الاوقات."
|
||||
|
||||
# gui.rpy:331
|
||||
old "## History"
|
||||
new "## الحوار السابق"
|
||||
|
||||
# gui.rpy:333
|
||||
old "## The history screen displays dialogue that the player has already dismissed."
|
||||
new "## صفحة الحوار السابق تعرض الحوارات التي سبق للاعب قرائتها."
|
||||
|
||||
# gui.rpy:335
|
||||
old "## The number of blocks of dialogue history Ren'Py will keep."
|
||||
new "## عدد فقاعات الحوار التي سيحتفظ بها رينباي في صفحة الحوار السابق."
|
||||
|
||||
# gui.rpy:338
|
||||
old "## The height of a history screen entry, or None to make the height variable at the cost of performance."
|
||||
new "## ارتفاع صفحة عرض الحوار السابق, او None ليكون الإرتفاع متغير مع ملاحظة انه يؤثر في الأداء العام."
|
||||
|
||||
# gui.rpy:342
|
||||
old "## The position, width, and alignment of the label giving the name of the speaking character."
|
||||
new "## الموقع, العرض, و اتجاه النص الخاص باسم الشخصية المعروض."
|
||||
|
||||
# gui.rpy:349
|
||||
old "## The position, width, and alignment of the dialogue text."
|
||||
new "## الموقع, العرض و اتجاه النص الخاص بالحوار المعروض."
|
||||
|
||||
# gui.rpy:356
|
||||
old "## NVL-Mode"
|
||||
new "## NVL-Mode أسلوب عرض الحوار الروائي."
|
||||
|
||||
# gui.rpy:358
|
||||
old "## The NVL-mode screen displays the dialogue spoken by NVL-mode characters."
|
||||
new "## شاشة عرض الأسلوب الروائي تعرض ما قالته شخصيات تم تخصيصها للحوار الروائي."
|
||||
|
||||
# gui.rpy:360
|
||||
old "## The borders of the background of the NVL-mode background window."
|
||||
new "## حاشية الخلفية المستخدمة في نافذة الحوار الخاصة بالحوار الروائي."
|
||||
|
||||
# gui.rpy:363
|
||||
old "## The height of an NVL-mode entry. Set this to None to have the entries dynamically adjust height."
|
||||
new "## إرتفاع النافذة الخاصة بعرض الحوار الروائي. استعمل None لتناسب النافذة الحوار المعروض لكل فقاعه حوار."
|
||||
|
||||
# gui.rpy:367
|
||||
old "## The spacing between NVL-mode entries when gui.nvl_height is None, and between NVL-mode entries and an NVL-mode menu."
|
||||
new "## المساحه بين العناصر عندما يكون النظام الروائي يستعمل متغير None في سطر gui.nvl_height و المساحه بين اجزاء الحوار والقائمة في الحوار الروائي."
|
||||
|
||||
# gui.rpy:384
|
||||
old "## The position, width, and alignment of nvl_thought text (the text said by the nvl_narrator character.)"
|
||||
new "## موقع, عرض و اتجاه النص الخاص بشخصية التفكير nvl_thought, الحوار المنطوق من قبل شخصية nvl_narrator تم تحديدها في ملف حوار اللعبة."
|
||||
|
||||
# gui.rpy:391
|
||||
old "## The position of nvl menu_buttons."
|
||||
new "## موقع ازرار القائمة في nvl menu_buttons."
|
||||
|
||||
# gui.rpy:403
|
||||
old "## This increases the size of the quick buttons to make them easier to touch on tablets and phones."
|
||||
new "## يقوم بتكبير المساحه الخاصة بازرار الاختصارات ليكون استعمالها اسهل على شاشات الاجهزة المحمولة و التابلت."
|
||||
|
||||
# gui.rpy:409
|
||||
old "## This changes the size and spacing of various GUI elements to ensure they are easily visible on phones."
|
||||
new "## يقوم بتغيير المساحات بين العناصر في اماكن مختلفة من الواجهة لتكون اسهل في الرؤية و الاستعمال على شاشات المحمول و التابلت."
|
||||
|
||||
# gui.rpy:413
|
||||
old "## Font sizes."
|
||||
new "## حجم النص."
|
||||
|
||||
# gui.rpy:421
|
||||
old "## Adjust the location of the textbox."
|
||||
new "## تحديد مكان مربع الحوار."
|
||||
|
||||
# gui.rpy:427
|
||||
old "## Change the size and spacing of items in the game menu."
|
||||
new "## تغيير الحجم و المساحه بين العناصر في قائمة اللعبة."
|
||||
|
||||
# gui.rpy:436
|
||||
old "## File button layout."
|
||||
new "## ترتيب ازرار الملفات."
|
||||
|
||||
# gui.rpy:440
|
||||
old "## NVL-mode."
|
||||
new "## NVL-mode نظام الحوار الروائي."
|
||||
|
||||
# gui.rpy:456
|
||||
old "## Quick buttons."
|
||||
new "## إختصارات."
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
|
||||
translate arabic strings:
|
||||
|
||||
# _layout/classic_joystick_preferences.rpym:94
|
||||
old "Joystick Mapping"
|
||||
new "خيارات عصى التحكم"
|
||||
|
||||
# _layout/classic_load_save.rpym:138
|
||||
old "Empty Slot."
|
||||
new "خانة فارغة"
|
||||
|
||||
# _layout/classic_load_save.rpym:170
|
||||
old "a"
|
||||
new "a"
|
||||
|
||||
# _layout/classic_load_save.rpym:179
|
||||
old "q"
|
||||
new "q"
|
||||
|
||||
# _compat/gamemenu.rpym:355
|
||||
old "Previous"
|
||||
new "السابق"
|
||||
|
||||
# _compat/gamemenu.rpym:362
|
||||
old "Next"
|
||||
new "التالي"
|
||||
|
||||
@@ -1,195 +0,0 @@
|
||||
|
||||
translate arabic strings:
|
||||
|
||||
# options.rpy:1
|
||||
old "## This file contains options that can be changed to customize your game."
|
||||
new "## هذا الملف يحتوي على الخيارات التي تستطيع تعديلها لتغيير محتويات لعبتك."
|
||||
|
||||
# options.rpy:4
|
||||
old "## Lines beginning with two '#' marks are comments, and you shouldn't uncomment them. Lines beginning with a single '#' mark are commented-out code, and you may want to uncomment them when appropriate."
|
||||
new "## الأسطر التي تبدأ بهذا الشعار مرتين'#' هي أسطر مقتبسه و لا يفترض عليك تغييرها. الأسطر التي تحتوي على '#' واحده هي أسطر برمجة يمكنك الغاء الاقتباس عندها لتفعيلها."
|
||||
|
||||
# options.rpy:10
|
||||
old "## Basics"
|
||||
new "## الأساسيات"
|
||||
|
||||
# options.rpy:12
|
||||
old "## A human-readable name of the game. This is used to set the default window title, and shows up in the interface and error reports."
|
||||
new "## الإسم الرسمي للعبه. يتم استعمال هذا السطر كإسم النافذة و يظهرفي واجهة النظام التشغيلية و ملفات حصر الأخطاء."
|
||||
|
||||
# options.rpy:15
|
||||
old "## The _() surrounding the string marks it as eligible for translation."
|
||||
new "## رمز _() حول النصوص يجعلها قابلة للترجمة."
|
||||
|
||||
# options.rpy:17
|
||||
old "Ren'Py 7 Default GUI"
|
||||
new "الواجهة التشغيلية القياسية لـ رينباي7"
|
||||
|
||||
# options.rpy:20
|
||||
old "## Determines if the title given above is shown on the main menu screen. Set this to False to hide the title."
|
||||
new "## يحدد إذا ما تم إظهار العنوان في القائمة الرئيسية. لإخفاء العنوان اجعله False."
|
||||
|
||||
# options.rpy:26
|
||||
old "## The version of the game."
|
||||
new "## نسخه اللعبة."
|
||||
|
||||
# options.rpy:31
|
||||
old "## Text that is placed on the game's about screen. To insert a blank line between paragraphs, write \\n\\n."
|
||||
new "## النص الظاهر على شاشة اللعبه. لإظهار سطر فارغ بين اجزاء النص اكتب \\n\\n."
|
||||
|
||||
# options.rpy:37
|
||||
old "## A short name for the game used for executables and directories in the built distribution. This must be ASCII-only, and must not contain spaces, colons, or semicolons."
|
||||
new "## اسم مختصر للعبه يتم استعماله في ملفات التشغيل و نسخ النشر. يجب ان يحتوي على احرف انجليزية فقط, دون فراغات ولا فواصل ولا فواصل منقوطة."
|
||||
|
||||
# options.rpy:44
|
||||
old "## Sounds and music"
|
||||
new "## الصوت و الموسيقى"
|
||||
|
||||
# options.rpy:46
|
||||
old "## These three variables control which mixers are shown to the player by default. Setting one of these to False will hide the appropriate mixer."
|
||||
new "## هذه المتغيرات الثلاثة تحدد معالجات الأصوات الظاهره بشكل قياسي للاعب. إلغاء أحدها يجعله يختفي من الواجهة عن طريق اختيار False."
|
||||
|
||||
# options.rpy:55
|
||||
old "## To allow the user to play a test sound on the sound or voice channel, uncomment a line below and use it to set a sample sound to play."
|
||||
new "## يسمح للاعب ان يسمع صوتا لاختبار ارتفاع الصوت او النطق, إمسح الاقتباس عن السطر التالي ليتم تفعيل زر العينة الصوتية."
|
||||
|
||||
# options.rpy:62
|
||||
old "## Uncomment the following line to set an audio file that will be played while the player is at the main menu. This file will continue playing into the game, until it is stopped or another file is played."
|
||||
new "## Uncomment the following line to set an audio file that will be played while the player is at the main menu. This file will continue playing into the game, until it is stopped or another file is played."
|
||||
|
||||
# options.rpy:69
|
||||
old "## Transitions"
|
||||
new "## الإنتقال"
|
||||
|
||||
# options.rpy:71
|
||||
old "## These variables set transitions that are used when certain events occur. Each variable should be set to a transition, or None to indicate that no transition should be used."
|
||||
new "## These variables set transitions that are used when certain events occur. Each variable should be set to a transition, or None to indicate that no transition should be used."
|
||||
|
||||
# options.rpy:75
|
||||
old "## Entering or exiting the game menu."
|
||||
new "## الدخول او الخروج من قائمة اللعبة."
|
||||
|
||||
# options.rpy:81
|
||||
old "## A transition that is used after a game has been loaded."
|
||||
new "## الإنتقال الذي يحصل بعد ان تنتهي اللعبة من الإقلاع."
|
||||
|
||||
# options.rpy:86
|
||||
old "## Used when entering the main menu after the game has ended."
|
||||
new "## يظهر عند الدخول إلى القائمة الرئيسية بعد انتهاء اللعبة."
|
||||
|
||||
# options.rpy:91
|
||||
old "## A variable to set the transition used when the game starts does not exist. Instead, use a with statement after showing the initial scene."
|
||||
new "## A variable to set the transition used when the game starts does not exist. Instead, use a with statement after showing the initial scene."
|
||||
|
||||
# options.rpy:96
|
||||
old "## Window management"
|
||||
new "## خيارات النافذة"
|
||||
|
||||
# options.rpy:98
|
||||
old "## This controls when the dialogue window is displayed. If \"show\", it is always displayed. If \"hide\", it is only displayed when dialogue is present. If \"auto\", the window is hidden before scene statements and shown again once dialogue is displayed."
|
||||
new "## This controls when the dialogue window is displayed. If \"show\", it is always displayed. If \"hide\", it is only displayed when dialogue is present. If \"auto\", the window is hidden before scene statements and shown again once dialogue is displayed."
|
||||
|
||||
# options.rpy:103
|
||||
old "## After the game has started, this can be changed with the \"window show\", \"window hide\", and \"window auto\" statements."
|
||||
new "## After the game has started, this can be changed with the \"window show\", \"window hide\", and \"window auto\" statements."
|
||||
|
||||
# options.rpy:109
|
||||
old "## Transitions used to show and hide the dialogue window"
|
||||
new "## الإنتقالات البصرية المستخدمه عند إظهار و إخفاء مربع الحوار"
|
||||
|
||||
# options.rpy:115
|
||||
old "## Preference defaults"
|
||||
new "## الخيارات القياسية"
|
||||
|
||||
# options.rpy:117
|
||||
old "## Controls the default text speed. The default, 0, is infinite, while any other number is the number of characters per second to type out."
|
||||
new "## Controls the default text speed. The default, 0, is infinite, while any other number is the number of characters per second to type out."
|
||||
|
||||
# options.rpy:123
|
||||
old "## The default auto-forward delay. Larger numbers lead to longer waits, with 0 to 30 being the valid range."
|
||||
new "## The default auto-forward delay. Larger numbers lead to longer waits, with 0 to 30 being the valid range."
|
||||
|
||||
# options.rpy:129
|
||||
old "## Save directory"
|
||||
new "## مجلد الحفظ"
|
||||
|
||||
# options.rpy:131
|
||||
old "## Controls the platform-specific place Ren'Py will place the save files for this game. The save files will be placed in:"
|
||||
new "## Controls the platform-specific place Ren'Py will place the save files for this game. The save files will be placed in:"
|
||||
|
||||
# options.rpy:134
|
||||
old "## Windows: %APPDATA\\RenPy\\<config.save_directory>"
|
||||
new "## Windows: %APPDATA\\RenPy\\<config.save_directory>"
|
||||
|
||||
# options.rpy:136
|
||||
old "## Macintosh: $HOME/Library/RenPy/<config.save_directory>"
|
||||
new "## Macintosh: $HOME/Library/RenPy/<config.save_directory>"
|
||||
|
||||
# options.rpy:138
|
||||
old "## Linux: $HOME/.renpy/<config.save_directory>"
|
||||
new "## Linux: $HOME/.renpy/<config.save_directory>"
|
||||
|
||||
# options.rpy:140
|
||||
old "## This generally should not be changed, and if it is, should always be a literal string, not an expression."
|
||||
new "## This generally should not be changed, and if it is, should always be a literal string, not an expression."
|
||||
|
||||
# options.rpy:146
|
||||
old "## Icon ########################################################################'"
|
||||
new "## أيقونة ########################################################################'"
|
||||
|
||||
# options.rpy:148
|
||||
old "## The icon displayed on the taskbar or dock."
|
||||
new "## الأيقونة الظاهرة في شريط البرامج."
|
||||
|
||||
# options.rpy:153
|
||||
old "## Build configuration"
|
||||
new "## معلومات ملف النشر"
|
||||
|
||||
# options.rpy:155
|
||||
old "## This section controls how Ren'Py turns your project into distribution files."
|
||||
new "## هذا الجزء يتحكم بالمعلومات التي يستعملها رينباي لتحويل مشروعك إلى ملفات يمكن نشرها."
|
||||
|
||||
# options.rpy:160
|
||||
old "## The following functions take file patterns. File patterns are case- insensitive, and matched against the path relative to the base directory, with and without a leading /. If multiple patterns match, the first is used."
|
||||
new "## The following functions take file patterns. File patterns are case- insensitive, and matched against the path relative to the base directory, with and without a leading /. If multiple patterns match, the first is used."
|
||||
|
||||
# options.rpy:165
|
||||
old "## In a pattern:"
|
||||
new "## In a pattern:"
|
||||
|
||||
# options.rpy:167
|
||||
old "## / is the directory separator."
|
||||
new "## / is the directory separator."
|
||||
|
||||
# options.rpy:169
|
||||
old "## * matches all characters, except the directory separator."
|
||||
new "## * matches all characters, except the directory separator."
|
||||
|
||||
# options.rpy:171
|
||||
old "## ** matches all characters, including the directory separator."
|
||||
new "## ** matches all characters, including the directory separator."
|
||||
|
||||
# options.rpy:173
|
||||
old "## For example, \"*.txt\" matches txt files in the base directory, \"game/**.ogg\" matches ogg files in the game directory or any of its subdirectories, and \"**.psd\" matches psd files anywhere in the project."
|
||||
new "## For example, \"*.txt\" matches txt files in the base directory, \"game/**.ogg\" matches ogg files in the game directory or any of its subdirectories, and \"**.psd\" matches psd files anywhere in the project."
|
||||
|
||||
# options.rpy:177
|
||||
old "## Classify files as None to exclude them from the built distributions."
|
||||
new "## Classify files as None to exclude them from the built distributions."
|
||||
|
||||
# options.rpy:185
|
||||
old "## To archive files, classify them as 'archive'."
|
||||
new "## To archive files, classify them as 'archive'."
|
||||
|
||||
# options.rpy:190
|
||||
old "## Files matching documentation patterns are duplicated in a mac app build, so they appear in both the app and the zip file."
|
||||
new "## Files matching documentation patterns are duplicated in a mac app build, so they appear in both the app and the zip file."
|
||||
|
||||
# options.rpy:196
|
||||
old "## A Google Play license key is required to download expansion files and perform in-app purchases. It can be found on the \"Services & APIs\" page of the Google Play developer console."
|
||||
new "## A Google Play license key is required to download expansion files and perform in-app purchases. It can be found on the \"Services & APIs\" page of the Google Play developer console."
|
||||
|
||||
# options.rpy:203
|
||||
old "## The username and project name associated with an itch.io project, separated by a slash."
|
||||
new "## The username and project name associated with an itch.io project, separated by a slash."
|
||||
|
||||
@@ -1,642 +0,0 @@
|
||||
|
||||
translate arabic strings:
|
||||
|
||||
# screens.rpy:9
|
||||
old "## Styles"
|
||||
new "## Styles"
|
||||
|
||||
# screens.rpy:87
|
||||
old "## In-game screens"
|
||||
new "## In-game screens"
|
||||
|
||||
# screens.rpy:91
|
||||
old "## Say screen"
|
||||
new "## Say screen"
|
||||
|
||||
# screens.rpy:93
|
||||
old "## The say screen is used to display dialogue to the player. It takes two parameters, who and what, which are the name of the speaking character and the text to be displayed, respectively. (The who parameter can be None if no name is given.)"
|
||||
new "## The say screen is used to display dialogue to the player. It takes two parameters, who and what, which are the name of the speaking character and the text to be displayed, respectively. (The who parameter can be None if no name is given.)"
|
||||
|
||||
# screens.rpy:98
|
||||
old "## This screen must create a text displayable with id \"what\", as Ren'Py uses this to manage text display. It can also create displayables with id \"who\" and id \"window\" to apply style properties."
|
||||
new "## This screen must create a text displayable with id \"what\", as Ren'Py uses this to manage text display. It can also create displayables with id \"who\" and id \"window\" to apply style properties."
|
||||
|
||||
# screens.rpy:102
|
||||
old "## https://www.renpy.org/doc/html/screen_special.html#say"
|
||||
new "## https://www.renpy.org/doc/html/screen_special.html#say"
|
||||
|
||||
# screens.rpy:169
|
||||
old "## Input screen"
|
||||
new "## Input screen"
|
||||
|
||||
# screens.rpy:171
|
||||
old "## This screen is used to display renpy.input. The prompt parameter is used to pass a text prompt in."
|
||||
new "## This screen is used to display renpy.input. The prompt parameter is used to pass a text prompt in."
|
||||
|
||||
# screens.rpy:174
|
||||
old "## This screen must create an input displayable with id \"input\" to accept the various input parameters."
|
||||
new "## This screen must create an input displayable with id \"input\" to accept the various input parameters."
|
||||
|
||||
# screens.rpy:177
|
||||
old "## http://www.renpy.org/doc/html/screen_special.html#input"
|
||||
new "## http://www.renpy.org/doc/html/screen_special.html#input"
|
||||
|
||||
# screens.rpy:205
|
||||
old "## Choice screen"
|
||||
new "## Choice screen"
|
||||
|
||||
# screens.rpy:207
|
||||
old "## This screen is used to display the in-game choices presented by the menu statement. The one parameter, items, is a list of objects, each with caption and action fields."
|
||||
new "## This screen is used to display the in-game choices presented by the menu statement. The one parameter, items, is a list of objects, each with caption and action fields."
|
||||
|
||||
# screens.rpy:211
|
||||
old "## http://www.renpy.org/doc/html/screen_special.html#choice"
|
||||
new "## http://www.renpy.org/doc/html/screen_special.html#choice"
|
||||
|
||||
# screens.rpy:221
|
||||
old "## When this is true, menu captions will be spoken by the narrator. When false, menu captions will be displayed as empty buttons."
|
||||
new "## When this is true, menu captions will be spoken by the narrator. When false, menu captions will be displayed as empty buttons."
|
||||
|
||||
# screens.rpy:244
|
||||
old "## Quick Menu screen"
|
||||
new "## Quick Menu screen"
|
||||
|
||||
# screens.rpy:246
|
||||
old "## The quick menu is displayed in-game to provide easy access to the out-of-game menus."
|
||||
new "## The quick menu is displayed in-game to provide easy access to the out-of-game menus."
|
||||
|
||||
# screens.rpy:261
|
||||
old "Back"
|
||||
new "عودة"
|
||||
|
||||
# screens.rpy:262
|
||||
old "History"
|
||||
new "سجل الحوار"
|
||||
|
||||
# screens.rpy:263
|
||||
old "Skip"
|
||||
new "تخطي"
|
||||
|
||||
# screens.rpy:264
|
||||
old "Auto"
|
||||
new "تلقائي"
|
||||
|
||||
# screens.rpy:265
|
||||
old "Save"
|
||||
new "حفظ"
|
||||
|
||||
# screens.rpy:266
|
||||
old "Q.Save"
|
||||
new "حفظ سريع"
|
||||
|
||||
# screens.rpy:267
|
||||
old "Q.Load"
|
||||
new "استرجاع سريع"
|
||||
|
||||
# screens.rpy:268
|
||||
old "Prefs"
|
||||
new "خيارات"
|
||||
|
||||
# screens.rpy:271
|
||||
old "## This code ensures that the quick_menu screen is displayed in-game, whenever the player has not explicitly hidden the interface."
|
||||
new "## This code ensures that the quick_menu screen is displayed in-game, whenever the player has not explicitly hidden the interface."
|
||||
|
||||
# screens.rpy:291
|
||||
old "## Navigation screen"
|
||||
new "## Navigation screen"
|
||||
|
||||
# screens.rpy:293
|
||||
old "## This screen is included in the main and game menus, and provides navigation to other menus, and to start the game."
|
||||
new "## This screen is included in the main and game menus, and provides navigation to other menus, and to start the game."
|
||||
|
||||
# screens.rpy:308
|
||||
old "Start"
|
||||
new "إبدأ"
|
||||
|
||||
# screens.rpy:316
|
||||
old "Load"
|
||||
new "استرجاع"
|
||||
|
||||
# screens.rpy:318
|
||||
old "Preferences"
|
||||
new "خيارات"
|
||||
|
||||
# screens.rpy:322
|
||||
old "End Replay"
|
||||
new "End Replay"
|
||||
|
||||
# screens.rpy:326
|
||||
old "Main Menu"
|
||||
new "القائمة الرئيسية"
|
||||
|
||||
# screens.rpy:328
|
||||
old "About"
|
||||
new "معلومات"
|
||||
|
||||
# screens.rpy:332
|
||||
old "## Help isn't necessary or relevant to mobile devices."
|
||||
new "## Help isn't necessary or relevant to mobile devices."
|
||||
|
||||
# screens.rpy:333
|
||||
old "Help"
|
||||
new "مساعدة"
|
||||
|
||||
# screens.rpy:335
|
||||
old "## The quit button is banned on iOS and unnecessary on Android."
|
||||
new "## The quit button is banned on iOS and unnecessary on Android."
|
||||
|
||||
# screens.rpy:336
|
||||
old "Quit"
|
||||
new "خروج"
|
||||
|
||||
# screens.rpy:350
|
||||
old "## Main Menu screen"
|
||||
new "## Main Menu screen"
|
||||
|
||||
# screens.rpy:352
|
||||
old "## Used to display the main menu when Ren'Py starts."
|
||||
new "## Used to display the main menu when Ren'Py starts."
|
||||
|
||||
# screens.rpy:354
|
||||
old "## http://www.renpy.org/doc/html/screen_special.html#main-menu"
|
||||
new "## http://www.renpy.org/doc/html/screen_special.html#main-menu"
|
||||
|
||||
# screens.rpy:369
|
||||
old "## The use statement includes another screen inside this one. The actual contents of the main menu are in the navigation screen."
|
||||
new "## The use statement includes another screen inside this one. The actual contents of the main menu are in the navigation screen."
|
||||
|
||||
# screens.rpy:413
|
||||
old "## Game Menu screen"
|
||||
new "## Game Menu screen"
|
||||
|
||||
# screens.rpy:415
|
||||
old "## This lays out the basic common structure of a game menu screen. It's called with the screen title, and displays the background, title, and navigation."
|
||||
new "## This lays out the basic common structure of a game menu screen. It's called with the screen title, and displays the background, title, and navigation."
|
||||
|
||||
# screens.rpy:418
|
||||
old "## The scroll parameter can be None, or one of \"viewport\" or \"vpgrid\". This screen is intended to be used with one or more children, which are transcluded (placed) inside it."
|
||||
new "## The scroll parameter can be None, or one of \"viewport\" or \"vpgrid\". This screen is intended to be used with one or more children, which are transcluded (placed) inside it."
|
||||
|
||||
# screens.rpy:476
|
||||
old "Return"
|
||||
new "عودة"
|
||||
|
||||
# screens.rpy:539
|
||||
old "## About screen"
|
||||
new "## About screen"
|
||||
|
||||
# screens.rpy:541
|
||||
old "## This screen gives credit and copyright information about the game and Ren'Py."
|
||||
new "## This screen gives credit and copyright information about the game and Ren'Py."
|
||||
|
||||
# screens.rpy:544
|
||||
old "## There's nothing special about this screen, and hence it also serves as an example of how to make a custom screen."
|
||||
new "## There's nothing special about this screen, and hence it also serves as an example of how to make a custom screen."
|
||||
|
||||
# screens.rpy:551
|
||||
old "## This use statement includes the game_menu screen inside this one. The vbox child is then included inside the viewport inside the game_menu screen."
|
||||
new "## This use statement includes the game_menu screen inside this one. The vbox child is then included inside the viewport inside the game_menu screen."
|
||||
|
||||
# screens.rpy:561
|
||||
old "Version [config.version!t]\n"
|
||||
new "Version [config.version!t]\n"
|
||||
|
||||
# screens.rpy:563
|
||||
old "## gui.about is usually set in options.rpy."
|
||||
new "## gui.about is usually set in options.rpy."
|
||||
|
||||
# screens.rpy:567
|
||||
old "Made with {a=https://www.renpy.org/}Ren'Py{/a} [renpy.version_only].\n\n[renpy.license!t]"
|
||||
new "Made with {a=https://www.renpy.org/}Ren'Py{/a} [renpy.version_only].\n\n[renpy.license!t]"
|
||||
|
||||
# screens.rpy:570
|
||||
old "## This is redefined in options.rpy to add text to the about screen."
|
||||
new "## This is redefined in options.rpy to add text to the about screen."
|
||||
|
||||
# screens.rpy:582
|
||||
old "## Load and Save screens"
|
||||
new "## Load and Save screens"
|
||||
|
||||
# screens.rpy:584
|
||||
old "## These screens are responsible for letting the player save the game and load it again. Since they share nearly everything in common, both are implemented in terms of a third screen, file_slots."
|
||||
new "## These screens are responsible for letting the player save the game and load it again. Since they share nearly everything in common, both are implemented in terms of a third screen, file_slots."
|
||||
|
||||
# screens.rpy:588
|
||||
old "## https://www.renpy.org/doc/html/screen_special.html#save https://www.renpy.org/doc/html/screen_special.html#load"
|
||||
new "## https://www.renpy.org/doc/html/screen_special.html#save https://www.renpy.org/doc/html/screen_special.html#load"
|
||||
|
||||
# screens.rpy:607
|
||||
old "Page {}"
|
||||
new "صفحة {}"
|
||||
|
||||
# screens.rpy:607
|
||||
old "Automatic saves"
|
||||
new "الحفظ التلقائي"
|
||||
|
||||
# screens.rpy:607
|
||||
old "Quick saves"
|
||||
new "الحفظ السريع"
|
||||
|
||||
# screens.rpy:613
|
||||
old "## This ensures the input will get the enter event before any of the buttons do."
|
||||
new "## This ensures the input will get the enter event before any of the buttons do."
|
||||
|
||||
# screens.rpy:629
|
||||
old "## The grid of file slots."
|
||||
new "## The grid of file slots."
|
||||
|
||||
# screens.rpy:649
|
||||
old "{#file_time}%A, %B %d %Y, %H:%M"
|
||||
new "{#file_time}%A, %B %d %Y, %H:%M"
|
||||
|
||||
# screens.rpy:649
|
||||
old "empty slot"
|
||||
new "خانة فارغة"
|
||||
|
||||
# screens.rpy:657
|
||||
old "## Buttons to access other pages."
|
||||
new "## Buttons to access other pages."
|
||||
|
||||
# screens.rpy:666
|
||||
old "<"
|
||||
new "<"
|
||||
|
||||
# screens.rpy:668
|
||||
old "{#auto_page}A"
|
||||
new "{#auto_page}ت"
|
||||
|
||||
# screens.rpy:670
|
||||
old "{#quick_page}Q"
|
||||
new "{#quick_page}س"
|
||||
|
||||
# screens.rpy:676
|
||||
old ">"
|
||||
new ">"
|
||||
|
||||
# screens.rpy:711
|
||||
old "## Preferences screen"
|
||||
new "## Preferences screen"
|
||||
|
||||
# screens.rpy:713
|
||||
old "## The preferences screen allows the player to configure the game to better suit themselves."
|
||||
new "## The preferences screen allows the player to configure the game to better suit themselves."
|
||||
|
||||
# screens.rpy:716
|
||||
old "## https://www.renpy.org/doc/html/screen_special.html#preferences"
|
||||
new "## https://www.renpy.org/doc/html/screen_special.html#preferences"
|
||||
|
||||
# screens.rpy:738
|
||||
old "Display"
|
||||
new "عرض"
|
||||
|
||||
# screens.rpy:739
|
||||
old "Window"
|
||||
new "نافذة"
|
||||
|
||||
# screens.rpy:740
|
||||
old "Fullscreen"
|
||||
new "ملء الشاشة"
|
||||
|
||||
# screens.rpy:744
|
||||
old "Rollback Side"
|
||||
new "Rollback Side"
|
||||
|
||||
# screens.rpy:745
|
||||
old "Disable"
|
||||
new "غير مفعّل"
|
||||
|
||||
# screens.rpy:746
|
||||
old "Left"
|
||||
new "يسار"
|
||||
|
||||
# screens.rpy:747
|
||||
old "Right"
|
||||
new "يمين"
|
||||
|
||||
# screens.rpy:752
|
||||
old "Unseen Text"
|
||||
new "النصوص التي لم تُشاهَد بعد"
|
||||
|
||||
# screens.rpy:753
|
||||
old "After Choices"
|
||||
new "بعد الإختيار"
|
||||
|
||||
# screens.rpy:754
|
||||
old "Transitions"
|
||||
new "التأثيرات البصرية"
|
||||
|
||||
# screens.rpy:756
|
||||
old "## Additional vboxes of type \"radio_pref\" or \"check_pref\" can be added here, to add additional creator-defined preferences."
|
||||
new "## Additional vboxes of type \"radio_pref\" or \"check_pref\" can be added here, to add additional creator-defined preferences."
|
||||
|
||||
# screens.rpy:767
|
||||
old "Text Speed"
|
||||
new "سرعة النص"
|
||||
|
||||
# screens.rpy:771
|
||||
old "Auto-Forward Time"
|
||||
new "وقت التسريع التلقائي"
|
||||
|
||||
# screens.rpy:778
|
||||
old "Music Volume"
|
||||
new "مستوى الموسيقى"
|
||||
|
||||
# screens.rpy:785
|
||||
old "Sound Volume"
|
||||
new "مستوى الأصوات"
|
||||
|
||||
# screens.rpy:791
|
||||
old "Test"
|
||||
new "تجربة"
|
||||
|
||||
# screens.rpy:795
|
||||
old "Voice Volume"
|
||||
new "مستوى صوت الكلام"
|
||||
|
||||
# screens.rpy:806
|
||||
old "Mute All"
|
||||
new "كتم الكل"
|
||||
|
||||
# screens.rpy:882
|
||||
old "## History screen"
|
||||
new "## History screen"
|
||||
|
||||
# screens.rpy:884
|
||||
old "## This is a screen that displays the dialogue history to the player. While there isn't anything special about this screen, it does have to access the dialogue history stored in _history_list."
|
||||
new "## This is a screen that displays the dialogue history to the player. While there isn't anything special about this screen, it does have to access the dialogue history stored in _history_list."
|
||||
|
||||
# screens.rpy:888
|
||||
old "## https://www.renpy.org/doc/html/history.html"
|
||||
new "## https://www.renpy.org/doc/html/history.html"
|
||||
|
||||
# screens.rpy:894
|
||||
old "## Avoid predicting this screen, as it can be very large."
|
||||
new "## Avoid predicting this screen, as it can be very large."
|
||||
|
||||
# screens.rpy:905
|
||||
old "## This lays things out properly if history_height is None."
|
||||
new "## This lays things out properly if history_height is None."
|
||||
|
||||
# screens.rpy:914
|
||||
old "## Take the color of the who text from the Character, if set."
|
||||
new "## Take the color of the who text from the Character, if set."
|
||||
|
||||
# screens.rpy:921
|
||||
old "The dialogue history is empty."
|
||||
new "The dialogue history is empty."
|
||||
|
||||
# screens.rpy:965
|
||||
old "## Help screen"
|
||||
new "## Help screen"
|
||||
|
||||
# screens.rpy:967
|
||||
old "## A screen that gives information about key and mouse bindings. It uses other screens (keyboard_help, mouse_help, and gamepad_help) to display the actual help."
|
||||
new "## A screen that gives information about key and mouse bindings. It uses other screens (keyboard_help, mouse_help, and gamepad_help) to display the actual help."
|
||||
|
||||
# screens.rpy:986
|
||||
old "Keyboard"
|
||||
new "لوحة المفاتيح"
|
||||
|
||||
# screens.rpy:987
|
||||
old "Mouse"
|
||||
new "الفأرة"
|
||||
|
||||
# screens.rpy:990
|
||||
old "Gamepad"
|
||||
new "عصا اللعب"
|
||||
|
||||
# screens.rpy:1003
|
||||
old "Enter"
|
||||
new "Enter"
|
||||
|
||||
# screens.rpy:1004
|
||||
old "Advances dialogue and activates the interface."
|
||||
new "التقدم في الحوار والتفاعل مع الواجهة."
|
||||
|
||||
# screens.rpy:1007
|
||||
old "Space"
|
||||
new "Space"
|
||||
|
||||
# screens.rpy:1008
|
||||
old "Advances dialogue without selecting choices."
|
||||
new "التقدم في الحوار دون تحديد الخيارات."
|
||||
|
||||
# screens.rpy:1011
|
||||
old "Arrow Keys"
|
||||
new "مفاتيح الأسهم"
|
||||
|
||||
# screens.rpy:1012
|
||||
old "Navigate the interface."
|
||||
new "لتصفح الواجهة."
|
||||
|
||||
# screens.rpy:1015
|
||||
old "Escape"
|
||||
new "Escape"
|
||||
|
||||
# screens.rpy:1016
|
||||
old "Accesses the game menu."
|
||||
new "للوصول لقائمة اللعبة."
|
||||
|
||||
# screens.rpy:1019
|
||||
old "Ctrl"
|
||||
new "Ctrl"
|
||||
|
||||
# screens.rpy:1020
|
||||
old "Skips dialogue while held down."
|
||||
new "لتخطي الحوار عند الإستمرار بالضغط."
|
||||
|
||||
# screens.rpy:1023
|
||||
old "Tab"
|
||||
new "Tab"
|
||||
|
||||
# screens.rpy:1024
|
||||
old "Toggles dialogue skipping."
|
||||
new "للتبديل بين أنظمة تخطي الحوار."
|
||||
|
||||
# screens.rpy:1027
|
||||
old "Page Up"
|
||||
new "Page Up"
|
||||
|
||||
# screens.rpy:1028
|
||||
old "Rolls back to earlier dialogue."
|
||||
new "للعودة للنص السابق."
|
||||
|
||||
# screens.rpy:1031
|
||||
old "Page Down"
|
||||
new "Page Down"
|
||||
|
||||
# screens.rpy:1032
|
||||
old "Rolls forward to later dialogue."
|
||||
new "للإستمرار للنص اللاحق."
|
||||
|
||||
# screens.rpy:1036
|
||||
old "Hides the user interface."
|
||||
new "لإخفاء الواجهة."
|
||||
|
||||
# screens.rpy:1040
|
||||
old "Takes a screenshot."
|
||||
new "إلتقاط صورة من الشاشة."
|
||||
|
||||
# screens.rpy:1044
|
||||
old "Toggles assistive {a=https://www.renpy.org/l/voicing}self-voicing{/a}."
|
||||
new "تفعيل مساعدة {a=https://www.renpy.org/l/voicing}الصوت التلقائي{/a}."
|
||||
|
||||
# screens.rpy:1050
|
||||
old "Left Click"
|
||||
new "النقر بالزر الأيسر"
|
||||
|
||||
# screens.rpy:1054
|
||||
old "Middle Click"
|
||||
new "النقر بالزر الأوسط"
|
||||
|
||||
# screens.rpy:1058
|
||||
old "Right Click"
|
||||
new "النقر بالزر الأيمن"
|
||||
|
||||
# screens.rpy:1062
|
||||
old "Mouse Wheel Up"
|
||||
new "تحريك عجلة الفأرة لأعلى"
|
||||
|
||||
# screens.rpy:1066
|
||||
old "Mouse Wheel Down"
|
||||
new "تحريك عجلة الفأرة لأسفل"
|
||||
|
||||
# screens.rpy:1073
|
||||
old "Right Trigger\nA/Bottom Button"
|
||||
new "Right Trigger\nA/Bottom Button"
|
||||
|
||||
# screens.rpy:1074
|
||||
old "Advance dialogue and activates the interface."
|
||||
new "التقدم في الحوار والتفاعل مع الواجهة."
|
||||
|
||||
# screens.rpy:1078
|
||||
old "Roll back to earlier dialogue."
|
||||
new "للعودة للنص السابق."
|
||||
|
||||
# screens.rpy:1081
|
||||
old "Right Shoulder"
|
||||
new "Right Shoulder"
|
||||
|
||||
# screens.rpy:1082
|
||||
old "Roll forward to later dialogue."
|
||||
new "للإستمرار للنص اللاحق."
|
||||
|
||||
# screens.rpy:1085
|
||||
old "D-Pad, Sticks"
|
||||
new "D-Pad, Sticks"
|
||||
|
||||
# screens.rpy:1089
|
||||
old "Start, Guide"
|
||||
new "Start, Guide"
|
||||
|
||||
# screens.rpy:1090
|
||||
old "Access the game menu."
|
||||
new "Access the game menu."
|
||||
|
||||
# screens.rpy:1093
|
||||
old "Y/Top Button"
|
||||
new "Y/Top Button"
|
||||
|
||||
# screens.rpy:1096
|
||||
old "Calibrate"
|
||||
new "Calibrate"
|
||||
|
||||
# screens.rpy:1124
|
||||
old "## Additional screens"
|
||||
new "## Additional screens"
|
||||
|
||||
# screens.rpy:1128
|
||||
old "## Confirm screen"
|
||||
new "## Confirm screen"
|
||||
|
||||
# screens.rpy:1130
|
||||
old "## The confirm screen is called when Ren'Py wants to ask the player a yes or no question."
|
||||
new "## The confirm screen is called when Ren'Py wants to ask the player a yes or no question."
|
||||
|
||||
# screens.rpy:1133
|
||||
old "## http://www.renpy.org/doc/html/screen_special.html#confirm"
|
||||
new "## http://www.renpy.org/doc/html/screen_special.html#confirm"
|
||||
|
||||
# screens.rpy:1137
|
||||
old "## Ensure other screens do not get input while this screen is displayed."
|
||||
new "## Ensure other screens do not get input while this screen is displayed."
|
||||
|
||||
# screens.rpy:1161
|
||||
old "Yes"
|
||||
new "نعم"
|
||||
|
||||
# screens.rpy:1162
|
||||
old "No"
|
||||
new "لا"
|
||||
|
||||
# screens.rpy:1164
|
||||
old "## Right-click and escape answer \"no\"."
|
||||
new "## Right-click and escape answer \"no\"."
|
||||
|
||||
# screens.rpy:1191
|
||||
old "## Skip indicator screen"
|
||||
new "## Skip indicator screen"
|
||||
|
||||
# screens.rpy:1193
|
||||
old "## The skip_indicator screen is displayed to indicate that skipping is in progress."
|
||||
new "## The skip_indicator screen is displayed to indicate that skipping is in progress."
|
||||
|
||||
# screens.rpy:1196
|
||||
old "## https://www.renpy.org/doc/html/screen_special.html#skip-indicator"
|
||||
new "## https://www.renpy.org/doc/html/screen_special.html#skip-indicator"
|
||||
|
||||
# screens.rpy:1208
|
||||
old "Skipping"
|
||||
new "جاري التخطي"
|
||||
|
||||
# screens.rpy:1215
|
||||
old "## This transform is used to blink the arrows one after another."
|
||||
new "## This transform is used to blink the arrows one after another."
|
||||
|
||||
# screens.rpy:1247
|
||||
old "## Notify screen"
|
||||
new "## Notify screen"
|
||||
|
||||
# screens.rpy:1249
|
||||
old "## The notify screen is used to show the player a message. (For example, when the game is quicksaved or a screenshot has been taken.)"
|
||||
new "## The notify screen is used to show the player a message. (For example, when the game is quicksaved or a screenshot has been taken.)"
|
||||
|
||||
# screens.rpy:1252
|
||||
old "## https://www.renpy.org/doc/html/screen_special.html#notify-screen"
|
||||
new "## https://www.renpy.org/doc/html/screen_special.html#notify-screen"
|
||||
|
||||
# screens.rpy:1286
|
||||
old "## NVL screen"
|
||||
new "## NVL screen"
|
||||
|
||||
# screens.rpy:1288
|
||||
old "## This screen is used for NVL-mode dialogue and menus."
|
||||
new "## This screen is used for NVL-mode dialogue and menus."
|
||||
|
||||
# screens.rpy:1290
|
||||
old "## http://www.renpy.org/doc/html/screen_special.html#nvl"
|
||||
new "## http://www.renpy.org/doc/html/screen_special.html#nvl"
|
||||
|
||||
# screens.rpy:1301
|
||||
old "## Displays dialogue in either a vpgrid or the vbox."
|
||||
new "## Displays dialogue in either a vpgrid or the vbox."
|
||||
|
||||
# screens.rpy:1314
|
||||
old "## Displays the menu, if given. The menu may be displayed incorrectly if config.narrator_menu is set to True, as it is above."
|
||||
new "## Displays the menu, if given. The menu may be displayed incorrectly if config.narrator_menu is set to True, as it is above."
|
||||
|
||||
# screens.rpy:1344
|
||||
old "## This controls the maximum number of NVL-mode entries that can be displayed at once."
|
||||
new "## This controls the maximum number of NVL-mode entries that can be displayed at once."
|
||||
|
||||
# screens.rpy:1406
|
||||
old "## Mobile Variants"
|
||||
new "## Mobile Variants"
|
||||
|
||||
# screens.rpy:1413
|
||||
old "## Since a mouse may not be present, we replace the quick menu with a version that uses fewer and bigger buttons that are easier to touch."
|
||||
new "## Since a mouse may not be present, we replace the quick menu with a version that uses fewer and bigger buttons that are easier to touch."
|
||||
|
||||
# screens.rpy:1429
|
||||
old "Menu"
|
||||
new "Menu"
|
||||
@@ -1,85 +0,0 @@
|
||||
# هذا الملف يحتوي على كل نصوص اللعبه
|
||||
|
||||
# استعمل السطر التالي لإظهار الصور في شاشة اللعب
|
||||
# image eileen happy = "eileen_happy.png"
|
||||
|
||||
# من هي شخصيات هذه اللعبه؟
|
||||
define e = Character('إيلين', color="#c8ffc8")
|
||||
|
||||
# اللعبه تبدأ هنا
|
||||
label start:
|
||||
|
||||
e "لقد بدأت حكاية رينباي جديدة."
|
||||
|
||||
e "كل ما عليك فعله هو إضافة نصوص و صور و إرسالها للعالم!"
|
||||
|
||||
return
|
||||
|
||||
|
||||
########################################################### من اليمين الى اليسار
|
||||
|
||||
define config.rtl = True
|
||||
|
||||
define gui.textalign = 1.0
|
||||
define gui.button_text_xalign = 1.0
|
||||
define gui.prompt_text_xalign = 1.0
|
||||
define gui.navigation_xpos = 240
|
||||
|
||||
define gui.name_xalign = 1.0
|
||||
define gui.dialogue_text_xalign = 1.0
|
||||
define gui.button_text_xalign = 1.0
|
||||
define gui.main_menu_text_xalign = 1.0
|
||||
define gui.history_name_xalign = 0.0
|
||||
define gui.history_text_xalign = 1.0
|
||||
define gui.nvl_name_xalign = 0.0
|
||||
define gui.nvl_text_xalign = 1.0
|
||||
define gui.nvl_thought_xalign = 1.0
|
||||
define gui.nvl_button_xalign = 1.0
|
||||
|
||||
define gui.help_label_text_xalign = 0.0
|
||||
|
||||
define gui.name_xpos = gui.scale(1040)
|
||||
define gui.dialogue_xpos = gui.scale(1012)
|
||||
define gui.history_name_xpos = gui.scale(763)
|
||||
define gui.history_text_xpos = gui.scale(748)
|
||||
define gui.nvl_name_xpos = gui.scale(850)
|
||||
define gui.nvl_text_xpos = gui.scale(830)
|
||||
define gui.nvl_thought_xpos = gui.scale(1040)
|
||||
define gui.nvl_button_xpos = gui.scale(830)
|
||||
|
||||
style game_menu_label:
|
||||
xalign 1.0
|
||||
xoffset gui.scale(-50)
|
||||
|
||||
style navigation_vbox:
|
||||
xanchor 1.0
|
||||
|
||||
style return_button:
|
||||
xanchor 1.0
|
||||
|
||||
style radio_button:
|
||||
xalign 1.0
|
||||
|
||||
style radio_label:
|
||||
xalign 1.0
|
||||
|
||||
style check_button:
|
||||
xalign 1.0
|
||||
|
||||
style check_label:
|
||||
xalign 1.0
|
||||
|
||||
style slider_label:
|
||||
xpos gui.scale(350)
|
||||
xalign 1.0
|
||||
|
||||
style help_hbox:
|
||||
box_reverse True
|
||||
xalign 1.0
|
||||
spacing gui.scale(20)
|
||||
|
||||
style help_label_text:
|
||||
xalign 0.0
|
||||
|
||||
style mute_all_button:
|
||||
xalign 0.0
|
||||
@@ -1,7 +0,0 @@
|
||||
translate arabic python:
|
||||
gui.REGULAR_FONT = "DejaVuSans.ttf"
|
||||
gui.LIGHT_FONT = "DejaVuSans.ttf"
|
||||
gui.FONT_SCALE = .9
|
||||
gui.REGULAR_BOLD = True
|
||||
|
||||
config.rtl = True
|
||||