Compare commits

..

2214 Commits

Author SHA1 Message Date
Tom Rothamel 2c728bc9a4 Bump version. 2012-09-11 01:28:40 -04:00
Tom Rothamel a573008ef1 Ignore attempts to play None as sound/music.
This is a minor behavior change. Before this, renpy.play would stop
the playing sound if called with None - which is the default in a lot
of circumstances.
2012-09-09 22:47:23 -04:00
Tom Rothamel 72a8e029ad Fix RAPT docs. 2012-09-04 22:29:38 -04:00
Tom Rothamel 4142473dc0 A few more fixes to the Android packaging docs. 2012-08-28 20:16:14 -04:00
Tom Rothamel 6e2bb81a1c Merge remote-tracking branch 'remotes/ren/patch-3' 2012-08-28 19:42:32 -04:00
Tom Rothamel dd4fc916ec Remove unnecessary use of AVFormatParameters in dead code. 2012-08-28 19:13:25 -04:00
xRenx 8e755eb157 Update sphinx/source/android-packaging.rst
Changed some wordings, expanded on some points, added screenshots and a Troubleshooting section.
2012-08-27 19:28:21 +02:00
Tom Rothamel b33b9628fd Ensure ffdecode.c can compile with the libav that we're distributing
with Ren'Py.
2012-08-26 15:05:55 -04:00
Tom Rothamel b9a6dfea88 Move to an O(n) algorithm for detecting store changes.
The problem is that python seems to generate two kinds of code to
access module globals. Variable access in the global scope uses object
methods, and so setitem and delitem are called. But when a global
is accessd from a function, the dict is accessed directly, and so
we can't intercept them.

This means that the new O(1) method of determining what changed in
the store is massively broken.

Ren'Py now uses an O(n) method of detecting store changes, which
is what we used in 6.13, modified to support multiple stores.
2012-08-24 17:46:31 -04:00
Tom Rothamel e16489fc5e Fix build of source package. 2012-08-23 23:10:49 -04:00
Tom Rothamel 1b0c5477f4 For safety's sake, make util.walk decode its arguments. 2012-08-23 22:34:42 -04:00
Tom Rothamel d85565910d Turn the projects directory into unicode, if it's not already. 2012-08-23 22:30:07 -04:00
Tom Rothamel 1201924c28 Still more video playback fixes.
* Always display the first frame of a video.
* Improve sync at the start of a video.
* Update the Movie displayable on a regular basis, even if a movie isn't playing. (This
  lets a movie start playing later.)

Fixes #24.
2012-08-23 22:13:25 -04:00
Tom Rothamel 02be062444 Deal with more problems with video playback:
* Accept the libav default for the number of threads to use for decoding.
* Only allocate a surface if the video stream exists.
2012-08-23 21:11:14 -04:00
Tom Rothamel 7a113712e1 Remove excess debugging print. 2012-08-23 20:14:09 -04:00
Tom Rothamel c046a7fd56 Make the locking scheme in PSS.py more similar to the one in Ren'Py
6.13.

This fixes crashing bugs that may have been caused by data structures
being updated while the audio callback is being run in the background.

The big change between 6.13 and this is that playing_name is now
protected by a mutex. PSS_playing_name only tries to grab this mutex,
and doesn't grab the SDL audio lock, preventing it from blocking if
video decoding is too far behind.
2012-08-22 22:42:03 -04:00
Tom Rothamel 07c1599821 Fix a race condition on audio start. 2012-08-22 21:27:30 -04:00
Tom Rothamel 9d5154b50a Fix a crash that can occur if Ren'Py doesn't know the (in-file)
location of an imagemap.

Fixes #20.
2012-08-20 21:24:27 -04:00
Tom Rothamel 3982c45886 Quote square brackets in some developer functionality.
Fixes #19.
2012-08-20 21:17:06 -04:00
Tom Rothamel 90772350fb Copy renpy-ppc.zip into the download directory. 2012-08-20 21:15:15 -04:00
Tom Rothamel fd250df032 Add support for producting direct downloads (not through the updater)
of editor dlc.
2012-08-19 09:47:04 -04:00
Tom Rothamel 9ea3c36a88 Bump version to 6.14.1. 2012-08-19 08:40:07 -04:00
Tom Rothamel 4cc4cae8bb Allow Ren'Py to be build in virtualenvs, as well as with PYTHONPATH set. 2012-08-17 11:50:47 -04:00
Tom Rothamel d4d9543019 Format license.rst using plain text, so we don't syntax-highlight
a bunch of source code licenses.
2012-08-16 20:55:30 -04:00
Tom Rothamel bf2cf5b5e3 Add support for producing an experimental distribution of Ren'Py. 2012-08-16 20:54:56 -04:00
Tom Rothamel 99cf00ad54 Deal with Windows-style paths in the launcher and navigation dump code. 2012-08-16 17:21:39 -04:00
Tom Rothamel 0ddb47ce6d Condition log close on the log being open. 2012-08-16 09:27:34 -04:00
Tom Rothamel 52f6898ffd Ensure that we can build with ANGLE and on ES-based platforms. 2012-08-15 22:05:57 -04:00
Tom Rothamel cc8d2823cd Use BGRA/UNSIGNED_INT_8_8_8_8_REV on PC-like platforms.
This fixes #16, a performance bug where lousy Intel drivers would take
forever to do glTexSubImage when RGBA/UNSIGNED_BYTE were the format and
type.
2012-08-14 23:18:38 -04:00
Tom Rothamel 03e09f45c0 Quote strings in navigation. 2012-08-09 23:05:29 -04:00
Tom Rothamel 061a04cd84 Enable the underlay when movies are playing.
Now that movies stop when a new context is entered, there's no reason
not to do this. fixes #13.
2012-08-09 22:35:38 -04:00
Tom Rothamel 0b555d73ab Deal with the case where a size_group is not defined.
This should never happen in a normal case - but it seems to have
occured during error handing. So we deal with it.
2012-08-09 22:09:03 -04:00
Tom Rothamel c05606aa94 Only check for render leaks if we haven't handled a traceback.
When we error-handle a failure that occurs while rendering, it's
possible that one or more Renders will be kept alive in a
traceback. This prevents us from giving the render-leak warning in
this case.
2012-08-09 21:54:23 -04:00
Tom Rothamel 98a37cb84f Make move transitions respect time warp. 2012-08-09 21:38:02 -04:00
Tom Rothamel 94f2fa7a9a Invoke dxwebsetup with os.startfile.
On 64-bit windows, with a space in the path, I was getting a command
line prompt.
2012-08-09 21:21:33 -04:00
Tom Rothamel 1cf9bb29ab Add warnings about python code in screens. 2012-08-09 21:20:03 -04:00
Tom Rothamel 771311a955 Only stop the movie on set_mode if the software renderer is being used.
A movie stop is necessary when the software renderer is being used
because setting the mode will kill the surface that the movie is
drawing to. In GL mode, we use a different surface, so a reset
isn't necessary.
2012-08-09 00:31:09 -04:00
Tom Rothamel a647a670a4 Have a go at making ffdecode work better with ffmpeg.
This involved dealing with some name changes where libav kept both
names without deprecation.
2012-08-09 00:18:14 -04:00
Tom Rothamel 00e0dfb5c7 Remove the vast majority of compiler warnings when compiling the
video and audio systems.
2012-08-09 00:11:43 -04:00
Tom Rothamel e1f5a7e9de Eliminate use of deprecated functions in ffplay.c. 2012-08-09 00:06:03 -04:00
Tom Rothamel e959d3e694 Use the GPU to scale movies.
This makes it possible to render movies on the Atom without frying the
CPU.
2012-08-08 23:35:36 -04:00
Tom Rothamel affd6d986f Merge pull request #15 from xRenx/patch-2
Update common/00themes.rpy
2012-08-08 17:33:11 -07:00
xRenx f30f82262f Update common/00themes.rpy
Changed http://renmazuo-.deviantart.com to http://x-Ren-x.deviantart.com/ as I changed my username on deviantArt.
2012-08-08 20:23:10 +02:00
Tom Rothamel 39e17a5872 Simplify premultipy().
This makes it run faster on in-order platforms like the
Atom. Premultiply was turning out to be a resource hog on video
playback.
2012-08-08 00:48:18 -04:00
Tom Rothamel b2c3480b8e Change _button to use the old (6.13.12) amie2 theme. 2012-08-06 22:49:11 -04:00
Tom Rothamel f822e9a0e9 Stop using MMX on 32-bit linux.
Lucid's 32-bit c compiler is miscompiling transform32_mmx. Since
that's not used for much in the OpenGL path, it's been disabled.
2012-08-06 22:34:44 -04:00
Tom Rothamel 4238849c4b Update the changelog. 2012-08-06 00:55:33 -04:00
Tom Rothamel 23ad4f0140 Remove unnecessary checks in the Choice... actions.
We had been checking that the _chosen dict was non-empty in ChoiceJump
and ChoiceReturn actions. This wasn't necessary given the logic of the
program, and failed in the case of a game that hadn't been played
before.

Fixes http://lemmasoft.renai.us/forums/viewtopic.php?p=214590#p214590
2012-08-06 00:52:01 -04:00
Tom Rothamel de85018794 Merge pull request #11 from apricotorange/master
Port the NVL tutorial from the wiki to Sphinx
2012-08-05 20:54:31 -07:00
Tom Rothamel cfa85aeb37 Video sync and other video improvements.
We now generally synchronize video to wall time. We adjust this
synchronization slowly if we're slightly out of sync with the audio,
or by a lot if we're way out of sync.

This ensures that the frame rate remains stable even if the times of
audio decode vary a bit.

We also now support the Movie displayable again.
2012-08-05 23:36:33 -04:00
Tom Rothamel f81fdd55e2 Cancelling projects path selection uses the old path.
Previously, it would reset things to the default path.
2012-08-05 10:59:01 -04:00
Tom Rothamel 5a8cf4c4ed Remove obsolete sync code. 2012-08-05 02:28:19 -04:00
Tom Rothamel 98292a2dc3 Remove subtitle-related code from ffdecode.c. 2012-08-05 02:13:08 -04:00
Tom Rothamel 1f16af50aa Rewrite video playback.
Previously, video playback was done using SDL events. This was at best
laggy, as the time it took for an SDL event to be delivered was up to
30 ms. Worse, if an event was ever lost, video playback would stop,
packets would queue up, and eventually audio playback (and Ren'Py
itself) would crash.

In the new approach, when a video is playing Ren'Py polls the video
system for new frames. Busy-waiting (with short sleeps to give control
to the decoder threads) ensures that frames are draw promptly, and
so the buffers can't fill up.

This code doesn't explicitly address latency, so that's a wash.
2012-08-05 01:24:42 -04:00
Tom Rothamel f24af00189 Allow the upload of large surfaces as a single texture.
Previously, we limited the maximum size of a texture that Ren'Py could
deal with to 512, and mandated the textures were 66% full. In the movie
case - with a lot of texture uploads - this was bad news, as making new
textures is slow on an intel GPU. So now, we can ask for a big texture
to be created in a single chunk.

Also, we now use 1024px textures, instead of being limited to 512px.
2012-08-05 01:21:13 -04:00
Tom Rothamel 704546149c Redo the way we lock in PSS.
This prevents Ren'Py from crashing when video playback is too slow,
but doesn't prevent frames from piling up.
2012-07-31 23:31:17 -04:00
Tom Rothamel 259e4bbb9b Update run.sh so it can work with a renpy-deps build. 2012-07-30 23:29:02 -04:00
Tom Rothamel 004a05a49b Speed up skipping when possible. 2012-07-30 12:58:44 -04:00
Tom Rothamel 1a91b29cf5 Remove obsolete edit.py files that can confuse the new launcher. 2012-07-30 00:03:15 -04:00
Tom Rothamel 79b2f36088 Re-read version number after we generate it, so we wind up with
the correct version number in the end.
2012-07-29 22:20:30 -04:00
Tom Rothamel 8b52a0c515 Add functions that allow for a list of save games such that the
user is able to add new save slots to the list.
2012-07-29 22:11:31 -04:00
Tom Rothamel 01689987d5 Remove debug print. 2012-07-29 19:40:31 -04:00
Tom Rothamel 9b9b8aed61 Skip template prompt if only one template exists. 2012-07-29 19:36:54 -04:00
Tom Rothamel 325299f342 renpy.game_get_runtime only returns time from the main context. 2012-07-29 19:32:57 -04:00
apricotorange 3384fc378f Port the NVL tutorial from the wiki to Sphinx. 2012-07-28 22:06:35 -07:00
apricotorange 6b66f3cce8 Port the NVL tutorial from the wiki to Sphinx. 2012-07-28 21:44:45 -07:00
Tom Rothamel d3e54853d6 Make the updater more robust when files already exist. 2012-07-29 00:27:46 -04:00
Tom Rothamel 6aa927c39a Force arguments to Grid to be integers.
Analogue passes floats to Grid, which passes them to range(), which changed
its behavior in python 2.7 to crash when it gets something other than an
integer.
2012-07-28 23:55:37 -04:00
Tom Rothamel d70374a5c0 Explicitly look for the correct tag when computing vc_version. 2012-07-26 23:41:10 -04:00
Tom Rothamel 67c4b55663 Fix rollback of - well, everything but stores.
I'm not sure how the restored code - which is right out of 6.13 -
went missing.
2012-07-26 00:38:06 -04:00
Tom Rothamel 0cbb4a6c0e Improve #TODO handling a bit.
* Suffix multiple TODOs with numbers.
* Give a more obvious message if no TODOs were found.
2012-07-25 22:47:04 -04:00
Tom Rothamel 6f063c92de Merge pull request #9 from edwin-v/scan_todo_for_launcher_v2
Added a todo list to the launcher navigation section.
2012-07-25 19:04:20 -07:00
Tom Rothamel 5504397bb8 Merge pull request #10 from xRenx/patch-1
Update sphinx/source/android-packaging.rst
2012-07-25 18:46:07 -07:00
xRenx 08a15c417d Update sphinx/source/android-packaging.rst
Just mentioned the links for those downloads are below, as some users might follow the guide in order.
2012-07-25 22:16:24 +02:00
Edwin ff05b590be Added a todo list to the launcher navigation section. 2012-07-25 21:04:20 +02:00
Tom Rothamel eb603088ae Move the projects scrollbar to the right so people know what it is. 2012-07-25 00:12:18 -04:00
Tom Rothamel 1363792d17 Exit the update channel preference when a button is clicked; Hide it
entirely if updating is not possible.
2012-07-25 00:10:31 -04:00
Tom Rothamel 21ef05b0fa Be a little more paranoid about missing editors. 2012-07-25 00:00:35 -04:00
Tom Rothamel 7b34af584f Input should ignore all keypresses it handles.
It ignored unicode events, but backspace, left, and right were
not consumed, and could be passed to other functions.
2012-07-24 23:14:25 -04:00
Tom Rothamel 4b5ec57624 Changes to front page:
* "Script Navigation" -> "Navigate Script"
* Add lines underneath Edit Script and Open Directory, so they don't
  look like buttons themselves.
2012-07-24 22:54:22 -04:00
Tom Rothamel ccf3ce6f5b Merge branch 'master' of github.com:renpy/renpy 2012-07-24 20:36:49 -04:00
Tom Rothamel 0fff7e9bbe Merge pull request #7 from JakeStaines/master
Added function into theme-choosing to modify screens.rpy; now changes file-picker rows to suit AWT where appropriate.
2012-07-24 17:30:47 -07:00
Tom Rothamel 90bda7dd23 Unlink partial zsync downloads. 2012-07-24 20:14:14 -04:00
Tom Rothamel f845f787ad Fix Update to work. 2012-07-24 20:07:40 -04:00
Tom Rothamel c16774c325 Add debug_sound change to changelog. 2012-07-24 20:07:11 -04:00
JakeStaines c2842286c7 Added function into theme-choosing to modify screens.rpy; now changes file-picker rows to suit AWT where appropriate. 2012-07-24 00:15:34 +01:00
Tom Rothamel ee8744b490 Exclude files from the distribution. 2012-07-22 22:25:40 -04:00
Tom Rothamel f14c68d047 New tagging script. 2012-07-22 22:10:05 -04:00
Tom Rothamel be76ab63e8 Merge pull request #5 from JakeStaines/master
Fixed White Tulip vbar to be full when at 100%, instead of empty.
2012-07-22 18:38:20 -07:00
Tom Rothamel ea825dfe23 Minor changes to the tutorial game script. 2012-07-22 21:32:48 -04:00
Tom Rothamel a0c87efac8 Minor change to the wording of the updater messages. 2012-07-22 21:32:35 -04:00
Tom Rothamel b55bad9e27 Do not hide the mouse due to inactivity when in the launcher. 2012-07-22 21:03:18 -04:00
Tom Rothamel 72af1de7e6 Fix problems where, after a relaunch, the default editor would not
be scanned or set.
2012-07-22 21:00:18 -04:00
Tom Rothamel 85e07b8cb8 Make the temporary directory before each launch.
This fixes a bug where, if a project existed already, the user could
try to launch it, and it would try to create navigation.json in a
directory that didn't exist.
2012-07-22 20:23:56 -04:00
Tom Rothamel 55c4369d6e Do not change line endings when updating options.rpy upon the creation
of a new game.
2012-07-22 20:08:56 -04:00
Tom Rothamel d860378a73 Show a slider for the volume in choose_theme. 2012-07-22 19:29:51 -04:00
JakeStaines 1943a31628 Fixed White Tulip vbar to be full when at 100%, instead of empty. 2012-07-22 23:45:01 +01:00
Tom Rothamel d7a26f722f Developer mode fixes.
* Quote style inspector output so it won't cause a crash if special
  characters are included.
* Fix a typo on the theme test screen.
2012-07-22 18:06:30 -04:00
Tom Rothamel 9af1b75fda Merge pull request #4 from JakeStaines/master
Added new bar style to A White Tulip theme; cleaned up a couple of minor graphical issues with the sliders and scrollbars.
2012-07-22 14:53:54 -07:00
Tom Rothamel 4787441d1f End skipping when entering a menu. 2012-07-22 17:52:49 -04:00
Tom Rothamel 9b47c3c4fd Ensure that display_menu passes the same items list to screens as it
did in previous releases.
2012-07-22 17:19:51 -04:00
Tom Rothamel 5c63e14ae7 Launcher changes/fixes.
* Error handling in the empty project name case.
* Ask the user to create a theme upon creating a new project.
2012-07-22 15:54:08 -04:00
Tom Rothamel ca606112bc Append to update log. 2012-07-22 15:28:57 -04:00
Tom Rothamel e0f1fe2847 If we can't do a file operation while Ren'Py is running, try it
again the next time Ren'Py starts.
2012-07-22 15:17:24 -04:00
Tom Rothamel 2179a13ea5 Fix updater in the case where things can't be renamed.
For some reason, font files fall into this category.
2012-07-21 22:30:57 -04:00
JakeStaines 4873db2a6a Added new bar style to A White Tulip theme; cleaned up a couple of minor graphical issues with the sliders and scrollbars. 2012-07-22 00:41:44 +01:00
Tom Rothamel 6768f9da67 Deal with windows's file separators. 2012-07-21 09:36:09 -04:00
Tom Rothamel 1a10e6d4e7 Add ctypes by default.
It's used by EasyDialogs, and probably good to keep around.
2012-07-21 09:35:26 -04:00
Tom Rothamel 2159888b07 Add some modules used by older code to the default store. 2012-07-21 09:34:57 -04:00
Tom Rothamel 478135fe56 Rename __dirty to __spdirty.
In 6.13.11, __dirty was a boolean. In 6.13.12, it change to an object with
a field - but loading a 6.13.11 game would overwrite that, causing crashes.
Having a totally new variable fixes the problem.
2012-07-21 08:30:59 -04:00
Tom Rothamel 701bfcb23a Re-raise original exception if exception handling is disabled
or fails.
2012-07-21 08:30:07 -04:00
Tom Rothamel 3d0b9b14c8 Try a different approach to dealing with out-of-range values.
Edwin's fix at 81c265c didn't work when an adjustment was ranged more
than once, with smaller and larger values, as it would shrink to fit
the smaller value. This version applies the in-range check when the
value is accessed.
2012-07-20 23:43:35 -04:00
Tom Rothamel ad73b70c9e Add AWT to the theme chooser. 2012-07-20 23:35:27 -04:00
Tom Rothamel c04826f663 Remove unused parameter from __AWTBullet. 2012-07-20 23:17:13 -04:00
Tom Rothamel 9bcb811bb2 Add the "A White Tulip" theme.
Credits:

Coding: Jake Staines (http://www.eviscerate.net/)
Graphics: Ren (http://renmazuo-.deviantart.com/)
Font: Andrew Paglinawan (www.andrewpaglinawan.com)
2012-07-20 23:15:33 -04:00
Tom Rothamel 61d403f032 Restore the ability to launch Ren'Py from the command line on
Mac OS X.

A user had mentioned to me that he had asked about this.
2012-07-20 00:33:41 -04:00
Tom Rothamel 7651a34206 Improve the error message produced when an empty string is used
as a displayable.
2012-07-20 00:11:41 -04:00
Tom Rothamel f2334d05fd Add editor-specific error messages for Editra on Linux and for jEdit. 2012-07-20 00:06:19 -04:00
Tom Rothamel 20a98290bd Delete .update.json files if we're not building an update. 2012-07-19 23:47:50 -04:00
Tom Rothamel 870db9d610 Ignore .Editra directories that happen to be lying around. 2012-07-19 23:12:44 -04:00
Tom Rothamel 7ef94349bd Quicksaves should not become the newest save. 2012-07-19 20:51:03 -04:00
Tom Rothamel 987e38e2e1 Merge pull request #2 from StephenChan/docs-improvements
Docs improvements
2012-07-19 17:29:56 -07:00
Tom Rothamel 547dbf5e16 Merge pull request #3 from edwin-v/fix_adjustment_set_range
Correct value when it exceed the new range.
2012-07-19 17:28:30 -07:00
Tom Rothamel 9e7c373d58 Remove saybehavior from launcher.
It was too easy to click through a screen we wanted to read while
expecting to focus the launcher.
2012-07-18 23:21:37 -04:00
Tom Rothamel c271293b8b Add zsync and the Artistic License to LICENSE.txt. 2012-07-18 23:18:54 -04:00
Tom Rothamel eed02c98c5 Add normalization script. 2012-07-18 23:12:59 -04:00
Tom Rothamel c08400cee4 Add BOM and normalize line endings of all script files. 2012-07-18 23:12:00 -04:00
Tom Rothamel 99bf5c7e29 Add or update copyright notices. 2012-07-18 23:00:32 -04:00
Tom Rothamel 3ee7f91523 Update incompatible changes. 2012-07-18 22:52:18 -04:00
Tom Rothamel 3715590a19 Bring changelog up to date. 2012-07-18 22:46:53 -04:00
Edwin 81c265ce46 Correct value when it exceed the new range. Fixes bug: https://bugs.launchpad.net/renpy/+bug/722422 2012-07-18 21:31:59 +01:00
Tom Rothamel 112788b597 Fix generation of .7z.exe. 2012-07-18 00:11:37 -04:00
Tom Rothamel 6b58675000 Add the renpy.call function.
This function terminates the current Ren'Py statement, calls a label,
and passes control to the statement following the current statement.
2012-07-17 22:28:41 -04:00
SleepKirby a0872d1cdc Docs proofreading. 2012-07-17 02:06:32 -07:00
SleepKirby 1cad8b6c1e Add many ref links to the Configuration Variables documentation. 2012-07-17 01:36:42 -07:00
SleepKirby 4a25c62fe4 Fix several documentation typos and minor mistakes. 2012-07-16 00:40:19 -07:00
Tom Rothamel 113716bfd3 Fix argument order for zsynmake.
On the mac, positional arguments seem to have to come after flags
2012-07-15 23:45:42 -04:00
Tom Rothamel 282b315c77 Store documentation patterns in a variable.
Instead of ignoring them entirely.
2012-07-15 21:46:51 -04:00
Tom Rothamel 91b541617e Match xbit and documentation patterns against filename with / prefixed.
This makes all pattern matching consistent.
2012-07-15 21:46:24 -04:00
Tom Rothamel 82f634f98e Include python standard library into the linux builds.
Use the right directory name for it.
2012-07-15 21:06:35 -04:00
Tom Rothamel 25068cb249 Fix errors on archiving.
The problem was that we were using rollbackable lists and dicts in
our archive, before the rollback system was ready.
2012-07-15 20:57:02 -04:00
Tom Rothamel 81047a4375 Archive files in the_question.
This is used to test archiving on multi-plaform builds.
2012-07-15 20:56:40 -04:00
Tom Rothamel d90d91f484 Give the user a place to go if they ignore errors in the launcher. 2012-07-15 18:52:33 -04:00
Tom Rothamel f113661745 Only offer rollback to the user if rollback is enabled. 2012-07-15 18:52:14 -04:00
Tom Rothamel b87ba78b9f Deal with the case where downloading an editor fails. 2012-07-15 18:49:06 -04:00
Tom Rothamel 60241ad0f3 Allow the game itself to define patters as to what is and is not
executable.

We use this to apply the xbit to Editra.
2012-07-15 18:33:10 -04:00
Tom Rothamel 01471d51c5 Fix im.matrix.colorize to actually work. 2012-07-15 16:06:54 -04:00
Tom Rothamel 8ba8b92d79 Fix typo in docs.
Thanks to horstjens for reporting it.
2012-07-14 22:46:09 -04:00
Tom Rothamel e12935ed38 Mention that Editra does not support IMEs. 2012-07-14 22:04:20 -04:00
Tom Rothamel c0ce664d7c Fix typo preventing the update button from showing up. 2012-07-14 21:34:39 -04:00
Tom Rothamel 39c06631bf Only include script version if it's not already in the project.
This lets one rebuild a project aimed at an older version of Ren'Py
with a newer version, while retaining compatibility.
2012-07-14 21:20:57 -04:00
Tom Rothamel de3fd83810 Basic windows developer docs. 2012-07-14 21:00:20 -04:00
Tom Rothamel 015389dfeb Use a different method of getting zsync progress.
Zsync only produces output when its stdin is a terminal, which isn't
the case on windows. Attempts to recompile it to change this
behavior proved fruitless.

So instead, we look at the downloaded file, and see how closely it
matches the correct file. (By downloading a list of hashes for each
64k block in the correct file.)
2012-07-14 20:54:42 -04:00
Tom Rothamel da69ef70bd Change the paths that we get msvcrt and zsync from. 2012-07-14 20:45:14 -04:00
Tom Rothamel 2a47037f7e New way to upload to the server. 2012-07-14 20:44:29 -04:00
Tom Rothamel 3fb7aace9c Merge pull request #1 from edwin-v/input_caret_position
Changed Input caret reference to zero at beginning.
2012-07-10 18:54:39 -07:00
Edwin 1a33949a5b Changed Input caret reference to zero at beginning. 2012-07-10 00:53:25 +02:00
Tom Rothamel 4ea4a22ec9 Set WMCLASS to a game-specific hint, so Unity can match it. 2012-07-09 00:05:21 -04:00
Tom Rothamel 55c50e62f1 Document fixed rollback. 2012-07-08 23:26:48 -04:00
Tom Rothamel 2b5ebc443e Apply Edwin's fix_rollback patch.
This adds renpy.fix_rollback, a function that forces the user to make
the same choice after rolling back.
2012-07-08 22:42:25 -04:00
Tom Rothamel 705a9556e7 Rewrite the image load log in terms of DynamicDisplayable
Restarting an interaction on a timer is more expensive than we
want.
2012-07-08 21:35:04 -04:00
Tom Rothamel ce1d05b019 Fixes to presplash to make it work. 2012-07-08 20:48:34 -04:00
Tom Rothamel fb8151f656 Fix problem with transformed Frames when the software renderer is used. 2012-07-08 20:20:30 -04:00
Tom Rothamel eb90c6a4e3 Move the opengl log into the games' base directories. 2012-07-08 17:15:08 -04:00
Tom Rothamel 33ecff8633 Enable debug_sound by default when in developer mode. 2012-07-08 16:37:52 -04:00
Tom Rothamel fdf7bd8112 Add about screen to launcher. 2012-07-08 16:25:33 -04:00
Tom Rothamel 8dd4ac2259 Various options changes.
- Add icon.
- Disable saving.
- Disable sound.
- Disable underlay.
- Disable rollback.
- Disable log.
- Disable game menu.
2012-07-08 16:00:55 -04:00
Tom Rothamel eafc62936c Preferences work.
* Update channel selector.
* Gl enable/disable.
* Console output enable/disable.
2012-07-08 15:47:49 -04:00
Tom Rothamel a6991d4950 Add tuple parameter to renpy.version, which returns the version as
as a tuple.
2012-07-08 00:26:06 -04:00
Tom Rothamel 6be3c59c0f Special methods (like __init__) should not be treated as private. 2012-07-08 00:22:57 -04:00
Tom Rothamel d961dd609b Distribute Ren'Py using the launcher.
To make builds more convenient, functionality was added to the
launcher to allow the command line tool to not build updates,
and to build a subset of packages.
2012-07-08 00:19:12 -04:00
Tom Rothamel 0a71291e24 Bump version to 6.14.0. 2012-07-07 21:42:49 -04:00
Tom Rothamel 7ec34e80ed Update build_exe to blacklist packages and include zsync. 2012-07-07 21:24:58 -04:00
Tom Rothamel a124dce48c Always use -OO when launching Ren'Py, so we always run with .pyo files. 2012-07-07 00:13:34 -04:00
Tom Rothamel fe191f364a Search for zsync in the correct places. 2012-07-07 00:13:09 -04:00
Tom Rothamel 9fd83f56c6 Include all methods in code navigation, not just classes by their
__init__ methods.
2012-07-06 23:37:41 -04:00
Tom Rothamel bdaa617f65 Back-compat for input changes. 2012-07-06 23:32:21 -04:00
Tom Rothamel 1b93566780 Merge patch from Edwin that adds left-right arrow support to the
input displayable.
2012-07-06 23:15:34 -04:00
Tom Rothamel b10af0a3d1 Updater documentation. 2012-07-06 23:10:16 -04:00
Tom Rothamel b19fe5788b Clean the module on build; check for errors. 2012-07-06 23:09:31 -04:00
Tom Rothamel e8729a086d Include files used by argparse. 2012-07-06 23:08:25 -04:00
Tom Rothamel 9f96864edb Include base64_codec, used by the crypto stuff. 2012-07-05 01:04:42 -04:00
Tom Rothamel ae9c2a0af7 DLC bug fixes. 2012-07-05 00:57:54 -04:00
Tom Rothamel 76ba294af3 DLC-based editor install.
When the user goes to edit something and no editor has been selected,
the launcher will prompt the creator to select an editor. If the editor
selected is not installed, it will be downloaded and installed.
2012-07-05 00:30:11 -04:00
Tom Rothamel 0be10220b3 Add DLC support to launcher and updater. 2012-07-04 14:27:40 -04:00
Tom Rothamel d27549bfdb Add support for building dlc-only and multi-format packages.
More specific control over what's built is needed for the Ren'Py
build - why not give it to regular users?
2012-07-04 01:25:53 -04:00
Tom Rothamel 63d7ee70e0 Save the update.json file to allow for DLC. 2012-07-04 00:11:56 -04:00
Tom Rothamel 350af3ccd9 Add documentation for the new build system. 2012-07-02 00:28:58 -04:00
Tom Rothamel cfa355d944 Make focus grab migration work with viewports. 2012-07-01 22:22:28 -04:00
Tom Rothamel 1bb2a49479 Add side_* properties to viewports.
This allows us to position the side object created with scrollbars.
2012-07-01 22:21:08 -04:00
Tom Rothamel ed05c4b98c When possible, retain a grab through an interaction restart.
Previously, an interaction restart would unconditionally break the
grab.
2012-07-01 21:34:35 -04:00
Tom Rothamel b39bb13527 Fix the way we adjust times in MultiBox to account for a multibox
that is created at a non-zero st.

This is the case for the box created by a MoveTransition.
2012-07-01 20:58:00 -04:00
Tom Rothamel 8484b63c2d Initial go at a tool that displays image loads on the screen.
It works right now, but interferes with transitions because it
restarts the interaction multiple times a second.
2012-07-01 19:03:33 -04:00
Tom Rothamel 58d0f71df1 Rewrite MoveTransition, changing the API.
Movetransition now interpolates the positions of the image
in the before and after cases. This means that if the image is
moving in one or both of the cases, it will be moved between the
two locations.

The new movetransition uses transforms to specify where to move
to and from, rather than factory functions.

It's easier to use, but somewhat less flexible.

The old move transition is around as OldMoveTransition, and compat
will swap it in based on the script version.
2012-07-01 16:05:57 -04:00
Tom Rothamel f6e9262b0e Only do fancy error handling (gui errors, open in editor) when the
game is using the default "run" command.
2012-07-01 13:29:50 -04:00
Tom Rothamel bf2da27703 Fix pydev warnings.
Among other things, removed the renpy.subprocess module in favor
of importing subprocess and adjusting sys.modules.
2012-07-01 13:18:33 -04:00
Tom Rothamel 9c9864528d Revert to the amie2 theme from 6.13. 2012-06-28 08:18:50 -04:00
Tom Rothamel 23f3636fbb Build Ren'Py distributions with Ren'Py.
I'll be wrapping this in a script later, but the basics of a Ren'Py
build can now be performed with the distribute command built into
the launcher.
2012-06-28 00:06:09 -04:00
Tom Rothamel b84d9e5ca0 Change the name of the launcher project. 2012-06-28 00:05:50 -04:00
Tom Rothamel 9b030c2297 Deal with the case where we have a project.Select action for
a project that doesn't exist.

We now just show it as insensitive and unselected, rather than
crashing.
2012-06-28 00:04:57 -04:00
Tom Rothamel 98c4ed746d Replace launcherinfo.py with project.json where appropriate. 2012-06-28 00:03:23 -04:00
Tom Rothamel 09e2cbd45c Rename the launchers.
This entailed a minor change in bootstrap.rpy so Ren'Py could find the
game directory of the old launcher4.
2012-06-27 22:35:08 -04:00
Tom Rothamel 3ff2f0cd56 Remove obsolete files, fix filenames, and migrate bzr->git. 2012-06-27 22:22:18 -04:00
Tom Rothamel cb6c4d6953 Fixes to action documentation.
Thanks to SleepKirby for contributing them.
2012-06-27 20:59:38 -04:00
Tom Rothamel acfac50066 Minor update fixes. 2012-06-27 20:51:21 -04:00
Tom Rothamel a90c3e1255 Call Video_AutoInit so we can run on Mac OS X. 2012-06-27 01:05:47 -04:00
Tom Rothamel 91f5f40fd8 Parse the output of an unmodified zsync.
Compliling zsync on windows is proving to be a real PITA - this lets us ship
unmodified binaries.
2012-06-25 00:48:55 -04:00
Tom Rothamel a1616b5e65 Rewrite renpy.sh so it can choose between linux-x86 and linux-x86_64. 2012-06-23 20:09:22 -04:00
SleepKirby 739ea64fa0 A few minor fixes to Screen Action documentation. 2012-06-22 19:32:05 -07:00
Tom Rothamel 010007b0a1 Remove symlink. 2012-06-22 17:45:31 -04:00
Tom Rothamel 13fe854082 Fix a bar rendering glitch.
The break in the bar could be a non-integer number of pixels, causing
both the left and right sides of the bar to be rounded down and the
total bar to lose a pixel of length.
2012-06-19 23:52:33 -04:00
Tom Rothamel 249c98f320 Document save, load, and rollback. 2012-06-19 00:25:04 -04:00
Tom Rothamel 46e84d3661 This release changes the behavior of transforms to make them more correct
and easier to use.

The xzoom and yzoom properties are now applied before, rotation. This means
that the shape of the image will remain consistent as the image is rotated.
Previously, the image to change shape as it was rotated.

The xzoom and yzoom properties may now be negative, with negative zoom
values causing the images to be flipped. The positioning code now takes
this into account, and positions a flipped image properly.
2012-06-18 19:37:30 -04:00
Tom Rothamel 171eb33966 Remove the now-obsolete tools directory.
This gets rid of add_from, but we haven't needed that in a long
time. The archiver is now part of the buld code.
2012-06-18 18:52:31 -04:00
Tom Rothamel 35cdadbcee Allow roll forward to work through a jump out of a call_screen. 2012-06-18 17:54:43 -04:00
Tom Rothamel fd501a7a03 Deleting persistent data. 2012-06-18 09:31:11 -04:00
Tom Rothamel d27ea92fd1 Add lint support to the new launcher. 2012-06-18 09:26:58 -04:00
Tom Rothamel 0a701ed929 Allow the user to change the update channel (URL). 2012-06-18 00:11:00 -04:00
Tom Rothamel b5e6cb97c7 Add the updater to the new launcher. 2012-06-17 23:27:35 -04:00
Tom Rothamel b2671013fd Remove obsolete code, show message + directory when done with build. 2012-06-17 21:46:14 -04:00
Tom Rothamel 3eada61cc7 Include the archiver in the launcher, and automatic archiving as part
of the build process.
2012-06-17 21:20:11 -04:00
Tom Rothamel f693e26ab0 Feed information from the game into the build system, so we can now
use the game script to control building.
2012-06-17 18:26:05 -04:00
Tom Rothamel f575a1f233 Dump build information from the script to the json dump file. 2012-06-17 09:56:07 -04:00
Tom Rothamel 9834b85ced Able to build distributions, using a GUI to show progress. 2012-06-14 01:23:51 -04:00
Tom Rothamel b8d96d86b7 Look tweaks. 2012-06-12 00:15:01 -04:00
Tom Rothamel d58eaaf387 Add file patterns editor. 2012-06-12 00:09:22 -04:00
Tom Rothamel 67adb17ad3 Save project data. 2012-06-11 22:36:28 -04:00
Tom Rothamel 435e919326 Work on the build distributions gui. 2012-06-10 16:54:20 -04:00
Tom Rothamel 37f35e4f34 Add config.rgl_resize.
This was needed for the launcher, and determines if the user can resize
the window.
2012-06-10 01:03:24 -04:00
Tom Rothamel 3c6353f73e Add missing files to distributions. 2012-06-09 23:56:48 -04:00
Tom Rothamel dfc573d307 Integrate updater with Ren'Py.
This includes exposing the updater through Ren'Py functions,
and creating a default user-interface screen.
2012-06-09 23:15:45 -04:00
Tom Rothamel 6758b6acc7 Start turning the updater into a .rpy file. 2012-06-09 21:29:26 -04:00
Tom Rothamel 2c9bfddb4e Add a simulation mode to the updater. 2012-06-07 00:05:44 -04:00
Tom Rothamel 81bf4c2288 Verify signatures in the updater. 2012-06-06 23:50:58 -04:00
Tom Rothamel b38ae1fb13 Add signed update scripts. 2012-06-05 03:30:24 -04:00
Tom Rothamel 7f0ce7a40b Change unlinking to be safe in the face of Windows sharing violations. 2012-06-05 03:29:18 -04:00
Tom Rothamel 0f5da2d89b Add the mac transform to the updater. 2012-06-03 19:56:11 -04:00
Tom Rothamel c80095f511 Make the updater threaded. 2012-06-03 19:27:02 -04:00
Tom Rothamel a9414d4692 The updater is at the point where it can update the_question into the
tutorial game.
2012-06-03 18:46:08 -04:00
Tom Rothamel d2de95afc1 More work on the automatic updater. 2012-06-03 16:58:22 -04:00
Tom Rothamel 718a8fb4f8 Mac transform, include update.json, progress reporting. 2012-06-01 23:37:16 -04:00
Tom Rothamel 7c603578db Basic package building, to the point where we can build a linux
tarball.
2012-06-01 01:02:43 -04:00
Tom Rothamel 86e3c7f12f Change to look of theme changer. 2012-05-23 00:25:32 -04:00
Tom Rothamel 7d8f8b8f12 Add theme chooser. 2012-05-22 00:14:17 -04:00
Tom Rothamel 546a16e23c Add xinitial and yinitial parameters to a viewport. This lets us set the
initial positioning of the viewport.
2012-05-22 00:02:15 -04:00
Tom Rothamel 80571b8fbd Creating new projects.
This is the main part - creating the project - and not the theme-picking
part of it.
2012-05-20 16:42:23 -04:00
Tom Rothamel 7b1a634701 Add projects directory picking. 2012-05-20 15:34:16 -04:00
Tom Rothamel 3e4efa344e Add text input support. 2012-05-19 23:05:10 -04:00
Tom Rothamel 13c76f6cb5 If an input would be empty, display a ZWSP instead.
This ensures the size of the input won't change when text is added to
it.
2012-05-19 23:00:01 -04:00
Tom Rothamel a71e6cf6ec Add a preferences screen and editor selection code to launcher4. 2012-05-17 10:11:07 -04:00
Tom Rothamel b1dbbeeef8 Tweak colors. 2012-05-16 23:55:19 -04:00
Tom Rothamel 1d3216b6c9 Update the navigation data whenever the game is launched, load it whenever it is needed. 2012-05-16 23:46:32 -04:00
Tom Rothamel 11bbe2cff8 Dumps can now take place when the script is launched using any
commmand, so we can auto-refresh when another command is run.

Also, dump even when errors occur.
2012-05-15 00:08:58 -04:00
Tom Rothamel ff83ef5676 Improve navigation screens and look. 2012-05-15 00:08:44 -04:00
Tom Rothamel dcfc3a173e Make launcher into a game. Add directory opening support.
The idea is that we can now use the script navigation to help with developing the new launcher itself.
2012-05-13 12:57:52 -04:00
Tom Rothamel 2f83caea2d Add support of launching all script files in the editor. 2012-05-12 23:35:39 -04:00
Tom Rothamel 17ed25387d l4: Editor support, and hooking the editor up to navigation. 2012-05-12 22:44:27 -04:00
Tom Rothamel 4d8c1031cd l4: Work on navigation screen. 2012-05-12 00:42:01 -04:00
Tom Rothamel 89f4b81b57 Read the dump information into launcher4. 2012-05-11 00:16:34 -04:00
Tom Rothamel ad50aa7602 l4: Information, progress, and error handling functions. 2012-05-09 00:25:38 -04:00
Tom Rothamel 316c64bb48 Various tweaks to the dump format. 2012-05-09 00:25:28 -04:00
Tom Rothamel 19920b37ca Add support for dumping various types of symbols to a file. 2012-05-08 19:52:27 -04:00
Tom Rothamel ef5d6a4b66 Dump additional name types. 2012-05-08 00:03:05 -04:00
Tom Rothamel 2ea0299615 Implement the ability to dump label locations. 2012-05-07 23:41:27 -04:00
Tom Rothamel 4cd605c134 Fix the example colorizer in the demo game.
It was overloading the Python regexp compiler.
2012-05-07 21:00:56 -04:00
Tom Rothamel c2ddd39f2c Better handling of arguments.
Now, we handle subcommands using two-pass parsing, rather than relying
on argparse to do it for us.
2012-05-06 17:26:16 -04:00
Tom Rothamel 47209c9f63 l4: Add the ability to open the documentation, launch the game, and return to a project. 2012-05-03 23:12:04 -04:00
Tom Rothamel bb9c7dfe46 Add the OpenURL function. 2012-05-03 23:11:43 -04:00
Tom Rothamel d95192e018 l4: Work on front screen. 2012-05-03 21:01:04 -04:00
Tom Rothamel 68b76e2306 l4: Work on the new launcher. 2012-04-29 23:24:43 -04:00
Tom Rothamel 6f0c5125ae Merge 4+ months of 6.13 development back into 6.14. 2012-04-23 22:59:11 -04:00
Tom Rothamel 7b6da918a7 Distro fixes for the new host. 2012-04-22 19:25:28 -04:00
Tom Rothamel 0c05990db3 Bump version to 6.13.12. 2012-04-17 22:02:06 -04:00
Tom Rothamel a3581860b3 Clear errors at the start of a texture test.
When ANGLE resets, it can leave a spurious error around, which will
then cause the texture test to fail and Ren'Py to crash.
2012-04-17 20:58:26 -04:00
Tom Rothamel f371ed6f5f Deal with keys that are used in the game, but not defined in config.keymap.
This helps when the creator replaces config.keymap wholesale, and we then
upgrade to a new version of Ren'Py.
2012-04-17 20:55:37 -04:00
Tom Rothamel 17ea9736cd Minor changes to non-written building doc. 2012-04-17 20:55:12 -04:00
Tom Rothamel a1e13e3eab Make the style preferences dirty flag survive a rollback. 2012-04-13 00:35:57 -04:00
Tom Rothamel 1de06e650e Also log to the temp directory if we can't log to the Ren'Py base directory. 2012-04-12 20:44:16 -04:00
Tom Rothamel f92f14f68a Place error handling files in a temp directory if the current
directory isn't writable.
2012-04-12 19:46:45 -04:00
Tom Rothamel a3c5e57616 Allow the screenshot pattern to be configured by the creator. 2012-04-12 18:03:15 -04:00
Tom Rothamel 5840d6c464 Tweak the step size of a FieldValue, and allow it to be configured
by the user.
2012-04-11 23:23:25 -04:00
Tom Rothamel ba751a8a93 Fix run() to recurse into nested lists.
Allow Adjustment to compute a step even if page is 0.
2012-04-11 23:05:04 -04:00
Tom Rothamel 29c7d33c0a Restart the current interaction on a window resize.
This allows the buttons to update their state in response to a resize event.
2012-04-09 17:27:49 -04:00
Tom Rothamel dfb053dbd6 Reset the key modifiers when the game loses or gains focus.
This is a bad solution, but it's better than leaving ALT stuck on,
which makes a bunch of things not work.
2012-04-03 22:17:46 -04:00
Tom Rothamel 5918606f33 Bump version. 2012-03-27 22:37:23 -04:00
Tom Rothamel 794f8955e3 Deal with reuse of an swdraw object. 2012-03-27 22:25:29 -04:00
Tom Rothamel e90754e2dc Fix crashing on windows when minimizing and maximizing in GL mode.
Fix windows icon rendering.
2012-03-27 21:59:42 -04:00
Tom Rothamel 976b4fc2fc Better handling of errors in error handling.
We try to show the original exception, not the error handling one.
2012-03-25 10:37:38 -04:00
Tom Rothamel ddb7bd2167 Do not substitute in a parse error. 2012-03-25 10:20:00 -04:00
Tom Rothamel 74fd442303 Bump version to 6.13.10. 2012-03-24 23:04:38 -04:00
Tom Rothamel 66555facd5 More paranoia in error handling, to prevent errors from being masked. 2012-03-24 23:04:28 -04:00
Tom Rothamel 83b9ca6b96 If the display fails to initialize during error handling, fall back
to the traditional error handling.
2012-03-24 22:57:12 -04:00
Tom Rothamel dddeb56b91 Do not set renpy.display.draw to None when doing a display reset.
We now only do a display reset from inside Ren'Py - we've given up the
ability to change the renderer on the fly.
2012-03-24 22:46:11 -04:00
Tom Rothamel 39a799e995 Ensure that we use integer pixel coordinates when doing is_pixel_opaque
in the software renderer.
2012-03-24 21:55:29 -04:00
Tom Rothamel 88032a1478 Trim the rollback log even if there is no label in it, to prevent it
from growing to an infinite size.
2012-03-24 18:15:30 -04:00
Tom Rothamel 90e547b0a5 Doc fix. 2012-03-24 16:54:47 -04:00
Tom Rothamel cc9ea22354 Various fixes to package loading, to make it work closer to the
way Python does it.
2012-03-23 23:34:13 -04:00
Tom Rothamel ea3d409c19 Fix a regression with tiled frames.
The change to floating-point render widths made a call to range() not
work.
2012-03-11 10:23:41 -04:00
Tom Rothamel 5ef40f8c3e Improve new text editor support to be production quality. 2012-03-10 17:45:52 -05:00
Tom Rothamel 71ccf249f2 Merge 6.14 editor code.
This starts the process or working around windows argument handling,
which would be very difficult to do with the old design.
2012-03-08 16:43:53 -05:00
Tom Rothamel 45d9d640ee Add a check for non-ASCII filenames to lint. 2012-03-08 00:00:36 -05:00
Tom Rothamel 14c38ded81 Use execfile to run the editor file. (Since for some reason, exec didn't
work.)
2012-03-07 23:59:58 -05:00
Tom Rothamel d90d68fd68 Fsencode filenames we hand off to pygame, since it seems to convert at
least some of them if we don't.
2012-03-07 19:48:40 -05:00
Tom Rothamel 9abd26d76c Remove unnecessary module from calls to FsPopen.
(Not just unnecessary, but totally wrong.)
2012-03-07 17:01:08 -05:00
Tom Rothamel 3f0b27ba26 Ensure that all filesystem access occurs using the filesystem
encoding, rather than unicode or utf-8.
2012-03-07 01:33:39 -05:00
Tom Rothamel 70276655c8 Wherever we call sys.getfilesystemencoding(), ensure we use utf-8 if it
returns None.

For whatever reason, we don't know what the filesystem encoding is on
Android.
2012-03-06 22:30:43 -05:00
Tom Rothamel b07b6aa32f Minor fixes to distribute.py to work with my new drive layout. 2012-03-06 21:54:04 -05:00
Tom Rothamel bcce21b0d5 Make save_dump work on Python 2.6. 2012-03-06 12:39:52 -05:00
Tom Rothamel 967e0d6539 Invalidate displayables that are rendered as part of a size_group.
This fixes previous code that used .kill(), which is now a no-op.
2012-03-06 11:36:43 -05:00
Tom Rothamel 383193d478 Bump version to 6.13.9. 2012-03-05 22:45:08 -05:00
Tom Rothamel 6b640a7070 Update changelog. 2012-03-05 22:43:16 -05:00
Tom Rothamel e22a2c16bd Update Android building docs to reflect RAPT. 2012-03-05 22:20:37 -05:00
Tom Rothamel 67f356f1b4 Use doubles instead of ints to represent character widths in texwrap.
This fixes a bug that would cause lines to be too long - the lines
were correct in texwrap, since widths were fine as ints, but expanded
when rendered with the full glyph advances.
2012-03-05 21:18:39 -05:00
Tom Rothamel 2eee3c772b Log menu choices with an index of 0 as choices.
Thanks to Spiky Caterpillar.
2012-03-05 14:03:23 -05:00
Tom Rothamel 7b14755607 Switch all path handling to using unicode.
This prevents us from getting errors when trying to convert encodings
in path names.
2012-03-01 23:24:21 -05:00
Tom Rothamel 8c8940dcbb Change a use of GL_BYTE to GL_UNSIGNED_BYTE.
Since the latter isn't supported on OpenGL ES. Also, one would never
want to use the former. (I have no idea why OpenGL even has it.)
2012-02-29 22:50:09 -05:00
Tom Rothamel 5aadfa5ca4 Add headers for cdef extern functions.
This allows things to compile on Windows. I'm not sure what changed to
make them not compile - probably something in Cython.
2012-02-29 01:05:53 -05:00
Tom Rothamel 46ef0cbf04 Change the type of height and width in Render to float.
This is for compatibility with 6.10 and prior versions of Ren'Py, and
because it makes sense. Zooming an image wants to create an image with
a non-integer width and height. This is especially true when xalign is
non-zero - we need to take the precise width into account when
centering the displayable (at least when using subpixel precision).
2012-02-27 23:43:53 -05:00
Tom Rothamel be6d4fdf77 Add config.save_dump, to allow people to configure save dumping. 2012-02-26 23:04:36 -05:00
Tom Rothamel c663b71114 Discard all displayables when saving a screen.
Previously, we didn't clear the widgets and transforms variables,
which kept almost everything - and made Cradle Song much slower.
2012-02-26 22:33:11 -05:00
Tom Rothamel e9b8a16a80 Code to dump a representation of the contents of the save file
when it's created.

This helps us determine why save-space is leaking.
2012-02-26 19:40:55 -05:00
Tom Rothamel 2750bcf927 Remove blacklist test code. 2012-01-30 17:56:05 -05:00
Tom Rothamel 320dc92092 Improvements to the blacklist.
Some versions of Mesa randomly fail when trying to compile shaders. We catch
those, and fall back to fixed-function mode to prevent the crash.
2012-01-24 23:48:35 -05:00
Tom Rothamel 790bdb03e7 Fix crash in Render.fill.
We were using SolidImage, which has been replaced by Solid.
2012-01-18 21:44:51 -05:00
Tom Rothamel 619addc5f0 Better catch autosave errors. 2012-01-17 22:27:48 -05:00
Tom Rothamel 47fb3f9438 Update copyright to 2012. 2012-01-15 09:50:38 -05:00
Tom Rothamel 7ac22328b2 Quote values displayed in the variable viewer, when they have [ in them.
Bug reported at:  http://lemmasoft.renai.us/forums/viewtopic.php?f=8&t=12726
2012-01-11 22:51:45 -05:00
Tom Rothamel 91989a56e9 Bound outlined blits.
This is in response to http://lemmasoft.renai.us/forums/viewtopic.php?p=177213#p177213
a bug where we were stuck drawing outside the screen.
2012-01-11 22:46:55 -05:00
Tom Rothamel 34070e63e6 Prefer modules from local directory.
Previously, if we had installed the Ren'Py modules, we would use those in
preference to the modules that exist in the current directory.
2012-01-11 22:45:55 -05:00
Tom Rothamel 1a5a7ef82a Fix roll-forward. 2012-01-11 22:27:27 -05:00
Tom Rothamel e2ae6828be Update changelog. 2012-01-07 19:58:10 -05:00
Tom Rothamel 9f02ad9a82 Use glTexParameteri instead of glTexParameterf for the texture test.
This is more consistent with how the normal code does it, and
also compiles on Windows.
2012-01-07 19:32:35 -05:00
Tom Rothamel 0289c770b4 Improvments to SideImage support.
Can track a single tag. Can only show a SideImage for characters
that are not on screen.
2012-01-07 19:12:15 -05:00
Tom Rothamel 6c5ce3198e Make a more useful error report if we can't import pygame.
Users can get this if they have ; or : in the directory, so
we inform them about that before creating a traceback.
2012-01-07 17:53:25 -05:00
Tom Rothamel 7acc54daa3 Protect the call to time.ctime().
It failed once on one user's machine, but since it isn't really
critical path, might as well just continue on in the case of
a failure.
2012-01-07 17:53:01 -05:00
Tom Rothamel 08192c47fc Do not allow a roll_forward when we're not in a context that
allows rollback.

Fixes bug #882807.
2012-01-05 22:44:41 -05:00
Tom Rothamel b94a84b931 Ren'Py now builds with libpng 1.5
Thanks to James Broadhead for the patch.
2012-01-05 21:55:08 -05:00
Tom Rothamel 82576c5ed6 Re-enable old-style interpolation.
This is in response to Bug #909023, and in recognition that there's a
lot of code out there that uses the old syntax.
2012-01-05 20:44:38 -05:00
Tom Rothamel 19333248d9 Ignore attempts to load from a non-existent directory.
This gets KS running.
2012-01-05 20:18:20 -05:00
Tom Rothamel 4774017317 Fix a bug with fonts.
It's possible to have a font's bitmap go above its ascent. When this
happened, we would write outside of memory. This fixes that bug by not
drawing - it might render the font wrong, but it should prevent
crashing.
2012-01-04 22:28:20 -05:00
Tom Rothamel 21a667d645 More accurate wording. 2012-01-01 00:20:06 -05:00
Tom Rothamel 81276aeb26 Added config.python_callbacks.
This is a list of functions that are called at the end of each Python
block. One use of this would be to allow variables to manipulated with
normal mathematical operators, and then have a callback ensure that
they remain within a range.
2012-01-01 00:18:02 -05:00
Tom Rothamel 8e975217f5 Modify the DSE game so that it uses the new-style interpolation syntax. 2011-12-31 23:56:11 -05:00
Tom Rothamel 3d47c7bae3 Quote square brackets in the old launcher. 2011-12-31 23:55:57 -05:00
Tom Rothamel c93a2ed5d5 Fix shebang in renpy.py. 2011-12-31 23:55:43 -05:00
Tom Rothamel eb9b83860b Fix more eclipse warnings.
Figured out how to get eclipse to scan the modules, so we can dispense
with the typeinfo stuff.
2011-12-31 23:03:00 -05:00
Tom Rothamel d9b7c73e8f Round up the width of text before drawing it.
When using negative kerning, we can have a line of text with a
fractional computed width. Rounding down this case lead to the last
pixel being cut off.
2011-12-31 19:14:20 -05:00
Tom Rothamel 0f5b7267fb Test textures before attempting to use them.
The hope is that we never use an overly-large texture.
2011-12-26 23:53:23 -05:00
Tom Rothamel eac1b02212 Remove all PyDev-generated warnings and problems.
(Updated to a new version of PyDev, which generated new warnings.)
2011-12-25 12:17:11 -05:00
Tom Rothamel cc8396a8ab Don't save the child of a screen. 2011-12-18 21:41:22 -05:00
Tom Rothamel 31a8cd2a3c Doc fix. 2011-12-17 23:26:23 -05:00
Tom Rothamel 295e64a02c Merge fixes from mainline. 2011-12-17 23:24:29 -05:00
Tom Rothamel ee566fc6c8 Import minstore into default store.
This ensures that sets created in the default store have the right
(RevertableSet) type.
2011-12-14 22:45:26 -05:00
Tom Rothamel fb60c4acfe New editor code. 2011-12-14 22:35:51 -05:00
Tom Rothamel 8381b5184c Add navigate page. 2011-11-30 21:47:00 -05:00
Tom Rothamel 9e5570b1b4 Only use the transform path for non-identity transforms. 2011-11-27 15:22:11 -05:00
Tom Rothamel 2caaebc1f5 Fix problems w/ rendering.
#1: Operation is not copied during a subsurface operation.

#2: A transformed dissolve (or IMAGEDISSOLVE) isn't rendered properly.
2011-11-27 14:46:17 -05:00
Tom Rothamel abb99e19e2 Start work on the settings screen.
Right now, it has the projects directory choice, and a checkbox to
disable transitions.
2011-11-24 12:29:13 -05:00
Tom Rothamel 63ed2b8632 l3: checkboxes. 2011-11-23 22:56:07 -05:00
Tom Rothamel 07d1391c4a Overlay pages.
We want one layer of overlay pages in the launcher. This lets
us replace the current page with other info, and then easily and
automatically get back to the main page.

Tried a stack, but it's too complex for our needs.
2011-11-22 23:25:56 -05:00
Tom Rothamel b69c0c2007 Refactor launcher, add jsondump command.
The launcher now is based on "pages". The jsondump command will dump
game information to a json file.
2011-11-22 22:42:49 -05:00
Tom Rothamel 6bda5fa459 Implement commands.
Commands are given on the command line after the base
directory. Implemented the lint, quit, and rmpersistent commands.
2011-11-19 22:55:38 -05:00
Tom Rothamel 5e9f4e71c8 Hook up arguments. Remove remote-control support.
Removed the remote control support since it was never documented or used.
2011-11-19 16:23:33 -05:00
Tom Rothamel d2188c860f Create arguments.py, begin switching Ren'Py to use argparse.
Moved the list of arguments to arguments.py.
2011-11-19 00:58:06 -05:00
Tom Rothamel b60ad5f3ec Launcher now launches. Viewport takes a scrollbars parameter. A screen
language block may now contain multiple has statements.
2011-11-13 22:15:40 -05:00
Tom Rothamel 5305670f1c Add launch button 2011-11-11 23:46:23 -05:00
Tom Rothamel bfb9380de0 The :ref:sl-textbutton and :ref:sl-label screen language statements now take
properties prefixed with ``text_``. These properties have the text_
prefix stripped, and are then passed to the internal text displayable.
2011-11-11 22:17:09 -05:00
Tom Rothamel 25c7bc5726 More look improvements. 2011-11-09 22:43:26 -05:00
Tom Rothamel 63acf7eb05 Transitions in the launcher. 2011-11-07 21:14:13 -05:00
Tom Rothamel 2f134f69f1 Improve multiple store support. 2011-11-06 23:37:00 -05:00
Tom Rothamel bf17e281c9 Start work on next-generation launcher. 2011-11-06 23:36:27 -05:00
Tom Rothamel 2b40f1b84d Implement additional store modules. 2011-10-30 19:06:01 -04:00
Tom Rothamel e6617caeef Rewrite store handling. 2011-10-24 23:36:49 -04:00
Tom Rothamel 34eee81a55 StoreDict and StoreModule classes. 2011-10-23 22:04:36 -04:00
Tom Rothamel bec2a832ea Type out text at the full framerate. 2011-10-20 19:26:15 -04:00
Tom Rothamel 6d86238f0a Bump version. 2011-10-18 22:02:59 -04:00
Tom Rothamel 758d5bad17 Disable substitutions in the launcher. 2011-10-18 21:54:17 -04:00
Tom Rothamel 291ff22366 Fix crash in font searching. 2011-10-16 22:37:38 -04:00
Tom Rothamel f4f0b8f8ce On Android, clear out multiple up or down events. 2011-10-15 14:49:45 -04:00
Tom Rothamel b8abc5aa16 Build docs, bump version. 2011-10-13 01:05:20 -04:00
Tom Rothamel 28fd3c9c89 Fix crash when loading in a created style. 2011-10-13 00:20:19 -04:00
Tom Rothamel 2c94cd19f6 Fix problems with QuickSave and QuickLoad. 2011-10-12 22:53:27 -04:00
Tom Rothamel 8add2bca63 Fix the creation of small solid textures on the software renderer. 2011-10-10 23:33:30 -04:00
Tom Rothamel 77041374ea Fix slow text, bump version. 2011-10-09 10:06:19 -04:00
Tom Rothamel 3d54904e89 Sphinx fixes. 2011-10-08 12:18:34 -04:00
Tom Rothamel a9d1f16cd8 shift+G gets people to the graphics menu. 2011-10-08 10:38:46 -04:00
Tom Rothamel 0439b22269 Bump version. 2011-10-06 17:54:46 -04:00
Tom Rothamel 3fe8abf25c Fix jumps from called screens. 2011-10-06 17:54:04 -04:00
Tom Rothamel 04299ac0f5 Fix distributed files, bump version, add build test script. 2011-10-06 08:22:35 -04:00
Tom Rothamel 96397ea768 Bump version. 2011-10-05 18:58:48 -04:00
Tom Rothamel 6580b36e35 Fix bugs in init phase error handling. 2011-10-04 23:33:49 -04:00
Tom Rothamel 4af4384dac Text's __init__ method can't use styles, since they're not built yet. 2011-10-04 23:29:26 -04:00
Tom Rothamel ebaaf0b242 Perform early binding on text substitutions. 2011-10-02 20:58:51 -04:00
Tom Rothamel bea36e2aa2 Doc fix to CDDs. 2011-10-02 15:14:10 -04:00
Tom Rothamel 247ec17be3 Tweaks to DX update phrasing. 2011-10-02 10:30:06 -04:00
Tom Rothamel 577c378517 Doc fixes. 2011-09-30 17:00:20 -04:00
Tom Rothamel 52e631f229 Make scissor box placement more correct, to prevent artifacts on the
sides of Frames.
2011-09-29 23:56:35 -04:00
Tom Rothamel f8307f725e Fix the scissor test to work with non-default projections, like the one
the mouse uses.
2011-09-29 17:20:45 -04:00
Tom Rothamel c13fbcaab2 Set config.auto_save_extra_info. 2011-09-29 00:31:52 -04:00
Tom Rothamel 6c4eff321e But for convenience, do a with None on a JumpException. 2011-09-28 22:38:33 -04:00
Tom Rothamel 54b8b73d45 Call screen only does a with None if it returns. 2011-09-28 22:35:28 -04:00
Tom Rothamel 0e88b7629e Ensure the software renderer calls init. 2011-09-28 18:20:24 -04:00
Tom Rothamel 012f148622 Fix transition per_interact handling. 2011-09-27 21:57:31 -04:00
Tom Rothamel 56a20cc877 Fix timer repeat bug, from http://lemmasoft.renai.us/forums/viewtopic.php?f=8&t=12023 2011-09-27 20:13:30 -04:00
Tom Rothamel b8df922459 Doc fixes. 2011-09-27 20:09:02 -04:00
Tom Rothamel 896232d308 Properly handle newlines in rpt files. 2011-09-27 20:02:31 -04:00
Tom Rothamel 0207327ded Doc fixes, thanks to Koichi Akabe. 2011-09-27 19:07:16 -04:00
Tom Rothamel e6815a3a4f Deal with buggy fonts w/ positive descenders. 2011-09-26 22:38:38 -04:00
Tom Rothamel 179bbaea92 Fixes to text vertical layout. 2011-09-26 22:13:21 -04:00
Tom Rothamel c7889bc7a2 Don't clip the mouse cursor. 2011-09-25 22:00:45 -04:00
Tom Rothamel ce9ecd124a Fix segfault bug. 2011-09-25 21:19:35 -04:00
Tom Rothamel 426a12d50c Use the existence of ANGLE to decide if we should use the fixed function
renderer, or fall back to ANGLE/DX.
2011-09-25 18:38:48 -04:00
Tom Rothamel eefd0ed728 Prioritize gl2 over angle over gl1 over software. 2011-09-24 23:31:41 -04:00
Tom Rothamel 6604043df0 Deactivate attribute arrays when they're not going to be used. 2011-09-20 22:53:24 -04:00
Tom Rothamel a3271bb290 Distribute sound.pyx. 2011-09-18 14:52:12 -04:00
Tom Rothamel aeed3598a1 Bump versions. 2011-09-18 14:00:56 -04:00
Tom Rothamel 4b43986a6c Allow auto-created styles to be loaded. 2011-09-18 13:58:08 -04:00
Tom Rothamel 4f79180a8e Prefer the copy RTT to the FBO one, because FBOs seem to trigger
crashes on a regular basis.
2011-09-18 13:31:42 -04:00
Tom Rothamel a635c4c35c Update changelog. 2011-09-11 12:37:58 -04:00
Tom Rothamel afc42f4ed3 Make error handling more robust. 2011-09-11 12:35:22 -04:00
Tom Rothamel 547accfd44 Allow user-defined statements to take blocks. 2011-09-11 11:34:00 -04:00
Tom Rothamel ccb51c7a26 Fix lint w/ non-English characters in the what part of a say statement. 2011-09-11 09:35:45 -04:00
Tom Rothamel 33190bba34 Update android build; add support for android assets. 2011-09-07 23:35:30 -04:00
Tom Rothamel b3147011d4 Only error out on bad text if config.developer is set. 2011-09-05 09:47:00 -04:00
Tom Rothamel 4c987901b6 Move to avlib. Deal with invalid frame sizes. Include posixpath on windows. 2011-09-05 09:42:37 -04:00
Tom Rothamel ce332b895f When text gets a non-string, non-displayable, trigger the error early. 2011-09-04 14:58:58 -04:00
Tom Rothamel 9b5823109f Guard more prediction. 2011-09-04 14:29:40 -04:00
Tom Rothamel 7a84fb8cdd Renamed from Low-Carb to Eye of the Storm. Thanks, Hurricane Irene. 2011-09-04 13:38:25 -04:00
Tom Rothamel 94c5c525a7 Allow ATL to interpolate None vs a tuple. 2011-09-04 13:19:53 -04:00
Tom Rothamel 0d25e419b4 Fixes. 2011-09-04 11:39:27 -04:00
Tom Rothamel b669f8363c More doc fixes. 2011-09-03 22:06:39 -04:00
Tom Rothamel 8e44aa6f88 More documentation. 2011-09-03 21:35:57 -04:00
Tom Rothamel 3ef70f862e Better format timed output. 2011-09-02 18:20:22 -04:00
Tom Rothamel e4d99edb65 Use RGBA to read pixels, even if we just want the alpha channel. This
is because GL_ALPHA isn't supported on GLES 2.
2011-09-02 08:59:37 -04:00
Tom Rothamel 5f611786dd Tweak compat version. 2011-09-02 07:45:28 -04:00
Tom Rothamel 657711a0a7 Change search style. 2011-09-01 21:01:39 -04:00
Tom Rothamel 0f1e6e7702 Update documentation. 2011-09-01 20:37:57 -04:00
Tom Rothamel e379ffae51 Include line number as part of the bytecode hash data. 2011-09-01 19:56:47 -04:00
Tom Rothamel b10d5e715c Use the advance, not the width, for image-based fonts.
Include .pyo files in an update iff there's no corresponding .py file.
2011-09-01 16:55:37 -04:00
Tom Rothamel 2f54637881 Flush logs after write. 2011-08-31 20:34:32 -04:00
Tom Rothamel eda1e01a71 Ignore more exceptions in displayables. 2011-08-31 17:07:42 -04:00
Tom Rothamel 8fdc4b8f58 Include utf_16_be, since it's used by the python compiler. 2011-08-31 15:28:15 -04:00
Tom Rothamel 3048825824 Only run iconified/restored code if we change states. 2011-08-30 22:04:50 -04:00
Tom Rothamel 704685c11a Bug fixing. 2011-08-30 19:30:33 -04:00
Tom Rothamel 7fba3a04da Try to fix reported encoding problem. 2011-08-30 17:35:59 -04:00
Tom Rothamel bfc57ecfc6 Fix off-by-one error in the blit outlining code. 2011-08-30 16:43:16 -04:00
Tom Rothamel c0dba7f121 Add a break point before a displayable. 2011-08-30 16:19:40 -04:00
Tom Rothamel ce3e63f3a5 Add latin encoding.
Fix windows build.
2011-08-27 23:47:19 -04:00
Tom Rothamel 0105503855 Quote urls properly. 2011-08-27 22:44:33 -04:00
Tom Rothamel 0d8525f1b1 Fix an exception in text.py, and one in logging. 2011-08-27 21:01:50 -04:00
Tom Rothamel bfd4a1e846 Reset the display when restoring on windows.
This fixes a bug where DirectX would leave a restored window blank, for
some reason.
2011-08-27 20:22:50 -04:00
Tom Rothamel c74343d2dd Use #-of-texture specific vertex shaders. 2011-08-27 16:11:43 -04:00
Tom Rothamel 6f7f545cd8 Document new text tags. 2011-08-26 21:43:48 -04:00
Tom Rothamel 303885776e Use RENPY_CYTHON to get the path to cython. 2011-08-26 21:17:03 -04:00
Tom Rothamel cabcf5b73c Fix compatibility. 2011-08-26 14:05:37 -04:00
Tom Rothamel a8a1972418 Don't update the file page when it's None. 2011-08-25 22:33:35 -04:00
Tom Rothamel 347778d8aa Revert {w} handling to be more similar to the way it was in 6.12, so
as to work better with NVL-mode.
2011-08-25 00:02:39 -04:00
Tom Rothamel 9646c951bb ANGLE should render to RGBA textures. 2011-08-24 12:45:23 -04:00
Tom Rothamel 7b4128f6b2 Don't transition off of a null that's been created without the ATL
script ever running.
2011-08-23 23:47:40 -04:00
Tom Rothamel 7ac623fc99 Fix problem with drawing an empty texture. Other fixes required to
build things.
2011-08-23 22:07:55 -04:00
Tom Rothamel e9328255b7 Pick a name: Low-Carb 2011-08-22 21:37:25 -04:00
Tom Rothamel 11ce47287b Make label take a scope. 2011-08-22 20:32:38 -04:00
Tom Rothamel a1ab25955d Make the tutorial game use new-style substitutions. 2011-08-22 20:08:40 -04:00
Tom Rothamel 3f59b82c2a Don't package bad filenames. 2011-08-22 19:30:17 -04:00
Tom Rothamel 0e6cded6cd Tweak what we distribute. 2011-08-22 19:28:34 -04:00
Tom Rothamel e18f73b317 Fix problem with empty lines in Text. 2011-08-22 19:15:00 -04:00
Tom Rothamel e65146503c Update license and changelog. 2011-08-20 21:53:42 -04:00
Tom Rothamel a6a5c65067 Make Ren'Py compile w/ ffmpeg-0.8.2. 2011-08-20 21:45:37 -04:00
Tom Rothamel afb58fa423 Offer the user the ability to install DirectX. 2011-08-20 17:08:07 -04:00
Tom Rothamel 8762636374 Document text overflow debugging. 2011-08-19 23:04:44 -04:00
Tom Rothamel d1b53fb56c Tweak wording. 2011-08-19 22:49:53 -04:00
Tom Rothamel c7b028b8cf Add missing files. 2011-08-19 22:42:07 -04:00
Tom Rothamel d0ee364a81 Document style preferences and image fonts. 2011-08-19 22:41:15 -04:00
Tom Rothamel a48fdc0d2c Remove minigame; fix uses of renpy.display.text; fix auto-unicode. 2011-08-18 12:05:58 -04:00
Tom Rothamel a464034fd0 More documentation. 2011-08-17 22:10:51 -04:00
Tom Rothamel 51955cae76 Add more indexes, start writing text documentation. 2011-08-17 21:42:35 -04:00
Tom Rothamel f2633d528e Translation update support. 2011-08-16 21:21:11 -04:00
Tom Rothamel 33090e1aa4 Document new text styles. 2011-08-16 20:36:24 -04:00
Tom Rothamel ffc801eaca Write changelog. 2011-08-16 19:16:52 -04:00
Tom Rothamel 49e77a1fa1 Add time_warp parameter to Dissolve and ImageDissolve. 2011-08-15 21:42:36 -04:00
Tom Rothamel 13c5ddc5fa Change the meaning of the auto-forward adjustment when default_afm_enable is
not None.
2011-08-15 21:25:44 -04:00
Tom Rothamel 1ee54eecbd Restore 6.11's xfill/yfill behavior. 2011-08-15 21:01:31 -04:00
Tom Rothamel b7ac285aeb Theme updates and color schemes from Aleema. 2011-08-15 13:57:06 -04:00
Tom Rothamel b6b50f1842 New themes, courtesy of Aleema. 2011-08-15 13:49:09 -04:00
Tom Rothamel d283792193 Add the quick menu to input and nvl-mode screens. 2011-08-14 09:46:45 -04:00
Tom Rothamel 0c5ccd267c Add quick menu to tutorial game. 2011-08-14 09:31:53 -04:00
Tom Rothamel 81108e2d26 Add image gallery. 2011-08-13 22:05:18 -04:00
Tom Rothamel 3c3590bafe Basic translation framework (no tool support). 2011-08-11 23:50:44 -04:00
Tom Rothamel b9e1120f69 New actions - SelectedIf, SetMixer, Rollback, and RollForward. 2011-08-11 20:18:41 -04:00
Tom Rothamel 9f943337bb Update the look of the documentation. 2011-08-11 17:48:49 -04:00
Tom Rothamel ab8964be1d Fix renpy.free_memory. 2011-08-11 15:41:17 -04:00
Tom Rothamel 37c1ba3926 Implement the caret style property. 2011-08-11 15:21:00 -04:00
Tom Rothamel 364d077c8a Allow frame borders to be assymetric. 2011-08-10 00:04:15 -04:00
Tom Rothamel 626f86b500 Fix an encoding problem. 2011-08-08 21:57:42 -04:00
Tom Rothamel d6488e4e7d Export renpy.easy.displayable as renpy.displayable. 2011-08-08 21:57:05 -04:00
Tom Rothamel 846abef17f Include platform in url. 2011-08-08 21:56:51 -04:00
Tom Rothamel 60e65a4d01 Automatically set the focus name of screens. 2011-08-08 20:47:39 -04:00
Tom Rothamel 4057365ff1 Allow newtext to react to style prefix changes. 2011-08-08 13:44:28 -04:00
Tom Rothamel f7d95e2791 Ensure that a transform always has a child after it has been copied,
since the copying code assumes the presence of a child when it updates
the state.

Other Cradle Song-inspired fixes.
2011-08-08 08:21:15 -04:00
Tom Rothamel db812e7f7b Implement style preferences. 2011-08-07 23:09:37 -04:00
Tom Rothamel 66e51bab0d Remove iliad support. 2011-08-07 20:46:29 -04:00
Tom Rothamel d0d82a5e22 Ren'Py always uses RGBA, with the software renderer translating that to the
screen format at texture load time.
2011-08-07 16:46:35 -04:00
Tom Rothamel 2d99e76007 Remove old-style scaling, in favor of a simple render-and-scale approach. 2011-08-07 14:30:04 -04:00
Tom Rothamel 102ff2145f Made setup.py report unnecessary files in gen. 2011-08-06 23:28:50 -04:00
Tom Rothamel 0e00282758 Merge Angle/DirectX support. 2011-08-06 23:22:43 -04:00
Tom Rothamel 337d12e490 Factor the performance test out into its own function, so creators can
call it whenever they want.
2011-08-06 23:19:05 -04:00
Tom Rothamel 916e125f4b Tweak language. 2011-08-06 22:59:31 -04:00
Tom Rothamel 752ef70000 Use framebuffer RTT by default when available. 2011-08-06 22:36:39 -04:00
Tom Rothamel b67c70dbe3 Add performance test.
Change how Ren'Py stores the renderer to use.

Add renpy.windows, renpy.macintosh, renpy.linux, and renpy.android
platform variables.
2011-08-06 22:31:05 -04:00
Tom Rothamel 8277ba6b5b Set the swap interval, although ANGLE doesn't seem to respect it. 2011-08-06 14:57:05 -04:00
Tom Rothamel 2db2a4a94d Fix windows build. 2011-08-06 14:20:02 -04:00
Tom Rothamel a477b862dd Eliminate the glenviron module. 2011-08-06 12:42:17 -04:00
Tom Rothamel 0a5cf3bcee Remove glshader now that everything from it has been moved into glenviron_shader. 2011-08-05 08:41:59 -04:00
Tom Rothamel 2d6e2bcd61 Accept dense packing from OpenGL when taking a screenshot - this allows us to take
screenshots from OpenGL ES.
2011-08-05 08:37:53 -04:00
Tom Rothamel 8d8b52dead Minor tweaks so things run on angle. 2011-08-05 07:13:03 -04:00
Tom Rothamel 3409759271 Refactor the way clipping occurs to be environ-specific. Use the shader to clip when
it's available.
2011-08-04 22:41:43 -04:00
Tom Rothamel 3109dad59b Angle now works on windows, even when the window changes. 2011-08-03 21:12:57 -04:00
Tom Rothamel 16c35e21f4 Transpose projection matrix, since OpenGL ES won't accept the option that
tells it to transpose for us.
2011-08-03 07:34:39 -04:00
Tom Rothamel 509b33477a Checkpoint progress - can open window, list version & extensions. 2011-08-02 23:08:23 -04:00
Tom Rothamel 4fcfdd24d1 Changes to allow things to build w/ ANGLE. 2011-08-02 12:39:20 -04:00
Tom Rothamel 473e8ea861 Redo glcompat.h so that it can handle GLES2. 2011-08-02 07:41:30 -04:00
Tom Rothamel 0bbbde3fb6 Fix RTT. 2011-08-01 23:58:33 -04:00
Tom Rothamel 0576bb71de Now mostly working (w/ transition problems). 2011-08-01 23:41:30 -04:00
Tom Rothamel e91d35abda Buggy as hell gles2-style shader. 2011-08-01 22:11:50 -04:00
Tom Rothamel da638df367 Generate angle code from gl code; tweak build system so they coexist. 2011-07-31 14:07:49 -04:00
Tom Rothamel bf8467aaa0 Move gl modules into their own package. 2011-07-30 22:09:27 -04:00
Tom Rothamel 3a8eea3223 Tweak bzrignore. 2011-07-30 21:32:02 -04:00
Tom Rothamel 566ed9bae6 Merge in changes from 6.12 branch. 2011-07-29 20:44:59 -04:00
Tom Rothamel 132341c9b5 Add versioning documentation. 2011-07-29 20:37:28 -04:00
Tom Rothamel 3f2a18a387 Add 6.12.2 information. 2011-07-29 19:48:06 -04:00
Tom Rothamel 296f940437 Update the docs. 2011-07-28 22:04:14 -04:00
Tom Rothamel dc7833e0fe End skipping on a game restart. 2011-07-28 21:59:26 -04:00
Tom Rothamel 7f38694341 Show mouse when quit_action runs. 2011-07-28 19:52:27 -04:00
Tom Rothamel 0a25f4e488 Fix lockup when a transition terminates early. 2011-07-28 19:13:29 -04:00
Tom Rothamel 88d5b6ea16 Make RENPY_SCALE_FAST work. 2011-07-27 22:23:00 -04:00
Tom Rothamel b775916a8d Fix doc bugs. 2011-07-27 16:06:55 -04:00
Tom Rothamel c1e4d3d598 Prospective patch for compiling w/ new ffmpeg 2011-07-27 15:58:52 -04:00
Tom Rothamel 2435b50e6d Have multipletransition handle timeevent. 2011-07-26 21:38:49 -04:00
Tom Rothamel 466c40f501 bump version. 2011-07-25 21:48:25 -04:00
Tom Rothamel e76f4205cb Try a different approach to how we deal with childless transforms. 2011-07-24 17:40:44 -04:00
Tom Rothamel 1961d467d9 Merge in newtext branch, which includes a rewrite of Text and also improvments
to the module build system.
2011-07-23 20:00:34 -04:00
Tom Rothamel 3cb9b3637d Fix quoting of text tags. 2011-07-23 19:43:53 -04:00
Tom Rothamel cf0232d24a Clean up code. 2011-07-23 18:58:51 -04:00
Tom Rothamel d1c786aa4a Remove oldtext. 2011-07-23 18:39:48 -04:00
Tom Rothamel 209b2b2099 Backwards compatibility and test cases. 2011-07-23 18:37:36 -04:00
Tom Rothamel efd378e71c Change defaults, bump version. 2011-07-22 13:33:05 -04:00
Tom Rothamel 50edf2ad83 Add backwards compatibility. 2011-07-22 13:27:28 -04:00
Tom Rothamel 27aae8a8f0 Hook newtext up to the screen language. 2011-07-21 21:13:27 -04:00
Tom Rothamel b07cae5959 Update Input to work with newtext. 2011-07-21 16:10:11 -04:00
Tom Rothamel f786704d9a Eliminate most uses of renpy.display.text. 2011-07-21 15:40:46 -04:00
Tom Rothamel 9f46f7a824 Text overflow detection. 2011-07-21 13:32:10 -04:00
Tom Rothamel 9b98a0f442 Make substitutions occur in Character. 2011-07-21 13:10:07 -04:00
Tom Rothamel 165c6886c1 Finish font TODOs. 2011-07-21 12:08:44 -04:00
Tom Rothamel c79f9f585b Displaying image fonts (with TODOs, still.) 2011-07-20 23:05:38 -04:00
Tom Rothamel 486ea3dc70 Start work on the new font module. 2011-07-20 22:29:14 -04:00
Tom Rothamel 765566acb0 Implement newline indent. 2011-07-20 06:47:28 -04:00
Tom Rothamel 06e06c3504 Continue integration/testing work. Can now begin to run the tutorial. 2011-07-18 22:36:29 -04:00
Tom Rothamel a16cf65808 Start hooking up newtext. 2011-07-17 21:22:59 -04:00
Tom Rothamel b65a5e6452 Redo build system to be simpler, and to automatically track dependencies. 2011-07-17 14:39:10 -04:00
Tom Rothamel ec88378641 Put newtext into its own package. 2011-07-17 12:15:09 -04:00
Tom Rothamel e22cc152d8 Finish substitutions and add to newtext. 2011-07-16 21:21:39 -04:00
Tom Rothamel db8adea231 Remove all symlinks from tree. 2011-07-16 10:55:00 -04:00
Tom Rothamel 7c7c92fe91 Add support for {_end} tag. 2011-07-15 22:29:23 -04:00
Tom Rothamel 7a8dec6afa State-machine-based formatter object. 2011-07-15 21:44:30 -04:00
Tom Rothamel 49637c2dbd Add a "nobreak" layout mode. 2011-07-14 21:54:25 -04:00
Tom Rothamel 51372d281a Finish implementing TeX linebreaking. 2011-07-14 21:37:13 -04:00
Tom Rothamel 3a4973ba20 Add support for RTL languages. 2011-07-14 21:12:30 -04:00
Tom Rothamel e447c6170b merge mainline 2011-07-14 11:28:51 -04:00
Tom Rothamel 90b25d3ea4 Remove symlink. 2011-07-13 00:49:14 -04:00
Tom Rothamel 951afa8799 screens: Only show joystick if a joystick exists (or we fake it). 2011-07-12 23:49:19 -04:00
Tom Rothamel 644243db31 Timer now can take a list of actions, rather than just a callable. Fixes lp:808546. 2011-07-10 21:41:44 -04:00
Tom Rothamel 212a1f0682 Document music_room. 2011-07-02 21:53:29 -04:00
Tom Rothamel d700cd9a97 Add music room. 2011-07-02 20:34:55 -04:00
Tom Rothamel 59d4ff87b8 Merge in fixes from the 6.12.1 branch. 2011-06-23 22:09:28 -04:00
Tom Rothamel 08641efd0c Force ATL transforms to be executed before they can be copied. This
prevents no child errors when the child is the first thing in the ATL.
2011-06-22 23:23:14 -04:00
Tom Rothamel 7c81554b39 Comment out parameterize for now. 2011-06-22 22:24:21 -04:00
Tom Rothamel 6fc1792436 Fix CTC-related problems. 2011-06-22 17:52:31 -04:00
Tom Rothamel c2855f7871 Use the correct definition for RENPY_THIRD_TEXTURE. 2011-06-22 16:13:17 -04:00
Tom Rothamel 5988076d56 Update documentation. 2011-06-22 13:54:50 -04:00
Tom Rothamel 4a0164fc7f Fix xfill/yfill fix. 2011-06-22 00:23:15 -04:00
Tom Rothamel 9bad334102 Ren'Py no longer captures gamepad input when not focused. 2011-06-21 23:19:27 -04:00
Tom Rothamel 4dfca9e6c1 Handle quit-during-error-handling by quitting. 2011-06-21 22:53:47 -04:00
Tom Rothamel 8b1dee04cd Fixes for the software renderer. 2011-06-20 22:32:33 -04:00
Tom Rothamel d856bd13be Pick a better window size on netbooks that use the software renderer. 2011-06-20 00:17:51 -04:00
Tom Rothamel e9d198109c ATL splines should deal with unknown properties, just like linear interpolation does. 2011-06-19 23:25:33 -04:00
Tom Rothamel aed19f9492 Add a NoRollback class, and make Particle inherit from it, to preserve
previous semantics.
2011-06-19 22:55:21 -04:00
Tom Rothamel 126c520d14 Fix bug with side images. 2011-06-19 14:45:29 -04:00
Tom Rothamel 6d23374f01 Use tablet/phone variants before None variant; also before touch variant. Add pc variant. 2011-06-19 13:56:40 -04:00
Tom Rothamel 6f0c5873c2 Call slow_done even if slow is set to False. This fixes a problem with CTC not showing up after a reload. 2011-06-19 12:32:36 -04:00
Tom Rothamel b8fb05f30f Give a more informative diagnostic for a menu caption followed by a block. 2011-06-19 08:45:05 -04:00
Tom Rothamel 925b53db58 Restore the behavior of xfill on vboxes and yfill on hboxes. 2011-06-19 08:35:37 -04:00
Tom Rothamel 99c1268051 Merge in fixes for gltexture. 2011-06-18 22:48:13 -04:00
Tom Rothamel 6be247e07d Make texwrap ignore RUBY_TOP glyphs. 2011-06-18 09:50:26 -04:00
Tom Rothamel dfa423b62d More performance and correctness fixes. 2011-06-16 22:58:28 -04:00
Tom Rothamel 49b95e1a8a Fix bugs in texture performance, including an ~5ms performance loss on texture loading. 2011-06-16 21:53:11 -04:00
Tom Rothamel 03eedca87c Much faster texwrap. (But is it fast enough for asian text?) 2011-06-16 16:04:59 -04:00
Tom Rothamel 4602f8b43a More optimizations. 2011-06-16 08:52:35 -04:00
Tom Rothamel 9b77f044ab Speed up the tex layout algorithm. (But it's still slow.) 2011-06-16 01:36:47 -04:00
Tom Rothamel 7200908ea9 newtext: tex wrapping algorith,. 2011-06-15 23:52:21 -04:00
Tom Rothamel b87827f53b newtext: Use unicode line breaking algorithm. 2011-06-15 12:57:14 -04:00
Tom Rothamel 173370b905 Generate linebreak data. 2011-06-15 09:51:31 -04:00
Tom Rothamel 628703aab3 newtext: Add asian annotation support. 2011-06-14 23:30:50 -04:00
Tom Rothamel 6bd014b9a6 Implement _start, cps text tags. 2011-06-13 10:14:11 -04:00
Tom Rothamel 7feff9e690 Add more test cases; fix code so they pass. 2011-06-12 22:16:33 -04:00
Tom Rothamel af300d118a newtext: Fix antialiasing and justification. 2011-06-11 23:54:22 -04:00
Tom Rothamel 25e74c5f79 Test case for newtext properties. 2011-06-11 15:24:14 -04:00
Tom Rothamel c63d860d1f Add support for alignment and justification. 2011-06-11 12:17:23 -04:00
Tom Rothamel 32db1082c0 newtext: Implement ruby, leading, and spacing. 2011-06-11 00:44:43 -04:00
Tom Rothamel 06193b4285 newtext: Less updates. 2011-06-10 20:26:00 -04:00
Tom Rothamel 1192c546a1 newtext: Add displayable support.
newtext: Add layout_cache.
2011-06-10 07:28:21 -04:00
Tom Rothamel ec3881d5c4 newtext: Add {space} and {vspace} tags. 2011-06-09 00:44:08 -04:00
Tom Rothamel 473ae87547 newtext: Add hyperlinks, underline, and strikethrough. 2011-06-08 15:58:01 -04:00
Tom Rothamel 6112741a6b newtext: Drawing/updating hyperlinks. 2011-06-08 11:24:50 -04:00
Tom Rothamel b68e23551a newtext: Figure out hyperlink areas. 2011-06-08 00:22:02 -04:00
Tom Rothamel 817bc804a6 newtext: separate initial and later layout steps.
newtext: fix multiple fonts from face.
2011-06-07 23:55:04 -04:00
Tom Rothamel 93976e043f Add support for bold. 2011-06-07 11:34:52 -04:00
Tom Rothamel 07b48bd353 newtext: Implement italics. 2011-06-07 01:19:55 -04:00
Tom Rothamel 6923507e74 newtext: get outlines working. 2011-06-06 15:30:27 -04:00
Tom Rothamel 5e1a260546 newtext: Compute the time the next character should be shown. 2011-06-06 13:10:50 -04:00
Tom Rothamel 63e2cc802c newtext: some fixes, calling it a night. 2011-06-06 01:13:10 -04:00
Tom Rothamel c4bdd4a800 newtext: First go at typing out text. 2011-06-05 23:55:16 -04:00
Tom Rothamel 0fdca7c146 newtext: cache font glyphs. 2011-06-01 14:00:39 -04:00
Tom Rothamel 0d35f3709b newtext: Fix line breaking, display text on screen, add profiling code. 2011-06-01 13:59:39 -04:00
Tom Rothamel b1e366a31f newtext: Working with outlines, and other bug fixes. 2011-06-01 00:43:14 -04:00
Tom Rothamel 922e5c0fbb newtext: Make ftfont use the over operation. 2011-05-31 01:37:27 -04:00
Tom Rothamel 11bc000a85 newtext: checkpoint @ writing text to a file. 2011-05-30 12:33:13 -04:00
Tom Rothamel 8ab9bb0e01 newtext: western-style character annotation and line-breaking. 2011-05-29 16:49:58 -04:00
Tom Rothamel ea83307012 Create the lists of glyphs. 2011-05-28 11:14:32 -04:00
Tom Rothamel df35b3f955 newtext: working tokenizer and segmenter. 2011-05-28 00:24:43 -04:00
Tom Rothamel b9b460e549 Rearrange code in preparation for newtext. 2011-05-28 00:22:52 -04:00
Tom Rothamel 91f78bee55 ftfont: rendering text to a surface. 2011-05-22 14:34:44 -04:00
Tom Rothamel a0833f0dd7 ftfont: Set unicode encoding. 2011-05-22 00:26:48 -04:00
Tom Rothamel b9a2c8d50c ftfont: init library
ftfont: open a face from a python file-like object.
2011-05-21 22:04:24 -04:00
Tom Rothamel dafd79d55b Merge fix for GLES devices. 2011-05-16 22:57:25 -04:00
Tom Rothamel 18808fffec Fix problems on GLES devices with only two textures, or that don't
have texture crossbar support.
2011-05-16 21:23:02 -04:00
Tom Rothamel 29ea80260f Don't error out if we has_screen an empty screen. 2011-05-15 16:28:16 -04:00
Tom Rothamel a61dd71833 Don't error out if we has_screen an empty screen. 2011-05-11 14:29:44 -04:00
Tom Rothamel e1b740eeff Allow shift+R when errorhandling. 2011-05-04 21:56:31 -04:00
Tom Rothamel c99e94e24d Properly initialize and deinitialize the environ and rtt objects. 2011-05-04 18:46:21 -04:00
Tom Rothamel 7141ae8478 Properly initialize and deinitialize the environ and rtt objects,
preventing a bug that caused a white screen to show up.
2011-05-04 17:36:18 -04:00
Tom Rothamel b10df22048 Init the GL environment in set_mode, so we can detect if we can't load shaders. 2011-05-03 13:07:15 -04:00
Tom Rothamel 986a5822bc Bump versions for 6.12.2. 2011-05-02 21:14:38 -04:00
Tom Rothamel 5f0057d3f8 Use the back buffer for screenshots. (Fixes a bug on Intel GPUs - hopefully.) 2011-05-01 12:06:58 -04:00
Tom Rothamel 8b64077881 Wave dead chickens over all-black screenshots. 2011-04-30 18:15:04 -04:00
Tom Rothamel 61c7e90f86 Clarify auto-population of config.archives. 2011-04-30 12:17:00 -04:00
Tom Rothamel 9ec2752883 By default, archives are searched in reverse asciiabetical order. 2011-04-29 00:06:37 -04:00
Tom Rothamel 192fe79839 Make viewport contents visible in style inspector. 2011-04-28 21:19:02 -04:00
Tom Rothamel 51e548d481 Properly display exceptions in init code. 2011-04-26 18:53:31 -04:00
Tom Rothamel 045077e983 Update doc version automatically. 2011-04-24 19:31:27 -04:00
Tom Rothamel 334195cc8f Implement config.say_attribute_transition. 2011-04-24 18:58:05 -04:00
Tom Rothamel 1d5696e10d Fix problems with invoking old-school yes/no prompts. 2011-04-24 18:27:27 -04:00
Tom Rothamel d4139d026a Clean out the say attributes at the end of an interaction. 2011-04-24 18:17:28 -04:00
Tom Rothamel 13520a7e23 Clear the screen on errors, to prevent erroneous displayables from
causing problems.
2011-04-24 16:57:59 -04:00
Tom Rothamel 49890f230a Reset image attributes on a failed say prediction. 2011-04-24 16:48:03 -04:00
Tom Rothamel 0bb8c545f0 Update changelog. 2011-04-24 09:53:07 -04:00
Tom Rothamel f7d799ea78 Remove legacy error handling. 2011-04-24 01:21:34 -04:00
Tom Rothamel c7cadc4097 Display parse errors in Ren'Py. 2011-04-24 01:16:34 -04:00
Tom Rothamel 583b4d79af Stop distributing CHANGELOG.txt, which is obsolete. 2011-04-23 17:52:43 -04:00
Tom Rothamel d58bea4f19 Document changes to say statement. 2011-04-23 17:51:39 -04:00
Tom Rothamel bacab075d8 Document android. 2011-04-23 17:29:46 -04:00
Tom Rothamel 46b4ca65eb Document transforms and transitions in python. 2011-04-23 17:03:33 -04:00
Tom Rothamel 783fdc120a Document transitions. 2011-04-23 12:52:29 -04:00
Tom Rothamel 4cce7d9523 Document transitions. 2011-04-23 00:31:25 -04:00
Tom Rothamel 065a1736f6 Document with statement. 2011-04-22 01:06:48 -04:00
Tom Rothamel 8f5119bb10 Be conservative on get_filename_line. 2011-04-22 00:18:30 -04:00
Tom Rothamel f5a9eb90ac glReadBuffer isn't in OpenGL ES. 2011-04-18 22:21:12 -04:00
Tom Rothamel 24f553dfec Take screenshots from the front buffer, since it's what the user is
seeing. Fixes a bug where screenshots could turn up black.
2011-04-18 22:14:29 -04:00
Tom Rothamel 47be57973e Fix bug with upgrading save games containing image references. 2011-04-18 20:58:34 -04:00
Tom Rothamel 23240e634a Documentation work. 2011-04-18 20:57:50 -04:00
Tom Rothamel c13438cee9 Add displaying images page to documentation. 2011-04-18 00:38:41 -04:00
Tom Rothamel 3e3cd634a0 Ren'Py no longer attempts to adjust the system level mixer controls, which
means that it's no longer possible to raise the volume from within Ren'Py.
Controlling the system volume exhibited bugs on all three platforms, including
hard-to-predict volume changes that affect other applications.
2011-04-17 15:06:42 -04:00
Tom Rothamel 72c5974efe Credit for bug. 2011-04-17 00:20:42 -04:00
Tom Rothamel 5832498bfe Do not merge TIMEEVENT with other events. (It rarely happens, and
it can lead to problems if the other event is ignored.)
2011-04-16 23:53:51 -04:00
Tom Rothamel 965418255d Make timers participate in rollback. Opens the gates for other displayables
to have rollback state, as well.
2011-04-16 23:47:36 -04:00
Tom Rothamel 317f981657 Fix bug with automatic images. 2011-04-16 17:53:57 -04:00
Tom Rothamel 8706c55260 Use the transform size property as the initial size of a render (fixes a
regression).
2011-04-16 17:43:14 -04:00
Tom Rothamel d29326065e Eliminate spurious PyDev warnings. 2011-04-16 17:38:44 -04:00
Tom Rothamel e5cdb1346d Future-proof ast.py. 2011-04-16 16:38:10 -04:00
Tom Rothamel 9b2ff06341 Add FullRestartException to the list of control exceptions. 2011-04-16 15:38:48 -04:00
Tom Rothamel 725382a378 Implement screen variants. Suppress more warnings. 2011-04-14 23:13:54 -04:00
Tom Rothamel 61c4cac28e Update Ren'Py to work w/ Honeycomb and tablets. 2011-04-14 21:31:22 -04:00
Tom Rothamel 05a0273995 Pre-release. 2011-04-08 22:40:11 -04:00
Tom Rothamel 5c30ed7ebe Minor changes for pre-release. 2011-04-08 22:31:21 -04:00
Tom Rothamel 32f7790b1f Update the changelog. 2011-04-07 21:54:15 -04:00
Tom Rothamel 0926618ed0 Allow Preference("display", 2.0) to set the screen size. 2011-04-07 21:44:06 -04:00
Tom Rothamel e4b8b3e726 Persist window size. 2011-04-07 12:20:07 -04:00
Tom Rothamel 0615b8432e Add tooltips.
Fix docs.
2011-04-05 23:10:20 -04:00
Tom Rothamel 88ad3fc1dd Censor tracebacks a bit better. 2011-04-05 22:13:22 -04:00
Tom Rothamel 4187cdafd4 Quote filenames in the image location picker. 2011-04-05 21:47:06 -04:00
Tom Rothamel 62d4323c95 Update style inspector. 2011-04-05 00:32:55 -04:00
Tom Rothamel 57f1fb6505 Make the renderer selection use the amie style. 2011-04-04 22:16:52 -04:00
Tom Rothamel c953a71e36 Added support for debugging text overflows. 2011-04-04 00:15:51 -04:00
Tom Rothamel db7075753d Improve logging. 2011-04-03 12:06:49 -04:00
Tom Rothamel f9709a429e Redo logging. 2011-04-03 11:32:39 -04:00
Tom Rothamel 3bc64e4af3 Ignore eclipse files. 2011-04-02 23:38:15 -04:00
Tom Rothamel 49cf9af762 Fix potential uninitialized variable bug. 2011-04-02 16:13:15 -04:00
Tom Rothamel ed14a0576a Fix bug in renpy.showing. 2011-04-02 10:55:44 -04:00
Tom Rothamel ec3a4ddb5a Debounce the VIDEORESIZE event - fixes duplicate mouse problem when
maximized on Linux.
2011-04-01 22:26:20 -04:00
Tom Rothamel 097479d0b0 Actions now can have an :method:Action.unhovered method. This method is
called when an action supplied as a `hovered` parameter loses focus.

Error handling now uses tooltips.
2011-03-31 11:54:33 -04:00
Tom Rothamel a995e3f542 Allow the user to ignore exceptions. 2011-03-31 00:56:38 -04:00
Tom Rothamel a0cfb8779d Change the AST nodes to call the new next_node function as early as
possible, so error recovery becomes plausible.
2011-03-31 00:25:29 -04:00
Tom Rothamel 3b137c3e54 Error handling at init time.
game.init_phase has been replaced with renpy.context().init_phase.
2011-03-30 21:46:05 -04:00
Tom Rothamel 50cc54840f Tweak look / spelling. 2011-03-30 00:42:03 -04:00
Tom Rothamel d9799ac5bb Good-looking error handling. 2011-03-29 23:55:02 -04:00
Tom Rothamel 64bf3f1b9c Add the box_wrap style property.
Fix many (bogus) errors reported by Eclipse, and a few minor real ones.
2011-03-29 00:07:09 -04:00
Tom Rothamel b791945564 Ren'Py now attempts to elide personal information from filenames. Where
possible, filenames are reported relative to the base or Ren'Py base
directories,  rather than the root of the filesystem.
2011-03-28 00:59:11 -04:00
Tom Rothamel a8cc7abfff Normalize error reporting.
Congratulations Deb and Mike!
2011-03-26 10:20:11 -04:00
Tom Rothamel fa15618437 Added the :func:SetScreenVariable and :func:ToggleScreenVariable actions.
These allow screen-local variables to be changed.
2011-03-26 09:40:36 -04:00
Tom Rothamel 844f7ac4d2 Indentation errors are now reported on the indented line, and not the line
preceding the erroneous indentation.
2011-03-26 00:21:50 -04:00
Tom Rothamel a43426bf64 Move the hyperlink functions into a style property. 2011-03-26 00:06:44 -04:00
Tom Rothamel 7015216392 merged 2011-03-25 16:00:16 -04:00
Tom Rothamel 5cc0dbbf08 Factor error handling out into its own file, which is loaded before anything else. 2011-03-25 11:03:25 -04:00
Tom Rothamel 98acd5b0f3 Insert basic exception interception. 2011-03-25 09:41:05 -04:00
Tom Rothamel 14f24424ea Restore merges. 2011-03-31 18:47:17 -04:00
Tom Rothamel 9483a7daa5 Back out changes. Release 6.12.0f. 2011-03-31 18:46:01 -04:00
Tom Rothamel 89d93544a7 Fix bug in new prediction. 2011-03-31 17:52:10 -04:00
Tom Rothamel af3a579122 merged 2011-03-24 22:32:39 -04:00
Tom Rothamel ae769272a6 merge changes 2011-03-24 22:31:55 -04:00
Tom Rothamel 5f08daa85a Fix problems w/ newer cython caused by no-longer-necessary forward
declaration.
2011-03-24 22:27:26 -04:00
Tom Rothamel 8fdec02557 Add the new internal (amie2) style. 2011-03-22 00:59:30 -04:00
Tom Rothamel f8cef3d339 Add the new internal (amie2) style. 2011-03-22 00:59:30 -04:00
Tom Rothamel d891dd290c Merge smartshow branch. 2011-03-21 00:11:56 -04:00
Tom Rothamel 0b366f6850 Document side_image. 2011-03-21 00:07:28 -04:00
Tom Rothamel 899bf47d34 Fix lint to work with screens. 2011-03-20 23:52:59 -04:00
Tom Rothamel 888c485186 Implement the new side image code. 2011-03-20 20:31:37 -04:00
Tom Rothamel dbbabbb2dc More eclipse annotations. 2011-03-20 14:17:39 -04:00
Tom Rothamel 7a38331f8c Fix/Annotate errors and warnings produced by PyDev. 2011-03-20 12:25:56 -04:00
Tom Rothamel 0dbcb352c9 Implement say with image attributes. 2011-03-19 21:29:38 -04:00
Tom Rothamel 1ab0b43202 Refactor images; Add image attributes. 2011-03-15 00:48:14 -04:00
Tom Rothamel 106d95e795 Implement keep_running_transform. 2011-03-06 15:18:55 -05:00
Tom Rothamel cf9005e457 Early work on keep_running_transform. 2011-03-05 11:32:57 -05:00
Tom Rothamel be7fd4fa13 Refactor image-like code out of image.py. 2011-03-01 23:23:00 -05:00
Tom Rothamel b0f848b089 Add xcenter and ycenter style and transform properties. 2011-02-23 23:42:33 -05:00
Tom Rothamel 07077e89b1 Add renpy.vibrate. 2011-02-21 23:26:14 -05:00
Tom Rothamel bc2a0451db Finish bumps to 6.12.1. 2011-02-15 22:19:46 -05:00
Tom Rothamel 4e38257900 Distribute bumps the vc_version file, which is read by __init__.py to
compute the advertised version.
2011-02-15 22:13:58 -05:00
Tom Rothamel f934838a59 Tree cleanup. 2011-02-15 21:43:19 -05:00
Tom Rothamel ee0fb68d60 Licenxe fixes. Better behavior for Frames with overly-big corners. 2011-02-08 20:32:39 -05:00
Tom Rothamel 37e8fd19cd Set _last_say_window at the start of a say statement. 2011-02-07 09:54:54 -05:00
Tom Rothamel f600e6a24b Remove texture unit check. 2011-02-06 17:38:30 -05:00
Tom Rothamel ca9009f5fe Fix problems with menu prediction. Doc/screen fixes. 2011-02-06 16:09:40 -05:00
Tom Rothamel 9a299a9b38 Make chosen work. 2011-02-06 10:51:20 -05:00
Tom Rothamel 845ae6e7ba Add FileSlotName. 2011-02-06 09:48:03 -05:00
Tom Rothamel 8f706107ac 6.12.0d 2011-02-05 21:28:37 -05:00
Tom Rothamel d489199e00 Screen tweaks, doc fixes. 2011-02-05 21:06:39 -05:00
Tom Rothamel bf023dc2e3 Only select FileSave if confirm=True. 2011-02-05 20:17:00 -05:00
Tom Rothamel ac6b04b5e3 Add FilePageName. 2011-02-05 16:53:14 -05:00
Tom Rothamel a34de5d601 Predict main_menu while in splashscreen.
Better logging on image cache misses.

Minor bug/doc fixes.
2011-02-05 13:58:15 -05:00
Tom Rothamel b9900776a8 Fix choice example 2011-02-03 23:53:57 -05:00
Tom Rothamel 12a444c11f Bump version. 2011-02-03 22:14:29 -05:00
Tom Rothamel 433473e53e No predict when a movie is playing; image cache debugging; gl debugging. 2011-02-03 21:39:57 -05:00
Tom Rothamel d5f889767a Multiple changes.
* Change how chosen choices are reported to screens.
* Don't use raw pygame to report an error.
* Check in the documentation includes.
2011-02-03 00:20:03 -05:00
Tom Rothamel 9873dd487c Don't go fullscreen on Android. 2011-02-02 00:30:44 -05:00
Tom Rothamel ec8bed61f1 Add xminimum property. Rewrite compute_subrect as compute_subline, which
winds up with clearer code.
2011-02-02 00:24:48 -05:00
Tom Rothamel d76971385d Fix typos. (Thanks backansi.) 2011-01-30 21:50:36 -05:00
Tom Rothamel b87fed5541 Remove unnecessary change. 2011-01-30 20:46:41 -05:00
Tom Rothamel bd8d3dbc38 Use the 6.11.2 (hacky) frame code when using the software renderer, to
prevent visual artifacts.
2011-01-30 20:38:14 -05:00
Tom Rothamel 6022e3fa2b Fixes. 2011-01-30 19:47:49 -05:00
Tom Rothamel c5c8a6e20e Allow unicode in ATL. 2011-01-30 09:19:21 -05:00
Tom Rothamel 3306bc848a Start work on b. 2011-01-30 09:03:36 -05:00
Tom Rothamel 2911ef54e5 Fix UTF-8 code. 2011-01-30 08:35:54 -05:00
Tom Rothamel cc54d1970b Windows & Distribution fixes. 2011-01-29 18:26:49 -05:00
Tom Rothamel e6915fffd3 Ensure that we can load Matrix2Ds. 2011-01-29 12:16:36 -05:00
Tom Rothamel 964d746f6d Move yesno_prompt back to 6.11 location. 2011-01-29 10:44:33 -05:00
Tom Rothamel de6af43d74 Bump copyright year. 2011-01-29 09:27:48 -05:00
Tom Rothamel 0dc1a6e46c Android docs. 2011-01-29 00:23:53 -05:00
Tom Rothamel 4098830804 Prevent get_screenshot from returning None. 2011-01-28 00:29:48 -05:00
Tom Rothamel 304ab15b8f Doc and tutorial additions/fixes. 2011-01-28 00:26:24 -05:00
Tom Rothamel 16fa9410db Pixel opacity can't be determined in GLES mode - so don't bother trying. 2011-01-28 00:10:38 -05:00
Tom Rothamel 9ff69de20c Kill a possible INVALID_ENUM error. 2011-01-27 21:51:14 -05:00
Tom Rothamel cd50f1ee86 Document snowblossom. 2011-01-27 19:07:19 -05:00
Tom Rothamel 195f3d6130 Documentation; Particle fix; Sprite demo. 2011-01-27 18:36:10 -05:00
Tom Rothamel 89d8622f6f Typo fix in tutorial. Change how we setup modulefinder. 2011-01-27 01:58:18 -05:00
Tom Rothamel d71e054eb4 Changes to import so that we can build packages. 2011-01-27 01:17:27 -05:00
Tom Rothamel 48a648eecd A far more minimial solution. 2011-01-27 00:07:16 -05:00
Tom Rothamel 63268d079e Remove the clipper from the software renderer, as it was causing problems
with transformed scaled images.
2011-01-26 23:24:54 -05:00
Tom Rothamel 743d5ca81a Add starfield effect. 2011-01-26 16:30:44 -05:00
Tom Rothamel dffb33c8e0 Fix the demo. 2011-01-25 21:36:11 -05:00
Tom Rothamel a6ea0931dd Fix Philippines flag orientation.
Never trust mugenjohncel.
2011-01-24 23:33:36 -05:00
Tom Rothamel 17016c0eb2 Fix bugs, tweak memory usage. 2011-01-24 23:33:31 -05:00
Tom Rothamel 67c703d934 Use big textures for RTT. 2011-01-24 22:28:58 -05:00
Tom Rothamel c163d1c936 Add focus_mask to screen language. 2011-01-24 21:12:33 -05:00
Tom Rothamel e3c15a2c58 Automatically size the window on initial load. 2011-01-24 19:28:43 -05:00
Tom Rothamel dfc149f292 Use glrtt fbo to render to textures.
Fix problem w/ rtt format.
2011-01-23 23:57:49 -05:00
Tom Rothamel 627ba65b9a Partially fix distribute, fixes for android. 2011-01-22 21:02:57 -05:00
Tom Rothamel a92170d88a Various fixes required to fix the Ren'Py tutorial. 2011-01-22 13:35:26 -05:00
Tom Rothamel 503653cb5e Fix sound problem. 2011-01-22 10:55:47 -05:00
Tom Rothamel 68c277ff9a Cleanup after merging. 2011-01-21 23:13:22 -05:00
Tom Rothamel 7b171b4f9b Spacing. 2011-01-21 22:42:34 -05:00
Tom Rothamel 30956e4c58 Rewrite the code that writes bytecode.rpyb, so that it uses md5 hashes
so that we don't have to recompile the code every time Ren'Py is
upgraded. (This matters on android.)
2011-01-21 22:36:40 -05:00
Tom Rothamel 6a956aacab Ren'Py now treats filenames as if they were case-insensitive. This
means that filename mismatches on Linux should no longer be a problem.
2011-01-21 00:20:33 -05:00
Tom Rothamel 681c845e2d Fix ordering problem the meant a parent's per_interact could be called
before its children's.

Fix lp:680266.
2011-01-19 23:45:07 -05:00
Tom Rothamel 11594ef5e8 Fix problems with SnowBlossom/Particles. 2011-01-19 00:19:21 -05:00
Tom Rothamel 28f06291db sl: add spacing 2011-01-18 23:04:14 -05:00
Tom Rothamel c6937698ed Fix screen prediction, especially for menus.
Rewrote tutorial to use an imagemap-screen.
2011-01-18 21:01:21 -05:00
Tom Rothamel 15f85c8b80 Merge with mainline. 2011-01-17 23:04:27 -05:00
Tom Rothamel 7fd5695f83 More build tweaks. 2011-01-17 23:03:18 -05:00
Tom Rothamel 952880287b Change how we version the module. 2011-01-17 22:01:44 -05:00
Tom Rothamel f76c7cf25a Lower the double-click to quit time to .75 seconds, to prevent confusion. 2011-01-16 14:03:17 -05:00
Tom Rothamel 7c14b4d381 Fix bug that prevented canvas from working in GL mode. 2011-01-16 13:59:42 -05:00
Tom Rothamel c67389f0a3 Fix dbz in audio code. 2011-01-16 11:13:35 -05:00
Tom Rothamel 219994ced2 Fix problems switching from sw -> gl, in 00gltest. 2011-01-15 23:21:28 -05:00
Tom Rothamel 274f08807e Allow Ren'Py to run on ancient OpenGL implementations. 2011-01-15 21:35:03 -05:00
Tom Rothamel 7601b4d3da Ensure Ren'Py can start even when OpenGL is missing. 2011-01-15 20:13:56 -05:00
Tom Rothamel 05d14b4bfd Fix im.matrix.colorize. 2011-01-15 19:24:24 -05:00
Tom Rothamel c5b63fd1c5 Fix get_screenshot regression. 2011-01-15 19:05:58 -05:00
Tom Rothamel 0bb6a926b2 Add config.screenshot_callback. 2011-01-15 18:54:38 -05:00
Tom Rothamel 0124eacb15 Add hovered and unhovered to Bar.
Remove spritemanager sl statement.
2011-01-15 18:19:04 -05:00
Tom Rothamel 7ac06761d6 Add MouseArea/mousearea. Add spritemanager to screen language. 2011-01-15 16:59:47 -05:00
Tom Rothamel c8c6226045 Add screen prediction to say, menu, and call screen statements, and
to several Actions.
2011-01-15 13:53:58 -05:00
Tom Rothamel 507d9610c7 Implement screen variants. 2011-01-15 00:10:53 -05:00
Tom Rothamel 5f4075fc35 Add NVL screen. 2011-01-14 09:39:07 -05:00
Tom Rothamel 514571cc80 Fix problems with options and shift+R reloading. 2011-01-13 01:09:51 -05:00
Tom Rothamel 6ff34b71cf Round stencil box coordinates more accurately. 2011-01-13 01:06:09 -05:00
Tom Rothamel 37416daa53 Fixes for menu screens. 2011-01-13 00:20:23 -05:00
Tom Rothamel 6bd5401633 Make the tutorial game use screens; improve screen support as necessary. 2011-01-12 23:59:25 -05:00
Tom Rothamel ea6b9571b5 Fixed software rendering / transform for now. This required ensuring that
there is always a 2-pixel band around the border of each image, up from
the previous 1-pixel border.
2011-01-10 02:06:00 -05:00
Tom Rothamel bd7c403986 Rewrite Solid and Frame so that they use the GPU to do scaling. Frame
no longer requires its argument to be an image manipulator.
2011-01-09 22:44:14 -05:00
Tom Rothamel 99417726ce Prediction of screens. 2011-01-09 18:14:52 -05:00
Tom Rothamel 4319e542f7 Add accessor for prefixed style properties.
Add prediction for images used in windows, buttons, and bars.
2011-01-09 00:25:44 -05:00
Tom Rothamel 61d8445949 Rewrote image prediction code. 2011-01-08 23:42:13 -05:00
Tom Rothamel 743095064d Update logging. 2011-01-08 01:41:29 -05:00
Tom Rothamel efa12ab5a6 Add logging infrastructure. 2011-01-08 01:15:39 -05:00
Tom Rothamel b49b1b392c Action prediction code. 2011-01-08 00:16:16 -05:00
Tom Rothamel 09e54e9915 Doc fix. 2011-01-07 23:39:14 -05:00
Tom Rothamel 373d175f2d Make imagemap caching configurable on a per-screen basis. 2011-01-04 01:57:10 -05:00
Tom Rothamel 5f3955a04a Cache imagemap hotspots to disk. 2011-01-04 01:37:33 -05:00
Tom Rothamel 98c0e51527 Document images and image manipulators. 2011-01-01 01:03:43 -05:00
Tom Rothamel 8b3a6e8fc6 Checkin to merge docs from wrong place. 2011-01-01 00:47:13 -05:00
Tom Rothamel b2d2e8ba7e Brillantly documented im.py in the wrong place. Checking in for a merge. 2011-01-01 00:46:29 -05:00
Tom Rothamel f1efced19c merge from trunk 2010-12-29 23:54:46 -05:00
Tom Rothamel 5b09dfc80c merge from trunk 2010-12-29 23:54:22 -05:00
Tom Rothamel 39f91a4368 Doc work 2010-12-29 23:52:37 -05:00
Tom Rothamel 3b6c9bde63 Fix sprites and add documentation. 2010-12-29 00:57:54 -05:00
Tom Rothamel 1df05ea53e fix bug when computing determinant. 2010-12-29 00:34:33 -05:00
Tom Rothamel 3e9aee1c6f Documentation. 2010-12-28 00:09:13 -05:00
Tom Rothamel 5231a460da Document Drag and Drop. 2010-12-26 21:10:31 -05:00
Tom Rothamel e6b3b36df9 Tweak sphinx building to handle methods; add (some) docs to dragdrop. 2010-12-25 10:13:22 -05:00
Tom Rothamel 060d510658 Random tweaks to work better with cardgame. 2010-12-25 02:34:23 -05:00
Tom Rothamel 3b21a4aa97 Redo joining support to be a better design; add clicked, hovered, and
unhovered to drag and drop.
2010-12-24 16:19:26 -05:00
Tom Rothamel 4824b44950 Added joins to achieve reasonably working drag and drop. 2010-12-24 01:25:31 -05:00
Tom Rothamel 988a92d4a5 Drag and drop uses style prefixes. 2010-12-23 11:21:53 -05:00
Tom Rothamel 378e2e61bd Implement drag & drop callbacks. 2010-12-23 01:29:23 -05:00
Tom Rothamel eb94a7d9bb Implement drag groups. 2010-12-23 00:40:25 -05:00
Tom Rothamel fe2ba07a57 Remember drag position. 2010-12-22 01:12:57 -05:00
Tom Rothamel 2788b12eb2 Add drag to SL and UI, restrict positions to the screen. 2010-12-21 00:01:59 -05:00
Tom Rothamel 265b553b4e Initial working drag and drop code. 2010-12-20 22:39:55 -05:00
Tom Rothamel 5f800681aa Make field presentable, preventing a memory leak. 2010-12-16 21:56:50 -05:00
Tom Rothamel 890c9cf591 Delete the correct file on restart. 2010-12-16 11:29:23 -05:00
Tom Rothamel 2c356b80ed Reset clear color to black. 2010-12-15 23:20:00 -05:00
Tom Rothamel cc097ba7da Use glScissor for clipping. 2010-12-15 23:12:08 -05:00
Tom Rothamel 78401f1c4a implement config.linear_saves_page_size 2010-12-14 21:43:48 -05:00
Tom Rothamel 8802363544 implement config.linear_saves_page_size 2010-12-14 21:39:51 -05:00
Tom Rothamel 05388c3733 Setup android keymap. 2010-12-14 11:51:54 -05:00
Tom Rothamel 8f84301b39 Android fixes. 2010-12-12 16:26:05 -05:00
Tom Rothamel 774ba5d990 Merge changes from lp:renpy. 2010-12-05 16:46:21 -05:00
Tom Rothamel 6bf0cd93d1 Merge bug fixes. 2010-12-05 16:43:56 -05:00
Tom Rothamel 7f63c26348 Since OpenGL ES doesn't support ClipPlanes, don't use them. 2010-12-05 13:04:22 -05:00
Tom Rothamel bce3e6ede1 More android fixes. 2010-12-05 00:17:48 -05:00
Tom Rothamel 4f642041f9 Change how reloading a game works.
Other minor android-related fixes.
2010-12-04 00:49:02 -05:00
Tom Rothamel b990b2768c Implement fast dissolve, config.simulate_android. 2010-11-29 22:28:42 -05:00
Tom Rothamel 53b8d37d8c Android fixes. 2010-11-28 16:29:47 -05:00
Tom Rothamel db9f63c2d9 Sound on Android Ren'Py. 2010-11-23 12:00:47 -05:00
Tom Rothamel 87df4ff487 Add power management support. 2010-11-16 23:08:49 -05:00
Tom Rothamel f0fe459460 GLES Video Working. 2010-11-14 23:02:07 -05:00
Tom Rothamel f71a35751a Fix problem with texture signedness. 2010-11-08 19:39:32 -05:00
Tom Rothamel 2458d9cbb3 Starting to display using GLES. 2010-11-07 22:15:15 -05:00
Tom Rothamel 81c6d33005 Limited environment. 2010-11-06 23:54:56 -04:00
Tom Rothamel dba5c20e34 Use RGBA instead of BGRA. 2010-11-05 22:34:38 -04:00
Tom Rothamel c2eddb21e5 Android work. 2010-11-04 00:06:55 -04:00
Tom Rothamel de1d289670 Better fix. 2010-11-01 08:01:12 -04:00
Tom Rothamel 623201fd75 fix crash bugs 2010-10-31 23:18:29 -04:00
Tom Rothamel 2f900b6bc7 Bump minimum GL version to 1.3. Rewrite drawing to use array-based functions that are supported by OpenGL ES. 2010-10-31 23:10:48 -04:00
Tom Rothamel 375af0cccd 6.11.2b 2010-10-26 22:12:50 -04:00
Tom Rothamel 8ae8e887f5 Fix a bug in Frame that can cause an image to be drawn more than once
a border size is 0.
2010-10-24 18:06:36 -04:00
Tom Rothamel 201b6432c4 6.11.2a 2010-10-24 14:59:33 -04:00
Tom Rothamel fc10bbf6b6 Update themes code to support Aleema's new themes. 2010-10-23 14:14:27 -04:00
Tom Rothamel 1c82c71aea Defensively code adding an event to the queue. 2010-10-23 00:13:53 -04:00
Tom Rothamel a59abd3135 Rewrote MoveTransition to deal with changes in order more gracefully. 2010-10-22 01:15:41 -04:00
Tom Rothamel a51633b511 Fixed :lpbug:647324, where ImageDissolves are rendered as if
specified with alpha=True whether or not alpha=True was set.
2010-10-21 23:26:41 -04:00
Tom Rothamel 2b40d265f9 Search for environment.txt in the directory containing the mac .app file. 2010-10-21 22:56:54 -04:00
Tom Rothamel 734b5b02f8 Buttons now only pass key events to their children when they are
focused. This allows a screen language key statement to be used as the
child of a button, and only activate when the button is focused.
2010-10-21 22:34:44 -04:00
Tom Rothamel 4120434e5a Add four themes contributed by Aleema. 2010-10-21 20:15:49 -04:00
Tom Rothamel 6d9c4dc6d9 Preserve statement names over more changes. 2010-10-21 19:47:21 -04:00
Tom Rothamel ce94a1360a Fixed a problem that prevented AnimatedValue from functioning properly
when delay was not 1.0. Thanks to Scout for the fix.
2010-10-20 01:09:56 -04:00
Tom Rothamel 27a61f4faf Proofreading by Doomfest. 2010-10-20 00:57:07 -04:00
Tom Rothamel 36f50a482b Deallocate movie surface when a movie is not playing, to prevent the last frame of the previous movie. 2010-10-20 00:47:10 -04:00
Tom Rothamel 28d681b29b Change movie drawing so that we use swscale to convert to RGB, rather
than the SDL stuff. The SDL was broken when video resize was used.
2010-10-20 00:38:32 -04:00
Tom Rothamel ddb53bfce1 Fixed :lpbug:661983, which caused insensitive hotspots to default to
the idle, rather than ground, image when no insensitive image was
supplied.
2010-10-17 02:02:33 -04:00
Tom Rothamel 81414254f9 The maximum default physical size of the Ren'Py window is now 102
pixels smaller than the height of the screen.
2010-10-16 23:33:14 -04:00
Tom Rothamel 4af4481a17 Fixed launchpad bug 647686, a regression that prevented sounds from looping properly.
Added lpbug documentation reference.
2010-10-16 19:06:28 -04:00
Tom Rothamel 1e6e0f0800 Fix spritemanager when st=0, add destroy_all method. 2010-10-11 18:20:48 -04:00
Tom Rothamel f1cff045e1 Better handle the overloading of Return(). 2010-10-09 18:13:11 -04:00
Tom Rothamel b3b3c55473 Factor environments and RTTs out into their own files, so we don't have
to compile them for Android.
2010-10-09 13:50:34 -04:00
Tom Rothamel 7f2c6fd977 Fix software rendering. 2010-10-09 13:22:10 -04:00
Tom Rothamel 59338d3ae3 Eliminate the use of the tegl and pysdlgl modules. 2010-10-09 12:41:55 -04:00
Tom Rothamel 98a5647f97 Convert glenviron and glshader to use GL directly. 2010-10-09 11:26:41 -04:00
Tom Rothamel 5d11642776 Convert gldraw and gltexture to use GL directly. 2010-10-09 10:52:11 -04:00
Tom Rothamel 297277451f Use the TEGL infrastructure to auto-generate gl.pxd. (The result is
checked in for convenience's sake.)
2010-10-09 02:37:12 -04:00
Tom Rothamel d5ec269811 Rewrite Particles in terms of SpriteManager. 2010-10-09 00:25:58 -04:00
Tom Rothamel 02bbe29ccb Finished sprite manager.
Expose python objects in store.
2010-10-08 18:48:39 -04:00
Tom Rothamel 3844ace955 New SpriteManager. 2010-10-08 01:04:20 -04:00
Tom Rothamel 3715a03598 Checkpoint. 2010-10-06 00:25:07 -04:00
Tom Rothamel 82c695a199 make buildable 2010-10-05 23:09:11 -04:00
Tom Rothamel 09ff58a1a6 Add a gc-based to checking for memory leakes in Renders. 2010-10-05 22:58:53 -04:00
Tom Rothamel 0fbe522235 More speedup of transform_render. 2010-10-03 23:57:21 -04:00
Tom Rothamel cc38b5e5c3 Add missing files. 2010-10-03 23:09:32 -04:00
Tom Rothamel c6101f5565 More improvements. 2010-10-03 23:09:18 -04:00
Tom Rothamel f4e50ae4d8 Add config.imagereference_respects_position. When set to False, ImageReference
ignores positions in its styles - much faster.
2010-10-03 18:21:37 -04:00
Tom Rothamel 3f42edbb08 Add some types to draw_render_textures. 2010-10-03 18:04:18 -04:00
Tom Rothamel c63ff665b2 Checkpointing work. 2010-10-03 17:06:23 -04:00
Tom Rothamel 230ef6d4ca Add pxds. 2010-10-02 20:52:43 -04:00
Tom Rothamel 9d1783f4d6 Checkpoint progress. 2010-10-02 20:52:23 -04:00
Tom Rothamel 99d14d9521 Improve the speed of the render function. 2010-10-02 15:30:24 -04:00
Tom Rothamel 57ed7e692e Annotate render fields, implement mark-sweep render gc. 2010-10-02 14:40:43 -04:00
Tom Rothamel 6aaf974049 Make sure everything can build with the latest cython, and remove
cython-generated code from the tree.
2010-09-27 23:03:17 -04:00
Tom Rothamel 1fce0f5557 Add infrastructure for automatically building and loading cython
Ren'Py modules, when they change.
2010-09-27 22:38:12 -04:00
Tom Rothamel f75f0ccb14 Allow the default property to be set in the screen language. 2010-09-16 08:31:39 -04:00
Tom Rothamel 01f82aaf4c Bump version. 2010-09-15 23:37:44 -04:00
Tom Rothamel 8b294e05ad Fix problem where if you hit quit, no at the main menu, the game starts. 2010-09-15 23:34:14 -04:00
Tom Rothamel 5b2fcb85e5 Fixed character not respecting the interact argument. 2010-09-15 22:34:29 -04:00
Tom Rothamel fb1d38dc3a Enter the with mode on with None. 2010-09-14 23:18:08 -04:00
Tom Rothamel 5cc6a8d75a Ensure that empty strings render with 0 width. 2010-09-13 23:22:58 -04:00
Tom Rothamel fbe2a03933 Normalize file line endings during updates. 2010-09-13 21:04:48 -04:00
Tom Rothamel 915bccf099 Fixed problem with modes (reported with patch by Spiky Catapillar.) 2010-09-12 23:52:08 -04:00
Tom Rothamel 0943e368e7 Fix mode to work with nvl and extend. 2010-09-12 23:48:39 -04:00
Tom Rothamel d35c6e190c Fix docs. 2010-09-09 11:37:34 -04:00
Tom Rothamel 1025ad5a6a Reduce size of updates. 2010-09-09 11:23:42 -04:00
Tom Rothamel fd74541318 Check that sayer is valid. 2010-09-09 11:23:24 -04:00
Tom Rothamel 821db477ae Update default enter/leave factories to work with offsets. 2010-09-09 10:06:40 -04:00
Tom Rothamel ed66034930 Fix bug that caused atl revolution not to work. 2010-09-09 09:58:30 -04:00
Tom Rothamel a9c91378fd Another version bump. 2010-09-08 22:17:48 -04:00
Tom Rothamel 1dc58f2ed1 Add AlphaDissolve to the tutorial. 2010-09-08 09:36:56 -04:00
Tom Rothamel ae916e2a59 More updater work. 2010-09-07 22:17:31 -04:00
Tom Rothamel f3af72e67e Properly notify on update events. 2010-09-07 21:52:45 -04:00
Tom Rothamel 939c2121b7 Fixes to updater. 2010-09-07 21:41:02 -04:00
Tom Rothamel 46699bfc1e Update copyright, and bump versions. 2010-09-07 21:19:54 -04:00
Tom Rothamel 63d381d5a6 FieldValues with max_is_zero set to True now work properly. Thanks to
SleepKirby for the fix.
2010-09-07 08:13:30 -04:00
Tom Rothamel c608d18684 Update distribution building to reflect new Windows layout. 2010-09-07 00:05:11 -04:00
Tom Rothamel c31f61e7b6 Integrate updater support w/ launcher. 2010-09-06 23:45:41 -04:00
Tom Rothamel 9912c15c04 Don't consider hidden screens when assigning default focus. 2010-09-06 14:19:07 -04:00
Tom Rothamel 651653593c Make MoveTransition respect offsets. 2010-09-06 12:52:29 -04:00
Tom Rothamel 85858974b8 Add urllib to dependencies. 2010-09-05 23:48:52 -04:00
Tom Rothamel a265fbb797 Fix problem with screen language lines numbers being in error. 2010-09-05 23:26:24 -04:00
Tom Rothamel e353ea2d56 Don't crash when compiling shaders. 2010-09-05 22:54:00 -04:00
Tom Rothamel 6f91db067a Fix a bug with hotbars not working.
Fix a bug caused by an incorrect texture unit check.
2010-09-05 18:32:49 -04:00
Tom Rothamel 8ed51cc810 Add renpy.notify and Notify. 2010-09-04 17:25:59 -04:00
Tom Rothamel f256f174f9 The new :func:HideInterface action allows the interface to
temporarily be hidden, as a screen language action.
2010-09-04 15:59:30 -04:00
Tom Rothamel 49d3796378 Added the :ref:renpy.focus_coordinates function, which returns the
coordinates of the currently focused displayable, when possible.
2010-09-04 15:46:30 -04:00
Tom Rothamel bfb6a18527 The new :ref:modes system allows one to invoke callbacks when
switching from one type of interaction to another. This can be used,
for example, to automatically hide the window before transitions.
2010-09-04 12:30:21 -04:00
Tom Rothamel 2960220a74 Improvements to updater. 2010-09-03 22:52:10 -04:00
Tom Rothamel c6605f1742 Add experimental update code. 2010-09-03 18:17:48 -04:00
Tom Rothamel cebffcfee1 Imagemaps created using the screen language now only have a size equal
to that of their ground image. (Previously, they took up the entire
screen.) This change makes it easier to position an imagemap at a
different location on screen, such as the bottom.

Imagemaps now take an alpha argument. If true (the default), hotspots
are only focused if the mouse is over a non-transparent part of the
idle or hover image. If set to false, the hotspot is focused whenever
the mouse is within its boundaries.
2010-09-03 17:42:46 -04:00
Tom Rothamel 006cdb8c3b The developer menu now includes a command that will list all the files
in the game directory.
2010-09-02 01:08:18 -04:00
Tom Rothamel 374e0697bf Fix documentation generation from curried functions. 2010-09-02 00:48:57 -04:00
Tom Rothamel f988878424 Transforms no longer cause a divide by zero exception when the zoom,
xzoom, or yzoom properties are 0.
2010-09-02 00:02:46 -04:00
Tom Rothamel e59b252dce Fix problems with scaling (and especially, switching back and forth
between GL and scaled SW modes.)
2010-08-31 16:36:00 -04:00
Tom Rothamel b2747914d8 Fix hotspot so that it properly handles insensitive and selected images. 2010-08-28 18:47:15 -04:00
Tom Rothamel 41aeb625f3 Try to fix backwards compatibility problem. 2010-08-24 21:55:20 -04:00
Tom Rothamel 4cfa8aa06c Document AlphaDissolve. 2010-08-24 21:51:42 -04:00
Tom Rothamel 8cb4a4e3b9 Merge alphadissolve. 2010-08-24 21:46:58 -04:00
Tom Rothamel 9a84c9715f Use 256 as the parameter - allows alphablend to use the full 8 bits of alpha
range.
2010-08-24 21:17:52 -04:00
Tom Rothamel 38538f1d9a Add AlphaBlend. 2010-08-24 02:33:29 -04:00
Tom Rothamel 6a42b2a107 Initial implementation of AlphaDissolve transition. 2010-08-24 02:20:38 -04:00
Tom Rothamel 486790b810 merge w/ renpy 2010-08-22 16:11:15 -04:00
Tom Rothamel 0e538e2261 Remove obsolete files.
Remove symlinks in documentation.
2010-08-22 16:08:03 -04:00
Tom Rothamel 9042fcca55 Redo the windows build process, so that no symlinks are involved, and so
that dlls are no longer bundled inside renpy.code.
2010-08-22 15:53:55 -04:00
Tom Rothamel 040035adbc Allow keymap to take a list of actions. 2010-08-21 11:58:32 -04:00
Tom Rothamel d72097de18 add comment 2010-08-19 13:23:27 -04:00
Tom Rothamel d9771bdade Draw mouse cursor in right place. 2010-08-19 13:01:20 -04:00
Tom Rothamel 07ca905373 Fix the parameters for define_screen. 2010-08-19 08:48:58 -04:00
Tom Rothamel ccd0d45a67 A sub-render should inherit alpha from the parent render. 2010-08-18 19:54:59 -04:00
Tom Rothamel 15a15870e7 Start of new updater code. 2010-08-18 18:11:09 -04:00
Tom Rothamel 28108c7796 Remove launcher1. 2010-08-18 12:30:05 -04:00
Tom Rothamel 171f388120 6.11.0k 2010-08-17 21:19:01 -04:00
Tom Rothamel bc50f171db Add transition parameters to Show and Hide. 2010-08-17 01:08:10 -04:00
Tom Rothamel ea4c955f1f Modal and zorder are now expressions. Note that this changes the signature to define_screen. 2010-08-16 02:22:54 -04:00
Tom Rothamel 27524457d0 Copy a screen when keeping it around after a hide, rather than modifying the original screen. 2010-08-16 01:53:51 -04:00
Tom Rothamel 01fe67cfa9 Fix problems with screens caused by renpy.transition being given None as an argument, by making it handle that case properly, rather than simply delegating to with_none. 2010-08-15 21:46:21 -04:00
Tom Rothamel f4d493465d Fix problem with iterating over a list that's changing. 2010-08-15 19:15:32 -04:00
Tom Rothamel 33cbe44390 Only call _hide on direct children of the screen. 2010-08-15 02:53:41 -04:00
Tom Rothamel 5214f08d1a Assign ids to displayables correctly.
Remove non-transitions from screens at hide-time.x
2010-08-15 01:50:46 -04:00
Tom Rothamel 608fc986c4 Now can hide screens by name and tag. 2010-08-15 00:39:01 -04:00
Tom Rothamel 779a96f97f Things in a screen without an on hide method go away once hidden. 2010-08-15 00:32:53 -04:00
Tom Rothamel faf48246d7 Don't let a hiding displayable pass along focus. 2010-08-14 20:10:10 -04:00
Tom Rothamel 81ec2a6c35 fix modal when hiding. 2010-08-14 19:12:56 -04:00
Tom Rothamel 803423f12b Was over-aggressive in combining screen and old_transfers - split them. 2010-08-14 17:17:11 -04:00
Tom Rothamel b384ee0381 Make the gl-test strings translatable. Bump version. 2010-08-14 13:29:41 -04:00
Tom Rothamel b8862d6b24 Add support for a "Graphics Acceleration" menu, which allows the user
to choose between software and opengl rendering.
2010-08-13 00:50:48 -04:00
Tom Rothamel dbfa4ed46d Fix problem where displayables on a screen of one name could inherit transforms and state from displayables on a screen of a different name. 2010-08-13 00:38:43 -04:00
Tom Rothamel d9eb999775 Report when a grid is overfull. 2010-08-11 16:30:43 -04:00
Tom Rothamel b4a9ca3f87 Tweaks to gltest.
FilePageNext grows a max argument.

Report screen errors better.
2010-08-11 16:25:31 -04:00
Tom Rothamel d087c86d1a Set correct variable when setting default afm time. 2010-08-10 22:08:14 -04:00
Tom Rothamel 0cfc7b25a6 Remove imagemap rectangle from the image picker. 2010-08-10 00:35:50 -04:00
Tom Rothamel 8f3c9bd2ba Cycle through OpenGL logfile. 2010-08-09 23:19:55 -04:00
Tom Rothamel 91c79cdac9 sl: add default statement. 2010-08-09 21:42:49 -04:00
Tom Rothamel 20e4e110ce Add a check for calling ui.interact inside itself. 2010-08-09 18:57:12 -04:00
Tom Rothamel 870d7ffe2c Try the opengl test twice. 2010-08-09 16:29:10 -04:00
Tom Rothamel 6ff88c914d Fix use of modal in docs. 2010-08-08 22:46:59 -04:00
Tom Rothamel 2a2078517f Only don't transition when failing to go to the game menu from the main
menu.
2010-08-08 22:33:27 -04:00
Tom Rothamel c09f697293 6.11.0i 2010-08-08 20:20:20 -04:00
Tom Rothamel a9e273a13d Document modal more precisely. 2010-08-07 14:53:50 -04:00
Tom Rothamel 592665aa9a Various fixes to cause modal displayables to work better. 2010-08-07 14:43:13 -04:00
Tom Rothamel 3745788f06 Store the OpenGL-giveup value on startup, and use it on a restart. 2010-08-07 10:59:18 -04:00
Tom Rothamel 52b09d8f4c Fix problems with y aspect ratio. 2010-08-07 10:47:22 -04:00
Tom Rothamel 32f25cdcec Fix problem with lint_play_sound. 2010-08-07 09:06:41 -04:00
Tom Rothamel 6f022a9b6a 6.11.0h 2010-08-07 08:52:31 -04:00
Tom Rothamel eea6970929 (doc) Clarify that the hide event isn't called on scene or context exit. 2010-08-07 07:59:41 -04:00
Tom Rothamel 35ecfd279f Tweak when we run the hide event. 2010-08-07 07:52:49 -04:00
Tom Rothamel 1f5c610843 Better logic before picking between adv and nvl windows. 2010-08-07 00:30:52 -04:00
Tom Rothamel 05f4c52c33 Always render to an alpha texture, for dissolve/imagedissolve in sw mode. 2010-08-06 12:27:54 -04:00
Tom Rothamel 326f773e75 Constrain drawing area using glViewport. 2010-08-06 02:08:03 -04:00
Tom Rothamel 2079b518a2 F11 now toggles fullscreen. 2010-08-04 01:15:20 -04:00
Tom Rothamel 70ed15e5ac Add If function. 2010-08-04 00:59:09 -04:00
Tom Rothamel f1d7fe0c73 Rename group -> style_group. 2010-08-03 22:59:53 -04:00
Tom Rothamel 08e4b9bafc Minor optimizations in GL code. 2010-08-03 22:22:01 -04:00
Tom Rothamel 56a0212316 Fix problem with mouse, when going fullscreen. 2010-08-03 22:17:09 -04:00
Tom Rothamel 5df6506191 Take file_prefix and file_suffix into account for lint. 2010-08-02 23:36:10 -04:00
Tom Rothamel 39779be980 Fix problems with lint and call. Humanize lint output. 2010-08-02 18:22:13 -04:00
Tom Rothamel bdacdddf14 Fix crash with shift+Y and generated styles. 2010-08-02 17:59:40 -04:00
Tom Rothamel 4b32337ef3 Command the mouse to be displayed once a second. 2010-08-02 17:58:01 -04:00
Tom Rothamel 4897d5b7a9 Ensure Ren'Py starts when the GL modules can't be loaded. 2010-08-02 12:29:58 -04:00
Tom Rothamel 6daa64facd Store and restore the windows size on a shift+R reload. 2010-08-02 12:19:31 -04:00
Tom Rothamel 07651e414d Ensure we always check for yesno_prompt. 2010-08-01 21:33:29 -04:00
Tom Rothamel 7e1e76f0d8 When loading textures, load the borders with adjacent pixels, rather than
transparency. This means we no longer have to distort textures when
upscaling, which improves quality.
2010-08-01 13:47:05 -04:00
Tom Rothamel b91a5d1a16 Check in keywords file. 2010-07-31 23:19:39 -04:00
Tom Rothamel 39b0646f24 Change around some things involving clip planes to try to fix a
problem with them on the mac.

6.11.0g
2010-07-31 21:08:58 -04:00
Tom Rothamel ea6406f144 When upscaling, adjust texture coordinates so that we never go outside
the loaded texture.
2010-07-31 13:30:23 -04:00
Tom Rothamel 7ed3f3fbad Add the quickstart to the manual. 2010-07-30 13:16:50 -04:00
Tom Rothamel cacb4ac40e Allow {fast} to work in menus and all-at-once mode. 2010-07-28 23:27:52 -04:00
Tom Rothamel 9503744631 Unbranding error messages. 2010-07-28 22:45:00 -04:00
Tom Rothamel 58dfd5dbfa Document focus, and use it to ensure that menus do not have any choice highlighted by default. 2010-07-28 22:40:48 -04:00
Tom Rothamel 60d5507184 Only call unhovered when a non-default unhover occurs. 2010-07-28 22:34:39 -04:00
Tom Rothamel 5641cec146 Give a proper error when someone tries to use an empty string as a displayable. 2010-07-28 22:32:51 -04:00
Tom Rothamel dd455e3d14 Fix problems with window hide / window show and NVL-mode. 2010-07-28 21:55:16 -04:00
Tom Rothamel 6876697f74 Fixed proble with default focus and subsurface. 2010-07-25 23:15:40 -04:00
Tom Rothamel 4373cab8cf 6.11.0f 2010-07-25 20:10:01 -04:00
Tom Rothamel eeccb5833b Doc fixes, remove AutoForward as an independent action. 2010-07-25 20:07:22 -04:00
Tom Rothamel 790dad0330 Fix / document screens. 2010-07-25 19:58:48 -04:00
Tom Rothamel 078a38af5d Pass transform events through to children of Transforms. 2010-07-25 13:55:44 -04:00
Tom Rothamel 8c186d2eb1 Remove extraneous print. 2010-07-25 13:40:04 -04:00
Tom Rothamel 81b94b27e0 Display problems documentation.
Limit display to screen size.
2010-07-25 01:15:20 -04:00
Tom Rothamel 17e8616e8c Do not buffer playback of movies.
Change get_playing to return audio that's queued up to play, as well as audio that's currently playing.
2010-07-24 16:44:39 -04:00
Tom Rothamel 50b0dc3c5e Add the ability to blacklist mugen's video card. 2010-07-24 13:24:49 -04:00
Tom Rothamel 9e217e722f Introduce StoreProxy object. 2010-07-24 11:41:22 -04:00
Tom Rothamel f466b44b66 Fix problem with negative line_spacing. 2010-07-23 02:32:31 -04:00
Tom Rothamel 34e0fc7cba Always take screenshots from the main thread. 2010-07-23 01:53:39 -04:00
Tom Rothamel bb88a7bb95 Remove letterboxing when taking a screenshot. 2010-07-23 01:14:06 -04:00
Tom Rothamel 71ba444e62 6.11.0e. 2010-07-18 10:39:09 -04:00
Tom Rothamel 3e0baee463 Update documentation. 2010-07-17 22:44:53 -04:00
Tom Rothamel a0064f5511 Disable OpenGL in launcher. 2010-07-17 22:37:01 -04:00
Tom Rothamel e7ce23f377 Fix potential video race. 2010-07-17 22:35:11 -04:00
Tom Rothamel 9c6d93968c Stop defining default in terms of other transforms, to allow those
transforms to be re-defined.
2010-07-17 22:00:21 -04:00
Tom Rothamel e4b29d58f4 Include indentation in text size. 2010-07-17 17:38:44 -04:00
Tom Rothamel a48b87a0d6 Fixed a bug that could cause ATL transforms to over-compute changes,
this leading to problems when used in parallel
2010-07-17 16:17:26 -04:00
Tom Rothamel 763515a937 Add GL Performance test. 2010-07-17 14:02:00 -04:00
Tom Rothamel 46a8242e51 Make sure that lexer revert also reverts the line. 2010-07-17 12:59:18 -04:00
Tom Rothamel efa8d66d3d Make placement of developer menu more friendly. 2010-07-15 23:28:37 -04:00
Tom Rothamel b7c71bb3b8 Work better with broken fonts. 2010-07-15 22:36:05 -04:00
Tom Rothamel aca5438b5a Use shift to disable OpenGL. Add deinit to swdraw. 2010-07-15 17:15:54 -04:00
Tom Rothamel e7eb23ab5e Create layout.yesno_screen function.
Doc update.

Bump to 6.11.0d.
2010-07-14 21:47:46 -04:00
Tom Rothamel 05dd8bfcc7 Use "screen" as the screen type and mouse for screens. 2010-07-14 20:39:30 -04:00
Tom Rothamel 2c299ab079 Share code between fullscreen and displayable versions of video playback. 2010-07-14 19:00:33 -04:00
Tom Rothamel 62acff5c75 CTRL on startup aborts OpenGL mode. 2010-07-14 01:22:40 -04:00
Tom Rothamel 316d146893 Make imagedissolve use the correct texture units. 2010-07-13 22:28:41 -04:00
Tom Rothamel e69fee2108 Auto-vivification of styles.
New styles.
2010-07-13 01:09:14 -04:00
Tom Rothamel 8fe6e1cf20 Add group argument to ui functions. 2010-07-13 00:27:48 -04:00
Tom Rothamel 6fcf7dbbba Blacklist Mesa Indirect GLX renderer. 2010-07-12 21:13:32 -04:00
Tom Rothamel f55c5f0ce5 Make screen language automatically prefix unicode-containing strings with u"" - like we do for other strings. 2010-07-12 20:42:32 -04:00
Tom Rothamel aaf8369421 Deallocate textures on shutdown. 2010-07-12 20:40:41 -04:00
Tom Rothamel 8e26c7730c Finish has rename.
Fix bugs with screens.
2010-07-11 22:46:19 -04:00
Tom Rothamel 556ca0611a Add has statement. 2010-07-11 17:25:46 -04:00
Tom Rothamel e2e78c175b Tweak the parser so that it recognizes \$ as a word unto itself. 2010-07-11 15:14:44 -04:00
Tom Rothamel 7b8033e6b2 A reference loop was preventing the weakref-based way of dealing with
PyCode from working. So instead, manually control when PyCodes are
recorded.
2010-07-11 13:04:44 -04:00
Tom Rothamel d602645fee Use button_text rather than default as the default button text style. 2010-07-11 11:57:06 -04:00
Tom Rothamel f8ac9c9e83 Bump version to 6.11.0c. 2010-07-10 16:06:22 -04:00
Tom Rothamel 98c90f8ab3 Shutdown trace.
Restrict minimum window size to 256x256.

Ensure window caption and icon are set when reiniting pygame.
2010-07-10 16:03:54 -04:00
Tom Rothamel 16bb21ee62 Always have an auto-forward length of 1. 2010-07-10 13:44:00 -04:00
Tom Rothamel 46bfec93d4 Set the window caption and icon whenenver we reinit the display. 2010-07-10 13:42:38 -04:00
Tom Rothamel 00e1ecf37d Fix DBZ protection. 2010-07-10 11:45:41 -04:00
Tom Rothamel a3e7b290fb Make references to PyCode weak, so that they are not compiled if they
do not live into the final game script.
2010-07-09 01:35:40 -04:00
Tom Rothamel 27ce59963f Document ui.detached, and make it work in an init block. 2010-07-09 01:02:10 -04:00
Tom Rothamel 54e3a97447 Play test sounds on the "sound" channel. 2010-07-09 00:36:41 -04:00
Tom Rothamel f886f710b7 Make video transient.
Fix most problems with ui.textbutton.
2010-07-09 00:06:30 -04:00
Tom Rothamel a895e1dc6c Always use copy RTT.
Deinitialize pygame on shutdown, and log that deinit, so we can notice where a crash there occurs.
2010-07-08 23:22:27 -04:00
Tom Rothamel 6f24d8eebd 6.11.0b 2010-07-07 19:40:03 -04:00
Tom Rothamel 000174c2c4 Implement renpy.get_renderer_info.
Change RENPY_DRAW -> RENPY_RENDERER.
2010-07-07 14:19:53 -04:00
Tom Rothamel 192aaea186 Make a click while AFM is enabled disable AFM. 2010-07-07 14:01:20 -04:00
Tom Rothamel eb0d6b696e Adds label and ui.label. 2010-07-07 02:42:40 -04:00
Tom Rothamel 94e1b0eb56 Update gl-screen when soft mouse moves. 2010-07-07 02:05:48 -04:00
Tom Rothamel 694a1cd6d5 Ensure we always project the mouse location into virtual coordinates. 2010-07-07 01:26:40 -04:00
Tom Rothamel 0600897a26 Check the number of texture units, and give up on OpenGL if less than 4. 2010-07-06 22:32:14 -04:00
Tom Rothamel e8c52f9417 Disable texture units w/o a texture bound to them. 2010-07-06 22:19:49 -04:00
Tom Rothamel 6d86963b1d Restart the video system when switching from GL to SW rendering. 2010-07-06 21:35:40 -04:00
Tom Rothamel 01e621067a Fix spelling error. 2010-07-06 12:11:03 -04:00
Tom Rothamel cd379ef1a3 Fix aspect ratio problem. 2010-07-06 11:07:20 -04:00
Tom Rothamel 41a4fbfb4d Rewrite icon changing to use the standard PEfile library.
Fix other bugs found through testing.
2010-07-05 22:25:48 -04:00
Tom Rothamel 04db2112c3 Rewrote Character and Text so that text is only parsed once. 2010-07-04 23:40:38 -04:00
Tom Rothamel d20bfb18bc Handle syntax errors in screen language code. 2010-07-04 16:44:20 -04:00
Tom Rothamel d02d83f896 Try to ensure that runtime errors in screen language code are
reported at the right location.
2010-07-04 02:25:31 -04:00
Tom Rothamel 6b45c92a58 Rewrite screenlang.py so that it generates and compiles python code
directly.
2010-07-03 13:58:25 -04:00
Tom Rothamel 871ad8c07f Ensure the screen reflects the end of a pause before the pause finishes.
Actually limit gl framerate.
2010-06-30 01:14:13 -04:00
Tom Rothamel 997290cd28 Work on improving screen speed. 2010-06-30 00:30:20 -04:00
Tom Rothamel fcfab5ada6 spelling fix 2010-06-29 02:23:13 -04:00
Tom Rothamel 005f45bad3 Stop Popen.__del__ from throwing errors on shutdown. 2010-06-28 23:48:46 -04:00
Tom Rothamel ef64872af5 Set the projects directory to None if it no longer exists. 2010-06-27 23:15:58 -04:00
Tom Rothamel 2cd5528df9 Take the condition parameter to Characters into account when scrying to
determine if the statement interacts.
2010-06-27 22:44:45 -04:00
Tom Rothamel 0a73e6f905 Stop sounds and movies on a rollback event. 2010-06-27 22:04:46 -04:00
Tom Rothamel b9f468e3f4 Update the license.
Fix a bar regression.

Ensure that slow_done always triggers, and the ctc indicator is always shown. (Fixes lp:520276)
2010-06-27 21:01:47 -04:00
Tom Rothamel ad5631ffc1 Fix bug 595532 - wrong text in tutorial game. 2010-06-27 18:40:25 -04:00
Tom Rothamel 50767c211a Sphinx style and indexing tweaks. 2010-06-27 18:11:44 -04:00
Tom Rothamel 8223545b72 Add sphinx ATL documentation. 2010-06-27 16:55:28 -04:00
Tom Rothamel 9925fa78e7 More documentation work. 2010-06-27 12:38:48 -04:00
Tom Rothamel 7834365803 Adding various changelogs. 2010-06-27 11:16:45 -04:00
Tom Rothamel 5bfeea6e30 Finish style documentation (for now at least). 2010-06-27 10:28:09 -04:00
Tom Rothamel 1877fcfe65 Link style lists from screens. 2010-06-27 02:23:36 -04:00
Tom Rothamel 98437bc207 Adding styles documentation. 2010-06-27 02:04:56 -04:00
Tom Rothamel 49e9560e91 Rename docs a bit more.
Add dlls to distribute.py files.
2010-06-25 01:56:09 -04:00
Tom Rothamel 9c5084ef14 Move doc directory.
Add automatic keyword generation support to examples.rpy.
2010-06-25 00:32:50 -04:00
Tom Rothamel 401c503c91 Mark the newest save file as selected.
Fix a problem with buttons showing up as insensitive during a transition.
2010-06-24 23:31:36 -04:00
Tom Rothamel 73d4515f9e Fix SaveMenu. 2010-06-24 22:09:13 -04:00
Tom Rothamel 9faadbd077 Fix tutorial game ATL.
Add renpy.list_files.
2010-06-24 21:05:32 -04:00
Tom Rothamel c886f16308 Change tutorial to deal with new Transform semantics.
Change DynamicDisplayable to be sure we can always get_position.
2010-06-24 11:01:10 -04:00
Tom Rothamel 6b4b410708 Ensure that we don't fail to set a transform's pos and anchor because
we're setting it to the old default value.
2010-06-24 08:46:51 -04:00
Tom Rothamel d6e50d840f pos and anchor are now considered part of the execution state of a
transform.
2010-06-24 01:26:59 -04:00
Tom Rothamel c1848159a9 The new LiveTile displayable tiles its child, without consuming a
large amount of memory to do so.
2010-06-23 23:49:36 -04:00
Tom Rothamel 46f503ec3c Wait until the adjustment is done being created before setting the
focusable property on a bar.
2010-06-23 22:05:05 -04:00
Tom Rothamel 71f40a33f7 Add the language basics document. 2010-06-23 21:05:33 -04:00
Tom Rothamel 94e789efde More windows distribution fixes. 2010-06-23 19:02:36 -04:00
Tom Rothamel d738da4272 Update build_exe and pefile to support python 2.6. 2010-06-23 18:52:38 -04:00
Tom Rothamel 8bbf9cb618 Update modules to build on Windows.
Read the surface masks out of a surface.
2010-06-23 15:49:35 -04:00
Tom Rothamel c5276e5073 Use a screen for the tutorial game tutorials menu.
Document viewport, add XScrollValue and YScrollValue.
2010-06-21 20:34:13 -04:00
Tom Rothamel 9b0a739872 Make bar actually respect a supplied style. 2010-06-20 22:55:54 -04:00
Tom Rothamel b3e817e1d4 Make subsurfaces depend on a surface. Fixes render leak bug. 2010-06-20 21:19:25 -04:00
Tom Rothamel 96a73712eb Try fixing a bug with masks on Linux. 2010-06-20 20:51:35 -04:00
Tom Rothamel dc91721ca2 Add config to doc. 2010-06-20 20:47:10 -04:00
Tom Rothamel 7175bb664c Tweak doc look. 2010-06-20 01:00:28 -04:00
Tom Rothamel 2a49120ac2 Add special screens. 2010-06-18 00:49:57 -04:00
Tom Rothamel 4ef546649b Document python mode. 2010-06-17 22:44:28 -04:00
Tom Rothamel f1a77bd2b0 Fix bug with old load/saves and invalid files.
Fix bug with screens and rollback.
2010-06-17 14:13:05 -04:00
Tom Rothamel aa8b6d364b Moved button and bar specialness into the displayables, rather than
the ui functions.

Changed the _replaces method to be a replaces constructor parameter.

Make the periodic method take st.

Add a periodic method to BarValue.

Implement AnimatedValue.
2010-06-17 12:56:04 -04:00
Tom Rothamel 1245c6120e Wrote a lot of screen documentation. 2010-06-15 23:32:03 -04:00
Tom Rothamel 2995118cae Re-implement subsurface clipping, to improve performance in some cases.
Make call scene (and renpy.call_scene) participate in rollback, roll
forward, and set _return as appropriate.
2010-06-15 13:40:37 -04:00
Tom Rothamel a201418d1a Implement is_pixel_opaque. 2010-06-15 11:54:36 -04:00
Tom Rothamel 1b46904897 Modify yesno_prompt so it uses actions, rather than interacting.
Add FileTakeScreenshot.
2010-06-15 00:42:10 -04:00
Tom Rothamel 1cf6764a08 Allow an input screen. 2010-06-15 00:09:47 -04:00
Tom Rothamel 6527b4e198 Implement screens for NVL-mode. 2010-06-14 23:48:45 -04:00
Tom Rothamel fd4d01374f Implement the show screen, hide screen, and call screen user-statements. 2010-06-14 11:08:31 -04:00
Tom Rothamel c77a11382d Rewrite parsing in terms of a trie, for flexibility and speed reasons. 2010-06-14 09:47:37 -04:00
Tom Rothamel 1239153a1c The distribution code has been moved into launcher/distribute.py. This
file can be run from the command line to build distributions in shell
scripts and other automated processes.

Plug games.renpy.org when building distributions.

Change xoffset and yoffset in transforms so that they stack with that
of the child.
2010-06-13 22:46:28 -04:00
Tom Rothamel ae7152a5fc The renpy.music.register_channel method now has two additional
parameters, file_prefix and file_suffix. These are prepended and
appended to filenames provided to the registered channel,
respectively.
2010-06-13 21:24:02 -04:00
Tom Rothamel eec4eb73b5 Added the rotate_pad transform property, which controls how Transform
pads rotated displayables. When set to False, _not_ the default, it's
now possible to rotate a (100, 50) displayable by 90 degrees, and have
the result be (50, 100) in size.
2010-06-13 19:51:02 -04:00
Tom Rothamel 0ab3521005 The screen language (and ui) now allows you to write action rather
than clicked.
2010-06-13 17:44:13 -04:00
Tom Rothamel 660ef587c9 Add mute preferences, and SetDict/ToggleDict to support them.
Add InvertSelected.
2010-06-13 16:47:13 -04:00
Tom Rothamel 541dd7b3c3 Implement _replaced on various displayables (Text, Input, Timer, and Viewport).
Implement _ctc screen.
2010-06-13 15:19:53 -04:00
Tom Rothamel ca53e2f696 Implement the basic framework for _replaces, which is called when
one widget replaces another as part of a screen.
2010-06-13 11:54:10 -04:00
Tom Rothamel 80764e130f Make opengl logging flush the file on each write.
Make opengl fullscreen quit and reinit the video system, so that we
can properly read out the size of the desktop.
2010-06-11 22:46:55 -04:00
Tom Rothamel 6afd0120c1 Add the screenshot action. 2010-06-10 22:21:23 -04:00
Tom Rothamel 953be074f2 The config.screenshot_crop configuration variable controls the area of
the screen that it stored when the user presses the screenshot key.
2010-06-10 22:16:19 -04:00
Tom Rothamel 03781d24d6 Ensure that actions only run when they are sensitive.
Ensure we can have more than one yesno_prompt up at a time.

Add CallInNewContext.

Make the inspector show things on the screens layer.
2010-06-10 22:01:41 -04:00
Tom Rothamel 55d87064a8 config.game_menu_action allows one to specify an action that is run
when entering the game menu.
2010-06-10 20:54:35 -04:00
Tom Rothamel 512478b945 Allow the user to specify an action that is run when someone hits the
quit button. (The one in the upper-right corner of the screen.)
2010-06-10 20:45:18 -04:00
Tom Rothamel 1c19ca8062 Add yes/no prompting. 2010-06-10 09:22:47 -04:00
Tom Rothamel fc764b464d ui.add can now take transform properties as keyword arguments. If at least
one transform property is present, ui.add will create a transform that
wraps the displayable it's adding to the screen.
2010-06-09 08:56:54 -04:00
Tom Rothamel 945b4fc1cd Add python statement (short and long forms) to screen language.
Change include statement to use statement.
2010-06-09 08:32:22 -04:00
Tom Rothamel 902b17462e Implement loading and saving using Actions, and various improvements
to screens, screen language, and ui to make sure we can pull off a
sensible implementation.
2010-06-09 00:27:54 -04:00
Tom Rothamel 8b0b39829a Use renpy.context()._main_menu rather than main_menu; ensure the former is always set. 2010-06-08 01:35:04 -04:00
Tom Rothamel 356ca9cd1e Implement the Play, Queue, and Stop actions, which control music/sound/etc.
Add a periodic method to actions, which is called on a periodic basis
while a button has that action.
2010-06-08 01:04:05 -04:00
Tom Rothamel 634da84442 Implement yesno_prompt for Quit and MainMenu, make ShowMenu-shown
screens transient, and clear out the screens when we enter a new
context.
2010-06-08 00:20:17 -04:00
Tom Rothamel 1d109ddaee Implement the Preference action/value constructor. 2010-06-07 23:37:01 -04:00
Tom Rothamel c1f996da07 Various fixes required to allow a working SL preferences screen. 2010-06-07 02:08:18 -04:00
Tom Rothamel b14c9f8954 Change ShowMenu so that it takes a short screen name, without the
"_screen" suffix.
2010-06-07 00:55:19 -04:00
Tom Rothamel 126050b4f3 Able to display an operational imagemap screen based main menu.
Rewrote screens so they are now use single word names, with an
optional explicit tag parameter.
2010-06-07 00:09:54 -04:00
Tom Rothamel 313e417f28 The choice screen allows in-game menus to be defined using screens. 2010-06-05 23:32:54 -04:00
Tom Rothamel e98ef1025c Implement more Actions and BarValues.
Ensure the say screen still works.
2010-06-05 23:02:46 -04:00
Tom Rothamel 3729e4bc3a sl: Ensure execution errors are reported in a relevant location. 2010-06-05 16:16:13 -04:00
Tom Rothamel ac071777ad Implement BarValue. 2010-06-05 01:15:59 -04:00
Tom Rothamel 445972756d sl: add on statement. 2010-06-04 01:22:32 -04:00
Tom Rothamel 91732e7def sl: Implement the for statement. 2010-06-03 01:25:38 -04:00
Tom Rothamel 5b7e4af26c Add key, timer, and transform statements to ATL. 2010-05-29 23:24:55 -04:00
Tom Rothamel 2bb459cda5 screen: Implement support for transient screens. 2010-05-28 23:03:16 -04:00
Tom Rothamel d410c73074 screen: refactor screens into Screen and ScreenDisplayable classes. 2010-05-28 08:59:08 -04:00
Tom Rothamel da70f197fe screen, sl: add zorder parameter. 2010-05-27 23:03:33 -04:00
Tom Rothamel c18ffb28d0 Pass transform events to the children of a screen. Allow the screen to
respond to a hide event.
2010-05-27 21:56:02 -04:00
Tom Rothamel d5f17ef9f1 Events propagate to all children. 2010-05-25 23:42:54 -04:00
Tom Rothamel 79c3f426e5 sl: Add xmaximum and ymaximum to the list of properties we support. 2010-05-25 23:02:29 -04:00
Tom Rothamel b004dd138f Add code for customizing the say screen. 2010-05-25 22:47:58 -04:00
Tom Rothamel 45b479e324 sl: implement if statement.
screen: trigger a redraw on each interaction.
2010-05-23 22:50:22 -04:00
Tom Rothamel b07cbd4193 sl: add include statement. 2010-05-23 21:58:00 -04:00
Tom Rothamel ae2739f32d Hooked up the screen language to the screen system. 2010-05-23 20:43:37 -04:00
Tom Rothamel dd51fcb1fd Fix ui.at, get things going with visit. 2010-05-22 22:07:58 -04:00
Tom Rothamel edc26fe0a4 First working screens. 2010-05-22 19:16:08 -04:00
Tom Rothamel c9215b3b71 Add renpy.ui.remove_above, for use by screens. (Not sure I'll bother
publically documenting this.)

Improve documentation of Scene Lists.
2010-05-16 01:06:13 -04:00
Tom Rothamel 115338bdeb Basic initial implementation of screens.
Rewrote the scene lists. This added support for "replaced" images, but
more importantly, cleaned up the code quite a bit, by making it be in
terms of objects rather than tuples.
2010-05-15 20:24:28 -04:00
Tom Rothamel b0b10ac7d3 Add all existing ui functions to the screen language parser. 2010-05-11 23:42:51 -04:00
Tom Rothamel 5a6013aac9 Update changelog.
Tweak config.default_transform behavior so that it only applies to
non-transforms, so we better match the old behavior.

fix renpy.ui.Many to work with with.
2010-05-04 01:58:10 -04:00
Tom Rothamel f3aa299aa0 Remove obsolete files from the gl-renpy branch. 2010-05-04 01:30:19 -04:00
Tom Rothamel 8e44536133 Merge in changes from old mainline. 2010-05-04 01:27:59 -04:00
Tom Rothamel 0cb937298e Add checkmark background when the screen is left empty, with no background.
Fix backwards compatibility bugs.
2010-05-04 01:26:01 -04:00
Tom Rothamel 6ed0491520 Add hotbars. 2010-05-02 00:27:58 -04:00
Tom Rothamel af7748920c Add hotspots. 2010-05-01 22:55:51 -04:00
Tom Rothamel 3c1c0310d8 Merge in screen language changes. 2010-04-30 01:29:57 -04:00
Tom Rothamel 91a67304dd Rewrite the ui module in terms of wrapper code. 2010-04-30 01:28:37 -04:00
Tom Rothamel 04d0e46c3e Rewrite how things are added in renpy.ui. 2010-04-29 01:08:10 -04:00
Tom Rothamel ed27eac80b Added support for composite style properties, that allow several style
properties to be set using a single parameter. The new composite style
properties are:

* pos - takes a pair, and uses it to set xpos and ypos.
* anchor - takes a pair, and uses it to set xanchor and yanchor.
* align - takes a pair, and uses it to set xalign and yalign. (And
  hence xpos, ypos, xanchor, and yanchor.)
* area - take (x, y, height, width) pair, and tries to set properties
  such that the displayable will be placed inside the rectangle. This 
  sets the xpos, ypos, xanchor, yanchor, xfill, yfill, xminimum, yminimum,
  xmaximum, and ymaximum properties.
2010-04-28 01:19:45 -04:00
Tom Rothamel 1f3e02bbdc More SL parsing. 2010-04-28 00:31:02 -04:00
Tom Rothamel 275e938602 Snapshot of work on screen system. 2010-04-27 00:24:33 -04:00
Tom Rothamel 3f80320d37 The python compiler has been rewritten to use the python ast module.
This should both improve performance, and improve error handling for
python syntax.
2010-04-23 23:12:11 -04:00
Tom Rothamel 0e44ce7636 Update docs. 2010-04-23 22:06:24 -04:00
Tom Rothamel 8fe727a8a1 Start on sphinx documentation for build system. 2010-04-18 01:51:17 -04:00
Tom Rothamel b82f7a5548 Use default_transform as the main way of positioning images on the screen. 2010-04-17 12:15:27 -04:00
Tom Rothamel fe15242479 Allow the position properties to be specified independently when transforms are composed. 2010-04-17 00:44:06 -04:00
Tom Rothamel 677a9b0dab Transform (and ui.transform) have been changed so that their arguments
can now be prefixed with a style prefix. One can write
ui.transform(idle_rotate=30, hover_rotate=90) and have it work. [doc]
2010-04-13 23:57:37 -04:00
Tom Rothamel 309001e2fe Pick mask based on platform. Fixes a bug in ubuntu 10.4 beta. 2010-03-30 02:06:25 -04:00
Tom Rothamel 90e782c9c6 Actually put textures on the free-lists, so we can reuse them. 2010-03-23 00:03:15 -04:00
Tom Rothamel f95d9cacb5 Sleep to prevent swdraw from speeding up the CPU. 2010-03-17 11:34:44 -04:00
Tom Rothamel 308d1e6b00 Choose directory for opengl.txt. 2010-03-17 11:16:23 -04:00
Tom Rothamel c57b3004a0 Reset display after renpygame. 2010-03-17 11:12:11 -04:00
Tom Rothamel 00bd5c96e9 Shift-reload now works in GL mode. 2010-03-16 22:08:45 -04:00
Tom Rothamel 371b11370a Allow Ren'Py to keep working even if GL can't be loaded. 2010-03-16 10:13:49 -04:00
Tom Rothamel b9338a7446 Video support. 2010-03-16 01:54:05 -04:00
Tom Rothamel e39ae375f4 Refactor things so texture caching takes place in the draw modules, using
weak references.
2010-03-15 13:24:48 -04:00
Tom Rothamel 975907aebf Fixed spelling, thanks to ZeikJT. 2010-03-15 00:45:51 -04:00
Tom Rothamel ccfbdf6f3a Software mouse works in GL Ren'Py. 2010-03-15 00:42:55 -04:00
Tom Rothamel 7934d40b7c Refactor mouse code. 2010-03-15 00:21:45 -04:00
Tom Rothamel 3b569a10bd Implement screenshots. 2010-03-14 16:49:11 -04:00
Tom Rothamel 941d959ee5 Reinitialize OpenGL (except for various detection) each time the window
is resized. This allows us to work on Mac OS X, which can't share any 
OpenGL state through a window resize. (At least with SDL+Pygame.)
2010-03-13 21:20:13 -05:00
Tom Rothamel d5a51c8139 Implement pixellate in gl-mode. 2010-03-13 19:01:46 -05:00
Tom Rothamel fc79078d51 Implement RENPY_GL_VSYNC, which control OpenGL vertical sync. 2010-03-13 12:42:43 -05:00
Tom Rothamel d6615410dd Allow the user to resize the GL window by dragging (or hitting the maximize
button).
2010-03-13 12:34:30 -05:00
Tom Rothamel adee372b4b Always add a left border to images. 2010-03-13 02:06:25 -05:00
Tom Rothamel 9c7542a357 Track total texture size. 2010-03-12 01:17:21 -05:00
Tom Rothamel bc18285a61 Allow renpy_draw to pick between software and hardware rendering. 2010-03-12 00:46:53 -05:00
Tom Rothamel 7b6c3f52e0 Implement imageblend. 2010-03-12 00:30:15 -05:00
Tom Rothamel f95c6e479d Add an extra row and column of pixels to textures that aren't full, to
ensure we don't interpolate in junk during subpixel rendering.
2010-03-11 21:47:27 -05:00
Tom Rothamel e4e224348f Merge premultiplied textures. 2010-03-11 01:50:59 -05:00
Tom Rothamel 7e914da261 Initial writing of premultiplied textures. 2010-03-11 01:49:33 -05:00
Tom Rothamel ae3eb40a0e Code to read from FB to surface.
Fix shaders to handle alpha blending.
2010-03-10 22:19:48 -05:00
Tom Rothamel 2f8cd81870 Dissolve works (with copy RTT). FBO rtt is buggy. 2010-03-09 23:50:55 -05:00
Tom Rothamel a1e7b60dab Implement basic render-to-texture.
Implement non-aligned clipping.
2010-03-09 17:02:12 -05:00
Tom Rothamel 92515fca49 Implement aligned clipping. 2010-03-09 02:27:41 -05:00
Tom Rothamel 6a8abf2a79 Basic support for clipping using glClipPlane. 2010-03-09 01:24:52 -05:00
Tom Rothamel 9a47b02840 Allocate texture numbers in the GL thread. 2010-03-08 18:49:19 -05:00
Tom Rothamel 488c1c34cd Use the right direction for the transform. 2010-03-08 02:03:42 -05:00
Tom Rothamel 52bd7de14f First drawing via GL to the screen. 2010-03-08 01:36:36 -05:00
Tom Rothamel deb0f813ca Making progress towards getting gl-drawing working. 2010-03-07 18:46:00 -05:00
Tom Rothamel 5030513375 Rewrite the text handling to create textures. 2010-03-06 20:16:55 -05:00
Tom Rothamel 53deb04137 Rewrite im to use textures instead of surfaces directly.
Add support for textures (really just surfaces) to swdraw.

Move rle cache code into swdraw.
2010-02-28 23:01:58 -05:00
Tom Rothamel 2c60f5251f Rewrite RotoZoom in terms of Transform. 2010-02-26 14:47:33 -05:00
Tom Rothamel 64ac5a9317 Rewrote Zoom, FactorZoom, and SizeZoom in terms of Renders. 2010-02-26 01:33:10 -05:00
Tom Rothamel 607113b31c Move pixellate into swdraw. 2010-02-24 21:47:32 -05:00
Tom Rothamel 5a472ef44b Finished factoring out dissolve and imagedissolve. 2010-02-24 01:28:27 -05:00
Tom Rothamel c67ba9b4e4 Restructured dissolve and imagedissolve. 2010-02-24 01:04:11 -05:00
Tom Rothamel 3f36d3a881 get_parameterized -> _get_parameterized 2010-02-24 01:03:10 -05:00
Tom Rothamel d188618785 Sync with main branch. 2010-02-23 16:31:25 -05:00
Tom Rothamel e6827bdff8 * lp:526297 - im.Rotozoom()s crash when Ren'Py is scaled down. (Thanks to Spiky Caterpillar for the bug report and fix.)
Renamed the internal show and hide methods of Displayable, so those
names can once again be used by user-defined displayables.
2010-02-23 15:12:44 -05:00
Tom Rothamel 85ac26fb1e Move the drawing code from render.py to swdraw.py. Now, none of the
code in render.py should be software-renderer specific.
2010-02-23 01:52:33 -05:00
Tom Rothamel abea49df8e Massive restructuring of the display system. The methods in Display
were split between the new SWDraw class and Interface. The idea is to
separate the software renderer out from the common code.
2010-02-23 01:13:02 -05:00
Tom Rothamel bfc7de0d16 glcore -> gldraw 2010-02-22 22:05:35 -05:00
Tom Rothamel aa8c3ecec9 Move gl stuff into the display directory. 2010-02-22 22:02:11 -05:00
Tom Rothamel 7ab984972e Started work on glcore.py. 2010-02-22 21:55:57 -05:00
Tom Rothamel da09c4d04f Implement the subsurface operation. 2010-02-21 20:02:31 -05:00
Tom Rothamel c42457446f Implemented a shader-based GL environment. 2010-02-21 02:35:30 -05:00
Tom Rothamel 40bb6ca557 Can compile shaders. 2010-02-20 23:25:58 -05:00
Tom Rothamel f2cc5d25e8 Implement render-to-texture using EXT_framebuffer_object, with
acceptable performance on both Nvidia and 950.
2010-02-20 13:50:49 -05:00
Tom Rothamel 04a5460e8b Init rtt and environ in a function, so we don't have to wait for them. 2010-02-20 11:04:20 -05:00
Tom Rothamel 12ef8ee199 Refactor render-to-texture code into a class, so we can have an
alternative implementation of it.
2010-02-20 02:41:26 -05:00
Tom Rothamel 9c2d2f3a06 Implement render to texture.
Implement (GL 1.1) blank texture loading.

Add EXT_framebuffer_object to tegl.
2010-02-19 19:56:11 -05:00
Tom Rothamel 94bcfe5c58 Change to using BGRA textures for speed on Nvida chips.
Make work on the mac.
2010-02-18 10:41:22 -05:00
Tom Rothamel fecd13c733 Allow textures of various sizes, from 512 to 64 pixels. 2010-02-17 22:54:43 -05:00
Tom Rothamel a9a6595d43 Implemented fixed-function imageblend. Also, tweaked normal blend so
textures are taken in the right order.
2010-02-16 00:20:02 -05:00
Tom Rothamel e4e9ea4e87 Working blend operation. 2010-02-14 21:14:29 -05:00
Tom Rothamel 588682f0d2 Change the representation of texgrids to include a tile index, rather
than implying the tile index.

Work on environments continues.
2010-02-14 19:17:32 -05:00
Tom Rothamel 0b502d5530 C-accelerated the rectangle drawing code. 2010-02-13 23:53:27 -05:00
Tom Rothamel 86a2b5d4e5 Move the GL setup code into a module. 2010-02-13 20:05:12 -05:00
Tom Rothamel 312a657e78 Rename surface.py to gltexture.py 2010-02-11 20:00:32 -05:00
Tom Rothamel 6197597ec9 Can now draw a TextureGrid to the screen. 2010-02-11 19:35:19 -05:00
Tom Rothamel c3ee29a9b0 Work on loading textures. 2010-02-11 09:01:42 -05:00
Tom Rothamel d5b26aa973 Work on loading textures. 2010-02-11 08:58:36 -05:00
Tom Rothamel 5d926ad49b Build modules in module directory. 2010-02-10 00:38:44 -05:00
Tom Rothamel b5f133ce17 Have working direct transfer of SDL surface -> texture. 2010-02-09 00:32:01 -05:00
Tom Rothamel 6ee4474e5e Prevent completing a rollback from triggering an exception if
other code is updating objects that it uses.
2010-02-07 13:06:58 -05:00
Tom Rothamel d515d07110 Customized TEGL for our purposes. 2010-02-04 20:58:57 -05:00
Tom Rothamel 3d2e5124d4 Add a clean tegl. 2010-02-04 20:50:51 -05:00
Tom Rothamel 48a826a13d Fix bug that could cause last element of a MultipleTransition to show twice. 2010-02-04 16:53:57 -05:00
Tom Rothamel 64e82c2c62 Rewrote MultipleTransition (which is used by Fade) to fix some
problems it was exhibiting.
2010-02-04 15:43:21 -05:00
Tom Rothamel 9c5d4d7ad5 Do not query volume if a mixer is disabled, in the imagemap
preferences screen.
2010-01-26 20:42:17 -05:00
Tom Rothamel 5f006c8f4c Bump version. 2010-01-22 11:00:07 -05:00
Tom Rothamel 3d8b6cbecb Remove default_transform test code that got stuck in a release. 2010-01-22 10:56:36 -05:00
Tom Rothamel 7e2e123af7 Bump version, update changelog. 2010-01-21 18:53:32 -05:00
Tom Rothamel 14aa4c4e3d Do not display ctc when interact=False. 2010-01-21 18:04:22 -05:00
Tom Rothamel 2c15237b8a Implement renpy.config.default_transform, but don't make it the default yet. 2010-01-21 16:54:10 -05:00
Tom Rothamel b4845252c1 Bump version. 2010-01-20 13:03:58 -05:00
Tom Rothamel 2f513235b3 The launcher now accepts a RENPY_DEFAULT_PROJECTS_DIRECTORY, which sets
the default for the projects directory, if it has not already been set 
by the user. It also will report an error when creating a project fails,
rather than producing a traceback.
2010-01-20 11:16:55 -05:00
Tom Rothamel c68b3bae89 The new voice_replay function replays the voice played on the current
interaction. The new voice_can_replay function returns True if a voice
can be replayed.
2010-01-20 01:01:24 -05:00
Tom Rothamel 3825e88883 Properly purge images from the image cache. 2010-01-20 00:10:20 -05:00
Tom Rothamel bbe0fdb98f It's now possible to assign style properties to individual imagemap
buttons, by indexing style.imagemap_button. (So for example, one could 
assign to style.imagemap_button["Start Game"].hover_sound .)
2010-01-18 22:46:56 -05:00
Tom Rothamel 009969dab5 Can't pop from a tuple. 2010-01-18 03:04:02 -05:00
Tom Rothamel 376ac7ad81 Add a link to the Ren'Py Games List to the launcher. 2010-01-17 17:07:38 -05:00
Tom Rothamel de8257f459 Ren'Py now builds zip files in distributions 64k at a time. 2010-01-14 22:03:14 -05:00
Tom Rothamel 3b0fbcc55f Previously, it was impossible to pass an arguments list to a call
expression. Now, we allow the pass keyword to be used to distinguish 
the two, using code like:

call expression foo pass (bar, baz)
2010-01-14 12:48:54 -05:00
Tom Rothamel e33abc05fb Prevent infinite looping when iterating over an object with
__getitem__ defined.
2010-01-14 11:37:59 -05:00
Tom Rothamel 430ee03d45 Bump version to 6.10.2b. 2010-01-14 00:12:46 -05:00
Tom Rothamel 03477d1c75 Fix lp:506322 - MoveTransition wouldn't work on the overlay layer, even if explicitly specified. 2010-01-13 23:20:15 -05:00
Tom Rothamel ef9ee657f7 Add cache_unpin 2010-01-12 23:48:57 -05:00
Tom Rothamel e31f1ac63f Mark one pylint spurious warning. 2010-01-10 15:42:11 -05:00
Tom Rothamel 33a6c97446 Finalize changelog. 2010-01-10 15:37:57 -05:00
Tom Rothamel 99e9e6e9ba Bump version to 6.10.2a. 2010-01-10 15:34:31 -05:00
Tom Rothamel 1d81cede71 Unpack ScaledSurfaces before using them as a sample for an alpha channel. 2010-01-10 01:52:00 -05:00
Tom Rothamel 54ab9e0f1b Add copyright information to files that have it missing. 2010-01-09 13:25:18 -05:00
Tom Rothamel f0df9a7a05 Bump copyright to 2010. 2010-01-09 13:14:42 -05:00
Tom Rothamel adc3bf820b Fixed a bug that caused the overlay to display twice in some cases. 2010-01-05 18:07:28 -05:00
Tom Rothamel d26ac890a5 Add the ability to pin images into the cache, using the renpy.cache_pin function. 2010-01-05 02:30:39 -05:00
Tom Rothamel d0397b2111 The new config.automatic_images_strip variable can strip out prefixes
when automatically defining images.
2010-01-03 16:32:21 -05:00
Tom Rothamel 0229de3f0d The new config.menu_clear_layers variable allows layers to be cleared
when entering the game menu. This makes it easier for a layer to have 
overlay-like things on it when in the game, but not when in the game
menu.
2010-01-03 16:25:20 -05:00
Tom Rothamel 176150be7f Add renpylint script, a wrapper around pylint that gets rid of some
false positives where pylint isn't able to fully analyze Ren'Py.

Add annotations to Ren'Py to further supress false positives. The result
is that we can now run pylint and pick out regressions.
2010-01-02 02:38:07 -05:00
Tom Rothamel 04992fa431 Flag spurious pylint warnings, in the renpy/ directory. 2010-01-01 16:30:38 -05:00
Tom Rothamel b26725fd01 pylint done. 2010-01-01 15:09:36 -05:00
Tom Rothamel 601e7b1949 pylint: Initial pass through renpy directory. 2010-01-01 14:27:20 -05:00
Tom Rothamel 37c1571792 pylint: ast.py and atl.py 2010-01-01 13:30:39 -05:00
Tom Rothamel 812144bdf0 Fixed a bug that caused pixellate to crash. 2009-12-31 16:16:20 -05:00
Tom Rothamel 6e616fda4e When a music filename is unknown, remove it from the loop, so we don't keep
trying to access it.
2009-12-31 15:44:40 -05:00
Tom Rothamel 3f120ce658 Ren'Py now caches the individual words of text that are rendered. This
can lead to a speedup in text display when there are many words of
text on the screen, and that text is re-displayed, as is the case
where the text text speed is not the maximum. This is especially 
beneficial for eastasian languages, where every character is treated
as a word.
2009-12-30 16:24:18 -05:00
Tom Rothamel 5446da46dc Ren'Py now caches the individual words of text that are rendered. This
can lead to a speedup in text display when there are many words of
text on the screen, and that text is re-displayed, as is the case
where the text text speed is not the maximum. This is especially 
beneficial for eastasian languages, where every character is treated
as a word.
2009-12-30 15:41:29 -05:00
Tom Rothamel 172efcac94 Surface creation parameter was missing when creating a Frame with tile=True.
Fixes lp:501351.
2009-12-30 00:24:27 -05:00
Tom Rothamel c5ce6c0f4b Bump version. 2009-12-17 09:36:36 -05:00
Tom Rothamel 40f8644ac2 Export time from renpy.exports. 2009-12-17 09:35:34 -05:00
Tom Rothamel d45cf0d79a Bump version. 2009-12-16 19:17:18 -05:00
Tom Rothamel 68937a71b9 Add developer menu to string scanner. 2009-12-14 22:06:00 -05:00
Tom Rothamel db435f5a0a Bump version. 2009-12-14 19:06:43 -05:00
Tom Rothamel 40c469fa23 Add ctc_timedpause. 2009-12-14 19:04:10 -05:00
Tom Rothamel fe7c7e2299 Decode the tutorial properly, so international characters can be used. 2009-12-14 16:51:43 -05:00
Tom Rothamel 2f9d9f9dee Bump version numbers. 2009-12-13 11:26:44 -05:00
Tom Rothamel 293508969a The layout.imagemap_main_menu and layout.imagemap_load_save functions
now allow one to define variant screens. This allows one to select an 
imagemap main menu screen to use, or to define different screens for
loading and saving.
2009-12-13 11:05:58 -05:00
Tom Rothamel 5908546828 Ensure we get an alpha surface even if pygame hasn't been initialized.
Take the position from the transform, not something enclosing the transform.

Fix the archiver to not error out on import.
2009-12-12 23:16:59 -05:00
Tom Rothamel b80f6a1e8e Fix a bug with the last checkin. 2009-12-12 15:45:12 -05:00
Tom Rothamel d3434400cd The layout.imagemap_load_save function can now take dictionaries for
each of its arguments. This allows separate values of the arguments to
be specified for load and save.
2009-12-12 15:28:16 -05:00
Tom Rothamel 11a20e21d1 Update the font to the latest version. 2009-12-12 03:11:18 -05:00
Tom Rothamel 0de0aa292a ATL now has a "function" statement, which allows an ATL transform to
use the same functions that are supplied to Transform.
2009-12-12 01:28:41 -05:00
Tom Rothamel aa0d357bdc The transform state transfer now looks inside ImageReferences. This means
that it works when a transform is defined as part of an image, as well as
part of an at clause (or as an ATL block).

Parameterize ctc indicators.
2009-12-12 00:22:04 -05:00
Tom Rothamel ca16c24fc4 Make all of Ren'Py pyflakes-clean. 2009-12-11 01:38:28 -05:00
Tom Rothamel d32db0c9a3 Fix Pyflakes warnings. 2009-12-11 01:20:33 -05:00
Tom Rothamel 60b9f0522c Make shown_window an attribute of scene_lists. This tracks it better.
Change overlay semantics to match everything else.

Make core.py and exports.py pyflakes clean.
2009-12-11 00:39:17 -05:00
Tom Rothamel d3c58da216 Make core.py pyflakes-clean. 2009-12-10 11:31:46 -05:00
Tom Rothamel e81044465d Fix various bugs, incl lp:494820. 2009-12-10 01:01:59 -05:00
Tom Rothamel 75a0741c33 Scaling bug fixes. 2009-12-09 02:49:00 -05:00
Tom Rothamel a68f4af35d Vaguely working (not immediately crashing) rewrite of the scaling code. 2009-12-09 02:24:02 -05:00
Tom Rothamel 9e0932af5a Fix typo that prevented ui.at from working. 2009-12-07 09:58:04 -05:00
Tom Rothamel 112c0bce66 Only allow rollbacks to be committed in the top-level context. Fixes lp:493062.
Error handling improvements.

Allow ui.imagemap to take arbitrary displayables as the ground.
2009-12-06 15:30:36 -05:00
Tom Rothamel d640759ab8 Fixed a bug that prevented Ren'Py from interpolating image rotation
before image rotation was specified.
2009-12-05 17:05:14 -05:00
Tom Rothamel bb628bd9cd Make bilinear scaling precise.
Make im.Scale use the smooth scaling code. Fixes lp:488814.
2009-12-05 15:42:31 -05:00
Tom Rothamel ed3c0937d9 Check in cython-created files. 2009-12-05 13:32:26 -05:00
Tom Rothamel 48cf0cd50a Fixed a bug that caused Ren'Py to fail when scaling was enabled. 2009-12-05 03:09:56 -05:00
Tom Rothamel a39934d0c4 The image text tag can now take any textual image representation. So
something like {image=eileen happy} is legal, if odd.


Fixed a bug that could prevent files from being loaded if Ren'Py was
run from a path that contains non-ascii characters. (Even in directories
that were not part of the Ren'Py distribution.)
2009-12-05 00:38:30 -05:00
Tom Rothamel 2a9eaf9dea Fix a no-shutdown bug. 2009-12-05 00:15:07 -05:00
Tom Rothamel 0d07b4dcb6 Be sure blit lock is held. 2009-12-02 18:14:11 -05:00
Tom Rothamel 76fbce3304 Fix bug that could cause shift+R to fail when going back to a menu after a restart.
Fix bug that could prevent Ren'Py from exiting if image or auto-save threads felt like keeping us around.
2009-12-02 17:51:08 -05:00
Tom Rothamel 510eba1628 Hide deprecation warnings on Python 2.6. 2009-11-30 02:54:16 -05:00
Tom Rothamel c37fede2f1 Add precise mode for transform32.
Remove can_ tests from the module as obsolete.
2009-11-30 02:01:45 -05:00
Tom Rothamel 3ccb522e33 Replace all surface creation with calls to
renpy.display.pgrender.surface and other functions in that
module. This function creates a surface with a 1px border in
all directions. This will let us not have to worry about transform32 
overrunning the surface.
2009-11-29 16:01:42 -05:00
Tom Rothamel a067d0c830 Bump version to 6.10.0e 2009-11-16 23:20:12 -05:00
Tom Rothamel 2f82c7466d Adjust the types of ATL properties as necessary. 2009-11-16 02:22:37 -05:00
Tom Rothamel 9e9a6b7f8e Change the strategy used for cropping in Transform. The new one allows for floating pointy crop windows. 2009-11-16 02:04:41 -05:00
Tom Rothamel 9db36905c6 Fix bug that prevented ATL default parameters from working. 2009-11-15 19:29:17 -05:00
Tom Rothamel e5ae260c33 Add ATL warp construct. 2009-11-15 19:24:17 -05:00
Tom Rothamel 4e3a579eed ATL: fix bug with bare number as pause. 2009-11-15 15:44:49 -05:00
Tom Rothamel 4cd1e62978 Simplify module.py, now that we error out if the module isn't loadable.
Make it possible to build on a stock ubuntu.
2009-11-15 15:31:09 -05:00
Tom Rothamel babd95540d ATL add contains expression statement. 2009-11-15 00:51:53 -05:00
Tom Rothamel 905de15883 Clear lint error.
Bump version for release.
2009-11-14 22:14:48 -05:00
Tom Rothamel 00f31ca351 Bar style tweak, and replace missing main menu file. 2009-11-14 22:10:12 -05:00
Tom Rothamel cb82cfae3e Allow Transforms to embed Dissolve et al.
Add concert to tutorial game. Add new main menu to tutorial game.
2009-11-14 22:03:51 -05:00
Tom Rothamel 1a36f1feb7 Add show_transform to character. 2009-11-13 18:18:47 -05:00
Tom Rothamel d1893c6e17 Do not change the style prefix of a button when changing the style
prefix of a button that contains it.
2009-11-13 15:12:08 -05:00
Tom Rothamel 330ec0e68c Optimize transforms when alpha is 0.
Trim happy_alley.

Bump version to 6.10.0b.
2009-11-13 14:24:19 -05:00
Tom Rothamel 830304b79e In ATL, changed child -> contains, so as not to mask access to the child variable. 2009-11-10 23:05:07 -05:00
Tom Rothamel dc5940ac56 Ensure layer_at_list works with ATL transforms properly. 2009-11-10 22:55:12 -05:00
Tom Rothamel 437cc8784f Choose default focus when leaving a context in which at least one interaction occured. 2009-11-10 01:58:41 -05:00
Tom Rothamel 8e08e6647a Update .bzrignore 2009-11-09 21:04:11 -05:00
Tom Rothamel 60a21a7bbe Add child statement to ATL.
Allow ATL Transform to be used as transition.
2009-11-09 21:01:04 -05:00
Tom Rothamel 6251a86cfe Add new lucy art - thanks, Mugen! 2009-11-09 16:48:43 -05:00
Tom Rothamel 580ea88cd0 Make transforms take a list of declared parameters.
Fix problem where transform and define would declare a label.
2009-11-09 16:42:15 -05:00
Tom Rothamel c93734cd9c Have the caret change color when a color parameter is supplied to Input. 2009-11-08 13:55:19 -05:00
Tom Rothamel f7e2f0dd1a Fix bug that prevented styles from rebuilding. 2009-11-08 13:22:02 -05:00
Tom Rothamel 943b505ec2 Fix the version number to be 6.10.0a. 2009-11-07 19:43:01 -05:00
Tom Rothamel 75304e781a Don't let REDRAW or TIMEEVENT hold up motions.
Final tweaks for release.
2009-11-07 19:41:46 -05:00
Tom Rothamel d73326af11 Rename the bidi module.
Bump the version numbers.

Fix the demo a bit.

Fix problem in which TIMEEVENT could starve redraws.
2009-11-07 17:55:27 -05:00
Tom Rothamel 670eca455d Update strings.
Get things building on all platforms, bump library versions.
2009-11-07 02:49:07 -05:00
Tom Rothamel ab38c2e521 The freetype library has been updated, and we have added support for
the use of TrueType collections. Using a name of 0@font.ttc will get
the first font in the collection, 1@font.ttc will get the second font,
and so on.

ATL typo.
2009-11-07 00:54:53 -05:00
Tom Rothamel 1ded9b2959 Changelog updates.
Add align and anchor ATL properties, for symmetry with pos.
2009-11-06 02:12:20 -05:00
Tom Rothamel 7c67db202f Preserve the illusion of linear time in transforms. 2009-11-05 21:30:39 -05:00
Tom Rothamel ba4321956b Basically done with the tutorial game. Removed a lot of files that are
no longer used.
2009-11-05 02:50:39 -05:00
Tom Rothamel 79e4b5a2fa Finished the ATL tutorial. 2009-11-04 23:09:07 -05:00
Tom Rothamel 5b84b0507c Added a .001s sleep for frames that are framerate-limited. This should
prevent Ren'Py from consuming all CPU unless the game is CPU-bound.
2009-11-04 19:25:12 -05:00
Tom Rothamel c15d13e543 Allow LiveComposites bigger than the screen. Fixes lp:473624. 2009-11-03 21:11:50 -05:00
Tom Rothamel 3ef27787b4 Various ATL fixes. Commit ATL tutorial. Off to go vote... 2009-11-03 11:10:26 -05:00
Tom Rothamel e84e8102b6 The new config.auto_load variable allows you to specify a save file
that is automatically loaded when Ren'Py starts. For example, setting
this to "1" loads the game in save slot 1. This is intended for use by
developers, so they can easily return to a point in the game after 
restarting Ren'Py.
2009-11-02 01:53:17 -05:00
Tom Rothamel ee8d1a531a Work on the ATL demo.
Fix yet another segfault bug in transform32, this one probably having to 
do with precision of floating point numbers.
2009-11-02 01:28:47 -05:00
Tom Rothamel 2d4d1903b2 More work on the tutorial. 2009-10-31 20:10:52 -04:00
Tom Rothamel d1cc2015ac Move demo/ to tutorial/. 2009-10-31 14:47:20 -04:00
Tom Rothamel be44f0805c Minor focus behavior changes to deal with viewports better.
More work on the demo. The quickstart is now covered.
2009-10-31 14:31:19 -04:00
Tom Rothamel 612207510c Working on turning the demo game into the tutorial game. 2009-10-31 02:19:29 -04:00
Tom Rothamel c2875e4a7d More tutorial work. Finished the dialogue section. 2009-10-28 00:50:20 -04:00
Tom Rothamel b8d2433a79 Demo work.
Add basic RTL support.
2009-10-26 18:46:21 -04:00
Tom Rothamel 43cc8b425a Make _args and _kwargs dynamically scoped. This fixes a problem with
_after_load when at a label, and may also fix a problem with return 
labels being missing.
2009-10-25 02:13:50 -04:00
Tom Rothamel 7962073926 The play statement takes an if_changed modifier, which prevents a song
from being restarted if it is already playing on the channel.
2009-10-25 00:06:22 -04:00
Tom Rothamel 281a35bc66 Fix problems with imagemap load & save. 2009-10-24 23:26:31 -04:00
Tom Rothamel a4f6a18bb8 Python blocks are now compiled in a mode that allows the python "with"
statement. Container displayables now support the context manager
protocol, automatically closing at the end of a with block. (Note
that the python with statement postdates the Ren'Py with statement,
and has totally different semantics.)
2009-10-24 04:19:35 -04:00
Tom Rothamel f50adf3ed2 Add the ui.tag function. 2009-10-22 09:57:41 -04:00
Tom Rothamel f1b78b4a05 Make a copy of an ATL displayable before running a hide handler. This
allows us to roll back to before the hide handler has run.
2009-10-22 09:43:38 -04:00
Tom Rothamel 7953f8adf1 Have ATL give a parse error if it sees two expressions in a row. 2009-10-22 08:59:29 -04:00
Tom Rothamel f3062e6f22 Add ability for ATL to run an event on hide, and suppress hide until
done. (Not sure if this is totally desirable, though. It interacts with
rollback poorly.)
2009-10-22 01:37:19 -04:00
Tom Rothamel fe4eda2661 Try to ensure that loading and saving ATL works out. 2009-10-20 21:51:42 -04:00
Tom Rothamel 2be10ba84c Alias Character to Speaker. 2009-10-20 21:14:31 -04:00
Tom Rothamel 82b3d0e78e The layout.imagemap_yesno_prompt now supports a prompt_images
argument, which is can be used to specify images to replace the
text of a yes/no prompt.

Make buttons give out the role + hover status.

Allow transform to control the render size of its child.
2009-10-18 21:49:54 -04:00
Tom Rothamel 079180f4ce Changed MoveTransition to preserve the timebases of the thing being moved
in all circumstances.

Fixes lp:451464
2009-10-17 23:30:26 -04:00
Tom Rothamel 9a3369c27c The developer screen was getting a bit large, so load it from a module
only if config.developer is enabled.
2009-10-17 15:12:23 -04:00
Tom Rothamel b87e10cdcf Added the Image Location Picker to the Developer (shift+D) menu. This
tool lets the user pick an image, and then pick locations that
image. It display the mouse coordinates, imagemap rectangle, and
cropping rectangle.
2009-10-17 15:07:15 -04:00
Tom Rothamel 229c542d68 ATL: Propagate events to child as well as parent. 2009-10-17 13:40:34 -04:00
Tom Rothamel 3478d079d6 The displayable code has been adjusted to consider strings that do not
contain at least one dot as image references. Now, one can write
"eileen happy" to refer to an image with that name.

ATL: Fix Child.
2009-10-17 00:25:09 -04:00
Tom Rothamel a7fc70402e The play and queue statements now take optional loop and noloop
modifiers, which force looping (or lack of looping) on that channel.
2009-10-16 23:41:40 -04:00
Tom Rothamel 5df6419a59 Added the pause statement. 2009-10-16 23:30:52 -04:00
Tom Rothamel 8b03bc5072 The new config.automatic_images variable, when set correctly, will
cause Ren'Py to automatically define images for appropriately-named
image files found in the archives and game directory.
2009-10-16 23:22:55 -04:00
Tom Rothamel 6ca8a37cc6 The new config.window_overlay_functions variable contains a list of
functions that should be called only when once the dialogue window has
been shown.
2009-10-16 22:40:23 -04:00
Tom Rothamel 9fbf1ee1b2 Add the define statement. 2009-10-16 22:17:03 -04:00
Tom Rothamel 84b7741fa4 Rewrite transform to fix segfaulting. Eliminate most fixed-point arithmetic.
Add to ATL corner1, corner2.
2009-10-16 03:41:42 -04:00
Tom Rothamel e6efaa5f9f Add ability of ATLTransform to take events from its child, and for
button to generate ATL events.

Fix focusing the child of an ATL displayable.
2009-10-16 01:19:13 -04:00
Tom Rothamel 330c2e247e Allow rotation of clipped render. 2009-10-15 11:35:48 -04:00
Tom Rothamel 923f56273c Add to ATL support for spline interpolation. 2009-10-14 01:33:44 -04:00
Tom Rothamel 8b761aa689 Update icon to 7-ready one.
Minor fix to ATLTransform.
2009-10-12 15:21:53 -04:00
Tom Rothamel fa538db11f Add ATL support for polar coordinates and revolution. 2009-10-12 02:57:17 -04:00
Tom Rothamel e4dff364e1 Add language support for revolution. 2009-10-12 02:56:36 -04:00
Tom Rothamel 5d7faf0274 Add basic revolution support. 2009-10-12 02:38:17 -04:00
Tom Rothamel ee0cafcf67 Change ATL to use warpers. 2009-10-11 15:38:25 -04:00
Tom Rothamel 94506ad601 Give people a fighting chance of debugging ATL errors. 2009-10-11 00:27:25 -04:00
Tom Rothamel f0b54ea7f9 Mark window is shown in renpy.display_menu. 2009-10-08 19:58:03 -04:00
Tom Rothamel 11dbf23952 Applied patch from spikey to fix lp:409151 2009-10-08 01:15:34 -04:00
Tom Rothamel 8957aa4f2f fixes lp:413209. 2009-10-08 01:09:22 -04:00
Tom Rothamel 7e206549fd Attempt a fix for lp:435595. 2009-10-08 00:32:11 -04:00
Tom Rothamel f365408bbc Fix lp:415110. 2009-10-08 00:17:04 -04:00
Tom Rothamel 0bdf5cd904 Be more aggressive in handling events, so the queue is less likely to
overflow.
2009-10-07 23:41:53 -04:00
Tom Rothamel 9ba28e5cd2 Fixed style.rebuild. 2009-10-07 02:07:12 -04:00
Tom Rothamel 49ae49a82e Add ui.button's keymap argument.
Add support for deleting save games.
2009-10-07 01:35:55 -04:00
Tom Rothamel 23e9fffd68 Fix function leaking into atl interpolators. 2009-10-07 00:43:08 -04:00
Tom Rothamel 1c6df6230d Various improvements to ui.input, in support of a failed effort to
allow the user to change the label of a savegame.
2009-10-07 00:22:39 -04:00
Tom Rothamel 88584747e4 renpy.get_roll_forward 2009-10-05 14:09:12 -04:00
Tom Rothamel d77d1c266b When an image is shown, Ren'Py checks to see if there was a previous
image with that tag, and if that image used a transform. If this is
true, Ren'Py does two things:

# If the new image is not a transform, it wraps it in a transform.
# The transform is initialized to have the properties of the old transform.

The generally has the effect of "remembering" the position of images
shown on the screen. In some cases, this memory effect may override a
position encoded into an image. In that case, the image must be hidden
and shown again.
2009-10-04 22:45:03 -04:00
Tom Rothamel d9738a2809 Added a FPS meter to the Developer (shift+D) menu.
Added a .001s sleep for frames that are framerate-limited. This should
prevent Ren'Py from consuming all CPU unless the game is CPU-bound.
2009-10-04 16:38:38 -04:00
Tom Rothamel a40d997413 Implement visit method on the various ATL classes. 2009-10-04 12:02:06 -04:00
Tom Rothamel d444558b06 Add ATL image prediction.
Add ATL On and Event statements.
2009-10-04 11:48:22 -04:00
Tom Rothamel 07164c156b Pass statement, remove requirement for choice to take an expression. 2009-10-04 03:36:09 -04:00
Tom Rothamel 625df4c7ac Implement Transform statement.
Implement calling an ATLTransform, and using an ATLTransform as a parameterized image.
2009-10-04 02:59:28 -04:00
Tom Rothamel 75a047e18d Implement the time statement. 2009-10-04 01:54:25 -04:00
Tom Rothamel ade3d4f935 Implemented choice. 2009-10-04 00:05:16 -04:00
Tom Rothamel a0bc604d92 Implement ATL statements, including repeat and parallel. 2009-10-03 22:59:55 -04:00
Tom Rothamel 10743adcee Fix a bug that could cause us to read a negative amount from a file, with disasterous results. 2009-10-03 15:36:35 -04:00
Tom Rothamel 4e9af0789c First ATL animation. 2009-10-01 03:21:37 -04:00
Tom Rothamel 83f7ef6fd7 WIP checkin of ATL. 2009-09-30 15:44:19 -04:00
Tom Rothamel b2850cc6ac ATL work. 2009-09-29 03:03:46 -04:00
Tom Rothamel e41c71da98 Add ATL, parse multipurpose statement. 2009-09-27 01:07:22 -04:00
Tom Rothamel 0e3468872b Fix strings to not double-escape. 2009-09-01 10:06:42 -04:00
Tom Rothamel cd6a49e679 Allow translation. 2009-08-31 01:36:55 -04:00
Tom Rothamel 494e1a944b Fix regression that prevented {w=1} from working. 2009-08-13 20:19:58 -04:00
Tom Rothamel 1361825f5d Bump version. 2009-08-03 21:33:34 -04:00
Tom Rothamel b977e20156 Export RENPY_BASE environment variable to help editors find Ren'Py.
Make SciTE use this mechanism to launch games.
2009-08-03 21:28:45 -04:00
Tom Rothamel ff858e599d Ensure that distribute works with non-unicode directories. 2009-08-03 19:26:26 -04:00
Tom Rothamel 4c7bdede29 Bump version. 2009-07-30 21:24:55 -04:00
Tom Rothamel 4208836d77 The various layouts now change the mouse to the gamemenu or mainmenu
mouse, as appropriate.
2009-07-30 21:13:34 -04:00
Tom Rothamel 592341f5b1 Editor selection tweaks. (Respects RENPY_EDITOR) 2009-07-30 21:04:06 -04:00
Tom Rothamel bc41ebadce Hide console on lint. 2009-07-29 23:36:02 -04:00
Tom Rothamel 0deadb41ee Reset LD_LIBRARY_PATH before running zenity. 2009-07-29 23:33:06 -04:00
Tom Rothamel 076624c4c2 Normalize filenames when building distributions. This prevents
duplicates and ensures that we can properly replace file data. For
example, on Windows, this was preventing Info.plist from being
replaced.
2009-07-28 22:23:33 -04:00
Tom Rothamel 943b421779 Bump version to 6.9.3a. 2009-07-14 09:59:00 -04:00
Tom Rothamel c21acfb108 Fix missed launcher internationalization. Thanks go to Cato. 2009-07-14 02:47:05 -04:00
Tom Rothamel 8ae58964d8 NVL-mode tutorial. 2009-07-14 01:59:03 -04:00
Tom Rothamel 0cf0135a00 Fix imagemap_preferences to properly highlight button. 2009-07-13 01:47:55 -04:00
Tom Rothamel 11d8a8a249 The save location for screenshots has now been standardized. It is now
the directory containing the executable used to start Ren'Py, be it a
.exe, .py, .sh, or .app. (The latter is handled specially.)
2009-07-12 16:49:45 -04:00
Tom Rothamel 8edacbf9f1 Fixed launchpad bug #392322. 2009-07-12 15:48:23 -04:00
Tom Rothamel e6f49527b6 Ren'Py will now search for a directory named "Ren'Py Data" in the
directories above your Ren'Py installation. If found, save data will
be placed in that directory, rather than the system-specific default
location. This should help make it easier to develop Ren'Py games when
using a USB drive.
2009-07-12 15:39:15 -04:00
Tom Rothamel 9b897f7ffc l2: Automatically update a translations file, if it exists. 2009-07-12 13:38:07 -04:00
Tom Rothamel bc06c75cf2 l2: translations framework 2009-07-12 12:16:09 -04:00
Tom Rothamel ef324e2f9f Remove debug print. 2009-07-11 15:43:17 -04:00
Tom Rothamel 002ed104de Allow config.layer_clipping to specify layers that are larger than the
screen.
2009-07-11 15:27:51 -04:00
Tom Rothamel 211fd59d66 The window show and window hide statements now work with NVL-mode,
and are probably preferred over nvl show and nvl hide.
2009-07-09 01:48:36 -04:00
Tom Rothamel 3827198240 Fixed a 5-year-old bug in rollback that prevented an object from being
rollback if it was not being referred to by an object in the current 
state. For example, if we did:

$ o.foo = [ ]

"point a"

$ o.foo.append(1)

"point b"

$ o.foo = None

"point c"

and then rolled back from point c to point a, o.foo would improperly remain
[1]. (And would become bigger each time we rolled back and forth.)
2009-07-06 23:51:40 -04:00
Tom Rothamel 760d975d5b L2 initial release. 2009-07-05 18:23:59 -04:00
Tom Rothamel ad25bd6597 l2 is now the default launcher. 2009-07-05 14:24:36 -04:00
Tom Rothamel 9edc9aa741 l2: text editing support. 2009-07-05 14:23:09 -04:00
Tom Rothamel 061f481d10 l2: new 2009-06-30 01:47:36 -04:00
Tom Rothamel f33839212d Add header to pot file. 2009-06-27 23:10:19 -04:00
Tom Rothamel ac46d25470 Switch to using pot files to store translations. 2009-06-27 22:41:25 -04:00
Tom Rothamel efdf7d4e30 l2: archiver. 2009-06-27 22:05:21 -04:00
Tom Rothamel 76d942ebb3 l2: progress bars and success screen 2009-06-27 20:50:16 -04:00
Tom Rothamel 24881174ce l2: Now building distributions on win, mac, linux, all. 2009-06-27 19:48:09 -04:00
Tom Rothamel 88a44ea1a9 l2: scanning files for distribution
l2: builds windows distribution
2009-06-27 18:42:57 -04:00
Tom Rothamel d0aed4a284 l2: distribute interface. 2009-06-27 14:31:03 -04:00
Tom Rothamel 47f5cce2c3 l2: Now can choose between multiple kinds of themes. 2009-06-27 00:11:03 -04:00
Tom Rothamel 534f669e1d l2: editor
l2: lint
l2: delete persistent
l2: start on theme changing
2009-06-26 04:17:08 -04:00
Tom Rothamel 2f422080e9 l2: game directory. 2009-06-26 02:08:11 -04:00
Tom Rothamel 6efbd90a7c Beginning work on Launcher2. 2009-06-26 01:59:14 -04:00
Tom Rothamel 446b5fd32f Also adjust times on root. 2009-06-12 16:36:16 -04:00
Tom Rothamel 705dc5f53b Fixed a problem that could cause children of the various
MultiBox-based displayables (Fixed, HBox, VBox, and LiveComposite) to
display animations incorrectly.
2009-06-11 21:50:44 -04:00
Tom Rothamel c5dba9f4a1 The new ui.detached function allows one to use the ui functions to
define displayables without adding them to a layer.
2009-06-11 21:09:56 -04:00
Tom Rothamel 904c2ebe73 Fix bug that caused renders to be cached without respect to displayable time. 2009-06-09 21:27:31 -04:00
Tom Rothamel 275f52814f Fix im.py:703: DeprecationWarning: integer argument expected, got float 2009-05-27 23:39:42 -04:00
Tom Rothamel 693cf9f8c9 Version bumps for 6.9.2 2009-05-05 02:09:59 -04:00
Tom Rothamel 35c2ec5a83 Fixed a bug that could cause it to take two tries to define a joystick
button.
2009-05-02 23:31:13 -04:00
Tom Rothamel 3b60efd744 Update changelog.
Fix dequeue to have correct semantics.
2009-05-02 23:05:27 -04:00
Tom Rothamel daac5d8ebf Doing anything besides rollforward during rollback now terminates
rollback.

Queueing music immediately after a play statement now allows the first 
track from the play statement to play.
2009-05-02 22:41:04 -04:00
Tom Rothamel 1fab6d8707 Prevent slow_done from being repeatedly called. 2009-05-02 21:32:24 -04:00
Tom Rothamel aaff11668a Catch errors when saving screenshots. 2009-05-02 20:21:18 -04:00
Tom Rothamel 536341a819 Fix problem with window icon on 16bit screen. 2009-05-01 22:16:29 -04:00
Tom Rothamel b9c468e446 Fix repeate word in the question. 2009-04-27 07:50:09 -04:00
Tom Rothamel 03edec9785 Fix a bug with Container. 2009-04-24 19:22:04 -04:00
Tom Rothamel da70a85d75 Bring in changes from staging. 2009-04-23 00:53:14 -04:00
Tom Rothamel 4ba170b8d8 Bring in features from mainline. 2009-04-23 00:52:04 -04:00
Tom Rothamel 72ae15c635 Back out some changes that lead to a slowdown in dissolve. 2009-04-22 23:16:49 -04:00
Tom Rothamel 1179066dda Bump version to 6.9.1h 2009-04-20 23:05:00 -04:00
Tom Rothamel 62d0093bee End skipping on rollback. 2009-04-20 23:01:10 -04:00
Tom Rothamel 55c0d3b4a7 Convert to alpha before smoothscaling windows icon. 2009-04-19 16:03:42 -04:00
Tom Rothamel 92014eafdd Fix a bug with the icon on windows. 2009-04-19 16:01:55 -04:00
Tom Rothamel b1be4c8ed4 The library alias for config has been removed. 2009-04-19 02:00:53 -04:00
Tom Rothamel 06f36dd8d1 Prevent infinite loop in error handling. 2009-04-19 01:31:26 -04:00
Tom Rothamel 3a15f5c717 6.9.1g 2009-04-18 23:24:22 -04:00
Tom Rothamel 031f3338b1 Scale screenshot using an alpha image. 2009-04-17 19:44:00 -04:00
Tom Rothamel 66125b2e10 Bump version. 2009-04-16 21:03:48 -04:00
Tom Rothamel e6becffc4c Blacklist obsolete file formats.
Properly deallocate VideoStates of short/invalid media files.
2009-04-16 19:31:50 -04:00
Tom Rothamel d281e57879 Fix reported bugs.
Make scaling more accurate.
2009-04-16 18:04:10 -04:00
Tom Rothamel 5196a970a0 Channels now have a default tightness. 2009-04-15 12:12:40 -04:00
Tom Rothamel efcbc92e7a Reimplement smoothscale in terms of _renpy.pixellate and _renpy.bilinear. 2009-04-15 01:10:13 -04:00
Tom Rothamel 142fa33548 Changelog updates. 2009-04-13 23:49:39 -04:00
Tom Rothamel 4b6e871ac6 6.9.1d 2009-04-13 23:40:13 -04:00
Tom Rothamel 1fbbad053a Add _rollback. 2009-04-13 23:11:39 -04:00
Tom Rothamel 61aa933d97 Fix rendering of empty image-based fonts. 2009-04-13 19:31:11 -04:00
Tom Rothamel 70c3ea773e Fix conflict between window show and shift+>. 2009-04-13 11:54:40 -04:00
Tom Rothamel a16de04682 The demo now passes with RENPY_SCALE_FACTOR=1.5. This required various fixes.
Prevent blit_lock from being held over a traceback.
2009-04-13 01:27:34 -04:00
Tom Rothamel 0280a12589 In SayBehavior, when a click comes in at the same time as a skip
timeout, favor the click.
2009-04-12 23:53:22 -04:00
Tom Rothamel 4dc8fef9c1 Fix a problems in scaling caused when images of different physical
sizes map to the same virtual size.

Fix a problem with restart.
2009-04-12 23:47:42 -04:00
Tom Rothamel 2c02645ec7 Lint now reports all uses of missing files, rather than just the first. 2009-04-12 15:14:19 -04:00
Tom Rothamel 40bad327fe renpy.full_restart now takes a target parameter, which is a screen on
the main menu to target.
2009-04-12 14:48:26 -04:00
Tom Rothamel f5653d3c4d Releasing 6.9.1c. 2009-04-11 14:16:14 -04:00
Tom Rothamel 4026d7818b Provide a basic mechanism for invoking the main menu with a particular screen. 2009-04-11 14:04:54 -04:00
Tom Rothamel a0fda2f058 Do not offer an editor if none exists.
Modified setup.py to check dependencies. It can now be used to build
on a stock ubuntu system, if all dependencies are in place.
2009-04-11 13:47:35 -04:00
Tom Rothamel 93546e2d5c Allow the movie channel to play back while muted. 2009-04-11 01:41:29 -04:00
Tom Rothamel 85a562713a Fix memory leak in the redraw queue. 2009-04-11 00:47:51 -04:00
Tom Rothamel 4e9beb1a5d Minor tweaks to the includes of ffdecode.c 2009-04-10 11:01:12 -04:00
Tom Rothamel 522333e0f5 Update help file to include a link to renpy/LICENSE.txt. 2009-04-10 10:15:06 -04:00
Tom Rothamel b4c4d0264c Make scale correct and higher quality. 2009-04-10 02:40:15 -04:00
Tom Rothamel 21c3187fa3 Fix help on an imagemap menu. 2009-04-10 00:03:42 -04:00
Tom Rothamel b377cfcdef Only play activate and hover sounds if defined. 2009-04-09 22:52:09 -04:00
Tom Rothamel 5d384e531d Drop log level in ffdecode.
Bump version to 6.9.1b.
2009-04-09 18:41:25 -04:00
Tom Rothamel 2b00c64973 More accurate durations on streams. 2009-04-09 14:44:48 -04:00
Tom Rothamel 7c777dea22 Scaling is now automatically enabled if the window won't fit on the screen. 2009-04-08 00:41:10 -04:00
Tom Rothamel 9d0c77917d Remove debugging code in nvl mode. 2009-04-07 11:59:32 -04:00
Tom Rothamel 6d40ced435 Updated renpy.sh to work on the Mac again. 2009-04-07 02:13:36 -04:00
Tom Rothamel 0675ee7f79 Fix clipping of BMFonts. 2009-04-06 23:43:38 -04:00
Tom Rothamel 0aec15a848 Fix problem with sounds being changed upon exiting a context. 2009-04-05 21:25:50 -04:00
Tom Rothamel 2ff01a99ac Update distribute.py to deal with new module files. 2009-04-05 16:21:06 -04:00
Tom Rothamel 0596ed7739 Update license for 6.9.1. 2009-04-05 16:10:35 -04:00
Tom Rothamel d8beb99964 There is a new config.windows_icon variable, that lets one set the
window icon for Windows separately from Mac OS X and Linux.
2009-04-05 15:59:00 -04:00
Tom Rothamel 648dfd8d75 Fix bugs revealed by the mediatest game. 2009-04-05 14:53:02 -04:00
Tom Rothamel 279a7a3fc8 Don't use SDL_Mix_Audio, which can have weird alignment
rules. Instead, just mix things ourselves in C.

Random other release engineering things.
2009-04-05 12:07:59 -04:00
Tom Rothamel a62aede62f Add video to the demo.
Tweak video playback to remove some logging, and some force stops.
2009-04-04 22:13:20 -04:00
Tom Rothamel b07bbbc1c9 Report more relevant errors when various commands occur during the init phase. 2009-04-04 19:08:08 -04:00
Tom Rothamel 547ce87eaa Add more window control statements to demo.
Properly compute size of Transform.

Eliminate dependency loop that was causing Renders to leak.
2009-04-04 18:08:43 -04:00
Tom Rothamel c206456d00 Modify demo game to use window show and window hide. 2009-04-04 14:42:56 -04:00
Tom Rothamel 590dd13f8f The new window statement allows one to control if an empty window is
shown when no character is speaking. Specifically, the

window show [transition]

statement shows the window, and the 

window hide [transition]

statement hides it. Both can take an optional
transition. config.empty_window is responsible for displaying the
window, while config.window_show_transition and
config.window_hide_transition are default transitions. The state of
the window can be determined by testing _window. The
renpy.shown_window function can be called to suppress displaying the
empty window, and is called automatically when characters speak.



The new renpy.get_placement function returns information about the
placement of displayables.
2009-04-04 14:02:00 -04:00
Tom Rothamel afd0e70479 Deal with the case where a bmfont has a negative offset for the first
character in a string.
2009-04-04 03:58:21 -04:00
Tom Rothamel b9166b35b3 The define.move_transitions function can now pass keyword arguments to
the moves it creates. The most useful thing with this is to pass
subpixel=True, in order to create subpixel move transitions.
2009-04-04 03:32:44 -04:00
Tom Rothamel 333fa51862 Hotspots for the game menu buttons can be defined as part of
layout.imagemap_load_save, layout.imagemap_preferences, and
layout.imagemap_yesno_prompt. Doing so prevents layout.navigation from
being called for that screen. It also allows opaque imagemaps to be
used, rather than forcing them to be transparent to allow the
navigation to show through.
2009-04-04 03:00:31 -04:00
Tom Rothamel ec6d256707 Support play <channel>, queue <channel>, and stop <channel> statements. 2009-04-03 22:36:44 -04:00
Tom Rothamel 86764d92a6 Fixed a bug that could cause crashing when rolling back to a Zoom with
an after_child.
2009-04-03 17:50:45 -04:00
Tom Rothamel cf1c9b3e5e Fixed a bug that caused layout.imagemap_main_menu to call a label even
though there was a button with the same name.
2009-04-03 14:05:08 -04:00
Tom Rothamel b15d7179b6 Zooming was totally broken when bilinear=False. 2009-04-03 02:29:11 -04:00
Tom Rothamel 72312f1249 Update the keymap to support alt-enter to toggle fullscreen, alt-q to quit. 2009-04-03 02:08:03 -04:00
Tom Rothamel 373198f628 Various minor changes required to get movie_cutscene working, and keep it compatible with the old version. 2009-04-03 01:58:36 -04:00
Tom Rothamel e96d8c774b Reimplement movie_cutscene.
Fix bugs that prevented sound from looping in some cases.
2009-04-02 22:34:07 -04:00
Tom Rothamel 8e221e183d Implement changing the volume over time.
Re-implement sound in terms of music.
2009-04-02 18:15:59 -04:00
Tom Rothamel 2249c49303 Added the PNG save code back in, so we can save a PNG file into a
memory buffer. 

Scout is hereby banned from crayons until she figures out a way to use
them that doesn't buffer-overrun pygame's TGA-writer.
2009-04-01 22:21:11 -04:00
Tom Rothamel 388362d318 Many fixes to movie playback.
Munge filenames that include non-identifier characters.
2009-04-01 04:28:50 -04:00
Tom Rothamel a554ea8e8b Update munge algorithm to deal with characters that cannot appear in python identifiers. 2009-04-01 04:22:01 -04:00
Tom Rothamel 090719deee Make ffdecode drop frames to maintain sync.
debug_sound will now enable output of ffmpeg status information.
2009-04-01 04:00:53 -04:00
Tom Rothamel e29a162a85 Discover AVSEEK_SIZE. Implement it. Fix bug that caused AVI files not
to parse.  It's _never_ easy. :-)
2009-04-01 03:05:34 -04:00
Tom Rothamel e17fa9edc2 The code now builds properly on Windows, but immediately crashes upon playing
a video.
2009-03-30 02:26:09 -04:00
Tom Rothamel e57529257e Remove more references to save_png. 2009-03-30 01:03:23 -04:00
Tom Rothamel 866f9228ef Get the Movie displayable working.
Remove image writing from _renpy, now that it's in pygame.
2009-03-30 01:00:23 -04:00
Tom Rothamel 3a38a8b89b Fix seeking bug that was affecting AVI playback. 2009-03-29 18:54:20 -04:00
Tom Rothamel 0509a23881 Fullscreen movie playback works. 2009-03-29 16:19:49 -04:00
Tom Rothamel cbb0741ab9 Rewritten sound support now works. (At least in the sense of not
crashing or leaking memory.)
2009-03-29 04:19:15 -04:00
Tom Rothamel 716bb0fac1 style, not 'style'. 2009-03-28 11:07:50 -04:00
Tom Rothamel acb193bd7b Moved all of the motions into their own file, as there's a reasonably
logical split between them and the stuff that remained in
renpy.layout. (And since two ~1k line files are more readable than one
2k line file.)
2009-03-28 01:18:10 -04:00
Tom Rothamel 0a09beb731 Fix FactorScale, and add to demo to be sure it works. 2009-03-28 00:22:10 -04:00
Tom Rothamel 93dca3df73 The Motion (including Move and Pan), Zoom, RotoZoom, and FactorZoom
displayables now use the style.motion style, which now has xanchor and
yanchor both set to 0. This gives these movements the same semantics
when used inside an image clause as they have outside one.
2009-03-27 23:08:34 -04:00
Tom Rothamel 008143a3da im.Grayscale and im.Sepia now take properties, so they can be
positioned.
2009-03-27 04:58:40 -04:00
Tom Rothamel 30a4db432e Fix problem computing the size of the render of a Transform. 2009-03-27 04:39:30 -04:00
Tom Rothamel 65546baf01 Remove obsolete files. 2009-03-27 03:53:55 -04:00
Tom Rothamel 8be5069490 Fix fixes. 2009-03-26 03:18:39 -04:00
Tom Rothamel 802410644b Fix locking conflict that could cause movies & music to not end.
Add some checking that should deallocate all renders.
2009-03-26 02:23:01 -04:00
Tom Rothamel e74b172372 Remove debug prints.
Add better locking to codec open/close, which prevents ffmpeg from complaining.
2009-03-24 06:36:21 -04:00
Tom Rothamel 23ac59588e Fix problems with non-44100 sampling rates. 2009-03-24 04:58:46 -04:00
Tom Rothamel 7f6e9de5e5 Integrated ffmpeg with pss. 2009-03-24 01:16:43 -04:00
Tom Rothamel 143906ae9d Begin work to integrate ffmpeg. 2009-03-22 21:16:17 -04:00
Tom Rothamel b003371456 6.9.0h 2009-03-21 17:36:00 -04:00
Tom Rothamel 1e6fa37a10 Fix offset problem in RotoZoom 2009-03-21 02:35:01 -04:00
Tom Rothamel 935786a161 Fix prior fix. 2009-03-19 23:51:46 -04:00
Tom Rothamel 23c4d07432 Fix bug with clipping. 2009-03-19 01:41:25 -04:00
Tom Rothamel 77107ef1eb Fix memory leak in Grid when bigger than the screen. 2009-03-18 02:12:21 -04:00
Tom Rothamel cac4238b12 6.9.0g 2009-03-17 23:46:55 -04:00
Tom Rothamel 8c402c2dc3 Fix button_menu problem. 2009-03-17 23:12:31 -04:00
Tom Rothamel 9bff95826a Fix bug in is_pixel_opaque. 2009-03-17 23:06:22 -04:00
Tom Rothamel fc0f7cecc4 Fix for viewport focus bugs? 2009-03-16 01:42:27 -04:00
Tom Rothamel 0b5c5ce17e Fix memory leak bug. 2009-03-16 00:45:43 -04:00
Tom Rothamel 9aa61532ff Refix bugs in pefile.py. 2009-03-12 22:39:56 -04:00
Tom Rothamel 3271557f8a Fix pefile.py to match latest py2exe. 2009-03-11 21:08:31 -04:00
Tom Rothamel 9587342129 6.9.0f
Fixes an overflow bug in subpixel.
2009-03-10 20:07:08 -04:00
Tom Rothamel 9b4821308d Change semantics of set_pan to be slightly more useful.
6.9.0e.
2009-03-09 23:12:04 -04:00
Tom Rothamel 663978906a Added renpy.partial. 2009-03-08 20:49:12 -04:00
Tom Rothamel 60f3308b8b Autobar now uses floating point numbers, making it smoother when the range is small.
Up the script version to 6.9.0.
2009-03-08 10:09:43 -04:00
Tom Rothamel a305d6e725 6.9.0d 2009-03-08 01:58:50 -05:00
Tom Rothamel 1feff344b8 New clipping code. 2009-03-07 21:23:01 -05:00
Tom Rothamel 4fa4ffae54 Releasing 6.9.0c. 2009-03-06 18:32:31 -05:00
Tom Rothamel 4ecd72de6e Readying 6.9.0b 2009-03-02 22:40:15 -05:00
Tom Rothamel 3ec495c3fc Fix fill problem.
Move only named layers.
Fix focus problem.
2009-03-02 21:50:50 -05:00
Tom Rothamel 5efc437384 Fixed rounding issue in place. 2009-03-02 15:29:55 -05:00
Tom Rothamel a777f4d3b1 Fix negative render size. 2009-03-01 20:06:19 -05:00
Tom Rothamel ff139808ff 6.9.0a 2009-03-01 14:23:58 -05:00
Tom Rothamel 07136f9be8 2009 2009-03-01 13:37:06 -05:00
Tom Rothamel 35fc2295e9 Various fixes. 2009-03-01 13:35:36 -05:00
Tom Rothamel 2b262ccca3 Fix annoying windows bugs. 2009-03-01 03:10:42 -05:00
Tom Rothamel d42aab3dff Movement demo. 2009-02-28 12:20:32 -05:00
Tom Rothamel 612c347498 Add transform demo. 2009-02-28 12:09:06 -05:00
Tom Rothamel 3c4540131a Remove speex.
Images are now allowed outside of init blocks.

Unicode strings are automatically prefixed with u in python code.
2009-02-27 00:45:55 -05:00
Tom Rothamel 43317f6e02 Add config.editor_file_separator 2009-02-24 23:31:42 -05:00
Tom Rothamel 523742d8de Write out launcherinfo.py 2009-02-24 23:11:18 -05:00
Tom Rothamel 9516ee910e The reporting of parse errors involving missing quotes has been
improved.

Added scaling of the subpixel function.
2009-02-24 03:49:55 -05:00
Tom Rothamel 3ea31a3862 Added config.label_callback. 2009-02-23 01:35:07 -05:00
Tom Rothamel 649411a4ef ui.transform and ui.autobar 2009-02-22 02:31:56 -05:00
Tom Rothamel a0e60e5453 Added transform and renpy.Container. 2009-02-21 15:34:16 -05:00
Tom Rothamel e3f1f40a78 Fix it for ppc etc. as well. 2009-02-19 03:43:03 -05:00
Tom Rothamel d0177f4c52 Implemented Transform
Fixed segfault bug in transform32_mmx.
2009-02-19 03:38:25 -05:00
Tom Rothamel 84a3a55a03 Update the changelog. Ensure draw_func draws on an integer pixel boundary. 2009-02-16 03:14:38 -05:00
Tom Rothamel 048075b47a Subpixel blitting works. Transform + alpha blitting is untested. 2009-02-16 02:41:18 -05:00
Tom Rothamel fab097c92a Render rewrite is roughly at parity with previous functionality. 2009-02-14 17:44:08 -05:00
Tom Rothamel 9d26bd8c04 WIP on Render rewrite. 2009-02-10 00:32:51 -05:00
Tom Rothamel 664d243c23 Implemented subpixel rendering in _renpy. 2009-01-29 02:58:48 -05:00
Tom Rothamel 9a0906655d Fix problems with 16 bit platform and config.window_icon. 2009-01-11 20:46:01 -05:00
Tom Rothamel 13d60f2741 Began adding subpixel support. 2009-01-05 01:28:06 -05:00
Tom Rothamel 7d4de64d0b Fixed an issue with imouto-mode that cropped up when a Frame scales something down to nothing. 2008-12-30 15:00:18 -05:00
Tom Rothamel 9ada2d9884 Deal with environment.txt. 2008-12-30 12:37:52 -05:00
Tom Rothamel a5f1951cfb Fixed multiple imouto-mode problems. 2008-12-30 12:27:03 -05:00
Tom Rothamel 98850e4c5c Added im.FactorScale, renpy.game_menu, and ui.gamemenus. 2008-12-29 12:25:29 -05:00
Tom Rothamel 709e1f925d Added renpy.sound.set_pan 2008-12-24 13:45:43 -05:00
Tom Rothamel b11ae331a5 Update renpygame.
Autosave on quit.

Fix memory leak via adjustments.
2008-12-23 00:41:15 -05:00
Tom Rothamel 3ba4b26b99 Transform (Rotozoom) now support subpixel alpha. 2008-12-16 03:29:43 -05:00
Tom Rothamel b864077017 Improved Rotozoom's correctness and speed. 2008-12-15 21:57:27 -05:00
Tom Rothamel d411dff1c0 Overlay behavior change.
Fix divide-by-zero in Alpha.
2008-12-06 01:52:12 -05:00
Tom Rothamel 7fc7453450 Releasing 6.8.1a. 2008-11-23 13:05:47 -05:00
Tom Rothamel 1799971885 Implement RENPY_LESS_UPDATES and RENPY_LESS_MOUSE.
Build iLiad distributions.

Add support for rebuilding distributions.
2008-11-23 11:15:26 -05:00
Tom Rothamel b999911292 Untested support for building iLiad distributions. 2008-11-21 02:59:49 -05:00
Tom Rothamel 29e0f9ad21 Working on iLiad support. 2008-11-21 02:09:54 -05:00
Tom Rothamel d821b7eb8b Fixed a bug that occured when space characters were inserted
immediately after a newline.
2008-11-20 01:32:40 -05:00
Tom Rothamel 272a214304 Modified lint slightly.
Added Alpha.
2008-11-18 01:35:29 -05:00
Tom Rothamel 7f15b351ee Add support for a user-defined default statement.
Speed up parsing a little.
2008-11-17 02:40:55 -05:00
Tom Rothamel 5a6a12a14a Blacklist renpy.display from being reloaded. 2008-11-17 00:05:31 -05:00
Tom Rothamel 01493c7063 Splitting cardgame. 2008-11-10 01:30:01 -05:00
Tom Rothamel 244055fcb7 Modified presplash.py so that it ignores errors forking of a second process. 2008-11-09 15:50:22 -05:00
Tom Rothamel 0415af5f31 Better support for scaling.
The launcher will now may sys.executable point to an existing file.
2008-11-09 15:36:16 -05:00
Tom Rothamel f73372c924 iRex iLiad support. 2008-11-02 16:14:16 -05:00
Tom Rothamel 65cdc24e37 Add staticgray support, for iLiad. 2008-11-02 08:43:53 -05:00
Tom Rothamel 1b2d439651 Releasing 6.8.0 2008-10-25 14:52:49 -04:00
Tom Rothamel b383942c69 Create icon group for loaded icons. (Took a week :-( ) 2008-10-25 01:45:03 -04:00
Tom Rothamel 73bd109abb Another try at fixing icons. 2008-10-17 22:57:18 -04:00
Tom Rothamel 33ffd5dedb Fix for a problem with icons that specify a size and shouldn't. 2008-10-17 20:21:21 -04:00
Tom Rothamel 7422fe43b8 Fix a bug building mac distributions on windows.
Ready 6.8.0d.
2008-10-17 10:06:57 -04:00
Tom Rothamel 879c45a5b3 Releasing 6.8.0c 2008-10-15 15:43:29 -04:00
Tom Rothamel db0d205374 Added BMFont support. 2008-10-15 15:36:05 -04:00
Tom Rothamel f20594a2b5 Add build_launchertrans to version control.
Remove obsolete files.
2008-10-15 12:40:26 -04:00
Tom Rothamel ee017f4bc6 The launcher now deals better with long project names.
The launcher now warns if java is missing.
2008-10-14 21:20:14 -04:00
Tom Rothamel 4d089f9a0e Fixed various editor bugs. 2008-10-14 19:35:02 -04:00
Tom Rothamel e7f9c5c2ac Making ready for 6.8.0b 2008-10-14 17:43:31 -04:00
Tom Rothamel 2df8d38c2f Add config.missing_background. 2008-10-14 17:36:51 -04:00
Tom Rothamel 17ac44d610 Ren'Py now supports the MudgeFont image-based file format. The new
renpy.register_mudgefont function is used to register a
MudgeFont.
2008-10-14 17:30:56 -04:00
Tom Rothamel 3c52c2ae3f Fixed positioning of 640x480 preferences. 2008-10-14 16:29:45 -04:00
Tom Rothamel 5a5115e29f Fixed a problem with outlines and bold/italic text. 2008-10-14 16:07:29 -04:00
Tom Rothamel 5c7ff1c97b Fixed a bug that prevented styles from being rebuilt. 2008-10-13 23:19:04 -04:00
Tom Rothamel cc820a3595 Fix bugs pointed out by delta at:
http://lemmasoft.renai.us/forums/viewtopic.php?p=58835#p58835
2008-10-13 22:49:23 -04:00
Tom Rothamel 48fff48d28 Updated tag script. 2008-10-13 17:59:53 -04:00
Tom Rothamel 1684243e57 Finalizing 6.8.0 2008-10-13 17:56:13 -04:00
Tom Rothamel 45e14781eb Custom mouse cursors should now be properly hidden when the mouse
leaves the window. Previously, this failed to work on the Mac OS X
platform.
2008-10-13 16:02:53 -04:00
Tom Rothamel 5ceea7b4a5 The new unscrollable style property allows one to choose how
unscrollbable scrollbars are displays. None keeps the current
behavior, which shows the bar normally. If set to "insensitive", the
bar becomes insensitive, while if set to "hide", the bar is not 
drawn at all.
2008-10-13 13:32:27 -04:00
Tom Rothamel 17e716b4c3 The presplash code now looks for presplash.jpg in the game directory
if presplash.png is not found.
2008-10-13 10:53:04 -04:00
Tom Rothamel adfdbf3246 Added icons to The Question. 2008-10-13 02:17:15 -04:00
Tom Rothamel 03b757d60e Added more files into bzr.
Fixed problem with pefile.py not being able to resize the resource segment... now it can.
2008-10-13 01:43:30 -04:00
Tom Rothamel 12c6d77990 Moved to bazaar. Added file to ignore temporaries and generated code. 2008-10-12 22:57:21 -04:00
Tom Rothamel 8a7373f412 Adding some files to subversion. 2008-10-13 00:08:29 +00:00
Tom Rothamel df28ff5bdc Updated distribute.py to respect new launcher directory. 2008-10-12 22:15:28 +00:00
Tom Rothamel 2afc2beb5d Refactored font code out into its own file.
Replaced asfont with a new font.

Updated the demo, generally got things ready for release.
2008-10-12 17:31:00 +00:00
Tom Rothamel 3896bf3aad Newly-created games will have a Help option on the main and game
menus. This is controlled by the config.help variable. By default 
the help system shows the README.html file in the game's base directory.

The new RENPY_SCREENSHOT_PATTERN environment variable lets you
configure the name of screenshot files. Ren'Py can now write out
screenshots as JPGs, as well as PNGs.
2008-10-11 18:52:37 +00:00
Tom Rothamel 744ace5ab6 Alt-f4 and Alt-q now trigger the quit event, as if you pressed the
quit button on the top of the window. The first press brings up the 
quit prompt, and a second press forcibly terminates the game. Alt
is mapped to Command on the Mac, so Command-q now works on Macintosh.

Alt/Command-h hides (iconifies) the window.
2008-10-10 19:51:53 +00:00
Tom Rothamel 4bf0b74b6c update changelog 2008-10-10 15:15:42 +00:00
Tom Rothamel 5c6e624ff7 If the file icon.ico is present in the base directory, it will be used
as the icon of the windows exe when building the windows
distribution. Similarly, the file icon.icns will be used as the icon
of the Macintosh application. (Note that .icns is a different file format 
from .ico.)

The Macintosh application will now show the name of the game in the 
menu bar, rather than "Ren'Py Launcher".
2008-10-10 15:09:44 +00:00
Tom Rothamel 6c0d5a7a10 Move launcher directory. 2008-10-10 13:52:45 +00:00
Tom Rothamel b34cb21f0c The newly-documented Style.set_parent method lets you change the
parent of a style. The new style.rebuild function allows styles to be
rebuilt even after the game has begun running, with some
caveats. (Changes are not persisted, for one thing.)


The new renpy.easy_displayable method can be used by user-defined
displayables to convert strings into Solid or Image displayables.
2008-10-10 13:51:55 +00:00
Tom Rothamel b77eb7ed0b When config.developer is set and an undefined image is used in a show
or scene statement, a list of undefined images will appear centered at
the top of the screen. A black screen will be show instead of any missing
background. This makes it easier to write a script before all images are
present.
2008-10-10 12:59:27 +00:00
Tom Rothamel 34193c510e Fixed problem with bytecode.rpyb being opened in ascii mode. Once again, I hate windows. 2008-10-08 16:05:07 +00:00
Tom Rothamel 55f1eaf5da There is now a new justify style property, that causes lines of text
to have additional whitespace inserted between words so that the left
and right margins are even, except on the last line of a paragraph.
2008-10-05 21:31:00 +00:00
Tom Rothamel 9b74b5a367 * Outlined text is now possible. The new outlines style property
allows you to specify one or more outlines, including offset
ones. This allows for several fairly complicated text effects, similar
to what you'd see in modern subtitles. [demo]

* We believe the bug preventing fonts from being archived has been
fixed. It should now be possible to include a font in an archive, and
have that work. The archiver has been modified to allow this.
2008-10-04 16:09:13 +00:00
Tom Rothamel 008922edc6 Added support for one or more outlines around text. This allows the
sort of text effects one sees in modern subtitles.
2008-10-04 02:00:42 +00:00
Tom Rothamel 82edca785f Added _renpy_font module. 2008-10-04 00:52:04 +00:00
Tom Rothamel b271baecd5 2008-10-03 21:20:12 +00:00
Tom Rothamel 9b48cd2a35 Adding font stuff. 2008-10-03 19:42:16 +00:00
Tom Rothamel 183f6ace88 2008-10-01 20:23:40 +00:00
Tom Rothamel b5987cd6ea Minor editing fixes. 2008-10-01 20:21:55 +00:00
Tom Rothamel 6e153a5070 ready for 6.7.1c 2008-09-28 15:12:31 +00:00
Tom Rothamel 56e59d91dd The Question art refresh 2008-09-28 14:45:00 +00:00
Tom Rothamel fd91c6811f The new renpy.copy_images function copies images with one prefix to a
second prefix.
2008-09-27 03:06:04 +00:00
Tom Rothamel 9914f4e145 2008-09-26 03:38:16 +00:00
Tom Rothamel 458db1095a 6.7.1b 2008-09-26 03:32:13 +00:00
Tom Rothamel 93c4f964ca Ren'Py now limits the framerate to 60 frames per second, which should
improve smoothness on fast enough machines.


Ren'Py now scans the game directory for all .rpa files, and adds them
to config.archives automatically. In addition, the archiver tool now
prompts for the name of archives, and uses filename patterns to decide
what to archive. This makes it easier to break the files up into
multiple archives, in a single game.
2008-09-26 03:21:17 +00:00
Tom Rothamel 743c459789 Fix error reporting on renpy.easy.color. 2008-09-24 14:05:06 +00:00
Tom Rothamel 4f4c424a67 2008-09-22 02:39:42 +00:00
Tom Rothamel df40e340e9 6.7.1a final 2008-09-22 02:35:38 +00:00
Tom Rothamel f08828f130 User-defined displayables can now use a canvas to draw lines, polygons, arcs,
and ellipses on the screen.

Ready for 6.7.1a.
2008-09-22 00:36:47 +00:00
Tom Rothamel d28b6ab04f The definitions of config.editor and config.editor_transient have been
changed. While it's simplified, older values may no longer
work. Please read the documentation for details of the new syntax.
2008-09-21 20:20:23 +00:00
Tom Rothamel 9cf8802c28 new distribution scheme. 2008-09-20 18:38:00 +00:00
Tom Rothamel 5e5d8b441a 2008-09-19 18:27:06 +00:00
Tom Rothamel 2e7240c29d The new _window_subtitle variable allows a portion of the window
caption to be varied depending on the game circumstances. The new
config.menu_window_subtitle
2008-09-19 18:26:59 +00:00
Tom Rothamel 3aed142859 config.editor changes 2008-09-17 00:13:28 +00:00
Tom Rothamel b087b29a22 Work around bug in subprocess.Popen.__del__ 2008-09-16 03:56:52 +00:00
Tom Rothamel 5687f6fbaf 2008-09-16 03:32:00 +00:00
Tom Rothamel 57bfebe0b1 2008-09-16 01:53:20 +00:00
Tom Rothamel 9dce927cd0 2008-09-16 01:52:29 +00:00
Tom Rothamel 3c1df298c7 2008-09-16 01:43:34 +00:00
Tom Rothamel 68d11f0a7b 2008-09-16 01:42:41 +00:00
Tom Rothamel e55bc7be71 2008-09-12 05:50:30 +00:00
Tom Rothamel 031f82cf63 Fix problems with presplash. 2008-09-12 05:44:11 +00:00
Tom Rothamel 99aa549b6b Fixed bugs with ctrl and suppressed transitions. 2008-09-12 04:50:29 +00:00
Tom Rothamel 7f1ec73a34 cardgame 1 2008-09-10 04:58:08 +00:00
Tom Rothamel ef81a0bddc 6.7.0b 2008-09-09 17:13:48 +00:00
Tom Rothamel 86d90aa924 Finalized 6.7.0. 2008-09-08 00:06:42 +00:00
Tom Rothamel 704440287d 2008-09-07 19:45:08 +00:00
Tom Rothamel ae09666322 Added homedir saves. 2008-09-07 18:22:19 +00:00
Tom Rothamel 3facb92ca5 imagemap layouts 2008-09-07 04:49:20 +00:00
Tom Rothamel b2dd429f84 spline editor done. spline integration. 2008-09-06 15:46:36 +00:00
Tom Rothamel 3d5058ee90 spline editor 2008-09-06 14:49:17 +00:00
Tom Rothamel 44ed2c1f91 Spline editor. 2008-09-06 06:30:26 +00:00
Tom Rothamel ffd5971ea6 Delta's feature - config.nvl_show_display_say 2008-09-06 03:32:30 +00:00
Tom Rothamel eda2d64dfe The renpy.full_restart function now takes an argument that lets one
specify the label that will be restarted to. By calling
renpy.full_restart(label="start"), one can start a new game.
2008-09-06 03:13:52 +00:00
Tom Rothamel 4ebc96723b The new SizeZoom motion function allows displayables to be scaled to a
specific size. Along with SizeZoom, the Zoom and FactorZoom functions get 
a new repeat argument that makes the zooms repeat.
2008-09-06 01:36:20 +00:00
Tom Rothamel 2ce8ba3406 The new layout.imagemap_navigation layout lets one use an imagemap to
define the game menu navigation.
2008-09-05 23:34:13 +00:00
Tom Rothamel 96fc7b5aba Fixed style inheritance, which in some cases wouldn't pick up the
style inherited from.

Fixed a bug that prevented the style inspector from working on animated
screens.
2008-09-05 20:19:39 +00:00
Tom Rothamel 08a37b90a4 2008-09-02 05:08:40 +00:00
Tom Rothamel 1d4ff67612 2008-09-02 04:57:15 +00:00
Tom Rothamel 23dd507913 Added Klondike solitaire. 2008-09-02 04:46:49 +00:00
Tom Rothamel e6e3d3e546 Initial checkin of cardgame 2008-09-01 23:27:18 +00:00
Tom Rothamel 62273459d8 2008-08-29 03:11:13 +00:00
Tom Rothamel d5f6741bd9 2008-08-29 03:10:56 +00:00
Tom Rothamel 634cc46258 2008-08-28 12:54:16 +00:00
Tom Rothamel 7f2e09af55 2008-08-24 23:38:51 +00:00
Tom Rothamel 47b2ca163a Fixed a bug that made image prediction fail when a hide statement was
encountered.

Fixed a bug that prevented im.AlphaMask and ImageDissolve from working
with some images. Also improved the quality of im.AlphaMask, which was
incorrectly blending fractional alphas with black.
2008-08-21 04:00:05 +00:00
Tom Rothamel adb4b3eb5c The \ character is now the universal quote character. One can use \%
to prevent % from performing interpolation, and \{ to prevent { from 
starting a text tag.
2008-08-19 00:58:37 +00:00
Tom Rothamel 6fddc3449e Fixed a bug that prevented im.AlphaMask and ImageDissolve from working
with some images.

Using stdin for the remote control didn't work on Windows, and could
lead to errors in some cases. Instead, the remote control mode now 
uses a file, which gets deleted after processing the command.
2008-08-19 00:42:33 +00:00
Tom Rothamel ae897681cc Improved the numerical stability of interpolation. This fixes a
problem where moves could wiggle from side to side for no good 
reason.
2008-07-27 21:08:48 +00:00
Tom Rothamel 1bb7c0cd36 Bug fixes. Ready for release. 2008-07-21 02:53:48 +00:00
Tom Rothamel e42d877d11 split into renpy.easy.displayable and renpy.easy.displayable_or_none 2008-07-19 18:59:47 +00:00
Tom Rothamel 7b0e376f4d The {w=<pause>} text tag now compensates for slow text, and will only
begin the pause once all text has been displayed.


Lint will no longer produce an error when encountering a user-defined
text tag of the form: {/=style}.
2008-07-19 05:14:51 +00:00
Tom Rothamel e405d91cdf Added remote-control mode.
ui.add(None) is now an error.

Shut off music when returning to main menu.

classic load/save takes a thumbnail.
2008-07-17 02:32:07 +00:00
Tom Rothamel 2f0b429e76 2008-06-07 20:43:15 +00:00
Tom Rothamel 7480d416bd 2008-06-04 19:20:46 +00:00
Tom Rothamel 052ed133ba Fixed a bug that could cause crashing under certain combinations of
layouts and transitions.
2008-05-26 16:24:37 +00:00
Tom Rothamel b5bc5f6b10 2008-05-11 15:06:52 +00:00
Tom Rothamel 9c5b4484e6 Fixes to the new transition code. 2008-05-11 14:56:59 +00:00
Tom Rothamel fb729c4737 6.6.2a 2008-05-11 02:29:44 +00:00
Tom Rothamel 3c82bee409 Readying release. 2008-05-11 02:00:42 +00:00
Tom Rothamel 957eec0bdf The new {s} text tag causes text to be struck-through. The new
{=style_name} text tag cause text to be rendered in the given style
(for example, {=foo}text{/=foo} causes text to be rendered in the foo 
style.
2008-05-10 17:52:59 +00:00
Tom Rothamel 72ce387755 The new layout.imagemap_main_menu function makes it easy to use
imagemaps to define the main menu.
2008-05-08 06:18:01 +00:00
Tom Rothamel 9e7ab9b6f8 The config.after_load_transition variable can be used to specify a
transition that occurs after a game has been loaded. [doc]


Calling renpy.restart_interaction() will no longer cause ongoing
transitions to be terminated. [test, doc]
2008-05-08 06:16:47 +00:00
Tom Rothamel c0181755c5 The config.main_menu and config.game_menu variables can now optionally
take 4- and 5-component tuples, respectively. In both cases, the new 
last component is a python expression that must be true for the button
to be shown.

Pressing control will no longer cause transitions to end when
config.allow_skipping is False.
2008-04-27 19:31:45 +00:00
Tom Rothamel 4faef86e87 The use of tab to toggle skipping is now disabled while inside the
game and main menus.

The new config.hyperlink_styler variable allows the style of
hyperlinks to be changed based on the argument to the hyperlink.
2008-04-27 17:57:01 +00:00
Tom Rothamel f65d84e09f 2008-03-29 10:27:27 +00:00
Tom Rothamel e24e54c56d 2008-03-26 22:03:10 +00:00
Tom Rothamel e2ed4afb71 nvl_window now is indexed with rollback. 2008-03-24 00:14:42 +00:00
Tom Rothamel 4872c10e9b 2008-03-23 23:59:59 +00:00
Tom Rothamel e070c4430c 2008-03-15 16:00:08 +00:00
Tom Rothamel 8f6a9eaeb6 2008-03-15 15:59:55 +00:00
Tom Rothamel c7d2e71726 2008-03-12 03:19:49 +00:00
Tom Rothamel 8af19f82a3 2008-03-10 03:40:58 +00:00
Tom Rothamel 89feaa0e0a 2008-03-10 01:43:32 +00:00
Tom Rothamel 8a82882378 2008-03-09 23:23:05 +00:00
Tom Rothamel aaeb862ef1 2008-03-07 05:18:41 +00:00
Tom Rothamel 66f256f55c 2008-03-05 21:46:18 +00:00
Tom Rothamel 0274db18fe 2008-03-05 03:31:03 +00:00
Tom Rothamel 460cdf5db8 2008-02-28 04:09:56 +00:00
Tom Rothamel dbf5087ccf Some fixes 2008-02-27 22:43:09 +00:00
Tom Rothamel 17b027d88a 2008-02-19 17:56:09 +00:00
Tom Rothamel d0282c4d5a 2008-02-11 02:37:55 +00:00
Tom Rothamel 4051d4e299 2008-02-11 02:28:56 +00:00
Tom Rothamel 23bf80608e 2008-02-11 02:01:43 +00:00
Tom Rothamel 33fe3a1003 2008-02-10 15:22:53 +00:00
Tom Rothamel f7cc77a28c 2008-02-08 22:58:59 +00:00
Tom Rothamel 13aadab31f Fixed themes. 2008-02-08 22:20:43 +00:00
Tom Rothamel 115849f760 2008-02-07 10:39:43 +00:00
Tom Rothamel f4a973582e 2008-02-07 09:53:29 +00:00
Tom Rothamel 138afbd3c3 Fixed editor goto 2008-02-06 06:22:48 +00:00
Tom Rothamel 4b87b8ec9c 2008-02-05 13:13:07 +00:00
Tom Rothamel caab16c759 Done with 6.6.0a 2008-02-04 21:17:23 +00:00
Tom Rothamel 000558e5dd 2008-02-04 19:39:38 +00:00
Tom Rothamel e7ce0841c5 2008-02-04 18:15:48 +00:00
Tom Rothamel 0e4632cc25 2008-02-04 17:52:06 +00:00
Tom Rothamel 520add49f4 Style system rewrite. 2008-02-03 06:14:49 +00:00
Tom Rothamel a9802ea04c Style system rewrite. 2008-02-03 06:14:01 +00:00
Tom Rothamel 1cbfcce551 2008-02-02 06:27:56 +00:00
Tom Rothamel bb94aa0ac9 2008-02-02 06:25:57 +00:00
Tom Rothamel 2132a3d6ea 2008-02-02 04:29:39 +00:00
Tom Rothamel 239de0df80 2008-01-31 11:24:13 +00:00
Tom Rothamel 9e9799f1d1 2008-01-31 11:13:26 +00:00
Tom Rothamel baa6f88291 2008-01-31 10:31:30 +00:00
Tom Rothamel 02cdfefd27 2008-01-31 05:34:42 +00:00
Tom Rothamel d46a1a01f4 2008-01-28 07:12:21 +00:00
Tom Rothamel f04fdf39ee 2008-01-28 07:12:06 +00:00
Tom Rothamel f9d1011e17 2008-01-25 04:34:38 +00:00
Tom Rothamel 32294e2f22 2008-01-23 10:23:13 +00:00
Tom Rothamel c536eeddd5 2008-01-21 17:49:28 +00:00
Tom Rothamel 5d139d5f7d 2008-01-21 17:44:44 +00:00
Tom Rothamel 7163f1e889 size_group 2008-01-21 08:06:43 +00:00
Tom Rothamel d12d9579d2 2008-01-19 18:58:48 +00:00
Tom Rothamel 7db3c21013 2008-01-18 16:05:02 +00:00
Tom Rothamel 80cffcf388 2008-01-18 14:51:12 +00:00
Tom Rothamel fd6bd9c9a6 Layouts improving. 2008-01-18 10:14:49 +00:00
Tom Rothamel 81024ef270 2008-01-18 06:18:19 +00:00
Tom Rothamel 0048dc5483 2008-01-17 08:20:15 +00:00
Tom Rothamel 14c85742cb 2008-01-17 07:59:35 +00:00
Tom Rothamel b069b168aa 2008-01-16 09:05:34 +00:00
Tom Rothamel 962805f1f8 2008-01-16 08:43:41 +00:00
Tom Rothamel 6f5e094691 2008-01-16 08:43:22 +00:00
Tom Rothamel 6f73c95e75 2008-01-13 20:59:07 +00:00
Tom Rothamel 1c410ff232 Implemented module loading. 2008-01-13 18:59:34 +00:00
Tom Rothamel 939152830f 2008-01-08 22:54:53 +00:00
Tom Rothamel 9316f1507e fix pickling 2008-01-03 07:05:14 +00:00
Tom Rothamel 316ff71542 fix pickling 2008-01-03 07:00:29 +00:00
Tom Rothamel 2b782faab6 2008-01-03 06:47:06 +00:00
Tom Rothamel 901d0e609e 2007-12-29 07:14:36 +00:00
Tom Rothamel 4eda972567 2007-12-29 06:29:42 +00:00
Tom Rothamel b93006a810 2007-12-29 05:18:23 +00:00
Tom Rothamel f51d46eb4d 2007-12-29 04:46:48 +00:00
Tom Rothamel 611ad5e7bc 2007-12-29 04:40:26 +00:00
Tom Rothamel 008add67e5 2007-12-29 04:01:31 +00:00
Tom Rothamel 57524bd1b6 Performance tweaking. 2007-12-29 00:33:18 +00:00
Tom Rothamel 6959786848 2007-12-28 22:39:30 +00:00
Tom Rothamel ec29567b77 2007-12-28 06:41:16 +00:00
Tom Rothamel 13739dce3b 2007-12-27 05:32:30 +00:00
Tom Rothamel 74f5810334 2007-12-27 05:26:37 +00:00
Tom Rothamel 6f0a83c348 2007-12-24 17:05:34 +00:00
Tom Rothamel 121586c8e2 2007-12-24 16:36:41 +00:00
Tom Rothamel 718d5c2375 2007-12-24 08:00:45 +00:00
Tom Rothamel 8bc8a47be7 6.5.0a finalized. 2007-12-24 07:22:27 +00:00
Tom Rothamel e6a9cdc4b1 2007-12-24 06:28:51 +00:00
Tom Rothamel 8e4fae7d73 2007-12-24 05:37:06 +00:00
Tom Rothamel 7ac8192492 2007-12-23 22:08:16 +00:00
Tom Rothamel 9fd63e0e8f 2007-12-23 21:29:25 +00:00
Tom Rothamel 2cf47dfb6e 2007-12-21 05:56:34 +00:00
Tom Rothamel e35e3a7743 2007-12-21 05:49:48 +00:00
Tom Rothamel 8d94763fca 2007-12-21 05:49:42 +00:00
Tom Rothamel 5c371723ce 2007-12-21 05:12:50 +00:00
Tom Rothamel 69666d9cd8 2007-12-19 06:10:28 +00:00
Tom Rothamel 6cda72b9a6 2007-12-19 06:05:12 +00:00
Tom Rothamel f2fe68a5a6 User-defined statements can now be provided a next function, which is
called to get the label of the statement to be executed after the
current one.
2007-12-19 05:54:53 +00:00
Tom Rothamel 11652eaf33 ui.side. 2007-12-17 17:23:21 +00:00
Tom Rothamel 3160502be4 2007-12-16 20:58:47 +00:00
Tom Rothamel f1bebbe89b 2007-12-16 14:05:57 +00:00
Tom Rothamel 55f258474c New scrollbars. im.hue. foreground. image prediction bug. 2007-12-11 01:21:52 +00:00
Tom Rothamel 7ff0f7e390 New roundrect scrollbars. 2007-12-08 06:05:12 +00:00
Tom Rothamel 979230078f 2007-12-08 05:30:46 +00:00
Tom Rothamel 944777cdf4 Added bzip2, pyobjc. 2007-12-03 08:34:50 +00:00
Tom Rothamel d5560db0ce Implemented ui.viewport draggable. 2007-12-03 08:19:08 +00:00
Tom Rothamel 07aeb76971 Rewrote the Bar class, which implements ui.bar. This class now
optionally takes an adjustment object, which is what stores
information about the range, value, page size, and step size of 
the bar. [doc]

Bars now take a new style_property, bar_resizing. If this is true, we 
resize sub-bars, rather than rendering them at the full bar size and
then cropping. This changes the look of bars a bit.

Viewports now use adjustments to control their x and y scrolling
information. They properly fill in a range and step size, allowing
scrollbars to indicate the fraction of the viewport that is being
displayed to the user. [doc]

Viewports now also support several new ways of scrolling around. If
a true mousewheel argument is given to ui.viewport, the user will be
able to scroll the viewport using the mousewheel. If the draggable
argument is true, then the user will be able to drag the viewport
around using the mouse. [doc, implement draggable, doc config.keymap]
2007-12-03 06:28:42 +00:00
Tom Rothamel 9b36f7da03 Python 2.5 support. 2007-11-25 02:05:31 +00:00
Tom Rothamel 9e2b936e9f Allow hyperlink callbacks to end an interaction. 2007-11-25 01:54:48 +00:00
Tom Rothamel 7a2ebea2dd renaming profile 2007-11-22 07:06:33 +00:00
Tom Rothamel 6ed860e314 2007-11-11 17:56:19 +00:00
Tom Rothamel 0977253227 Beginning release process. 2007-11-11 05:46:40 +00:00
Tom Rothamel c8ea5ef55c Many changes. 2007-11-09 08:38:12 +00:00
Tom Rothamel a138844faf Character rewrite. 2007-11-08 06:15:42 +00:00
Tom Rothamel 23b520c773 2007-11-07 04:37:34 +00:00
Tom Rothamel 937c2b167a Modified the behavior of return so that it evaluates the return
expression with the values of dynamic variables found inside the
function that has been called.

Added a new variable, _mouse_visible, that controls if the mouse 
should be visible at any given moment. [doc]

renpy.with_statement and ui.interact now take a clear argument, which 
controls if the transient layer is cleared at the end of a transition
or interaction. [doc]

The new At function provides a nicer syntax for applying position
objects (the result of Position, Move, etc.) to displayables. [doc]
2007-11-02 02:55:18 +00:00
Tom Rothamel 4e78cee1d8 2007-10-03 01:52:34 +00:00
Tom Rothamel 8aca0c9d4f Bugfix, changelog cleaned. 2007-10-01 00:51:14 +00:00
Tom Rothamel 839e7e2569 The new ui.timer function lets you call a function after a certain
amount of time has passed. The function may be called once, or it may
repeat. [doc]


The ui.remove function removes a displayable from a layer.
2007-09-26 05:28:22 +00:00
Tom Rothamel 0c57985968 The code for supporting hyperlinks (the {a} text tag) has been
rewritten. It is now possible for hyperlinks to span more than one
line. It is also possible to have code run when a hyperlink has been
focused, using the config.hyperlink_focus callback. 

This necessitated some changes to how hyperlinks work. They are no
longer buttons, so style.hyperlink is no longer used... now, only
style.hyperlink_text is used to change the look of a hyperlink.



The new im.AlphaMask image operator lets you use an image to
alpha-mask another. The new config.missing_image_callback lets you
specify a function that's called when an image is missing. Together,
they provide the necessary infrastructure for JCC--- JPEG Compression of
Character art.
2007-09-25 04:29:32 +00:00
Tom Rothamel 8313ab8ad6 The subtitle layout algorithm now properly deals with newlines. 2007-09-11 14:19:23 +00:00
Tom Rothamel 4fb0edcbfe 2007-08-27 02:22:57 +00:00
Tom Rothamel 09f5d23aa5 2007-08-13 14:41:32 +00:00
Tom Rothamel 26dc030a4d 2007-08-12 16:38:02 +00:00
Tom Rothamel ef10644285 2007-08-11 03:54:49 +00:00
Tom Rothamel affeece1f3 2007-08-11 00:56:59 +00:00
Tom Rothamel caa1b6c261 2007-08-10 03:52:23 +00:00
Tom Rothamel 46b2934867 2007-08-08 22:43:55 +00:00
Tom Rothamel 448ca5f0a8 2007-08-07 01:06:08 +00:00
Tom Rothamel 9fc21619ad 2007-07-31 12:24:19 +00:00
Tom Rothamel e08b6e4a16 2007-07-31 12:23:55 +00:00
Tom Rothamel 1252d7af95 2007-07-31 12:23:25 +00:00
Tom Rothamel 1b731fe48d 2007-07-31 12:23:13 +00:00
Tom Rothamel 99b252fb53 Documented how displayables work, and how users can define their own
displayables. This involved making public the types renpy.Displayable,
renpy.Render, and renpy.IgnoreEvent; and the functions renpy.render, 
renpy.redraw, and renpy.timeout.
2007-07-31 12:22:03 +00:00
Tom Rothamel 5049dd2ea0 2007-07-28 23:29:12 +00:00
Tom Rothamel c8daf0df77 2007-07-28 20:18:04 +00:00
Tom Rothamel 97673f7f48 renpygame initial 2007-07-24 02:42:39 +00:00
Tom Rothamel 3efb0d562e 2007-07-14 00:18:49 +00:00
Tom Rothamel 0d341dfe62 2007-07-13 05:29:43 +00:00
Tom Rothamel 69d7576d28 2007-07-09 23:13:20 +00:00
Tom Rothamel 2e37647bd4 2007-07-09 22:31:43 +00:00
Tom Rothamel 37bbe802ea 2007-07-09 16:47:37 +00:00
Tom Rothamel 5c7d844c6c 2007-07-07 04:59:47 +00:00
Tom Rothamel 1211d223b2 2007-06-30 18:42:12 +00:00
Tom Rothamel 46ed470dba Focus fixes. 2007-06-23 04:52:20 +00:00
Tom Rothamel a50b8c81f8 2007-06-21 01:46:52 +00:00
Tom Rothamel 9400f65550 2007-06-18 16:10:45 +00:00
Tom Rothamel 8f76c07757 2007-06-18 16:07:14 +00:00
Tom Rothamel 8ab6342a3b 2007-06-17 03:38:35 +00:00
Tom Rothamel f6b3a1e72b 2007-06-12 21:49:17 +00:00
Tom Rothamel 22897cad88 2007-06-11 17:30:48 +00:00
Tom Rothamel ad38cd75d7 2007-06-11 17:30:21 +00:00
Tom Rothamel afe820df47 2007-06-11 17:27:17 +00:00
Tom Rothamel c300147785 2007-06-10 14:13:29 +00:00
Tom Rothamel 4dc589e254 2007-06-10 13:43:59 +00:00
Tom Rothamel afc351550b 2007-06-10 03:22:02 +00:00
Tom Rothamel fd41cfd159 2007-06-10 02:46:18 +00:00
Tom Rothamel 43f767f311 2007-06-07 21:27:02 +00:00
Tom Rothamel 781b779fb1 2007-06-07 05:23:11 +00:00
Tom Rothamel 9a6f2234de 2007-06-06 04:27:17 +00:00
Tom Rothamel e646aaefa7 box_layout=fixed.
renpy.image_size

MPEG-1 movies can now be read out of archive files.
2007-06-05 04:00:53 +00:00
Tom Rothamel a4d1a60f22 2007-06-02 15:51:38 +00:00
Tom Rothamel 905146012f Massive changes to style system. 2007-06-01 05:09:26 +00:00
Tom Rothamel 8e96e83e8e Improving the style system muchly. 2007-05-31 05:51:23 +00:00
Tom Rothamel 5f8b866592 Show text and centered now display their text using the "subtitle"
layout algorithm, which tries to minimize the difference in line
length.
2007-05-27 16:18:58 +00:00
Tom Rothamel 367ae0b7b0 fixed nw, warn about config.developer 2007-05-27 15:40:54 +00:00
Tom Rothamel 04ba009ff0 There is a new style inspector, which can be activated with 'I' when
config.developer is true. [elaborate, doc, implement]


The activate_ property prefix has made a comeback. This prefix is
applied to buttons that have been selected by the user. It is applied
when the button is first selected (while the clicked function is
running). If the clicked function returns a non-None value, or an 
exception, then the button remains activated forever. [doc]


The new xoffset and yoffset placement properties allow one to specify 
a pixel offset to the position computed using xpos/xanchor and
ypos/yanchor. This makes it easy to specify, say, that a button's
label should be a pixel or two above center. [doc]


The default roundrect theme now takes a new argument, less_rounded. If
True, this will use the 6-pixel rounded rectangles, even on an 800x600
game. This is the default for new projects. [doc, implement]


Setting _game_menu_screen = None prevents the game menu from being
shown. (Setting it to a value like "_save_screen" or "_load_screen"
shows the game menu again.) This is the default during the
splashscreen. [doc]
2007-05-21 15:43:05 +00:00
Tom Rothamel 4b82958e7b Setting _game_menu_screen = None prevents the game menu from being
shown. (Setting it to a value like "_save_screen" or "_load_screen"
shows the game menu again.) This is the default during the
splashscreen. [doc]


NVLCharacter has a new parameter, clear, that if true causes the nvl-mode
screen to be cleared after that character speaks. [doc]


Rewrote the input handling code. Now, we can deal with keysyms prefixed 
with alt_, shift_, and noshift_.
2007-05-19 17:56:23 +00:00
Tom Rothamel 2cfde4ba75 2007-05-12 02:58:33 +00:00
Tom Rothamel 50cea93c5c Adding ColorMatrix/MatrixColor code. 2007-05-09 04:29:36 +00:00
Tom Rothamel 72dcb7304d Fixed a bug that prevented ui.at from working properly. 2007-05-04 23:43:51 +00:00
Tom Rothamel 44296c7a4d Added a function, renpy.seen_label, that returns True if a label has
been executed at least once, in any execution of the game. [doc]
2007-05-04 13:31:59 +00:00
Tom Rothamel 10d7a57a6a Fixed Ren'Py such that movies properly loop when required. Changes
renpy.movie_cutscene so that it allows a delay of None, which will
delay until the user clicks. (Note that you still need to specify
loops=-1 in this case.) [doc]
2007-05-03 19:03:18 +00:00
Tom Rothamel c82821fdd6 2007-04-25 18:54:40 +00:00
Tom Rothamel 1914df46b4 Added retag. 2007-04-22 16:08:58 +00:00
Tom Rothamel 3e2ca9e289 2007-04-22 16:07:37 +00:00
Tom Rothamel fb4bd94074 Tagging script. 2007-04-22 16:06:38 +00:00
Tom Rothamel d0ea38c849 Updated demo for 6.2.0b. 2007-04-22 15:14:56 +00:00
Tom Rothamel 579cce34ab Adding support for the {nw} tag. 2007-04-21 16:41:52 +00:00
Tom Rothamel 5c814cc5e1 6.2.0 ready. 2007-04-21 04:14:17 +00:00
Tom Rothamel 2669834fea 2007-04-21 02:02:06 +00:00
Tom Rothamel c7713a655b 2007-04-19 04:52:15 +00:00
Tom Rothamel aeb3e804dd 2007-04-16 01:20:51 +00:00
Tom Rothamel db3bc691aa 2007-04-14 20:22:09 +00:00
Tom Rothamel 3c7253ca33 2007-04-14 14:55:33 +00:00
Tom Rothamel 65e855cbe4 2007-04-12 03:33:54 +00:00
Tom Rothamel b3ecf203f0 2007-04-12 03:06:55 +00:00
Tom Rothamel 7e83dc7489 2007-04-11 17:14:20 +00:00
Tom Rothamel 5a97d433a7 Fix for lint on non-unicode files. 2007-04-10 20:17:58 +00:00
Tom Rothamel 8cd8e3e44d 2007-04-09 15:17:24 +00:00
Tom Rothamel 131e28b852 More autosave tweaks. 2007-04-08 16:03:51 +00:00
Tom Rothamel 166d29b7e1 Initial add of auto-save. 2007-04-08 14:51:04 +00:00
Tom Rothamel 1096fabb32 2007-04-07 05:00:50 +00:00
Tom Rothamel 4057ef583a Normalize archive paths. 2007-04-04 18:49:30 +00:00
Tom Rothamel 6ddd7aa60f 2007-04-03 15:33:21 +00:00
Tom Rothamel f3faf25c68 Merging branch. 2007-04-03 14:40:59 +00:00
Tom Rothamel 7c1ed208ad Merging branch. 2007-04-03 14:40:42 +00:00
Tom Rothamel d6322ba74d 2007-04-03 14:34:34 +00:00
Tom Rothamel 8de38e73c7 2007-03-22 04:21:08 +00:00
Tom Rothamel b925f24003 Making more robust against lacking savedir. 2007-03-21 02:53:04 +00:00
Tom Rothamel c438d17a3d 2007-03-21 02:52:10 +00:00
Tom Rothamel 3b18d46a8b 2007-03-21 02:51:45 +00:00
Tom Rothamel 3e25a4b8b8 2007-03-21 02:47:32 +00:00
Tom Rothamel eb5aaa46ae 2007-03-18 02:16:06 +00:00
Tom Rothamel ddd84b207e 2007-03-18 01:10:50 +00:00
Tom Rothamel 4e61ebeaf7 2007-03-17 02:10:13 +00:00
Tom Rothamel 91b1556b8a Added .rpe extension system. 2007-03-17 01:42:11 +00:00
Tom Rothamel 7e0257e167 The black screen of death. 2007-03-15 00:19:40 +00:00
Tom Rothamel f21d70e9fa Implemented a new trace mode that will help to diagnose problems with
Ren'Py itself. Supplying the --trace option to Ren'Py will write
information about function calls to trace.txt. Supplying --trace twice 
will also dump information about line execution and function
returns. Note that trace mode comes with a significant speed penalty, 
when active.
2007-03-13 20:54:08 +00:00
Tom Rothamel ea41bb9cd0 Removed remaining instances of 'with'. (hopefully) 2007-03-10 16:38:37 +00:00
Tom Rothamel 14c28b927a 2007-03-10 07:48:08 +00:00
Tom Rothamel 5b9b176f66 2007-03-10 07:40:26 +00:00
Tom Rothamel 0348445dec 2007-03-10 07:18:54 +00:00
Tom Rothamel c41fc41e90 2007-03-10 07:12:33 +00:00
Tom Rothamel fa37e2e556 2007-03-08 19:13:00 +00:00
Tom Rothamel 5bcee73df4 2007-03-07 18:21:56 +00:00
Tom Rothamel ddfd44915f 2007-03-05 02:33:16 +00:00
Tom Rothamel 9b03c8e8c2 2007-03-05 02:08:24 +00:00
Tom Rothamel c0badd8de8 2007-03-04 15:56:45 +00:00
Tom Rothamel 4d5c2713c2 2007-03-04 14:22:07 +00:00
Tom Rothamel d3a8d0e2d6 2007-03-04 00:56:43 +00:00
Tom Rothamel 1da77b7856 2007-03-04 00:42:30 +00:00
Tom Rothamel d2bc6ca31f 2007-03-02 04:42:21 +00:00
Tom Rothamel 8fd9fe41f8 2007-02-28 07:30:47 +00:00
Tom Rothamel 032c9a1b10 2007-02-28 05:48:58 +00:00
Tom Rothamel 91ba41bc88 2007-02-27 06:01:33 +00:00
Tom Rothamel 931e6df719 text_cps 2007-02-21 19:55:34 +00:00
Tom Rothamel e2814a71cd Make Animation adjust the shown timebase. 2007-02-20 20:38:27 +00:00
Tom Rothamel 6f10cbac14 Checking in shell script. 2007-02-20 13:05:55 +00:00
Tom Rothamel c0d923b928 Updated Dissolve and ImageDissolve transitions. 2007-02-20 06:30:39 +00:00
Tom Rothamel fed151ff01 2007-02-20 06:16:11 +00:00
Tom Rothamel b6fde297fa Implement more config.*transition variables, propery color insensitive
load slots.
2007-02-18 04:52:18 +00:00
Tom Rothamel 075ae8d282 New style system, et al. 2007-02-17 22:22:50 +00:00
Tom Rothamel affb926ff3 2007-02-14 19:28:35 +00:00
Tom Rothamel 3c7e27c9cf 2007-02-14 18:13:23 +00:00
Tom Rothamel bb18aed24c 2007-02-08 05:21:10 +00:00
Tom Rothamel ed3c0d3f0d 2007-02-08 04:07:33 +00:00
Tom Rothamel 6727ee4511 2007-02-06 16:02:04 +00:00
Tom Rothamel afbd8af715 2007-02-06 15:34:09 +00:00
Tom Rothamel 672b12a2cd 2007-02-06 15:00:26 +00:00
Tom Rothamel 306f591e4b 2007-02-05 14:56:48 +00:00
Tom Rothamel 9a9d8db41d 2007-02-04 20:15:39 +00:00
Tom Rothamel bdaf3c0ed4 2007-02-04 15:24:17 +00:00
Tom Rothamel bcaf88f8a3 2007-02-04 15:23:18 +00:00
Tom Rothamel 0be97c3f2c 2007-02-04 06:43:47 +00:00
Tom Rothamel db0576a125 2007-02-03 16:38:38 +00:00
Tom Rothamel f9e36e8854 2007-02-01 23:02:56 +00:00
Tom Rothamel 79f669d409 2007-02-01 05:35:30 +00:00
Tom Rothamel bbbb05868e 2007-01-29 19:22:21 +00:00
Tom Rothamel b9ebbd8014 2007-01-29 14:31:10 +00:00
Tom Rothamel 0db2e1c9a2 2007-01-28 23:23:23 +00:00
Tom Rothamel 29254c2f93 2007-01-28 19:49:38 +00:00
Tom Rothamel 113c335adb 2007-01-28 19:34:48 +00:00
Tom Rothamel 2647c57cd7 Lets the user specify extensions to ignore. 2007-01-28 16:55:13 +00:00
Tom Rothamel 4dc6d3b3f8 2007-01-26 01:19:55 +00:00
Tom Rothamel 87111417a8 2007-01-26 00:29:44 +00:00
Tom Rothamel 2fdf4264b2 Adding the question. 2007-01-26 00:28:19 +00:00
Tom Rothamel 55763227a8 2007-01-24 13:58:40 +00:00
Tom Rothamel 262ef1045b 2007-01-24 13:57:07 +00:00
Tom Rothamel f44de50bf6 2007-01-24 13:54:45 +00:00
Tom Rothamel af57916916 Adding user-defined statements. 2007-01-24 13:45:36 +00:00
Tom Rothamel 5e5aa4c96a 2007-01-19 09:26:49 +00:00
Tom Rothamel d2400eda05 2007-01-13 02:35:27 +00:00
Tom Rothamel 67fc45b0e0 2007-01-08 20:44:41 +00:00
Tom Rothamel 8e058e9ffb 2007-01-08 15:44:22 +00:00
Tom Rothamel c01294b5a1 2007-01-08 15:07:43 +00:00
Tom Rothamel 79eea14456 hovered can return a value, ending an interaction.
various ways of configuring the menus.

RotoZoom.
2007-01-08 00:19:07 +00:00
Tom Rothamel 061a12c273 2007-01-02 20:19:29 +00:00
Tom Rothamel 5a628e16fd 2007-01-02 20:03:02 +00:00
Tom Rothamel fd1bc58f3e Added improved MoveTransition. 2007-01-02 17:44:01 +00:00
Tom Rothamel 4e60aa72d1 Default to 32-bit, change MoveTransition. 2007-01-02 07:47:17 +00:00
Tom Rothamel 41d0b7ca95 2007-01-01 19:34:31 +00:00
Tom Rothamel 57347e7032 2006-12-31 22:18:49 +00:00
Tom Rothamel 483f05edba 2006-12-31 11:51:24 +00:00
Tom Rothamel d1e1b65647 2006-12-31 08:45:14 +00:00
Tom Rothamel e99267fdca 2006-12-23 08:19:05 +00:00
Tom Rothamel 63179fc49a It is now possible to supply a function that determines if the say
statement is allowed to be dismissed, by setting
config.say_allow_dismiss. ui.saybehavior has been updated with similar
functionality. This was added to support children's games, where
dismissing dialogue before it's fully spoken harms the value of a game
as a pedagogical tool... this functionality should not be used in visual 
novels aimed at adults.
2006-12-20 04:12:18 +00:00
Tom Rothamel cf9376d453 2006-12-16 18:19:19 +00:00
Tom Rothamel 02ae2fcaaf 2006-12-15 04:23:05 +00:00
Tom Rothamel 2fdf3b2565 2006-12-15 03:09:02 +00:00
Tom Rothamel badf120507 2006-12-15 03:06:43 +00:00
Tom Rothamel ac6351b801 2006-12-15 03:05:55 +00:00
Tom Rothamel 16115db8fe Added more checks to lint. 2006-12-14 23:59:18 +00:00
Tom Rothamel 16c7ccfe26 The new config.image_buttons and config.image_labels variables can now
be used to replace the buttons and labels (respectively) found on the
game and main menus with image-based replacements.

The new focus_mask property allows image buttons to take a mask image
that defines where the mouse must be for it to be focused. The
focus_rect property lets a subrectangle be used to specify focus, when
two imagebuttons overlap.
2006-12-12 16:29:47 +00:00
Tom Rothamel 9a68d0501f We now store a digest of .rpy files in the corresponding .rpyc
file. This will allow us to detect that the .rpy file has changed,
even if there are problems with the system clock.
2006-12-03 21:03:54 +00:00
Tom Rothamel 8c4741f91c The show statement now takes a 'behind' clause, which gives a list of
image tags the current image should be shown behind.

Demo minigame.

Launcher fixes.
2006-11-24 18:49:46 +00:00
Tom Rothamel f9778ca346 2006-11-20 18:53:55 +00:00
Tom Rothamel 5513c10593 Bactick strings. 2006-11-20 05:20:45 +00:00
Tom Rothamel d21d756764 2006-11-15 23:56:42 +00:00
Tom Rothamel 985e66eedc 2006-11-15 03:15:55 +00:00
Tom Rothamel a28b88067f Implemented the ui.keymap function, which lets one easily map keys to
functions.

Modified the launcher so the user can chose which files are archived
by the "Archive Files" tool. (Which has been renamed from "Archive Images".)

Fixed a bug that prevented new projects from being created under
Linux.
2006-11-15 03:15:43 +00:00
Tom Rothamel 6f0e0b4982 2006-11-10 04:31:05 +00:00
Tom Rothamel e13cf875bb Bug fixing. 2006-11-10 04:12:57 +00:00
Tom Rothamel 18b4acd852 2006-11-10 03:26:20 +00:00
Tom Rothamel bfd380f028 2006-11-10 03:02:11 +00:00
Tom Rothamel 7b7a93954d 2006-11-10 02:10:02 +00:00
Tom Rothamel 23412f847a 2006-11-10 01:59:50 +00:00
Tom Rothamel e06d275fb0 2006-11-10 01:58:57 +00:00
Tom Rothamel cb046b7387 2006-11-10 01:57:04 +00:00
Tom Rothamel 46e0c3bd7a Ren'Py now considers config.has_sound, config.has_music, and
config.has_voice when assigning mixer names to channels. If all of
these are set False, sound will be disabled. If only some are set,
only those mixers will control system volume.
2006-11-09 05:00:40 +00:00
Tom Rothamel 4958185439 2006-11-09 04:33:01 +00:00
Tom Rothamel 6a33d26c41 2006-11-08 06:29:34 +00:00
Tom Rothamel ea48335834 2006-11-07 05:54:14 +00:00
Tom Rothamel c18a2e2689 2006-11-02 14:53:37 +00:00
Tom Rothamel e29003763b Ren'Py now attempts to automatically determine if the RLE optimization
will be profitable, and will automatically use the RLE optimization if
it deems it worthwhile.
2006-10-29 06:33:41 +00:00
Tom Rothamel cb62a2b962 SnowBlossom now takes a fast argument, which if true causes the
particles to start all at once all over the screen, rather then at the
top or the bottom only.
2006-10-29 05:45:56 +00:00
Tom Rothamel 29ec48d023 Export displayables, update DynamicDisplayable, Character.copy() 2006-10-18 12:52:17 +00:00
Tom Rothamel 6b77899000 library. -> config. transmigration. 2006-10-14 20:44:30 +00:00
Tom Rothamel 3da2ff55a6 Added roll forward to the other interactions. 2006-10-14 11:25:44 +00:00
Tom Rothamel af5ea04ec5 Roll forward through menus.
Skipping multiple transitions at once.
2006-10-14 03:41:33 +00:00
Tom Rothamel 11ac2a5a8d 2006-10-08 14:47:50 +00:00
Tom Rothamel ed1a8cbabc Various fixes. 2006-10-08 14:28:50 +00:00
Tom Rothamel c61f0ff965 2006-10-04 02:36:00 +00:00
Tom Rothamel b21a6449d0 Bug fixes. 2006-10-04 02:06:24 +00:00
Tom Rothamel 793fd1238a Finalized 5.6.2. 2006-10-02 18:01:49 +00:00
Tom Rothamel ff653f0fd9 2006-10-01 15:34:01 +00:00
Tom Rothamel 4d47ba7a42 2006-10-01 14:09:56 +00:00
Tom Rothamel 6406307317 2006-10-01 14:00:42 +00:00
Tom Rothamel cc8cdf059f 2006-10-01 13:59:55 +00:00
Tom Rothamel d6d64bd115 Now building working Linux dist. 2006-09-30 02:50:39 +00:00
Tom Rothamel 6081783a9d 2006-09-29 23:56:45 +00:00
Tom Rothamel 5080052728 Launcher work continues. 2006-09-29 03:40:18 +00:00
Tom Rothamel 90da02fa68 Reorg. 2006-09-27 02:32:57 +00:00
Tom Rothamel dd67724968 Reordering directories. 2006-09-27 01:02:45 +00:00
Tom Rothamel a163c4fc00 RLE bug fix.
Changed the way we look for directories.
2006-09-25 02:24:39 +00:00
Tom Rothamel 8504a7b80c Fixed a bug that manifested itself in a crash when a clipped
Displayable was placed at (x, y) where x <= 0 and y <= 0.

Fixed a focus bug that made it difficult to unhide windows.
2006-09-15 12:50:38 +00:00
Tom Rothamel a1472a9dcc 2006-09-14 02:06:34 +00:00
Tom Rothamel 2c08690d59 Readying 5.6.1. 2006-09-13 23:23:39 +00:00
Tom Rothamel b041d707fb Readying 5.6.1. 2006-09-13 23:23:04 +00:00
Tom Rothamel 760b1ae30c Previously, in statements with a transition, focusable objects from
the old scene could be assigned the default focus. This is no longer
possible.

Auto-forward mode now takes into account the {fast} text tag.
2006-09-13 13:08:32 +00:00
Tom Rothamel ce7bd1f915 Now can add layer to save games. 2006-09-12 12:45:26 +00:00
Tom Rothamel 19e5260a89 After a load, the user can roll back the number of screens he could
before the load. Previously, this number was one less.
2006-09-12 04:18:27 +00:00
Tom Rothamel 5846f6ba4c 2006-09-11 18:56:02 +00:00
Tom Rothamel 54662088de Prevented hang when executing a with statement without a prior shown
scene.
2006-09-11 14:48:56 +00:00
Tom Rothamel 30f05caf42 Improved the precision of bilinear scaling, which fixes artifacting
experienced with very small source surfaces.
2006-09-11 12:18:34 +00:00
Tom Rothamel 0657723374 Fixed a bug in the way python code was pre-compiled. This bug
manifested by "phantom syntax-errors", syntax errors that would occur
again the first time Ren'Py was started after they were first
eliminated.
2006-09-11 12:09:39 +00:00
Tom Rothamel 55edf3e373 2006-09-08 03:30:25 +00:00
Tom Rothamel c36fadbbe2 A regression involving PNG images with colorkey alpha has been
fixed. I didn't realize PNG images _could_ have colorkey alpha. Go
figure.
2006-09-07 17:52:12 +00:00
Tom Rothamel 6882c6a74e Various bug-fixes. 2006-09-07 12:41:03 +00:00
Tom Rothamel 25f29aacf6 Fixed bug with fast skipping. 2006-09-06 20:07:55 +00:00
Tom Rothamel 735332ef86 2006-09-06 01:56:58 +00:00
Tom Rothamel 75ba12c5aa Readying 5.6.0. 2006-09-06 01:49:06 +00:00
Tom Rothamel 5fd4ed6238 2006-09-06 00:35:37 +00:00
Tom Rothamel c9bc47c35e Working on changelog. 2006-09-04 20:55:21 +00:00
Tom Rothamel 6ad478f61b Improve speed of rollback (to the point where its reasonable again. 2006-09-04 19:49:46 +00:00
Tom Rothamel 520129321d Updated demo. 2006-09-04 06:22:17 +00:00
Tom Rothamel ba032fe806 2006-09-04 05:02:13 +00:00
Tom Rothamel 5423af98d5 New syntax for say statements. 2006-09-04 04:55:19 +00:00
Tom Rothamel 65030ada99 Add zorder to scene list. 2006-09-03 14:55:49 +00:00
Tom Rothamel 875d7b4410 Bilinear Filtering done. 2006-09-03 04:41:23 +00:00
Tom Rothamel ba58ec003a Many fixes involving clipped layers. 2006-09-01 16:05:59 +00:00
Tom Rothamel fd28ad3600 Some backwards compat fixes, introduced menu_button, moved implicit with Nones to say, menu, pause, imagemap, and input. 2006-08-31 02:22:25 +00:00
Tom Rothamel 9a07dce963 Initial go at minigame support. 2006-08-30 13:09:55 +00:00
Tom Rothamel 83f3f04c4d Integrated two_window and side_image into Character. 2006-08-30 00:53:28 +00:00
Tom Rothamel 73e0cbea16 MoveTransition gets a factory; Motion, Zoom, Move and Pan get time_warp. 2006-08-29 01:58:49 +00:00
Tom Rothamel 1b13951ee0 MultiPersistent, etc. 2006-08-28 23:25:36 +00:00
Tom Rothamel f6659b3873 Switched fonts to DejaVu. 2006-08-28 21:20:42 +00:00
Tom Rothamel 6a0748e3bf Implemented the ability to clip layers to sub-parts of the screen. 2006-08-27 16:03:54 +00:00
Tom Rothamel f66e2a0649 Made as and depth keywords. 2006-08-25 01:07:22 +00:00
Tom Rothamel 4564820e3c implicit with None, and changes to support always_show_window. 2006-08-24 02:00:04 +00:00
Tom Rothamel 06e4e8c21c 2006-08-23 01:40:06 +00:00
Tom Rothamel 6ebfce1b1a Improved debugging of python blocks. 2006-08-23 01:39:12 +00:00
Tom Rothamel f67a398eda im.Color and Frame(tile=True). 2006-08-23 01:02:45 +00:00
Tom Rothamel 7f3251d15a Added checking of style properties.
Added easy colors and displayables.
2006-08-23 00:40:47 +00:00
Tom Rothamel bfbc271801 New prefs system. Prefs compat.
New main menu pic.
2006-08-22 23:33:40 +00:00
Tom Rothamel ee629cb316 Ren'Py now checks, when parsing a file, that image statements are
contained within init blocks. It has long been an error to run an
image statement outside of an init block, so this primarily checks for
useless init statements.
2006-08-20 19:40:26 +00:00
Tom Rothamel 5cfdb1d6a6 When changing the script, Ren'Py now tries fairly hard to assign
statements the same internal name they had in the previous version of
the script. This means that it's now usually possible to load in a
changed script, and come back to roughly the spot where you left
off. (Previously, the closest we would come is the prior label.) Of
course, variables are given the values they when the game was saved.

This allows us to implement a new feature. Pressing shift+R when
config.developer is set saves the game, reloads the script from disk,
and then reloads the game. Doing this generally brings you to the last
unchanged line seen before saving, making it easy to edit the script
and then see your changes in action. Like many developer features,
this may not work perfectly in all circumstances.
2006-08-20 19:26:31 +00:00
Tom Rothamel d5396466d8 Fixed a bug, reported by Shaja, that prevented pauses from terminated
when they occured in interactions beginning with a transition, when no
events occured during the interaction. A symptom of the bug was that
if the user moved the mouse, the pause would immediately terminate and
the game would advance.
2006-08-20 02:43:32 +00:00
Tom Rothamel 8a591c38df Added a function, renpy.showing() that allows us to check to see if
an image is shown or not.
2006-08-17 19:40:23 +00:00
Tom Rothamel db4fcb1397 When changing the script, Ren'Py now tries fairly hard to assign
statements the same internal name they had in the previous version of
the script. This means that it's now usually possible to load in a
changed script, and come back to roughly the spot where you left
off. (Previously, the closest we would come is the prior label.) Of
course, variables are given the values they when the game was saved.
2006-08-15 12:54:16 +00:00
Tom Rothamel b2ca030729 O3-Inspired changes. New Eileen art from Piroshki. 2006-08-13 21:50:50 +00:00
Tom Rothamel 38f4ad4168 2006-08-10 00:00:45 +00:00
Tom Rothamel b33308d3a1 2006-08-09 23:16:46 +00:00
Tom Rothamel 314311c7e8 We now look for the presplash image in the "game" and "data" directories,
as well as the directory derived from the script filename.
2006-08-09 02:35:32 +00:00
Tom Rothamel b2d3107035 2006-08-08 11:39:59 +00:00
Tom Rothamel fe7ecc8221 2006-08-08 02:45:59 +00:00
Tom Rothamel d265c93bcc 2006-08-08 01:22:44 +00:00
Tom Rothamel e6ea26ad93 2006-08-08 01:22:19 +00:00
Tom Rothamel ba61ef1f1f 2006-08-08 01:00:50 +00:00
Tom Rothamel 69f51ed383 2006-08-03 19:56:55 +00:00
Tom Rothamel d242595213 2006-08-02 00:09:27 +00:00
Tom Rothamel 678581f165 Bars now support vertical mode, and invert mode. [expand, doc] 2006-07-28 19:33:55 +00:00
Tom Rothamel 3db637bbcf Changed preload to predict, as predict is the name I kept using. 2006-07-28 18:06:48 +00:00
Tom Rothamel e328ca32d9 2006-07-26 11:01:02 +00:00
Tom Rothamel 4533f541c4 Now, renpy.preload can be called to programatically preload an image. [doc] 2006-07-24 23:42:07 +00:00
Tom Rothamel a23bbff40d Fixed bug that prevented text from changing color when focused.
Fixed bug that caused wrong displayble to be focused.
2006-07-24 23:21:43 +00:00
Tom Rothamel e96f87763a Fixed a use-after-free bug in the sound playback code. The result of
this bug was random crashing when changing music.
2006-07-23 13:11:54 +00:00
Tom Rothamel 27725bd81e There is now a new method of recoloring that allows one to specify two
colors, one of which replaces white and one which replaces
black. This is accessed through im.Twocolor. This effect can also be
applied to SFonts using the black_color style property.
2006-07-19 23:01:37 +00:00
Tom Rothamel 3f8560ed0e 2006-07-15 23:53:40 +00:00
Tom Rothamel 89ea7c7f9b Fixing bug with empty lines in Text. 2006-07-15 23:52:27 +00:00
Tom Rothamel 5f02f63aa6 Fixed bug in is_fullscreen. 2006-07-15 20:41:10 +00:00
Tom Rothamel 05d696ef45 Fixed a bug in which some variables were not saved after the game was
restarted. This is a fairly major bug that could affect end users in
certain circumstances.
2006-07-15 20:39:32 +00:00
Tom Rothamel 7e3d7ac0e1 A new optimization is that we only draw images that are above the
uppermost full-screen image that does not have an alpha channel.
Images below this image cannot be seen, and now are not drawn. This
optimization only considers the presence or absence of an alpha
channel, and not the content of that channel. So a PNG image with an
alpha channel that has full opacity will not trigger this
optimization, while the same image with the alpha channel removed will.
2006-07-12 01:29:16 +00:00
Tom Rothamel 52925ba42f Window and button backgrounds no participate in layout, using xpos,
xanchor, ypos, and yanchor.

There are now two new properties, xalign and yalign. Assigning to xalign
is equivalent to assigning the same value to xpos and xanchor, and
similarly for yalign. This means that it is now possible to write
xalign=0.5 to center a displayable, rather than having to write
xpos=0.5, xanchor=0.5. [doc]
2006-07-08 14:28:03 +00:00
Tom Rothamel e0da35a499 Doc updates, mostly. 2006-07-05 13:51:40 +00:00
Tom Rothamel 9f965f3e32 Y now dumps styles when config.developer is True... update keymap and doc. 2006-07-04 15:24:24 +00:00
Tom Rothamel df1db159ae Doc updates, make public Text. 2006-07-04 14:08:25 +00:00
Tom Rothamel fa46038dcc 2006-06-28 21:46:27 +00:00
Tom Rothamel 38150544c0 Interim release. 2006-06-27 23:15:30 +00:00
Tom Rothamel e097848384 2006-06-27 15:28:22 +00:00
Tom Rothamel eb35a4c75f Configurable text layout algorithm. [doc] 2006-06-27 02:50:13 +00:00
Tom Rothamel b3c0fd0f4f Cut release. 2006-06-10 16:56:30 +00:00
Tom Rothamel 509313f7a0 2006-06-01 20:43:15 +00:00
Tom Rothamel eaebc28c62 Finalizing 5.5.2. 2006-06-01 14:02:48 +00:00
Tom Rothamel 866924087e SFonts are now rendered in color. When a non-(255, 255, 255, 255)
color is supplied to a SFont, the supplied image is remapped so that
each channel has its value interpolated between 0 and the supplied
color. Most importantly, this means that white pixels will have the
supplied color. This functionality means that drop shadows are now
rendered correctly.
2006-06-01 13:20:44 +00:00
Tom Rothamel 059b7287a1 Fixed a bug that prevented Animations with long or no repeats from
functioning correctly.
2006-05-31 19:46:58 +00:00
Tom Rothamel 32e9a2cd1d 2006-05-30 03:30:17 +00:00
Tom Rothamel 59b90471a0 2006-05-29 15:15:37 +00:00
Tom Rothamel 097ab320ca DynamicDisplayable and hyperlinks and Displayable.visit have all been added. 2006-05-28 13:38:16 +00:00
Tom Rothamel e170e453d2 UTF-8 Title. 2006-05-22 16:44:28 +00:00
Tom Rothamel 11ee50cd3a Two small fixes. 2006-05-20 17:02:51 +00:00
Tom Rothamel 163f12a7e2 Fixed a longstanding bug in the DSE that prevented event.only and
event.solo from working.
2006-05-11 16:12:20 +00:00
Tom Rothamel c546662c2a Added im.Flip. 2006-05-05 03:58:38 +00:00
Tom Rothamel be213d0ed0 Fixed a bug with clipping rectangle computations, when faced with an
image larger then the screen.
2006-05-02 01:47:13 +00:00
Tom Rothamel 301203cd88 5.5.0 Feature Complete 2006-04-30 00:42:31 +00:00
Tom Rothamel 44067c771a 2006-04-28 22:10:30 +00:00
Tom Rothamel fc805a2231 2006-04-28 21:44:23 +00:00
Tom Rothamel fb7bb99486 Added config.sound. 2006-04-28 12:47:23 +00:00
Tom Rothamel 732311fccc A bug that prevented a fixed click-to-continue indicator from working
has been fixed.
2006-04-22 18:35:40 +00:00
Tom Rothamel 21ab52c33b The screenshots taken with the 's' key are now PNGs, rather than BMPs.
There is a new image operation, im.Recolor, that can be used to
recolor each channel of an image.
2006-04-19 20:18:45 +00:00
Tom Rothamel d513eca182 library.main_menu_music
Character(show_...=...)

And more.
2006-04-18 04:21:07 +00:00
Tom Rothamel c0773533e3 Renamed some styles. 2006-04-14 13:18:34 +00:00
Tom Rothamel bd1ef6d3e3 2006-04-14 03:01:16 +00:00
Tom Rothamel 7805095b96 2006-04-13 20:47:49 +00:00
Tom Rothamel 8cf2533d51 2006-04-13 20:47:19 +00:00
Tom Rothamel 8d72e223b7 All sorts of minor changes. 2006-04-10 19:13:54 +00:00
Tom Rothamel 63bdd908bd +++
config.with_callback has been changed. It now takes two arguments. The
first is the transition being performed. If this transition is a None
transition created as part of a scene, show, or hide statement, then
the second argument is the transition found in that
statement. Otherwise, it is None. config.with_callback is now requried
to return a transition, which replaces the specified
transition. Hopefully, this is enough to make with_callback useful, by
always giving the callback information specified by the user.
2006-04-09 18:36:09 +00:00
Tom Rothamel c2e4e655c6 The list of characters used by SFonts was wrong, so that has been
fixed. The documentation has also been improved to include a
convenient list of what those fonts should look like.
2006-04-09 17:21:41 +00:00
Tom Rothamel 5a0fcb1c1a 2006-04-07 00:07:39 +00:00
Tom Rothamel 07a032fa7c 2006-04-06 20:55:05 +00:00
Tom Rothamel 61b21817a8 2006-04-05 20:08:10 +00:00
Tom Rothamel eba101519f A new extra, translations.py, gives all of the translatable strings in
the Ren'Py common code.

There is now a variable, config.lint_hooks, that contains functions
that are called at lint time.
2006-04-03 15:45:34 +00:00
Tom Rothamel f38aeb3872 Added SFont support.
+++
Fixed a bug in renpy.music.set_music, in which the test was inverted
in the code. (But not in the documentation.) Flagged this as requiring
an update, as it could require script changes.
2006-03-31 16:00:18 +00:00
Tom Rothamel c2ac268e7d Slow text and skipping conflicted, in that when skipping one will see
the slow text effect. This may be a regression, but it's fixed now.

Ren'Py now takes some new command line options:

* --savedir allows the user to set the directory in which Ren'Py saves
data in. This allows Ren'Py games to be run from a non-writable
directory. 

* --version prints the version of Ren'Py.
2006-03-24 22:13:50 +00:00
Tom Rothamel ca3c6f8bc1 Finalizing 5.4.4. 2006-03-13 01:34:02 +00:00
Tom Rothamel 6989233cbc Clarified that the voice extra can take non-wave sound files, such as
OGG Vorbis and especially OGG Speex files. Also, made voice
automatically sustain through pauses.

Fixed a bug in Ren'Py that was causing the voice extra to
malfunction. The bug was caused by the contents of the config
namespace being copied at the wrong time, leading it to not be
restored properly to default values when Ren'Py was reset (as the Main
Menu choice.) 

Removed a leftover debugging statement that caused Ren'Py to spew out
all of the say statements in .rpy files it parsed.
2006-03-12 15:14:33 +00:00
Tom Rothamel 056bed0fc2 Updated the gallery extra to support showing arbitrary displayables,
rather than just images with filenames. It was also updated to support
tuples, corresponding to composing one image atop another, and lists,
which display things in sequence. To support this, the tuples used by
gallery take a third argument which gives a filename which is used,
somewhat indirectly, to compute the thumbnail.
2006-03-10 14:42:31 +00:00
Tom Rothamel 7b946a2369 Fixed a bug preventing dump_text.bat and archiver.bat from working. 2006-03-08 21:37:01 +00:00
Tom Rothamel f41aec238e RELEASING.txt has been updated and corrected.
Empty strings are now allowed in Say statements, although it's not
immediately obvious to me why they would be used, except in some
strange cases, or as placeholders.
2006-03-05 16:13:13 +00:00
Tom Rothamel 77423980a2 The format of archive files has been changed, to store each media file
contiguously on disk. This allows us to use disk access to retrieve
files from archives, whereas previously the files had to be
reassembled in memory before use. Eliminating this memory assembly can
drop the resident size of Ren'Py significantly. (When music was
playing, there was a memory overhead equal to double the size of the
playing file... this has been eliminated.) While Ren'Py remains
compatible with the older-format archives, regenerating the archives
for a game allows it to take advantage of the new format.
2006-03-05 06:57:46 +00:00
Tom Rothamel 47606637de The presence of tabs in a script causes a more appropriate error
message to be generated. Previously, they simply caused random parse
errors. 

Implemented a widescreen mode, but disabled it for lack of utility.
2006-03-01 20:49:58 +00:00
Tom Rothamel 3eacc751ce 2006-02-21 02:36:20 +00:00
Tom Rothamel 4fdae44700 Reading 5.4.2 for release. 2006-02-18 03:56:18 +00:00
Tom Rothamel 06119fbcd2 The sound module has been rewritten to play sound (or silence) all the
time, rather than pausing and restarting sound playback as
necessary. This eliminates popping and errors in some edge cases, like
playing a very short sound.
2006-02-18 03:25:18 +00:00
Tom Rothamel 282bdb5164 Cleaned up the initial import, by removing some files that really have
no part being there.
2006-02-17 18:07:53 +00:00
Tom Rothamel 64d7e55027 Imported Ren'Py into trac. 2006-02-17 18:00:52 +00:00
812 changed files with 152057 additions and 16610 deletions
+54
View File
@@ -0,0 +1,54 @@
*.rpyc
*.rpyb
*.rpymc
*.pyc
*.pyo
*~
*.bak
saves
tmp
cache
log.txt
/build
/dist
/dists
/renpy.app
/jedit
/lint.txt
/renpy.code
/traceback.txt
/testing*
/screenshot*
/errors.txt
/styles.txt
/Microsoft.VC90.CRT.manifest
/console.exe
/msvcr90.dll
/python27.dll
/renpy.exe
/lib/windows-x86
/lib/linux-x86_64
/lib/linux-i686
/lib/python2.7
/doc
/.pydevproject
/.pydevproject.bak
/.project
/.settings
/LICENSE.txt
/template/README.html
/the_question/README.html
/tutorial/README.html
/renpy/angle/*.pyx
/renpy/angle/*.pxd
/renpy-ppc.zip
/module/build
/module/gen
/editra
dl
renpy/vc_version.py
BIN
View File
Binary file not shown.
+3994 -1
View File
File diff suppressed because it is too large Load Diff
-47
View File
@@ -1,47 +0,0 @@
Copyright 2004-2005 PyTom <pytom@bishoujo.us>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please note that the above license only applies to Ren'Py
proper. A binary distribution of Ren'Py contains a number of other
packages, each with their own licenses, which you may be bound to
comply with when distributing a Ren'Py game.
These packages may include:
Python (Python License)
http://www.python.org
Pygame (GNU LGPL)
http://www.pygame.org
SDL (GNU LGPL)
http://www.libsdl.org
SDL_mixer (GNU LGPL)
http://www.libsdl.org/projects/SDL_mixer
SDL_ttf (GNU LGPL)
http://www.libsdl.org/projects/SDL_ttf
ctypes (MIT)
http://starship.python.net/crew/theller/ctypes/
-42
View File
@@ -1,42 +0,0 @@
Greetings!
You've downloaded a game that was written using Ren'Py, a python based
engine for visual novel style games. If you're interested in making
your own games, you may want to consider downloading Ren'Py from:
http://www.bishoujo.us/renpy/
Ren'Py games can be played using the keyboard or the mouse.
When dialogue or transitions are displayed, they can be dismissed
by clicking the left mouse button, or pressing space or enter on the
keyboard. When the control key is held down, dialogue and transitions
are rapidly dismissed, provided that the user has seen them
already. Tab toggles skipping mode.
Choices on menus can be made by clicking on the appopriate choice with
the mouse, or by picking the choice using the up and down arrow and
hitting enter.
Hitting escape or clicking the right mouse button brings up the game
menu. This game menu lets you save and load games, quit the game, or
return to the main menu. It also lets you set preferences that control
the behavior of the game. These preferences are:
Display --- Controls if the game displays in a window or
fullscreen.
Music --- Controls if music is played or silenced.
TAB and CTRL Skip --- Chooses if CTRL skips all messages or only messages
that have ever been seen on this computer.
Transitions --- Controls the amount of transitions that are shown.
Finally, Ren'Py supports a rollback feature, which lets you, with some
limits, play the game backwards. For example, you can rollback to a
menu, and save or make a different choice. It also lets you see
dialogue that you missed. You can rollback by pressing the 'page up'
key, or by scrolling your mouse wheel up. Pressing 'page down' or
scrolling your mouse wheel down lets you skip dialogue that's been
seen in this session, which is almost the opposite of rollback.
Thank you for choosing to play a Ren'Py powered game.
-4
View File
@@ -1,4 +0,0 @@
Have a new form of imagemap that uses a color image to distinguish
hotspots.
Keyd compiles.
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
cd ~/ab/website
./upload.sh
-104
View File
@@ -1,104 +0,0 @@
#!/usr/bin/env python
# This program adds froms to every unqualified call found in the game
# directory. It's not perfect, but it's better than nothing.
import sys
import os
import re
import glob
def find_labels(fn, labels):
f = file(fn, "r")
for l in f:
m = re.match(r'^\s*call\s+\w+\s+from\s+(\w+)\s*$', l)
if m:
labels[m.group(1)] = True
m = re.match(r'^\s*call\s+expression.*from\s+(\w+)\s*$', l)
if m:
labels[m.group(1)] = True
f.close()
def replace_labels(fn, labels):
f = file(fn, "r")
of = file(fn + ".new", "w")
def replaceit(m):
target = m.group(2)
num = 0
while True:
num += 1
label = "_call_%s_%d" % (target, num)
if label not in labels:
break
labels[label] = True
return m.group(1) + "call " + target + " from " + label + m.group(3)
for l in f:
l = re.sub(r'^(\s*)call\s+(\w+)(\s*$)', replaceit, l)
if re.search(r'call\s+expression', l) and not re.search('from', l):
num = 0
while True:
num += 1
label = "_call_expression_%d" % num
if label not in labels:
break
labels[label] = label
l = l[:-1] + " from " + label + "\n"
of.write(l)
f.close()
of.close()
try:
os.unlink(fn + ".bak")
except:
pass
os.rename(fn, fn + ".bak")
os.rename(fn + ".new", fn)
def main():
pattern = "*/*.rpy"
if len(sys.argv) >= 2:
pattern = sys.argv[1]
files = glob.glob(pattern)
files = [ i for i in files if not i.startswith("common/") ]
labels = { }
for fn in files:
print "Finding labels in", fn
find_labels(fn, labels)
for fn in files:
print "Replacing labels in", fn
replace_labels(fn, labels)
if __name__ == "__main__":
main()
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
ln -s ../help.html tutorial/README.html
ln -s ../help.html the_question/README.html
ln -s ../help.html template/README.html
ln -s sphinx/source/license.rst LICENSE.txt
ln -s sphinx/build/html doc
+10
View File
@@ -0,0 +1,10 @@
# This file sets up the normal python modules. It's used to help eclipse
# do type detection, by providing an importable version of the cython code.
from distutils.core import setup
setup(
packages=['renpy', 'renpy.gl', 'renpy.angle', 'renpy.display', 'renpy.audio', 'renpy.text', 'pysdlsound'],
package_dir={ 'pysdlsound' : 'module' },
)
-3
View File
@@ -1,3 +0,0 @@
cd game
..\archiver.exe images *.png *.jpg
pause
-96
View File
@@ -1,96 +0,0 @@
#!/usr/bin/env python
# The Ren'Py archiver. This builds a Ren'Py archive file, and the
# associated index file. These files are really easy to reverse-engineer,
# but are probably better than nothing.
import sys
import os
import encodings.zlib_codec
import random
import glob
from cPickle import loads, dumps, HIGHEST_PROTOCOL
# The most we will go without inserting some padding. 10k.
padding_every = 10240
# The amount of padding we will add.
padding_max = 32
def randpadding():
plen = random.randint(1, padding_max)
rv = ""
for i in range(0, plen):
rv += chr(random.randint(1, 255))
return rv
def main():
if len(sys.argv) < 3:
print "Usage: %s <file-prefix> <files ...>" % sys.argv[0]
return
prefix = sys.argv[1]
# Archive file.
archivef = file(prefix + ".rpa", "wb")
# Index file.
indexf = file(prefix + ".rpi", "wb")
index = { }
random.seed()
offset = 0
# Needed because windows sucks. It doesn't do globbing on the
# command line.
files = [ ]
for i in sys.argv[2:]:
files.extend(glob.glob(i))
for fn in files:
index[fn] = [ ]
print "Adding %s..." % fn
datafile = file(fn, "rb")
while True:
# Pad with junk.
padding = randpadding()
archivef.write(padding)
offset += len(padding)
# Pick a random block size.
block = random.randint(1, padding_every)
data = datafile.read(block)
if not data:
break
dlen = len(data)
archivef.write(data)
index[fn].append((offset, dlen))
offset += dlen
datafile.close()
archivef.close()
indexf.write(dumps(index, HIGHEST_PROTOCOL).encode("zlib"))
indexf.close()
if __name__ == "__main__":
main()
-1
View File
@@ -1 +0,0 @@
build_exe.py run_game
+101 -21
View File
@@ -1,31 +1,111 @@
#!/usr/bin/env python
import modulefinder
import shutil
from distutils.core import setup
import py2exe
import py2exe #@UnresolvedImport @UnusedImport
import sys
import zipfile
import traceback
import os
if len(sys.argv) != 2:
print "Usage: build_exe.py <prefix>"
print ""
print "Builds <prefix>.exe."
print "Expects icons in <prefix>.ico."
# 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')
sys.exit(-1)
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.)
"""
def program(name):
return dict(script="run_game.py",
icon_resources=[ (0, name + ".ico"),
],
dest_base=name)
if os.path.isdir(fn):
shutil.rmtree(fn)
elif os.path.exists(fn):
os.unlink(fn)
programs = [
program(sys.argv[1]),
]
os.rename("dist/" + fn, fn)
sys.argv[1:] = [ 'py2exe' ]
import renpy
renpy.setup_modulefinder(modulefinder) #@UndefinedVariable
setup(name="RenPy",
windows=programs,
console=[ "archiver.py", "add_from.py", "console.py", "dump_text.py" ],
zipfile='lib/renpy.zip',
)
def main():
sys.argv[1:] = [ 'py2exe', '-a', '--dll-excludes', 'w9xpopen.exe', ]
setup(name="Ren'Py",
windows=[ dict(script="renpy.py",
dest_base="renpy",
icon_resources=[ (1, "newicon.ico") ],
),
],
console=[ dict(script="renpy.py", dest_base="console") ],
zipfile='lib/windows-x86/renpy.code',
options={ 'py2exe' : { 'excludes' : [ 'doctest',
'pygame.macosx',
'pygame.surfarray',
'pygame.mixer',
'pygame.mixer_music',
'_ssl',
'_hashlib',
'win32con',
'win32api',
'Numeric',
'os2emxpath',
'macpath',
'multiprocessing',
'_multiprocessing',
],
'optimize' : 2,
} },
)
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/"):
# 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
if fn == "SDL_mixer.dll":
continue
seen[fn] = True
zfnew.writestr(fn, zfold.read(fn))
zfold.close()
zfnew.close()
os.unlink("dist/lib/windows-x86/renpy.code")
os.rename("dist/lib/windows-x86/renpy.code.new", "dist/lib/windows-x86/renpy.code")
# Take these files from the old python.
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("python27.dll")
move_from_dist("renpy.exe")
try:
main()
except:
traceback.print_exc()
+79
View File
@@ -0,0 +1,79 @@
#!/usr/bin/env python
import collections
import glob
import re
import os
# 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("launcher/*.rpy")
files += glob.glob("common/*.rpy")
files += glob.glob("common/*.rpym")
files += glob.glob("common/_layout/*.rpym")
files += glob.glob("common/_compat/*.rpym")
if "launcher/strings.rpy" in files:
files.remove("launcher/strings.rpy")
for fn in files:
process(fn)
converse = [ ]
for k, v in strings.iteritems():
v = " ".join(sorted(v))
converse.append((v, k))
converse.sort()
f = file("launcher/strings.rpy", "w")
files = set(i for i in os.listdir("launcher") if i.endswith(".rpy"))
print >>f, """\
init python:
LAUNCHER_RPYS = %r
TRANSLATION_STRINGS = [
""" % files
for v, k in converse:
# print
# print "#:", v
# print "#, python-format"
print >>f, " u\"%s\"," % unicode(k)
print >>f, """\
]
"""
+35
View File
@@ -0,0 +1,35 @@
# Copyright 2004-2012 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
# early, so Ren'Py knows about them when parsing other files.
python early hide:
# pause is defined internally, but would look like:
#
# @renpy.atl_warper
# def pause(t):
# if t >= 1.0:
# return 1.0
# else:
# return 0.0
@renpy.atl_warper
def linear(t):
return t
@renpy.atl_warper
def easeout(x):
import math
return 1.0 - math.cos(x * math.pi / 2.0)
@renpy.atl_warper
def easein(x):
import math
return math.cos((1.0 - x) * math.pi / 2.0)
@renpy.atl_warper
def ease(x):
import math
return .5 - math.cos(math.pi * x) / 2.0
+301
View File
@@ -0,0 +1,301 @@
# Contains functions and variables that control the building of
# distributions.
init -1000 python in build:
def make_file_lists(s):
"""
Turns `s` into a (perhaps empty) list of file_lists.
If `s` is a list or None, then returns it. If it's a string, splits
it on whitespace. Otherwise, errors out.
"""
if s is None:
return s
elif isinstance(s, list):
return s
elif isinstance(s, basestring):
return s.split()
raise Exception("Expected a string, list, or None.")
def pattern_list(l):
"""
Apply file_lists to the second argument of each tuple in a list.
"""
rv = [ ]
for pattern, groups in l:
rv.append((pattern, make_file_lists(groups)))
return rv
# Patterns that are used to classify Ren'Py.
renpy_patterns = pattern_list([
( "**~", None),
( "**/#*", None),
( "**/.*", None),
( "**.old", None),
( "**.new", None),
( "**.rpa", None),
( "**/*.pyc", None),
( "renpy.py", "all"),
( "renpy/**", "all"),
( "common/**", "all"),
# Windows-specific patterns.
( "python*.dll", "windows" ),
( "msvcr*.dll", "windows"),
( "Microsoft.VC*.CRT.manifest", "windows"),
( "lib/dxwebsetup.exe", "windows"),
( "lib/windows-x86/**", "windows"),
# Linux patterns.
( "renpy.sh", "linux"),
( "lib/linux-x86_64/**", "linux"),
( "lib/linux-i686/**", "linux"),
( "lib/python2.7/**", "linux"),
# Mac patterns.
( "renpy.app/Contents/Ren'Py Launcher", None),
( "renpy.app/Contents/Info.plist", None),
( "renpy.app/Contents/Resources/launcher.py", None),
( "renpy.app/Contents/Resources/launcher.icns", None),
( "renpy.app/**", "mac"),
# Shared patterns.
( "/lib/", "windows linux"),
])
def classify_renpy(pattern, groups):
"""
Classifies files in the Ren'Py base directory according to pattern.
"""
renpy_patterns.append((pattern, make_file_lists(groups)))
# Patterns that are relative to the base directory.
early_base_patterns = pattern_list([
("*.py", None),
("*.sh", None),
("*.app/", None),
("*.dll", None),
("*.manifest", None),
("lib/", None),
("renpy/", None),
("update/", None),
("common/", None),
("update/", None),
("icon.ico", None),
("icon.icns", None),
("project.json", None),
("tmp/", None),
("game/saves/", None),
("archived/", None),
("launcherinfo.py", None),
("android.txt", None),
])
base_patterns = [ ]
late_base_patterns = pattern_list([
("**", "all")
])
def classify(pattern, file_list):
"""
:doc: build
Classifies files that match `pattern` into `file_list`.
"""
base_patterns.append((pattern, make_file_lists(file_list)))
def clear():
"""
:doc: build
Clears the list of patterns used to classify files.
"""
base_patterns[:] = [ ]
def remove(l, pattern):
"""
Removes the pattern from the list.
"""
l[:] = [ (p, fl) for i in l if p != pattern ]
# Archiving.
archives = [ ]
def archive(name, file_list="all"):
"""
:doc: build
Declares the existence of an archive. If one or more files are
classified with `name`, `name`.rpa is build as an archive. The
archive is included in the named file lists.
"""
archives.append((name, make_file_lists(file_list)))
archive("archive", "all")
# Documentation patterns.
documentation_patterns = [ ]
def documentation(pattern):
"""
:doc: build
Declares a pattern that matches documentation. In a mac app build,
files matching the documentation pattern are stored twice - once
inside the app package, and again outside of it.
"""
documentation_patterns.append(pattern)
xbit_patterns = [
"**.sh",
"**/*.so.*",
"**/*.so",
"**/*.dylib",
"**.app/Contents/MacOS/*",
"lib/**/python",
"lib/**/zsync",
"lib/**/zsyncmake",
]
def executable(pattern):
"""
:doc: build
Adds a pattern marking files as executable on platforms that support it.
(Linux and Macintosh)
"""
xbit_patterns.append(pattern)
# Packaging.
packages = [ ]
def package(name, format, file_lists, description=None, update=True, dlc=False):
"""
:doc: build
Declares a package that can be built by the packaging
tool.
`name`
The name of the package.
`format`
The format of the package. A string containing a space separated
list of:
zip
A zip file.
app-zip
A zip file containing a macintosh application.
tar.bz2
A tar.bz2 file.
The empty string will not build any package formats (this
makes dlc possible).
`file_lists`
A list containing the file lists that will be contained
within the package.
`description`
An optional description of the package to be built.
`update`
If true and updates are being built, an update will be
built for this package.
`dlc`
If true, any zip or tar.bz2 file will be built in
standalone DLC mode, without an update directory.
"""
formats = format.split()
for i in formats:
if i not in [ "zip", "app-zip", "tar.bz2" ]:
raise Exception("Format {} not known.".format(i))
if description is None:
description = name
d = {
"name" : name,
"formats" : formats,
"file_lists" : make_file_lists(file_lists),
"description" : description,
"update" : update,
"dlc" : dlc,
}
packages.append(d)
package("all", "zip", "windows mac linux all", "All Desktop Platforms")
package("linux", "tar.bz2", "linux all", "Linux x86/x86_64")
package("mac", "app-zip", "mac all", "Macintosh x86")
package("win", "zip", "windows all", "Windows x86")
# Data that we expect the user to set.
# The name of directories in the archives.
directory_name = ""
# The name of executables.
executable_name = ""
# Should we include update information into the archives?
include_update = False
# A verbose version to include in the update.
version = None
# Are we building Ren'Py?
renpy = False
# This function is called by the json_dump command to dump the build data
# into the json file.
def dump():
rv = { }
rv["directory_name"] = directory_name
rv["executable_name"] = executable_name
rv["include_update"] = include_update
rv["packages"] = packages
rv["archives"] = archives
rv["documentation_patterns"] = documentation_patterns
rv["base_patterns"] = early_base_patterns + base_patterns + late_base_patterns
rv["renpy_patterns"] = renpy_patterns
rv["xbit_patterns"] = xbit_patterns
rv["version"] = version or directory_name
rv["renpy"] = renpy
return rv
+128
View File
@@ -0,0 +1,128 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init -1210 python:
# This is called when script_version is set, to immediately
# run code in response to a script_version change.
def _set_script_version(version):
if version is None:
return
if version <= (5, 6, 0):
config.check_properties = False
if version <= (6, 5, 0):
layout.compat()
if version <= (6, 9, 1):
store.library = store.config
if version <= (6, 9, 3):
# Before 6.10, these were positions, rather than transforms.
store.left = Position(xalign=0.0)
store.center = Position(xalign=0.5)
store.truecenter = Position(xalign=0.5, yalign=0.5)
store.right = Position(xalign=1.0)
store.offscreenleft = Position(xpos=0.0, xanchor=1.0)
store.offscreenright = Position(xpos=1.0, xanchor=0.0)
if version <= (6, 10, 2):
# Before 6.11, we used the image placement to handle
# the location of things on the screen.
style.image_placement.xpos = 0.5
style.image_placement.ypos = 1.0
style.image_placement.xanchor = 0.5
style.image_placement.yanchor = 1.0
config.transform_uses_child_position = False
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
if version <= (6, 12, 0):
config.keep_running_transform = False
config.image_attributes = False
config.new_character_image_argument = False
config.save_physical_size = False
if version <= (6, 12, 2):
style.default.language = "western"
style.default.layout = "greedy"
config.new_substitutions = False
config.broken_line_spacing = True
if (6, 12, 2) < version <= (6, 13, 8):
config.old_substitutions = False
if version <= (6, 13, 12):
global MoveTransition
MoveTransition = OldMoveTransition
init 1210 python hide::
# This returns true if the script_version is <= the
# script_version supplied. Give it the last script version
# where an old version was used.
def compat(x, y, z):
return config.script_version and config.script_version <= (x, y, z)
# Compat for changes to with-callback.
if compat(5, 4, 5):
if config.with_callback:
def compat_with_function(trans, paired, old=config.with_callback):
old(trans)
return trans
config.with_callback = compat_with_function
if not config.sound:
config.has_sound = False
config.has_music = False
config.has_voice = False
# Compat for SFont recoloring.
if compat(5, 1, 1):
config.recolor_sfonts = False
if compat(5, 5, 4):
config.implicit_with_none = False
# Compat for changes to button look.
if compat(5, 5, 4):
style.button.setdefault(xpos=0.5, xanchor=0.5)
style.menu_button.clear()
style.menu_button_text.clear()
if compat(5, 6, 6):
config.reject_midi = False
if compat(6, 2, 0):
config.reject_backslash = False
if compat(6, 9, 0):
style.motion.clear()
if "Fullscreen" in config.translations:
fs = _("Fullscreen")
config.translations.setdefault("Fullscreen 4:3", fs + " 4:3")
config.translations.setdefault("Fullscreen 16:9", fs + " 16:9")
config.translations.setdefault("Fullscreen 16:10", fs + " 16:10")
for i in layout.compat_funcs:
i()
if config.hyperlink_styler or config.hyperlink_callback or config.hyperlink_focus:
style.default.hyperlink_functions = (config.hyperlink_styler, config.hyperlink_callback, config.hyperlink_focus)
+283
View File
@@ -0,0 +1,283 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file contains a number of definitions of standard
# locations and transitions. We've moved them into the common
# directory so that it's easy for an updated version of all of these
# definitions.
init -1110:
transform reset:
alpha 1 rotate None zoom 1 xzoom 1 yzoom 1 align (0, 0) alignaround (0, 0) subpixel False size None crop None
# These are positions that can be used inside at clauses. We set
# them up here so that they can be used throughout the program.
transform left:
xpos 0.0 xanchor 0.0 ypos 1.0 yanchor 1.0
transform right:
xpos 1.0 xanchor 1.0 ypos 1.0 yanchor 1.0
transform center:
xpos 0.5 xanchor 0.5 ypos 1.0 yanchor 1.0
transform truecenter:
xpos 0.5 xanchor 0.5 ypos 0.5 yanchor 0.5
transform topleft:
xpos 0.0 xanchor 0.0 ypos 0.0 yanchor 0.0
transform topright:
xpos 1.0 xanchor 1.0 ypos 0.0 yanchor 0.0
transform top:
xpos 0.5 xanchor 0.5 ypos 0.0 yanchor 0.0
# Offscreen positions for use with the move transition. Images at
# these positions are still shown (and consume
# resources)... remember to hide the image after the transition.
transform offscreenleft:
xpos 0.0 xanchor 1.0 ypos 1.0 yanchor 1.0
transform offscreenright:
xpos 1.0 xanchor 0.0 ypos 1.0 yanchor 1.0
transform default:
alpha 1 rotate None zoom 1 xzoom 1 yzoom 1 align (0, 0) alignaround (0, 0) subpixel False size None crop None
xpos 0.5 xanchor 0.5 ypos 1.0 yanchor 1.0
# These are used by the transitions to move things offscreen. We don't
# expect them to be used by user code.
transform _moveleft:
xpos 0.0 xanchor 1.0
transform _moveright:
xpos 1.0 xanchor 0.0
transform _movetop:
ypos 0.0 yanchor 1.0
transform _movebottom:
ypos 1.0 yanchor 0.0
python:
config.default_transform = default
init -1110 python:
_define = define = object()
# Transitions ############################################################
# Simple transitions.
fade = Fade(.5, 0, .5) # Fade to black and back.
dissolve = Dissolve(0.5)
pixellate = Pixellate(1.0, 5)
# Various uses of CropMove.
wiperight = CropMove(1.0, "wiperight")
wipeleft = CropMove(1.0, "wipeleft")
wipeup = CropMove(1.0, "wipeup")
wipedown = CropMove(1.0, "wipedown")
slideright = CropMove(1.0, "slideright")
slideleft = CropMove(1.0, "slideleft")
slideup = CropMove(1.0, "slideup")
slidedown = CropMove(1.0, "slidedown")
slideawayright = CropMove(1.0, "slideawayright")
slideawayleft = CropMove(1.0, "slideawayleft")
slideawayup = CropMove(1.0, "slideawayup")
slideawaydown = CropMove(1.0, "slideawaydown")
irisout = CropMove(1.0, "irisout")
irisin = CropMove(1.0, "irisin")
# Ease images around. These are basically cosine-warped moves.
def _ease_out_time_warp(x):
print "ZZZ"
import math
return 1.0 - math.cos(x * math.pi / 2.0)
def _ease_in_time_warp(x):
import math
return math.cos((1.0 - x) * math.pi / 2.0)
def _ease_time_warp(x):
import math
return .5 - math.cos(math.pi * x) / 2.0
# Back up the move transition, so that if MoveTransition gets replaced by
# renpy.compat, this still works.
__MoveTransition = MoveTransition
# This defines a family of move transitions, using the old-style methods.
def move_transitions(prefix, delay, time_warp=None, in_time_warp=None, out_time_warp=None, old=False, layers=[ 'master' ], **kwargs):
"""
:doc: transition_family
This defines a family of move transitions, similar to the move and ease
transitions. For a given `prefix`, this defines the transitions:
* *prefix*- A transition that takes `delay` seconds to move images that
changed positions to their new locations.
* *prefix*\ inleft, *prefix*\ inright, *prefix*\ intop, *prefix*\ inbottom - Transitions
that take `delay` seconds to move images that changed positions to their
new locations, with newly shown images coming in from the appropriate
side.
* *prefix*\ outleft, *prefix*\ outright, *prefix*\ outtop, *prefix*\ outbottom -
Transitions that take `delay` seconds to move images that changed
positions to their new locations, with newly hidden images leaving via
the appropriate side.
`time_warp`, `in_time_warp`, `out_time_warp`
Time warp functions that are given a time from 0.0 to 1.0 representing
the fraction of the move complete, and return a value in the same
range giving the fraction of a linear move that is complete.
This can be used to define functions that ease the images around,
rather than moving them at a constant speed.
The three argument are used for images remaining on the screen,
newly shown images, and newly hidden images, respectively.
`old`
If true, the transitions to move the old displayables, rather than the new ones.
`layers`
The layers the transition will apply to.
::
# This defines all of the pre-defined transitions beginning
# with "move".
init python:
define.move_transitions("move", 0.5)
"""
moves = {
"" : MoveTransition(
delay,
old=old,
layers=layers,
time_warp=time_warp),
"inright" : MoveTransition(
delay,
old=old,
layers=layers,
enter=_moveright,
time_warp=time_warp,
enter_time_warp=in_time_warp,
),
"inleft" : MoveTransition(
delay,
old=old,
layers=layers,
enter=_moveleft,
time_warp=time_warp,
enter_time_warp=in_time_warp,
),
"intop" : MoveTransition(
delay,
old=old,
layers=layers,
enter=_movetop,
time_warp=time_warp,
enter_time_warp=in_time_warp,
),
"inbottom" : MoveTransition(
delay,
old=old,
layers=layers,
enter=_movebottom,
time_warp=time_warp,
enter_time_warp=in_time_warp,
),
"outright" : MoveTransition(
delay,
old=old,
layers=layers,
leave=_moveright,
time_warp=time_warp,
leave_time_warp=out_time_warp,
),
"outleft" : MoveTransition(
delay,
old=old,
layers=layers,
leave=_moveleft,
time_warp=time_warp,
leave_time_warp=out_time_warp,
),
"outtop" : MoveTransition(
delay,
old=old,
layers=layers,
leave=_movetop,
time_warp=time_warp,
leave_time_warp=out_time_warp,
),
"outbottom" : MoveTransition(
delay,
old=old,
layers=layers,
leave=_movebottom,
time_warp=time_warp,
leave_time_warp=out_time_warp,
),
}
for k, v in moves.iteritems():
setattr(store, prefix + k, v)
define.move_transitions = move_transitions
del move_transitions
define.move_transitions("move", 0.5)
define.move_transitions("ease", 0.5, _ease_time_warp, _ease_in_time_warp, _ease_out_time_warp)
# Zoom-based transitions. Legacy - nowadays, these are probably best done with ATL.
zoomin = OldMoveTransition(0.5, enter_factory=ZoomInOut(0.01, 1.0))
zoomout = OldMoveTransition(0.5, leave_factory=ZoomInOut(1.0, 0.01))
zoominout = OldMoveTransition(0.5, enter_factory=ZoomInOut(0.01, 1.0), leave_factory=ZoomInOut(1.0, 0.01))
# These shake the screen up and down for a quarter second.
# The delay needs to be an integer multiple of the period.
vpunch = Move((0, 10), (0, -10), .10, bounce=True, repeat=True, delay=.275)
hpunch = Move((15, 0), (-15, 0), .10, bounce=True, repeat=True, delay=.275)
# These use the ImageDissolve to do some nifty effects.
blinds = ImageDissolve(im.Tile("blindstile.png"), 1.0, 8)
squares = ImageDissolve(im.Tile("squarestile.png"), 1.0, 256)
init -1110:
image black = Solid("#000")
init 1110 python:
if not hasattr(store, 'narrator'):
narrator = Character(None, kind=adv, what_style='say_thought')
if not hasattr(store, 'name_only'):
name_only = adv
if not hasattr(store, 'centered'):
centered = Character(None, what_style="centered_text", window_style="centered_window")
# This is necessary to ensure that config.default_transform works.
if config.default_transform:
config.default_transform._show()
+329
View File
@@ -0,0 +1,329 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init -1135 python:
class __GalleryAllPriorCondition(object):
def check(self, all_prior):
return all_prior
class __GalleryArbitraryCondition(object):
def __init__(self, condition):
self.condition = condition
def check(self, all_prior):
return eval(self.condition)
class __GalleryUnlockCondition(object):
def __init__(self, images):
self.images = images
def check(self, all_prior):
for i in self.images:
if not renpy.seen_image(i):
return False
return True
class __GalleryImage(object):
def __init__(self, gallery, displayables):
# The gallery object we belong to.
self.gallery = gallery
# A list of conditions for this image to be displayed.
self.conditions = [ ]
# A list of displayables to show.
self.displayables = displayables
# A list of transforms to apply to those displayables, or None
# to not apply a transform.
self.transforms = [ None ] * len(displayables)
def check_unlock(self, all_prior):
"""
Returns True if the image is unlocked.
"""
for i in self.conditions:
if not i.check(all_prior):
return False
return True
def show(self, locked, index, count):
"""
Shows this image when it's unlocked.
"""
renpy.transition(self.gallery.transition)
ui.saybehavior()
displayables = [ ]
for d, transform in zip(self.displayables, self.transforms):
if transform is not None:
d = transform(d)
else:
d = config.default_transform(d)
displayables.append(d)
renpy.show_screen("_gallery", locked=locked, index=index + 1, count=count, displayables=displayables, gallery=self.gallery)
ui.interact()
class __GalleryButton(object):
def __init__(self, gallery):
self.gallery = gallery
self.images = [ ]
self.conditions = [ ]
def check_unlock(self):
for i in self.conditions:
if not i.check(True):
return False
for i in self.images:
if i.check_unlock(False):
return True
return False
def show(self):
all_prior = True
for i, img in enumerate(self.images):
locked = not img.check_unlock(all_prior)
img.show(locked, i, len(self.images))
renpy.transition(self.gallery.transition)
class Gallery(object):
"""
:doc: gallery class
This class supports the creation of an image gallery by handling the
locking of images, providing an action that can show one or more images,
and a providing method that creates buttons that use that action.
.. attribute:: transition
The transition that is used when changing images.
.. attribute:: locked_button
The default displayable used by make_button for a locked button.
.. attribute:: hover_border
The default hover border used by make_button.
.. attribute:: idle_border
The default idle border used by make_button.
"""
transition = None
hover_border = None
idle_border = None
locked_button = None
def __init__(self):
# A map from button name (or image) to __GalleryButton object.
self.buttons = { }
self.button_ = None
self.image_ = None
self.unlockable = None
def button(self, name):
"""
:doc: gallery method
Creates a new button, named `name`.
`name`
The name of the button being created.
"""
self.button_ = __GalleryButton(self)
self.unlockable = self.button_
self.buttons[name] = self.button_
def image(self, *displayables):
"""
:doc: gallery method
Adds a new image to the current button, where an image consists
of one or more displayables.
"""
self.image_ = __GalleryImage(self, displayables)
self.button_.images.append(self.image_)
self.unlockable = self.image_
display = image
def transform(self, *transforms):
"""
:doc: gallery method
Applies transforms to the last image registered. This should be
called with the same number of transforms as the image has
displayables. The transforms are applied to the corresponding
displayables.
If a transform is None, the default transform is used.
"""
self.image_.transforms = transforms
def unlock(self, *images):
"""
:doc: gallery method
A condition that takes one or more image names as argument, and
is satisfied when all the named images have been seen by the
player. The image names should be given as strings.
"""
self.unlockable.conditions.append(__GalleryUnlockCondition(images))
def condition(self, expression):
"""
:doc: gallery method
A condition that is satisfied when an expression evaluates to true.
`expression`
A string giving a python expression.
"""
if not isinstance(expression, basestring):
raise Exception("Gallery condition must be a string containing an expression.")
self.unlockable.conditions.append(__GalleryArbitraryCondition(expression))
def allprior(self):
"""
:doc: gallery method
A condition that is true if all prior images associated with the
current button have been unlocked.
"""
self.unlockable.conditions.append(__GalleryAllPriorCondition())
def unlock_image(self, *images):
"""
:doc: gallery method
A convenience method that is equivalent to calling image and unlock
with the same parameters. This will cause an image to be displayed
if it has been seen before.
The images should be specified as strings giving image names.
"""
self.image(*images)
self.unlock(*images)
def Action(self, name):
"""
:doc: gallery method
An action that displays the images associated with the given button
name.
"""
if name not in self.buttons:
raise Exception("{0!r} is not a button defined in this gallery.".format(name))
b = self.buttons[name]
if b.check_unlock():
return ui.invokesinnewcontext(b.show)
else:
return None
def make_button(self, name, unlocked, locked=None, hover_border=None, idle_border=None, **properties):
"""
:doc: gallery method
This creates a button that displays the images associated with the given
button name.
`name`
The name of the button that will be created.
`unlocked`
A displayable that is displayed for this button when it is
unlocked.
`locked`
A displayable that is displayed for this button when it is
locked. If None, the locked_button field of the gallery
object is used instead.
`hover_border`
A displayable that is used to overlay this button when when
it is unlocked and has focus. If None, the hover_border
field of the gallery object is used.
`idle_border`
A displayable that is used to overlay this button when when
it is unlocked but unfocused. If None, the idle_border
field of the gallery object is used.
Additional keyword arguments become style properties of the
created button object.
"""
action = self.Action(name)
if locked is None:
locked = self.locked_button
if hover_border is None:
hover_border = self.hover_border
if idle_border is None:
idle_border = self.idle_border
return Button(action=action, child=unlocked, insensitive_child=locked, hover_foreground=hover_border, idle_foreground=idle_border, **properties)
init -1135:
# Displays a set of images in the gallery, or indicates that the images
# are locked. This is given the following arguments:
#
# locked
# True if the image is locked.
# displayables
# A list of transformed displayables that should be shown to the user.
# index
# A 1-based index of the image being shown.
# count
# The number of images attached to the current button.
# gallery
# The image gallery object.
screen _gallery:
if locked:
add "#000"
text "Image [index] of [count] locked." align (0.5, 0.5)
else:
for d in displayables:
add d
+377
View File
@@ -0,0 +1,377 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This contains code to choose between OpenGL and Software rendering, when
# a system supports both.
init -1024:
python hide:
import os
store.__dxwebsetup = os.path.join(config.renpy_base, "lib", "dxwebsetup.exe")
python:
class _SetRenderer(Action):
"""
Sets the preferred renderer to one of "auto", "angle", "gl", or
"sw".
"""
def __init__(self, renderer):
self.renderer = renderer
def __call__(self):
_preferences.renderer = self.renderer
renpy.restart_interaction()
def get_selected(self):
return _preferences.renderer == self.renderer
# This is displayed to ask the user to choose the renderer he or she
# wants to use. It takes no parameters, doesn't return anything, and
# is expected to call _SetRenderer actions and quit when done.
#
# This screen can be customized by the creator, provided the actions
# remain available.
screen _choose_renderer:
frame:
style_group ""
xalign .5
yalign .33
xpadding 20
ypadding 20
xmaximum 400
has vbox
label _("Graphics Acceleration")
null height 10
textbutton _("Automatically Choose"):
action _SetRenderer("auto")
xfill True
if renpy.renpy.windows:
textbutton _("Force Angle/DirectX Renderer"):
action _SetRenderer("angle")
xfill True
textbutton _("Force OpenGL Renderer"):
action _SetRenderer("gl")
xfill True
textbutton _("Force Software Renderer"):
action _SetRenderer("sw")
xfill True
null height 10
text _("Changes will take effect the next time this program is run.") substitute True
null height 10
textbutton _(u"Quit"):
action Quit(confirm=False)
xfill True
if not renpy.display.interface.safe_mode:
textbutton _("Return"):
action Return(0)
xfill True
# This is displayed when a display performance problem occurs.
#
# `problem` is the kind of problem that is occuring. It can be:
# - "sw" if the software renderer was selected.
# - "slow" if the performance test failed.
# - "fixed" if we're operating w/o shaders.
# - other things, added in the future.
#
# `url` is the url of a web page on renpy.org that will include
# info on troubleshooting display problems.
screen _performance_warning:
frame:
style_group ""
xalign .5
yalign .33
xpadding 20
ypadding 20
xmaximum 400
has vbox
label _("Performance Warning")
null height 10
if problem == "sw":
text _("This computer is using software rendering.")
elif problem == "fixed":
text _("This computer is not using shaders.")
elif problem == "slow":
text _("This computer is displaying graphics slowly.")
else:
text _("This computer has a problem displaying graphics: [problem].") substitute True
null height 10
if directx_update:
text _("Its graphics drivers may be out of date or not operating correctly. This can lead to slow or incorrect graphics display. Updating DirectX could fix this problem.")
else:
text _("Its graphics drivers may be out of date or not operating correctly. This can lead to slow or incorrect graphics display.")
if directx_update:
null height 10
textbutton _("Update DirectX"):
action directx_update
xfill True
null height 10
textbutton _("Continue, Show this warning again"):
action Return(True)
xfill True
textbutton _("Continue, Don't show warning again"):
action Return(False)
xfill True
null height 10
textbutton _("Quit"):
action Quit(confirm=False)
xfill True
# Used while a directx update is ongoing.
screen _directx_update:
frame:
style_group ""
xalign .5
yalign .33
xpadding 20
ypadding 20
xmaximum 400
has vbox
label _("Updating DirectX.")
null height 10
text _("DirectX web setup has been started. It may start minimized in the taskbar. Please follow the prompts to install DirectX.")
null height 10
text _("{b}Note:{/b} Microsoft's DirectX web setup program will, by default, install the Bing toolbar. If you do not want this toolbar, uncheck the appropriate box.")
null height 10
text _("When setup finishes, please click below to restart this program.")
textbutton _("Restart") action Return(True)
init -1024 python:
# The image that we fill the screen with in GL-test mode.
config.gl_test_image = "black"
class __GLTest(renpy.Displayable):
"""
This counts the number of times it's been rendered, and
the number of seconds it's been displayed, and uses them
to make the decisions as to if OpenGL is working or not.
"""
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
renpy.renpy.display.log.write("- Target is {0} frames in {1} seconds.".format(frames, self.target))
def render(self, width, height, st, at):
rv = renpy.Render(width, height)
if self.success:
return rv
self.times.append(st)
renpy.redraw(self, 0)
renpy.renpy.display.log.write("- Frame drawn at %f seconds." % st)
if len(self.times) >= self.frames:
frames_timing = self.times[-1] - self.times[-self.frames]
renpy.renpy.display.log.write("- %f seconds to render %d frames.", frames_timing, self.frames)
if frames_timing <= self.target:
self.success = True
renpy.timeout(0)
return rv
def event(self, ev, x, y, st):
if self.success:
return True
if st > self.timeout:
return False
renpy.timeout(self.timeout - st)
config.performance_test = True
def __gl_test():
import os
# If we've entered safe mode, display the renderer choice screen.
# This screen will cause us to quit.
if _restart:
return
if not config.gl_enable:
return
if renpy.display.interface.safe_mode:
renpy.call_in_new_context("_choose_renderer")
if not config.performance_test:
return
_gl_performance_test()
def _gl_performance_test():
import os
if not _preferences.performance_test and "RENPY_PERFORMANCE_TEST" not in os.environ:
return
# Don't bother on androuid - there's nothing the user can do.
if renpy.renpy.android:
return
renpy.renpy.display.log.write("Performance test:")
# This will cause the screen to start displaying.
ui.pausebehavior(0)
ui.interact(suppress_underlay=True, suppress_overlay=True)
# The problem we have.
problem = None
renderer_info = renpy.get_renderer_info()
# Software renderer check.
if config.renderer != "sw" and renderer_info["renderer"] == "sw":
problem = "sw"
# Speed check.
if problem is None:
# The parameters of the performance test. If we do not hit FPS fps
# over FRAMES frames before DELAY seconds are up, we fail.
FRAMES = 5
FPS = 15
DELAY = 1.5
renpy.transition(Dissolve(DELAY), always=True, force=True)
ui.add(__GLTest(FRAMES, FPS, DELAY))
result = ui.interact(suppress_overlay=True, suppress_underlay=True)
if not result:
problem = "slow"
# Lack of shaders check.
if problem is None:
if not "RENPY_GL_ENVIRON" in os.environ:
if renderer_info["renderer"] == "gl" and renderer_info["environ"] == "fixed":
problem = "fixed"
if problem is None:
return
if renpy.renpy.windows and os.path.exists(__dxwebsetup):
directx_update = Jump("_directx_update")
else:
directx_update = None
# Give the warning message to the user.
renpy.show_screen("_performance_warning", problem=problem, directx_update=directx_update, _transient=True)
result = ui.interact(suppress_overlay=True, suppress_underlay=True)
# Store the user's choice, and continue.
_preferences.performance_test = result
return
label _gl_test:
# Show the test image.
scene
show expression config.gl_test_image
$ __gl_test()
# Hide the test image.
scene
return
# We can assume we're on windows here. We're also always restart once we
# make it here.
label _directx_update:
if renpy.has_label("directx_update"):
jump expression "directx_update"
label _directx_update_main:
python hide:
import subprocess
import sys
# Start dxsetup. We have to go through startfile to ensure that UAC
# doesn't cause problems.
os.startfile(__dxwebsetup)
renpy.show_screen("_directx_update")
ui.interact(suppress_overlay=True, suppress_underlay=True)
# Restart the current program.
subprocess.Popen(sys.argv)
renpy.quit()
label _choose_renderer:
scene expression "#000"
$ renpy.call_screen("_choose_renderer")
return
+434
View File
@@ -0,0 +1,434 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init -1105 python:
class Layout():
def __call__(self, func):
setattr(self, func.func_name, func)
return func
layout = _layout = Layout()
del Layout
layout.compat_funcs = [ ]
layout.provided = set()
init -1105 python hide:
# Called to indicate that the given kind of layout has been
# provided.
@layout
def provides(kind):
if kind in layout.provided:
raise Exception("%s has already been provided by another layout function." % kind)
layout.provided.add(kind)
# Called by registered themes to have the default versions of
# various kinds of layouts provided, if a more specific version
# has not been requested by the user.
@layout
def defaults():
# Do nothing, in compatibility mode.
if 'compat' in layout.provided:
return
defaults = dict(
main_menu=layout.classic_main_menu,
load_save=layout.classic_load_save,
navigation=layout.classic_navigation,
yesno_prompt=layout.classic_yesno_prompt,
preferences=layout.classic_preferences,
joystick_preferences=layout.classic_joystick_preferences,
)
if renpy.has_screen("main_menu"):
defaults["main_menu"] = layout.screen_main_menu
if renpy.has_screen("load") and renpy.has_screen("save"):
defaults["load_save"] = layout.screen_load_save
if renpy.has_screen("yesno_prompt"):
defaults["yesno_prompt"] = layout.screen_yesno_prompt
if renpy.has_screen("preferences"):
defaults["preferences"] = layout.screen_preferences
if renpy.has_screen("joystick_preferences"):
defaults["joystick_preferences"] = layout.screen_joystick_preferences
for k, v in defaults.iteritems():
if k not in layout.provided:
v()
if store._game_menu_screen is None:
if renpy.has_label("save_screen"):
store._game_menu_screen = "save_screen"
elif renpy.has_label("preferences_screen"):
store._game_menu_screen = "preferences_screen"
##########################################################################
# These live on the layout object, and ease the construction of buttons,
# labels, and prompts. A sufficently aggressive layout might change
# these.
@layout
def button(label,
type=None,
selected=False,
enabled=True,
clicked=None,
hovered=None,
unhovered=None,
index=None,
**properties):
"""
label - The label of this button. Will be translated if necessary.
type - The type of this button. Used to generate the appropriate styles.
selected - Determines if this button should be selected.
enabled - Determines if this button should be enabled.
clicked - A function that is run when the button is clicked.
hovered - A function that is run when the button is hovered.
unhovered - A function that is run when the button is unhovered.
index - A style index. If None, label is used.
size_group - The size_group used by this button.
"""
if not enabled:
clicked = None
if selected and enabled:
role = "selected_"
else:
role = ""
if type:
button_style = type + "_button"
text_style = type + "_button_text"
else:
button_style = 'button'
text_style = 'button_text'
if index is None:
index = label
button_style = getattr(style, button_style)[index]
text_style = getattr(style, text_style)[index]
rv = ui.button(style=button_style, role=role, clicked=clicked, hovered=hovered, unhovered=unhovered, **properties)
ui.text(_(label), style=text_style)
return rv
@layout
def label(label, type, suffix="label", index=None, **properties):
if index is None:
index = label
if type:
label_style = getattr(style, type + "_" + suffix)[index]
text_style = getattr(style, type + "_" + suffix + "_text")[index]
else:
label_style = style.label[index]
text_style = style.label_text[index]
ui.window(style=label_style, **properties)
ui.text(_(label), style=text_style)
@layout
def prompt(label, type, index=None, **properties):
return layout.label(label, type, "prompt", index, **properties)
@layout
def list(entries, clicked=None, hovered=None, unhovered=None, selected=None, **properties):
ui.window(style=style.list, **properties)
ui.vbox(style=style.list_box)
size_group = str(id(entries))
for i, (spacers, content) in enumerate(entries):
if clicked is not None:
new_clicked = renpy.curry(clicked)(i)
else:
new_clicked = None
if hovered is not None:
new_hovered = renpy.curry(hovered)(i)
else:
new_hovered = None
if unhovered is not None:
new_unhovered = renpy.curry(unhovered)(i)
else:
new_unhovered = None
if selected == i:
role = "selected_"
else:
role = ""
ui.button(style=style.list_row[i%2],
clicked=new_clicked,
hovered=new_hovered,
unhovered=new_unhovered,
role=role,
size_group=size_group,
)
ui.hbox(style=style.list_row_box)
for j in range(0, spacers):
ui.window(style=style.list_spacer)
ui.null()
ui.text(content, style=style.list_text)
ui.close() # row
ui.close() # vbox
##########################################################################
# Misc.
@layout
def button_menu():
config.narrator_menu = True
style.menu.box_spacing = 2
style.menu_window.set_parent(style.default)
style.menu_window.xalign = 0.5
style.menu_window.yalign = 0.5
style.menu_choice.set_parent(style.button_text)
style.menu_choice.clear()
style.menu_choice_button.set_parent(style.button)
style.menu_choice_button.xminimum = int(config.screen_width * 0.75)
style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)
store._button_menu = button_menu
###########################################################################
# Compat layout.
@layout
def compat():
layout.provides('compat')
renpy.load_module("_compat/styles")
renpy.load_module("_compat/library")
renpy.load_module("_compat/mainmenu")
renpy.load_module("_compat/gamemenu")
renpy.load_module("_compat/preferences")
renpy.load_module("_compat/themes")
###########################################################################
# Classic layout.
@layout
def classic_main_menu():
renpy.load_module("_layout/classic_main_menu")
@layout
def classic_navigation():
renpy.load_module('_layout/classic_navigation')
@layout
def classic_load_save():
renpy.load_module('_layout/classic_load_save')
@layout
def classic_yesno_prompt():
renpy.load_module('_layout/classic_yesno_prompt')
@layout
def classic_preferences(center=False):
renpy.load_module('_layout/classic_preferences')
if center:
style.prefs_button.xalign = 0.5
style.prefs_slider.xalign = 0.5
style.prefs_jump_button.xalign = 0.5
@layout
def classic_joystick_preferences():
renpy.load_module('_layout/classic_joystick_preferences')
@layout
def two_column_preferences():
renpy.load_module("_layout/two_column_preferences")
@layout
def one_column_preferences():
renpy.load_module("_layout/one_column_preferences")
@layout
def grouped_main_menu(per_group=2, equal_size=True):
renpy.load_module("_layout/grouped_main_menu")
config.main_menu_per_group = per_group
if equal_size:
style.mm_button.size_group = "main_menu"
@layout
def grouped_navigation(per_group=2, equal_size=True):
renpy.load_module("_layout/grouped_navigation")
config.navigation_per_group = per_group
if equal_size:
style.gm_nav_button.size_group = "navigation"
@layout
def scrolling_load_save():
renpy.load_module("_layout/scrolling_load_save")
@layout
def imagemap_main_menu(ground, selected, hotspots, idle=None, variant=None):
renpy.load_module("_layout/imagemap_main_menu")
config.main_menu_ground[variant] = ground
config.main_menu_selected[variant] = selected
config.main_menu_hotspots[variant] = hotspots
config.main_menu_idle[variant] = idle
@layout
def imagemap_navigation(ground, idle, hover, selected_idle, selected_hover,
hotspots):
renpy.load_module("_layout/imagemap_navigation")
config.navigation_ground = ground
config.navigation_idle = idle
config.navigation_hover = hover
config.navigation_selected_idle = selected_idle
config.navigation_selected_hover = selected_hover
config.navigation_hotspots = hotspots
@layout
def imagemap_preferences(ground, idle, hover, selected_idle, selected_hover,
hotspots):
renpy.load_module("_layout/imagemap_preferences")
config.preferences_ground = ground
config.preferences_idle = idle
config.preferences_hover = hover
config.preferences_selected_idle = selected_idle
config.preferences_selected_hover = selected_hover
config.preferences_hotspots = hotspots
@layout
def imagemap_yesno_prompt(ground, idle, hover, hotspots, prompt_images={ }):
renpy.load_module("_layout/imagemap_yesno_prompt")
config.yesno_prompt_ground = ground
config.yesno_prompt_idle = idle
config.yesno_prompt_hover = hover
config.yesno_prompt_hotspots = hotspots
config.yesno_prompt_message_images = prompt_images
@layout
def imagemap_load_save(ground, idle, hover, selected_idle, selected_hover,
hotspots, variant=None):
renpy.load_module("_layout/imagemap_load_save")
config.load_save_ground[variant] = ground
config.load_save_idle[variant] = idle
config.load_save_hover[variant] = hover
config.load_save_selected_idle[variant] = selected_idle
config.load_save_selected_hover[variant] = selected_hover
config.load_save_hotspots[variant] = hotspots
@layout
def screen_main_menu():
renpy.load_module("_layout/screen_main_menu")
@layout
def screen_load_save():
renpy.load_module("_layout/screen_load_save")
@layout
def screen_preferences():
renpy.load_module("_layout/screen_preferences")
@layout
def screen_joystick_preferences():
renpy.load_module("_layout/screen_joystick_preferences")
@layout
def screen_yesno_prompt():
renpy.load_module("_layout/screen_yesno_prompt")
layout.ARE_YOU_SURE = u"Are you sure?"
layout.DELETE_SAVE = u"Are you sure you want to delete this save?"
layout.OVERWRITE_SAVE = u"Are you sure you want to overwrite your save?"
layout.LOADING = u"Loading will lose unsaved progress.\nAre you sure you want to do this?"
layout.QUIT = u"Are you sure you want to quit?"
layout.MAIN_MENU = u"Are you sure you want to return to the main menu?\nThis will lose unsaved progress."
@layout
def invoke_yesno_prompt(*args):
_enter_menu()
return layout.yesno_prompt(*args)
@layout
def yesno_screen(message, yes=None, no=None):
"""
:doc: other
This causes the a yes/no prompt screen with the given message
to be displayed. The screen will be hidden when the user hits
yes or no.
`message`
The message that will be displayed.
`yes`
An action that is run when the user chooses yes.
`no`
An action that is run when the user chooses no.
"""
if renpy.has_screen("yesno_prompt"):
yes_action = [ Hide("yesno_prompt") ]
no_action = [ Hide("yesno_prompt") ]
if yes is not None:
yes_action.append(yes)
if no is not None:
no_action.append(no)
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.invoke_yesno_prompt, None, message):
if yes is not None:
yes()
else:
if no is not None:
no()
def __auto_save_extra_info():
return save_name
config.auto_save_extra_info = __auto_save_extra_info
+914
View File
@@ -0,0 +1,914 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file consists of renpy functions that aren't expected to be
# touched by the user too much. We reserve the _ prefix for names
# defined in the library.
init -1180 python:
# These are settings that the user can tweak to control the
# look of the main menu and the load/save/escape screens.
# basics: The version of Ren'Py this script is intended for, or
# None if it's intended for the current version.
config.script_version = None
# The minimum version of the module we work with. Don't change
# this unless you know what you're doing.
config.module_version = 6007001
# Should we warn the user if the module is missing or has a bad
# version?
config.module_warning = False
# basics: A map from a string that's displayed by the interface to
# a translated value of that string.
config.translations = { }
# Used internally to maintain compatiblity with old
# translations of strings.
config.old_names = { }
# basics: True if the skip indicator should be shown.
config.skip_indicator = True
# basics: The width of a thumbnail.
config.thumbnail_width = 66
# basics: The height of a thumbnail.
config.thumbnail_height = 50
# basics: If not None, the default value of the fullscreen
# preference when the game is first run.
config.default_fullscreen = None
# basics: If not None, the default value of the text_cps
# preference when the game is first run.
config.default_text_cps = None
# If not None, the default value of afm_time
config.default_afm_time = None
# If not None, the default value of afm_enable
config.default_afm_enable = None
# Should we automatically define images?
config.automatic_images = None
# Prefixes to strip from automatic images.
config.automatic_images_strip = [ ]
# A save to automatically load, if it exists.
config.auto_load = None
# Layers to clear when entering the menus.
config.menu_clear_layers = [ ]
# 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.
save_name = ''
# Should the window be shown during transitions?
_window_during_transitions = False
def _default_with_callback(trans, paired=None):
if (_window_during_transitions and not
renpy.context_nesting_level() and
not renpy.count_displayables_in_layer('transient')):
# narrator("", interact=False)
ui.window(style=style.say_window["empty"])
ui.null()
return trans
config.with_callback = _default_with_callback
def _default_empty_window():
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.')
style.skip_indicator.xpos = 10
style.skip_indicator.ypos = 10
# This is used to jump to a label with a transition.
def _intra_jumps_core(label, transition):
renpy.transition(getattr(config, transition))
renpy.jump(label)
_intra_jumps = renpy.curry(_intra_jumps_core)
# The function that's used to translate strings in the game menu.
def _(s):
"""
Translates s into another language or something.
"""
if s in config.translations:
return config.translations[s]
if s in config.old_names and config.old_names[s] in config.translations:
return config.translations[config.old_names[s]]
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
def toggle_skipping():
if not config.skipping:
config.skipping = "slow"
else:
config.skipping = None
if renpy.context()._menu:
renpy.jump("_noisy_return")
else:
renpy.restart_interaction()
config.help = None
def _help(help=None):
if help is None:
help = config.help
if help is None:
return
if renpy.has_label(help):
renpy.call_in_new_context(help)
return
_preferences.fullscreen = False
try:
import webbrowser
webbrowser.open_new("file:///" + config.basedir + "/" + help)
except:
pass
# Called to make a screenshot happen.
def _screenshot():
import os.path
import os
import __main__
# Pick the directory to save into.
dest = config.renpy_base.rstrip("/")
# Guess if we're an OSX App.
if dest.endswith("/Contents/Resources/autorun"):
# Go up 4 directories.
dest = os.path.dirname(dest)
dest = os.path.dirname(dest)
dest = os.path.dirname(dest)
dest = os.path.dirname(dest)
# Try to pick a filename.
i = 1
while True:
fn = os.path.join(dest, config.screenshot_pattern % i)
if not os.path.exists(fn):
break
i += 1
try:
renpy.screenshot(fn)
except:
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:
import os
config.screenshot_pattern = os.environ.get("RENPY_SCREENSHOT_PATTERN", "screenshot%04d.png")
def dump_styles():
if config.developer:
renpy.style.write_text("styles.txt")
# This is run when entering the game menu.
config.game_menu_action = None
def invoke_game_menu():
if renpy.context()._menu:
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)
else:
renpy.call_in_new_context('_game_menu')
def keymap_toggle_skipping():
if renpy.context()._menu:
return
toggle_skipping()
def fast_skip():
if config.fast_skipping or config.developer:
config.skipping = "fast"
if renpy.context()._menu:
renpy.jump("_noisy_return")
def reload_game():
if not config.developer:
return
renpy.call_in_new_context("_save_reload_game")
def launch_editor():
if not config.developer:
return
filename, line = renpy.get_filename_line()
renpy.launch_editor([ filename ], line)
# The default keymap. We might also want to put some of this into
# the launcher.
km = renpy.Keymap(
rollback = renpy.rollback,
screenshot = _screenshot,
toggle_fullscreen = renpy.toggle_fullscreen,
toggle_music = renpy.toggle_music,
toggle_skip = keymap_toggle_skipping,
fast_skip = fast_skip,
game_menu = invoke_game_menu,
hide_windows = renpy.curried_call_in_new_context("_hide_windows"),
launch_editor = launch_editor,
dump_styles = dump_styles,
reload_game = reload_game,
developer = renpy.curried_call_in_new_context("_developer"),
quit = renpy.quit_event,
iconify = renpy.iconify,
help = _help,
choose_renderer = renpy.curried_call_in_new_context("_choose_renderer"),
)
config.underlay = [ km ]
def skip_indicator():
### skip_indicator default
# (text) The style and placement of the skip indicator.
if config.skip_indicator is True:
if config.skipping == "slow" and config.skip_indicator:
ui.text(_(u"Skip Mode"), style='skip_indicator')
if config.skipping == "fast" and config.skip_indicator:
ui.text(_(u"Fast Skip Mode"), style='skip_indicator')
return
if not config.skip_indicator:
return
if not config.skipping:
return
ui.add(renpy.easy.displayable(config.skip_indicator))
config.overlay_functions.append(skip_indicator)
# Hyperlink functions. Duplicated in _errorhandling.rpym.
def hyperlink_styler(target):
return style.hyperlink_text
def hyperlink_function(target):
if target.startswith("http:"):
try:
import webbrowser
webbrowser.open(target)
except:
pass
else:
renpy.call_in_new_context(target)
style.default.hyperlink_functions = (hyperlink_styler, hyperlink_function, None)
# 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.imagemap_auto_function = imagemap_auto_function
label _hide_windows:
if renpy.context()._menu:
return
if _windows_hidden:
return
python:
_windows_hidden = True
ui.saybehavior(dismiss=['dismiss', 'hide_windows'])
ui.interact(suppress_overlay=True, suppress_window=True)
_windows_hidden = False
return
# This code here handles check for the correct version of the Ren'Py module.
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-1", "reload save game")
ui.add(Solid((0, 0, 0, 255)))
ui.text("Reloading script...",
size=32, xalign=0.5, yalign=0.5, color=(255, 255, 255, 255))
renpy.pause(0)
renpy.utter_restart()
label _load_reload_game:
if not renpy.can_load("_reload-1"):
return
python hide:
renpy.rename_save("_reload-1", "_reload-2")
ui.add(Solid((0, 0, 0, 255)))
ui.text("Reloading game...",
size=32, xalign=0.5, yalign=0.5, color=(255, 255, 255, 255))
ui.pausebehavior(0)
ui.interact(suppress_underlay=True, suppress_overlay=True)
renpy.load("_reload-2")
return
init -1001:
image text = renpy.ParameterizedText(style="centered_text")
# Lock the library object.
$ config.locked = True
# Implement config.default_fullscreen and config.default_text_cps.
init 1180 python:
if not persistent._set_preferences:
persistent._set_preferences = True
if config.default_fullscreen is not None:
_preferences.fullscreen = config.default_fullscreen
if config.default_text_cps is not None:
_preferences.text_cps = config.default_text_cps
if config.default_afm_time is not None:
_preferences.afm_time = config.default_afm_time
if config.default_afm_enable is not None:
_preferences.afm_enable = config.default_afm_enable
_preferences.using_afm_enable = True
else:
_preferences.afm_enable = True
_preferences.using_afm_enable = False
##############################################################################
# Code that originated in 00gamemenu.rpy
init -1180 python:
######################################################################
# First up, we define a bunch of configuration variable, which the
# user can change.
# menus: Music to play when entering the game menu.
config.game_menu_music = None
# menus: Sound played when entering the library without clicking a
# button.
config.enter_sound = None
# menus: Sound played when leaving the library without clicking a
# button.
config.exit_sound = None
# menus: Transition that occurs when entering the game menu.
config.enter_transition = None
# menus: Transition that occurs when leaving the game menu.
config.exit_transition = None
# menus: Transition that's used when going from one screen to another.
config.intra_transition = None
# menus: Transition that's used when going from the main to the game
# menu.
config.main_game_transition = None
# menus: Transition that's used when going from the game to the main
# menu.
config.game_main_transition = None
# menus: Transition that's used at the end of the game, when returning
# to the main menu.
config.end_game_transition = None
# menus: Transition that's used at the end of the splash screen, when
# it is shown.
config.end_splash_transition = None
# Transition that's used after the game is loaded.
config.after_load_transition = None
# basics: True if autosave should be used.
config.has_autosave = True
# basics: True if quicksave has been enabled.
config.has_quicksave = False
# A list of layers to clear when entering the main and game menus.
config.clear_layers = [ ]
# The _window_subtitle used inside menus.
config.menu_window_subtitle = ''
# The screen that we go to when entering the game menu.
_game_menu_screen = None
style.error_root = Style(style.default)
style.error_title = Style(style.default)
style.error_body = Style(style.default)
def _show_exception(title, message):
ui.window(style='error_root')
ui.vbox()
ui.text(title, style='error_title')
ui.text("")
ui.text(message, style='error_body')
ui.text("")
ui.text(_(u"Please click to continue."), style='error_body')
ui.close()
ui.saybehavior()
ui.interact()
def _enter_menu():
config.skipping = None
renpy.movie_stop(only_fullscreen=True)
renpy.take_screenshot((config.thumbnail_width, config.thumbnail_height))
for i in config.menu_clear_layers:
renpy.scene(layer=i)
renpy.context()._menu = True
renpy.context()._main_menu = False
renpy.context_dynamic("main_menu")
renpy.context_dynamic("_window_subtitle")
renpy.context_dynamic("_window")
store.main_menu = False
store._window_subtitle = config.menu_window_subtitle
store._window = False
store.mouse_visible = True
store.suppress_overlay = True
ui.clear()
for i in config.clear_layers:
renpy.scene(layer=i)
# Run at the end of init, to set up autosaving based on the user's
# choices.
init 1180 python:
if config.has_autosave:
config.autosave_slots = 10
else:
config.autosave_frequency = None
# Factored this all into one place, to make our lives a bit easier.
label _enter_game_menu:
$ _enter_menu()
$ renpy.transition(config.enter_transition)
if renpy.has_label("enter_game_menu"):
call expression "enter_game_menu" from _call_enter_game_menu_1
if config.game_menu_music:
$ renpy.music.play(config.game_menu_music, if_changed=True)
return
# Entry points from the game into menu-space.
label _game_menu(_game_menu_screen=_game_menu_screen):
if not _game_menu_screen:
return
$ renpy.play(config.enter_sound)
call _enter_game_menu from _call__enter_game_menu_0
if renpy.has_label("game_menu"):
jump expression "game_menu"
if renpy.has_screen(_game_menu_screen):
$ renpy.show_screen(_game_menu_screen)
$ ui.interact()
jump _noisy_return
jump expression _game_menu_screen
label _game_menu_save:
call _enter_game_menu from _call__enter_game_menu_1
if renpy.has_label("_save_screen"):
jump expression "_save_screen"
else:
jump expression "save_screen"
label _game_menu_load:
call _enter_game_menu from _call__enter_game_menu_2
if renpy.has_label("_load_screen"):
jump expression "_load_screen"
else:
jump expression "load_screen"
label _game_menu_preferences:
call _enter_game_menu from _call__enter_game_menu_3
if renpy.has_label("_prefs_screen"):
jump expression "_prefs_screen"
else:
jump expression "preferences_screen"
label _quit:
$ renpy.quit()
label _return_skipping:
$ config.skipping = "slow"
jump _return
# Make some noise, then return.
label _noisy_return:
$ renpy.play(config.exit_sound)
# Return to the game.
label _return:
if renpy.context()._main_menu:
$ renpy.transition(config.game_main_transition)
jump _main_menu_screen
$ renpy.transition(config.exit_transition)
return
label _confirm_quit:
if renpy.has_label("confirm_quit"):
jump expression "confirm_quit"
elif renpy.has_label("_compat_confirm_quit"):
jump expression "_compat_confirm_quit"
else:
jump expression "_quit_prompt"
##############################################################################
# Code that originated in 00mainmenu.rpy
init -1180 python hide:
# menus: Music to play at the main menu.
config.main_menu_music = None
# advanced: Callbacks to run at start.
config.start_callbacks = [ ]
# This fixes up the context, if necessary, then calls the real
# after_load.
label _after_load:
$ renpy.context()._menu = False
$ renpy.context()._main_menu = False
if config.after_load_transition:
$ renpy.transition(config.after_load_transition, force=True)
if renpy.has_label("after_load"):
jump expression "after_load"
else:
return
# This is the true starting point of the program. Sssh... Don't
# tell anyone.
label _start:
python hide:
renpy.context()._menu = False
renpy.context()._main_menu = False
for i in config.start_callbacks:
i()
$ renpy.block_rollback()
call _gl_test
call _load_reload_game from _call__load_reload_game_1
if not _restart and config.auto_load and renpy.can_load(config.auto_load):
$ renpy.load(config.auto_load)
if config.start_scene_black:
scene black
else:
scene
if not _restart:
$ ui.pausebehavior(0)
$ ui.interact(suppress_underlay=True, suppress_overlay=True)
$ 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
$ _game_menu_screen = _old_game_menu_screen
$ del _old_game_menu_screen
$ renpy.block_rollback()
if config.main_menu_music:
$ renpy.music.play(config.main_menu_music, if_changed=True)
else:
$ renpy.music.stop()
# Clean out any residual scene from the splashscreen.
if config.start_scene_black:
scene black
else:
scene
# This has to be python, to deal with a case where _restart may
# change across a shift-reload.
python:
if _restart is None:
renpy.transition(config.end_splash_transition)
else:
renpy.transition(_restart[0])
renpy.jump(_restart[1])
label _invoke_main_menu:
# Again, this has to be python.
python:
if _restart:
renpy.call_in_new_context(_restart[2])
else:
renpy.call_in_new_context("_main_menu")
# If the main menu returns, then start the game.
jump start
# At this point, we've been switched into a new context. So we
# initialize it.
label _main_menu(_main_menu_screen="_main_menu_screen"):
$ _enter_menu()
python:
renpy.dynamic("_load_prompt")
_load_prompt = False
renpy.context()._main_menu = True
store.main_menu = True
jump expression _main_menu_screen
# This is called to show the main menu to the user.
label _main_menu_screen:
# Let the user completely override the main menu. (But please note
# it still lives in the menu context, rather than the game context.)
if renpy.has_label("main_menu"):
jump expression "main_menu"
# New name.
elif renpy.has_label("main_menu_screen"):
jump expression "main_menu_screen"
# Compatibility name.
elif renpy.has_label("_library_main_menu"):
jump expression "_library_main_menu"
return
init 1180 python hide:
def create_automatic_images():
seps = config.automatic_images
if seps is True:
seps = [ ' ', '/', '_' ]
for dir, fn in renpy.loader.listdirfiles():
if fn.startswith("_"):
continue
# Only .png and .jpg
if not fn.lower().endswith(".png") and not fn.lower().endswith(".jpg"):
continue
# Strip the extension, replace slashes.
shortfn = fn[:-4].replace("\\", "/")
# Determine the name.
name = ( shortfn, )
for sep in seps:
name = tuple(j for i in name for j in i.split(sep))
# Strip name components.
while name:
for i in config.automatic_images_strip:
if name[0] == i:
name = name[1:]
break
else:
break
# Only names of 2 components or more.
if len(name) < 2:
continue
# Reject if it already exists.
if name in renpy.display.image.images:
continue
renpy.image(name, fn)
if config.automatic_images:
create_automatic_images()
# After init, make some changes based on if config.developer is True.
init 1180 python hide:
if config.developer:
if config.debug_sound is None:
config.debug_sound = True
renpy.load_module("_developer")
# Entry point for the developer screen. The rest of it is loaded from
# _developer.rpym
label _developer:
if not config.developer:
return
$ _enter_menu()
jump expression "_developer_screen"
# Translations.
init -1180 python:
def _language_activate():
if persistent._language:
language = persistent._language
else:
language = "translations"
if renpy.loadable(language + ".rpt"):
config.translator = renpy.Translator(language)
else:
config.translator = None
_language_activate()
+46
View File
@@ -0,0 +1,46 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# Common stuff that's used by the various Ren'Py menus. This includes
# the default definitions of config.main_menu and config.game_menu, as
# well as the default definitions of the various preferences (and the objects
# holding those preferences)
init -1150 python:
config.main_menu = [
(u"Start Game", "start", "True"),
(u"Load Game", _intra_jumps("load_screen", "main_game_transition"), "True"),
(u"Preferences", _intra_jumps("preferences_screen", "main_game_transition"), "True"),
(u"Help", _help, "True", "config.help"),
(u"Quit", ui.jumps("_quit"), "True"),
]
config.game_menu = [
( None, u"Return", ui.jumps("_return"), 'True'),
( "preferences", u"Preferences", _intra_jumps("preferences_screen", "intra_transition"), 'True' ),
( "save", u"Save Game", _intra_jumps("save_screen", "intra_transition"), 'not main_menu' ),
( "load", u"Load Game", _intra_jumps("load_screen", "intra_transition"), 'True'),
( None, u"Main Menu", ui.callsinnewcontext("_main_menu_prompt"), 'not main_menu' ),
( "help", u"Help", _help, "True", "config.help"),
( None, u"Quit", ui.callsinnewcontext("_quit_prompt"), 'True' ),
]
label _quit_prompt:
$ renpy.loadsave.force_autosave()
if layout.yesno_prompt(None, layout.QUIT):
jump _quit
else:
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:
return
+63
View File
@@ -0,0 +1,63 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file contains code that sets up the various mixers, based on how
# the user sets config.has_music, .has_sound, and .has_voice.
init -1130 python hide:
# Set to true in the very unlikely event you want to manually init
# the sound system.
config.force_sound = False
# basics: True if the game will have music.
config.has_music = True
# basics: True if the game will have sound effects.
config.has_sound = True
# Register 8 channels by default, for compatiblity with older version
# of Ren'Py.
for i in xrange(0, 8):
renpy.music.register_channel(i)
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")
renpy.music.alias_channel(7, "music")
renpy.music.alias_channel(2, "voice")
init 1130:
python hide:
if not config.has_music and not config.has_sound:
mixers = None
elif not config.has_music and config.has_sound:
mixers = [ 'sfx' ] * 8
elif config.has_music and not config.has_sound:
mixers = [ 'music' ] * 8
else:
mixers = [ 'sfx' ] * 3 + [ 'music' ] * 5
if config.has_voice:
if not mixers:
mixers = [ 'voice' ] * 8
else:
mixers[2] = 'voice'
if not mixers:
config.sound = config.force_sound
else:
for i, m in enumerate(mixers):
renpy.sound.set_mixer(i, m, default=True)
if m == 'music':
renpy.music.set_music(i, True, default=True)
else:
renpy.music.set_music(i, False, default=True)
+221
View File
@@ -0,0 +1,221 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file contains the code to implement Ren'Py's music room function,
# which consists of the ability to set up a playlist (the aforementioned
# "music room"), and then a series of actions that let the player
# navigate through the music room.
init -1135 python:
class __MusicRoomPlay(Action):
"""
The action returned by MusicRoom.Play when called with a file.
"""
def __init__(self, mr, filename):
self.mr = mr
self.filename = filename
self.selected = self.get_selected()
def __call__(self):
self.mr.play(self.filename, 0)
def get_sensitive(self):
return self.mr.is_unlocked(self.filename)
def get_selected(self):
return renpy.music.get_playing(self.mr.channel) == self.filename
def periodic(self, st):
if self.selected != self.get_selected():
renpy.restart_interaction()
return .1
class MusicRoom(object):
"""
:doc: music_room class
A music room that contains a series of songs that can be unlocked
by the user, and actions that can play entries from the list in
order.
"""
def __init__(self, channel="music", fadeout=0.0, fadein=0.0):
"""
`channel`
The channel that this music room will operate on.
`fadeout`
The number of seconds it takes to fade out the old
music when changing tracks.
`fadein`
The number of seconds it takes to fade in the new
music when changing tracks.
"""
self.channel = channel
self.fadeout = fadeout
self.fadein = fadein
# The list of strings giving the titles of songs that make up the
# playlist.
self.playlist = [ ]
# A set of filenames, so we can quickly check if a valid filename
# has been provided.
self.filenames = set()
# The set of songs that are always unlocked.
self.always_unlocked = set()
def add(self, filename, always_unlocked=False):
"""
:doc: music_room method
Adds the music file `filename` to this music room. The music room
will play unlocked files in the order that they are added to the
room.
`always_unlocked`
If true, the music file will be always unlocked. This allows
the file to show up in the music room before it has been
played in the game.
"""
self.playlist.append(filename)
self.filenames.add(filename)
if always_unlocked:
self.always_unlocked.add(filename)
def is_unlocked(self, filename):
"""
:doc: music_room method
Returns true if the filename has been unlocked (or is always
unlocked), and false if it is still locked.
"""
if filename in self.always_unlocked:
return True
return renpy.seen_audio(filename)
def unlocked_playlist(self):
"""
Returns a list of filenames in the playlist that have been
unlocked.
"""
return [ i for i in self.playlist if self.is_unlocked(i) ]
def play(self, filename=None, offset=0):
"""
Starts the music room playing. The file we start playing with is
selected in two steps.
If `filename` is an unlocked file, we start by playing it.
Otherwise, we start by playing the currently playing file, and if
that doesn't exist or isn't unlocked, we start with the first file.
We then apply `offset`. If `offset` is positive, we advance that many
files, otherwise we go back that many files.
The selected file is then played.
"""
playlist = self.unlocked_playlist()
if not playlist:
return
if filename is None:
filename = renpy.music.get_playing(channel=self.channel)
try:
idx = playlist.index(filename)
except ValueError:
idx = 0
idx = (idx + offset) % len(playlist)
playlist = playlist[idx:] + playlist[:idx]
renpy.music.play(playlist, channel=self.channel, fadeout=self.fadeout, fadein=self.fadein)
def stop(self):
"""
Stops the music from playing.
"""
renpy.music.stop(channel=self.channel, fadeout=self.fadeout)
def next(self):
"""
Plays the next file in the playlist.
"""
return self.play(None, 1)
def previous(self):
"""
Plays the previous file in the playlist.
"""
return self.play(None, -1)
def Play(self, filename=None):
"""
:doc: music_room method
Causes the music room to start playing. If `filename` is given, that
file begins playing. Otherwise, the currently playing file starts
over (if it's unlocked), or the first file starts playing.
If `filename` is given, buttons with this action will be insensitive
while `filename` is locked, and will be selected when `filename`
is playing.
"""
if filename is None:
return self.play
if filename not in self.filenames:
raise Exception("{0!r} is not a filename registered with this music room.".format(filename))
return __MusicRoomPlay(self, filename)
def Stop(self):
"""
:doc: music_room method
Stops the music.
"""
return self.stop
def Next(self):
"""
:doc: music_room method
An action that causes the music room to play the next unlocked file
in the playlist.
"""
return self.next
def Previous(self):
"""
:doc: music_room method
An action that causes the music room to play the previous unlocked
file in the playlist.
"""
return self.previous
+416
View File
@@ -0,0 +1,416 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This is an implementation of NVL-mode, which can be used to show
# dialogue in a fullscreen way, like NVL-style games. Multiple lines
# of dialogue are shown on the screen at once, whenever a line of
# dialogue is said by a NVLCharacter. Calling the nvl_clear function
# clears the screen, ensuring that the the next line will appear at
# the top of the screen.
#
# You can also have menus appear on the screen, by running:
#
# init:
# $ menu = nvl_menu
#
# It's also possible to make the narrator a NVLCharacter, using code like:
#
# init:
# $ narrator = NVLCharacter(None)
##############################################################################
# The implementation of NVL mode lives below this line.
init -1100 python:
# Styles that are used by nvl mode.
style.create('nvl_window', 'default', 'the window containing nvl-mode dialogue')
style.create('nvl_vbox', 'vbox', 'the vbox containing each box of nvl-mode dialogue')
style.create('nvl_label', 'say_label', 'an nvl-mode character\'s name')
style.create('nvl_dialogue', 'say_dialogue', 'nvl-mode character dialogue')
style.create('nvl_entry', 'default', 'a window containing each line of nvl-mode dialogue')
style.create('nvl_menu_window', 'default', 'a window containing an nvl-mode menu')
style.create('nvl_menu_choice', 'default', 'an nvl-mode menu choice')
style.create('nvl_menu_choice_chosen', 'nvl_menu_choice', 'an nvl-mode menu choice that has been chosen')
style.create('nvl_menu_choice_button', 'default', 'an nvl-mode choice button')
style.create('nvl_menu_choice_chosen_button', 'nvl_menu_choice_button', 'an nvl-mode choice button that\'s been chosen.')
# Set up nvl mode styles.
style.nvl_label.minwidth = 150
style.nvl_label.text_align = 1.0
style.nvl_window.background = "#0008"
style.nvl_window.yfill = True
style.nvl_window.xfill = True
style.nvl_window.xpadding = 20
style.nvl_window.ypadding = 30
style.nvl_vbox.box_spacing = 10
style.nvl_menu_choice.idle_color = "#0ff"
style.nvl_menu_choice.hover_color = "#ff0"
style.nvl_menu_choice_button.left_margin = 160
style.nvl_menu_choice_button.right_margin = 20
style.nvl_menu_choice_button.xfill = True
style.nvl_menu_choice_button.hover_background = "#F0F2"
# nvlmode: The CTC indicator to use when at the end of an NVL page.
config.nvl_page_ctc = None
# nvlmode: The position of the CTC indicator used at the end of an NVL page.
config.nvl_page_ctc_position = "nestled"
# Should we used paged rollback?
config.nvl_paged_rollback = False
# A hook that delta wanted, that is called instead of renpy.show_display_say
config.nvl_show_display_say = renpy.show_display_say
# A list of arguments that have been passed to nvl_record_show.
nvl_list = None
# If set, then all of the nvl-specific style get indexed with this.
nvl_variant = None
# Returns the appropriate variant style.
def __s(s):
if nvl_variant:
return s[nvl_variant]
else:
return s
def __nvl_screen_dialogue():
"""
Returns widget_properties and dialogue for the current NVL
mode screen.
"""
widget_properties = { }
dialogue = [ ]
for i, entry in enumerate(nvl_list):
if not entry:
continue
who, what, kwargs = entry
if i == len(nvl_list) - 1:
who_id = "who"
what_id = "what"
window_id = "window"
else:
who_id = "who%d" % i
what_id = "what%d" % i
window_id = "window%d" % i
widget_properties[who_id] = kwargs["who_args"]
widget_properties[what_id] = kwargs["what_args"]
widget_properties[window_id] = kwargs["window_args"]
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()
return renpy.get_widget(screen_name, "what")
def nvl_show_core(who=None, what=None):
# Screen version.
if renpy.has_screen("nvl"):
return __nvl_show_screen("nvl", items=[ ])
if renpy.in_rollback():
nvl_window = __s(style.nvl_window)['rollback']
nvl_vbox = __s(style.nvl_vbox)['rollback']
else:
nvl_window = __s(style.nvl_window)
nvl_vbox = __s(style.nvl_vbox)
ui.window(style=nvl_window)
ui.vbox(style=nvl_vbox)
rv = None
for i in nvl_list:
if not i:
continue
who, what, kw = i
rv = config.nvl_show_display_say(who, what, variant=nvl_variant, **kw)
ui.close()
renpy.shown_window()
return rv
def nvl_window():
nvl_show_core()
def nvl_show(with_):
nvl_show_core()
renpy.with_statement(with_)
def nvl_hide(with_):
nvl_show_core()
renpy.with_statement(None)
renpy.with_statement(with_)
def nvl_erase():
if nvl_list:
nvl_list.pop()
# Check to see if one of the next statements is nvl clear.
def nvl_clear_next():
# The number of statements forward to look.
count = 10
scry = renpy.scry()
scry = scry.next()
while count and scry:
count -= 1
if scry.nvl_clear:
return True
if scry.interacts:
return False
scry = scry.next()
class NVLCharacter(ADVCharacter):
def __init__(self,
who=renpy.character.NotSet,
kind=None,
**properties):
if kind is None:
kind = store.nvl
if "clear" in properties:
self.clear = properties.pop("clear")
else:
self.clear = kind.clear
ADVCharacter.__init__(
self,
who,
kind=kind,
**properties)
def do_add(self, who, what):
if store.nvl_list is None:
store.nvl_list = [ ]
kwargs = self.show_args.copy()
kwargs["what_args"] = self.what_args
kwargs["who_args"] = self.who_args
kwargs["window_args"] = self.window_args
store.nvl_list.append((who, what, kwargs))
def do_display(self, who, what, **display_args):
page = self.clear or nvl_clear_next()
if config.nvl_page_ctc and page:
display_args["ctc"] = config.nvl_page_ctc
display_args["ctc_position"] = config.nvl_page_ctc_position
if config.nvl_paged_rollback:
if page:
checkpoint = True
else:
if renpy.in_rollback():
return
checkpoint = False
else:
checkpoint = True
renpy.display_say(
who,
what,
nvl_show_core,
checkpoint=checkpoint,
**display_args)
def do_done(self, who, what):
if self.clear:
nvl_clear()
def do_extend(self):
renpy.mode(self.mode)
store.nvl_list = store.nvl_list[:-1]
# The default NVLCharacter.
nvl = NVLCharacter(
show_say_vbox_properties={ 'box_layout' : 'horizontal' },
who_style='nvl_label',
what_style='nvl_dialogue',
window_style='nvl_entry',
type='nvl',
mode='nvl',
clear=False,
kind=adv)
def nvl_clear():
store.nvl_list = [ ]
# 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:
widget_properties, dialogue = __nvl_screen_dialogue()
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))
for i in nvl_list:
if not i:
continue
who, what, kw = i
rv = renpy.show_display_say(who, what, **kw)
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()
rv = ui.interact(roll_forward=roll_forward)
renpy.checkpoint(rv)
return rv
NVLSpeaker = NVLCharacter
config.nvl_adv_transition = None
config.adv_nvl_transition = None
# This is used to execute the nvl and adv mode transitions.
def _nvl_adv_callback(mode, old_modes):
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:
def parse_nvl_show_hide(l):
rv = l.simple_expression()
if rv is None:
renpy.error('expected simple expression')
if not l.eol():
renpy.error('expected end of line')
return rv
def lint_nvl_show_hide(trans):
_try_eval(trans, 'transition')
def execute_nvl_show(trans):
nvl_show(eval(trans))
def execute_nvl_hide(trans):
nvl_hide(eval(trans))
renpy.statements.register("nvl show",
parse=parse_nvl_show_hide,
execute=execute_nvl_show,
lint=lint_nvl_show_hide)
renpy.statements.register("nvl hide",
parse=parse_nvl_show_hide,
execute=execute_nvl_hide,
lint=lint_nvl_show_hide)
def parse_nvl_clear(l):
if not l.eol():
renpy.error('expected end of line')
return None
def execute_nvl_clear(parse):
nvl_clear()
def scry_nvl_clear(parse, scry):
scry.nvl_clear = True
renpy.statements.register('nvl clear',
parse=parse_nvl_clear,
execute=execute_nvl_clear,
scry=scry_nvl_clear)
+1946
View File
File diff suppressed because it is too large Load Diff
+135
View File
@@ -0,0 +1,135 @@
# This file contains the spline motion code contributed by Aenakume, at
# http://lemmasoft.renai.us/forums/viewtopic.php?f=8&t=3977
init -1080 python:
class _SplineInterpolator(object):
ANCHORS = {
'top' : 0.0,
'center' : 0.5,
'bottom' : 1.0,
'left' : 0.0,
'right' : 1.0,
}
def __init__(self, points, anchors=(0.5, 0.5)):
assert len(points) >= 2, "Need at least a start and end point."
def setup_coordinate_(c):
if len(c) == 2:
c += anchors
return [ self.ANCHORS.get(i, i) for i in c ]
self.points = []
for p in points:
length = len(p)
if isinstance(p[-1], float):
length = len(p) - 1
point = [ p[-1] ]
else:
length = len(p)
point = [ -1 ]
self.points.append(point + [ setup_coordinate_(p[i]) for i in range(length) ])
# Make sure start and end times are set, if not already set
if self.points[0][0] == -1:
self.points[0][0] = 0.0
if self.points[-1][0] == -1:
self.points[-1][0] = 1.0
# Now we gotta calculate the step times that need calculating
for start in range(1, len(self.points) - 1):
if self.points[start][0] != -1:
continue
end = start + 1
while end < (len(self.points) - 1) and self.points[end][0] == -1:
end += 1
step = (self.points[end][0] - self.points[start - 1][0]) / float(end - start + 1)
for i in range(start, end):
self.points[i][0] = self.points[i - 1][0] + step
# And finally, sort the list of points by increasing time
self.points.sort(key=lambda a : a[0])
self.initialized = None
def init_values(self, sizes):
def to_abs_(value, size):
if type(value) == float:
return value * size
else:
return value
def coord_(c):
if len(c) == 2:
c = c + (0, 0)
return ( to_abs_(c[0], sizes[0]) - to_abs_(c[2], sizes[2]),
to_abs_(c[1], sizes[1]) - to_abs_(c[3], sizes[3]) )
for p in self.points:
for i in range(1, len(p)):
p[i] = coord_(p[i])
self.initialized = sizes
def __call__(self, t, sizes):
# Initialize if necessary
if not self.initialized == sizes:
self.init_values(sizes)
# Now we must determine which segment we are in
for segment in range(len(self.points)):
if self.points[segment][0] > t:
break
# If this is the zeroth segment, just start at the start point
if segment == 0:
result = self.points[0][1]
# If this is past the last segment, just leave it at the end point
elif segment == len(self.points) - 1 and t > self.points[-1][0]:
result = self.points[-1][1]
else:
# Scale t
t = (t - self.points[segment - 1][0]) / (self.points[segment][0] - self.points[segment - 1][0])
# Get start and end points
start = self.points[segment - 1][1]
end = self.points[segment][1]
# Now what kind of interpolation is it?
if len(self.points[segment]) == 2: # Straight line
t_p = 1.0 - t
result = [ t_p * start[i] + t * end[i] for i in 0,1 ]
elif len(self.points[segment]) == 3: # Quadratic Bezier
t_pp = (1.0 - t)**2
t_p = 2 * t * (1.0 - t)
t2 = t**2
result = [ t_pp * start[i] + t_p * self.points[segment][2][i] + t2 * end[i] for i in 0,1 ]
elif len(self.points[segment]) == 4: # Cubic Bezier
t_ppp = (1.0 - t)**3
t_pp = 3 * t * (1.0 - t)**2
t_p = 3 * t**2 * (1.0 - t)
t3 = t**3
result = [ t_ppp * start[i] + t_pp * self.points[segment][2][i] + t_p * self.points[segment][3][i] + t3 * end[i] for i in 0,1 ]
return ( absolute(result[0]), absolute(result[1]), 0, 0 )
def SplineMotion(points, time, child=None, anchors=(0.5, 0.5), repeat=False, bounce=False, anim_timebase=False, style='default', time_warp=None, **properties):
return Motion(_SplineInterpolator(points, anchors), time, child, repeat=repeat, bounce=bounce, anim_timebase=anim_timebase, style=style, time_warp=time_warp, add_sizes=True, **properties)
+569
View File
@@ -0,0 +1,569 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file contains code that creates a few new statements. We'll
# also describe here the API for defining your own statements.
#
# Statements can be defined by calling renpy.statements.register. This
# function takes a string giving the keywords at the start of the
# statement, and then up to 4 functions defining the behavior of the
# statement: parse, execute, predict, and lint. If given the keyword
# argument block=True, the statement will take a block.
#
# The parse function takes a lexer object as an argument, and is
# expected to return some parser data. The lexer has the following
# methods.
#
# l.eol() - True if we are at the end of the line.
# l.match(re) - Matches an arbitrary regexp string.
# l.keyword(s) - Matches s.
# l.name() - Matches any non-keyword name. Note that this only
# counts built-in keywords.
# l.word() - Matches any word, period.
# l.string() - Matches a renpy string.
# l.integer() - Matches an integer, returns a string containing the
# integer.
# l.float() - Matches a floating point number.
# l.simple_expression() - Matches a simple python expression, returns
# it as a string.
# l.rest() - Skips whitespace, then returns the rest of the line.
# l.checkpoint() - Returns an opaque object representing the current
# point in the parse.
# l.revert(o) - Given the object returned by l.checkpoint(), returns
# there.
#
# l.subblock_lexer() - Return a lexer that gives a sub-block for the
# block associated with the current statement.
# l.advance() - In a subblock lexer, advance to the next line. This needs
# to be called before the above functions can be called on the first line.
#
#
#
# The parse function is expected to return an object, which is passed
# to the other functions. Parse should call renpy.error with the error
# message to report an error.
#
# The execute function is passed the object returned from parse, and
# is expected to execute the statement.
#
# The predict function is passed the object returned from parse, and
# is expected to return a list of images that are used by the
# statement.
#
# The lint function is called at lint time, after the init code is
# run. It should check the statement for errors, and report them by
# calling renpy.error with the appropriate error message.
#
# The scry function is called with a scry object. It may mutate that
# object, but it is then expected to return it. See 00nvlmode.rpy for
# details.
#
# The next function is expected to return a string giving the label of
# the next statement to execute, or None to indicate that next
# statement in the block should be executed. The next function is
# called during predict, scry, and execute, and should always return
# the same value. (Or scrying may be incorrect.)
python early hide:
# Music play - The example of a full statement.
def parse_play_music(l):
file = l.simple_expression()
if not file:
renpy.error("play requires a file")
fadeout = "None"
fadein = "0"
channel = None
loop = None
if_changed = False
while True:
if l.eol():
break
if l.keyword('fadeout'):
fadeout = l.simple_expression()
if fadeout is None:
renpy.error('expected simple expression')
continue
if l.keyword('fadein'):
fadein = l.simple_expression()
if fadein is None:
renpy.error('expected simple expression')
continue
if l.keyword('channel'):
channel = l.simple_expression()
if channel is None:
renpy.error('expected simple expression')
continue
if l.keyword('loop'):
loop = True
continue
if l.keyword('noloop'):
loop = False
continue
if l.keyword('if_changed'):
if_changed = True
continue
renpy.error('could not parse statement.')
return dict(file=file,
fadeout=fadeout,
fadein=fadein,
channel=channel,
loop=loop,
if_changed=if_changed)
def execute_play_music(p):
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = "music"
renpy.music.play(eval(p["file"]),
fadeout=eval(p["fadeout"]),
fadein=eval(p["fadein"]),
channel=channel,
loop=p.get("loop", None),
if_changed=p.get("if_changed", False))
def predict_play_music(p):
return [ ]
def lint_play_music(p, channel="music"):
file = _try_eval(p["file"], 'filename')
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):
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,
predict=predict_play_music,
lint=lint_play_music)
# From here on, we'll steal bits of other statements when defining other
# statements.
def parse_queue_music(l):
file = l.simple_expression()
if not file:
renpy.error("queue requires a file")
channel = None
loop = None
while not l.eol():
if l.keyword('channel'):
channel = l.simple_expression()
if channel is None:
renpy.error('expected simple expression')
if l.keyword('loop'):
loop = True
continue
if l.keyword('noloop'):
loop = False
continue
renpy.error('expected end of line')
return dict(file=file, channel=channel, loop=loop)
def execute_queue_music(p):
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = "music"
renpy.music.queue(
eval(p["file"]),
channel=channel,
loop=p.get("loop", None))
renpy.statements.register('queue music',
parse=parse_queue_music,
execute=execute_queue_music,
lint=lint_play_music)
def parse_stop_music(l):
fadeout = "None"
if l.keyword("fadeout"):
fadeout = l.simple_expression()
channel = None
if l.keyword('channel'):
channel = l.simple_expression()
if channel is None:
renpy.error('expected simple expression')
if not l.eol():
renpy.error('expected end of line')
if fadeout is None:
renpy.error('expected simple expression')
return dict(fadeout=fadeout, channel=channel)
def execute_stop_music(p):
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = "music"
renpy.music.stop(fadeout=eval(p["fadeout"]), channel=channel)
renpy.statements.register('stop music',
parse=parse_stop_music,
execute=execute_stop_music)
# Sound statements. They share alot with the equivalent music
# statements.
def execute_play_sound(p):
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = "sound"
fadeout = eval(p["fadeout"]) or 0
renpy.sound.play(eval(p["file"]),
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_sound)
def execute_queue_sound(p):
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = "sound"
renpy.sound.queue(eval(p["file"]), channel=channel)
renpy.statements.register('queue sound',
parse=parse_queue_music,
execute=execute_queue_sound,
lint=lint_play_music)
def execute_stop_sound(p):
if p["channel"] is not None:
channel = eval(p["channel"])
else:
channel = "sound"
fadeout = eval(p["fadeout"]) or 0
renpy.sound.stop(fadeout=fadeout, channel=channel)
renpy.statements.register('stop sound',
parse=parse_stop_music,
execute=execute_stop_sound)
# Generic play/queue/stop statements. These take a channel name as
# the second thing.
def parse_play_generic(l, parse_play_music=parse_play_music):
channel = l.name()
if channel is None:
renpy.error('play requires a channel')
rv = parse_play_music(l)
if rv["channel"] is None:
rv["channel"] = repr(channel)
return rv
def parse_queue_generic(l, parse_queue_music=parse_queue_music):
channel = l.name()
if channel is None:
renpy.error('queue requires a channel')
rv = parse_queue_music(l)
if rv["channel"] is None:
rv["channel"] = repr(channel)
return rv
def parse_stop_generic(l, parse_stop_music=parse_stop_music):
channel = l.name()
if channel is None:
renpy.error('stop requires a channel')
rv = parse_stop_music(l)
if rv["channel"] is None:
rv["channel"] = repr(channel)
return rv
def lint_play_generic(p, lint_play_music=lint_play_music):
channel = eval(p["channel"])
if not renpy.music.channel_defined(channel):
renpy.error("channel %r is not defined" % channel)
lint_play_music(p, channel)
def lint_stop_generic(p):
channel = eval(p["channel"])
if not renpy.music.channel_defined(channel):
renpy.error("channel %r is not defined" % channel)
renpy.statements.register('play',
parse=parse_play_generic,
execute=execute_play_music,
predict=predict_play_music,
lint=lint_play_generic)
renpy.statements.register('queue',
parse=parse_queue_generic,
execute=execute_queue_music,
lint=lint_play_generic)
renpy.statements.register('stop',
parse=parse_stop_generic,
execute=execute_stop_music,
lint=lint_stop_generic)
##########################################################################
# "window show" and "window hide" statements.
def parse_window(l):
p = l.simple_expression()
if not l.eol():
renpy.error('expected end of line')
return p
def lint_window(p):
if p is not None:
_try_eval(p, 'window transition')
def execute_window_show(p):
if store._window:
return
if p is not None:
trans = eval(p)
else:
trans = config.window_show_transition
renpy.with_statement(None)
store._window = True
renpy.with_statement(trans)
def execute_window_hide(p):
if not _window:
return
if p is not None:
trans = eval(p)
else:
trans = config.window_hide_transition
renpy.with_statement(None)
store._window = False
renpy.with_statement(trans)
renpy.statements.register('window show',
parse=parse_window,
execute=execute_window_show,
lint=lint_window)
renpy.statements.register('window hide',
parse=parse_window,
execute=execute_window_hide,
lint=lint_window)
##########################################################################
# Pause statement.
def parse_pause(l):
delay = l.simple_expression()
if not l.eol():
renpy.error("expected end of line.")
return { "delay" : delay }
def lint_pause(p):
if p["delay"]:
_try_eval(p["delay"], 'pause statement')
def execute_pause(p):
if p["delay"]:
delay = eval(p["delay"])
renpy.with_statement(Pause(delay))
else:
renpy.pause()
renpy.statements.register('pause',
parse=parse_pause,
lint=lint_pause,
execute=execute_pause)
init -1200 python:
config.window_show_transition = None
config.window_hide_transition = None
def _try_eval(e, what):
try:
return eval(e)
except:
renpy.error('unable to evaluate %s %r' % (what, e))
##############################################################################
# Screen-related statements.
python early hide:
def parse_show_call_screen(l):
# Parse a name.
name = l.require(l.name)
# Parse a parameter list. (name -> expression string)
parameters = { }
if l.match(r"\("):
while True:
pname = l.name()
if not pname:
break
l.require(r"=")
expr = l.delimited_python(",)")
if not expr:
l.error("expected expression.")
parameters[pname] = expr
if not l.match(r','):
break
l.require(r'\)')
l.expect_eol()
return dict(name=name, parameters=parameters)
def parse_hide_screen(l):
name = l.require(l.name)
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"]
parameters = p["parameters"]
kwargs = { }
for k, v in parameters.iteritems():
kwargs[k] = eval(v)
renpy.show_screen(name, **kwargs)
def execute_call_screen(p):
name = p["name"]
parameters = p["parameters"]
kwargs = { }
for k, v in parameters.iteritems():
kwargs[str(k)] = eval(v)
store._return = renpy.call_screen(name, **kwargs)
def execute_hide_screen(p):
name = p["name"]
renpy.hide_screen(name)
def lint_screen(p):
name = p["name"]
if not renpy.has_screen(name):
renpy.error("Screen %s does not exist." % name)
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",
parse=parse_hide_screen,
execute=execute_hide_screen)
+328
View File
@@ -0,0 +1,328 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file is responsible for creating and defining the default styles
# used by the system.
# This file should be considered part of the Ren'Py library, and not
# something that needs to be modified by the user. Instead, just update
# the appropriate style property in an init: block in your script.
#
# For example, to change the default window backgrounds to a
# transparent dark red, add:
#
# init:
# $ style.window.background = "#8008"
#
# to your script. No need to mess around here, it will just make your
# life harder when a new version of Ren'Py is released.
init -1200 python hide:
# Style Declarations #################################################
style.default = Style(None, help='root of style hierarchy')
style.text = Style(style.default, help='style of text')
style.fixed = Style(style.default, help='fixed layouts')
style.hbox = Style(style.default, help='horizontal boxes')
style.vbox = Style(style.default, help='vertical boxes')
style.grid = Style(style.default, help='grid layouts')
style.side = Style(style.default, help='side layouts')
style.window = Style(style.default, help='windows created with ui.window')
style.image_placement = Style(style.default, help='default placement of images on the screen')
style.image = Style(style.default, help="default style of images")
style.motion = Style(style.default, help="default style of motions and zooms.")
style.animation = Style(style.default, help="default style of animations.")
style.say_label = Style(style.default, help='the name of the character speaking dialogue.')
style.say_dialogue = Style(style.default, help='used for dialogue text')
style.say_thought = Style(style.default, help='used by the default narrator')
style.say_window = Style(style.window, help='windows containing dialogue and thoughts')
style.say_who_window = Style(style.window, help='window containing the label in two-window-say mode')
style.say_two_window_vbox = Style(style.vbox, help='vbox containing the two windows in two-window-say mode')
style.say_vbox = Style(style.vbox, help='contains the label (if present) and the body of dialogue')
style.menu = Style(style.default, help='the vbox containing an in-game menu')
style.menu_caption = Style(style.default, help='in-game menu caption text')
style.menu_choice = Style(style.default, help='text of an in-game menu choice')
style.menu_choice_button = Style(style.default, help='buttons containing in-game menu choices')
style.menu_choice_chosen = Style(style.menu_choice, help='text of an in-game menu choice that has been chosen')
style.menu_choice_chosen_button = Style(style.menu_choice_button, help='buttons containing chosen in-game menu choices')
style.menu_window = Style(style.window, help='a window containing a menu')
style.input = Style(style.default, help='style of an input control')
style.input_text = Style(style.input, help='text of an input box')
style.input_prompt = Style(style.default, help='prompt of an input box')
style.input_window = Style(style.window, help='window of an input box')
style.centered_window = Style(style.default, help='window containing centered text')
style.centered_text = Style(style.default, help='centered text')
style.imagemap = Style(style.image_placement, help='default style of imagemaps')
style.hotspot = Style(style.default, help='default style of hotspots inside imagemaps')
style.hotbar = Style(style.default, help='default style of hotbars inside imagemaps')
style.imagemap_button = style.hotspot
style.image_button = Style(style.default, help='default style of image buttons')
style.image_button_image = Style(style.default, help='default style of images inside image buttons')
style.hyperlink = Style(style.default, help=None) # ignored
style.hyperlink_text = Style(style.default, help='hyperlinked text')
style.ruby_text = Style(style.default, help='ruby text')
style.viewport = Style(style.default, help='default style of viewports')
style.transform = Style(style.motion, help='default style of transforms')
style.list = Style(style.default)
style.list_box = Style(style.vbox)
style.list_row = Style(style.default)
style.list_row_box = Style(style.hbox)
style.list_spacer = Style(style.default)
style.list_text = Style(style.default)
style.tile = Style(style.default, help='default style of tile')
# The base styles that can be customized by themes.
style.frame = Style(style.default, help='base style for frames.')
style.menu_frame = Style(style.frame, help='base style for frames used in the game and main menus.')
style.button = Style(style.default, help='base style for buttons.')
style.button_text = Style(style.default, help='base style for button text')
style.small_button = Style(style.button, help="base style for small buttons")
style.small_button_text = Style(style.button_text, help="base style for small button text")
style.radio_button = Style(style.button, help="base style for radio buttons")
style.radio_button_text = Style(style.button_text, help="base style for radio button text")
style.check_button = Style(style.button, help="base style for check buttons")
style.check_button_text = Style(style.button_text, help="base style for check button text")
style.large_button = Style(style.default, help="base style for large buttons")
style.large_button_text = Style(style.default, help="base style for large button text")
style.label = Style(style.default, help="base style for windows surrounding labels")
style.label_text = Style(style.default, help="base style for label text")
style.prompt = Style(style.default, help="base style for windows surrounding prompts")
style.prompt_text = Style(style.default, help="base style for prompt text")
style.bar = Style(style.default, help='base style for horizontal bars')
style.vbar = Style(style.default, help='base style for vertical bars')
style.slider = Style(style.default, help='base style for horizontal sliders')
style.vslider = Style(style.default, help='base style for vertical sliders')
style.scrollbar = Style(style.default, help='base style for horizontal scrollbars')
style.vscrollbar = Style(style.default, help='base style for vertical scollbars')
style.mm_root = Style(style.default, help="main menu root window")
style.gm_root = Style(style.default, help="game menu root window")
init -1090 python:
# Colors #############################################################
# The Default Style ###################################################
# Text properties.
style.default.font = "DejaVuSans.ttf"
style.default.language = "unicode"
style.default.antialias = True
style.default.size = 22
style.default.color = (255, 255, 255, 255)
style.default.black_color = (0, 0, 0, 255)
style.default.bold = False
style.default.italic = False
style.default.underline = False
style.default.strikethrough = False
style.default.kerning = 0.0
style.default.drop_shadow = None
style.default.drop_shadow_color = (0, 0, 0, 255)
style.default.outlines = [ ]
style.default.minwidth = 0
style.default.text_align = 0
style.default.justify = False
style.default.text_y_fudge = 0
style.default.first_indent = 0
style.default.rest_indent = 0
style.default.line_spacing = 0
style.default.line_leading = 0
style.default.line_overlap_split = 0
style.default.layout = "tex"
style.default.subtitle_width = 0.9
style.default.slow_cps = None
style.default.slow_cps_multiplier = 1.0
style.default.slow_abortable = False
# style.default.hyperlink_functions (set in 00library.rpy)
# Window properties.
style.default.background = None
style.default.xpadding = 0
style.default.ypadding = 0
style.default.xmargin = 0
style.default.ymargin = 0
style.default.xfill = False
style.default.yfill = False
style.default.xminimum = 0 # Includes margins and padding.
style.default.yminimum = 0 # Includes margins and padding.
# Placement properties.
style.default.xpos = None # 0
style.default.ypos = None # 0
style.default.xanchor = None # 0
style.default.yanchor = None # 0
style.default.xmaximum = None
style.default.ymaximum = None
style.default.xoffset = 0
style.default.yoffset = 0
style.default.subpixel = False
# Sound properties.
style.default.sound = None
# Box properties.
style.default.spacing = 0
style.default.first_spacing = None
style.default.box_layout = None
style.default.box_wrap = False
# Focus properties.
style.default.focus_mask = None
style.default.focus_rect = None
# Bar properties.
style.default.fore_bar = Null()
style.default.aft_bar = Null()
style.default.thumb = None
style.default.thumb_shadow = None
style.default.left_gutter = 0
style.default.right_gutter = 0
style.default.thumb_offset = 0
style.default.unscrollable = None
# Misc.
style.default.activate_sound = None
style.default.clipping = False
# Boxes.
style.hbox.box_layout = 'horizontal'
style.vbox.box_layout = 'vertical'
# Motions, zooms, rotozooms, and transforms.
style.motion.xanchor = 0
style.motion.yanchor = 0
style.motion.xpos = 0
style.motion.ypos = 0
# Windows.
style.window.background = Solid((0, 0, 0, 192))
style.window.xpadding = 6
style.window.ypadding = 6
style.window.xmargin = 0
style.window.ymargin = 0
style.window.xfill = True
style.window.yfill = False
style.window.yminimum = 150 # Includes margins and padding.
style.window.xalign = 0.5
style.window.yalign = 1.0
# Dialogue
style.say_label.bold = True
style.say_vbox.spacing = 8
# Two window styles.
style.say_who_window.xminimum = 200
style.say_who_window.yminimum = 34
style.say_who_window.xfill = False
style.say_who_window.xalign = 0
style.say_two_window_vbox.yalign = 1.0
# Menus.
style.menu_choice.idle_color = "#0ff"
style.menu_choice.hover_color = "#ff0"
style.input.color = "#ff0"
# Styles used by centered.
style.centered_window.xalign = 0.5
style.centered_window.xfill = False
style.centered_window.yalign = 0.5
style.centered_window.yfill = False
style.centered_window.xpadding = 10
style.centered_text.textalign = 0.5
style.centered_text.xalign = 0.5
style.centered_text.yalign = 0.5
style.centered_text.layout = "subtitle"
# Hyperlinks.
style.hyperlink_text.underline = True
style.hyperlink_text.hover_color = "#0ff"
style.hyperlink_text.idle_color = "#08f"
# Ruby.
style.ruby_text.size = 22
style.ruby_text.xoffset = 0
style.default.ruby_style = style.ruby_text
# Bars.
style.default.bar_invert = False
style.default.bar_resizing = False
style.default.bar_vertical = False
style.vbar.bar_vertical = True
style.vslider.bar_vertical = True
style.vscrollbar.bar_vertical = True
style.vscrollbar.bar_invert = True
# Viewport
style.viewport.clipping = True
# Transform
style.transform.subpixel = True
# Menu windows.
style.mm_root.background = "#000"
style.mm_root.xfill = True
style.mm_root.yfill = True
style.gm_root.background = "#000"
style.gm_root.xfill = True
style.gm_root.yfill = True
# Lists.
style.list_row.xfill = True
style.list_row.ymargin = 0
style.list_row.background = "#eee"
style.list_row[1].background = "#ddd"
style.list_row.hover_background = "#fff"
style.list_row[1].hover_background = "#fff"
style.list_row.selected_background = "#cce"
style.list_row[1].selected_background = "#cce"
style.list_text.color = "#000"
style.list_text.size = 14
style.list_spacer.xminimum = 15
# Tile
style.tile.clipping = True
######################################################################
# Error messages.
style.error_root.background = Solid((220, 220, 255, 255))
style.error_root.xfill = True
style.error_root.yfill = True
style.error_root.xpadding = 20
style.error_root.ypadding = 20
style.error_title.color = (255, 128, 128, 255)
style.error_body.color = (128, 128, 255, 255)
+170
View File
@@ -0,0 +1,170 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file contains code for the style preferences system, which allows
# the user to define preferences that update styles.
init -1135 python:
# A map from preference name to list of (alternative, style, property, value)
# tuples.
__preferences = { }
# A map from preference name to the list of alternatives for that preference.
__alternatives = { }
# Are style preferences dirty? If so, we need to update them at the start of
# the next operation.
__spdirty = object()
__spdirty.flag = True
# A map from preference name to alternative.
if persistent._style_preferences is None:
persistent._style_preferences = { }
def __register_style_preference(preference, alternative, style, property, value):
"""
:doc: style_preferences
:name: renpy.register_style_preference
Registers information about an alternative for a style preference.
`preference`
A string, the name of the style property.
`alternative`
A string, the name of the alternative.
`style`
The style that will be updated. This may be a style object or a string giving the style name.
`property`
A string giving the name of the style property that will be update.
`value`
The value that will be assigned to the style property.
"""
if preference not in __preferences:
__preferences[preference] = [ ]
__alternatives[preference] = [ ]
if alternative not in __alternatives:
__alternatives[preference].append(alternative)
__preferences[preference].append((alternative, style, property, value))
def __init():
"""
Called at the end of the init phase, to ensure that each preference
has a valid value.
"""
for preference, alternatives in __alternatives.iteritems():
alt = persistent._style_preferences.get(preference, None)
if alt not in alternatives:
persistent._style_preferences[preference] = alternatives[0]
def __update():
"""
Called at least once per interaction, to update the styles if necessary.
"""
if not __spdirty.flag:
return
for preference, alternatives in __preferences.iteritems():
alt = persistent._style_preferences.get(preference, None)
for alternative, style, property, value in alternatives:
if alternative == alt:
setattr(style, property, value)
renpy.style.rebuild()
__spdirty.flag = False
def __check(preference, alternative=None):
if preference not in __alternatives:
raise Exception("{0} is not a known style preference.".format(preference))
if alternative is not None:
if alternative not in __alternatives[preference]:
raise Exception("{0} is not a known alternative for style preference {1}.".format(alternative, preference))
def __set_style_preference(preference, alternative):
"""
:doc: style_preferences
:name: renpy.set_style_preference
Sets the selected alternative for the style preference.
`preference`
A string giving the name of the style preference.
`alternative`
A string giving the name of the alternative.
"""
__check(preference, alternative)
persistent._style_preferences[preference] = alternative
__spdirty.flag = True
renpy.restart_interaction()
def __get_style_preference(preference):
"""
:doc: style_preferences
:name: renpy.get_style_preference
Returns a string giving the name of the selected alternative for the named style preference.
`preference`
A string giving the name of the style preference.
"""
__check(preference)
return persistent._style_preferences[preference]
class StylePreference(Action):
"""
:doc: style_preferences
An action that causes `alternative` to become the selected alternative for the given style preference.
`preference`
A string giving the name of the style preference.
`alternative`
A string giving the name of the alternative.
"""
def __init__(self, preference, alternative):
__check(preference, alternative)
self.preference = preference
self.alternative = alternative
def __call__(self):
__set_style_preference(self.preference, self.alternative)
def get_selected(self):
return __get_style_preference(self.preference) == self.alternative
renpy.register_style_preference = __register_style_preference
renpy.set_style_preference = __set_style_preference
renpy.get_style_preference = __get_style_preference
config.interact_callbacks.append(__update)
init 1135 python:
__init()
+1231
View File
File diff suppressed because it is too large Load Diff
+1290
View File
File diff suppressed because it is too large Load Diff
+131
View File
@@ -0,0 +1,131 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This extra contains a basic implementation of voice support. Right
# now, voice is given its own toggle, and can either be turned on or
# turned off. In the future, we'll probably provide some way of
# toggling it on or off for individual characters.
#
# To use it, place a voice "<sndfile>" line before each voiced line of
# dialogue.
#
# voice "e_1001.ogg"
# e "Voice support lets you add the spoken word to your games."
#
# Normally, a voice is cancelled at the start of the next
# interaction. If you want a voice to span interactions, call
# voice_sustain.
#
# voice "e_1002.ogg"
# e "Voice sustain is a technique that allows the same voice file.."
#
# $ voice_sustain()
# e "...to play for two lines of dialogue."
init -1120:
python:
_voice = object()
_voice.play = None
_voice.sustain = False
_voice.seen_in_lint = False
# Call this to specify the voice file that will be played for
# the user.
def voice(file, **kwargs):
if not config.has_voice:
return
_voice.play = file
_last_voice_play = file
# Call this to specify that the currently playing voice file
# should be sustained through the current interaction.
def voice_sustain(ignored="", **kwargs):
if not config.has_voice:
return
_voice.sustain = True
# Call this to replay the last bit of voice.
def voice_replay():
renpy.sound.play(_last_voice_play, channel="voice")
# Returns true if we can replay the voice.
def voice_can_replay():
return _last_voice_play != None
python hide:
# basics: True if the game will have voice.
config.has_voice = True
# This is called on each interaction, to ensure that the
# appropriate voice file is played for the user.
def voice_interact():
if not config.has_voice:
return
if _voice.play and not config.skipping:
renpy.sound.play(_voice.play, channel="voice")
store._last_voice_play = _voice.play
elif not _voice.sustain:
renpy.sound.stop(channel="voice")
store._last_voice_play = _voice.play
_voice.play = None
_voice.sustain = False
config.start_interact_callbacks.append(voice_interact)
config.say_sustain_callbacks.append(voice_sustain)
def voice_afm_callback():
return not renpy.sound.is_playing(channel="voice")
config.afm_callback = voice_afm_callback
python early hide:
def parse_voice(l):
fn = l.simple_expression()
if fn is None:
renpy.error('expected simple expression (string)')
if not l.eol():
renpy.error('expected end of line')
return fn
def execute_voice(fn):
fn = eval(fn)
voice(fn)
def lint_voice(fn):
_voice.seen_in_lint = True
fn = _try_eval(fn, 'voice filename')
if isinstance(fn, basestring) and not renpy.loadable(fn):
renpy.error('voice file %r is not loadable' % fn)
renpy.statements.register('voice',
parse=parse_voice,
execute=execute_voice,
lint=lint_voice)
def parse_voice_sustain(l):
if not l.eol():
renpy.error('expected end of line')
return None
def execute_voice_sustain(parsed):
voice_sustain()
renpy.statements.register('voice sustain',
parse=parse_voice_sustain,
execute=execute_voice_sustain)
Binary file not shown.
+99
View File
@@ -0,0 +1,99 @@
Fonts are (c) Bitstream (see below). DejaVu changes are in public domain.
Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below)
Bitstream Vera Fonts Copyright
------------------------------
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is
a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute the
Font Software, including without limitation the rights to use, copy, merge,
publish, distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to the
following conditions:
The above copyright and trademark notices and this permission notice shall
be included in all copies of one or more of the Font Software typefaces.
The Font Software may be modified, altered, or added to, and in particular
the designs of glyphs or characters in the Fonts may be modified and
additional glyphs or characters may be added to the Fonts, only if the fonts
are renamed to names not containing either the words "Bitstream" or the word
"Vera".
This License becomes null and void to the extent applicable to Fonts or Font
Software that has been modified and is distributed under the "Bitstream
Vera" names.
The Font Software may be sold as part of a larger software package but no
copy of one or more of the Font Software typefaces may be sold by itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT,
TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME
FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING
ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE
FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font Software
without prior written authorization from the Gnome Foundation or Bitstream
Inc., respectively. For further information, contact: fonts at gnome dot
org.
Arev Fonts Copyright
------------------------------
Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and
associated documentation files (the "Font Software"), to reproduce
and distribute the modifications to the Bitstream Vera Font Software,
including without limitation the rights to use, copy, merge, publish,
distribute, and/or sell copies of the Font Software, and to permit
persons to whom the Font Software is furnished to do so, subject to
the following conditions:
The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.
The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Tavmjong Bah" or the word "Arev".
This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Tavmjong Bah Arev" names.
The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the name of Tavmjong Bah shall not
be used in advertising or otherwise to promote the sale, use or other
dealings in this Font Software without prior written authorization
from Tavmjong Bah. For further information, contact: tavmjong @ free
. fr.
$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $
BIN
View File
Binary file not shown.
-55
View File
@@ -1,55 +0,0 @@
This package was debianized by Michael Fedrowitz <michaelf@debian.org>
on Sun, 23 Feb 2003.
It was downloaded from
'http://ftp.gnome.org/pub/GNOME/sources/ttf-bitstream-vera/'.
Upstream Author: Bitstream, Inc.
Copyright:
Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
Vera is a trademark of Bitstream, Inc.
Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute
the Font Software, including without limitation the rights to use,
copy, merge, publish, distribute, and/or sell copies of the Font
Software, and to permit persons to whom the Font Software is furnished
to do so, subject to the following conditions:
The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.
The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Bitstream" or the word "Vera".
This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Bitstream Vera" names.
The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.
Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font
Software without prior written authorization from the Gnome Foundation
or Bitstream Inc., respectively. For further information, contact:
fonts at gnome dot org.
+504
View File
@@ -0,0 +1,504 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
######################################################################
# First up, we define a bunch of configuration variable, which the
# user can change.
# The contents of the game menu choices.
config.game_menu = [
( "return", u"Return", ui.jumps("_return"), 'True'),
( "skipping", u"Begin Skipping", ui.jumps("_return_skipping"), 'config.allow_skipping and not renpy.context()._main_menu'),
( "prefs", u"Preferences", _intra_jumps("_prefs_screen", "intra_transition"), 'True' ),
( "save", u"Save Game", _intra_jumps("_save_screen", "intra_transition"), 'not renpy.context()._main_menu' ),
( "load", u"Load Game", _intra_jumps("_load_screen", "intra_transition"), 'True'),
( "mainmenu", u"Main Menu", lambda : _mainmenu_prompt(), 'not renpy.context()._main_menu' ),
( "quit", u"Quit", lambda : _quit_prompt("quit"), 'True' ),
]
# If not None, a map from the names of the game menu
# navigation buttons to new fixed positions for them on
# the screen.
config.game_menu_positions = None
# The number of columns of files to show at once.
config.file_page_cols = 2
# The number of rows of files to show at once.
config.file_page_rows = 5
# The number of pages to add quick access buttons for.
config.file_quick_access_pages = 5
# The positions of file picker components.
config.file_picker_positions = None
# This lets us disable the file pager. (So we only have one
# page of files.)
config.disable_file_pager = False
# This lets us disable the thumbnails in the file pager.
config.disable_thumbnails = False
# How we format time.
config.time_format = "%b %d, %H:%M"
# How we format loade_save slot formats.
config.file_entry_format = "%(time)s\n%(save_name)s"
# If True, we will be prompted before loading a game. (This can
# be changed from inside the game code, so that one can load from
# the first few screens but not after that.)
_load_prompt = True
_game_menu_screen = "_save_screen"
######################################################################
# Next, support code.
# This is used to store scratch data that's used by the
# library, but shouldn't be saved out as part of the savegame.
_scratch = object()
# This returns a window containing the game menu navigation
# buttons, set up to jump to the appropriate screen sections.
#
# This can be overridden by user code. It's called with the
# name of the selected screen... one of "mainmenu", "prefs",
# "save", "load", or "quit", at least for the default game
# menu. If None, then it's an indication that none of the
# nav buttons should be shown.
def _game_nav(screen, buttons=True):
global _screen
_screen = screen
ui.add(renpy.Keymap(toggle_fullscreen = renpy.toggle_fullscreen))
ui.add(renpy.Keymap(game_menu=ui.jumps("_noisy_return")))
ui.window(style=style.gm_root[screen])
ui.null()
if not screen:
return
if not config.game_menu_positions:
ui.window(style='gm_nav_frame')
ui.vbox(focus='gm_nav', style='gm_nav_vbox')
for i, (key, label, clicked, enabled) in enumerate(config.game_menu):
disabled = False
if not eval(enabled):
disabled = True
clicked = None
if config.game_menu_positions:
kwargs = config.game_menu_positions.get(label, { })
else:
kwargs = { }
_button_factory(label, "gm_nav",
selected=(key==screen),
disabled=disabled,
clicked=clicked,
properties=kwargs)
if not config.game_menu_positions:
ui.close()
# This is called from the game menu to interact with the
# user. It suppresses all of the underlays and overlays.
def _game_interact():
return ui.interact(suppress_underlay=True,
suppress_overlay=True,
mouse="gamemenu")
# This renders a slot with a file in it, in the file picker.
def _render_savefile(index, name, filename, extra_info, screenshot, mtime, newest, clickable, **positions):
if clickable:
clicked = ui.returns(("return", (filename, True)))
else:
clicked = None
ui.button(style=style.file_picker_entry[index],
clicked=clicked,
**positions)
ui.hbox(style=style.file_picker_entry_box[index])
if not config.disable_thumbnails:
ui.add(screenshot)
if newest:
ui.text(name + ". ", style=style.file_picker_new[index])
else:
ui.text(name + ". ", style=style.file_picker_old[index])
s = config.file_entry_format % dict(
time=renpy.time.strftime(config.time_format,
renpy.time.localtime(mtime)),
save_name=extra_info)
ui.text(s, style=style.file_picker_extra_info[index])
ui.close()
# This renders an empty slot in the file picker.
def _render_new_slot(index, name, filename, clickable, **positions):
if clickable:
clicked=ui.returns(("return", (filename, False)))
enable_hover = True
else:
clicked = None
enable_hover = True
ui.button(style=style.file_picker_entry[index],
clicked=clicked,
enable_hover=enable_hover,
**positions)
ui.hbox(style=style.file_picker_entry_box[index])
if not config.disable_thumbnails:
ui.null(width=config.thumbnail_width,
height=config.thumbnail_height)
ui.text(name + ". ", style=style.file_picker_old[index])
ui.text(_(u"Empty Slot."), style=style.file_picker_empty_slot[index])
ui.close()
_scratch.file_picker_page = None
# The names of the various pages that the file picker knows
# about.
def _file_picker_pages():
rv = [ ]
if config.has_autosave:
rv.append("Auto")
if config.has_quicksave:
rv.append("Quick")
for i in range(1, config.file_quick_access_pages + 1):
rv.append(str(i))
return rv
# This function is given a page, and should map it to the names
# of the files on that page.
def _file_picker_page_files(page):
per_page = config.file_page_cols * config.file_page_rows
rv = [ ]
if config.has_autosave:
if page == 0:
for i in range(1, per_page + 1):
rv.append(("auto-" + str(i), "a" + str(i), True))
return rv
else:
page -= 1
if config.has_quicksave:
if page == 0:
for i in range(1, per_page + 1):
rv.append(("quick-" + str(i), "q" + str(i), True))
return rv
else:
page -= 1
for i in range(per_page * page + 1, per_page * page + 1 + per_page):
rv.append(("%d" % i, "%d" % i, False))
return rv
# Given a filename, returns the page that filename is on.
def _file_picker_file_page(filename):
per_page = config.file_page_cols * config.file_page_rows
base = 0
if config.has_autosave:
if filename.startswith("auto-"):
return base
else:
base += 1
if config.has_quicksave:
if filename.startswith("quick-"):
return base
else:
base += 1
return base + int((int(filename) - 1) / per_page)
def _file_picker_process_screenshot(s):
return s
# This displays a file picker that can chose a save file from
# the list of save files.
def _file_picker(selected, save):
# The number of slots in a page.
file_page_length = config.file_page_cols * config.file_page_rows
saved_games = renpy.list_saved_games(regexp=r'(auto-|quick-)?[0-9]+')
newest = None
newest_mtime = None
save_info = { }
for fn, extra_info, screenshot, mtime in saved_games:
screenshot = _file_picker_process_screenshot(screenshot)
save_info[fn] = (extra_info, screenshot, mtime)
if not fn.startswith("auto-") and mtime > newest_mtime:
newest = fn
newest_mtime = mtime
if config.file_picker_positions:
positions = config.file_picker_positions
else:
positions = { }
# The index of the first entry in the page.
fpp = _scratch.file_picker_page
if fpp is None:
if newest:
fpp = _file_picker_file_page(newest)
else:
fpp = _file_picker_file_page("1")
while True:
if fpp < 0:
fpp = 0
_scratch.file_picker_page = fpp
# Show navigation
_game_nav(selected)
if not config.file_picker_positions:
ui.window(style='file_picker_frame')
ui.vbox(style='file_picker_frame_vbox') # whole thing.
if not config.disable_file_pager:
### file_picker_navbox thick_hbox
# (box) The box containing the naviation (next/previous)
# buttons in the file picker.
### file_picker_nav_button menu_button
# (window, hover) The style that is used for enabled file
# picker navigation buttons.
### file_picker_nav_button_text menu_button_text
# (text) The style that is used for the label of enabled
# file picker navigation buttons.
# Draw the navigation.
if not config.file_picker_positions:
ui.hbox(style='file_picker_navbox') # nav buttons.
def tb(cond, label, clicked, selected):
_button_factory(label,
"file_picker_nav",
disabled=not cond,
clicked=clicked,
selected=selected,
properties=positions.get("nav_" + label, { }))
# Previous
tb(fpp > 0, _(u'Previous'), ui.returns(("fppdelta", -1)), selected=False)
# Quick Access
for i, name in enumerate(_file_picker_pages()):
tb(True, name, ui.returns(("fppset", i)), fpp == i)
# Next
tb(True, _(u'Next'), ui.returns(("fppdelta", +1)), False)
# Done with nav buttons.
if not config.file_picker_positions:
ui.close()
# This draws a single slot.
def entry(name, filename, offset, ro):
place = positions.get("entry_" + str(offset + 1), { })
if filename not in save_info:
clickable = save and not ro
_render_new_slot(offset, name, filename, clickable, **place)
else:
clickable = not save or not ro
extra_info, screenshot, mtime = save_info[filename]
_render_savefile(offset, name, filename, extra_info, screenshot,
mtime, newest == filename, clickable, **place)
if not config.file_picker_positions:
ui.grid(config.file_page_cols,
config.file_page_rows,
style='file_picker_grid',
transpose=True) # slots
for i, (filename, name, ro) in enumerate(_file_picker_page_files(fpp)):
entry(name, filename, i, ro)
if not config.file_picker_positions:
ui.close() # slots
ui.close() # whole thing
result = _game_interact()
type, value = result
if type == "return":
return value
if type == "fppdelta":
fpp += value
if type == "fppset":
fpp = value
# This renders a yes/no prompt, as part of the game menu. If
# screen is None, then it omits the game menu navigation.
def _yesno_prompt(screen, message):
"""
@param screen: The screen button that should be highlighted when this prompt is shown. If None, then no game menu navigation is shown.
@param message: The message that is shown to the user to prompt them to answer yes or no.
This function returns True if the user clicks Yes, or False if the user clicks No.
"""
renpy.transition(config.intra_transition)
_game_nav(screen)
ui.window(style='yesno_frame')
ui.vbox(style='yesno_frame_vbox')
_label_factory(message, "yesno")
ui.hbox(style='yesno_button_hbox')
# The extra nulls are because we want equal whitespace surrounding
# the two buttons. It should work as long as we have xfill=True
_button_factory(u"Yes", 'yesno', clicked=ui.returns(True))
_button_factory(u"No", 'yesno', clicked=ui.returns(False))
ui.close()
ui.close()
rv = _game_interact()
renpy.transition(config.intra_transition)
return rv
config.old_names["Are you sure you want to quit?"] = "Are you sure you want to quit the game?"
def _quit_prompt(screen="quit"):
def prompt():
return _yesno_prompt(screen, u"Are you sure you want to quit?")
if renpy.invoke_in_new_context(prompt):
renpy.quit()
else:
return
config.old_names["Are you sure you want to return to the main menu?\nThis will lose unsaved progress."] = "Are you sure you want to return to the main menu?\nThis will end your game."
def _mainmenu_prompt(screen="mainmenu"):
def prompt():
return _yesno_prompt(screen, u"Are you sure you want to return to the main menu?\nThis will lose unsaved progress.")
if renpy.invoke_in_new_context(prompt):
renpy.full_restart(transition=config.game_main_transition)
else:
return
label _compat_confirm_quit:
$ _quit_prompt(None)
return
init -1160:
$ config.old_names["Loading will lose unsaved progress.\nAre you sure you want to do this?"] = "Loading a new game will end your current game.\nAre you sure you want to do this?"
label _load_screen:
if renpy.has_label("_load_screen_hook"):
call expression "_load_screen_hook" from _call__load_screen_hook
python hide:
fn, exists = _file_picker("load", False )
if not renpy.context()._main_menu and _load_prompt:
if _yesno_prompt("load", u"Loading will lose unsaved progress.\nAre you sure you want to do this?"):
renpy.load(fn)
else:
renpy.load(fn)
jump _load_screen
label _save_screen:
if renpy.has_label("_save_screen_hook"):
call expression "_save_screen_hook" from _call__save_screen_hook
$ _fn, _exists = _file_picker("save", True)
if not _exists or _yesno_prompt("save", u"Are you sure you want to overwrite your save?"):
python hide:
if save_name:
full_save_name = save_name
else:
full_save_name = ""
try:
renpy.save(_fn, full_save_name)
except Exception, e:
if config.debug:
raise
message = ( _(u"The error message was:") + "\n\n" +
e.__class__.__name__ + ": " + unicode(e) + "\n\n" +
_(u"You may want to try saving in a different slot, or playing for a while and trying again later.") )
_show_exception(_(u"Save Failed."), message)
jump _save_screen
+112
View File
@@ -0,0 +1,112 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init:
python:
# A dict of 5-tuples mapping button labels to image buttons.
config.image_buttons = { }
# A dict mapping label to image.
config.image_labels = { }
# Maps from button or label to additional properties.
config.button_properties = { }
config.button_text_properties = { }
config.label_properties = { }
def _button_factory(label,
type=None,
selected=None,
disabled=False,
clicked=None,
properties={},
index=None,
**props):
"""
This function is called to create the various buttons used
in the game menu. By overriding this function, one can
(for example) replace the default textbuttons with image buttons.
When it is called, it's expected to add a button to the screen.
@param label: The label of this button, before translation.
@param type: The type of the button. One of "mm" (main menu),
"gm_nav" (game menu), "file_picker_nav", "yesno", or "prefs".
@param selected: True if the button is selected, False if not,
or None if it doesn't matter.
@param disabled: True if the button is disabled, False if not.
@param clicked: A function that should be executed when the
button is clicked.
@param properties: Addtional layout properties.
"""
props.update(properties)
props.update(config.button_properties.get(label, { }))
if disabled:
clicked = None
if selected and not disabled:
role = "selected_"
else:
role = ""
if label in config.image_buttons:
(idle, hover, sel_idle, sel_hover, disabled) = config.image_buttons[label]
ui.imagebutton(idle,
hover,
disabled,
hover,
sel_idle,
sel_hover,
disabled,
sel_hover,
clicked=clicked,
style=style.image_button[label],
role=role,
**props)
return
button_style = type + "_button"
text_style = type + "_button_text"
if index is None:
index = label
button_style = getattr(style, button_style)[index]
text_style = getattr(style, text_style)[index]
ui.button(style=button_style, clicked=clicked, role=role, **props)
ui.text(_(label), style=text_style, **config.button_text_properties.get(label, { }))
def _label_factory(label, type, properties={}, **props):
"""
This function is called to create a new label. It can be
overridden by the user to change how these labels are created.
@param label: The label of the box.
@param type: "prefs" or "yesno". (perhaps more by now.)
@param properties: This may contain position properties.
"""
props.update(properties)
props.update(config.label_properties.get(label, { }))
if label in config.image_labels:
ui.image(config.image_labels[label], **props)
return
style = getattr(store.style, type + "_label")[label]
ui.text(_(label), style=style, **props)
+62
View File
@@ -0,0 +1,62 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init -1170 python hide:
config.old_names['Quit'] = 'Quit Game'
# The contents of the main menu.
config.main_menu = [
( u"Start Game", "start", 'True'),
( u"Continue Game", _intra_jumps("_load_screen", "main_game_transition"), 'True' ),
( u"Preferences", _intra_jumps("_prefs_screen", "main_game_transition"), 'True' ),
( u"Quit", ui.jumps("_quit"), 'True' ),
]
# If not None, this is used to fix the positions of the
# things in the main menu.
config.main_menu_positions = None
# Styles used in this file.
# This is the default main menu, which we get if the user hasn't
# defined his own, or if that function calls this explicitly.
label _library_main_menu:
python hide:
ui.add(renpy.Keymap(toggle_fullscreen = renpy.toggle_fullscreen))
ui.window(style='mm_root')
ui.null()
if not config.main_menu_positions:
ui.window(style='mm_menu_frame')
ui.vbox(style='mm_menu_frame_vbox')
for i, (text, clicked, enabled) in enumerate(config.main_menu):
if isinstance(clicked, basestring):
clicked = ui.jumpsoutofcontext(clicked)
if config.main_menu_positions:
kwargs = config.main_menu_positions.get(text, { })
else:
kwargs = { }
if not eval(enabled):
clicked = None
disabled = True
else:
disabled = False
_button_factory(text, "mm", clicked=clicked, disabled=disabled, properties=kwargs)
if not config.main_menu_positions:
ui.close()
store._result = ui.interact(suppress_overlay=True,
suppress_underlay=True,
mouse="mainmenu")
jump _main_menu
+607
View File
@@ -0,0 +1,607 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# Copyright 2004-2012 Tom Rothamel
#
# Please see the LICENSE.txt distributed with Ren'Py for permission to
# copy and modify.
# This file contains the code to implement the Ren'Py preferences
# screen.
init python:
# This is a map from the name of the style that is applied to
# a list of preferences that should be placed into a vbox
# with that style.
config.preferences = { }
# Ditto, for joystick preferences.
config.joystick_preferences = { }
# Positions for preferences... overrides the above.
config.preference_positions = None
config.joystick_preference_positions = None
# This is a map from preference name to that preference
# object, that can be used in rearranging preferences.
config.all_preferences = { }
# If true, the preference choices will be arranged in an
# hbox.
config.hbox_pref_choices = False
# A list of (readable name, synthetic key) tuples
# corresponding to joystick events.
config.joystick_keys = [
(u'Left', 'joy_left'),
(u'Right', 'joy_right'),
(u'Up', 'joy_up'),
(u'Down', 'joy_down'),
(u'Select/Dismiss', 'joy_dismiss'),
(u'Rollback', 'joy_rollback'),
(u'Hold to Skip', 'joy_holdskip'),
(u'Toggle Skip', 'joy_toggleskip'),
(u'Hide Text', 'joy_hide'),
(u'Menu', 'joy_menu'),
]
# If True, then we can always get into the joystick
# preferences.
config.always_has_joystick = False
def _prefs_screen_run(prefs_map, positions):
_game_nav("prefs")
if positions is not None:
for name, pos in positions.iteritems():
ui.vbox(**pos)
config.all_preferences[name].render_preference()
ui.close()
else:
### prefs_frame default
# (window) A window containing all preferences.
ui.window(style='prefs_frame')
ui.fixed()
for style, prefs in prefs_map.iteritems():
ui.vbox(style=style)
for i in prefs:
i.render_preference()
ui.close()
ui.close()
_game_interact()
class _Preference(object):
"""
This is a class that's used to represent a multiple-choice
preference.
"""
def __init__(self, name, field, values, base=_preferences):
"""
@param name: The name of this preference. It will be
displayed to the user.
@param variable: The field on the base object
that will be assigned the selected value. This field
must exist.
@param values: A list of value name, value, condition
triples. The value name is the name of this value that
will be shown to the user. The value is the literal
python value that will be assigned if this value is
selected. The condition is a condition that will be
evaluated to determine if this is a legal value. If no
conditions are true, this preference will not be
displayed to the user. A condition of None is always
considered to be True.
@param base: The base object on which the variable is
read from and set. This defaults to _preferences,
the user preferences object.
"""
self.name = name
self.field = field
self.values = values
self.base = base
config.all_preferences[name] = self
def render_preference(self):
values = [ (name, val) for name, val, cond in self.values
if cond is None or renpy.eval(cond) ]
if not values:
return
ui.window(style=style.prefs_pref_frame[self.name])
ui.vbox(style=style.prefs_pref_vbox[self.name])
_label_factory(self.name, "prefs")
cur = getattr(self.base, self.field)
### prefs_hbox default
# If config.hbox_pref_choices is True, the style
# of the hbox containing the choices.
if config.hbox_pref_choices:
ui.hbox(style=style.prefs_hbox[self.name])
for name, value in values:
### prefs_button menu_button
# (window, hover) The style of an unselected preferences
# button.
### prefs_button_text menu_button_text
# (text, hover) The style of the text of an unselected
# preferences button.
def clicked(value=value):
setattr(self.base, self.field, value)
return True
_button_factory(name, "prefs",
selected=cur==value,
clicked=clicked)
if config.hbox_pref_choices:
ui.close()
ui.close()
class _VolumePreference(object):
"""
This represents a preference that controls one of the
volumes in the system. It is represented as a slider bar,
and a button that can be pushed to play a sample sound on
a channel.
"""
def __init__(self, name, mixer, enable='True', sound='None', channel=0):
"""
@param name: The name of this preference, as shown to the user.
@param mixer: The mixer this preference controls.
@param enable: A string giving a python expression. If
the expression is evaluates to false, this preference
is not shown.
@param sound: A string that is evaluated to yield
another string. The yielded string is expected to give
a sound file, which is played as the sample sound. (We
apologize for the convolution of this.)
@param channel: The number of the channel the sample
sound is played on.
"""
self.name = name
self.mixer = mixer
self.enable = enable
self.sound = sound
self.channel = channel
config.all_preferences[name] = self
def render_preference(self):
if not eval(self.enable):
return
sound = eval(self.sound)
ui.window(style=style.prefs_pref_frame[self.name])
ui.vbox(style=style.prefs_pref_vbox[self.name])
_label_factory(self.name, "prefs")
def changed(v):
_preferences.set_volume(self.mixer, v / 128.0)
ui.bar(128,
int(_preferences.get_volume(self.mixer) * 128),
changed=changed,
style=style.prefs_volume_slider[self.name])
if sound:
def clicked():
renpy.sound.play(sound, channel=self.channel)
_button_factory(u"Test", "soundtest", clicked=clicked, index=self.name)
ui.close()
class _SliderPreference(object):
"""
A class that represents a preference that is controlled by a
slider.
"""
def __init__(self, name, range, get, set, enable='True'):
"""
@param set: The name of this preference, that is shown to the user.
@param range: An integer giving the maximum value of
this slider. The slider goes from 0 to range.
@param get: A function that's called to get the
initial value of the slider. It's called with no
arguments, and should return an integet between 0 and
range, inclusive.
@param set: A function that's called when the value of
the slider is set by the user. It is called with a
single integer, in the range 0 to range, inclusive.
@param enable: A string giving a python expression. If
the expression is evaluates to false, this preference
is not shown.
"""
self.name = name
self.range = range
self.get = get
self.set = set
self.enable = enable
config.all_preferences[name] = self
def render_preference(self):
if not eval(self.enable):
return
ui.window(style=style.prefs_pref_frame[self.name])
ui.vbox(style=style.prefs_pref_vbox[self.name])
_label_factory(self.name, "prefs")
def changed(v):
self.set(v)
### prefs_slider bar
# (bar) The style that is applied to preference
# sliders.
ui.bar(self.range,
self.get(),
changed=changed,
style=style.prefs_slider[self.name])
ui.close()
class _PreferenceSpinner(object):
"""
This is a class that's used to represent a preference
spinner, which is a preference that can be incremented
and decremented, when shown to the user.
"""
def __init__(self, name, field, minimum, maximum, delta,
cond = "True", render = lambda x : str(x),
base=_preferences):
"""
@param name: The name of this preference, that is presented
to the user.
@param field: The name of the field on the base object
that is updated by this spinner.
@param minimum: The minimum value that this spinner can set
the value to.
@param maximum: The maximum value that this spinner can set
the value to.
@param delta: The delta by which this spinner is
incremented or decremented.
@param cond: If this condition is not true, this spinner is
not shown.
@param render: This function is called with the value of
the field, and is expected to render that value to a
string.
@param base: The base object that this spinner updates
the field on. It defaults to _preferences, the preferences
object.
"""
self.name = name
self.field = field
self.minimum = minimum
self.maximum = maximum
self.delta = delta
self.cond = cond
self.render = render
self.base = base
config.all_preferences[name] = self
def render_preference(self):
if not renpy.eval(self.cond):
return
ui.window(style=style.prefs_pref_frame[self.name])
ui.vbox(style=style.prefs_pref_vbox[self.name])
_label_factory(self.name, "prefs")
cur = getattr(self.base, self.field)
def minus_clicked():
value = cur - self.delta
value = max(self.minimum, value)
setattr(self.base, self.field, value)
return True
def plus_clicked():
value = cur + self.delta
value = min(self.maximum, value)
setattr(self.base, self.field, value)
return True
ui.hbox(style=style.prefs_spinner[self.name])
_button_factory("-", "prefs_spinner", clicked=minus_clicked)
_label_factory(self.render(cur), "prefs_spinner")
_button_factory("+", "prefs_spinner", clicked=plus_clicked)
ui.close()
ui.close()
def _joystick_select_binding():
for label, key in config.joystick_keys:
def my_clicked(label=label, key=key):
return (label, key)
_button_factory(_(label) + " - " + _(_preferences.joymap.get(key, u"Not Assigned")), "prefs_js", clicked=my_clicked, index=label)
def _joystick_get_binding():
ui.add(renpy.display.joystick.JoyBehavior())
ui.saybehavior()
def _joystick_take_binding(binding, key):
if not isinstance(binding, basestring):
if key in _preferences.joymap:
del _preferences.joymap[key]
else:
_preferences.joymap[key] = binding
class _JoystickPreference(object):
def __init__(self, name):
self.name = name
config.all_preferences[name] = self
def render_preference(self):
def set_binding(label, key):
_game_nav(None)
ui.window(style='js_frame')
ui.vbox(style='js_frame_vbox')
_label_factory(_(u"Joystick Mapping") + " - " + _(label), "js_function")
_label_factory(u'Move the joystick or press a joystick button to create the mapping. Click the mouse to remove the mapping.', 'js_prompt')
ui.close()
_joystick_get_binding()
binding = _game_interact()
_joystick_take_binding(binding, key)
return True
ui.window(style='prefs_js_frame')
ui.vbox(style='prefs_js_vbox')
_label_factory(self.name, 'prefs')
for label, key in config.joystick_keys:
def clicked(label=label, key=key):
return renpy.invoke_in_new_context(set_binding, label, key)
_button_factory(_(label) + " - " + _(_preferences.joymap.get(key, u"Not Assigned")), "prefs_js", clicked=clicked, index=label)
ui.close()
class _JumpPreference(object):
def __init__(self, name, target, condition="True"):
self.name = name
self.target = target
self.condition = condition
config.all_preferences[name] = self
def render_preference(self):
ui.window(style=style.prefs_jump[self.name])
if eval(self.condition):
clicked=ui.jumps(self.target)
else:
clicked=None
_button_factory(self.name, 'prefs_jump', clicked=clicked)
def _remove_preference(name):
"""
Removes the preference with the given name from the
preferences menu.
"""
pref = config.all_preferences.get(name, None)
if not pref:
return
for k, v in config.preferences.iteritems():
if pref in v:
v.remove(pref)
init python hide:
# Enablers for some preferences.
config.has_music = True
config.has_sound = True
config.sample_sound = None
config.has_transitions = True
config.has_cps = True
config.has_afm = True
config.has_skipping = True
config.has_skip_after_choice = True
# Left
pl1 = _Preference(u'Display', 'fullscreen', [
(u'Window', False, None),
(u'Fullscreen', True, None),
])
pl2 = _Preference(u'Transitions', 'transitions', [
(u'All', 2, 'config.has_transitions'),
(u'Some', 1, 'config.has_transitions and default_transition'),
(u'None', 0, 'config.has_transitions'),
])
# Center
pc1 = _Preference(u'Skip', 'skip_unseen', [
(u'Seen Messages', False, 'config.allow_skipping and config.has_skipping'),
(u'All Messages', True, 'config.allow_skipping and config.has_skipping'),
])
config.old_names['Skip'] = 'TAB and CTRL Skip'
config.all_preferences['TAB and CTRL Skip'] = pc1
pc2= _Preference(u'After Choices', 'skip_after_choices', [
(u'Stop Skipping', False, 'config.allow_skipping and config.has_skip_after_choice'),
(u'Keep Skipping', True, 'config.allow_skipping and config.has_skip_after_choice'),
])
config.old_names['Keep Skipping'] = 'Continue Skipping'
def cps_get():
cps = _preferences.text_cps
if cps == 0:
cps = 150
else:
cps -= 1
return cps
def cps_set(cps):
cps += 1
if cps == 151:
cps = 0
_preferences.text_cps = cps
pc3 = _SliderPreference(u'Text Speed', 150, cps_get, cps_set,
'config.has_cps')
def afm_get():
afm = _preferences.afm_time
if afm == 0:
afm = 40
else:
afm -= 1
return afm
def afm_set(afm):
afm += 1
if afm == 41:
afm = 0
_preferences.afm_time = afm
pc4 = _SliderPreference(u'Auto-Forward Time', 40, afm_get, afm_set,
'config.has_afm')
# Right
pr1 = _VolumePreference(u"Music Volume", 'music', 'config.has_music')
pr2 = _VolumePreference(u"Sound Volume", 'sfx', 'config.has_sound', 'config.sample_sound')
_JumpPreference(u'Joystick...', '_joystick_screen', 'renpy.display.joystick.enabled or config.always_has_joystick')
_JoystickPreference(u'Joystick Configuration')
config.preferences['prefs_left'] = [
config.all_preferences[u'Display'],
config.all_preferences[u'Transitions'],
config.all_preferences[u'Joystick...'],
]
config.preferences['prefs_center'] = [
config.all_preferences[u'Skip'],
config.all_preferences[u'After Choices'],
config.all_preferences[u'Text Speed'],
config.all_preferences[u'Auto-Forward Time'],
]
config.preferences['prefs_right'] = [
config.all_preferences[u'Music Volume'],
config.all_preferences[u'Sound Volume'],
]
config.joystick_preferences['prefs_joystick'] = [
config.all_preferences[u'Joystick Configuration'],
]
config.sample_voice = None
vp = _VolumePreference(u'Voice Volume',
'voice',
'config.has_voice',
'config.sample_voice',
2)
config.preferences['prefs_right'].insert(1, vp)
label _prefs_screen:
$ _prefs_screen_run(config.preferences, config.preference_positions)
jump _prefs_screen
label _joystick_screen:
$ _prefs_screen_run(config.joystick_preferences, config.joystick_preference_positions)
jump _joystick_screen
+357
View File
@@ -0,0 +1,357 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python hide:
style.menu_button = Style(style.button, heavy=True, help='Buttons that are part of the main or game menus.')
style.menu_button_text = Style(style.button_text, heavy=True, help='The label of buttons that are part of the main or game menus.')
style.thin_hbox = Style(style.hbox, heavy=True, help='A hbox with a small amount of spacing.')
style.thick_hbox = Style(style.hbox, heavy=True, help='A hbox with a large amount of spacing.')
style.thin_vbox = Style(style.vbox, heavy=True, help='A vbox with a small amount of spacing.')
style.thick_vbox = Style(style.vbox, heavy=True, help='A vbox with a large amount of spacing.')
style.mm_menu_frame = Style(style.default, heavy=True, help='The frame containing the main menu.')
style.mm_menu_frame_vbox = Style(style.thin_vbox, heavy=True, help='The vbox containing the main menu.')
style.mm_button = Style(style.menu_button, heavy=True, help='A main menu button.')
style.mm_button_text = Style(style.menu_button_text, heavy=True, help='A main menu button label.')
style.default.drop_shadow = (1, 1)
style.gm_nav_frame = Style(style.default, heavy=True, help='The frame containing the navigation buttons.')
style.gm_nav_vbox = Style(style.thin_vbox, heavy=True, help='The vbox containing the navigation buttons.')
style.gm_nav_button = Style(style.menu_button, heavy=True, help='A navigation button.')
style.gm_nav_button_text = Style(style.menu_button_text, heavy=True, help='A navigation button label.')
style.file_picker_entry = Style(style.menu_button, heavy=True, help='A button you click to save or load a file.')
style.file_picker_entry_box = Style(style.thin_hbox, heavy=True, help='The box inside that button.')
style.file_picker_text = Style(style.default, heavy=True, help='Base style for text inside a file picker entry.')
style.file_picker_new = Style(style.file_picker_text, heavy=True, help='The number of the newest file.')
style.file_picker_old = Style(style.file_picker_text, heavy=True, help='The number of non-newest files.')
style.file_picker_extra_info = Style(style.file_picker_text, heavy=True, help='Extra text (the date and save info) of a file.')
style.file_picker_empty_slot = Style(style.file_picker_text, heavy=True, help='The style of "Empty Slot" text.')
style.file_picker_frame = Style(style.default, heavy=True, help='The frame containing the file picker.')
style.file_picker_frame_vbox = Style(style.thin_vbox, heavy=True, help='The box containing file picker navigation and the file picker grid.')
style.file_picker_navbox = Style(style.thick_hbox, heavy=True, help='The box containing the file picker navigation buttons.')
style.file_picker_nav_button = Style(style.menu_button, heavy=True, help='A file picker navigation button.')
style.file_picker_nav_button_text = Style(style.menu_button_text, heavy=True, help='A file picker navigation button label.')
style.file_picker_grid = Style(style.default, heavy=True, help='The grid containing the entries in the file picker.')
style.yesno_frame = Style(style.default, heavy=True, help='The frame containing the yes/no dialog.')
style.yesno_frame_vbox = Style(style.thick_vbox, heavy=True, help='Separates the label from the buttons in a yes/no dialog.')
style.yesno_label = Style(style.default, heavy=True, help='The label of a yes/no dialog.')
style.yesno_button_hbox = Style(style.thick_hbox, heavy=True, help="The box containing the Yes and No buttons.")
style.yesno_button = Style(style.menu_button, heavy=True, help='A Yes/No button.')
style.yesno_button_text = Style(style.menu_button_text, heavy=True, help='A Yes/No button label.')
style.prefs_frame = Style(style.default, heavy=True, help='')
style.prefs_pref_frame = Style(style.default, heavy=True, help='')
style.prefs_pref_vbox = Style(style.thin_vbox, heavy=True, help='')
style.prefs_label = Style(style.default, heavy=True, help='')
style.prefs_hbox = Style(style.default, heavy=True, help='')
style.prefs_button = Style(style.menu_button, heavy=True, help='')
style.prefs_button_text = Style(style.menu_button_text, heavy=True, help='')
style.soundtest_button = Style(style.prefs_button, heavy=True, help='')
style.soundtest_button_text = Style(style.prefs_button_text, heavy=True, help='')
style.prefs_slider = Style(style.bar, heavy=True, help='')
style.prefs_volume_slider = Style(style.prefs_slider, heavy=True, help='')
style.prefs_spinner = Style(style.default, heavy=True, help='')
style.prefs_spinner_label = Style(style.prefs_label, heavy=True, help='')
style.prefs_spinner_button = Style(style.prefs_button, heavy=True, help='')
style.prefs_spinner_button_text = Style(style.prefs_button_text, heavy=True, help='')
style.prefs_js_frame = Style(style.prefs_pref_frame, heavy=True, help='')
style.prefs_js_vbox = Style(style.prefs_pref_vbox, heavy=True, help='')
style.prefs_js_button = Style(style.prefs_button, heavy=True, help='')
style.prefs_js_button_text = Style(style.prefs_button_text, heavy=True, help='')
style.js_frame = Style(style.prefs_frame, heavy=True, help='')
style.js_frame_vbox = Style(style.thick_vbox, heavy=True, help='')
style.js_function_label = Style(style.prefs_label, heavy=True, help='')
style.js_prompt_label = Style(style.prefs_label, heavy=True, help='')
style.prefs_jump = Style(style.prefs_pref_frame, heavy=True, help='')
style.prefs_jump_button = Style(style.prefs_button, heavy=True, help='')
style.prefs_jump_button_text = Style(style.prefs_button_text, heavy=True, help='')
style.prefs_column = Style(style.default, heavy=True, help='')
style.prefs_left = Style(style.prefs_column, heavy=True, help='')
style.prefs_center = Style(style.prefs_column, heavy=True, help='')
style.prefs_right = Style(style.prefs_column, heavy=True, help='')
style.prefs_joystick = Style(style.prefs_center, heavy=True, help='')
style.thin_hbox.spacing = 3
style.thick_hbox.spacing = 30
style.thin_vbox.spacing = 0
style.thick_vbox.spacing = 30
dark_cyan = (0, 192, 255, 255)
bright_cyan = (0, 255, 255, 255)
dark_red = (255, 128, 128, 255)
bright_red = (255, 64, 64, 255)
green = (0, 128, 0, 255)
# Frames.
style.frame.background = Solid((0, 0, 128, 128))
style.frame.xpadding = 10
style.frame.ypadding = 5
style.frame.xmargin = 10
style.frame.ymargin = 5
######################################################################
# Buttons.
style.button_text.color = dark_cyan
style.button_text.hover_color = bright_cyan
style.button_text.insensitive_color = (192, 192, 192, 255)
style.button_text.size = 24
style.button_text.drop_shadow = (2, 2)
style.button_text.selected_color = dark_red
style.button_text.selected_hover_color = bright_red
style.button_text.xpos = 0.5
style.button_text.xanchor = 0.5
style.menu_button.xpos = 0.5
style.menu_button.xanchor = 0.5
######################################################################
# Bar.
style.bar.ymaximum = 22
style.bar.left_bar = Solid(bright_cyan)
style.bar.right_bar = Solid((0, 0, 0, 128))
style.bar.bottom_bar = Solid(bright_cyan)
style.bar.top_bar = Solid((0, 0, 0, 128))
style.bar.left_gutter = 0
style.bar.right_gutter = 0
style.bar.thumb = None
style.bar.thumb_offset = 0
style.bar.thumb_shadow = None
style.vbar.xmaximum = 22
style.vbar.left_bar = Solid(bright_cyan)
style.vbar.right_bar = Solid((0, 0, 0, 128))
style.vbar.bottom_bar = Solid(bright_cyan)
style.vbar.top_bar = Solid((0, 0, 0, 128))
style.vbar.left_gutter = 0
style.vbar.right_gutter = 0
style.vbar.bottom_gutter = 0
style.vbar.top_gutter = 0
style.vbar.thumb = None
style.vbar.thumb_offset = 0
style.vbar.thumb_shadow = None
style.vscrollbar.set_parent(style.vbar)
style.scrollbar.set_parent(style.bar)
style.vscrollbar.bottom_bar = Solid((0, 0, 0, 128))
style.vscrollbar.top_bar = Solid(bright_cyan)
style.slider.ymaximum = 1
style.vslider.xmaximum = 1
######################################################################
# Main menu.
style.mm_menu_frame.xpos = 0.9
style.mm_menu_frame.xanchor = 1.0
style.mm_menu_frame.ypos = 0.9
style.mm_menu_frame.yanchor = 1.0
######################################################################
# Game menu common.
style.gm_nav_frame.xpos = 0.95
style.gm_nav_frame.xanchor = 1.0
style.gm_nav_frame.ypos = 0.95
style.gm_nav_frame.yanchor = 1.0
##############################################################################
# File picker.
style.file_picker_frame.xpos = 0
style.file_picker_frame.xanchor = 0.0
style.file_picker_frame.ypos = 0
style.file_picker_frame.yanchor = 0.0
style.file_picker_frame.xpadding = 5
style.file_picker_navbox.xpos = 10
style.file_picker_grid.xfill = True
style.file_picker_entry.xpadding = 5
style.file_picker_entry.ypadding = 2
style.file_picker_entry.xmargin = 5
style.file_picker_entry.xfill = True
style.file_picker_entry.ymargin = 2
style.file_picker_entry.background = Solid((255, 255, 255, 255))
style.file_picker_entry.hover_background = Solid((255, 255, 192, 255))
style.file_picker_text.size = 16
style.file_picker_text.color = dark_cyan
style.file_picker_text.hover_color = bright_cyan
style.file_picker_new.hover_color = bright_red
style.file_picker_new.idle_color = dark_red
style.file_picker_new.minwidth = 40
style.file_picker_old.minwidth = 40
style.file_picker_new.text_align = 1.0
style.file_picker_old.text_align = 1.0
######################################################################
# Yes/No Dialog
style.yesno_label.color = green
style.yesno_label.textalign = 0.5
style.yesno_label.xpos = 0.5
style.yesno_label.xanchor = 0.5
style.yesno_frame.xfill = True
style.yesno_frame.yminimum = 0.5
style.yesno_frame.xmargin = .1
style.yesno_frame_vbox.xpos = 0.5
style.yesno_frame_vbox.xanchor = 0.5
style.yesno_frame_vbox.ypos = 0.5
style.yesno_frame_vbox.yanchor = 0.5
style.yesno_button_hbox.xalign = 0.5
style.yesno_button_hbox.spacing = 100
##############################################################################
# Preferences.
style.prefs_pref_frame.xpos = 0.5
style.prefs_pref_frame.xanchor = 0.5
style.prefs_pref_frame.bottom_margin = 10
style.prefs_label.xpos = 0.5
style.prefs_label.xanchor = 0.5
style.prefs_label.color = green
style.prefs_slider.xmaximum=200
style.prefs_slider.ymaximum=22
style.prefs_slider.xpos = 0.5
style.prefs_slider.xanchor = 0.5
style.prefs_hbox.xpos = 0.5
style.prefs_hbox.xanchor = 0.5
style.prefs_button.xpos = 0.5
style.prefs_button.xanchor = 0.5
style.prefs_button.selected_xpos = 0.5
style.prefs_button.selected_xanchor = 0.5
style.prefs_frame.xfill=True
style.prefs_frame.ypadding = 0.05
style.prefs_column.spacing = 6
style.prefs_left.xanchor = 0.5
style.prefs_left.xpos = 1.0 / 6.0
style.prefs_center.xanchor = 0.5
style.prefs_center.xpos = 3.0 / 6.0
style.prefs_right.xanchor = 0.5
style.prefs_right.xpos = 5.0 / 6.0
style.prefs_spinner.xpos = 0.5
style.prefs_spinner.xanchor = 0.5
style.prefs_spinner_label.minwidth = 100
style.prefs_spinner_label.textalign = 0.5
style.prefs_js_button_text.size = 18
style.prefs_js_button_text.drop_shadow = (1, 1)
style.js_function_label.textalign = 0.5
style.js_prompt_label.textalign = 0.5
style.js_frame.xfill = True
style.js_frame.yminimum = 0.5
style.js_frame.xmargin = .1
style.js_frame_vbox.xpos = 0.5
style.js_frame_vbox.xanchor = 0.5
style.js_frame_vbox.ypos = 0.5
style.js_frame_vbox.yanchor = 0.5
style.soundtest_button.activate_sound = None
style.window.background = Solid((0, 0, 128, 128))
style.window.xpadding = 10
style.window.ypadding = 5
style.window.xmargin = 10
style.window.ymargin = 5
style.window.xfill = True
style.window.yfill = False
style.window.xminimum = 0 # Includes margins and padding.
style.window.yminimum = 150 # Includes margins and padding.
######################################################################
# Compatibility names for renamed styles.
style.file_picker_window_vbox = style.file_picker_frame_vbox
style.prefs_window = style.prefs_frame
style.mm_root_window = style.mm_root
style.file_picker_window = style.file_picker_frame
style.prefs_pref = style.prefs_pref_frame
style.gm_root_window = style.gm_root
style.yesno_window_vbox = style.yesno_frame_vbox
style.joyprompt_label = style.js_prompt_label
style.gm_nav_window = style.gm_nav_frame
style.joy_window = style.js_frame
style.mm_menu_window = style.mm_menu_frame
style.error_window = style.error_root
style.joyfunc_label = style.js_function_label
style.joy_vbox = style.js_frame_vbox
style.yesno_window = style.yesno_frame
style.mm_menu_window_vbox = style.mm_menu_frame_vbox
style.menu_choice_button_text = style.menu_choice
style.menu_choice_chosen_button_text = style.menu_choice_chosen
store._selected_compat = [ ]
class _SelectedCompat(object):
def __init__(self, target):
self.__dict__["target"] = target
self.__dict__["property_updates"] = [ ]
store._selected_compat.append(self)
def __setattr__(self, k, v):
self.property_updates.append((k, v))
def apply(self):
target = getattr(style, self.target)
for k, v in self.property_updates:
setattr(target, "selected_" + k, v)
def clear(self):
self.__dict__["property_updates"] = [ ]
style.selected_button = _SelectedCompat('button')
style.selected_button_text = _SelectedCompat('button_text')
style.gm_nav_selected_button = _SelectedCompat('gm_nav_button')
style.gm_nav_selected_button_text = _SelectedCompat('gm_nav_button_text')
style.prefs_selected_button = _SelectedCompat('prefs_button')
style.prefs_selected_button_text = _SelectedCompat('prefs_button_text')
def apply_selected_compat():
for scs in _selected_compat:
scs.apply()
layout.compat_funcs.append(apply_selected_compat)
+503
View File
@@ -0,0 +1,503 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# Copyright 2004-2012 Tom Rothamel
#
# Please see the LICENSE.txt distributed with Ren'Py for permission to
# copy and modify.
init -1100:
python:
theme = object()
def RoundRect(color, small=False):
"""
Creates a roundrect displayable. Size should be one of
6 or 12, while color is the color of the roundrect.
"""
if small:
size = 6
else:
if config.screen_width <= 640:
size = 6
else:
size = 12
return Frame(theme.OneOrTwoColor("_roundrect/rr%dg.png" % size, color), size, size)
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)
def _button_menu():
store.menu = _display_button_menu
style.menu.clear()
style.menu.box_spacing = 2
style.menu_window.clear()
style.menu_window.take(style.default)
style.menu_window.xpos = 0.5
style.menu_window.xanchor = 0.5
style.menu_window.ypos = 0.5
style.menu_window.yanchor = 0.5
style.menu_choice.clear()
style.menu_choice.take(style.button_text)
style.menu_choice_button.clear()
style.menu_choice_button.take(style.button)
style.menu_choice_chosen.clear()
style.menu_choice_chosen_button.clear()
style.menu_choice_button.xminimum = int(config.screen_width * 0.75)
style.menu_choice_button.xmaximum = int(config.screen_width * 0.75)
theme.button_menu = _button_menu
python hide:
def OneOrTwoColor(image, color):
if len(color) == 2:
return im.Twocolor(image, color[0], color[1])
else:
return im.Twocolor(image, color, color)
theme.OneOrTwoColor = OneOrTwoColor
def theme_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),
window = (0, 0, 0, 192),
mm_root = Solid((220, 235, 255, 255)),
gm_root = Solid((220, 235, 255, 255)),
centered = False,
button_menu = True,
launcher = False,
rounded_window = True,
less_rounded = False,
):
"""This enables the use of the roundrect theme. By
default, this theme styles the game in a blue color
scheme. However, by supplying one or more of the
parameters given below, the color scheme can be
changed.
@param widget: The background color of non-focued
buttons and sliders.
@param widget_hover: The background color of focused
buttons and sliders.
@param widget_text: The text color of non-selected buttons.
@param widget_selected: The text color of selected buttons.
@param disabled: The background color of disabled buttons.
@param disabled_text: The text color of disabled buttons.
@param label: The text color of non-selected labels.
@param frame: The background color of frames.
@param mm_root: A displayable (such as
an Image or Solid) that will be used as
the background for the main menu.
@param gm_root: A displayable (such as
an Image or Solid) that will be used as
the background for the game menu.
@param centered: If True, the buttons and sliders will
be centered in the frames or windows that contain
them. If False, the default, they will be pushed to the
right side.
"""
if config.screen_width <= 640:
size = 18
small = 12
big = False
spacing = 0
pref_spacing = 5
title_spacing = 6
frame_width = 200
widget_width = 160
config.thumbnail_width = 60
config.thumbnail_height = 45
config.file_page_cols = 2
config.file_page_rows = 4
# style.file_picker_frame.xmaximum = 450
prefcols = [ 110, 320, 530 ]
nav_xpos = 530
else:
size = 22
small = 16
big = True
spacing = 0
pref_spacing = 10
title_spacing = 12
frame_width = 250
widget_width = 200
prefcols = [ 137, 400, 663 ]
nav_xpos = 663
rrslider_empty = "_roundrect/rrslider_empty.png"
rrslider_full = "_roundrect/rrslider_full.png"
rrslider_thumb = "_roundrect/rrslider_thumb.png"
rrslider_radius = 6
rrslider_height = 24
rrvslider_empty = "_roundrect/rrvslider_empty.png"
rrvslider_full = "_roundrect/rrvslider_full.png"
rrvslider_thumb = "_roundrect/rrvslider_thumb.png"
rrscrollbar = "_roundrect/rrscrollbar.png"
rrscrollbar_thumb = "_roundrect/rrscrollbar_thumb.png"
rrvscrollbar = "_roundrect/rrvscrollbar.png"
rrvscrollbar_thumb = "_roundrect/rrvscrollbar_thumb.png"
rrvslider_radius = 6
rrvslider_width = 24
def rrframe(sty):
sty.background = RoundRect(frame, less_rounded)
sty.xpadding = 6
sty.ypadding = 6
if big and not less_rounded:
store._roundrect_radius = 12
else:
store._roundrect_radius = 6
style.button.clear()
style.button.background = RoundRect(widget, less_rounded)
style.button.hover_background = RoundRect(widget_hover, less_rounded)
style.button.xminimum = widget_width
style.button.ypadding = 1
style.button.xpadding = _roundrect_radius
style.button.xmargin = 1
style.button.ymargin = 1
style.button_text.clear()
style.button_text.drop_shadow = None
style.button_text.color = widget_text
style.button_text.size = size
style.button_text.xpos = 0.5
style.button_text.xanchor = 0.5
style.button_text.ypos = 0.5
style.button_text.yanchor = 0.5
style.button_text.textalign = 0.5
style.button.insensitive_background = RoundRect(disabled, less_rounded)
style.button_text.insensitive_color = disabled_text
style.button_text.selected_color = widget_selected
style.menu_button.clear()
style.mm_root.background = mm_root
style.gm_root.background = gm_root
style.mm_menu_frame_vbox.box_spacing = spacing
rrframe(style.mm_menu_frame)
style.mm_menu_frame.xpos = nav_xpos
style.mm_menu_frame.xanchor = 0.5
style.gm_nav_vbox.box_spacing = spacing
rrframe(style.gm_nav_frame)
style.gm_nav_frame.xpos = nav_xpos
style.gm_nav_frame.xanchor = 0.5
rrframe(style.prefs_pref_frame)
del style.prefs_pref_frame.bottom_margin
style.prefs_pref_frame.xfill = True
style.prefs_pref_vbox.box_spacing = spacing
style.prefs_pref_vbox.box_first_spacing = title_spacing
style.prefs_pref_vbox.xfill = True
style.prefs_frame.ypadding = pref_spacing
rrframe(style.prefs_column)
style.prefs_column.box_spacing = pref_spacing
style.prefs_column.xmaximum = frame_width
style.prefs_left.xpos = prefcols[0]
style.prefs_center.xpos = prefcols[1]
style.prefs_right.xpos = prefcols[2]
style.prefs_label.color = label
style.prefs_label.size = size
style.prefs_label.drop_shadow = None
style.prefs_label.xpos = 0
style.prefs_label.xanchor = 0
if centered:
style.prefs_button.xpos = 0.5
style.prefs_button.xanchor = 0.5
else:
style.prefs_button.xpos = 1.0
style.prefs_button.xanchor = 1.0
style.bar.ymaximum = rrslider_height
style.bar.left_gutter = rrslider_radius
style.bar.right_gutter = rrslider_radius
style.bar.thumb_offset = -rrslider_radius
style.bar.left_bar = Frame(theme.OneOrTwoColor(rrslider_full, widget), rrslider_radius * 2, 0)
style.bar.right_bar = Frame(theme.OneOrTwoColor(rrslider_empty, widget), rrslider_radius * 2, 0)
style.bar.thumb = theme.OneOrTwoColor(rrslider_thumb, widget)
style.bar.hover_left_bar = Frame(theme.OneOrTwoColor(rrslider_full, widget_hover), rrslider_radius * 2, 0)
style.bar.hover_right_bar = Frame(theme.OneOrTwoColor(rrslider_empty, widget_hover), rrslider_radius * 2, 0)
style.bar.hover_thumb = theme.OneOrTwoColor(rrslider_thumb, widget_hover)
style.scrollbar.clear()
style.scrollbar.left_bar = Frame(theme.OneOrTwoColor(rrscrollbar, widget), 6, 0)
style.scrollbar.right_bar = Frame(theme.OneOrTwoColor(rrscrollbar, widget), 6, 0)
style.scrollbar.hover_left_bar = Frame(theme.OneOrTwoColor(rrscrollbar, widget_hover), 6, 0)
style.scrollbar.hover_right_bar = Frame(theme.OneOrTwoColor(rrscrollbar, widget_hover), 6, 0)
style.scrollbar.thumb = Frame(theme.OneOrTwoColor(rrscrollbar_thumb, widget), 6, 0)
style.scrollbar.hover_thumb = Frame(theme.OneOrTwoColor(rrscrollbar_thumb, widget_hover), 6, 0)
style.scrollbar.left_gutter = 6
style.scrollbar.right_gutter = 6
style.scrollbar.ymaximum = 12
style.scrollbar.thumb_offset = 6
style.vbar.xmaximum = rrvslider_width
style.vbar.top_gutter = rrvslider_radius
style.vbar.bottom_gutter = rrvslider_radius
style.vbar.thumb_offset = -rrvslider_radius
style.vbar.bottom_bar = Frame(theme.OneOrTwoColor(rrvslider_full, widget), 0, rrvslider_radius * 2)
style.vbar.top_bar = Frame(theme.OneOrTwoColor(rrvslider_empty, widget), 0, rrvslider_radius * 2)
style.vbar.thumb = theme.OneOrTwoColor(rrvslider_thumb, widget)
style.vbar.hover_bottom_bar = Frame(theme.OneOrTwoColor(rrvslider_full, widget_hover), 0, rrvslider_radius * 2)
style.vbar.hover_top_bar = Frame(theme.OneOrTwoColor(rrvslider_empty, widget_hover), 0, rrvslider_radius * 2)
style.vbar.hover_thumb = theme.OneOrTwoColor(rrvslider_thumb, widget_hover)
style.vscrollbar.clear()
style.vscrollbar.bar_invert = True
style.vscrollbar.top_bar = Frame(theme.OneOrTwoColor(rrvscrollbar, widget), 0, 6)
style.vscrollbar.bottom_bar = Frame(theme.OneOrTwoColor(rrvscrollbar, widget), 0, 6)
style.vscrollbar.hover_top_bar = Frame(theme.OneOrTwoColor(rrvscrollbar, widget_hover), 0, 6)
style.vscrollbar.hover_bottom_bar = Frame(theme.OneOrTwoColor(rrvscrollbar, widget_hover), 0, 6)
style.vscrollbar.thumb = Frame(theme.OneOrTwoColor(rrvscrollbar_thumb, widget), 0, 6)
style.vscrollbar.hover_thumb = Frame(theme.OneOrTwoColor(rrvscrollbar_thumb, widget_hover), 0, 6)
style.vscrollbar.top_gutter = 6
style.vscrollbar.bottom_gutter = 6
style.vscrollbar.xmaximum = 12
style.vscrollbar.thumb_offset = 6
style.prefs_slider.xmaximum=widget_width
del style.prefs_slider.ymaximum
if centered:
style.prefs_slider.xpos = 0.5
style.prefs_slider.xanchor = 0.5
else:
style.prefs_slider.xpos = 1.0
style.prefs_slider.xanchor = 1.0
style.soundtest_button.xminimum = 0
# Joystick
style.prefs_joystick.xmaximum = 600
style.prefs_joystick.xpos = 0.5
style.prefs_joystick.xanchor = 0.5
style.prefs_js_button.background = RoundRect(widget, True)
style.prefs_js_button.hover_background = RoundRect(widget_hover, True)
style.prefs_js_button_text.drop_shadow = None
style.prefs_js_button_text.size = small
style.prefs_js_button.xminimum = 450
rrframe(style.js_frame)
del style.js_frame.yminimum
style.js_frame.ypadding = .05
style.js_frame.xpadding = rrslider_radius
style.js_frame.xmargin = .05
style.js_frame.ypos = .1
style.js_frame.yanchor = 0
style.js_function_label.xpos = 0.5
style.js_function_label.xanchor = 0.5
style.js_prompt_label.xpos = 0.5
style.js_prompt_label.xanchor = 0.5
# Yes/No
rrframe(style.yesno_frame)
del style.yesno_frame.yminimum
style.yesno_frame.ypadding = .05
style.yesno_frame.xpadding = rrslider_radius
style.yesno_frame.xmargin = .05
style.yesno_frame.ypos = .1
style.yesno_frame.yanchor = 0
style.yesno_label.color = label
style.yesno_label.drop_shadow = None
# File Picker
rrframe(style.file_picker_frame)
style.file_picker_frame.xmargin = 6
style.file_picker_frame.ymargin = 6
style.file_picker_frame_vbox.box_spacing = 4
style.file_picker_nav_button.xminimum = 0
style.file_picker_navbox.box_spacing = spacing
del style.file_picker_navbox.xpos
style.file_picker_entry.background = RoundRect(widget, less_rounded)
style.file_picker_entry.hover_background = RoundRect(widget_hover, less_rounded)
style.file_picker_entry.xpadding = _roundrect_radius
style.file_picker_entry.xmargin = 2
style.file_picker_text.size = small
style.file_picker_text.drop_shadow = None
style.file_picker_text.color = widget_text
style.file_picker_new.color = widget_selected
style.file_picker_old.minwidth = 40
style.file_picker_new.minwidth = 40
style.file_picker_old.text_align = 1.0
style.file_picker_new.text_align = 1.0
if config.script_version is None or config.script_version > (6, 0, 0):
style.file_picker_text.insensitive_color = disabled_text
style.file_picker_entry.insensitive_background = RoundRect(disabled, less_rounded)
config.file_quick_access_pages = 8
# In-game.
if rounded_window:
style.window.background = RoundRect(window, less_rounded)
style.window.xpadding = 6
style.window.ypadding = 6
style.window.xmargin = 6
style.window.ymargin = 6
else:
style.window.background = Solid(window)
style.window.xpadding = 6
style.window.ypadding = 6
style.window.xmargin = 0
style.window.ymargin = 0
style.default.size = size
style.default.drop_shadow = None
rrframe(style.frame)
style.frame.xpadding = 6
style.frame.ypadding = 6
style.frame.xmargin = 6
style.frame.ymargin = 6
if button_menu:
_button_menu()
if launcher:
style.launcher_mid_vbox.xpos = 80
style.launcher_mid_vbox.ypos = 50
style.launcher_bottom_vbox.xpos = 80
style.launcher_bottom_vbox.ypos = 360
style.launcher_bottom_vbox.yanchor = 1.0
style.launcher_button.xpos = 20
style.launcher_button.xminimum = 240
style.launcher_title_label.color = label
style.launcher_title_label.size = 28
style.launcher_text.xpos = 140
style.launcher_text.xanchor = 0.5
style.launcher_text.xmaximum = 240
style.launcher_text.color = label
style.launcher_text.text_align = 0.5
style.launcher_label.xpos = 140
style.launcher_label.xanchor = 0.5
style.launcher_label.xmaximum = 240
style.launcher_label.color = label
style.launcher_label.text_align = 0.5
style.launcher_input.xpos = 140
style.launcher_input.xanchor = 0.5
style.launcher_input.xmaximum = 240
style.launcher_input.color = widget
style.launcher_input.text_align = 0.5
store._launcher_per_page = 9
theme.roundrect = theme_roundrect
def theme_roundrect_red(**params):
"""
This sets up a red/pink variant of the roundrect theme.
"""
args = dict(widget=(150, 50, 50, 255),
widget_hover=(200, 50, 50, 255),
widget_text=(255, 225, 225, 255),
frame=(225, 115, 115, 192),
mm_root=Solid((255, 225, 225, 255)),
gm_root=Solid((255, 225, 225, 255)),
)
args.update(params)
theme.roundrect(**args)
theme.roundrect_red = theme_roundrect_red
+584
View File
@@ -0,0 +1,584 @@
# This file contains code that helps support the development of Ren'Py
# games.
screen _developer:
frame:
style_group ""
align (.025, .05)
has vbox
label "Developer Menu"
textbutton _(u"Reload Game (Shift+R)"):
action ui.callsinnewcontext("_save_reload_game")
size_group "developer"
textbutton _(u"Variable Viewer"):
action Jump("_debugger_screen")
size_group "developer"
textbutton _(u"Theme Test"):
action Jump("_theme_test")
size_group "developer"
textbutton _(u"Style Hierarchy"):
action Jump("_style_hierarchy")
size_group "developer"
textbutton _(u"Image Location Picker"):
action Jump("_image_location_picker")
size_group "developer"
textbutton _(u"Filename List"):
action Jump("_filename_list")
size_group "developer"
null height 15
textbutton _(u"Return"):
action Return()
size_group "developer"
label _developer_screen:
call screen _developer
return
label _debugger_screen:
python hide:
ui.window(style=style.gm_root)
ui.null()
ui.frame(ymargin=10, xmargin=10, style=style.menu_frame)
ui.side(['t', 'c', 'r', 'b'])
layout.label("Variable Viewer", None)
entries = [ ]
ebc = store.__dict__.ever_been_changed
ebc = list(ebc)
ebc.sort()
ebc.remove("nvl_list")
import repr
aRepr = repr.Repr()
aRepr.maxstring = 40
for var in ebc:
if not hasattr(store, var):
continue
if var.startswith("__00"):
continue
if var.startswith("_") and not var.startswith("__"):
continue
val = aRepr.repr(getattr(store, var))
s = (var + " = " + val)
s = s.replace("{", "{{")
s = s.replace("[", "[[")
entries.append((0, s))
if entries:
vp = ui.viewport(mousewheel=True)
layout.list(entries)
ui.bar(adjustment=vp.yadjustment, style='vscrollbar')
else:
layout.prompt("No variables have changed since the game started.", None)
ui.null()
layout.button(u"Return to the developer menu", None, clicked=ui.returns(True))
ui.close()
ui.interact()
jump _developer_screen
label _theme_test:
python hide:
# Never gets pickled
def role(b):
if b:
return "selected_"
else:
return ""
toggle_var = True
adj = ui.adjustment(100, 25, page=25, adjustable=True)
while True:
ui.window(style=style.gm_root)
ui.null()
# Buttons
ui.hbox(box_spacing=10, xpos=10, ypos=10)
ui.vbox(box_spacing=10)
sg = "theme_test"
ui.frame(style='menu_frame')
ui.vbox()
layout.label("Button", None)
ui.textbutton("Button", size_group=sg, clicked=ui.returns("gndn"))
ui.textbutton("Button (Selected)", size_group=sg, clicked=ui.returns("gndn"), role=role(True))
ui.textbutton("Small", clicked=ui.returns("gndn"), style='small_button')
ui.close()
ui.frame(style='menu_frame')
ui.vbox()
layout.label("Radio Button", None)
ui.textbutton("True", size_group=sg, clicked=ui.returns("set"), role=role(toggle_var), style='radio_button')
ui.textbutton("False", size_group=sg, clicked=ui.returns("unset"), role=role(not toggle_var), style='radio_button')
ui.close()
ui.frame(style='menu_frame')
ui.vbox()
layout.label("Check Button", None)
ui.textbutton("Check Button", size_group=sg, clicked=ui.returns("toggle"), role=role(toggle_var), style='check_button')
ui.close()
ui.frame(style='menu_frame')
ui.vbox(box_spacing=2)
ui.bar(adjustment=adj, style='bar', xmaximum=200)
ui.bar(adjustment=adj, style='slider', xmaximum=200)
ui.bar(adjustment=adj, style='scrollbar', xmaximum=200)
ui.close()
ui.close() # vbox
ui.frame(style='menu_frame')
ui.hbox(box_spacing=2)
ui.bar(adjustment=adj, style='vbar', ymaximum=200)
ui.bar(adjustment=adj, style='vslider', ymaximum=200)
ui.bar(adjustment=adj, style='vscrollbar', ymaximum=200)
ui.close()
ui.frame(style='menu_frame', xmaximum=0.95)
ui.vbox(box_spacing=20)
layout.prompt("This is a prompt. We've made this text long enough to wrap around so it fills multiple lines.", None)
ui.close()
ui.close() # hbox
ui.frame(style='menu_frame', xalign=.01, yalign=.99)
ui.textbutton("Return to the developer menu", clicked=ui.returns("return"))
rv = ui.interact()
if rv == "return":
renpy.jump("_developer_screen")
elif rv == "set":
toggle_var = True
elif rv == "unset":
toggle_var = False
elif rv == "toggle":
toggle_var = not toggle_var
label _style_hierarchy:
python hide:
ui.window(style=style.gm_root)
ui.null()
ui.frame(ymargin=10, xmargin=10, style=style.menu_frame)
ui.side(['t', 'c', 'r', 'b'], spacing=2)
layout.label("Style Hierarchy", None)
hier = renpy.style.style_hierarchy()
entries = [ (i[0], i[1] + " - " + str(i[2])) for i in hier if i[2] ]
vp = ui.viewport(mousewheel=True)
layout.list(entries)
ui.bar(adjustment=vp.yadjustment, style='vscrollbar')
layout.button(u"Return to the developer menu", None, clicked=ui.returns(True))
ui.close()
ui.interact()
jump _developer_screen
init -1050 python:
config.missing_background = "black"
init 1050 python:
if config.developer:
# This is used to indicate that a scene has just occured,
# and so if the next thing is a missing_show, we should
# blank the screen.
__missing_scene = False
# This returns the __missing dictionary from the current
# context object.
def __missing():
try:
return renpy.context().__missing
except AttributeError:
rv = dict()
renpy.context().__missing = rv
return rv
def __missing_show_callback(name, what, layer):
if layer != 'master':
return False
global __missing_scene
if __missing_scene:
renpy.show(name, what=config.missing_background)
__missing_scene = False
what = " ".join(what).replace("{", "{{").replace("[", "[[")
__missing()[name[0]] = what
return True
def __missing_hide_callback(name, layer):
if layer != 'master':
return False
global __missing_scene
__missing_scene = False
__missing().pop(name[0], None)
return True
def __missing_scene_callback(layer):
if layer != 'master':
return False
global __missing_scene
__missing_scene = True
__missing().clear()
return True
def __missing_overlay():
missing = __missing()
if not missing:
return
ui.vbox(xalign=0.5, yalign=0.0)
ui.text(_("Undefined Images"), xalign=0.5)
for what in sorted(missing.values()):
ui.text(what, xalign=0.5)
ui.close()
config.missing_scene = __missing_scene_callback
config.missing_show = __missing_show_callback
config.missing_hide = __missing_hide_callback
config.overlay_functions.append(__missing_overlay)
init -1050 python:
class __FPSMeter(object):
def __init__(self):
self.last_frames = None
self.last_time = None
def __call__(self, st, at):
if self.last_time is not None:
frames = config.frames - self.last_frames
time = st - self.last_time
text = "FPS: %.1f" % (frames / time)
else:
text = "FPS: --.-"
self.last_frames = config.frames
self.last_time = st
return Text(text, xalign=1.0), .5
label _fps_meter:
python hide:
def fps_overlay():
ui.add(DynamicDisplayable(__FPSMeter()))
# We normally don't want to change this at runtime... but here
# it's okay, because we don't want to save the FPS meter anyway.
#
# Do as I say, not as I do.
config.overlay_functions.append(fps_overlay)
return
init python:
# This is a displayable that can keep track of the mouse coordinates,
# and show them to the user.
class __ImageLocationPicker(renpy.Displayable):
def __init__(self, fn, **kwargs):
super(__ImageLocationPicker, self).__init__(**kwargs)
self.child = Image(fn)
self.mouse = None
self.point1 = None
self.point2 = None
def render(self, width, height, st, at):
rv = renpy.Render(width, height)
cr = renpy.render(self.child, width, height, st, at)
rv.blit(cr, (0, 0))
text = [ ]
if self.point1 and self.point2 and not self.point1 == self.point2:
x1, y1 = self.point1
x2, y2 = self.point2
x1 = min(x1, cr.width)
x2 = min(x2, cr.width)
y1 = min(y1, cr.height)
y2 = min(y2, cr.height)
minx = min(x1, x2)
miny = min(y1, y2)
maxx = max(x1, x2)
maxy = max(y1, y2)
w = maxx - minx
h = maxy - miny
if w and h:
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("Rectangle: %r" % ((minx, miny, w, h),))
if self.mouse:
mx, my = self.mouse
if mx < cr.width and my < cr.height:
text.append(_("Mouse position: %r") % (self.mouse,))
text.append(_("Right-click or escape to quit."))
td = Text("\n".join(text), size=14, color="#fff", outlines=[ (1, "#000", 0, 0 ) ])
tr = renpy.render(td, width, height, st, at)
rv.blit(tr, (0, height - tr.height))
return rv
def event(self, ev, x, y, st):
import pygame
self.mouse = (x, y)
renpy.redraw(self, 0)
if ev.type == pygame.MOUSEBUTTONDOWN and ev.button == 1:
self.point1 = (x, y)
self.point2 = (x, y)
elif ev.type == pygame.MOUSEMOTION and ev.buttons[0]:
self.point2 = (x, y)
elif ev.type == pygame.MOUSEBUTTONUP and ev.button == 1:
self.point2 = (x, y)
label _image_location_picker:
scene black
python hide:
image_files = [
fn
for dir, fn in renpy.loader.listdirfiles()
if fn.lower().endswith(".jpg") or fn.lower().endswith(".png")
if not fn[0] == "_"
]
image_files.sort()
xadjustment = ui.adjustment()
yadjustment = ui.adjustment()
while True:
ui.frame()
ui.vbox()
layout.label(u"Image Location Picker", None)
ui.textbutton(_(u"Done"), clicked=ui.returns(False), size_group="files")
ui.side(['c', 'b', 'r'], spacing=5)
vp = ui.viewport(xadjustment=xadjustment, yadjustment=yadjustment, mousewheel=True)
ui.vbox()
for fn in image_files:
ui.button(clicked=ui.returns(fn), size_group="files", xminimum=1.0)
ui.text(fn.replace("{", "{{").replace("[", "[["), style="button_text", xalign=0.0)
ui.close()
ui.bar(adjustment=xadjustment, style='scrollbar')
ui.bar(adjustment=yadjustment, style='vscrollbar')
ui.close()
ui.close()
rv = ui.interact()
if rv is False:
renpy.jump("_developer_screen")
# Now, allow the user to pick the image.
ui.keymap(game_menu=ui.returns(True))
ui.add(__ImageLocationPicker(rv))
ui.interact()
# ...
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.encode("utf-8", "replace")
print fn.encode("utf-8", "replace")
f.close()
renpy.launch_editor(["files.txt"], transient=1)
jump _developer_screen
# The style inspector.
screen _inspector:
zorder 1010
modal True
frame:
style_group ""
xfill True
yfill True
has vbox
label _("Style Inspector")
null height 20
if not tree:
text _("Nothing to inspect.")
else:
for depth, width, height, d in tree:
$ t = ( " " * depth +
u" \u2022 " +
d.__class__.__name__ + " : " +
"style=%s, " % (__format_style(d.style),) +
"size=(%dx%d)" % (width, height) )
text "[t!q]"
null height 20
text _("(Click to continue.)")
python:
ui.saybehavior()
init python:
def _image_load_log_function(st, at):
ill = list(renpy.get_image_load_log(3))
if not ill:
return Null(), .25
vbox = VBox()
for when, filename, preload in ill:
if preload:
color="#ffffff"
else:
color="#ffcccc"
vbox.add(Text(filename.replace("{", "{{").replace("[", "[["), size=12, color=color, style="_default"))
rv = Window(vbox, style="_frame", background="#0004", xpadding=5, ypadding=5, xminimum=200)
return rv, .25
screen _image_load_log:
zorder 1000
add DynamicDisplayable(_image_load_log_function)
init python:
def __format_style(s):
while s:
if s.name:
break
if s.parent:
s = style.get(s.parent)
else:
break
return s.name[0] + "".join([ "[%r]" % i for i in s.name[1:] ])
def __inspect(tree):
renpy.context_dynamic("_window")
store._window = False
renpy.exports.show_screen("_inspector", _transient=True, tree=tree)
renpy.ui.interact(mouse="screen", type="screen", suppress_overlay=True, suppress_underlay=True)
config.inspector = __inspect
init python:
config.underlay.append(im.Tile("_transparent_tile.png"))
+488
View File
@@ -0,0 +1,488 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
#
# This file contains the code for in-game Ren'Py error handling. It's a
# module (as opposed to a .rpy file) because that allows us to ensure
# that it is fully loaded or run before any other Ren'Py code runs.
# These styles define the look of the Ren'Py in-game interface (the
# amie2-inspired look). They're also used in the launcher.
init python:
# default
style._default = Style(None)
# Temporarily, until the real styles can be defined.
style.default = style._default
style.image = style._default
style.fixed = style._default
style._default.font = "DejaVuSans.ttf"
style._default.language = "unicode"
style._default.antialias = True
style._default.size = 14
style._default.color = "#111"
style._default.black_color = (0, 0, 0, 255)
style._default.bold = False
style._default.italic = False
style._default.underline = False
style._default.strikethrough = False
style._default.kerning = 0.0
style._default.drop_shadow = None
style._default.drop_shadow_color = (0, 0, 0, 255)
style._default.outlines = [ ]
style._default.minwidth = 0
style._default.text_align = 0
style._default.justify = False
style._default.text_y_fudge = 0
style._default.first_indent = 0
style._default.rest_indent = 0
style._default.line_spacing = 0
style._default.line_leading = 0
style._default.line_overlap_split = 0
style._default.layout = "tex"
style._default.subtitle_width = 0.9
style._default.slow_cps = None
style._default.slow_cps_multiplier = 1.0
style._default.slow_abortable = False
# Window properties.
style._default.background = None
style._default.xpadding = 0
style._default.ypadding = 0
style._default.xmargin = 0
style._default.ymargin = 0
style._default.xfill = False
style._default.yfill = False
style._default.xminimum = 0 # Includes margins and padding.
style._default.yminimum = 0 # Includes margins and padding.
# Placement properties.
style._default.xpos = None # 0
style._default.ypos = None # 0
style._default.xanchor = None # 0
style._default.yanchor = None # 0
style._default.xmaximum = None
style._default.ymaximum = None
style._default.xoffset = 0
style._default.yoffset = 0
style._default.subpixel = False
# Sound properties.
style._default.sound = None
# Box properties.
style._default.spacing = 0
style._default.first_spacing = None
style._default.box_layout = None
style._default.box_wrap = False
# Focus properties.
style._default.focus_mask = None
style._default.focus_rect = None
# Bar properties.
style._default.fore_bar = Null()
style._default.aft_bar = Null()
style._default.thumb = None
style._default.thumb_shadow = None
style._default.left_gutter = 0
style._default.right_gutter = 0
style._default.thumb_offset = 0
style._default.unscrollable = None
style._default.bar_invert = False
style._default.bar_vertical = False
# Misc.
style._default.activate_sound = None
style._default.clipping = False
##########################################################################
# frame
style._frame = Style(style._default)
style._frame.background = Frame("_theme_amie2/frame.png", 40, 40)
style._frame.xmargin = 0
style._frame.ymargin = 0
style._frame.xpadding = 15
style._frame.ypadding = 10
# text
style._text = Style(style._default)
# boxes/boxlike
style._fixed = Style(style._default)
style._hbox = Style(style._default)
style._vbox = Style(style._default)
style._grid = Style(style._default)
style._side = Style(style._default)
style._viewport = Style(style._default)
style._hbox.box_layout = 'horizontal'
style._vbox.box_layout = 'vertical'
style._viewport.clipping = True
# button
style._button = Style(style._default)
style._button_text = Style(style._default)
style._button.xpadding = 8
style._button.ypadding = 6
style._button.xoffset = -5
style._button.background = Frame("_theme_amie2/button.png", 10, 10)
style._button.hover_background = Frame("_theme_amie2/button_hover.png", 10, 10)
style._button_text.size = 16
style._button_text.color = "#111"
style._button_text.selected_color = "#11f"
style._button_text.insensitive_color = "#ccc"
style._button_text.xalign = 0.5
style._button_text.yoffset = 0
# label
style._label = Style(style._default)
style._label_text = Style(style._default)
style._label.top_margin = 10
style._label.bottom_margin = 5
style._label_text.color = "#000"
style._label_text.bold = True
# bar
style._bar = Style(style._default)
style._bar.left_bar = Frame("_theme_amie2/hover_frame.png", 10, 10)
style._bar.right_bar = Frame("_theme_amie2/bar.png", 10, 10)
style._bar.thumb = None
style._bar.hover_thumb = None
style._bar.ymaximum = 20
style._scrollbar = Style(style._default)
style._vscrollbar = Style(style._default)
style._scrollbar.left_bar = Frame("_theme_amie2/bar.png", 10, 10)
style._scrollbar.right_bar = Frame("_theme_amie2/bar.png", 10, 10)
style._scrollbar.thumb = Frame("_theme_amie2/frame.png", 10, 10)
style._scrollbar.hover_thumb = Frame("_theme_amie2/hover_frame.png", 10, 10)
style._scrollbar.thumb_offset = 10
style._scrollbar.left_gutter = 5
style._scrollbar.right_gutter = 5
style._scrollbar.unscrollable = "hide"
style._scrollbar.ymaximum = 20
style._vscrollbar.xmaximum = 20
style._vscrollbar.bar_vertical = True
style._vscrollbar.bar_invert = True
style._hyperlink = Style(style._default)
style._hyperlink.color = "#008"
style._hyperlink.hover_underline = True
# Early hyperlink support.
init python hide:
def hyperlink_styler(target):
return style._hyperlink
def hyperlink_function(target):
if target.startswith("http:"):
try:
import webbrowser
webbrowser.open(target)
except:
pass
if target.startswith("edit:"):
prefix, line, filename = target.split(":", 2)
line = int(line)
renpy.launch_editor([ filename ], line)
style._default.hyperlink_functions = (hyperlink_styler, hyperlink_function, None)
init python:
# Null translation function. This gets redefined once things start
# successfully.
def _(s):
return s
# This function is responsible for taking a traceback, and converting
# it to a string that can be shown with text.
def __format_traceback(s):
import re
lines = [ i.replace("{", "{{") for i in s.split("\n") ]
rv = [ "{b}" + lines[0] + "{/b}" ]
for i in lines[1:]:
i = re.sub(r'(File "(.*)", line (\d+))', r'{a=edit:\3:\2}\1{/a}', i)
rv.append(i)
return "\n".join(rv)
def __format_parse_errors(s):
import re
rv = ""
lines = s.split("\n")
len_lines = len(lines)
ln = 0
while ln < len_lines:
line = lines[ln]
ln += 1
if ln < len_lines and lines[ln].endswith("^"):
highlight = len(lines[ln]) - 1
ln += 1
else:
highlight = -1
pos = 0
for c in line:
if pos == highlight:
rv += u"{color=#c00}\u2192{/color}"
highlight = -1
pos += 1
if c == "{":
rv += "{{"
else:
rv += c
if highlight > 0:
rv += u"{color=#c00}\u2190{/color}"
rv += "\n"
rv = re.sub(r'(File "(.*)", line (\d+))', r'{a=edit:\3:\2}\1{/a}', rv)
return rv
class __EditFile(Action):
def __init__(self, filename):
self.filename = filename
def __call__(self):
try:
renpy.launch_editor([ self.filename ], 1, transient=1)
except:
pass
def __can_open_traceback():
return True
# The transform used for errors. ATL isn't ready yet.
def __transform_function(state, st, at):
done = min(st / .1, 1.0)
state.zoom = .5 + .5 * done
state.alpha = done
state.xalign = 0.5
state.yalign = 0.5
if done < 1.0:
return 0
else:
return None
__transform = Transform(function=__transform_function, style='_default')
class __TooltipAction(object):
def __init__(self, tooltip, value):
self.tooltip = tooltip
self.value = value
def __call__(self):
if self.tooltip.value != self.value:
self.tooltip.value = self.value
renpy.restart_interaction()
def unhovered(self):
if self.tooltip.value != self.tooltip.default:
self.tooltip.value = self.tooltip.default
renpy.restart_interaction()
class __Tooltip(object):
def __init__(self, default):
self.value = default
self.default = default
def action(self, value):
return __TooltipAction(self, value)
class __XScrollValue(BarValue):
def __init__(self, viewport):
self.viewport = viewport
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." % self.viewport)
return w.xadjustment
def get_style(self):
return "scrollbar", "vscrollbar"
class __YScrollValue(BarValue):
def __init__(self, viewport):
self.viewport = viewport
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." % self.viewport)
return w.yadjustment
def get_style(self):
return "scrollbar", "vscrollbar"
# The screen that is used for error handling.
screen _exception:
modal True
zorder 1090
default tt = __Tooltip("")
default fmt_short = __format_traceback(short)
default fmt_full = __format_traceback(full)
add Solid("#000")
frame:
style_group ""
xfill True
at __transform
has side "t c r b"
vbox:
label _("An exception has occurred.")
viewport:
id "viewport"
child_size (4000, None)
mousewheel True
has vbox
text fmt_short substitute False
text fmt_full substitute False
bar:
style "_vscrollbar"
value __YScrollValue("viewport")
vbox:
bar:
style "_scrollbar"
value __XScrollValue("viewport")
hbox:
box_wrap True
if rollback_action:
textbutton _("Rollback"):
action rollback_action
hovered tt.action(_("Attempts a roll back to a prior time, allowing you to save or choose a different choice."))
if ignore_action:
textbutton _("Ignore"):
action ignore_action
hovered tt.action(_("Ignores the exception, allowing you to continue. This often leads to additional errors."))
if config.developer:
textbutton _("Reload"):
action reload_action
hovered tt.action(_("Reloads the game from disk, saving and restoring game state if possible."))
textbutton _("Open Traceback"):
action __EditFile(traceback_fn)
hovered tt.action(_("Opens the traceback.txt file in a text editor."))
null width 30
textbutton _("Quit"):
action renpy.quit
hovered tt.action(_("Quits the game."))
# Tooltip.
text tt.value size 12
if config.developer and reload_action:
key "R" action reload_action
# The screen that is used for error handling.
screen _parse_errors:
modal True
zorder 1090
default tt = __Tooltip("")
default fmt_errors = __format_parse_errors(errors)
add Solid("#000")
frame:
style_group ""
xfill True
at __transform
has side "t c r b"
vbox:
label _("Parsing the script failed.")
viewport:
id "viewport"
child_size (None, None)
mousewheel True
has vbox
text fmt_errors substitute False
bar:
style "_vscrollbar"
value __YScrollValue("viewport")
vbox:
bar:
style "_scrollbar"
value __XScrollValue("viewport")
hbox:
box_wrap True
textbutton _("Reload"):
action reload_action
hovered tt.action(_("Reloads the game from disk, saving and restoring game state if possible."))
textbutton _("Open Parse Errors"):
action __EditFile(error_fn)
hovered tt.action(_("Opens the errors.txt file in a text editor."))
null width 30
textbutton _("Quit"):
action renpy.quit
hovered tt.action(_("Quits the game."))
# Tooltip.
text tt.value size 12
if config.developer and reload_action:
key "R" action reload_action
@@ -0,0 +1,109 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('joystick_preferences')
style.js_frame = Style(style.menu_frame, help="frame used for changing a joystick binding")
style.js_frame_box = Style(style.vbox, help="vbox used for changing a joystick binding")
style.js_function_prompt = Style(style.prompt, help="the name of the joystick binding to change (window)")
style.js_function_prompt_text = Style(style.prompt_text, help="the name of the joystick binding to change (text)")
style.js_action_prompt = Style(style.prompt, help="prompting the user how to change a joystick binding (window)")
style.js_action_prompt_text = Style(style.prompt_text, help="prompting the user how to change a joystick binding (text)")
style.js_prefs_frame = Style(style.menu_frame, help="frame containing all joystick bindings")
style.js_prefs_box = Style(style.vbox, help="box containing all joystick bindings")
style.js_prefs_button = Style(style.button, help="button containing a joystick binding")
style.js_prefs_button_text = Style(style.button_text, help="button containing a joystick binding (text)")
style.js_prefs_label = Style(style.label, help="joystick preferences label (window)")
style.js_prefs_label_text = Style(style.label_text, help="joystick preferences label (text)")
style.js_frame.ypos = .1
style.js_frame.ypadding = .05
style.js_frame.xmargin = .1
style.js_frame_box.box_spacing = 30
style.js_prefs_frame.xpos = 10
style.js_prefs_frame.ypos = 10
style.js_prefs_button.xminimum = 0.5
style.js_prefs_box.box_first_spacing = 10
config.joystick_keys = [
(u'Left', 'joy_left'),
(u'Right', 'joy_right'),
(u'Up', 'joy_up'),
(u'Down', 'joy_down'),
(u'Select/Dismiss', 'joy_dismiss'),
(u'Rollback', 'joy_rollback'),
(u'Hold to Skip', 'joy_holdskip'),
(u'Toggle Skip', 'joy_toggleskip'),
(u'Hide Text', 'joy_hide'),
(u'Menu', 'joy_menu'),
]
def _joystick_select_binding():
for label, key in config.joystick_keys:
def my_clicked(label=label, key=key):
return (label, key)
layout.button(_(label) + " - " + _(_preferences.joymap.get(key, u"Not Assigned")), "prefs_js", clicked=my_clicked, index=label)
def _joystick_get_binding():
ui.saybehavior()
ui.add(renpy.display.joystick.JoyBehavior())
def _joystick_take_binding(binding, key):
if not isinstance(binding, basestring):
if key in _preferences.joymap:
del _preferences.joymap[key]
else:
_preferences.joymap[key] = binding
def _joystick_preferences():
def set_binding(label, key):
layout.navigation(None)
ui.window(style='js_frame')
ui.vbox(style='js_frame_box')
layout.prompt(_(u"Joystick Mapping") + " - " + _(label), "js_function")
layout.prompt(u'Move the joystick or press a joystick button to create the mapping. Click the mouse to remove the mapping.', 'js_action')
ui.close()
_joystick_get_binding()
binding = ui.interact(mouse="gamemenu")
_joystick_take_binding(binding, key)
return True
ui.window(style='js_prefs_frame')
ui.vbox(style='js_prefs_box')
layout.label("Joystick Configuration", "js_prefs")
for label, key in config.joystick_keys:
def clicked(label=label, key=key):
return renpy.invoke_in_new_context(set_binding, label, key)
layout.button(_(label) + " - " + _(_preferences.joymap.get(key, u"Not Assigned")), "js_prefs", clicked=clicked, index=label)
ui.close()
label joystick_preferences_screen:
while True:
python:
layout.navigation("joystick_preferences")
_joystick_preferences()
ui.interact(mouse="gamemenu")
+353
View File
@@ -0,0 +1,353 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('load_save')
# Define styles
style.file_picker_entry = Style(style.large_button, help="used to select a file to load or save")
style.file_picker_entry_box = Style(style.hbox, help="the box inside a file picker entry")
style.file_picker_text = Style(style.large_button_text, help="text inside a file picker entry")
style.file_picker_empty_slot = Style(style.file_picker_text, help="text inside an empty file picker entry slot")
style.file_picker_extra_info = Style(style.file_picker_text)
style.file_picker_new = Style(style.file_picker_text)
style.file_picker_old = Style(style.file_picker_text)
style.file_picker_frame = Style(style.menu_frame, help="the frame enclosing the entire file picker")
style.file_picker_frame_box = Style(style.vbox, help="the box containing the navbox and the grid of file picker entries")
style.file_picker_navbox = Style(style.hbox, help="the box containing navigation buttons")
style.file_picker_nav_button = Style(style.small_button, help="a file picker navigation button")
style.file_picker_nav_button_text = Style(style.small_button_text, help="file picker navigation button text")
style.file_picker_grid = Style(style.default, help="a grid containing file picker navigation buttons")
# Adjust styles.
style.file_picker_entry.xminimum = 0.5
style.file_picker_frame.xmargin = 6
style.file_picker_frame.ymargin = 6
style.file_picker_frame_box.box_spacing = 4
style.file_picker_entry_box.box_spacing = 4
# The number of columns per page of files.
config.file_page_cols = 2
if config.screen_width <= 640:
# The number of rows per page of files.
config.file_page_rows = 4
# The number of quick access pages.
config.file_quick_access_pages = 6
else:
config.file_page_rows = 5
config.file_quick_access_pages = 8
# True if we want to disable the file pager.
config.disable_file_pager = False
# True to suppress the display of thumbnails.
config.disable_thumbnails = False
# The default thumbnail to use when no file exists.
config.load_save_empty_thumbnail = None
# How we format time in a file entry.
config.time_format = "%b %d, %H:%M"
# How we format a file entry.
config.file_entry_format = "%(time)s\n%(save_name)s"
# True if we should prompt before loading a game.
_load_prompt = True
# This is used to store scratch data that's used by the
# library, but shouldn't be saved out as part of the savegame.
__scratch = object()
__scratch.file_picker_page = None
def _render_savefile(index, name, extra_info, screenshot, mtime, newest, clicked):
import time
ui.button(style=style.file_picker_entry[index],
clicked=clicked,
role=("selected_" if newest else ""),
keymap={ "save_delete" : ui.returns(("unlink", name)) }
)
ui.hbox(style=style.file_picker_entry_box[index])
if not config.disable_thumbnails:
ui.add(screenshot)
if newest:
ui.text(name + ". ", style=style.file_picker_new[index])
else:
ui.text(name + ". ", style=style.file_picker_old[index])
s = config.file_entry_format % dict(
time=time.strftime(config.time_format,
time.localtime(mtime)),
save_name=extra_info)
ui.text(s, style=style.file_picker_extra_info[index])
ui.close()
def _render_new_slot(index, name, clicked):
ui.button(style=style.file_picker_entry[index],
clicked=clicked)
ui.hbox(style=style.file_picker_entry_box[index])
if not config.disable_thumbnails:
if config.load_save_empty_thumbnail:
ui.add(config.load_save_empty_thumbnail)
else:
ui.null(width=config.thumbnail_width,
height=config.thumbnail_height)
ui.text(name + ". ", style=style.file_picker_old[index])
ui.text(_(u"Empty Slot."), style=style.file_picker_empty_slot[index])
ui.close()
# Returns the names of the various pages that the file picker knows
# about.
def _file_picker_pages():
rv = [ ]
if config.has_autosave:
rv.append(u"Auto")
if config.has_quicksave:
rv.append(u"Quick")
for i in range(1, config.file_quick_access_pages + 1):
rv.append(str(i))
return rv
# This function is given a page, and should map it to the names
# of the files on that page.
def _file_picker_page_files(page):
per_page = config.file_page_cols * config.file_page_rows
rv = [ ]
if config.has_autosave:
if page == 0:
for i in range(1, per_page + 1):
rv.append(("auto-" + str(i), _(u"a") + str(i), True))
return rv
else:
page -= 1
if config.has_quicksave:
if page == 0:
for i in range(1, per_page + 1):
rv.append(("quick-" + str(i), _(u"q") + str(i), True))
return rv
else:
page -= 1
for i in range(per_page * page + 1, per_page * page + 1 + per_page):
rv.append(("%d" % i, "%d" % i, False))
return rv
# Given a filename, returns the page that filename is on.
def _file_picker_file_page(filename):
per_page = config.file_page_cols * config.file_page_rows
base = 0
if config.has_autosave:
if filename.startswith("auto-"):
return base
else:
base += 1
if config.has_quicksave:
if filename.startswith("quick-"):
return base
else:
base += 1
try:
return base + int((int(filename) - 1) / per_page)
except:
return base
# Processes a screenshot.
def _file_picker_process_screenshot(s):
return s
# This displays a file picker that can chose a save file from
# the list of save files.
def _file_picker(screen, save):
# Should we update the list of saved games?
update = True
while True:
if update:
update = False
# The number of slots in a page.
file_page_length = config.file_page_cols * config.file_page_rows
# The list of saved games.
saved_games = renpy.list_saved_games(regexp=r'(auto-|quick-)?[0-9]+')
# Figure out which game is the newest and so on.
newest = None
newest_mtime = None
save_info = { }
for fn, extra_info, screenshot, mtime in saved_games:
screenshot = _file_picker_process_screenshot(screenshot)
save_info[fn] = (extra_info, screenshot, mtime)
if not fn.startswith("auto-") and mtime > newest_mtime:
newest = fn
newest_mtime = mtime
# The index of the first entry in the page.
fpp = __scratch.file_picker_page
if fpp is None:
if newest:
fpp = _file_picker_file_page(newest)
else:
fpp = _file_picker_file_page("1")
if fpp < 0:
fpp = 0
__scratch.file_picker_page = fpp
# Show navigation
layout.navigation(screen)
ui.window(style='file_picker_frame')
ui.vbox(style='file_picker_frame_box') # whole thing.
if not config.disable_file_pager:
# Draw the navigation.
ui.hbox(style='file_picker_navbox') # nav buttons.
def tb(cond, label, clicked, selected):
layout.button(label,
"file_picker_nav",
enabled=cond,
clicked=clicked,
selected=selected)
# Previous
tb(fpp > 0, u'Previous', ui.returns(("fppdelta", -1)), selected=False)
# Quick Access
for i, name in enumerate(_file_picker_pages()):
tb(True, name, ui.returns(("fppset", i)), fpp == i)
# Next
tb(True, u'Next', ui.returns(("fppdelta", +1)), False)
ui.close()
# This draws a single slot.
def entry(name, filename, offset, ro):
clicked = ui.returns(("return", filename))
if filename not in save_info:
if (not save) or ro:
clicked = None
_render_new_slot(offset, name, clicked)
else:
if save and ro:
clicked = None
extra_info, screenshot, mtime = save_info[filename]
_render_savefile(offset,
name,
extra_info,
screenshot,
mtime,
newest == filename,
clicked)
ui.grid(config.file_page_cols,
config.file_page_rows,
style='file_picker_grid',
transpose=True) # slots
for i, (filename, name, ro) in enumerate(_file_picker_page_files(fpp)):
entry(name, filename, i, ro)
ui.close() # slots
ui.close() # whole thing
result = ui.interact(mouse="gamemenu")
type, value = result
if type == "unlink":
if layout.yesno_prompt(screen, layout.DELETE_SAVE):
renpy.unlink_save(value)
update = True
if type == "return":
return value
if type == "fppdelta":
fpp += value
if type == "fppset":
fpp = value
label save_screen:
python hide:
while True:
fn = _file_picker("save", True)
if renpy.can_load(fn):
if not layout.yesno_prompt("save", layout.OVERWRITE_SAVE):
continue
renpy.save(fn, extra_info=store.save_name)
label load_screen:
python hide:
while True:
fn = _file_picker("load", False)
if _load_prompt:
if not layout.yesno_prompt("load", layout.LOADING):
continue
renpy.load(fn)
+60
View File
@@ -0,0 +1,60 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('main_menu')
style.mm_menu_frame = Style(style.menu_frame, help="frame containing main menu")
style.mm_menu_frame_box = Style(style.vbox, help="box containing main menu buttons")
style.mm_button = Style(style.button, help="main menu button")
style.mm_button_text = Style(style.button_text, help="main menu button (text)")
style.mm_button.size_group = "mm"
style.mm_menu_frame.xpos = 5.0/6.0
style.mm_menu_frame.xanchor = 0.5
style.mm_menu_frame.ypos = 0.9
style.mm_menu_frame.yanchor = 1.0
label main_menu_screen:
python hide:
# Ignore right-click while at the main menu.
ui.keymap(game_menu=ui.returns(None))
# Show the background.
ui.window(style='mm_root')
ui.null()
ui.frame(style='mm_menu_frame')
ui.vbox(style='mm_menu_frame_box')
for e in config.main_menu:
if len(e) == 3:
label, clicked, enabled = e
shown = "True"
else:
label, clicked, enabled, shown = e
if not eval(shown):
continue
# This checks to see if clicked is a string. If so, we want clicked
# to jump us out of the current context.
if isinstance(clicked, basestring):
clicked=ui.jumpsoutofcontext(clicked)
# Create each button.
layout.button(label, "mm", enabled=eval(enabled), clicked=clicked)
ui.close()
ui.interact(mouse="mainmenu")
return
+53
View File
@@ -0,0 +1,53 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('navigation')
style.gm_nav_frame = Style(style.menu_frame, help="game menu navigation frame")
style.gm_nav_box = Style(style.vbox, help="box containing game menu navigation buttons")
style.gm_nav_button = Style(style.button, help="game menu navigation button")
style.gm_nav_button_text = Style(style.button_text, help="game menu navigation button (text)")
style.gm_nav_button.size_group = "gm_nav_button"
style.gm_nav_frame.xpos = 5.0/6.0
style.gm_nav_frame.xanchor = 0.5
style.gm_nav_frame.ypos = 0.95
style.gm_nav_frame.yanchor = 1.0
def _navigation(screen=None):
# Display the game menu background
ui.window(style=style.gm_root[screen])
ui.null()
if screen is None:
return
# Display the navigation frame.
ui.frame(style='gm_nav_frame')
ui.vbox(focus='gm_nav', style='gm_nav_box')
for e in config.game_menu:
if len(e) == 4:
key, label, clicked, enabled = e
shown = "True"
else:
key, label, clicked, enabled, shown = e
if not eval(shown):
continue
layout.button(label,
"gm_nav",
selected=(screen==key),
enabled=eval(enabled),
clicked=clicked)
ui.close()
layout.navigation = _navigation
+86
View File
@@ -0,0 +1,86 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('preferences')
# Load the common code.
renpy.load_module("_layout/classic_preferences_common")
# Create styles.
style.prefs_column = Style(style.vbox, help="preference columns")
style.prefs_left = Style(style.prefs_column, help="the left preference column")
style.prefs_center = Style(style.prefs_column, help="the center preference column")
style.prefs_right = Style(style.prefs_column, help="the right preference column")
# Customize styles.
style.prefs_pref_frame.xfill = True
style.prefs_column.xanchor = 0.5
if config.screen_width <= 640:
style.prefs_pref_box.box_spacing = 6
style.prefs_column.xmaximum = 200
style.prefs_column.box_spacing = 5
style.prefs_frame.top_margin = 5
style.prefs_left.xpos = 110
style.prefs_center.xpos = 320
style.prefs_right.xpos = 530
style.prefs_slider.xmaximum = 160
else:
style.prefs_pref_box.box_spacing = 12
style.prefs_column.xmaximum = 250
style.prefs_column.box_spacing = 10
style.prefs_frame.top_margin = 10
style.prefs_left.xpos = 137
style.prefs_center.xpos = 400
style.prefs_right.xpos = 663
style.prefs_slider.xmaximum = 200
style.prefs_pref_box.xfill = True
style.prefs_volume_box.xfill = True
style.prefs_pref_choicebox.xfill = True
style.prefs_button.xalign = 1.0
style.prefs_jump_button.xalign = 1.0
style.prefs_slider.xalign = 1.0
style.soundtest_button.xalign = 1.0
style.prefs_button.size_group = "prefs"
style.prefs_jump_button.size_group = "prefs"
# Place preferences into groups.
config.preferences['prefs_left'] = [
config.all_preferences[u'Display'],
config.all_preferences[u'Transitions'],
config.all_preferences[u'Text Speed'],
config.all_preferences[u'Joystick...'],
]
config.preferences['prefs_center'] = [
config.all_preferences[u'Skip'],
config.all_preferences[u'Begin Skipping'],
config.all_preferences[u'After Choices'],
config.all_preferences[u'Auto-Forward Time'],
]
config.preferences['prefs_right'] = [
config.all_preferences[u'Music Volume'],
config.all_preferences[u'Sound Volume'],
config.all_preferences[u'Voice Volume'],
]
label preferences_screen:
python hide:
_prefs_screen_run(config.preferences)
jump preferences_screen
@@ -0,0 +1,380 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
# Styles
style.prefs_frame = Style(style.default, help="the frame containing all of the preferences")
style.prefs_frame_box = Style(style.default, help="the box inside the frame containing all of the preferences")
style.prefs_pref_frame = Style(style.menu_frame, help="a frame containing a single preference")
style.prefs_pref_box = Style(style.vbox, help="the box separating the preference label from the preference choices")
style.prefs_pref_choicebox = Style(style.vbox, help="the box containing the preference choices")
style.prefs_label = Style(style.label, help="a preference label (window)")
style.prefs_label_text = Style(style.label_text, help="a preference label (text)")
style.prefs_button = Style(style.radio_button, help="preference value button")
style.prefs_button_text = Style(style.radio_button_text, help="preference value button (text)")
style.prefs_slider = Style(style.slider, help="preference value slider bar")
style.prefs_volume_box = Style(style.vbox, help="box containing a volume slider and soundtest button")
style.prefs_volume_slider = Style(style.prefs_slider, help="volume slider bar")
style.soundtest_button = Style(style.small_button, help="soundtest button")
style.soundtest_button_text = Style(style.small_button_text, help="soundtest button (text)")
style.prefs_jump = Style(style.prefs_pref_frame, help="jump preference frame")
style.prefs_jump_button = Style(style.button, help="jump preference button")
style.prefs_jump_button_text = Style(style.button_text, help="jump preference button (text)")
# This is a map from the name of the style that is applied to
# a list of preferences that should be placed into a vbox
# with that style.
config.preferences = { }
# This is a map from preference name to that preference
# object, that can be used in rearranging preferences.
config.all_preferences = { }
# Should the soundtest button be before the volume slider?
config.soundtest_before_volume = False
def _prefs_screen_run(prefs_map):
layout.navigation("preferences")
ui.window(style='prefs_frame')
ui.fixed(style='prefs_frame_box')
for style, prefs in prefs_map.iteritems():
ui.vbox(style=style)
for i in prefs:
i.render()
ui.close()
ui.close()
ui.interact(mouse="gamemenu")
class _Preference(object):
"""
This is a class that's used to represent a multiple-choice
preference.
"""
def __init__(self, name, field, values, base=_preferences):
"""
@param name: The name of this preference. It will be
displayed to the user.
@param variable: The field on the base object
that will be assigned the selected value. This field
must exist.
@param values: A list of value name, value, condition
triples. The value name is the name of this value that
will be shown to the user. The value is the literal
python value that will be assigned if this value is
selected. The condition is a condition that will be
evaluated to determine if this is a legal value. If no
conditions are true, this preference will not be
displayed to the user. A condition of None is always
considered to be True.
@param base: The base object on which the variable is
read from and set. This defaults to _preferences,
the user preferences object.
"""
self.name = name
self.field = field
self.values = values
self.base = base
config.all_preferences[name] = self
def render(self):
values = [ (name, val) for name, val, cond in self.values
if cond is None or renpy.eval(cond) ]
if not values:
return
ui.window(style=style.prefs_pref_frame[self.name])
ui.vbox(style=style.prefs_pref_box[self.name])
layout.label(self.name, "prefs")
cur = getattr(self.base, self.field)
ui.hbox(style=style.prefs_pref_choicebox[self.name])
for name, value in values:
def clicked(value=value):
setattr(self.base, self.field, value)
return True
layout.button(name, "prefs",
selected=(cur==value),
clicked=clicked)
ui.close() # choicebox
ui.close() # vbox
class _VolumePreference(object):
"""
This represents a preference that controls one of the
volumes in the system. It is represented as a slider bar,
and a button that can be pushed to play a sample sound on
a channel.
"""
def __init__(self, name, mixer, enable='True', sound='None', channel="sound"):
"""
@param name: The name of this preference, as shown to the user.
@param mixer: The mixer this preference controls.
@param enable: A string giving a python expression. If
the expression is evaluates to false, this preference
is not shown.
@param sound: A string that is evaluated to yield
another string. The yielded string is expected to give
a sound file, which is played as the sample sound. (We
apologize for the convolution of this.)
@param channel: The number of the channel the sample
sound is played on.
"""
self.name = name
self.mixer = mixer
self.enable = enable
self.sound = sound
self.channel = channel
config.all_preferences[name] = self
def render(self):
if not eval(self.enable):
return
sound = eval(self.sound)
ui.window(style=style.prefs_pref_frame[self.name])
ui.vbox(style=style.prefs_pref_box[self.name])
layout.label(self.name, "prefs")
ui.vbox(style=style.prefs_volume_box[self.name])
if sound:
def clicked():
renpy.sound.play(sound, channel=self.channel)
if sound and config.soundtest_before_volume:
layout.button(u"Test", "soundtest", clicked=clicked, index=self.name)
def changed(v):
_preferences.set_volume(self.mixer, v / 128.0)
ui.bar(128,
int(_preferences.get_volume(self.mixer) * 128),
changed=changed,
style=style.prefs_volume_slider[self.name])
if sound and not config.soundtest_before_volume:
layout.button(u"Test", "soundtest", clicked=clicked, index=self.name)
ui.close()
ui.close()
class _SliderPreference(object):
"""
A class that represents a preference that is controlled by a
slider.
"""
def __init__(self, name, field, range, enable='True', base=_preferences):
"""
@param name: The name of this preference, that is shown to the user.
@param range: An integer giving the maximum value of
this slider. The slider goes from 0 to range.
@param get: A function that's called to get the
initial value of the slider. It's called with no
arguments, and should return an integet between 0 and
range, inclusive.
@param set: A function that's called when the value of
the slider is set by the user. It is called with a
single integer, in the range 0 to range, inclusive.
@param enable: A string giving a python expression. If
the expression is evaluates to false, this preference
is not shown.
"""
self.name = name
self.field = field
self.range = range
self.enable = enable
self.base = base
config.all_preferences[name] = self
def get(self):
value = getattr(self.base, self.field)
if value == 0:
value = self.range
else:
value -= 1
return value
def set(self, value):
value += 1
if value == self.range + 1:
value = 0
setattr(self.base, self.field, value)
def render(self):
if not eval(self.enable):
return
ui.window(style=style.prefs_pref_frame[self.name])
ui.vbox(style=style.prefs_pref_box[self.name])
layout.label(self.name, "prefs")
def changed(v):
self.set(v)
ui.bar(self.range,
self.get(),
changed=changed,
style=style.prefs_slider[self.name])
ui.close()
class _JumpPreference(object):
def __init__(self, name, target, condition="True", show="True"):
self.name = name
self.target = target
self.condition = condition
self.show = show
config.all_preferences[name] = self
def render(self):
if not eval(self.show):
return
ui.window(style=style.prefs_jump[self.name])
if eval(self.condition):
clicked=ui.jumps(self.target)
else:
clicked=None
layout.button(self.name, 'prefs_jump', clicked=clicked)
def _remove_preference(name):
"""
Removes the preference with the given name from the
preferences menu.
"""
pref = config.all_preferences.get(name, None)
if not pref:
return
for k, v in config.preferences.iteritems():
if pref in v:
v.remove(pref)
init python hide:
# Enablers for some preferences.
config.sample_sound = None
config.sample_voice = None
config.has_transitions = True
config.has_cps = True
config.has_afm = True
config.has_skipping = True
config.has_skip_after_choice = True
config.always_has_joystick = False
config.has_joystick = True
# Left
_Preference(u'Display', 'fullscreen', [
(u'Window', False, None),
(u'Fullscreen', True, None),
])
_Preference(u'Transitions', 'transitions', [
(u'All', 2, 'config.has_transitions'),
(u'Some', 1, 'config.has_transitions and default_transition'),
(u'None', 0, 'config.has_transitions'),
])
# Center
_Preference(u'Skip', 'skip_unseen', [
(u'Seen Messages', False, 'config.allow_skipping and config.has_skipping'),
(u'All Messages', True, 'config.allow_skipping and config.has_skipping'),
])
_JumpPreference(u'Begin Skipping',
'_return_skipping',
'not main_menu',
'config.allow_skipping and config.has_skipping')
_Preference(u'After Choices', 'skip_after_choices', [
(u'Stop Skipping', False, 'config.allow_skipping and config.has_skip_after_choice'),
(u'Keep Skipping', True, 'config.allow_skipping and config.has_skip_after_choice'),
])
config.old_names['Keep Skipping'] = 'Continue Skipping'
_SliderPreference(u'Text Speed', "text_cps", 150, 'config.has_cps')
_SliderPreference(u'Auto-Forward Time', "afm_time", 40, 'config.has_afm')
# Right
_VolumePreference(u"Music Volume",
'music',
'config.has_music')
_VolumePreference(u"Sound Volume",
'sfx',
'config.has_sound',
'config.sample_sound',
'sound')
_VolumePreference(u'Voice Volume',
'voice',
'config.has_voice',
'config.sample_voice',
'voice')
_JumpPreference(u'Joystick...',
'joystick_preferences_screen',
'renpy.display.joystick.enabled or config.always_has_joystick',
'config.has_joystick')
+60
View File
@@ -0,0 +1,60 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python hide:
layout.provides('yesno_prompt')
# Define styles
style.yesno_frame = Style(style.menu_frame, help="frame containing a yes/no prompt and yes/no buttons")
style.yesno_frame_vbox = Style(style.vbox, help="box separating yes/no prompt from yes/no buttons")
style.yesno_prompt = Style(style.prompt, help="a yes/no prompt")
style.yesno_prompt_text = Style(style.prompt_text, help="a yes/no prompt (text)")
style.yesno_button_hbox = Style(style.hbox, help="the box separating yes and no buttons")
style.yesno_button = Style(style.button, help="a yes or no button")
style.yesno_button_text = Style(style.button_text, help="a yes or no button (text)")
# Alter styles.
style.yesno_frame.xfill = True
style.yesno_frame.xmargin = .05
style.yesno_frame.ypos = .1
style.yesno_frame.yanchor = 0
style.yesno_frame.ypadding = .05
style.yesno_frame_vbox.xalign = 0.5
style.yesno_frame_vbox.yalign = 0.5
style.yesno_frame_vbox.box_spacing = 30
style.yesno_button_hbox.xalign = 0.5
style.yesno_button_hbox.spacing = 100
style.yesno_button.size_group = "yesno"
def yesno_prompt(screen, message):
renpy.transition(config.intra_transition)
layout.navigation(screen)
ui.window(style='yesno_frame')
ui.vbox(style='yesno_frame_vbox')
layout.prompt(message, "yesno")
ui.hbox(style='yesno_button_hbox')
# The extra nulls are because we want equal whitespace surrounding
# the two buttons. It should work as long as we have xfill=True
layout.button(u"Yes", 'yesno', clicked=ui.returns(True))
layout.button(u"No", 'yesno', clicked=ui.returns(False))
ui.close()
ui.close()
rv = ui.interact(mouse="gamemenu")
renpy.transition(config.intra_transition)
return rv
layout.yesno_prompt = yesno_prompt
+72
View File
@@ -0,0 +1,72 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('main_menu')
style.mm_menu_frame = Style(style.menu_frame, help="frame containing main menu")
style.mm_outer_box = Style(style.vbox, help="outer box containing main menu buttons")
style.mm_inner_box = Style(style.hbox, help="inner box containing main menu buttons")
style.mm_button = Style(style.button, help="main menu button")
style.mm_button_text = Style(style.button_text, help="main menu button (text)")
style.mm_menu_frame.xalign = 0.5
style.mm_menu_frame.yalign = 0.98
style.mm_inner_box.xalign = 0.5
config.main_menu_per_group = 2
label main_menu_screen:
python hide:
# Ignore right-click while at the main menu.
ui.keymap(game_menu=ui.returns(None))
# Show the background.
ui.window(style='mm_root')
ui.null()
ui.frame(style='mm_menu_frame')
ui.vbox(style='mm_outer_box')
inner_open = False
for i, e in enumerate(config.main_menu):
if len(e) == 3:
label, clicked, enabled = e
shown = "True"
else:
label, clicked, enabled, shown = e
if not eval(shown):
continue
if i % config.main_menu_per_group == 0:
if inner_open:
ui.close()
ui.hbox(style='mm_inner_box')
inner_open = True
# This checks to see if clicked is a string. If so, we want clicked
# to jump us out of the current context.
if isinstance(clicked, basestring):
clicked=ui.jumpsoutofcontext(clicked)
# Create each button.
layout.button(label, "mm", enabled=eval(enabled), clicked=clicked)
if inner_open:
ui.close() # inner box
ui.close() # outer box
ui.interact(mouse="mainmenu")
return
+69
View File
@@ -0,0 +1,69 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('navigation')
style.gm_nav_frame = Style(style.menu_frame, help="game menu navigation frame")
style.gm_nav_inner_box = Style(style.hbox, help="inner box containing game menu navigation buttons")
style.gm_nav_outer_box = Style(style.vbox, help="outer box containing game menu navigation buttons")
style.gm_nav_button = Style(style.button, help="game menu navigation button")
style.gm_nav_button_text = Style(style.button_text, help="game menu navigation button (text)")
style.gm_nav_button.size_group = "gm_nav_button"
style.gm_nav_frame.xalign = 0.5
style.gm_nav_frame.ypos = 0.98
style.gm_nav_frame.yanchor = 1.0
style.gm_nav_inner_box.xalign = 0.5
config.navigation_per_group = 4
def navigation(screen=None):
# Display the game menu background
ui.window(style=style.gm_root[screen])
ui.null()
if screen is None:
return
# Display the navigation frame.
ui.frame(style='gm_nav_frame')
ui.vbox(focus='gm_nav', style='gm_nav_outer_box')
box_open = False
for i, e in enumerate(config.game_menu):
if len(e) == 4:
key, label, clicked, enabled = e
shown = "True"
else:
key, label, clicked, enabled, shown = e
if not eval(shown):
continue
if i % config.navigation_per_group == 0:
if box_open:
ui.close()
ui.hbox(style='gm_nav_inner_box')
box_open = True
layout.button(label,
"gm_nav",
selected=(screen==key),
enabled=eval(enabled),
clicked=clicked)
if box_open:
ui.close() # inner box.
ui.close() # outer box.
layout.navigation = navigation
+127
View File
@@ -0,0 +1,127 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
class _ImageMapper(object):
def __init__(self, screen, ground, idle, hover, selected_idle, selected_hover, hotspots, navigation=True, variant=None):
# If the argument is a dict, look up the screen in that dict, and
# return the result. Otherwise, just return the result.
def maybe_variant(a):
if isinstance(a, dict):
if variant in a:
return a[variant]
else:
return a[None]
return a
ground = maybe_variant(ground)
self.idle = maybe_variant(idle) or ground
self.hover = maybe_variant(hover) or self.idle
self.selected_idle = maybe_variant(selected_idle) or self.idle
self.selected_hover = maybe_variant(selected_hover) or self.hover
self.hotspots = { }
for (x1, y1, x2, y2, name) in maybe_variant(hotspots):
self.hotspots[name] = (x1, y1, x2, y2)
self.remaining_hotspots = set(self.hotspots.keys())
if navigation:
# Display the layout navigation only if there are no
# game menu buttons defined.
for i in config.game_menu:
if i[1] in self.hotspots:
break
else:
layout.navigation(screen)
ui.fixed(style='imagemap')
ui.image(ground)
if navigation:
# Display any navigation buttons that exist.
for e in config.game_menu:
screen_ = e[0]
name = e[1]
act = e[2]
enable = e[3]
if not eval(enable):
continue
self.button(name, act, screen == screen_)
def button(self, name, clicked, selected, keymap={}):
if name not in self.hotspots:
return None
self.remaining_hotspots.discard(name)
x1, y1, x2, y2 = self.hotspots[name]
if clicked is None:
return (x1, y1, x2, y2)
if selected:
idle = self.selected_idle
hover = self.selected_hover
else:
idle = self.idle
hover = self.hover
ui.imagebutton(
LiveCrop((x1, y1, (x2 - x1), (y2 - y1)), idle),
LiveCrop((x1, y1, (x2 - x1), (y2 - y1)), hover),
xpos=x1,
ypos=y1,
xanchor=0,
yanchor=0,
clicked=clicked,
focus_mask=True,
style='imagemap_button',
keymap=keymap,
)
return (x1, y1, x2, y2)
def bar(self, name, range, value, changed):
if name not in self.hotspots:
return
self.remaining_hotspots.discard(name)
x1, y1, x2, y2 = self.hotspots[name]
ui.bar(
range,
value,
changed=changed,
left_gutter=0,
right_gutter=0,
left_bar=LiveCrop((x1, y1, (x2 - x1), (y2 - y1)), self.selected_idle),
right_bar=LiveCrop((x1, y1, (x2 - x1), (y2 - y1)), self.idle),
hover_left_bar=LiveCrop((x1, y1, (x2 - x1), (y2 - y1)), self.selected_hover),
hover_right_bar=LiveCrop((x1, y1, (x2 - x1), (y2 - y1)), self.hover),
bar_resizing=False,
xpos=x1,
ypos=y1,
xmaximum=(x2-x1),
ymaximum=(y2-y1),
thumb=None,
thumb_shadow=None,
thumb_offset=0)
def nothing(self, name):
self.remaining_hotspots.discard(name)
def close(self):
ui.close()
+354
View File
@@ -0,0 +1,354 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('load_save')
renpy.load_module("_layout/imagemap_common")
# The ground image.
config.load_save_ground = { }
# The idle image.
config.load_save_idle = { }
# The hover image.
config.load_save_hover = { }
# The selected idle image.
config.load_save_selected_idle = { }
# The selected hover image.
config.load_save_selected_hover = { }
# The hotspots. Each hotspot is defined by a tuple giving:
# - The x-coordinate of the left side.
# - The y-coordinate of the top side.
# - The x-coordinate of the right side.
# - The y-coordinate of the bottoms side.
# - The name of the button or slider this is equivalent to.
config.load_save_hotspots = { }
# Define styles
style.file_picker_text = Style(style.large_button_text, help="text inside a file picker entry")
style.file_picker_empty_slot = Style(style.file_picker_text, help="text inside an empty file picker entry slot")
style.file_picker_text_window = Style(style.default, help="a window containing the file picker text.")
style.file_picker_ss_window = Style(style.default, help="a window containing the screenshot.")
# Should we disable thumbnails?
config.disable_thumbnails = False
# The default thumbnail to use when no file exists.
config.load_save_empty_thumbnail = None
# How we format time in a file entry.
config.time_format = "%b %d, %H:%M"
# How we format a file entry.
config.file_entry_format = "%(time)s\n%(save_name)s"
# True if we should prompt before loading a game.
_load_prompt = True
# This is used to store scratch data that's used by the
# library, but shouldn't be saved out as part of the savegame.
__scratch = object()
__scratch.file_picker_page = None
__scratch.initialized = False
__scratch.per_page = 0
__scratch.pages = 0
__scratch.has_autosave = False
__scratch.has_quicksave = False
def _render_savefile(ime, index, name, extra_info, screenshot, mtime, newest, clicked):
import time
(x1, y1, x2, y2) = ime.button(
"slot_%d" % index, clicked, newest,
keymap={ "save_delete" : ui.returns(("unlink", name)) })
ui.fixed(xpos=x1, ypos=y1, xmaximum=x2-x1, ymaximum=y2-y1)
if not config.disable_thumbnails:
ui.window(style=style.file_picker_ss_window[index])
ui.add(screenshot)
s = name + ". " + config.file_entry_format % dict(
time=time.strftime(config.time_format,
time.localtime(mtime)),
save_name=extra_info)
ui.window(style=style.file_picker_text_window[index])
ui.text(s, style=style.file_picker_text[index])
ui.close()
def _render_new_slot(ime, index, name, clicked):
(x1, y1, x2, y2) = ime.button("slot_%d" % index, clicked, False)
ui.fixed(xpos=x1, ypos=y1, xmaximum=x2-x1, ymaximum=y2-y1)
if not config.disable_thumbnails:
if config.load_save_empty_thumbnail:
ui.window(style=style.file_picker_ss_window[index])
ui.add(config.load_save_empty_thumbnail)
ui.window(style=style.file_picker_text_window[index])
ui.text(name + ". " + _(u"Empty Slot.") + "\n", style=style.file_picker_empty_slot[index])
ui.close()
# This function is given a page, and should map it to the names
# of the files on that page.
def _file_picker_page_files(page):
per_page = __scratch.per_page
rv = [ ]
if __scratch.has_autosave:
if page == 0:
for i in range(1, per_page + 1):
rv.append(("auto-" + str(i), _(u"a") + str(i), True))
return rv
else:
page -= 1
if __scratch.has_quicksave:
if page == 0:
for i in range(1, per_page + 1):
rv.append(("quick-" + str(i), _(u"q") + str(i), True))
return rv
else:
page -= 1
for i in range(per_page * page + 1, per_page * page + 1 + per_page):
rv.append(("%d" % i, "%d" % i, False))
return rv
# Given a filename, returns the page that filename is on.
def _file_picker_file_page(filename):
per_page = __scratch.per_page
base = 0
if __scratch.has_autosave:
if filename.startswith("auto-"):
return base
else:
base += 1
if __scratch.has_quicksave:
if filename.startswith("quick-"):
return base
else:
base += 1
try:
return base + int((int(filename) - 1) / per_page)
except:
return base
# Processes a screenshot.
def _file_picker_process_screenshot(s):
return s
# Initialize the scratch information.
def _file_picker_init():
hotspots = set()
if isinstance(config.load_save_hotspots, dict):
for d in config.load_save_hotspots.values():
for (x1, y1, x2, y2, name) in d:
hotspots.add(name)
else:
for (x1, y1, x2, y2, name) in config.load_save_hotspots:
hotspots.add(name)
__scratch.has_autosave = ("page_auto" in hotspots)
__scratch.has_quicksave = ("page_quick" in hotspots)
__scratch.per_page = 0
while ("slot_%d" % __scratch.per_page) in hotspots:
__scratch.per_page += 1
__scratch.pages = 1
while ("page_%d" % __scratch.pages) in hotspots:
__scratch.pages += 1
__scratch.pages -= 1
def _file_picker_pages():
rv = [ ]
if config.has_autosave:
rv.append("page_auto")
if config.has_quicksave:
rv.append("page_quick")
for i in range(1, __scratch.pages + 1):
rv.append("page_%d" % i)
return rv
# This displays a file picker that can chose a save file from
# the list of save files.
def _file_picker(screen, save):
if not __scratch.initialized:
__scratch.initialized = True
_file_picker_init()
# The number of slots in a page.
file_page_length = __scratch.per_page
update = True
while True:
if update:
update = False
saved_games = renpy.list_saved_games(regexp=r'(auto-|quick-)?[0-9]+')
newest = None
newest_mtime = None
save_info = { }
for fn, extra_info, screenshot, mtime in saved_games:
screenshot = _file_picker_process_screenshot(screenshot)
save_info[fn] = (extra_info, screenshot, mtime)
if not fn.startswith("auto-") and mtime > newest_mtime:
newest = fn
newest_mtime = mtime
# The index of the first entry in the page.
fpp = __scratch.file_picker_page
if fpp is None:
if newest:
fpp = _file_picker_file_page(newest)
else:
fpp = _file_picker_file_page("1")
if fpp < 0:
fpp = 0
__scratch.file_picker_page = fpp
ime = _ImageMapper(
screen,
config.load_save_ground,
config.load_save_idle,
config.load_save_hover,
config.load_save_selected_idle,
config.load_save_selected_hover,
config.load_save_hotspots,
variant=screen)
def tb(enabled, label, clicked, selected):
if not enabled:
return
ime.button(label, clicked, selected)
# Previous
tb(fpp > 0, 'previous', ui.returns(("fppdelta", -1)), selected=False)
# Quick Access
for i, name in enumerate(_file_picker_pages()):
tb(True, name, ui.returns(("fppset", i)), fpp == i)
# Next
tb(True, 'next', ui.returns(("fppdelta", +1)), False)
# This draws a single slot.
def entry(name, filename, offset, ro):
clicked = ui.returns(("return", filename))
if filename not in save_info:
if (not save) or ro:
clicked = None
_render_new_slot(ime, offset, name, clicked)
else:
if save and ro:
clicked = None
extra_info, screenshot, mtime = save_info[filename]
_render_savefile(ime,
offset,
name,
extra_info,
screenshot,
mtime,
newest == filename,
clicked)
for i, (filename, name, ro) in enumerate(_file_picker_page_files(fpp)):
entry(name, filename, i, ro)
ime.close()
result = ui.interact(mouse="gamemenu")
type, value = result
if type == "unlink":
if layout.yesno_prompt(screen, layout.DELETE_SAVE):
renpy.unlink_save(value)
update = True
if type == "return":
return value
if type == "fppdelta":
fpp += value
if type == "fppset":
fpp = value
label save_screen:
python hide:
while True:
fn = _file_picker("save", True)
if renpy.can_load(fn):
if not layout.yesno_prompt("save", layout.OVERWRITE_SAVE):
continue
renpy.save(fn, extra_info=store.save_name)
label load_screen:
python hide:
while True:
fn = _file_picker("load", False)
if _load_prompt:
if not layout.yesno_prompt("load", layout.LOADING):
continue
renpy.load(fn)
+80
View File
@@ -0,0 +1,80 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('main_menu')
renpy.load_module("_layout/imagemap_common")
# The ground image.
config.main_menu_ground = { }
# The selected/hover image.
config.main_menu_selected = { }
# The idle image.
config.main_menu_idle = { }
# The hotspots. Each hotspot is defined by a tuple giving:
# - The x-coordinate of the left side.
# - The y-coordinate of the top side.
# - The x-coordinate of the right side.
# - The y-coordinate of the bottoms side.
# - Either the (untranslated) name of the main menu button this hotspot
# is equivalent to, or, a label in the program to jump to when this
# hotspot is clicked.
config.main_menu_hotspots = { }
# This can be set from user code to define the main menu variant to use.
_main_menu_variant = None
label main_menu_screen:
python hide:
# Ignore right-click while at the main menu.
ui.keymap(game_menu=ui.returns(None))
# Show the background.
ui.window(style='mm_root')
ui.null()
ime = _ImageMapper(
None,
config.main_menu_ground,
config.main_menu_idle,
config.main_menu_selected,
config.main_menu_idle,
config.main_menu_selected,
config.main_menu_hotspots,
navigation=False,
variant=_main_menu_variant)
for e in config.main_menu:
if len(e) == 4:
name, act, enabled, shown = e
else:
name, act, enabled = e
shown = "True"
if not eval(shown):
ime.nothing(name)
if not eval(enabled):
act = None
if isinstance(act, basestring):
act = ui.jumpsoutofcontext(act)
ime.button(name, act, False)
for i in list(ime.remaining_hotspots):
ime.button(i, ui.jumpsoutofcontext(i), None)
ime.close()
ui.interact(mouse='mainmenu')
jump main_menu_screen
+85
View File
@@ -0,0 +1,85 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('navigation')
# The ground image.
config.navigation_ground = None
# The idle image.
config.navigation_idle = None
# The hover image.
config.navigation_hover = None
# The selected idle image.
config.navigation_selected_idle = None
# The selected hover image.
config.navigation_selected_hover = None
# The hotspots. Each hotspot is defined by a tuple giving:
# - The x-coordinate of the left side.
# - The y-coordinate of the top side.
# - The x-coordinate of the right side.
# - The y-coordinate of the bottoms side.
# - The name of the game menu button this is equivalent to.
config.navigation_hotspots = None
def _navigation(screen=None):
# Display the game menu background
ui.window(style=style.gm_root[screen])
ui.null()
if screen is None:
return
# A map from button name to game menu information.
gm = dict()
for e in config.game_menu:
screen_ = e[0]
name_ = e[1]
act = e[2]
enable = e[3]
gm[name_] = (screen_, act, enable)
ui.fixed(style='imagemap')
ui.image(config.navigation_ground)
for (x0, y0, x1, y1, name) in config.navigation_hotspots:
if name not in gm:
raise Exception("%r was used in a game menu hotspot, but isn't the name of a game menu button." % name)
screen_, act, enable = gm[name]
if not eval(enable):
continue
if screen_ == screen:
idle = config.navigation_selected_idle
hover = config.navigation_selected_hover
else:
idle = config.navigation_idle
hover = config.navigation_hover
ui.imagebutton(
LiveCrop((x0, y0, x1-x0, y1-y0), idle),
LiveCrop((x0, y0, x1-x0, y1-y0), hover),
clicked=act,
style='imagemap_button',
xpos=x0,
ypos=y0,
xanchor=0,
yanchor=0,
focus_mask=True,
)
ui.close()
layout.navigation = _navigation
+147
View File
@@ -0,0 +1,147 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('preferences')
renpy.load_module("_layout/imagemap_common")
# The ground image.
config.preferences_ground = None
# The idle image.
config.preferences_idle = None
# The hover image.
config.preferences_hover = None
# The selected idle image.
config.preferences_selected_idle = None
# The selected hover image.
config.preferences_selected_hover = None
# The hotspots. Each hotspot is defined by a tuple giving:
# - The x-coordinate of the left side.
# - The y-coordinate of the top side.
# - The x-coordinate of the right side.
# - The y-coordinate of the bottoms side.
# - The name of the button or slider this is equivalent to.
config.preferences_hotspots = None
config.sample_sound = None
config.sample_voice = None
config.always_has_joystick = False
def __set(base, field, value):
setattr(base, field, value)
return True
__curried_set = renpy.curry(__set)
def __show_preferences():
ime = _ImageMapper(
"preferences",
config.preferences_ground,
config.preferences_idle,
config.preferences_hover,
config.preferences_selected_idle,
config.preferences_selected_hover,
config.preferences_hotspots)
def pref(name, pref, value):
ime.button(
name,
__curried_set(_preferences, pref, value),
getattr(_preferences, pref) == value)
pref("Window", "fullscreen", False)
pref("Fullscreen", "fullscreen", True)
pref("All", "transitions", 2)
pref("Some", "transitions", 1)
pref("None", "transitions", 0)
pref("Seen Messages", "skip_unseen", False)
pref("All Messages", "skip_unseen", True)
if not main_menu:
ime.button("Begin Skipping", ui.jumps("_return_skipping"), False)
pref("Stop Skipping", "skip_after_choices", False)
pref("Keep Skipping", "skip_after_choices", True)
if renpy.display.joystick.enabled or config.always_has_joystick:
ime.button("Joystick", ui.jumps("joystick_preferences_screen"), False)
def play_sound():
renpy.music.play(config.sample_sound, channel="sound")
ime.button("Sound Test", play_sound, False)
def play_voice():
renpy.music.play(config.sample_sound, channel="voice")
ime.button("Voice Test", play_voice, False)
v = _preferences.text_cps
if v == 0:
v = 150
else:
v = v - 1
def set_text_cps(v):
if v == 150:
v = 0
else:
v = v + 1
_preferences.text_cps = v
ime.bar("Text Speed", 150, v, set_text_cps)
v = _preferences.afm_time
if v == 0:
v = 40
else:
v = v - 1
def set_afm_time(v):
if v == 40:
v = 0
else:
v = v + 1
_preferences.afm_time = v
ime.bar("Auto-Forward Time", 40, v, set_afm_time)
def set_music(v):
_preferences.set_volume('music', v / 128.0)
def set_sound(v):
_preferences.set_volume('sfx', v / 128.0)
def set_voice(v):
_preferences.set_volume('voice', v / 128.0)
if config.has_music:
ime.bar("Music Volume", 128, int(_preferences.get_volume('music') * 128), set_music)
if config.has_sound:
ime.bar("Sound Volume", 128, int(_preferences.get_volume('sfx') * 128), set_sound)
if config.has_voice:
ime.bar("Voice Volume", 128, int(_preferences.get_volume('voice') * 128), set_voice)
ime.close()
ui.interact(mouse="gamemenu")
label preferences_screen:
while True:
$ __show_preferences()
+53
View File
@@ -0,0 +1,53 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python hide:
layout.provides('yesno_prompt')
renpy.load_module("_layout/imagemap_common")
# Define styles
style.yesno_prompt = Style(style.prompt, help="a yes/no prompt")
style.yesno_prompt_text = Style(style.prompt_text, help="a yes/no prompt (text)")
# Define config variables.
config.yesno_prompt_ground = None
config.yesno_prompt_idle = None
config.yesno_prompt_hover = None
config.yesno_prompt_hotspots = None
config.yesno_prompt_message_images = { }
def yesno_prompt(screen, message):
renpy.transition(config.intra_transition)
ime = _ImageMapper(
screen,
config.yesno_prompt_ground,
config.yesno_prompt_idle,
config.yesno_prompt_hover,
config.yesno_prompt_idle,
config.yesno_prompt_hover,
config.yesno_prompt_hotspots)
ime.button("Yes", ui.returns(True), False)
ime.button("No", ui.returns(False), False)
ime.close()
default = config.yesno_prompt_message_images.get(layout.ARE_YOU_SURE, None)
message_image = config.yesno_prompt_message_images.get(message, default)
if message_image:
ui.add(message_image)
else:
layout.prompt(message, "yesno")
rv = ui.interact(mouse="gamemenu")
renpy.transition(config.intra_transition)
return rv
layout.yesno_prompt = yesno_prompt
@@ -0,0 +1,71 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('preferences')
# Load the common code.
renpy.load_module("_layout/classic_preferences_common")
# Create styles.
style.prefs_column = Style(style.vbox, help="the single preferences column")
style.prefs_frame.set_parent(style.menu_frame)
style.prefs_pref_frame.set_parent(style.default)
# Adjust styles.
style.prefs_frame_box.box_layout = 'vertical'
style.prefs_frame.xalign = 0.0
style.prefs_frame.ypos = 10
style.prefs_frame.xmargin = 10
style.prefs_slider.xmaximum = 200
style.prefs_slider.xalign = 1.0
style.prefs_volume_slider.xmaximum = 200
style.prefs_volume_slider.xalign = 1.0
style.prefs_volume_box.xalign = 1.0
style.prefs_volume_box.box_layout = 'horizontal'
style.prefs_pref_box.xfill = True
style.prefs_pref_box.box_layout = 'horizontal'
style.prefs_pref_choicebox.box_layout = 'horizontal'
style.prefs_pref_choicebox.xalign = 1.0
style.prefs_jump.xfill = True
style.prefs_column.box_spacing = 5
style.soundtest_button.xalign = 1.0
style.prefs_jump_button.xalign = 1.0
config.translations["Fullscreen 16:9"] = "16:9"
config.translations["Fullscreen 16:10"] = "16:10"
config.soundtest_before_volume = True
# Place preferences into groups.
config.preferences['prefs_column'] = [
config.all_preferences[u'Display'],
config.all_preferences[u'Transitions'],
config.all_preferences[u'Skip'],
config.all_preferences[u'Begin Skipping'],
config.all_preferences[u'After Choices'],
config.all_preferences[u'Text Speed'],
config.all_preferences[u'Auto-Forward Time'],
config.all_preferences[u'Music Volume'],
config.all_preferences[u'Sound Volume'],
config.all_preferences[u'Voice Volume'],
config.all_preferences[u'Joystick...'],
]
label preferences_screen:
$ _prefs_screen_run(config.preferences)
jump preferences_screen
@@ -0,0 +1,16 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('joystick_preferences')
label joystick_preferences_screen:
$ renpy.show_screen('joystick_preferences')
$ ui.interact()
jump _noisy_return
+19
View File
@@ -0,0 +1,19 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('load_save')
label load_screen:
$ renpy.show_screen('load')
$ ui.interact()
jump _noisy_return
label save_screen:
$ renpy.show_screen('save')
$ ui.interact()
jump _noisy_return
+14
View File
@@ -0,0 +1,14 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('main_menu')
label main_menu_screen:
$ renpy.show_screen("main_menu")
$ ui.interact()
return
+16
View File
@@ -0,0 +1,16 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('preferences')
label preferences_screen:
$ renpy.show_screen('preferences')
$ ui.interact()
jump _noisy_return
+12
View File
@@ -0,0 +1,12 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python hide:
layout.provides('yesno_prompt')
def yesno_prompt(screen, message):
rv = renpy.call_screen('yesno_prompt', message=message, yes_action=Return(True), no_action=Return(False))
return rv
layout.yesno_prompt = yesno_prompt
+229
View File
@@ -0,0 +1,229 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('load_save')
# Store some global information that won't be saved.
__session = object()
__session.scrollbar_position = None
# Should we prompt to load?
_load_prompt = True
# The number of normal save slots.
config.load_save_slots = 50
# The number of autosave slots.
config.load_save_auto_slots = 5
# The number of quicksave slots.
config.load_save_quick_slots = 5
# How we format time in a file entry.
config.time_format = "%b %d, %H:%M"
# How we format a file entry.
config.file_entry_format = "%(time)s\n%(save_name)s"
# Set the default size of thumbnails.
config.thumbnail_width = 320
config.thumbnail_height = 240
# The default empty slot thumbnail.
config.load_save_empty_thumbnail = None
# Styles.
style.file_picker_frame = Style(style.frame, help="frame containing the file picker")
style.file_picker_side = Style(style.default, help="ui.side containing the file picker and the scrollbars")
style.file_picker_viewport = Style(style.viewport, help="viewport containing the file picker entries")
style.file_picker_box = Style(style.vbox, help="box containing the file picker entries")
style.file_picker_entry = Style(style.large_button, help="the buttons containing information about each file")
style.file_picker_text = Style(style.large_button_text, help="the text inside a file picker entry.")
style.file_picker_scrollbar = Style(style.vscrollbar, help="the text inside a file picker entry.")
style.thumbnail_frame = Style(style.frame, help="the style of the frame containing a thumbnail")
# Position things correctly.
style.file_picker_frame.xmaximum = 0.5
style.file_picker_frame.xmargin = 6
style.file_picker_frame.ymargin = 6
style.file_picker_frame.yfill = True
style.file_picker_entry.xfill = True
style.file_picker_entry.yminimum = 58
style.thumbnail_frame.ymargin = 6
style.thumbnail_frame.xpos = 0.75
style.thumbnail_frame.xanchor = 0.5
def _file_picker_thumbnail(st, at):
if __session.thumbnail:
rv = __session.thumbnail
elif config.load_save_empty_thumbnail:
rv = config.load_save_empty_thumbnail
else:
rv = Null(width=config.thumbnail_width, height=config.thumbnail_height)
return rv, None
def _file_picker(screen):
while True:
@renpy.curry
def hovered(thumbnail):
if __session.thumbnail is not thumbnail:
__session.thumbnail = thumbnail
renpy.restart_interaction()
@renpy.curry
def unhovered(thumbnail):
if __session.thumbnail is thumbnail:
__session.thumbnail = None
renpy.restart_interaction()
__session.thumbnail = None
layout.navigation(screen)
newest = None
newest_time = None
info = { }
for name, extra_info, thumbnail, time in renpy.list_saved_games():
info[name] = (extra_info, thumbnail, time)
if not name[0] in "0123456789":
continue
if time > newest_time:
newest = name
newest_time = time
slots = [ ]
for i in range(1, config.load_save_slots + 1):
slots.append((str(i), str(i)))
if config.has_quicksave:
for i in range(1, config.load_save_quick_slots + 1):
slots.append(('quick-'+ str(i), _(u'q') + str(i)))
if config.has_autosave:
for i in range(1, config.load_save_auto_slots + 1):
slots.append(('auto-' + str(i), _(u'a') + str(i)))
ui.frame(style=style.file_picker_frame)
ui.side(['c', 'r'], style=style.file_picker_side)
if __session.scrollbar_position is None:
if newest is None:
yoffset = 0
else:
yoffset = 1.0 * (int(newest) - 1) / len(slots)
value = 0
else:
value = __session.scrollbar_position
yoffset = None
adj = ui.adjustment(value=value)
ui.viewport(yadjustment=adj, offsets=(0, yoffset), style=style.file_picker_viewport, mousewheel=True)
ui.vbox(style=style.file_picker_box, focus=renpy.time.time())
for i, (fn, n) in enumerate(slots):
clicked = ui.returns(("select", fn))
if screen == "save" and fn.startswith("auto-"):
clicked = None
if screen == "load" and fn not in info:
clicked = None
if fn in info:
extra_info, thumbnail, time = info[fn]
ui.button(style=style.file_picker_entry[i],
clicked=clicked,
hovered=hovered(thumbnail),
unhovered=unhovered(thumbnail),
role = "selected_" if (fn == newest) else "",
keymap = { "save_delete" : ui.returns(("unlink", fn)) },
)
s = config.file_entry_format % dict(
time=renpy.time.strftime(
config.time_format,
renpy.time.localtime(time)),
save_name=extra_info)
ui.text(n + ". " + s, style=style.file_picker_text[i])
else:
ui.button(style=style.file_picker_entry[i],
clicked=clicked,
role = "selected_" if (fn == newest) else "")
ui.text(n + ". " + _(u"Empty Slot."),
style=style.file_picker_text[i])
ui.close() # vbox/viewport
ui.bar(adjustment=adj, style=style.file_picker_scrollbar)
ui.close() # side/window
# Thumbnail.
ui.frame(style=style.thumbnail_frame)
ui.add(DynamicDisplayable(_file_picker_thumbnail))
try:
action, arg = ui.interact(mouse="gamemenu")
finally:
__session.scrollbar_position = adj.value
__session.thumbnail = None
if action == "select":
return arg
elif action == "unlink":
if layout.yesno_prompt("save", layout.DELETE_SAVE):
renpy.unlink_save(arg)
label save_screen:
python hide:
while True:
fn = _file_picker("save")
if renpy.can_load(fn):
if not layout.yesno_prompt("save", layout.OVERWRITE_SAVE):
continue
renpy.save(fn, extra_info=store.save_name)
label load_screen:
python hide:
while True:
fn = _file_picker("load")
if _load_prompt:
if not layout.yesno_prompt("load", layout.LOADING):
continue
renpy.load(fn)
@@ -0,0 +1,81 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
layout.provides('preferences')
# Load the common code.
renpy.load_module("_layout/classic_preferences_common")
# Create styles.
style.prefs_column = Style(style.vbox, help="columns of preferences")
style.prefs_left = Style(style.prefs_column, help="the left preference column")
style.prefs_right = Style(style.prefs_column, help="the right preference column")
style.prefs_left.xmaximum = 520
style.prefs_right.xmaximum = 250
style.prefs_left.xpos = 271
style.prefs_left.xanchor = 0.5
style.prefs_left.ypos = 10
style.prefs_right.xpos = 667
style.prefs_right.xanchor = 0.5
style.prefs_right.ypos = 10
style.prefs_slider.xmaximum = 400
style.prefs_slider.xalign = 1.0
style.prefs_volume_slider.xmaximum = 200
style.prefs_volume_slider.xalign = 1.0
style.prefs_pref_box.xfill = True
style.prefs_pref_choicebox.box_layout = 'horizontal'
style.prefs_pref_choicebox.xalign = 1.0
style.prefs_volume_box.xalign = 1.0
style.prefs_jump.xfill = True
style.prefs_column.box_spacing = 5
style.prefs_button.set_parent(style.small_button)
style.prefs_button_text.set_parent(style.small_button_text)
style.soundtest_button.xalign = 1.0
style.prefs_jump_button.xalign = 1.0
config.sample_voice = "18005551212.ogg"
config.translations["Fullscreen 16:9"] = "16:9"
config.translations["Fullscreen 16:10"] = "16:10"
# Place preferences into groups.
config.preferences['prefs_left'] = [
config.all_preferences[u'Display'],
config.all_preferences[u'Transitions'],
config.all_preferences[u'Skip'],
config.all_preferences[u'Begin Skipping'],
config.all_preferences[u'After Choices'],
config.all_preferences[u'Text Speed'],
config.all_preferences[u'Auto-Forward Time'],
]
config.preferences['prefs_right'] = [
config.all_preferences[u'Music Volume'],
config.all_preferences[u'Sound Volume'],
config.all_preferences[u'Voice Volume'],
config.all_preferences[u'Joystick...'],
]
label preferences_screen:
$ _prefs_screen_run(config.preferences)
jump preferences_screen
Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 386 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 867 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 391 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 529 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 325 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 358 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 656 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 789 B

Some files were not shown because too many files have changed in this diff Show More