Compare commits
310 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 37e8fd19cd | |||
| f600e6a24b | |||
| ca9009f5fe | |||
| 9a299a9b38 | |||
| 845ae6e7ba | |||
| 8f706107ac | |||
| d489199e00 | |||
| bf023dc2e3 | |||
| ac6b04b5e3 | |||
| a34de5d601 | |||
| b9900776a8 | |||
| 12a444c11f | |||
| 433473e53e | |||
| d5f889767a | |||
| 9873dd487c | |||
| ec8bed61f1 | |||
| d76971385d | |||
| b87fed5541 | |||
| bd8d3dbc38 | |||
| 6022e3fa2b | |||
| c5c8a6e20e | |||
| 3306bc848a | |||
| 2911ef54e5 | |||
| cc54d1970b | |||
| e6915fffd3 | |||
| 964d746f6d | |||
| de6af43d74 | |||
| 0dc1a6e46c | |||
| 4098830804 | |||
| 304ab15b8f | |||
| 16fa9410db | |||
| 9ff69de20c | |||
| cd50f1ee86 | |||
| 195f3d6130 | |||
| 89d8622f6f | |||
| d71e054eb4 | |||
| 48a648eecd | |||
| 63268d079e | |||
| 743d5ca81a | |||
| dffb33c8e0 | |||
| a6ea0931dd | |||
| 17016c0eb2 | |||
| 67c703d934 | |||
| c163d1c936 | |||
| e3c15a2c58 | |||
| dfc149f292 | |||
| 627ba65b9a | |||
| a92170d88a | |||
| 503653cb5e | |||
| 68c277ff9a | |||
| 7b171b4f9b | |||
| 30956e4c58 | |||
| 6a956aacab | |||
| 681c845e2d | |||
| 11594ef5e8 | |||
| 28f06291db | |||
| c6937698ed | |||
| 15f85c8b80 | |||
| 7fd5695f83 | |||
| 952880287b | |||
| f76c7cf25a | |||
| 7c14b4d381 | |||
| c67389f0a3 | |||
| 219994ced2 | |||
| 274f08807e | |||
| 7601b4d3da | |||
| 05d14b4bfd | |||
| c5b63fd1c5 | |||
| 0bb6a926b2 | |||
| 0124eacb15 | |||
| 7ac06761d6 | |||
| c8c6226045 | |||
| 507d9610c7 | |||
| 5f4075fc35 | |||
| 514571cc80 | |||
| 6ff34b71cf | |||
| 37416daa53 | |||
| 6bd5401633 | |||
| ea6b9571b5 | |||
| bd7c403986 | |||
| 99417726ce | |||
| 4319e542f7 | |||
| 61d8445949 | |||
| 743095064d | |||
| efa12ab5a6 | |||
| b49b1b392c | |||
| 09e54e9915 | |||
| 373d175f2d | |||
| 5f3955a04a | |||
| 98c0e51527 | |||
| 8b3a6e8fc6 | |||
| b2d2e8ba7e | |||
| f1efced19c | |||
| 5b09dfc80c | |||
| 39f91a4368 | |||
| 3b6c9bde63 | |||
| 1df05ea53e | |||
| 3e9aee1c6f | |||
| 5231a460da | |||
| e6b3b36df9 | |||
| 060d510658 | |||
| 3b21a4aa97 | |||
| 4824b44950 | |||
| 988a92d4a5 | |||
| 378e2e61bd | |||
| eb94a7d9bb | |||
| fe2ba07a57 | |||
| 2788b12eb2 | |||
| 265b553b4e | |||
| 5f800681aa | |||
| 890c9cf591 | |||
| 2c356b80ed | |||
| cc097ba7da | |||
| 78401f1c4a | |||
| 8802363544 | |||
| 05388c3733 | |||
| 8f84301b39 | |||
| 774ba5d990 | |||
| 6bf0cd93d1 | |||
| 7f63c26348 | |||
| bce3e6ede1 | |||
| 4f642041f9 | |||
| b990b2768c | |||
| 53b8d37d8c | |||
| db9f63c2d9 | |||
| 87df4ff487 | |||
| f0fe459460 | |||
| f71a35751a | |||
| 2458d9cbb3 | |||
| 81c6d33005 | |||
| dba5c20e34 | |||
| c2eddb21e5 | |||
| de1d289670 | |||
| 623201fd75 | |||
| 2f900b6bc7 | |||
| 375af0cccd | |||
| 8ae8e887f5 | |||
| 201b6432c4 | |||
| fc10bbf6b6 | |||
| 1c82c71aea | |||
| a59abd3135 | |||
| a51633b511 | |||
| 2b40d265f9 | |||
| 734b5b02f8 | |||
| 4120434e5a | |||
| 6d9c4dc6d9 | |||
| ce94a1360a | |||
| 27a61f4faf | |||
| 36f50a482b | |||
| 28d681b29b | |||
| ddb53bfce1 | |||
| 81414254f9 | |||
| 4af4481a17 | |||
| 1e6e0f0800 | |||
| f1cff045e1 | |||
| b3b3c55473 | |||
| 7f2c6fd977 | |||
| 59338d3ae3 | |||
| 98a5647f97 | |||
| 5d11642776 | |||
| 297277451f | |||
| d5ec269811 | |||
| 02bbe29ccb | |||
| 3844ace955 | |||
| 3715a03598 | |||
| 82c695a199 | |||
| 09ff58a1a6 | |||
| 0fbe522235 | |||
| cc38b5e5c3 | |||
| c6101f5565 | |||
| f4e50ae4d8 | |||
| 3f42edbb08 | |||
| c63ff665b2 | |||
| 230ef6d4ca | |||
| 9d1783f4d6 | |||
| 99d14d9521 | |||
| 57ed7e692e | |||
| 6aaf974049 | |||
| 1fce0f5557 | |||
| f75f0ccb14 | |||
| 01f82aaf4c | |||
| 8b294e05ad | |||
| 5b2fcb85e5 | |||
| fb1d38dc3a | |||
| 5cc6a8d75a | |||
| fbe2a03933 | |||
| 915bccf099 | |||
| 0943e368e7 | |||
| d35c6e190c | |||
| 1025ad5a6a | |||
| fd74541318 | |||
| 821db477ae | |||
| ed66034930 | |||
| a9c91378fd | |||
| 1dc58f2ed1 | |||
| ae916e2a59 | |||
| f3af72e67e | |||
| 939c2121b7 | |||
| 46699bfc1e | |||
| 63d381d5a6 | |||
| c608d18684 | |||
| c31f61e7b6 | |||
| 9912c15c04 | |||
| 651653593c | |||
| 85858974b8 | |||
| a265fbb797 | |||
| e353ea2d56 | |||
| 6f91db067a | |||
| 8ed51cc810 | |||
| f256f174f9 | |||
| 49d3796378 | |||
| bfb6a18527 | |||
| 2960220a74 | |||
| c6605f1742 | |||
| cebffcfee1 | |||
| 006cdb8c3b | |||
| 374e0697bf | |||
| f988878424 | |||
| e59b252dce | |||
| b2747914d8 | |||
| 41aeb625f3 | |||
| 4cfa8aa06c | |||
| 8cb4a4e3b9 | |||
| 9a84c9715f | |||
| 38538f1d9a | |||
| 6a42b2a107 | |||
| 486790b810 | |||
| 0e538e2261 | |||
| 9042fcca55 | |||
| 040035adbc | |||
| d72097de18 | |||
| d9771bdade | |||
| 07ca905373 | |||
| ccd0d45a67 | |||
| 15a15870e7 | |||
| 28108c7796 | |||
| 171f388120 | |||
| bc50f171db | |||
| ea4c955f1f | |||
| 27524457d0 | |||
| 01fe67cfa9 | |||
| f4d493465d | |||
| 33cbe44390 | |||
| 5214f08d1a | |||
| 608fc986c4 | |||
| 779a96f97f | |||
| faf48246d7 | |||
| 81ec2a6c35 | |||
| 803423f12b | |||
| b384ee0381 | |||
| b8862d6b24 | |||
| dbfa4ed46d | |||
| d9eb999775 | |||
| b4a9ca3f87 | |||
| d087c86d1a | |||
| 0cfc7b25a6 | |||
| 8f3c9bd2ba | |||
| 91c79cdac9 | |||
| 20e4e110ce | |||
| 870d7ffe2c | |||
| 6ff88c914d | |||
| 2a2078517f | |||
| c09f697293 | |||
| a9e273a13d | |||
| 592665aa9a | |||
| 3745788f06 | |||
| 52b09d8f4c | |||
| 32f25cdcec | |||
| 6f022a9b6a | |||
| eea6970929 | |||
| 35ecfd279f | |||
| 1f5c610843 | |||
| 05f4c52c33 | |||
| 326f773e75 | |||
| 2079b518a2 | |||
| 70ed15e5ac | |||
| f1d7fe0c73 | |||
| 08e4b9bafc | |||
| 56a0212316 | |||
| 5df6506191 | |||
| 39779be980 | |||
| bdacdddf14 | |||
| 4b32337ef3 | |||
| 4897d5b7a9 | |||
| 6daa64facd | |||
| 07651e414d | |||
| 7e1e76f0d8 | |||
| b91a5d1a16 | |||
| 39b0646f24 | |||
| ea6406f144 | |||
| 7ed3f3fbad | |||
| cacb4ac40e | |||
| 9503744631 | |||
| 58dfd5dbfa | |||
| 60d5507184 | |||
| 5641cec146 | |||
| dd455e3d14 | |||
| 6876697f74 | |||
| 4373cab8cf | |||
| eeccb5833b | |||
| 790dad0330 | |||
| 078a38af5d | |||
| 8c186d2eb1 | |||
| 81b94b27e0 | |||
| 17e8616e8c | |||
| 50b0dc3c5e | |||
| 9e217e722f | |||
| f466b44b66 | |||
| 34e0fc7cba | |||
| bb88a7bb95 |
@@ -49,7 +49,6 @@ renpygame-1.2.zip
|
||||
speedtest
|
||||
styles.txt
|
||||
renpygame-demo/game/saves
|
||||
./lib
|
||||
Lucy Sprites.zip
|
||||
translate
|
||||
close_bugs.py
|
||||
@@ -58,3 +57,44 @@ scite-6.10.zip
|
||||
scite-renpy-20090803.zip
|
||||
module/cython.sh
|
||||
old_demo
|
||||
opengl.txt
|
||||
Microsoft.VC90.CRT.manifest
|
||||
console.exe
|
||||
msvcr90.dll
|
||||
python26.dll
|
||||
renpy.exe
|
||||
lib/windows-x86
|
||||
sphinx/source/inc/*
|
||||
doc/*
|
||||
updates/prerelease
|
||||
module/render.c
|
||||
module/_renpy.c
|
||||
module/_renpy_pysdlgl.c
|
||||
module/_renpybidi.c
|
||||
module/sound.c
|
||||
module/winmixer.c
|
||||
module/accelerator.html
|
||||
module/gldraw.html
|
||||
module/glenviron_fixed.html
|
||||
module/glenviron.html
|
||||
module/glenviron_limited.html
|
||||
module/glenviron_shader.html
|
||||
module/glrtt_copy.html
|
||||
module/glshader.html
|
||||
module/gltexture.html
|
||||
module/render.html
|
||||
module/accelerator.c
|
||||
module/gldraw.c
|
||||
module/glenviron.c
|
||||
module/glenviron_fixed.c
|
||||
module/glenviron_limited.c
|
||||
module/glenviron_shader.c
|
||||
module/glrtt_copy.c
|
||||
module/glshader.c
|
||||
module/gltexture.c
|
||||
log.txt
|
||||
lib/linux-x86
|
||||
lib/python
|
||||
lib/update-version.txt
|
||||
sphinx/game/saves
|
||||
tutorial/game/saves
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
License
|
||||
=======
|
||||
|
||||
Ren'Py itself is covered by the terms of the following (MIT) license:
|
||||
Most of Ren'Py is covered by the terms of the following (MIT) license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation files
|
||||
@@ -23,13 +23,15 @@ Ren'Py itself is covered by the terms of the following (MIT) license:
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Portions of Ren'Py are derived from code that is copyright using the
|
||||
Lesser GNU Public License, so Ren'Py games must be distributed in a
|
||||
manner that satisfies the LGPL.
|
||||
|
||||
Please see each individual source file for a list of copyright
|
||||
holders. The artwork in the demo is released by various copyright
|
||||
holders, under the same terms.
|
||||
|
||||
The Ren'Py module, the Ren'Py windows binaries, and the various Ren'Py
|
||||
launchers may contain code taken from the following projects:
|
||||
Ren'Py binaries include code from the following projects:
|
||||
|
||||
* Python (Python License)
|
||||
* Pygame (LGPL)
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
dist/Microsoft.VC90.CRT.manifest
|
||||
@@ -5,6 +5,8 @@ if [ "x$1" = "x" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
rsync -av updates tom@onegeek.org:/home/tom/WWW.update/renpy/
|
||||
|
||||
mkdir ~/ab/website/renpy/dl/$1
|
||||
cp dists/renpy-$1-* ~/ab/website/renpy/dl/$1
|
||||
cp CHANGELOG.txt ~/ab/website/renpy/dl/$1
|
||||
|
||||
@@ -1,20 +1,37 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import modulefinder
|
||||
import shutil
|
||||
from distutils.core import setup
|
||||
import py2exe
|
||||
import sys
|
||||
import zipfile
|
||||
import traceback
|
||||
import os
|
||||
|
||||
# The pythonpath on my system.
|
||||
sys.path.insert(0, 'c:\\msys\\1.0\\newbuild\\install\\bin')
|
||||
sys.path.insert(0, 'c:\\msys\\1.0\\newbuild\\install\\python')
|
||||
|
||||
def move_from_dist(fn):
|
||||
"""
|
||||
Moves the file `fn` from the dist directory to the main
|
||||
directory. (This means we don't need symlinks on windows.)
|
||||
"""
|
||||
|
||||
if os.path.isdir(fn):
|
||||
shutil.rmtree(fn)
|
||||
elif os.path.exists(fn):
|
||||
os.unlink(fn)
|
||||
|
||||
os.rename("dist/" + fn, fn)
|
||||
|
||||
import renpy
|
||||
renpy.setup_modulefinder(modulefinder)
|
||||
|
||||
def main():
|
||||
|
||||
sys.argv[1:] = [ 'py2exe', '--bundle', '2', '-a', '--dll-excludes', 'w9xpopen.exe', ]
|
||||
# sys.argv[1:] = [ 'py2exe', '-a', '--dll-excludes', 'w9xpopen.exe', ]
|
||||
sys.argv[1:] = [ 'py2exe', '-a', '--dll-excludes', 'w9xpopen.exe', ]
|
||||
|
||||
setup(name="Ren'Py",
|
||||
windows=[ dict(script="renpy.py",
|
||||
@@ -25,7 +42,7 @@ def main():
|
||||
|
||||
console=[ dict(script="renpy.py", dest_base="console") ],
|
||||
|
||||
zipfile='renpy.code',
|
||||
zipfile='lib/windows-x86/renpy.code',
|
||||
|
||||
options={ 'py2exe' : { 'excludes' : [ 'doctest',
|
||||
'pygame.macosx',
|
||||
@@ -49,14 +66,18 @@ def main():
|
||||
)
|
||||
|
||||
|
||||
zfold = zipfile.ZipFile("dist/renpy.code")
|
||||
zfnew = zipfile.ZipFile("renpy.code", "w", zipfile.ZIP_STORED)
|
||||
zfold = zipfile.ZipFile("dist/lib/windows-x86/renpy.code")
|
||||
zfnew = zipfile.ZipFile("dist/lib/windows-x86/renpy.code.new", "w", zipfile.ZIP_STORED)
|
||||
|
||||
seen = { }
|
||||
|
||||
for fn in zfold.namelist():
|
||||
if fn.startswith("renpy/"):
|
||||
continue
|
||||
|
||||
# Keep around .pyo files that load pyd files.
|
||||
pydfn = fn.replace("/", ".").replace(".pyo", ".pyd")
|
||||
if not os.path.exists("dist/lib/windows-x86/" + pydfn):
|
||||
continue
|
||||
|
||||
if fn in seen:
|
||||
continue
|
||||
@@ -71,14 +92,21 @@ def main():
|
||||
zfold.close()
|
||||
zfnew.close()
|
||||
|
||||
shutil.copy("c:/Python26/Microsoft.VC90.CRT.manifest", "dist/Microsoft.VC90.CRT.manifest")
|
||||
shutil.copy("c:/Python26/msvcr90.dll", "dist/msvcr90.dll")
|
||||
os.unlink("dist/lib/windows-x86/renpy.code")
|
||||
os.rename("dist/lib/windows-x86/renpy.code.new", "dist/lib/windows-x86/renpy.code")
|
||||
|
||||
shutil.copy("c:/Python26/Microsoft.VC90.CRT.manifest", "Microsoft.VC90.CRT.manifest")
|
||||
shutil.copy("c:/Python26/msvcr90.dll", "msvcr90.dll")
|
||||
|
||||
move_from_dist("lib/windows-x86")
|
||||
move_from_dist("console.exe")
|
||||
move_from_dist("python26.dll")
|
||||
move_from_dist("renpy.exe")
|
||||
|
||||
|
||||
try:
|
||||
main()
|
||||
except:
|
||||
traceback.print_exc()
|
||||
|
||||
print
|
||||
print "Press return to quit."
|
||||
raw_input()
|
||||
|
||||
|
||||
@@ -1,84 +0,0 @@
|
||||
1#!/usr/bin/env python
|
||||
|
||||
import collections
|
||||
import glob
|
||||
import re
|
||||
import sys
|
||||
import time
|
||||
|
||||
# A map from string to filename, line number where the string is found.
|
||||
strings = collections.defaultdict(list)
|
||||
|
||||
def process(fn):
|
||||
|
||||
lineno = 0
|
||||
|
||||
for data in file(fn, "r"):
|
||||
|
||||
lineno += 1
|
||||
|
||||
matches = [ ]
|
||||
|
||||
matches += re.finditer(r'\bu\"(\\"|[^"])+\"', data)
|
||||
matches += re.finditer(r"\bu\'(\\'|[^'])+\'", data)
|
||||
|
||||
for m in matches:
|
||||
s = m.group(0)[2:-1]
|
||||
|
||||
if "\\u" in s:
|
||||
continue
|
||||
|
||||
if len(s) == 1:
|
||||
continue
|
||||
|
||||
strings[s].append("%s:%d" % (fn, lineno))
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
files = [ ]
|
||||
|
||||
files += glob.glob("launcher2/*.rpy")
|
||||
files += glob.glob("common/*.rpy")
|
||||
files += glob.glob("common/_layout/*.rpym")
|
||||
files += glob.glob("common/_compat/*.rpym")
|
||||
|
||||
for fn in files:
|
||||
process(fn)
|
||||
|
||||
|
||||
converse = [ ]
|
||||
|
||||
for k, v in strings.iteritems():
|
||||
v = " ".join(sorted(v))
|
||||
converse.append((v, k))
|
||||
|
||||
converse.sort()
|
||||
|
||||
print """\
|
||||
# Ren'Py Visual Novel Engine
|
||||
# Copyright (C) 2009 PyTom <pytom@bishoujo.us>
|
||||
# This file is distributed under the same license as the Ren'Py package.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: mainline\\n"
|
||||
"Report-Msgid-Bugs-To: PyTom <pytom@bishoujo.us>\\n"
|
||||
"POT-Creation-Date: %s\\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\\n"
|
||||
"MIME-Version: 1.0\\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\\n"
|
||||
"Content-Transfer-Encoding: 8bit\\n"
|
||||
""" % time.strftime("%Y-%m-%d %H:%M%z")
|
||||
|
||||
for v, k in converse:
|
||||
print
|
||||
print "#:", v
|
||||
print "#, python-format"
|
||||
print "msgid \"%s\"" % k
|
||||
print "msgstr \"\""
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file contains warpers that are used by ATL. They need to be defined
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init -1210 python:
|
||||
@@ -41,7 +41,16 @@ init -1210 python:
|
||||
config.default_transform = None
|
||||
config.start_scene_black = True
|
||||
|
||||
if version <= (6, 11, 0):
|
||||
config.movetransition_respects_offsets = False
|
||||
|
||||
if version <= (6, 11, 2):
|
||||
config.imagereference_respects_position = True
|
||||
config.predict_screens = False
|
||||
config.choice_screen_chosen = False
|
||||
|
||||
|
||||
|
||||
init 1210 python hide::
|
||||
|
||||
# This returns true if the script_version is <= the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file contains a number of definitions of standard
|
||||
|
||||
@@ -1,9 +1,39 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file contains code to perform the OpenGL test. This is always
|
||||
# run - even in software mode - so that the user experience remains
|
||||
# consistent. (But it terminates early in sw-mode.)
|
||||
# This contains code to choose between OpenGL and Software rendering, when
|
||||
# a system supports both.
|
||||
|
||||
init -1024:
|
||||
screen _gl_test:
|
||||
frame:
|
||||
xalign .5
|
||||
yalign .33
|
||||
|
||||
xpadding 20
|
||||
ypadding 20
|
||||
|
||||
has vbox
|
||||
|
||||
label _(u"Graphics Acceleration")
|
||||
|
||||
null height 10
|
||||
|
||||
textbutton _(u"Automatically Choose"):
|
||||
size_group "gl"
|
||||
action SetField(persistent, "_gl_test", "auto")
|
||||
textbutton _(u"Prefer Software Renderer"):
|
||||
size_group "gl"
|
||||
action SetField(persistent, "_gl_test", "sw")
|
||||
textbutton _(u"Prefer OpenGL Renderer"):
|
||||
size_group "gl"
|
||||
action SetField(persistent, "_gl_test", "gl")
|
||||
|
||||
null height 10
|
||||
|
||||
textbutton _(u"Continue"):
|
||||
size_group "gl"
|
||||
action Return(True)
|
||||
|
||||
init -1024 python:
|
||||
# The image that we fill the screen with in GL-test mode.
|
||||
@@ -16,28 +46,38 @@ init -1024 python:
|
||||
to make the decisions as to if OpenGL is working or not.
|
||||
"""
|
||||
|
||||
def __init__(self, frames, timeout):
|
||||
def __init__(self, frames, fps, timeout):
|
||||
super(__GLTest, self).__init__()
|
||||
|
||||
self.target = 1.0 * frames / fps
|
||||
self.frames = frames
|
||||
self.timeout = timeout
|
||||
|
||||
self.times = [ ]
|
||||
self.success = False
|
||||
|
||||
def render(self, width, height, st, at):
|
||||
self.frames -= 1
|
||||
|
||||
if self.frames <= 0:
|
||||
renpy.timeout(0)
|
||||
self.times.append(st)
|
||||
|
||||
renpy.redraw(self, 0)
|
||||
|
||||
|
||||
renpy.renpy.log.info("Frame drawn at %f seconds." % st)
|
||||
|
||||
if len(self.times) >= self.frames:
|
||||
frames_timing = self.times[-1] - self.times[-self.frames]
|
||||
|
||||
renpy.renpy.log.info("It took %f seconds to render %d frames.", frames_timing, self.frames)
|
||||
|
||||
if frames_timing <= self.target:
|
||||
self.success = True
|
||||
renpy.timeout(0)
|
||||
|
||||
rv = renpy.Render(width, height)
|
||||
return rv
|
||||
|
||||
|
||||
|
||||
def event(self, ev, x, y, st):
|
||||
st = st
|
||||
|
||||
if self.frames <= 0:
|
||||
if self.success:
|
||||
return True
|
||||
|
||||
if st > self.timeout:
|
||||
@@ -45,35 +85,104 @@ init -1024 python:
|
||||
|
||||
renpy.timeout(self.timeout - st)
|
||||
|
||||
|
||||
def __gl_prefer_renderers(renderers):
|
||||
"""
|
||||
Forces the current renderer to be renderer, one of gl or sw.
|
||||
"""
|
||||
|
||||
if renpy.display.prefer_renderers == renderers:
|
||||
return
|
||||
|
||||
renpy.display.prefer_renderers = renderers
|
||||
renpy.display_reset()
|
||||
|
||||
def __gl_prompt():
|
||||
"""
|
||||
Decides if we want to prompt the user to enable OpenGL mode.
|
||||
If so, shows a screen that allows the user to alter the
|
||||
OpenGL setting.
|
||||
"""
|
||||
|
||||
if not renpy.display.interface.safe_mode:
|
||||
return
|
||||
|
||||
__gl_prefer_renderers("sw")
|
||||
|
||||
renpy.call_screen("_gl_test")
|
||||
|
||||
renpy.display.interface.safe_mode = False
|
||||
|
||||
def __gl_test():
|
||||
"""
|
||||
Makes the decision as to if we should use GL or SW mode.
|
||||
"""
|
||||
|
||||
import os
|
||||
if "RENPY_RENDERER" in os.environ:
|
||||
return
|
||||
|
||||
# Our decision survives a restart.
|
||||
if _restart:
|
||||
return
|
||||
|
||||
renpy.renpy.log.info("GL test mode: %s", persistent._gl_test)
|
||||
|
||||
# If GL is disabled, don't bother.
|
||||
if not config.gl_enable:
|
||||
return
|
||||
|
||||
__gl_prompt()
|
||||
|
||||
if persistent._gl_test == "gl":
|
||||
__gl_prefer_renderers("gl,sw")
|
||||
return
|
||||
|
||||
if persistent._gl_test == "sw":
|
||||
__gl_prefer_renderers("sw")
|
||||
return
|
||||
|
||||
__gl_prefer_renderers("gl,sw")
|
||||
|
||||
ui.pausebehavior(0)
|
||||
ui.interact(suppress_underlay=True, suppress_overlay=True)
|
||||
|
||||
# If GL is able to render FRAMES frames at FPS fps in less
|
||||
# than DELAY seconds, we consider it to be operational, and
|
||||
# continue in GL mode. Otherwise, we rever to software
|
||||
# rendering mode.
|
||||
FRAMES = 5
|
||||
FPS = 15
|
||||
DELAY = 1
|
||||
|
||||
renpy.transition(Dissolve(DELAY), always=True, force=True)
|
||||
ui.add(__GLTest(FRAMES, FPS, DELAY))
|
||||
result = ui.interact(suppress_overlay=True, suppress_underlay=True)
|
||||
|
||||
if result:
|
||||
__gl_prefer_renderers("gl,sw")
|
||||
else:
|
||||
__gl_prefer_renderers("sw")
|
||||
|
||||
# Init-time code:
|
||||
# Make a guess as to what modes we should be in.
|
||||
if persistent._gl_test is None:
|
||||
persistent._gl_test = "auto"
|
||||
|
||||
if persistent._gl_test == "sw":
|
||||
renpy.display.prefer_renderers = "sw"
|
||||
|
||||
|
||||
label _gl_test:
|
||||
|
||||
# Show the test image.
|
||||
scene
|
||||
show expression config.gl_test_image
|
||||
|
||||
python hide:
|
||||
|
||||
# If GL is able to render FRAMES in DELAY seconds, we consider it to
|
||||
# be operational, and continue in GL mode. Otherwise, we rever to
|
||||
# software rendering mode.
|
||||
FRAMES = 4
|
||||
DELAY = .25
|
||||
|
||||
import os
|
||||
|
||||
if (not "RENPY_RENDERER" in os.environ) and (renpy.get_renderer_info()["renderer"] == "gl"):
|
||||
|
||||
renpy.pause(0)
|
||||
|
||||
renpy.transition(Dissolve(DELAY))
|
||||
ui.add(__GLTest(FRAMES, DELAY))
|
||||
rv = ui.interact(suppress_overlay=True, suppress_underlay=False)
|
||||
|
||||
if not rv:
|
||||
config.gl_enable = False
|
||||
renpy.display_reset()
|
||||
|
||||
$ __gl_test()
|
||||
|
||||
# Hide the test image.
|
||||
scene
|
||||
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init -1105 python:
|
||||
@@ -14,17 +14,6 @@ init -1105 python:
|
||||
layout.compat_funcs = [ ]
|
||||
layout.provided = set()
|
||||
|
||||
# This takes care of actually displaying button menus.
|
||||
def _display_button_menu(menuitems):
|
||||
|
||||
narration = [ s for s, i in menuitems if i is None and s ]
|
||||
menuitems = [ (s, i) for s, i in menuitems if i is not None or not s ]
|
||||
|
||||
if narration:
|
||||
renpy.say(None, "\n".join(narration), interact=False)
|
||||
|
||||
return renpy.display_menu(menuitems)
|
||||
|
||||
init -1105 python hide:
|
||||
|
||||
# Called to indicate that the given kind of layout has been
|
||||
@@ -62,7 +51,7 @@ init -1105 python hide:
|
||||
if renpy.has_screen("load") and renpy.has_screen("save"):
|
||||
defaults["load_save"] = layout.screen_load_save
|
||||
|
||||
if renpy.has_screen("yesno"):
|
||||
if renpy.has_screen("yesno_prompt"):
|
||||
defaults["yesno_prompt"] = layout.screen_yesno_prompt
|
||||
|
||||
if renpy.has_screen("preferences"):
|
||||
@@ -211,7 +200,7 @@ init -1105 python hide:
|
||||
@layout
|
||||
def button_menu():
|
||||
|
||||
store.menu = _display_button_menu
|
||||
config.narrator_menu = True
|
||||
|
||||
style.menu.box_spacing = 2
|
||||
style.menu_window.set_parent(style.default)
|
||||
@@ -405,7 +394,6 @@ init -1105 python hide:
|
||||
An action that is run when the user chooses no.
|
||||
"""
|
||||
|
||||
|
||||
if renpy.has_screen("yesno_prompt"):
|
||||
|
||||
yes_action = [ Hide("yesno_prompt") ]
|
||||
@@ -416,12 +404,14 @@ init -1105 python hide:
|
||||
if no is not None:
|
||||
no_action.append(no)
|
||||
|
||||
renpy.display.show_screen(
|
||||
renpy.show_screen(
|
||||
"yesno_prompt",
|
||||
message=message,
|
||||
yes_action=yes_action,
|
||||
no_action=no_action)
|
||||
|
||||
renpy.restart_interaction()
|
||||
|
||||
return
|
||||
|
||||
if renpy.invoke_in_new_context(layout.yesno_prompt, None, message):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file consists of renpy functions that aren't expected to be
|
||||
@@ -67,6 +67,10 @@ init -1180 python:
|
||||
|
||||
# Should we start the game with scene black or just scene?
|
||||
config.start_scene_black = False
|
||||
|
||||
# Voice and Sound samples.
|
||||
config.sample_sound = None
|
||||
config.sample_voice = None
|
||||
|
||||
# This is updated to give the user an idea of where a save is
|
||||
# taking place.
|
||||
@@ -90,8 +94,20 @@ init -1180 python:
|
||||
|
||||
|
||||
def _default_empty_window():
|
||||
store.narrator("", interact=False)
|
||||
|
||||
who = _last_say_who
|
||||
|
||||
if who is not None:
|
||||
who = eval(who)
|
||||
|
||||
if who is None:
|
||||
who = narrator
|
||||
|
||||
if isinstance(who, NVLCharacter):
|
||||
nvl_show_core()
|
||||
else:
|
||||
store.narrator("", interact=False)
|
||||
|
||||
config.empty_window = _default_empty_window
|
||||
|
||||
style.skip_indicator = Style(style.default, heavy=True, help='The skip indicator.')
|
||||
@@ -105,7 +121,6 @@ init -1180 python:
|
||||
|
||||
_intra_jumps = renpy.curry(_intra_jumps_core)
|
||||
|
||||
|
||||
# The function that's used to translate strings in the game menu.
|
||||
def _(s):
|
||||
"""
|
||||
@@ -120,11 +135,33 @@ init -1180 python:
|
||||
|
||||
return s
|
||||
|
||||
config.extend_interjection = "{fast}"
|
||||
|
||||
def extend(what, interact=True):
|
||||
who = _last_say_who
|
||||
|
||||
if who is not None:
|
||||
who = eval(who)
|
||||
|
||||
if who is None:
|
||||
who = narrator
|
||||
|
||||
if isinstance(who, basestring):
|
||||
who = unknown.copy(who)
|
||||
|
||||
# This ensures extend works even with NVL mode.
|
||||
who.do_extend()
|
||||
|
||||
what = _last_say_what + config.extend_interjection + what
|
||||
|
||||
renpy.exports.say(who, what, interact=interact)
|
||||
store._last_say_what = what
|
||||
|
||||
extend.record_say = False
|
||||
|
||||
# Are the windows currently hidden?
|
||||
_windows_hidden = False
|
||||
|
||||
init -1180 python:
|
||||
|
||||
def toggle_skipping():
|
||||
|
||||
if not config.skipping:
|
||||
@@ -139,22 +176,27 @@ init -1180 python:
|
||||
|
||||
config.help = None
|
||||
|
||||
def _help():
|
||||
if not config.help:
|
||||
def _help(help=None):
|
||||
|
||||
if help is None:
|
||||
help = config.help
|
||||
|
||||
if help is None:
|
||||
return
|
||||
|
||||
if renpy.has_label(config.help):
|
||||
renpy.call_in_new_context(config.help)
|
||||
if renpy.has_label(help):
|
||||
renpy.call_in_new_context(help)
|
||||
return
|
||||
|
||||
_preferences.fullscreen = False
|
||||
|
||||
try:
|
||||
import webbrowser
|
||||
webbrowser.open_new("file:///" + config.basedir + "/" + config.help)
|
||||
webbrowser.open_new("file:///" + config.basedir + "/" + help)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
# Called to make a screenshot happen.
|
||||
def _screenshot():
|
||||
import os.path
|
||||
@@ -188,7 +230,16 @@ init -1180 python:
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
if config.screenshot_callback is not None:
|
||||
config.screenshot_callback(fn)
|
||||
|
||||
def _screenshot_callback(fn):
|
||||
renpy.notify(_("Saved screenshot as %s.") % fn)
|
||||
|
||||
config.screenshot_callback = _screenshot_callback
|
||||
|
||||
_predict_screens = [ ]
|
||||
|
||||
init -1180 python hide:
|
||||
|
||||
def dump_styles():
|
||||
@@ -200,7 +251,10 @@ init -1180 python hide:
|
||||
|
||||
def invoke_game_menu():
|
||||
if renpy.context()._menu:
|
||||
renpy.jump("_noisy_return")
|
||||
if renpy.context()._main_menu:
|
||||
return
|
||||
else:
|
||||
renpy.jump("_noisy_return")
|
||||
else:
|
||||
if config.game_menu_action:
|
||||
renpy.display.behavior.run(config.game_menu_action)
|
||||
@@ -296,32 +350,42 @@ init -1180 python hide:
|
||||
|
||||
config.hyperlink_styler = hyperlink_styler
|
||||
config.hyperlink_callback = hyperlink_function
|
||||
|
||||
# Prediction of screens.
|
||||
def predict():
|
||||
|
||||
for s in _predict_screens:
|
||||
if renpy.has_screen(s):
|
||||
renpy.predict_screen(s)
|
||||
|
||||
s = _game_menu_screen
|
||||
|
||||
if s is None:
|
||||
return
|
||||
|
||||
if renpy.has_screen(s):
|
||||
renpy.predict_screen(s)
|
||||
return
|
||||
|
||||
if s.endswith("_screen"):
|
||||
s = s[:-7]
|
||||
if renpy.has_screen(s):
|
||||
renpy.predict_screen(s)
|
||||
return
|
||||
|
||||
|
||||
config.predict_callbacks.append(predict)
|
||||
|
||||
def imagemap_auto_function(auto_param, variant):
|
||||
rv = auto_param % variant
|
||||
|
||||
if renpy.loadable(rv):
|
||||
return rv
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
config.extend_interjection = "{fast}"
|
||||
|
||||
init -1180 python:
|
||||
def extend(what, interact=True):
|
||||
who = _last_say_who
|
||||
|
||||
if who is not None:
|
||||
who = eval(who)
|
||||
|
||||
if who is None:
|
||||
who = narrator
|
||||
|
||||
if isinstance(who, basestring):
|
||||
who = unknown.copy(who)
|
||||
|
||||
# This ensures extend works even with NVL mode.
|
||||
who.do_extend()
|
||||
|
||||
what = _last_say_what + config.extend_interjection + what
|
||||
|
||||
renpy.exports.say(who, what, interact=interact)
|
||||
store._last_say_what = what
|
||||
|
||||
extend.record_say = False
|
||||
config.imagemap_auto_function = imagemap_auto_function
|
||||
|
||||
|
||||
label _hide_windows:
|
||||
@@ -346,17 +410,15 @@ label _hide_windows:
|
||||
label _save_reload_game:
|
||||
python hide:
|
||||
renpy.take_screenshot((config.thumbnail_width, config.thumbnail_height))
|
||||
|
||||
renpy.music.stop()
|
||||
|
||||
ui.add(Solid((0, 0, 0, 255)))
|
||||
ui.text("Saving game...",
|
||||
size=32, xalign=0.5, yalign=0.5, color=(255, 255, 255, 255))
|
||||
|
||||
renpy.pause(0)
|
||||
renpy.save("reload", "reload save game")
|
||||
|
||||
renpy.music.stop()
|
||||
|
||||
persistent._reload_save = "reload"
|
||||
renpy.save("_reload-1", "reload save game")
|
||||
|
||||
ui.add(Solid((0, 0, 0, 255)))
|
||||
ui.text("Reloading script...",
|
||||
@@ -367,13 +429,12 @@ label _save_reload_game:
|
||||
renpy.utter_restart()
|
||||
|
||||
label _load_reload_game:
|
||||
|
||||
if not persistent._reload_save:
|
||||
return
|
||||
|
||||
if not renpy.can_load("_reload-1"):
|
||||
return
|
||||
|
||||
python hide:
|
||||
save = persistent._reload_save
|
||||
persistent._reload_save = 0
|
||||
renpy.rename_save("_reload-1", "_reload-2")
|
||||
|
||||
ui.add(Solid((0, 0, 0, 255)))
|
||||
ui.text("Reloading game...",
|
||||
@@ -382,7 +443,7 @@ label _load_reload_game:
|
||||
ui.pausebehavior(0)
|
||||
ui.interact(suppress_underlay=True, suppress_overlay=True)
|
||||
|
||||
renpy.load(save)
|
||||
renpy.load("_reload-2")
|
||||
|
||||
return
|
||||
|
||||
@@ -406,7 +467,7 @@ init 1180 python:
|
||||
_preferences.text_cps = config.default_text_cps
|
||||
|
||||
if config.default_afm_time is not None:
|
||||
_preferences.default_afm_time = config.default_afm_time
|
||||
_preferences.afm_time = config.default_afm_time
|
||||
|
||||
if config.default_afm_enable is not None:
|
||||
_preferences.afm_enable = config.default_afm_enable
|
||||
@@ -707,6 +768,8 @@ label _start:
|
||||
for i in config.start_callbacks:
|
||||
i()
|
||||
|
||||
$ renpy.block_rollback()
|
||||
|
||||
call _gl_test
|
||||
|
||||
call _load_reload_game from _call__load_reload_game_1
|
||||
@@ -726,7 +789,9 @@ label _start:
|
||||
$ renpy.block_rollback()
|
||||
|
||||
$ _old_game_menu_screen = _game_menu_screen
|
||||
$ _old_predict_screens = _predict_screens
|
||||
$ _game_menu_screen = None
|
||||
$ _predict_screens = [ 'main_menu' ]
|
||||
|
||||
if renpy.has_label("splashscreen") and not _restart:
|
||||
call expression "splashscreen" from _call_splashscreen_1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# Common stuff that's used by the various Ren'Py menus. This includes
|
||||
@@ -35,6 +35,8 @@ label _quit_prompt:
|
||||
return
|
||||
|
||||
label _main_menu_prompt:
|
||||
$ renpy.loadsave.force_autosave()
|
||||
|
||||
if layout.yesno_prompt(None, layout.MAIN_MENU):
|
||||
$ renpy.full_restart(transition=config.game_main_transition)
|
||||
else:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file contains code that sets up the various mixers, based on how
|
||||
@@ -21,7 +21,7 @@ init -1130 python hide:
|
||||
for i in xrange(0, 8):
|
||||
renpy.music.register_channel(i)
|
||||
|
||||
renpy.music.register_channel("movie", "music", False, stop_on_mute=False)
|
||||
renpy.music.register_channel("movie", "music", False, stop_on_mute=False, buffer_queue=False)
|
||||
|
||||
# Set up default names for some of the channels.
|
||||
renpy.music.alias_channel(0, "sound")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This is an implementation of NVL-mode, which can be used to show
|
||||
@@ -80,9 +80,10 @@ init -1100 python:
|
||||
else:
|
||||
return s
|
||||
|
||||
def nvl_show_screen(screen_name, **scope):
|
||||
def __nvl_screen_dialogue():
|
||||
"""
|
||||
Shows an nvl-mode screen. Returns the "who" widget.
|
||||
Returns widget_properties and dialogue for the current NVL
|
||||
mode screen.
|
||||
"""
|
||||
|
||||
widget_properties = { }
|
||||
@@ -110,6 +111,14 @@ init -1100 python:
|
||||
|
||||
dialogue.append((who, what, who_id, what_id, window_id))
|
||||
|
||||
return widget_properties, dialogue
|
||||
|
||||
def __nvl_show_screen(screen_name, **scope):
|
||||
"""
|
||||
Shows an nvl-mode screen. Returns the "what" widget.
|
||||
"""
|
||||
|
||||
widget_properties, dialogue = __nvl_screen_dialogue()
|
||||
renpy.show_screen(screen_name, _transient=True, _widget_properties=widget_properties, dialogue=dialogue, **scope)
|
||||
renpy.shown_window()
|
||||
|
||||
@@ -119,7 +128,7 @@ init -1100 python:
|
||||
|
||||
# Screen version.
|
||||
if renpy.has_screen("nvl"):
|
||||
return nvl_show_screen("nvl")
|
||||
return __nvl_show_screen("nvl", items=[ ])
|
||||
|
||||
if renpy.in_rollback():
|
||||
nvl_window = __s(style.nvl_window)['rollback']
|
||||
@@ -245,6 +254,7 @@ init -1100 python:
|
||||
nvl_clear()
|
||||
|
||||
def do_extend(self):
|
||||
renpy.mode(self.mode)
|
||||
store.nvl_list = store.nvl_list[:-1]
|
||||
|
||||
# The default NVLCharacter.
|
||||
@@ -254,6 +264,7 @@ init -1100 python:
|
||||
what_style='nvl_dialogue',
|
||||
window_style='nvl_entry',
|
||||
type='nvl',
|
||||
mode='nvl',
|
||||
clear=False,
|
||||
kind=adv)
|
||||
|
||||
@@ -262,43 +273,64 @@ init -1100 python:
|
||||
|
||||
# Run clear at the start of the game.
|
||||
config.start_callbacks.append(nvl_clear)
|
||||
|
||||
|
||||
|
||||
def nvl_menu(items):
|
||||
|
||||
renpy.mode('nvl_menu')
|
||||
|
||||
if nvl_list is None:
|
||||
store.nvl_list = [ ]
|
||||
|
||||
screen = None
|
||||
|
||||
if renpy.has_screen("nvl_choice"):
|
||||
screen = "nvl_choice"
|
||||
elif renpy.has_screen("nvl"):
|
||||
screen = "nvl"
|
||||
|
||||
if screen is not None:
|
||||
|
||||
# Screen version.
|
||||
nvl_show_screen("nvl_choice", items=items)
|
||||
widget_properties, dialogue = __nvl_screen_dialogue()
|
||||
|
||||
else:
|
||||
return renpy.display_menu(
|
||||
items,
|
||||
widget_properties=widget_properties,
|
||||
screen=screen,
|
||||
scope={ "dialogue" : dialogue },
|
||||
window_style=__s(style.nvl_menu_window),
|
||||
choice_style=__s(style.nvl_menu_choice),
|
||||
choice_chosen_style=__s(style.nvl_menu_choice_chosen),
|
||||
choice_button_style=__s(style.nvl_menu_choice_button),
|
||||
choice_chosen_button_style=__s(style.nvl_menu_choice_chosen_button),
|
||||
type="nvl",
|
||||
)
|
||||
|
||||
# Traditional version.
|
||||
ui.layer("transient")
|
||||
ui.clear()
|
||||
ui.close()
|
||||
|
||||
ui.window(style=__s(style.nvl_window))
|
||||
ui.vbox(style=__s(style.nvl_vbox))
|
||||
# Traditional version.
|
||||
ui.layer("transient")
|
||||
ui.clear()
|
||||
ui.close()
|
||||
|
||||
for i in nvl_list:
|
||||
if not i:
|
||||
continue
|
||||
ui.window(style=__s(style.nvl_window))
|
||||
ui.vbox(style=__s(style.nvl_vbox))
|
||||
|
||||
who, what, kw = i
|
||||
rv = renpy.show_display_say(who, what, **kw)
|
||||
for i in nvl_list:
|
||||
if not i:
|
||||
continue
|
||||
|
||||
renpy.display_menu(items, interact=False,
|
||||
window_style=__s(style.nvl_menu_window),
|
||||
choice_style=__s(style.nvl_menu_choice),
|
||||
choice_chosen_style=__s(style.nvl_menu_choice_chosen),
|
||||
choice_button_style=__s(style.nvl_menu_choice_button),
|
||||
choice_chosen_button_style=__s(style.nvl_menu_choice_chosen_button),
|
||||
)
|
||||
who, what, kw = i
|
||||
rv = renpy.show_display_say(who, what, **kw)
|
||||
|
||||
ui.close()
|
||||
renpy.display_menu(items, interact=False,
|
||||
window_style=__s(style.nvl_menu_window),
|
||||
choice_style=__s(style.nvl_menu_choice),
|
||||
choice_chosen_style=__s(style.nvl_menu_choice_chosen),
|
||||
choice_button_style=__s(style.nvl_menu_choice_button),
|
||||
choice_chosen_button_style=__s(style.nvl_menu_choice_chosen_button),
|
||||
)
|
||||
|
||||
ui.close()
|
||||
|
||||
roll_forward = renpy.roll_forward_info()
|
||||
|
||||
@@ -312,29 +344,23 @@ init -1100 python:
|
||||
config.nvl_adv_transition = None
|
||||
config.adv_nvl_transition = None
|
||||
|
||||
init 1140 python:
|
||||
|
||||
if config.nvl_adv_transition or config.adv_nvl_transition:
|
||||
# This is used to execute the nvl and adv mode transitions.
|
||||
def _nvl_adv_callback(mode, old_modes):
|
||||
|
||||
def _nvl_adv_callback(event, interact, type, **kwargs):
|
||||
|
||||
if event != "begin" or not interact or renpy.get_transition():
|
||||
return
|
||||
|
||||
old_type = renpy.last_interact_type()
|
||||
|
||||
if old_type == "say" and type == "nvl":
|
||||
# We have an extra line in the nvl_list as we do this. So
|
||||
# take it out for the duration of the nvl_show.
|
||||
old_nvl_list = store.nvl_list
|
||||
store.nvl_list = old_nvl_list[:-1]
|
||||
nvl_show(config.adv_nvl_transition)
|
||||
store.nvl_list = old_nvl_list
|
||||
elif old_type == "nvl" and type == "say":
|
||||
nvl_hide(config.nvl_adv_transition)
|
||||
|
||||
config.all_character_callbacks.insert(0, _nvl_adv_callback)
|
||||
old = old_modes[0]
|
||||
|
||||
if config.adv_nvl_transition:
|
||||
if mode == "nvl" or mode == "nvl_menu":
|
||||
if old == "say" or old == "menu":
|
||||
nvl_show(config.adv_nvl_transition)
|
||||
|
||||
if config.nvl_adv_transition:
|
||||
if mode == "say" or mode == "menu":
|
||||
if old == "nvl" or old == "nvl_menu":
|
||||
nvl_hide(config.nvl_adv_transition)
|
||||
|
||||
config.mode_callbacks.append(_nvl_adv_callback)
|
||||
|
||||
python early hide:
|
||||
|
||||
|
||||
@@ -13,13 +13,17 @@ init -1140 python:
|
||||
When in a menu, this returns from the menu.
|
||||
"""
|
||||
|
||||
def __init__(self, value=True):
|
||||
def __init__(self, value=None):
|
||||
self.value = value
|
||||
|
||||
def __call__(self):
|
||||
|
||||
if renpy.context()._main_menu:
|
||||
ShowMenu("main_menu")()
|
||||
if self.value is None:
|
||||
if renpy.context()._main_menu:
|
||||
ShowMenu("main_menu")()
|
||||
else:
|
||||
return True
|
||||
|
||||
else:
|
||||
return self.value
|
||||
|
||||
@@ -47,14 +51,24 @@ init -1140 python:
|
||||
This causes another screen to be shown. `screen` is a string
|
||||
giving the name of the screen. The keyword arguments are
|
||||
passed to the screen being shown.
|
||||
|
||||
If not None, `transition` is use to show the new screen.
|
||||
"""
|
||||
|
||||
def __init__(self, screen, **kwargs):
|
||||
def __init__(self, screen, transition=None, **kwargs):
|
||||
self.screen = screen
|
||||
self.kwargs = kwargs
|
||||
self.transition = transition
|
||||
|
||||
def predict(self):
|
||||
renpy.predict_screen(self.screen, **self.kwargs)
|
||||
|
||||
def __call__(self):
|
||||
renpy.show_screen(self.screen, **self.kwargs)
|
||||
|
||||
if self.transition is not None:
|
||||
renpy.transition(self.transition)
|
||||
|
||||
renpy.restart_interaction()
|
||||
|
||||
def get_selected(self):
|
||||
@@ -77,13 +91,21 @@ init -1140 python:
|
||||
:doc: control_action
|
||||
|
||||
This causes the screen named `screen` to be hidden, if it is shown.
|
||||
|
||||
`transition`
|
||||
If not None, a transition that occurs when hiding the screen.
|
||||
"""
|
||||
|
||||
def __init__(self, screen):
|
||||
def __init__(self, screen, transition=None):
|
||||
self.screen = screen
|
||||
|
||||
self.transition = transition
|
||||
|
||||
def __call__(self):
|
||||
renpy.hide_screen(self.screen)
|
||||
|
||||
if self.transition is not None:
|
||||
renpy.transition(self.transition)
|
||||
|
||||
renpy.restart_interaction()
|
||||
|
||||
|
||||
@@ -97,7 +119,48 @@ init -1140 python:
|
||||
def __call__(self):
|
||||
_screenshot()
|
||||
|
||||
def HideInterface():
|
||||
"""
|
||||
:doc other_action
|
||||
|
||||
Causes the interface to be hidden until the user clicks.
|
||||
"""
|
||||
|
||||
return ui.callsinnewcontext("_hide_windows")
|
||||
|
||||
|
||||
class With(Action):
|
||||
"""
|
||||
:doc: other_action
|
||||
|
||||
Causes `transition` to occur.
|
||||
"""
|
||||
|
||||
def __init__(self, transition):
|
||||
self.transition = transition
|
||||
|
||||
def __call__(self):
|
||||
renpy.transition(self.transition)
|
||||
renpy.restart_interaction()
|
||||
|
||||
class Notify(Action):
|
||||
"""
|
||||
:doc: other_action
|
||||
|
||||
Displays `message` using :func:`renpy.notify`.
|
||||
"""
|
||||
|
||||
def __init__(self, message):
|
||||
self.message = message
|
||||
|
||||
def predict(self):
|
||||
renpy.predict_screen("notify")
|
||||
|
||||
def __call__(self):
|
||||
renpy.notify(self.message)
|
||||
|
||||
|
||||
|
||||
class InvertSelected(Action):
|
||||
"""
|
||||
:doc: other_action
|
||||
@@ -120,8 +183,24 @@ init -1140 python:
|
||||
|
||||
def periodic(self, st):
|
||||
return self.action.periodic(st)
|
||||
|
||||
def predict(self):
|
||||
self.action.predict()
|
||||
|
||||
|
||||
def If(expression, true=None, false=None):
|
||||
"""
|
||||
:doc: other_action
|
||||
|
||||
This returns `true` if `expression` is true, and `false`
|
||||
otherwise. Use this to select an action based on an expression.
|
||||
Note that the default, None, can be used as an action that causes
|
||||
a button to be disabled.
|
||||
"""
|
||||
|
||||
if expression:
|
||||
return true
|
||||
else:
|
||||
return false
|
||||
|
||||
##########################################################################
|
||||
# Menu-related actions.
|
||||
@@ -158,6 +237,11 @@ init -1140 python:
|
||||
def __init__(self, screen=None):
|
||||
self.screen = screen
|
||||
|
||||
|
||||
def predict(self):
|
||||
if renpy.has_screen(self.screen):
|
||||
renpy.predict_screen(self.screen)
|
||||
|
||||
def __call__(self):
|
||||
|
||||
if not self.get_sensitive():
|
||||
@@ -167,19 +251,24 @@ init -1140 python:
|
||||
|
||||
if not (renpy.has_screen(screen) or renpy.has_label(screen)):
|
||||
screen = screen + "_screen"
|
||||
|
||||
|
||||
# Ugly. We have different code depending on if we're in the
|
||||
# game menu or not.
|
||||
if renpy.context()._menu:
|
||||
|
||||
if renpy.has_screen(screen):
|
||||
|
||||
renpy.transition(config.intra_transition)
|
||||
renpy.show_screen(screen, _transient=True)
|
||||
renpy.restart_interaction()
|
||||
|
||||
elif renpy.has_label(screen):
|
||||
renpy.transition(config.intra_transition)
|
||||
renpy.scene(layer='screens')
|
||||
|
||||
ui.layer("screens")
|
||||
ui.remove_above(None)
|
||||
ui.close()
|
||||
|
||||
renpy.jump(screen)
|
||||
|
||||
else:
|
||||
@@ -264,6 +353,7 @@ init -1140 python:
|
||||
def __call__(self):
|
||||
|
||||
if self.confirm:
|
||||
renpy.loadsave.force_autosave()
|
||||
layout.yesno_screen(layout.QUIT, Quit(False))
|
||||
else:
|
||||
renpy.quit()
|
||||
@@ -293,10 +383,27 @@ init -1140 python:
|
||||
|
||||
def get_sensitive(self):
|
||||
return config.allow_skipping and (not renpy.context()._main_menu)
|
||||
|
||||
class Help(Action):
|
||||
"""
|
||||
:doc: other_action
|
||||
|
||||
Displays help.
|
||||
|
||||
`help`
|
||||
If this is a string giving a label in the programe, then
|
||||
that label is called in a new context when the button is
|
||||
chosen. Otherwise, it should be a string giving a file
|
||||
that is opened in a web browser. If None, the value of
|
||||
config.help is used in the same wayt.
|
||||
"""
|
||||
|
||||
def __init__(self, help=None):
|
||||
self.help = help
|
||||
|
||||
def AutoForward(Action):
|
||||
return Preference("auto-forward")
|
||||
|
||||
def __call__(self):
|
||||
_help(self.help)
|
||||
|
||||
|
||||
##########################################################################
|
||||
# Functions that set variables or fields.
|
||||
@@ -321,7 +428,7 @@ init -1140 python:
|
||||
|
||||
def get_selected(self):
|
||||
return getattr(self.object, self.field) == self.value
|
||||
|
||||
|
||||
|
||||
def SetVariable(variable, value):
|
||||
"""
|
||||
@@ -488,7 +595,7 @@ init -1140 python:
|
||||
def get_selected(self):
|
||||
return renpy.music.get_playing(self.channel) == self.file
|
||||
|
||||
def periodic(self):
|
||||
def periodic(self, st):
|
||||
if self.selected != self.get_selected():
|
||||
renpy.restart_interaction()
|
||||
|
||||
@@ -613,7 +720,7 @@ init -1140 python:
|
||||
if self.value == self.old_value:
|
||||
return
|
||||
|
||||
fraction = st - (self.start_time) / self.delay
|
||||
fraction = (st - self.start_time) / self.delay
|
||||
fraction = min(1.0, fraction)
|
||||
|
||||
value = self.old_value + fraction * (self.value - self.old_value)
|
||||
@@ -669,8 +776,8 @@ init -1140 python:
|
||||
def changed(self, value):
|
||||
|
||||
if self.max_is_zero:
|
||||
if value == 0:
|
||||
value = self.range
|
||||
if value == self.range:
|
||||
value = 0
|
||||
else:
|
||||
value = value + 1
|
||||
|
||||
@@ -737,7 +844,7 @@ init -1140 python:
|
||||
def get_adjustment(self):
|
||||
w = renpy.get_widget(None, self.viewport)
|
||||
if not isinstance(w, Viewport):
|
||||
raise Exception("The displayable with id %r is not declared, or not a viewport.")
|
||||
raise Exception("The displayable with id %r is not declared, or not a viewport." % self.viewport)
|
||||
|
||||
return w.xadjustment
|
||||
|
||||
@@ -759,7 +866,7 @@ init -1140 python:
|
||||
def get_adjustment(self):
|
||||
w = renpy.get_widget(None, self.viewport)
|
||||
if not isinstance(w, Viewport):
|
||||
raise Exception("The displayable with id %r is not declared, or not a viewport.")
|
||||
raise Exception("The displayable with id %r is not declared, or not a viewport." % self.viewport)
|
||||
|
||||
return w.yadjustment
|
||||
|
||||
@@ -769,6 +876,8 @@ init -1140 python:
|
||||
##########################################################################
|
||||
# File functions
|
||||
|
||||
config.linear_saves_page_size = None
|
||||
|
||||
if persistent._file_page is None:
|
||||
persistent._file_page = "1"
|
||||
|
||||
@@ -776,8 +885,15 @@ init -1140 python:
|
||||
|
||||
if page is None:
|
||||
page = persistent._file_page
|
||||
|
||||
|
||||
if config.linear_saves_page_size is not None:
|
||||
try:
|
||||
page = int(page)
|
||||
name = int(name)
|
||||
return str((page - 1) * config.linear_saves_page_size + name)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
return str(page) + "-" + str(name)
|
||||
|
||||
def FileLoadable(name, page=None):
|
||||
@@ -873,6 +989,9 @@ init -1140 python:
|
||||
If true, then this file will be marked as the newest save
|
||||
file when it's saved. (Set this to false for a quicksave,
|
||||
for example.)
|
||||
|
||||
`page`
|
||||
The name of the page that it will be saved to.
|
||||
"""
|
||||
|
||||
def __init__(self, name, confirm=True, newest=True, page=None):
|
||||
@@ -892,7 +1011,7 @@ init -1140 python:
|
||||
if self.confirm:
|
||||
layout.yesno_screen(layout.OVERWRITE_SAVE, FileSave(self.name, False, self.newest, self.page))
|
||||
return
|
||||
|
||||
|
||||
renpy.save(fn, extra_info=save_name)
|
||||
|
||||
if self.newest:
|
||||
@@ -909,6 +1028,9 @@ init -1140 python:
|
||||
return True
|
||||
|
||||
def get_selected(self):
|
||||
if not self.confirm:
|
||||
return False
|
||||
|
||||
return persistent._file_newest == __filename(self.name, self.page)
|
||||
|
||||
class FileLoad(Action):
|
||||
@@ -944,6 +1066,9 @@ init -1140 python:
|
||||
return renpy.scan_saved_game(__filename(self.name, self.page))
|
||||
|
||||
def get_selected(self):
|
||||
if not self.confirm:
|
||||
return False
|
||||
|
||||
return persistent._file_newest == __filename(self.name, self.page)
|
||||
|
||||
class FileDelete(Action):
|
||||
@@ -990,9 +1115,9 @@ init -1140 python:
|
||||
"""
|
||||
|
||||
if renpy.current_screen().screen_name[0] == "load":
|
||||
return FileLoad(name, page)
|
||||
return FileLoad(name, page=page)
|
||||
else:
|
||||
return FileSave(name, page)
|
||||
return FileSave(name, page=page)
|
||||
|
||||
|
||||
class FilePage(Action):
|
||||
@@ -1016,7 +1141,7 @@ init -1140 python:
|
||||
def get_sensitive(self):
|
||||
if self.page == "auto" and not config.has_autosave:
|
||||
return False
|
||||
elif self.page == "quicksave" and not config.has_quicksave:
|
||||
elif self.page == "quick" and not config.has_quicksave:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
@@ -1024,16 +1149,82 @@ init -1140 python:
|
||||
def get_selected(self):
|
||||
return self.page == persistent._file_page
|
||||
|
||||
|
||||
def FilePageName(auto="a", quick="q"):
|
||||
"""
|
||||
:doc: file_action_function
|
||||
|
||||
Returns the name of the current file page, as a string. If a normal
|
||||
page, this returns the page number. Otherwise, it returns
|
||||
`auto` or `quick`.
|
||||
"""
|
||||
|
||||
page = persistent._file_page
|
||||
|
||||
if page == "quick":
|
||||
return quick
|
||||
elif page == "auto":
|
||||
return auto
|
||||
else:
|
||||
return page
|
||||
|
||||
def FileSlotName(slot, slots_per_page, auto="a", quick="q", format="%s%d"):
|
||||
"""
|
||||
:doc: file_action_function
|
||||
|
||||
Returns the name of the numbered slot. This assumes that slots on
|
||||
normal pages are numbered in a linear order starting with 1, and
|
||||
that page numbers start with 1. When slot is 2, and slots_per_page
|
||||
is 10, and the other variables are the defauts:
|
||||
|
||||
* When the first page is slowing, this returns "2".
|
||||
* When the second page is showing, this returns "12".
|
||||
* When the auto page is showing, this returns "a2".
|
||||
* When the quicksave page is showing, this returns "q2".
|
||||
|
||||
`slot`
|
||||
The number of the slot to access.
|
||||
|
||||
`slots_per_page`
|
||||
The number of slots per page.
|
||||
|
||||
`auto`
|
||||
A prefix to use for the auto page.
|
||||
|
||||
`quick`
|
||||
A prefix to use for the quick page.
|
||||
|
||||
`format`
|
||||
The formatting code to use. This is given two arguments: A string
|
||||
giving the page prefix, and an integer giving the slot number.
|
||||
"""
|
||||
|
||||
page = persistent._file_page
|
||||
|
||||
if page == "quick":
|
||||
prefix = quick
|
||||
page = 0
|
||||
elif page == "auto":
|
||||
prefix = auto
|
||||
page = 0
|
||||
else:
|
||||
prefix = ""
|
||||
page = int(page) - 1
|
||||
|
||||
return format % (prefix, page * slots_per_page + slot)
|
||||
|
||||
|
||||
class FilePageNext(Action):
|
||||
"""
|
||||
:doc: file_action
|
||||
|
||||
Goes to the next file page. (It's always possible to get to the
|
||||
next file page.)
|
||||
Goes to the next file page.
|
||||
|
||||
`max`
|
||||
If set, this should be an integer that gives the number of
|
||||
the maximum file page we can go to.
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, max=None):
|
||||
|
||||
page = persistent._file_page
|
||||
|
||||
@@ -1047,7 +1238,14 @@ init -1140 python:
|
||||
page = "1"
|
||||
|
||||
else:
|
||||
page = str(int(page) + 1)
|
||||
page = int(page) + 1
|
||||
|
||||
if max is not None:
|
||||
if page > max:
|
||||
page = None
|
||||
|
||||
if page is not None:
|
||||
page = str(page)
|
||||
|
||||
self.page = page
|
||||
|
||||
@@ -1058,6 +1256,9 @@ init -1140 python:
|
||||
persistent._file_page = self.page
|
||||
renpy.restart_interaction()
|
||||
|
||||
def get_sensitive(self):
|
||||
return self.page is not None
|
||||
|
||||
|
||||
class FilePagePrevious(Action):
|
||||
"""
|
||||
@@ -1310,7 +1511,7 @@ init -1140 python:
|
||||
|
||||
|
||||
# What we do on a quit, by default.
|
||||
config.quit_action = ShowMenu("_confirm_quit")
|
||||
config.quit_action = ui.gamemenus("_confirm_quit")
|
||||
|
||||
|
||||
# This is used to ensure a fixed click-to-continue indicator is shown on
|
||||
@@ -1318,3 +1519,25 @@ init -1140 python:
|
||||
screen _ctc:
|
||||
add ctc
|
||||
|
||||
# These are used by renpy.notify.
|
||||
|
||||
transform _notify_transform:
|
||||
# These control the position.
|
||||
xalign .02 yalign .015
|
||||
|
||||
# These control the actions on show and hide.
|
||||
on show:
|
||||
alpha 0
|
||||
linear .25 alpha 1.0
|
||||
on hide:
|
||||
linear .5 alpha 0.0
|
||||
|
||||
screen notify:
|
||||
zorder 100
|
||||
|
||||
text message at _notify_transform
|
||||
|
||||
# This controls how long it takes between when the screen is
|
||||
# first shown, and when it begins hiding.
|
||||
timer 3.25 action Hide('notify')
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file contains code that creates a few new statements. We'll
|
||||
@@ -137,19 +137,24 @@ python early hide:
|
||||
def predict_play_music(p):
|
||||
return [ ]
|
||||
|
||||
def lint_play_music(p):
|
||||
def lint_play_music(p, channel="music"):
|
||||
|
||||
file = _try_eval(p["file"], 'filename')
|
||||
if p["channel"] is not None:
|
||||
_try_eval(p["channel"], 'channel')
|
||||
|
||||
if p["channel"] is not None:
|
||||
channel = _try_eval(p["channel"], 'channel')
|
||||
|
||||
if not isinstance(file, list):
|
||||
file = [ file ]
|
||||
|
||||
for fn in file:
|
||||
if isinstance(fn, basestring) and not renpy.loadable(fn):
|
||||
renpy.error("%r is not loadable" % fn)
|
||||
|
||||
if isinstance(fn, basestring):
|
||||
try:
|
||||
if not renpy.music.playable(fn, channel):
|
||||
renpy.error("%r is not loadable" % fn)
|
||||
except:
|
||||
pass
|
||||
|
||||
renpy.statements.register('play music',
|
||||
parse=parse_play_music,
|
||||
execute=execute_play_music,
|
||||
@@ -254,11 +259,14 @@ python early hide:
|
||||
fadeout=fadeout,
|
||||
fadein=eval(p["fadein"]),
|
||||
channel=channel)
|
||||
|
||||
|
||||
def lint_play_sound(p, lint_play_music=lint_play_music):
|
||||
return lint_play_music(p, channel="sound")
|
||||
|
||||
renpy.statements.register('play sound',
|
||||
parse=parse_play_music,
|
||||
execute=execute_play_sound,
|
||||
lint=lint_play_music)
|
||||
lint=lint_play_sound)
|
||||
|
||||
def execute_queue_sound(p):
|
||||
if p["channel"] is not None:
|
||||
@@ -334,7 +342,7 @@ python early hide:
|
||||
if not renpy.music.channel_defined(channel):
|
||||
renpy.error("channel %r is not defined" % channel)
|
||||
|
||||
lint_play_music(p)
|
||||
lint_play_music(p, channel)
|
||||
|
||||
def lint_stop_generic(p):
|
||||
channel = eval(p["channel"])
|
||||
@@ -495,7 +503,11 @@ python early hide:
|
||||
l.expect_eol()
|
||||
|
||||
return dict(name=name)
|
||||
|
||||
|
||||
def predict_screen(p):
|
||||
if not p["parameters"]:
|
||||
renpy.predict_screen(p["name"])
|
||||
|
||||
def execute_show_screen(p):
|
||||
|
||||
name = p["name"]
|
||||
@@ -515,7 +527,7 @@ python early hide:
|
||||
kwargs = { }
|
||||
|
||||
for k, v in parameters.iteritems():
|
||||
kwargs[k] = eval(v)
|
||||
kwargs[str(k)] = eval(v)
|
||||
|
||||
store._return = renpy.call_screen(name, **kwargs)
|
||||
|
||||
@@ -532,11 +544,13 @@ python early hide:
|
||||
renpy.statements.register("show screen",
|
||||
parse=parse_show_call_screen,
|
||||
execute=execute_show_screen,
|
||||
predict=predict_screen,
|
||||
lint=lint_screen)
|
||||
|
||||
renpy.statements.register("call screen",
|
||||
parse=parse_show_call_screen,
|
||||
execute=execute_call_screen,
|
||||
predict=predict_screen,
|
||||
lint=lint_screen)
|
||||
|
||||
renpy.statements.register("hide screen",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This file is responsible for creating and defining the default styles
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init -1110 python:
|
||||
@@ -71,9 +71,7 @@ init -1110 python hide:
|
||||
style.vscrollbar.bar_vertical = True
|
||||
style.vscrollbar.bar_invert = True
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# This recolors the given image using one or two colors.
|
||||
@theme
|
||||
def OneOrTwoColor(image, color):
|
||||
@@ -82,246 +80,68 @@ init -1110 python hide:
|
||||
else:
|
||||
return im.Twocolor(image, color, color)
|
||||
|
||||
@theme
|
||||
def roundrect_frames(
|
||||
less_rounded,
|
||||
frame):
|
||||
def roundrect_based_theme(name, file_prefix, Box=None, frame_png=None):
|
||||
|
||||
theme.clear_frames()
|
||||
|
||||
style.frame.background = RoundRect(frame, less_rounded)
|
||||
if Box is None:
|
||||
def Box(color, ignored):
|
||||
return Frame(theme.OneOrTwoColor(file_prefix + "_box.png", color), 12, 12)
|
||||
|
||||
style.frame.xpadding = 6
|
||||
style.frame.ypadding = 6
|
||||
|
||||
if frame_png is not None:
|
||||
def FrameBox(color, ignored):
|
||||
return Frame(theme.OneOrTwoColor(file_prefix + frame_png, color), 12, 12)
|
||||
else:
|
||||
FrameBox = Box
|
||||
|
||||
@theme
|
||||
def roundrect_buttons(text_size,
|
||||
less_rounded,
|
||||
widget,
|
||||
widget_hover,
|
||||
widget_text,
|
||||
widget_selected,
|
||||
disabled,
|
||||
disabled_text):
|
||||
|
||||
theme.clear_buttons()
|
||||
|
||||
style.button.background = RoundRect(widget, less_rounded)
|
||||
style.button.hover_background = RoundRect(widget_hover, less_rounded)
|
||||
style.button.insensitive_background = RoundRect(disabled, less_rounded)
|
||||
|
||||
style.button_text.size = text_size
|
||||
style.button_text.color = widget_text
|
||||
style.button_text.selected_color = widget_selected
|
||||
style.button_text.insensitive_color = disabled_text
|
||||
|
||||
if less_rounded:
|
||||
style.button.xpadding = 6
|
||||
else:
|
||||
style.button.xpadding = 12
|
||||
|
||||
style.button.ypadding = 1
|
||||
style.button.xmargin = 1
|
||||
style.button.ymargin = 1
|
||||
|
||||
style.button_text.xalign = 0.5
|
||||
style.button_text.yalign = 0.5
|
||||
style.button_text.text_align = 0.5
|
||||
|
||||
@theme
|
||||
def roundrect_large_buttons(
|
||||
text_size,
|
||||
less_rounded,
|
||||
widget,
|
||||
widget_hover,
|
||||
widget_text,
|
||||
widget_selected,
|
||||
disabled,
|
||||
disabled_text):
|
||||
|
||||
theme.clear_large_buttons()
|
||||
|
||||
if less_rounded:
|
||||
style.large_button.xpadding = 6
|
||||
else:
|
||||
style.large_button.xpadding = 12
|
||||
|
||||
style.large_button.ypadding = 1
|
||||
style.large_button.xmargin = 1
|
||||
style.large_button.ymargin = 1
|
||||
|
||||
style.large_button.background = RoundRect(widget, less_rounded)
|
||||
style.large_button.hover_background = RoundRect(widget_hover, less_rounded)
|
||||
style.large_button.insensitive_background = RoundRect(disabled, less_rounded)
|
||||
|
||||
style.large_button_text.size = text_size
|
||||
style.large_button_text.color = widget_text
|
||||
style.large_button_text.selected_color = widget_selected
|
||||
style.large_button_text.insensitive_color = disabled_text
|
||||
|
||||
style.large_button_text.xalign = 0
|
||||
style.large_button_text.yalign = 0
|
||||
|
||||
@theme
|
||||
def roundrect_labels(
|
||||
text_size,
|
||||
label):
|
||||
|
||||
theme.clear_labels()
|
||||
|
||||
style.label_text.size = text_size
|
||||
style.label_text.color = label
|
||||
|
||||
@theme
|
||||
def roundrect_prompts(
|
||||
text_size,
|
||||
label):
|
||||
|
||||
theme.clear_prompts()
|
||||
|
||||
style.prompt_text.size = text_size
|
||||
style.prompt_text.color = label
|
||||
|
||||
style.prompt.xalign = 0.5
|
||||
style.prompt_text.text_align = 0.5
|
||||
style.prompt_text.layout = "subtitle"
|
||||
|
||||
@theme
|
||||
def roundrect_bars(
|
||||
widget,
|
||||
widget_hover):
|
||||
|
||||
theme.clear_bars()
|
||||
|
||||
def img(name, color, x, y):
|
||||
rv = theme.OneOrTwoColor("_roundrect/" + name + ".png", color)
|
||||
if x is not None:
|
||||
rv = Frame(rv, x, y)
|
||||
return rv
|
||||
|
||||
# Bars.
|
||||
style.bar.ymaximum = 24
|
||||
style.bar.left_gutter = 6
|
||||
style.bar.right_gutter = 6
|
||||
style.bar.thumb_offset = 6
|
||||
|
||||
style.bar.left_bar = img("rrslider_full", widget, 12, 0)
|
||||
style.bar.right_bar = img("rrslider_empty", widget, 12, 0)
|
||||
style.bar.thumb = img("rrslider_thumb", widget, None, None)
|
||||
style.bar.hover_left_bar = img("rrslider_full", widget_hover, 12, 0)
|
||||
style.bar.hover_right_bar = img("rrslider_empty", widget_hover, 12, 0)
|
||||
style.bar.hover_thumb = img("rrslider_thumb", widget_hover, None, None)
|
||||
|
||||
style.vbar.xmaximum = 24
|
||||
style.vbar.top_gutter = 6
|
||||
style.vbar.bottom_gutter = 6
|
||||
style.vbar.thumb_offset = 6
|
||||
|
||||
style.vbar.bottom_bar = img("rrvslider_full", widget, 0, 12)
|
||||
style.vbar.top_bar = img("rrvslider_empty", widget, 0, 12)
|
||||
style.vbar.thumb = img("rrvslider_thumb", widget, None, None)
|
||||
style.vbar.hover_bottom_bar = img("rrvslider_full", widget_hover, 0, 12)
|
||||
style.vbar.hover_top_bar = img("rrvslider_empty", widget_hover, 0, 12)
|
||||
style.vbar.hover_thumb = img("rrvslider_thumb", widget_hover, None, None)
|
||||
|
||||
# Sliders.
|
||||
style.slider.ymaximum = 24
|
||||
style.slider.left_gutter = 6
|
||||
style.slider.right_gutter = 6
|
||||
style.slider.thumb_offset = 6
|
||||
|
||||
style.slider.left_bar = img("rrslider_full", widget, 12, 0)
|
||||
style.slider.right_bar = img("rrslider_empty", widget, 12, 0)
|
||||
style.slider.thumb = img("rrslider_thumb", widget, None, None)
|
||||
style.slider.hover_left_bar = img("rrslider_full", widget_hover, 12, 0)
|
||||
style.slider.hover_right_bar = img("rrslider_empty", widget_hover, 12, 0)
|
||||
style.slider.hover_thumb = img("rrslider_thumb", widget_hover, None, None)
|
||||
|
||||
style.vslider.xmaximum = 24
|
||||
style.vslider.top_gutter = 6
|
||||
style.vslider.bottom_gutter = 6
|
||||
style.vslider.thumb_offset = 6
|
||||
|
||||
style.vslider.bottom_bar = img("rrvslider_full", widget, 0, 12)
|
||||
style.vslider.top_bar = img("rrvslider_empty", widget, 0, 12)
|
||||
style.vslider.thumb = img("rrvslider_thumb", widget, None, None)
|
||||
style.vslider.hover_bottom_bar = img("rrvslider_full", widget_hover, 0, 12)
|
||||
style.vslider.hover_top_bar = img("rrvslider_empty", widget_hover, 0, 12)
|
||||
style.vslider.hover_thumb = img("rrvslider_thumb", widget_hover, None, None)
|
||||
|
||||
|
||||
# Scrollbars.
|
||||
style.scrollbar.left_gutter = 6
|
||||
style.scrollbar.right_gutter = 6
|
||||
style.scrollbar.thumb_offset = 6
|
||||
style.scrollbar.ymaximum = 12
|
||||
|
||||
style.scrollbar.left_bar = img("rrscrollbar", widget, 12, 0)
|
||||
style.scrollbar.right_bar = img("rrscrollbar", widget, 12, 0)
|
||||
style.scrollbar.thumb = img("rrscrollbar_thumb", widget, None, None)
|
||||
style.scrollbar.hover_left_bar = img("rrscrollbar", widget_hover, 12, 0)
|
||||
style.scrollbar.hover_right_bar = img("rrscrollbar", widget_hover, 12, 0)
|
||||
style.scrollbar.hover_thumb = img("rrscrollbar_thumb", widget_hover, None, None)
|
||||
|
||||
style.vscrollbar.top_gutter = 6
|
||||
style.vscrollbar.bottom_gutter = 6
|
||||
style.vscrollbar.thumb_offset = 6
|
||||
style.vscrollbar.xmaximum = 12
|
||||
|
||||
style.vscrollbar.left_bar = img("rrvscrollbar", widget, 0, 12)
|
||||
style.vscrollbar.right_bar = img("rrvscrollbar", widget, 0, 12)
|
||||
style.vscrollbar.thumb = img("rrvscrollbar_thumb", widget, None, None)
|
||||
style.vscrollbar.hover_left_bar = img("rrvscrollbar", widget_hover, 0, 12)
|
||||
style.vscrollbar.hover_right_bar = img("rrvscrollbar", widget_hover, 0, 12)
|
||||
style.vscrollbar.hover_thumb = img("rrvscrollbar_thumb", widget_hover, None, None)
|
||||
|
||||
@theme
|
||||
def roundrect(
|
||||
widget = (0, 60, 120, 255),
|
||||
widget_hover = (0, 80, 160, 255),
|
||||
widget_text = (200, 225, 255, 255),
|
||||
widget_selected = (255, 255, 200, 255),
|
||||
disabled = (64, 64, 64, 255),
|
||||
disabled_text = (200, 200, 200, 255),
|
||||
label = (255, 255, 255, 255),
|
||||
frame = (100, 150, 200, 255),
|
||||
|
||||
text_size=None,
|
||||
small_text_size=None,
|
||||
less_rounded = False,
|
||||
|
||||
# Compat for the old roundrect theme.
|
||||
window = None,
|
||||
button_menu = None,
|
||||
rounded_window = True,
|
||||
outline_bars = False,
|
||||
mm_root = None,
|
||||
gm_root = None):
|
||||
|
||||
if button_menu is None:
|
||||
if (config.script_version is not None) and (config.script_version < (6, 9, 0)):
|
||||
button_menu = True
|
||||
else:
|
||||
button_menu = False
|
||||
|
||||
layout.defaults()
|
||||
|
||||
if config.screen_width <= 640:
|
||||
text_size = text_size or 18
|
||||
small_text_size = small_text_size or 12
|
||||
less_rounded = True
|
||||
|
||||
else:
|
||||
text_size = text_size or 22
|
||||
small_text_size = small_text_size or 16
|
||||
radius = 12
|
||||
|
||||
theme.roundrect_frames(
|
||||
def frames(
|
||||
less_rounded,
|
||||
frame)
|
||||
frame):
|
||||
|
||||
theme.roundrect_buttons(
|
||||
theme.clear_frames()
|
||||
|
||||
style.frame.background = Box(frame, less_rounded)
|
||||
|
||||
style.frame.xpadding = 6
|
||||
style.frame.ypadding = 6
|
||||
|
||||
setattr(theme, name + "_frames", frames)
|
||||
|
||||
|
||||
def buttons(text_size,
|
||||
less_rounded,
|
||||
widget,
|
||||
widget_hover,
|
||||
widget_text,
|
||||
widget_selected,
|
||||
disabled,
|
||||
disabled_text):
|
||||
|
||||
theme.clear_buttons()
|
||||
|
||||
style.button.background = Box(widget, less_rounded)
|
||||
style.button.hover_background = Box(widget_hover, less_rounded)
|
||||
style.button.insensitive_background = Box(disabled, less_rounded)
|
||||
|
||||
style.button_text.size = text_size
|
||||
style.button_text.color = widget_text
|
||||
style.button_text.selected_color = widget_selected
|
||||
style.button_text.insensitive_color = disabled_text
|
||||
|
||||
if less_rounded:
|
||||
style.button.xpadding = 6
|
||||
else:
|
||||
style.button.xpadding = 12
|
||||
|
||||
style.button.ypadding = 1
|
||||
style.button.xmargin = 1
|
||||
style.button.ymargin = 1
|
||||
|
||||
style.button_text.xalign = 0.5
|
||||
style.button_text.yalign = 0.5
|
||||
style.button_text.text_align = 0.5
|
||||
|
||||
setattr(theme, name + "_buttons", buttons)
|
||||
|
||||
def large_buttons(
|
||||
text_size,
|
||||
less_rounded,
|
||||
widget,
|
||||
@@ -329,55 +149,260 @@ init -1110 python hide:
|
||||
widget_text,
|
||||
widget_selected,
|
||||
disabled,
|
||||
disabled_text)
|
||||
disabled_text):
|
||||
|
||||
theme.roundrect_large_buttons(
|
||||
small_text_size,
|
||||
less_rounded,
|
||||
widget,
|
||||
widget_hover,
|
||||
widget_text,
|
||||
widget_selected,
|
||||
disabled,
|
||||
disabled_text)
|
||||
theme.clear_large_buttons()
|
||||
|
||||
theme.roundrect_labels(
|
||||
text_size,
|
||||
label)
|
||||
|
||||
theme.roundrect_prompts(
|
||||
text_size,
|
||||
label)
|
||||
|
||||
theme.roundrect_bars(
|
||||
widget,
|
||||
widget_hover)
|
||||
|
||||
if mm_root is not None:
|
||||
style.mm_root.background = mm_root
|
||||
|
||||
if gm_root is not None:
|
||||
style.gm_root.background = gm_root
|
||||
|
||||
if window is not None:
|
||||
|
||||
if rounded_window:
|
||||
style.window.background = RoundRect(window, less_rounded)
|
||||
style.window.xpadding = 6
|
||||
style.window.xmargin = 6
|
||||
style.window.ypadding = 6
|
||||
style.window.ymargin = 6
|
||||
if less_rounded:
|
||||
style.large_button.xpadding = 6
|
||||
else:
|
||||
style.window.background = Solid(window)
|
||||
style.window.xpadding = 6
|
||||
style.window.xmargin = 0
|
||||
style.window.ypadding = 6
|
||||
style.window.ymargin = 0
|
||||
style.large_button.xpadding = 12
|
||||
|
||||
style.large_button.ypadding = 1
|
||||
style.large_button.xmargin = 1
|
||||
style.large_button.ymargin = 1
|
||||
|
||||
style.large_button.background = Box(widget, less_rounded)
|
||||
style.large_button.hover_background = Box(widget_hover, less_rounded)
|
||||
style.large_button.insensitive_background = Box(disabled, less_rounded)
|
||||
|
||||
style.large_button_text.size = text_size
|
||||
style.large_button_text.color = widget_text
|
||||
style.large_button_text.selected_color = widget_selected
|
||||
style.large_button_text.insensitive_color = disabled_text
|
||||
|
||||
style.large_button_text.xalign = 0
|
||||
style.large_button_text.yalign = 0
|
||||
|
||||
setattr(theme, name + "_large_buttons", large_buttons)
|
||||
|
||||
def labels(
|
||||
text_size,
|
||||
label):
|
||||
|
||||
theme.clear_labels()
|
||||
|
||||
style.label_text.size = text_size
|
||||
style.label_text.color = label
|
||||
|
||||
setattr(theme, name + "_labels", labels)
|
||||
|
||||
def prompts(
|
||||
text_size,
|
||||
label):
|
||||
|
||||
theme.clear_prompts()
|
||||
|
||||
style.prompt_text.size = text_size
|
||||
style.prompt_text.color = label
|
||||
|
||||
style.prompt.xalign = 0.5
|
||||
style.prompt_text.text_align = 0.5
|
||||
style.prompt_text.layout = "subtitle"
|
||||
|
||||
setattr(theme, name + "_prompts", prompts)
|
||||
|
||||
|
||||
def bars(
|
||||
widget,
|
||||
widget_hover):
|
||||
|
||||
theme.clear_bars()
|
||||
|
||||
def img(name, color, x, y):
|
||||
rv = theme.OneOrTwoColor(file_prefix + name + ".png", color)
|
||||
if x is not None:
|
||||
rv = Frame(rv, x, y, tile=True)
|
||||
return rv
|
||||
|
||||
# Bars.
|
||||
style.bar.ymaximum = 24
|
||||
style.bar.left_gutter = 6
|
||||
style.bar.right_gutter = 6
|
||||
style.bar.thumb_offset = 6
|
||||
|
||||
style.bar.left_bar = img("slider_full", widget, 12, 0)
|
||||
style.bar.right_bar = img("slider_empty", widget, 12, 0)
|
||||
style.bar.thumb = img("slider_thumb", widget, None, None)
|
||||
style.bar.hover_left_bar = img("slider_full", widget_hover, 12, 0)
|
||||
style.bar.hover_right_bar = img("slider_empty", widget_hover, 12, 0)
|
||||
style.bar.hover_thumb = img("slider_thumb", widget_hover, None, None)
|
||||
|
||||
style.vbar.xmaximum = 24
|
||||
style.vbar.top_gutter = 6
|
||||
style.vbar.bottom_gutter = 6
|
||||
style.vbar.thumb_offset = 6
|
||||
|
||||
style.vbar.bottom_bar = img("vslider_full", widget, 0, 12)
|
||||
style.vbar.top_bar = img("vslider_empty", widget, 0, 12)
|
||||
style.vbar.thumb = img("vslider_thumb", widget, None, None)
|
||||
style.vbar.hover_bottom_bar = img("vslider_full", widget_hover, 0, 12)
|
||||
style.vbar.hover_top_bar = img("vslider_empty", widget_hover, 0, 12)
|
||||
style.vbar.hover_thumb = img("vslider_thumb", widget_hover, None, None)
|
||||
|
||||
# Sliders.
|
||||
style.slider.ymaximum = 24
|
||||
style.slider.left_gutter = 6
|
||||
style.slider.right_gutter = 6
|
||||
style.slider.thumb_offset = 6
|
||||
|
||||
style.slider.left_bar = img("slider_full", widget, 12, 0)
|
||||
style.slider.right_bar = img("slider_empty", widget, 12, 0)
|
||||
style.slider.thumb = img("slider_thumb", widget, None, None)
|
||||
style.slider.hover_left_bar = img("slider_full", widget_hover, 12, 0)
|
||||
style.slider.hover_right_bar = img("slider_empty", widget_hover, 12, 0)
|
||||
style.slider.hover_thumb = img("slider_thumb", widget_hover, None, None)
|
||||
|
||||
style.vslider.xmaximum = 24
|
||||
style.vslider.top_gutter = 6
|
||||
style.vslider.bottom_gutter = 6
|
||||
style.vslider.thumb_offset = 6
|
||||
|
||||
style.vslider.bottom_bar = img("vslider_full", widget, 0, 12)
|
||||
style.vslider.top_bar = img("vslider_empty", widget, 0, 12)
|
||||
style.vslider.thumb = img("vslider_thumb", widget, None, None)
|
||||
style.vslider.hover_bottom_bar = img("vslider_full", widget_hover, 0, 12)
|
||||
style.vslider.hover_top_bar = img("vslider_empty", widget_hover, 0, 12)
|
||||
style.vslider.hover_thumb = img("vslider_thumb", widget_hover, None, None)
|
||||
|
||||
|
||||
if button_menu:
|
||||
layout.button_menu()
|
||||
# Scrollbars.
|
||||
style.scrollbar.left_gutter = 6
|
||||
style.scrollbar.right_gutter = 6
|
||||
style.scrollbar.thumb_offset = 6
|
||||
style.scrollbar.ymaximum = 12
|
||||
|
||||
style.scrollbar.left_bar = img("scrollbar", widget, 12, 0)
|
||||
style.scrollbar.right_bar = img("scrollbar", widget, 12, 0)
|
||||
style.scrollbar.thumb = img("scrollbar_thumb", widget, None, None)
|
||||
style.scrollbar.hover_left_bar = img("scrollbar", widget_hover, 12, 0)
|
||||
style.scrollbar.hover_right_bar = img("scrollbar", widget_hover, 12, 0)
|
||||
style.scrollbar.hover_thumb = img("scrollbar_thumb", widget_hover, None, None)
|
||||
|
||||
style.vscrollbar.top_gutter = 6
|
||||
style.vscrollbar.bottom_gutter = 6
|
||||
style.vscrollbar.thumb_offset = 6
|
||||
style.vscrollbar.xmaximum = 12
|
||||
|
||||
style.vscrollbar.left_bar = img("vscrollbar", widget, 0, 12)
|
||||
style.vscrollbar.right_bar = img("vscrollbar", widget, 0, 12)
|
||||
style.vscrollbar.thumb = img("vscrollbar_thumb", widget, None, None)
|
||||
style.vscrollbar.hover_left_bar = img("vscrollbar", widget_hover, 0, 12)
|
||||
style.vscrollbar.hover_right_bar = img("vscrollbar", widget_hover, 0, 12)
|
||||
style.vscrollbar.hover_thumb = img("vscrollbar_thumb", widget_hover, None, None)
|
||||
|
||||
setattr(theme, name + "_bars", bars)
|
||||
|
||||
def main(
|
||||
widget = (0, 60, 120, 255),
|
||||
widget_hover = (0, 80, 160, 255),
|
||||
widget_text = (200, 225, 255, 255),
|
||||
widget_selected = (255, 255, 200, 255),
|
||||
disabled = (64, 64, 64, 255),
|
||||
disabled_text = (200, 200, 200, 255),
|
||||
label = (255, 255, 255, 255),
|
||||
frame = (100, 150, 200, 255),
|
||||
|
||||
text_size=None,
|
||||
small_text_size=None,
|
||||
less_rounded = False,
|
||||
|
||||
# Compat for the old roundrect theme.
|
||||
window = None,
|
||||
button_menu = None,
|
||||
rounded_window = True,
|
||||
outline_bars = False,
|
||||
mm_root = None,
|
||||
gm_root = None):
|
||||
|
||||
if button_menu is None:
|
||||
if (config.script_version is not None) and (config.script_version < (6, 9, 0)):
|
||||
button_menu = True
|
||||
else:
|
||||
button_menu = False
|
||||
|
||||
layout.defaults()
|
||||
|
||||
if config.screen_width <= 640:
|
||||
text_size = text_size or 18
|
||||
small_text_size = small_text_size or 12
|
||||
less_rounded = True
|
||||
|
||||
else:
|
||||
text_size = text_size or 22
|
||||
small_text_size = small_text_size or 16
|
||||
radius = 12
|
||||
|
||||
frames(
|
||||
less_rounded,
|
||||
frame)
|
||||
|
||||
buttons(
|
||||
text_size,
|
||||
less_rounded,
|
||||
widget,
|
||||
widget_hover,
|
||||
widget_text,
|
||||
widget_selected,
|
||||
disabled,
|
||||
disabled_text)
|
||||
|
||||
large_buttons(
|
||||
small_text_size,
|
||||
less_rounded,
|
||||
widget,
|
||||
widget_hover,
|
||||
widget_text,
|
||||
widget_selected,
|
||||
disabled,
|
||||
disabled_text)
|
||||
|
||||
labels(
|
||||
text_size,
|
||||
label)
|
||||
|
||||
prompts(
|
||||
text_size,
|
||||
label)
|
||||
|
||||
bars(
|
||||
widget,
|
||||
widget_hover)
|
||||
|
||||
if mm_root is not None:
|
||||
style.mm_root.background = mm_root
|
||||
|
||||
if gm_root is not None:
|
||||
style.gm_root.background = gm_root
|
||||
|
||||
if window is not None:
|
||||
|
||||
if rounded_window:
|
||||
style.window.background = RoundRect(window, less_rounded)
|
||||
style.window.xpadding = 6
|
||||
style.window.xmargin = 6
|
||||
style.window.ypadding = 6
|
||||
style.window.ymargin = 6
|
||||
else:
|
||||
style.window.background = Solid(window)
|
||||
style.window.xpadding = 6
|
||||
style.window.xmargin = 0
|
||||
style.window.ypadding = 6
|
||||
style.window.ymargin = 0
|
||||
|
||||
|
||||
if button_menu:
|
||||
layout.button_menu()
|
||||
|
||||
setattr(theme, name, main)
|
||||
|
||||
roundrect_based_theme("roundrect", "_roundrect/rr", RoundRect)
|
||||
roundrect_based_theme("bordered", "_theme_bordered/br")
|
||||
roundrect_based_theme("diamond", "_theme_diamond/d")
|
||||
roundrect_based_theme("tv", "_theme_tv/t")
|
||||
roundrect_based_theme("glow", "_theme_glow/g", None, "_outline.png")
|
||||
|
||||
|
||||
@theme
|
||||
def ancient():
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# This extra contains a basic implementation of voice support. Right
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init -1170 python hide:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# Copyright 2004-2006 PyTom
|
||||
# Copyright 2004-2011 Tom Rothamel
|
||||
#
|
||||
# Please see the LICENSE.txt distributed with Ren'Py for permission to
|
||||
# copy and modify.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python hide:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Copyright 2004-2008 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
# Copyright 2004-2007 PyTom
|
||||
# Copyright 2004-2011 Tom Rothamel
|
||||
#
|
||||
# Please see the LICENSE.txt distributed with Ren'Py for permission to
|
||||
# copy and modify.
|
||||
|
||||
@@ -1,29 +1,34 @@
|
||||
# This file contains code that helps support the development of Ren'Py
|
||||
# games.
|
||||
|
||||
screen _developer:
|
||||
window style "gm_root"
|
||||
|
||||
frame:
|
||||
style_group "_developer"
|
||||
|
||||
align (.025, .05)
|
||||
|
||||
has vbox:
|
||||
first_spacing 10
|
||||
|
||||
label "Developer Menu"
|
||||
|
||||
textbutton _(u"Return") action Return()
|
||||
textbutton _(u"Reload Game (Shift + R)") action ui.callsinnewcontext("_save_reload_game")
|
||||
textbutton _(u"Variable Viewer") action Jump("_debugger_screen")
|
||||
textbutton _(u"Theme Test") action Jump("_theme_test")
|
||||
textbutton _(u"Style Hierarchy") action Jump("_style_hierarchy")
|
||||
textbutton _(u"Image Location Picker") action Jump("_image_location_picker")
|
||||
textbutton _(u"Filename List") action Jump("_filename_list")
|
||||
|
||||
init python hide:
|
||||
style._developer_button = Style(style.button)
|
||||
style._developer_button.size_group = "_developer"
|
||||
|
||||
label _developer_screen:
|
||||
|
||||
python hide:
|
||||
|
||||
ui.window(style=style.gm_root)
|
||||
ui.null()
|
||||
|
||||
ui.frame(xalign=.025, yalign=.05, style=style.menu_frame)
|
||||
ui.vbox(box_first_spacing=10)
|
||||
layout.label(u"Developer Menu", None)
|
||||
|
||||
sg = "developer_menu"
|
||||
|
||||
layout.button(u"Return", None, clicked=ui.returns(True), size_group=sg)
|
||||
layout.button(u"Reload Game (Shift+R)", None, clicked=ui.callsinnewcontext("_save_reload_game"), size_group=sg)
|
||||
layout.button(u"Variable Viewer", None, clicked=ui.jumps("_debugger_screen"), size_group=sg)
|
||||
layout.button(u"Theme Test", None, clicked=ui.jumps("_theme_test"), size_group=sg)
|
||||
layout.button(u"Style Hierarchy", None, clicked=ui.jumps("_style_hierarchy"), size_group=sg)
|
||||
# layout.button(u"FPS Meter", None, clicked=ui.jumps("_fps_meter"), size_group=sg)
|
||||
layout.button(u"Image Location Picker", None, clicked=ui.jumps("_image_location_picker"), size_group=sg)
|
||||
|
||||
ui.close()
|
||||
ui.interact()
|
||||
call screen _developer
|
||||
|
||||
return
|
||||
|
||||
@@ -369,8 +374,8 @@ init python:
|
||||
sr = renpy.render(Solid("#0ff4"), w, h, st, at)
|
||||
rv.blit(sr, (minx, miny))
|
||||
|
||||
text.append("Imagemap rectangle: %r" % ((minx, miny, maxx, maxy),))
|
||||
text.append("Cropping rectangle: %r" % ((minx, miny, w, h),))
|
||||
# text.append("Imagemap rectangle: %r" % ((minx, miny, maxx, maxy),))
|
||||
text.append("Rectangle: %r" % ((minx, miny, w, h),))
|
||||
|
||||
if self.mouse:
|
||||
mx, my = self.mouse
|
||||
@@ -466,6 +471,30 @@ label _image_location_picker:
|
||||
|
||||
renpy.jump("_image_location_picker")
|
||||
|
||||
label _filename_list:
|
||||
|
||||
python hide:
|
||||
import os
|
||||
f = file("files.txt", "w")
|
||||
|
||||
for dirname, dirs, files in os.walk(config.gamedir):
|
||||
|
||||
dirs.sort()
|
||||
files.sort()
|
||||
|
||||
for fn in files:
|
||||
fn = os.path.join(dirname, fn)
|
||||
fn = fn[len(config.gamedir) + 1:]
|
||||
print >>f, fn
|
||||
print fn
|
||||
|
||||
f.close()
|
||||
|
||||
renpy.launch_editor(["files.txt"], transient=1)
|
||||
|
||||
|
||||
jump _developer_screen
|
||||
|
||||
|
||||
init python:
|
||||
config.underlay.append(im.Tile("_transparent_tile.png"))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python hide:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python hide:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python hide:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2004-2010 PyTom <pytom@bishoujo.us>
|
||||
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
|
||||
# See LICENSE.txt for license details.
|
||||
|
||||
init python:
|
||||
|
||||
|
After Width: | Height: | Size: 266 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 489 B |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 2.9 KiB |
|
After Width: | Height: | Size: 313 B |
|
After Width: | Height: | Size: 287 B |
|
After Width: | Height: | Size: 236 B |
|
After Width: | Height: | Size: 265 B |
|
After Width: | Height: | Size: 324 B |
|
After Width: | Height: | Size: 356 B |
|
After Width: | Height: | Size: 289 B |
|
After Width: | Height: | Size: 247 B |
|
After Width: | Height: | Size: 255 B |
|
After Width: | Height: | Size: 359 B |
|
After Width: | Height: | Size: 405 B |
|
After Width: | Height: | Size: 313 B |
|
After Width: | Height: | Size: 763 B |
|
After Width: | Height: | Size: 862 B |
|
After Width: | Height: | Size: 524 B |
|
After Width: | Height: | Size: 450 B |
|
After Width: | Height: | Size: 781 B |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 545 B |
|
After Width: | Height: | Size: 611 B |
|
After Width: | Height: | Size: 460 B |
|
After Width: | Height: | Size: 816 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 529 B |
|
After Width: | Height: | Size: 315 B |
|
After Width: | Height: | Size: 246 B |
|
After Width: | Height: | Size: 184 B |
|
After Width: | Height: | Size: 364 B |
|
After Width: | Height: | Size: 384 B |
|
After Width: | Height: | Size: 206 B |
|
After Width: | Height: | Size: 266 B |
|
After Width: | Height: | Size: 204 B |
|
After Width: | Height: | Size: 408 B |
|
After Width: | Height: | Size: 412 B |
|
After Width: | Height: | Size: 212 B |
@@ -1 +0,0 @@
|
||||
dist/console.exe
|
||||
@@ -9,6 +9,10 @@ import time
|
||||
import zlib
|
||||
import compileall
|
||||
import shutil
|
||||
import subprocess
|
||||
import makeupdate
|
||||
import glob
|
||||
import time
|
||||
|
||||
zlib.Z_DEFAULT_COMPRESSION = 9
|
||||
|
||||
@@ -20,7 +24,7 @@ def data(fn):
|
||||
if fn.startswith("renpy.app"):
|
||||
return rv
|
||||
|
||||
if fn.endswith(".rpy") or fn.endswith(".py") or fn.endswith(".txt"):
|
||||
if fn.endswith(".rpy") or fn.endswith(".rpym") or fn.endswith(".py") or fn.endswith(".txt"):
|
||||
rv = rv.replace("\n", "\r\n")
|
||||
rv = rv.replace("\r\r\n", "\r\n")
|
||||
|
||||
@@ -87,7 +91,11 @@ def tree(root):
|
||||
|
||||
if ".svn" in dirs:
|
||||
dirs.remove(".svn")
|
||||
|
||||
|
||||
if ".doctrees" in dirs:
|
||||
dirs.remove(".doctrees")
|
||||
|
||||
|
||||
for f in filenames:
|
||||
if f[-1] == '~' or f[0] == '.':
|
||||
continue
|
||||
@@ -113,104 +121,72 @@ def main():
|
||||
|
||||
prefix = sys.argv[1]
|
||||
|
||||
shutil.copy("tutorial/game/screens.rpy", "template/game/screens.rpy")
|
||||
|
||||
# Update the update-version.txt file.
|
||||
p = subprocess.Popen(["bzr", "revno"], stdout=subprocess.PIPE)
|
||||
revno = p.stdout.read().strip() + "-" + str(time.time())
|
||||
p.wait()
|
||||
|
||||
f = file("lib/update-version.txt", "w")
|
||||
f.write(revno + " base\n")
|
||||
f.close()
|
||||
|
||||
# Compile all the python files.
|
||||
compileall.compile_dir("renpy/", ddir=prefix + "/renpy/", force=1)
|
||||
|
||||
os.environ['RENPY_PATH_ELIDE'] = '/home/tom/ab/renpy:' + prefix
|
||||
|
||||
# Chmod the mac app.
|
||||
os.chmod("./renpy.app/Contents/MacOS/Ren'Py Launcher", 0755)
|
||||
|
||||
# Chmod down renpy.py, for now.
|
||||
os.chmod("renpy.py", 0644)
|
||||
|
||||
# Compile the various games
|
||||
for i in [ 'tutorial/game', 'launcher', 'template/game', 'the_question/game' ]:
|
||||
os.system("./renpy.sh --compile --game " + i)
|
||||
|
||||
|
||||
files = [ ]
|
||||
more_files = [ ]
|
||||
|
||||
files.append("CHANGELOG.txt")
|
||||
files.append("LICENSE.txt")
|
||||
files.extend(tree("common"))
|
||||
more_files.append("console.exe")
|
||||
files.extend(tree("launcher"))
|
||||
files.extend(tree("tutorial"))
|
||||
# files.extend(tree("dse"))
|
||||
files.extend(tree("the_question"))
|
||||
|
||||
# editor = tree("editor")
|
||||
# editor.remove("editor/scite.exe")
|
||||
# files.append("editor/scite.exe")
|
||||
# more_files.extend(editor)
|
||||
|
||||
more_files.extend(tree("jedit"))
|
||||
|
||||
# files.extend(tree("extras"))
|
||||
more_files.extend(tree("lib"))
|
||||
more_files.extend(tree("lib/linux-x86"))
|
||||
|
||||
|
||||
module_files = [
|
||||
"lib/pysdlsound/linmixer.py",
|
||||
"lib/pysdlsound/__init__.py",
|
||||
"core.c",
|
||||
"ffdecode.c",
|
||||
"IMG_savepng.c",
|
||||
"IMG_savepng.h",
|
||||
"mmx.h",
|
||||
"pss.c",
|
||||
"pss.h",
|
||||
"*.c",
|
||||
"*.h",
|
||||
"*.py",
|
||||
"*.pyx",
|
||||
"README.txt",
|
||||
"_renpy.c",
|
||||
"renpy_font.c",
|
||||
"renpy.h",
|
||||
"_renpy.pyx",
|
||||
"renpy_ttf.c",
|
||||
"renpy_ttf.h",
|
||||
"rwobject.c",
|
||||
"setup.py",
|
||||
"sound.c",
|
||||
"sound.pyx",
|
||||
"subpixel.c",
|
||||
"winmixer.c",
|
||||
"winmixer.pyx",
|
||||
"_renpybidi.c",
|
||||
"renpybidicore.c",
|
||||
"_renpybidi.pyx",
|
||||
"_renpy_pysdlgl.c",
|
||||
"_renpy_pysdlgl.pyx",
|
||||
"_renpy_tegl.c",
|
||||
"maketegl.py",
|
||||
"maketegl.txt",
|
||||
"lib/pysdlsound/*.py",
|
||||
]
|
||||
|
||||
for i in module_files:
|
||||
files.append('module/' + i)
|
||||
files.extend(glob.glob('module/' + i))
|
||||
|
||||
files.extend(tree('renpy'))
|
||||
files.append('renpy.py')
|
||||
|
||||
more_files.append('python26.dll')
|
||||
more_files.append('msvcr90.dll')
|
||||
more_files.append('Microsoft.VC90.CRT.manifest')
|
||||
files.extend(tree('renpy'))
|
||||
more_files.extend(tree('renpy.app'))
|
||||
more_files.append('renpy.code')
|
||||
more_files.append('renpy.exe')
|
||||
files.append('renpy.py')
|
||||
|
||||
more_files.append('renpy.exe')
|
||||
more_files.append("console.exe")
|
||||
more_files.append('renpy.sh')
|
||||
|
||||
files.extend(tree('template'))
|
||||
# files.extend(tree('tools'))
|
||||
|
||||
files.extend(tree('doc'))
|
||||
|
||||
# files.append('doc/index.html')
|
||||
# files.append('doc/common.css')
|
||||
# files.append('doc/docs.css')
|
||||
# files.append('doc/monobook.css')
|
||||
# files.append('doc/monobook2.css')
|
||||
# files.append('doc/shared.css')
|
||||
# files.extend(tree('doc/reference'))
|
||||
# files.extend(tree('doc/tutorials'))
|
||||
# files.extend(tree('doc/images'))
|
||||
|
||||
|
||||
files.sort()
|
||||
more_files.sort()
|
||||
|
||||
@@ -222,6 +198,7 @@ def main():
|
||||
print "----"
|
||||
tarup("dists/" + prefix + "-source.tar.bz2", prefix, files)
|
||||
print "----"
|
||||
|
||||
# Make the 7zip.
|
||||
os.chdir("dists")
|
||||
os.system("unzip " + prefix + "-sdk.zip")
|
||||
@@ -233,13 +210,23 @@ def main():
|
||||
|
||||
os.system("7z a " + prefix + "-sdk.7z " + prefix)
|
||||
os.system("cat ../7z.sfx " + prefix + "-sdk.7z > " + prefix + "-sdk.7z.exe""")
|
||||
shutil.rmtree(prefix)
|
||||
os.unlink(prefix + "-sdk.7z")
|
||||
|
||||
|
||||
os.chdir("..")
|
||||
|
||||
if os.path.exists("updates/prerelease"):
|
||||
shutil.rmtree("updates/prerelease")
|
||||
|
||||
os.rename("dists/" + prefix, "updates/prerelease")
|
||||
os.unlink("updates/prerelease/lib/update-version.txt")
|
||||
|
||||
makeupdate.make_update("updates/prerelease", revno)
|
||||
|
||||
os.chmod("renpy.py", 0755)
|
||||
|
||||
print
|
||||
print "Did you remember to rebuild the exe after the last change?"
|
||||
print "Did you run me with renpython -OO?"
|
||||
print "Was ming using the right crt?"
|
||||
print "Did you update renpy.py and launcher/script_version.rpy?"
|
||||
print "Did you run with a RENPY_SCALE_FACTOR?"
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ init python:
|
||||
return rv
|
||||
|
||||
|
||||
def switch_theme(name):
|
||||
def switch_theme(theme_function, name):
|
||||
"""
|
||||
Switches the theme of the current project to the named theme.
|
||||
"""
|
||||
@@ -130,7 +130,7 @@ init python:
|
||||
m = re.match(r' theme.(\w+)\(', l)
|
||||
if m:
|
||||
if m.group(1) in theme_functions:
|
||||
l = theme_templates[td["theme"]] % td
|
||||
l = theme_templates[theme_function] % td
|
||||
changed = True
|
||||
|
||||
out.write(l + "\n")
|
||||
@@ -160,29 +160,26 @@ init python:
|
||||
|
||||
##########################################################################
|
||||
# Code that handles display.
|
||||
|
||||
|
||||
current_theme_function = None
|
||||
current_theme = None
|
||||
|
||||
def show_theme(name, target):
|
||||
def show_theme(function, name, target):
|
||||
"""
|
||||
Changes from the current theme to the roundrect theme named
|
||||
`name`.
|
||||
Changes from the current theme to the theme named `name`.
|
||||
"""
|
||||
|
||||
if current_theme == name:
|
||||
if current_theme_function == function and current_theme == name:
|
||||
return
|
||||
|
||||
store.current_theme_function = function
|
||||
store.current_theme = name
|
||||
|
||||
td = theme_data[name].copy()
|
||||
kind = td["theme"]
|
||||
del td["theme"]
|
||||
|
||||
if kind == "roundrect":
|
||||
td["rounded_window"] = False
|
||||
td["rounded_window"] = False
|
||||
|
||||
renpy.style.restore(style_backup)
|
||||
getattr(theme, kind)(**td)
|
||||
getattr(theme, function)(**td)
|
||||
customize_styles()
|
||||
renpy.style.rebuild()
|
||||
|
||||
@@ -264,7 +261,7 @@ label repeat_choose_theme:
|
||||
button(name,
|
||||
ui.returns(function),
|
||||
"",
|
||||
hovered=curried_show_theme(exemplar, "repeat_choose_theme"),
|
||||
hovered=curried_show_theme(function, exemplar, "repeat_choose_theme"),
|
||||
unhovered=does_nothing)
|
||||
|
||||
ui.close() # vbox
|
||||
@@ -292,7 +289,8 @@ label repeat_choose_color_scheme:
|
||||
|
||||
tip = _(u"Please choose a color scheme for your project.")
|
||||
|
||||
themes = [ k for k,v in theme_data.iteritems() if v["theme"] == theme_function ]
|
||||
|
||||
themes = theme_data.keys()
|
||||
themes.sort()
|
||||
|
||||
screen()
|
||||
@@ -307,9 +305,9 @@ label repeat_choose_color_scheme:
|
||||
|
||||
for i in themes:
|
||||
button(i,
|
||||
curried_switch_theme(i),
|
||||
curried_switch_theme(theme_function, i),
|
||||
"",
|
||||
hovered=curried_show_theme(i, "repeat_choose_color_scheme"),
|
||||
hovered=curried_show_theme(theme_function, i, "repeat_choose_color_scheme"),
|
||||
unhovered=does_nothing)
|
||||
|
||||
ui.close() # vbox
|
||||
|
||||
@@ -41,6 +41,7 @@ ignored_files = (
|
||||
"thumbs.db",
|
||||
"traceback.txt",
|
||||
"errors.txt",
|
||||
"files.txt",
|
||||
"saves"
|
||||
)
|
||||
|
||||
@@ -146,7 +147,7 @@ class MyZipFile(zipfile.ZipFile):
|
||||
def tree(
|
||||
src,
|
||||
dest,
|
||||
exclude_suffix=[ ".pyc", "~", ".bak" ],
|
||||
exclude_suffix=[ ".pyc", "~", ".bak", ".old", ".new" ],
|
||||
exclude_prefix=[ "#", "." ],
|
||||
exclude_files = set(ignored_files),
|
||||
root_exclude_prefix = [ ],
|
||||
@@ -392,11 +393,13 @@ def distribute(
|
||||
if build_windows or build_all:
|
||||
|
||||
win_files.append((rb + "renpy.exe", "/" + executable_name + ".exe"))
|
||||
win_files.append((rb + "renpy.code", "/renpy.code"))
|
||||
win_files.append((rb + "python26.dll", "/python26.dll"))
|
||||
win_files.append((rb + "msvcr90.dll", "/msvcr90.dll"))
|
||||
win_files.append((rb + "Microsoft.VC90.CRT.manifest", "/Microsoft.VC90.CRT.manifest"))
|
||||
|
||||
win_files.append((rb + "lib", "/lib"))
|
||||
win_files.extend(tree(rb + "lib/windows-x86", "/lib/windows-x86"))
|
||||
|
||||
if os.path.exists(project_path + "/icon.ico"):
|
||||
file_data[rb + "renpy.exe"] = change_icon.change_icons(
|
||||
rb + "renpy.exe",
|
||||
|
||||
@@ -221,6 +221,27 @@ init 11 python:
|
||||
|
||||
interact()
|
||||
|
||||
def pauseinfo(t, message):
|
||||
"""
|
||||
Displays an error to the user, and lets him click to return to
|
||||
`target`.
|
||||
"""
|
||||
|
||||
set_tooltip("")
|
||||
|
||||
screen()
|
||||
|
||||
ui.vbox()
|
||||
title(t)
|
||||
text(message)
|
||||
|
||||
ui.null(height=20)
|
||||
|
||||
button(_(u"Ok"), ui.returns(True), None)
|
||||
ui.close()
|
||||
|
||||
interact()
|
||||
|
||||
def info(t, message):
|
||||
"""
|
||||
Displays an informational message to the user, and immediately
|
||||
|
||||