Compare commits

...

1092 Commits

Author SHA1 Message Date
Tom Rothamel c12adecf9f Bump versions. 2013-06-26 08:05:53 -04:00
Tom Rothamel fc6013c5de Use the correct shader program for imageblends. 2013-06-26 07:57:29 -04:00
Tom Rothamel 3dd9f07fe2 Add changelog. 2013-06-26 07:53:04 -04:00
Tom Rothamel 5308fdd0b8 Skip sets proper values for config.skipping.
This:

* Displays the skip indicator.
* Allows for fast (to-next-menu) skipping.
* Fixes #97.
2013-06-24 22:37:49 -04:00
Tom Rothamel 273d1e296c Apply drag-drop fix. (Thank you, Kinsman.)
Fixes #99.
2013-06-24 22:24:10 -04:00
Tom Rothamel 152af7dc7b Changes to improve compatibility with very old Ren'Py games.
These were required to get the Ren'Py 5.0 demo to run. (You'll need
to create a script_version.rpy file set to (5, 0, 0) to get things
actually working.)
2013-06-20 17:58:15 -04:00
Tom Rothamel 43b34f22a3 Bump version. 2013-06-17 20:22:49 -04:00
Tom Rothamel 3330b451d0 Build on android-8. 2013-06-17 20:22:38 -04:00
Tom Rothamel 5290296952 Print the android savedir to stdout/logcat.
I just have the feeling this will come in handy one day.
2013-06-17 01:58:14 -04:00
Tom Rothamel 8fc784aef5 Place logs and traceback.txt into renpy.config.logdir.
On android, this is always placed on external storage, so we can
get to it.
2013-06-17 01:51:19 -04:00
Tom Rothamel 110c8b890b Change the search path for saves on android.
We look in:

* The public directory used by very old RAPT versions.
* The private directory used by newer RAPT versions.
* The getExternalFilesDir directory, used by the newest RAPT versions.

This means that saves will now be placed in a public place, so they
can be copied and otherwise shared.
2013-06-17 01:36:27 -04:00
Tom Rothamel b6c686d770 Do not looks for assets on the android filesystem.
In recent RAPTs we won't put anything there. What's worse, older games
might have left files there, which will interfere with our newer
code.
2013-06-17 00:07:54 -04:00
Tom Rothamel 6358db88ff Never invoke the editor on android. 2013-06-17 00:07:44 -04:00
Tom Rothamel b2611fd613 Use different shaders for clipping and no-clipping cases.
The clipping support in the shaders causes a noticable performance
hit on Android, and is rarely used. This fixes that in the common
case.
2013-06-16 22:25:46 -04:00
Tom Rothamel 5eb3af0188 Update android packaging docs to match the new RAPT. 2013-06-10 01:45:13 -04:00
Tom Rothamel ad71c17f77 Prevent import recursion that took place if utf-8 was not imported
before the Ren'Py loader was initialized.

This actually happend on Android.
2013-06-10 01:36:52 -04:00
Tom Rothamel 0d7dec8e4e Merge pull request #109 from JaHIY/master
add a variable set the minimum number of component in automatic_images
2013-06-07 20:26:29 -07:00
Tom Rothamel 112fbbfc08 Return the correct value from renpy.call_in_new_context. 2013-06-07 23:02:15 -04:00
JaHIY 4ee5240c72 change config.automatic_images_minimum_component to
config.automatic_images_minimum_components
2013-06-07 22:29:34 +08:00
JaHIY 025e359394 Now developers can set the minimum number of component 2013-06-07 20:04:31 +08:00
Tom Rothamel 143bcfad08 Enable minimize and quit shortcuts in the launcher. 2013-06-05 10:11:27 -04:00
Tom Rothamel a39ebd13e0 Check in the changelog. 2013-06-04 23:43:42 -04:00
Tom Rothamel e7c0a5f19f Check in problems.rst. 2013-06-03 23:26:46 -04:00
Tom Rothamel f0b03dc426 Add the Flatten displayable to Ren'Py. 2013-06-03 23:24:53 -04:00
Tom Rothamel 3d2ad79b6b Document additive blending. 2013-06-03 23:04:13 -04:00
Tom Rothamel 9f28a93c56 Deal with r.over in the sprite manager. 2013-06-03 23:00:25 -04:00
Tom Rothamel 386dd1d799 Deal (improperly) with additive blending in the software renderer.
When additive blending is 1.0, the software renderer will not
display an image. This is probably preferable to the image
displaying incorrectly, since they're likely to be effect
images.
2013-06-03 22:55:28 -04:00
Tom Rothamel e85ebf3a50 Add additive blending to Transform. 2013-06-03 22:30:05 -04:00
Tom Rothamel 81eb2e6f42 Additive blending in the GL renderer.
This commit adds in the backend support, for varying the additive
blending factor.

Additive blending will not be added to the (mostly obsolete) software
renderer. Instead, added a way to test if the current renderer
supports additive blending.
2013-06-03 22:11:29 -04:00
Tom Rothamel 9d021a2ec1 Bump version to 6.15.5. 2013-06-02 23:32:06 -04:00
Tom Rothamel 439fac65e2 Remove assert statements.
Thes won't run when optimization is enabled, which is the default
for Ren'Py. It's better to eliminate them entirely, so we have
the same configuration in testing and production.
2013-06-02 20:46:19 -04:00
Tom Rothamel dee484a16b Error message fix. 2013-06-02 16:57:16 -04:00
Tom Rothamel 90457d6f20 Fix translation problem.
Returned the wrong value when we used RENPY_UPDATE_STRINGS
to translate a string with a {#translation_comment} in it.
2013-06-02 13:42:16 -04:00
Tom Rothamel 245c30d7a7 Force font autohinting.
This was the behavior of of Ren'Py until switching to Freetype 2.4. The
autohinter more resembles the older Ren'Pys, seems to produce better
forms on most fonts, and fixes spacing issues on broken fonts.
2013-05-27 23:39:07 -04:00
Tom Rothamel 81b28293ca Allow * in classification patterns to match directories as well as
files.

Fixes #106.
2013-05-26 00:10:08 -04:00
Tom Rothamel 392f71b214 Use secure permissions in zip and tar files.
Previously, we used 666 and 777, and expected the user's umask to take
care of adjusting the permissions. Unfortunately, info-zip overrides
the umask, writing world-writable files to disk.

Thanks to Spiky Caterpillar for the bug and the fix.
2013-05-23 00:37:26 -04:00
Tom Rothamel 257a5281ed Make use of avresample optional.
This lets us compile on platforms that do not support it, using
the old audio_resample code.
2013-05-21 00:25:09 -04:00
Tom Rothamel d44f70a145 Revert "Update ffdecode.c to work with newer libav."
This reverts commit 1ffd4f97fc.
2013-05-21 00:00:45 -04:00
Tom Rothamel ec9198f25d Fix one more deprecation with newer libav. 2013-05-20 23:54:37 -04:00
Tom Rothamel 1ffd4f97fc Update ffdecode.c to work with newer libav.
This gets rid of deprecation warnings when building ffdecode.c, and
adds a dependency on the avsample library.
2013-05-20 23:28:14 -04:00
Tom Rothamel e8968252ab Skip whitespace before default parameters and arguments.
Fixes #101.
2013-05-06 22:58:34 -04:00
Tom Rothamel ae618ddd76 Allow the creator to cancel out of create file and generate translation.
Fixes #100.
2013-05-04 12:24:30 -04:00
Tom Rothamel 005aa1a64c Read assets from an expansion file if one is available on Android. 2013-04-14 22:51:55 -04:00
Tom Rothamel a63231d36f Merge branch 'master' into android 2013-04-13 23:06:26 -04:00
Tom Rothamel db530f7def Document config.start_callbacks. 2013-04-07 20:00:47 -04:00
Tom Rothamel 627261f51d Clarify what the Ren'Py license applies to. 2013-04-07 19:43:58 -04:00
Tom Rothamel d080b71f29 Make exclude_empty_directories deal with non-terminal directories. 2013-04-07 11:13:00 -04:00
Tom Rothamel 0a62195625 Update changelog, document problems. 2013-04-06 23:11:51 -04:00
Tom Rothamel 571bb43459 Bump version to 6.15.4. 2013-04-06 23:00:10 -04:00
Tom Rothamel 817b9d5c9f Fix race condition in the updater.
If the update finished while we were checking progress, zsync
wouldn't rename the file and the update would fail.
2013-04-06 22:55:30 -04:00
Tom Rothamel 6f3fa9bf8d Make loads after rollback non-greedy.
A greedy load after rollback can roll-back through with statements,
which are turned into with None statements until the start of the
next interaction. (Which is sensible behavior for the rollback
case, but fails when an after_load transition is scheduled.)

Fixes #95.
2013-04-06 21:13:47 -04:00
Tom Rothamel 2de5a7d9f7 Add build.exclude_empty_directories variable. 2013-04-06 20:58:10 -04:00
Tom Rothamel d26f1a65e8 Add the ability to include empty directories to the zip format.
Per http://lemmasoft.renai.us/forums/viewtopic.php?f=32&t=2023
2013-04-06 18:31:59 -04:00
Tom Rothamel 667c2e59d3 Do not set the window size while entering/leaving fullscreen mode. 2013-04-06 17:52:12 -04:00
Tom Rothamel b4411a027f Fix documentation issues.
Fixes #89.
2013-04-06 13:53:20 -04:00
Tom Rothamel 142831ec44 Remove duplicated docs.
Fixes #90.
2013-04-06 13:19:48 -04:00
Tom Rothamel 2dd58759de Remove extraneous debug print. 2013-04-04 19:06:55 -04:00
Tom Rothamel 866f3a11b2 Use nogil_copy to copy surfaces.
Previously, we used the angle copy function to copy surfaces, which
used the pygame blit function. The pygame blit function was more
complex and held the GIL while blitting, and led to slowdowns in
loading.

Nogil_copy appears to be safe for Ren'Py, which doesn't use software
surfaces.
2013-04-04 12:13:56 -04:00
Tom Rothamel 8a2d779320 Spend less time with the image cache locked.
The image cache is no longer locked for expensive operations,
such as image loads. While this may cause us to load an image
twice (in rare circumstances), it also lets us preload images
without blocking loads frome the main thread.
2013-04-04 03:22:36 -04:00
Tom Rothamel 2ef8cd4c3f Remove obsolete renpy_font module. 2013-04-02 23:42:21 -04:00
Tom Rothamel 88ec1e66e6 Use rwobject.c that's included in pygame, rather than building
our own.
2013-04-02 23:40:32 -04:00
Tom Rothamel f6bfeefc8e Merge branch 'master' into android 2013-04-02 20:05:55 -04:00
Tom Rothamel bbdf9023fe Check in tkaskdir. 2013-04-02 20:05:34 -04:00
Tom Rothamel b0070122f8 Merge branch 'master' into android 2013-03-31 21:42:49 -04:00
Tom Rothamel ad51bfb30f Kick off preload thread at the start of image prediction, rather
than the end of an interaction.

Kicking it off at the end of the interaction lead to bad behavior
where the start of the next interaction would fight with the
preload thread for the image cache lock.
2013-03-31 17:56:16 -04:00
Tom Rothamel d15ae51825 New add.py script that combines the old add.sh and tag.py scripts,
and also does the dl symlinking.
2013-03-30 12:51:03 -04:00
Tom Rothamel 2efa265983 Bump version. 2013-03-30 11:50:21 -04:00
Tom Rothamel cc6513c93a Paranoia regarding cases where Transform.event is called before
Transform.render.

Closes #87.
2013-03-29 23:40:41 -04:00
Tom Rothamel a81865484c Ensure that we render displayables before passing events to them,
even if video is playing.
2013-03-29 23:34:11 -04:00
Tom Rothamel d70eb13cb0 Wait until a frame is available before drawing the screen while
displaying full-screen video.

Fixes #85.
2013-03-29 23:18:00 -04:00
Tom Rothamel 4b5d94eeb9 Re-offset a viewport if its size changes before the first event has
been processed.

This is necessary to deal with the way a size may offer the viewport
a smaller area than initially necessary, once scrollbars take up
some space.

Fixes #88.
2013-03-29 20:32:51 -04:00
Tom Rothamel 5674a4ddac Produce an error when dealing with logical lines longer than 64K
characters in size.

Line parsing can be N**2, so this turns a really slow error into one
that takes a reasonable amount of time.
2013-03-29 00:28:13 -04:00
Tom Rothamel 5bb6483ab4 When a page is given specified to FileSave, use it to determine
if the action should be sensitive.

This was preventing QuickSave from working when the default file page
was set to auto.

Fixes #82.
2013-03-29 00:15:14 -04:00
Tom Rothamel f62e4b6eb7 Add more protection to pygame.event.post statements.
Fixes #86.
2013-03-28 23:46:30 -04:00
Tom Rothamel c54a613393 Bars only run hover and unhover actions once. 2013-03-28 22:57:12 -04:00
Tom Rothamel 2c4be00267 Ensure image fonts include U+200B, since we need that for
input to work.
2013-03-27 21:04:29 -04:00
Tom Rothamel 0b8c22e0d8 Sort SpriteManager sprites by their zorder.
Thanks to Kinsman for the fix.
2013-03-27 10:11:45 -04:00
Tom Rothamel 65a7dca95f Fix random segfaulting related to TTF lookup tables, especially on shift+R.
The segfaulting occured when a TTF Font contains a GSUB table with a
Lookup type other than one. This caused us to initialize a data
structure that represents the lookup table, but never fill it in.

Rarely, one of these tables would hava field initalized to 1 or 2. In
that case, we'd try to free associated data that was never properly
initialized, and we'd crash.

The fix was to intialize the data structures before use.
2013-03-27 00:06:48 -04:00
Tom Rothamel fdcfaface0 Do inexpensive prediction while displaying frames.
This involved breaking the prediction coroutine, and the context
prediction routine up further. By predicting one statement at a time,
we can interleve predicitions with frame display, and prevent
dissolves or ATL transforms from starving the image predictor, at
least in simple (non-screen) cases.
2013-03-26 00:58:33 -04:00
Tom Rothamel 5f08884b52 Predict images used in ATL transforms that are part of show/scene
statements.
2013-03-25 23:36:46 -04:00
Tom Rothamel 3595eee11c Prevent memory leaks via the rollback log.
Before this change, code that created and then immediately modified a
list, dict, set, or object that was rollback-able would cause a small
memory leak until the end of the interaction.
2013-03-24 23:51:13 -04:00
Tom Rothamel b33eb54c34 Bound the layout cache size.
This helps ensure that code that creates many text objects in a
single interaction will now consume unbounded memory if it lets
those Text objects be GCed.
2013-03-24 23:49:02 -04:00
Tom Rothamel c86fc743bc Change memory profile to show the differen between the number of
objects at each call.
2013-03-24 23:48:39 -04:00
Tom Rothamel 10b82603b9 Do not translate the who-prefix or who-suffix if new-style
subsititutions are disabled.
2013-03-23 20:13:04 -04:00
Tom Rothamel 1a1ae36299 Quit the display when doing a forced resize (like when clicking the
Window preference.)

This prevents the possibility of spurious resize events, and also
prevents the black bars from appearing on the screen after such
a resize.
2013-03-20 23:26:36 -04:00
Tom Rothamel cc004c00f0 Merge branch 'master' into android 2013-03-19 23:30:51 -04:00
Tom Rothamel cda96afd14 Ensure an over-full video queue can't starve the audio queue,
and vice-versa.
2013-03-19 00:04:18 -04:00
Tom Rothamel 966630ea16 Write .zip files out in large chunks.
Previously, we would load entire files into RAM, compress the entire
file, and write out the compressed data. This was breaking down on
large .rpas, hence the change.
2013-03-17 18:42:19 -04:00
Tom Rothamel 8c746bdccc Work around fonts that don't have the ZWSP (U+200b) character.
We use ZWSP in input so we properly size an empty line. Some fonts
do not include this character, and replace it with an undefined
character glyph (often a square).

This fix prevents Ren'Py from rendering the ZWSP, making the
problem invisible to the user.
2013-03-16 22:49:34 -04:00
Tom Rothamel 4fac7da3bb Start work on documenting the python statements. 2013-03-10 23:32:44 -04:00
Tom Rothamel 4045958cd2 Bump version. 2013-03-09 23:11:51 -05:00
Tom Rothamel 45155a9ff4 Use python+tkinter to prompt for the projects directory.
Fixes #77.
2013-03-09 23:02:21 -05:00
Tom Rothamel 83ad789654 Improve OpenGL ES2 support. 2013-03-08 23:44:10 -05:00
Tom Rothamel 21eaa5ee9c Merge branch 'master' into android 2013-03-08 21:31:50 -05:00
Tom Rothamel 69bcd84d5d Fix doc typos.
Thanks, Koichi.
2013-03-08 00:57:07 -05:00
Tom Rothamel 7357fa4c5b Allow the music room to loop tracks, rather than advancing them. 2013-03-07 11:38:32 -05:00
Tom Rothamel d51c768112 Document renpy.input. 2013-03-06 22:44:28 -05:00
Tom Rothamel 32ae4fef3a Bump version. 2013-03-04 10:09:20 -05:00
Tom Rothamel fd5ee77f1c Force use of shaders on android.
The auto-detect code fails on ES.
2013-03-04 01:15:56 -05:00
Tom Rothamel b9acbfccd7 Changes required to support android.
The new android support uses GL2, so we need to change some defines
to use it.
2013-03-04 00:00:08 -05:00
Tom Rothamel d05059e64d Stop ongoing transitions when we enter a new context.
A minor performance improvement, which also prevents the side-effects
of the new code being surrounded by old transitions.
2013-03-03 01:08:10 -05:00
Tom Rothamel bc80e38bb5 Change how we compensate for times in a restarted move transition.
The previous method was causing problems where when we created
a new screen under a transition, the new screen would get the
wrong creation time.
2013-03-03 00:48:29 -05:00
Tom Rothamel 838233a68f Doc fix. 2013-03-02 21:27:35 -05:00
Tom Rothamel 6968d973a6 Fix compatibility between OldMoveTransition and define.move_transitions.
Fixes #74.
2013-03-02 12:28:53 -05:00
Tom Rothamel 199f6aa70c Include the language as part of a rollback copy.
This prevents us from running the language change code whenever we
do a rollback when a non-default language is enabled.

Fixes #73.
2013-02-28 22:30:29 -05:00
Tom Rothamel b7e33bb2b9 Documentation fix. 2013-02-28 00:01:44 -05:00
Tom Rothamel d2d777be0c Doc fix. 2013-02-27 23:59:49 -05:00
Tom Rothamel 4c924b4971 Documentation fix. 2013-02-27 23:55:41 -05:00
Tom Rothamel ddd4a1a4ea Fix mistake. 2013-02-27 23:54:57 -05:00
Tom Rothamel c68f240061 Fix more launch options. 2013-02-25 09:42:49 -05:00
Tom Rothamel 5d9d4955ff Allow symlinks to renpy.py. 2013-02-25 09:26:35 -05:00
Tom Rothamel fb4eeaaaeb Update sphinx docs. 2013-02-24 22:51:49 -05:00
Tom Rothamel a0b04c2d99 Allow ffdecode.c to compile with ffmpeg.
Patch thanks to Maks Verver.
2013-02-24 22:32:28 -05:00
Tom Rothamel 86b38b5e40 Add load and save commands to the console. 2013-02-23 22:04:14 -05:00
Tom Rothamel 2e6ff091e2 Implement config.console_callback. 2013-02-23 21:42:36 -05:00
Tom Rothamel e91972589c Change the console activation key to shift+O only.
The backtick key invokes IMEs, which can confuse Ren'Py.
2013-02-23 21:26:05 -05:00
Tom Rothamel eb5a8b8beb Fix translation documentation problems reported by Koichi. 2013-02-22 23:55:15 -05:00
Tom Rothamel e1320c4661 Restart interaction on FieldValue change. Add VariableValue. 2013-02-21 23:57:05 -05:00
Tom Rothamel 2db0d397a6 Add a README that shows up on github. 2013-02-21 23:05:30 -05:00
Tom Rothamel 7f85af9c54 The after checkout script can now copy the files necessary to run
Ren'Py from a built Ren'Py.
2013-02-21 22:23:45 -05:00
Tom Rothamel 3a981be8c6 Delete obsolete scripts. 2013-02-21 21:01:18 -05:00
Tom Rothamel 95b51dae6f Style _default for the Japanese translation. 2013-02-20 23:01:59 -05:00
Tom Rothamel 9eef533e8a Edit all no longer opens TL files. 2013-02-20 22:43:05 -05:00
Tom Rothamel 8e4930d031 Run python with -E flag.
This ignores a PYTHONPATH the user has lying around for some other reason.
2013-02-20 22:40:31 -05:00
Tom Rothamel e398518bd1 Do not modify the meta path on shift+R. 2013-02-19 23:54:32 -05:00
Tom Rothamel 48bdab0ed5 Don't use non-existent field in console. 2013-02-19 23:50:28 -05:00
Tom Rothamel ab122f92ad Allow the user to type { and } at the console. 2013-02-19 23:40:43 -05:00
Tom Rothamel ef0b374959 Fix space quoting in renpy.sh. 2013-02-19 22:29:36 -05:00
Tom Rothamel dbfc04afc4 If pythonw doesn't exist, launch with sys.executable. 2013-02-18 23:00:51 -05:00
Koichi Akabe 7d6687f46f update Japanese translation 2013-02-18 22:35:20 -05:00
Tom Rothamel f8483ec22e Add shift+O as a way of invoking the console. 2013-02-18 22:01:23 -05:00
Tom Rothamel 0b690bbe43 Add the __ function, which immediately translates a string. 2013-02-18 21:25:45 -05:00
Tom Rothamel 871aa08f41 Ensure that _restart is set, even if we restart at the main menu. 2013-02-18 21:07:03 -05:00
Tom Rothamel e2c2e2e841 Defer the import of pygame.macosx.
This seems necessary to get it to import on OS X 10.6.8.
2013-02-18 19:32:19 -05:00
Tom Rothamel ba9dfa8f4c Make the translation code unicode-safe.
Also, put a TODO before each translation.
2013-02-17 22:11:13 -05:00
Tom Rothamel cad5b436e5 Doc update. 2013-02-17 18:55:11 -05:00
Tom Rothamel 312fdcea96 Remove Ren'Py 7 mention from tutorial; add edgescroll demo. 2013-02-17 17:51:10 -05:00
Tom Rothamel 518a969aab Fix bug in edgescroll that prevented scrolling from happening while the mouse was being moved. 2013-02-17 17:50:47 -05:00
Tom Rothamel e6687bd7b8 Run zsync in the update directory.
At least on mac, it seems to want to write files to the current
directory. By default that's the root directory, and hence
problematic.
2013-02-17 14:24:51 -05:00
Tom Rothamel 74260589f4 Do not package debug output. 2013-02-17 13:51:23 -05:00
Tom Rothamel aefd6e6a9e Tweak mac and windows /lib build patterns. 2013-02-17 11:44:50 -05:00
Tom Rothamel 58e60ee148 Fix editra build rules. 2013-02-17 01:28:49 -05:00
Tom Rothamel fdc2b21e0b When the RSA module is missing, do not offer an update. 2013-02-17 00:20:19 -05:00
Tom Rothamel 9d6c15e10b Send stdout and stderr to null when we don't have stdout or stderr.
This is the case when running on windows under pythonw (the default).
2013-02-16 22:48:27 -05:00
Tom Rothamel f271d3890b Use python.exe to launch projects on windows. 2013-02-16 21:11:07 -05:00
Tom Rothamel 69a4a29014 Remove obsolete windows build files. 2013-02-16 12:39:30 -05:00
Tom Rothamel f72771c026 Write lint.txt in ascii mode, so the files we produce can be read
on windows.
2013-02-15 21:47:10 -05:00
Tom Rothamel d2e05c481f Change how we define eruby_ja.
This lets it be linted properly.
2013-02-15 21:42:53 -05:00
Tom Rothamel f999cfc2c7 Translate the date format string into Japanese. 2013-02-15 01:02:20 -05:00
Tom Rothamel 6c7812b8a4 Remove locale support.
It didn't work on windows, since windows locales work using the ANSI
code page, and there's no way to get them to use UTF-8 or unicode.
(Also, having multiple locale names is asking for problems.)
2013-02-15 00:55:06 -05:00
Tom Rothamel b841358e22 Merge branch 'fix-error-ruby-ja' of https://github.com/vbkaisetsu/renpy into devel 2013-02-15 00:28:51 -05:00
Koichi Akabe 3419343e85 fix errors around ruby 2013-02-15 13:40:00 +09:00
Tom Rothamel 917fc68e27 Document the new mac requirements. 2013-02-14 23:28:53 -05:00
Tom Rothamel fadd0279a8 Add the optimize option to the distribute command line. 2013-02-14 23:28:37 -05:00
Tom Rothamel bbcc75dd2d More changelog updates. 2013-02-14 22:55:17 -05:00
Tom Rothamel f0b44d8c02 Update changelog. 2013-02-13 23:34:35 -05:00
Tom Rothamel eddf89697d Add the renpy.end_interaction function.
This creates an exception that ends the current interaction. This can
be used in the render and event methods of a creator-defined
displayable.
2013-02-13 22:00:09 -05:00
Tom Rothamel 92a155c780 Implement the renpy.set_locale method, which translation use to set the locale.
Modify the japanese translation of the tutorial to use it.
2013-02-13 15:51:56 -05:00
Tom Rothamel 6661e6e058 As part of a new approach to locales, rename back to japanese. 2013-02-13 15:08:06 -05:00
Tom Rothamel 68c49a9aa1 Merge pull request #67 from vbkaisetsu/i18n-confirm-n-locale
Please merge i18n-confirm-n-locale
2013-02-13 10:59:52 -08:00
Koichi Akabe 1ae7d4bd54 update font glyphs
The following is new glyph: U+672A
2013-02-13 17:25:25 +09:00
Koichi Akabe 8330ef062e update translation to support changing locale
fix font location
2013-02-13 16:55:53 +09:00
Koichi Akabe 5493ba998e change the locale when the language is changed 2013-02-13 16:35:11 +09:00
Koichi Akabe ed59d8a351 update Japanese translation 2013-02-13 13:38:00 +09:00
Koichi Akabe 077def41ae use _ function for confirmation messages 2013-02-13 13:32:54 +09:00
Tom Rothamel 7480a33eaf Make the file slot info translatable. 2013-02-12 17:59:18 -05:00
Tom Rothamel 4e1e8832cc Allow for tutorial-only sections of screens.rpy.
We generate template/game/screens.rpy from tutorial/game/screens.rpy -
but now, the tutorial version has the language preference in it. We don't
want the language preference to be in the default template, so we use
distribute.py to filter it out.
2013-02-12 17:51:15 -05:00
Tom Rothamel fe290a42c1 Do not distribute the launcher/game/themes directory.
This doesn't exist in git, but I use it to test the launcher theming
support - eliminating it means I don't have to remember to delete
the directory.
2013-02-12 17:37:57 -05:00
Tom Rothamel 54ae627ed2 Improve lint to count words and characters by language, and to count images and screens. 2013-02-12 16:59:10 -05:00
Tom Rothamel a3d30e9012 Update the VL-Gothic license file to include all relevant info. 2013-02-12 12:35:00 -05:00
Tom Rothamel 021e9c6335 Move VL-Gothic files into tl/japanese 2013-02-12 12:34:45 -05:00
Tom Rothamel 3833f01f2d Merge pull request #58 from vbkaisetsu/tutorial-i18n-l10n-ja
Merge japanese translation of tutorial game.
2013-02-12 06:50:22 -08:00
Tom Rothamel 2060dc288e Remove obsolete voice readme file. 2013-02-12 09:48:46 -05:00
Tom Rothamel fe10a1d57e Voice documentation. 2013-02-12 09:34:56 -05:00
Tom Rothamel 563e50334c Various voice actions:
* SetVoiceMute - sets the mute of a voice tag.
* ToggleVoiceMute - toggles the mute of a voice tag.
* VoiceReplay - replays the current voice.
2013-02-12 00:41:05 -05:00
Tom Rothamel a630c1daa4 Adjust indentation level. 2013-02-12 00:24:40 -05:00
Tom Rothamel 97380ceae6 Bring the voice mute code to the point where it works. 2013-02-12 00:20:34 -05:00
Tom Rothamel 7f8a4ec63d Various improvments to the voice mute support that was
just merged in.
2013-02-12 00:03:28 -05:00
Tom Rothamel 88eaf9ad53 Merge branch 'voice_enhancement' of git://github.com/odysseystudio/renpy into devel 2013-02-11 23:36:18 -05:00
Koichi Akabe 0e8a7f4b30 add license information for VLGothic 2013-02-11 23:59:46 +09:00
Koichi Akabe 42cd424723 add light-weight font based on VL Gothic 2013-02-11 22:53:55 +09:00
Tom Rothamel d7319907e8 Update the copyright notices to reflect the new year. 2013-02-10 21:41:51 -05:00
Tom Rothamel 3c942cfea1 Rename release. 2013-02-10 21:15:40 -05:00
Tom Rothamel 2884b93971 For clarity's sake, import time from distribute.rpy. 2013-02-10 07:41:36 -05:00
Tom Rothamel 494f445b33 Also call the before_restart code on load.
For the same reasons.
2013-02-09 23:57:16 -05:00
Tom Rothamel f23299fc9a Prevent old screens from updating while the game is restarting.
This prevents an issue that was triggered by an old screen hanging
around during a game restart, but that screen using a variable that
is no longer defined after game start.
2013-02-09 23:45:10 -05:00
Tom Rothamel d53f00a55a Remove incorrect uses of NotImplemented.
Which isn't an exception - it's a return value.
2013-02-08 22:38:40 -05:00
Tom Rothamel 89315c90e8 Wrap a list's rmul operation.
This fixes #65, a bug where [1, 2, 3] * 4 would produce a RevertableList,
but 4 * [1, 2, 3] would produce an unwrapped list (that doesn't
participare in rollback).
2013-02-08 22:32:26 -05:00
Tom Rothamel 3fedc41772 Rename the pythonw executable to use executable_name.
This has the nice behavior that the game we're running winds up being
called <game>, rather than python.
2013-02-06 22:56:30 -05:00
Tom Rothamel da4db2e4a2 Moves/fixes to work with new windows packaging. 2013-02-03 23:25:12 -05:00
Tom Rothamel 7e0f611279 Build mac apps + distribution.
A bunch of small changes, but the big one here is that we now generate
the mac app from scratch, using the plist creation code that was
checked in earlier.
2013-02-02 23:41:58 -05:00
Tom Rothamel 56ff162681 Search for Ren'Py when launched from a mac app. 2013-02-02 00:46:31 -05:00
Tom Rothamel 0eebc91e3d Fix renpy.sh so it works. 2013-02-01 23:28:41 -05:00
Tom Rothamel 284dc98394 Improvements to mac support.
* Write out a correct Info.plist
* Allow renpy.sh to call the new darwin build.
* Call the argv emulator.
2013-02-01 01:55:43 -05:00
Tom Rothamel f11928f91f Basic info.plist writer. 2013-01-30 23:56:50 -05:00
Tom Rothamel 1bcbdc1411 Add viewport edge scrolling.
This is a mode where the viewport automatically scrolls when the mouse
approaches the viewport's edges.

Fixes #17.
2013-01-29 23:26:36 -05:00
Tom Rothamel 19067d10ea Fix last commit. 2013-01-29 17:38:00 -05:00
Tom Rothamel e53c9f596b Make nvl hide and nvl show switch the mode used by window hide and
window show.

Since otherwise, it looks bad.
2013-01-29 17:22:23 -05:00
Tom Rothamel 970420e275 Make key repeat configurable.
Also, use the compat mechanism to disable it for old games, since
there's a small-but-not-zero chance it could break something.
2013-01-27 11:07:16 -05:00
Tom Rothamel 9d3d2877d9 Remove unnecessary code from renpy.sh. 2013-01-26 23:34:25 -05:00
Tom Rothamel 32af9095cb Add the transform_around style property.
Fixes #63.
2013-01-26 00:22:04 -05:00
Tom Rothamel ea6304f4bc Implement the guts of the transform_anchor transform property.
This transforms the anchor using the same matrix as the rest of
the transform, essentially allowing the point around which the
image rotates/zooms to be specified.
2013-01-26 00:02:26 -05:00
Tom Rothamel 695a804813 Tweak side image attribute handling, so it works w/ menus.
Fixes #59.
2013-01-24 11:18:40 -05:00
Tom Rothamel 88d23f22a4 Prevent the time inside an ATL transform from ticking backwards.
This could happy in various cases, such as when the show and hide
operations were called. The result is that the time inside an
interpolate could go massively negative, and we'd get overly-long
delays and other artifacts.
2013-01-24 00:49:00 -05:00
Tom Rothamel 754b6dc069 Don't invert the bar keys when bar_invert is true.
(We already inverted the value, so inverting the keys is redundant.)
2013-01-23 19:39:15 -05:00
Tom Rothamel b72466a1e3 Set keys to repeat. 2013-01-23 19:24:57 -05:00
Tom Rothamel d7d7795b99 Fix a regression that prevented load from working. 2013-01-23 19:17:03 -05:00
Tom Rothamel f4c03d58c9 Force tar times to be integers. 2013-01-22 13:44:03 -05:00
Tom Rothamel 431231ed68 Ensure that the start and end segments of Text are always included
in the list of segments that are shown to the user.

Fixes #60.
2013-01-21 14:59:51 -05:00
Tom Rothamel 34521e8656 Fix mmx bug on mac; remove obsolete script. 2013-01-20 23:47:25 -05:00
Koichi Akabe 16765ff731 Fix wrong translation 2013-01-20 23:11:33 +09:00
Koichi Akabe 2e59973c8d Fix wrong translation 2013-01-20 22:58:37 +09:00
Koichi Akabe e0277b2b59 Add style for translation 2013-01-20 22:12:21 +09:00
Koichi Akabe 91ddb05f27 Add Japanese translation 2013-01-20 21:44:17 +09:00
Koichi Akabe 70b215054d Use a map instead of str.lower() for translation 2013-01-20 21:08:58 +09:00
Koichi Akabe afe596eb7d Use _ function to support i18n in tutorial game 2013-01-20 17:30:06 +09:00
Tom Rothamel 811f04e783 Add Yes/No menu transitions. 2013-01-18 11:25:04 -05:00
Tom Rothamel 38543b0979 More documentation improvements. 2013-01-17 23:54:13 -05:00
Tom Rothamel 0574b03aeb Update changelog to reflect 6.15 work. 2013-01-17 23:31:47 -05:00
Tom Rothamel 460ccfcacb Call slow_done if a character is called with slow text disabled.
This triggers the slow text callback, which might be needed to end
something called in one of the other callbacks. (For example, the
PW-style beeping speech.)
2013-01-16 22:53:27 -05:00
Tom Rothamel 50e0f04b9a Remove warnings. 2013-01-16 11:13:04 -05:00
Tom Rothamel 77bc0f095f Remove eclipse warnings. 2013-01-16 11:12:42 -05:00
Tom Rothamel 064e7f544a Make code match the docs. 2013-01-16 01:25:24 -05:00
Tom Rothamel 06f329ae3b Document tailoring. 2013-01-16 01:23:33 -05:00
Tom Rothamel d05283200b Add the renpy.language_tailor function.
This lets the user tailor the linebreaking algorithm even further by
changing the unicode line breaking classes of individual characters.
2013-01-16 01:21:47 -05:00
Tom Rothamel d700c3ea17 Linebreaking improvements.
* Update the linebreaking to the algorithm and tables in unicode 6.2.
* Implement japanese-strict, japanese-normal, and japanese-loose breaking methods.
2013-01-16 00:47:55 -05:00
Tom Rothamel 3c381320c0 Properly style input screen. 2013-01-14 20:45:33 -05:00
Tom Rothamel 876d07f467 Import the decimal module, so it's included w/ Ren'Py. 2013-01-14 18:18:54 -05:00
Tom Rothamel 691adcb82d Expose the child style property to the screen language.
It was exposed before, but not as a style property. So it didn't work
as well as it could have.
2013-01-13 23:58:08 -05:00
Tom Rothamel 0321b19eaa Move box_reverse and order_reverse into the styles.
This makes it at least moderately plausible that a translation can
change them.
2013-01-13 23:42:31 -05:00
Tom Rothamel 02a84d71a6 Swap the width and height when rendering vertical text. 2013-01-13 22:03:03 -05:00
Tom Rothamel 504a81b86a Remove changelog from git. 2013-01-13 21:03:47 -05:00
Tom Rothamel 0baf603f90 Remove dse from Ren'Py repository. 2013-01-13 14:33:43 -05:00
Tom Rothamel 7593b7a3e3 Remove renpygame from renpy repo. 2013-01-13 14:32:56 -05:00
Tom Rothamel b07a146f27 Dlc test script. 2013-01-13 14:25:37 -05:00
Tom Rothamel 2eee59c530 Add back support for .rpt translation files. 2013-01-13 14:22:11 -05:00
Tom Rothamel 9b50b5bdb5 Translation generation improvements:
* Include commented code as part of the generated translations.
* Generate empty translation statements.
2013-01-13 13:38:11 -05:00
Tom Rothamel 4911348396 Implement the {#...} text tag, to distinguish translatable strings. 2013-01-12 22:32:42 -05:00
Tom Rothamel 2a9759e7d2 Fix a regression that caused us to constantly queue up redraw events. 2013-01-12 22:09:06 -05:00
Tom Rothamel 4366e29c05 ATL xoffset and yoffset now take floats.
Also, document them.
2013-01-12 20:55:39 -05:00
Tom Rothamel c612eef65d Do not try to execute python early code that won't compile.
This prevents a Ren'Py error from masking the original syntax error.
2013-01-12 12:41:51 -05:00
Tom Rothamel 48cd830628 Recompute scene list index after _hide.
Closes #45.
2013-01-11 12:47:54 -05:00
Tom Rothamel 7be08a2e2d renpy.loadable should check in .apk packages. 2013-01-10 22:17:56 -05:00
Tom Rothamel 3d4def2072 Prevent a widget from being grabbed if it's part of a screen
that is being hidden.
2013-01-10 21:57:45 -05:00
Tom Rothamel 259ef699d4 Make bar key bindings reflect bar_invert and bar_vertical. 2013-01-10 20:27:44 -05:00
Tom Rothamel 2a79d00726 Fix screen call/show without arguments. 2013-01-10 20:14:38 -05:00
Tom Rothamel eb27efd9e0 Allow the screen language use statement to pass positional parameters. 2013-01-10 00:31:57 -05:00
Tom Rothamel c94ce0ac7d Screens accept parameters via _args and _kwargs.
Calls to screens supply parameters via those variables.
2013-01-10 00:24:07 -05:00
Tom Rothamel 0acd9a38fa Allow screen language screens to accept parameters. 2013-01-10 00:00:39 -05:00
Tom Rothamel 5a0a60e8ba Factor parameter acceptance code into its own function. 2013-01-09 23:57:55 -05:00
Tom Rothamel 02854ef0a0 Deal with meaningless code from older games that could cause a crash
in 6.14.
2013-01-08 10:28:40 -05:00
Tom Rothamel 62e5b63229 Remove launcher2. 2013-01-07 23:57:20 -05:00
Tom Rothamel c2c537baa2 Add the "Add script file" command to the launcher. 2013-01-07 23:56:45 -05:00
Tom Rothamel 89223eb90f Document launcher skinning. 2013-01-06 23:08:49 -05:00
Tom Rothamel 2ba95ea13b Generate checkbuttons from colors in theme. 2013-01-06 22:11:05 -05:00
Tom Rothamel e4af56c5ae launcher: Add basic themeing support. 2013-01-06 21:54:50 -05:00
Tom Rothamel 5accf191dc If we can't create the tmp directory, use tempfile to make one. 2013-01-06 18:41:56 -05:00
Tom Rothamel a011e15e14 Implement the japanese-alternate language.
This breaks before and after every wide character, which emulates
the algorithm used by Japanese visual novels.

This was discussed at:
http://lemmasoft.renai.us/forums/viewtopic.php?p=242978#p242978
2013-01-06 13:55:15 -05:00
Tom Rothamel 2c9b67c87e Don't use vertical in font_replacement_map, as it would be a
non-backwards-compatible change.
2013-01-05 22:46:48 -05:00
Tom Rothamel 895c8f2dde Document vertical text. 2013-01-05 22:43:24 -05:00
Tom Rothamel 47e5f54776 Document box_reverse and order_reverse. 2013-01-05 22:21:00 -05:00
Tom Rothamel 13ff44ec32 Add order_reverse to vbox, hbox, and fixed.
This reverses the order in which child displayables are blitted to
the screen.
2013-01-05 22:02:09 -05:00
Tom Rothamel 8d03df8553 Implement box_reverse.
This reverses the order of an hbox or vbox's children. For example, in
a box_reversed hbox, the first child will be rightmost, and the last
child will be leftmost.
2013-01-05 21:21:00 -05:00
Tom Rothamel 5bdac85eab Vertical text integration.
Vertical text is now automatically rotated to the vertical
orientation.

Add the vtext image and vcentered character, which are the
vertical-text equivalents of image text and centered.
2013-01-05 14:15:38 -05:00
Tom Rothamel f391f2d9c6 Merge branch 'master' of git://github.com/vbkaisetsu/renpy into devel
This adds vertical text support.
2013-01-05 11:10:14 -05:00
Tom Rothamel ebebd6c6b9 Update translation documentation. 2013-01-05 00:10:30 -05:00
Tom Rothamel e7b4a1d156 Merge remote-tracking branch 'ren/patch-5' into devel 2013-01-04 22:24:32 -05:00
Tom Rothamel a93d083cce Change the comments generated by the translator. 2013-01-03 23:50:25 -05:00
Tom Rothamel c38d6c07f7 Change the identifier generation scheme.
It now includes the label, and will generate a unique identifier for
the repetitions of code within a label.
2013-01-03 23:45:01 -05:00
Tom Rothamel 0d1a6f1926 Add hide clause to parsing of Label.
The hide clause will be used with translations, to avoid taking the
label name into account when generating the translation identifier.
2013-01-02 23:48:58 -05:00
Tom Rothamel b6e86ec2f2 Translate only a single line of dialogue at a time. 2013-01-02 23:38:02 -05:00
Tom Rothamel d867e5a578 Transform fixes:
* Taking execution state now works with nested Transforms.
* An ATL transform will take the child of the Transform it replaces,
  if it has no child of its own.
2013-01-02 22:08:34 -05:00
Tom Rothamel 8fd52a383e Fix a bug where the cache can grow uncontrollably.
This error hits when the cache is over-full - we used to bail out
early, and never call the cleanout code. This fixes that.
2013-01-01 00:49:11 -05:00
Tom Rothamel 44c73da13b Re-enable image cache. 2013-01-01 00:39:08 -05:00
Tom Rothamel 79daaf3387 Install a stub keymap as part of error handling.
This fixes a regression in parse error handling.
2012-12-31 22:41:45 -05:00
Tom Rothamel 6ccb9bc261 Prevent prediction from starving redraw/timer events.
The problem we had was that the REDRAW and TIMEEVENT events weren't
scheduled until the prediction coroutine was run. When prediction was
taking a while, the events wouldn't cancel it.

This manifiested as slow skipping, among other problems.
2012-12-29 22:52:30 -05:00
Tom Rothamel 5f6608e43a Have proper nosave for screens.
Previously, the nosave was typoed. This over-saved the screens,
and lead to very large save files.
2012-12-29 22:51:03 -05:00
Tom Rothamel dbdf3f1b61 "Fix" save dump.
Once in a while, we can get a weirdly reduced object. This ignores
those objects.
2012-12-29 22:50:19 -05:00
Tom Rothamel 39bc31ede3 Fix skipping keymap. 2012-12-29 22:48:32 -05:00
Tom Rothamel 07eaf04454 Minor fixes to console. 2012-12-29 22:46:52 -05:00
Tom Rothamel c77be46006 Adjust help and look of input line. 2012-12-29 12:37:15 -05:00
Tom Rothamel 5be1d2dee8 Add recall support to the console. 2012-12-29 12:28:11 -05:00
Tom Rothamel b04b095055 Console changes:
* Add commands.
* Eliminate debug prefix from names.
* Remove now-obsolete code.
2012-12-29 10:20:41 -05:00
Tom Rothamel 0a26b7bdff Implement various console commands. 2012-12-29 00:48:56 -05:00
Tom Rothamel 2755ac54db Console runs Ren'Py and Python code. 2012-12-28 23:00:54 -05:00
Tom Rothamel e7155dae52 Add exception handling. 2012-12-28 01:06:42 -05:00
Tom Rothamel b499c5b7bc More fixes, such as forgetting the label once we've called it. 2012-12-28 00:11:47 -05:00
Tom Rothamel 30e06d21b7 Fix rollback/context bug. 2012-12-27 23:55:50 -05:00
Tom Rothamel c01b910aa5 Run Ren'Py code with some error handling. 2012-12-27 23:42:25 -05:00
xRenx 748920b136 Update sphinx/source/translations.rst
Just corrected a couple of typos (one was in some sort of hash, edited 'm' out).
2012-12-27 18:42:56 +00:00
Tom Rothamel e07fbd55cb Assign serial numbers consectuively between files.
This lets us be sure that we never create the same name twice in
a single process of Ren'Py, even if load_string is called in
quick succession.
2012-12-24 01:39:47 -05:00
Tom Rothamel 6cf01c4261 Add the ability to load a string into Ren'Py as a script file. 2012-12-24 01:37:44 -05:00
Tom Rothamel afdb276473 Switch how we run the debug console.
The console now runs in the main context, at least when it's
started in the main context.
2012-12-23 23:26:33 -05:00
Tom Rothamel 445d16bde6 Add non-greedy rollback.
Greedy rollback rolls back as far as it can without crossing a
checkpoint. Non-greedy rollback rolls back to the start of
the checkpoint statement, or the start of the current
statement if we're in a statement.

(This is used by the console to get back to the start of the
current statement.)
2012-12-23 23:23:11 -05:00
Tom Rothamel 3d9f73500c Back out rollback option due to problems.
The problem is that when we have two rollbackable contexts sharing
a store, variable changes in the inner context aren't rolled back
when a rollback occurs in the main context.
2012-12-23 21:46:41 -05:00
Tom Rothamel 165e3490fc Work on console.
This version converts the console from UI functions to screens,
and adds support for rolling back lines of input.
2012-12-22 23:59:22 -05:00
Tom Rothamel 7ab1a9b6d8 Call_in_new_context takes an _rollback argument.
This determines if rollback is allowed in the new context.
2012-12-22 23:56:49 -05:00
Tom Rothamel 526e44dbae Remove unnecessary loop from main, which prevented the game
from ending with a return.
2012-12-22 17:30:36 -05:00
Tom Rothamel f33f5fad35 Persist viewport range across a viewport replacemet cycle.
This prevents viewports from resetting to 0 when replaced.
2012-12-22 14:40:29 -05:00
Tom Rothamel ee36c66333 Encode the translation properly when hashing it. 2012-12-19 15:32:37 -05:00
Tom Rothamel fc6c7e7549 Add back config.game_menu_action. 2012-12-19 15:32:25 -05:00
Tom Rothamel eb4b3613cd Check in new debug console.
Thanks: Shiz, C, and delta.
2012-12-17 23:57:29 -05:00
Tom Rothamel 2859390ff7 Check in file deletions and changes. 2012-12-17 23:51:00 -05:00
Tom Rothamel 654c648feb Reorganize the unweildy 00screens.rpy file into 9 new files. 2012-12-17 23:49:15 -05:00
Tom Rothamel ad07fa19d7 Finish breaking 00library.rpy out into multiple parts. 2012-12-17 23:03:46 -05:00
Tom Rothamel 4d1cb10fd3 Move default config.keymap into 00keymap.rpy. 2012-12-17 09:57:30 -05:00
Tom Rothamel d936b0f482 Start refactoring common:
* Reassigned the init priorities.
* Started splitting 00library.rpy into multiple files.
2012-12-17 00:38:47 -05:00
Tom Rothamel 915b67758a Move the common directory to renpy/common. 2012-12-16 21:51:38 -05:00
Tom Rothamel 16b152ddf8 Document replay mode. 2012-12-16 21:32:22 -05:00
Tom Rothamel 3cc56f5c9d Don't translate 'a' and 'q' - it doesn't work. 2012-12-16 18:25:33 -05:00
Tom Rothamel ac69e0e45b Rename memory->replay, so that there's no confusion with functions that
manage computer memory.
2012-12-16 18:24:15 -05:00
Tom Rothamel e0f53d1030 More work on memories.
Implemented the EndMemory exception, EndMemory action, and
renpy.end_memory, which together end the current memory if we're in
memory mode.
2012-12-15 14:36:12 -05:00
Tom Rothamel 4e8eafe92e Memory Support and rollback changes/fixes.
This adds initial support for the memory mode, where we replay
a scene in a new context.

This requires a bunch of changes to rollback, so that it is possible
to rollback a context other than context[0]. Most notably,
RestartException has been replaced by RestartContext and
RestartTopContext.

This also fixes a bug where the rollback_limit was being decremented
even when a checkpoint wasn't reach. This manifiested as a reduced
amount of rollback, especially at the start of the game.
2012-12-15 14:10:36 -05:00
Tom Rothamel 263fd588af Allow run.sh to be scripted. 2012-12-15 14:10:22 -05:00
Tom Rothamel fac0b5af94 Add NoRollback to the default store. 2012-12-09 22:05:18 -05:00
Tom Rothamel 02a266f2d7 Add the ability to back up and restore the entire store. 2012-12-09 13:41:00 -05:00
Tom Rothamel 392df791ee Make the main_menu variable available even when we're not in the menu
context.
2012-12-08 15:30:35 -05:00
Tom Rothamel fa797518c1 Document translations. 2012-12-08 14:51:36 -05:00
Tom Rothamel 1791824b14 Add menu/string translations. 2012-12-08 11:16:02 -05:00
Tom Rothamel 407f37dd9e Add translation documentation. 2012-12-08 10:55:54 -05:00
Tom Rothamel af50b50110 Let the creator configure the name of the translation directory.
"Let the bikeshed-painting begin!"
2012-12-04 22:46:28 -05:00
Tom Rothamel 1af7616961 Actually check in the launcher translation support. 2012-12-04 22:46:14 -05:00
Tom Rothamel 0d8100c1d8 Add translation support to the launcher.
There's two parts to this. First off, there's a new "Generate
Translations" option, which lets the creator or translator generate
the translation files. Then, I added the ability to change the language
the launcher itself uses.
2012-12-04 22:33:48 -05:00
Tom Rothamel 9b8ab5430c Mark various statements as translatable. 2012-12-03 00:13:42 -05:00
Tom Rothamel d7e325ba89 The loader will look for translation-specific filenames
when loading images, music, etc.
2012-12-03 00:13:42 -05:00
Tom Rothamel cae94fe7eb The imagemap cache should take the current language into account, to
ensure that if the image is translated, the cache will be updated or
ignored.
2012-12-03 00:13:42 -05:00
Tom Rothamel bbb50748e4 Fix translate python statement. 2012-12-03 00:13:42 -05:00
Tom Rothamel c34253c6af Stop translate on exception; prevent double translation; make prefix/suffix translatable. 2012-12-03 00:13:42 -05:00
Tom Rothamel a027dd6579 Change the language option so it triggers the new translate
mechanism.
2012-12-03 00:13:42 -05:00
Tom Rothamel 4a5cdd31f4 Add menu choices to the list of strings to be translated. 2012-12-03 00:13:42 -05:00
Tom Rothamel 83703f757f Add a rot13 filter for translations. 2012-12-03 00:13:42 -05:00
Tom Rothamel 58f68de94a Translations can be activated. 2012-12-03 00:13:42 -05:00
Tom Rothamel 963dfd0c62 Scanning scripts to generate string translations. 2012-12-03 00:13:42 -05:00
Tom Rothamel cd7f00b9e3 Fix argument parsing.
Previously, the project and command were optional, which led to problems
when a required command argument was missing.
2012-12-03 00:13:42 -05:00
Tom Rothamel 0c0b560321 Implement string_scan function.
This scans a file for translatable strings.
2012-12-03 00:13:42 -05:00
Tom Rothamel 3c31888f54 Add the !t conversion type.
This type allows us to write [value!t], to get a translation of
value.
2012-12-03 00:13:41 -05:00
Tom Rothamel 1f057d8945 String translation support.
This removes the old .rpt support, and replaces it with a translate
string statement. The RENPY_UPDATE_STRINGS statement now writes
a .rpy file containing the new strings.
2012-12-03 00:13:41 -05:00
Tom Rothamel a28e207511 Write out translates. 2012-12-03 00:13:41 -05:00
Tom Rothamel 35dd42a9f9 Infrastructure to write translation files. 2012-12-03 00:13:41 -05:00
Tom Rothamel 9cb00851aa Encode say strings properly. 2012-12-03 00:13:41 -05:00
Tom Rothamel 73f4ae8d28 We can now translate blocks of text. 2012-12-03 00:13:41 -05:00
Tom Rothamel 5e0edd9d95 Chain translation blocks together; add a new EndTranslate block. 2012-12-03 00:13:41 -05:00
Tom Rothamel dfbb5aa79e Parser changes.
* Add translate statement.
* Add nointeract clause to say statement.
2012-12-03 00:13:41 -05:00
Tom Rothamel 62d9bbf522 Initial support for automatic addition of translate nodes.
This adds a new pass to script loading, one where Ren'Py iterates
through the script and groups say statements and translatable user
statements into translate blocks.
2012-12-03 00:13:41 -05:00
Tom Rothamel e832d56310 Start implementation of translation. 2012-12-03 00:13:41 -05:00
Tom Rothamel 45fc6fb1b2 Merge branch 'devel' of github.com:renpy/renpy into devel 2012-12-03 00:12:39 -05:00
Koichi Akabe be39d4c825 Merge with trunk 2012-10-31 22:53:09 +09:00
Tom Rothamel 7baf6559ed When doing error handling, we only build the styles needed for
error handling.

This prevents consistency error in styles (for example, a style inheriting from an undefined style) from causing a crash.
2012-10-29 19:47:41 -04:00
Tom Rothamel 13ee3550f9 Fix LiveTile range() problems.
LiveTile could crash with an error if the child render size or
displayable size were not integers.
2012-10-29 18:38:56 -04:00
Tom Rothamel 4f63b6f2e0 Hide shouldn't stop prediction. 2012-10-17 22:09:40 -04:00
Tom Rothamel 536d765359 Add the voice_tag parameter to Character, and config.voice_tag_callback.
To support the new voice tag feature, character gains a voice_tag
parameter, and the new config.voice_tag_callback variable comes into
existence. When a character speaks, config.voice_tag_callback is
called with that character's voice tag.
2012-09-17 19:50:51 -04:00
Albert Westra 20c4dcac26 Fix a couple ID10T Errors 2012-09-17 09:20:31 -07:00
Albert Westra 58bd1a7bde Added elif to a if line 2012-09-16 22:07:25 -07:00
Albert Westra bacb4f067d Added Comments in 00screen.rpy;
Added :doc: comment in chracter;
and Added voice_tag requirement in 00voice.rpy.
2012-09-16 22:01:43 -07:00
Albert Westra e4d82fcfc2 Add README to state what I am doing 2012-09-12 22:36:30 -07:00
Tom Rothamel 754f457574 Merge branch 'feature-font-group' 2012-09-12 23:11:28 -04:00
Tom Rothamel 96984da285 Remove use of renpy.game.args.warp.
This is the last use of a command-line argument in code that isn't
part of the run command. We can now start a Ren'Py game with a
command other than the run command.
2012-09-12 22:53:56 -04:00
Tom Rothamel 1d1d1cb405 Merge branch 'master' into devel 2012-09-11 22:55:45 -04:00
Tom Rothamel 6beb2ed831 Make Language() use deferred rollback. 2012-09-11 22:54:16 -04:00
Tom Rothamel 80ac28bd07 Implement deferred rollback.
This allows a rollback to begin in a menu, but not take effect until the
user returns to the top-level context.
2012-09-11 22:52:56 -04:00
Tom Rothamel e4e39cdfeb Ensure rollback respects rollback_limit. 2012-09-11 22:52:08 -04:00
Tom Rothamel 25c03ae410 When rolling back, roll back to the the rollback immediately after
the previous checkpoint.

This allows all the code that makes up the current screen to be re-run
when a rollback occurs.
2012-09-11 19:02:13 -04:00
Tom Rothamel 7ef4449fc1 Merge branch 'feature-font-group' into devel 2012-09-11 01:29:11 -04:00
Tom Rothamel 2c728bc9a4 Bump version. 2012-09-11 01:28:40 -04:00
Tom Rothamel b1353fdfcc Document font groups. 2012-09-11 01:13:32 -04:00
Tom Rothamel 3a3cad9fd4 Integrate FontGroup with subsegment.
This gets the FontGroup code working.
2012-09-11 00:24:30 -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 6e6784a5e7 Implement FontGroup.
This lets us register a group of fonts, with each covering a portion
of the unicode character space. A string can then be segmented based
on this, dividing it up into runs of characters using various fonts.
2012-09-07 00:21:06 -04:00
Tom Rothamel cf22336e3a Add subsegment method to TextSegment.
This gives a textsegment the ability to decide to break itself up
further based on the contents of the text supplied to it.
2012-09-06 23:11:45 -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
Koichi Akabe be69bd95af Use underline_position for vertical sideline calculation
This change is optimized for full width characters
2012-08-24 16:50:42 +09: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
Koichi Akabe bc19194c58 Use bbox.yMax instead of horiBearingY for simulation
If the height of the glyph is small, horiBearingY returns
a non-expected value for vertical layout simulation, but bbox.yMax
returns the same value for all glyphs.
2012-08-20 17:18:35 +09: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
Koichi Akabe 62ac5b09b1 Get GSUB table regardless of FT_HAS_VERTICAL 2012-08-19 21:04:06 +09:00
Koichi Akabe 9ccc66da0e Fix position calcuration on vertical layout simulaton 2012-08-19 15:33:54 +09:00
Koichi Akabe 1d6ec0fcfd Simulate vertical layout if the font doesn't support it 2012-08-19 13:25:40 +09:00
Koichi Akabe d9510a7569 Simulate vertical layout if the font doesn't support it 2012-08-19 13:24:51 +09:00
Koichi Akabe 5412165427 Add vertical style
* Add vert and horiz text tag
 * Add ttgsubtable to get vertical glyphs
 * Inherit vertical style on ruby and hyperlink
2012-08-19 10:17:37 +09: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 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 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
689 changed files with 75162 additions and 33657 deletions
-106
View File
@@ -1,106 +0,0 @@
build
dist
dists
renpy.app
**/*.rpyc
**/*.rpyb
**/*.rpymc
jedit
lint.txt
renpy.code
traceback.txt
doc/common.css
doc/images
doc/index.html
doc/monobook.css
doc/monobook2.css
doc/reference
doc/shared.css
doc/tutorials
doc/www.renpy.org
testing
translations.rpy
launchertrans.rpy
jcc
scite/scite.zip
screenshot*
.ropeproject
release_cardgame.sh
cardgame
dse.split
empty
empty-linux-x86.tar.bz2
empty-mac.zip
empty.zip
errors.txt
icons
iliad-icon.png
iliad-work
kuroi
lsprofcalltree.py
manifest.xml
mediatest
musicroom
nobmtest
renpy-iliad.sh
renpy.kcg
renpy.stats
renpygame-1.2.zip
speedtest
styles.txt
renpygame-demo/game/saves
Lucy Sprites.zip
translate
close_bugs.py
.logplayer
scite-6.10.zip
scite-renpy-20090803.zip
module/cython.sh
old_demo
opengl.txt
Microsoft.VC90.CRT.manifest
console.exe
msvcr90.dll
python26.dll
renpy.exe
lib/windows-x86
sphinx/source/inc/*
doc/*
updates/prerelease
module/render.c
module/_renpy.c
module/_renpy_pysdlgl.c
module/_renpybidi.c
module/sound.c
module/winmixer.c
module/accelerator.html
module/gldraw.html
module/glenviron_fixed.html
module/glenviron.html
module/glenviron_limited.html
module/glenviron_shader.html
module/glrtt_copy.html
module/glshader.html
module/gltexture.html
module/render.html
module/accelerator.c
module/gldraw.c
module/glenviron.c
module/glenviron_fixed.c
module/glenviron_limited.c
module/glenviron_shader.c
module/glrtt_copy.c
module/glshader.c
module/gltexture.c
log.txt
lib/linux-x86
lib/python
lib/update-version.txt
sphinx/game/saves
tutorial/game/saves
doc
unparse.py
module/glrtt_fbo.c
module/glrtt_fbo.html
tutorial/game/cache
renpy.exe.log
+54
View File
@@ -0,0 +1,54 @@
*.rpyc
*.rpyb
*.rpymc
*.pyc
*.pyo
*~
*.bak
saves
tmp
cache
log.txt
errors.txt
traceback.txt
styles.txt
/build
/dist
/dists
/renpy.app
/jedit
/lint.txt
/renpy.code
/testing*
/screenshot*
/Microsoft.VC90.CRT.manifest
/console.exe
/msvcr90.dll
/python27.dll
/renpy.exe
/lib
/lib.old
/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
/launcher/game/theme
dl
renpy/vc_version.py
.externalToolBuilders
-4796
View File
File diff suppressed because it is too large Load Diff
-801
View File
@@ -1,801 +0,0 @@
=======
License
=======
Most of Ren'Py is covered by the terms of the following (MIT) license:
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(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.
Portions of Ren'Py are derived from code that is copyright using the
Lesser GNU Public License, so Ren'Py games must be distributed in a
manner that satisfies the LGPL.
Please see each individual source file for a list of copyright
holders. The artwork in the demo is released by various copyright
holders, under the same terms.
Ren'Py binaries include code from the following projects:
* Python (Python License)
* Pygame (LGPL)
* SDL (LGPL)
* SDL_image (LGPL)
* SDL_ttf (LGPL)
* Freetype (LGPL)
* FFmpeg (LGPL)
* Fribidi (LGPL)
* jpeg (JPEG License)
* libpng (PNG license)
* zlib (Zlib License)
* bzip2 (Bzip2 License)
* pyobjc (MIT License)
* py2exe (MIT License)
* GLEW (Modified BSD, MIT)
For the purpose of LGPL compliance, the source code to all LGPL
software we depend on is either in the Ren'Py package (available from
http://www.renpy.org/), or in the renpy-deps package
(http://www.renpy.org/dl/lgpl/). We believe compliance can be achieved
by including a copy of this license with every copy of Ren'Py you
distribute, and referring to it in your project's README file.
The default Ren'Py build distributes Ren'Py alongside jEdit, which is
licensed under the GNU GPL. The source code to jEdit is distributed as
part of the renpy-deps package (http://www.renpy.org/dl/lgpl/).
GNU Lesser General Public License
=================================
::
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations
below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it
becomes a de-facto standard. To achieve this, non-free programs must
be allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control
compilation and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at least
three years, to give the same user the materials specified in
Subsection 6a, above, for a charge no more than the cost of
performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply, and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License
may add an explicit geographical distribution limitation excluding those
countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms
of the ordinary General Public License).
To apply these terms, attach the following notices to the library.
It is safest to attach them to the start of each source file to most
effectively convey the exclusion of warranty; and each file should
have at least the "copyright" line and a pointer to where the full
notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or
your school, if any, to sign a "copyright disclaimer" for the library,
if necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James
Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!
Python License
==============
::
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using Python 2.3 software in source or binary form and its
associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF
hereby grants Licensee a nonexclusive, royalty-free, world-wide
license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use Python 2.3
alone or in any derivative version, provided, however, that PSF's
License Agreement and PSF's notice of copyright, i.e., "Copyright (c)
2001, 2002 Python Software Foundation; All Rights Reserved" are
retained in Python 2.3 alone or in any derivative version prepared by
Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python 2.3 or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python 2.3.
4. PSF is making Python 2.3 available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 2.3 WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
2.3 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 2.3,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python 2.3, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
Jpeg License
============
::
In plain English:
1. We don't promise that this software works. (But if you find any bugs,
please let us know!)
2. You can use this software for whatever you want. You don't have to pay us.
3. You may not pretend that you wrote this software. If you use it in a
program, you must acknowledge somewhere in your documentation that
you've used the IJG code.
In legalese:
The authors make NO WARRANTY or representation, either express or implied,
with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.
This software is copyright (C) 1991-1998, Thomas G. Lane.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
software (or portions thereof) for any purpose, without fee, subject to these
conditions:
(1) If any part of the source code for this software is distributed, then this
README file must be included, with this copyright and no-warranty notice
unaltered; and any additions, deletions, or changes to the original files
must be clearly indicated in accompanying documentation.
(2) If only executable code is distributed, then the accompanying
documentation must state that "this software is based in part on the work of
the Independent JPEG Group".
(3) Permission for use of this software is granted only if the user accepts
full responsibility for any undesirable consequences; the authors accept
NO LIABILITY for damages of any kind.
These conditions apply to any software derived from or based on the IJG code,
not just to the unmodified library. If you use our work, you ought to
acknowledge us.
Permission is NOT granted for the use of any IJG author's name or company name
in advertising or publicity relating to this software or products derived from
it. This software may be referred to only as "the Independent JPEG Group's
software".
We specifically permit and encourage the use of this software as the basis of
commercial products, provided that all warranty or liability claims are
assumed by the product vendor.
PNG License
===========
::
The PNG Reference Library is supplied "AS IS". The Contributing Authors
and Group 42, Inc. disclaim all warranties, expressed or implied,
including, without limitation, the warranties of merchantability and of
fitness for any purpose. The Contributing Authors and Group 42, Inc.
assume no liability for direct, indirect, incidental, special, exemplary,
or consequential damages, which may result from the use of the PNG
Reference Library, even if advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, without fee, subject
to the following restrictions:
1. The origin of this source code must not be misrepresented.
2. Altered versions must be plainly marked as such and must not
be misrepresented as being the original source.
3. This Copyright notice may not be removed or altered from any
source or altered source distribution.
The Contributing Authors and Group 42, Inc. specifically permit, without
fee, and encourage the use of this source code as a component to
supporting the PNG file format in commercial products. If you use this
source code in a product, acknowledgment is not required but would be
appreciated.
Zlib License
============
::
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Bzip2 License
=============
::
This program, "bzip2", the associated library "libbzip2", and all
documentation, are copyright (C) 1996-2005 Julian R Seward. All
rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product
documentation would be appreciated but is not required.
3. Altered source versions must be plainly marked as such, and must
not be misrepresented as being the original software.
4. The name of the author may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Modified BSD License
====================
::
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the author may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
+55
View File
@@ -0,0 +1,55 @@
==============================
The Ren'Py Visual Novel Engine
==============================
http://www.renpy.org
Branches
========
Ren'Py development takes place on two branches, ``master`` and
``devel``, as well as the occasional feature branch.
Master
-----
The master branch contains code that can be run using the libraries in
the latest (release or pre-release) version of Ren'Py. It's used for
bugfixes and features that do not require C or Cython code to
implement.
After checking out master, run::
./after_checkout.sh <path-to-renpy>
to link in the libraries from the most recent Ren'Py. (On Windows, you
will need to run this under msys or cygwin.)
Ren'Py can then be run by running renpy.exe, renpy.sh, or renpy.app as
appropriate.
Devel
-----
The devel branch contains code that requires a recompile of modules
implemented in C or Cython. Building devel requires you to have the
prerequisite libraries installed. Then set RENPY_DEPS_INSTALLED to
a \::-separated list of paths containing dependencies. For example::
export RENPY_DEPS_INSTALL=/usr::/usr/lib/x86_64-linux-gnu/
Finally, change into the modules directory, and run::
python setup.py install
Ren'Py can then be run by using python to run renpy.py.
Contributing
============
For bug fixes, documentation improvements, and simple changes, just
make a pull request. For more complex changes, it might make sense
to file an issue so we can discuss the design.
Executable
+49
View File
@@ -0,0 +1,49 @@
#!/usr/bin/env python
import argparse
import os
import subprocess
from renpy import version_tuple #@UnresolvedImport
version = ".".join(str(i) for i in version_tuple)
short_version = ".".join(str(i) for i in version_tuple[:3])
print "Version", version
ap = argparse.ArgumentParser()
ap.add_argument("--release", action="store_true")
ap.add_argument("--prerelease", action="store_true")
ap.add_argument("--experimental", action="store_true")
ap.add_argument("--no-tag", "-n", action="store_true")
args = ap.parse_args()
if args.release:
links = [ "release", "prerelease", "experimental" ]
tag = True
elif args.prerelease:
links = [ "prerelease", "experimental" ]
tag = True
elif args.experimental:
links = [ "experimental" ]
tag = False
else:
links = [ ]
tag = False
os.chdir("/home/tom/ab/renpy/dl")
for i in links:
if os.path.exists(i):
os.unlink(i)
os.symlink(short_version, i)
os.chdir("/home/tom/ab/renpy")
if tag and not args.no_tag:
cmd = [ "git", "tag", "-a", version, "-m", "Ren'Py " + version ]
subprocess.check_call(cmd)
os.chdir("/home/tom/ab/website")
subprocess.check_call("./upload.sh")
-15
View File
@@ -1,15 +0,0 @@
#!/bin/sh
if [ "x$1" = "x" ]; then
echo need version
exit
fi
rsync -av updates tom@onegeek.org:/home/tom/WWW.update/renpy/
mkdir ~/ab/website/renpy/dl/$1
cp dists/renpy-$1-* ~/ab/website/renpy/dl/$1
cp CHANGELOG.txt ~/ab/website/renpy/dl/$1
cd ~/ab/website
./upload.sh
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
ROOT="$(dirname $(readlink -f $0))"
ln -s "$ROOT/help.html" "$ROOT/tutorial/README.html"
ln -s "$ROOT/help.html" "$ROOT/the_question/README.html"
ln -s "$ROOT/help.html" "$ROOT/template/README.html"
ln -s "$ROOT/sphinx/source/license.rst" "$ROOT/LICENSE.txt"
ln -s "$ROOT/sphinx/build/html" "$ROOT/doc"
if [ "$1" != "" ]; then
ln -s "$1/lib" "$ROOT/lib"
ln -s "$1/renpy.app" "$ROOT"
ln -s "$1/renpy.exe" "$ROOT"
fi
+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' },
)
-112
View File
@@ -1,112 +0,0 @@
#!/usr/bin/env python
import modulefinder
import shutil
from distutils.core import setup
import py2exe
import sys
import zipfile
import traceback
import os
# The pythonpath on my system.
sys.path.insert(0, 'c:\\msys\\1.0\\newbuild\\install\\bin')
sys.path.insert(0, 'c:\\msys\\1.0\\newbuild\\install\\python')
def move_from_dist(fn):
"""
Moves the file `fn` from the dist directory to the main
directory. (This means we don't need symlinks on windows.)
"""
if os.path.isdir(fn):
shutil.rmtree(fn)
elif os.path.exists(fn):
os.unlink(fn)
os.rename("dist/" + fn, fn)
import renpy
renpy.setup_modulefinder(modulefinder)
def main():
sys.argv[1:] = [ 'py2exe', '-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',
'pygame.font',
'_ssl',
'_hashlib',
'win32con',
'win32api',
'Numeric',
'locale',
'gettext',
'os2emxpath',
'macpath',
'posixpath',
],
'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")
shutil.copy("c:/Python26/Microsoft.VC90.CRT.manifest", "Microsoft.VC90.CRT.manifest")
shutil.copy("c:/Python26/msvcr90.dll", "msvcr90.dll")
move_from_dist("lib/windows-x86")
move_from_dist("console.exe")
move_from_dist("python26.dll")
move_from_dist("renpy.exe")
try:
main()
except:
traceback.print_exc()
-81
View File
@@ -1,81 +0,0 @@
#!/usr/bin/env python
import collections
import glob
import re
import sys
import time
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, """\
]
"""
-188
View File
@@ -1,188 +0,0 @@
# Copyright 2004-2011 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:
screen _gl_test:
frame:
xalign .5
yalign .33
xpadding 20
ypadding 20
has vbox
label _(u"Graphics Acceleration")
null height 10
textbutton _(u"Automatically Choose"):
size_group "gl"
action SetField(persistent, "_gl_test", "auto")
textbutton _(u"Prefer Software Renderer"):
size_group "gl"
action SetField(persistent, "_gl_test", "sw")
textbutton _(u"Prefer OpenGL Renderer"):
size_group "gl"
action SetField(persistent, "_gl_test", "gl")
null height 10
textbutton _(u"Continue"):
size_group "gl"
action Return(True)
init -1024 python:
# The image that we fill the screen with in GL-test mode.
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
def render(self, width, height, st, at):
self.times.append(st)
renpy.redraw(self, 0)
renpy.renpy.log.info("Frame drawn at %f seconds." % st)
if len(self.times) >= self.frames:
frames_timing = self.times[-1] - self.times[-self.frames]
renpy.renpy.log.info("It took %f seconds to render %d frames.", frames_timing, self.frames)
if frames_timing <= self.target:
self.success = True
renpy.timeout(0)
rv = renpy.Render(width, height)
return rv
def event(self, ev, x, y, st):
if self.success:
return True
if st > self.timeout:
return False
renpy.timeout(self.timeout - st)
def __gl_prefer_renderers(renderers):
"""
Forces the current renderer to be renderer, one of gl or sw.
"""
if renpy.display.prefer_renderers == renderers:
return
renpy.display.prefer_renderers = renderers
renpy.display_reset()
def __gl_prompt():
"""
Decides if we want to prompt the user to enable OpenGL mode.
If so, shows a screen that allows the user to alter the
OpenGL setting.
"""
if not renpy.display.interface.safe_mode:
return
__gl_prefer_renderers("sw")
renpy.call_screen("_gl_test")
renpy.display.interface.safe_mode = False
def __gl_test():
"""
Makes the decision as to if we should use GL or SW mode.
"""
import os
if "RENPY_RENDERER" in os.environ:
return
# Our decision survives a restart.
if _restart:
return
renpy.renpy.log.info("GL test mode: %s", persistent._gl_test)
# If GL is disabled, don't bother.
if not config.gl_enable:
return
__gl_prompt()
if persistent._gl_test == "gl":
__gl_prefer_renderers("gl,sw")
return
if persistent._gl_test == "sw":
__gl_prefer_renderers("sw")
return
__gl_prefer_renderers("gl,sw")
ui.pausebehavior(0)
ui.interact(suppress_underlay=True, suppress_overlay=True)
# If GL is able to render FRAMES frames at FPS fps in less
# than DELAY seconds, we consider it to be operational, and
# continue in GL mode. Otherwise, we rever to software
# rendering mode.
FRAMES = 5
FPS = 15
DELAY = 1
renpy.transition(Dissolve(DELAY), always=True, force=True)
ui.add(__GLTest(FRAMES, FPS, DELAY))
result = ui.interact(suppress_overlay=True, suppress_underlay=True)
if result:
__gl_prefer_renderers("gl,sw")
else:
__gl_prefer_renderers("sw")
# Init-time code:
# Make a guess as to what modes we should be in.
if persistent._gl_test is None:
persistent._gl_test = "auto"
if persistent._gl_test == "sw":
renpy.display.prefer_renderers = "sw"
label _gl_test:
# Show the test image.
scene
show expression config.gl_test_image
$ __gl_test()
# Hide the test image.
scene
return
-935
View File
@@ -1,935 +0,0 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file consists of renpy functions that aren't expected to be
# 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__
pattern = os.environ.get("RENPY_SCREENSHOT_PATTERN", "screenshot%04d.png")
# 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 = dest + "/" + 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:
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,
)
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)
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)
config.hyperlink_styler = hyperlink_styler
config.hyperlink_callback = hyperlink_function
# Prediction of screens.
def predict():
for s in _predict_screens:
if renpy.has_screen(s):
renpy.predict_screen(s)
s = _game_menu_screen
if s is None:
return
if renpy.has_screen(s):
renpy.predict_screen(s)
return
if s.endswith("_screen"):
s = s[:-7]
if renpy.has_screen(s):
renpy.predict_screen(s)
return
config.predict_callbacks.append(predict)
def imagemap_auto_function(auto_param, variant):
rv = auto_param % variant
if renpy.loadable(rv):
return rv
else:
return None
config.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
if config.developer:
def _inspector(l):
ui.add("#000")
ui.window(xmargin=20, ymargin=20, style='default')
ui.vbox()
ui.text("Style Inspector")
ui.text("")
if not l:
ui.text("Nothing to inspect.")
for depth, width, height, d in l:
s = d.style
while s:
if s.name:
break
if s.parent:
s = style.get(s.parent)
else:
break
name = s.name[0] + "".join([ "[%r]" % i for i in s.name[1:] ])
ui.text(" " * depth + u" \u2022 " + d.__class__.__name__ + " : " + name + " (%dx%d)" % (width, height))
ui.text("")
ui.text("(click to continue)")
ui.close()
ui.saybehavior()
ui.interact(suppress_overlay=True, suppress_underlay=True)
return
config.inspector = _inspector
##############################################################################
# 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()
# 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
label _enter_menu:
python hide:
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
# This may be changed, if we are already in the main menu.
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)
return
# Factored this all into one place, to make our lives a bit easier.
label _enter_game_menu:
call _enter_menu from _call__enter_menu_2
$ 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"):
call _enter_menu from _call__enter_menu_1
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.exports.images:
continue
renpy.image(name, fn)
if config.automatic_images:
create_automatic_images()
# Load the developer screen, if necessary.
init 1180 python hide:
if config.developer:
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
call _enter_menu from _call__enter_menu_4
jump expression "_developer_screen"
-46
View File
@@ -1,46 +0,0 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# Common stuff that's used by the various Ren'Py menus. This includes
# 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
-1543
View File
File diff suppressed because it is too large Load Diff
-131
View File
@@ -1,131 +0,0 @@
# Copyright 2004-2011 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)
-11
View File
@@ -1,11 +0,0 @@
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python hide:
layout.provides('yesno_prompt')
def yesno_prompt(screen, message):
return renpy.call_screen('yesno_prompt', message=message, yes_action=Return(True), no_action=Return(False))
layout.yesno_prompt = yesno_prompt
Regular → Executable
+155 -103
View File
@@ -1,18 +1,18 @@
#!/home/tom/bin/renpython -O
#!/home/tom/bin/renpython -OO
# Builds a distributions of Ren'Py.
import sys
import os
import zipfile
import tarfile
import time
import zlib
import compileall
import shutil
import subprocess
import makeupdate
import glob
import time
import argparse
CWD = os.getcwdu()
zlib.Z_DEFAULT_COMPRESSION = 9
@@ -79,7 +79,31 @@ def zipup(filename, prefix, files):
sys.stdout.flush()
def copy_tutorial_file(src, dest):
"""
Copies a file from src to dst. Lines between "# tutorial-only" and
"# end-tutorial-only" comments are omitted from the copy.
"""
sf = open(src, "rb")
df = open(dest, "wb")
# True if we want to copy the line.
copy = True
for l in sf:
if "# tutorial-only" in l:
copy = False
elif "# end-tutorial-only" in l:
copy = True
else:
if copy:
df.write(l)
sf.close()
df.close()
def tree(root):
rv = [ ]
@@ -95,7 +119,6 @@ def tree(root):
if ".doctrees" in dirs:
dirs.remove(".doctrees")
for f in filenames:
if f[-1] == '~' or f[0] == '.':
continue
@@ -115,120 +138,149 @@ def tree(root):
def main():
if len(sys.argv) != 2:
print "Usage: %s <prefix>" % sys.argv[0]
return
ap = argparse.ArgumentParser()
ap.add_argument("version")
ap.add_argument("--fast", action="store_true")
args = ap.parse_args()
prefix = sys.argv[1]
# Revision updating is done early, so we can do it even if the rest
# of the program fails.
shutil.copy("tutorial/game/screens.rpy", "template/game/screens.rpy")
# Determine the version. We grab the current revision, and if any
# file has changed, bump it by 1.
import renpy
match_version = ".".join(str(i) for i in renpy.version_tuple[:2]) #@UndefinedVariable
zip_version = ".".join(str(i) for i in renpy.version_tuple[:3]) #@UndefinedVariable
s = subprocess.check_output([ "git", "describe", "--tags", "--dirty", "--match", match_version ])
parts = s.strip().split("-")
vc_version = int(parts[1])
if parts[-1] == "dirty":
vc_version += 1
with open("renpy/vc_version.py", "w") as f:
f.write("vc_version = {}".format(vc_version))
reload(sys.modules['renpy.vc_version']) #@UndefinedVariable
reload(sys.modules['renpy'])
# Check that the versions match.
full_version = ".".join(str(i) for i in renpy.version_tuple) #@UndefinedVariable
if args.version != "experimental" and not full_version.startswith(args.version):
raise Exception("The command-line and Ren'Py versions do not match.")
print "Version {} ({})".format(args.version, full_version)
# Update the update-version.txt file.
p = subprocess.Popen(["bzr", "revno"], stdout=subprocess.PIPE)
revno = p.stdout.read().strip() + "-" + str(time.time())
p.wait()
f = file("lib/update-version.txt", "w")
f.write(revno + " base\n")
f.close()
# Copy over the screens, to keep them up to date.
copy_tutorial_file("tutorial/game/screens.rpy", "template/game/screens.rpy")
# Compile all the python files.
compileall.compile_dir("renpy/", ddir=prefix + "/renpy/", force=1)
os.environ['RENPY_PATH_ELIDE'] = '/home/tom/ab/renpy:' + prefix
# Chmod the mac app.
os.chmod("./renpy.app/Contents/MacOS/Ren'Py Launcher", 0755)
# Chmod down renpy.py, for now.
os.chmod("renpy.py", 0644)
compileall.compile_dir("renpy/", ddir="renpy/", force=1, quiet=1)
# Compile the various games
for i in [ 'tutorial/game', 'launcher', 'template/game', 'the_question/game' ]:
os.system("./renpy.sh --compile --game " + i)
files = [ ]
more_files = [ ]
if not args.fast:
for i in [ 'tutorial', 'launcher', 'template', 'the_question' ]:
print "Compiling", i
subprocess.check_call(["./renpy.sh", i, "compile" ])
files.append("CHANGELOG.txt")
files.append("LICENSE.txt")
files.extend(tree("common"))
files.extend(tree("launcher"))
files.extend(tree("tutorial"))
files.extend(tree("the_question"))
more_files.extend(tree("jedit"))
more_files.extend(tree("lib"))
more_files.extend(tree("lib/linux-x86"))
# The destination directory.
destination = os.path.join("dl", args.version)
module_files = [
"*.c",
"*.h",
"*.py",
"*.pyx",
"README.txt",
"lib/pysdlsound/*.py",
]
if not os.path.exists(destination):
os.makedirs(destination)
for i in module_files:
files.extend(glob.glob('module/' + i))
if args.fast:
files.extend(tree('renpy'))
files.append('renpy.py')
more_files.append('python26.dll')
more_files.append('msvcr90.dll')
more_files.append('Microsoft.VC90.CRT.manifest')
more_files.extend(tree('renpy.app'))
more_files.append('renpy.exe')
more_files.append("console.exe")
more_files.append('renpy.sh')
files.extend(tree('template'))
files.extend(tree('doc'))
files.sort()
more_files.sort()
# zipup("dists/" + prefix + "-win32.zip", prefix, files)
# print "----"
zipup("dists/" + prefix + "-sdk.zip", prefix, files + more_files)
print "----"
tarup("dists/" + prefix + "-sdk.tar.bz2", prefix, files + more_files)
print "----"
tarup("dists/" + prefix + "-source.tar.bz2", prefix, files)
print "----"
# Make the 7zip.
os.chdir("dists")
os.system("unzip " + prefix + "-sdk.zip")
try:
os.unlink(prefix + "-sdk.7z")
except:
pass
os.system("7z a " + prefix + "-sdk.7z " + prefix)
os.system("cat ../7z.sfx " + prefix + "-sdk.7z > " + prefix + "-sdk.7z.exe""")
os.unlink(prefix + "-sdk.7z")
os.chdir("..")
if os.path.exists("updates/prerelease"):
shutil.rmtree("updates/prerelease")
os.rename("dists/" + prefix, "updates/prerelease")
os.unlink("updates/prerelease/lib/update-version.txt")
makeupdate.make_update("updates/prerelease", revno)
os.chmod("renpy.py", 0755)
cmd = [
"./renpy.sh",
"launcher",
"distribute",
"launcher",
"--package",
"sdk",
"--destination",
destination,
"--no-update",
]
else:
cmd = [
"./renpy.sh",
"launcher",
"distribute",
"launcher",
"--destination",
destination,
]
print
print "Did you remember to rebuild the exe after the last change?"
subprocess.check_call(cmd)
# Sign the update.
if not args.fast:
subprocess.check_call([
"scripts/sign_update.py",
"/home/tom/ab/keys/renpy_private.pem",
os.path.join(destination, "updates.json"),
])
# Write 7z.exe.
sdk = "renpy-{}-sdk".format(zip_version)
if not args.fast:
# shutil.copy("renpy-ppc.zip", os.path.join(destination, "renpy-ppc.zip"))
with open("7z.sfx", "rb") as f:
sfx = f.read()
os.chdir(destination)
if os.path.exists(sdk):
shutil.rmtree(sdk)
subprocess.check_call([ "unzip", "-q", sdk + ".zip" ])
if os.path.exists(sdk + ".7z"):
os.unlink(sdk + ".7z")
sys.stdout.write("Creating -sdk.7z")
p = subprocess.Popen([ "7z", "a", sdk +".7z", sdk], stdout=subprocess.PIPE)
for i, _l in enumerate(p.stdout):
if i % 10 != 0:
continue
sys.stdout.write(".")
sys.stdout.flush()
if p.wait() != 0:
raise Exception("7z failed")
with open(sdk + ".7z", "rb") as f:
data = f.read()
with open(sdk + ".7z.exe", "wb") as f:
f.write(sfx)
f.write(data)
os.unlink(sdk + ".7z")
shutil.rmtree(sdk)
else:
os.chdir(destination)
if os.path.exists(sdk + ".7z.exe"):
os.unlink(sdk + ".7z.exe")
print
print "Did you run me with renpython -OO?"
print "Did you update renpy.py and launcher/script_version.rpy?"
print "Did you run with a RENPY_SCALE_FACTOR?"
if __name__ == "__main__":
main()
-1
View File
@@ -1 +0,0 @@
sphinx/build/html/
-137
View File
@@ -1,137 +0,0 @@
# This contains code for the new day planner. You probably
# don't want to change this file, but it might make sense to
# change many of the variables or styles defined here from
# other files.
init -100 python:
# The frame containing the day planner.
style.dp_frame = Style(style.frame)
style.dp_vbox = Style(style.vbox)
style.dp_hbox = Style(style.hbox)
# The frame and vbox containing a single choice.
style.dp_choices = Style(style.default)
style.dp_choices_vbox = Style(style.vbox)
style.dp_choices.xalign = 0.5
# Buttons.
style.dp_choice_button = Style(style.button)
style.dp_choice_button_text = Style(style.button_text)
style.dp_done_button = Style(style.button)
style.dp_done_button_text = Style(style.button_text)
# Labels.
style.dp_label = Style(style.label)
style.dp_label_text = Style(style.label_text)
# The title of the done button.
dp_done_title = "Done Planning"
# A map from period name to the information we know about that
# period.
__periods = { }
# The period we're updating.
__period = None
class __Period(object):
def __init__(self, name, var):
self.name = name
self.var = var
self.acts = [ ]
def dp_period(name, var):
__periods[name] = store.__period = __Period(name, var)
__None = object()
def dp_choice(name, value=__None, enable="True", show="True"):
if not __period:
raise Exception("Choices must be part of a defined period.")
if value is __None:
value = name
__period.acts.append((name, value, enable, show))
def __set_noncurried(var, value):
setattr(store, var, value)
return True
__set = renpy.curry(__set_noncurried)
label day_planner(periods):
python hide:
renpy.choice_for_skipping()
label day_planner_repeat:
if renpy.has_label("dp_callback"):
call dp_callback
python hide:
ui.window(style=style.dp_frame)
ui.vbox(style=style.dp_vbox)
ui.hbox(style=style.dp_hbox)
can_continue = True
for p in periods:
if p not in __periods:
raise Exception("Period %r was never defined." % p)
ui.window(style=style.dp_choices)
ui.vbox(style=style.dp_choices_vbox)
p = __periods[p]
v = getattr(store, p.var)
layout.label(p.name, "dp")
valid_choice = False
for name, value, enable, show in p.acts:
show = eval(show)
enable = eval(enable)
selected = (v == value)
if show:
layout.button(
name,
"dp_choice",
clicked=__set(p.var, value),
selected=selected,
enabled=enable,
)
if show and enable and selected:
valid_choice = True
if not valid_choice:
can_continue = False
ui.close()
ui.close() # hbox.
layout.button(
dp_done_title,
"dp_done",
clicked=ui.returns(False),
enabled=can_continue)
ui.close() # vbox
if ui.interact():
jump day_planner_repeat
else:
return
-328
View File
@@ -1,328 +0,0 @@
# The Ren'Py/DSE event dispatcher. This file contains the code that
# actually supports the running of events. Specifically, it contains
# code that determines which events are available, which events can
# run, and to actually run the events that should be run during a
# given period.
# This isn't really intended to be user-changable.
init -100 python:
# A list of all of the events that the system knowns about,
# it's filtered to determine which events should run when.
all_events = [ ]
# The base class for events. When constructed, an event
# automatically adds itself to all_events.
#
# The first parameter for this is a unique name for the event,
# which is also used as the label that is called when the
# event executes.
#
# All other parameters are expressions. These expressions can
# be either strings, or objects having an eval method. Many
# interesting objects are given below.
#
# Keyword arguments are also kept on the object. Currently,
# there is one useful keyword argument, priority. This
# controls the order in which events are in the event list.
# (Events with lower priority number are evaluated first. If a
# priority is not specified, it's 100.)
class event(object):
def __repr__(self):
return '<event ' + self.name + '>'
def __init__(self, name, *args, **kwargs):
self.name = name
exprs = [ ]
for i in args:
if isinstance(i, basestring):
exprs.append(event.evaluate(i))
else:
exprs.append(i)
self.exprs = exprs
self.priority = kwargs.get('priority', 100)
all_events.append(self)
# Checks to see if this event is valid. It's called with
# a list of events that have already checked out to be
# True, and returns True if this event checks out.
def check(self, valid):
for i in self.exprs:
if not i.eval(self.name, valid):
return False
return True
def properties(self):
rv = { }
for i in self.exprs:
rv.update(i.properties())
return rv
# The base class for all of the event checks given below.
class event_check(object):
def properties(self):
return { }
def __invert__(self):
return event.false(self)
def __and__(self, other):
return event.and_op(self, other)
def __or__(self, other):
return event.or_op(self, other)
# This evaluates the expression given as an argument, and the
# returns true if it evaluates to true.
class evaluate(event_check):
def __init__(self, expr):
self.expr = expr
def eval(self, name, valid):
return eval(self.expr)
# If present as a condition to an event, an object of this
# type ensures that the event will only execute once.
class once(event_check):
def eval(self, name, valid):
return name not in events_executed
# Returns True if no event of higher priority can execute,
# and false otherwise. In general, solo events should be
# the lowest priority, and are run if nothing else is.
class solo(event_check):
def eval(self, name, valid):
# True if valid is empty.
return not valid
# Returns True if no event of higher priority can execute.
# This also prevents other events from executing.
class only(solo):
def properties(self):
return dict(only=True)
# Returns True if the given events have happend already,
# at any time in the game. False if at least one hasn't
# happened yet.
class happened(event_check):
def __init__(self, *events):
self.events = events
def eval(self, name, valid):
for i in self.events:
if i not in events_executed:
return False
return True
# Returns True probability of the time, where probability
# is a number between 0 and 1.
class random(event_check):
def __init__(self, probability):
self.probability = probability
def eval(self, name, valid):
return renpy.random.random() <= self.probability
# Chooses only one from the group.
class choose_one(event_check):
def __init__(self, group, group_count=1):
self.group = group
self.group_count = group_count
def eval(self, name, valid):
return True
def properties(self):
return dict(group=self.group,
group_count=self.group_count)
# Evaluates its argument, and returns true if it is false
# and vice-versa.
class false(event_check):
def __init__(self, cond):
self.cond = cond
def eval(self, name, valid):
return not self.cond.eval(name, valid)
# Handles the and operator.
class and_op(event_check):
def __init__(self, *args):
self.args = args
def eval(self, name, valid):
for i in self.args:
if not i.eval(name, valid):
return False
return True
# Handles the or operator.
class or_op(event_check):
def __init__(self, *args):
self.args = args
def eval(self, name, valid):
for i in self.args:
if i.eval(name, valid):
return True
return False
# Returns True if all of the events given as arguments have
# happened yesterday or earlier, or False otherwise.
class depends(event_check):
def __init__(self, *events):
self.events = events
def eval(self, name, valid):
for i in self.events:
if i not in events_executed_yesterday:
return False
return True
# The number of periods to skip.
skip_periods = 0
# This returns True if the current period should be skipped,
# or False if the current period should execute. If it returns
# True, it decrements skip_periods.
def check_skip_period():
global skip_periods
if skip_periods:
skip_periods -= 1
return True
else:
return False
def __events_init():
store.events_executed = { }
store.events_executed_yesterday = { }
config.start_callbacks.append(__events_init)
# This should called at the end of a (game) day, to let things
# like depends_yesterday to work.
label events_end_day:
$ skip_periods = 0
python hide:
# We can't skip between days.
skip_periods = 0
for k in events_executed:
events_executed_yesterday[k] = True
return
# This is called once per period, to determine, and then execute, the
# events that should be run for that period.
label events_run_period:
$ events = [ ]
python hide:
eobjs = [ ]
egroups = { }
eingroup = { }
for i in all_events:
if not i.check(eobjs):
continue
eobjs.append(i)
props = i.properties()
if 'group' in props:
group = props['group']
count = props['group_count']
egroups.setdefault(group, [ ]).extend([ i ] * count)
eingroup[i] = group
if 'only' in props:
break
echosen = { }
for k in egroups:
echosen[k] = renpy.random.choice(egroups[k])
for i in eobjs:
if i in eingroup and echosen[eingroup[i]] is not i:
continue
events.append(i.name)
while not check_skip_period() and events:
$ _event = events.pop(0)
$ events_executed[_event] = True
call expression _event from call_expression_event_1
return
# If this is jumped to, it will end the current period immediately,
# and return control to the main program.
label events_end_period:
$ skip_period = 1
return
# If this is jumped to, it will end the current period and skip
# the next period. Use this if, say, the user goes on a date that
# takes up two time slots.
label events_skip_period:
$ skip_period = 2
return
init 100:
python hide:
# Sort all events on priority.
all_events.sort(key=lambda i : i.priority)
python hide:
for i in all_events:
if not renpy.has_label(i.name):
raise Exception("'%s' is defined as an event somewhere in the game, but no label named '%s' was defined anywhere." % (i.name, i.name))
-767
View File
@@ -1,767 +0,0 @@
# This file contains the events that will be part of the game. It's
# expected that the user will add and remove events as appropriate
# for this game.
# Some characters that are used in events in the game.
init:
$ t = Character('Teacher')
$ gg = Character('Glasses Girl', color=(192, 255, 192, 255))
$ sg = Character('Sporty Girl', color=(255, 255, 192, 255))
$ bg = Character('Both Girls')
$ narrator = Character(' ')
# First up, we define some simple events for the various actions, that
# are run only if no higher-priority event is about to occur.
init:
$ event("class", "act == 'class'", event.only(), priority=200)
$ event("class_bad", "act == 'class'", priority=210)
$ event("cut1", "act == 'cut'", event.choose_one('cut'), priority=200)
$ event("cut2", "act == 'cut'", event.choose_one('cut'), priority=200)
$ event("study", "act == 'study'", event.solo(), priority=200)
$ event("hang", "act == 'hang'", event.solo(), priority=200)
$ event("exercise", "act == 'exercise'", event.solo(), priority=200)
$ event("play", "act == 'play'", event.solo(), priority=200)
label class:
"I make it to class just in time, and proceed to listen to the
teacher droning on about a wide range of topics, none of which
are remotely interesting."
return
# For test purposes only.
label class_bad:
"You shouldn't be seeing this."
"This is because class was declared with event.only(), which
should suspend processing of further events."
"This is really for testing purposes only."
return
label cut1:
"I cut class, and spend the morning goofing off instead."
$ intelligence -= 10
return
label cut2:
"I cut class, and spend the morning playing computer games."
return
label study:
"I head on down to the library, and start reading about the topics
I should have been reading about in class."
$ intelligence += 10
return
label hang:
"I spend the afternoon hanging out with my friends, killing
some time."
return
label exercise:
"I decide to go out for a run through the town, to keep myself in
shape."
$ strength += 10
return
label play:
"I pop a DVD into my video game console, and spend the evening
rolling small cities up into balls."
$ strength -= 10
return
# Below here are special events that are triggered when certain
# conditions are true.
# This is an introduction event, that runs once when we first go
# to class.
init:
$ event("introduction", "act == 'class'", event.once(), event.only())
label introduction:
"I run to school, and make it to my seat just as the bell
signalling the start of class rings."
t "Before we start, I have an announcement to make."
t "We will have two new students joining us. Girls, come on in."
"Two girls walk in, and stand in front of the class."
"They're twins."
"Identical twins."
"Identical black hair, and the same pretty face."
"Despite that, it's still fairly easy to tell them apart."
"The one on the left is wearing glasses."
"Not too thick, but enough to let me know she probably reads alot
of books."
"If I look a little closely, I can find another difference."
"The one on the right probably exercises a bit more."
"I can tell by the muscle tone in her legs."
"I realize that I'm staring at her legs, and quickly look up."
"Suddenly, I realize that she's been talking for all this town."
sg "... to this town. And we hope to be friends with all of you."
sg "Well, that's about it. Sis, do you have anything to say?"
"The girl with glasses pauses for a second, and then quickly says:"
gg "{size=-4}It's good to meet you all.{/size}"
"She stops, and goes back to not saying anything."
t "Well, if that's all, you can take your seats and we can start
the class."
"They do, and our teacher begins his lecture."
"I don't think anyone pays much attention to it, however."
return
# These are the events with glasses girl.
init:
# The glasses girl is studying in the library, but we do not
# talk to her.
#
#
$ event("gg_studying",
# This takes place when the action is 'study'.
"act == 'study'",
# This will only take place if no higher-priority
# event will occur.
event.solo(),
# This takes place at least one day after seeing the
# introduction event.
event.depends("introduction"),
# This takes priority over the study event.
priority=190)
# She asks to borrow our pen.
$ event("borrow_pen",
# This takes place when we go to study, and we have an int
# >= 50.
"act == 'study' and intelligence >= 50",
# It runs only once.
event.once(),
# It requires the introduction event to have run at least
# one day before.
event.depends("introduction"))
# After the pen, she smiles when she sees us.
$ event("gg_smiling", "act == 'study'",
event.solo(), event.depends("borrow_pen"),
priority = 180)
# The bookslide.
$ event("bookslide", "act == 'study' and intelligence == 100",
event.once(), event.depends("borrow_pen"))
# She makes us cookies.
$ event("cookies", "act == 'study'",
event.once(), event.depends("bookslide"))
# Her solo ending.
$ event("gg_confess", "act == 'class'",
event.once(), event.depends("cookies"))
label gg_studying:
"I head to the library, to get some studying done."
"The glasses girl is there, but she's busy reading a book, taking
notes as she does so."
"I decide not to disturb her, and instead start reading my own
book."
$ intelligence += 10
return
label borrow_pen:
"I head to the library, to get some studying done."
"The glasses girl is there, but she's busy reading a book."
"I decide not to disturb her, and instead start reading my own
book."
"Suddenly, I feel a tap on my shoulder."
"I look up, and see the glasses girl standing right next to me."
gg "Excuse me, but can I borrow your pen?"
gg "Mine ran out of ink."
"I dig through my bag, to find the pen I had stashed there."
"While I'm looking, I point out that she seems to come to the
library alot."
gg "Hm... I guess you're right."
gg "There's so much stuff here, and I want to know about it all."
gg "Surely, you must feel the same way, as you're here almost as
much as I am."
"I don't have the heart to tell her that I'm only here to study so
that I don't fail out."
"My hand brushes the pen, and I quickly pull it out and give it to
her."
gg "Thank you."
"She says, and she goes back to studying."
return
label gg_smiling:
"I head to the library, to get some studying done."
"The glasses girl is there, and smiles at me for a second before
turning back to her book."
"I decide not to disturb her, and instead start reading my own
book."
$ intelligence += 10
return
label bookslide:
"I head to the library, to get some studying done."
"The glasses girl is standing right by the entrance, putting a
book back into a bookcase containing science books."
"It looks quite old, and quite weak, as if it could break at any
time."
"Suddenly, I hear a loud crack come from the bookcase."
"Without thinking, I throw myself between the girl and the
bookcase, pushing her out of the way in the process."
"As the shelves fail one by one, I'm hit with large textbooks on
topics ranging from Astronomy to Zoology."
"She's safe, but I'm knocked off my feet by the falling books."
"Before the dust even settled, the girl with glasses realized what
happened and asked:"
gg "Are you alright?"
"I tell her that I am, all the while rubbing a bruise left by a
particularly large Physics book."
gg "You saved me."
"She points out. I shrug... I guess I did, but it's not like I'm a
hero or anything."
"She extends out her hand, I take it, and she helps me to get up."
gg "Wow... Um..."
"She doesn't know what to say."
"I suggest that we help clean up the mess, mostly to take her off
the spot."
"She agrees, and together we begin piling the books up into neat
piles."
return
label cookies:
"I head to the library, to get some studying done."
"The glasses girl is there, apparently waiting for me."
"She's holding a package in her hands."
gg "Here."
"She says, and she hands me the package."
"I take it from her, and open it."
"It contains fresh homemade cookies. Ginger snaps, I think."
gg "It's to thank you."
"She points out... She's probably not used to this. Especially
with guys."
"I take one of them, and stick it in my mouth."
"The taste is exquisite."
"It's perhaps one of the best cookies I've ever tasted."
"Of course it is. It's the only cookie I'd ever tasted that was
made for me by a beutiful girl."
"I tell her this... that it's delicious, not the girl part."
"But I do let slip that if I could eat these every day, I'd be the
happiest guy in the world."
"At this, she can only blush."
return
label gg_confess:
"I once again barely make it to class on time."
"I sit down, at my desk, and put some of my books into it."
"My hand brushes a folded sheet of paper, one I didn't remember
putting in there."
"It's a girl's handwriting... \"Meet me on the roof at lunch.\""
"That's all it says... no signature or anything."
"Lunch is a few hours away, but the time passes like a blur."
"It's all I can do to avoid racing up to the roof... but I give it
some time anyway."
"It wouldn't make sense for me to get there first."
"I let two minutes elapse before leaving the classroom, and then
slowly walk the flights of stairs up to the roof."
"Standing there, I find the glasses girl."
"She's holding what looks like a homemade lunch... big enough for
two."
"I look at it, then her, then remember what I had said after she
made me the cookies."
"Finally, I ask her... \"Does this mean?\""
"She nods. It's all the confirmation I need."
"I sit down next to my new girlfriend... and together we start
eating her lunch."
"I'm probably the happiest guy in the world."
"But I still have to find out her name."
".:. Ending 1."
$ renpy.full_restart()
init:
$ event("catchme", "act == 'exercise'",
event.depends('introduction'), event.once())
$ event("cantcatchme", "act == 'exercise'",
event.depends('catchme'), event.solo(), priority=190)
$ event("caughtme", "act == 'exercise' and strength >= 50",
event.depends('catchme'), event.once())
$ event("together", "act == 'exercise' and strength >= 50",
event.depends('caughtme'), event.solo(), priority=180)
$ event("apart", "act == 'exercise' and strength < 50",
event.depends('caughtme'), event.solo(), priority=180)
$ event("pothole", "act == 'exercise' and strength >= 100",
event.depends('caughtme'), event.once())
$ event("dontsee", "act == 'exercise'",
event.depends('pothole'), event.solo(), priority=170)
$ event("sg_confess", "act == 'class'",
event.depends('dontsee'), event.once())
label catchme:
"I decide to go out for a run, to keep myself in shape."
"As I'm running through the town, I see a girl."
"She's one of the twins who transferred into my class."
"She waves, and comes over to me."
sg "I didn't know you were a runner."
"I point out that I'm not really a runner... I just run a little
bit at a time."
"I ask her if she wants to run with me for a while."
sg "As if! You couldn't keep up with me."
"I point out that I probably can."
sg "Well, let's see."
"We set off running, but she quickly pulls past me."
sg "See? Well, maybe we can try it again when you're a bit
faster."
sg "Until then, later."
"Even though I'm jogging, she pulls away as if it is nothing."
return
label cantcatchme:
"I'm out running again, when the sporty girl catches up to me."
sg "Still at it?"
sg "Well, keep up the good work. One day you'll be as fast as me!"
sg "Well, maybe."
"She pulls out past me, and disappears into the distance. One day
I'll catch up to her."
$ strength += 10
return
label caughtme:
"I'm out running again, when the sporty girl catches up to me."
sg "Still at it?"
sg "Well, keep up the good work. One day you'll be as fast as me!"
sg "Well, maybe."
"Today, however, I'm not about to let this stand unchallenged."
"I break out into a run, and for the first time ever, I keep up
with her."
"We both run, neck and neck, me keeping up with her."
"Finally, she starts slowing down, and we come to a stop
together."
sg "Not bad."
"She pauses to catch her breath."
sg "You've been practicing, and it really shows."
sg "You've finally become fast enough to run with me."
"I nod, accepting her praise."
sg "We should do this more often... it's better to run with
someone else, to keep the challenge up."
"I nod again."
sg "Well, shall we go?"
"I nod a third time, and we take off, running side by side."
$ strength += 10
return
label together:
"I start running, and meet up with the sporty girl as she passes
the street in front of my house."
"She's still better than me... she's been running for over a mile
before reaching this point."
"Still, I can keep up with her for the rest of the run. And that's
not bad."
$ strength += 10
return
label apart:
"I start running, and meet up with the sporty girl as she passes
the street in front of my house."
"I try to keep up with her, but she pulls away from me."
"When she's a block away, she slows down and lets me catch up."
sg "It's your own fault... this is what you get for not
practicing."
"She's right, of course, and I redouble my efforts to try to keep
up with her."
$ strength += 10
return
label pothole:
"I start running, and meet up with the sporty girl as she passes
the street in front of my house."
"We run together for several miles."
"I think about how much I've improved in our time together."
"And, although she probably won't admit it, I think she's improved
as well."
"I guess a little friendly competition is usually for the best."
"A small yelp pulls me out of my thought."
sg "Ow!"
"The sporty girl sits down, grabbing her ankle."
"I ask her what happened."
sg "I... hit a... pothole. Twisted my... ankle."
"I wince in sympathy."
"We wait a bit. I'm not sure what to do."
"Finally, I ask her if she can walk on it."
"She tries for a bit, but then winces in pain."
sg "No, I don't think so."
"I realize that we can't stay here."
"And so, I crouch down and motion for her to climb up onto my
back."
sg "What are you doing?"
"I explain that she can't stay out in the middle of the street
forever, and she won't get any help until I can get her home."
"And the only way to do that is for me to carry her."
"She accepts this, and climbs up onto my back."
"She wraps her arms around my neck, and I place my hands
underneath her to make a seat."
"I stand up, and start carrying her home."
return
label dontsee:
"I go running again."
"But this time, I don't see the sporty girl."
"I finish the course that we usually take, but it's not the same
without her."
return
label sg_confess:
"I once again barely make it to class on time."
"I sit down, at my desk, and put some of my books into it."
"My hand brushes a folded sheet of paper, one I didn't remember
putting in there."
"It's a girl's handwriting... \"Meet me on the roof at lunch.\""
"That's all it says... no signature or anything."
"Lunch is a few hours away, but the time passes like a blur."
"It's all I can do to avoid racing up to the roof... but I give it
some time anyway."
"It wouldn't make sense for me to get there first."
"I let two minutes elapse before leaving the classroom, and then
slowly walk the flights of stairs up to the roof."
"Standing there, I find the sporty girl."
"She's leaning on a crutch."
"I look at it for a second, and she notices that."
sg "I went to the doctor, and he gave me this."
sg "Looks like we won't be running together for a while."
"I nod."
sg "And that's why I asked you here."
sg "I couldn't stand the though of not seeing you for a few
weeks."
"I search my feelings, and realize I feel the same way."
sg "So I thought..."
"She doesn't say it... she doesn't need to."
"We both know how we feel about each other."
"And with that, we went from being running partners to partners in
a deeper sense."
"Now if I only knew her name..."
".:. Ending 2."
$ renpy.full_restart()
init:
# This needs to be higher-priority than either girl's ending.
$ event('both_confess', 'act == "class"',
event.depends("dontsee"), event.depends("cookies"),
event.once(), priority = 50)
label both_confess:
"I once again barely make it to class on time."
"I sit down, at my desk, and put some of my books into it."
"My hand brushes a folded sheet of paper, then another."
"I take the first one out, and read it."
"It's a girl's handwriting... \"Meet me on the roof at lunch.\""
"That's all it says... no signature or anything."
"I take a look at the second one, and it says the same thing."
"Sure, the handwriting is a little different, but..."
"Lunch is a few hours away, but the time passes like a blur."
"It's all I can do to avoid racing up to the roof... but I give it
some time anyway."
"I let two minutes elapse before leaving the classroom, and then
slowly walk the flights of stairs up to the roof."
"Standing there are the twins."
"Both of them."
"As in, the two notes came from the two twins."
"I ask them what they are doing there, feigning ignorance."
sg "Well, I invited you up here to confess to you..."
sg "... and then I found out that my sister here was about to do
the same thing."
gg "{size=-4}...I was...{/size}"
sg "When we found out, we were quite shocked, but after comparing
notes, we decide what we're going to do..."
"I quickly run through the possibilities in my head."
"The best cases involve them never talking to me again."
"The worst cases involve me being thrown off the roof."
bg "We're going to share you!"
"Eh?"
"That wasn't something I considered."
"Each of the girls grabs onto one of my arms."
"I don't know what the future holds for us..."
"... and I don't know if this will work out."
"But I do know that one day I will work up the courage to find out
their names."
".:. Ending 3."
$ renpy.full_restart()
-163
View File
@@ -1,163 +0,0 @@
# This is the main program. This can be changed quite a bit to
# customize it for your program... But remember what you do, so you
# can integrate with a new version of DSE when it comes out.
# Set up a default theme.
init python:
register_stat("Strength", "strength", 10, 100)
register_stat("Intelligence", "intelligence", 10, 100)
dp_period("Morning", "morning_act")
dp_choice("Attend Class", "class")
dp_choice("Cut Class", "cut")
dp_period("Afternoon", "afternoon_act")
dp_choice("Study", "study")
dp_choice("Hang Out", "hang")
dp_period("Evening", "evening_act")
dp_choice("Exercise", "exercise")
dp_choice("Play Games", "play")
# This is the entry point into the game.
label start:
# Initialize the default values of some of the variables used in
# the game.
$ day = 0
# Show a default background.
scene black
# The script here is run before any event.
"In case you're just tuning in, here's the story of my life to
date."
"I'm a guy in the second year of high school."
"I'm not good at sports or school or even something as simple as
remembering peoples names."
"In short, I am your usual random loser guy."
"And this is my story..."
# We jump to day to start the first day.
jump day
# This is the label that is jumped to at the start of a day.
label day:
# Increment the day it is.
$ day += 1
# We may also want to compute the name for the day here, but
# right now we don't bother.
"It's day %(day)d."
# Here, we want to set up some of the default values for the
# day planner. In a more complicated game, we would probably
# want to add and remove choices from the dp_ variables
# (especially dp_period_acts) to reflect the choices the
# user has available to him.
$ morning_act = None
$ afternoon_act = None
$ evening_act = None
# Now, we call the day planner, which may set the act variables
# to new values. We call it with a list of periods that we want
# to compute the values for.
call day_planner(["Morning", "Afternoon", "Evening"])
# We process each of the three periods of the day, in turn.
label morning:
# Tell the user what period it is.
centered "Morning"
# Set these variables to appropriate values, so they can be
# picked up by the expression in the various events defined below.
$ period = "morning"
$ act = morning_act
# Ensure that the stats are in the proper range.
$ normalize_stats()
# Execute the events for the morning.
call events_run_period
# That's it for the morning, so we fall through to the
# afternoon.
label afternoon:
# It's possible that we will be skipping the afternoon, if one
# of the events in the morning jumped to skip_next_period. If
# so, we should skip the afternoon.
if check_skip_period():
jump evening
# The rest of this is the same as for the morning.
centered "Afternoon"
$ period = "afternoon"
$ act = afternoon_act
$ normalize_stats()
call events_run_period
label evening:
# The evening is the same as the afternoon.
if check_skip_period():
jump night
centered "Evening"
$ period = "evening"
$ act = evening_act
$ normalize_stats()
call events_run_period
label night:
# This is now the end of the day, and not a period in which
# events can be run. We put some boilerplate end-of-day text
# in here.
centered "Night"
"It's getting late, so I decide to go to sleep."
# We call events_end_day to let it know that the day is done.
call events_end_day
# And we jump back to day to start the next day. This goes
# on forever, until an event ends the game.
jump day
# This is a callback that is called by the day planner. One of the
# uses of this is to show the statistics to the user.
label dp_callback:
# Add in a line of dialogue asking the question that's on
# everybody's mind.
$ narrator("What should I do today?", interact=False)
$ display_stats()
return
-88
View File
@@ -1,88 +0,0 @@
init -100 python:
style.stats_frame = Style(style.frame)
style.stats_vbox = Style(style.vbox)
style.stats_label = Style(style.label)
style.stats_label_text = Style(style.label_text)
style.stat_side = Style(style.default)
style.stat_label = Style(style.label)
style.stat_label_text = Style(style.label_text)
style.stat_bar = Style(style.bar)
style.stat_value_label = Style(style.label)
style.stat_value_label_text = Style(style.label_text)
__dse_stats = [ ]
class __Stat(object):
def __init__(self, name, var, default, max):
self.name = name
self.var = var
self.default = default
self.max = max
def __init_stats():
for s in __dse_stats:
setattr(store, s.var, s.default)
config.start_callbacks.append(__init_stats)
def register_stat(name, var, default, max):
__dse_stats.append(__Stat(name, var, default, max))
def normalize_stats():
for s in __dse_stats:
v = getattr(store, s.var)
if v > s.max:
v = s.max
if v < 0:
v = 0
setattr(store, s.var, v)
def display_stats(name=True, bar=True, value=True, max=True):
normalize_stats()
ui.window(style=style.stats_frame)
ui.vbox(style=style.stats_vbox)
layout.label("Statistics", "stats")
for s in __dse_stats:
v = getattr(store, s.var)
ui.side(['l', 'r', 'c'], style=style.stat_side)
if name:
layout.label(s.name, "stat")
else:
ui.null()
if value and max:
layout.label("%d/%d" % (v, s.max), "stat_value")
elif value:
layout.label("%d" % (v,), "stat_value")
elif max:
layout.label("%d" % (max,), "stat_value")
else:
ui.null()
if bar:
ui.bar(s.max, v, style=style.stat_bar)
else:
ui.null()
ui.close()
ui.close()
-49
View File
@@ -1,49 +0,0 @@
# This file contains styles for the day planner.
init python:
# Place the day planner.
style.dp_frame.ypos = 120
style.dp_frame.yanchor = 0.0
style.dp_frame.xalign = 0.5
# Spacing betweeen the choices and the done button.
style.dp_vbox.box_spacing = 20
# Spacing between the choice columns.
style.dp_hbox.box_spacing = 20
# Center the choices.
style.dp_choices.xalign = 0.5
# Center the label of each choice.
style.dp_label.xalign = 0.5
style.dp_label_text.text_align = 0.5
# Make each choice button the same size, and centered.
style.dp_choice_button.size_group = "dp_choice"
style.dp_choice_button.xalign = 0.5
# Center the done button.
style.dp_done_button.xalign = 0.5
# Put a margin on the stats frame.
style.stats_frame.xmargin = 10
style.stats_frame.ymargin = 5
# Space between the label and the stats.
style.stats_vbox.box_first_spacing = 10
# Put blank space around each stat name, and right-justify.
style.stat_label.xminimum = 140
style.stat_label_text.xalign = 1.0
style.stat_label.xmargin = 5
# Put blank space around each stat value, and right-justify.
style.stat_value_label.xminimum = 100
style.stat_value_label_text.xalign = 1.0
# Center the stat bar vertically.
style.stat_bar.yalign = 0.5
-2
View File
@@ -1,2 +0,0 @@
description = "A game that demonstrates the use of the dating-sim engine. A non-graphical proof of concept."
ro = True
+1 -1
View File
@@ -112,7 +112,7 @@ display: none;
<dd>Toggles fullscreen mode</dd>
<dt>S</dt>
<dd>Takes a screenshot, saving it in a file named screenshotxxxx.png, where xxxx is a serial number.</dd>
<dt>Alt-H, Command-H</dt>
<dt>Alt-M, Command-H</dt>
<dd>Hides (iconifies) the window.</dd>
<dt>Alt-F4, Command-Q</dt>
<dd>Quits the game.</dd>
Binary file not shown.
+4
View File
@@ -0,0 +1,4 @@
import renpy
# Do nothing when the editor is invoked.
Editor = renpy.editor.Editor
-6
View File
@@ -1,6 +0,0 @@
# Name: None
# Version: 1
# Description: Disables the automatic launching of an editor.
config.editor = None
config.editor_transient = None
+4
View File
@@ -0,0 +1,4 @@
import renpy
# Pass the file off to the system editor (as determined by file associations).
Editor = renpy.editor.SystemEditor
-177
View File
@@ -1,177 +0,0 @@
init python:
import renpy.tools.archiver as archiver
import os
import os.path
import fnmatch
label archiver:
python hide:
# Get the options
name = project.info.get('archive_name', "data")
include = project.info.get('archive_include', "*.png *.gif *.jpg")
exclude = project.info.get('archive_exclude', "presplash.png")
# Allow the user to set the options.
while True:
set_tooltip("")
screen()
ui.vbox()
title(_(u"Archiver"))
text(_(u"The archiver allows you to obfuscate your game by including files in an archive file."))
ui.null(height=15)
text_variable(_(u"Archive Name:"), name, "name",
_(u"The name of the archive to create."))
text_variable(_(u"Include Patterns:"), include, "include",
_(u"Files matching these patterns are included in the archive."))
text_variable(_(u"Exclude Patterns:"), exclude, "exclude",
_(u"Files matching these patterns are excluded from the archive."))
ui.null(height=15)
button(_(u"Archive"), ui.returns("archive"), _(u"Build the archive."))
button(_(u"Cancel"), ui.jumps("top"), "")
ui.close()
act = interact()
if act == "name":
name = input(
_(u"Archive Name"),
_(u"The name of the archive file to create, without the .rpa extension.\n\nThe \"data\" archive is loaded automatically. Other archives must be added to config.archives."),
name)
elif act == "include":
include = input(
_(u"Include Patterns"),
_(u"This is a space-separated list of file patterns. Files matching these patterns are added to the archive.\n\nAsterisks (*) can be used as a wildcard."),
include)
elif act == "exclude":
exclude = input(
_(u"Include Patterns"),
_(u"This is a space-separated list of file patterns. Files matching these patterns are excluded from the archive. If a file is matched by both an exclude and include pattern, the exclude takes precedence.\n\nAsterisks (*) can be used as a wildcard."),
exclude)
elif act == "archive":
break
# Store the options.
project.info["archive_name"] = name
project.info["archive_include"] = include
project.info["archive_exclude"] = exclude
project.save()
# Break up the extension lists.
include = [ i.strip() for i in include.split() ]
exclude = [ i.strip() for i in exclude.split() ]
# Get the gamedir and the archived dir.
gamedir = os.path.join(project.path, "game")
archived = os.path.join(project.path, "archived")
# The prefix of the archive file.
prefix = os.path.join(gamedir, name)
archived_files = set()
files = [ ]
# Choose files to archive.
set_tooltip("")
info(
_(u"Scanning Files..."),
"")
for bdir in (gamedir, archived):
for dirname, dirs, filenames in os.walk(bdir):
dirs[:] = [ i for i in dirs if not i[0] == '.' ]
for fn in filenames:
fullfn = dirname + "/" + fn
shortfn = fullfn[len(bdir)+1:]
if fn[0] == ".":
continue
if shortfn in archived_files:
continue
should_archive = False
for i in include:
if fnmatch.fnmatch(fn, i):
should_archive = True
for i in exclude:
if fnmatch.fnmatch(fn, i):
should_archive = False
if not should_archive:
continue
files.append((fullfn, shortfn))
archived_files.add(shortfn)
if not files:
error(_(u"The patterns did not match any files, so no archive was created."))
# Actually archiving files.
info(_(u"Archiving Files..."), "")
archiver.archive(prefix, files)
# Move files out of the way.
for fullfn, shortfn in files:
afn = archived + "/" + shortfn
if fullfn == afn:
continue
try:
os.makedirs(os.path.dirname(afn))
except:
pass
try:
os.rename(fullfn, afn)
except:
os.rename(afn, afn + ".old")
os.rename(fullfn, afn)
os.unlink(afn + ".old")
# Report success.
screen()
ui.vbox()
title(_(u"Success"))
text(_(u"The files have been added to the archive, and moved into the \"archived\" directory. Future runs of the archiver will archive files in both the \"game\" and \"archived\" directories."))
ui.null(height=20)
button(_(u"Return"), ui.jumps("top"), None)
ui.close()
interact()
-324
View File
@@ -1,324 +0,0 @@
init python:
import codecs
import re
import sys
##########################################################################
# Code to update options.rpy
def list_logical_lines(filename):
"""
This reads in filename, and turns it into a list of logical
lines.
"""
f = codecs.open(filename, "rb", "utf-8")
data = f.read()
f.close()
# The result.
rv = []
# The current position we're looking at in the buffer.
pos = 0
# Looping over the lines in the file.
while pos < len(data):
# The line that we're building up.
line = ""
# The number of open parenthesis there are right now.
parendepth = 0
# Looping over the characters in a single logical line.
while pos < len(data):
c = data[pos]
if c == '\n' and not parendepth:
rv.append(line)
pos += 1
# This helps out error checking.
line = ""
break
# Backslash/newline.
if c == "\\" and data[pos+1] == "\n":
pos += 2
line += "\\\n"
continue
# Parenthesis.
if c in ('(', '[', '{'):
parendepth += 1
if c in ('}', ']', ')') and parendepth:
parendepth -= 1
# Comments.
if c == '#':
while data[pos] != '\n':
line += data[pos]
pos += 1
continue
# Strings.
if c in ('"', "'", "`"):
delim = c
line += c
pos += 1
escape = False
while pos < len(data):
c = data[pos]
if escape:
escape = False
pos += 1
line += c
continue
if c == delim:
pos += 1
line += c
break
if c == '\\':
escape = True
line += c
pos += 1
continue
continue
line += c
pos += 1
if line:
rv.append(line)
return rv
def switch_theme(theme_function, name):
"""
Switches the theme of the current project to the named theme.
"""
theme_functions = set(i[1] for i in themes)
td = theme_data[name].copy()
td["name"] = name
# Did we change the file at all?
changed = False
filename = os.path.join(project.gamedir, "options.rpy")
out = codecs.open(filename + ".new", "wb", "utf-8")
for l in list_logical_lines(filename):
m = re.match(r' theme.(\w+)\(', l)
if m:
if m.group(1) in theme_functions:
l = theme_templates[theme_function] % td
changed = True
out.write(l + "\n")
out.close()
if changed:
try:
os.unlink(filename + ".bak")
except:
pass
os.rename(filename, filename + ".bak")
os.rename(filename + ".new", filename)
else:
os.unlink(filename + ".new")
error(_(u"Could not modify options.rpy. Perhaps it was changed too much."))
set_tooltip(_(u"Theme changed to %s.") % name)
renpy.jump("top")
curried_switch_theme = renpy.curry(switch_theme)
##########################################################################
# Code that handles display.
current_theme_function = None
current_theme = None
def show_theme(function, name, target):
"""
Changes from the current theme to the theme named `name`.
"""
if current_theme_function == function and current_theme == name:
return
store.current_theme_function = function
store.current_theme = name
td = theme_data[name].copy()
td["rounded_window"] = False
renpy.style.restore(style_backup)
getattr(theme, function)(**td)
customize_styles()
renpy.style.rebuild()
renpy.jump(target)
curried_show_theme = renpy.curry(show_theme)
def theme_demo():
# The sample area, that shows what the theme looks like.
ui.window(style='default', background="#444", xpadding=1, ypadding=1)
ui.window(style='gm_root', xpadding=5, ypadding=5)
ui.vbox(5)
# Display Preference.
ui.window(style=style.prefs_pref_frame)
ui.vbox(style=style.prefs_pref_box)
ui.hbox(style=style.prefs_pref_choicebox)
layout.label(_(u"Display"), "prefs")
layout.button(_(u"Window"), "prefs", clicked=does_nothing, selected=True)
layout.button(_(u"Fullscreen"), "prefs", clicked=does_nothing, selected=False)
layout.button(_(u"Planetarium"), "prefs", clicked=None, selected=False)
ui.close()
ui.close()
# Volume Preference
ui.window(style=style.prefs_pref_frame)
ui.vbox(style=style.prefs_pref_box)
layout.label(_(u"Music Volume"), "prefs")
ui.vbox(style=style.prefs_volume_box)
ui.bar(128,
92,
changed=does_nothing,
style=style.prefs_volume_slider)
layout.button(_(u"Test"), "soundtest", clicked=does_nothing)
ui.close()
ui.close()
ui.close() # vbox
# Used to have buttons not do anything.
def does_nothing(*args):
return
label choose_theme:
python:
if not os.path.exists(os.path.join(project.gamedir, "options.rpy")):
error(_(u"The options.rpy file does not exist in the game directory, so this launcher cannot change the theme."))
current_theme = None
theme_adjustment = ui.adjustment()
label repeat_choose_theme:
python hide:
tip = _(u"Themes control the basic look of interface elements. You'll be able to pick a color scheme next.")
screen()
ui.vbox()
title(_(u"Choose Theme"))
ui.grid(2, 1, padding=10, xfill=True)
# The scroll area, that lets the user pick a theme.
scrolled('top', theme_adjustment)
ui.vbox()
for name, function, exemplar in themes:
button(name,
ui.returns(function),
"",
hovered=curried_show_theme(function, exemplar, "repeat_choose_theme"),
unhovered=does_nothing)
ui.close() # vbox
ui.close() # scrolled
theme_demo()
ui.close() # grid
ui.close() # vbox
set_tooltip(tip)
store.theme_function = interact()
label choose_color_scheme:
python:
current_theme = None
theme_adjustment = ui.adjustment()
label repeat_choose_color_scheme:
python hide:
tip = _(u"Please choose a color scheme for your project.")
themes = theme_data.keys()
themes.sort()
screen()
ui.vbox()
title(_(u"Choose Color Scheme"))
ui.grid(2, 1, padding=10, xfill=True)
# The scroll area, that lets the user pick a theme.
scrolled('choose_theme', theme_adjustment)
ui.vbox()
for i in themes:
button(i,
curried_switch_theme(theme_function, i),
"",
hovered=curried_show_theme(theme_function, i, "repeat_choose_color_scheme"),
unhovered=does_nothing)
ui.close() # vbox
ui.close() # scrolled
theme_demo()
ui.close() # grid
ui.close() # vbox
set_tooltip(tip)
interact()
-536
View File
@@ -1,536 +0,0 @@
import os
import os.path
import zipfile
import tarfile
import time
import sys
import struct
import zlib
zlib.Z_DEFAULT_COMPRESSION = 9
import binascii
import change_icon
import argparse
# The directory containing the project that we'll be distributing.
project_path = None
# The path to the Ren'Py base directory.
renpy_base = None
# A function that is called to give information about what is going
# on now.
def info(title, body):
return
# A function that is called to give a progress report.
def progress(title, total, amount):
amount += 1
if amount % 25 == 0:
print title, amount, "of", total
# A translation function.
def _(s):
return s
# These are files that are ignored wherever they are found in a
# distribution.
ignored_files = (
"thumbs.db",
"traceback.txt",
"errors.txt",
"files.txt",
"saves"
)
# These are files (and directories) that are ignored when found in
# the root directory of the distribution.
root_ignored_files = (
"common",
"renpy",
"renpy.code",
"python23.dll",
"python24.dll",
"python25.dll",
"msvcr71.dll",
"lib",
"iliad-icon.png",
"manifest.xml",
"icon.ico",
"icon.icns",
"launcherinfo.py",
"archived",
)
# Extensions that should be made executable.
executable_extensions = (
"MacOS",
"so",
"dylib",
".sh",
"python",
"python.real",
)
class MyZipFile(zipfile.ZipFile):
"""
Modified ZipFile class that can insert a file into the archive,
using a supplied ZipInfo object. Code comes from the writestr
and write methods of ZipFile.
"""
def write_file_with_zipinfo(self, filename, zinfo, compress_type=None):
"""Put the bytes from filename into the archive under the name
arcname."""
st = os.stat(filename)
if compress_type is None:
zinfo.compress_type = self.compression
else:
zinfo.compress_type = compress_type
zinfo.file_size = st.st_size
zinfo.flag_bits = 0x00
zinfo.header_offset = self.fp.tell() # Start of header bytes
self._writecheck(zinfo)
self._didModify = True
fp = open(filename, "rb")
# Must overwrite CRC and sizes with correct data later
zinfo.CRC = CRC = 0
zinfo.compress_size = compress_size = 0
zinfo.file_size = file_size = 0
self.fp.write(zinfo.FileHeader())
if zinfo.compress_type == zipfile.ZIP_DEFLATED:
cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION,
zlib.DEFLATED, -15)
else:
cmpr = None
while 1:
buf = fp.read(1024 * 64)
if not buf:
break
file_size = file_size + len(buf)
CRC = binascii.crc32(buf, CRC)
if cmpr:
buf = cmpr.compress(buf)
compress_size = compress_size + len(buf)
self.fp.write(buf)
fp.close()
if cmpr:
buf = cmpr.flush()
compress_size = compress_size + len(buf)
self.fp.write(buf)
zinfo.compress_size = compress_size
else:
zinfo.compress_size = file_size
zinfo.CRC = CRC
zinfo.file_size = file_size
# Seek backwards and write CRC and file sizes
position = self.fp.tell() # Preserve current position in file
self.fp.seek(zinfo.header_offset + 14, 0)
self.fp.write(struct.pack("<lLL", zinfo.CRC, zinfo.compress_size,
zinfo.file_size))
self.fp.seek(position, 0)
self.filelist.append(zinfo)
self.NameToInfo[zinfo.filename] = zinfo
def tree(
src,
dest,
exclude_suffix=[ ".pyc", "~", ".bak", ".old", ".new" ],
exclude_prefix=[ "#", "." ],
exclude_files = set(ignored_files),
root_exclude_prefix = [ ],
root_exclude_suffix = [ ".py", ".sh", ".app" ],
root_exclude_files = set(root_ignored_files),
root=False):
"""
Returns a list of source-filename, destination-filename pairs.
"""
if dest[0] != "/":
raise Exception("Destination must begin with /: %r" % dest)
src = src.rstrip('/')
dest = dest.rstrip('/')
def include(fn, is_root):
"""
Returns True if the file should be included in the list of
files we are copying.
"""
for i in exclude_suffix:
if fn.endswith(i):
return False
for i in exclude_prefix:
if fn.startswith(i):
return False
if fn in exclude_files:
return False
if not root or not is_root:
return True
for i in root_exclude_suffix:
if fn.endswith(i):
return False
for i in root_exclude_prefix:
if fn.startswith(i):
return False
if fn in root_exclude_files:
return False
return True
rv = [ ]
# Walk the tree, including what is necessary.
for srcdir, dirs, files in os.walk(src):
is_root = (srcdir == src)
srcdir += "/"
destdir = dest + srcdir[len(src):]
destdir.replace("\\", "/")
rv.append((srcdir, destdir))
for fn in files:
if not include(fn, is_root):
continue
sfn = srcdir + fn
dfn = destdir + fn
rv.append((sfn, dfn))
dirs[:] = [ i for i in dirs if include(i, is_root) ]
rv = [ (a.replace("\\", "/"), b.replace("\\", "/")) for a, b in rv ]
return rv
def make_zip(t, filename, files, file_data):
"""
This creates `filename`.zip, containing `files`, placed in the
`filename` directory. `file_data` is a map from source file to
replacement data.
"""
files.sort(key=lambda a : a[1])
progress_len = len(files)
fn = os.path.join(os.path.dirname(project_path), filename)
zf = MyZipFile(fn + ".zip", "w", zipfile.ZIP_DEFLATED)
for i, (fn, an) in enumerate(files):
progress(t, progress_len, i)
if os.path.isdir(fn):
continue
zi = zipfile.ZipInfo(filename + an)
s = os.stat(fn)
zi.date_time = time.gmtime(s.st_mtime)[:6]
zi.compress_type = zipfile.ZIP_DEFLATED
zi.create_system = 3
for i in executable_extensions:
if os.path.dirname(fn).endswith(i) or fn.endswith(i):
zi.external_attr = long(0100777) << 16
break
else:
zi.external_attr = long(0100666) << 16
if fn in file_data:
data = file_data[fn]
zf.writestr(zi, data)
else:
zf.write_file_with_zipinfo(fn, zi)
zf.close()
def make_tar(t, filename, files):
"""
Makes a tarfile, as above.
"""
files.sort(key=lambda a : a[1])
progress_len = len(files)
fn = os.path.join(os.path.dirname(project_path), filename)
tf = tarfile.open(fn + ".tar.bz2", "w:bz2")
tf.dereference = True
for j, (fn, an) in enumerate(files):
progress(t, progress_len, j)
info = tf.gettarinfo(fn, filename + an)
perms = 0666
if info.isdir():
perms = 0777
for i in executable_extensions:
if fn.endswith(i):
perms = 0777
info.mode = perms
info.uid = 1000
info.gid = 1000
info.uname = "renpy"
info.gname = "renpy"
if info.isreg():
tf.addfile(info, file(fn, "rb"))
else:
tf.addfile(info)
tf.close()
def distribute(
_project_path,
_renpy_base,
base_name,
executable_name,
ignore_extensions,
documentation_extensions,
build_windows,
build_linux,
build_mac,
build_all):
global project_path
global renpy_base
project_path = _project_path
renpy_base = _renpy_base
base_name = base_name.encode("utf-8")
executable_name = executable_name.encode("utf-8")
ignore_extensions = ignore_extensions.encode("utf-8")
documentation_extensions = documentation_extensions.encode("utf-8")
# Convert some of these to more useful formats.
ignore_extensions = [ i.strip() for i in ignore_extensions.split() ]
documentation_extensions = [ i.strip() for i in documentation_extensions.split() ]
# Scan for the files we want to include in the various distributions.
info(_(u"Scanning..."), "")
# Files included in the various distributions.
multi_files = [ ]
win_files = [ ]
linux_files = [ ]
mac_files = [ ]
# A map from source file name to replacement data to be placed in
# that file.
file_data = { }
######################################################################
# Multi files.
rb = renpy_base.replace("\\", "/") + "/"
# Project files.
multi_files.extend(tree(project_path, "/", root=True, exclude_suffix=ignore_extensions))
multi_files.append((rb + "renpy.py", "/" + executable_name + ".py"))
# Renpy files.
multi_files.extend(tree(rb + "common", "/common"))
multi_files.extend(tree(rb + "renpy", "/renpy"))
multi_files.append((rb + "LICENSE.txt", "/renpy/LICENSE.txt"))
def add_script_version(fn, ignore_extensions=ignore_extensions, multi_files=multi_files, rb=rb):
"""
Add a script_version file if it does not already exist, and if the
extension is allowed by the game.
"""
for a, b in multi_files:
if b == "/game/" + fn:
return
for i in ignore_extensions:
if fn.endswith(i):
return
multi_files.append((rb + "launcher/" + fn, "/game/" + fn))
add_script_version("script_version.rpy")
add_script_version("script_version.rpyc")
######################################################################
# Windows files.
if build_windows or build_all:
win_files.append((rb + "renpy.exe", "/" + executable_name + ".exe"))
win_files.append((rb + "python26.dll", "/python26.dll"))
win_files.append((rb + "msvcr90.dll", "/msvcr90.dll"))
win_files.append((rb + "Microsoft.VC90.CRT.manifest", "/Microsoft.VC90.CRT.manifest"))
win_files.append((rb + "lib", "/lib"))
win_files.extend(tree(rb + "lib/windows-x86", "/lib/windows-x86"))
if os.path.exists(project_path + "/icon.ico"):
file_data[rb + "renpy.exe"] = change_icon.change_icons(
rb + "renpy.exe",
project_path + "/icon.ico",
)
######################################################################
# Linux files.
if build_linux or build_all:
linux_files.append((rb + "renpy.sh", "/" + executable_name + ".sh"))
linux_files.append((rb + "lib", "/lib"))
linux_files.append((rb + "lib/python", "/lib/python"))
linux_files.extend(tree(rb + "lib/linux-x86", "/lib/linux-x86"))
# Warning: The tar.bz2 builder doesn't support file_data.
######################################################################
# Mac (non-app) files.
if build_mac or build_all:
mac_files = tree(rb + "renpy.app",
"/" + executable_name + ".app")
# Rename executable.
mac_files = [ (fn, an.replace("Ren'Py Launcher", executable_name)) for (fn, an) in mac_files ]
# Plist file.
quoted_name = executable_name.replace("&", "&amp;").replace("<", "&lt;")
info_plist = file(rb + "renpy.app/Contents/Info.plist", "rb").read().replace("Ren'Py Launcher", quoted_name)
file_data[rb + "renpy.app/Contents/Info.plist"] = info_plist
# Launcher script.
quoted_name = executable_name.replace("\"", "\\\"")
launcher_py = file(rb + "renpy.app/Contents/Resources/launcher.py", "rb").read().replace("Ren'Py Launcher", quoted_name)
file_data[rb + "renpy.app/Contents/Resources/launcher.py"] = launcher_py
# Icon file.
if os.path.exists(project_path + "/icon.icns"):
icon_data = file(project_path + "/icon.icns", "rb").read()
file_data[rb + "renpy.app/Contents/Resources/launcher.icns"] = icon_data
######################################################################
# Now, build the various distributions.
if build_windows:
make_zip(
_(u"Building Windows..."),
base_name + "-win32",
multi_files + win_files,
file_data)
if build_linux:
make_tar(
_(u"Building Linux..."),
base_name + "-linux-x86",
multi_files + linux_files)
if build_mac:
# Reorganize the files so all the non application files live inside
# the application. If there's documentation involved, then it
# lives in both places.
macapp_files = [ ]
for fn, an in multi_files + mac_files:
if not an.startswith("/" + executable_name + ".app"):
new_an = "/" + executable_name + ".app/Contents/Resources/autorun" + an
macapp_files.append((fn, new_an))
if an.rindex('/') == 0:
for i in documentation_extensions:
if fn.endswith(i):
macapp_files.append((fn, an))
break
else:
macapp_files.append((fn, an))
make_zip(
_(u"Building Macintosh..."),
base_name + "-mac",
macapp_files,
file_data)
if build_all:
make_zip(
_(u"Building Combined..."),
base_name + "-all",
multi_files + win_files + linux_files + mac_files,
file_data)
def main():
ap = argparse.ArgumentParser(description="Prepare a Ren'Py game for distribution.")
ap.add_argument("project_path", type=str, help="The path to the directory containing the project.")
ap.add_argument("base_name", type=str, help="The base name of the archive files produced.")
ap.add_argument("executable_name", type=str, help="The name of the executables produced.")
ap.add_argument("--renpy-base", type=str, default=None, help="The path to the Ren'Py distribution.")
ap.add_argument("--ignore-extensions", type=str, default="~ .bak", help="A space-separated list of extensions to ignore.")
ap.add_argument("--documentation-extensions", type=str, default="txt html", help="A space-separated list of extensions to treat as documentation.")
ap.add_argument("--build-windows", action="store_true", default=False, help="Build the Windows distribution.")
ap.add_argument("--build-mac", action="store_true", default=False, help="Build the Mac OS X distribution.")
ap.add_argument("--build-linux", action="store_true", default=False, help="Build the Windows distribution.")
ap.add_argument("--build-all", action="store_true", default=False, help="Build the All Platforms distribution.")
args = ap.parse_args()
renpy_base = args.renpy_base
if renpy_base is None:
renpy_base = os.path.dirname(os.path.dirname(os.path.abspath(sys.argv[0])))
distribute(
args.project_path,
renpy_base,
base_name=args.base_name,
executable_name=args.executable_name,
ignore_extensions=args.ignore_extensions,
documentation_extensions=args.documentation_extensions,
build_windows=args.build_windows,
build_mac=args.build_mac,
build_linux=args.build_linux,
build_all=args.build_all)
if __name__ == "__main__":
main()
-185
View File
@@ -1,185 +0,0 @@
# This file contains the code needed to build a Ren'Py distribution.
init 12 python:
import distribute
distribute.progress = progress
distribute.info = info
distribute._ = _
def dist_exists(fn):
"""
Returns true if the given file exists in the renpy directory.
"""
return os.path.exists(os.path.join(config.renpy_base, fn))
label distribute:
call lint
if not yesno(_(u"Building Distributions"),
_(u"I've just performed a lint on your project. If it contains errors, you should say no and fix them.\nPlease also check {a=http://www.renpy.org/wiki/renpy/Download_Ren'Py}www.renpy.org{/a} to see if updates or fixes are available.\n\nDo you want to continue?")):
jump top
python hide:
# Do we have the files?
has_windows = dist_exists("renpy.exe")
has_linux = dist_exists("lib/linux-x86")
has_mac = dist_exists("renpy.app")
has_all = has_windows and has_mac and has_linux
# Should we build these distributions?
build_windows = has_windows and project.info.get("build_windows", has_windows)
build_linux = has_linux and project.info.get("build_linux", has_linux)
build_mac = has_mac and project.info.get("build_mac", has_mac)
build_all = has_all and project.info.get("build_all", False)
# The base name of the distribution.
base_name = project.info.get("distribution_base", project.name)
# The executable name.
executable_name = project.info.get("executable_name", project.name)
# Extensions to exclude.
ignore_extensions = project.info.get("ignore_extensions", "~ .bak")
# Documentation extensions.
documentation_extensions = project.info.get("documentation_extensions", "txt html")
# Prompt the user for all of the above.
while True:
set_tooltip("")
screen()
ui.vbox()
title(_(u"Building Distributions"))
text_variable(_(u"Base Name:"), base_name, "base_name",
_(u"Used to generate the names of directories and archive files."))
text_variable(_(u"Executable Name:"), executable_name, "executable_name",
_(u"Used to generate the names of executables and runnable programs."))
text_variable(_(u"Ignore Extensions:"), ignore_extensions, "ignore_extensions",
_(u"Files with these extensions will not be included in the distributions."))
text_variable(_(u"Documentation Extensions:"), documentation_extensions, "documentation_extensions",
_(u"Files with these extensions will be treated as documentation, when building the Macintosh application."))
text(_(u"Distributions to Build:"))
if has_windows:
toggle_button(_(u"Windows x86"), build_windows, ui.returns("build_windows"),
_(u"Zip distribution for the 32-bit Windows platform."))
if has_linux:
toggle_button(_(u"Linux x86"), build_linux, ui.returns("build_linux"),
_(u"Tar.Bz2 distribution for the Linux x86 platform."))
if has_mac:
toggle_button(_(u"Macintosh Universal"), build_mac, ui.returns("build_mac"),
_(u"Single application distribution for the Macintosh x86 and ppc platforms."))
if has_all:
toggle_button(_(u"Windows/Linux/Mac Combined"), build_all, ui.returns("build_all"),
_(u"Zip distribution for the Windows x86, Linux x86, Macintosh x86 and Macintosh ppc platforms."))
ui.null(height=15)
button(_(u"Build"), ui.returns("build"), _(u"Start building the distributions."))
button(_(u"Cancel"), ui.jumps("top"), "")
ui.close()
act = interact()
if act == "build_windows":
build_windows = not build_windows
elif act == "build_linux":
build_linux = not build_linux
elif act == "build_mac":
build_mac = not build_mac
elif act == "build_all":
build_all = not build_all
elif act == "base_name":
base_name = input(
_(u"Base Name"),
_(u"Please enter in the base name for your distribution. This name is used to generate the names of directories and archive files. Usually, this is the name of your game, plus a version number, like \"moonlight-1.0\"."),
base_name)
elif act == "executable_name":
executable_name = input(
_(u"Executable Name"),
_(u"Please enter a name for the executables in your distribution. This should not include an extension, as that will be added automatically."),
executable_name)
elif act == "ignore_extensions":
ignore_extensions = input(
_(u"Ignore Extensions"),
_(u"Please enter a space-separated list of file extensions. Files with these extensions will not be included in the built distributions."),
ignore_extensions)
elif act == "documentation_extensions":
documentation_extensions = input(
_(u"Documentation Extensions"),
_(u"Please enter a space separated list of documentation extensions. Files in the base directory with these extensions will have a second copy stored outside of the Macintosh application."),
documentation_extensions)
elif act == "build":
break
# Store the user-selected options in info, and save info.
project.info["distribution_base"] = base_name
project.info["executable_name"] = executable_name
project.info["ignore_extensions"] = ignore_extensions
project.info["documentation_extensions"] = documentation_extensions
project.info["build_windows"] = build_windows
project.info["build_linux"] = build_linux
project.info["build_mac"] = build_mac
project.info["build_all"] = build_all
project.save()
distribute.distribute(
project.path,
config.renpy_base,
base_name=base_name,
executable_name=executable_name,
ignore_extensions=ignore_extensions,
documentation_extensions=documentation_extensions,
build_windows=build_windows,
build_mac=build_mac,
build_linux=build_linux,
build_all=build_all)
# Report success to the user.
set_tooltip(_(u"Thank you for choosing Ren'Py."))
screen()
ui.vbox()
title(_(u"Success"))
text(_(u"The distributions have been built. Be sure to test them before release.\n\nNote that unpacking and repacking the Macintosh, Linux, or Combined distributions on Windows is not supported.\n\nPlease announce your release at the {a=http://lemmasoft.renai.us/forums/}Lemma Soft Forums{/a}, and add it to {a=http://games.renpy.org}games.renpy.org{/a}."))
ui.null(height=20)
button(_(u"Return"), ui.jumps("top"), None)
ui.close()
interact()
-162
View File
@@ -1,162 +0,0 @@
# This file contains logic for selecting an editor.
init python:
import glob
import re
import traceback
import os
import os.path
# The default name for the editor.
if persistent.editor is None:
persistent.editor = "jEdit"
# A map from editor name to the file containing information about
# that editor.
editors = { }
# A map from editor to the version of that editor.
editor_versions = { }
# A map from editor to a description of that editor.
editor_descriptions = { }
# Should we set up the editor? How about the transient editor?
set_editor = "RENPY_EDITOR" not in os.environ
set_editor_transient = "RENPY_EDITOR_TRANSIENT" not in os.environ
if set_editor and not set_editor_transient:
config.editor_transient = config.editor
os.environ['RENPY_EDITOR_TRANSIENT'] = config.editor
set_editor_transient = False
def scan_editor(ef):
"""
Scans a single editor file to get the meta-information. If it
checks out, adds it to editors. Uses editor_versions as a cache
so we only add the newest version of each editor.
"""
info = { }
f = file(ef, "r")
for l in f:
m = re.match("#\s*(\w+):\s*(.*?)\s*$", l)
if not m:
break
info[m.group(1)] = m.group(2)
f.close()
try:
name = info["Name"]
version = int(info["Version"])
description = info.get("Description", "")
except:
traceback.print_exc()
print >>sys.stderr, ef
if version > editor_versions.get(name, -1):
editors[name] = ef
editor_versions[name] = version
editor_descriptions[name] = description
def scan_editors():
"""
Finds all *.editor.py files, and uses them to populate the list
of editors.
"""
editors.clear()
editor_versions.clear()
editor_descriptions.clear()
for d in [ config.renpy_base, persistent.projects_directory ]:
if d is None:
continue
for ef in glob.glob(d + "/*/*.editor.py"):
scan_editor(ef)
def setup_editor():
"""
Sets the system up to respect the value containined in
persistent.editor.
"""
if not set_editor:
return
ef = None
for i in [ persistent.editor, "jEdit", "None" ]:
if i in editors:
ef = editors[i]
break
else:
return
ctx = {
"renpy" : renpy,
"config" : config,
"persistent" : persistent,
"base" : os.path.dirname(ef),
}
execfile(ef, ctx, ctx)
if set_editor:
if config.editor:
os.environ['RENPY_EDITOR'] = config.editor
else:
if 'RENPY_EDITOR' in os.environ:
del os.environ['RENPY_EDITOR']
if set_editor_transient:
if config.editor_transient:
os.environ['RENPY_EDITOR_TRANSIENT'] = config.editor_transient
else:
if 'RENPY_EDITOR_TRANSIENT' in os.environ:
del os.environ['RENPY_EDITOR_TRANSIENT']
label editor:
python hide:
if not set_editor:
error(_(u"The editor has been set from the RENPY_EDITOR environment variable, and cannot be changed."), "options")
set_tooltip("")
screen()
ui.vbox()
title(_(u"Choose Editor"))
text(_(u"Please choose the editor that will be use to edit scripts and display errors. More editors can be downloaded from {a=http://www.renpy.org/wiki/renpy/Editors}the Ren'Py website{/a}."))
ui.null(height=15)
scrolled("options")
ui.vbox()
for i in sorted(editors, key=lambda a : a.lower()):
button(i,
ui.returns(i),
editor_descriptions[i])
ui.close() # Vbox
ui.close() # Scrolled
ui.close() # Vbox
persistent.editor = interact()
setup_editor()
jump options
Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

@@ -1,3 +1,4 @@
#@PydevCodeAnalysisIgnore
"""Easy to use dialogs.
Message(msg) -- display a message and an OK button.
Binary file not shown.
Binary file not shown.
+27
View File
@@ -0,0 +1,27 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# Checks for various abilities that might be taken away from us by
# redistributors.
init 1 python in ability:
from store import config
import store
import store.updater as updater
import os
EXECUTABLES = [ "renpy.exe", "renpy.app", "renpy.sh" ]
# can_distribute - True if we can distribute
for i in EXECUTABLES:
if not os.path.exists(os.path.join(config.renpy_base, i)):
can_distribute = False
else:
can_distribute = True
# can_update - True if we can update.
can_update = updater.can_update() or (store.UPDATE_SIMULATE is not None)
+31
View File
@@ -0,0 +1,31 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
screen about:
$ version = renpy.version()
frame:
style_group "l"
style "l_root"
window:
xfill True
has vbox xfill True
add "logo.png" xalign 0.5 yoffset -5
null height 15
text _("[version!q]") xalign 0.5 bold True
null height 20
textbutton _("View license") action interface.OpenLicense() xalign 0.5
textbutton _("Back") action Jump("front_page") style "l_left_button"
label about:
call screen about
+36
View File
@@ -0,0 +1,36 @@
label add_file:
python hide:
import os
import codecs
filename = interface.input(_("FILENAME"), _("Enter the name of the script file to create."), filename="withslash", cancel=Jump("navigation"))
if "." in filename and not filename.endswith(".rpy"):
interface.error(_("The filename must have the .rpy extension."), label="navigation")
elif "." not in filename:
filename += ".rpy"
path = os.path.join(project.current.gamedir, filename)
dir = os.path.dirname(path)
if os.path.exists(path):
interface.error(_("The file already exists."), label="navigation")
contents = u"\uFEFF"
contents += _("# Ren'Py automatically loads all script files ending with .rpy. To use this\n# file, define a label and jump to it from another file.\n")
contents += "\n"
try:
os.makedirs(dir)
except:
pass
contents = u"\uFEFF"
contents += _("# Ren'Py automatically loads all script files ending with .rpy. To use this\n# file, define a label and jump to it from another file.\n")
with open(path, "wb") as f:
f.write(contents.encode("utf-8"))
jump navigation_refresh
+67
View File
@@ -0,0 +1,67 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# 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.
init python in archiver:
import sys
import random
import glob
from cPickle import dumps, HIGHEST_PROTOCOL
class Archive(object):
"""
Adds files from disk to a rpa archive.
"""
def __init__(self, filename):
# The archive file.
self.f = open(filename, "wb")
# The index to the file.
self.index = _dict()
# A fixed key minimizes difference between archive versions.
self.key = 0x42424242
padding = "RPA-3.0 XXXXXXXXXXXXXXXX XXXXXXXX\n"
self.f.write(padding)
def add(self, name, path):
"""
Adds a file to the archive.
"""
self.index[name] = _list()
with open(path, "rb") as df:
data = df.read()
dlen = len(data)
# Pad.
padding = "Made with Ren'Py."
self.f.write(padding)
offset = self.f.tell()
self.f.write(data)
self.index[name].append((offset ^ self.key, dlen ^ self.key, ""))
def close(self):
indexoff = self.f.tell()
self.f.write(dumps(self.index, HIGHEST_PROTOCOL).encode("zlib"))
self.f.seek(0)
self.f.write("RPA-3.0 %016x %08x\n" % (indexoff, self.key))
self.f.close()
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

@@ -5,7 +5,7 @@
import struct
import sys
import array
import pefile
import pefile # @UnresolvedImport
# This class performs various operations on memory-loaded binary files,
# including modifications.
@@ -42,7 +42,7 @@ class BinFile(object):
c = self.u16()
rv = u""
for i in range(c):
for _i in range(c):
rv += unichr(self.u16())
return rv
@@ -53,7 +53,7 @@ class BinFile(object):
def tostring(self):
return self.a.tostring()
def substring(self, start, len):
def substring(self, start, len): #@ReservedAssignment
return self.a[start:start+len].tostring()
def __init__(self, data):
@@ -78,7 +78,7 @@ def parse_data(bf, offset):
l = [ ]
bf.seek(data_offset - resource_virtual)
for i in range(data_len):
for _i in range(data_len):
l.append(chr(bf.u8()))
return (code_page, "".join(l))
@@ -87,16 +87,16 @@ def parse_data(bf, offset):
def parse_directory(bf, offset):
bf.seek(offset)
char = bf.u32()
timedate = bf.u32()
major = bf.u16()
minor = bf.u16()
char = bf.u32() #@UnusedVariable
timedate = bf.u32() #@UnusedVariable
major = bf.u16() #@UnusedVariable
minor = bf.u16() #@UnusedVariable
n_named = bf.u16()
n_id = bf.u16()
entries = [ ]
for i in range(n_named + n_id):
for _i in range(n_named + n_id):
entries.append((bf.u32(), bf.u32()))
rv = { }
@@ -313,7 +313,6 @@ def change_icons(oldexe, icofn):
sec_size = i.Misc_VirtualSize
sec_size = sec_size - (sec_size % alignment) + alignment
print sec_size
total_size += sec_size
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

+465
View File
@@ -0,0 +1,465 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
import random
import codecs
import re
import sys
def theme_names():
"""
Gets a list of all of the theme names we know about.
"""
names = list(theme_data.THEME.keys())
names.sort(key=lambda a : a.lower())
return names
def scheme_names(theme):
"""
Gets a list of the color scheme names corresponding to the given
theme.
"""
names = list(theme_data.THEME[theme].keys())
names.sort(key=lambda a : a.lower())
return names
def theme_yinitial():
names = theme_names()
if len(names) < 2:
return 0
return 1.0 * names.index(current_theme) / (len(names) - 1)
def scheme_yinitial():
names = scheme_names(current_theme)
if len(names) < 2:
return 0
return 1.0 * names.index(current_scheme) / (len(names) - 1)
def pick_theme(theme, scheme):
"""
Returns a theme and scheme that are similar to `theme` and `scheme`.
If the theme is known, picks it, otherwise picks a random theme. If
the scheme is known for that theme, picks it, otherwise picks a
random scheme that is known for the current theme.
"""
if theme not in theme_data.THEME:
theme = random.choice(list(theme_data.THEME))
schemes = theme_data.THEME[theme]
if scheme not in schemes:
if theme in schemes:
scheme = theme
else:
scheme = random.choice(list(schemes))
return theme, scheme
def implement_theme(theme, scheme):
global showing_theme, showing_scheme
if theme == showing_theme and scheme == showing_scheme:
return
renpy.style.restore(style_backup)
exec theme_data.THEME[theme][scheme] in globals()
renpy.style.rebuild()
showing_theme = theme
showing_scheme = scheme
renpy.restart_interaction()
showing_theme = None
showing_scheme = None
class SetTheme(Action):
def __init__(self, theme):
self.theme = theme
def __call__(self):
global current_theme
global current_scheme
current_theme, current_scheme = pick_theme(self.theme, current_scheme)
implement_theme(current_theme, current_scheme)
renpy.restart_interaction()
def get_selected(self):
return current_theme == self.theme
class SetScheme(Action):
def __init__(self, scheme):
self.scheme = scheme
def __call__(self):
global current_theme
global current_scheme
current_theme, current_scheme = pick_theme(current_theme, self.scheme)
implement_theme(current_theme, current_scheme)
renpy.restart_interaction()
def get_selected(self):
return current_scheme == self.scheme
class PreviewTheme(Action):
def __init__(self, theme, scheme):
self.theme = theme
self.scheme = scheme
def __call__(self):
theme, scheme = pick_theme(self.theme, self.scheme)
implement_theme(theme, scheme)
def unhovered(self):
if (showing_theme == self.theme and showing_scheme == self.scheme):
implement_theme(current_theme, current_scheme)
def value_changed(value):
return None
##########################################################################
# Code to update options.rpy
def list_logical_lines(filename):
"""
This reads in filename, and turns it into a list of logical
lines.
"""
f = codecs.open(filename, "rb", "utf-8")
data = f.read()
f.close()
# The result.
rv = [ ]
# The current position we're looking at in the buffer.
pos = 0
# Looping over the lines in the file.
while pos < len(data):
# The line that we're building up.
line = ""
# The number of open parenthesis there are right now.
parendepth = 0
# Looping over the characters in a single logical line.
while pos < len(data):
c = data[pos]
if c == '\n' and not parendepth:
rv.append(line)
pos += 1
# This helps out error checking.
line = ""
break
# Backslash/newline.
if c == "\\" and data[pos+1] == "\n":
pos += 2
line += "\\\n"
continue
# Parenthesis.
if c in ('(', '[', '{'):
parendepth += 1
if c in ('}', ']', ')') and parendepth:
parendepth -= 1
# Comments.
if c == '#':
while data[pos] != '\n':
line += data[pos]
pos += 1
continue
# Strings.
if c in ('"', "'", "`"):
delim = c
line += c
pos += 1
escape = False
while pos < len(data):
c = data[pos]
if escape:
escape = False
pos += 1
line += c
continue
if c == delim:
pos += 1
line += c
break
if c == '\\':
escape = True
line += c
pos += 1
continue
continue
line += c
pos += 1
if line:
rv.append(line)
return rv
def switch_theme():
"""
Switches the theme of the current project to the current theme
and color scheme. (As set in current_theme and current_scheme.)
"""
theme_code = theme_data.THEME[current_theme][current_scheme]
# Did we change the file at all?
changed = False
filename = os.path.join(project.current.path, "game/options.rpy")
with codecs.open(filename + ".new", "wb", "utf-8") as out:
for l in list_logical_lines(filename):
m = re.match(r' theme.(\w+)\(', l)
if (not changed) and m and (m.group(1) in theme_data.THEME_FUNCTIONS):
l = " " + theme_code
changed = True
out.write(l + "\n")
if changed:
try:
os.unlink(filename + ".bak")
except:
pass
os.rename(filename, filename + ".bak")
os.rename(filename + ".new", filename)
else:
os.unlink(filename + ".new")
interface.error(_("Could not change the theme. Perhaps options.rpy was changed too much."))
# Now give the theme's screen-ops function a chance to make any
# necessary changes to the screens.rpy file
filename = os.path.join(project.current.path, "game/screens.rpy")
changed = False
try:
with codecs.open(filename + ".new", "wb", "utf-8") as out:
lines = list_logical_lines(filename)
lines = theme_data.THEME_SCREEN_OPERATIONS[current_theme](lines)
if lines != None:
for l in lines:
out.write(l + "\n")
changed = True
if changed:
try:
os.unlink(filename + ".bak")
except:
pass
os.rename(filename, filename + ".bak")
os.rename(filename + ".new", filename)
except Exception as inst:
try:
# just in case
os.unlink(filename + ".new")
except:
pass
pass
init 100 python:
style_backup = renpy.style.backup()
screen theme_demo:
window:
style "gm_root"
xpadding 5
ypadding 5
grid 1 1:
xfill True
style_group "prefs"
vbox:
frame:
style_group "pref"
has vbox
label _("Display")
textbutton _("Window") action SelectedIf(True)
textbutton _("Fullscreen") action ui.returns(None)
textbutton _("Planetarium") action None
frame:
style_group "pref"
has vbox
label _("Sound Volume")
bar style "slider" value .75 range 1.0 changed value_changed
textbutton "Test":
action ui.returns(None)
style "soundtest_button"
init -2 python:
style.pref_frame.xfill = True
style.pref_frame.xmargin = 5
style.pref_frame.top_margin = 5
style.pref_vbox.xfill = True
style.pref_button.size_group = "pref"
style.pref_button.xalign = 1.0
style.pref_slider.xmaximum = 192
style.pref_slider.xalign = 1.0
style.soundtest_button.xalign = 1.0
screen choose_theme:
frame:
style_group "l"
style "l_root"
window:
has vbox
label _("Choose Theme")
hbox:
yfill True
# Theme selector.
frame:
style "l_indent"
bottom_margin HALF_SPACER_HEIGHT
xmaximum 225
has vbox
label _("Theme") style "l_label_small"
viewport:
scrollbars "vertical"
yinitial theme_yinitial()
mousewheel True
has vbox
for i in theme_names():
textbutton "[i]":
action SetTheme(i)
hovered PreviewTheme(i, current_scheme)
style "l_list2"
# Color scheme selector.
frame:
style "l_indent"
bottom_margin HALF_SPACER_HEIGHT
xmaximum 225
has vbox
label _("Color Scheme") style "l_label_small"
viewport:
scrollbars "vertical"
mousewheel True
yinitial scheme_yinitial()
has vbox
for i in scheme_names(current_theme):
textbutton "[i]":
action SetScheme(i)
hovered PreviewTheme(current_theme, i)
style "l_list2"
# Preview
frame:
style "l_default"
background Frame(PATTERN, 0, 0, tile=True)
xpadding 5
ypadding 5
xfill True
yfill True
xmargin 20
bottom_margin 6
use theme_demo
textbutton _("Back") action Jump("front_page") style "l_left_button"
textbutton _("Continue") action Return(True) style "l_right_button"
label choose_theme_callable:
python:
current_theme, current_scheme = pick_theme(None, None)
implement_theme(current_theme, current_scheme)
call screen choose_theme
python hide:
with interface.error_handling("changing the theme"):
switch_theme()
return
label choose_theme:
call choose_theme_callable
jump front_page
+923
View File
@@ -0,0 +1,923 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This file contains code that manages the distribution of Ren'Py games
# and Ren'Py proper.
#
# In this module, all files and paths are stored in unicode. Full paths
# might include windows path separators (\), but archive paths and names we
# deal with/match against use the unix separator (/).
init python in distribute:
from store import config, persistent
import store.project as project
import store.interface as interface
import store.archiver as archiver
import store.updater as updater
import store as store
from change_icon import change_icons
import sys
import os
import json
import subprocess
import hashlib
import struct
import collections
import os
import io
import re
import plistlib
import time
match_cache = { }
def compile_match(pattern):
"""
Compiles a pattern for use with match.
"""
regexp = ""
while pattern:
if pattern.startswith("**"):
regexp += r'.*'
pattern = pattern[2:]
elif pattern[0] == "*":
regexp += r'[^/]*/?'
pattern = pattern[1:]
elif pattern[0] == '[':
regexp += r'['
pattern = pattern[1:]
while pattern and pattern[0] != ']':
regexp += pattern[0]
pattern = pattern[1:]
pattern = pattern[1:]
regexp += ']'
else:
regexp += re.escape(pattern[0])
pattern = pattern[1:]
regexp += "$"
return re.compile(regexp, re.I)
def match(s, pattern):
"""
Matches a glob-style pattern against s. Returns True if it matches,
and False otherwise.
** matches every character.
* matches every character but /.
[abc] matches a, b, or c.
Things are matched case-insensitively.
"""
regexp = match_cache.get(pattern, None)
if regexp is None:
regexp = compile_match(pattern)
match_cache[pattern] = regexp
if regexp.match(s):
return True
if regexp.match("/" + s):
return True
return False
class File(object):
"""
Represents a file that we can distribute.
self.name
The name of the file as it will be stored in the archives.
self.path
The path to the file on disk. None if it won't be stored
on disk.
self.directory
True if this is a directory.
self.executable
True if this is an executable that should be distributed
with the xbit set.
"""
def __init__(self, name, path, directory, executable):
self.name = name
self.path = path
self.directory = directory
self.executable = executable
def __repr__(self):
if self.directory:
extra = "dir"
elif self.executable:
extra = "x-bit"
else:
extra = ""
return "<File {!r} {!r} {}>".format(self.name, self.path, extra)
def copy(self):
return File(self.name, self.path, self.directory, self.executable)
class FileList(list):
"""
This represents a list of files that we know about.
"""
def sort(self):
list.sort(self, key=lambda a : a.name)
def copy(self):
"""
Makes a deep copy of this file list.
"""
rv = FileList()
for i in self:
rv.append(i.copy())
return rv
def filter_empty(self):
"""
Makes a deep copy of this file list with empty directories
omitted.
"""
rv = FileList()
needed_dirs = set()
for i in reversed(self):
if (not i.directory) or (i.name in needed_dirs):
rv.insert(0, i.copy())
directory, _sep, _filename = i.name.rpartition("/")
needed_dirs.add(directory)
return rv
@staticmethod
def merge(l):
"""
Merges a list of file lists into a single file list with no
duplicate entries.
"""
rv = FileList()
seen = set()
for fl in l:
for f in fl:
if f.name in seen:
continue
rv.append(f)
seen.add(f.name)
return rv
def prepend_directory(self, directory):
"""
Modifies this file list such that every file in it has `directory`
prepended.
"""
for i in self:
i.name = directory + "/" + i.name
self.insert(0, File(directory, None, True, False))
def mac_transform(self, app, documentation):
"""
Creates a new file list that has the mac transform applied to it.
The mac transform places all files that aren't already in <app> in
<app>/Contents/Resources/autorun. If it matches one of the documentation
patterns, then it appears both inside and outside of the app.
"""
rv = FileList()
for f in self:
# Already in the app.
if f.name == app or f.name.startswith(app + "/"):
rv.append(f)
continue
# If it's documentation, keep the file. (But also make
# a copy.)
for pattern in documentation:
if match(f.name, pattern):
rv.append(f)
if match("/" + f.name, pattern):
rv.append(f)
# Make a copy.
f = f.copy()
f.name = app + "/Contents/Resources/autorun/" + f.name
rv.append(f)
rv.append(File(app + "/Contents/Resources/autorun", None, True, False))
rv.sort()
return rv
class Distributor(object):
"""
This manages the process of building distributions.
"""
def __init__(self, project, destination=None, reporter=None, packages=None, build_update=True):
"""
Distributes `project`.
`destination`
The destination in which the distribution will be placed. If None,
uses a default location.
`reporter`
An object that's used to report status and progress to the user.
`packages`
If not None, a list of packages to distributed. If None, all
packages are distributed.
`build_update`
Will updates be built?
"""
# Safety - prevents us frome releasing a launcher that won't update.
if store.UPDATE_SIMULATE:
raise Exception("Cannot build distributions when UPDATE_SIMULATE is True.")
# The project we want to distribute.
self.project = project
# Logfile.
self.log = open(self.temp_filename("distribute.txt"), "w")
# Start by scanning the project, to get the data and build
# dictionaries.
data = project.data
project.update_dump(force=True, gui=False)
if project.dump.get("error", False):
raise Exception("Could not get build data from the project. Please ensure the project runs.")
self.build = build = project.dump['build']
# Map from file list name to file list.
self.file_lists = collections.defaultdict(FileList)
self.base_name = build['directory_name']
self.executable_name = build['executable_name']
self.pretty_version = build['version']
# The destination directory.
if destination is None:
parent = os.path.dirname(project.path)
self.destination = os.path.join(parent, self.base_name + "-dists")
try:
os.makedirs(self.destination)
except:
pass
else:
self.destination = destination
# Status reporter.
self.reporter = reporter
self.include_update = build['include_update']
self.build_update = self.include_update and build_update
# The various executables, which change names based on self.executable_name.
self.app = self.executable_name + ".app"
self.exe = self.executable_name + ".exe"
self.sh = self.executable_name + ".sh"
self.py = self.executable_name + ".py"
self.documentation_patterns = build['documentation_patterns']
build_packages = [ ]
for i in build['packages']:
name = i['name']
if (packages is None) or (name in packages):
build_packages.append(i)
if not build_packages:
self.reporter.info(_("Nothing to do."), pause=True)
return
# add the game.
self.reporter.info(_("Scanning project files..."))
self.scan_and_classify(project.path, build["base_patterns"])
self.archive_files(build["archives"])
# Add Ren'Py.
self.reporter.info(_("Scanning Ren'Py files..."))
self.scan_and_classify(config.renpy_base, build["renpy_patterns"])
# Add Python (with the same name as our executables)
self.add_python()
# Build the mac app.
self.add_mac_files()
# Add generated/special files.
if not build['renpy']:
self.add_renpy_files()
self.add_windows_files()
# Assign the x-bit as necessary.
self.mark_executable()
# Rename the executable-like files.
if not build['renpy']:
self.rename()
# The time of the update version.
self.update_version = int(time.time())
for p in build_packages:
for f in p["formats"]:
self.make_package(
p["name"],
f,
p["file_lists"],
dlc=p["dlc"])
if self.build_update and p["update"]:
self.make_package(
p["name"],
"update",
p["file_lists"],
dlc=False)
if self.build_update:
self.finish_updates(build_packages)
self.log.close()
def scan_and_classify(self, directory, patterns):
"""
Walks through the `directory`, finds files and directories that
match the pattern, and assds them to the appropriate file list.
`patterns`
A list of pattern, file_list tuples. The pattern is a string
that is matched using match. File_list is either
a space-separated list of file lists to add the file to,
or None to ignore it.
Directories are matched with a trailing /, but added to the
file list with the trailing / removed.
"""
def walk(name, path):
is_dir = os.path.isdir(path)
if is_dir:
match_name = name + "/"
else:
match_name = name
for pattern, file_list in patterns:
if match(match_name, pattern):
break
else:
print >> self.log, match_name.encode("utf-8"), "doesn't match anything."
pattern = None
file_list = None
print >> self.log, match_name.encode("utf-8"), "matches", pattern, "(" + str(file_list) + ")."
if file_list is None:
return
for fl in file_list:
f = File(name, path, is_dir, False)
self.file_lists[fl].append(f)
if is_dir:
for fn in os.listdir(path):
walk(
name + "/" + fn,
os.path.join(path, fn),
)
for fn in os.listdir(directory):
walk(fn, os.path.join(directory, fn))
def temp_filename(self, name):
self.project.make_tmp()
return os.path.join(self.project.tmp, name)
def add_file(self, file_list, name, path, executable=False):
"""
Adds a file to the file lists.
`file_list`
A space-separated list of file list names.
`name`
The name of the file to be added.
`path`
The path to that file on disk.
"""
if not os.path.exists(path):
raise Exception("{} does not exist.".format(path))
if isinstance(file_list, basestring):
file_list = file_list.split()
f = File(name, path, False, executable)
for fl in file_list:
self.file_lists[fl].append(f)
def archive_files(self, archives):
"""
Add files to archives.
"""
for arcname, file_list in archives:
if not self.file_lists[arcname]:
continue
arcfn = arcname + ".rpa"
arcpath = self.temp_filename(arcfn)
af = archiver.Archive(arcpath)
fll = len(self.file_lists[arcname])
for i, entry in enumerate(self.file_lists[arcname]):
if entry.directory:
continue
self.reporter.progress(_("Archiving files..."), i, fll)
name = "/".join(entry.name.split("/")[1:])
af.add(name, entry.path)
self.reporter.progress_done()
af.close()
self.add_file(file_list, "game/" + arcfn, arcpath)
def add_renpy_files(self):
"""
Add Ren'Py-generic files to the project.
"""
if not os.path.exists(os.path.join(self.project.path, "game", "script_version.rpy")):
self.add_file("all", "game/script_version.rpy", os.path.join(config.gamedir, "script_version.rpy"))
if not os.path.exists(os.path.join(self.project.path, "game", "script_version.rpyc")):
self.add_file("all", "game/script_version.rpyc", os.path.join(config.gamedir, "script_version.rpyc"))
self.add_file("all", "renpy/LICENSE.txt", os.path.join(config.renpy_base, "LICENSE.txt"))
def write_plist(self):
display_name = self.build['display_name']
executable_name = self.executable_name
version = self.build['version']
plist = dict(
CFBundleDevelopmentRegion="English",
CFBundleDisplayName=display_name,
CFBundleExecutable=executable_name,
CFBundleIconFile="icon",
CFBundleInfoDictionaryVersion="6.0",
CFBundleName=display_name,
CFBundlePackageType="APPL",
CFBundleShortVersionString=version,
CFBundleVersion="1.0.{0}".format(int(time.time())),
CFBundleDocumentTypes = [
{
"CFBundleTypeOSTypes" : [ "****", "fold", "disk" ],
"CFBundleTypeRole" : "Viewer",
},
],
UTExportedTypeDeclarations = [
{
"UTTypeConformsTo" : [ "public.python-script" ],
"UTTypeDescription" : "Ren'Py Script",
"UTTypeIdentifier" : "org.renpy.rpy",
"UTTypeTagSpecification" : { "public.filename-extension" : [ "rpy" ] }
},
],
)
rv = self.temp_filename("Info.plist")
plistlib.writePlist(plist, rv)
return rv
def add_python(self):
if self.build['renpy']:
windows = 'binary'
linux = 'binary'
mac = 'binary'
else:
windows = 'windows'
linux = 'linux'
mac = 'mac'
self.add_file(
linux,
"lib/linux-i686/" + self.executable_name,
os.path.join(config.renpy_base, "lib/linux-i686/pythonw"),
True)
self.add_file(
linux,
"lib/linux-x86_64/" + self.executable_name,
os.path.join(config.renpy_base, "lib/linux-x86_64/pythonw"),
True)
self.add_file(
mac,
"lib/darwin-x86_64/" + self.executable_name,
os.path.join(config.renpy_base, "lib/darwin-x86_64/pythonw"),
True)
self.add_file(
windows,
"lib/windows-i686/" + self.executable_name + ".exe",
os.path.join(config.renpy_base, "lib/windows-i686/pythonw.exe"))
def add_mac_files(self):
"""
Add mac-specific files to the distro.
"""
if self.build['renpy']:
filelist = "binary"
else:
filelist = "mac"
contents = self.app + "/Contents"
plist_fn = self.write_plist()
self.add_file(filelist, contents + "/Info.plist", plist_fn)
self.add_file(filelist, contents + "/MacOS/" + self.executable_name, os.path.join(config.renpy_base, "renpy.sh"))
custom_fn = os.path.join(self.project.path, "icon.icns")
default_fn = os.path.join(config.renpy_base, "launcher/icon.icns")
if os.path.exists(custom_fn):
icon_fn = custom_fn
else:
icon_fn = default_fn
self.add_file(filelist, contents + "/Resources/icon.icns", icon_fn)
def add_windows_files(self):
"""
Adds windows-specific files.
"""
icon_fn = os.path.join(self.project.path, "icon.ico")
old_exe_fn = os.path.join(config.renpy_base, "renpy.exe")
if os.path.exists(icon_fn):
exe_fn = self.temp_filename("renpy.exe")
with open(exe_fn, "wb") as f:
f.write(change_icons(old_exe_fn, icon_fn))
else:
exe_fn = old_exe_fn
self.add_file("windows", "renpy.exe", exe_fn)
def mark_executable(self):
"""
Marks files as executable.
"""
for l in self.file_lists.values():
for f in l:
for pat in self.build['xbit_patterns']:
if match(f.name, pat):
f.executable = True
if match("/" + f.name, pat):
f.executable = True
def rename(self):
"""
Rename files in all lists to match the executable names.
"""
def rename_one(fn):
parts = fn.split('/')
p = parts[0]
if p == "renpy.exe":
p = self.exe
elif p == "renpy.sh":
p = self.sh
elif p == "renpy.py":
p = self.py
parts[0] = p
return "/".join(parts)
for l in self.file_lists.values():
for f in l:
f.name = rename_one(f.name)
def make_package(self, variant, format, file_lists, dlc=False):
"""
Creates a package file in the projects directory.
`variant`
The name of the variant to package. This is appended to the base name to become
part of the file and directory names.
`format`
The format things will be packaged in. This should be one of "zip", "tar.bz2", or
"update".
`file_lists`
A string containing a space-separated list of file_lists to include in this
package.
`dlc`
True if we want to build a non-update file in DLC mode.
"""
filename = self.base_name + "-" + variant
path = os.path.join(self.destination, filename)
fl = FileList.merge([ self.file_lists[i] for i in file_lists ])
fl = fl.copy()
fl.sort()
if self.build.get("exclude_empty_directories", True):
fl = fl.filter_empty()
# Write the update information.
update_files = [ ]
update_xbit = [ ]
update_directories = [ ]
for i in fl:
if not i.directory:
update_files.append(i.name)
else:
update_directories.append(i.name)
if i.executable:
update_xbit.append(i.name)
update = { variant : { "version" : self.update_version, "pretty_version" : self.pretty_version, "files" : update_files, "directories" : update_directories, "xbit" : update_xbit } }
if self.include_update and not dlc:
update_fn = os.path.join(self.destination, filename + ".update.json")
with open(update_fn, "wb") as f:
json.dump(update, f)
fl.append(File("update", None, True, False))
fl.append(File("update/current.json", update_fn, False, False))
# The mac transform.
if format == "app-zip":
fl = fl.mac_transform(self.app, self.documentation_patterns)
# If we're not an update file, prepend the directory.
if (not dlc) and format != "update":
fl.prepend_directory(filename)
if format == "tar.bz2":
path += ".tar.bz2"
pkg = TarPackage(path, "w:bz2")
elif format == "update":
path += ".update"
pkg = TarPackage(path, "w", notime=True)
elif format == "zip" or format == "app-zip":
path += ".zip"
pkg = ZipPackage(path)
for i, f in enumerate(fl):
self.reporter.progress(_("Writing the [variant] [format] package."), i, len(fl), variant=variant, format=format)
if f.directory:
pkg.add_directory(f.name, f.path)
else:
pkg.add_file(f.name, f.path, f.executable)
self.reporter.progress_done()
pkg.close()
if format == "update":
# Build the zsync file.
self.reporter.info(_("Making the [variant] update zsync file."), variant=variant)
cmd = [
updater.zsync_path("zsyncmake"),
"-z",
# -u url to gzipped data - not a local filename!
"-u", filename + ".update.gz",
"-o", os.path.join(self.destination, filename + ".zsync"),
os.path.abspath(path),
]
subprocess.check_call([ renpy.fsencode(i) for i in cmd ])
# Build the sums file. This is a file with an adler32 hash of each 64k block
# of the zsync file. It's used to help us determine how much of the file is
# downloaded.
with open(path, "rb") as src:
with open(renpy.fsencode(os.path.join(self.destination, filename + ".sums")), "wb") as sums:
while True:
data = src.read(65536)
if not data:
break
sums.write(struct.pack("I", zlib.adler32(data) & 0xffffffff))
if self.include_update and not self.build_update and not dlc:
os.unlink(update_fn)
def finish_updates(self, packages):
"""
Indexes the updates, then removes the .update files.
"""
if not self.build_update:
return
index = { }
def add_variant(variant):
fn = renpy.fsencode(os.path.join(self.destination, self.base_name + "-" + variant + ".update"))
with open(fn, "rb") as f:
digest = hashlib.sha256(f.read()).hexdigest()
index[variant] = {
"version" : self.update_version,
"pretty_version" : self.pretty_version,
"digest" : digest,
"zsync_url" : self.base_name + "-" + variant + ".zsync",
"sums_url" : self.base_name + "-" + variant + ".sums",
"json_url" : self.base_name + "-" + variant + ".update.json",
}
os.unlink(fn)
for p in packages:
if p["update"]:
add_variant(p["name"])
fn = renpy.fsencode(os.path.join(self.destination, "updates.json"))
with open(fn, "wb") as f:
json.dump(index, f)
def dump(self):
for k, v in sorted(self.file_lists.items()):
print
print k + ":"
v.sort()
for i in v:
print " ", i.name, "xbit" if i.executable else ""
class GuiReporter(object):
"""
Displays progress using the gui.
"""
def __init__(self):
# The time at which we should next report progress.
self.next_progress = 0
def info(self, what, pause=False, **kwargs):
if pause:
interface.information(what, **kwargs)
else:
interface.processing(what, **kwargs)
def progress(self, what, complete, total, **kwargs):
if (complete > 0) and (time.time() < self.next_progress):
return
interface.processing(what, _("Processed {b}[complete]{/b} of {b}[total]{/b} files."), complete=complete, total=total, **kwargs)
self.next_progress = time.time() + .05
def progress_done(self):
return
class TextReporter(object):
"""
Displays progress on the command line.
"""
def info(self, what, pause=False, **kwargs):
what = what.replace("[", "{")
what = what.replace("]", "}")
what = what.format(**kwargs)
print what
def progress(self, what, done, total, **kwargs):
what = what.replace("[", "{")
what = what.replace("]", "}")
what = what.format(**kwargs)
sys.stdout.write("\r{} - {} of {}".format(what, done + 1, total))
sys.stdout.flush()
def progress_done(self):
sys.stdout.write("\n")
def distribute_command():
ap = renpy.arguments.ArgumentParser()
ap.add_argument("--destination", "--dest", default=None, action="store", help="The directory where the packaged files should be placed.")
ap.add_argument("--no-update", default=True, action="store_false", dest="build_update", help="Prevents updates from being built.")
ap.add_argument("project", help="The path to the project directory.")
ap.add_argument("--package", action="append", help="If given, a package to build. Defaults to building all packages.")
args = ap.parse_args()
p = project.Project(args.project)
if args.package:
packages = args.package
else:
packages = None
Distributor(p, destination=args.destination, reporter=TextReporter(), packages=packages, build_update=args.build_update)
return False
renpy.arguments.register_command("distribute", distribute_command)
label distribute:
python hide:
data = project.current.data
d = distribute.Distributor(project.current, reporter=distribute.GuiReporter(), packages=data['packages'], build_update=data['build_update'])
OpenDirectory(d.destination)()
interface.info(_("All packages have been built.\n\nDue to the presence of permission information, unpacking and repacking the Linux and Macintosh distributions on Windows is not supported."))
jump front_page
+247
View File
@@ -0,0 +1,247 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
class PackageToggle(Action):
def __init__(self, name):
self.name = name
def get_selected(self):
return self.name in project.current.data['packages']
def __call__(self):
packages = project.current.data['packages']
if self.name in packages:
packages.remove(self.name)
else:
packages.append(self.name)
project.current.save_data()
renpy.restart_interaction()
class DataToggle(Action):
def __init__(self, field):
self.field = field
def get_selected(self):
return project.current.data[self.field]
def __call__(self):
project.current.data[self.field] = not project.current.data[self.field]
project.current.save_data()
renpy.restart_interaction()
DEFAULT_BUILD_INFO = """
## This section contains information about how to build your project into
## distribution files.
init python:
## The name that's used for directories and archive files. For example, if
## this is 'mygame-1.0', the windows distribution will be in the
## directory 'mygame-1.0-win', in the 'mygame-1.0-win.zip' file.
build.directory_name = "PROJECTNAME-1.0"
## The name that's uses for executables - the program that users will run
## to start the game. For example, if this is 'mygame', then on Windows,
## users can click 'mygame.exe' to start the game.
build.executable_name = "PROJECTNAME"
## If True, Ren'Py will include update information into packages. This
## allows the updater to run.
build.include_update = False
## File patterns:
##
## The following functions take file patterns. File patterns are case-
## insensitive, and matched against the path relative to the base
## directory, with and without a leading /. If multiple patterns match,
## the first is used.
##
##
## In a pattern:
##
## /
## Is the directory separator.
## *
## Matches all characters, except the directory separator.
## **
## Matches all characters, including the directory separator.
##
## For example:
##
## *.txt
## Matches txt files in the base directory.
## game/**.ogg
## Matches ogg files in the game directory or any of its subdirectories.
## **.psd
## Matches psd files anywhere in the project.
## Classify files as None to exclude them from the built distributions.
build.classify('**~', None)
build.classify('**.bak', None)
build.classify('**/.**', None)
build.classify('**/#**', None)
build.classify('**/thumbs.db', None)
## To archive files, classify them as 'archive'.
# build.classify('game/**.png', 'archive')
# build.classify('game/**.jpg', 'archive')
## Files matching documentation patterns are duplicated in a mac app
## build, so they appear in both the app and the zip file.
build.documentation('*.html')
build.documentation('*.txt')
"""
# A screen that displays a file or directory name, and
# lets the user change it,
#
# title
# The title of the link.
# value
# The value of the field.
screen distribute_name:
add SEPARATOR2
frame:
style "l_indent"
has vbox
text title
add HALF_SPACER
frame:
style "l_indent"
text "[value!q]"
add SPACER
screen build_distributions:
frame:
style_group "l"
style "l_root"
window:
has vbox
label _("Build Distributions: [project.current.name!q]")
add HALF_SPACER
hbox:
# Left side.
frame:
style "l_indent"
xmaximum ONEHALF
xfill True
has vbox
use distribute_name(
title=_("Directory Name:"),
value=project.current.dump["build"]["directory_name"])
use distribute_name(
title=_("Executable Name:"),
value=project.current.dump["build"]["executable_name"])
add SEPARATOR2
frame:
style "l_indent"
has vbox
text _("Actions:")
add HALF_SPACER
frame style "l_indent":
has vbox
textbutton _("Edit options.rpy") action editor.Edit("game/options.rpy", check=True)
textbutton _("Refresh") action Jump("build_distributions")
# Right side.
frame:
style "l_indent"
xmaximum ONEHALF
xfill True
has vbox
add SEPARATOR2
frame:
style "l_indent"
has vbox
text _("Build Packages:")
add HALF_SPACER
$ packages = project.current.dump["build"]["packages"]
for pkg in packages:
$ description = pkg["description"]
textbutton "[description!q]" action PackageToggle(pkg["name"]) style "l_checkbox"
add SPACER
if project.current.dump["build"]["include_update"]:
textbutton _("Build Updates") action DataToggle("build_update") style "l_checkbox"
textbutton _("Back") action Jump("front_page") style "l_left_button"
textbutton _("Build") action Jump("distribute") style "l_right_button"
label build_update_dump:
python:
project.current.update_dump(True)
if project.current.dump.get("error", False):
interface.error(_("Errors were detected when running the project. Please ensure the project runs without errors before building distributions."))
return
label build_distributions:
call build_update_dump
if not project.current.dump["build"]["directory_name"]:
jump build_missing
call screen build_distributions
label build_missing:
python hide:
interface.yesno(_("Your project does not contain build information. Would you like to add build information to the end of options.rpy?"), yes=Return(True), no=Jump("front_page"))
build_info = DEFAULT_BUILD_INFO.replace("PROJECTNAME", project.current.name)
with open(os.path.join(project.current.path, "game", "options.rpy"), "a") as f:
f.write(build_info)
jump build_distributions
+421
View File
@@ -0,0 +1,421 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# Editor Support.
#
# This contains code for scanning for editors, and for allowing the user to
# select an editor.
init python in editor:
from store import Action, renpy, config, persistent
import store.project as project
import store.updater as updater
import store.interface as interface
import store
import glob
import re
import traceback
import os
import os.path
# Should we set up the editor?
set_editor = "RENPY_EDIT_PY" not in os.environ
# A map from editor name to EditorInfo object.
editors = { }
class EditorInfo(object):
def __init__(self, filename):
# The path to the editor info file.
self.filename = filename
# The name of the editor.
self.name = os.path.basename(filename)[:-len(".edit.py")]
# The time the editor file was last modified. We use this
# to decide if we should update the editors mat when we
# have multiple versions of an editor in contention.
self.mtime = os.path.getmtime(filename)
def scan_editor(filename):
"""
Inserts an editor into editors if there isn't a newer
editor there already.
"""
ei = EditorInfo(filename)
if ei.name in editors:
if editors[ei.name].mtime >= ei.mtime:
return
editors[ei.name] = ei
def scan_all():
"""
Finds all *.edit.py files, and uses them to populate the list
of editors.
"""
editors.clear()
for d in [ config.renpy_base, persistent.projects_directory ]:
if d is None:
continue
for filename in glob.glob(d + "/*/*.edit.py"):
scan_editor(filename)
########################################################################
# A list of fancy_editor_info objects.
fancy_editors = [ ]
# The error message to display if an editor failed to start.
error_message = None
class FancyEditorInfo(object):
"""
Represents an editor in the selection screen. A FEI knows if the
editor is installed or not.
"""
def __init__(self, priority, name, description=None, dlc=None, dldescription=None, error_message=None):
# The priority of the editor. Lower priorities will come later
# in the list.
self.priority = priority
# The name of the editor.
self.name = name
# Is the editor installed?
self.installed = name in editors
# The dlc needed to install the editor.
self.dlc = dlc
# A description of the editor.
self.description = description
# A description of the download.
self.dldescription = dldescription
# An error message to display if the editor failed to start.
self.error_message = error_message
def fancy_scan_editors():
"""
Creates the list of FancyEditorInfo objects.
"""
global fancy_editors
scan_all()
fei = fancy_editors = [ ]
# Editra.
ED = _("{b}Recommended.{/b} A beta editor with an easy to use interface and features that aid in development, such as spell-checking. Editra currently lacks the IME support required for Chinese, Japanese, and Korean text input.")
EDL = _("{b}Recommended.{/b} A beta editor with an easy to use interface and features that aid in development, such as spell-checking. Editra currently lacks the IME support required for Chinese, Japanese, and Korean text input. On Linux, Editra requires wxPython.")
if renpy.windows:
dlc = "editra-windows"
installed = os.path.exists(os.path.join(config.basedir, "editra/Editra-win32"))
description = ED
error_message = None
elif renpy.macintosh:
dlc = "editra-mac"
installed = os.path.exists(os.path.join(config.basedir, "editra/Editra-mac.app"))
description = ED
error_message = None
else:
dlc = "editra-linux"
installed = os.path.exists(os.path.join(config.basedir, "editra/Editra"))
description = EDL
error_message = _("The may have occured because wxPython is not installed on this system.")
e = FancyEditorInfo(
1,
"Editra",
description,
dlc,
_("Up to 22 MB download required."),
error_message)
e.installed = e.installed or installed
fei.append(e)
# jEdit
fei.append(FancyEditorInfo(
2,
"jEdit",
"A mature editor that requires Java.",
"jedit",
_("1.8 MB download required."),
_("This may have occured because Java is not installed on this system."),
))
fei.append(FancyEditorInfo(
3,
"System Editor",
"Invokes the editor your operating system has associated with .rpy files.",
None))
for k in editors:
if k in [ "Editra", "jEdit", "System Editor", "None" ]:
continue
fei.append(FancyEditorInfo(
4,
k,
None,
None))
fei.append(FancyEditorInfo(
5,
"None",
"Prevents Ren'Py from opening a text editor.",
None))
fei.sort(key=lambda e : (e.priority, e.name.lower()))
# If we're in a linux distro or something, assume all editors work.
if not updater.can_update():
for i in fei:
i.installed = True
def fancy_activate_editor(default=False):
"""
Activates the editor in persistent.editor, if it's installed.
`default`
"""
global error_message
fancy_scan_editors()
if default and not set_editor:
renpy.editor.init()
return
for i in fancy_editors:
if i.name == persistent.editor:
if i.installed and i.name in editors:
ei = editors[i.name]
os.environ["RENPY_EDIT_PY"] = renpy.fsencode(os.path.abspath(ei.filename))
error_message = i.error_message
break
else:
persistent.editor = None
os.environ.pop("RENPY_EDIT_PY", None)
renpy.editor.init()
def fancy_select_editor(name):
"""
Selects the editor with the given name, installing it if it
doesn't already exist.
"""
for fe in fancy_editors:
if fe.name == name:
break
else:
return
if not fe.installed:
# We don't check the status of this because fancy_activate_editor
# will fail if the editor is not installed.
store.add_dlc(fe.dlc)
persistent.editor = fe.name
fancy_activate_editor()
return persistent.editor is not None
# Call fancy_activate_editor on startup.
fancy_activate_editor(True)
class SelectEditor(Action):
def __init__(self, name):
self.name = name
def get_selected(self):
return persistent.editor == self.name
def __call__(self):
return fancy_select_editor(self.name)
def check_editor():
"""
Checks to see if an editor is set. If one isn't asks the user to
select one.
Returns True if the editor is set and editing can proceed, and
False otherwise.
"""
if not set_editor:
return True
if persistent.editor:
return True
return renpy.invoke_in_new_context(renpy.call_screen, "editor")
##########################################################################
# Editing actions.
class Edit(Action):
def __init__(self, filename, line=None, check=False):
"""
An action that opens the given line of the given file in a
text editor.
`filename`
The filename to open.
`line`
The line in the file to jump to.
`check`
If true, we will check to see if the file exists, and gray
out the box if it does not.
"""
self.filename = filename
self.line = line
self.check = check
def get_sensitive(self):
if not self.check:
return True
fn = project.current.unelide_filename(self.filename)
return os.path.exists(fn)
def __call__(self):
if not self.get_sensitive():
return
if not check_editor():
return
fn = project.current.unelide_filename(self.filename)
try:
e = renpy.editor.editor
e.begin()
e.open(fn, line=self.line)
e.end()
except Exception, e:
exception = traceback.format_exception_only(type(e), e)[-1][:-1]
renpy.invoke_in_new_context(interface.error, _("An exception occured while launching the text editor:\n[exception!q]"), error_message, exception=exception)
class EditAll(Action):
"""
Opens all scripts that are part of the current project in a web browser.
"""
def __init__(self):
return
def __call__(self):
if not check_editor():
return
scripts = project.current.script_files()
scripts = [ i for i in scripts if not i.startswith("game/tl/") ]
scripts.sort(key=lambda fn : fn.lower())
for fn in [ "game/screens.rpy", "game/options.rpy", "game/script.rpy" ]:
if fn in scripts:
scripts.remove(fn)
scripts.insert(0, fn)
try:
e = renpy.editor.editor
e.begin()
for fn in scripts:
fn = project.current.unelide_filename(fn)
e.open(fn)
e.end()
except Exception, e:
exception = traceback.format_exception_only(type(e), e)[-1][:-1]
renpy.invoke_in_new_context(interface.error, _("An exception occured while launching the text editor:\n[exception!q]"), error_message, exception=exception)
screen editor:
frame:
style_group "l"
style "l_root"
window:
has vbox
label _("Select Editor")
add HALF_SPACER
hbox:
frame:
style "l_indent"
xfill True
viewport:
scrollbars "vertical"
mousewheel True
has vbox
text _("A text editor is the program you'll use to edit Ren'Py script files. Here, you can select the editor Ren'Py will use. If not already present, the editor will be automatically downloaded and installed.") style "l_small_text"
for fe in editor.fancy_editors:
add SPACER
textbutton fe.name action editor.SelectEditor(fe.name)
add HALF_SPACER
frame:
style "l_indent"
has vbox
if fe.description:
text fe.description style "l_small_text"
if not fe.installed:
add HALF_SPACER
text fe.dldescription style "l_small_text"
textbutton _("Cancel") action Return(False) style "l_left_button"
label editor_preference:
call screen editor
jump preferences
+223
View File
@@ -0,0 +1,223 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
define PROJECT_ADJUSTMENT = ui.adjustment()
init python:
import os
import subprocess
class OpenDirectory(Action):
"""
Opens `directory` in a file browser. `directory` is relative to
the project root.
"""
def __init__(self, directory, absolute=False):
if absolute:
self.directory = directory
else:
self.directory = os.path.join(project.current.path, directory)
def get_sensitive(self):
return os.path.exists(self.directory)
def __call__(self):
directory = renpy.fsencode(self.directory)
if renpy.windows:
os.startfile(directory)
elif renpy.macintosh:
subprocess.Popen([ "open", directory ])
else:
subprocess.Popen([ "xdg-open", directory ])
# Used for testing.
def Relaunch():
renpy.quit(relaunch=True)
screen front_page:
frame:
style_group "l"
style "l_root"
has hbox
# Projects list section - on left.
frame:
style "l_projects"
xmaximum 300
right_margin 2
top_padding 20
bottom_padding 26
side "t c b":
window style "l_label":
text "PROJECTS:" style "l_label_text" size 36 yoffset 10
side "c r":
viewport:
yadjustment PROJECT_ADJUSTMENT
mousewheel True
use front_page_project_list
vbar:
style "l_vscrollbar"
adjustment PROJECT_ADJUSTMENT
vbox:
add HALF_SPACER
add SEPARATOR
add HALF_SPACER
textbutton _("+ Create New Project"):
left_margin (HALF_INDENT)
action Jump("new_project")
# Project section - on right.
if project.current is not None:
use front_page_project
if project.current is not None:
textbutton _("Launch Project") action project.Launch() style "l_right_button"
# This is used by front_page to display the list of known projects on the screen.
screen front_page_project_list:
$ projects = project.manager.projects
vbox:
if projects:
for p in projects:
textbutton "[p.name!q]":
action project.Select(p)
style "l_list"
null height 12
textbutton _("Tutorial") action project.Select("tutorial") style "l_list"
textbutton _("The Question") action project.Select("the_question") style "l_list"
# This is used for the right side of the screen, which is where the project-specific
# buttons are.
screen front_page_project:
$ p = project.current
window:
has vbox
frame style "l_label":
has hbox xfill True
text "[p.name!q]" style "l_label_text"
label _("Active Project") style "l_alternate"
grid 2 1:
xfill True
spacing HALF_INDENT
vbox:
label _("Open Directory") style "l_label_small"
frame style "l_indent":
has vbox
textbutton _("game") action OpenDirectory("game")
textbutton _("base") action OpenDirectory(".")
# textbutton _("images") action OpenDirectory("game/images") style "l_list"
# textbutton _("save") action None style "l_list"
vbox:
label _("Edit File") style "l_label_small"
frame style "l_indent":
has vbox
textbutton "script.rpy" action editor.Edit("game/script.rpy", check=True)
textbutton "options.rpy" action editor.Edit("game/options.rpy", check=True)
textbutton "screens.rpy" action editor.Edit("game/screens.rpy", check=True)
textbutton _("All script files") action editor.EditAll()
add SPACER
add SEPARATOR
add SPACER
frame style "l_indent":
has vbox
textbutton _("Navigate Script") text_size 30 action Jump("navigation")
add SPACER
grid 2 1:
xfill True
spacing HALF_INDENT
frame style "l_indent":
has vbox
textbutton _("Check Script (Lint)") action Jump("lint")
textbutton _("Change Theme") action Jump("choose_theme")
textbutton _("Delete Persistent") action Jump("rmpersistent")
# textbutton "Relaunch" action Relaunch
frame style "l_indent":
has vbox
if ability.can_distribute:
textbutton _("Build Distributions") action Jump("build_distributions")
textbutton _("Generate Translations") action Jump("translate")
label main_menu:
return
label start:
show screen bottom_info
label front_page:
call screen front_page
jump front_page
label lint:
python hide:
interface.processing(_("Checking script for potential problems..."))
lint_fn = project.current.temp_filename("lint.txt")
project.current.launch([ 'lint', lint_fn ], wait=True)
e = renpy.editor.editor
e.begin(True)
e.open(lint_fn)
e.end()
jump front_page
label rmpersistent:
python hide:
interface.processing(_("Deleting persistent data..."))
project.current.launch([ 'rmpersistent' ], wait=True)
jump front_page
+391
View File
@@ -0,0 +1,391 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
################################################################################
# Interface actions.
init python in interface:
from store import OpenURL, config, Return
import store
import os.path
import contextlib
RENPY_URL = "http://www.renpy.org"
RENPY_GAMES_URL = "http://games.renpy.org"
DOC_PATH = os.path.join(config.renpy_base, "doc/index.html")
DOC_URL = "http://www.renpy.org/doc/html/"
LICENSE_PATH = os.path.join(config.renpy_base, "doc/license.html")
LICENSE_URL = "http://www.renpy.org/doc/html/license.html"
if os.path.exists(DOC_PATH):
DOC_LOCAL_URL = "file:///" + DOC_PATH
else:
DOC_LOCAL_URL = None
if os.path.exists(LICENSE_PATH):
LICENSE_LOCAL_URL = "file:///" + LICENSE_PATH
else:
LICENSE_LOCAL_URL = None
def OpenDocumentation():
"""
An action that opens the documentation.
"""
if DOC_LOCAL_URL is not None:
return OpenURL(DOC_LOCAL_URL)
else:
return OpenURL(DOC_URL)
def OpenLicense():
"""
An action that opens the license.
"""
if LICENSE_LOCAL_URL is not None:
return OpenURL(LICENSE_LOCAL_URL)
else:
return OpenURL(LICENSE_URL)
# Should we display the bottom links?
links = True
@contextlib.contextmanager
def nolinks():
global links
links = False
try:
yield
finally:
links = True
# This displays the bottom of the screen. If the tooltip is not None, this displays the
# tooltip. Otherwise, it displays a list of links (to various websites, and to the
# preferences and update screen), or is just blank.
screen bottom_info:
zorder 100
if interface.links:
frame:
style_group "l"
style "l_default"
left_margin (10 + INDENT)
right_margin (10 + INDENT)
xfill True
ypos 536
yanchor 0.0
hbox:
xfill True
hbox:
spacing INDENT
textbutton _("Documentation") style "l_link" action interface.OpenDocumentation()
textbutton _("Ren'Py Website") style "l_link" action OpenURL(interface.RENPY_URL)
textbutton _("Ren'Py Games List") style "l_link" action OpenURL(interface.RENPY_GAMES_URL)
textbutton _("About") style "l_link" action Jump("about")
hbox:
spacing INDENT
xalign 1.0
if ability.can_update:
textbutton _("update") action Jump("update") style "l_link"
textbutton _("preferences") style "l_link" action Jump("preferences")
textbutton _("quit") style "l_link" action Quit(confirm=False)
screen common:
default complete = None
default total = None
default yes = None
default no = None
frame:
style "l_root"
frame:
style_group "l_info"
has vbox
text message:
text_align 0.5
xalign 0.5
layout "subtitle"
if complete is not None:
add SPACER
frame:
style "l_progress_frame"
bar:
range total
value complete
style "l_progress_bar"
if submessage:
add SPACER
text submessage:
text_align 0.5
xalign 0.5
layout "subtitle"
if yes:
add SPACER
hbox:
xalign 0.5
textbutton _("Yes") style "l_button" action yes
null width 160
textbutton _("No") style "l_button" action no
label title text_color title_color style "l_info_label"
if back:
textbutton _("Back") action Return(False) style "l_left_button"
if continue_:
textbutton _("Continue") action Return(True) style "l_right_button"
screen launcher_input:
frame:
style "l_root"
frame:
style_group "l_info"
has vbox
text message
add SPACER
input style "l_default" size 24 xalign 0.5 default default color INPUT_COLOR
if filename:
add SPACER
text _("Due to package format limitations, non-ASCII file and directory names are not allowed.")
label _("[title]") style "l_info_label" text_color QUESTION_COLOR
if cancel:
textbutton _("Cancel") action cancel style "l_left_button"
init python in interface:
import traceback
def common(title, title_color, message, submessage=None, back=False, continue_=False, pause0=False, **kwargs):
"""
Displays the info, interaction, and processing screens.
`title`
The title of the screen.
`message`
The main message that is displayed when the screen is.
`submessage`
If not None, a message that is displayed below the main message.
`back`
If True, a back button will be present. If it's clicked, False will
be returned.
`continue_`
If True, a continue button will be present. If it's clicked, True
will be returned.
`pause0`
If True, a zero-length pause will be inserted before calling the
screen. This will display it to the user and then immediately
return.
Other keyword arguments are passed to the screen itself.
"""
if pause0:
ui.pausebehavior(0)
return renpy.call_screen("common", title=title, title_color=title_color, message=message, submessage=submessage, back=back, continue_=continue_, **kwargs)
def error(message, submessage=None, label="front_page", **kwargs):
"""
Indicates to the user that an error has occured.
`message`
The message to display.
`submessage`
Optional secondary message information. For example, this may be
used to display an exception string.
`label`
The label to redirect to when the user finishes displaying the error. None
to just return.
Keyword arguments are passed into the screen so that they can be substituted into
the message.
"""
common(_("ERROR"), store.ERROR_COLOR, message=message, submessage=submessage, back=True, **kwargs)
if label:
renpy.jump(label)
@contextlib.contextmanager
def error_handling(what, label="front_page"):
"""
This is a context manager that catches exceptions and displays them using
interface.error.
`what`
What we're doing when the error occurs. This is usually written using
the present participle.
`label`
The label to jump to when error handling finishes.
As an example of usage::
with interface.error_handling("opening the log file"):
f = open("log.txt", "w")
"""
try:
yield
except Exception, e:
import traceback
traceback.print_exc()
error(_("While [what!q], an error occured:"),
_("[exception!q]"),
what=what,
exception=traceback.format_exception_only(type(e), e)[-1][:-1])
def input(title, message, filename=False, sanitize=True, cancel=None, default=""):
"""
Requests typewritten input from the user.
"""
rv = default
while True:
rv = renpy.call_screen("launcher_input", title=title, message=message, filename=filename, cancel=cancel, default=rv)
if sanitize:
if ("[" in rv) or ("{" in rv):
error(_("Text input may not contain the {{ or [[ characters."), label=None)
continue
if filename:
if filename and (filename != "withslash") and (("\\" in rv) or ("/" in rv)):
error(_("File and directory names may not contain / or \\."), label=None)
continue
try:
rv.encode("ascii")
except:
error(_("File and directory names must consist of ASCII characters."), label=None)
continue
return rv
def info(message, submessage=None, pause=True, **kwargs):
"""
Displays an informational message to the user. The user will be asked to click to
confirm that he has read the message.
`message`
The message to display.
`pause`
True if we should pause while showing the info.
Keyword arguments are passed into the screen so that they can be substituted into
the message.
"""
if pause:
common(_("INFORMATION"), store.INFO_COLOR, message, submessage, continue_=True, **kwargs)
else:
common(_("INFORMATION"), store.INFO_COLOR, message, submessage, pause=0, **kwargs)
def interaction(title, message, submessage=None, **kwargs):
"""
Put up on the screen while an interaction with an external program occurs.
This shows the message, then immediately returns.
`title`
The title of the interaction.
`message`
The message itself.
`submessage`
An optional sub message.
"""
common(title, store.INTERACTION_COLOR, message, submessage, pause0=True, **kwargs)
def processing(message, submessage=None, complete=None, total=None, **kwargs):
"""
Indicates to the user that processing is taking place. This should be used when
there is an indefinite amount of work to be done.
`message`
The message to display.
`submessage`
An additional message to display.
`complete`
The fraction complete the step is.
`total`
The total amount of work to do in this step.
Keyword arguments are passed into the screen so that they can be substituted into
the message.
"""
common(_("PROCESSING"), store.INTERACTION_COLOR, message, submessage, pause0=True, complete=complete, total=total, **kwargs)
def yesno(message, yes=Return(True), no=Return(False), **kwargs):
"""
Asks the user a yes or no question.
`message`
The question to ask.
`yes`
The action to perform if the user answers yes.
`no`
The action to perform if the user answer no.
"""
return common(_("QUESTION"), store.QUESTION_COLOR, message, yes=yes, no=no, **kwargs)

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

+262
View File
@@ -0,0 +1,262 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python in navigation:
import store.interface as interface
import store.project as project
import store.editor as editor
from store import persistent, Action
# The last navigation screen we've seen. This is the scree we try to go
# to the next time we enter navigation. (We may not be able to go there,
# if the screen is empty.)
if persistent.navigation is None:
persistent.navigation = "label"
# A map from a kind of information, to how we should sort it. Possible
# sorts are alphabetical, by-file, natural.
if persistent.navigation_sort is None:
persistent.navigation_sort = { }
if persistent.navigate_private is None:
persistent.navigate_private = False
if persistent.navigate_library is None:
persistent.navigate_library = False
# A list of kinds of navigation we support.
KINDS = [ "file", "label", "define", "transform", "screen", "callable", "todo" ]
# A map from kind name to adjustment.
adjustments = { }
for i in KINDS:
persistent.navigation_sort.setdefault(i, "by-file")
adjustments[i] = ui.adjustment()
def group_and_sort(kind):
"""
This is responsible for pulling navigation information of the
appropriate kind out of project.current.dump, grouping it,
and sorting it.
This returns a list of (group, list of (name, filename, line)). The
group may be a string or None.
"""
project.current.update_dump()
sort = persistent.navigation_sort[kind]
name_map = project.current.dump.get("location", {}).get(kind, { })
groups = { }
for name, loc in name_map.items():
filename, line = loc
filename = filename.replace("\\", "/")
if sort == "alphabetical":
group = None
else:
group = filename
if group.startswith("game/"):
group = group[5:]
g = groups.get(group, None)
if g is None:
groups[group] = g = [ ]
g.append((name, filename, line))
for g in groups.values():
if sort == "natural":
g.sort(key=lambda a : a[2])
else:
g.sort(key=lambda a : a[0].lower())
rv = list(groups.items())
rv.sort()
return rv
def group_and_sort_files():
rv = [ ]
for fn in project.current.script_files():
shortfn = fn
shortfn = shortfn.replace("\\", "/")
if shortfn.startswith("game/"):
shortfn = fn[5:]
rv.append((shortfn, fn, None))
rv.sort()
return [ (None, rv) ]
class ChangeKind(Action):
"""
Changes the kind of thing we're navigating over.
"""
def __init__(self, kind):
self.kind = kind
def get_selected(self):
return persistent.navigation == self.kind
def __call__(self):
if persistent.navigation == self.kind:
return
persistent.navigation = self.kind
renpy.jump("navigation_loop")
class ChangeSort(Action):
"""
Changes the sort order.
"""
def __init__(self, sort):
self.sort = sort
def get_selected(self):
return persistent.navigation_sort[persistent.navigation] == self.sort
def __call__(self):
if self.get_selected():
return
persistent.navigation_sort[persistent.navigation] = self.sort
renpy.jump("navigation_loop")
screen navigation:
frame:
style_group "l"
style "l_root"
window:
has vbox
frame style "l_label":
has hbox xfill True
text _("Navigate: [project.current.name]") style "l_label_text"
frame:
style "l_alternate"
style_group "l_small"
has hbox
if persistent.navigation != "file":
text _("Order: ")
textbutton _("alphabetical") action navigation.ChangeSort("alphabetical")
text " | "
textbutton _("by-file") action navigation.ChangeSort("by-file")
text " | "
textbutton _("natural") action navigation.ChangeSort("natural")
null width HALF_INDENT
textbutton _("refresh") action Jump("navigation_refresh")
add HALF_SPACER
frame style "l_indent":
hbox:
spacing HALF_INDENT
text _("Category:")
textbutton _("files") action navigation.ChangeKind("file")
textbutton _("labels") action navigation.ChangeKind("label")
textbutton _("defines") action navigation.ChangeKind("define")
textbutton _("transforms") action navigation.ChangeKind("transform")
textbutton _("screens") action navigation.ChangeKind("screen")
textbutton _("callables") action navigation.ChangeKind("callable")
textbutton _("TODOs") action navigation.ChangeKind("todo")
add SPACER
add SEPARATOR
frame style "l_indent_margin":
if groups:
viewport:
mousewheel True
scrollbars "vertical"
yadjustment navigation.adjustments[persistent.navigation]
vbox:
style_group "l_navigation"
for group_name, group in groups:
if group_name is not None:
text "[group_name!q]"
if persistent.navigation == "todo":
vbox:
for name, filename, line in group:
textbutton "[name!q]" action editor.Edit(filename, line)
else:
hbox:
box_wrap True
for name, filename, line in group:
textbutton "[name!q]" action editor.Edit(filename, line)
if group_name is not None:
add SPACER
if persistent.navigation == "file":
add SPACER
textbutton _("+ Add script file") action Jump("add_file") style "l_button"
else:
fixed:
if persistent.navigation == "todo":
text _("No TODO comments found.\n\nTo create one, include \"# TODO\" in your script."):
text_align 0.5
xalign 0.5
yalign 0.5
else:
text _("The list of names is empty."):
xalign 0.5
yalign 0.5
textbutton _("Back") action Jump("front_page") style "l_left_button"
textbutton _("Launch Project") action project.Launch() style "l_right_button"
label navigation:
label navigation_loop:
python in navigation:
kind = persistent.navigation
if kind == "file":
groups = group_and_sort_files()
else:
groups = group_and_sort(kind)
renpy.call_screen("navigation", groups=groups)
label navigation_refresh:
$ project.current.update_dump(True)
jump navigation_loop
+109
View File
@@ -0,0 +1,109 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
import shutil
import os
import time
import re
screen select_template:
default result = project.manager.get("template")
frame:
style_group "l"
style "l_root"
window:
has vbox
label _("Choose Project Template")
hbox:
frame:
style "l_indent"
xmaximum ONETHIRD
viewport:
scrollbars "vertical"
vbox:
for p in project.manager.templates:
textbutton "[p.name!q]" action SetScreenVariable("result", p) style "l_list"
frame:
style "l_indent"
xmaximum TWOTHIRDS
text _("Please select a template to use for your new project. Ren'Py ships with a default template that creates an English-language game with standard screens.")
textbutton _("Back") action Jump("front_page") style "l_left_button"
textbutton _("Continue") action Return(result) style "l_right_button"
label new_project:
if persistent.projects_directory is None:
call choose_projects_directory
python hide:
project_name = interface.input(
_("PROJECT NAME"),
_("Please enter the name of your project:"),
filename=True,
cancel=Jump("front_page"))
project_name = project_name.strip()
if not project_name:
interface.error(_("The project name may not be empty."))
project_dir = os.path.join(persistent.projects_directory, project_name)
if project.manager.get(project_name) is not None:
interface.error(_("[project_name!q] already exists. Please choose a different project name."), project_name=project_name)
if os.path.exists(project_dir):
interface.error(_("[project_dir!q] already exists. Please choose a different project name."), project_dir=project_dir)
if len(project.manager.templates) == 1:
template = project.manager.templates[0]
else:
template = renpy.call_screen("select_template")
template_path = template.path
with interface.error_handling("creating a new project"):
shutil.copytree(template_path, project_dir)
# Delete the tmp directory, if it exists.
if os.path.isdir(os.path.join(project_dir, "tmp")):
os.path.rmtree(os.path.join(project_dir, "tmp"))
# Delete project.json, which must exist.
os.unlink(os.path.join(project_dir, "project.json"))
# Change the save directory in options.rpy
fn = os.path.join(project_dir, "game/options.rpy")
with open(fn, "rb") as f:
options = f.read().decode("utf-8")
save_dir = project_name + "-" + str(int(time.time()))
options = re.sub(r'template-\d+', save_dir, options)
with open(fn, "wb") as f:
f.write(options.encode("utf-8"))
# Activate the project.
with interface.error_handling("activating the new project"):
project.manager.scan()
project.Select(project.manager.get(project_name))()
call choose_theme_callable
jump front_page
+301
View File
@@ -0,0 +1,301 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
## This file contains some of the options that can be changed to customize
## your Ren'Py game. It only contains the most common options... there
## is quite a bit more customization you can do.
##
## Lines beginning with two '#' marks are comments, and you shouldn't
## uncomment them. Lines beginning with a single '#' mark are
## commented-out code, and you may want to uncomment them when
## appropriate.
init -1 python hide:
## Should we enable the use of developer tools? This should be
## set to False before the game is released, so the user can't
## cheat using developer tools.
config.developer = True
## These control the width and height of the screen.
config.screen_width = 800
config.screen_height = 600
## This controls the title of the window, when Ren'Py is
## running in a window.
config.window_title = u"Ren'Py Launcher"
# These control the name and version of the game, that are reported
# with tracebacks and other debugging logs.
config.name = "Ren'Py Launcher"
config.version = renpy.version().split()[1]
#########################################
# Themes
## We then want to call a theme function. themes.roundrect is
## a theme that features the use of rounded rectangles. It's
## the only theme we currently support.
##
## The theme function takes a number of parameters that can
## customize the color scheme.
theme.roundrect(
## Theme: Roundrect
## Color scheme: Basic Blue
## The color of an idle widget face.
widget = "#003c78",
## The color of a focused widget face.
widget_hover = "#0050a0",
## The color of the text in a widget.
widget_text = "#c8ffff",
## The color of the text in a selected widget. (For
## example, the current value of a preference.)
widget_selected = "#ffffc8",
## The color of a disabled widget face.
disabled = "#404040",
## The color of disabled widget text.
disabled_text = "#c8c8c8",
## The color of informational labels.
label = "#ffffff",
## The color of a frame containing widgets.
frame = "#6496c8",
## The background of the main menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
mm_root = "#dcebff",
## The background of the game menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
gm_root = "#dcebff",
## If this is True, the in-game window is rounded. If False,
## the in-game window is square.
rounded_window = False,
## And we're done with the theme. The theme will customize
## various styles, so if we want to change them, we should
## do so below.
)
#########################################
## Help.
## This lets you configure the help option on the Ren'Py menus.
## It may be:
## - A label in the script, in which case that label is called to
## show help to the user.
## - A file name relative to the base directory, which is opened in a
## web browser.
## - None, to disable help.
config.help = "README.html"
#########################################
## Transitions.
## Used when entering the game menu from the game.
config.enter_transition = None
## Used when exiting the game menu to the game.
config.exit_transition = None
## Used between screens of the game menu.
config.intra_transition = None
## Used when entering the game menu from the main menu.
config.main_game_transition = None
## Used when returning to the main menu from the game.
config.game_main_transition = None
## Used when entering the main menu from the splashscreen.
config.end_splash_transition = None
## Used when entering the main menu after the game has ended.
config.end_game_transition = None
## Used when a game is loaded.
config.after_load_transition = None
## Used when the window is shown.
config.window_show_transition = None
## Used when the window is hidden.
config.window_hide_transition = None
#########################################
## This is the name of the directory where the game's data is
## stored. (It needs to be set early, before any other init code
## is run, so the persistent information can be found by the init code.)
python early:
config.save_directory = "launcher-4"
init -1 python hide:
#########################################
## Default values of Preferences.
## Note: These options are only evaluated the first time a
## game is run. To have them run a second time, delete
## game/saves/persistent
## Should we start in fullscreen mode?
config.default_fullscreen = False
## The default text speed in characters per second. 0 is infinite.
config.default_text_cps = 0
#########################################
## More customizations can go here.
config.sound = False
config.quit_action = Quit(confirm=False)
config.gl_resize = False
config.window_icon = "logo.png"
config.windows_icon = "logo32.png"
config.has_autosave = False
config.log_enable = False
config.mouse_hide_time = 86400 * 366
_game_menu_screen = None
config.underlay = [
renpy.Keymap(
quit = renpy.quit_event,
iconify = renpy.iconify,
choose_renderer = renpy.curried_call_in_new_context("_choose_renderer"),
),
]
config.rollback_enabled = False
## This section controls how to build Ren'Py. (Building the launcher is how
## we build Ren'Py distributions.)
init python:
## We're building Ren'Py tonight.
build.renpy = True
## The version number that's supplied to the updater.
build.version = "Ren'Py {}".format(config.version)
## The name that's used for directories and archive files. For example, if
## this is 'mygame-1.0', the windows distribution will be in the
## directory 'mygame-1.0-win', in the 'mygame-1.0-win.zip' file.
build.directory_name = "renpy-" + config.version.rsplit('.', 1)[0]
## The name that's uses for executables - the program that users will run
## to start the game. For example, if this is 'mygame', then on Windows,
## users can click 'mygame.exe' to start the game.
build.executable_name = "renpy"
## If True, Ren'Py will include update information into packages. This
## allows the updater to run.
build.include_update = True
## Clear out various file patterns.
build.renpy_patterns = [ ]
build.early_base_patterns = [ ]
build.base_patterns = [ ]
build.late_base_patterns = [ ]
# We don't need to clear out the executable patterns, since they're
# correct for Ren'Py.
## Now, add the Ren'Py distribution in using classify_renpy.
build.classify_renpy("**~", None)
build.classify_renpy("**/#*", None)
build.classify_renpy("**/thumbs.db", None)
build.classify_renpy("**/.*", None)
build.classify_renpy("**.old", None)
build.classify_renpy("**.new", None)
build.classify_renpy("**.bak", None)
build.classify_renpy("**.pyc", None)
build.classify_renpy("**/log.txt", None)
build.classify_renpy("**/saves/", None)
build.classify_renpy("**/tmp/", None)
build.classify_renpy("**/.Editra", None)
# main source.
build.classify_renpy("renpy.py", "source")
build.classify_renpy("renpy/**", "source")
# games.
build.classify_renpy("launcher/game/theme/", None)
build.classify_renpy("launcher/**", "source")
build.classify_renpy("template/**", "source")
build.classify_renpy("the_question/**", "source")
build.classify_renpy("tutorial/**", "source")
# docs.
build.classify_renpy("doc/", "source")
build.classify_renpy("doc/.doctrees/", None)
build.classify_renpy("doc/_sources/", None)
build.classify_renpy("doc/**", "source")
build.classify_renpy("LICENSE.txt", "source")
# module.
build.classify_renpy("module/", "source")
build.classify_renpy("module/*.c", "source")
build.classify_renpy("module/gen/", "source")
build.classify_renpy("module/gen/*.c", "source")
build.classify_renpy("module/*.h", "source")
build.classify_renpy("module/*.py*", "source")
build.classify_renpy("module/include/", "source")
build.classify_renpy("module/include/*.pxd", "source")
build.classify_renpy("module/pysdlsound/", "source")
build.classify_renpy("module/pysdlsound/*.py", "source")
build.classify_renpy("module/pysdlsound/*.pyx", "source")
# all-platforms binary.
build.classify_renpy("lib/*/renpy", None)
build.classify_renpy("lib/*/renpy.exe", None)
build.classify_renpy("lib/**", "binary")
build.classify_renpy("renpy.sh", "binary")
build.classify_renpy("renpy.exe", "binary")
# renpy.app is now built from scratch from distribute.rpy.
# jedit rules.
build.classify_renpy("jedit/**", "jedit")
# editra rules.
build.classify_renpy("editra/", "editra-all")
build.classify_renpy("editra/Editra.edit.py", "editra-all")
build.classify_renpy("editra/Editra/**", "editra-linux editra-windows")
build.classify_renpy("editra/Editra-mac.app/**", "editra-mac")
build.classify_renpy("editra/lib/**", "editra-windows")
build.classify_renpy("editra/editra.exe", "editra-windows")
# Executable rules.
build.executable("editra/Editra/Editra")
# Packages.
build.packages = [ ]
build.package("sdk", "zip tar.bz2", "source binary")
build.package("source", "tar.bz2", "source", update=False)
build.package("jedit", "zip", "jedit")
build.package("editra-linux", "tar.bz2", "editra-all editra-linux", dlc=True)
build.package("editra-mac", "zip", "editra-all editra-mac", dlc=True)
build.package("editra-windows", "zip", "editra-all editra-windows", dlc=True)
+175
View File
@@ -0,0 +1,175 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python in distribute:
import time
import zipfile
import tarfile
import zlib
import struct
import stat
from zipfile import crc32
zlib.Z_DEFAULT_COMPRESSION = 9
class ZipFile(zipfile.ZipFile):
def write_with_info(self, zinfo, filename):
"""Put the bytes from filename into the archive under the name
arcname."""
if not self.fp:
raise RuntimeError(
"Attempt to write to ZIP archive that was already closed")
st = os.stat(filename)
isdir = stat.S_ISDIR(st.st_mode)
zinfo.file_size = st.st_size
zinfo.flag_bits = 0x00
zinfo.header_offset = self.fp.tell() # Start of header bytes
self._writecheck(zinfo)
self._didModify = True
if isdir:
zinfo.file_size = 0
zinfo.compress_size = 0
zinfo.CRC = 0
self.filelist.append(zinfo)
self.NameToInfo[zinfo.filename] = zinfo
self.fp.write(zinfo.FileHeader())
return
with open(filename, "rb") as fp:
# Must overwrite CRC and sizes with correct data later
zinfo.CRC = CRC = 0
zinfo.compress_size = compress_size = 0
zinfo.file_size = file_size = 0
self.fp.write(zinfo.FileHeader())
if zinfo.compress_type == zipfile.ZIP_DEFLATED:
cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION,
zlib.DEFLATED, -15)
else:
cmpr = None
while 1:
buf = fp.read(1024 * 1024)
if not buf:
break
file_size = file_size + len(buf)
CRC = crc32(buf, CRC) & 0xffffffff
if cmpr:
buf = cmpr.compress(buf)
compress_size = compress_size + len(buf)
self.fp.write(buf)
if cmpr:
buf = cmpr.flush()
compress_size = compress_size + len(buf)
self.fp.write(buf)
zinfo.compress_size = compress_size
else:
zinfo.compress_size = file_size
zinfo.CRC = CRC
zinfo.file_size = file_size
# Seek backwards and write CRC and file sizes
position = self.fp.tell() # Preserve current position in file
self.fp.seek(zinfo.header_offset + 14, 0)
self.fp.write(struct.pack("<LLL", zinfo.CRC, zinfo.compress_size,
zinfo.file_size))
self.fp.seek(position, 0)
self.filelist.append(zinfo)
self.NameToInfo[zinfo.filename] = zinfo
class ZipPackage(object):
"""
A class that creates a zip file.
"""
def __init__(self, filename):
self.zipfile = ZipFile(filename, "w", zipfile.ZIP_DEFLATED)
def add_file(self, name, path, xbit):
if path is None:
raise Exception("path for " + name + " must not be None.")
zi = zipfile.ZipInfo(name)
s = os.stat(path)
zi.date_time = time.gmtime(s.st_mtime)[:6]
zi.compress_type = zipfile.ZIP_DEFLATED
zi.create_system = 3
if xbit:
zi.external_attr = long(0100755) << 16
else:
zi.external_attr = long(0100644) << 16
self.zipfile.write_with_info(zi, path)
def add_directory(self, name, path):
if path is None:
return
zi = zipfile.ZipInfo(name + "/")
s = os.stat(path)
zi.date_time = time.gmtime(s.st_mtime)[:6]
zi.compress_type = zipfile.ZIP_STORED
zi.create_system = 3
zi.external_attr = (long(0040755) << 16) | 0x10
self.zipfile.write_with_info(zi, path)
def close(self):
self.zipfile.close()
class TarPackage(object):
def __init__(self, filename, mode, notime=False):
"""
notime
If true, times will be forced to the epoch.
"""
self.tarfile = tarfile.open(filename, mode)
self.tarfile.dereference = True
self.notime = notime
def add_file(self, name, path, xbit):
if path is not None:
info = self.tarfile.gettarinfo(path, name)
else:
info = tarfile.TarInfo(name)
info.size = 0
info.mtime = int(time.time())
info.type = tarfile.DIRTYPE
if xbit:
info.mode = 0755
else:
info.mode = 0644
info.uid = 1000
info.gid = 1000
info.uname = "renpy"
info.gname = "renpy"
if self.notime:
info.mtime = 0
if info.isreg():
with open(path, "rb") as f:
self.tarfile.addfile(info, f)
else:
self.tarfile.addfile(info)
def add_directory(self, name, path):
self.add_file(name, path, True)
def close(self):
self.tarfile.close()
Binary file not shown.

After

Width:  |  Height:  |  Size: 687 B

@@ -1,3 +1,5 @@
#@PydevCodeAnalysisIgnore
"""pefile, Portable Executable reader module
@@ -25,11 +27,9 @@ __version__ = '1.2.10-%d' % int( __revision__[21:-2] )
__contact__ = 'ero@dkbza.org'
import os
import struct
import time
import math
import re
import exceptions
import string
import array
@@ -844,9 +844,10 @@ class SectionStructure(Structure):
"""Check whether the section contains the file offset provided."""
if not self.PointerToRawData:
# bss and other sections containing only uninitialized data must have 0
# and do not take space in the file
return False
# bss and other sections containing only uninitialized data must have 0
# and do not take space in the file
return False
return self.PointerToRawData <= offset < self.PointerToRawData + self.SizeOfRawData
@@ -3183,7 +3184,7 @@ class PE:
try:
# If the RVA is invalid all would blow up. Some EXEs seem to be
# specially nasty and have an invalid RVA.
data = self.get_data(rva, 2)
self.get_data(rva, 2)
except PEFormatError, e:
return None
+202
View File
@@ -0,0 +1,202 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
if persistent.gl_enable is None:
persistent.gl_enable = True
config.gl_enable = persistent.gl_enable
if persistent.windows_console is None:
persistent.windows_console = False
def scan_translations():
languages = renpy.known_languages()
if not languages:
return None
rv = [ ( "English", None) ]
for i in languages:
rv.append((i.title(), i))
return rv
screen preferences:
$ translations = scan_translations()
frame:
style_group "l"
style "l_root"
window:
has vbox
label _("Launcher Preferences")
add HALF_SPACER
hbox:
frame:
style "l_indent"
xmaximum ONETHIRD
xfill True
has vbox
# Projects directory selection.
add SEPARATOR2
frame:
style "l_indent"
yminimum 75
has vbox
text _("Projects Directory:")
add HALF_SPACER
frame style "l_indent":
if persistent.projects_directory:
textbutton _("[persistent.projects_directory!q]") action Jump("projects_directory_preference")
else:
textbutton _("Not Set") action Jump("projects_directory_preference")
add SPACER
# Text editor selection.
add SEPARATOR2
frame:
style "l_indent"
yminimum 75
has vbox
text _("Text Editor:")
add HALF_SPACER
frame style "l_indent":
if persistent.editor:
textbutton persistent.editor action Jump("editor_preference")
else:
textbutton _("Not Set") action Jump("editor_preference")
add SPACER
if ability.can_update:
# Update URL selection.
add SEPARATOR2
frame:
style "l_indent"
yminimum 75
has vbox
text _("Update Channel:")
add HALF_SPACER
frame style "l_indent":
textbutton persistent.update_channel action Jump("update_preference")
frame:
style "l_indent"
xmaximum ONETHIRD
xfill True
has vbox
add SEPARATOR2
frame:
style "l_indent"
yminimum 75
has vbox
text _("Navigation Options:")
add HALF_SPACER
textbutton _("Include private names") style "l_checkbox" action ToggleField(persistent, "navigate_private")
textbutton _("Include library names") style "l_checkbox" action ToggleField(persistent, "navigate_library")
add SPACER
add SEPARATOR2
frame:
style "l_indent"
yminimum 75
has vbox
text _("Launcher Options:")
add HALF_SPACER
textbutton _("Hardware rendering") style "l_checkbox" action ToggleField(persistent, "gl_enable")
if renpy.windows:
textbutton _("Console output") style "l_checkbox" action ToggleField(persistent, "windows_console")
frame:
style "l_indent"
xmaximum ONETHIRD
xfill True
has vbox
add SEPARATOR2
frame:
style "l_indent"
yminimum 75
has vbox
text _("Actions:")
add HALF_SPACER
textbutton _("Open launcher project") style "l_nonbox" action [ project.Select("launcher"), Jump("front_page") ]
if translations:
add SPACER
# Text editor selection.
add SEPARATOR2
frame:
style "l_indent"
yminimum 75
has vbox
text _("Language:")
add HALF_SPACER
# frame style "l_indent":
for tlname, tlvalue in translations:
textbutton tlname action Language(tlvalue) style "l_list"
textbutton _("Back") action Jump("front_page") style "l_left_button"
label projects_directory_preference:
call choose_projects_directory
jump preferences
label preferences:
call screen preferences
jump preferences
+536
View File
@@ -0,0 +1,536 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# Code that manages projects.
init python:
try:
import EasyDialogsWin as EasyDialogs
except:
EasyDialogs = None
import os
init python in project:
from store import persistent, config, Action, renpy
import store.util as util
import store.interface as interface
import sys
import os.path
import json
import subprocess
import re
import tempfile
class Project(object):
def __init__(self, path):
while path.endswith("/"):
path = path[:-1]
if not os.path.exists(path):
raise Exception("{} does not exist.".format(path))
# The name of the project.
self.name = os.path.basename(path)
# The path to the project.
self.path = path
# The path to the game directory.
gamedir = os.path.join(path, "game")
if os.path.isdir(gamedir):
self.gamedir = gamedir
else:
self.gamedir = path
# Load the data.
self.load_data()
# The project's temporary directory.
self.tmp = None
# This contains the result of dumping information about the game
# to disk.
self.dump = { }
# The mtime of the last dump file loaded.
self.dump_mtime = 0
def get_dump_filename(self):
self.make_tmp()
return os.path.join(self.tmp, "navigation.json")
def load_data(self):
try:
f = open(os.path.join(self.path, "project.json"), "rb")
self.data = json.load(f)
f.close()
except:
self.data = { }
self.update_data()
def save_data(self):
"""
Saves the project data.
"""
try:
with open(os.path.join(self.path, "project.json"), "wb") as f:
json.dump(self.data, f)
except:
self.load_data()
def update_data(self):
data = self.data
data.setdefault("build_update", False)
data.setdefault("packages", [ "all" ])
def make_tmp(self):
"""
Makes the project's temporary directory, if it doesn't exist
yet.
"""
if self.tmp and os.path.isdir(self.tmp):
return
tmp = os.path.join(self.path, "tmp")
try:
os.mkdir(tmp)
except:
pass
if os.path.isdir(tmp):
self.tmp = tmp
return
self.tmp = tempfile.mkdtemp()
def temp_filename(self, filename):
"""
Returns a filename in the temporary directory.
"""
self.make_tmp()
return os.path.join(self.tmp, filename)
def launch(self, args=[], wait=False):
"""
Launches the project.
`args`
Additional arguments to give to the project.
`wait`
If true, waits for the launched project to terminate before
continuing.
"""
self.make_tmp()
# Find the python executable to run.
executable_path = os.path.dirname(sys.executable)
if renpy.renpy.windows:
extension = ".exe"
else:
extension = ""
if persistent.windows_console:
executables = [ "python" + extension ]
else:
executables = [ "pythonw" + extension ]
executables.append(sys.executable)
for i in executables:
executable = os.path.join(executable_path, i)
if os.path.exists(executable):
break
else:
raise Exception("Python interpreter not found: %r", executables)
# Put together the basic command line.
cmd = [ executable, "-EOO", sys.argv[0] ]
cmd.append(self.path)
cmd.extend(args)
# Add flags to dump game info.
cmd.append("--json-dump")
cmd.append(self.get_dump_filename())
if persistent.navigate_private:
cmd.append("--json-dump-private")
if persistent.navigate_library:
cmd.append("--json-dump-common")
# Launch the project.
with interface.error_handling("launching the project"):
cmd = [ renpy.fsencode(i) for i in cmd ]
p = subprocess.Popen(cmd)
if wait:
p.wait()
def update_dump(self, force=False, gui=True):
"""
If the dumpfile does not exist, runs Ren'Py to create it. Otherwise,
loads it in iff it's newer than the one that's already loaded.
"""
dump_filename = self.get_dump_filename()
if force or not os.path.exists(dump_filename):
if gui:
interface.processing(_("Ren'Py is scanning the project..."))
self.launch(["quit"], wait=True)
if not os.path.exists(dump_filename):
self.dump["error"] = True
return
file_mtime = os.path.getmtime(dump_filename)
if file_mtime == self.dump_mtime:
return
self.dump_mtime = file_mtime
try:
with open(dump_filename, "r") as f:
self.dump = json.load(f)
# add todo list to dump data
self.update_todos()
except:
self.dump["error"] = True
def update_todos(self):
"""
Scans the scriptfiles for lines TODO comments and add them to
the dump data.
"""
todos = self.dump.setdefault("location", {})["todo"] = {}
files = self.script_files()
for f in files:
data = file(self.unelide_filename(f))
for l, line in enumerate(data):
l += 1
m = re.search(r".*#\s*TODO(\s*:\s*|\s+)(.*)", line, re.I)
if m is None:
continue
raw_todo_text = m.group(2).strip()
todo_text = raw_todo_text
index = 0
while not todo_text or todo_text in todos:
index += 1
todo_text = "{0} ({1})".format(raw_todo_text, index)
todos[todo_text] = [f, l]
def unelide_filename(self, fn):
"""
Unelides the filename relative to the project base.
"""
fn1 = os.path.join(self.path, fn)
if os.path.exists(fn1):
return fn1
fn2 = os.path.join(config.renpy_base, fn)
if os.path.exists(fn2):
return fn2
return fn
def script_files(self):
"""
Return a list of the script files that make up the project. These
are elided, and so need to be passed to unelide_filename before they
can be included in the project.
"""
rv = [ ]
rv.extend(i for i, isdir in util.walk(self.path) if (not isdir) and (i.endswith(".rpy") or i.endswith(".rpym")) )
return rv
class ProjectManager(object):
"""
This maintains a list of the various types of projects that
we know about.
"""
def __init__(self):
# The projects directory.
self.projects_directory = ""
# Normal projects, in alphabetical order by lowercase name.
self.projects = [ ]
# Template projects.
self.templates = [ ]
# All projects - normal, template, and hidden.
self.all_projects = [ ]
# Directories that have been scanned.
self.scanned = set()
self.scan()
def scan(self):
"""
Scans for projects.
"""
if (persistent.projects_directory is not None) and not os.path.isdir(persistent.projects_directory):
persistent.projects_directory = None
self.projects_directory = persistent.projects_directory
self.projects = [ ]
self.templates = [ ]
self.all_projects = [ ]
self.scanned = set()
if self.projects_directory is not None:
self.scan_directory(self.projects_directory)
self.scan_directory(config.renpy_base)
self.scan_directory(os.path.join(config.renpy_base, "templates"))
self.projects.sort(key=lambda p : p.name.lower())
self.templates.sort(key=lambda p : p.name.lower())
def scan_directory(self, d):
"""
Scans for projects in directories directly underneath `d`.
"""
global current
d = os.path.abspath(d)
if not os.path.isdir(d):
return
for pdir in os.listdir(d):
ppath = os.path.join(d, pdir)
# A project must be a directory.
if not os.path.isdir(ppath):
continue
# A project has either a game/ directory, or a project.json
# file.
if (not os.path.isdir(os.path.join(ppath, "game"))) and (not os.path.exists(os.path.join(ppath, "project.json"))):
continue
if ppath in self.scanned:
continue
self.scanned.add(ppath)
# We have a project directory, so create a Project.
p = Project(ppath)
project_type = p.data.get("type", "normal")
if project_type == "hidden":
pass
elif project_type == "template":
self.templates.append(p)
else:
self.projects.append(p)
self.all_projects.append(p)
# Select the default project.
if persistent.active_project is not None:
p = self.get(persistent.active_project)
if p is not None:
current = p
return
p = self.get("tutorial")
if p is not None:
current = p
return
current = None
def get(self, name):
"""
Gets the project with the given name.
Returns None if the project doesn't exist.
"""
for p in self.all_projects:
if p.name == name:
return p
return None
manager = ProjectManager()
# The current project.
current = None
# Actions
class Select(Action):
"""
An action that causes p to become the selected project when it was
clicked. If label is not None, jumps to the given label.
"""
def __init__(self, p, label=None):
"""
`p`
Either a project object, or a string giving the name of a
project.
`label`
The label to jump to when clicked.
"""
if isinstance(p, basestring):
p = manager.get(p)
self.project = p
self.label = label
def get_selected(self):
if self.project is None:
return False
if current is None:
return False
return current.path == self.project.path
def get_sensitive(self):
return self.project is not None
def __call__(self):
global current
current = self.project
persistent.active_project = self.project.name
renpy.restart_interaction()
if self.label is not None:
renpy.jump(self.label)
class Launch(Action):
"""
An action that launches the supplied project, or the current
project if no project is supplied.
"""
def __init__(self, p=None):
if p is None:
self.project = current
elif isinstance(p, basestring):
self.project = manager.get(p)
else:
self.project = p
def get_sensitive(self):
return self.project is not None
def __call__(self):
self.project.launch()
manager.scan()
if isinstance(persistent.projects_directory, str):
persistent.projects_directory = renpy.fsdecode(persistent.projects_directory)
###############################################################################
# Code to choose the projects directory.
label choose_projects_directory:
python hide:
interface.interaction(_("PROJECTS DIRECTORY"), _("Please choose the projects directory using the directory chooser.\n{b}The directory chooser may have opened behind this window.{/b}"), _("This launcher will scan for projects in this directory, will create new projects in this directory, and will place built projects into this directory."),)
path = persistent.projects_directory
if path:
default_path = path
else:
try:
default_path = os.path.dirname(os.path.abspath(config.renpy_base))
except:
default_path = os.path.abspath(config.renpy_base)
if EasyDialogs:
choice = EasyDialogs.AskFolder(defaultLocation=default_path, wanted=unicode)
if choice is not None:
path = choice
else:
path = None
else:
try:
cmd = [ "/usr/bin/python", os.path.join(config.gamedir, "tkaskdir.py"), renpy.fsencode(default_path) ]
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
choice = p.stdout.read()
p.wait()
if choice:
path = renpy.fsdecode(choice)
except:
import traceback
traceback.print_exc()
path = None
interface.error(_("Ren'Py was unable to run python with tkinter to choose the projects directory."), label=None)
if path is None:
path = default_path
interface.info(_("Ren'Py has set the projects directory to:"), "[path!q]", path=path)
path = renpy.fsdecode(path)
persistent.projects_directory = path
project.manager.scan()
return
+8
View File
@@ -0,0 +1,8 @@
-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEAnEdzfwV6FFnmjkbJHJKJ59jqLTGkPSES5LBFbxwweGuC3LU2sNs+
tRlWx+2+kbW6azb5yteP/O05/hzHdtIa4slao7s8A/wf0zA6HbLX4H5iqSosDvuw
FP9DAF46vH0Qn1a3k97JFV2eXoGAbwHZICKhbIPCm7qR39G8FvUrw7grCS+5Scb+
LzqkBv6TnwRDB4agcwhlkA432s6BTU8p9RIFmyldCEgq0SXeK07lkuDmOplp6IdL
bVwLoRWg6pngIEoPo/Qxt8ZnLdBthN+TAsMRiquz17GaAvERbkUBwYtlt7R8qx01
F3vzweKXSCguzr9XQBQflkVu2y6cmIEwPQIDAQAB
-----END RSA PUBLIC KEY-----
+4
View File
@@ -0,0 +1,4 @@
init -999:
$ config.script_version = (6, 15, 7)
Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

+295
View File
@@ -0,0 +1,295 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init -1 python:
# The color of non-interactive text.
TEXT = "#545454"
# Colors for buttons in various states.
IDLE = "#42637b"
HOVER = "#d86b45"
DISABLED = "#808080"
# Colors for reversed text buttons (selected list entries).
REVERSE_IDLE = "#78a5c5"
REVERSE_HOVER = "#d86b45"
REVERSE_TEXT = "#ffffff"
# Colors for the scrollbar thumb.
SCROLLBAR_IDLE = "#dfdfdf"
SCROLLBAR_HOVER = "#d86b45"
# An image used as a separator pattern.
PATTERN = "pattern.png"
# A displayable used for the background of everything.
BACKGROUND = "background.png"
# A displayable used for the background of windows
# containing commands, preferences, and navigation info.
WINDOW = Frame("window.png", 0, 0, tile=True)
# A displayable used for the background of the projects list.
PROJECTS_WINDOW = Null()
# A displayable used the background of information boxes.
INFO_WINDOW = "#f9f9f9"
# Colors for the titles of information boxes.
ERROR_COLOR = "#d15353"
INFO_COLOR = "#545454"
INTERACTION_COLOR = "#d19753"
QUESTION_COLOR = "#d19753"
# The color of input text.
INPUT_COLOR = "#d86b45"
init 1 python:
INDENT = 20
HALF_INDENT = 10
SCROLLBAR_SIZE = 16
SEPARATOR = Frame(PATTERN, 0, 0, tile=True, ymaximum=5, yalign=1.0)
SEPARATOR2 = Frame(PATTERN, 0, 0, tile=True, ymaximum=10, yalign=1.0)
SPACER_HEIGHT = 12
SPACER = Null(height=SPACER_HEIGHT)
HALF_SPACER_HEIGHT = 6
HALF_SPACER = Null(height=HALF_SPACER_HEIGHT)
# FONTS/WEIGHTS
LIGHT = "Roboto-Light.ttf"
REGULAR = "Roboto-Regular.ttf"
DARK = "Roboto-Medium.ttf"
# DIVIDING THE SCREEN
ONETHIRD = 258
TWOTHIRDS = 496
ONEHALF = 377
# Default style.
style.l_default = Style(style.default)
style.l_default.font = LIGHT
style.l_default.color = TEXT
style.l_default.idle_color = IDLE
style.l_default.hover_color = HOVER
style.l_default.size = 18
style.l_text = Style(style.l_default)
style.l_button = Style(style.l_default)
style.l_button_text = Style(style.l_default)
style.l_button_text.insensitive_color = DISABLED
style.l_button_text.selected_font = REGULAR
# A small button, used at the bottom of the screen.
style.l_link = Style(style.l_default)
style.l_link_text = Style(style.l_default)
style.l_link_text.size = 14
style.l_link_text.font = LIGHT
# Action buttons on the bottom of the screen.
style.l_right_button = Style(style.l_default)
style.l_right_button.xalign = 1.0
style.l_right_button.ypos = 600 - 128 + 12
style.l_right_button.left_margin = 8 + INDENT
style.l_right_button.right_margin = 10 + INDENT
style.l_right_button_text = Style(style.l_default)
style.l_right_button_text.size = 30
style.l_left_button = Style(style.l_right_button)
style.l_left_button.xalign = 0.0
style.l_left_button_text = Style(style.l_right_button_text)
# The root frame. This contains everything but the bottom navigation, back
# button, and tooltip button.
style.l_root = Style(style.l_default)
style.l_root.background = BACKGROUND
style.l_root.xpadding = 10
style.l_root.top_padding = 64
style.l_root.bottom_padding = 128
# An inner window.
style.l_window = Style(style.l_default)
style.l_window.background = WINDOW
style.l_window.left_padding = 6
style.l_window.xfill = True
style.l_window.yfill = True
# Normal-sized labels.
style.l_label = Style(style.l_default)
style.l_label.xfill = True
style.l_label.top_padding = 10
style.l_label.bottom_padding = 8
style.l_label.bottom_margin = 12
style.l_label.background = SEPARATOR
style.l_label_text = Style(style.l_default)
style.l_label_text.size = 24
style.l_label_text.xpos = INDENT
style.l_label_text.yoffset = 6
# Small labels.
style.l_label_small = Style(style.l_default)
style.l_label_small.xfill = True
style.l_label_small.bottom_padding = 8
style.l_label_small.bottom_margin = HALF_SPACER_HEIGHT
style.l_label_small.background = SEPARATOR
style.l_label_small_text = Style(style.l_default)
style.l_label_small_text.xpos = INDENT
style.l_label_small_text.yoffset = 6
style.l_label_small_text.size = 20
# Alternate labels. This nests inside an l_label, and gives a button
# or label that's nested inside another label.
style.l_alternate = Style(style.l_default)
style.l_alternate.xalign = 1.0
style.l_alternate.yalign = 1.0
style.l_alternate.yoffset = 4
style.l_alternate.right_margin = INDENT
style.l_alternate_text = Style(style.l_default)
style.l_alternate_text.size = 14
style.l_alternate_text.font = LIGHT
style.l_alternate_text.text_align = 1.0
style.l_small_button = Style(style.l_button)
style.l_small_button_text = Style(style.l_button_text)
style.l_small_button_text.size = 14
style.l_small_text = Style(style.l_text)
style.l_small_text.size = 14
# Indents its contents.
style.l_indent = Style(style.l_default)
style.l_indent.left_margin = INDENT
# Indents its contents and pads them vertically.
style.l_indent_margin = Style(style.l_indent)
style.l_indent_margin.ymargin = 6
# List button.
style.l_list = Style(style.l_default)
style.l_list.left_padding = HALF_INDENT
style.l_list.xfill = True
style.l_list.selected_background = REVERSE_IDLE
style.l_list.selected_hover_background = REVERSE_HOVER
style.l_list_text = Style(style.l_default)
style.l_list_text.idle_color = IDLE
style.l_list_text.hover_color = HOVER
style.l_list_text.selected_idle_color = REVERSE_TEXT
style.l_list_text.selected_hover_color = REVERSE_TEXT
style.l_list_text.insensitive_color = DISABLED
style.l_list2 = Style(style.l_list)
style.l_list2.left_padding = HALF_INDENT + INDENT
style.l_list2_text = Style(style.l_list_text)
# Scrollbar.
style.l_vscrollbar = Style(style.l_default)
style.l_vscrollbar.thumb = Fixed(
Solid(SCROLLBAR_IDLE, xmaximum=8, xalign=0.5),
Image("vscrollbar_center.png", xalign=0.5, yalign=0.5),
xmaximum = SCROLLBAR_SIZE)
style.l_vscrollbar.hover_thumb = Fixed(
Solid(SCROLLBAR_HOVER, xmaximum=8, xalign=0.5),
Image("vscrollbar_center.png", xalign=0.5, yalign=0.5),
xmaximum = SCROLLBAR_SIZE)
style.l_vscrollbar.xmaximum = SCROLLBAR_SIZE
style.l_vscrollbar.bar_vertical = True
style.l_vscrollbar.bar_invert = True
style.l_vscrollbar.unscrollable = "hide"
# Information window.
style.l_info_vbox = Style(style.vbox)
style.l_info_vbox.yalign = 0.5
style.l_info_vbox.xalign = 0.5
style.l_info_vbox.xfill = True
style.l_info_frame = Style(style.l_default)
style.l_info_frame.ypadding = 21
style.l_info_frame.xfill = True
style.l_info_frame.background = Fixed(
INFO_WINDOW,
Frame(PATTERN, 0, 0, tile=True, ymaximum=5, yalign=0.0, yoffset=8),
Frame(PATTERN, 0, 0, tile=True, ymaximum=5, yalign=1.0, yoffset=-8),
)
style.l_info_frame.yminimum = 180
style.l_info_frame.ypos = 100
style.l_info_label = Style(style.l_default)
style.l_info_label.xalign = 0.5
style.l_info_label.ypos = 100
style.l_info_label.yanchor = 1.0
style.l_info_label.yoffset = 12
style.l_info_label_text = Style(style.l_default)
style.l_info_label_text.size = 36
style.l_info_text = Style(style.l_default)
style.l_info_text.xalign = 0.5
style.l_info_button = Style(style.l_button)
style.l_info_button.xalign = 0.5
style.l_info_button_text = Style(style.l_button_text)
# Code navigation
style.l_navigation_button = Style(style.l_button)
style.l_navigation_button.size_group = "navigation"
style.l_navigation_button.right_margin = INDENT
style.l_navigation_button.top_margin = 3
style.l_navigation_button_text = Style(style.l_button_text)
style.l_navigation_button_text.size = 14
style.l_navigation_button_text.font = REGULAR
style.l_navigation_text = Style(style.l_text)
style.l_navigation_text.size = 12
style.l_navigation_text.font = LIGHT
style.l_navigation_text.color = TEXT
# Check boxes
style.l_checkbox = Style(style.l_button)
style.l_checkbox.left_padding = INDENT
def checkbox(full, color):
if full:
return im.Twocolor("checkbox_full.png", color, color, yalign=0.5)
else:
return im.Twocolor("checkbox_empty.png", color, color, yalign=0.5)
style.l_checkbox.background = checkbox(False, IDLE)
style.l_checkbox.hover_background = checkbox(False, HOVER)
style.l_checkbox.selected_idle_background = checkbox(True, IDLE)
style.l_checkbox.selected_hover_background = checkbox(True, HOVER)
style.l_checkbox.insensitive_background = checkbox(False, DISABLED)
style.l_checkbox_text = Style(style.l_button_text)
style.l_checkbox_text.selected_font = LIGHT
# A normal button that lines up with checkboxes.
style.l_nonbox = Style(style.l_button)
style.l_nonbox.xpadding = INDENT
style.l_nonbox_text = Style(style.l_button_text)
style.l_nonbox_text.selected_font = LIGHT
# A progress bar and its frame.
style.l_progress_frame = Style(style.l_default)
style.l_progress_frame.background = Frame(PATTERN, 0, 0, tile=True)
style.l_progress_frame.ypadding = 5
style.l_progress_bar = Style(style.l_default)
style.l_progress_bar.left_bar = REVERSE_IDLE
style.l_progress_bar.right_bar = Null()
style.l_progress_bar.ymaximum = 24
# The projects window.
style.l_projects = Style(style.l_default)
style.l_projects.background = PROJECTS_WINDOW
+586
View File
@@ -0,0 +1,586 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python in theme_data:
def __PerformScreenOperations(lines, file_picker_rows=5, file_picker_cols=2):
import re
x = 0
correct_section = False
while x < len(lines):
l = lines[x]
m = re.match(r'^screen\s+\w+\s*:\s*$', l)
if m:
correct_section = False
m = re.match(r'^screen\s+file_picker\s*:\s*$', l)
if m:
correct_section = True
if correct_section:
m = re.match(r'^\s+\$\s*columns\s*=\s*(\d+)\s*$', l)
if m:
l = l.replace(str(m.group(1)), str(file_picker_cols))
m = re.match(r'^\s+\$\s*rows\s*=\s*(\d+)\s*$', l)
if m:
l = l.replace(str(m.group(1)), str(file_picker_rows))
lines[x] = l
x = x + 1
return lines
def roundrect_screen_ops(lines):
return __PerformScreenOperations(lines)
def awt_screen_ops(lines):
return __PerformScreenOperations(lines, file_picker_rows=3)
# theme name -> (color scheme name -> code that implements it)
THEME = { }
# The set of theme functions.
THEME_FUNCTIONS = set()
# theme name -> function name to call to munge screens.rpy as appropriate
# for that theme.
THEME_SCREEN_OPERATIONS = { }
# Color schemes that work (technically - some are eye-melting) with the
# roundrect-style themes.
ROUNDRECT_SCHEMES = {
'Basic Blue': {'disabled': '#404040',
'disabled_text': '#c8c8c8',
'frame': '#6496c8',
'gm_root': '#dcebff',
'label': '#ffffff',
'mm_root': '#dcebff',
'widget': '#003c78',
'widget_hover': '#0050a0',
'widget_selected': '#ffffc8',
'widget_text': '#c8ffff'},
'Bloody Mary': {'disabled': '#400000',
'disabled_text': '#260000',
'frame': '#400808',
'gm_root': '#000000',
'label': '#ffffff',
'mm_root': '#000000',
'widget': '#000000',
'widget_hover': '#830000',
'widget_selected': '#ffffff',
'widget_text': '#C2C2C2'},
'Colorblind': {'disabled': '#898989',
'disabled_text': '#666666',
'frame': '#252525',
'gm_root': '#393939',
'label': '#c2c2c2',
'mm_root': '#393939',
'widget': '#898989',
'widget_hover': '#464646',
'widget_selected': '#F2F2F2',
'widget_text': '#CCCCCC'},
'Cotton Candy': {'disabled': '#C8AFA1',
'disabled_text': '#E1D4C9',
'frame': '#FCF5F2',
'gm_root': '#D0B4BA',
'label': '#805C40',
'mm_root': '#D0B4BA',
'widget': '#ECC7D0',
'widget_hover': '#E1D4C9',
'widget_selected': '#805C40',
'widget_text': '#805C40'},
'Creamsicle': {'disabled': '#FFECBF',
'disabled_text': '#ffffff',
'frame': '#FFECBF',
'gm_root': '#FDF5E3',
'label': '#502F13',
'mm_root': '#FDF5E3',
'widget': '#D96B00',
'widget_hover': '#FD9B1C',
'widget_selected': '#ffffff',
'widget_text': '#FCE6B1'},
'Dramatic Flesh': {'disabled': '#ab6038',
'disabled_text': '#BF7C51',
'frame': '#49271b',
'gm_root': '#2a201f',
'label': '#ffffff',
'mm_root': '#2a201f',
'widget': '#BF7C51',
'widget_hover': '#dda570',
'widget_selected': '#ffffff',
'widget_text': '#E5DFDF'},
'Easter Baby': {'disabled': '#DDE9FF',
'disabled_text': '#A6AFBF',
'frame': '#CCF8DC',
'gm_root': '#FBF9DF',
'label': '#698071',
'mm_root': '#FBF9DF',
'widget': '#F5D4EE',
'widget_hover': '#F0DDFF',
'widget_selected': '#000000',
'widget_text': '#698071'},
'Favorite Jeans': {'disabled': '#919994',
'disabled_text': '#B6BFB9',
'frame': '#6f7571',
'gm_root': '#b0b8ba',
'label': '#ffffff',
'mm_root': '#b0b8ba',
'widget': '#8699a7',
'widget_hover': '#9eb1ad',
'widget_selected': '#ffffff',
'widget_text': '#dcdfd6'},
'Fine China': {'disabled': '#ADB9CC',
'disabled_text': '#DFBA14',
'frame': '#ADB9CC',
'gm_root': '#F7F7FA',
'label': '#39435E',
'mm_root': '#F7F7FA',
'widget': '#6A7183',
'widget_hover': '#1A2B47',
'widget_selected': '#E3E3E4',
'widget_text': '#C9C9CB'},
'First Valentines': {'disabled': '#F8F2D0',
'disabled_text': '#BFA1A1',
'frame': '#F8F2D0',
'gm_root': '#D98989',
'label': '#5D1010',
'mm_root': '#D98989',
'widget': '#F09898',
'widget_hover': '#D6C5BB',
'widget_selected': '#B31E1E',
'widget_text': '#593131'},
'Ice Queen': {'disabled': '#F0F2F2',
'disabled_text': '#FBFBFB',
'frame': '#ffffff',
'gm_root': '#E6E6E6',
'label': '#D9D9D9',
'mm_root': '#E6E6E6',
'widget': '#D9D9D9',
'widget_hover': '#F0F2F2',
'widget_selected': '#737373',
'widget_text': '#ffffff'},
'Mocha Latte': {'disabled': '#614D3A',
'disabled_text': '#80654D',
'frame': '#926841',
'gm_root': '#1A140E',
'label': '#F1EBE5',
'mm_root': '#1A140E',
'widget': '#4D3B29',
'widget_hover': '#996E45',
'widget_selected': '#ffffff',
'widget_text': '#B99D83'},
'Muted Horror': {'disabled': '#73735C',
'disabled_text': '#8C8C70',
'frame': '#555544',
'gm_root': '#1A0001',
'label': '#1A0001',
'mm_root': '#1A0001',
'widget': '#777777',
'widget_hover': '#73735C',
'widget_selected': '#000000',
'widget_text': '#404033'},
'Old Polaroid': {'disabled': '#A89E7D',
'disabled_text': '#CCC097',
'frame': '#49403E',
'gm_root': '#A84A3E',
'label': '#ffffff',
'mm_root': '#A84A3E',
'widget': '#A89E7D',
'widget_hover': '#8DB6B9',
'widget_selected': '#ffffff',
'widget_text': '#49403E'},
'Really Red': {'disabled': '#404040',
'disabled_text': '#c8c8c8',
'frame': '#e17373',
'gm_root': '#ffd0d0',
'label': '#ffffff',
'mm_root': '#ffd0d0',
'widget': '#963232',
'widget_hover': '#c83232',
'widget_selected': '#ffffc8',
'widget_text': '#ffffff'},
'Summer Sky': {'disabled': '#6074BF',
'disabled_text': '#7383BF',
'frame': '#6074BF',
'gm_root': '#B4CDD4',
'label': '#94C7D4',
'mm_root': '#B4CDD4',
'widget': '#F2E6AA',
'widget_hover': '#FCFCA4',
'widget_selected': '#1A5766',
'widget_text': '#7DA8B3'},
'Swamp Critter': {'disabled': '#A2521D',
'disabled_text': '#753D00',
'frame': '#797C1C',
'gm_root': '#B09D5A',
'label': '#ffffff',
'mm_root': '#B09B4F',
'widget': '#753D00',
'widget_hover': '#B19A48',
'widget_selected': '#ffffff',
'widget_text': '#CCCAC2'},
'Urban Sprawl': {'disabled': '#8F0000',
'disabled_text': '#333333',
'frame': '#8F0000',
'gm_root': '#000000',
'label': '#ffffff',
'mm_root': '#000000',
'widget': '#333333',
'widget_hover': '#000000',
'widget_selected': '#ffffff',
'widget_text': '#6C8A2F'},
'Victorian Gingerbread': {'disabled': '#7A674F',
'disabled_text': '#664F33',
'frame': '#BF8A73',
'gm_root': '#695640',
'label': '#F2EDC4',
'mm_root': '#695640',
'widget': '#7A674F',
'widget_hover': '#BDA77D',
'widget_selected': '#FDFBEE',
'widget_text': '#F2EDC4'},
'Watermelon Pie': {'disabled': '#FABF46',
'disabled_text': '#FFE06D',
'frame': '#C3CD91',
'gm_root': '#F7F7C5',
'label': '#FCFCD7',
'mm_root': '#F7F7C5',
'widget': '#FFE06D',
'widget_hover': '#E38A4F',
'widget_selected': '#996600',
'widget_text': '#FAA700'},
'White Chocolate': {'disabled': '#614D3A',
'disabled_text': '#80654D',
'frame': '#926841',
'gm_root': '#FBF9EA',
'label': '#F1EBE5',
'mm_root': '#FBF9EA',
'widget': '#33271C',
'widget_hover': '#ECE7C4',
'widget_selected': '#ffffff',
'widget_text': '#B99D83'},
'Winter Mint': {'disabled': '#426143',
'disabled_text': '#819981',
'frame': '#245536',
'gm_root': '#e5f1e5',
'label': '#ffffff',
'mm_root': '#e5f1e5',
'widget': '#7AA27B',
'widget_hover': '#A3C7A3',
'widget_selected': '#ffffff',
'widget_text': '#CDE0CE'},
'Mint Chocolate': {'disabled': '#ffe69c',
'disabled_text': '#ddbc7e',
'frame': '#8ab395',
'gm_root': '#7a4229',
'label': '#7a4229',
'mm_root': '#7a4229',
'widget': '#ffe69c',
'widget_hover': '#f5c153',
'widget_selected': '#7a4229',
'widget_text': '#b5743a'},
'Parachute Pants': {'disabled': '#53c7bb',
'disabled_text': '#97d7bd',
'frame': '#457b9f',
'gm_root': '#37397f',
'label': '#cce2ae',
'mm_root': '#37397f',
'widget': '#53c7bb',
'widget_hover': '#97d7bd',
'widget_selected': '#37397f',
'widget_text': '#457b9f'},
'Strawberry Orchard': {'disabled': '#b3c292',
'disabled_text': '#525748',
'frame': '#d8ebae',
'gm_root': '#e7f3cb',
'label': '#525748',
'mm_root': '#e7f3cb',
'widget': '#525748',
'widget_hover': '#f45c73',
'widget_selected': '#ffce95',
'widget_text': '#e7f3cb'},
'Grape Jelly': {'disabled': '#81859a',
'disabled_text': '#5e2862',
'frame': '#8ea9b0',
'gm_root': '#5e2862',
'label': '#ffffff',
'mm_root': '#5e2862',
'widget': '#c45693',
'widget_hover': '#5e2862',
'widget_selected': '#e59eae',
'widget_text': '#ffffff'},
'Dreamscape': {'disabled': '#966077',
'disabled_text': '#c75f77',
'frame': '#836177',
'gm_root': '#c75f77',
'label': '#fefab6',
'mm_root': '#c75f77',
'widget': '#77a493',
'widget_hover': '#8accb3',
'widget_selected': '#c75f77',
'widget_text': '#ffffff'},
'Unrequited Love': {'disabled': '#dbe4dd',
'disabled_text': '#bd9ca9',
'frame': '#fffeed',
'gm_root': '#b38698',
'label': '#23000e',
'mm_root': '#b38698',
'widget': '#7fa1b3',
'widget_hover': '#b38698',
'widget_selected': '#fffeed',
'widget_text': '#ffffff'},
'Watermelon': {'disabled': '#f9cdad',
'disabled_text': '#fc9d9a',
'frame': '#f9cdad',
'gm_root': '#83af9b',
'label': '#fe4365',
'mm_root': '#83af9b',
'widget': '#fc9d9a',
'widget_hover': '#fe4365',
'widget_selected': '#e5fcc2',
'widget_text': '#ffffff'},
'City Lights': {'disabled': '#638e89',
'disabled_text': '#594f4f',
'frame': '#547980',
'gm_root': '#594f4f',
'label': '#e5fcc2',
'mm_root': '#594f4f',
'widget': '#45ada8',
'widget_hover': '#2e5860',
'widget_selected': '#e5fcc2',
'widget_text': '#9de0ad'},
'Vampire Bite': {'disabled': '#971140',
'disabled_text': '#bd4b40',
'frame': '#bd1550',
'gm_root': '#490a3d',
'label': '#f8ca00',
'mm_root': '#490a3d',
'widget': '#e97f02',
'widget_hover': '#f5a240',
'widget_selected': '#490a3d',
'widget_text': '#bd1550'},
'Underground Rave': {'disabled': '#57cdff',
'disabled_text': '#717be5',
'frame': '#04b4ff',
'gm_root': '#cd249b',
'label': '#000000',
'mm_root': '#cd249b',
'widget': '#8833ce',
'widget_hover': '#cd249b',
'widget_selected': '#b6d754',
'widget_text': '#000000'},
'Tree Frog': {'disabled': '#ffffff',
'disabled_text': '#1c140d',
'frame': '#cbe86b',
'gm_root': '#ffffff',
'label': '#1c140d',
'mm_root': '#ffffff',
'widget': '#1c140d',
'widget_hover': '#86827e',
'widget_selected': '#f2e9e1',
'widget_text': '#cbe86b'},
'Sun Kissed': {'disabled': '#ffffff',
'disabled_text': '#ec4c51',
'frame': '#f0874d',
'gm_root': '#f8c821',
'label': '#ffffff',
'mm_root': '#f8c821',
'widget': '#ec4c51',
'widget_hover': '#dc454a',
'widget_selected': '#f8c821',
'widget_text': '#ffffff'},
'Vintage Faded': {'disabled': '#b17d6f',
'disabled_text': '#8c4e3d',
'frame': '#ab7464',
'gm_root': '#935844',
'label': '#f7d3c8',
'mm_root': '#935844',
'widget': '#8c4e3d',
'widget_hover': '#734032',
'widget_selected': '#fcf5ed',
'widget_text': '#e2b9ad'},
'Vintage': {'disabled': '#883e35',
'disabled_text': '#b86258',
'frame': '#b86258',
'gm_root': '#a24637',
'label': '#ffffff',
'mm_root': '#a24637',
'widget': '#6c2921',
'widget_hover': '#832f26',
'widget_selected': '#ffc7c0',
'widget_text': '#fff4eb'},
'Earth Tones': {'disabled': '#12612f',
'disabled_text': '#2c6e44',
'frame': '#00551f',
'gm_root': '#6b4a27',
'label': '#ffffff',
'mm_root': '#568153',
'widget': '#ad8c31',
'widget_hover': '#568153',
'widget_selected': '#f2edc4',
'widget_text': '#ffffff'},
'Kindergarten': {'disabled': '#1ca4b2',
'disabled_text': '#22d5b3',
'frame': '#22d5b3',
'gm_root': '#ffeca6',
'label': '#ffffff',
'mm_root': '#ffeca6',
'widget': '#1781b1',
'widget_hover': '#12678e',
'widget_selected': '#f2edc4',
'widget_text': '#fdfbee'},
'Phone Operator': {'disabled': '#929292',
'disabled_text': '#ababab',
'frame': '#d2d2d2',
'gm_root': '#59667a',
'label': '#343e4d',
'mm_root': '#59667a',
'widget': '#59667a',
'widget_hover': '#343e4d',
'widget_selected': '#bed4f6',
'widget_text': '#ffffff'},
}
ROUNDRECT_VARIANTS = [
("Roundrect", "roundrect"),
("Bordered", "bordered"),
("Diamond", "diamond"),
("Regal", "regal"),
("Austen", "austen"),
("TV", "tv"),
("3D", "threeD"),
("Glow", "glow"),
("Marker", "marker"),
("Crayon", "crayon"),
]
ROUNDRECT_CODE = """theme.%(function)s(
## Theme: %(theme)s
## Color scheme: %(scheme)s
## The color of an idle widget face.
widget = "%(widget)s",
## The color of a focused widget face.
widget_hover = "%(widget_hover)s",
## The color of the text in a widget.
widget_text = "%(widget_text)s",
## The color of the text in a selected widget. (For
## example, the current value of a preference.)
widget_selected = "%(widget_selected)s",
## The color of a disabled widget face.
disabled = "%(disabled)s",
## The color of disabled widget text.
disabled_text = "%(disabled_text)s",
## The color of informational labels.
label = "%(label)s",
## The color of a frame containing widgets.
frame = "%(frame)s",
## The background of the main menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
mm_root = "%(mm_root)s",
## The background of the game menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
gm_root = "%(gm_root)s",
## If this is True, the in-game window is rounded. If False,
## the in-game window is square.
rounded_window = False,
## And we're done with the theme. The theme will customize
## various styles, so if we want to change them, we should
## do so below.
)"""
for theme, function in ROUNDRECT_VARIANTS:
THEME[theme] = { }
THEME_FUNCTIONS.add(function)
THEME_SCREEN_OPERATIONS[theme] = roundrect_screen_ops
for scheme, colors in ROUNDRECT_SCHEMES.iteritems():
subs = dict(colors)
subs["function"] = function
subs["theme"] = theme
subs["scheme"] = scheme
THEME[theme][scheme] = ROUNDRECT_CODE % (subs)
AWT_CODE = """theme.a_white_tulip(
## Theme: A White Tulip
## Scheme %(scheme)s
## The color of an idle widget face.
widget = "%(widget)s",
## The color of a focused widget face.
widget_hover = "%(widget_hover)s",
## The color of the text in a selected widget. (For
## example, the current value of a preference.)
widget_selected = "%(widget_selected)s",
## The color of a disabled widget face.
disabled = "%(disabled)s",
## The color of a frame containing widgets.
frame = "%(frame)s",
## The background of the main menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
mm_root = "%(mm_root)s",
## The background of the game menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
gm_root = "%(gm_root)s",
## And we're done with the theme. The theme will customize
## various styles, so if we want to change them, we should
## do so below.
)"""
THEME["A White Tulip"] = { }
THEME_FUNCTIONS.add("a_white_tulip")
THEME_SCREEN_OPERATIONS["A White Tulip"] = awt_screen_ops
for scheme, colors in ROUNDRECT_SCHEMES.iteritems():
subs = dict(colors)
subs["scheme"] = scheme
THEME["A White Tulip"][scheme] = AWT_CODE % (subs)
THEME["A White Tulip"]["A White Tulip"] = AWT_CODE % dict(
scheme = "A White Tulip",
widget = "#c1c6d3",
widget_hover = "#d7dbe5",
widget_text = "#6b6b6b",
widget_selected = "#c1c6d3",
disabled = "#b4b4b4",
disabled_text = "#6b6b6b",
label = "#6b6b6b",
frame = "#9391c9",
mm_root = "#ffffff",
gm_root = "#ffffff",
)
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env python
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
# This is used on Linux and Mac to prompt the user for the projects
# directory.
import sys
# Python3 and Python2-style imports.
try:
from tkinter import Tk
from tkinter.filedialog import askdirectory
except ImportError:
from Tkinter import Tk
from tkFileDialog import askdirectory
# Create the TK canvas.
if __name__ == "__main__":
root = Tk()
root.withdraw()
result = askdirectory(initialdir=sys.argv[1], parent=root, title="Select Ren'Py Projects Directory")
sys.stdout.write(result)
+34
View File
@@ -0,0 +1,34 @@
init python:
if persistent.translate_language is None:
persistent.translate_language = "english"
label translate:
python:
language = interface.input(_("Create or Update Translations"), _("Please enter the name of the language for which you want to create or update translations."), filename=True, default=persistent.translate_language, cancel=Jump("front_page"))
language = language.strip()
if not language:
interface.error(_("The language name can not be the empty string."))
persistent.translate_language = language
args = [ "translate", language ]
if language == "rot13":
args.append("--rot13")
else:
args.append("--empty")
interface.processing(_("Ren'Py is generating translations...."))
project.current.launch(args, wait=True)
project.current.update_dump(force=True)
interface.info(_("Ren'Py has finished generating [language] translations."))
jump front_page
+171
View File
@@ -0,0 +1,171 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python:
# This can be one of None, "available", "not-available", or "error".
#
# It must be None for a release.
UPDATE_SIMULATE = None
PUBLIC_KEY = "renpy_public.pem"
UPDATE_URLS = {
"Release" : "http://update.renpy.org/release/updates.json",
"Prerelease" : "http://update.renpy.org/prerelease/updates.json",
"Experimental" : "http://update.renpy.org/experimental/updates.json"
}
version_tuple = renpy.version(tuple=True)
DLC_URL = "http://update.renpy.org/{0}.{1}.{2}/updates.json".format(version_tuple[0], version_tuple[1], version_tuple[2])
if persistent.update_channel not in UPDATE_URLS:
persistent.update_channel = "Release"
def check_dlc(name):
"""
Returns true if the named dlc package is present.
"""
return name in updater.get_installed_packages()
def add_dlc(name):
"""
Adds the DLC package, if it doesn't already exist.
Returns True if the DLC is installed, False otherwise.
"""
if check_dlc(name):
return True
return renpy.invoke_in_new_context(updater.update, DLC_URL, add=[name], public_key=PUBLIC_KEY, simulate=UPDATE_SIMULATE, restart=False)
screen update_channel:
frame:
style_group "l"
style "l_root"
window:
has vbox
label _("Select Update Channel")
add HALF_SPACER
hbox:
frame:
style "l_indent"
xfill True
has vbox
text _("The update channel controls the version of Ren'Py the updater will download. Please select an update channel:") style "l_small_text"
# Release
add SPACER
textbutton _("Release") action [ SetField(persistent, "update_channel", "Release"), Jump("preferences") ]
add HALF_SPACER
frame:
style "l_indent"
text _("{b}Recommended.{/b} The version of Ren'Py that should be used in all newly-released games.") style "l_small_text"
# Prerelease
add SPACER
textbutton _("Prerelease") action [ SetField(persistent, "update_channel", "Prerelease"), Jump("preferences") ]
add HALF_SPACER
frame:
style "l_indent"
text _("A preview of the next version of Ren'Py that can be used for testing and taking advantage of new features, but not for final releases of games.") style "l_small_text"
# Experimental
add SPACER
textbutton _("Experimental") action [ SetField(persistent, "update_channel", "Experimental"), Jump("preferences") ]
add HALF_SPACER
frame:
style "l_indent"
text _("Experimental versions of Ren'Py. You shouldn't select this channel unless asked by a Ren'Py developer.") style "l_small_text"
textbutton _("Cancel") action Jump("preferences") style "l_left_button"
label update_preference:
call screen update_channel
return
screen updater:
frame:
style "l_root"
frame:
style_group "l_info"
has vbox
if u.state == u.ERROR:
text _("An error has occured:")
elif u.state == u.CHECKING:
text _("Checking for updates.")
elif u.state == u.UPDATE_NOT_AVAILABLE:
text _("Ren'Py is up to date.")
elif u.state == u.UPDATE_AVAILABLE:
text _("[u.version] is now available. Do you want to install it?")
elif u.state == u.PREPARING:
text _("Preparing to download the update.")
elif u.state == u.DOWNLOADING:
text _("Downloading the update.")
elif u.state == u.UNPACKING:
text _("Unpacking the update.")
elif u.state == u.FINISHING:
text _("Finishing up.")
elif u.state == u.DONE:
text _("The update has been installed. Ren'Py will restart.")
elif u.state == u.DONE_NO_RESTART:
text _("The update has been installed.")
elif u.state == u.CANCELLED:
text _("The update was cancelled.")
if u.message is not None:
add SPACER
text "[u.message!q]"
if u.progress is not None:
add SPACER
frame:
style "l_progress_frame"
bar:
range 1.0
value u.progress
style "l_progress_bar"
label _("Ren'Py Update") style "l_info_label"
if u.can_cancel:
textbutton _("Cancel") action u.cancel style "l_left_button"
if u.can_proceed:
textbutton _("Proceed") action u.proceed style "l_right_button"
label update:
python:
updater.update(UPDATE_URLS[persistent.update_channel], simulate=UPDATE_SIMULATE, public_key=PUBLIC_KEY)
# This should never happen.
jump front_page
+37
View File
@@ -0,0 +1,37 @@
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# See LICENSE.txt for license details.
init python in util:
import os
def walk(directory, base=None):
"""
Walks through the directories and files underneath `directory`,
yielding (name, isdir) tuples. The names are given relative to
`base`, which defaults to `directory` if None.
"""
directory = renpy.fsdecode(directory)
if base is None:
base = directory
else:
base = renpy.fsdecode(base)
for subdir, directories, files in os.walk(directory):
for fn in directories:
fullfn = os.path.join(subdir, fn)
relfn = os.path.relpath(fullfn, base)
relfn = relfn.replace("\\", "/")
yield relfn, True
for fn in files:
fullfn = os.path.join(subdir, fn)
relfn = os.path.relpath(fullfn, base)
relfn = relfn.replace("\\", "/")
yield relfn, False
Binary file not shown.

After

Width:  |  Height:  |  Size: 106 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.
-366
View File
@@ -1,366 +0,0 @@
# This file contains the various components of the launcher interface.
init -11 python:
style.launcher_base = Style(style.default)
style.launcher_text = Style(style.launcher_base)
style.launcher_text.size = 15
style.launcher_text.color = "#333"
style.launcher_text.justify = True
style.launcher_title = Style(style.launcher_base)
style.launcher_title.size = 26
style.launcher_title.color = "#333"
style.launcher_button_text = Style(style.launcher_base)
style.launcher_button_text.size = 20
style.launcher_button_text.color = "#03c"
style.launcher_button_text.hover_color = "#088"
style.launcher_button_text.insensitive_color = "#aaa"
style.launcher_button_text.minwidth = 250
style.launcher_small_button_text = Style(style.launcher_button_text)
style.launcher_small_button_text.size = 15
style.launcher_tooltip = Style(style.default)
style.launcher_tooltip.color = "#fff"
style.launcher_tooltip.size = 14
init 11 python hide:
props = { }
for i in style.default.properties:
props.update(i)
if props["font"] == "DejaVuSans.ttf":
style.launcher_base.setdefault(font="DejaVuSerif.ttf")
init 11 python:
import time
# Settings.
config.developer = True
# Make backup of styles.
style_backup = renpy.style.backup()
# Style customizations. These need to be in a function so that we can
# change them when we're choosing a theme.
def customize_styles():
style.window.yminimum = 60
style.window.left_padding = 60
style.hyperlink_text.color = "#03c"
style.hyperlink_text.hover_color = "#00c"
style.hyperlink_text.size = 15
style.hyperlink_text.underline = False
customize_styles()
tooltip = _(u"Welcome!")
def show_tooltip(st, at):
return Text(tooltip, color="#fff", size=14), None
def set_tooltip(s):
global tooltip
if tooltip != s:
tooltip = s
renpy.restart_interaction()
tooltips = renpy.curry(set_tooltip)
def unset_tooltip(s):
global tooltip
if s and tooltip == s:
tooltip = ""
renpy.restart_interaction()
untooltips = renpy.curry(unset_tooltip)
def screen():
"""
Display a screen. This should be called before any code that
draws to the screen.
"""
ui.add(Solid("#fff"))
ui.window(yalign=1.0)
ui.add(DynamicDisplayable(show_tooltip))
ui.image("eileen_small.png", xalign=0.0, yalign=1.0)
ui.window(xmargin=20, top_margin=4, bottom_margin=85, style='default')
def interact():
"""
Closes the screen, and causes an interaction to occur.
"""
return ui.interact(suppress_overlay=True, suppress_underlay=True)
def title(s):
"""
Display a title on the screen.
"""
ui.window(style="default", bottom_margin=4, top_margin=12)
ui.text(s, style="launcher_title")
def text(s):
"""
Display text on the screen.
"""
ui.text(s, style="launcher_text")
def button(s, clicked=None, subtitle="", hovered=None, unhovered=None):
"""
Displays a button with caption `s`.
"""
if subtitle is not None:
if hovered is None:
hovered = tooltips(subtitle)
if unhovered is None:
unhovered = untooltips(subtitle)
ui.button(style="default", clicked=clicked,
hovered=hovered, unhovered=unhovered,
top_padding=3, bottom_padding=3)
ui.text(s, style="launcher_button_text")
def small_button(s, clicked=None, subtitle="", hovered=None, unhovered=None):
"""
Displays a button with caption `s`.
"""
if hovered is None:
hovered = tooltips(subtitle)
if unhovered is None:
unhovered = untooltips(subtitle)
ui.button(style="default", clicked=clicked,
hovered=hovered, unhovered=unhovered,
top_padding=0, bottom_padding=0)
ui.text(s, style="launcher_small_button_text")
def toggle_button(s, checked, clicked=None, subtitle=""):
"""
Displays a button with caption `s`.
"""
hovered = tooltips(subtitle)
unhovered = untooltips(subtitle)
if checked:
s = u"{font=DejaVuSans.ttf}\u25a3{/font} " + s
else:
s = u"{font=DejaVuSans.ttf}\u25a1{/font} " + s
ui.button(style="default", clicked=clicked,
hovered=hovered, unhovered=unhovered,
top_padding=0, bottom_padding=0)
ui.text(s, style="launcher_small_button_text")
def scrolled(cancel, yadj=None):
if yadj is None:
yadj = ui.adjustment()
ui.side(['r', 'b', 'c'])
ui.bar(adjustment=yadj, style='lscrollbar')
if cancel:
ui.vbox()
ui.null(height=12)
button(_(u"Cancel"), clicked=ui.jumps(cancel))
ui.close()
else:
ui.null()
ui.viewport(yadjustment=yadj, mousewheel=True)
# Left up to the user to close.
def error(message, target="top"):
"""
Displays an error to the user, and lets him click to return to
`target`.
"""
set_tooltip("")
screen()
ui.vbox()
title(_(u"Error"))
text(message)
ui.null(height=20)
if target is None:
clicked = ui.returns(True)
else:
clicked = ui.jumps(target)
button(_(u"Return"), clicked, None)
ui.close()
interact()
def pauseinfo(t, message):
"""
Displays an error to the user, and lets him click to return to
`target`.
"""
set_tooltip("")
screen()
ui.vbox()
title(t)
text(message)
ui.null(height=20)
button(_(u"Ok"), ui.returns(True), None)
ui.close()
interact()
def info(t, message):
"""
Displays an informational message to the user, and immediately
returns.
"""
ui.pausebehavior(0)
screen()
ui.vbox()
title(t)
text(message)
ui.close()
interact()
def yesno(t, message):
"""
Asks a yes/no question of the user.
"""
set_tooltip("")
screen()
ui.vbox()
title(t)
text(message)
button(_(u"Yes"), ui.returns(True), "")
button(_(u"No"), ui.returns(False), "")
ui.close()
return interact()
def text_variable(t, value, returns, tooltip=""):
text(t)
small_button(value, ui.returns(returns), tooltip)
ui.null(height=5)
def input(t, prompt, value, cancel=None):
set_tooltip(_(u"Press enter when done."))
while True:
screen()
ui.vbox()
title(t)
text(prompt)
ui.null(height=10)
ui.input(value, size=20, color="#00c")
if cancel is not None:
ui.null(height=20)
button(_(u"Cancel"), ui.jumps(cancel), "")
ui.close()
value = interact()
value = value.strip()
if not value:
error(
_(u"The string cannot be empty. Please enter some text."),
None)
continue
try:
value = value.encode("ascii")
except:
error(
_(u"Non-ASCII filenames are not allowed. This is because Zip files cannot reliably represent non-ASCII filenames."),
None)
continue
break
return value
# The time progress was last updated. We only update the progress
# every 10th of a second, so that we don't waste time doing
# such updates.
progress_time = 0
def progress(what, limit, amount):
"""
Show progress to the user.
"""
global progress_time
t = time.time()
if t < progress_time + .1:
return
progress_time = t
set_tooltip(_(u"Processed %d of %d files.") % (amount + 1, limit))
ui.pausebehavior(0)
screen()
ui.vbox(xfill=True)
title(what)
ui.null(height=20)
ui.bar(limit, amount, xmaximum=300, xalign=0.5, style='lbar')
ui.close()
interact()
-17
View File
@@ -1,17 +0,0 @@
# Name: jEdit
# Version: 1
# Description: jEdit requires Java be installed on your computer.
import os
import os.path
import sys
editor = os.path.normpath(base + "/../jedit/jedit.jar")
editor = renpy.shell_escape(editor)
if sys.platform == 'win32':
config.editor = 'javaw.exe -jar "' + editor + '" -reuseview "%(filename)s" +line:%(line)d "%(otherfiles)s"'
config.editor_transient = 'javaw.exe -jar "' + editor + '" -newplainview "%(filename)s" +line:%(line)d "%(otherfiles)s"'
else:
config.editor = 'java -jar "' + editor + '" -reuseview "%(filename)s" +line:%(line)d "%(otherfiles)s"'
config.editor_transient = 'java -jar "' + editor + '" -newplainview "%(filename)s" +line:%(line)d "%(otherfiles)s"'
Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

-52
View File
@@ -1,52 +0,0 @@
init python:
import os
import os.path
import shutil
label new_project:
if persistent.projects_directory is None:
call choose_projects_directory
python hide:
name = input(
_(u"New Project"),
_(u"Please type the name of your new project."),
"", cancel='top')
name = name.strip()
path = os.path.join(persistent.projects_directory, name)
set_tooltip("")
if os.path.exists(path):
error(_(u"Something with that name already exists in the projects directory."))
info(_(u"Creating Project"),
_(u"Please wait while we create the project."))
template = os.path.join(config.renpy_base, "template")
try:
shutil.copytree(template, path)
except OSError, e:
error(_(u"Could not create the project directory. The error was: %s") % unicode(e))
launcherinfo = os.path.join(path, "launcherinfo.py")
if os.path.exists(launcherinfo):
os.unlink(launcherinfo)
# Change the save directory.
options = file(path + "/game/options.rpy").read()
save_dir = "%s-%d" % (name, time.time())
options = options.replace("template-1220804310", save_dir)
file(path + "/game/options.rpy", "w").write(options)
p = Project(path)
p.select()
jump choose_theme
-132
View File
@@ -1,132 +0,0 @@
## This file contains some of the options that can be changed to customize
## your Ren'Py game. It only contains the most common options... there
## is quite a bit more customization you can do.
##
## Lines beginning with two '#' marks are comments, and you shouldn't
## uncomment them. Lines beginning with a single '#' mark are
## commented-out code, and you may want to uncomment them when
## appropriate.
init -1 python hide:
## Should we enable the use of developer tools? This should be
## set to False before the game is released, so the user can't
## cheat using developer tools.
config.developer = True
## These control the width and height of the screen.
config.screen_width = 540
config.screen_height = 440
## This controls the title of the window, when Ren'Py is
## running in a window.
config.window_title = _(u"%s Launcher") % renpy.version()
#########################################
# Themes
## We then want to call a theme function. themes.roundrect is
## a theme that features the use of rounded rectangles. It's
## the only theme we currently support.
##
## The theme function takes a number of parameters that can
## customize the color scheme.
theme.roundrect(
## The color of an idle widget face.
widget = "#003c78",
## The color of a focused widget face.
widget_hover = "#0050a0",
## The color of the text in a widget.
widget_text = "#c8ffff",
## The color of the text in a selected widget. (For
## example, the current value of a preference.)
widget_selected = "#ffffc8",
## The color of a disabled widget face.
disabled = "#404040",
## The color of disabled widget text.
disabled_text = "#c8c8c8",
## The color of informational labels.
label = "#ffffff",
## The color of a frame containing widgets.
frame = "#6496c8",
## If this is True, the in-game window is rounded. If False,
## the in-game window is square.
rounded_window = False,
## The background of the main menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
mm_root = "#dcebff",
## The background of the game menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
gm_root = "#dcebff",
## And we're done with the theme. The theme will customize
## various styles, so if we want to change them, we should
## do so below.
)
theme.outline_bars(
inside="#6496c8",
idle="#06c",
hover="#00c")
# Copy the bar styles used by the launcher, so the theme
# selector can't change them.
style.lbar = Style(style.default)
style.lbar.take(style.bar)
style.lscrollbar = Style(style.default)
style.lscrollbar.take(style.vscrollbar)
#########################################
## These settings let you change some of the sounds that are used by
## Ren'Py.
## Set this to False if the game does not have any sound effects.
config.sound = False
# Disable opengl.
config.gl_enable = False
python early:
config.save_directory = "launcher-2"
init -1 python hide:
#########################################
## Default values of Preferences.
## Note: These options are only evaluated the first time a
## game is run. To have them run a second time, delete
## game/saves/persistent
## Should we start in fullscreen mode?
config.default_fullscreen = False
## The default text speed in characters per second. 0 is infinite.
config.default_text_cps = 0
#########################################
## More customizations can go here.
config.has_autosave = False
config.window_icon = "logo.png"
config.windows_icon = "logo32.png"
-42
View File
@@ -1,42 +0,0 @@
# This file handles the launcher options screen.
label options:
python hide:
screen()
ui.vbox()
title(_(u"Launcher Options"))
editor = persistent.editor
if not set_editor:
editor = _(u"Using RENPY_EDITOR")
text_variable(_("Text Editor"), editor, "editor",
_(u"Change the default text editor."))
ui.null(height=15)
button(_(u"Projects Directory"),
ui.jumps("options_cpd"),
_(u"Select the directory Ren'Py searches for projects."))
ui.null(height=15)
button(_(u"Return"), ui.jumps("top"), "")
ui.close()
act = interact()
if act == "editor":
renpy.jump("editor")
jump options
label options_cpd:
call choose_projects_directory
jump options
-453
View File
@@ -1,453 +0,0 @@
"""Common operations on Posix pathnames.
Instead of importing this module directly, import os and refer to
this module as os.path. The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. macpath, ntpath).
Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
"""
import os
import stat
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmtime",
"getatime","getctime","islink","exists","lexists","isdir","isfile",
"ismount","walk","expanduser","expandvars","normpath","abspath",
"samefile","sameopenfile","samestat",
"curdir","pardir","sep","pathsep","defpath","altsep","extsep",
"devnull","realpath","supports_unicode_filenames"]
# strings representing various path-related bits and pieces
curdir = '.'
pardir = '..'
extsep = '.'
sep = '/'
pathsep = ':'
defpath = ':/bin:/usr/bin'
altsep = None
devnull = '/dev/null'
# Normalize the case of a pathname. Trivial in Posix, string.lower on Mac.
# On MS-DOS this may also turn slashes into backslashes; however, other
# normalizations (such as optimizing '../' away) are not allowed
# (another function should be defined to do that).
def normcase(s):
"""Normalize case of pathname. Has no effect under Posix"""
return s
# Return whether a path is absolute.
# Trivial in Posix, harder on the Mac or MS-DOS.
def isabs(s):
"""Test whether a path is absolute"""
return s.startswith('/')
# Join pathnames.
# Ignore the previous parts if a part is absolute.
# Insert a '/' unless the first part is empty or already ends in '/'.
def join(a, *p):
"""Join two or more pathname components, inserting '/' as needed"""
path = a
for b in p:
if b.startswith('/'):
path = b
elif path == '' or path.endswith('/'):
path += b
else:
path += '/' + b
return path
# Split a path in head (everything up to the last '/') and tail (the
# rest). If the path ends in '/', tail will be empty. If there is no
# '/' in the path, head will be empty.
# Trailing '/'es are stripped from head unless it is the root.
def split(p):
"""Split a pathname. Returns tuple "(head, tail)" where "tail" is
everything after the final slash. Either part may be empty."""
i = p.rfind('/') + 1
head, tail = p[:i], p[i:]
if head and head != '/'*len(head):
head = head.rstrip('/')
return head, tail
# Split a path in root and extension.
# The extension is everything starting at the last dot in the last
# pathname component; the root is everything before that.
# It is always true that root + ext == p.
def splitext(p):
"""Split the extension from a pathname. Extension is everything from the
last dot to the end. Returns "(root, ext)", either part may be empty."""
i = p.rfind('.')
if i<=p.rfind('/'):
return p, ''
else:
return p[:i], p[i:]
# Split a pathname into a drive specification and the rest of the
# path. Useful on DOS/Windows/NT; on Unix, the drive is always empty.
def splitdrive(p):
"""Split a pathname into drive and path. On Posix, drive is always
empty."""
return '', p
# Return the tail (basename) part of a path.
def basename(p):
"""Returns the final component of a pathname"""
return split(p)[1]
# Return the head (dirname) part of a path.
def dirname(p):
"""Returns the directory component of a pathname"""
return split(p)[0]
# Return the longest prefix of all list elements.
def commonprefix(m):
"Given a list of pathnames, returns the longest common leading component"
if not m: return ''
s1 = min(m)
s2 = max(m)
n = min(len(s1), len(s2))
for i in xrange(n):
if s1[i] != s2[i]:
return s1[:i]
return s1[:n]
# Get size, mtime, atime of files.
def getsize(filename):
"""Return the size of a file, reported by os.stat()."""
return os.stat(filename).st_size
def getmtime(filename):
"""Return the last modification time of a file, reported by os.stat()."""
return os.stat(filename).st_mtime
def getatime(filename):
"""Return the last access time of a file, reported by os.stat()."""
return os.stat(filename).st_atime
def getctime(filename):
"""Return the metadata change time of a file, reported by os.stat()."""
return os.stat(filename).st_ctime
# Is a path a symbolic link?
# This will always return false on systems where os.lstat doesn't exist.
def islink(path):
"""Test whether a path is a symbolic link"""
try:
st = os.lstat(path)
except (os.error, AttributeError):
return False
return stat.S_ISLNK(st.st_mode)
# Does a path exist?
# This is false for dangling symbolic links.
def exists(path):
"""Test whether a path exists. Returns False for broken symbolic links"""
try:
st = os.stat(path)
except os.error:
return False
return True
# Being true for dangling symbolic links is also useful.
def lexists(path):
"""Test whether a path exists. Returns True for broken symbolic links"""
try:
st = os.lstat(path)
except os.error:
return False
return True
# Is a path a directory?
# This follows symbolic links, so both islink() and isdir() can be true
# for the same path.
def isdir(path):
"""Test whether a path is a directory"""
try:
st = os.stat(path)
except os.error:
return False
return stat.S_ISDIR(st.st_mode)
# Is a path a regular file?
# This follows symbolic links, so both islink() and isfile() can be true
# for the same path.
def isfile(path):
"""Test whether a path is a regular file"""
try:
st = os.stat(path)
except os.error:
return False
return stat.S_ISREG(st.st_mode)
# Are two filenames really pointing to the same file?
def samefile(f1, f2):
"""Test whether two pathnames reference the same actual file"""
s1 = os.stat(f1)
s2 = os.stat(f2)
return samestat(s1, s2)
# Are two open files really referencing the same file?
# (Not necessarily the same file descriptor!)
def sameopenfile(fp1, fp2):
"""Test whether two open file objects reference the same file"""
s1 = os.fstat(fp1)
s2 = os.fstat(fp2)
return samestat(s1, s2)
# Are two stat buffers (obtained from stat, fstat or lstat)
# describing the same file?
def samestat(s1, s2):
"""Test whether two stat buffers reference the same file"""
return s1.st_ino == s2.st_ino and \
s1.st_dev == s2.st_dev
# Is a path a mount point?
# (Does this work for all UNIXes? Is it even guaranteed to work by Posix?)
def ismount(path):
"""Test whether a path is a mount point"""
try:
s1 = os.lstat(path)
s2 = os.lstat(join(path, '..'))
except os.error:
return False # It doesn't exist -- so not a mount point :-)
dev1 = s1.st_dev
dev2 = s2.st_dev
if dev1 != dev2:
return True # path/.. on a different device as path
ino1 = s1.st_ino
ino2 = s2.st_ino
if ino1 == ino2:
return True # path/.. is the same i-node as path
return False
# Directory tree walk.
# For each directory under top (including top itself, but excluding
# '.' and '..'), func(arg, dirname, filenames) is called, where
# dirname is the name of the directory and filenames is the list
# of files (and subdirectories etc.) in the directory.
# The func may modify the filenames list, to implement a filter,
# or to impose a different order of visiting.
def walk(top, func, arg):
"""Directory tree walk with callback function.
For each directory in the directory tree rooted at top (including top
itself, but excluding '.' and '..'), call func(arg, dirname, fnames).
dirname is the name of the directory, and fnames a list of the names of
the files and subdirectories in dirname (excluding '.' and '..'). func
may modify the fnames list in-place (e.g. via del or slice assignment),
and walk will only recurse into the subdirectories whose names remain in
fnames; this can be used to implement a filter, or to impose a specific
order of visiting. No semantics are defined for, or required of, arg,
beyond that arg is always passed to func. It can be used, e.g., to pass
a filename pattern, or a mutable object designed to accumulate
statistics. Passing None for arg is common."""
try:
names = os.listdir(top)
except os.error:
return
func(arg, top, names)
for name in names:
name = join(top, name)
try:
st = os.lstat(name)
except os.error:
continue
if stat.S_ISDIR(st.st_mode):
walk(name, func, arg)
# Expand paths beginning with '~' or '~user'.
# '~' means $HOME; '~user' means that user's home directory.
# If the path doesn't begin with '~', or if the user or $HOME is unknown,
# the path is returned unchanged (leaving error reporting to whatever
# function is called with the expanded path as argument).
# See also module 'glob' for expansion of *, ? and [...] in pathnames.
# (A function should also be defined to do full *sh-style environment
# variable expansion.)
def expanduser(path):
"""Expand ~ and ~user constructions. If user or $HOME is unknown,
do nothing."""
if not path.startswith('~'):
return path
i = path.find('/', 1)
if i < 0:
i = len(path)
if i == 1:
if 'HOME' not in os.environ:
import pwd
userhome = pwd.getpwuid(os.getuid()).pw_dir
else:
userhome = os.environ['HOME']
else:
import pwd
try:
pwent = pwd.getpwnam(path[1:i])
except KeyError:
return path
userhome = pwent.pw_dir
userhome = userhome.rstrip('/')
return userhome + path[i:]
# Expand paths containing shell variable substitutions.
# This expands the forms $variable and ${variable} only.
# Non-existent variables are left unchanged.
_varprog = None
def expandvars(path):
"""Expand shell variables of form $var and ${var}. Unknown variables
are left unchanged."""
global _varprog
if '$' not in path:
return path
if not _varprog:
import re
_varprog = re.compile(r'\$(\w+|\{[^}]*\})')
i = 0
while True:
m = _varprog.search(path, i)
if not m:
break
i, j = m.span(0)
name = m.group(1)
if name.startswith('{') and name.endswith('}'):
name = name[1:-1]
if name in os.environ:
tail = path[j:]
path = path[:i] + os.environ[name]
i = len(path)
path += tail
else:
i = j
return path
# Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B.
# It should be understood that this may change the meaning of the path
# if it contains symbolic links!
def normpath(path):
"""Normalize path, eliminating double slashes, etc."""
if path == '':
return '.'
initial_slashes = path.startswith('/')
# POSIX allows one or two initial slashes, but treats three or more
# as single slash.
if (initial_slashes and
path.startswith('//') and not path.startswith('///')):
initial_slashes = 2
comps = path.split('/')
new_comps = []
for comp in comps:
if comp in ('', '.'):
continue
if (comp != '..' or (not initial_slashes and not new_comps) or
(new_comps and new_comps[-1] == '..')):
new_comps.append(comp)
elif new_comps:
new_comps.pop()
comps = new_comps
path = '/'.join(comps)
if initial_slashes:
path = '/'*initial_slashes + path
return path or '.'
def abspath(path):
"""Return an absolute path."""
if not isabs(path):
path = join(os.getcwd(), path)
return normpath(path)
# Return a canonical path (i.e. the absolute location of a file on the
# filesystem).
def realpath(filename):
"""Return the canonical path of the specified filename, eliminating any
symbolic links encountered in the path."""
if isabs(filename):
bits = ['/'] + filename.split('/')[1:]
else:
bits = [''] + filename.split('/')
for i in range(2, len(bits)+1):
component = join(*bits[0:i])
# Resolve symbolic links.
if islink(component):
resolved = _resolve_link(component)
if resolved is None:
# Infinite loop -- return original component + rest of the path
return abspath(join(*([component] + bits[i:])))
else:
newpath = join(*([resolved] + bits[i:]))
return realpath(newpath)
return abspath(filename)
def _resolve_link(path):
"""Internal helper function. Takes a path and follows symlinks
until we either arrive at something that isn't a symlink, or
encounter a path we've seen before (meaning that there's a loop).
"""
paths_seen = []
while islink(path):
if path in paths_seen:
# Already seen this path, so we must have a symlink loop
return None
paths_seen.append(path)
# Resolve where the link points to
resolved = os.readlink(path)
if not isabs(resolved):
dir = dirname(path)
path = normpath(join(dir, resolved))
else:
path = normpath(resolved)
return path
supports_unicode_filenames = False
+1
View File
@@ -0,0 +1 @@
{"build_update": true, "packages": ["all", "linux", "mac", "win", "sdk", "source", "jedit", "editra-mac", "editra-linux", "editra-windows"], "type": "hidden"}
-332
View File
@@ -1,332 +0,0 @@
init python:
import os
import os.path
import sys
import platform
import subprocess
# Set the projects directory to None if it no longer exists.
if persistent.projects_directory is not None:
if not os.path.isdir(persistent.projects_directory):
persistent.projects_directory = None
ZWSP = u"\u200B"
# The process of the running game.
game_proc = None
class ProcessBehavior(renpy.display.layout.Null):
def __init__(self, proc):
super(ProcessBehavior, self).__init__()
self.proc = proc
def event(self, ev, x, y, st):
if self.proc.poll() is not None:
return True
renpy.game.interface.timeout(.25)
def quote_char(c):
n = ord(c)
if 0x20 <= n <= 0x7f:
return c
else:
return "\\x%02x" % n
# Quotes an arbitrary string (without knowing the encoding) for display.
def quote(s):
s ="".join(quote_char(i) for i in s)
s = s.replace("/", "/" + ZWSP)
s = s.replace("\\", "\\" + ZWSP)
return s
class Project(object):
def __init__(self, path):
# The name of the project.
self.name = os.path.basename(path)
# The full path to the project.
self.path = path
# The path to the game directory, for convenience.
self.gamedir = os.path.join(path, "game")
def __repr__(self):
return "<Project %r>" % (self.path)
def select(self):
"""
Select this project as the one that we're working on.
"""
global project
global game_proc
persistent.project_path = self.path
project = self
game_proc = None
# Load the informatrion dictionary.
info = dict()
launcherinfo = os.path.join(self.path, "launcherinfo.py")
if os.path.exists(launcherinfo):
source = file(launcherinfo, "rU").read().decode("utf8")
if source[0] == u'\ufeff':
source = source[1:]
source = source.encode("raw_unicode_escape")
exec source in info
del info["__builtins__"]
self.info = info
def save(self):
"""
Saves the info dictionary into the launcherinfo file.
"""
launcherinfo = os.path.join(self.path, "launcherinfo.py")
f = file(launcherinfo + ".new", "w")
for k, v in self.info.iteritems():
f.write("%s = %r\n" % (k, v))
f.close()
try:
os.rename(launcherinfo + ".new", launcherinfo)
except:
os.unlink(launcherinfo)
os.rename(launcherinfo + ".new", launcherinfo)
def scan_projects():
"""
Scans for projects. Returns a list of Project objects.
"""
rv = [ ]
project_dirs = [ config.renpy_base ]
if persistent.projects_directory and persistent.projects_directory not in project_dirs:
project_dirs.append(persistent.projects_directory)
for d in project_dirs:
if not os.path.isdir(d):
continue
for pd in sorted(os.listdir(d), key=lambda a : a.lower()):
path = os.path.join(d, pd)
if not os.path.isdir(path):
continue
gamedir = os.path.join(path, "game")
if not os.path.isdir(gamedir):
continue
rv.append(Project(path))
return rv
def choose_default_project():
"""
Chooses the default project, based on the persistent information.
"""
project = None
projects = scan_projects()
for i in projects:
if i.path == persistent.project_path:
i.select()
return
for i in projects:
if i.name == "tutorial":
i.select()
return
if projects:
projects[0].select()
return
def select_project(p):
p.select()
renpy.jump("top")
curried_select_project = renpy.curry(select_project)
label select_project:
if persistent.projects_directory is None:
call choose_projects_directory
python:
screen()
ui.vbox()
title(_(u"Select Project"))
scrolled("top")
ui.vbox()
projects = scan_projects()
for i in projects:
button(i.name,
curried_select_project(i),
quote(i.path))
ui.close() # vbox
ui.close() # scrolled
ui.close() # vbox
interact()
label launch_tutorial:
python hide:
if sys.platform == "win32" and sys.argv[0].lower().endswith(".exe"):
proc = subprocess.Popen([sys.argv[0], tutorial_path])
else:
proc = subprocess.Popen([sys.executable, sys.argv[0], tutorial_path])
set_tooltip(_(u"Tutorial game has been launched."))
jump top
label launch:
python hide:
if sys.platform == "win32" and sys.argv[0].lower().endswith(".exe"):
proc = subprocess.Popen([sys.argv[0], project.path])
else:
proc = subprocess.Popen([sys.executable, sys.argv[0], project.path])
set_tooltip(_(u"%s has been launched.") % project.name.capitalize())
store.game_proc = proc
jump top
label game_directory:
python hide:
gamedir = os.path.normpath(project.gamedir)
if sys.platform == "win32":
os.startfile(gamedir)
elif platform.mac_ver()[0]:
subprocess.Popen([ "open", gamedir ])
else:
subprocess.Popen([ "xdg-open", gamedir ])
gamedir = quote(gamedir)
set_tooltip(_(u"Opening game directory:\n%s") % gamedir)
jump top
label edit_script:
python hide:
if not config.editor:
error(_(u"No editor has been selected."))
files = [ project.gamedir + "/" + i for i in os.listdir(project.gamedir) if i.endswith(".rpy") if not i[0] == "."]
files.sort()
for i in files[:]:
if i.endswith("options.rpy"):
files.remove(i)
files.insert(0, i)
for i in files[:]:
if i.endswith("script.rpy"):
files.remove(i)
files.insert(0, i)
if not files:
error(_(u"No files to edit."))
if not renpy.launch_editor(files):
error(_(u"Launching the editor failed."))
set_tooltip(_(u"Launched editor with %d script files.") % len(files))
jump top
label lint:
python hide:
set_tooltip("")
info(_(u"Lint"), _(u"Lint in progress."))
lf = file("lint.txt", "w+")
if hasattr(sys, "winver") and sys.argv[0].lower().endswith(".exe"):
CREATE_NO_WINDOW=0x08000000
proc = subprocess.Popen([config.renpy_base + "/console.exe", "--lint", project.path], stdin=lf, stdout=lf, stderr=lf, creationflags=CREATE_NO_WINDOW)
else:
proc = subprocess.Popen([sys.executable, sys.argv[0], "--lint", project.path], stdout=lf)
proc.wait()
lf.close()
renpy.launch_editor([ "lint.txt" ], transient=1)
return
label call_lint:
call lint
python:
set_tooltip(_(u"Lint complete."))
jump top
label delete_persistent:
python hide:
set_tooltip("")
info(_(u"Delete Persistent"), _(u"Deleting persistent data."))
if hasattr(sys, "winver") and sys.argv[0].lower().endswith(".exe"):
proc = subprocess.Popen([config.renpy_base + "/console.exe", "--rmpersistent", project.path])
else:
proc = subprocess.Popen([sys.executable, sys.argv[0], "--rmpersistent", project.path])
proc.wait()
set_tooltip(_(u"Persistent data has been deleted."))
jump top
-62
View File
@@ -1,62 +0,0 @@
init python:
import os
import subprocess
try:
import EasyDialogs
except ImportError:
try:
import EasyDialogsWin as EasyDialogs
except:
EasyDialogs = None
label choose_projects_directory:
python hide:
set_tooltip("")
info(_(u"Choose Projects Directory"),
_(u"Please choose the directory containing your projects."))
path = persistent.projects_directory
if path is None:
path = os.path.dirname(config.renpy_base)
path = os.environ.get("RENPY_DEFAULT_PROJECTS_DIRECTORY", path)
if EasyDialogs:
choice = EasyDialogs.AskFolder(defaultLocation=path, wanted=str)
if choice is not None:
path = choice
else:
try:
env = os.environ.copy()
if 'RENPY_OLD_LD_LIBRARY_PATH' in env:
env['LD_LIBRARY_PATH'] = env['RENPY_OLD_LD_LIBRARY_PATH']
zen = subprocess.Popen([ "zenity", "--title=Select Projects Directory", "--file-selection", "--directory", "--filename=" + path ],
env=env, stdout=subprocess.PIPE)
choice = zen.stdout.read()
zen.wait()
if choice:
path = choice[:-1]
except:
error(_(u"Could not run zenity. The projects directory has been set to the directory immediately above the directory containing Ren'Py."), None)
persistent.projects_directory = path
choose_default_project()
return
-47
View File
@@ -1,47 +0,0 @@
def k(s):
s = s.replace(" ", "")
s = s.replace(":", "")
s = s.replace("\n", "")
return int(s, 16)
modulus = k("""
00:c2:e6:31:c6:7d:b3:cf:57:12:91:cf:b4:2c:9d:
25:17:cf:21:f8:ac:5b:1d:c1:95:56:9d:1c:1c:d5:
eb:67:ca:0a:a4:3f:e5:9c:6c:10:6e:4a:7a:2c:c2:
d6:e3:3f:84:6d:b1:6f:70:3d:05:4e:06:91:3c:51:
28:3f:b1:26:a5:be:6e:a6:14:a1:09:95:87:10:4d:
c3:4b:44:fd:e0:a6:9d:f8:1f:50:ca:8a:0d:fd:86:
7d:39:74:af:af:4e:05:8b:bd:93:b5:9b:6a:85:ca:
1e:47:25:ca:f1:31:47:10:3e:a2:26:79:d2:00:34:
f4:c5:a8:db:b6:36:2b:70:ef:14:8c:44:41:02:11:
64:31:d4:d8:cd:7b:a7:e1:af:25:2c:a4:31:fb:84:
c7:bc:6e:7c:fb:6a:46:5d:ee:bb:5f:74:96:a1:fe:
13:79:55:e8:c4:74:77:1c:ea:6a:8e:a8:cb:89:da:
20:db:88:18:e5:4a:f9:93:43:03:53:c3:d8:a3:2c:
73:ea:8c:64:55:da:cf:a5:c7:11:70:ce:d4:51:3c:
2c:19:06:3c:23:0c:d6:02:a5:95:28:b7:b0:34:1f:
5d:32:38:e0:01:f2:12:b5:b2:8f:6b:83:83:06:6c:
e0:ca:ec:e5:45:3e:75:79:f4:bf:47:e2:56:cd:8a:
7b:cc:c7:0d:14:af:00:f6:e0:64:e2:30:a3:6c:ed:
05:1e:33:9a:88:8b:0d:31:48:2b:02:65:61:4b:cd:
84:90:c5:83:ba:93:1f:b7:78:7f:ec:4e:e9:bc:02:
03:86:c2:a9:00:87:4c:e1:bb:d8:e7:b2:12:a6:9b:
ab:9f:24:6f:6d:fe:09:60:22:d9:45:c2:20:55:70:
27:9d:3a:84:fb:57:9a:d3:d0:d2:d3:18:25:8c:40:
f8:2c:15:98:de:2e:2d:be:b4:dd:6e:24:2b:07:0b:
21:08:a6:db:30:df:5c:7f:50:6f:be:b7:2e:40:28:
58:85:89:de:4e:c7:66:af:fc:05:1c:c7:4d:d1:d2:
fa:2c:00:1a:0e:47:5f:30:b6:e6:90:fe:99:96:42:
4d:17:d3:13:36:7b:76:1c:36:c6:31:f3:a8:b0:9c:
33:a1:b3:e9:40:51:b9:29:1d:b4:36:2a:20:0e:c0:
f7:fb:a9:db:18:e0:67:ca:5d:d7:46:03:17:32:04:
35:24:5a:fe:0a:1e:7b:96:8b:0a:fb:3c:f6:94:92:
ab:d8:7d:ed:e4:2b:64:d7:ab:8d:11:89:e3:80:9d:
28:59:da:de:6f:55:30:30:78:9a:06:30:5b:a4:ff:
7a:70:49:b6:8c:9a:66:c0:a8:77:74:ca:f5:02:05:
63:8c:83
""")
exponent = 0x10001
-143
View File
@@ -1,143 +0,0 @@
init python:
tutorial_path = config.renpy_base + "/tutorial"
tutorial_exists = os.path.isdir(tutorial_path)
label main_menu:
return
label start:
python:
choose_default_project()
scan_editors()
setup_editor()
jump top
label top:
python:
if game_proc and game_proc.poll() is None:
launch = None
ui.add(ProcessBehavior(game_proc))
else:
launch = ui.jumps("launch")
game_proc = None
screen()
ui.vbox()
ui.viewport(draggable=True, ymaximum=47)
title(project.name.capitalize())
ui.grid(2, 4, transpose=True)
button(_(u"Launch"),
launch,
_(u"Launches the project."))
button(_(u"Edit Script"),
ui.jumps("edit_script"),
_(u"Edits the script of the project."))
button(_(u"Game Directory"),
ui.jumps("game_directory"),
_(u"Opens the project's game directory."))
button(_(u"Check Script (Lint)"),
ui.jumps("call_lint"),
_(u"Checks the script of the project for likely errors."))
button(_(u"Choose Theme"),
ui.jumps("choose_theme"),
_(u"Changes the theme used by the project."))
button(_(u"Delete Persistent"),
ui.jumps("delete_persistent"),
_(u"Deletes the persistent data associated with the project."))
button(_(u"Archive Files"),
ui.jumps("archiver"),
_(u"Archives files found in the game and archived directories."))
button(_(u"Build Distributions"),
ui.jumps("distribute"),
_(u"Builds distributions of the project."))
ui.close()
title(_(u"Ren'Py"))
ui.grid(2, 4, transpose=True)
button(_(u"Select Project"),
ui.jumps("select_project"),
_(u"Select a project to work with."))
button(_(u"New Project"),
ui.jumps("new_project"),
_(u"Create a new project."))
button(_(u"Ren'Py Games List"),
ui.jumps("renpy_games_list"),
_(u"Visit the Ren'Py games list, at http://games.renpy.org."))
button(_(u"Quit"),
ui.jumps("launcher_quit"),
_(u"Causes the launcher to exit."))
button(_(u"Options"),
ui.jumps("options"),
_(u"Change Ren'Py launcher options."))
button(_(u"Ren'Py Help"),
ui.jumps("documentation"),
_(u"Open the Ren'Py documentation in a web browser."))
if tutorial_exists:
button(_(u"Tutorial Game"),
ui.jumps("launch_tutorial"),
_(u"Launches the Ren'Py tutorial game."))
else:
ui.null()
ui.null()
ui.close()
ui.close()
if update_allowed:
ui.key("U", Jump("update"))
interact()
# ProcessBehavior can return True, which sends us here.
jump top
label documentation:
python hide:
import webbrowser
webbrowser.open_new("file:///" + config.renpy_base + "/doc/index.html")
set_tooltip(_(u"Now showing the Ren'Py documentation in your web browser."))
jump top
label renpy_games_list:
python hide:
import webbrowser
webbrowser.open_new("http://games.renpy.org")
set_tooltip(_(u"Now showing the Ren'Py Games List in your web browser."))
jump top
label launcher_quit:
label confirm_quit:
$ renpy.quit()
-3
View File
@@ -1,3 +0,0 @@
init -999:
$ config.script_version = (6, 12, 0)
-217
View File
@@ -1,217 +0,0 @@
init python:
LAUNCHER_RPYS = set(['options.rpy', 'strings.rpy', 'transupdate.rpy', 'choose_theme.rpy', 'archiver.rpy', 'project.rpy', 'script_version.rpy', 'new.rpy', 'updater.rpy', 'themes_data.rpy', 'opts.rpy', 'interface.rpy', 'projectsdir.rpy', 'update_interface.rpy', 'distribute.rpy', 'script.rpy', 'editor.rpy'])
TRANSLATION_STRINGS = [
u"Graphics Acceleration",
u"Automatically Choose",
u"Prefer Software Renderer",
u"Prefer OpenGL Renderer",
u"Continue",
u"Are you sure?",
u"Are you sure you want to delete this save?",
u"Are you sure you want to overwrite your save?",
u"Loading will lose unsaved progress.\nAre you sure you want to do this?",
u"Are you sure you want to quit?",
u"Are you sure you want to return to the main menu?\nThis will lose unsaved progress.",
u"Skip Mode",
u"Fast Skip Mode",
u"Please click to continue.",
u"Start Game",
u"Load Game",
u"Preferences",
u"Help",
u"Quit",
u"Return",
u"Save Game",
u"Main Menu",
u"Begin Skipping",
u"Empty Slot.",
u"Previous",
u"Next",
u"Yes",
u"No",
u"The error message was:",
u"You may want to try saving in a different slot, or playing for a while and trying again later.",
u"Save Failed.",
u"Continue Game",
u"Test",
u"Left",
u"Right",
u"Not Assigned",
u"Up",
u"Down",
u"Select/Dismiss",
u"Joystick Mapping",
u"Move the joystick or press a joystick button to create the mapping. Click the mouse to remove the mapping.",
u"Rollback",
u"Hold to Skip",
u"Toggle Skip",
u"Hide Text",
u"Menu",
u"Display",
u"Window",
u"Fullscreen",
u"Transitions",
u"All",
u"Some",
u"None",
u"Skip",
u"Seen Messages",
u"All Messages",
u"After Choices",
u"Stop Skipping",
u"Keep Skipping",
u"Text Speed",
u"Auto-Forward Time",
u"Music Volume",
u"Sound Volume",
u"Joystick...",
u"Joystick Configuration",
u"Voice Volume",
u"Reload Game (Shift + R)",
u"Variable Viewer",
u"Return to the developer menu",
u"Theme Test",
u"Style Hierarchy",
u"Image Location Picker",
u"Filename List",
u"Done",
u"Auto",
u"Quick",
u"The patterns did not match any files, so no archive was created.",
u"Archiving Files...",
u"Success",
u"The files have been added to the archive, and moved into the \"archived\" directory. Future runs of the archiver will archive files in both the \"game\" and \"archived\" directories.",
u"Archiver",
u"The archiver allows you to obfuscate your game by including files in an archive file.",
u"Archive Name:",
u"The name of the archive to create.",
u"Include Patterns:",
u"Files matching these patterns are included in the archive.",
u"Exclude Patterns:",
u"Files matching these patterns are excluded from the archive.",
u"Archive",
u"Build the archive.",
u"Cancel",
u"Archive Name",
u"The name of the archive file to create, without the .rpa extension.\n\nThe \"data\" archive is loaded automatically. Other archives must be added to config.archives.",
u"Include Patterns",
u"This is a space-separated list of file patterns. Files matching these patterns are added to the archive.\n\nAsterisks (*) can be used as a wildcard.",
u"This is a space-separated list of file patterns. Files matching these patterns are excluded from the archive. If a file is matched by both an exclude and include pattern, the exclude takes precedence.\n\nAsterisks (*) can be used as a wildcard.",
u"Scanning Files...",
u"Could not modify options.rpy. Perhaps it was changed too much.",
u"Theme changed to %s.",
u"Planetarium",
u"The options.rpy file does not exist in the game directory, so this launcher cannot change the theme.",
u"Themes control the basic look of interface elements. You'll be able to pick a color scheme next.",
u"Choose Theme",
u"Please choose a color scheme for your project.",
u"Choose Color Scheme",
u"Base Name",
u"Please enter in the base name for your distribution. This name is used to generate the names of directories and archive files. Usually, this is the name of your game, plus a version number, like \"moonlight-1.0\".",
u"Executable Name",
u"Please enter a name for the executables in your distribution. This should not include an extension, as that will be added automatically.",
u"Ignore Extensions",
u"Please enter a space-separated list of file extensions. Files with these extensions will not be included in the built distributions.",
u"Documentation Extensions",
u"Please enter a space separated list of documentation extensions. Files in the base directory with these extensions will have a second copy stored outside of the Macintosh application.",
u"Thank you for choosing Ren'Py.",
u"The distributions have been built. Be sure to test them before release.\n\nNote that unpacking and repacking the Macintosh, Linux, or Combined distributions on Windows is not supported.\n\nPlease announce your release at the {a=http://lemmasoft.renai.us/forums/}Lemma Soft Forums{/a}, and add it to {a=http://games.renpy.org}games.renpy.org{/a}.",
u"Building Distributions",
u"I've just performed a lint on your project. If it contains errors, you should say no and fix them.\nPlease also check {a=http://www.renpy.org/wiki/renpy/Download_Ren'Py}www.renpy.org{/a} to see if updates or fixes are available.\n\nDo you want to continue?",
u"Base Name:",
u"Used to generate the names of directories and archive files.",
u"Executable Name:",
u"Used to generate the names of executables and runnable programs.",
u"Ignore Extensions:",
u"Files with these extensions will not be included in the distributions.",
u"Documentation Extensions:",
u"Files with these extensions will be treated as documentation, when building the Macintosh application.",
u"Distributions to Build:",
u"Windows x86",
u"Zip distribution for the 32-bit Windows platform.",
u"Linux x86",
u"Tar.Bz2 distribution for the Linux x86 platform.",
u"Macintosh Universal",
u"Single application distribution for the Macintosh x86 and ppc platforms.",
u"Windows/Linux/Mac Combined",
u"Zip distribution for the Windows x86, Linux x86, Macintosh x86 and Macintosh ppc platforms.",
u"Build",
u"Start building the distributions.",
u"The editor has been set from the RENPY_EDITOR environment variable, and cannot be changed.",
u"Choose Editor",
u"Please choose the editor that will be use to edit scripts and display errors. More editors can be downloaded from {a=http://www.renpy.org/wiki/renpy/Editors}the Ren'Py website{/a}.",
u"Error",
u"Press enter when done.",
u"The string cannot be empty. Please enter some text.",
u"Non-ASCII filenames are not allowed. This is because Zip files cannot reliably represent non-ASCII filenames.",
u"Processed %d of %d files.",
u"Welcome!",
u"New Project",
u"Please type the name of your new project.",
u"Something with that name already exists in the projects directory.",
u"Creating Project",
u"Please wait while we create the project.",
u"Could not create the project directory. The error was: %s",
u"%s Launcher",
u"Launcher Options",
u"Using RENPY_EDITOR",
u"Change the default text editor.",
u"Projects Directory",
u"Select the directory Ren'Py searches for projects.",
u"Select Project",
u"Tutorial game has been launched.",
u"%s has been launched.",
u"Opening game directory:\n%s",
u"No editor has been selected.",
u"No files to edit.",
u"Launching the editor failed.",
u"Launched editor with %d script files.",
u"Lint",
u"Lint in progress.",
u"Lint complete.",
u"Deleting persistent data.",
u"Delete Persistent",
u"Persistent data has been deleted.",
u"Choose Projects Directory",
u"Please choose the directory containing your projects.",
u"Could not run zenity. The projects directory has been set to the directory immediately above the directory containing Ren'Py.",
u"Tutorial Game",
u"Launches the Ren'Py tutorial game.",
u"Update Ren'Py",
u"Updates Ren'Py to the latest version.",
u"Now showing the Ren'Py documentation in your web browser.",
u"Now showing the Ren'Py Games List in your web browser.",
u"Launch",
u"Launches the project.",
u"Edit Script",
u"Edits the script of the project.",
u"Game Directory",
u"Opens the project's game directory.",
u"Check Script (Lint)",
u"Checks the script of the project for likely errors.",
u"Changes the theme used by the project.",
u"Deletes the persistent data associated with the project.",
u"Archive Files",
u"Archives files found in the game and archived directories.",
u"Build Distributions",
u"Builds distributions of the project.",
u"Ren'Py",
u"Select a project to work with.",
u"Create a new project.",
u"Ren'Py Games List",
u"Visit the Ren'Py games list, at http://games.renpy.org.",
u"Causes the launcher to exit.",
u"Options",
u"Change Ren'Py launcher options.",
u"Ren'Py Help",
u"Open the Ren'Py documentation in a web browser.",
u"Retrieving catalog",
u"Checking files",
u"Making directories.",
u"Downloading updated files",
u"Renaming files",
u"Fixing permissions.",
]
-292
View File
@@ -1,292 +0,0 @@
init 1 python:
# This is a list of (theme name, theme function, theme exemplar) tuples.
themes = [
("Roundrect", "roundrect", "Basic Blue"),
("Bordered", "bordered", "Dramatic Flesh"),
("Diamond", "diamond", "Colorblind"),
("TV", "tv", "Fine China"),
("Glow", "glow", "Really Red"),
]
# This is a map from theme function to template text that sensibly calls
# that function.
theme_templates = { }
theme_templates["roundrect"] = """\
theme.roundrect(
# Color scheme: %(name)s
## The color of an idle widget face.
widget = "%(widget)s",
## The color of a focused widget face.
widget_hover = "%(widget_hover)s",
## The color of the text in a widget.
widget_text = "%(widget_text)s",
## The color of the text in a selected widget. (For
## example, the current value of a preference.)
widget_selected = "%(widget_selected)s",
## The color of a disabled widget face.
disabled = "%(disabled)s",
## The color of disabled widget text.
disabled_text = "%(disabled_text)s",
## The color of informational labels.
label = "%(label)s",
## The color of a frame containing widgets.
frame = "%(frame)s",
## The background of the main menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
mm_root = "%(mm_root)s",
## The background of the game menu. This can be a color
## beginning with '#', or an image filename. The latter
## should take up the full height and width of the screen.
gm_root = "%(gm_root)s",
## If this is True, the in-game window is rounded. If False,
## the in-game window is square.
rounded_window = False,
## And we're done with the theme. The theme will customize
## various styles, so if we want to change them, we should
## do so below.
)"""
theme_templates["bordered"] = theme_templates["roundrect"].replace("roundrect", "bordered")
theme_templates["diamond"] = theme_templates["roundrect"].replace("roundrect", "diamond")
theme_templates["tv"] = theme_templates["roundrect"].replace("roundrect", "tv")
theme_templates["glow"] = theme_templates["roundrect"].replace("roundrect", "glow")
# This is a map from theme name to the code needed to implement that
# theme.
theme_data = {
'Basic Blue': {'disabled': '#404040',
'disabled_text': '#c8c8c8',
'frame': '#6496c8',
'gm_root': '#dcebff',
'label': '#ffffff',
'mm_root': '#dcebff',
'widget': '#003c78',
'widget_hover': '#0050a0',
'widget_selected': '#ffffc8',
'widget_text': '#c8ffff'},
'Bloody Mary': {'disabled': '#400000',
'disabled_text': '#260000',
'frame': '#400808',
'gm_root': '#000000',
'label': '#ffffff',
'mm_root': '#000000',
'widget': '#000000',
'widget_hover': '#830000',
'widget_selected': '#ffffff',
'widget_text': '#C2C2C2'},
'Colorblind': {'disabled': '#898989',
'disabled_text': '#666666',
'frame': '#252525',
'gm_root': '#393939',
'label': '#c2c2c2',
'mm_root': '#393939',
'widget': '#898989',
'widget_hover': '#464646',
'widget_selected': '#F2F2F2',
'widget_text': '#CCCCCC'},
'Cotton Candy': {'disabled': '#C8AFA1',
'disabled_text': '#E1D4C9',
'frame': '#FCF5F2',
'gm_root': '#D0B4BA',
'label': '#805C40',
'mm_root': '#D0B4BA',
'widget': '#ECC7D0',
'widget_hover': '#E1D4C9',
'widget_selected': '#805C40',
'widget_text': '#805C40'},
'Creamsicle': {'disabled': '#FFECBF',
'disabled_text': '#ffffff',
'frame': '#FFECBF',
'gm_root': '#FDF5E3',
'label': '#502F13',
'mm_root': '#FDF5E3',
'widget': '#D96B00',
'widget_hover': '#FD9B1C',
'widget_selected': '#ffffff',
'widget_text': '#FCE6B1'},
'Dramatic Flesh': {'disabled': '#ab6038',
'disabled_text': '#BF7C51',
'frame': '#49271b',
'gm_root': '#2a201f',
'label': '#ffffff',
'mm_root': '#2a201f',
'widget': '#BF7C51',
'widget_hover': '#dda570',
'widget_selected': '#ffffff',
'widget_text': '#E5DFDF'},
'Easter Baby': {'disabled': '#DDE9FF',
'disabled_text': '#A6AFBF',
'frame': '#CCF8DC',
'gm_root': '#FBF9DF',
'label': '#698071',
'mm_root': '#FBF9DF',
'widget': '#F5D4EE',
'widget_hover': '#F0DDFF',
'widget_selected': '#000000',
'widget_text': '#698071'},
'Favorite Jeans': {'disabled': '#919994',
'disabled_text': '#B6BFB9',
'frame': '#6f7571',
'gm_root': '#b0b8ba',
'label': '#ffffff',
'mm_root': '#b0b8ba',
'widget': '#8699a7',
'widget_hover': '#9eb1ad',
'widget_selected': '#ffffff',
'widget_text': '#dcdfd6'},
'Fine China': {'disabled': '#ADB9CC',
'disabled_text': '#DFBA14',
'frame': '#ADB9CC',
'gm_root': '#F7F7FA',
'label': '#39435E',
'mm_root': '#F7F7FA',
'widget': '#6A7183',
'widget_hover': '#1A2B47',
'widget_selected': '#E3E3E4',
'widget_text': '#C9C9CB'},
'First Valentines': {'disabled': '#F8F2D0',
'disabled_text': '#BFA1A1',
'frame': '#F8F2D0',
'gm_root': '#D98989',
'label': '#5D1010',
'mm_root': '#D98989',
'widget': '#F09898',
'widget_hover': '#D6C5BB',
'widget_selected': '#B31E1E',
'widget_text': '#593131'},
'Ice Queen': {'disabled': '#F0F2F2',
'disabled_text': '#FBFBFB',
'frame': '#ffffff',
'gm_root': '#E6E6E6',
'label': '#D9D9D9',
'mm_root': '#E6E6E6',
'widget': '#D9D9D9',
'widget_hover': '#F0F2F2',
'widget_selected': '#737373',
'widget_text': '#ffffff'},
'Mocha Latte': {'disabled': '#614D3A',
'disabled_text': '#80654D',
'frame': '#926841',
'gm_root': '#1A140E',
'label': '#F1EBE5',
'mm_root': '#1A140E',
'widget': '#4D3B29',
'widget_hover': '#996E45',
'widget_selected': '#ffffff',
'widget_text': '#B99D83'},
'Muted Horror': {'disabled': '#73735C',
'disabled_text': '#8C8C70',
'frame': '#555544',
'gm_root': '#1A0001',
'label': '#1A0001',
'mm_root': '#1A0001',
'widget': '#777777',
'widget_hover': '#73735C',
'widget_selected': '#000000',
'widget_text': '#404033'},
'Old Polaroid': {'disabled': '#A89E7D',
'disabled_text': '#CCC097',
'frame': '#49403E',
'gm_root': '#A84A3E',
'label': '#ffffff',
'mm_root': '#A84A3E',
'widget': '#A89E7D',
'widget_hover': '#8DB6B9',
'widget_selected': '#ffffff',
'widget_text': '#49403E'},
'Really Red': {'disabled': '#404040',
'disabled_text': '#c8c8c8',
'frame': '#e17373',
'gm_root': '#ffd0d0',
'label': '#ffffff',
'mm_root': '#ffd0d0',
'widget': '#963232',
'widget_hover': '#c83232',
'widget_selected': '#ffffc8',
'widget_text': '#ffffff'},
'Summer Sky': {'disabled': '#6074BF',
'disabled_text': '#7383BF',
'frame': '#6074BF',
'gm_root': '#B4CDD4',
'label': '#94C7D4',
'mm_root': '#B4CDD4',
'widget': '#F2E6AA',
'widget_hover': '#FCFCA4',
'widget_selected': '#1A5766',
'widget_text': '#7DA8B3'},
'Swamp Critter': {'disabled': '#A2521D',
'disabled_text': '#753D00',
'frame': '#797C1C',
'gm_root': '#B09D5A',
'label': '#ffffff',
'mm_root': '#B09B4F',
'widget': '#753D00',
'widget_hover': '#B19A48',
'widget_selected': '#ffffff',
'widget_text': '#CCCAC2'},
'Urban Sprawl': {'disabled': '#8F0000',
'disabled_text': '#333333',
'frame': '#8F0000',
'gm_root': '#000000',
'label': '#ffffff',
'mm_root': '#000000',
'widget': '#333333',
'widget_hover': '#000000',
'widget_selected': '#ffffff',
'widget_text': '#6C8A2F'},
'Victorian Gingerbread': {'disabled': '#7A674F',
'disabled_text': '#664F33',
'frame': '#BF8A73',
'gm_root': '#695640',
'label': '#F2EDC4',
'mm_root': '#695640',
'widget': '#7A674F',
'widget_hover': '#BDA77D',
'widget_selected': '#FDFBEE',
'widget_text': '#F2EDC4'},
'Watermelon Pie': {'disabled': '#FABF46',
'disabled_text': '#FFE06D',
'frame': '#C3CD91',
'gm_root': '#F7F7C5',
'label': '#FCFCD7',
'mm_root': '#F7F7C5',
'widget': '#FFE06D',
'widget_hover': '#E38A4F',
'widget_selected': '#996600',
'widget_text': '#FAA700'},
'White Chocolate': {'disabled': '#614D3A',
'disabled_text': '#80654D',
'frame': '#926841',
'gm_root': '#FBF9EA',
'label': '#F1EBE5',
'mm_root': '#FBF9EA',
'widget': '#33271C',
'widget_hover': '#ECE7C4',
'widget_selected': '#ffffff',
'widget_text': '#B99D83'},
'Winter Mint': {'disabled': '#426143',
'disabled_text': '#819981',
'frame': '#245536',
'gm_root': '#e5f1e5',
'label': '#ffffff',
'mm_root': '#e5f1e5',
'widget': '#7AA27B',
'widget_hover': '#A3C7A3',
'widget_selected': '#ffffff',
'widget_text': '#CDE0CE'}}
-62
View File
@@ -1,62 +0,0 @@
# This file contains code for updating translations. Basically, it will
# search for a non-default file in launcher, and if that file exists, it
# will append missing translations to it.
init python:
import os
import os.path
import traceback
import codecs
def update_translations():
# Find the first file in the launcher directory that was
# not distributed with Ren'Py.
for fn in sorted(os.listdir(config.gamedir)):
if not fn.endswith(".rpy"):
continue
if fn in LAUNCHER_RPYS:
continue
break
else:
return
# Find untranslated strings.
new_translations = [ ]
for t in TRANSLATION_STRINGS:
if t not in config.translations:
new_translations.append(t)
if not new_translations:
return
# Add a block to the file with the untranslated strings.
f = codecs.open(os.path.join(config.gamedir, fn), "a", "utf-8")
print >>f
print >>f, "# New translations for", renpy.version()
print >>f, "init -1 python hide:"
print >>f, " config.translations.update({"
for t in new_translations:
print >>f
print >>f, " %r" % t
print >>f, " : %r," % t
print >>f
print >>f, " })"
f.close()
init 100 python hide:
try:
update_translations()
except:
traceback.print_exc()
-58
View File
@@ -1,58 +0,0 @@
# This is an early version of an interface for the updater. For now, we just
# assume that the user wants to update the prerelease channel, and the
# base tag.
init python:
import os
import time
version_fn = os.path.join(config.basedir, "lib", "update-version.txt")
update_allowed = os.path.exists(version_fn)
label update:
python hide:
try:
info("Checking for update...", "")
old_version = file(version_fn, "rb").read()
updater = Updater(config.basedir, 'http://update.renpy.org/renpy/updates/prerelease', [ 'base' ])
# Check the version.
version, verbose_version = updater.check_version(old_version)
if version is None:
pauseinfo("Up To Date", "Your version of Ren'Py is up to date.")
renpy.jump("top")
if not yesno("Update Available", "Would you like to update to %s?" % verbose_version):
renpy.jump("top")
# If we've made it this far, the user has decided that he wants
# to try an update.
for what, amount, limit in updater.step():
progress(what, limit, amount)
f = file(version_fn, "wb")
f.write(version)
f.close()
pauseinfo("Update complete.", "The update has finished. Ren'Py will now restart.")
if sys.platform == "win32" and sys.argv[0].lower().endswith(".exe"):
proc = subprocess.Popen([sys.argv[0], config.basedir])
else:
proc = subprocess.Popen([sys.executable, sys.argv[0], config.basedir])
renpy.quit()
except UpdateException, e:
error('The update has failed, with the error message: %s' % e.args[0])
-328
View File
@@ -1,328 +0,0 @@
init python:
import urllib2
import bz2
import os
import hashlib
import public
class UpdateException(Exception):
"""
The exception that we return if the update fails.
"""
pass
class Updater(object):
"""
A class that attempts to update a tree of files, with a reasonable
degree of safety, security, speed, and progress reporting.
"""
def __init__(self, local, remote, tags):
"""
Create a new updater.
`local`
The name of the local directory where the files are stored.
`remote`
The remote url base.
`tags`
A list of tags to update.
"""
self.local = local
self.remote = remote
# The remote version we're upgrading to.
self.version = None
# A list of directory names.
self.directories = [ ]
# A list of file, bz2-size, adler32 tuples.
self.files = [ ]
# Xbit files.
self.xbit = [ ]
# The tags we use.
self.tags = set(tags)
def snarf(self, url):
"""
Gets the url as a string.
"""
url = self.remote + "/" + url
try:
u = urllib2.urlopen(url, None, 5)
return u.read()
except Exception, e:
raise UpdateException("Could not download %r: %r" % (url, e))
def retrieve(self, relative):
"""
Downloads the bz2-compressed file, and then decompresses it into
relative.new.
"""
bz = os.path.join(self.local, relative + ".new.bz2")
new = os.path.join(self.local, relative + ".new")
url = self.remote + "/" + relative + ".bz2"
try:
u = urllib2.urlopen(url, None, 5)
f = file(bz, "wb")
f.write(u.read())
f.close()
u.close()
bzf = bz2.BZ2File(bz, "rb")
f = file(new, "wb")
while True:
buf = bzf.read(1024 * 1024)
if not buf:
break
f.write(buf)
f.close()
bzf.close()
os.unlink(bz)
except Exception, e:
raise UpdateException("Could not download %r: %r" % (url, e))
def check_version(self, version):
"""
Checks to see if version is still up to date. Returns a new-version,
verbose-version string. new-version is an internal representation
of the version being downloaded, while verbose-version is a
string that can be presented to the user.
The `version` argument should be given the new-version returned
from the last successful update. new-version is None if we are
up to date.
"""
remote_version = self.snarf("version")
self.version, verbose_version = remote_version.split("\n", 1)
self.version += " " + " ".join(sorted(self.tags))
if self.version.strip() == version.strip():
return None, verbose_version
else:
return self.version, verbose_version
def verify_hash(self, relative, digest):
"""
Verifies that the file `relative` has the hash value `digest`.
"""
fn = os.path.join(self.local, relative)
if not os.path.exists(fn):
return False
hash = hashlib.sha256()
try:
f = file(fn, "rb")
while True:
data = f.read(1024 * 1024)
if not data:
break
if not "renpy.app" in fn:
if fn.endswith(".rpy") or fn.endswith(".rpym") or fn.endswith(".py") or fn.endswith(".txt"):
data = data.replace("\n", "\r\n")
data = data.replace("\r\r\n", "\r\n")
hash.update(data)
f.close()
except:
return False
return hash.hexdigest() == digest
def get_catalog(self):
"""
Downloads the catalog file from the server, checking the signature
as necessary.
"""
self.retrieve("catalog1")
catalog_fn = os.path.join(self.local, "catalog1.new")
verified = False
try:
hash = hashlib.sha256()
f = file(catalog_fn, "rb")
# Read control information.
for l in f:
if l[0] == "-":
break
hash.update(l)
l = l[:-1]
a = l.split("\t")
if a[0] == "file":
cmd, digest, size, tag, name = a
if tag in self.tags:
self.files.append((name, digest, int(size)))
elif a[0] == "dir":
cmd, tag, name = a
if tag in self.tags:
self.directories.append(name)
elif a[0] == "xbit":
cmd, name = a
self.xbit.append(name)
else:
raise UpdateException("Unknown upgrade command: %r" % l)
# Compute the unsigned message.
unsigned = int("01" + hash.hexdigest(), 16)
for l in f:
a = l[:-1].split("\t")
if a[0] != "signature":
continue
signature = int(a[1], 16)
if pow(signature, public.exponent, public.modulus) == unsigned:
verified = True
f.close()
os.unlink(catalog_fn)
except UpdateException:
raise
except Exception, e:
raise UpdateException("Could not download catalog: %r" % (e,))
if not verified:
raise UpdateException("Could not verify catalog signature.")
def step(self):
"""
This is a generator that performs the steps in the update
process. It yields a (message, complete, total) tuple for
each step, and terminates upon success.
"""
yield (u"Retrieving catalog", 0, 1)
self.get_catalog()
updated_files = [ ]
download_size = 0
for i, (name, hash, size) in enumerate(self.files):
yield (u"Checking files", i, len(self.files))
if not self.verify_hash(name, hash):
updated_files.append((name, hash, size))
download_size += size
complete_size = 0
# Todo: Make directories.
for i, dir in enumerate(self.directories):
yield (u"Making directories", i, len(self.directories))
dir = os.path.join(self.local, dir)
if not os.path.exists(dir):
try:
os.mkdir(dir)
except:
raise UpdateException("Couldn't make directory %r." % dir)
complete = 0
for name, hash, size in updated_files:
yield (u"Downloading updated files", complete, len(updated_files))
if self.verify_hash(name + ".new", hash):
complete_size += size
continue
self.retrieve(name)
if not self.verify_hash(name + ".new", hash):
raise UpdateException("Could not verify download of %r." % name)
complete_size += size
complete += 1
umask = os.umask(0)
os.umask(umask)
for i, (name, hash, size) in enumerate(updated_files):
yield (u"Renaming files", i, len(updated_files))
fn = os.path.join(self.local, name)
if os.path.exists(fn + ".old"):
os.unlink(fn + ".old")
if os.path.exists(fn):
os.rename(fn, fn + ".old")
os.rename(fn + ".new", fn)
if fn.endswith(".py") and os.path.exists(fn + 'o'):
os.unlink(fn + 'o')
for i, name in enumerate(self.xbit):
yield (u"Fixing permissions", i, len(self.xbit))
fn = os.path.join(self.local, name)
if os.path.exists(fn):
os.chmod(fn, 0777 & (~umask))
# if __name__ == "__main__":
# up = Updater("/tmp/renpy-1", "file:///tmp/renpy-6.11.0", [ "base" ])
# version, verbose_version = up.check_version(1)
# for message, done, total in up.step():
# print message, "(%d/%d)" % (done, total)
# print version
# print verbose_version
-96
View File
@@ -1,96 +0,0 @@
#!/usr/bin/env python
import sys
sys.path.append('/home/tom/ab/keys/')
import os
import bz2
import hashlib
import public
import private
import shutil
def sha(s):
"""
Hashes s into a string.
"""
hash = hashlib.sha256()
hash.update(s)
return hash.hexdigest()
def make_update(root, version):
# A list of command strings.
commands = [ ]
for dir, dirs, files in os.walk(root):
for fn in files:
fn = os.path.join(dir, fn)
oldf = file(fn, "rb")
bzf = bz2.BZ2File(fn + ".bz2", "wb")
bzf.write(oldf.read())
bzf.close()
oldf.close()
shutil.copymode(fn, fn + ".bz2")
os.unlink(fn)
for dir, dirs, files in os.walk(root):
for fn in dirs + files:
path = os.path.join(dir, fn)
relpath = os.path.relpath(path, root)
if relpath in [ "version", "catalog1.bz2" ]:
continue
if os.path.isdir(path):
commands.append(('dir', "base", relpath))
elif relpath.endswith(".rpyc.bz2"):
continue
elif relpath.endswith(".rpymc.bz2"):
continue
elif relpath.endswith(".rpyb.bz2"):
continue
elif relpath.endswith(".pyo.bz2"):
continue
elif relpath.endswith(".bz2"):
hash = sha(bz2.BZ2File(path, "r").read())
size = "%d" % (os.path.getsize(path))
commands.append(('file', hash, size, "base", relpath[:-4]))
if os.access(path, os.X_OK):
commands.append(('xbit', relpath[:-4]))
out = bz2.BZ2File(os.path.join(root, "catalog1.bz2"), "w")
hash = hashlib.sha256()
for i in commands:
line = "\t".join(i) + "\n"
hash.update(line)
out.write(line)
unsigned = int("01" + hash.hexdigest(), 16)
signed = pow(unsigned, private.exponent, public.modulus)
out.write("-\n")
out.write("signature\t%x\n" % signed)
out.close()
f = file(os.path.join(root, "version"), "w")
f.write(version)
f.write("\n")
f.write("the latest Ren'Py pre-release")
f.close()
+6 -1
View File
@@ -28,8 +28,13 @@
#include <SDL/SDL.h>
#include <SDL/SDL_byteorder.h>
#include <png.h>
#include <zlib.h>
#include "IMG_savepng.h"
#ifndef png_voidp
#define png_voidp voidp
#endif
int IMG_SavePNG(const char *file, SDL_Surface *surf,int compression){
SDL_RWops *fp;
int ret;
@@ -84,7 +89,7 @@ int IMG_SavePNG_RW(SDL_RWops *src, SDL_Surface *surf,int compression){
goto savedone;
}
/* setup custom writer functions */
png_set_write_fn(png_ptr,(voidp)src,png_write_data,NULL);
png_set_write_fn(png_ptr,(png_voidp)src,png_write_data,NULL);
if (setjmp(png_jmpbuf(png_ptr))){
SDL_SetError("Unknown error writing PNG");
+25270
View File
File diff suppressed because it is too large Load Diff
-11
View File
@@ -1,11 +0,0 @@
# This makefile should work on Linux, and might work on other unix-like
# platforms as well. It probably won't work on Mac OS X, however.
build:: _renpy.c sound.c nativemidi.c winmixer.c
clean:
-rm *.so pysdlsound/*.so
-rm -Rf build
%.c : %.pyx
pyrexc $+
+10 -5
View File
@@ -1,5 +1,5 @@
# -*- python -*-
# Copyright 2004-2011 Tom Rothamel <pytom@bishoujo.us>
# Copyright 2004-2012 Tom Rothamel <pytom@bishoujo.us>
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
@@ -23,13 +23,16 @@
def version():
return (6, 12, 0)
cdef extern from "renpy.h":
cdef extern from "pygame/pygame.h":
cdef struct SDL_RWops:
pass
void import_pygame_rwobject()
SDL_RWops* RWopsFromPython(object obj)
cdef extern from "renpy.h":
void core_init()
void save_png_core(object, SDL_RWops *, int)
@@ -136,7 +139,7 @@ def pixellate(pysrc, pydst, avgwidth, avgheight, outwidth, outheight):
# and alpha. Instead, they are the first through fourth byte of data.
# The mapping between byte and color/alpha varies from system to
# system, and needs to be determined at a higher level.
def map(pysrc, pydst, r, g, b, a):
def map(pysrc, pydst, r, g, b, a): # @ReservedAssignment
if not isinstance(pysrc, PygameSurface):
raise Exception("map requires a pygame Surface as its first argument.")
@@ -421,5 +424,7 @@ def subpixel(pysrc, pydst, xoffset, yoffset, shift):
# Be sure to update scale.py when adding something new here!
import_pygame_rwobject()
core_init()

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